KeePass   KeePass Help Center Home KeePass Home | Package Downloads | Flag Translations | Blocks Plugins | Donate Donate  
Home Help Center Home | People Forums | Award Awards | Link Links  







PwStructs.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008-2018 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 
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 
117 
118  TCHAR *pszBinaryDesc;
119  BYTE *pBinaryData;
121 } PW_ENTRY, *PPW_ENTRY;
122 
124 typedef struct _PW_UUID_STRUCT
125 {
126  BYTE uuid[16];
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;
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;
237 
239 typedef struct _KP_KEYPROV_CONTEXT
240 {
241  DWORD dwSize;
242 
243  LPCTSTR lpProviderName;
244 
246  BOOL bConfirming;
247  BOOL bChanging;
248 
251 
252 #pragma pack()
253 
254 #endif // ___PW_STRUCTS_H___
LPCTSTR lpTitle
Title.
Definition: PwStructs.h:173
LPTSTR lpCommandString
The menu item's text.
Definition: PwStructs.h:154
TCHAR * pszUserName
User name.
Definition: PwStructs.h:106
DWORD uImageId
Index of the icon in the image list to use for this entry.
Definition: PwStructs.h:102
Structure containing information about a database repairing process.
Definition: PwStructs.h:130
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
DWORD dwEntries
Number of entries in the database.
Definition: PwStructs.h:68
LPCTSTR lpUserName
User name.
Definition: PwStructs.h:175
DWORD uImageId
Index of the icon in the image list to use for this group.
Definition: PwStructs.h:80
TCHAR * pszBinaryDesc
A string describing the contents of pBinaryData.
Definition: PwStructs.h:118
PW_TIME tLastAccess
Time when the group was last accessed.
Definition: PwStructs.h:85
DWORD dwFormat
Reserved for future use, must be 0.
Definition: PwStructs.h:231
LPCTSTR lpPassword
Password (unencrypted).
Definition: PwStructs.h:176
DWORD dwSize
Size of the KP_KEYPROV_CONTEXT structure.
Definition: PwStructs.h:241
PW_TIME tCreation
Time when the entry was created.
Definition: PwStructs.h:113
Structure containing information about one main menu item provided by a plugin.
Definition: PwStructs.h:138
DWORD dwOriginalGroupCount
Definition: PwStructs.h:132
LPCTSTR lpAdditional
Notes.
Definition: PwStructs.h:177
DWORD dwDataSize
Size of the key (lpData) in bytes.
Definition: PwStructs.h:233
DWORD dwFlags
Reserved for future use, must be 0.
Definition: PwStructs.h:215
BOOL bCreatingNewKey
Specifies whether a new key is being generated.
Definition: PwStructs.h:245
TCHAR * pszAdditional
Notes.
Definition: PwStructs.h:111
DWORD dwType
Type flags.
Definition: PwStructs.h:229
DWORD dwRecognizedMetaStreamCount
Definition: PwStructs.h:134
BYTE btMinute
Minutes. Begins at 0, maximum value is 59.
Definition: PwStructs.h:48
PW_TIME tLastMod
Time when the group was last modified.
Definition: PwStructs.h:84
TCHAR * pszPassword
Password (may be encrypted, use IKpDatabase::UnlockEntryPassword to decrypt).
Definition: PwStructs.h:109
Information structure used when querying keys from key providers.
Definition: PwStructs.h:239
Structure wrapping one GUID.
Definition: PwStructs.h:124
PW_TIME tCreation
Time when the group was created.
Definition: PwStructs.h:83
struct KP_ENTRY * PKP_ENTRY
DWORD dwFlags
Used by KeePass internally, don't use (set to 0 for a new structure).
Definition: PwStructs.h:94
DWORD_PTR dwReserved
Reserved for future use, must be 0.
Definition: PwStructs.h:235
Structure used for entry validations by plugins.
Definition: PwStructs.h:161
BOOL bConfirming
Specifies whether KeePass asks the user to confirm the key.
Definition: PwStructs.h:246
DWORD uImageId
Index of the icon in the image list to use for this entry.
Definition: PwStructs.h:171
DWORD_PTR dwReserved
Reserved for future use, must be 0.
Definition: PwStructs.h:219
DWORD uGroupId
ID of the group that contains this entry.
Definition: PwStructs.h:101
LPCTSTR lpName
Unique display name of the key provider.
Definition: PwStructs.h:216
LPVOID lpData
Key data pointer.
Definition: PwStructs.h:232
USHORT shYear
Year. 2004 means 2004.
Definition: PwStructs.h:44
DWORD dwImageIndex
Index of the icon shown in the combo box.
Definition: PwStructs.h:217
TCHAR * pszGroupName
Name of the group.
Definition: PwStructs.h:81
Group structure, containing information about one group.
Definition: PwStructs.h:77
DWORD_PTR dwReserved
Reserved for future use, must be 0.
Definition: PwStructs.h:157
TCHAR * pszTitle
Title.
Definition: PwStructs.h:104
DWORD dwKeyEncRounds
Number of master key transformations.
Definition: PwStructs.h:73
DWORD uGroupIndex
Index of the group that contains this entry.
Definition: PwStructs.h:169
DWORD dwSignature1
File identifier word, set to PWM_DBSIG_1.
Definition: PwStructs.h:59
DWORD dwFlags
Flags (enabled state, checkbox, popup, etc).
Definition: PwStructs.h:147
DWORD_PTR dwReserved
Reserved for future use, must be 0.
Definition: PwStructs.h:179
LPCTSTR lpProviderName
Name of the provider that should generate the key.
Definition: PwStructs.h:243
DWORD uGroupId
ID of the group. The ID is a unique identifier in one database.
Definition: PwStructs.h:79
BYTE btDay
Day. The first day is 1.
Definition: PwStructs.h:46
DWORD dwSignature2
File identifier word, set to PWM_DBSIG_2.
Definition: PwStructs.h:60
PW_TIME tExpire
Time when the group will expire.
Definition: PwStructs.h:86
A key returned by a key provider.
Definition: PwStructs.h:223
PW_TIME tLastAccess
Time when the entry was last accessed.
Definition: PwStructs.h:115
TCHAR * pszURL
URL.
Definition: PwStructs.h:105
DWORD dwFlags
Definition: PwStructs.h:61
DWORD uPasswordLen
Length of the password (required for memory protection).
Definition: PwStructs.h:108
BYTE * pBinaryData
Attachment data (of length uBinaryDataLen), may be NULL.
Definition: PwStructs.h:119
Time structure.
Definition: PwStructs.h:42
LPCTSTR lpDescriptiveName
File name or some other descriptive string.
Definition: PwStructs.h:249
DWORD dwOriginalEntryCount
Definition: PwStructs.h:133
DWORD dwCommandID
Set by KeePass, don't modify yourself.
Definition: PwStructs.h:155
BYTE btSecond
Seconds. Begins at 0, maximum value is 59.
Definition: PwStructs.h:49
DWORD dwIcon
Definition: PwStructs.h:153
PW_TIME tLastMod
Time when the entry was last modified.
Definition: PwStructs.h:114
const void * pOriginalEntry
Pointer to the original PW_ENTRY.
Definition: PwStructs.h:163
Entry structure, containing information about one entry.
Definition: PwStructs.h:98
DWORD dwState
State (checkbox, etc).
Definition: PwStructs.h:151
PW_TIME tExpire
Time when the entry will expire.
Definition: PwStructs.h:116
Information about a key provider.
Definition: PwStructs.h:213
USHORT usLevel
Indentation/depth level in the group tree.
Definition: PwStructs.h:88
DWORD dwVersion
Definition: PwStructs.h:62
BOOL bChanging
Definition: PwStructs.h:247
BYTE btMonth
Month. Ranges from 1 = Jan to 12 = Dec.
Definition: PwStructs.h:45
DWORD dwGroups
Number of groups in the database.
Definition: PwStructs.h:67
LPCTSTR lpURL
URL.
Definition: PwStructs.h:174
Database header structure. All KeePass KDB files begin with this structure.
Definition: PwStructs.h:57



Documentation generated with Doxygen.




Valid XHTML 1.0 Transitional Document

Get KeePass


Copyright © 2003-2018 Dominik Reichl, [Legal Contact / Imprint] [Terms & Privacy] [Acknowledgements] [Donate]