wininet: Add test for FtpGetCurrentDirectoryA in wininet/tests/ftp.c.
[wine/gsoc_dplay.git] / include / wincred.h
blob34c4f352cf74b77e7111db21572a8f0c0117a1cb
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 _CREDUI_INFOA
103 DWORD cbSize;
104 HWND hwndParent;
105 PCSTR pszMessageText;
106 PCSTR pszCaptionText;
107 HBITMAP hbmBanner;
108 } CREDUI_INFOA, *PCREDUI_INFOA;
110 typedef struct _CREDUI_INFOW
112 DWORD cbSize;
113 HWND hwndParent;
114 PCWSTR pszMessageText;
115 PCWSTR pszCaptionText;
116 HBITMAP hbmBanner;
117 } CREDUI_INFOW, *PCREDUI_INFOW;
119 DECL_WINELIB_TYPE_AW(CREDUI_INFO)
120 DECL_WINELIB_TYPE_AW(PCREDUI_INFO)
122 #define CRED_MAX_STRING_LENGTH 256
123 #define CRED_MAX_USERNAME_LENGTH 513
124 #define CRED_MAX_GENERIC_TARGET_NAME_LENGTH 32767
125 #define CRED_MAX_DOMAIN_TARGET_NAME_LENGTH 337
126 #define CRED_MAX_VALUE_SIZE 256
127 #define CRED_MAX_ATTRIBUTES 64
129 #define CRED_MAX_BLOB_SIZE 512
131 #define CREDUI_MAX_MESSAGE_LENGTH 32767
132 #define CREDUI_MAX_CAPTION_LENGTH 128
133 #define CREDUI_MAX_GENERIC_TARGET_LENGTH CRED_MAX_GENERIC_TARGET_NAME_LENGTH
134 #define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_LENGTH
135 #define CREDUI_MAX_USERNAME_LENGTH CRED_MAX_USERNAME_LENGTH
136 #define CREDUI_MAX_PASSWORD_LENGTH (CRED_MAX_CREDENTIAL_BLOB_SIZE / 2)
138 /* flags for CREDENTIAL::Flags */
139 #define CRED_FLAGS_PASSWORD_FOR_CERT 0x0001
140 #define CRED_FLAGS_PROMPT_NOW 0x0002
141 #define CRED_FLAGS_USERNAME_TARGET 0x0004
142 #define CRED_FLAGS_OWF_CRED_BLOB 0x0008
143 #define CRED_FLAGS_VALID_FLAGS 0x000f
145 /* values for CREDENTIAL::Type */
146 #define CRED_TYPE_GENERIC 1
147 #define CRED_TYPE_DOMAIN_PASSWORD 2
148 #define CRED_TYPE_DOMAIN_CERTIFICATE 3
149 #define CRED_TYPE_DOMAIN_VISIBLE_PASSWORD 4
150 #define CRED_TYPE_MAXIMUM 5
152 /* values for CREDENTIAL::Persist */
153 #define CRED_PERSIST_NONE 0
154 #define CRED_PERSIST_SESSION 1
155 #define CRED_PERSIST_LOCAL_MACHINE 2
156 #define CRED_PERSIST_ENTERPRISE 3
158 #define CREDUI_FLAGS_INCORRECT_PASSWORD 0x00000001
159 #define CREDUI_FLAGS_DO_NOT_PERSIST 0x00000002
160 #define CREDUI_FLAGS_REQUEST_ADMINISTRATOR 0x00000004
161 #define CREDUI_FLAGS_EXCLUDE_CERTIFICATES 0x00000008
162 #define CREDUI_FLAGS_REQUIRE_CERTIFICATE 0x00000010
163 #define CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX 0x00000040
164 #define CREDUI_FLAGS_ALWAYS_SHOW_UI 0x00000080
165 #define CREDUI_FLAGS_REQUIRE_SMARTCARD 0x00000100
166 #define CREDUI_FLAGS_PASSWORD_ONLY_OK 0x00000200
167 #define CREDUI_FLAGS_VALIDATE_USERNAME 0x00000400
168 #define CREDUI_FLAGS_COMPLETE_USERNAME 0x00000800
169 #define CREDUI_FLAGS_PERSIST 0x00001000
170 #define CREDUI_FLAGS_SERVER_CREDENTIAL 0x00004000
171 #define CREDUI_FLAGS_EXPECT_CONFIRMATION 0x00020000
172 #define CREDUI_FLAGS_GENERIC_CREDENTIALS 0x00040000
173 #define CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS 0x00080000
174 #define CREDUI_FLAGS_KEEP_USERNAME 0x00100000
176 /* flags for CredWrite and CredWriteDomainCredentials */
177 #define CRED_PRESERVE_CREDENTIAL_BLOB 0x00000001
179 WINADVAPI BOOL WINAPI CredDeleteA(LPCSTR,DWORD,DWORD);
180 WINADVAPI BOOL WINAPI CredDeleteW(LPCWSTR,DWORD,DWORD);
181 #define CredDelete WINELIB_NAME_AW(CredDelete)
182 WINADVAPI BOOL WINAPI CredEnumerateA(LPCSTR,DWORD,DWORD *,PCREDENTIALA **);
183 WINADVAPI BOOL WINAPI CredEnumerateW(LPCWSTR,DWORD,DWORD *,PCREDENTIALW **);
184 #define CredEnumerate WINELIB_NAME_AW(CredEnumerate)
185 WINADVAPI VOID WINAPI CredFree(PVOID);
186 WINADVAPI BOOL WINAPI CredReadA(LPCSTR,DWORD,DWORD,PCREDENTIALA *);
187 WINADVAPI BOOL WINAPI CredReadW(LPCWSTR,DWORD,DWORD,PCREDENTIALW *);
188 #define CredRead WINELIB_NAME_AW(CredRead)
189 WINADVAPI BOOL WINAPI CredRenameA(LPCSTR,LPCSTR,DWORD,DWORD);
190 WINADVAPI BOOL WINAPI CredRenameW(LPCWSTR,LPCWSTR,DWORD,DWORD);
191 #define CredRename WINELIB_NAME_AW(CredRename)
192 WINADVAPI BOOL WINAPI CredWriteA(PCREDENTIALA,DWORD);
193 WINADVAPI BOOL WINAPI CredWriteW(PCREDENTIALW,DWORD);
194 #define CredWrite WINELIB_NAME_AW(CredWrite)
196 DWORD WINAPI CredUICmdLinePromptForCredentialsW(PCWSTR,PCtxtHandle,DWORD,PWSTR,ULONG,PWSTR,ULONG,PBOOL,DWORD);
197 DWORD WINAPI CredUICmdLinePromptForCredentialsA(PCSTR,PCtxtHandle,DWORD,PSTR,ULONG,PSTR,ULONG,PBOOL,DWORD);
198 #define CredUICmdLinePromptForCredentials WINELIB_NAME_AW(CredUICmdLinePromptForCredentials)
199 DWORD WINAPI CredUIConfirmCredentialsW(PCWSTR,BOOL);
200 DWORD WINAPI CredUIConfirmCredentialsA(PCSTR,BOOL);
201 #define CredUIConfirmCredentials WINELIB_NAME_AW(CredUIConfirmCredentials)
202 DWORD WINAPI CredUIParseUserNameW(PCWSTR,PWSTR,ULONG,PWSTR,ULONG);
203 DWORD WINAPI CredUIParseUserNameA(PCSTR,PSTR,ULONG,PSTR,ULONG);
204 #define CredUIParseUserName WINELIB_NAME_AW(CredUIParseUserName)
205 DWORD WINAPI CredUIPromptForCredentialsW(PCREDUI_INFOW,PCWSTR,PCtxtHandle,DWORD,PWSTR,ULONG,PWSTR,ULONG,PBOOL,DWORD);
206 DWORD WINAPI CredUIPromptForCredentialsA(PCREDUI_INFOA,PCSTR,PCtxtHandle,DWORD,PSTR,ULONG,PSTR,ULONG,PBOOL,DWORD);
207 #define CredUIPromptForCredentials WINELIB_NAME_AW(CredUIPromptForCredentials)
208 DWORD WINAPI CredUIStoreSSOCredW(PCWSTR,PCWSTR,PCWSTR,BOOL);
209 /* Note: no CredUIStoreSSOCredA in PSDK header */
210 DWORD WINAPI CredUIReadSSOCredW(PCWSTR,PWSTR*);
211 /* Note: no CredUIReadSSOCredA in PSDK header */
213 #ifdef __cplusplus
215 #endif
217 #endif /* _WINCRED_H_ */