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
26 #ifndef __SECHANDLE_DEFINED__
27 #define __SECHANDLE_DEFINED__
28 typedef struct _SecHandle
32 } SecHandle, *PSecHandle;
35 typedef SecHandle CtxtHandle;
36 typedef PSecHandle PCtxtHandle;
38 typedef struct _CREDENTIAL_ATTRIBUTEA
44 } CREDENTIAL_ATTRIBUTEA, *PCREDENTIAL_ATTRIBUTEA;
46 typedef struct _CREDENTIAL_ATTRIBUTEW
52 } CREDENTIAL_ATTRIBUTEW, *PCREDENTIAL_ATTRIBUTEW;
54 DECL_WINELIB_TYPE_AW(CREDENTIAL_ATTRIBUTE)
55 DECL_WINELIB_TYPE_AW(PCREDENTIAL_ATTRIBUTE)
57 typedef struct _CREDENTIALA
64 DWORD CredentialBlobSize;
65 LPBYTE CredentialBlob;
68 PCREDENTIAL_ATTRIBUTEA Attributes;
71 } CREDENTIALA, *PCREDENTIALA;
73 typedef struct _CREDENTIALW
80 DWORD CredentialBlobSize;
81 LPBYTE CredentialBlob;
84 PCREDENTIAL_ATTRIBUTEW Attributes;
87 } CREDENTIALW, *PCREDENTIALW;
89 DECL_WINELIB_TYPE_AW(CREDENTIAL)
90 DECL_WINELIB_TYPE_AW(PCREDENTIAL)
92 typedef struct _CREDUI_INFOA
99 } CREDUI_INFOA, *PCREDUI_INFOA;
101 typedef struct _CREDUI_INFOW
105 PCWSTR pszMessageText;
106 PCWSTR pszCaptionText;
108 } CREDUI_INFOW, *PCREDUI_INFOW;
110 DECL_WINELIB_TYPE_AW(CREDUI_INFO)
111 DECL_WINELIB_TYPE_AW(PCREDUI_INFO)
113 #define CRED_MAX_STRING_LENGTH 256
114 #define CRED_MAX_USERNAME_LENGTH 513
115 #define CRED_MAX_GENERIC_TARGET_NAME_LENGTH 32767
116 #define CRED_MAX_DOMAIN_TARGET_NAME_LENGTH 337
117 #define CRED_MAX_VALUE_SIZE 256
118 #define CRED_MAX_ATTRIBUTES 64
120 #define CRED_MAX_BLOB_SIZE 512
122 #define CREDUI_MAX_MESSAGE_LENGTH 32767
123 #define CREDUI_MAX_CAPTION_LENGTH 128
124 #define CREDUI_MAX_GENERIC_TARGET_LENGTH CRED_MAX_GENERIC_TARGET_NAME_LENGTH
125 #define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_LENGTH
126 #define CREDUI_MAX_USERNAME_LENGTH CRED_MAX_USERNAME_LENGTH
127 #define CREDUI_MAX_PASSWORD_LENGTH (CRED_MAX_CREDENTIAL_BLOB_SIZE / 2)
129 /* flags for CREDENTIAL::Flags */
130 #define CRED_FLAGS_PASSWORD_FOR_CERT 0x0001
131 #define CRED_FLAGS_PROMPT_NOW 0x0002
132 #define CRED_FLAGS_USERNAME_TARGET 0x0004
133 #define CRED_FLAGS_OWF_CRED_BLOB 0x0008
134 #define CRED_FLAGS_VALID_FLAGS 0x000f
136 /* values for CREDENTIAL::Type */
137 #define CRED_TYPE_GENERIC 1
138 #define CRED_TYPE_DOMAIN_PASSWORD 2
139 #define CRED_TYPE_DOMAIN_CERTIFICATE 3
140 #define CRED_TYPE_DOMAIN_VISIBLE_PASSWORD 4
141 #define CRED_TYPE_MAXIMUM 5
143 /* values for CREDENTIAL::Persist */
144 #define CRED_PERSIST_NONE 0
145 #define CRED_PERSIST_SESSION 1
146 #define CRED_PERSIST_LOCAL_MACHINE 2
147 #define CRED_PERSIST_ENTERPRISE 3
149 #define CREDUI_FLAGS_INCORRECT_PASSWORD 0x00000001
150 #define CREDUI_FLAGS_DO_NOT_PERSIST 0x00000002
151 #define CREDUI_FLAGS_REQUEST_ADMINISTRATOR 0x00000004
152 #define CREDUI_FLAGS_EXCLUDE_CERTIFICATES 0x00000008
153 #define CREDUI_FLAGS_REQUIRE_CERTIFICATE 0x00000010
154 #define CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX 0x00000040
155 #define CREDUI_FLAGS_ALWAYS_SHOW_UI 0x00000080
156 #define CREDUI_FLAGS_REQUIRE_SMARTCARD 0x00000100
157 #define CREDUI_FLAGS_PASSWORD_ONLY_OK 0x00000200
158 #define CREDUI_FLAGS_VALIDATE_USERNAME 0x00000400
159 #define CREDUI_FLAGS_COMPLETE_USERNAME 0x00000800
160 #define CREDUI_FLAGS_PERSIST 0x00001000
161 #define CREDUI_FLAGS_SERVER_CREDENTIAL 0x00004000
162 #define CREDUI_FLAGS_EXPECT_CONFIRMATION 0x00020000
163 #define CREDUI_FLAGS_GENERIC_CREDENTIALS 0x00040000
164 #define CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS 0x00080000
165 #define CREDUI_FLAGS_KEEP_USERNAME 0x00100000
167 /* flags for CredWrite and CredWriteDomainCredentials */
168 #define CRED_PRESERVE_CREDENTIAL_BLOB 0x00000001
170 BOOL WINAPI CredDeleteA(LPCSTR,DWORD,DWORD);
171 BOOL WINAPI CredDeleteW(LPCWSTR,DWORD,DWORD);
172 #define CredDelete WINELIB_NAME_AW(CredDelete)
173 BOOL WINAPI CredEnumerateA(LPCSTR,DWORD,DWORD *,PCREDENTIALA **);
174 BOOL WINAPI CredEnumerateW(LPCWSTR,DWORD,DWORD *,PCREDENTIALW **);
175 #define CredEnumerate WINELIB_NAME_AW(CredEnumerate)
176 VOID WINAPI CredFree(PVOID);
177 BOOL WINAPI CredReadA(LPCSTR,DWORD,DWORD,PCREDENTIALA *);
178 BOOL WINAPI CredReadW(LPCWSTR,DWORD,DWORD,PCREDENTIALW *);
179 #define CredRead WINELIB_NAME_AW(CredRead)
180 BOOL WINAPI CredRenameA(LPCSTR,LPCSTR,DWORD,DWORD);
181 BOOL WINAPI CredRenameW(LPCWSTR,LPCWSTR,DWORD,DWORD);
182 #define CredRename WINELIB_NAME_AW(CredRename)
183 BOOL WINAPI CredWriteA(PCREDENTIALA,DWORD);
184 BOOL WINAPI CredWriteW(PCREDENTIALW,DWORD);
185 #define CredWrite WINELIB_NAME_AW(CredWrite)
187 DWORD WINAPI CredUICmdLinePromptForCredentialsW(PCWSTR,PCtxtHandle,DWORD,PWSTR,ULONG,PWSTR,ULONG,PBOOL,DWORD);
188 DWORD WINAPI CredUICmdLinePromptForCredentialsA(PCSTR,PCtxtHandle,DWORD,PSTR,ULONG,PSTR,ULONG,PBOOL,DWORD);
189 #define CredUICmdLinePromptForCredentials WINELIB_NAME_AW(CredUICmdLinePromptForCredentials)
190 DWORD WINAPI CredUIConfirmCredentialsW(PCWSTR,BOOL);
191 DWORD WINAPI CredUIConfirmCredentialsA(PCSTR,BOOL);
192 #define CredUIConfirmCredentials WINELIB_NAME_AW(CredUIConfirmCredentials)
193 DWORD WINAPI CredUIParseUserNameW(PCWSTR,PWSTR,ULONG,PWSTR,ULONG);
194 DWORD WINAPI CredUIParseUserNameA(PCSTR,PSTR,ULONG,PSTR,ULONG);
195 #define CredUIParseUserName WINELIB_NAME_AW(CredUIParseUserName)
196 DWORD WINAPI CredUIPromptForCredentialsW(PCREDUI_INFOW,PCWSTR,PCtxtHandle,DWORD,PWSTR,ULONG,PWSTR,ULONG,PBOOL,DWORD);
197 DWORD WINAPI CredUIPromptForCredentialsA(PCREDUI_INFOA,PCSTR,PCtxtHandle,DWORD,PSTR,ULONG,PSTR,ULONG,PBOOL,DWORD);
198 #define CredUIPromptForCredentials WINELIB_NAME_AW(CredUIPromptForCredentials)
199 DWORD WINAPI CredUIStoreSSOCredW(PCWSTR,PCWSTR,PCWSTR,BOOL);
200 /* Note: no CredUIStoreSSOCredA in PSDK header */
201 DWORD WINAPI CredUIReadSSOCredW(PCWSTR,PWSTR*);
202 /* Note: no CredUIReadSSOCredA in PSDK header */
208 #endif /* _WINCRED_H_ */