2 * Copyright (C) 2006 Robert Shearman (for CodeWeavers)
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.
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.
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
30 #define WINADVAPI DECLSPEC_IMPORT
38 #define CREDUIAPI DECLSPEC_IMPORT
42 #ifndef __SECHANDLE_DEFINED__
43 #define __SECHANDLE_DEFINED__
44 typedef struct _SecHandle
48 } SecHandle
, *PSecHandle
;
51 #ifndef __WINE_CTXTHANDLE_DEFINED__
52 #define __WINE_CTXTHANDLE_DEFINED__
53 typedef SecHandle CtxtHandle
;
54 typedef PSecHandle PCtxtHandle
;
57 typedef struct _CREDENTIAL_ATTRIBUTEA
63 } CREDENTIAL_ATTRIBUTEA
, *PCREDENTIAL_ATTRIBUTEA
;
65 typedef struct _CREDENTIAL_ATTRIBUTEW
71 } CREDENTIAL_ATTRIBUTEW
, *PCREDENTIAL_ATTRIBUTEW
;
73 DECL_WINELIB_TYPE_AW(CREDENTIAL_ATTRIBUTE
)
74 DECL_WINELIB_TYPE_AW(PCREDENTIAL_ATTRIBUTE
)
76 typedef struct _CREDENTIALA
83 DWORD CredentialBlobSize
;
84 LPBYTE CredentialBlob
;
87 PCREDENTIAL_ATTRIBUTEA Attributes
;
90 } CREDENTIALA
, *PCREDENTIALA
;
92 typedef struct _CREDENTIALW
99 DWORD CredentialBlobSize
;
100 LPBYTE CredentialBlob
;
102 DWORD AttributeCount
;
103 PCREDENTIAL_ATTRIBUTEW Attributes
;
106 } CREDENTIALW
, *PCREDENTIALW
;
108 DECL_WINELIB_TYPE_AW(CREDENTIAL
)
109 DECL_WINELIB_TYPE_AW(PCREDENTIAL
)
111 typedef struct _CREDENTIAL_TARGET_INFORMATIONA
114 LPSTR NetbiosServerName
;
116 LPSTR NetbiosDomainName
;
123 } CREDENTIAL_TARGET_INFORMATIONA
, *PCREDENTIAL_TARGET_INFORMATIONA
;
125 typedef struct _CREDENTIAL_TARGET_INFORMATIONW
128 LPWSTR NetbiosServerName
;
129 LPWSTR DnsServerName
;
130 LPWSTR NetbiosDomainName
;
131 LPWSTR DnsDomainName
;
137 } CREDENTIAL_TARGET_INFORMATIONW
, *PCREDENTIAL_TARGET_INFORMATIONW
;
139 DECL_WINELIB_TYPE_AW(CREDENTIAL_TARGET_INFORMATION
)
140 DECL_WINELIB_TYPE_AW(PCREDENTIAL_TARGET_INFORMATION
)
142 typedef struct _CREDUI_INFOA
146 PCSTR pszMessageText
;
147 PCSTR pszCaptionText
;
149 } CREDUI_INFOA
, *PCREDUI_INFOA
;
151 typedef struct _CREDUI_INFOW
155 PCWSTR pszMessageText
;
156 PCWSTR pszCaptionText
;
158 } CREDUI_INFOW
, *PCREDUI_INFOW
;
160 DECL_WINELIB_TYPE_AW(CREDUI_INFO
)
161 DECL_WINELIB_TYPE_AW(PCREDUI_INFO
)
163 typedef enum _CRED_MARSHAL_TYPE
166 UsernameTargetCredential
,
168 } CRED_MARSHAL_TYPE
, *PCRED_MARSHAL_TYPE
;
170 #define CERT_HASH_LENGTH 20
172 typedef struct _CERT_CREDENTIAL_INFO
175 UCHAR rgbHashOfCert
[CERT_HASH_LENGTH
];
176 } CERT_CREDENTIAL_INFO
, *PCERT_CREDENTIAL_INFO
;
178 typedef struct _USERNAME_TARGET_CREDENTIAL_INFO
181 } USERNAME_TARGET_CREDENTIAL_INFO
;
183 typedef struct _BINARY_BLOB_CREDENTIAL_INFO
187 } BINARY_BLOB_CREDENTIAL_INFO
, *PBINARY_BLOB_CREDENTIAL_INFO
;
189 #define CRED_MAX_STRING_LENGTH 256
190 #define CRED_MAX_USERNAME_LENGTH 513
191 #define CRED_MAX_GENERIC_TARGET_NAME_LENGTH 32767
192 #define CRED_MAX_DOMAIN_TARGET_NAME_LENGTH 337
193 #define CRED_MAX_VALUE_SIZE 256
194 #define CRED_MAX_ATTRIBUTES 64
196 #define CRED_MAX_BLOB_SIZE 512
197 #define CRED_MAX_CREDENTIAL_BLOB_SIZE (5 * CRED_MAX_BLOB_SIZE)
199 #define CREDUI_MAX_MESSAGE_LENGTH 32767
200 #define CREDUI_MAX_CAPTION_LENGTH 128
201 #define CREDUI_MAX_GENERIC_TARGET_LENGTH CRED_MAX_GENERIC_TARGET_NAME_LENGTH
202 #define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_NAME_LENGTH
203 #define CREDUI_MAX_USERNAME_LENGTH CRED_MAX_USERNAME_LENGTH
204 #define CREDUI_MAX_PASSWORD_LENGTH (CRED_MAX_CREDENTIAL_BLOB_SIZE / 2)
206 /* flags for CREDENTIAL::Flags */
207 #define CRED_FLAGS_PASSWORD_FOR_CERT 0x0001
208 #define CRED_FLAGS_PROMPT_NOW 0x0002
209 #define CRED_FLAGS_USERNAME_TARGET 0x0004
210 #define CRED_FLAGS_OWF_CRED_BLOB 0x0008
211 #define CRED_FLAGS_VALID_FLAGS 0x000f
213 /* values for CREDENTIAL::Type */
214 #define CRED_TYPE_GENERIC 1
215 #define CRED_TYPE_DOMAIN_PASSWORD 2
216 #define CRED_TYPE_DOMAIN_CERTIFICATE 3
217 #define CRED_TYPE_DOMAIN_VISIBLE_PASSWORD 4
218 #define CRED_TYPE_GENERIC_CERTIFICATE 5
219 #define CRED_TYPE_MAXIMUM 6
220 #define CRED_TYPE_MAXIMUM_EX (CRED_TYPE_MAXIMUM+1000)
222 /* values for CREDENTIAL::Persist */
223 #define CRED_PERSIST_NONE 0
224 #define CRED_PERSIST_SESSION 1
225 #define CRED_PERSIST_LOCAL_MACHINE 2
226 #define CRED_PERSIST_ENTERPRISE 3
228 /* values for CREDENTIAL_TARGET_INFORMATION::Flags */
229 #define CRED_TI_SERVER_FORMAT_UNKNOWN 1
230 #define CRED_TI_DOMAIN_FORMAT_UNKNOWN 2
231 #define CRED_TI_ONLY_PASSWORD_REQUIRED 4
233 #define CREDUI_FLAGS_INCORRECT_PASSWORD 0x00000001
234 #define CREDUI_FLAGS_DO_NOT_PERSIST 0x00000002
235 #define CREDUI_FLAGS_REQUEST_ADMINISTRATOR 0x00000004
236 #define CREDUI_FLAGS_EXCLUDE_CERTIFICATES 0x00000008
237 #define CREDUI_FLAGS_REQUIRE_CERTIFICATE 0x00000010
238 #define CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX 0x00000040
239 #define CREDUI_FLAGS_ALWAYS_SHOW_UI 0x00000080
240 #define CREDUI_FLAGS_REQUIRE_SMARTCARD 0x00000100
241 #define CREDUI_FLAGS_PASSWORD_ONLY_OK 0x00000200
242 #define CREDUI_FLAGS_VALIDATE_USERNAME 0x00000400
243 #define CREDUI_FLAGS_COMPLETE_USERNAME 0x00000800
244 #define CREDUI_FLAGS_PERSIST 0x00001000
245 #define CREDUI_FLAGS_SERVER_CREDENTIAL 0x00004000
246 #define CREDUI_FLAGS_EXPECT_CONFIRMATION 0x00020000
247 #define CREDUI_FLAGS_GENERIC_CREDENTIALS 0x00040000
248 #define CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS 0x00080000
249 #define CREDUI_FLAGS_KEEP_USERNAME 0x00100000
251 /* flags for CredWrite and CredWriteDomainCredentials */
252 #define CRED_PRESERVE_CREDENTIAL_BLOB 0x00000001
254 WINADVAPI BOOL WINAPI
CredDeleteA(LPCSTR
,DWORD
,DWORD
);
255 WINADVAPI BOOL WINAPI
CredDeleteW(LPCWSTR
,DWORD
,DWORD
);
256 #define CredDelete WINELIB_NAME_AW(CredDelete)
257 WINADVAPI BOOL WINAPI
CredEnumerateA(LPCSTR
,DWORD
,DWORD
*,PCREDENTIALA
**);
258 WINADVAPI BOOL WINAPI
CredEnumerateW(LPCWSTR
,DWORD
,DWORD
*,PCREDENTIALW
**);
259 #define CredEnumerate WINELIB_NAME_AW(CredEnumerate)
260 WINADVAPI VOID WINAPI
CredFree(PVOID
);
261 WINADVAPI BOOL WINAPI
CredGetSessionTypes(DWORD
,LPDWORD
);
262 WINADVAPI BOOL WINAPI
CredIsMarshaledCredentialA(LPCSTR
);
263 WINADVAPI BOOL WINAPI
CredIsMarshaledCredentialW(LPCWSTR
);
264 #define CredIsMarshaledCredential WINELIB_NAME_AW(CredIsMarshaledCredential)
265 WINADVAPI BOOL WINAPI
CredMarshalCredentialA(CRED_MARSHAL_TYPE
,PVOID
,LPSTR
*);
266 WINADVAPI BOOL WINAPI
CredMarshalCredentialW(CRED_MARSHAL_TYPE
,PVOID
,LPWSTR
*);
267 #define CredMarshalCredential WINELIB_NAME_AW(CredMarshalCredential)
268 WINADVAPI BOOL WINAPI
CredReadA(LPCSTR
,DWORD
,DWORD
,PCREDENTIALA
*);
269 WINADVAPI BOOL WINAPI
CredReadW(LPCWSTR
,DWORD
,DWORD
,PCREDENTIALW
*);
270 #define CredRead WINELIB_NAME_AW(CredRead)
271 WINADVAPI BOOL WINAPI
CredReadDomainCredentialsA(PCREDENTIAL_TARGET_INFORMATIONA
,DWORD
,DWORD
*,PCREDENTIALA
**);
272 WINADVAPI BOOL WINAPI
CredReadDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW
,DWORD
,DWORD
*,PCREDENTIALW
**);
273 #define CredReadDomainCredentials WINELIB_NAME_AW(CredReadDomainCredentials)
274 WINADVAPI BOOL WINAPI
CredRenameA(LPCSTR
,LPCSTR
,DWORD
,DWORD
);
275 WINADVAPI BOOL WINAPI
CredRenameW(LPCWSTR
,LPCWSTR
,DWORD
,DWORD
);
276 #define CredRename WINELIB_NAME_AW(CredRename)
277 WINADVAPI BOOL WINAPI
CredUnmarshalCredentialA(LPCSTR
,PCRED_MARSHAL_TYPE
,PVOID
*);
278 WINADVAPI BOOL WINAPI
CredUnmarshalCredentialW(LPCWSTR
,PCRED_MARSHAL_TYPE
,PVOID
*);
279 #define CredUnmarshalCredential WINELIB_NAME_AW(CredUnmarshalCredential)
280 WINADVAPI BOOL WINAPI
CredWriteA(PCREDENTIALA
,DWORD
);
281 WINADVAPI BOOL WINAPI
CredWriteW(PCREDENTIALW
,DWORD
);
282 #define CredWrite WINELIB_NAME_AW(CredWrite)
284 CREDUIAPI BOOL WINAPI
CredPackAuthenticationBufferW(DWORD
,LPWSTR
,LPWSTR
,PBYTE
,DWORD
*);
285 CREDUIAPI BOOL WINAPI
CredUnPackAuthenticationBufferW(DWORD
,PVOID
,DWORD
,LPWSTR
,DWORD
*,LPWSTR
,DWORD
*,LPWSTR
,DWORD
*);
286 CREDUIAPI DWORD WINAPI
CredUICmdLinePromptForCredentialsW(PCWSTR
,PCtxtHandle
,DWORD
,PWSTR
,ULONG
,PWSTR
,ULONG
,PBOOL
,DWORD
);
287 CREDUIAPI DWORD WINAPI
CredUICmdLinePromptForCredentialsA(PCSTR
,PCtxtHandle
,DWORD
,PSTR
,ULONG
,PSTR
,ULONG
,PBOOL
,DWORD
);
288 #define CredUICmdLinePromptForCredentials WINELIB_NAME_AW(CredUICmdLinePromptForCredentials)
289 CREDUIAPI DWORD WINAPI
CredUIConfirmCredentialsW(PCWSTR
,BOOL
);
290 CREDUIAPI DWORD WINAPI
CredUIConfirmCredentialsA(PCSTR
,BOOL
);
291 #define CredUIConfirmCredentials WINELIB_NAME_AW(CredUIConfirmCredentials)
292 CREDUIAPI DWORD WINAPI
CredUIParseUserNameW(PCWSTR
,PWSTR
,ULONG
,PWSTR
,ULONG
);
293 CREDUIAPI DWORD WINAPI
CredUIParseUserNameA(PCSTR
,PSTR
,ULONG
,PSTR
,ULONG
);
294 #define CredUIParseUserName WINELIB_NAME_AW(CredUIParseUserName)
295 CREDUIAPI DWORD WINAPI
CredUIPromptForCredentialsW(PCREDUI_INFOW
,PCWSTR
,PCtxtHandle
,DWORD
,PWSTR
,ULONG
,PWSTR
,ULONG
,PBOOL
,DWORD
);
296 CREDUIAPI DWORD WINAPI
CredUIPromptForCredentialsA(PCREDUI_INFOA
,PCSTR
,PCtxtHandle
,DWORD
,PSTR
,ULONG
,PSTR
,ULONG
,PBOOL
,DWORD
);
297 #define CredUIPromptForCredentials WINELIB_NAME_AW(CredUIPromptForCredentials)
298 CREDUIAPI DWORD WINAPI
CredUIPromptForWindowsCredentialsW(PCREDUI_INFOW
,DWORD
,ULONG
*,LPCVOID
,ULONG
,LPVOID
*, ULONG
*, BOOL
*,
300 CREDUIAPI DWORD WINAPI
CredUIStoreSSOCredW(PCWSTR
,PCWSTR
,PCWSTR
,BOOL
);
301 /* Note: no CredUIStoreSSOCredA in PSDK header */
302 CREDUIAPI DWORD WINAPI
CredUIReadSSOCredW(PCWSTR
,PWSTR
*);
303 /* Note: no CredUIReadSSOCredA in PSDK header */
309 #endif /* _WINCRED_H_ */