msi: Create temp files in the destination directory instead of the root.
[wine.git] / include / wincred.h
blob59f248905d092533cc251329c19251420db5bbc7
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 #ifdef _ADVAPI32_
27 #define WINADVAPI
28 #else
29 #define WINADVAPI DECLSPEC_IMPORT
30 #endif
32 #ifndef __SECHANDLE_DEFINED__
33 #define __SECHANDLE_DEFINED__
34 typedef struct _SecHandle
36 ULONG_PTR dwLower;
37 ULONG_PTR dwUpper;
38 } SecHandle, *PSecHandle;
39 #endif
41 #ifndef __WINE_CTXTHANDLE_DEFINED__
42 #define __WINE_CTXTHANDLE_DEFINED__
43 typedef SecHandle CtxtHandle;
44 typedef PSecHandle PCtxtHandle;
45 #endif
47 typedef struct _CREDENTIAL_ATTRIBUTEA
49 LPSTR Keyword;
50 DWORD Flags;
51 DWORD ValueSize;
52 LPBYTE Value;
53 } CREDENTIAL_ATTRIBUTEA, *PCREDENTIAL_ATTRIBUTEA;
55 typedef struct _CREDENTIAL_ATTRIBUTEW
57 LPWSTR Keyword;
58 DWORD Flags;
59 DWORD ValueSize;
60 LPBYTE Value;
61 } CREDENTIAL_ATTRIBUTEW, *PCREDENTIAL_ATTRIBUTEW;
63 DECL_WINELIB_TYPE_AW(CREDENTIAL_ATTRIBUTE)
64 DECL_WINELIB_TYPE_AW(PCREDENTIAL_ATTRIBUTE)
66 typedef struct _CREDENTIALA
68 DWORD Flags;
69 DWORD Type;
70 LPSTR TargetName;
71 LPSTR Comment;
72 FILETIME LastWritten;
73 DWORD CredentialBlobSize;
74 LPBYTE CredentialBlob;
75 DWORD Persist;
76 DWORD AttributeCount;
77 PCREDENTIAL_ATTRIBUTEA Attributes;
78 LPSTR TargetAlias;
79 LPSTR UserName;
80 } CREDENTIALA, *PCREDENTIALA;
82 typedef struct _CREDENTIALW
84 DWORD Flags;
85 DWORD Type;
86 LPWSTR TargetName;
87 LPWSTR Comment;
88 FILETIME LastWritten;
89 DWORD CredentialBlobSize;
90 LPBYTE CredentialBlob;
91 DWORD Persist;
92 DWORD AttributeCount;
93 PCREDENTIAL_ATTRIBUTEW Attributes;
94 LPWSTR TargetAlias;
95 LPWSTR UserName;
96 } CREDENTIALW, *PCREDENTIALW;
98 DECL_WINELIB_TYPE_AW(CREDENTIAL)
99 DECL_WINELIB_TYPE_AW(PCREDENTIAL)
101 typedef struct _CREDENTIAL_TARGET_INFORMATIONA
103 LPSTR TargetName;
104 LPSTR NetbiosServerName;
105 LPSTR DnsServerName;
106 LPSTR NetbiosDomainName;
107 LPSTR DnsDomainName;
108 LPSTR DnsTreeName;
109 LPSTR PackageName;
110 DWORD Flags;
111 DWORD CredTypeCount;
112 LPDWORD CredTypes;
113 } CREDENTIAL_TARGET_INFORMATIONA, *PCREDENTIAL_TARGET_INFORMATIONA;
115 typedef struct _CREDENTIAL_TARGET_INFORMATIONW
117 LPWSTR TargetName;
118 LPWSTR NetbiosServerName;
119 LPWSTR DnsServerName;
120 LPWSTR NetbiosDomainName;
121 LPWSTR DnsDomainName;
122 LPWSTR DnsTreeName;
123 LPWSTR PackageName;
124 DWORD Flags;
125 DWORD CredTypeCount;
126 LPDWORD CredTypes;
127 } CREDENTIAL_TARGET_INFORMATIONW, *PCREDENTIAL_TARGET_INFORMATIONW;
129 DECL_WINELIB_TYPE_AW(CREDENTIAL_TARGET_INFORMATION)
130 DECL_WINELIB_TYPE_AW(PCREDENTIAL_TARGET_INFORMATION)
132 typedef struct _CREDUI_INFOA
134 DWORD cbSize;
135 HWND hwndParent;
136 PCSTR pszMessageText;
137 PCSTR pszCaptionText;
138 HBITMAP hbmBanner;
139 } CREDUI_INFOA, *PCREDUI_INFOA;
141 typedef struct _CREDUI_INFOW
143 DWORD cbSize;
144 HWND hwndParent;
145 PCWSTR pszMessageText;
146 PCWSTR pszCaptionText;
147 HBITMAP hbmBanner;
148 } CREDUI_INFOW, *PCREDUI_INFOW;
150 DECL_WINELIB_TYPE_AW(CREDUI_INFO)
151 DECL_WINELIB_TYPE_AW(PCREDUI_INFO)
153 #define CRED_MAX_STRING_LENGTH 256
154 #define CRED_MAX_USERNAME_LENGTH 513
155 #define CRED_MAX_GENERIC_TARGET_NAME_LENGTH 32767
156 #define CRED_MAX_DOMAIN_TARGET_NAME_LENGTH 337
157 #define CRED_MAX_VALUE_SIZE 256
158 #define CRED_MAX_ATTRIBUTES 64
160 #define CRED_MAX_BLOB_SIZE 512
162 #define CREDUI_MAX_MESSAGE_LENGTH 32767
163 #define CREDUI_MAX_CAPTION_LENGTH 128
164 #define CREDUI_MAX_GENERIC_TARGET_LENGTH CRED_MAX_GENERIC_TARGET_NAME_LENGTH
165 #define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_LENGTH
166 #define CREDUI_MAX_USERNAME_LENGTH CRED_MAX_USERNAME_LENGTH
167 #define CREDUI_MAX_PASSWORD_LENGTH (CRED_MAX_CREDENTIAL_BLOB_SIZE / 2)
169 /* flags for CREDENTIAL::Flags */
170 #define CRED_FLAGS_PASSWORD_FOR_CERT 0x0001
171 #define CRED_FLAGS_PROMPT_NOW 0x0002
172 #define CRED_FLAGS_USERNAME_TARGET 0x0004
173 #define CRED_FLAGS_OWF_CRED_BLOB 0x0008
174 #define CRED_FLAGS_VALID_FLAGS 0x000f
176 /* values for CREDENTIAL::Type */
177 #define CRED_TYPE_GENERIC 1
178 #define CRED_TYPE_DOMAIN_PASSWORD 2
179 #define CRED_TYPE_DOMAIN_CERTIFICATE 3
180 #define CRED_TYPE_DOMAIN_VISIBLE_PASSWORD 4
181 #define CRED_TYPE_GENERIC_CERTIFICATE 5
182 #define CRED_TYPE_MAXIMUM 6
183 #define CRED_TYPE_MAXIMUM_EX (CRED_TYPE_MAXIMUM+1000)
185 /* values for CREDENTIAL::Persist */
186 #define CRED_PERSIST_NONE 0
187 #define CRED_PERSIST_SESSION 1
188 #define CRED_PERSIST_LOCAL_MACHINE 2
189 #define CRED_PERSIST_ENTERPRISE 3
191 /* values for CREDENTIAL_TARGET_INFORMATION::Flags */
192 #define CRED_TI_SERVER_FORMAT_UNKNOWN 1
193 #define CRED_TI_DOMAIN_FORMAT_UNKNOWN 2
194 #define CRED_TI_ONLY_PASSWORD_REQUIRED 4
196 #define CREDUI_FLAGS_INCORRECT_PASSWORD 0x00000001
197 #define CREDUI_FLAGS_DO_NOT_PERSIST 0x00000002
198 #define CREDUI_FLAGS_REQUEST_ADMINISTRATOR 0x00000004
199 #define CREDUI_FLAGS_EXCLUDE_CERTIFICATES 0x00000008
200 #define CREDUI_FLAGS_REQUIRE_CERTIFICATE 0x00000010
201 #define CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX 0x00000040
202 #define CREDUI_FLAGS_ALWAYS_SHOW_UI 0x00000080
203 #define CREDUI_FLAGS_REQUIRE_SMARTCARD 0x00000100
204 #define CREDUI_FLAGS_PASSWORD_ONLY_OK 0x00000200
205 #define CREDUI_FLAGS_VALIDATE_USERNAME 0x00000400
206 #define CREDUI_FLAGS_COMPLETE_USERNAME 0x00000800
207 #define CREDUI_FLAGS_PERSIST 0x00001000
208 #define CREDUI_FLAGS_SERVER_CREDENTIAL 0x00004000
209 #define CREDUI_FLAGS_EXPECT_CONFIRMATION 0x00020000
210 #define CREDUI_FLAGS_GENERIC_CREDENTIALS 0x00040000
211 #define CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS 0x00080000
212 #define CREDUI_FLAGS_KEEP_USERNAME 0x00100000
214 /* flags for CredWrite and CredWriteDomainCredentials */
215 #define CRED_PRESERVE_CREDENTIAL_BLOB 0x00000001
217 WINADVAPI BOOL WINAPI CredDeleteA(LPCSTR,DWORD,DWORD);
218 WINADVAPI BOOL WINAPI CredDeleteW(LPCWSTR,DWORD,DWORD);
219 #define CredDelete WINELIB_NAME_AW(CredDelete)
220 WINADVAPI BOOL WINAPI CredEnumerateA(LPCSTR,DWORD,DWORD *,PCREDENTIALA **);
221 WINADVAPI BOOL WINAPI CredEnumerateW(LPCWSTR,DWORD,DWORD *,PCREDENTIALW **);
222 #define CredEnumerate WINELIB_NAME_AW(CredEnumerate)
223 WINADVAPI VOID WINAPI CredFree(PVOID);
224 WINADVAPI BOOL WINAPI CredGetSessionTypes(DWORD,LPDWORD);
225 WINADVAPI BOOL WINAPI CredReadA(LPCSTR,DWORD,DWORD,PCREDENTIALA *);
226 WINADVAPI BOOL WINAPI CredReadW(LPCWSTR,DWORD,DWORD,PCREDENTIALW *);
227 #define CredRead WINELIB_NAME_AW(CredRead)
228 WINADVAPI BOOL WINAPI CredReadDomainCredentialsA(PCREDENTIAL_TARGET_INFORMATIONA,DWORD,DWORD *,PCREDENTIALA **);
229 WINADVAPI BOOL WINAPI CredReadDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW,DWORD,DWORD *,PCREDENTIALW **);
230 #define CredReadDomainCredentials WINELIB_NAME_AW(CredReadDomainCredentials)
231 WINADVAPI BOOL WINAPI CredRenameA(LPCSTR,LPCSTR,DWORD,DWORD);
232 WINADVAPI BOOL WINAPI CredRenameW(LPCWSTR,LPCWSTR,DWORD,DWORD);
233 #define CredRename WINELIB_NAME_AW(CredRename)
234 WINADVAPI BOOL WINAPI CredWriteA(PCREDENTIALA,DWORD);
235 WINADVAPI BOOL WINAPI CredWriteW(PCREDENTIALW,DWORD);
236 #define CredWrite WINELIB_NAME_AW(CredWrite)
238 DWORD WINAPI CredUICmdLinePromptForCredentialsW(PCWSTR,PCtxtHandle,DWORD,PWSTR,ULONG,PWSTR,ULONG,PBOOL,DWORD);
239 DWORD WINAPI CredUICmdLinePromptForCredentialsA(PCSTR,PCtxtHandle,DWORD,PSTR,ULONG,PSTR,ULONG,PBOOL,DWORD);
240 #define CredUICmdLinePromptForCredentials WINELIB_NAME_AW(CredUICmdLinePromptForCredentials)
241 DWORD WINAPI CredUIConfirmCredentialsW(PCWSTR,BOOL);
242 DWORD WINAPI CredUIConfirmCredentialsA(PCSTR,BOOL);
243 #define CredUIConfirmCredentials WINELIB_NAME_AW(CredUIConfirmCredentials)
244 DWORD WINAPI CredUIParseUserNameW(PCWSTR,PWSTR,ULONG,PWSTR,ULONG);
245 DWORD WINAPI CredUIParseUserNameA(PCSTR,PSTR,ULONG,PSTR,ULONG);
246 #define CredUIParseUserName WINELIB_NAME_AW(CredUIParseUserName)
247 DWORD WINAPI CredUIPromptForCredentialsW(PCREDUI_INFOW,PCWSTR,PCtxtHandle,DWORD,PWSTR,ULONG,PWSTR,ULONG,PBOOL,DWORD);
248 DWORD WINAPI CredUIPromptForCredentialsA(PCREDUI_INFOA,PCSTR,PCtxtHandle,DWORD,PSTR,ULONG,PSTR,ULONG,PBOOL,DWORD);
249 #define CredUIPromptForCredentials WINELIB_NAME_AW(CredUIPromptForCredentials)
250 DWORD WINAPI CredUIStoreSSOCredW(PCWSTR,PCWSTR,PCWSTR,BOOL);
251 /* Note: no CredUIStoreSSOCredA in PSDK header */
252 DWORD WINAPI CredUIReadSSOCredW(PCWSTR,PWSTR*);
253 /* Note: no CredUIReadSSOCredA in PSDK header */
255 #ifdef __cplusplus
257 #endif
259 #endif /* _WINCRED_H_ */