VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/sspi.h@ 33281

Last change on this file since 33281 was 28475, checked in by vboxsync, 15 years ago

crOpenGL: update to wine 1.1.43

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette