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 | /*
|
---|
20 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
21 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
22 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
23 | * a choice of LGPL license versions is made available with the language indicating
|
---|
24 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
25 | * of the LGPL is applied is otherwise unspecified.
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef _WINCRED_H_
|
---|
29 | #define _WINCRED_H_
|
---|
30 |
|
---|
31 | #ifdef __cplusplus
|
---|
32 | extern "C" {
|
---|
33 | #endif
|
---|
34 |
|
---|
35 | #ifdef _ADVAPI32_
|
---|
36 | #define WINADVAPI
|
---|
37 | #else
|
---|
38 | #define WINADVAPI DECLSPEC_IMPORT
|
---|
39 | #endif
|
---|
40 |
|
---|
41 | #ifndef __SECHANDLE_DEFINED__
|
---|
42 | #define __SECHANDLE_DEFINED__
|
---|
43 | typedef struct _SecHandle
|
---|
44 | {
|
---|
45 | ULONG_PTR dwLower;
|
---|
46 | ULONG_PTR dwUpper;
|
---|
47 | } SecHandle, *PSecHandle;
|
---|
48 | #endif
|
---|
49 |
|
---|
50 | #ifndef __WINE_CTXTHANDLE_DEFINED__
|
---|
51 | #define __WINE_CTXTHANDLE_DEFINED__
|
---|
52 | typedef SecHandle CtxtHandle;
|
---|
53 | typedef PSecHandle PCtxtHandle;
|
---|
54 | #endif
|
---|
55 |
|
---|
56 | typedef struct _CREDENTIAL_ATTRIBUTEA
|
---|
57 | {
|
---|
58 | LPSTR Keyword;
|
---|
59 | DWORD Flags;
|
---|
60 | DWORD ValueSize;
|
---|
61 | LPBYTE Value;
|
---|
62 | } CREDENTIAL_ATTRIBUTEA, *PCREDENTIAL_ATTRIBUTEA;
|
---|
63 |
|
---|
64 | typedef struct _CREDENTIAL_ATTRIBUTEW
|
---|
65 | {
|
---|
66 | LPWSTR Keyword;
|
---|
67 | DWORD Flags;
|
---|
68 | DWORD ValueSize;
|
---|
69 | LPBYTE Value;
|
---|
70 | } CREDENTIAL_ATTRIBUTEW, *PCREDENTIAL_ATTRIBUTEW;
|
---|
71 |
|
---|
72 | DECL_WINELIB_TYPE_AW(CREDENTIAL_ATTRIBUTE)
|
---|
73 | DECL_WINELIB_TYPE_AW(PCREDENTIAL_ATTRIBUTE)
|
---|
74 |
|
---|
75 | typedef struct _CREDENTIALA
|
---|
76 | {
|
---|
77 | DWORD Flags;
|
---|
78 | DWORD Type;
|
---|
79 | LPSTR TargetName;
|
---|
80 | LPSTR Comment;
|
---|
81 | FILETIME LastWritten;
|
---|
82 | DWORD CredentialBlobSize;
|
---|
83 | LPBYTE CredentialBlob;
|
---|
84 | DWORD Persist;
|
---|
85 | DWORD AttributeCount;
|
---|
86 | PCREDENTIAL_ATTRIBUTEA Attributes;
|
---|
87 | LPSTR TargetAlias;
|
---|
88 | LPSTR UserName;
|
---|
89 | } CREDENTIALA, *PCREDENTIALA;
|
---|
90 |
|
---|
91 | typedef struct _CREDENTIALW
|
---|
92 | {
|
---|
93 | DWORD Flags;
|
---|
94 | DWORD Type;
|
---|
95 | LPWSTR TargetName;
|
---|
96 | LPWSTR Comment;
|
---|
97 | FILETIME LastWritten;
|
---|
98 | DWORD CredentialBlobSize;
|
---|
99 | LPBYTE CredentialBlob;
|
---|
100 | DWORD Persist;
|
---|
101 | DWORD AttributeCount;
|
---|
102 | PCREDENTIAL_ATTRIBUTEW Attributes;
|
---|
103 | LPWSTR TargetAlias;
|
---|
104 | LPWSTR UserName;
|
---|
105 | } CREDENTIALW, *PCREDENTIALW;
|
---|
106 |
|
---|
107 | DECL_WINELIB_TYPE_AW(CREDENTIAL)
|
---|
108 | DECL_WINELIB_TYPE_AW(PCREDENTIAL)
|
---|
109 |
|
---|
110 | typedef struct _CREDENTIAL_TARGET_INFORMATIONA
|
---|
111 | {
|
---|
112 | LPSTR TargetName;
|
---|
113 | LPSTR NetbiosServerName;
|
---|
114 | LPSTR DnsServerName;
|
---|
115 | LPSTR NetbiosDomainName;
|
---|
116 | LPSTR DnsDomainName;
|
---|
117 | LPSTR DnsTreeName;
|
---|
118 | LPSTR PackageName;
|
---|
119 | DWORD Flags;
|
---|
120 | DWORD CredTypeCount;
|
---|
121 | LPDWORD CredTypes;
|
---|
122 | } CREDENTIAL_TARGET_INFORMATIONA, *PCREDENTIAL_TARGET_INFORMATIONA;
|
---|
123 |
|
---|
124 | typedef struct _CREDENTIAL_TARGET_INFORMATIONW
|
---|
125 | {
|
---|
126 | LPWSTR TargetName;
|
---|
127 | LPWSTR NetbiosServerName;
|
---|
128 | LPWSTR DnsServerName;
|
---|
129 | LPWSTR NetbiosDomainName;
|
---|
130 | LPWSTR DnsDomainName;
|
---|
131 | LPWSTR DnsTreeName;
|
---|
132 | LPWSTR PackageName;
|
---|
133 | DWORD Flags;
|
---|
134 | DWORD CredTypeCount;
|
---|
135 | LPDWORD CredTypes;
|
---|
136 | } CREDENTIAL_TARGET_INFORMATIONW, *PCREDENTIAL_TARGET_INFORMATIONW;
|
---|
137 |
|
---|
138 | DECL_WINELIB_TYPE_AW(CREDENTIAL_TARGET_INFORMATION)
|
---|
139 | DECL_WINELIB_TYPE_AW(PCREDENTIAL_TARGET_INFORMATION)
|
---|
140 |
|
---|
141 | typedef struct _CREDUI_INFOA
|
---|
142 | {
|
---|
143 | DWORD cbSize;
|
---|
144 | HWND hwndParent;
|
---|
145 | PCSTR pszMessageText;
|
---|
146 | PCSTR pszCaptionText;
|
---|
147 | HBITMAP hbmBanner;
|
---|
148 | } CREDUI_INFOA, *PCREDUI_INFOA;
|
---|
149 |
|
---|
150 | typedef struct _CREDUI_INFOW
|
---|
151 | {
|
---|
152 | DWORD cbSize;
|
---|
153 | HWND hwndParent;
|
---|
154 | PCWSTR pszMessageText;
|
---|
155 | PCWSTR pszCaptionText;
|
---|
156 | HBITMAP hbmBanner;
|
---|
157 | } CREDUI_INFOW, *PCREDUI_INFOW;
|
---|
158 |
|
---|
159 | DECL_WINELIB_TYPE_AW(CREDUI_INFO)
|
---|
160 | DECL_WINELIB_TYPE_AW(PCREDUI_INFO)
|
---|
161 |
|
---|
162 | #define CRED_MAX_STRING_LENGTH 256
|
---|
163 | #define CRED_MAX_USERNAME_LENGTH 513
|
---|
164 | #define CRED_MAX_GENERIC_TARGET_NAME_LENGTH 32767
|
---|
165 | #define CRED_MAX_DOMAIN_TARGET_NAME_LENGTH 337
|
---|
166 | #define CRED_MAX_VALUE_SIZE 256
|
---|
167 | #define CRED_MAX_ATTRIBUTES 64
|
---|
168 |
|
---|
169 | #define CRED_MAX_BLOB_SIZE 512
|
---|
170 |
|
---|
171 | #define CREDUI_MAX_MESSAGE_LENGTH 32767
|
---|
172 | #define CREDUI_MAX_CAPTION_LENGTH 128
|
---|
173 | #define CREDUI_MAX_GENERIC_TARGET_LENGTH CRED_MAX_GENERIC_TARGET_NAME_LENGTH
|
---|
174 | #define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_LENGTH
|
---|
175 | #define CREDUI_MAX_USERNAME_LENGTH CRED_MAX_USERNAME_LENGTH
|
---|
176 | #define CREDUI_MAX_PASSWORD_LENGTH (CRED_MAX_CREDENTIAL_BLOB_SIZE / 2)
|
---|
177 |
|
---|
178 | /* flags for CREDENTIAL::Flags */
|
---|
179 | #define CRED_FLAGS_PASSWORD_FOR_CERT 0x0001
|
---|
180 | #define CRED_FLAGS_PROMPT_NOW 0x0002
|
---|
181 | #define CRED_FLAGS_USERNAME_TARGET 0x0004
|
---|
182 | #define CRED_FLAGS_OWF_CRED_BLOB 0x0008
|
---|
183 | #define CRED_FLAGS_VALID_FLAGS 0x000f
|
---|
184 |
|
---|
185 | /* values for CREDENTIAL::Type */
|
---|
186 | #define CRED_TYPE_GENERIC 1
|
---|
187 | #define CRED_TYPE_DOMAIN_PASSWORD 2
|
---|
188 | #define CRED_TYPE_DOMAIN_CERTIFICATE 3
|
---|
189 | #define CRED_TYPE_DOMAIN_VISIBLE_PASSWORD 4
|
---|
190 | #define CRED_TYPE_GENERIC_CERTIFICATE 5
|
---|
191 | #define CRED_TYPE_MAXIMUM 6
|
---|
192 | #define CRED_TYPE_MAXIMUM_EX (CRED_TYPE_MAXIMUM+1000)
|
---|
193 |
|
---|
194 | /* values for CREDENTIAL::Persist */
|
---|
195 | #define CRED_PERSIST_NONE 0
|
---|
196 | #define CRED_PERSIST_SESSION 1
|
---|
197 | #define CRED_PERSIST_LOCAL_MACHINE 2
|
---|
198 | #define CRED_PERSIST_ENTERPRISE 3
|
---|
199 |
|
---|
200 | /* values for CREDENTIAL_TARGET_INFORMATION::Flags */
|
---|
201 | #define CRED_TI_SERVER_FORMAT_UNKNOWN 1
|
---|
202 | #define CRED_TI_DOMAIN_FORMAT_UNKNOWN 2
|
---|
203 | #define CRED_TI_ONLY_PASSWORD_REQUIRED 4
|
---|
204 |
|
---|
205 | #define CREDUI_FLAGS_INCORRECT_PASSWORD 0x00000001
|
---|
206 | #define CREDUI_FLAGS_DO_NOT_PERSIST 0x00000002
|
---|
207 | #define CREDUI_FLAGS_REQUEST_ADMINISTRATOR 0x00000004
|
---|
208 | #define CREDUI_FLAGS_EXCLUDE_CERTIFICATES 0x00000008
|
---|
209 | #define CREDUI_FLAGS_REQUIRE_CERTIFICATE 0x00000010
|
---|
210 | #define CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX 0x00000040
|
---|
211 | #define CREDUI_FLAGS_ALWAYS_SHOW_UI 0x00000080
|
---|
212 | #define CREDUI_FLAGS_REQUIRE_SMARTCARD 0x00000100
|
---|
213 | #define CREDUI_FLAGS_PASSWORD_ONLY_OK 0x00000200
|
---|
214 | #define CREDUI_FLAGS_VALIDATE_USERNAME 0x00000400
|
---|
215 | #define CREDUI_FLAGS_COMPLETE_USERNAME 0x00000800
|
---|
216 | #define CREDUI_FLAGS_PERSIST 0x00001000
|
---|
217 | #define CREDUI_FLAGS_SERVER_CREDENTIAL 0x00004000
|
---|
218 | #define CREDUI_FLAGS_EXPECT_CONFIRMATION 0x00020000
|
---|
219 | #define CREDUI_FLAGS_GENERIC_CREDENTIALS 0x00040000
|
---|
220 | #define CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS 0x00080000
|
---|
221 | #define CREDUI_FLAGS_KEEP_USERNAME 0x00100000
|
---|
222 |
|
---|
223 | /* flags for CredWrite and CredWriteDomainCredentials */
|
---|
224 | #define CRED_PRESERVE_CREDENTIAL_BLOB 0x00000001
|
---|
225 |
|
---|
226 | WINADVAPI BOOL WINAPI CredDeleteA(LPCSTR,DWORD,DWORD);
|
---|
227 | WINADVAPI BOOL WINAPI CredDeleteW(LPCWSTR,DWORD,DWORD);
|
---|
228 | #define CredDelete WINELIB_NAME_AW(CredDelete)
|
---|
229 | WINADVAPI BOOL WINAPI CredEnumerateA(LPCSTR,DWORD,DWORD *,PCREDENTIALA **);
|
---|
230 | WINADVAPI BOOL WINAPI CredEnumerateW(LPCWSTR,DWORD,DWORD *,PCREDENTIALW **);
|
---|
231 | #define CredEnumerate WINELIB_NAME_AW(CredEnumerate)
|
---|
232 | WINADVAPI VOID WINAPI CredFree(PVOID);
|
---|
233 | WINADVAPI BOOL WINAPI CredGetSessionTypes(DWORD,LPDWORD);
|
---|
234 | WINADVAPI BOOL WINAPI CredReadA(LPCSTR,DWORD,DWORD,PCREDENTIALA *);
|
---|
235 | WINADVAPI BOOL WINAPI CredReadW(LPCWSTR,DWORD,DWORD,PCREDENTIALW *);
|
---|
236 | #define CredRead WINELIB_NAME_AW(CredRead)
|
---|
237 | WINADVAPI BOOL WINAPI CredReadDomainCredentialsA(PCREDENTIAL_TARGET_INFORMATIONA,DWORD,DWORD *,PCREDENTIALA **);
|
---|
238 | WINADVAPI BOOL WINAPI CredReadDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW,DWORD,DWORD *,PCREDENTIALW **);
|
---|
239 | #define CredReadDomainCredentials WINELIB_NAME_AW(CredReadDomainCredentials)
|
---|
240 | WINADVAPI BOOL WINAPI CredRenameA(LPCSTR,LPCSTR,DWORD,DWORD);
|
---|
241 | WINADVAPI BOOL WINAPI CredRenameW(LPCWSTR,LPCWSTR,DWORD,DWORD);
|
---|
242 | #define CredRename WINELIB_NAME_AW(CredRename)
|
---|
243 | WINADVAPI BOOL WINAPI CredWriteA(PCREDENTIALA,DWORD);
|
---|
244 | WINADVAPI BOOL WINAPI CredWriteW(PCREDENTIALW,DWORD);
|
---|
245 | #define CredWrite WINELIB_NAME_AW(CredWrite)
|
---|
246 |
|
---|
247 | DWORD WINAPI CredUICmdLinePromptForCredentialsW(PCWSTR,PCtxtHandle,DWORD,PWSTR,ULONG,PWSTR,ULONG,PBOOL,DWORD);
|
---|
248 | DWORD WINAPI CredUICmdLinePromptForCredentialsA(PCSTR,PCtxtHandle,DWORD,PSTR,ULONG,PSTR,ULONG,PBOOL,DWORD);
|
---|
249 | #define CredUICmdLinePromptForCredentials WINELIB_NAME_AW(CredUICmdLinePromptForCredentials)
|
---|
250 | DWORD WINAPI CredUIConfirmCredentialsW(PCWSTR,BOOL);
|
---|
251 | DWORD WINAPI CredUIConfirmCredentialsA(PCSTR,BOOL);
|
---|
252 | #define CredUIConfirmCredentials WINELIB_NAME_AW(CredUIConfirmCredentials)
|
---|
253 | DWORD WINAPI CredUIParseUserNameW(PCWSTR,PWSTR,ULONG,PWSTR,ULONG);
|
---|
254 | DWORD WINAPI CredUIParseUserNameA(PCSTR,PSTR,ULONG,PSTR,ULONG);
|
---|
255 | #define CredUIParseUserName WINELIB_NAME_AW(CredUIParseUserName)
|
---|
256 | DWORD WINAPI CredUIPromptForCredentialsW(PCREDUI_INFOW,PCWSTR,PCtxtHandle,DWORD,PWSTR,ULONG,PWSTR,ULONG,PBOOL,DWORD);
|
---|
257 | DWORD WINAPI CredUIPromptForCredentialsA(PCREDUI_INFOA,PCSTR,PCtxtHandle,DWORD,PSTR,ULONG,PSTR,ULONG,PBOOL,DWORD);
|
---|
258 | #define CredUIPromptForCredentials WINELIB_NAME_AW(CredUIPromptForCredentials)
|
---|
259 | DWORD WINAPI CredUIStoreSSOCredW(PCWSTR,PCWSTR,PCWSTR,BOOL);
|
---|
260 | /* Note: no CredUIStoreSSOCredA in PSDK header */
|
---|
261 | DWORD WINAPI CredUIReadSSOCredW(PCWSTR,PWSTR*);
|
---|
262 | /* Note: no CredUIReadSSOCredA in PSDK header */
|
---|
263 |
|
---|
264 | #ifdef __cplusplus
|
---|
265 | }
|
---|
266 | #endif
|
---|
267 |
|
---|
268 | #endif /* _WINCRED_H_ */
|
---|