VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sspi.h

最後變更 在這個檔案是 53206,由 vboxsync 提交於 10 年 前

Devices/vmsvga: header fixes

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 31.8 KB
 
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 * Oracle 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, Oracle 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#define SECPKG_FLAG_RESTRICTED_TOKENS 0x00080000
144#define SECPKG_FLAG_NEGO_EXTENDER 0x00100000
145#define SECPKG_FLAG_NEGOTIABLE2 0x00200000
146#define SECPKG_FLAG_APPCONTAINER_PASSTHROUGH 0x00400000
147#define SECPKG_FLAG_APPCONTAINER_CHECKS 0x00800000
148
149#define SECPKG_ID_NONE 0xffff
150
151typedef struct _SecBuffer
152{
153 ULONG cbBuffer;
154 ULONG BufferType;
155 PVOID pvBuffer;
156} SecBuffer, *PSecBuffer;
157
158/* values for BufferType */
159#define SECBUFFER_EMPTY 0
160#define SECBUFFER_DATA 1
161#define SECBUFFER_TOKEN 2
162#define SECBUFFER_PKG_PARAMS 3
163#define SECBUFFER_MISSING 4
164#define SECBUFFER_EXTRA 5
165#define SECBUFFER_STREAM_TRAILER 6
166#define SECBUFFER_STREAM_HEADER 7
167#define SECBUFFER_NEGOTIATION_INFO 8
168#define SECBUFFER_PADDING 9
169#define SECBUFFER_STREAM 10
170#define SECBUFFER_MECHLIST 11
171#define SECBUFFER_MECHLIST_SIGNATURE 12
172#define SECBUFFER_TARGET 13
173#define SECBUFFER_CHANNEL_BINDINGS 14
174
175#define SECBUFFER_ATTRMASK 0xf0000000
176#define SECBUFFER_READONLY 0x80000000
177#define SECBUFFER_READONLY_WITH_CHECKSUM 0x10000000
178#define SECBUFFER_RESERVED 0x60000000
179
180typedef struct _SecBufferDesc
181{
182 ULONG ulVersion;
183 ULONG cBuffers;
184 PSecBuffer pBuffers;
185} SecBufferDesc, *PSecBufferDesc;
186
187/* values for ulVersion */
188#define SECBUFFER_VERSION 0
189
190typedef void (SEC_ENTRY *SEC_GET_KEY_FN)(void *Arg, void *Principal,
191 ULONG KeyVer, void **Key, SECURITY_STATUS *Status);
192
193SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesA(PULONG pcPackages,
194 PSecPkgInfoA *ppPackageInfo);
195SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesW(PULONG pcPackages,
196 PSecPkgInfoW *ppPackageInfo);
197#define EnumerateSecurityPackages WINELIB_NAME_AW(EnumerateSecurityPackages)
198
199typedef SECURITY_STATUS (SEC_ENTRY *ENUMERATE_SECURITY_PACKAGES_FN_A)(PULONG,
200 PSecPkgInfoA *);
201typedef SECURITY_STATUS (SEC_ENTRY *ENUMERATE_SECURITY_PACKAGES_FN_W)(PULONG,
202 PSecPkgInfoW *);
203#define ENUMERATE_SECURITY_PACKAGES_FN WINELIB_NAME_AW(ENUMERATE_SECURITY_PACKAGES_FN_)
204
205SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesA(
206 PCredHandle phCredential, ULONG ulAttribute, void *pBuffer);
207SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesW(
208 PCredHandle phCredential, ULONG ulAttribute, void *pBuffer);
209#define QueryCredentialsAttributes WINELIB_NAME_AW(QueryCredentialsAttributes)
210
211typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CREDENTIALS_ATTRIBUTES_FN_A)
212 (PCredHandle, ULONG, PVOID);
213typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CREDENTIALS_ATTRIBUTES_FN_W)
214 (PCredHandle, ULONG, PVOID);
215#define QUERY_CREDENTIALS_ATTRIBUTES_FN WINELIB_NAME_AW(QUERY_CREDENTIALS_ATTRIBUTES_FN_)
216
217/* values for QueryCredentialsAttributes ulAttribute */
218#define SECPKG_CRED_ATTR_NAMES 1
219
220/* types for QueryCredentialsAttributes */
221typedef struct _SecPkgCredentials_NamesA
222{
223 SEC_CHAR *sUserName;
224} SecPkgCredentials_NamesA, *PSecPkgCredentials_NamesA;
225
226typedef struct _SecPkgCredentials_NamesW
227{
228 SEC_WCHAR *sUserName;
229} SecPkgCredentials_NamesW, *PSecPkgCredentials_NamesW;
230
231#define SecPkgCredentials_Names WINELIB_NAME_AW(SecPkgCredentials_Names)
232
233SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleA(
234 SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialsUse,
235 PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn,
236 PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry);
237SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleW(
238 SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialsUse,
239 PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn,
240 PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry);
241#define AcquireCredentialsHandle WINELIB_NAME_AW(AcquireCredentialsHandle)
242
243/* flags for fCredentialsUse */
244#define SECPKG_CRED_INBOUND 0x00000001
245#define SECPKG_CRED_OUTBOUND 0x00000002
246#define SECPKG_CRED_BOTH (SECPKG_CRED_INBOUND | SECPKG_CRED_OUTBOUND)
247#define SECPKG_CRED_DEFAULT 0x00000004
248#define SECPKG_CRED_RESERVED 0xf0000000
249
250typedef SECURITY_STATUS (SEC_ENTRY *ACQUIRE_CREDENTIALS_HANDLE_FN_A)(
251 SEC_CHAR *, SEC_CHAR *, ULONG, PLUID, PVOID, SEC_GET_KEY_FN, PVOID,
252 PCredHandle, PTimeStamp);
253typedef SECURITY_STATUS (SEC_ENTRY *ACQUIRE_CREDENTIALS_HANDLE_FN_W)(
254 SEC_WCHAR *, SEC_WCHAR *, ULONG, PLUID, PVOID, SEC_GET_KEY_FN, PVOID,
255 PCredHandle, PTimeStamp);
256#define ACQUIRE_CREDENTIALS_HANDLE_FN WINELIB_NAME_AW(ACQUIRE_CREDENTIALS_HANDLE_FN_)
257
258SECURITY_STATUS SEC_ENTRY FreeContextBuffer(PVOID pv);
259
260typedef SECURITY_STATUS (SEC_ENTRY *FREE_CONTEXT_BUFFER_FN)(PVOID);
261
262SECURITY_STATUS SEC_ENTRY FreeCredentialsHandle(PCredHandle
263 phCredential);
264
265#define FreeCredentialHandle FreeCredentialsHandle
266
267typedef SECURITY_STATUS (SEC_ENTRY *FREE_CREDENTIALS_HANDLE_FN)(PCredHandle);
268
269SECURITY_STATUS SEC_ENTRY InitializeSecurityContextA(
270 PCredHandle phCredential, PCtxtHandle phContext,
271 SEC_CHAR *pszTargetName, ULONG fContextReq,
272 ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput,
273 ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput,
274 ULONG *pfContextAttr, PTimeStamp ptsExpiry);
275SECURITY_STATUS SEC_ENTRY InitializeSecurityContextW(
276 PCredHandle phCredential, PCtxtHandle phContext,
277 SEC_WCHAR *pszTargetName, ULONG fContextReq,
278 ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput,
279 ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput,
280 ULONG *pfContextAttr, PTimeStamp ptsExpiry);
281#define InitializeSecurityContext WINELIB_NAME_AW(InitializeSecurityContext)
282
283typedef SECURITY_STATUS (SEC_ENTRY *INITIALIZE_SECURITY_CONTEXT_FN_A)
284 (PCredHandle, PCtxtHandle, SEC_CHAR *, ULONG, ULONG, ULONG, PSecBufferDesc,
285 ULONG, PCtxtHandle, PSecBufferDesc, ULONG *, PTimeStamp);
286typedef SECURITY_STATUS (SEC_ENTRY *INITIALIZE_SECURITY_CONTEXT_FN_W)
287 (PCredHandle, PCtxtHandle, SEC_WCHAR *, ULONG, ULONG, ULONG, PSecBufferDesc,
288 ULONG, PCtxtHandle, PSecBufferDesc, ULONG *, PTimeStamp);
289#define INITIALIZE_SECURITY_CONTEXT_FN WINELIB_NAME_AW(INITIALIZE_SECURITY_CONTEXT_FN_)
290
291/* flags for InitializeSecurityContext fContextReq and pfContextAttr */
292#define ISC_REQ_DELEGATE 0x00000001
293#define ISC_REQ_MUTUAL_AUTH 0x00000002
294#define ISC_REQ_REPLAY_DETECT 0x00000004
295#define ISC_REQ_SEQUENCE_DETECT 0x00000008
296#define ISC_REQ_CONFIDENTIALITY 0x00000010
297#define ISC_REQ_USE_SESSION_KEY 0x00000020
298#define ISC_REQ_PROMPT_FOR_CREDS 0x00000040
299#define ISC_REQ_USE_SUPPLIED_CREDS 0x00000080
300#define ISC_REQ_ALLOCATE_MEMORY 0x00000100
301#define ISC_REQ_USE_DCE_STYLE 0x00000200
302#define ISC_REQ_DATAGRAM 0x00000400
303#define ISC_REQ_CONNECTION 0x00000800
304#define ISC_REQ_CALL_LEVEL 0x00001000
305#define ISC_REQ_FRAGMENT_SUPPLIED 0x00002000
306#define ISC_REQ_EXTENDED_ERROR 0x00004000
307#define ISC_REQ_STREAM 0x00008000
308#define ISC_REQ_INTEGRITY 0x00010000
309#define ISC_REQ_IDENTIFY 0x00020000
310#define ISC_REQ_NULL_SESSION 0x00040000
311#define ISC_REQ_MANUAL_CRED_VALIDATION 0x00080000
312#define ISC_REQ_RESERVED1 0x00100000
313#define ISC_REQ_FRAGMENT_TO_FIT 0x00200000
314
315#define ISC_RET_DELEGATE 0x00000001
316#define ISC_RET_MUTUAL_AUTH 0x00000002
317#define ISC_RET_REPLAY_DETECT 0x00000004
318#define ISC_RET_SEQUENCE_DETECT 0x00000008
319#define ISC_RET_CONFIDENTIALITY 0x00000010
320#define ISC_RET_USE_SESSION_KEY 0x00000020
321#define ISC_RET_USED_COLLECTED_CREDS 0x00000040
322#define ISC_RET_USED_SUPPLIED_CREDS 0x00000080
323#define ISC_RET_ALLOCATED_MEMORY 0x00000100
324#define ISC_RET_USED_DCE_STYLE 0x00000200
325#define ISC_RET_DATAGRAM 0x00000400
326#define ISC_RET_CONNECTION 0x00000800
327#define ISC_RET_INTERMEDIATE_RETURN 0x00001000
328#define ISC_RET_CALL_LEVEL 0x00002000
329#define ISC_RET_EXTENDED_ERROR 0x00004000
330#define ISC_RET_STREAM 0x00008000
331#define ISC_RET_INTEGRITY 0x00010000
332#define ISC_RET_IDENTIFY 0x00020000
333#define ISC_RET_NULL_SESSION 0x00040000
334#define ISC_RET_MANUAL_CRED_VALIDATION 0x00080000
335#define ISC_RET_RESERVED1 0x00100000
336#define ISC_RET_FRAGMENT_ONLY 0x00200000
337
338SECURITY_STATUS SEC_ENTRY AcceptSecurityContext(
339 PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput,
340 ULONG fContextReq, ULONG TargetDataRep,
341 PCtxtHandle phNewContext, PSecBufferDesc pOutput,
342 ULONG *pfContextAttr, PTimeStamp ptsExpiry);
343
344typedef SECURITY_STATUS (SEC_ENTRY *ACCEPT_SECURITY_CONTEXT_FN)(PCredHandle,
345 PCtxtHandle, PSecBufferDesc, ULONG, ULONG, PCtxtHandle,
346 PSecBufferDesc, ULONG *, PTimeStamp);
347
348/* flags for AcceptSecurityContext fContextReq and pfContextAttr */
349#define ASC_REQ_DELEGATE 0x00000001
350#define ASC_REQ_MUTUAL_AUTH 0x00000002
351#define ASC_REQ_REPLAY_DETECT 0x00000004
352#define ASC_REQ_SEQUENCE_DETECT 0x00000008
353#define ASC_REQ_CONFIDENTIALITY 0x00000010
354#define ASC_REQ_USE_SESSION_KEY 0x00000020
355#define ASC_REQ_ALLOCATE_MEMORY 0x00000100
356#define ASC_REQ_USE_DCE_STYLE 0x00000200
357#define ASC_REQ_DATAGRAM 0x00000400
358#define ASC_REQ_CONNECTION 0x00000800
359#define ASC_REQ_CALL_LEVEL 0x00001000
360#define ASC_REQ_FRAGMENT_SUPPLIED 0x00002000
361#define ASC_REQ_EXTENDED_ERROR 0x00008000
362#define ASC_REQ_STREAM 0x00010000
363#define ASC_REQ_INTEGRITY 0x00020000
364#define ASC_REQ_LICENSING 0x00040000
365#define ASC_REQ_IDENTIFY 0x00080000
366#define ASC_REQ_ALLOW_NULL_SESSION 0x00100000
367#define ASC_REQ_ALLOW_NON_USER_LOGONS 0x00200000
368#define ASC_REQ_ALLOW_CONTEXT_REPLAY 0x00400000
369#define ASC_REQ_FRAGMENT_TO_FIT 0x00800000
370#define ASC_REQ_FRAGMENT_NO_TOKEN 0x01000000
371
372#define ASC_RET_DELEGATE 0x00000001
373#define ASC_RET_MUTUAL_AUTH 0x00000002
374#define ASC_RET_REPLAY_DETECT 0x00000004
375#define ASC_RET_SEQUENCE_DETECT 0x00000008
376#define ASC_RET_CONFIDENTIALITY 0x00000010
377#define ASC_RET_USE_SESSION_KEY 0x00000020
378#define ASC_RET_ALLOCATED_MEMORY 0x00000100
379#define ASC_RET_USED_DCE_STYLE 0x00000200
380#define ASC_RET_DATAGRAM 0x00000400
381#define ASC_RET_CONNECTION 0x00000800
382#define ASC_RET_CALL_LEVEL 0x00002000
383#define ASC_RET_THIRD_LEG_FAILED 0x00004000
384#define ASC_RET_EXTENDED_ERROR 0x00008000
385#define ASC_RET_STREAM 0x00010000
386#define ASC_RET_INTEGRITY 0x00020000
387#define ASC_RET_LICENSING 0x00040000
388#define ASC_RET_IDENTIFY 0x00080000
389#define ASC_RET_NULL_SESSION 0x00100000
390#define ASC_RET_ALLOW_NON_USER_LOGONS 0x00200000
391#define ASC_RET_ALLOW_CONTEXT_REPLAY 0x00400000
392#define ASC_RET_FRAGMENT_ONLY 0x00800000
393#define ASC_RET_NO_TOKEN 0x01000000
394
395/* values for TargetDataRep */
396#define SECURITY_NATIVE_DREP 0x00000010
397#define SECURITY_NETWORK_DREP 0x00000000
398
399SECURITY_STATUS SEC_ENTRY CompleteAuthToken(PCtxtHandle phContext,
400 PSecBufferDesc pToken);
401
402typedef SECURITY_STATUS (SEC_ENTRY *COMPLETE_AUTH_TOKEN_FN)(PCtxtHandle,
403 PSecBufferDesc);
404
405SECURITY_STATUS SEC_ENTRY DeleteSecurityContext(PCtxtHandle phContext);
406
407typedef SECURITY_STATUS (SEC_ENTRY *DELETE_SECURITY_CONTEXT_FN)(PCtxtHandle);
408
409SECURITY_STATUS SEC_ENTRY ApplyControlToken(PCtxtHandle phContext,
410 PSecBufferDesc pInput);
411
412typedef SECURITY_STATUS (SEC_ENTRY *APPLY_CONTROL_TOKEN_FN)(PCtxtHandle,
413 PSecBufferDesc);
414
415SECURITY_STATUS SEC_ENTRY QueryContextAttributesA(PCtxtHandle phContext,
416 ULONG ulAttribute, void *pBuffer);
417SECURITY_STATUS SEC_ENTRY QueryContextAttributesW(PCtxtHandle phContext,
418 ULONG ulAttribute, void *pBuffer);
419#define QueryContextAttributes WINELIB_NAME_AW(QueryContextAttributes)
420
421typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle,
422 ULONG, void *);
423typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle,
424 ULONG, void *);
425#define QUERY_CONTEXT_ATTRIBUTES_FN WINELIB_NAME_AW(QUERY_CONTEXT_ATTRIBUTES_FN_)
426
427/* values for QueryContextAttributes/SetContextAttributes ulAttribute */
428#define SECPKG_ATTR_SIZES 0
429#define SECPKG_ATTR_NAMES 1
430#define SECPKG_ATTR_LIFESPAN 2
431#define SECPKG_ATTR_DCE_INFO 3
432#define SECPKG_ATTR_STREAM_SIZES 4
433#define SECPKG_ATTR_KEY_INFO 5
434#define SECPKG_ATTR_AUTHORITY 6
435#define SECPKG_ATTR_PROTO_INFO 7
436#define SECPKG_ATTR_PASSWORD_EXPIRY 8
437#define SECPKG_ATTR_SESSION_KEY 9
438#define SECPKG_ATTR_PACKAGE_INFO 10
439#define SECPKG_ATTR_USER_FLAGS 11
440#define SECPKG_ATTR_NEGOTIATION_INFO 12
441#define SECPKG_ATTR_NATIVE_NAMES 13
442#define SECPKG_ATTR_FLAGS 14
443#define SECPKG_ATTR_USE_VALIDATED 15
444#define SECPKG_ATTR_CREDENTIAL_NAME 16
445#define SECPKG_ATTR_TARGET_INFORMATION 17
446#define SECPKG_ATTR_ACCESS_TOKEN 18
447#define SECPKG_ATTR_TARGET 19
448#define SECPKG_ATTR_AUTHENTICATION_ID 20
449
450/* types for QueryContextAttributes/SetContextAttributes */
451
452typedef struct _SecPkgContext_Sizes
453{
454 ULONG cbMaxToken;
455 ULONG cbMaxSignature;
456 ULONG cbBlockSize;
457 ULONG cbSecurityTrailer;
458} SecPkgContext_Sizes, *PSecPkgContext_Sizes;
459
460typedef struct _SecPkgContext_StreamSizes
461{
462 ULONG cbHeader;
463 ULONG cbTrailer;
464 ULONG cbMaximumMessage;
465 ULONG cbBuffers;
466 ULONG cbBlockSize;
467} SecPkgContext_StreamSizes, *PSecPkgContext_StreamSizes;
468
469typedef struct _SecPkgContext_NamesA
470{
471 SEC_CHAR *sUserName;
472} SecPkgContext_NamesA, *PSecPkgContext_NamesA;
473
474typedef struct _SecPkgContext_NamesW
475{
476 SEC_WCHAR *sUserName;
477} SecPkgContext_NamesW, *PSecPkgContext_NamesW;
478
479#define SecPkgContext_Names WINELIB_NAME_AW(SecPkgContext_Names)
480#define PSecPkgContext_Names WINELIB_NAME_AW(PSecPkgContext_Names)
481
482typedef struct _SecPkgContext_Lifespan
483{
484 TimeStamp tsStart;
485 TimeStamp tsExpiry;
486} SecPkgContext_Lifespan, *PSecPkgContext_Lifespan;
487
488typedef struct _SecPkgContext_DceInfo
489{
490 ULONG AuthzSvc;
491 PVOID pPac;
492} SecPkgContext_DceInfo, *PSecPkgContext_DceInfo;
493
494typedef struct _SecPkgContext_KeyInfoA
495{
496 SEC_CHAR *sSignatureAlgorithmName;
497 SEC_CHAR *sEncryptAlgorithmName;
498 ULONG KeySize;
499 ULONG SignatureAlgorithm;
500 ULONG EncryptAlgorithm;
501} SecPkgContext_KeyInfoA, *PSecPkgContext_KeyInfoA;
502
503typedef struct _SecPkgContext_KeyInfoW
504{
505 SEC_WCHAR *sSignatureAlgorithmName;
506 SEC_WCHAR *sEncryptAlgorithmName;
507 ULONG KeySize;
508 ULONG SignatureAlgorithm;
509 ULONG EncryptAlgorithm;
510} SecPkgContext_KeyInfoW, *PSecPkgContext_KeyInfoW;
511
512#define SecPkgContext_KeyInfo WINELIB_NAME_AW(SecPkgContext_KeyInfo)
513#define PSecPkgContext_KeyInfo WINELIB_NAME_AW(PSecPkgContext_KeyInfo)
514
515typedef struct _SecPkgContext_AuthorityA
516{
517 SEC_CHAR *sAuthorityName;
518} SecPkgContext_AuthorityA, *PSecPkgContext_AuthorityA;
519
520typedef struct _SecPkgContext_AuthorityW
521{
522 SEC_WCHAR *sAuthorityName;
523} SecPkgContext_AuthorityW, *PSecPkgContext_AuthorityW;
524
525#define SecPkgContext_Authority WINELIB_NAME_AW(SecPkgContext_Authority)
526#define PSecPkgContext_Authority WINELIB_NAME_AW(PSecPkgContext_Authority)
527
528typedef struct _SecPkgContext_ProtoInfoA
529{
530 SEC_CHAR *sProtocolName;
531 ULONG majorVersion;
532 ULONG minorVersion;
533} SecPkgContext_ProtoInfoA, *PSecPkgContext_ProtoInfoA;
534
535typedef struct _SecPkgContext_ProtoInfoW
536{
537 SEC_WCHAR *sProtocolName;
538 ULONG majorVersion;
539 ULONG minorVersion;
540} SecPkgContext_ProtoInfoW, *PSecPkgContext_ProtoInfoW;
541
542#define SecPkgContext_ProtoInfo WINELIB_NAME_AW(SecPkgContext_ProtoInfo)
543#define PSecPkgContext_ProtoInfo WINELIB_NAME_AW(PSecPkgContext_ProtoInfo)
544
545typedef struct _SecPkgContext_PasswordExpiry
546{
547 TimeStamp tsPasswordExpires;
548} SecPkgContext_PasswordExpiry, *PSecPkgContext_PasswordExpiry;
549
550typedef struct _SecPkgContext_SessionKey
551{
552 ULONG SessionKeyLength;
553 unsigned char *SessionKey;
554} SecPkgContext_SessionKey, *PSecPkgContext_SessionKey;
555
556typedef struct _SecPkgContext_PackageInfoA
557{
558 PSecPkgInfoA PackageInfo;
559} SecPkgContext_PackageInfoA, *PSecPkgContext_PackageInfoA;
560
561typedef struct _SecPkgContext_PackageInfoW
562{
563 PSecPkgInfoW PackageInfo;
564} SecPkgContext_PackageInfoW, *PSecPkgContext_PackageInfoW;
565
566#define SecPkgContext_PackageInfo WINELIB_NAME_AW(SecPkgContext_PackageInfo)
567#define PSecPkgContext_PackageInfo WINELIB_NAME_AW(PSecPkgContext_PackageInfo)
568
569typedef struct _SecPkgContext_Flags
570{
571 ULONG Flags;
572} SecPkgContext_Flags, *PSecPkgContext_Flags;
573
574typedef struct _SecPkgContext_UserFlags
575{
576 ULONG UserFlags;
577} SecPkgContext_UserFlags, *PSecPkgContext_UserFlags;
578
579typedef struct _SecPkgContext_NegotiationInfoA
580{
581 PSecPkgInfoA PackageInfo;
582 ULONG NegotiationState;
583} SecPkgContext_NegotiationInfoA, *PSecPkgContext_NegotiationInfoA;
584
585typedef struct _SecPkgContext_NegotiationInfoW
586{
587 PSecPkgInfoW PackageInfo;
588 ULONG NegotiationState;
589} SecPkgContext_NegotiationInfoW, *PSecPkgContext_NegotiationInfoW;
590
591#define SecPkgContext_NegotiationInfo WINELIB_NAME_AW(SecPkgContext_NegotiationInfo)
592#define PSecPkgContext_NegotiationInfo WINELIB_NAME_AW(PSecPkgContext_NegotiationInfo)
593
594/* values for NegotiationState */
595#define SECPKG_NEGOTIATION_COMPLETE 0
596#define SECPKG_NEGOTIATION_OPTIMISTIC 1
597#define SECPKG_NEGOTIATION_IN_PROGRESS 2
598#define SECPKG_NEGOTIATION_DIRECT 3
599#define SECPKG_NEGOTIATION_TRY_MULTICRED 4
600
601typedef struct _SecPkgContext_NativeNamesA
602{
603 SEC_CHAR *sClientName;
604 SEC_CHAR *sServerName;
605} SecPkgContext_NativeNamesA, *PSecPkgContext_NativeNamesA;
606
607typedef struct _SecPkgContext_NativeNamesW
608{
609 SEC_WCHAR *sClientName;
610 SEC_WCHAR *sServerName;
611} SecPkgContext_NativeNamesW, *PSecPkgContext_NativeNamesW;
612
613#define SecPkgContext_NativeNames WINELIB_NAME_AW(SecPkgContext_NativeNames)
614#define PSecPkgContext_NativeNames WINELIB_NAME_AW(PSecPkgContext_NativeNames)
615
616typedef struct _SecPkgContext_CredentialNameA
617{
618 ULONG CredentialType;
619 SEC_CHAR *sCredentialName;
620} SecPkgContext_CredentialNameA, *PSecPkgContext_CredentialNameA;
621
622typedef struct _SecPkgContext_CredentialNameW
623{
624 ULONG CredentialType;
625 SEC_WCHAR *sCredentialName;
626} SecPkgContext_CredentialNameW, *PSecPkgContext_CredentialNameW;
627
628#define SecPkgContext_CredentialName WINELIB_NAME_AW(SecPkgContext_CredentialName)
629#define PSecPkgContext_CredentialName WINELIB_NAME_AW(PSecPkgContext_CredentialName)
630
631typedef struct _SecPkgContext_AccessToken
632{
633 void *AccessToken;
634} SecPkgContext_AccessToken, *PSecPkgContext_AccessToken;
635
636typedef struct _SecPkgContext_TargetInformation
637{
638 ULONG MarshalledTargetInfoLength;
639 unsigned char *MarshalledTargetInfo;
640} SecPkgContext_TargetInformation, *PSecPkgContext_TargetInformation;
641
642typedef struct _SecPkgContext_AuthzID
643{
644 ULONG AuthzIDLength;
645 char *AuthzID;
646} SecPkgContext_AuthzID, *PSecPkgContext_AuthzID;
647
648typedef struct _SecPkgContext_Target
649{
650 ULONG TargetLength;
651 char *Target;
652} SecPkgContext_Target, *PSecPkgContext_Target;
653
654SECURITY_STATUS SEC_ENTRY ImpersonateSecurityContext(PCtxtHandle phContext);
655
656typedef SECURITY_STATUS (SEC_ENTRY *IMPERSONATE_SECURITY_CONTEXT_FN)
657 (PCtxtHandle);
658
659SECURITY_STATUS SEC_ENTRY RevertSecurityContext(PCtxtHandle phContext);
660
661typedef SECURITY_STATUS (SEC_ENTRY *REVERT_SECURITY_CONTEXT_FN)(PCtxtHandle);
662
663SECURITY_STATUS SEC_ENTRY MakeSignature(PCtxtHandle phContext,
664 ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo);
665
666typedef SECURITY_STATUS (SEC_ENTRY *MAKE_SIGNATURE_FN)(PCtxtHandle,
667 ULONG, PSecBufferDesc, ULONG);
668
669SECURITY_STATUS SEC_ENTRY VerifySignature(PCtxtHandle phContext,
670 PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP);
671
672typedef SECURITY_STATUS (SEC_ENTRY *VERIFY_SIGNATURE_FN)(PCtxtHandle,
673 PSecBufferDesc, ULONG, PULONG);
674
675SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoA(
676 SEC_CHAR *pszPackageName, PSecPkgInfoA *ppPackageInfo);
677SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoW(
678 SEC_WCHAR *pszPackageName, PSecPkgInfoW *ppPackageInfo);
679#define QuerySecurityPackageInfo WINELIB_NAME_AW(QuerySecurityPackageInfo)
680
681typedef SECURITY_STATUS (SEC_ENTRY *QUERY_SECURITY_PACKAGE_INFO_FN_A)
682 (SEC_CHAR *, PSecPkgInfoA *);
683typedef SECURITY_STATUS (SEC_ENTRY *QUERY_SECURITY_PACKAGE_INFO_FN_W)
684 (SEC_WCHAR *, PSecPkgInfoW *);
685#define QUERY_SECURITY_PACKAGE_INFO_FN WINELIB_NAME_AW(QUERY_SECURITY_PACKAGE_INFO_FN_)
686
687SECURITY_STATUS SEC_ENTRY ExportSecurityContext(PCtxtHandle phContext,
688 ULONG fFlags, PSecBuffer pPackedContext, void **pToken);
689
690typedef SECURITY_STATUS (SEC_ENTRY *EXPORT_SECURITY_CONTEXT_FN)(PCtxtHandle,
691 ULONG, PSecBuffer, void **);
692
693/* values for ExportSecurityContext fFlags */
694#define SECPKG_CONTEXT_EXPORT_RESET_NEW 0x00000001
695#define SECPKG_CONTEXT_EXPORT_DELETE_OLD 0x00000002
696
697SECURITY_STATUS SEC_ENTRY ImportSecurityContextA(SEC_CHAR *pszPackage,
698 PSecBuffer pPackedContext, void *Token, PCtxtHandle phContext);
699SECURITY_STATUS SEC_ENTRY ImportSecurityContextW(SEC_WCHAR *pszPackage,
700 PSecBuffer pPackedContext, void *Token, PCtxtHandle phContext);
701#define ImportSecurityContext WINELIB_NAME_AW(ImportSecurityContext)
702
703typedef SECURITY_STATUS (SEC_ENTRY *IMPORT_SECURITY_CONTEXT_FN_A)(SEC_CHAR *,
704 PSecBuffer, void *, PCtxtHandle);
705typedef SECURITY_STATUS (SEC_ENTRY *IMPORT_SECURITY_CONTEXT_FN_W)(SEC_WCHAR *,
706 PSecBuffer, void *, PCtxtHandle);
707#define IMPORT_SECURITY_CONTEXT_FN WINELIB_NAME_AW(IMPORT_SECURITY_CONTEXT_FN_)
708
709SECURITY_STATUS SEC_ENTRY AddCredentialsA(PCredHandle hCredentials,
710 SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialUse,
711 void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument,
712 PTimeStamp ptsExpiry);
713SECURITY_STATUS SEC_ENTRY AddCredentialsW(PCredHandle hCredentials,
714 SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialUse,
715 void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument,
716 PTimeStamp ptsExpiry);
717#define AddCredentials WINELIB_NAME_AW(AddCredentials)
718
719typedef SECURITY_STATUS (SEC_ENTRY *ADD_CREDENTIALS_FN_A)(PCredHandle,
720 SEC_CHAR *, SEC_CHAR *, ULONG, void *, SEC_GET_KEY_FN, void *,
721 PTimeStamp);
722typedef SECURITY_STATUS (SEC_ENTRY *ADD_CREDENTIALS_FN_W)(PCredHandle,
723 SEC_WCHAR *, SEC_WCHAR *, ULONG, void *, SEC_GET_KEY_FN, void *,
724 PTimeStamp);
725
726SECURITY_STATUS SEC_ENTRY QuerySecurityContextToken(PCtxtHandle phContext,
727 HANDLE *phToken);
728
729typedef SECURITY_STATUS (SEC_ENTRY *QUERY_SECURITY_CONTEXT_TOKEN_FN)
730 (PCtxtHandle, HANDLE *);
731
732SECURITY_STATUS SEC_ENTRY EncryptMessage(PCtxtHandle phContext, ULONG fQOP,
733 PSecBufferDesc pMessage, ULONG MessageSeqNo);
734SECURITY_STATUS SEC_ENTRY DecryptMessage(PCtxtHandle phContext,
735 PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP);
736
737/* values for EncryptMessage fQOP */
738#define SECQOP_WRAP_NO_ENCRYPT 0x80000001
739
740typedef SECURITY_STATUS (SEC_ENTRY *ENCRYPT_MESSAGE_FN)(PCtxtHandle, ULONG,
741 PSecBufferDesc, ULONG);
742typedef SECURITY_STATUS (SEC_ENTRY *DECRYPT_MESSAGE_FN)(PCtxtHandle,
743 PSecBufferDesc, ULONG, PULONG);
744
745SECURITY_STATUS SEC_ENTRY SetContextAttributesA(PCtxtHandle phContext,
746 ULONG ulAttribute, void *pBuffer, ULONG cbBuffer);
747SECURITY_STATUS SEC_ENTRY SetContextAttributesW(PCtxtHandle phContext,
748 ULONG ulAttribute, void *pBuffer, ULONG cbBuffer);
749#define SetContextAttributes WINELIB_NAME_AW(SetContextAttributes)
750
751typedef SECURITY_STATUS (SEC_ENTRY *SET_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle,
752 ULONG, void *, ULONG);
753typedef SECURITY_STATUS (SEC_ENTRY *SET_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle,
754 ULONG, void *, ULONG);
755
756#define SECURITY_ENTRYPOINT_ANSIA "InitSecurityInterfaceA"
757#define SECURITY_ENTRYPOINT_ANSIW "InitSecurityInterfaceW"
758#define SECURITY_ENTRYPOINT_ANSI WINELIB_NAME_AW(SECURITY_ENTRYPOINT_ANSI)
759
760typedef struct _SECURITY_FUNCTION_TABLE_A
761{
762 ULONG dwVersion;
763 ENUMERATE_SECURITY_PACKAGES_FN_A EnumerateSecurityPackagesA;
764 QUERY_CREDENTIALS_ATTRIBUTES_FN_A QueryCredentialsAttributesA;
765 ACQUIRE_CREDENTIALS_HANDLE_FN_A AcquireCredentialsHandleA;
766 FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle;
767 void *Reserved2;
768 INITIALIZE_SECURITY_CONTEXT_FN_A InitializeSecurityContextA;
769 ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext;
770 COMPLETE_AUTH_TOKEN_FN CompleteAuthToken;
771 DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext;
772 APPLY_CONTROL_TOKEN_FN ApplyControlToken;
773 QUERY_CONTEXT_ATTRIBUTES_FN_A QueryContextAttributesA;
774 IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext;
775 REVERT_SECURITY_CONTEXT_FN RevertSecurityContext;
776 MAKE_SIGNATURE_FN MakeSignature;
777 VERIFY_SIGNATURE_FN VerifySignature;
778 FREE_CONTEXT_BUFFER_FN FreeContextBuffer;
779 QUERY_SECURITY_PACKAGE_INFO_FN_A QuerySecurityPackageInfoA;
780 void *Reserved3;
781 void *Reserved4;
782 EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext;
783 IMPORT_SECURITY_CONTEXT_FN_A ImportSecurityContextA;
784 ADD_CREDENTIALS_FN_A AddCredentialsA;
785 void *Reserved8;
786 QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken;
787 ENCRYPT_MESSAGE_FN EncryptMessage;
788 DECRYPT_MESSAGE_FN DecryptMessage;
789 SET_CONTEXT_ATTRIBUTES_FN_A SetContextAttributesA;
790} SecurityFunctionTableA, *PSecurityFunctionTableA;
791
792typedef struct _SECURITY_FUNCTION_TABLE_W
793{
794 ULONG dwVersion;
795 ENUMERATE_SECURITY_PACKAGES_FN_W EnumerateSecurityPackagesW;
796 QUERY_CREDENTIALS_ATTRIBUTES_FN_W QueryCredentialsAttributesW;
797 ACQUIRE_CREDENTIALS_HANDLE_FN_W AcquireCredentialsHandleW;
798 FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle;
799 void *Reserved2;
800 INITIALIZE_SECURITY_CONTEXT_FN_W InitializeSecurityContextW;
801 ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext;
802 COMPLETE_AUTH_TOKEN_FN CompleteAuthToken;
803 DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext;
804 APPLY_CONTROL_TOKEN_FN ApplyControlToken;
805 QUERY_CONTEXT_ATTRIBUTES_FN_W QueryContextAttributesW;
806 IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext;
807 REVERT_SECURITY_CONTEXT_FN RevertSecurityContext;
808 MAKE_SIGNATURE_FN MakeSignature;
809 VERIFY_SIGNATURE_FN VerifySignature;
810 FREE_CONTEXT_BUFFER_FN FreeContextBuffer;
811 QUERY_SECURITY_PACKAGE_INFO_FN_W QuerySecurityPackageInfoW;
812 void *Reserved3;
813 void *Reserved4;
814 EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext;
815 IMPORT_SECURITY_CONTEXT_FN_W ImportSecurityContextW;
816 ADD_CREDENTIALS_FN_W AddCredentialsW;
817 void *Reserved8;
818 QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken;
819 ENCRYPT_MESSAGE_FN EncryptMessage;
820 DECRYPT_MESSAGE_FN DecryptMessage;
821 SET_CONTEXT_ATTRIBUTES_FN_W SetContextAttributesW;
822} SecurityFunctionTableW, *PSecurityFunctionTableW;
823
824#define SecurityFunctionTable WINELIB_NAME_AW(SecurityFunctionTable)
825#define PSecurityFunctionTable WINELIB_NAME_AW(PSecurityFunctionTable)
826
827#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION 1
828#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2 2
829
830PSecurityFunctionTableA SEC_ENTRY InitSecurityInterfaceA(void);
831PSecurityFunctionTableW SEC_ENTRY InitSecurityInterfaceW(void);
832#define InitSecurityInterface WINELIB_NAME_AW(InitSecurityInterface)
833
834typedef PSecurityFunctionTableA (SEC_ENTRY *INIT_SECURITY_INTERFACE_A)(void);
835typedef PSecurityFunctionTableW (SEC_ENTRY *INIT_SECURITY_INTERFACE_W)(void);
836#define INIT_SECURITY_INTERFACE WINELIB_NAME_AW(INIT_SECURITY_INTERFACE_)
837
838#ifdef __cplusplus
839}
840#endif
841
842#endif /* ndef __WINE_SSPI_H__ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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