[LSASRV][MSV1_0]
[reactos.git] / reactos / dll / win32 / msv1_0 / msv1_0.c
1 /*
2 * PROJECT: Authentication Package DLL
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/win32/msv1_0/msv1_0.c
5 * PURPOSE: Main file
6 * COPYRIGHT: Copyright 2013 Eric Kohl
7 */
8
9 /* INCLUDES ****************************************************************/
10
11 #include "msv1_0.h"
12
13 WINE_DEFAULT_DEBUG_CHANNEL(msv1_0);
14
15
16 /* GLOBALS *****************************************************************/
17
18 LSA_DISPATCH_TABLE DispatchTable;
19
20
21 /* FUNCTIONS ***************************************************************/
22
23 static
24 NTSTATUS
25 GetDomainSid(PRPC_SID *Sid)
26 {
27 LSAPR_HANDLE PolicyHandle = NULL;
28 PLSAPR_POLICY_INFORMATION PolicyInfo = NULL;
29 ULONG Length = 0;
30 NTSTATUS Status;
31
32 Status = LsaIOpenPolicyTrusted(&PolicyHandle);
33 if (!NT_SUCCESS(Status))
34 {
35 TRACE("LsaIOpenPolicyTrusted() failed (Status 0x%08lx)\n", Status);
36 return Status;
37 }
38
39 Status = LsarQueryInformationPolicy(PolicyHandle,
40 PolicyAccountDomainInformation,
41 &PolicyInfo);
42 if (!NT_SUCCESS(Status))
43 {
44 TRACE("LsarQueryInformationPolicy() failed (Status 0x%08lx)\n", Status);
45 goto done;
46 }
47
48 Length = RtlLengthSid(PolicyInfo->PolicyAccountDomainInfo.Sid);
49
50 *Sid = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length);
51 if (*Sid == NULL)
52 {
53 ERR("Failed to allocate SID\n");
54 Status = STATUS_INSUFFICIENT_RESOURCES;
55 goto done;
56 }
57
58 memcpy(*Sid, PolicyInfo->PolicyAccountDomainInfo.Sid, Length);
59
60 done:
61 if (PolicyInfo != NULL)
62 LsaIFree_LSAPR_POLICY_INFORMATION(PolicyAccountDomainInformation,
63 PolicyInfo);
64
65 if (PolicyHandle != NULL)
66 LsarClose(&PolicyHandle);
67
68 return Status;
69 }
70
71
72 static
73 NTSTATUS
74 BuildInteractiveProfileBuffer(IN PLSA_CLIENT_REQUEST ClientRequest,
75 IN PSAMPR_USER_INFO_BUFFER UserInfo,
76 IN PUNICODE_STRING LogonServer,
77 OUT PMSV1_0_INTERACTIVE_PROFILE *ProfileBuffer,
78 OUT PULONG ProfileBufferLength)
79 {
80 PMSV1_0_INTERACTIVE_PROFILE LocalBuffer = NULL;
81 PVOID ClientBaseAddress = NULL;
82 LPWSTR Ptr;
83 ULONG BufferLength;
84 NTSTATUS Status = STATUS_SUCCESS;
85
86 *ProfileBuffer = NULL;
87 *ProfileBufferLength = 0;
88
89 BufferLength = sizeof(MSV1_0_INTERACTIVE_PROFILE) +
90 UserInfo->All.FullName.Length + sizeof(WCHAR) +
91 UserInfo->All.HomeDirectory.Length + sizeof(WCHAR) +
92 UserInfo->All.HomeDirectoryDrive.Length + sizeof(WCHAR) +
93 UserInfo->All.ScriptPath.Length + sizeof(WCHAR) +
94 UserInfo->All.ProfilePath.Length + sizeof(WCHAR) +
95 LogonServer->Length + sizeof(WCHAR);
96
97 LocalBuffer = DispatchTable.AllocateLsaHeap(BufferLength);
98 if (LocalBuffer == NULL)
99 {
100 TRACE("Failed to allocate the local buffer!\n");
101 Status = STATUS_INSUFFICIENT_RESOURCES;
102 goto done;
103 }
104
105 Status = DispatchTable.AllocateClientBuffer(ClientRequest,
106 BufferLength,
107 &ClientBaseAddress);
108 if (!NT_SUCCESS(Status))
109 {
110 TRACE("DispatchTable.AllocateClientBuffer failed (Status 0x%08lx)\n", Status);
111 goto done;
112 }
113
114 TRACE("ClientBaseAddress: %p\n", ClientBaseAddress);
115
116 Ptr = (LPWSTR)((ULONG_PTR)LocalBuffer + sizeof(MSV1_0_INTERACTIVE_PROFILE));
117
118 LocalBuffer->MessageType = MsV1_0InteractiveProfile;
119 LocalBuffer->LogonCount = UserInfo->All.LogonCount;
120 LocalBuffer->BadPasswordCount = UserInfo->All.BadPasswordCount;
121
122 LocalBuffer->LogonTime.LowPart = UserInfo->All.LastLogon.LowPart;
123 LocalBuffer->LogonTime.HighPart = UserInfo->All.LastLogon.HighPart;
124
125 // LocalBuffer->LogoffTime.LowPart =
126 // LocalBuffer->LogoffTime.HighPart =
127
128 // LocalBuffer->KickOffTime.LowPart =
129 // LocalBuffer->KickOffTime.HighPart =
130
131 LocalBuffer->PasswordLastSet.LowPart = UserInfo->All.PasswordLastSet.LowPart;
132 LocalBuffer->PasswordLastSet.HighPart = UserInfo->All.PasswordLastSet.HighPart;
133
134 LocalBuffer->PasswordCanChange.LowPart = UserInfo->All.PasswordCanChange.LowPart;
135 LocalBuffer->PasswordCanChange.HighPart = UserInfo->All.PasswordCanChange.HighPart;
136
137 LocalBuffer->PasswordMustChange.LowPart = UserInfo->All.PasswordMustChange.LowPart;
138 LocalBuffer->PasswordMustChange.HighPart = UserInfo->All.PasswordMustChange.HighPart;
139
140 LocalBuffer->LogonScript.Length = UserInfo->All.ScriptPath.Length;
141 LocalBuffer->LogonScript.MaximumLength = UserInfo->All.ScriptPath.Length + sizeof(WCHAR);
142 LocalBuffer->LogonScript.Buffer = (LPWSTR)((ULONG_PTR)ClientBaseAddress + (ULONG_PTR)Ptr - (ULONG_PTR)LocalBuffer);
143 memcpy(Ptr,
144 UserInfo->All.ScriptPath.Buffer,
145 UserInfo->All.ScriptPath.Length);
146
147 Ptr = (LPWSTR)((ULONG_PTR)Ptr + LocalBuffer->LogonScript.MaximumLength);
148
149 LocalBuffer->HomeDirectory.Length = UserInfo->All.HomeDirectory.Length;
150 LocalBuffer->HomeDirectory.MaximumLength = UserInfo->All.HomeDirectory.Length + sizeof(WCHAR);
151 LocalBuffer->HomeDirectory.Buffer = (LPWSTR)((ULONG_PTR)ClientBaseAddress + (ULONG_PTR)Ptr - (ULONG_PTR)LocalBuffer);
152 memcpy(Ptr,
153 UserInfo->All.HomeDirectory.Buffer,
154 UserInfo->All.HomeDirectory.Length);
155
156 Ptr = (LPWSTR)((ULONG_PTR)Ptr + LocalBuffer->HomeDirectory.MaximumLength);
157
158 LocalBuffer->FullName.Length = UserInfo->All.FullName.Length;
159 LocalBuffer->FullName.MaximumLength = UserInfo->All.FullName.Length + sizeof(WCHAR);
160 LocalBuffer->FullName.Buffer = (LPWSTR)((ULONG_PTR)ClientBaseAddress + (ULONG_PTR)Ptr - (ULONG_PTR)LocalBuffer);
161 memcpy(Ptr,
162 UserInfo->All.FullName.Buffer,
163 UserInfo->All.FullName.Length);
164 TRACE("FullName.Buffer: %p\n", LocalBuffer->FullName.Buffer);
165
166 Ptr = (LPWSTR)((ULONG_PTR)Ptr + LocalBuffer->FullName.MaximumLength);
167
168 LocalBuffer->ProfilePath.Length = UserInfo->All.ProfilePath.Length;
169 LocalBuffer->ProfilePath.MaximumLength = UserInfo->All.ProfilePath.Length + sizeof(WCHAR);
170 LocalBuffer->ProfilePath.Buffer = (LPWSTR)((ULONG_PTR)ClientBaseAddress + (ULONG_PTR)Ptr - (ULONG_PTR)LocalBuffer);
171 memcpy(Ptr,
172 UserInfo->All.ProfilePath.Buffer,
173 UserInfo->All.ProfilePath.Length);
174
175 Ptr = (LPWSTR)((ULONG_PTR)Ptr + LocalBuffer->ProfilePath.MaximumLength);
176
177 LocalBuffer->HomeDirectoryDrive.Length = UserInfo->All.HomeDirectoryDrive.Length;
178 LocalBuffer->HomeDirectoryDrive.MaximumLength = UserInfo->All.HomeDirectoryDrive.Length + sizeof(WCHAR);
179 LocalBuffer->HomeDirectoryDrive.Buffer = (LPWSTR)((ULONG_PTR)ClientBaseAddress + (ULONG_PTR)Ptr - (ULONG_PTR)LocalBuffer);
180 memcpy(Ptr,
181 UserInfo->All.HomeDirectoryDrive.Buffer,
182 UserInfo->All.HomeDirectoryDrive.Length);
183
184 Ptr = (LPWSTR)((ULONG_PTR)Ptr + LocalBuffer->HomeDirectoryDrive.MaximumLength);
185
186 LocalBuffer->LogonServer.Length = LogonServer->Length;
187 LocalBuffer->LogonServer.MaximumLength = LogonServer->Length + sizeof(WCHAR);
188 LocalBuffer->LogonServer.Buffer = (LPWSTR)((ULONG_PTR)ClientBaseAddress + (ULONG_PTR)Ptr - (ULONG_PTR)LocalBuffer);;
189 memcpy(Ptr,
190 LogonServer->Buffer,
191 LogonServer->Length);
192
193 LocalBuffer->UserFlags = 0;
194
195 Status = DispatchTable.CopyToClientBuffer(ClientRequest,
196 BufferLength,
197 ClientBaseAddress,
198 LocalBuffer);
199 if (!NT_SUCCESS(Status))
200 {
201 TRACE("DispatchTable.CopyToClientBuffer failed (Status 0x%08lx)\n", Status);
202 goto done;
203 }
204
205 *ProfileBuffer = (PMSV1_0_INTERACTIVE_PROFILE)ClientBaseAddress;
206 *ProfileBufferLength = BufferLength;
207
208 done:
209 if (LocalBuffer != NULL)
210 DispatchTable.FreeLsaHeap(LocalBuffer);
211
212 if (!NT_SUCCESS(Status))
213 {
214 if (ClientBaseAddress != NULL)
215 DispatchTable.FreeClientBuffer(ClientRequest,
216 ClientBaseAddress);
217 }
218
219 return Status;
220 }
221
222
223 static
224 PSID
225 AppendRidToSid(PSID SrcSid,
226 ULONG Rid)
227 {
228 PSID DstSid = NULL;
229 UCHAR RidCount;
230
231 RidCount = *RtlSubAuthorityCountSid(SrcSid);
232 if (RidCount >= 8)
233 return NULL;
234
235 DstSid = DispatchTable.AllocateLsaHeap(RtlLengthRequiredSid(RidCount + 1));
236 if (DstSid == NULL)
237 return NULL;
238
239 RtlCopyMemory(DstSid,
240 SrcSid,
241 RtlLengthRequiredSid(RidCount));
242
243 *RtlSubAuthorityCountSid(DstSid) = RidCount + 1;
244 *RtlSubAuthoritySid(DstSid, RidCount) = Rid;
245
246 return DstSid;
247 }
248
249 static
250 NTSTATUS
251 BuildTokenUser(OUT PTOKEN_USER User,
252 IN PSID AccountDomainSid,
253 IN ULONG RelativeId)
254 {
255 User->User.Sid = AppendRidToSid(AccountDomainSid,
256 RelativeId);
257 if (User->User.Sid == NULL)
258 {
259 ERR("Could not create the user SID\n");
260 return STATUS_UNSUCCESSFUL;
261 }
262
263 User->User.Attributes = 0;
264
265 return STATUS_SUCCESS;
266 }
267
268
269 static
270 NTSTATUS
271 BuildTokenGroups(IN PSID AccountDomainSid,
272 IN PLUID LogonId,
273 OUT PTOKEN_GROUPS *Groups,
274 OUT PSID *PrimaryGroupSid)
275 {
276 SID_IDENTIFIER_AUTHORITY WorldAuthority = {SECURITY_WORLD_SID_AUTHORITY};
277 SID_IDENTIFIER_AUTHORITY SystemAuthority = {SECURITY_NT_AUTHORITY};
278 PTOKEN_GROUPS TokenGroups;
279 #define MAX_GROUPS 6
280 DWORD GroupCount = 0;
281 PSID Sid;
282 NTSTATUS Status = STATUS_SUCCESS;
283
284 TokenGroups = DispatchTable.AllocateLsaHeap(sizeof(TOKEN_GROUPS) +
285 MAX_GROUPS * sizeof(SID_AND_ATTRIBUTES));
286 if (TokenGroups == NULL)
287 {
288 return STATUS_INSUFFICIENT_RESOURCES;
289 }
290
291 Sid = AppendRidToSid(AccountDomainSid, DOMAIN_GROUP_RID_USERS);
292 if (Sid == NULL)
293 {
294
295 }
296
297 /* Member of the domain */
298 TokenGroups->Groups[GroupCount].Sid = Sid;
299 TokenGroups->Groups[GroupCount].Attributes =
300 SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY;
301 *PrimaryGroupSid = Sid;
302 GroupCount++;
303
304 /* Member of 'Everyone' */
305 RtlAllocateAndInitializeSid(&WorldAuthority,
306 1,
307 SECURITY_WORLD_RID,
308 SECURITY_NULL_RID,
309 SECURITY_NULL_RID,
310 SECURITY_NULL_RID,
311 SECURITY_NULL_RID,
312 SECURITY_NULL_RID,
313 SECURITY_NULL_RID,
314 SECURITY_NULL_RID,
315 &Sid);
316 TokenGroups->Groups[GroupCount].Sid = Sid;
317 TokenGroups->Groups[GroupCount].Attributes =
318 SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY;
319 GroupCount++;
320
321 #if 1
322 /* Member of 'Administrators' */
323 RtlAllocateAndInitializeSid(&SystemAuthority,
324 2,
325 SECURITY_BUILTIN_DOMAIN_RID,
326 DOMAIN_ALIAS_RID_ADMINS,
327 SECURITY_NULL_RID,
328 SECURITY_NULL_RID,
329 SECURITY_NULL_RID,
330 SECURITY_NULL_RID,
331 SECURITY_NULL_RID,
332 SECURITY_NULL_RID,
333 &Sid);
334 TokenGroups->Groups[GroupCount].Sid = Sid;
335 TokenGroups->Groups[GroupCount].Attributes =
336 SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY;
337 GroupCount++;
338 #else
339 TRACE("Not adding user to Administrators group\n");
340 #endif
341
342 /* Member of 'Users' */
343 RtlAllocateAndInitializeSid(&SystemAuthority,
344 2,
345 SECURITY_BUILTIN_DOMAIN_RID,
346 DOMAIN_ALIAS_RID_USERS,
347 SECURITY_NULL_RID,
348 SECURITY_NULL_RID,
349 SECURITY_NULL_RID,
350 SECURITY_NULL_RID,
351 SECURITY_NULL_RID,
352 SECURITY_NULL_RID,
353 &Sid);
354 TokenGroups->Groups[GroupCount].Sid = Sid;
355 TokenGroups->Groups[GroupCount].Attributes =
356 SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY;
357 GroupCount++;
358
359 /* Member of 'Interactive users' */
360 RtlAllocateAndInitializeSid(&SystemAuthority,
361 1,
362 SECURITY_INTERACTIVE_RID,
363 SECURITY_NULL_RID,
364 SECURITY_NULL_RID,
365 SECURITY_NULL_RID,
366 SECURITY_NULL_RID,
367 SECURITY_NULL_RID,
368 SECURITY_NULL_RID,
369 SECURITY_NULL_RID,
370 &Sid);
371 TokenGroups->Groups[GroupCount].Sid = Sid;
372 TokenGroups->Groups[GroupCount].Attributes =
373 SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY;
374 GroupCount++;
375
376 /* Member of 'Authenticated users' */
377 RtlAllocateAndInitializeSid(&SystemAuthority,
378 1,
379 SECURITY_AUTHENTICATED_USER_RID,
380 SECURITY_NULL_RID,
381 SECURITY_NULL_RID,
382 SECURITY_NULL_RID,
383 SECURITY_NULL_RID,
384 SECURITY_NULL_RID,
385 SECURITY_NULL_RID,
386 SECURITY_NULL_RID,
387 &Sid);
388 TokenGroups->Groups[GroupCount].Sid = Sid;
389 TokenGroups->Groups[GroupCount].Attributes =
390 SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY;
391 GroupCount++;
392
393 TokenGroups->GroupCount = GroupCount;
394 ASSERT(TokenGroups->GroupCount <= MAX_GROUPS);
395
396 *Groups = TokenGroups;
397
398 return Status;
399 }
400
401
402 static
403 NTSTATUS
404 BuildTokenPrimaryGroup(PTOKEN_PRIMARY_GROUP PrimaryGroup,
405 PSID PrimaryGroupSid)
406 {
407 ULONG RidCount;
408 ULONG Size;
409
410 RidCount = *RtlSubAuthorityCountSid(PrimaryGroupSid);
411 Size = RtlLengthRequiredSid(RidCount);
412
413 PrimaryGroup->PrimaryGroup = DispatchTable.AllocateLsaHeap(Size);
414 if (PrimaryGroup->PrimaryGroup == NULL)
415 {
416 return STATUS_INSUFFICIENT_RESOURCES;
417 }
418
419 RtlCopyMemory(PrimaryGroup->PrimaryGroup,
420 PrimaryGroupSid,
421 Size);
422
423 return STATUS_SUCCESS;
424 }
425
426 static
427 NTSTATUS
428 BuildTokenPrivileges(PTOKEN_PRIVILEGES *TokenPrivileges)
429 {
430 /* FIXME shouldn't use hard-coded list of privileges */
431 static struct
432 {
433 LPCWSTR PrivName;
434 DWORD Attributes;
435 }
436 DefaultPrivs[] =
437 {
438 { L"SeMachineAccountPrivilege", 0 },
439 { L"SeSecurityPrivilege", 0 },
440 { L"SeTakeOwnershipPrivilege", 0 },
441 { L"SeLoadDriverPrivilege", 0 },
442 { L"SeSystemProfilePrivilege", 0 },
443 { L"SeSystemtimePrivilege", 0 },
444 { L"SeProfileSingleProcessPrivilege", 0 },
445 { L"SeIncreaseBasePriorityPrivilege", 0 },
446 { L"SeCreatePagefilePrivilege", 0 },
447 { L"SeBackupPrivilege", 0 },
448 { L"SeRestorePrivilege", 0 },
449 { L"SeShutdownPrivilege", 0 },
450 { L"SeDebugPrivilege", 0 },
451 { L"SeSystemEnvironmentPrivilege", 0 },
452 { L"SeChangeNotifyPrivilege", SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_ENABLED_BY_DEFAULT },
453 { L"SeRemoteShutdownPrivilege", 0 },
454 { L"SeUndockPrivilege", 0 },
455 { L"SeEnableDelegationPrivilege", 0 },
456 { L"SeImpersonatePrivilege", SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_ENABLED_BY_DEFAULT },
457 { L"SeCreateGlobalPrivilege", SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_ENABLED_BY_DEFAULT }
458 };
459 PTOKEN_PRIVILEGES Privileges = NULL;
460 ULONG i;
461 RPC_UNICODE_STRING PrivilegeName;
462 LSAPR_HANDLE PolicyHandle = NULL;
463 NTSTATUS Status = STATUS_SUCCESS;
464
465 Status = LsaIOpenPolicyTrusted(&PolicyHandle);
466 if (!NT_SUCCESS(Status))
467 {
468 goto done;
469 }
470
471 /* Allocate and initialize token privileges */
472 Privileges = DispatchTable.AllocateLsaHeap(sizeof(TOKEN_PRIVILEGES) +
473 sizeof(DefaultPrivs) / sizeof(DefaultPrivs[0]) *
474 sizeof(LUID_AND_ATTRIBUTES));
475 if (Privileges == NULL)
476 {
477 Status = STATUS_INSUFFICIENT_RESOURCES;
478 goto done;
479 }
480
481 Privileges->PrivilegeCount = 0;
482 for (i = 0; i < sizeof(DefaultPrivs) / sizeof(DefaultPrivs[0]); i++)
483 {
484 PrivilegeName.Length = wcslen(DefaultPrivs[i].PrivName) * sizeof(WCHAR);
485 PrivilegeName.MaximumLength = PrivilegeName.Length + sizeof(WCHAR);
486 PrivilegeName.Buffer = (LPWSTR)DefaultPrivs[i].PrivName;
487
488 Status = LsarLookupPrivilegeValue(PolicyHandle,
489 &PrivilegeName,
490 &Privileges->Privileges[Privileges->PrivilegeCount].Luid);
491 if (!NT_SUCCESS(Status))
492 {
493 WARN("Can't set privilege %S\n", DefaultPrivs[i].PrivName);
494 }
495 else
496 {
497 Privileges->Privileges[Privileges->PrivilegeCount].Attributes = DefaultPrivs[i].Attributes;
498 Privileges->PrivilegeCount++;
499 }
500 }
501
502 *TokenPrivileges = Privileges;
503
504 done:
505 if (PolicyHandle != NULL)
506 LsarClose(&PolicyHandle);
507
508 return Status;
509 }
510
511
512 static
513 NTSTATUS
514 BuildTokenInformationBuffer(PLSA_TOKEN_INFORMATION_V1 *TokenInformation,
515 PRPC_SID AccountDomainSid,
516 ULONG RelativeId,
517 PLUID LogonId)
518 {
519 PLSA_TOKEN_INFORMATION_V1 Buffer = NULL;
520 PSID PrimaryGroupSid = NULL;
521 ULONG i;
522 NTSTATUS Status = STATUS_SUCCESS;
523
524 Buffer = DispatchTable.AllocateLsaHeap(sizeof(LSA_TOKEN_INFORMATION_V1));
525 if (Buffer == NULL)
526 {
527 TRACE("Failed to allocate the local buffer!\n");
528 Status = STATUS_INSUFFICIENT_RESOURCES;
529 goto done;
530 }
531
532 /* FIXME: */
533 Buffer->ExpirationTime.QuadPart = -1;
534
535 Status = BuildTokenUser(&Buffer->User,
536 (PSID)AccountDomainSid,
537 RelativeId);
538 if (!NT_SUCCESS(Status))
539 goto done;
540
541 Status = BuildTokenGroups((PSID)AccountDomainSid,
542 LogonId,
543 &Buffer->Groups,
544 &PrimaryGroupSid);
545 if (!NT_SUCCESS(Status))
546 goto done;
547
548 Status = BuildTokenPrimaryGroup(&Buffer->PrimaryGroup,
549 PrimaryGroupSid);
550 if (!NT_SUCCESS(Status))
551 goto done;
552
553 Status = BuildTokenPrivileges(&Buffer->Privileges);
554 if (!NT_SUCCESS(Status))
555 goto done;
556
557 *TokenInformation = Buffer;
558
559 done:
560 if (!NT_SUCCESS(Status))
561 {
562 if (Buffer != NULL)
563 {
564 if (Buffer->User.User.Sid != NULL)
565 DispatchTable.FreeLsaHeap(Buffer->User.User.Sid);
566
567 if (Buffer->Groups != NULL)
568 {
569 for (i = 0; i < Buffer->Groups->GroupCount; i++)
570 {
571 if (Buffer->Groups->Groups[i].Sid != NULL)
572 DispatchTable.FreeLsaHeap(Buffer->Groups->Groups[i].Sid);
573 }
574
575 DispatchTable.FreeLsaHeap(Buffer->Groups);
576 }
577
578 if (Buffer->PrimaryGroup.PrimaryGroup != NULL)
579 DispatchTable.FreeLsaHeap(Buffer->PrimaryGroup.PrimaryGroup);
580
581 if (Buffer->Privileges != NULL)
582 DispatchTable.FreeLsaHeap(Buffer->Privileges);
583
584 if (Buffer->DefaultDacl.DefaultDacl != NULL)
585 DispatchTable.FreeLsaHeap(Buffer->DefaultDacl.DefaultDacl);
586
587 DispatchTable.FreeLsaHeap(Buffer);
588 }
589 }
590
591 return Status;
592 }
593
594
595 static
596 NTSTATUS
597 MsvpChangePassword(IN PLSA_CLIENT_REQUEST ClientRequest,
598 IN PVOID ProtocolSubmitBuffer,
599 IN PVOID ClientBufferBase,
600 IN ULONG SubmitBufferLength,
601 OUT PVOID *ProtocolReturnBuffer,
602 OUT PULONG ReturnBufferLength,
603 OUT PNTSTATUS ProtocolStatus)
604 {
605 PMSV1_0_CHANGEPASSWORD_REQUEST RequestBuffer;
606 ULONG_PTR PtrOffset;
607
608 TRACE("()\n");
609
610 RequestBuffer = (PMSV1_0_CHANGEPASSWORD_REQUEST)ProtocolSubmitBuffer;
611
612 /* Fix-up pointers in the request buffer info */
613 PtrOffset = (ULONG_PTR)ProtocolSubmitBuffer - (ULONG_PTR)ClientBufferBase;
614
615 RequestBuffer->DomainName.Buffer = FIXUP_POINTER(RequestBuffer->DomainName.Buffer, PtrOffset);
616 RequestBuffer->AccountName.Buffer = FIXUP_POINTER(RequestBuffer->AccountName.Buffer, PtrOffset);
617 RequestBuffer->OldPassword.Buffer = FIXUP_POINTER(RequestBuffer->OldPassword.Buffer, PtrOffset);
618 RequestBuffer->NewPassword.Buffer = FIXUP_POINTER(RequestBuffer->NewPassword.Buffer, PtrOffset);
619
620 TRACE("Domain: %S\n", RequestBuffer->DomainName.Buffer);
621 TRACE("Account: %S\n", RequestBuffer->AccountName.Buffer);
622 TRACE("Old Password: %S\n", RequestBuffer->OldPassword.Buffer);
623 TRACE("New Password: %S\n", RequestBuffer->NewPassword.Buffer);
624
625
626 return STATUS_SUCCESS;
627 }
628
629
630 static
631 NTSTATUS
632 MsvpCheckPassword(PUNICODE_STRING UserPassword,
633 PSAMPR_USER_INFO_BUFFER UserInfo)
634 {
635 ENCRYPTED_NT_OWF_PASSWORD UserNtPassword;
636 ENCRYPTED_LM_OWF_PASSWORD UserLmPassword;
637 BOOLEAN UserLmPasswordPresent = FALSE;
638 BOOLEAN UserNtPasswordPresent = FALSE;
639 OEM_STRING LmPwdString;
640 CHAR LmPwdBuffer[15];
641 NTSTATUS Status;
642
643 TRACE("(%p %p)\n", UserPassword, UserInfo);
644
645 /* Calculate the LM password and hash for the users password */
646 LmPwdString.Length = 15;
647 LmPwdString.MaximumLength = 15;
648 LmPwdString.Buffer = LmPwdBuffer;
649 ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
650
651 Status = RtlUpcaseUnicodeStringToOemString(&LmPwdString,
652 UserPassword,
653 FALSE);
654 if (NT_SUCCESS(Status))
655 {
656 /* Calculate the LM hash value of the users password */
657 Status = SystemFunction006(LmPwdString.Buffer,
658 (LPSTR)&UserLmPassword);
659 if (NT_SUCCESS(Status))
660 {
661 UserLmPasswordPresent = TRUE;
662 }
663 }
664
665 /* Calculate the NT hash of the users password */
666 Status = SystemFunction007(UserPassword,
667 (LPBYTE)&UserNtPassword);
668 if (NT_SUCCESS(Status))
669 {
670 UserNtPasswordPresent = TRUE;
671 }
672
673 Status = STATUS_WRONG_PASSWORD;
674
675 /* Succeed, if no password has been set */
676 if (UserInfo->All.NtPasswordPresent == FALSE &&
677 UserInfo->All.LmPasswordPresent == FALSE)
678 {
679 TRACE("No password check!\n");
680 Status = STATUS_SUCCESS;
681 goto done;
682 }
683
684 /* Succeed, if NT password matches */
685 if (UserNtPasswordPresent && UserInfo->All.NtPasswordPresent)
686 {
687 TRACE("Check NT password hashes:\n");
688 if (RtlEqualMemory(&UserNtPassword,
689 UserInfo->All.NtOwfPassword.Buffer,
690 sizeof(ENCRYPTED_NT_OWF_PASSWORD)))
691 {
692 TRACE(" success!\n");
693 Status = STATUS_SUCCESS;
694 goto done;
695 }
696
697 TRACE(" failed!\n");
698 }
699
700 /* Succeed, if LM password matches */
701 if (UserLmPasswordPresent && UserInfo->All.LmPasswordPresent)
702 {
703 TRACE("Check LM password hashes:\n");
704 if (RtlEqualMemory(&UserLmPassword,
705 UserInfo->All.LmOwfPassword.Buffer,
706 sizeof(ENCRYPTED_LM_OWF_PASSWORD)))
707 {
708 TRACE(" success!\n");
709 Status = STATUS_SUCCESS;
710 goto done;
711 }
712 TRACE(" failed!\n");
713 }
714
715 done:
716 return Status;
717 }
718
719
720 /*
721 * @unimplemented
722 */
723 NTSTATUS
724 NTAPI
725 LsaApCallPackage(IN PLSA_CLIENT_REQUEST ClientRequest,
726 IN PVOID ProtocolSubmitBuffer,
727 IN PVOID ClientBufferBase,
728 IN ULONG SubmitBufferLength,
729 OUT PVOID *ProtocolReturnBuffer,
730 OUT PULONG ReturnBufferLength,
731 OUT PNTSTATUS ProtocolStatus)
732 {
733 ULONG MessageType;
734 NTSTATUS Status;
735
736 TRACE("()\n");
737
738 if (SubmitBufferLength < sizeof(MSV1_0_PROTOCOL_MESSAGE_TYPE))
739 return STATUS_INVALID_PARAMETER;
740
741 MessageType = (ULONG)*((PMSV1_0_PROTOCOL_MESSAGE_TYPE)ProtocolSubmitBuffer);
742
743 *ProtocolReturnBuffer = NULL;
744 *ReturnBufferLength = 0;
745
746 switch (MessageType)
747 {
748 case MsV1_0Lm20ChallengeRequest:
749 case MsV1_0Lm20GetChallengeResponse:
750 case MsV1_0EnumerateUsers:
751 case MsV1_0GetUserInfo:
752 case MsV1_0ReLogonUsers:
753 Status = STATUS_NOT_IMPLEMENTED;
754 break;
755
756 case MsV1_0ChangePassword:
757 Status = MsvpChangePassword(ClientRequest,
758 ProtocolSubmitBuffer,
759 ClientBufferBase,
760 SubmitBufferLength,
761 ProtocolReturnBuffer,
762 ReturnBufferLength,
763 ProtocolStatus);
764 break;
765
766 case MsV1_0ChangeCachedPassword:
767 case MsV1_0GenericPassthrough:
768 case MsV1_0CacheLogon:
769 case MsV1_0SubAuth:
770 case MsV1_0DeriveCredential:
771 case MsV1_0CacheLookup:
772 Status = STATUS_NOT_IMPLEMENTED;
773 break;
774
775 default:
776 return STATUS_INVALID_PARAMETER;
777 }
778
779 return Status;
780 }
781
782
783 /*
784 * @unimplemented
785 */
786 NTSTATUS
787 NTAPI
788 LsaApCallPackagePassthrough(IN PLSA_CLIENT_REQUEST ClientRequest,
789 IN PVOID ProtocolSubmitBuffer,
790 IN PVOID ClientBufferBase,
791 IN ULONG SubmitBufferLength,
792 OUT PVOID *ProtocolReturnBuffer,
793 OUT PULONG ReturnBufferLength,
794 OUT PNTSTATUS ProtocolStatus)
795 {
796 TRACE("()\n");
797 return STATUS_NOT_IMPLEMENTED;
798 }
799
800
801 /*
802 * @unimplemented
803 */
804 NTSTATUS
805 NTAPI
806 LsaApCallPackageUntrusted(IN PLSA_CLIENT_REQUEST ClientRequest,
807 IN PVOID ProtocolSubmitBuffer,
808 IN PVOID ClientBufferBase,
809 IN ULONG SubmitBufferLength,
810 OUT PVOID *ProtocolReturnBuffer,
811 OUT PULONG ReturnBufferLength,
812 OUT PNTSTATUS ProtocolStatus)
813 {
814 TRACE("()\n");
815 return STATUS_NOT_IMPLEMENTED;
816 }
817
818
819 /*
820 * @unimplemented
821 */
822 NTSTATUS
823 NTAPI
824 LsaApInitializePackage(IN ULONG AuthenticationPackageId,
825 IN PLSA_DISPATCH_TABLE LsaDispatchTable,
826 IN PLSA_STRING Database OPTIONAL,
827 IN PLSA_STRING Confidentiality OPTIONAL,
828 OUT PLSA_STRING *AuthenticationPackageName)
829 {
830 PANSI_STRING NameString;
831 PCHAR NameBuffer;
832
833 TRACE("(%lu %p %p %p %p)\n",
834 AuthenticationPackageId, LsaDispatchTable, Database,
835 Confidentiality, AuthenticationPackageName);
836
837 /* Get the dispatch table entries */
838 DispatchTable.CreateLogonSession = LsaDispatchTable->CreateLogonSession;
839 DispatchTable.DeleteLogonSession = LsaDispatchTable->DeleteLogonSession;
840 DispatchTable.AddCredential = LsaDispatchTable->AddCredential;
841 DispatchTable.GetCredentials = LsaDispatchTable->GetCredentials;
842 DispatchTable.DeleteCredential = LsaDispatchTable->DeleteCredential;
843 DispatchTable.AllocateLsaHeap = LsaDispatchTable->AllocateLsaHeap;
844 DispatchTable.FreeLsaHeap = LsaDispatchTable->FreeLsaHeap;
845 DispatchTable.AllocateClientBuffer = LsaDispatchTable->AllocateClientBuffer;
846 DispatchTable.FreeClientBuffer = LsaDispatchTable->FreeClientBuffer;
847 DispatchTable.CopyToClientBuffer = LsaDispatchTable->CopyToClientBuffer;
848 DispatchTable.CopyFromClientBuffer = LsaDispatchTable->CopyFromClientBuffer;
849
850 /* Return the package name */
851 NameString = DispatchTable.AllocateLsaHeap(sizeof(LSA_STRING));
852 if (NameString == NULL)
853 return STATUS_INSUFFICIENT_RESOURCES;
854
855 NameBuffer = DispatchTable.AllocateLsaHeap(sizeof(MSV1_0_PACKAGE_NAME));
856 if (NameBuffer == NULL)
857 {
858 DispatchTable.FreeLsaHeap(NameString);
859 return STATUS_INSUFFICIENT_RESOURCES;
860 }
861
862 strcpy(NameBuffer, MSV1_0_PACKAGE_NAME);
863
864 RtlInitAnsiString(NameString, NameBuffer);
865
866 *AuthenticationPackageName = (PLSA_STRING)NameString;
867
868 return STATUS_SUCCESS;
869 }
870
871
872 /*
873 * @unimplemented
874 */
875 VOID
876 NTAPI
877 LsaApLogonTerminated(IN PLUID LogonId)
878 {
879 TRACE("()\n");
880 }
881
882
883 /*
884 * @unimplemented
885 */
886 NTSTATUS
887 NTAPI
888 LsaApLogonUser(IN PLSA_CLIENT_REQUEST ClientRequest,
889 IN SECURITY_LOGON_TYPE LogonType,
890 IN PVOID AuthenticationInformation,
891 IN PVOID ClientAuthenticationBase,
892 IN ULONG AuthenticationInformationLength,
893 OUT PVOID *ProfileBuffer,
894 OUT PULONG ProfileBufferLength,
895 OUT PLUID LogonId,
896 OUT PNTSTATUS SubStatus,
897 OUT PLSA_TOKEN_INFORMATION_TYPE TokenInformationType,
898 OUT PVOID *TokenInformation,
899 OUT PLSA_UNICODE_STRING *AccountName,
900 OUT PLSA_UNICODE_STRING *AuthenticatingAuthority)
901 {
902 PMSV1_0_INTERACTIVE_LOGON LogonInfo;
903
904 SAMPR_HANDLE ServerHandle = NULL;
905 SAMPR_HANDLE DomainHandle = NULL;
906 SAMPR_HANDLE UserHandle = NULL;
907 PRPC_SID AccountDomainSid = NULL;
908 RPC_UNICODE_STRING Names[1];
909 SAMPR_ULONG_ARRAY RelativeIds = {0, NULL};
910 SAMPR_ULONG_ARRAY Use = {0, NULL};
911 PSAMPR_USER_INFO_BUFFER UserInfo = NULL;
912 UNICODE_STRING LogonServer;
913 BOOLEAN SessionCreated = FALSE;
914 NTSTATUS Status;
915
916 TRACE("()\n");
917
918 TRACE("LogonType: %lu\n", LogonType);
919 TRACE("AuthenticationInformation: %p\n", AuthenticationInformation);
920 TRACE("AuthenticationInformationLength: %lu\n", AuthenticationInformationLength);
921
922 *ProfileBuffer = NULL;
923 *ProfileBufferLength = 0;
924 *SubStatus = STATUS_SUCCESS;
925
926 if (LogonType == Interactive ||
927 LogonType == Batch ||
928 LogonType == Service)
929 {
930 ULONG_PTR PtrOffset;
931
932 LogonInfo = (PMSV1_0_INTERACTIVE_LOGON)AuthenticationInformation;
933
934 /* Fix-up pointers in the authentication info */
935 PtrOffset = (ULONG_PTR)AuthenticationInformation - (ULONG_PTR)ClientAuthenticationBase;
936
937 LogonInfo->LogonDomainName.Buffer = FIXUP_POINTER(LogonInfo->LogonDomainName.Buffer, PtrOffset);
938 LogonInfo->UserName.Buffer = FIXUP_POINTER(LogonInfo->UserName.Buffer, PtrOffset);
939 LogonInfo->Password.Buffer = FIXUP_POINTER(LogonInfo->Password.Buffer, PtrOffset);
940
941 TRACE("Domain: %S\n", LogonInfo->LogonDomainName.Buffer);
942 TRACE("User: %S\n", LogonInfo->UserName.Buffer);
943 TRACE("Password: %S\n", LogonInfo->Password.Buffer);
944
945 RtlInitUnicodeString(&LogonServer, L"Testserver");
946 }
947 else
948 {
949 FIXME("LogonType %lu is not supported yet!\n", LogonType);
950 return STATUS_NOT_IMPLEMENTED;
951 }
952
953 Status = GetDomainSid(&AccountDomainSid);
954 if (!NT_SUCCESS(Status))
955 {
956 TRACE("GetDomainSid() failed (Status 0x%08lx)\n", Status);
957 return Status;
958 }
959
960 /* Connect to the SAM server */
961 Status = SamIConnect(NULL,
962 &ServerHandle,
963 SAM_SERVER_CONNECT | SAM_SERVER_LOOKUP_DOMAIN,
964 TRUE);
965 if (!NT_SUCCESS(Status))
966 {
967 TRACE("SamIConnect() failed (Status 0x%08lx)\n", Status);
968 goto done;
969 }
970
971 /* Open the account domain */
972 Status = SamrOpenDomain(ServerHandle,
973 DOMAIN_LOOKUP,
974 AccountDomainSid,
975 &DomainHandle);
976 if (!NT_SUCCESS(Status))
977 {
978 TRACE("SamrOpenDomain failed (Status %08lx)\n", Status);
979 goto done;
980 }
981
982 Names[0].Length = LogonInfo->UserName.Length;
983 Names[0].MaximumLength = LogonInfo->UserName.MaximumLength;
984 Names[0].Buffer = LogonInfo->UserName.Buffer;
985
986 /* Try to get the RID for the user name */
987 Status = SamrLookupNamesInDomain(DomainHandle,
988 1,
989 Names,
990 &RelativeIds,
991 &Use);
992 if (!NT_SUCCESS(Status))
993 {
994 TRACE("SamrLookupNamesInDomain failed (Status %08lx)\n", Status);
995 Status = STATUS_NO_SUCH_USER;
996 goto done;
997 }
998
999 /* Fail, if it is not a user account */
1000 if (Use.Element[0] != SidTypeUser)
1001 {
1002 TRACE("Account is not a user account!\n");
1003 Status = STATUS_NO_SUCH_USER;
1004 goto done;
1005 }
1006
1007 /* Open the user object */
1008 Status = SamrOpenUser(DomainHandle,
1009 USER_READ_GENERAL | USER_READ_LOGON |
1010 USER_READ_ACCOUNT | USER_READ_PREFERENCES, /* FIXME */
1011 RelativeIds.Element[0],
1012 &UserHandle);
1013 if (!NT_SUCCESS(Status))
1014 {
1015 TRACE("SamrOpenUser failed (Status %08lx)\n", Status);
1016 goto done;
1017 }
1018
1019 Status = SamrQueryInformationUser(UserHandle,
1020 UserAllInformation,
1021 &UserInfo);
1022 if (!NT_SUCCESS(Status))
1023 {
1024 TRACE("SamrQueryInformationUser failed (Status %08lx)\n", Status);
1025 goto done;
1026 }
1027
1028
1029 TRACE("UserName: %S\n", UserInfo->All.UserName.Buffer);
1030
1031 /* FIXME: Check restrictions */
1032
1033 /* Check the password */
1034 if ((UserInfo->All.UserAccountControl & USER_PASSWORD_NOT_REQUIRED) == 0)
1035 {
1036 Status = MsvpCheckPassword(&(LogonInfo->Password),
1037 UserInfo);
1038 if (!NT_SUCCESS(Status))
1039 {
1040 TRACE("MsvpCheckPassword failed (Status %08lx)\n", Status);
1041 goto done;
1042 }
1043 }
1044
1045 /* Return logon information */
1046
1047 /* Create and return a new logon id */
1048 Status = NtAllocateLocallyUniqueId(LogonId);
1049 if (!NT_SUCCESS(Status))
1050 {
1051 TRACE("NtAllocateLocallyUniqueId failed (Status %08lx)\n", Status);
1052 goto done;
1053 }
1054
1055 /* Create the logon session */
1056 Status = DispatchTable.CreateLogonSession(LogonId);
1057 if (!NT_SUCCESS(Status))
1058 {
1059 TRACE("CreateLogonSession failed (Status %08lx)\n", Status);
1060 goto done;
1061 }
1062
1063 SessionCreated = TRUE;
1064
1065 /* Build and fill the interactve profile buffer */
1066 Status = BuildInteractiveProfileBuffer(ClientRequest,
1067 UserInfo,
1068 &LogonServer,
1069 (PMSV1_0_INTERACTIVE_PROFILE*)ProfileBuffer,
1070 ProfileBufferLength);
1071 if (!NT_SUCCESS(Status))
1072 {
1073 TRACE("BuildInteractiveProfileBuffer failed (Status %08lx)\n", Status);
1074 goto done;
1075 }
1076
1077 /* Return the token information type */
1078 *TokenInformationType = LsaTokenInformationV1;
1079
1080 /* Build and fill the token information buffer */
1081 Status = BuildTokenInformationBuffer((PLSA_TOKEN_INFORMATION_V1*)TokenInformation,
1082 AccountDomainSid,
1083 RelativeIds.Element[0],
1084 LogonId);
1085 if (!NT_SUCCESS(Status))
1086 {
1087 TRACE("BuildTokenInformationBuffer failed (Status %08lx)\n", Status);
1088 goto done;
1089 }
1090
1091 done:
1092 /* Return the account name */
1093 *AccountName = DispatchTable.AllocateLsaHeap(sizeof(UNICODE_STRING));
1094 if (*AccountName != NULL)
1095 {
1096 (*AccountName)->Buffer = DispatchTable.AllocateLsaHeap(LogonInfo->UserName.Length +
1097 sizeof(UNICODE_NULL));
1098 if ((*AccountName)->Buffer != NULL)
1099 {
1100 (*AccountName)->MaximumLength = LogonInfo->UserName.Length +
1101 sizeof(UNICODE_NULL);
1102 RtlCopyUnicodeString(*AccountName, &LogonInfo->UserName);
1103 }
1104 }
1105
1106 if (!NT_SUCCESS(Status))
1107 {
1108 if (SessionCreated == TRUE)
1109 DispatchTable.DeleteLogonSession(LogonId);
1110
1111 if (*ProfileBuffer != NULL)
1112 {
1113 DispatchTable.FreeClientBuffer(ClientRequest,
1114 *ProfileBuffer);
1115 *ProfileBuffer = NULL;
1116 }
1117 }
1118
1119 if (UserHandle != NULL)
1120 SamrCloseHandle(&UserHandle);
1121
1122 SamIFree_SAMPR_USER_INFO_BUFFER(UserInfo,
1123 UserAllInformation);
1124 SamIFree_SAMPR_ULONG_ARRAY(&RelativeIds);
1125 SamIFree_SAMPR_ULONG_ARRAY(&Use);
1126
1127 if (DomainHandle != NULL)
1128 SamrCloseHandle(&DomainHandle);
1129
1130 if (ServerHandle != NULL)
1131 SamrCloseHandle(&ServerHandle);
1132
1133 if (AccountDomainSid != NULL)
1134 RtlFreeHeap(RtlGetProcessHeap(), 0, AccountDomainSid);
1135
1136 if (Status == STATUS_NO_SUCH_USER ||
1137 Status == STATUS_WRONG_PASSWORD)
1138 {
1139 *SubStatus = Status;
1140 Status = STATUS_LOGON_FAILURE;
1141 }
1142
1143 TRACE("LsaApLogonUser done (Status %08lx)\n", Status);
1144
1145 return Status;
1146 }
1147
1148
1149 /*
1150 * @unimplemented
1151 */
1152 #if 0
1153 NTSTATUS
1154 NTAPI
1155 LsaApLogonUserEx(IN PLSA_CLIENT_REQUEST ClientRequest,
1156 IN SECURITY_LOGON_TYPE LogonType,
1157 IN PVOID AuthenticationInformation,
1158 IN PVOID ClientAuthenticationBase,
1159 IN ULONG AuthenticationInformationLength,
1160 OUT PVOID *ProfileBuffer,
1161 OUT PULONG ProfileBufferLength,
1162 OUT PLUID LogonId,
1163 OUT PNTSTATUS SubStatus,
1164 OUT PLSA_TOKEN_INFORMATION_TYPE TokenInformationType,
1165 OUT PVOID *TokenInformation,
1166 OUT PUNICODE_STRING *AccountName,
1167 OUT PUNICODE_STRING *AuthenticatingAuthority,
1168 OUT PUNICODE_STRING *MachineName)
1169 {
1170 TRACE("()\n");
1171
1172 TRACE("LogonType: %lu\n", LogonType);
1173 TRACE("AuthenticationInformation: %p\n", AuthenticationInformation);
1174 TRACE("AuthenticationInformationLength: %lu\n", AuthenticationInformationLength);
1175
1176 return STATUS_NOT_IMPLEMENTED;
1177 }
1178
1179
1180 /*
1181 * @unimplemented
1182 */
1183 NTSTATUS
1184 NTAPI
1185 LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest,
1186 IN SECURITY_LOGON_TYPE LogonType,
1187 IN PVOID ProtocolSubmitBuffer,
1188 IN PVOID ClientBufferBase,
1189 IN ULONG SubmitBufferSize,
1190 OUT PVOID *ProfileBuffer,
1191 OUT PULONG ProfileBufferSize,
1192 OUT PLUID LogonId,
1193 OUT PNTSTATUS SubStatus,
1194 OUT PLSA_TOKEN_INFORMATION_TYPE TokenInformationType,
1195 OUT PVOID *TokenInformation,
1196 OUT PUNICODE_STRING *AccountName,
1197 OUT PUNICODE_STRING *AuthenticatingAuthority,
1198 OUT PUNICODE_STRING *MachineName,
1199 OUT PSECPKG_PRIMARY_CRED PrimaryCredentials,
1200 OUT PSECPKG_SUPPLEMENTAL_CRED_ARRAY *SupplementalCredentials)
1201 {
1202 TRACE("()\n");
1203
1204 TRACE("LogonType: %lu\n", LogonType);
1205 TRACE("ProtocolSubmitBuffer: %p\n", ProtocolSubmitBuffer);
1206 TRACE("SubmitBufferSize: %lu\n", SubmitBufferSize);
1207
1208
1209 return STATUS_NOT_IMPLEMENTED;
1210 }
1211 #endif
1212
1213 /* EOF */