include/ddk: Add minimal compstui.h.
[wine/wine64.git] / include / sspi.h
blob6c2f8f5c69feac504efb8b98dd6be1c424e3c6e1
1 /*
2 * Copyright (C) 2004 Juan Lang
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
18 #ifndef __WINE_SSPI_H__
19 #define __WINE_SSPI_H__
21 #include <wtypes.h>
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
27 #define SEC_ENTRY __stdcall
29 typedef WCHAR SEC_WCHAR;
30 typedef CHAR SEC_CHAR;
32 #ifndef __SECSTATUS_DEFINED__
33 #define __SECSTATUS_DEFINED__
34 typedef LONG SECURITY_STATUS;
35 #endif
37 #ifdef UNICODE
38 typedef SEC_WCHAR * SECURITY_PSTR;
39 typedef CONST SEC_WCHAR * SECURITY_PCSTR;
40 #else
41 typedef SEC_CHAR * SECURITY_PSTR;
42 typedef CONST SEC_CHAR * SECURITY_PCSTR;
43 #endif
45 #ifndef __SECHANDLE_DEFINED__
46 #define __SECHANDLE_DEFINED__
47 typedef struct _SecHandle
49 ULONG_PTR dwLower;
50 ULONG_PTR dwUpper;
51 } SecHandle, *PSecHandle;
52 #endif
54 #define SecInvalidateHandle(x) do { \
55 ((PSecHandle)(x))->dwLower = ((ULONG_PTR)((INT_PTR)-1)); \
56 ((PSecHandle)(x))->dwUpper = ((ULONG_PTR)((INT_PTR)-1)); \
57 while (0)
59 #define SecIsValidHandle(x) \
60 ((((PSecHandle)(x))->dwLower != ((ULONG_PTR)(INT_PTR)-1)) && \
61 (((PSecHandle)(x))->dwUpper != ((ULONG_PTR)(INT_PTR)-1)))
63 typedef SecHandle CredHandle;
64 typedef PSecHandle PCredHandle;
66 typedef SecHandle CtxtHandle;
67 typedef PSecHandle PCtxtHandle;
69 typedef LARGE_INTEGER SECURITY_INTEGER, *PSECURITY_INTEGER;
70 typedef SECURITY_INTEGER TimeStamp, *PTimeStamp;
72 typedef struct _SecPkgInfoA
74 unsigned long fCapabilities;
75 unsigned short wVersion;
76 unsigned short wRPCID;
77 unsigned long cbMaxToken;
78 SEC_CHAR *Name;
79 SEC_CHAR *Comment;
80 } SecPkgInfoA, *PSecPkgInfoA;
82 typedef struct _SecPkgInfoW
84 unsigned long fCapabilities;
85 unsigned short wVersion;
86 unsigned short wRPCID;
87 unsigned long cbMaxToken;
88 SEC_WCHAR *Name;
89 SEC_WCHAR *Comment;
90 } SecPkgInfoW, *PSecPkgInfoW;
92 #define SecPkgInfo WINELIB_NAME_AW(SecPkgInfo)
93 #define PSecPkgInfo WINELIB_NAME_AW(PSecPkgInfo)
95 /* fCapabilities field of SecPkgInfo */
96 #define SECPKG_FLAG_INTEGRITY 0x00000001
97 #define SECPKG_FLAG_PRIVACY 0x00000002
98 #define SECPKG_FLAG_TOKEN_ONLY 0x00000004
99 #define SECPKG_FLAG_DATAGRAM 0x00000008
100 #define SECPKG_FLAG_CONNECTION 0x00000010
101 #define SECPKG_FLAG_MULTI_REQUIRED 0x00000020
102 #define SECPKG_FLAG_CLIENT_ONLY 0x00000040
103 #define SECPKG_FLAG_EXTENDED_ERROR 0x00000080
104 #define SECPKG_FLAG_IMPERSONATION 0x00000100
105 #define SECPKG_FLAG_ACCEPT_WIN32_NAME 0x00000200
106 #define SECPKG_FLAG_STREAM 0x00000400
107 #define SECPKG_FLAG_NEGOTIABLE 0x00000800
108 #define SECPKG_FLAG_GSS_COMPATIBLE 0x00001000
109 #define SECPKG_FLAG_LOGON 0x00002000
110 #define SECPKG_FLAG_ASCII_BUFFERS 0x00004000
111 #define SECPKG_FLAG_FRAGMENT 0x00008000
112 #define SECPKG_FLAG_MUTUAL_AUTH 0x00010000
113 #define SECPKG_FLAG_DELEGATION 0x00020000
114 #define SECPKG_FLAG_READONLY_WITH_CHECKSUM 0x00040000
116 typedef struct _SecBuffer
118 unsigned long cbBuffer;
119 unsigned long BufferType;
120 void *pvBuffer;
121 } SecBuffer, *PSecBuffer;
123 /* values for BufferType */
124 #define SECBUFFER_EMPTY 0
125 #define SECBUFFER_DATA 1
126 #define SECBUFFER_TOKEN 2
127 #define SECBUFFER_PKG_PARAMS 3
128 #define SECBUFFER_MISSING 4
129 #define SECBUFFER_EXTRA 5
130 #define SECBUFFER_STREAM_TRAILER 6
131 #define SECBUFFER_HEADER 7
132 #define SECBUFFER_NEGOTIATION_INFO 8
133 #define SECBUFFER_PADDING 9
134 #define SECBUFFER_STREAM 10
135 #define SECBUFFER_MECHLIST 11
136 #define SECBUFFER_MECHLIST_SIGNATURE 12
137 #define SECBUFFER_TARGET 13
138 #define SECBUFFER_CHANNEL_BINDINGS 14
140 #define SECBUFFER_ATTRMASK 0xf0000000
141 #define SECBUFFER_READONLY 0x80000000
142 #define SECBUFFER_READONLY_WITH_CHECKSUM 0x10000000
143 #define SECBUFFER_RESERVED 0x60000000
145 typedef struct _SecBufferDesc
147 unsigned long ulVersion;
148 unsigned long cBuffers;
149 PSecBuffer pBuffers;
150 } SecBufferDesc, *PSecBufferDesc;
152 /* values for ulVersion */
153 #define SECBUFFER_VERSION 0
155 typedef void (SEC_ENTRY *SEC_GET_KEY_FN)(void *Arg, void *Principal,
156 unsigned long KeyVer, void **Key, SECURITY_STATUS *Status);
158 SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesA(PULONG pcPackages,
159 PSecPkgInfoA *ppPackageInfo);
160 SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesW(PULONG pcPackages,
161 PSecPkgInfoW *ppPackageInfo);
162 #define EnumerateSecurityPackages WINELIB_NAME_AW(EnumerateSecurityPackages)
164 typedef SECURITY_STATUS (SEC_ENTRY *ENUMERATE_SECURITY_PACKAGES_FN_A)(PULONG,
165 PSecPkgInfoA *);
166 typedef SECURITY_STATUS (SEC_ENTRY *ENUMERATE_SECURITY_PACKAGES_FN_W)(PULONG,
167 PSecPkgInfoW *);
168 #define ENUMERATE_SECURITY_PACKAGES_FN WINELIB_NAME_AW(ENUMERATE_SECURITY_PACKAGES_FN_)
170 SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesA(
171 PCredHandle phCredential, unsigned long ulAttribute, void *pBuffer);
172 SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesW(
173 PCredHandle phCredential, unsigned long ulAttribute, void *pBuffer);
174 #define QueryCredentialsAttributes WINELIB_NAME_AW(QueryCredentialsAttributes)
176 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CREDENTIALS_ATTRIBUTES_FN_A)
177 (PCredHandle, unsigned long, PVOID);
178 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CREDENTIALS_ATTRIBUTES_FN_W)
179 (PCredHandle, unsigned long, PVOID);
180 #define QUERY_CREDENTIALS_ATTRIBUTES_FN WINELIB_NAME_AW(QUERY_CREDENTIALS_ATTRIBUTES_FN_)
182 /* values for QueryCredentialsAttributes ulAttribute */
183 #define SECPKG_CRED_ATTR_NAMES 1
185 /* types for QueryCredentialsAttributes */
186 typedef struct _SecPkgCredentials_NamesA
188 SEC_CHAR *sUserName;
189 } SecPkgCredentials_NamesA, *PSecPkgCredentials_NamesA;
191 typedef struct _SecPkgCredentials_NamesW
193 SEC_WCHAR *sUserName;
194 } SecPkgCredentials_NamesW, *PSecPkgCredentials_NamesW;
196 #define SecPkgCredentials_Names WINELIB_NAME_AW(SecPkgCredentials_Names)
198 SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleA(
199 SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialsUse,
200 PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn,
201 PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry);
202 SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleW(
203 SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialsUse,
204 PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn,
205 PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry);
206 #define AcquireCredentialsHandle WINELIB_NAME_AW(AcquireCredentialsHandle)
208 /* flags for fCredentialsUse */
209 #define SECPKG_CRED_INBOUND 0x00000001
210 #define SECPKG_CRED_OUTBOUND 0x00000002
211 #define SECPKG_CRED_BOTH (SECPKG_CRED_INBOUND | SECPKG_CRED_OUTBOUND)
212 #define SECPKG_CRED_DEFAULT 0x00000004
213 #define SECPKG_CRED_RESERVED 0xf0000000
215 typedef SECURITY_STATUS (SEC_ENTRY *ACQUIRE_CREDENTIALS_HANDLE_FN_A)(
216 SEC_CHAR *, SEC_CHAR *, ULONG, PLUID, PVOID, SEC_GET_KEY_FN, PVOID,
217 PCredHandle, PTimeStamp);
218 typedef SECURITY_STATUS (SEC_ENTRY *ACQUIRE_CREDENTIALS_HANDLE_FN_W)(
219 SEC_WCHAR *, SEC_WCHAR *, ULONG, PLUID, PVOID, SEC_GET_KEY_FN, PVOID,
220 PCredHandle, PTimeStamp);
221 #define ACQUIRE_CREDENTIALS_HANDLE_FN WINELIB_NAME_AW(ACQUIRE_CREDENTIALS_HANDLE_FN_)
223 SECURITY_STATUS SEC_ENTRY FreeContextBuffer(PVOID pv);
225 typedef SECURITY_STATUS (SEC_ENTRY *FREE_CONTEXT_BUFFER_FN)(PVOID);
227 SECURITY_STATUS SEC_ENTRY FreeCredentialsHandle(PCredHandle
228 phCredential);
230 typedef SECURITY_STATUS (SEC_ENTRY *FREE_CREDENTIALS_HANDLE_FN)(PCredHandle);
232 SECURITY_STATUS SEC_ENTRY InitializeSecurityContextA(
233 PCredHandle phCredential, PCtxtHandle phContext,
234 SEC_CHAR *pszTargetName, unsigned long fContextReq,
235 unsigned long Reserved1, unsigned long TargetDataRep, PSecBufferDesc pInput,
236 unsigned long Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput,
237 unsigned long *pfContextAttr, PTimeStamp ptsExpiry);
238 SECURITY_STATUS SEC_ENTRY InitializeSecurityContextW(
239 PCredHandle phCredential, PCtxtHandle phContext,
240 SEC_WCHAR *pszTargetName, unsigned long fContextReq,
241 unsigned long Reserved1, unsigned long TargetDataRep, PSecBufferDesc pInput,
242 unsigned long Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput,
243 unsigned long *pfContextAttr, PTimeStamp ptsExpiry);
244 #define InitializeSecurityContext WINELIB_NAME_AW(InitializeSecurityContext)
246 typedef SECURITY_STATUS (SEC_ENTRY *INITIALIZE_SECURITY_CONTEXT_FN_A)
247 (PCredHandle, PCtxtHandle, SEC_CHAR *, unsigned long, unsigned long,
248 unsigned long, PSecBufferDesc, unsigned long, PCtxtHandle, PSecBufferDesc,
249 unsigned long *, PTimeStamp);
250 typedef SECURITY_STATUS (SEC_ENTRY *INITIALIZE_SECURITY_CONTEXT_FN_W)
251 (PCredHandle, PCtxtHandle, SEC_WCHAR *, unsigned long, unsigned long,
252 unsigned long, PSecBufferDesc, unsigned long, PCtxtHandle, PSecBufferDesc,
253 unsigned long *, PTimeStamp);
254 #define INITIALIZE_SECURITY_CONTEXT_FN WINELIB_NAME_AW(INITIALIZE_SECURITY_CONTEXT_FN_)
256 /* flags for InitializeSecurityContext fContextReq and pfContextAttr */
257 #define ISC_REQ_DELEGATE 0x00000001
258 #define ISC_REQ_MUTUAL_AUTH 0x00000002
259 #define ISC_REQ_REPLAY_DETECT 0x00000004
260 #define ISC_REQ_SEQUENCE_DETECT 0x00000008
261 #define ISC_REQ_CONFIDENTIALITY 0x00000010
262 #define ISC_REQ_USE_SESSION_KEY 0x00000020
263 #define ISC_REQ_PROMPT_FOR_CREDS 0x00000040
264 #define ISC_REQ_USE_SUPPLIED_CREDS 0x00000080
265 #define ISC_REQ_ALLOCATE_MEMORY 0x00000100
266 #define ISC_REQ_USE_DCE_STYLE 0x00000200
267 #define ISC_REQ_DATAGRAM 0x00000400
268 #define ISC_REQ_CONNECTION 0x00000800
269 #define ISC_REQ_CALL_LEVEL 0x00001000
270 #define ISC_REQ_FRAGMENT_SUPPLIED 0x00002000
271 #define ISC_REQ_EXTENDED_ERROR 0x00004000
272 #define ISC_REQ_STREAM 0x00008000
273 #define ISC_REQ_INTEGRITY 0x00001000
274 #define ISC_REQ_IDENTIFY 0x00002000
275 #define ISC_REQ_NULL_SESSION 0x00004000
276 #define ISC_REQ_MANUAL_CRED_VALIDATION 0x00080000
277 #define ISC_REQ_RESERVED1 0x00100000
278 #define ISC_REQ_FRAGMENT_TO_FIT 0x00200000
280 #define ISC_RET_DELEGATE 0x00000001
281 #define ISC_RET_MUTUAL_AUTH 0x00000002
282 #define ISC_RET_REPLAY_DETECT 0x00000004
283 #define ISC_RET_SEQUENCE_DETECT 0x00000008
284 #define ISC_RET_CONFIDENTIALITY 0x00000010
285 #define ISC_RET_USE_SESSION_KEY 0x00000020
286 #define ISC_RET_USED_COLLECTED_CREDS 0x00000040
287 #define ISC_RET_USED_SUPPLIED_CREDS 0x00000080
288 #define ISC_RET_ALLOCATED_MEMORY 0x00000100
289 #define ISC_RET_USED_DCE_STYLE 0x00000200
290 #define ISC_RET_DATAGRAM 0x00000400
291 #define ISC_RET_CONNECTION 0x00000800
292 #define ISC_RET_INTERMEDIATE_RETURN 0x00001000
293 #define ISC_RET_CALL_LEVEL 0x00002000
294 #define ISC_RET_EXTENDED_ERROR 0x00004000
295 #define ISC_RET_STREAM 0x00008000
296 #define ISC_RET_INTEGRITY 0x00001000
297 #define ISC_RET_IDENTIFY 0x00002000
298 #define ISC_RET_NULL_SESSION 0x00004000
299 #define ISC_RET_MANUAL_CRED_VALIDATION 0x00080000
300 #define ISC_RET_RESERVED1 0x00100000
301 #define ISC_RET_FRAGMENT_ONLY 0x00200000
303 SECURITY_STATUS SEC_ENTRY AcceptSecurityContext(
304 PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput,
305 unsigned long fContextReq, unsigned long TargetDataRep,
306 PCtxtHandle phNewContext, PSecBufferDesc pOutput,
307 unsigned long *pfContextAttr, PTimeStamp ptsExpiry);
309 typedef SECURITY_STATUS (SEC_ENTRY *ACCEPT_SECURITY_CONTEXT_FN)(PCredHandle,
310 PCtxtHandle, PSecBufferDesc, unsigned long, unsigned long, PCtxtHandle,
311 PSecBufferDesc, unsigned long *, PTimeStamp);
313 /* flags for AcceptSecurityContext fContextReq and pfContextAttr */
314 #define ASC_REQ_DELEGATE 0x00000001
315 #define ASC_REQ_MUTUAL_AUTH 0x00000002
316 #define ASC_REQ_REPLAY_DETECT 0x00000004
317 #define ASC_REQ_SEQUENCE_DETECT 0x00000008
318 #define ASC_REQ_CONFIDENTIALITY 0x00000010
319 #define ASC_REQ_USE_SESSION_KEY 0x00000020
320 #define ASC_REQ_ALLOCATE_MEMORY 0x00000100
321 #define ASC_REQ_USE_DCE_STYLE 0x00000200
322 #define ASC_REQ_DATAGRAM 0x00000400
323 #define ASC_REQ_CONNECTION 0x00000800
324 #define ASC_REQ_CALL_LEVEL 0x00001000
325 #define ASC_REQ_FRAGMENT_SUPPLIED 0x00002000
326 #define ASC_REQ_EXTENDED_ERROR 0x00008000
327 #define ASC_REQ_STREAM 0x00010000
328 #define ASC_REQ_INTEGRITY 0x00020000
329 #define ASC_REQ_LICENSING 0x00040000
330 #define ASC_REQ_IDENTIFY 0x00080000
331 #define ASC_REQ_ALLOW_NULL_SESSION 0x00100000
332 #define ASC_REQ_ALLOW_NON_USER_LOGONS 0x00200000
333 #define ASC_REQ_ALLOW_CONTEXT_REPLAY 0x00400000
334 #define ASC_REQ_FRAGMENT_TO_FIT 0x00800000
335 #define ASC_REQ_FRAGMENT_NO_TOKEN 0x01000000
337 #define ASC_RET_DELEGATE 0x00000001
338 #define ASC_RET_MUTUAL_AUTH 0x00000002
339 #define ASC_RET_REPLAY_DETECT 0x00000004
340 #define ASC_RET_SEQUENCE_DETECT 0x00000008
341 #define ASC_RET_CONFIDENTIALITY 0x00000010
342 #define ASC_RET_USE_SESSION_KEY 0x00000020
343 #define ASC_RET_ALLOCATED_MEMORY 0x00000100
344 #define ASC_RET_USED_DCE_STYLE 0x00000200
345 #define ASC_RET_DATAGRAM 0x00000400
346 #define ASC_RET_CONNECTION 0x00000800
347 #define ASC_RET_CALL_LEVEL 0x00002000
348 #define ASC_RET_THIRD_LEG_FAILED 0x00004000
349 #define ASC_RET_EXTENDED_ERROR 0x00008000
350 #define ASC_RET_STREAM 0x00010000
351 #define ASC_RET_INTEGRITY 0x00020000
352 #define ASC_RET_LICENSING 0x00040000
353 #define ASC_RET_IDENTIFY 0x00080000
354 #define ASC_RET_NULL_SESSION 0x00100000
355 #define ASC_RET_ALLOW_NON_USER_LOGONS 0x00200000
356 #define ASC_RET_ALLOW_CONTEXT_REPLAY 0x00400000
357 #define ASC_RET_FRAGMENT_ONLY 0x00800000
358 #define ASC_RET_NO_TOKEN 0x01000000
360 /* values for TargetDataRep */
361 #define SECURITY_NATIVE_DREP 0x00000010
362 #define SECURITY_NETWORK_DREP 0x00000000
364 SECURITY_STATUS SEC_ENTRY CompleteAuthToken(PCtxtHandle phContext,
365 PSecBufferDesc pToken);
367 typedef SECURITY_STATUS (SEC_ENTRY *COMPLETE_AUTH_TOKEN_FN)(PCtxtHandle,
368 PSecBufferDesc);
370 SECURITY_STATUS SEC_ENTRY DeleteSecurityContext(PCtxtHandle phContext);
372 typedef SECURITY_STATUS (SEC_ENTRY *DELETE_SECURITY_CONTEXT_FN)(PCtxtHandle);
374 SECURITY_STATUS SEC_ENTRY ApplyControlToken(PCtxtHandle phContext,
375 PSecBufferDesc pInput);
377 typedef SECURITY_STATUS (SEC_ENTRY *APPLY_CONTROL_TOKEN_FN)(PCtxtHandle,
378 PSecBufferDesc);
380 SECURITY_STATUS SEC_ENTRY QueryContextAttributesA(PCtxtHandle phContext,
381 unsigned long ulAttribute, void *pBuffer);
382 SECURITY_STATUS SEC_ENTRY QueryContextAttributesW(PCtxtHandle phContext,
383 unsigned long ulAttribute, void *pBuffer);
384 #define QueryContextAttributes WINELIB_NAME_AW(QueryContextAttributes)
386 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle,
387 unsigned long, void *);
388 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle,
389 unsigned long, void *);
390 #define QUERY_CONTEXT_ATTRIBUTES_FN WINELIB_NAME_AW(QUERY_CONTEXT_ATTRIBUTES_FN_)
392 /* values for QueryContextAttributes/SetContextAttributes ulAttribute */
393 #define SECPKG_ATTR_SIZES 0
394 #define SECPKG_ATTR_NAMES 1
395 #define SECPKG_ATTR_LIFESPAN 2
396 #define SECPKG_ATTR_DCE_INFO 3
397 #define SECPKG_ATTR_STREAM_SIZES 4
398 #define SECPKG_ATTR_KEY_INFO 5
399 #define SECPKG_ATTR_AUTHORITY 6
400 #define SECPKG_ATTR_PROTO_INFO 7
401 #define SECPKG_ATTR_PASSWORD_EXPIRY 8
402 #define SECPKG_ATTR_SESSION_KEY 9
403 #define SECPKG_ATTR_PACKAGE_INFO 10
404 #define SECPKG_ATTR_USER_FLAGS 11
405 #define SECPKG_ATTR_NEGOTIATION_INFO 12
406 #define SECPKG_ATTR_NATIVE_NAMES 13
407 #define SECPKG_ATTR_FLAGS 14
408 #define SECPKG_ATTR_USE_VALIDATED 15
409 #define SECPKG_ATTR_CREDENTIAL_NAME 16
410 #define SECPKG_ATTR_TARGET_INFORMATION 17
411 #define SECPKG_ATTR_ACCESS_TOKEN 18
412 #define SECPKG_ATTR_TARGET 19
413 #define SECPKG_ATTR_AUTHENTICATION_ID 20
415 /* types for QueryContextAttributes/SetContextAttributes */
417 typedef struct _SecPkgContext_Sizes
419 unsigned long cbMaxToken;
420 unsigned long cbMaxSignature;
421 unsigned long cbBlockSize;
422 unsigned long cbSecurityTrailer;
423 } SecPkgContext_Sizes, *PSecPkgContext_Sizes;
425 typedef struct _SecPkgContext_StreamSizes
427 unsigned long cbHeader;
428 unsigned long cbTrailer;
429 unsigned long cbMaximumMessage;
430 unsigned long cbBuffers;
431 unsigned long cbBlockSize;
432 } SecPkgContext_StreamSizes, *PSecPkgContext_StreamSizes;
434 typedef struct _SecPkgContext_NamesA
436 SEC_CHAR *sUserName;
437 } SecPkgContext_NamesA, *PSecPkgContext_NamesA;
439 typedef struct _SecPkgContext_NamesW
441 SEC_WCHAR *sUserName;
442 } SecPkgContext_NamesW, *PSecPkgContext_NamesW;
444 #define SecPkgContext_Names WINELIB_NAME_AW(SecPkgContext_Names)
445 #define PSecPkgContext_Names WINELIB_NAME_AW(PSecPkgContext_Names)
447 typedef struct _SecPkgContext_Lifespan
449 TimeStamp tsStart;
450 TimeStamp tsExpiry;
451 } SecPkgContext_Lifespan, *PSecPkgContext_Lifespan;
453 typedef struct _SecPkgContext_DceInfo
455 unsigned long AuthzSvc;
456 void *pPac;
457 } SecPkgContext_DceInfo, *PSecPkgContext_DceInfo;
459 typedef struct _SecPkgContext_KeyInfoA
461 SEC_CHAR *sSignatureAlgorithmName;
462 SEC_CHAR *sEncryptAlgorithmName;
463 unsigned long KeySize;
464 unsigned long SignatureAlgorithm;
465 unsigned long EncryptAlgorithm;
466 } SecPkgContext_KeyInfoA, *PSecPkgContext_KeyInfoA;
468 typedef struct _SecPkgContext_KeyInfoW
470 SEC_WCHAR *sSignatureAlgorithmName;
471 SEC_WCHAR *sEncryptAlgorithmName;
472 unsigned long KeySize;
473 unsigned long SignatureAlgorithm;
474 unsigned long EncryptAlgorithm;
475 } SecPkgContext_KeyInfoW, *PSecPkgContext_KeyInfoW;
477 #define SecPkgContext_KeyInfo WINELIB_NAME_AW(SecPkgContext_KeyInfo)
478 #define PSecPkgContext_KeyInfo WINELIB_NAME_AW(PSecPkgContext_KeyInfo)
480 typedef struct _SecPkgContext_AuthorityA
482 SEC_CHAR *sAuthorityName;
483 } SecPkgContext_AuthorityA, *PSecPkgContext_AuthorityA;
485 typedef struct _SecPkgContext_AuthorityW
487 SEC_WCHAR *sAuthorityName;
488 } SecPkgContext_AuthorityW, *PSecPkgContext_AuthorityW;
490 #define SecPkgContext_Authority WINELIB_NAME_AW(SecPkgContext_Authority)
491 #define PSecPkgContext_Authority WINELIB_NAME_AW(PSecPkgContext_Authority)
493 typedef struct _SecPkgContext_ProtoInfoA
495 SEC_CHAR *sProtocolName;
496 unsigned long majorVersion;
497 unsigned long minorVersion;
498 } SecPkgContext_ProtoInfoA, *PSecPkgContext_ProtoInfoA;
500 typedef struct _SecPkgContext_ProtoInfoW
502 SEC_WCHAR *sProtocolName;
503 unsigned long majorVersion;
504 unsigned long minorVersion;
505 } SecPkgContext_ProtoInfoW, *PSecPkgContext_ProtoInfoW;
507 #define SecPkgContext_ProtoInfo WINELIB_NAME_AW(SecPkgContext_ProtoInfo)
508 #define PSecPkgContext_ProtoInfo WINELIB_NAME_AW(PSecPkgContext_ProtoInfo)
510 typedef struct _SecPkgContext_PasswordExpiry
512 TimeStamp tsPasswordExpires;
513 } SecPkgContext_PasswordExpiry, *PSecPkgContext_PasswordExpiry;
515 typedef struct _SecPkgContext_SessionKey
517 unsigned long SessionKeyLength;
518 unsigned char *SessionKey;
519 } SecPkgContext_SessionKey, *PSecPkgContext_SessionKey;
521 typedef struct _SecPkgContext_PackageInfoA
523 PSecPkgInfoA PackageInfo;
524 } SecPkgContext_PackageInfoA, *PSecPkgContext_PackageInfoA;
526 typedef struct _SecPkgContext_PackageInfoW
528 PSecPkgInfoW PackageInfo;
529 } SecPkgContext_PackageInfoW, *PSecPkgContext_PackageInfoW;
531 #define SecPkgContext_PackageInfo WINELIB_NAME_AW(SecPkgContext_PackageInfo)
532 #define PSecPkgContext_PackageInfo WINELIB_NAME_AW(PSecPkgContext_PackageInfo)
534 typedef struct _SecPkgContext_Flags
536 unsigned long Flags;
537 } SecPkgContext_Flags, *PSecPkgContext_Flags;
539 typedef struct _SecPkgContext_UserFlags
541 unsigned long UserFlags;
542 } SecPkgContext_UserFlags, *PSecPkgContext_UserFlags;
544 typedef struct _SecPkgContext_NegotiationInfoA
546 PSecPkgInfoA PackageInfo;
547 unsigned long NegotiationState;
548 } SecPkgContext_NegotiationInfoA, *PSecPkgContext_NegotiationInfoA;
550 typedef struct _SecPkgContext_NegotiationInfoW
552 PSecPkgInfoW PackageInfo;
553 unsigned long NegotiationState;
554 } SecPkgContext_NegotiationInfoW, *PSecPkgContext_NegotiationInfoW;
556 #define SecPkgContext_NegotiationInfo WINELIB_NAME_AW(SecPkgContext_NegotiationInfo)
557 #define PSecPkgContext_NegotiationInfo WINELIB_NAME_AW(PSecPkgContext_NegotiationInfo)
559 /* values for NegotiationState */
560 #define SECPKG_NEGOTIATION_COMPLETE 0
561 #define SECPKG_NEGOTIATION_OPTIMISTIC 1
562 #define SECPKG_NEGOTIATION_IN_PROGRESS 2
563 #define SECPKG_NEGOTIATION_DIRECT 3
564 #define SECPKG_NEGOTIATION_TRY_MULTICRED 4
566 typedef struct _SecPkgContext_NativeNamesA
568 SEC_CHAR *sClientName;
569 SEC_CHAR *sServerName;
570 } SecPkgContext_NativeNamesA, *PSecPkgContext_NativeNamesA;
572 typedef struct _SecPkgContext_NativeNamesW
574 SEC_WCHAR *sClientName;
575 SEC_WCHAR *sServerName;
576 } SecPkgContext_NativeNamesW, *PSecPkgContext_NativeNamesW;
578 #define SecPkgContext_NativeNames WINELIB_NAME_AW(SecPkgContext_NativeNames)
579 #define PSecPkgContext_NativeNames WINELIB_NAME_AW(PSecPkgContext_NativeNames)
581 typedef struct _SecPkgContext_CredentialNameA
583 unsigned long CredentialType;
584 SEC_CHAR *sCredentialName;
585 } SecPkgContext_CredentialNameA, *PSecPkgContext_CredentialNameA;
587 typedef struct _SecPkgContext_CredentialNameW
589 unsigned long CredentialType;
590 SEC_WCHAR *sCredentialName;
591 } SecPkgContext_CredentialNameW, *PSecPkgContext_CredentialNameW;
593 #define SecPkgContext_CredentialName WINELIB_NAME_AW(SecPkgContext_CredentialName)
594 #define PSecPkgContext_CredentialName WINELIB_NAME_AW(PSecPkgContext_CredentialName)
596 typedef struct _SecPkgContext_AccessToken
598 void *AccessToken;
599 } SecPkgContext_AccessToken, *PSecPkgContext_AccessToken;
601 typedef struct _SecPkgContext_TargetInformation
603 unsigned long MarshalledTargetInfoLength;
604 unsigned char *MarshalledTargetInfo;
605 } SecPkgContext_TargetInformation, *PSecPkgContext_TargetInformation;
607 typedef struct _SecPkgContext_AuthzID
609 unsigned long AuthzIDLength;
610 char *AuthzID;
611 } SecPkgContext_AuthzID, *PSecPkgContext_AuthzID;
613 typedef struct _SecPkgContext_Target
615 unsigned long TargetLength;
616 char *Target;
617 } SecPkgContext_Target, *PSecPkgContext_Target;
619 SECURITY_STATUS SEC_ENTRY ImpersonateSecurityContext(PCtxtHandle phContext);
621 typedef SECURITY_STATUS (SEC_ENTRY *IMPERSONATE_SECURITY_CONTEXT_FN)
622 (PCtxtHandle);
624 SECURITY_STATUS SEC_ENTRY RevertSecurityContext(PCtxtHandle phContext);
626 typedef SECURITY_STATUS (SEC_ENTRY *REVERT_SECURITY_CONTEXT_FN)(PCtxtHandle);
628 SECURITY_STATUS SEC_ENTRY MakeSignature(PCtxtHandle phContext,
629 ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo);
631 typedef SECURITY_STATUS (SEC_ENTRY *MAKE_SIGNATURE_FN)(PCtxtHandle,
632 ULONG, PSecBufferDesc, ULONG);
634 SECURITY_STATUS SEC_ENTRY VerifySignature(PCtxtHandle phContext,
635 PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP);
637 typedef SECURITY_STATUS (SEC_ENTRY *VERIFY_SIGNATURE_FN)(PCtxtHandle,
638 PSecBufferDesc, ULONG, PULONG);
640 SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoA(
641 SEC_CHAR *pszPackageName, PSecPkgInfoA *ppPackageInfo);
642 SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoW(
643 SEC_WCHAR *pszPackageName, PSecPkgInfoW *ppPackageInfo);
644 #define QuerySecurityPackageInfo WINELIB_NAME_AW(QuerySecurityPackageInfo)
646 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_SECURITY_PACKAGE_INFO_FN_A)
647 (SEC_CHAR *, PSecPkgInfoA *);
648 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_SECURITY_PACKAGE_INFO_FN_W)
649 (SEC_WCHAR *, PSecPkgInfoW *);
650 #define QUERY_SECURITY_PACKAGE_INFO_FN WINELIB_NAME_AW(QUERY_SECURITY_PACKAGE_INFO_FN_)
652 SECURITY_STATUS SEC_ENTRY ExportSecurityContext(PCtxtHandle phContext,
653 ULONG fFlags, PSecBuffer pPackedContext, void **pToken);
655 typedef SECURITY_STATUS (SEC_ENTRY *EXPORT_SECURITY_CONTEXT_FN)(PCtxtHandle,
656 ULONG, PSecBuffer, void **);
658 /* values for ExportSecurityContext fFlags */
659 #define SECPKG_CONTEXT_EXPORT_RESET_NEW 0x00000001
660 #define SECPKG_CONTEXT_EXPORT_DELETE_OLD 0x00000002
662 SECURITY_STATUS SEC_ENTRY ImportSecurityContextA(SEC_CHAR *pszPackage,
663 PSecBuffer pPackedContext, void *Token, PCtxtHandle phContext);
664 SECURITY_STATUS SEC_ENTRY ImportSecurityContextW(SEC_WCHAR *pszPackage,
665 PSecBuffer pPackedContext, void *Token, PCtxtHandle phContext);
666 #define ImportSecurityContext WINELIB_NAME_AW(ImportSecurityContext)
668 typedef SECURITY_STATUS (SEC_ENTRY *IMPORT_SECURITY_CONTEXT_FN_A)(SEC_CHAR *,
669 PSecBuffer, void *, PCtxtHandle);
670 typedef SECURITY_STATUS (SEC_ENTRY *IMPORT_SECURITY_CONTEXT_FN_W)(SEC_WCHAR *,
671 PSecBuffer, void *, PCtxtHandle);
672 #define IMPORT_SECURITY_CONTEXT_FN WINELIB_NAME_AW(IMPORT_SECURITY_CONTEXT_FN_)
674 SECURITY_STATUS SEC_ENTRY AddCredentialsA(PCredHandle hCredentials,
675 SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, unsigned long fCredentialUse,
676 void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument,
677 PTimeStamp ptsExpiry);
678 SECURITY_STATUS SEC_ENTRY AddCredentialsW(PCredHandle hCredentials,
679 SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, unsigned long fCredentialUse,
680 void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument,
681 PTimeStamp ptsExpiry);
682 #define AddCredentials WINELIB_NAME_AW(AddCredentials)
684 typedef SECURITY_STATUS (SEC_ENTRY *ADD_CREDENTIALS_FN_A)(PCredHandle,
685 SEC_CHAR *, SEC_CHAR *, unsigned long, void *, SEC_GET_KEY_FN, void *,
686 PTimeStamp);
687 typedef SECURITY_STATUS (SEC_ENTRY *ADD_CREDENTIALS_FN_W)(PCredHandle,
688 SEC_WCHAR *, SEC_WCHAR *, unsigned long, void *, SEC_GET_KEY_FN, void *,
689 PTimeStamp);
691 SECURITY_STATUS SEC_ENTRY QuerySecurityContextToken(PCtxtHandle phContext,
692 HANDLE *phToken);
694 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_SECURITY_CONTEXT_TOKEN_FN)
695 (PCtxtHandle, HANDLE *);
697 SECURITY_STATUS SEC_ENTRY EncryptMessage(PCtxtHandle phContext, ULONG fQOP,
698 PSecBufferDesc pMessage, ULONG MessageSeqNo);
699 SECURITY_STATUS SEC_ENTRY DecryptMessage(PCtxtHandle phContext,
700 PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP);
702 /* values for EncryptMessage fQOP */
703 #define SECQOP_WRAP_NO_ENCRYPT 0x80000001
705 typedef SECURITY_STATUS (SEC_ENTRY *ENCRYPT_MESSAGE_FN)(PCtxtHandle, ULONG,
706 PSecBufferDesc, ULONG);
707 typedef SECURITY_STATUS (SEC_ENTRY *DECRYPT_MESSAGE_FN)(PCtxtHandle,
708 PSecBufferDesc, ULONG, PULONG);
710 SECURITY_STATUS SEC_ENTRY SetContextAttributesA(PCtxtHandle phContext,
711 unsigned long ulAttribute, void *pBuffer, unsigned long cbBuffer);
712 SECURITY_STATUS SEC_ENTRY SetContextAttributesW(PCtxtHandle phContext,
713 unsigned long ulAttribute, void *pBuffer, unsigned long cbBuffer);
714 #define SetContextAttributes WINELIB_NAME_AW(SetContextAttributes)
716 typedef SECURITY_STATUS (SEC_ENTRY *SET_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle,
717 unsigned long, void *, unsigned long);
718 typedef SECURITY_STATUS (SEC_ENTRY *SET_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle,
719 unsigned long, void *, unsigned long);
721 #define SECURITY_ENTRYPOINT_ANSIA "InitSecurityInterfaceA"
722 #define SECURITY_ENTRYPOINT_ANSIW "InitSecurityInterfaceW"
723 #define SECURITY_ENTRYPOINT_ANSI WINELIB_NAME_AW(SECURITY_ENTRYPOINT_ANSI)
725 typedef struct _SECURITY_FUNCTION_TABLE_A
727 unsigned long dwVersion;
728 ENUMERATE_SECURITY_PACKAGES_FN_A EnumerateSecurityPackagesA;
729 QUERY_CREDENTIALS_ATTRIBUTES_FN_A QueryCredentialsAttributesA;
730 ACQUIRE_CREDENTIALS_HANDLE_FN_A AcquireCredentialsHandleA;
731 FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle;
732 void *Reserved2;
733 INITIALIZE_SECURITY_CONTEXT_FN_A InitializeSecurityContextA;
734 ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext;
735 COMPLETE_AUTH_TOKEN_FN CompleteAuthToken;
736 DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext;
737 APPLY_CONTROL_TOKEN_FN ApplyControlToken;
738 QUERY_CONTEXT_ATTRIBUTES_FN_A QueryContextAttributesA;
739 IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext;
740 REVERT_SECURITY_CONTEXT_FN RevertSecurityContext;
741 MAKE_SIGNATURE_FN MakeSignature;
742 VERIFY_SIGNATURE_FN VerifySignature;
743 FREE_CONTEXT_BUFFER_FN FreeContextBuffer;
744 QUERY_SECURITY_PACKAGE_INFO_FN_A QuerySecurityPackageInfoA;
745 void *Reserved3;
746 void *Reserved4;
747 EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext;
748 IMPORT_SECURITY_CONTEXT_FN_A ImportSecurityContextA;
749 ADD_CREDENTIALS_FN_A AddCredentialsA;
750 void *Reserved8;
751 QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken;
752 ENCRYPT_MESSAGE_FN EncryptMessage;
753 DECRYPT_MESSAGE_FN DecryptMessage;
754 SET_CONTEXT_ATTRIBUTES_FN_A SetContextAttributesA;
755 } SecurityFunctionTableA, *PSecurityFunctionTableA;
757 typedef struct _SECURITY_FUNCTION_TABLE_W
759 unsigned long dwVersion;
760 ENUMERATE_SECURITY_PACKAGES_FN_W EnumerateSecurityPackagesW;
761 QUERY_CREDENTIALS_ATTRIBUTES_FN_W QueryCredentialsAttributesW;
762 ACQUIRE_CREDENTIALS_HANDLE_FN_W AcquireCredentialsHandleW;
763 FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle;
764 void *Reserved2;
765 INITIALIZE_SECURITY_CONTEXT_FN_W InitializeSecurityContextW;
766 ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext;
767 COMPLETE_AUTH_TOKEN_FN CompleteAuthToken;
768 DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext;
769 APPLY_CONTROL_TOKEN_FN ApplyControlToken;
770 QUERY_CONTEXT_ATTRIBUTES_FN_W QueryContextAttributesW;
771 IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext;
772 REVERT_SECURITY_CONTEXT_FN RevertSecurityContext;
773 MAKE_SIGNATURE_FN MakeSignature;
774 VERIFY_SIGNATURE_FN VerifySignature;
775 FREE_CONTEXT_BUFFER_FN FreeContextBuffer;
776 QUERY_SECURITY_PACKAGE_INFO_FN_W QuerySecurityPackageInfoW;
777 void *Reserved3;
778 void *Reserved4;
779 EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext;
780 IMPORT_SECURITY_CONTEXT_FN_W ImportSecurityContextW;
781 ADD_CREDENTIALS_FN_W AddCredentialsW;
782 void *Reserved8;
783 QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken;
784 ENCRYPT_MESSAGE_FN EncryptMessage;
785 DECRYPT_MESSAGE_FN DecryptMessage;
786 SET_CONTEXT_ATTRIBUTES_FN_W SetContextAttributesW;
787 } SecurityFunctionTableW, *PSecurityFunctionTableW;
789 #define SecurityFunctionTable WINELIB_NAME_AW(SecurityFunctionTable)
790 #define PSecurityFunctionTable WINELIB_NAME_AW(PSecurityFunctionTable)
792 #define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION 1
793 #define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2 2
795 PSecurityFunctionTableA SEC_ENTRY InitSecurityInterfaceA(void);
796 PSecurityFunctionTableW SEC_ENTRY InitSecurityInterfaceW(void);
797 #define InitSecurityInterface WINELIB_NAME_AW(InitSecurityInterface)
799 typedef PSecurityFunctionTableA (SEC_ENTRY *INIT_SECURITY_INTERFACE_A)(void);
800 typedef PSecurityFunctionTableW (SEC_ENTRY *INIT_SECURITY_INTERFACE_W)(void);
801 #define INIT_SECURITY_INTERFACE WINELIB_NAME_AW(INIT_SECURITY_INTERFACE_)
803 #ifdef __cplusplus
805 #endif
807 #endif /* ndef __WINE_SSPI_H__ */