1 | /*
|
---|
2 | * Copyright (C) 2007 Yuval Fledel
|
---|
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 _NTSECPKG_H
|
---|
29 | #define _NTSECPKG_H
|
---|
30 |
|
---|
31 | #ifdef __cplusplus
|
---|
32 | extern "C" {
|
---|
33 | #endif
|
---|
34 |
|
---|
35 | /* Flags for the MachineState field in SECPKG_PARAMETERS */
|
---|
36 | #define SECPKG_STATE_ENCRYPTION_PERMITTED 0x01
|
---|
37 | #define SECPKG_STATE_STRONG_ENCRYPTION_PERMITTED 0x02
|
---|
38 | #define SECPKG_STATE_DOMAIN_CONTROLLER 0x04
|
---|
39 | #define SECPKG_STATE_WORKSTATION 0x08
|
---|
40 | #define SECPKG_STATE_STANDALONE 0x10
|
---|
41 |
|
---|
42 | /* Version magics as passed to or returned from Sp[Lsa,Mode]ModeInitialize */
|
---|
43 | #define SECPKG_INTERFACE_VERSION 0x10000
|
---|
44 | #define SECPKG_INTERFACE_VERSION_2 0x20000
|
---|
45 | #define SECPKG_INTERFACE_VERSION_3 0x40000
|
---|
46 | #define SECPKG_INTERFACE_VERSION_4 0x80000
|
---|
47 | #define SECPKG_INTERFACE_VERSION_5 0x100000
|
---|
48 | #define SECPKG_INTERFACE_VERSION_6 0x200000
|
---|
49 |
|
---|
50 | /* enum definitions for Secure Service Provider/Authentication Packages */
|
---|
51 | typedef enum _LSA_TOKEN_INFORMATION_TYPE {
|
---|
52 | LsaTokenInformationNull,
|
---|
53 | LsaTokenInformationV1
|
---|
54 | } LSA_TOKEN_INFORMATION_TYPE, *PLSA_TOKEN_INFORMATION_TYPE;
|
---|
55 |
|
---|
56 | typedef enum _SECPKG_EXTENDED_INFORMATION_CLASS
|
---|
57 | {
|
---|
58 | SecpkgGssInfo = 1,
|
---|
59 | SecpkgContextThunks,
|
---|
60 | SecpkgMutualAuthLevel,
|
---|
61 | SecpkgMaxInfo
|
---|
62 | } SECPKG_EXTENDED_INFORMATION_CLASS;
|
---|
63 |
|
---|
64 | typedef enum _SECPKG_NAME_TYPE {
|
---|
65 | SecNameSamCompatible,
|
---|
66 | SecNameAlternateId,
|
---|
67 | SecNameFlat,
|
---|
68 | SecNameDN
|
---|
69 | } SECPKG_NAME_TYPE;
|
---|
70 |
|
---|
71 | /* struct definitions for SSP/AP */
|
---|
72 | typedef struct _SECPKG_PRIMARY_CRED {
|
---|
73 | LUID LogonId;
|
---|
74 | UNICODE_STRING DownlevelName;
|
---|
75 | UNICODE_STRING DomainName;
|
---|
76 | UNICODE_STRING Password;
|
---|
77 | UNICODE_STRING OldPassword;
|
---|
78 | PSID UserSid;
|
---|
79 | ULONG Flags;
|
---|
80 | UNICODE_STRING DnsDomainName;
|
---|
81 | UNICODE_STRING Upn;
|
---|
82 | UNICODE_STRING LogonServer;
|
---|
83 | UNICODE_STRING Spare1;
|
---|
84 | UNICODE_STRING Spare2;
|
---|
85 | UNICODE_STRING Spare3;
|
---|
86 | UNICODE_STRING Spare4;
|
---|
87 | } SECPKG_PRIMARY_CRED, *PSECPKG_PRIMARY_CRED;
|
---|
88 |
|
---|
89 | typedef struct _SECPKG_SUPPLEMENTAL_CRED {
|
---|
90 | UNICODE_STRING PackageName;
|
---|
91 | ULONG CredentialSize;
|
---|
92 | PUCHAR Credentials;
|
---|
93 | } SECPKG_SUPPLEMENTAL_CRED, *PSECPKG_SUPPLEMENTAL_CRED;
|
---|
94 |
|
---|
95 | typedef struct _SECPKG_SUPPLEMENTAL_CRED_ARRAY {
|
---|
96 | ULONG CredentialCount;
|
---|
97 | SECPKG_SUPPLEMENTAL_CRED Credentials[1];
|
---|
98 | } SECPKG_SUPPLEMENTAL_CRED_ARRAY, *PSECPKG_SUPPLEMENTAL_CRED_ARRAY;
|
---|
99 |
|
---|
100 | typedef struct _SECPKG_PARAMETERS {
|
---|
101 | ULONG Version;
|
---|
102 | ULONG MachineState;
|
---|
103 | ULONG SetupMode;
|
---|
104 | PSID DomainSid;
|
---|
105 | UNICODE_STRING DomainName;
|
---|
106 | UNICODE_STRING DnsDomainName;
|
---|
107 | GUID DomainGuid;
|
---|
108 | } SECPKG_PARAMETERS, *PSECPKG_PARAMETERS,
|
---|
109 | SECPKG_EVENT_DOMAIN_CHANGE, *PSECPKG_EVENT_DOMAIN_CHANGE;
|
---|
110 |
|
---|
111 | typedef struct _SECPKG_CLIENT_INFO {
|
---|
112 | LUID LogonId;
|
---|
113 | ULONG ProcessID;
|
---|
114 | ULONG ThreadID;
|
---|
115 | BOOLEAN HasTcbPrivilege;
|
---|
116 | BOOLEAN Impersonating;
|
---|
117 | BOOLEAN Restricted;
|
---|
118 | } SECPKG_CLIENT_INFO,
|
---|
119 | *PSECPKG_CLIENT_INFO;
|
---|
120 |
|
---|
121 | typedef struct _SECURITY_USER_DATA {
|
---|
122 | UNICODE_STRING UserName;
|
---|
123 | UNICODE_STRING LogonDomainName;
|
---|
124 | UNICODE_STRING LogonServer;
|
---|
125 | PSID pSid;
|
---|
126 | } SECURITY_USER_DATA, *PSECURITY_USER_DATA,
|
---|
127 | SecurityUserData, *PSecurityUserData;
|
---|
128 |
|
---|
129 | typedef struct _SECPKG_GSS_INFO {
|
---|
130 | ULONG EncodedIdLength;
|
---|
131 | UCHAR EncodedId[4];
|
---|
132 | } SECPKG_GSS_INFO, *PSECPKG_GSS_INFO;
|
---|
133 |
|
---|
134 | typedef struct _SECPKG_CONTEXT_THUNKS {
|
---|
135 | ULONG InfoLevelCount;
|
---|
136 | ULONG Levels[1];
|
---|
137 | } SECPKG_CONTEXT_THUNKS, *PSECPKG_CONTEXT_THUNKS;
|
---|
138 |
|
---|
139 | typedef struct _SECPKG_MUTUAL_AUTH_LEVEL {
|
---|
140 | ULONG MutualAuthLevel;
|
---|
141 | } SECPKG_MUTUAL_AUTH_LEVEL, *PSECPKG_MUTUAL_AUTH_LEVEL;
|
---|
142 |
|
---|
143 | typedef struct _SECPKG_CALL_INFO {
|
---|
144 | ULONG ProcessId;
|
---|
145 | ULONG ThreadId;
|
---|
146 | ULONG Attributes;
|
---|
147 | ULONG CallCount;
|
---|
148 | } SECPKG_CALL_INFO, *PSECPKG_CALL_INFO;
|
---|
149 |
|
---|
150 | typedef struct _SECPKG_EXTENDED_INFORMATION {
|
---|
151 | SECPKG_EXTENDED_INFORMATION_CLASS Class;
|
---|
152 | union {
|
---|
153 | SECPKG_GSS_INFO GssInfo;
|
---|
154 | SECPKG_CONTEXT_THUNKS ContextThunks;
|
---|
155 | SECPKG_MUTUAL_AUTH_LEVEL MutualAuthLevel;
|
---|
156 | } Info;
|
---|
157 | } SECPKG_EXTENDED_INFORMATION, *PSECPKG_EXTENDED_INFORMATION;
|
---|
158 |
|
---|
159 | typedef struct _SECPKG_TARGETINFO {
|
---|
160 | PSID DomainSid;
|
---|
161 | PCWSTR ComputerName;
|
---|
162 | } SECPKG_TARGETINFO, *PSECPKG_TARGETINFO;
|
---|
163 |
|
---|
164 | /* callbacks implemented by SSP/AP dlls and called by the LSA */
|
---|
165 | typedef VOID (NTAPI *PLSA_CALLBACK_FUNCTION)(ULONG_PTR, ULONG_PTR, PSecBuffer,
|
---|
166 | PSecBuffer);
|
---|
167 |
|
---|
168 | /* misc typedefs used in the below prototypes */
|
---|
169 | typedef PVOID *PLSA_CLIENT_REQUEST;
|
---|
170 | typedef ULONG LSA_SEC_HANDLE, *PLSA_SEC_HANDLE;
|
---|
171 | typedef LPTHREAD_START_ROUTINE SEC_THREAD_START;
|
---|
172 | typedef PSECURITY_ATTRIBUTES SEC_ATTRS;
|
---|
173 |
|
---|
174 | /* functions used by SSP/AP obtainable by dispatch tables */
|
---|
175 | typedef NTSTATUS (NTAPI *PLSA_REGISTER_CALLBACK)(ULONG, PLSA_CALLBACK_FUNCTION);
|
---|
176 | typedef NTSTATUS (NTAPI *PLSA_CREATE_LOGON_SESSION)(PLUID);
|
---|
177 | typedef NTSTATUS (NTAPI *PLSA_DELETE_LOGON_SESSION)(PLUID);
|
---|
178 | typedef NTSTATUS (NTAPI *PLSA_ADD_CREDENTIAL)(PLUID, ULONG, PLSA_STRING,
|
---|
179 | PLSA_STRING);
|
---|
180 | typedef NTSTATUS (NTAPI *PLSA_GET_CREDENTIALS)(PLUID, ULONG, PULONG, BOOLEAN,
|
---|
181 | PLSA_STRING, PULONG, PLSA_STRING);
|
---|
182 | typedef NTSTATUS (NTAPI *PLSA_DELETE_CREDENTIAL)(PLUID, ULONG, PLSA_STRING);
|
---|
183 | typedef PVOID (NTAPI *PLSA_ALLOCATE_LSA_HEAP)(ULONG);
|
---|
184 | typedef VOID (NTAPI *PLSA_FREE_LSA_HEAP)(PVOID);
|
---|
185 | typedef NTSTATUS (NTAPI *PLSA_ALLOCATE_CLIENT_BUFFER)(PLSA_CLIENT_REQUEST,
|
---|
186 | ULONG, PVOID*);
|
---|
187 | typedef NTSTATUS (NTAPI *PLSA_FREE_CLIENT_BUFFER)(PLSA_CLIENT_REQUEST, PVOID);
|
---|
188 | typedef NTSTATUS (NTAPI *PLSA_COPY_TO_CLIENT_BUFFER)(PLSA_CLIENT_REQUEST, ULONG,
|
---|
189 | PVOID, PVOID);
|
---|
190 | typedef NTSTATUS (NTAPI *PLSA_COPY_FROM_CLIENT_BUFFER)(PLSA_CLIENT_REQUEST,
|
---|
191 | ULONG, PVOID, PVOID);
|
---|
192 | typedef NTSTATUS (NTAPI *PLSA_IMPERSONATE_CLIENT)(void);
|
---|
193 | typedef NTSTATUS (NTAPI *PLSA_UNLOAD_PACKAGE)(void);
|
---|
194 | typedef NTSTATUS (NTAPI *PLSA_DUPLICATE_HANDLE)(HANDLE, PHANDLE);
|
---|
195 | typedef NTSTATUS (NTAPI *PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS)(PLUID, ULONG,
|
---|
196 | PVOID, BOOLEAN);
|
---|
197 | typedef HANDLE (NTAPI *PLSA_CREATE_THREAD)(SEC_ATTRS, ULONG, SEC_THREAD_START,
|
---|
198 | PVOID, ULONG, PULONG);
|
---|
199 | typedef NTSTATUS (NTAPI *PLSA_GET_CLIENT_INFO)(PSECPKG_CLIENT_INFO);
|
---|
200 | typedef HANDLE (NTAPI *PLSA_REGISTER_NOTIFICATION)(SEC_THREAD_START, PVOID,
|
---|
201 | ULONG, ULONG, ULONG, ULONG, HANDLE);
|
---|
202 | typedef NTSTATUS (NTAPI *PLSA_CANCEL_NOTIFICATION)(HANDLE);
|
---|
203 | typedef NTSTATUS (NTAPI *PLSA_MAP_BUFFER)(PSecBuffer, PSecBuffer);
|
---|
204 | typedef NTSTATUS (NTAPI *PLSA_CREATE_TOKEN)(PLUID, PTOKEN_SOURCE,
|
---|
205 | SECURITY_LOGON_TYPE, SECURITY_IMPERSONATION_LEVEL, LSA_TOKEN_INFORMATION_TYPE,
|
---|
206 | PVOID, PTOKEN_GROUPS, PUNICODE_STRING, PUNICODE_STRING, PUNICODE_STRING,
|
---|
207 | PUNICODE_STRING, PHANDLE, PNTSTATUS);
|
---|
208 | typedef VOID (NTAPI *PLSA_AUDIT_LOGON)(NTSTATUS, NTSTATUS, PUNICODE_STRING,
|
---|
209 | PUNICODE_STRING, PUNICODE_STRING, OPTIONAL PSID, SECURITY_LOGON_TYPE,
|
---|
210 | PTOKEN_SOURCE, PLUID);
|
---|
211 | typedef NTSTATUS (NTAPI *PLSA_CALL_PACKAGE)(PUNICODE_STRING, PVOID, ULONG,
|
---|
212 | PVOID*, PULONG, PNTSTATUS);
|
---|
213 | typedef BOOLEAN (NTAPI *PLSA_GET_CALL_INFO)(PSECPKG_CALL_INFO);
|
---|
214 | typedef NTSTATUS (NTAPI *PLSA_CALL_PACKAGEEX)(PUNICODE_STRING, PVOID, PVOID,
|
---|
215 | ULONG, PVOID*, PULONG, PNTSTATUS);
|
---|
216 | typedef PVOID (NTAPI *PLSA_CREATE_SHARED_MEMORY)(ULONG, ULONG);
|
---|
217 | typedef PVOID (NTAPI *PLSA_ALLOCATE_SHARED_MEMORY)(PVOID, ULONG);
|
---|
218 | typedef VOID (NTAPI *PLSA_FREE_SHARED_MEMORY)(PVOID, PVOID);
|
---|
219 | typedef BOOLEAN (NTAPI *PLSA_DELETE_SHARED_MEMORY)(PVOID);
|
---|
220 | typedef NTSTATUS (NTAPI *PLSA_OPEN_SAM_USER)(PUNICODE_STRING, SECPKG_NAME_TYPE,
|
---|
221 | PUNICODE_STRING, BOOLEAN, ULONG, PVOID*);
|
---|
222 | typedef NTSTATUS (NTAPI *PLSA_GET_USER_CREDENTIALS)(PVOID, PVOID *, PULONG,
|
---|
223 | PVOID *, PULONG);
|
---|
224 | typedef NTSTATUS (NTAPI *PLSA_GET_USER_AUTH_DATA)(PVOID, PUCHAR *, PULONG);
|
---|
225 | typedef NTSTATUS (NTAPI *PLSA_CLOSE_SAM_USER)(PVOID);
|
---|
226 | typedef NTSTATUS (NTAPI *PLSA_CONVERT_AUTH_DATA_TO_TOKEN)(PVOID, ULONG,
|
---|
227 | SECURITY_IMPERSONATION_LEVEL, PTOKEN_SOURCE, SECURITY_LOGON_TYPE,
|
---|
228 | PUNICODE_STRING, PHANDLE, PLUID, PUNICODE_STRING, PNTSTATUS);
|
---|
229 | typedef NTSTATUS (NTAPI *PLSA_CLIENT_CALLBACK)(PCHAR, ULONG_PTR, ULONG_PTR,
|
---|
230 | PSecBuffer, PSecBuffer);
|
---|
231 | typedef NTSTATUS (NTAPI *PLSA_UPDATE_PRIMARY_CREDENTIALS)(PSECPKG_PRIMARY_CRED, PSECPKG_SUPPLEMENTAL_CRED_ARRAY);
|
---|
232 | typedef NTSTATUS (NTAPI *PLSA_GET_AUTH_DATA_FOR_USER)(PUNICODE_STRING,
|
---|
233 | SECPKG_NAME_TYPE, PUNICODE_STRING, PUCHAR *, PULONG, PUNICODE_STRING);
|
---|
234 | typedef NTSTATUS (NTAPI *PLSA_CRACK_SINGLE_NAME)(ULONG, BOOLEAN,
|
---|
235 | PUNICODE_STRING, PUNICODE_STRING, ULONG, PUNICODE_STRING, PUNICODE_STRING,
|
---|
236 | PULONG);
|
---|
237 | typedef NTSTATUS (NTAPI *PLSA_AUDIT_ACCOUNT_LOGON)(ULONG, BOOLEAN,
|
---|
238 | PUNICODE_STRING, PUNICODE_STRING, PUNICODE_STRING, NTSTATUS);
|
---|
239 | typedef NTSTATUS (NTAPI *PLSA_CALL_PACKAGE_PASSTHROUGH)(PUNICODE_STRING, PVOID,
|
---|
240 | PVOID, ULONG, PVOID*, PULONG, PNTSTATUS);
|
---|
241 |
|
---|
242 | /* Dispatch tables of functions used by SSP/AP */
|
---|
243 | typedef struct SECPKG_DLL_FUNCTIONS {
|
---|
244 | PLSA_ALLOCATE_LSA_HEAP AllocateHeap;
|
---|
245 | PLSA_FREE_LSA_HEAP FreeHeap;
|
---|
246 | PLSA_REGISTER_CALLBACK RegisterCallback;
|
---|
247 | } SECPKG_DLL_FUNCTIONS,
|
---|
248 | *PSECPKG_DLL_FUNCTIONS;
|
---|
249 |
|
---|
250 | typedef struct LSA_DISPATCH_TABLE {
|
---|
251 | PLSA_CREATE_LOGON_SESSION CreateLogonSession;
|
---|
252 | PLSA_DELETE_LOGON_SESSION DeleteLogonSession;
|
---|
253 | PLSA_ADD_CREDENTIAL AddCredential;
|
---|
254 | PLSA_GET_CREDENTIALS GetCredentials;
|
---|
255 | PLSA_DELETE_CREDENTIAL DeleteCredential;
|
---|
256 | PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap;
|
---|
257 | PLSA_FREE_LSA_HEAP FreeLsaHeap;
|
---|
258 | PLSA_ALLOCATE_CLIENT_BUFFER AllocateClientBuffer;
|
---|
259 | PLSA_FREE_CLIENT_BUFFER FreeClientBuffer;
|
---|
260 | PLSA_COPY_TO_CLIENT_BUFFER CopyToClientBuffer;
|
---|
261 | PLSA_COPY_FROM_CLIENT_BUFFER CopyFromClientBuffer;
|
---|
262 | } LSA_DISPATCH_TABLE,
|
---|
263 | *PLSA_DISPATCH_TABLE;
|
---|
264 |
|
---|
265 | typedef struct _LSA_SECPKG_FUNCTION_TABLE {
|
---|
266 | PLSA_CREATE_LOGON_SESSION CreateLogonSession;
|
---|
267 | PLSA_DELETE_LOGON_SESSION DeleteLogonSession;
|
---|
268 | PLSA_ADD_CREDENTIAL AddCredential;
|
---|
269 | PLSA_GET_CREDENTIALS GetCredentials;
|
---|
270 | PLSA_DELETE_CREDENTIAL DeleteCredential;
|
---|
271 | PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap;
|
---|
272 | PLSA_FREE_LSA_HEAP FreeLsaHeap;
|
---|
273 | PLSA_ALLOCATE_CLIENT_BUFFER AllocateClientBuffer;
|
---|
274 | PLSA_FREE_CLIENT_BUFFER FreeClientBuffer;
|
---|
275 | PLSA_COPY_TO_CLIENT_BUFFER CopyToClientBuffer;
|
---|
276 | PLSA_COPY_FROM_CLIENT_BUFFER CopyFromClientBuffer;
|
---|
277 | PLSA_IMPERSONATE_CLIENT ImpersonateClient;
|
---|
278 | PLSA_UNLOAD_PACKAGE UnloadPackage;
|
---|
279 | PLSA_DUPLICATE_HANDLE DuplicateHandle;
|
---|
280 | PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS SaveSupplementalCredentials;
|
---|
281 | PLSA_CREATE_THREAD CreateThread;
|
---|
282 | PLSA_GET_CLIENT_INFO GetClientInfo;
|
---|
283 | PLSA_REGISTER_NOTIFICATION RegisterNotification;
|
---|
284 | PLSA_CANCEL_NOTIFICATION CancelNotification;
|
---|
285 | PLSA_MAP_BUFFER MapBuffer;
|
---|
286 | PLSA_CREATE_TOKEN CreateToken;
|
---|
287 | PLSA_AUDIT_LOGON AuditLogon;
|
---|
288 | PLSA_CALL_PACKAGE CallPackage;
|
---|
289 | PLSA_FREE_LSA_HEAP FreeReturnBuffer;
|
---|
290 | PLSA_GET_CALL_INFO GetCallInfo;
|
---|
291 | PLSA_CALL_PACKAGEEX CallPackageEx;
|
---|
292 | PLSA_CREATE_SHARED_MEMORY CreateSharedMemory;
|
---|
293 | PLSA_ALLOCATE_SHARED_MEMORY AllocateSharedMemory;
|
---|
294 | PLSA_FREE_SHARED_MEMORY FreeSharedMemory;
|
---|
295 | PLSA_DELETE_SHARED_MEMORY DeleteSharedMemory;
|
---|
296 | PLSA_OPEN_SAM_USER OpenSamUser;
|
---|
297 | PLSA_GET_USER_CREDENTIALS GetUserCredentials;
|
---|
298 | PLSA_GET_USER_AUTH_DATA GetUserAuthData;
|
---|
299 | PLSA_CLOSE_SAM_USER CloseSamUser;
|
---|
300 | PLSA_CONVERT_AUTH_DATA_TO_TOKEN ConvertAuthDataToToken;
|
---|
301 | PLSA_CLIENT_CALLBACK ClientCallback;
|
---|
302 | PLSA_UPDATE_PRIMARY_CREDENTIALS UpdateCredentials;
|
---|
303 | PLSA_GET_AUTH_DATA_FOR_USER GetAuthDataForUser;
|
---|
304 | PLSA_CRACK_SINGLE_NAME CrackSingleName;
|
---|
305 | PLSA_AUDIT_ACCOUNT_LOGON AuditAccountLogon;
|
---|
306 | PLSA_CALL_PACKAGE_PASSTHROUGH CallPackagePassthrough;
|
---|
307 | } LSA_SECPKG_FUNCTION_TABLE,
|
---|
308 | *PLSA_SECPKG_FUNCTION_TABLE;
|
---|
309 |
|
---|
310 | /* LSA-mode functions implemented by SSP/AP obtainable by a dispatch table */
|
---|
311 | typedef NTSTATUS (NTAPI *PLSA_AP_INITIALIZE_PACKAGE)(ULONG, PLSA_DISPATCH_TABLE,
|
---|
312 | PLSA_STRING, PLSA_STRING, PLSA_STRING *);
|
---|
313 | typedef NTSTATUS (NTAPI *PLSA_AP_LOGON_USER)(LPWSTR, LPWSTR, LPWSTR, LPWSTR,
|
---|
314 | DWORD, DWORD, PHANDLE);
|
---|
315 | typedef NTSTATUS (NTAPI *PLSA_AP_CALL_PACKAGE)(PUNICODE_STRING, PVOID, ULONG,
|
---|
316 | PVOID *, PULONG, PNTSTATUS);
|
---|
317 | typedef VOID (NTAPI *PLSA_AP_LOGON_TERMINATED)(PLUID);
|
---|
318 | typedef NTSTATUS (NTAPI *PLSA_AP_CALL_PACKAGE_UNTRUSTED)(PLSA_CLIENT_REQUEST,
|
---|
319 | PVOID, PVOID, ULONG, PVOID *, PULONG, PNTSTATUS);
|
---|
320 | typedef NTSTATUS (NTAPI *PLSA_AP_CALL_PACKAGE_PASSTHROUGH)(PUNICODE_STRING,
|
---|
321 | PVOID, PVOID, ULONG, PVOID *, PULONG, PNTSTATUS);
|
---|
322 | typedef NTSTATUS (NTAPI *PLSA_AP_LOGON_USER_EX)(PLSA_CLIENT_REQUEST,
|
---|
323 | SECURITY_LOGON_TYPE, PVOID, PVOID, ULONG, PVOID *, PULONG, PLUID, PNTSTATUS,
|
---|
324 | PLSA_TOKEN_INFORMATION_TYPE, PVOID *, PUNICODE_STRING *, PUNICODE_STRING *,
|
---|
325 | PUNICODE_STRING *);
|
---|
326 | typedef NTSTATUS (NTAPI *PLSA_AP_LOGON_USER_EX2)(PLSA_CLIENT_REQUEST,
|
---|
327 | SECURITY_LOGON_TYPE, PVOID, PVOID, ULONG, PVOID *, PULONG, PLUID, PNTSTATUS,
|
---|
328 | PLSA_TOKEN_INFORMATION_TYPE, PVOID *, PUNICODE_STRING *, PUNICODE_STRING *,
|
---|
329 | PUNICODE_STRING *, PSECPKG_PRIMARY_CRED, PSECPKG_SUPPLEMENTAL_CRED_ARRAY *);
|
---|
330 | typedef NTSTATUS (SpInitializeFn)(ULONG_PTR, PSECPKG_PARAMETERS,
|
---|
331 | PLSA_SECPKG_FUNCTION_TABLE);
|
---|
332 | typedef NTSTATUS (NTAPI SpShutDownFn)(void);
|
---|
333 | typedef NTSTATUS (NTAPI SpGetInfoFn)(PSecPkgInfoW);
|
---|
334 | typedef NTSTATUS (NTAPI SpAcceptCredentialsFn)(SECURITY_LOGON_TYPE,
|
---|
335 | PUNICODE_STRING, PSECPKG_PRIMARY_CRED, PSECPKG_SUPPLEMENTAL_CRED);
|
---|
336 | typedef NTSTATUS (NTAPI SpAcquireCredentialsHandleFn)(PUNICODE_STRING, ULONG,
|
---|
337 | PLUID, PVOID, PVOID, PVOID, PLSA_SEC_HANDLE, PTimeStamp);
|
---|
338 | typedef NTSTATUS (NTAPI SpQueryCredentialsAttributesFn)(LSA_SEC_HANDLE, ULONG,
|
---|
339 | PVOID);
|
---|
340 | typedef NTSTATUS (NTAPI SpFreeCredentialsHandleFn)(LSA_SEC_HANDLE);
|
---|
341 | typedef NTSTATUS (NTAPI SpSaveCredentialsFn)(LSA_SEC_HANDLE, PSecBuffer);
|
---|
342 | typedef NTSTATUS (NTAPI SpGetCredentialsFn)(LSA_SEC_HANDLE, PSecBuffer);
|
---|
343 | typedef NTSTATUS (NTAPI SpDeleteCredentialsFn)(LSA_SEC_HANDLE, PSecBuffer);
|
---|
344 | typedef NTSTATUS (NTAPI SpInitLsaModeContextFn)(LSA_SEC_HANDLE, LSA_SEC_HANDLE,
|
---|
345 | PUNICODE_STRING, ULONG, ULONG, PSecBufferDesc, PLSA_SEC_HANDLE, PSecBufferDesc,
|
---|
346 | PULONG, PTimeStamp, PBOOLEAN, PSecBuffer);
|
---|
347 | typedef NTSTATUS (NTAPI SpAcceptLsaModeContextFn)(LSA_SEC_HANDLE,
|
---|
348 | LSA_SEC_HANDLE, PSecBufferDesc, ULONG, ULONG, PLSA_SEC_HANDLE, PSecBufferDesc,
|
---|
349 | PULONG, PTimeStamp, PBOOLEAN, PSecBuffer);
|
---|
350 | typedef NTSTATUS (NTAPI SpDeleteContextFn)(LSA_SEC_HANDLE);
|
---|
351 | typedef NTSTATUS (NTAPI SpApplyControlTokenFn)(LSA_SEC_HANDLE, PSecBufferDesc);
|
---|
352 | typedef NTSTATUS (NTAPI SpGetUserInfoFn)(PLUID, ULONG, PSecurityUserData *);
|
---|
353 | typedef NTSTATUS (NTAPI SpGetExtendedInformationFn)(
|
---|
354 | SECPKG_EXTENDED_INFORMATION_CLASS, PSECPKG_EXTENDED_INFORMATION *);
|
---|
355 | typedef NTSTATUS (NTAPI SpQueryContextAttributesFn)(LSA_SEC_HANDLE, ULONG,
|
---|
356 | PVOID);
|
---|
357 | typedef NTSTATUS (NTAPI SpAddCredentialsFn)(LSA_SEC_HANDLE, PUNICODE_STRING,
|
---|
358 | PUNICODE_STRING, ULONG, PVOID, PVOID, PVOID, PTimeStamp);
|
---|
359 | typedef NTSTATUS (NTAPI SpSetExtendedInformationFn)(
|
---|
360 | SECPKG_EXTENDED_INFORMATION_CLASS, PSECPKG_EXTENDED_INFORMATION);
|
---|
361 | typedef NTSTATUS (NTAPI SpSetContextAttributesFn)(LSA_SEC_HANDLE, ULONG, PVOID,
|
---|
362 | ULONG);
|
---|
363 | typedef NTSTATUS (NTAPI SpSetCredentialsAttributesFn)(LSA_SEC_HANDLE, ULONG,
|
---|
364 | PVOID, ULONG);
|
---|
365 | typedef NTSTATUS (NTAPI SpChangeAccountPasswordFn)(PUNICODE_STRING,
|
---|
366 | PUNICODE_STRING, PUNICODE_STRING, PUNICODE_STRING, BOOLEAN, PSecBufferDesc);
|
---|
367 | typedef NTSTATUS (NTAPI SpQueryMetaDataFn)(LSA_SEC_HANDLE, PUNICODE_STRING,
|
---|
368 | ULONG, PULONG, PUCHAR *, PLSA_SEC_HANDLE);
|
---|
369 | typedef NTSTATUS (NTAPI SpExchangeMetaDataFn)(LSA_SEC_HANDLE, PUNICODE_STRING,
|
---|
370 | ULONG, ULONG, PUCHAR, PLSA_SEC_HANDLE);
|
---|
371 | typedef NTSTATUS (NTAPI SpGetCredUIContextFn)(LSA_SEC_HANDLE, GUID *, PULONG,
|
---|
372 | PUCHAR *);
|
---|
373 | typedef NTSTATUS (NTAPI SpUpdateCredentialsFn)(LSA_SEC_HANDLE, GUID *, ULONG,
|
---|
374 | PUCHAR);
|
---|
375 | typedef NTSTATUS (NTAPI SpValidateTargetInfoFn)(PLSA_CLIENT_REQUEST, PVOID,
|
---|
376 | PVOID, ULONG, PSECPKG_TARGETINFO);
|
---|
377 |
|
---|
378 | /* User-mode functions implemented by SSP/AP obtainable by a dispatch table */
|
---|
379 | typedef NTSTATUS (NTAPI SpInstanceInitFn)(ULONG, PSECPKG_DLL_FUNCTIONS,
|
---|
380 | PVOID *);
|
---|
381 | typedef NTSTATUS (NTAPI SpInitUserModeContextFn)(LSA_SEC_HANDLE, PSecBuffer);
|
---|
382 | typedef NTSTATUS (NTAPI SpMakeSignatureFn)(LSA_SEC_HANDLE, ULONG,
|
---|
383 | PSecBufferDesc, ULONG);
|
---|
384 | typedef NTSTATUS (NTAPI SpVerifySignatureFn)(LSA_SEC_HANDLE, PSecBufferDesc,
|
---|
385 | ULONG, PULONG);
|
---|
386 | typedef NTSTATUS (NTAPI SpSealMessageFn)(LSA_SEC_HANDLE, ULONG, PSecBufferDesc,
|
---|
387 | ULONG);
|
---|
388 | typedef NTSTATUS (NTAPI SpUnsealMessageFn)(LSA_SEC_HANDLE, PSecBufferDesc,
|
---|
389 | ULONG, PULONG);
|
---|
390 | typedef NTSTATUS (NTAPI SpGetContextTokenFn)(LSA_SEC_HANDLE, PHANDLE);
|
---|
391 | typedef NTSTATUS (NTAPI SpCompleteAuthTokenFn)(LSA_SEC_HANDLE, PSecBufferDesc);
|
---|
392 | typedef NTSTATUS (NTAPI SpFormatCredentialsFn)(PSecBuffer, PSecBuffer);
|
---|
393 | typedef NTSTATUS (NTAPI SpMarshallSupplementalCredsFn)(ULONG, PUCHAR, PULONG,
|
---|
394 | PVOID *);
|
---|
395 | typedef NTSTATUS (NTAPI SpExportSecurityContextFn)(LSA_SEC_HANDLE, ULONG,
|
---|
396 | PSecBuffer, PHANDLE);
|
---|
397 | typedef NTSTATUS (NTAPI SpImportSecurityContextFn)(PSecBuffer, HANDLE,
|
---|
398 | PLSA_SEC_HANDLE);
|
---|
399 |
|
---|
400 | #ifdef WINE_NO_UNICODE_MACROS
|
---|
401 | #undef SetContextAttributes
|
---|
402 | #endif
|
---|
403 |
|
---|
404 | /* dispatch tables of LSA-mode functions implemented by SSP/AP */
|
---|
405 | typedef struct SECPKG_FUNCTION_TABLE {
|
---|
406 | PLSA_AP_INITIALIZE_PACKAGE InitializePackage;
|
---|
407 | PLSA_AP_LOGON_USER LsaLogonUser;
|
---|
408 | PLSA_AP_CALL_PACKAGE CallPackage;
|
---|
409 | PLSA_AP_LOGON_TERMINATED LogonTerminated;
|
---|
410 | PLSA_AP_CALL_PACKAGE_UNTRUSTED CallPackageUntrusted;
|
---|
411 | PLSA_AP_CALL_PACKAGE_PASSTHROUGH CallPackagePassthrough;
|
---|
412 | PLSA_AP_LOGON_USER_EX LogonUserEx;
|
---|
413 | PLSA_AP_LOGON_USER_EX2 LogonUserEx2;
|
---|
414 | SpInitializeFn *Initialize;
|
---|
415 | SpShutDownFn *Shutdown;
|
---|
416 | SpGetInfoFn *GetInfo;
|
---|
417 | SpAcceptCredentialsFn *AcceptCredentials;
|
---|
418 | SpAcquireCredentialsHandleFn *SpAcquireCredentialsHandle;
|
---|
419 | SpQueryCredentialsAttributesFn *SpQueryCredentialsAttributes;
|
---|
420 | SpFreeCredentialsHandleFn *FreeCredentialsHandle;
|
---|
421 | SpSaveCredentialsFn *SaveCredentials;
|
---|
422 | SpGetCredentialsFn *GetCredentials;
|
---|
423 | SpDeleteCredentialsFn *DeleteCredentials;
|
---|
424 | SpInitLsaModeContextFn *InitLsaModeContext;
|
---|
425 | SpAcceptLsaModeContextFn *AcceptLsaModeContext;
|
---|
426 | SpDeleteContextFn *DeleteContext;
|
---|
427 | SpApplyControlTokenFn *ApplyControlToken;
|
---|
428 | SpGetUserInfoFn *GetUserInfo;
|
---|
429 | SpGetExtendedInformationFn *GetExtendedInformation;
|
---|
430 | SpQueryContextAttributesFn *SpQueryContextAttributes;
|
---|
431 | SpAddCredentialsFn *SpAddCredentials;
|
---|
432 | SpSetExtendedInformationFn *SetExtendedInformation;
|
---|
433 | /* Packages with version SECPKG_INTERFACE_VERSION end here */
|
---|
434 | SpSetContextAttributesFn *SetContextAttributes;
|
---|
435 | /* Packages with version SECPKG_INTERFACE_VERSION_2 end here */
|
---|
436 | SpSetCredentialsAttributesFn *SetCredentialsAttributes;
|
---|
437 | /* Packages with version SECPKG_INTERFACE_VERSION_3 end here */
|
---|
438 | SpChangeAccountPasswordFn *ChangeAccountPassword;
|
---|
439 | /* Packages with version SECPKG_INTERFACE_VERSION_4 end here */
|
---|
440 | SpQueryMetaDataFn *QueryMetaData;
|
---|
441 | SpExchangeMetaDataFn *ExchangeMetaData;
|
---|
442 | SpGetCredUIContextFn *GetCredUIContext;
|
---|
443 | SpUpdateCredentialsFn *UpdateCredentials;
|
---|
444 | /* Packages with version SECPKG_INTERFACE_VERSION_5 end here */
|
---|
445 | SpValidateTargetInfoFn *ValidateTargetInfo;
|
---|
446 | /* Packages with version SECPKG_INTERFACE_VERSION_6 end here */
|
---|
447 | } SECPKG_FUNCTION_TABLE,
|
---|
448 | *PSECPKG_FUNCTION_TABLE;
|
---|
449 |
|
---|
450 | /* dispatch tables of user-mode functions implemented by SSP/AP */
|
---|
451 | typedef struct SECPKG_USER_FUNCTION_TABLE {
|
---|
452 | SpInstanceInitFn *InstanceInit;
|
---|
453 | SpInitUserModeContextFn *InitUserModeContext;
|
---|
454 | SpMakeSignatureFn *MakeSignature;
|
---|
455 | SpVerifySignatureFn *VerifySignature;
|
---|
456 | SpSealMessageFn *SealMessage;
|
---|
457 | SpUnsealMessageFn *UnsealMessage;
|
---|
458 | SpGetContextTokenFn *GetContextToken;
|
---|
459 | SpQueryContextAttributesFn *SpQueryContextAttributes;
|
---|
460 | SpCompleteAuthTokenFn *CompleteAuthToken;
|
---|
461 | SpDeleteContextFn *DeleteUserModeContext;
|
---|
462 | SpFormatCredentialsFn *FormatCredentials;
|
---|
463 | SpMarshallSupplementalCredsFn *MarshallSupplementalCreds;
|
---|
464 | SpExportSecurityContextFn *ExportContext;
|
---|
465 | SpImportSecurityContextFn *ImportContext;
|
---|
466 | } SECPKG_USER_FUNCTION_TABLE,
|
---|
467 | *PSECPKG_USER_FUNCTION_TABLE;
|
---|
468 |
|
---|
469 | /* LSA-mode entry point to SSP/APs */
|
---|
470 | typedef NTSTATUS (NTAPI *SpLsaModeInitializeFn)(ULONG, PULONG,
|
---|
471 | PSECPKG_FUNCTION_TABLE *, PULONG);
|
---|
472 |
|
---|
473 | /* User-mode entry point to SSP/APs */
|
---|
474 | typedef NTSTATUS (WINAPI *SpUserModeInitializeFn)(ULONG, PULONG,
|
---|
475 | PSECPKG_USER_FUNCTION_TABLE *, PULONG);
|
---|
476 |
|
---|
477 | #ifdef __cplusplus
|
---|
478 | }
|
---|
479 | #endif
|
---|
480 | #endif /* _NTSECPKG_H */
|
---|