KeePass Help Center KeePass Home | Downloads | Translations | Plugins | Donate 
Help Center Home | Forums | Awards | Links 







IKpUtilities.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008-2024 Dominik Reichl
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions
7  are met:
8 
9  * Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11  * Redistributions in binary form must reproduce the above copyright
12  notice, this list of conditions and the following disclaimer in
13  the documentation and/or other materials provided with the
14  distribution.
15 
16  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
19  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
20  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  POSSIBILITY OF SUCH DAMAGE.
28 */
29 
30 #ifndef ___IKPUTILITIES_H___
31 #define ___IKPUTILITIES_H___
32 
33 #pragma once
34 
35 #include "../../SysDefEx.h"
36 #include "IKpUnknown.h"
37 
38 #pragma pack(1)
39 
43 struct KP_DECL_INTERFACE("9700114E-9178-4337-A26F-34A6DA91FBB4") IKpUtilities :
44  public IKpUnknown
45 {
46 public:
47  STDMETHOD(ShowFileDialog)(BOOL bOpenMode, LPCTSTR lpSuffix, LPTSTR lpStoreBuf,
48  DWORD dwBufLen) = 0;
49 
51  STDMETHOD_(char*, UnicodeToMultiByte)(const WCHAR* lpwString) = 0;
53  STDMETHOD_(WCHAR*, MultiByteToUnicode)(const char* lpString) = 0;
54 
56  STDMETHOD_(UTF8_BYTE*, StringToUTF8)(LPCTSTR lpSourceString) = 0;
57  STDMETHOD_(DWORD, UTF8NumChars)(const UTF8_BYTE* pUTF8String) = 0;
58  STDMETHOD_(DWORD, UTF8BytesNeeded)(LPCTSTR lpString) = 0;
60  STDMETHOD_(LPTSTR, UTF8ToString)(const UTF8_BYTE* pUTF8String) = 0;
61  STDMETHOD_(BOOL, IsUTF8String)(const UTF8_BYTE* pUTF8String) = 0;
62 
63  STDMETHOD(UuidToString)(const BYTE* pUuid, LPTSTR lpOutBuf) = 0;
64  STDMETHOD(StringToUuid)(LPCTSTR lpSource, BYTE* pUuid) = 0;
65 
66  STDMETHOD_(INT, ShellOpenLocalFile)(LPCTSTR lpFile, INT nMode) = 0;
67  STDMETHOD(OpenUrl)(LPCTSTR lpURL, HWND hParent) = 0;
68  STDMETHOD(OpenAppHelp)(LPCTSTR lpTopicFile) = 0;
69 
70  STDMETHOD(Base64Encode)(const BYTE* pbIn, DWORD cbInLen, BYTE* pbOut, DWORD* pcbOutLen) = 0;
71  STDMETHOD(Base64Decode)(const BYTE* pbIn, DWORD cbInLen, BYTE* pbOut, DWORD* pcbOutLen) = 0;
72 
73  STDMETHOD(GetApplicationDirectory)(LPTSTR lpStoreBuf, DWORD dwBufLen,
74  BOOL bFilterSpecial, BOOL bMakeURL) = 0;
75 
77  STDMETHOD_(LPTSTR, MakeRelativePath)(LPCTSTR lpBaseFile, LPCTSTR lpTargetFile) = 0;
78 
80  STDMETHOD_(LPTSTR, GetShortestAbsolutePath)(LPCTSTR lpFilePath) = 0;
81 
82  STDMETHOD_(BOOL, IsAbsolutePath)(LPCTSTR lpPath) = 0;
83 
96  STDMETHOD_(BOOL, ValidatePath)(LPCTSTR lpPath, DWORD dwOptions) = 0;
97 
99  STDMETHOD_(LPTSTR, GetQuotedPath)(LPCTSTR lpPath) = 0;
100 
106  STDMETHOD(CreateDirectoryTree)(LPCTSTR lpDirPath, DWORD dwOptions) = 0;
107 
110  STDMETHOD(FlushStorageBuffers)(LPCTSTR lpFileOnStorage, BOOL bOnlyIfRemovable) = 0;
111 
113  STDMETHOD(SecureDeleteFile)(LPCTSTR lpFilePath) = 0;
114 
115  STDMETHOD(WriteFile)(LPCTSTR lpFilePath, const BYTE* pData, DWORD dwDataSize) = 0;
116 
117  STDMETHOD_(INT, CompareTimes)(const PW_TIME* pTime1, const PW_TIME* pTime2) = 0;
118 
119  STDMETHOD_(DWORD, EstimatePasswordBits)(LPCTSTR lpPassword) = 0;
120 
121  STDMETHOD_(BOOL, IsTANEntry)(const PW_ENTRY* pEntry) = 0;
122 
123  STDMETHOD(HashFileSHA256)(LPCTSTR lpFile, BYTE* pHashBuf) = 0;
124 
132  STDMETHOD(SHA256CreateContext)(void** pOutNewContext) = 0;
133 
139  STDMETHOD(SHA256Init)(void* pContext) = 0;
140 
147  STDMETHOD(SHA256Hash)(void* pContext, const BYTE* pData, DWORD dwDataLength) = 0;
148 
155  STDMETHOD(SHA256Final)(void* pContext, BYTE* pOutHashBuf) = 0;
156 
163  STDMETHOD(EncryptMemory)(BYTE* pbBuf, DWORD dwBufLen, const BYTE* pbKey, DWORD dwKeyLen) = 0;
164 
167  STDMETHOD(DecryptMemory)(BYTE* pbBuf, DWORD dwBufLen, const BYTE* pbKey, DWORD dwKeyLen) = 0;
168 };
169 
170 #pragma pack()
171 
172 #endif // ___IKPUTILITIES_H___
#define UTF8_BYTE
Definition: SysDefEx.h:88
Base interface from which all other interfaces must derive.
Definition: IKpUnknown.h:41
Interface to an object providing various utility methods.
Definition: IKpUtilities.h:43

Documentation generated with Doxygen.





Get KeePass