wined3d: Directly call wined3d_texture_create() to create swapchain textures.
[wine.git] / include / wincred.h
blob6309ce6d5700c1398b5609c085f3f9812c18a61b
1 /*
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
19 #ifndef _WINCRED_H_
20 #define _WINCRED_H_
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
26 #ifndef WINADVAPI
27 #ifdef _ADVAPI32_
28 #define WINADVAPI
29 #else
30 #define WINADVAPI DECLSPEC_IMPORT
31 #endif
32 #endif
34 #ifndef __SECHANDLE_DEFINED__
35 #define __SECHANDLE_DEFINED__
36 typedef struct _SecHandle
38 ULONG_PTR dwLower;
39 ULONG_PTR dwUpper;
40 } SecHandle, *PSecHandle;
41 #endif
43 #ifndef __WINE_CTXTHANDLE_DEFINED__
44 #define __WINE_CTXTHANDLE_DEFINED__
45 typedef SecHandle CtxtHandle;
46 typedef PSecHandle PCtxtHandle;
47 #endif
49 typedef struct _CREDENTIAL_ATTRIBUTEA
51 LPSTR Keyword;
52 DWORD Flags;
53 DWORD ValueSize;
54 LPBYTE Value;
55 } CREDENTIAL_ATTRIBUTEA, *PCREDENTIAL_ATTRIBUTEA;
57 typedef struct _CREDENTIAL_ATTRIBUTEW
59 LPWSTR Keyword;
60 DWORD Flags;
61 DWORD ValueSize;
62 LPBYTE Value;
63 } CREDENTIAL_ATTRIBUTEW, *PCREDENTIAL_ATTRIBUTEW;
65 DECL_WINELIB_TYPE_AW(CREDENTIAL_ATTRIBUTE)
66 DECL_WINELIB_TYPE_AW(PCREDENTIAL_ATTRIBUTE)
68 typedef struct _CREDENTIALA
70 DWORD Flags;
71 DWORD Type;
72 LPSTR TargetName;
73 LPSTR Comment;
74 FILETIME LastWritten;
75 DWORD CredentialBlobSize;
76 LPBYTE CredentialBlob;
77 DWORD Persist;
78 DWORD AttributeCount;
79 PCREDENTIAL_ATTRIBUTEA Attributes;
80 LPSTR TargetAlias;
81 LPSTR UserName;
82 } CREDENTIALA, *PCREDENTIALA;
84 typedef struct _CREDENTIALW
86 DWORD Flags;
87 DWORD Type;
88 LPWSTR TargetName;
89 LPWSTR Comment;
90 FILETIME LastWritten;
91 DWORD CredentialBlobSize;
92 LPBYTE CredentialBlob;
93 DWORD Persist;
94 DWORD AttributeCount;
95 PCREDENTIAL_ATTRIBUTEW Attributes;
96 LPWSTR TargetAlias;
97 LPWSTR UserName;
98 } CREDENTIALW, *PCREDENTIALW;
100 DECL_WINELIB_TYPE_AW(CREDENTIAL)
101 DECL_WINELIB_TYPE_AW(PCREDENTIAL)
103 typedef struct _CREDENTIAL_TARGET_INFORMATIONA
105 LPSTR TargetName;
106 LPSTR NetbiosServerName;
107 LPSTR DnsServerName;
108 LPSTR NetbiosDomainName;
109 LPSTR DnsDomainName;
110 LPSTR DnsTreeName;
111 LPSTR PackageName;
112 DWORD Flags;
113 DWORD CredTypeCount;
114 LPDWORD CredTypes;
115 } CREDENTIAL_TARGET_INFORMATIONA, *PCREDENTIAL_TARGET_INFORMATIONA;
117 typedef struct _CREDENTIAL_TARGET_INFORMATIONW
119 LPWSTR TargetName;
120 LPWSTR NetbiosServerName;
121 LPWSTR DnsServerName;
122 LPWSTR NetbiosDomainName;
123 LPWSTR DnsDomainName;
124 LPWSTR DnsTreeName;
125 LPWSTR PackageName;
126 DWORD Flags;
127 DWORD CredTypeCount;
128 LPDWORD CredTypes;
129 } CREDENTIAL_TARGET_INFORMATIONW, *PCREDENTIAL_TARGET_INFORMATIONW;
131 DECL_WINELIB_TYPE_AW(CREDENTIAL_TARGET_INFORMATION)
132 DECL_WINELIB_TYPE_AW(PCREDENTIAL_TARGET_INFORMATION)
134 typedef struct _CREDUI_INFOA
136 DWORD cbSize;
137 HWND hwndParent;
138 PCSTR pszMessageText;
139 PCSTR pszCaptionText;
140 HBITMAP hbmBanner;
141 } CREDUI_INFOA, *PCREDUI_INFOA;
143 typedef struct _CREDUI_INFOW
145 DWORD cbSize;
146 HWND hwndParent;
147 PCWSTR pszMessageText;
148 PCWSTR pszCaptionText;
149 HBITMAP hbmBanner;
150 } CREDUI_INFOW, *PCREDUI_INFOW;
152 DECL_WINELIB_TYPE_AW(CREDUI_INFO)
153 DECL_WINELIB_TYPE_AW(PCREDUI_INFO)
155 typedef enum _CRED_MARSHAL_TYPE
157 CertCredential = 1,
158 UsernameTargetCredential,
159 BinaryBlobCredential
160 } CRED_MARSHAL_TYPE, *PCRED_MARSHAL_TYPE;
162 #define CERT_HASH_LENGTH 20
164 typedef struct _CERT_CREDENTIAL_INFO
166 ULONG cbSize;
167 UCHAR rgbHashOfCert[CERT_HASH_LENGTH];
168 } CERT_CREDENTIAL_INFO, *PCERT_CREDENTIAL_INFO;
170 typedef struct _USERNAME_TARGET_CREDENTIAL_INFO
172 LPWSTR UserName;
173 } USERNAME_TARGET_CREDENTIAL_INFO;
175 typedef struct _BINARY_BLOB_CREDENTIAL_INFO
177 ULONG cbBlob;
178 LPBYTE pbBlob;
179 } BINARY_BLOB_CREDENTIAL_INFO, *PBINARY_BLOB_CREDENTIAL_INFO;
181 #define CRED_MAX_STRING_LENGTH 256
182 #define CRED_MAX_USERNAME_LENGTH 513
183 #define CRED_MAX_GENERIC_TARGET_NAME_LENGTH 32767
184 #define CRED_MAX_DOMAIN_TARGET_NAME_LENGTH 337
185 #define CRED_MAX_VALUE_SIZE 256
186 #define CRED_MAX_ATTRIBUTES 64
188 #define CRED_MAX_BLOB_SIZE 512
189 #define CRED_MAX_CREDENTIAL_BLOB_SIZE (5 * CRED_MAX_BLOB_SIZE)
191 #define CREDUI_MAX_MESSAGE_LENGTH 32767
192 #define CREDUI_MAX_CAPTION_LENGTH 128
193 #define CREDUI_MAX_GENERIC_TARGET_LENGTH CRED_MAX_GENERIC_TARGET_NAME_LENGTH
194 #define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_NAME_LENGTH
195 #define CREDUI_MAX_USERNAME_LENGTH CRED_MAX_USERNAME_LENGTH
196 #define CREDUI_MAX_PASSWORD_LENGTH (CRED_MAX_CREDENTIAL_BLOB_SIZE / 2)
198 /* flags for CREDENTIAL::Flags */
199 #define CRED_FLAGS_PASSWORD_FOR_CERT 0x0001
200 #define CRED_FLAGS_PROMPT_NOW 0x0002
201 #define CRED_FLAGS_USERNAME_TARGET 0x0004
202 #define CRED_FLAGS_OWF_CRED_BLOB 0x0008
203 #define CRED_FLAGS_VALID_FLAGS 0x000f
205 /* values for CREDENTIAL::Type */
206 #define CRED_TYPE_GENERIC 1
207 #define CRED_TYPE_DOMAIN_PASSWORD 2
208 #define CRED_TYPE_DOMAIN_CERTIFICATE 3
209 #define CRED_TYPE_DOMAIN_VISIBLE_PASSWORD 4
210 #define CRED_TYPE_GENERIC_CERTIFICATE 5
211 #define CRED_TYPE_MAXIMUM 6
212 #define CRED_TYPE_MAXIMUM_EX (CRED_TYPE_MAXIMUM+1000)
214 /* values for CREDENTIAL::Persist */
215 #define CRED_PERSIST_NONE 0
216 #define CRED_PERSIST_SESSION 1
217 #define CRED_PERSIST_LOCAL_MACHINE 2
218 #define CRED_PERSIST_ENTERPRISE 3
220 /* values for CREDENTIAL_TARGET_INFORMATION::Flags */
221 #define CRED_TI_SERVER_FORMAT_UNKNOWN 1
222 #define CRED_TI_DOMAIN_FORMAT_UNKNOWN 2
223 #define CRED_TI_ONLY_PASSWORD_REQUIRED 4
225 #define CREDUI_FLAGS_INCORRECT_PASSWORD 0x00000001
226 #define CREDUI_FLAGS_DO_NOT_PERSIST 0x00000002
227 #define CREDUI_FLAGS_REQUEST_ADMINISTRATOR 0x00000004
228 #define CREDUI_FLAGS_EXCLUDE_CERTIFICATES 0x00000008
229 #define CREDUI_FLAGS_REQUIRE_CERTIFICATE 0x00000010
230 #define CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX 0x00000040
231 #define CREDUI_FLAGS_ALWAYS_SHOW_UI 0x00000080
232 #define CREDUI_FLAGS_REQUIRE_SMARTCARD 0x00000100
233 #define CREDUI_FLAGS_PASSWORD_ONLY_OK 0x00000200
234 #define CREDUI_FLAGS_VALIDATE_USERNAME 0x00000400
235 #define CREDUI_FLAGS_COMPLETE_USERNAME 0x00000800
236 #define CREDUI_FLAGS_PERSIST 0x00001000
237 #define CREDUI_FLAGS_SERVER_CREDENTIAL 0x00004000
238 #define CREDUI_FLAGS_EXPECT_CONFIRMATION 0x00020000
239 #define CREDUI_FLAGS_GENERIC_CREDENTIALS 0x00040000
240 #define CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS 0x00080000
241 #define CREDUI_FLAGS_KEEP_USERNAME 0x00100000
243 /* flags for CredWrite and CredWriteDomainCredentials */
244 #define CRED_PRESERVE_CREDENTIAL_BLOB 0x00000001
246 WINADVAPI BOOL WINAPI CredDeleteA(LPCSTR,DWORD,DWORD);
247 WINADVAPI BOOL WINAPI CredDeleteW(LPCWSTR,DWORD,DWORD);
248 #define CredDelete WINELIB_NAME_AW(CredDelete)
249 WINADVAPI BOOL WINAPI CredEnumerateA(LPCSTR,DWORD,DWORD *,PCREDENTIALA **);
250 WINADVAPI BOOL WINAPI CredEnumerateW(LPCWSTR,DWORD,DWORD *,PCREDENTIALW **);
251 #define CredEnumerate WINELIB_NAME_AW(CredEnumerate)
252 WINADVAPI VOID WINAPI CredFree(PVOID);
253 WINADVAPI BOOL WINAPI CredGetSessionTypes(DWORD,LPDWORD);
254 WINADVAPI BOOL WINAPI CredIsMarshaledCredentialA(LPCSTR);
255 WINADVAPI BOOL WINAPI CredIsMarshaledCredentialW(LPCWSTR);
256 #define CredIsMarshaledCredential WINELIB_NAME_AW(CredIsMarshaledCredential)
257 WINADVAPI BOOL WINAPI CredMarshalCredentialA(CRED_MARSHAL_TYPE,PVOID,LPSTR *);
258 WINADVAPI BOOL WINAPI CredMarshalCredentialW(CRED_MARSHAL_TYPE,PVOID,LPWSTR *);
259 #define CredMarshalCredential WINELIB_NAME_AW(CredMarshalCredential)
260 WINADVAPI BOOL WINAPI CredReadA(LPCSTR,DWORD,DWORD,PCREDENTIALA *);
261 WINADVAPI BOOL WINAPI CredReadW(LPCWSTR,DWORD,DWORD,PCREDENTIALW *);
262 #define CredRead WINELIB_NAME_AW(CredRead)
263 WINADVAPI BOOL WINAPI CredReadDomainCredentialsA(PCREDENTIAL_TARGET_INFORMATIONA,DWORD,DWORD *,PCREDENTIALA **);
264 WINADVAPI BOOL WINAPI CredReadDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW,DWORD,DWORD *,PCREDENTIALW **);
265 #define CredReadDomainCredentials WINELIB_NAME_AW(CredReadDomainCredentials)
266 WINADVAPI BOOL WINAPI CredRenameA(LPCSTR,LPCSTR,DWORD,DWORD);
267 WINADVAPI BOOL WINAPI CredRenameW(LPCWSTR,LPCWSTR,DWORD,DWORD);
268 #define CredRename WINELIB_NAME_AW(CredRename)
269 WINADVAPI BOOL WINAPI CredUnmarshalCredentialA(LPCSTR,PCRED_MARSHAL_TYPE,PVOID *);
270 WINADVAPI BOOL WINAPI CredUnmarshalCredentialW(LPCWSTR,PCRED_MARSHAL_TYPE,PVOID *);
271 #define CredUnmarshalCredential WINELIB_NAME_AW(CredUnmarshalCredential)
272 WINADVAPI BOOL WINAPI CredWriteA(PCREDENTIALA,DWORD);
273 WINADVAPI BOOL WINAPI CredWriteW(PCREDENTIALW,DWORD);
274 #define CredWrite WINELIB_NAME_AW(CredWrite)
276 BOOL WINAPI CredPackAuthenticationBufferW(DWORD,LPWSTR,LPWSTR,PBYTE,DWORD *);
277 BOOL WINAPI CredUnPackAuthenticationBufferW(DWORD,PVOID,DWORD,LPWSTR,DWORD *,LPWSTR,DWORD *,LPWSTR,DWORD *);
278 DWORD WINAPI CredUICmdLinePromptForCredentialsW(PCWSTR,PCtxtHandle,DWORD,PWSTR,ULONG,PWSTR,ULONG,PBOOL,DWORD);
279 DWORD WINAPI CredUICmdLinePromptForCredentialsA(PCSTR,PCtxtHandle,DWORD,PSTR,ULONG,PSTR,ULONG,PBOOL,DWORD);
280 #define CredUICmdLinePromptForCredentials WINELIB_NAME_AW(CredUICmdLinePromptForCredentials)
281 DWORD WINAPI CredUIConfirmCredentialsW(PCWSTR,BOOL);
282 DWORD WINAPI CredUIConfirmCredentialsA(PCSTR,BOOL);
283 #define CredUIConfirmCredentials WINELIB_NAME_AW(CredUIConfirmCredentials)
284 DWORD WINAPI CredUIParseUserNameW(PCWSTR,PWSTR,ULONG,PWSTR,ULONG);
285 DWORD WINAPI CredUIParseUserNameA(PCSTR,PSTR,ULONG,PSTR,ULONG);
286 #define CredUIParseUserName WINELIB_NAME_AW(CredUIParseUserName)
287 DWORD WINAPI CredUIPromptForCredentialsW(PCREDUI_INFOW,PCWSTR,PCtxtHandle,DWORD,PWSTR,ULONG,PWSTR,ULONG,PBOOL,DWORD);
288 DWORD WINAPI CredUIPromptForCredentialsA(PCREDUI_INFOA,PCSTR,PCtxtHandle,DWORD,PSTR,ULONG,PSTR,ULONG,PBOOL,DWORD);
289 #define CredUIPromptForCredentials WINELIB_NAME_AW(CredUIPromptForCredentials)
290 DWORD WINAPI CredUIPromptForWindowsCredentialsW(PCREDUI_INFOW,DWORD,ULONG *,LPCVOID,ULONG,LPVOID *, ULONG *, BOOL *,
291 DWORD);
292 DWORD WINAPI CredUIStoreSSOCredW(PCWSTR,PCWSTR,PCWSTR,BOOL);
293 /* Note: no CredUIStoreSSOCredA in PSDK header */
294 DWORD WINAPI CredUIReadSSOCredW(PCWSTR,PWSTR*);
295 /* Note: no CredUIReadSSOCredA in PSDK header */
297 #ifdef __cplusplus
299 #endif
301 #endif /* _WINCRED_H_ */