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







PwStructs.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 ___PW_STRUCTS_H___
31 #define ___PW_STRUCTS_H___
32 
33 #pragma once
34 
35 #include "SysDefEx.h"
36 // #include <string>
37 // #include <vector>
38 
39 #pragma pack(1)
40 
42 typedef struct _PW_TIME
43 {
44  USHORT shYear;
45  BYTE btMonth;
46  BYTE btDay;
47  BYTE btHour;
48  BYTE btMinute;
49  BYTE btSecond;
50 
51 #ifdef VPF_ALIGN
52  BYTE btDummy;
53 #endif
54 } PW_TIME, *PPW_TIME;
55 
57 typedef struct _PW_DBHEADER
58 {
59  DWORD dwSignature1;
60  DWORD dwSignature2;
61  DWORD dwFlags;
62  DWORD dwVersion;
63 
64  BYTE aMasterSeed[16];
65  UINT8 aEncryptionIV[16];
66 
67  DWORD dwGroups;
68  DWORD dwEntries;
69 
70  BYTE aContentsHash[32];
71 
72  BYTE aMasterSeed2[32];
74 } PW_DBHEADER, *PPW_DBHEADER;
75 
77 typedef struct _PW_GROUP
78 {
79  DWORD uGroupId;
80  DWORD uImageId;
81  TCHAR *pszGroupName;
82 
83  PW_TIME tCreation;
84  PW_TIME tLastMod;
85  PW_TIME tLastAccess;
86  PW_TIME tExpire;
87 
88  USHORT usLevel;
89 
90 #ifdef VPF_ALIGN
91  USHORT usDummy;
92 #endif
93 
94  DWORD dwFlags;
95 } PW_GROUP, *PPW_GROUP;
96 
98 typedef struct _PW_ENTRY
99 {
100  BYTE uuid[16];
101  DWORD uGroupId;
102  DWORD uImageId;
103 
104  TCHAR *pszTitle;
105  TCHAR *pszURL;
106  TCHAR *pszUserName;
107 
108  DWORD uPasswordLen;
109  TCHAR *pszPassword;
110 
111  TCHAR *pszAdditional;
112 
113  PW_TIME tCreation;
114  PW_TIME tLastMod;
115  PW_TIME tLastAccess;
116  PW_TIME tExpire;
117 
118  TCHAR *pszBinaryDesc;
119  BYTE *pBinaryData;
121 } PW_ENTRY, *PPW_ENTRY;
122 
124 typedef struct _PW_UUID_STRUCT
125 {
126  BYTE uuid[16];
127 } PW_UUID_STRUCT;
128 
130 typedef struct _PWDB_REPAIR_INFO
131 {
135 } PWDB_REPAIR_INFO, *PPWDB_REPAIR_INFO;
136 
138 typedef struct
139 {
147  DWORD dwFlags; // KPMIF_XXX flags
148 
151  DWORD dwState; // KPMIS_XXX flags
152 
153  DWORD dwIcon;
155  DWORD dwCommandID;
156 
157  DWORD_PTR dwReserved;
158 } KP_MENU_ITEM;
159 
161 typedef struct
162 {
163  const void* pOriginalEntry;
164 
165  BYTE uuid[16];
166 
169  DWORD uGroupIndex;
170 
171  DWORD uImageId;
172 
173  LPCTSTR lpTitle;
174  LPCTSTR lpURL;
175  LPCTSTR lpUserName;
176  LPCTSTR lpPassword;
177  LPCTSTR lpAdditional;
178 
179  DWORD_PTR dwReserved;
180 } KP_ENTRY, *PKP_ENTRY;
181 // CPwUtil::FreeKpEntry
182 
183 #pragma pack()
184 
185 /* /// Entry structure, containing information about one entry.
186 typedef struct _PW_ENTRY_STL
187 {
188  BYTE uuid[16]; ///< Unique GUID identifying this entry (not only in this database).
189  DWORD uGroupId; ///< ID of the group that contains this entry.
190  DWORD uImageId; ///< Index of the icon in the image list to use for this entry.
191 
192  std::basic_string<TCHAR> strTitle; ///< Title.
193  std::basic_string<TCHAR> strURL; ///< URL.
194  std::basic_string<TCHAR> strUserName; ///< User name.
195  std::basic_string<TCHAR> strPassword; ///< Password.
196  std::basic_string<TCHAR> strAdditional; ///< Notes.
197 
198  PW_TIME tCreation; ///< Time when the entry was created.
199  PW_TIME tLastMod; ///< Time when the entry was last modified.
200  PW_TIME tLastAccess; ///< Time when the entry was last accessed.
201  PW_TIME tExpire; ///< Time when the entry will expire.
202 
203  std::basic_string<TCHAR> strBinaryDesc; ///< A string describing the contents of vBinaryData.
204  std::vector<BYTE> vBinaryData; ///< Attachment data.
205 } PW_ENTRY_STL, *PPW_ENTRY_STL; */
206 
208 // Key provider structures
209 
210 #pragma pack(1)
211 
213 typedef struct _KP_KEYPROV_INFO
214 {
215  DWORD dwFlags;
216  LPCTSTR lpName;
217  DWORD dwImageIndex;
218 
219  DWORD_PTR dwReserved;
220 } KP_KEYPROV_INFO;
221 
223 typedef struct _KP_KEYPROV_KEY
224 {
229  DWORD dwType;
230 
231  DWORD dwFormat;
232  LPVOID lpData;
233  DWORD dwDataSize;
234 
235  DWORD_PTR dwReserved;
236 } KP_KEYPROV_KEY;
237 
239 typedef struct _KP_KEYPROV_CONTEXT
240 {
241  DWORD dwSize;
242 
243  LPCTSTR lpProviderName;
244 
246  BOOL bConfirming;
247  BOOL bChanging;
248 
250 } KP_KEYPROV_CONTEXT;
251 
252 #pragma pack()
253 
254 #endif // ___PW_STRUCTS_H___
DWORD dwSize
Size of the KP_KEYPROV_CONTEXT structure.
Definition: PwStructs.h:241
DWORD dwGroups
Number of groups in the database.
Definition: PwStructs.h:67
USHORT shYear
Year. 2004 means 2004.
Definition: PwStructs.h:44
struct PWDB_REPAIR_INFO * PPWDB_REPAIR_INFO
Structure wrapping one GUID.
Definition: PwStructs.h:124
Structure containing information about a database repairing process.
Definition: PwStructs.h:130
BOOL bChanging
Definition: PwStructs.h:247
BYTE aMasterSeed[16]
Seed that gets hashed with the user key to form the final key.
Definition: PwStructs.h:64
DWORD uBinaryDataLen
Length of the attachment data in bytes.
Definition: PwStructs.h:120
BYTE btHour
Hour. Begins with hour 0, maximum value is 23.
Definition: PwStructs.h:47
LPCTSTR lpAdditional
Notes.
Definition: PwStructs.h:177
LPCTSTR lpProviderName
Name of the provider that should generate the key.
Definition: PwStructs.h:243
LPTSTR lpCommandString
The menu item's text.
Definition: PwStructs.h:154
PW_TIME tCreation
Time when the entry was created.
Definition: PwStructs.h:113
TCHAR * pszGroupName
Name of the group.
Definition: PwStructs.h:81
DWORD dwDataSize
Size of the key (lpData) in bytes.
Definition: PwStructs.h:233
DWORD_PTR dwReserved
Reserved for future use, must be 0.
Definition: PwStructs.h:157
LPCTSTR lpPassword
Password (unencrypted).
Definition: PwStructs.h:176
PW_TIME tExpire
Time when the entry will expire.
Definition: PwStructs.h:116
DWORD_PTR dwReserved
Reserved for future use, must be 0.
Definition: PwStructs.h:179
BYTE btSecond
Seconds. Begins at 0, maximum value is 59.
Definition: PwStructs.h:49
DWORD dwEntries
Number of entries in the database.
Definition: PwStructs.h:68
LPCTSTR lpName
Unique display name of the key provider.
Definition: PwStructs.h:216
USHORT usLevel
Indentation/depth level in the group tree.
Definition: PwStructs.h:88
BOOL bCreatingNewKey
Specifies whether a new key is being generated.
Definition: PwStructs.h:245
DWORD dwFlags
Reserved for future use, must be 0.
Definition: PwStructs.h:215
struct PW_GROUP * PPW_GROUP
DWORD uImageId
Index of the icon in the image list to use for this group.
Definition: PwStructs.h:80
PW_TIME tLastMod
Time when the group was last modified.
Definition: PwStructs.h:84
TCHAR * pszBinaryDesc
A string describing the contents of pBinaryData.
Definition: PwStructs.h:118
PW_TIME tCreation
Time when the group was created.
Definition: PwStructs.h:83
LPCTSTR lpDescriptiveName
File name or some other descriptive string.
Definition: PwStructs.h:249
BYTE btMinute
Minutes. Begins at 0, maximum value is 59.
Definition: PwStructs.h:48
Structure used for entry validations by plugins.
Definition: PwStructs.h:161
UINT8 aEncryptionIV[16]
IV used for content encryption.
Definition: PwStructs.h:65
DWORD dwFlags
Definition: PwStructs.h:61
DWORD dwImageIndex
Index of the icon shown in the combo box.
Definition: PwStructs.h:217
PW_TIME tLastAccess
Time when the group was last accessed.
Definition: PwStructs.h:85
DWORD dwIcon
Definition: PwStructs.h:153
BYTE aMasterSeed2[32]
Seed used for the dwKeyEncRounds AES transformations.
Definition: PwStructs.h:72
DWORD dwVersion
Definition: PwStructs.h:62
TCHAR * pszPassword
Password (may be encrypted, use IKpDatabase::UnlockEntryPassword to decrypt).
Definition: PwStructs.h:109
DWORD dwFlags
Flags (enabled state, checkbox, popup, etc).
Definition: PwStructs.h:147
struct PW_TIME * PPW_TIME
PW_TIME tExpire
Time when the group will expire.
Definition: PwStructs.h:86
DWORD uGroupIndex
Index of the group that contains this entry.
Definition: PwStructs.h:169
A key returned by a key provider.
Definition: PwStructs.h:223
struct KP_ENTRY * PKP_ENTRY
Structure containing information about one main menu item provided by a plugin.
Definition: PwStructs.h:138
LPCTSTR lpUserName
User name.
Definition: PwStructs.h:175
DWORD dwOriginalGroupCount
Definition: PwStructs.h:132
PW_TIME tLastAccess
Time when the entry was last accessed.
Definition: PwStructs.h:115
TCHAR * pszAdditional
Notes.
Definition: PwStructs.h:111
TCHAR * pszUserName
User name.
Definition: PwStructs.h:106
const void * pOriginalEntry
Pointer to the original PW_ENTRY.
Definition: PwStructs.h:163
DWORD uGroupId
ID of the group that contains this entry.
Definition: PwStructs.h:101
LPVOID lpData
Key data pointer.
Definition: PwStructs.h:232
DWORD dwType
Type flags.
Definition: PwStructs.h:229
LPCTSTR lpURL
URL.
Definition: PwStructs.h:174
DWORD uImageId
Index of the icon in the image list to use for this entry.
Definition: PwStructs.h:102
DWORD uImageId
Index of the icon in the image list to use for this entry.
Definition: PwStructs.h:171
PW_TIME tLastMod
Time when the entry was last modified.
Definition: PwStructs.h:114
DWORD dwCommandID
Set by KeePass, don't modify yourself.
Definition: PwStructs.h:155
DWORD dwSignature1
File identifier word, set to PWM_DBSIG_1.
Definition: PwStructs.h:59
DWORD dwFlags
Used by KeePass internally, don't use (set to 0 for a new structure).
Definition: PwStructs.h:94
Group structure, containing information about one group.
Definition: PwStructs.h:77
DWORD dwRecognizedMetaStreamCount
Definition: PwStructs.h:134
struct PW_DBHEADER * PPW_DBHEADER
BYTE * pBinaryData
Attachment data (of length uBinaryDataLen), may be NULL.
Definition: PwStructs.h:119
BYTE uuid[16]
Unique GUID identifying this entry (not only in this database).
Definition: PwStructs.h:100
Information about a key provider.
Definition: PwStructs.h:213
LPCTSTR lpTitle
Title.
Definition: PwStructs.h:173
BYTE aContentsHash[32]
SHA-256 hash of the database, used for integrity checking.
Definition: PwStructs.h:70
DWORD_PTR dwReserved
Reserved for future use, must be 0.
Definition: PwStructs.h:219
DWORD dwFormat
Reserved for future use, must be 0.
Definition: PwStructs.h:231
DWORD dwState
State (checkbox, etc).
Definition: PwStructs.h:151
DWORD dwSignature2
File identifier word, set to PWM_DBSIG_2.
Definition: PwStructs.h:60
TCHAR * pszURL
URL.
Definition: PwStructs.h:105
Entry structure, containing information about one entry.
Definition: PwStructs.h:98
BOOL bConfirming
Specifies whether KeePass asks the user to confirm the key.
Definition: PwStructs.h:246
Information structure used when querying keys from key providers.
Definition: PwStructs.h:239
DWORD dwOriginalEntryCount
Definition: PwStructs.h:133
struct PW_ENTRY * PPW_ENTRY
BYTE uuid[16]
A GUID.
Definition: PwStructs.h:126
TCHAR * pszTitle
Title.
Definition: PwStructs.h:104
DWORD dwKeyEncRounds
Number of master key transformations.
Definition: PwStructs.h:73
Time structure.
Definition: PwStructs.h:42
DWORD uPasswordLen
Length of the password (required for memory protection).
Definition: PwStructs.h:108
BYTE btMonth
Month. Ranges from 1 = Jan to 12 = Dec.
Definition: PwStructs.h:45
Database header structure. All KeePass KDB files begin with this structure.
Definition: PwStructs.h:57
DWORD uGroupId
ID of the group. The ID is a unique identifier in one database.
Definition: PwStructs.h:79
DWORD_PTR dwReserved
Reserved for future use, must be 0.
Definition: PwStructs.h:235
BYTE btDay
Day. The first day is 1.
Definition: PwStructs.h:46

Documentation generated with Doxygen.





Get KeePass