ReactOS 0.4.16-dev-338-g34e76ad
wincred.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2006 Robert Shearman (for CodeWeavers)
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#ifndef _WINCRED_H_
20#define _WINCRED_H_
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#ifdef _ADVAPI32_
27#define WINADVAPI
28#else
29#define WINADVAPI DECLSPEC_IMPORT
30#endif
31
32#ifndef __SECHANDLE_DEFINED__
33#define __SECHANDLE_DEFINED__
34typedef struct _SecHandle
35{
39#endif
40
41#ifndef __WINE_CTXTHANDLE_DEFINED__
42#define __WINE_CTXTHANDLE_DEFINED__
45#endif
46
48{
54
56{
62
63DECL_WINELIB_TYPE_AW(CREDENTIAL_ATTRIBUTE)
64DECL_WINELIB_TYPE_AW(PCREDENTIAL_ATTRIBUTE)
65
67{
74 _Field_size_bytes_(CredentialBlobSize) LPBYTE CredentialBlob;
81
82typedef struct _CREDENTIALW
83{
97
98DECL_WINELIB_TYPE_AW(CREDENTIAL)
99DECL_WINELIB_TYPE_AW(PCREDENTIAL)
100
102{
114
116{
128
129DECL_WINELIB_TYPE_AW(CREDENTIAL_TARGET_INFORMATION)
130DECL_WINELIB_TYPE_AW(PCREDENTIAL_TARGET_INFORMATION)
131
133{
140
141typedef struct _CREDUI_INFOW
142{
149
150DECL_WINELIB_TYPE_AW(CREDUI_INFO)
151DECL_WINELIB_TYPE_AW(PCREDUI_INFO)
152
154{
159
160#define CERT_HASH_LENGTH 20
161
163{
167
169{
172
174{
178
179#define CRED_MAX_STRING_LENGTH 256
180#define CRED_MAX_USERNAME_LENGTH 513
181#define CRED_MAX_GENERIC_TARGET_NAME_LENGTH 32767
182#define CRED_MAX_DOMAIN_TARGET_NAME_LENGTH 337
183#define CRED_MAX_VALUE_SIZE 256
184#define CRED_MAX_ATTRIBUTES 64
185
186#define CRED_MAX_BLOB_SIZE 512
187#define CRED_MAX_CREDENTIAL_BLOB_SIZE (5 * CRED_MAX_BLOB_SIZE)
188
189#define CREDUI_MAX_MESSAGE_LENGTH 32767
190#define CREDUI_MAX_CAPTION_LENGTH 128
191#define CREDUI_MAX_GENERIC_TARGET_LENGTH CRED_MAX_GENERIC_TARGET_NAME_LENGTH
192#define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_LENGTH
193#define CREDUI_MAX_USERNAME_LENGTH CRED_MAX_USERNAME_LENGTH
194#define CREDUI_MAX_PASSWORD_LENGTH (CRED_MAX_CREDENTIAL_BLOB_SIZE / 2)
195
196/* flags for CREDENTIAL::Flags */
197#define CRED_FLAGS_PASSWORD_FOR_CERT 0x0001
198#define CRED_FLAGS_PROMPT_NOW 0x0002
199#define CRED_FLAGS_USERNAME_TARGET 0x0004
200#define CRED_FLAGS_OWF_CRED_BLOB 0x0008
201#define CRED_FLAGS_VALID_FLAGS 0x000f
202
203/* values for CREDENTIAL::Type */
204#define CRED_TYPE_GENERIC 1
205#define CRED_TYPE_DOMAIN_PASSWORD 2
206#define CRED_TYPE_DOMAIN_CERTIFICATE 3
207#define CRED_TYPE_DOMAIN_VISIBLE_PASSWORD 4
208#define CRED_TYPE_GENERIC_CERTIFICATE 5
209#define CRED_TYPE_MAXIMUM 6
210#define CRED_TYPE_MAXIMUM_EX (CRED_TYPE_MAXIMUM+1000)
211
212/* values for CREDENTIAL::Persist */
213#define CRED_PERSIST_NONE 0
214#define CRED_PERSIST_SESSION 1
215#define CRED_PERSIST_LOCAL_MACHINE 2
216#define CRED_PERSIST_ENTERPRISE 3
217
218/* values for CREDENTIAL_TARGET_INFORMATION::Flags */
219#define CRED_TI_SERVER_FORMAT_UNKNOWN 1
220#define CRED_TI_DOMAIN_FORMAT_UNKNOWN 2
221#define CRED_TI_ONLY_PASSWORD_REQUIRED 4
222
223#define CREDUI_FLAGS_INCORRECT_PASSWORD 0x00000001
224#define CREDUI_FLAGS_DO_NOT_PERSIST 0x00000002
225#define CREDUI_FLAGS_REQUEST_ADMINISTRATOR 0x00000004
226#define CREDUI_FLAGS_EXCLUDE_CERTIFICATES 0x00000008
227#define CREDUI_FLAGS_REQUIRE_CERTIFICATE 0x00000010
228#define CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX 0x00000040
229#define CREDUI_FLAGS_ALWAYS_SHOW_UI 0x00000080
230#define CREDUI_FLAGS_REQUIRE_SMARTCARD 0x00000100
231#define CREDUI_FLAGS_PASSWORD_ONLY_OK 0x00000200
232#define CREDUI_FLAGS_VALIDATE_USERNAME 0x00000400
233#define CREDUI_FLAGS_COMPLETE_USERNAME 0x00000800
234#define CREDUI_FLAGS_PERSIST 0x00001000
235#define CREDUI_FLAGS_SERVER_CREDENTIAL 0x00004000
236#define CREDUI_FLAGS_EXPECT_CONFIRMATION 0x00020000
237#define CREDUI_FLAGS_GENERIC_CREDENTIALS 0x00040000
238#define CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS 0x00080000
239#define CREDUI_FLAGS_KEEP_USERNAME 0x00100000
240
241/* flags for CredWrite and CredWriteDomainCredentials */
242#define CRED_PRESERVE_CREDENTIAL_BLOB 0x00000001
243
246#define CredDelete WINELIB_NAME_AW(CredDelete)
247
249BOOL
250WINAPI
256
258BOOL
259WINAPI
265
266#define CredEnumerate WINELIB_NAME_AW(CredEnumerate)
267
269
271BOOL
272WINAPI
274 _In_ DWORD MaximumPersistCount,
275 _Out_writes_(MaximumPersistCount) LPDWORD);
276
279#define CredIsMarshaledCredential WINELIB_NAME_AW(CredIsMarshaledCredential)
280
282BOOL
283WINAPI
286 _In_ PVOID,
287 _Out_ LPSTR *);
288
290BOOL
291WINAPI
294 _In_ PVOID,
295 _Out_ LPWSTR *);
296
297#define CredMarshalCredential WINELIB_NAME_AW(CredMarshalCredential)
298
300BOOL
301WINAPI
303 _In_ LPCSTR,
304 _In_ DWORD,
307
309BOOL
310WINAPI
313 _In_ DWORD,
316
317#define CredRead WINELIB_NAME_AW(CredRead)
318
320BOOL
321WINAPI
324 _In_ DWORD,
327
329BOOL
330WINAPI
333 _In_ DWORD,
336
337#define CredReadDomainCredentials WINELIB_NAME_AW(CredReadDomainCredentials)
338
340BOOL
341WINAPI
343 _In_ LPCSTR,
344 _In_ LPCSTR,
345 _In_ DWORD,
347
349BOOL
350WINAPI
354 _In_ DWORD,
356
357#define CredRename WINELIB_NAME_AW(CredRename)
358
360BOOL
361WINAPI
363 _In_ LPCSTR,
365 _Out_ PVOID *);
366
368BOOL
369WINAPI
373 _Out_ PVOID *);
374
375#define CredUnmarshalCredential WINELIB_NAME_AW(CredUnmarshalCredential)
376
379#define CredWrite WINELIB_NAME_AW(CredWrite)
380
381DWORD
382WINAPI
386 _In_ DWORD,
387 _Inout_updates_(ulUserBufferSize) PWSTR,
388 _In_ ULONG ulUserBufferSize,
389 _Inout_updates_(ulPasswordBufferSize) PWSTR,
390 _In_ ULONG ulPasswordBufferSize,
392 _In_ DWORD);
393
394DWORD
395WINAPI
399 _In_ DWORD,
400 _Inout_updates_(ulUserBufferSize) PSTR,
401 _In_ ULONG ulUserBufferSize,
402 _Inout_updates_(ulPasswordBufferSize) PSTR,
403 _In_ ULONG ulPasswordBufferSize,
405 _In_ DWORD);
406
407#define CredUICmdLinePromptForCredentials WINELIB_NAME_AW(CredUICmdLinePromptForCredentials)
408
411#define CredUIConfirmCredentials WINELIB_NAME_AW(CredUIConfirmCredentials)
412
413DWORD
414WINAPI
416 _In_ PCWSTR,
417 _Out_writes_(userBufferSize) PWSTR,
418 _In_ ULONG userBufferSize,
419 _Out_writes_(domainBufferSize) PWSTR,
420 _In_ ULONG domainBufferSize);
421
422DWORD
423WINAPI
425 _In_ PCSTR,
426 _Out_writes_(userBufferSize) PSTR,
427 _In_ ULONG userBufferSize,
428 _Out_writes_(domainBufferSize) PSTR,
429 _In_ ULONG domainBufferSize);
430
431#define CredUIParseUserName WINELIB_NAME_AW(CredUIParseUserName)
432
433DWORD
434WINAPI
439 _In_ DWORD,
440 _Inout_updates_(ulUserNameBufferSize) PWSTR,
441 _In_ ULONG ulUserNameBufferSize,
442 _Inout_updates_(ulPasswordBufferSize) PWSTR,
443 _In_ ULONG ulPasswordBufferSize,
445 _In_ DWORD);
446
447DWORD
448WINAPI
453 _In_ DWORD,
454 _Inout_updates_(ulUserNameBufferSize) PSTR,
455 _In_ ULONG ulUserNameBufferSize,
456 _Inout_updates_(ulPasswordBufferSize) PSTR,
457 _In_ ULONG ulPasswordBufferSize,
459 _In_ DWORD);
460
461#define CredUIPromptForCredentials WINELIB_NAME_AW(CredUIPromptForCredentials)
462
463DWORD
464WINAPI
467 _In_ PCWSTR,
468 _In_ PCWSTR,
469 _In_ BOOL);
470
471/* Note: no CredUIStoreSSOCredA in PSDK header */
473/* Note: no CredUIReadSSOCredA in PSDK header */
474
475#ifdef __cplusplus
476}
477#endif
478
479#endif /* _WINCRED_H_ */
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
static HBITMAP
Definition: button.c:44
#define _Inout_updates_(s)
Definition: no_sal2.h:182
#define _Outptr_
Definition: no_sal2.h:262
#define _Outptr_result_buffer_(s)
Definition: no_sal2.h:286
#define _Inout_opt_
Definition: no_sal2.h:216
#define _Out_writes_(s)
Definition: no_sal2.h:176
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _Reserved_
Definition: no_sal2.h:504
int Count
Definition: noreturn.cpp:7
UCHAR rgbHashOfCert[CERT_HASH_LENGTH]
Definition: wincred.h:165
PCREDENTIAL_ATTRIBUTEA Attributes
Definition: wincred.h:77
LPSTR Comment
Definition: wincred.h:71
LPSTR TargetAlias
Definition: wincred.h:78
DWORD Persist
Definition: wincred.h:75
LPSTR UserName
Definition: wincred.h:79
LPSTR TargetName
Definition: wincred.h:70
_Field_size_bytes_(CredentialBlobSize) LPBYTE CredentialBlob
FILETIME LastWritten
Definition: wincred.h:72
DWORD AttributeCount
Definition: wincred.h:76
DWORD Type
Definition: wincred.h:69
DWORD CredentialBlobSize
Definition: wincred.h:73
DWORD Flags
Definition: wincred.h:68
LPWSTR TargetName
Definition: wincred.h:86
LPBYTE CredentialBlob
Definition: wincred.h:90
DWORD AttributeCount
Definition: wincred.h:92
PCREDENTIAL_ATTRIBUTEW Attributes
Definition: wincred.h:93
FILETIME LastWritten
Definition: wincred.h:88
DWORD Flags
Definition: wincred.h:84
LPWSTR UserName
Definition: wincred.h:95
DWORD CredentialBlobSize
Definition: wincred.h:89
DWORD Type
Definition: wincred.h:85
DWORD Persist
Definition: wincred.h:91
LPWSTR TargetAlias
Definition: wincred.h:94
LPWSTR Comment
Definition: wincred.h:87
PCSTR pszCaptionText
Definition: wincred.h:137
DWORD cbSize
Definition: wincred.h:134
HWND hwndParent
Definition: wincred.h:135
HBITMAP hbmBanner
Definition: wincred.h:138
PCSTR pszMessageText
Definition: wincred.h:136
HWND hwndParent
Definition: wincred.h:144
PCWSTR pszMessageText
Definition: wincred.h:145
DWORD cbSize
Definition: wincred.h:143
PCWSTR pszCaptionText
Definition: wincred.h:146
HBITMAP hbmBanner
Definition: wincred.h:147
ULONG_PTR dwLower
Definition: sspi.h:53
ULONG_PTR dwUpper
Definition: sspi.h:54
uint16_t * PWSTR
Definition: typedefs.h:56
char * PSTR
Definition: typedefs.h:51
const uint16_t * PCWSTR
Definition: typedefs.h:57
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t * LPDWORD
Definition: typedefs.h:59
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
WINADVAPI BOOL WINAPI CredEnumerateA(_In_opt_ LPCSTR, _Reserved_ DWORD, _Out_ DWORD *Count, _Outptr_result_buffer_(*Count) PCREDENTIALA **)
DWORD WINAPI CredUIPromptForCredentialsA(_In_opt_ PCREDUI_INFOA, _In_opt_ PCSTR, _Reserved_ PCtxtHandle, _In_ DWORD, _Inout_updates_(ulUserNameBufferSize) PSTR, _In_ ULONG ulUserNameBufferSize, _Inout_updates_(ulPasswordBufferSize) PSTR, _In_ ULONG ulPasswordBufferSize, _Inout_opt_ PBOOL, _In_ DWORD)
#define WINADVAPI
Definition: wincred.h:29
DWORD WINAPI CredUICmdLinePromptForCredentialsA(_In_opt_ PCSTR, _Reserved_ PCtxtHandle, _In_ DWORD, _Inout_updates_(ulUserBufferSize) PSTR, _In_ ULONG ulUserBufferSize, _Inout_updates_(ulPasswordBufferSize) PSTR, _In_ ULONG ulPasswordBufferSize, _Inout_opt_ PBOOL, _In_ DWORD)
DWORD WINAPI CredUIConfirmCredentialsA(_In_ PCSTR, _In_ BOOL)
struct _CREDENTIAL_TARGET_INFORMATIONA CREDENTIAL_TARGET_INFORMATIONA
DWORD WINAPI CredUIParseUserNameW(_In_ PCWSTR, _Out_writes_(userBufferSize) PWSTR, _In_ ULONG userBufferSize, _Out_writes_(domainBufferSize) PWSTR, _In_ ULONG domainBufferSize)
struct _CREDENTIALA CREDENTIALA
WINADVAPI BOOL WINAPI CredDeleteA(_In_ LPCSTR, _In_ DWORD, _Reserved_ DWORD)
WINADVAPI BOOL WINAPI CredMarshalCredentialA(_In_ CRED_MARSHAL_TYPE, _In_ PVOID, _Out_ LPSTR *)
WINADVAPI BOOL WINAPI CredEnumerateW(_In_opt_ LPCWSTR, _Reserved_ DWORD, _Out_ DWORD *Count, _Outptr_result_buffer_(*Count) PCREDENTIALW **)
struct _CERT_CREDENTIAL_INFO CERT_CREDENTIAL_INFO
enum _CRED_MARSHAL_TYPE CRED_MARSHAL_TYPE
WINADVAPI BOOL WINAPI CredMarshalCredentialW(_In_ CRED_MARSHAL_TYPE, _In_ PVOID, _Out_ LPWSTR *)
struct _CREDUI_INFOA * PCREDUI_INFOA
struct _CREDENTIAL_TARGET_INFORMATIONA * PCREDENTIAL_TARGET_INFORMATIONA
struct _CERT_CREDENTIAL_INFO * PCERT_CREDENTIAL_INFO
#define CERT_HASH_LENGTH
Definition: wincred.h:160
DWORD WINAPI CredUIConfirmCredentialsW(_In_ PCWSTR, _In_ BOOL)
WINADVAPI BOOL WINAPI CredReadDomainCredentialsW(_In_ PCREDENTIAL_TARGET_INFORMATIONW, _In_ DWORD, _Out_ DWORD *Count, _Outptr_result_buffer_(*Count) PCREDENTIALW **)
struct _CREDUI_INFOW CREDUI_INFOW
WINADVAPI BOOL WINAPI CredReadA(_In_ LPCSTR, _In_ DWORD, _Reserved_ DWORD, _Out_ PCREDENTIALA *)
WINADVAPI BOOL WINAPI CredGetSessionTypes(_In_ DWORD MaximumPersistCount, _Out_writes_(MaximumPersistCount) LPDWORD)
struct _CREDENTIAL_TARGET_INFORMATIONW CREDENTIAL_TARGET_INFORMATIONW
struct _CREDENTIAL_ATTRIBUTEA CREDENTIAL_ATTRIBUTEA
SecHandle CtxtHandle
Definition: wincred.h:43
WINADVAPI BOOL WINAPI CredReadW(_In_ LPCWSTR, _In_ DWORD, _Reserved_ DWORD, _Out_ PCREDENTIALW *)
struct _SecHandle * PSecHandle
PSecHandle PCtxtHandle
Definition: wincred.h:44
enum _CRED_MARSHAL_TYPE * PCRED_MARSHAL_TYPE
WINADVAPI VOID WINAPI CredFree(_In_ PVOID)
WINADVAPI BOOL WINAPI CredDeleteW(_In_ LPCWSTR, _In_ DWORD, _Reserved_ DWORD)
struct _CREDENTIALW * PCREDENTIALW
struct _CREDENTIALW CREDENTIALW
WINADVAPI BOOL WINAPI CredWriteW(_In_ PCREDENTIALW, _In_ DWORD)
struct _CREDENTIAL_TARGET_INFORMATIONW * PCREDENTIAL_TARGET_INFORMATIONW
DWORD WINAPI CredUIPromptForCredentialsW(_In_opt_ PCREDUI_INFOW, _In_opt_ PCWSTR, _Reserved_ PCtxtHandle, _In_ DWORD, _Inout_updates_(ulUserNameBufferSize) PWSTR, _In_ ULONG ulUserNameBufferSize, _Inout_updates_(ulPasswordBufferSize) PWSTR, _In_ ULONG ulPasswordBufferSize, _Inout_opt_ PBOOL, _In_ DWORD)
WINADVAPI BOOL WINAPI CredWriteA(_In_ PCREDENTIALA, _In_ DWORD)
WINADVAPI BOOL WINAPI CredUnmarshalCredentialW(_In_ LPCWSTR, _Out_ PCRED_MARSHAL_TYPE, _Out_ PVOID *)
WINADVAPI BOOL WINAPI CredUnmarshalCredentialA(_In_ LPCSTR, _Out_ PCRED_MARSHAL_TYPE, _Out_ PVOID *)
DWORD WINAPI CredUIParseUserNameA(_In_ PCSTR, _Out_writes_(userBufferSize) PSTR, _In_ ULONG userBufferSize, _Out_writes_(domainBufferSize) PSTR, _In_ ULONG domainBufferSize)
DWORD WINAPI CredUIStoreSSOCredW(_In_opt_ PCWSTR, _In_ PCWSTR, _In_ PCWSTR, _In_ BOOL)
struct _CREDUI_INFOW * PCREDUI_INFOW
struct _CREDENTIALA * PCREDENTIALA
struct _CREDENTIAL_ATTRIBUTEW CREDENTIAL_ATTRIBUTEW
_CRED_MARSHAL_TYPE
Definition: wincred.h:154
@ BinaryBlobCredential
Definition: wincred.h:157
@ UsernameTargetCredential
Definition: wincred.h:156
@ CertCredential
Definition: wincred.h:155
DWORD WINAPI CredUIReadSSOCredW(_In_opt_ PCWSTR, _Outptr_ PWSTR *)
struct _CREDENTIAL_ATTRIBUTEA * PCREDENTIAL_ATTRIBUTEA
WINADVAPI BOOL WINAPI CredReadDomainCredentialsA(_In_ PCREDENTIAL_TARGET_INFORMATIONA, _In_ DWORD, _Out_ DWORD *Count, _Outptr_result_buffer_(*Count) PCREDENTIALA **)
struct _CREDUI_INFOA CREDUI_INFOA
struct _BINARY_BLOB_CREDENTIAL_INFO * PBINARY_BLOB_CREDENTIAL_INFO
struct _USERNAME_TARGET_CREDENTIAL_INFO USERNAME_TARGET_CREDENTIAL_INFO
WINADVAPI BOOL WINAPI CredIsMarshaledCredentialA(_In_ LPCSTR)
struct _BINARY_BLOB_CREDENTIAL_INFO BINARY_BLOB_CREDENTIAL_INFO
struct _SecHandle SecHandle
struct _CREDENTIAL_ATTRIBUTEW * PCREDENTIAL_ATTRIBUTEW
DWORD WINAPI CredUICmdLinePromptForCredentialsW(_In_opt_ PCWSTR, _Reserved_ PCtxtHandle, _In_ DWORD, _Inout_updates_(ulUserBufferSize) PWSTR, _In_ ULONG ulUserBufferSize, _Inout_updates_(ulPasswordBufferSize) PWSTR, _In_ ULONG ulPasswordBufferSize, _Inout_opt_ PBOOL, _In_ DWORD)
WINADVAPI BOOL WINAPI CredRenameW(_In_ LPCWSTR, _In_ LPCWSTR, _In_ DWORD, _Reserved_ DWORD)
WINADVAPI BOOL WINAPI CredRenameA(_In_ LPCSTR, _In_ LPCSTR, _In_ DWORD, _Reserved_ DWORD)
WINADVAPI BOOL WINAPI CredIsMarshaledCredentialW(_In_ LPCWSTR)
#define DECL_WINELIB_TYPE_AW(type)
Definition: windef.h:401
BOOL * PBOOL
Definition: windef.h:161
#define WINAPI
Definition: msvc.h:6
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
unsigned char UCHAR
Definition: xmlstorage.h:181
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185