ReactOS  0.4.14-dev-115-g4576127
gui.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS msgina.dll
3  * FILE: dll/win32/msgina/gui.c
4  * PURPOSE: ReactOS Logon GINA DLL
5  * PROGRAMMER: Hervé Poussineau (hpoussin@reactos.org)
6  */
7 
8 #include "msgina.h"
9 
10 #include <wingdi.h>
11 #include <winnls.h>
12 #include <winreg.h>
13 
14 typedef struct _DISPLAYSTATUSMSG
15 {
17  HDESK hDesktop;
23 
24 typedef struct _LEGALNOTICEDATA
25 {
29 
30 typedef struct _DLG_DATA
31 {
40 
41 static BOOL
43  IN OUT PGINA_CONTEXT pgContext)
44 {
45  TRACE("GUIInitialize(%p)\n", pgContext);
46  return TRUE;
47 }
48 
49 
50 static
51 VOID
53 {
54  PWCHAR pBuffer = NULL, p;
55  HKEY hKey;
56  DWORD BufSize, dwType, dwWelcomeSize, dwTitleLength;
57  LONG rc;
58 
59  TRACE("SetWelcomeText(%p)\n", hWnd);
60 
61  /* Open the Winlogon key */
63  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
64  0,
66  &hKey);
67  if (rc != ERROR_SUCCESS)
68  {
69  WARN("RegOpenKeyExW() failed with error %lu\n", rc);
70  return;
71  }
72 
73  /* Get the size of the Welcome value */
74  dwWelcomeSize = 0;
75  rc = RegQueryValueExW(hKey,
76  L"Welcome",
77  NULL,
78  &dwType,
79  NULL,
80  &dwWelcomeSize);
81  if (rc == ERROR_FILE_NOT_FOUND || dwWelcomeSize == 0 || dwType != REG_SZ)
82  goto done;
83 
84  dwTitleLength = GetWindowTextLengthW(hWnd);
85  BufSize = dwWelcomeSize + ((dwTitleLength + 1) * sizeof(WCHAR));
86 
88  if (pBuffer == NULL)
89  goto done;
90 
92  wcscat(pBuffer, L" ");
93  p = &pBuffer[dwTitleLength + 1];
94 
95  RegQueryValueExW(hKey,
96  L"Welcome",
97  NULL,
98  &dwType,
99  (PBYTE)p,
100  &dwWelcomeSize);
101 
103 
104 done:
105  if (pBuffer != NULL)
107 
108  RegCloseKey(hKey);
109 }
110 
111 
112 static INT_PTR CALLBACK
114  IN HWND hwndDlg,
115  IN UINT uMsg,
116  IN WPARAM wParam,
117  IN LPARAM lParam)
118 {
119  PDLG_DATA pDlgData;
121 
122  pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
123 
124  switch (uMsg)
125  {
126  case WM_INITDIALOG:
127  {
129  if (!msg)
130  return FALSE;
131 
132  msg->Context->hStatusWindow = hwndDlg;
133 
134  if (msg->pTitle)
135  SetWindowTextW(hwndDlg, msg->pTitle);
136  SetDlgItemTextW(hwndDlg, IDC_STATUS_MESSAGE, msg->pMessage);
137  SetEvent(msg->StartupEvent);
138 
139  pDlgData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DLG_DATA));
140  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pDlgData);
141 
142  if (pDlgData == NULL)
143  return FALSE;
144 
145  /* Load the bar bitmap */
147  if (pDlgData->hBarBitmap)
148  {
149  BITMAP bm;
150 
151  GetObject(pDlgData->hBarBitmap, sizeof(BITMAP), &bm);
152  pDlgData->BarWidth = bm.bmWidth;
153  pDlgData->BarHeight = bm.bmHeight;
154  pDlgData->TimerID = SetTimer(hwndDlg, -1, 20, NULL);
155  }
156  return TRUE;
157  }
158 
159  case WM_TIMER:
160  {
161  if (pDlgData)
162  {
163  /*
164  * Default rotation bar image width is 413 (same as logo)
165  * We can divide 413 by 7 without remainder
166  */
167  pDlgData->BarCounter = (pDlgData->BarCounter + 7) % pDlgData->BarWidth;
168  InvalidateRect(hwndDlg, NULL, FALSE);
169  UpdateWindow(hwndDlg);
170  }
171  return TRUE;
172  }
173 
174  case WM_DRAWITEM:
175  {
177 
178  if (lpDis->CtlID != IDC_BAR)
179  {
180  return FALSE;
181  }
182 
183  if (pDlgData && pDlgData->hBarBitmap)
184  {
185  HDC hdcMem;
186  HGDIOBJ hOld;
187  DWORD off = pDlgData->BarCounter;
188  DWORD iw = pDlgData->BarWidth;
189  DWORD ih = pDlgData->BarHeight;
190 
191  hdcMem = CreateCompatibleDC(lpDis->hDC);
192  hOld = SelectObject(hdcMem, pDlgData->hBarBitmap);
193  BitBlt(lpDis->hDC, off, 0, iw - off, ih, hdcMem, 0, 0, SRCCOPY);
194  BitBlt(lpDis->hDC, 0, 0, off, ih, hdcMem, iw - off, 0, SRCCOPY);
195  SelectObject(hdcMem, hOld);
196  DeleteDC(hdcMem);
197 
198  return TRUE;
199  }
200  return FALSE;
201  }
202 
203  case WM_DESTROY:
204  {
205  if (pDlgData)
206  {
207  if (pDlgData->hBarBitmap)
208  {
209  KillTimer(hwndDlg, pDlgData->TimerID);
210  DeleteObject(pDlgData->hBarBitmap);
211  }
212  HeapFree(GetProcessHeap(), 0, pDlgData);
213  }
214  return TRUE;
215  }
216  }
217  return FALSE;
218 }
219 
220 static DWORD WINAPI
222 {
223  HDESK hDesk;
225 
226  /* When SetThreadDesktop is called the system closes the desktop handle when needed
227  so we have to create a new handle because this handle may still be in use by winlogon */
229  msg->hDesktop,
231  (HANDLE*)&hDesk,
232  0,
233  FALSE,
235  {
236  ERR("Duplicating handle failed!\n");
237  HeapFree(GetProcessHeap(), 0, lpParam);
238  return FALSE;
239  }
240 
241  if(!SetThreadDesktop(hDesk))
242  {
243  ERR("Setting thread desktop failed!\n");
244  HeapFree(GetProcessHeap(), 0, lpParam);
245  return FALSE;
246  }
247 
249  hDllInstance,
253  (LPARAM)lpParam);
254 
255  HeapFree(GetProcessHeap(), 0, lpParam);
256  return TRUE;
257 }
258 
259 static BOOL
261  IN PGINA_CONTEXT pgContext,
262  IN HDESK hDesktop,
264  IN PWSTR pTitle,
265  IN PWSTR pMessage)
266 {
268  HANDLE Thread;
269  DWORD ThreadId;
270 
271  TRACE("GUIDisplayStatusMessage(%ws)\n", pMessage);
272 
273  if (!pgContext->hStatusWindow)
274  {
275  /*
276  * If everything goes correctly, 'msg' is freed
277  * by the 'StartupWindowThread' thread.
278  */
281  sizeof(*msg));
282  if(!msg)
283  return FALSE;
284 
285  msg->Context = pgContext;
286  msg->dwOptions = dwOptions;
287  msg->pTitle = pTitle;
288  msg->pMessage = pMessage;
289  msg->hDesktop = hDesktop;
290 
291  msg->StartupEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
292 
293  if (!msg->StartupEvent)
294  {
295  HeapFree(GetProcessHeap(), 0, msg);
296  return FALSE;
297  }
298 
300  0,
302  (PVOID)msg,
303  0,
304  &ThreadId);
305  if (Thread)
306  {
307  /* 'msg' will be freed by 'StartupWindowThread' */
308 
310  WaitForSingleObject(msg->StartupEvent, INFINITE);
311  CloseHandle(msg->StartupEvent);
312  return TRUE;
313  }
314  else
315  {
316  /*
317  * The 'StartupWindowThread' thread couldn't be created,
318  * so we need to free the allocated 'msg'.
319  */
320  HeapFree(GetProcessHeap(), 0, msg);
321  }
322 
323  return FALSE;
324  }
325 
326  if (pTitle)
327  SetWindowTextW(pgContext->hStatusWindow, pTitle);
328 
329  SetDlgItemTextW(pgContext->hStatusWindow, IDC_STATUS_MESSAGE, pMessage);
330 
331  return TRUE;
332 }
333 
334 static BOOL
336  IN PGINA_CONTEXT pgContext)
337 {
338  if (pgContext->hStatusWindow)
339  {
340  EndDialog(pgContext->hStatusWindow, 0);
341  pgContext->hStatusWindow = NULL;
342  }
343 
344  return TRUE;
345 }
346 
347 static INT_PTR CALLBACK
349  IN HWND hwndDlg,
350  IN UINT uMsg,
351  IN WPARAM wParam,
352  IN LPARAM lParam)
353 {
354  PDLG_DATA pDlgData;
355 
356  pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
357 
358  switch (uMsg)
359  {
360  case WM_INITDIALOG:
361  {
362  pDlgData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DLG_DATA));
363  if (pDlgData == NULL)
364  return FALSE;
365 
366  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pDlgData);
367 
368  pDlgData->pgContext = (PGINA_CONTEXT)lParam;
369 
370  /* Load the logo bitmap */
371  pDlgData->hBitmap = LoadImageW(pDlgData->pgContext->hDllInstance, MAKEINTRESOURCEW(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
372  return TRUE;
373  }
374 
375  case WM_PAINT:
376  {
377  PAINTSTRUCT ps;
378  if (pDlgData->hBitmap)
379  {
380  BeginPaint(hwndDlg, &ps);
381  DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
382  EndPaint(hwndDlg, &ps);
383  }
384  return TRUE;
385  }
386  case WM_DESTROY:
387  {
388  DeleteObject(pDlgData->hBitmap);
389  HeapFree(GetProcessHeap(), 0, pDlgData);
390  return TRUE;
391  }
392  }
393  return FALSE;
394 }
395 
396 static VOID
398  IN OUT PGINA_CONTEXT pgContext)
399 {
400  TRACE("GUIDisplaySASNotice()\n");
401 
402  /* Display the notice window */
403  pgContext->pWlxFuncs->WlxDialogBoxParam(pgContext->hWlx,
404  pgContext->hDllInstance,
408  (LPARAM)pgContext);
409 }
410 
411 /* Get the text contained in a textbox. Allocates memory in pText
412  * to contain the text. Returns TRUE in case of success */
413 static BOOL
415  IN HWND hwndDlg,
416  IN INT TextboxId,
417  OUT LPWSTR *pText)
418 {
419  LPWSTR Text;
420  int Count;
421 
422  Count = GetWindowTextLength(GetDlgItem(hwndDlg, TextboxId));
423  Text = HeapAlloc(GetProcessHeap(), 0, (Count + 1) * sizeof(WCHAR));
424  if (!Text)
425  return FALSE;
426  if (Count != GetWindowTextW(GetDlgItem(hwndDlg, TextboxId), Text, Count + 1))
427  {
429  return FALSE;
430  }
431  *pText = Text;
432  return TRUE;
433 }
434 
435 
436 static
437 INT
439  IN PGINA_CONTEXT pgContext,
440  IN HWND hwnd,
441  IN UINT uType,
442  IN UINT uCaption,
443  IN UINT uText)
444 {
445  WCHAR szCaption[256];
446  WCHAR szText[256];
447 
448  LoadStringW(pgContext->hDllInstance, uCaption, szCaption, _countof(szCaption));
449  LoadStringW(pgContext->hDllInstance, uText, szText, _countof(szText));
450 
451  return pgContext->pWlxFuncs->WlxMessageBox(pgContext->hWlx,
452  hwnd,
453  szText,
454  szCaption,
455  uType);
456 }
457 
458 
459 static
460 BOOL
462  IN PGINA_CONTEXT pgContext,
463  IN HWND hwndDlg)
464 {
465  WCHAR UserName[256];
466  WCHAR Domain[256];
467  WCHAR OldPassword[256];
468  WCHAR NewPassword1[256];
469  WCHAR NewPassword2[256];
470  PMSV1_0_CHANGEPASSWORD_REQUEST RequestBuffer = NULL;
471  PMSV1_0_CHANGEPASSWORD_RESPONSE ResponseBuffer = NULL;
472  ULONG RequestBufferSize;
473  ULONG ResponseBufferSize = 0;
474  LPWSTR Ptr;
475  BOOL res = FALSE;
478 
479  GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_USERNAME, UserName, _countof(UserName));
480  GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_DOMAIN, Domain, _countof(Domain));
481  GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_OLDPWD, OldPassword, _countof(OldPassword));
482  GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_NEWPWD1, NewPassword1, _countof(NewPassword1));
483  GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_NEWPWD2, NewPassword2, _countof(NewPassword2));
484 
485  /* Compare the two passwords and fail if they do not match */
486  if (wcscmp(NewPassword1, NewPassword2) != 0)
487  {
488  ResourceMessageBox(pgContext,
489  hwndDlg,
493  return FALSE;
494  }
495 
496  /* Calculate the request buffer size */
497  RequestBufferSize = sizeof(MSV1_0_CHANGEPASSWORD_REQUEST) +
498  ((wcslen(Domain) + 1) * sizeof(WCHAR)) +
499  ((wcslen(UserName) + 1) * sizeof(WCHAR)) +
500  ((wcslen(OldPassword) + 1) * sizeof(WCHAR)) +
501  ((wcslen(NewPassword1) + 1) * sizeof(WCHAR));
502 
503  /* Allocate the request buffer */
504  RequestBuffer = HeapAlloc(GetProcessHeap(),
506  RequestBufferSize);
507  if (RequestBuffer == NULL)
508  {
509  ERR("HeapAlloc failed\n");
510  return FALSE;
511  }
512 
513  /* Initialize the request buffer */
514  RequestBuffer->MessageType = MsV1_0ChangePassword;
515  RequestBuffer->Impersonating = TRUE;
516 
517  Ptr = (LPWSTR)((ULONG_PTR)RequestBuffer + sizeof(MSV1_0_CHANGEPASSWORD_REQUEST));
518 
519  /* Pack the domain name */
520  RequestBuffer->DomainName.Length = wcslen(Domain) * sizeof(WCHAR);
521  RequestBuffer->DomainName.MaximumLength = RequestBuffer->DomainName.Length + sizeof(WCHAR);
522  RequestBuffer->DomainName.Buffer = Ptr;
523 
524  RtlCopyMemory(RequestBuffer->DomainName.Buffer,
525  Domain,
526  RequestBuffer->DomainName.MaximumLength);
527 
528  Ptr = (LPWSTR)((ULONG_PTR)Ptr + RequestBuffer->DomainName.MaximumLength);
529 
530  /* Pack the user name */
531  RequestBuffer->AccountName.Length = wcslen(UserName) * sizeof(WCHAR);
532  RequestBuffer->AccountName.MaximumLength = RequestBuffer->AccountName.Length + sizeof(WCHAR);
533  RequestBuffer->AccountName.Buffer = Ptr;
534 
535  RtlCopyMemory(RequestBuffer->AccountName.Buffer,
536  UserName,
537  RequestBuffer->AccountName.MaximumLength);
538 
539  Ptr = (LPWSTR)((ULONG_PTR)Ptr + RequestBuffer->AccountName.MaximumLength);
540 
541  /* Pack the old password */
542  RequestBuffer->OldPassword.Length = wcslen(OldPassword) * sizeof(WCHAR);
543  RequestBuffer->OldPassword.MaximumLength = RequestBuffer->OldPassword.Length + sizeof(WCHAR);
544  RequestBuffer->OldPassword.Buffer = Ptr;
545 
546  RtlCopyMemory(RequestBuffer->OldPassword.Buffer,
547  OldPassword,
548  RequestBuffer->OldPassword.MaximumLength);
549 
550  Ptr = (LPWSTR)((ULONG_PTR)Ptr + RequestBuffer->OldPassword.MaximumLength);
551 
552  /* Pack the new password */
553  RequestBuffer->NewPassword.Length = wcslen(NewPassword1) * sizeof(WCHAR);
554  RequestBuffer->NewPassword.MaximumLength = RequestBuffer->NewPassword.Length + sizeof(WCHAR);
555  RequestBuffer->NewPassword.Buffer = Ptr;
556 
557  RtlCopyMemory(RequestBuffer->NewPassword.Buffer,
558  NewPassword1,
559  RequestBuffer->NewPassword.MaximumLength);
560 
561  /* Connect to the LSA server */
562  if (ConnectToLsa(pgContext) != ERROR_SUCCESS)
563  {
564  ERR("ConnectToLsa() failed\n");
565  goto done;
566  }
567 
568  /* Call the authentication package */
569  Status = LsaCallAuthenticationPackage(pgContext->LsaHandle,
570  pgContext->AuthenticationPackage,
571  RequestBuffer,
572  RequestBufferSize,
573  (PVOID*)&ResponseBuffer,
574  &ResponseBufferSize,
575  &ProtocolStatus);
576  if (!NT_SUCCESS(Status))
577  {
578  ERR("LsaCallAuthenticationPackage failed (Status 0x%08lx)\n", Status);
579  goto done;
580  }
581 
583  {
584  TRACE("LsaCallAuthenticationPackage failed (ProtocolStatus 0x%08lx)\n", ProtocolStatus);
585  goto done;
586  }
587 
588  res = TRUE;
589 
590  ResourceMessageBox(pgContext,
591  hwndDlg,
595 
596  if ((wcscmp(UserName, pgContext->UserName) == 0) &&
597  (wcscmp(Domain, pgContext->DomainName) == 0) &&
598  (wcscmp(OldPassword, pgContext->Password) == 0))
599  {
600  ZeroMemory(pgContext->Password, sizeof(pgContext->Password));
601  wcscpy(pgContext->Password, NewPassword1);
602  }
603 
604 done:
605  if (RequestBuffer != NULL)
606  HeapFree(GetProcessHeap(), 0, RequestBuffer);
607 
608  if (ResponseBuffer != NULL)
609  LsaFreeReturnBuffer(ResponseBuffer);
610 
611  return res;
612 }
613 
614 
615 static INT_PTR CALLBACK
617  IN HWND hwndDlg,
618  IN UINT uMsg,
619  IN WPARAM wParam,
620  IN LPARAM lParam)
621 {
622  PGINA_CONTEXT pgContext;
623 
624  pgContext = (PGINA_CONTEXT)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
625 
626  switch (uMsg)
627  {
628  case WM_INITDIALOG:
629  {
630  pgContext = (PGINA_CONTEXT)lParam;
631  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pgContext);
632 
633  SetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_USERNAME, pgContext->UserName);
634  SendDlgItemMessageW(hwndDlg, IDC_CHANGEPWD_DOMAIN, CB_ADDSTRING, 0, (LPARAM)pgContext->DomainName);
637  return TRUE;
638  }
639 
640  case WM_COMMAND:
641  switch (LOWORD(wParam))
642  {
643  case IDOK:
644  if (DoChangePassword(pgContext, hwndDlg))
645  {
646  EndDialog(hwndDlg, TRUE);
647  }
648  else
649  {
653  }
654  return TRUE;
655 
656  case IDCANCEL:
657  EndDialog(hwndDlg, FALSE);
658  return TRUE;
659  }
660  break;
661 
662  case WM_CLOSE:
663  EndDialog(hwndDlg, FALSE);
664  return TRUE;
665  }
666 
667  return FALSE;
668 }
669 
670 
671 static VOID
673  PGINA_CONTEXT pgContext)
674 {
675  WCHAR Buffer1[256];
676  WCHAR Buffer2[256];
677  WCHAR Buffer3[256];
678  WCHAR Buffer4[512];
679 
680  LoadStringW(pgContext->hDllInstance, IDS_LOGONMSG, Buffer1, _countof(Buffer1));
681 
682  wsprintfW(Buffer2, L"%s\\%s", pgContext->DomainName, pgContext->UserName);
683  wsprintfW(Buffer4, Buffer1, Buffer2);
684 
686 
687  LoadStringW(pgContext->hDllInstance, IDS_LOGONDATE, Buffer1, _countof(Buffer1));
688 
690  (SYSTEMTIME*)&pgContext->LogonTime, NULL, Buffer2, _countof(Buffer2));
691 
693  (SYSTEMTIME*)&pgContext->LogonTime, NULL, Buffer3, _countof(Buffer3));
694 
695  wsprintfW(Buffer4, Buffer1, Buffer2, Buffer3);
696 
698 
699  if (pgContext->bAutoAdminLogon)
701 }
702 
703 
704 static BOOL
706  IN HWND hwnd,
707  IN PGINA_CONTEXT pgContext)
708 {
709  INT res;
710 
711  TRACE("OnChangePassword()\n");
712 
713  res = pgContext->pWlxFuncs->WlxDialogBoxParam(
714  pgContext->hWlx,
715  pgContext->hDllInstance,
717  hwnd,
719  (LPARAM)pgContext);
720 
721  TRACE("Result: %x\n", res);
722 
723  return FALSE;
724 }
725 
726 
727 static INT_PTR CALLBACK
729  IN HWND hwndDlg,
730  IN UINT uMsg,
731  IN WPARAM wParam,
732  IN LPARAM lParam)
733 {
734  switch (uMsg)
735  {
736  case WM_INITDIALOG:
737  return TRUE;
738 
739  case WM_COMMAND:
740  switch (LOWORD(wParam))
741  {
742  case IDYES:
743  EndDialog(hwndDlg, IDYES);
744  return TRUE;
745 
746  case IDNO:
747  EndDialog(hwndDlg, IDNO);
748  return TRUE;
749  }
750  break;
751 
752  case WM_CLOSE:
753  EndDialog(hwndDlg, IDNO);
754  return TRUE;
755  }
756 
757  return FALSE;
758 }
759 
760 
761 static
762 INT
764  IN HWND hwndDlg,
765  IN PGINA_CONTEXT pgContext)
766 {
767  return pgContext->pWlxFuncs->WlxDialogBoxParam(
768  pgContext->hWlx,
769  pgContext->hDllInstance,
771  hwndDlg,
773  (LPARAM)pgContext);
774 }
775 
776 
777 static
778 INT
780  IN HWND hwndDlg,
781  IN PGINA_CONTEXT pgContext)
782 {
783  INT ret;
784  DWORD ShutdownOptions;
785 
786  TRACE("OnShutDown(%p %p)\n", hwndDlg, pgContext);
787 
788  pgContext->nShutdownAction = GetDefaultShutdownSelState();
789  ShutdownOptions = GetDefaultShutdownOptions();
790 
791  if (pgContext->UserToken != NULL)
792  {
793  if (ImpersonateLoggedOnUser(pgContext->UserToken))
794  {
795  pgContext->nShutdownAction = LoadShutdownSelState();
796  ShutdownOptions = GetAllowedShutdownOptions();
797  RevertToSelf();
798  }
799  else
800  {
801  ERR("WL: ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError());
802  }
803  }
804 
805  ret = ShutdownDialog(hwndDlg, ShutdownOptions, pgContext);
806 
807  if (ret == IDOK)
808  {
809  if (pgContext->UserToken != NULL)
810  {
811  if (ImpersonateLoggedOnUser(pgContext->UserToken))
812  {
813  SaveShutdownSelState(pgContext->nShutdownAction);
814  RevertToSelf();
815  }
816  else
817  {
818  ERR("WL: ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError());
819  }
820  }
821  }
822 
823  return ret;
824 }
825 
826 
827 static INT_PTR CALLBACK
829  IN HWND hwndDlg,
830  IN UINT uMsg,
831  IN WPARAM wParam,
832  IN LPARAM lParam)
833 {
834  PGINA_CONTEXT pgContext;
835 
836  pgContext = (PGINA_CONTEXT)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
837 
838  switch (uMsg)
839  {
840  case WM_INITDIALOG:
841  {
842  pgContext = (PGINA_CONTEXT)lParam;
843  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pgContext);
844 
845  SetWelcomeText(hwndDlg);
846 
848  SetFocus(GetDlgItem(hwndDlg, IDNO));
849  return TRUE;
850  }
851 
852  case WM_COMMAND:
853  {
854  switch (LOWORD(wParam))
855  {
856  case IDC_SECURITY_LOCK:
858  return TRUE;
859  case IDC_SECURITY_LOGOFF:
860  if (OnLogOff(hwndDlg, pgContext) == IDYES)
862  return TRUE;
864  if (OnShutDown(hwndDlg, pgContext) == IDOK)
865  EndDialog(hwndDlg, pgContext->nShutdownAction);
866  return TRUE;
868  if (OnChangePassword(hwndDlg, pgContext))
870  return TRUE;
873  return TRUE;
874  case IDCANCEL:
875  EndDialog(hwndDlg, WLX_SAS_ACTION_NONE);
876  return TRUE;
877  }
878  break;
879  }
880  case WM_CLOSE:
881  {
882  EndDialog(hwndDlg, WLX_SAS_ACTION_NONE);
883  return TRUE;
884  }
885  }
886 
887  return FALSE;
888 }
889 
890 static INT
892  IN OUT PGINA_CONTEXT pgContext,
893  IN DWORD dwSasType)
894 {
895  INT result;
896 
897  TRACE("GUILoggedOnSAS()\n");
898 
899  if (dwSasType != WLX_SAS_TYPE_CTRL_ALT_DEL)
900  {
901  /* Nothing to do for WLX_SAS_TYPE_TIMEOUT ; the dialog will
902  * close itself thanks to the use of WlxDialogBoxParam */
903  return WLX_SAS_ACTION_NONE;
904  }
905 
906  pgContext->pWlxFuncs->WlxSwitchDesktopToWinlogon(
907  pgContext->hWlx);
908 
909  result = pgContext->pWlxFuncs->WlxDialogBoxParam(
910  pgContext->hWlx,
911  pgContext->hDllInstance,
915  (LPARAM)pgContext);
916 
919  {
921  }
922 
924  {
925  pgContext->pWlxFuncs->WlxSwitchDesktopToUser(
926  pgContext->hWlx);
927  }
928 
929  return result;
930 }
931 
932 
933 static
934 BOOL
936  IN HWND hwndDlg,
937  IN OUT PGINA_CONTEXT pgContext)
938 {
939  LPWSTR UserName = NULL;
940  LPWSTR Password = NULL;
941  LPWSTR Domain = NULL;
942  BOOL result = FALSE;
944 
945  if (GetTextboxText(hwndDlg, IDC_LOGON_USERNAME, &UserName) && *UserName == '\0')
946  goto done;
947 
948  if (GetTextboxText(hwndDlg, IDC_LOGON_DOMAIN, &Domain) && *Domain == '\0')
949  goto done;
950 
951  if (!GetTextboxText(hwndDlg, IDC_LOGON_PASSWORD, &Password))
952  goto done;
953 
954  Status = DoLoginTasks(pgContext, UserName, Domain, Password, &SubStatus);
956  {
957  ResourceMessageBox(pgContext,
958  hwndDlg,
962  goto done;
963  }
965  {
966  TRACE("DoLoginTasks failed! Status 0x%08lx SubStatus 0x%08lx\n", Status, SubStatus);
967 
969  {
970  ResourceMessageBox(pgContext,
971  hwndDlg,
975  goto done;
976  }
978  {
979  TRACE("Account locked!\n");
980  ResourceMessageBox(pgContext,
981  hwndDlg,
985  goto done;
986  }
987  else if ((SubStatus == STATUS_PASSWORD_MUST_CHANGE) ||
989  {
991  ResourceMessageBox(pgContext,
992  hwndDlg,
993  MB_OK | MB_ICONSTOP,
996  else
997  ResourceMessageBox(pgContext,
998  hwndDlg,
999  MB_OK | MB_ICONSTOP,
1002 
1003  if (!OnChangePassword(hwndDlg,
1004  pgContext))
1005  goto done;
1006 
1007  Status = DoLoginTasks(pgContext,
1008  pgContext->UserName,
1009  pgContext->DomainName,
1010  pgContext->Password,
1011  &SubStatus);
1012  if (!NT_SUCCESS(Status))
1013  {
1014  TRACE("Login after password change failed! (Status 0x%08lx)\n", Status);
1015 
1016  goto done;
1017  }
1018  }
1019  else if (SubStatus == STATUS_ACCOUNT_EXPIRED)
1020  {
1021  ResourceMessageBox(pgContext,
1022  hwndDlg,
1026  }
1028  {
1029  ResourceMessageBox(pgContext,
1030  hwndDlg,
1031  MB_OK | MB_ICONERROR,
1034  goto done;
1035  }
1037  {
1038  ResourceMessageBox(pgContext,
1039  hwndDlg,
1040  MB_OK | MB_ICONERROR,
1043  goto done;
1044  }
1045  else
1046  {
1047  TRACE("Other error!\n");
1048  ResourceMessageBox(pgContext,
1049  hwndDlg,
1050  MB_OK | MB_ICONERROR,
1053  goto done;
1054  }
1055  }
1056  else if (!NT_SUCCESS(Status))
1057  {
1058  TRACE("DoLoginTasks failed! Status 0x%08lx\n", Status);
1059  goto done;
1060  }
1061 
1062  if (!CreateProfile(pgContext, UserName, Domain, Password))
1063  {
1064  ERR("Failed to create the profile!\n");
1065  goto done;
1066  }
1067 
1068  ZeroMemory(pgContext->Password, sizeof(pgContext->Password));
1069  wcscpy(pgContext->Password, Password);
1070 
1071  result = TRUE;
1072 
1073 done:
1074  pgContext->bAutoAdminLogon = FALSE;
1075 
1076  if (UserName != NULL)
1077  HeapFree(GetProcessHeap(), 0, UserName);
1078 
1079  if (Password != NULL)
1081 
1082  if (Domain != NULL)
1083  HeapFree(GetProcessHeap(), 0, Domain);
1084 
1085  return result;
1086 }
1087 
1088 
1089 static
1090 VOID
1092  HWND hwndDomainComboBox,
1093  PGINA_CONTEXT pgContext)
1094 {
1095  WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1096  DWORD dwComputerNameLength;
1097  LONG lIndex = 0;
1098  LONG lFindIndex;
1099 
1100  SendMessageW(hwndDomainComboBox, CB_RESETCONTENT, 0, 0);
1101 
1102  dwComputerNameLength = _countof(szComputerName);
1103  if (GetComputerNameW(szComputerName, &dwComputerNameLength))
1104  {
1105  lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)szComputerName);
1106  }
1107 
1108  if (wcslen(pgContext->DomainName) != 0)
1109  {
1110  lFindIndex = SendMessageW(hwndDomainComboBox, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)pgContext->DomainName);
1111  if (lFindIndex == CB_ERR)
1112  {
1113  lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)pgContext->DomainName);
1114  }
1115  else
1116  {
1117  lIndex = lFindIndex;
1118  }
1119  }
1120 
1121  SendMessageW(hwndDomainComboBox, CB_SETCURSEL, lIndex, 0);
1122 }
1123 
1124 
1125 static INT_PTR CALLBACK
1127  IN HWND hwndDlg,
1128  IN UINT uMsg,
1129  IN WPARAM wParam,
1130  IN LPARAM lParam)
1131 {
1132  PDLG_DATA pDlgData;
1133 
1134  pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1135 
1136  switch (uMsg)
1137  {
1138  case WM_INITDIALOG:
1139  {
1140  pDlgData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DLG_DATA));
1141  if (pDlgData == NULL)
1142  return FALSE;
1143 
1144  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pDlgData);
1145 
1146  /* FIXME: take care of NoDomainUI */
1147  pDlgData->pgContext = (PGINA_CONTEXT)lParam;
1148 
1149  /* Draw the logo bitmap */
1150  pDlgData->hBitmap = LoadImageW(pDlgData->pgContext->hDllInstance, MAKEINTRESOURCEW(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
1151 
1152  SetWelcomeText(hwndDlg);
1153 
1154  if (pDlgData->pgContext->bAutoAdminLogon ||
1155  !pDlgData->pgContext->bDontDisplayLastUserName)
1156  SetDlgItemTextW(hwndDlg, IDC_LOGON_USERNAME, pDlgData->pgContext->UserName);
1157 
1158  if (pDlgData->pgContext->bAutoAdminLogon)
1159  SetDlgItemTextW(hwndDlg, IDC_LOGON_PASSWORD, pDlgData->pgContext->Password);
1160 
1161  SetDomainComboBox(GetDlgItem(hwndDlg, IDC_LOGON_DOMAIN), pDlgData->pgContext);
1162 
1163  if (pDlgData->pgContext->bDisableCAD)
1164  EnableWindow(GetDlgItem(hwndDlg, IDCANCEL), FALSE);
1165 
1166  if (!pDlgData->pgContext->bShutdownWithoutLogon)
1168 
1169  SetFocus(GetDlgItem(hwndDlg, pDlgData->pgContext->bDontDisplayLastUserName ? IDC_LOGON_USERNAME : IDC_LOGON_PASSWORD));
1170 
1171  if (pDlgData->pgContext->bAutoAdminLogon)
1172  PostMessage(GetDlgItem(hwndDlg, IDOK), BM_CLICK, 0, 0);
1173 
1174  return TRUE;
1175  }
1176 
1177  case WM_PAINT:
1178  {
1179  PAINTSTRUCT ps;
1180  if (pDlgData->hBitmap)
1181  {
1182  BeginPaint(hwndDlg, &ps);
1183  DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1184  EndPaint(hwndDlg, &ps);
1185  }
1186  return TRUE;
1187  }
1188 
1189  case WM_DESTROY:
1190  DeleteObject(pDlgData->hBitmap);
1191  HeapFree(GetProcessHeap(), 0, pDlgData);
1192  return TRUE;
1193 
1194  case WM_COMMAND:
1195  switch (LOWORD(wParam))
1196  {
1197  case IDOK:
1198  if (DoLogon(hwndDlg, pDlgData->pgContext))
1199  EndDialog(hwndDlg, WLX_SAS_ACTION_LOGON);
1200  return TRUE;
1201 
1202  case IDCANCEL:
1203  EndDialog(hwndDlg, WLX_SAS_ACTION_NONE);
1204  return TRUE;
1205 
1206  case IDC_LOGON_SHUTDOWN:
1207  if (OnShutDown(hwndDlg, pDlgData->pgContext) == IDOK)
1208  EndDialog(hwndDlg, pDlgData->pgContext->nShutdownAction);
1209  return TRUE;
1210  }
1211  break;
1212  }
1213 
1214  return FALSE;
1215 }
1216 
1217 
1218 static
1219 INT_PTR
1220 CALLBACK
1222  IN HWND hwndDlg,
1223  IN UINT uMsg,
1224  IN WPARAM wParam,
1225  IN LPARAM lParam)
1226 {
1227  PLEGALNOTICEDATA pLegalNotice;
1228 
1229  switch (uMsg)
1230  {
1231  case WM_INITDIALOG:
1232  pLegalNotice = (PLEGALNOTICEDATA)lParam;
1233  SetWindowTextW(hwndDlg, pLegalNotice->pszCaption);
1234  SetDlgItemTextW(hwndDlg, IDC_LEGALNOTICE_TEXT, pLegalNotice->pszText);
1235  return TRUE;
1236 
1237  case WM_COMMAND:
1238  switch (LOWORD(wParam))
1239  {
1240  case IDOK:
1241  EndDialog(hwndDlg, 0);
1242  return TRUE;
1243 
1244  case IDCANCEL:
1245  EndDialog(hwndDlg, 0);
1246  return TRUE;
1247  }
1248  break;
1249  }
1250 
1251  return FALSE;
1252 }
1253 
1254 
1255 static INT
1257  IN OUT PGINA_CONTEXT pgContext)
1258 {
1259  LEGALNOTICEDATA LegalNotice = {NULL, NULL};
1260  HKEY hKey = NULL;
1261  LONG rc;
1262  int result;
1263 
1264  TRACE("GUILoggedOutSAS()\n");
1265 
1267  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
1268  0,
1270  &hKey);
1271  if (rc == ERROR_SUCCESS)
1272  {
1273  ReadRegSzValue(hKey,
1274  L"LegalNoticeCaption",
1275  &LegalNotice.pszCaption);
1276 
1277  ReadRegSzValue(hKey,
1278  L"LegalNoticeText",
1279  &LegalNotice.pszText);
1280 
1281  RegCloseKey(hKey);
1282  }
1283 
1284  if (LegalNotice.pszCaption != NULL && wcslen(LegalNotice.pszCaption) != 0 &&
1285  LegalNotice.pszText != NULL && wcslen(LegalNotice.pszText) != 0)
1286  {
1287  pgContext->pWlxFuncs->WlxDialogBoxParam(pgContext->hWlx,
1288  pgContext->hDllInstance,
1290  GetDesktopWindow(),
1292  (LPARAM)&LegalNotice);
1293  }
1294 
1295  if (LegalNotice.pszCaption != NULL)
1296  HeapFree(GetProcessHeap(), 0, LegalNotice.pszCaption);
1297 
1298  if (LegalNotice.pszText != NULL)
1299  HeapFree(GetProcessHeap(), 0, LegalNotice.pszText);
1300 
1301  result = pgContext->pWlxFuncs->WlxDialogBoxParam(
1302  pgContext->hWlx,
1303  pgContext->hDllInstance,
1305  GetDesktopWindow(),
1307  (LPARAM)pgContext);
1308  if (result >= WLX_SAS_ACTION_LOGON &&
1310  {
1311  WARN("WlxLoggedOutSAS() returns 0x%x\n", result);
1312  return result;
1313  }
1314 
1315  WARN("WlxDialogBoxParam() failed (0x%x)\n", result);
1316  return WLX_SAS_ACTION_NONE;
1317 }
1318 
1319 
1320 static VOID
1322  INT nDlgItem,
1323  PGINA_CONTEXT pgContext)
1324 {
1325  WCHAR Buffer1[256];
1326  WCHAR Buffer2[256];
1327  WCHAR Buffer3[512];
1328 
1329  LoadStringW(pgContext->hDllInstance, IDS_LOCKMSG, Buffer1, _countof(Buffer1));
1330 
1331  wsprintfW(Buffer2, L"%s\\%s", pgContext->DomainName, pgContext->UserName);
1332  wsprintfW(Buffer3, Buffer1, Buffer2);
1333 
1334  SetDlgItemTextW(hwnd, nDlgItem, Buffer3);
1335 }
1336 
1337 
1338 static
1339 BOOL
1341  IN HWND hwndDlg,
1342  IN PGINA_CONTEXT pgContext,
1343  OUT LPINT Action)
1344 {
1345  WCHAR Buffer1[256];
1346  WCHAR Buffer2[256];
1347  LPWSTR UserName = NULL;
1348  LPWSTR Password = NULL;
1349  BOOL res = FALSE;
1350 
1351  if (GetTextboxText(hwndDlg, IDC_UNLOCK_USERNAME, &UserName) && *UserName == '\0')
1352  {
1353  HeapFree(GetProcessHeap(), 0, UserName);
1354  return FALSE;
1355  }
1356 
1358  {
1359  if (UserName != NULL && Password != NULL &&
1360  wcscmp(UserName, pgContext->UserName) == 0 &&
1361  wcscmp(Password, pgContext->Password) == 0)
1362  {
1364  res = TRUE;
1365  }
1366  else if (wcscmp(UserName, pgContext->UserName) == 0 &&
1367  wcscmp(Password, pgContext->Password) != 0)
1368  {
1369  /* Wrong Password */
1370  LoadStringW(pgContext->hDllInstance, IDS_LOCKEDWRONGPASSWORD, Buffer2, _countof(Buffer2));
1371  LoadStringW(pgContext->hDllInstance, IDS_COMPUTERLOCKED, Buffer1, _countof(Buffer1));
1372  MessageBoxW(hwndDlg, Buffer2, Buffer1, MB_OK | MB_ICONERROR);
1373  }
1374  else
1375  {
1376  /* Wrong user name */
1377  if (DoAdminUnlock(pgContext, UserName, NULL, Password))
1378  {
1380  res = TRUE;
1381  }
1382  else
1383  {
1384  LoadStringW(pgContext->hDllInstance, IDS_LOCKEDWRONGUSER, Buffer1, _countof(Buffer1));
1385  wsprintfW(Buffer2, Buffer1, pgContext->DomainName, pgContext->UserName);
1386  LoadStringW(pgContext->hDllInstance, IDS_COMPUTERLOCKED, Buffer1, _countof(Buffer1));
1387  MessageBoxW(hwndDlg, Buffer2, Buffer1, MB_OK | MB_ICONERROR);
1388  }
1389  }
1390  }
1391 
1392  if (UserName != NULL)
1393  HeapFree(GetProcessHeap(), 0, UserName);
1394 
1395  if (Password != NULL)
1397 
1398  return res;
1399 }
1400 
1401 
1402 static
1403 INT_PTR
1404 CALLBACK
1406  IN HWND hwndDlg,
1407  IN UINT uMsg,
1408  IN WPARAM wParam,
1409  IN LPARAM lParam)
1410 {
1411  PDLG_DATA pDlgData;
1413 
1414  pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1415 
1416  switch (uMsg)
1417  {
1418  case WM_INITDIALOG:
1419  {
1420  pDlgData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DLG_DATA));
1421  if (pDlgData == NULL)
1422  return FALSE;
1423 
1424  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pDlgData);
1425 
1426  pDlgData->pgContext = (PGINA_CONTEXT)lParam;
1427 
1428  SetWelcomeText(hwndDlg);
1429 
1430  SetLockMessage(hwndDlg, IDC_UNLOCK_MESSAGE, pDlgData->pgContext);
1431 
1432  SetDlgItemTextW(hwndDlg, IDC_UNLOCK_USERNAME, pDlgData->pgContext->UserName);
1434 
1435  if (pDlgData->pgContext->bDisableCAD)
1436  EnableWindow(GetDlgItem(hwndDlg, IDCANCEL), FALSE);
1437 
1438  /* Load the logo bitmap */
1439  pDlgData->hBitmap = LoadImageW(pDlgData->pgContext->hDllInstance, MAKEINTRESOURCEW(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
1440  return TRUE;
1441  }
1442 
1443  case WM_PAINT:
1444  {
1445  PAINTSTRUCT ps;
1446  if (pDlgData->hBitmap)
1447  {
1448  BeginPaint(hwndDlg, &ps);
1449  DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1450  EndPaint(hwndDlg, &ps);
1451  }
1452  return TRUE;
1453  }
1454  case WM_DESTROY:
1455  DeleteObject(pDlgData->hBitmap);
1456  HeapFree(GetProcessHeap(), 0, pDlgData);
1457  return TRUE;
1458 
1459  case WM_COMMAND:
1460  switch (LOWORD(wParam))
1461  {
1462  case IDOK:
1463  if (DoUnlock(hwndDlg, pDlgData->pgContext, &result))
1464  EndDialog(hwndDlg, result);
1465  return TRUE;
1466 
1467  case IDCANCEL:
1468  EndDialog(hwndDlg, WLX_SAS_ACTION_NONE);
1469  return TRUE;
1470  }
1471  break;
1472  }
1473 
1474  return FALSE;
1475 }
1476 
1477 
1478 static INT
1480  IN OUT PGINA_CONTEXT pgContext)
1481 {
1482  int result;
1483 
1484  TRACE("GUILockedSAS()\n");
1485 
1486  result = pgContext->pWlxFuncs->WlxDialogBoxParam(
1487  pgContext->hWlx,
1488  pgContext->hDllInstance,
1490  GetDesktopWindow(),
1492  (LPARAM)pgContext);
1493  if (result >= WLX_SAS_ACTION_LOGON &&
1495  {
1496  WARN("GUILockedSAS() returns 0x%x\n", result);
1497  return result;
1498  }
1499 
1500  WARN("GUILockedSAS() failed (0x%x)\n", result);
1501  return WLX_SAS_ACTION_NONE;
1502 }
1503 
1504 
1505 static INT_PTR CALLBACK
1507  IN HWND hwndDlg,
1508  IN UINT uMsg,
1509  IN WPARAM wParam,
1510  IN LPARAM lParam)
1511 {
1512  PDLG_DATA pDlgData;
1513 
1514  pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1515 
1516  switch (uMsg)
1517  {
1518  case WM_INITDIALOG:
1519  {
1520  pDlgData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DLG_DATA));
1521  if (pDlgData == NULL)
1522  return FALSE;
1523 
1524  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pDlgData);
1525 
1526  pDlgData->pgContext = (PGINA_CONTEXT)lParam;
1527 
1528  /* Load the logo bitmap */
1529  pDlgData->hBitmap = LoadImageW(pDlgData->pgContext->hDllInstance, MAKEINTRESOURCEW(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
1530 
1531  SetWelcomeText(hwndDlg);
1532 
1533  SetLockMessage(hwndDlg, IDC_LOCKED_MESSAGE, pDlgData->pgContext);
1534  return TRUE;
1535  }
1536  case WM_PAINT:
1537  {
1538  PAINTSTRUCT ps;
1539  if (pDlgData->hBitmap)
1540  {
1541  BeginPaint(hwndDlg, &ps);
1542  DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1543  EndPaint(hwndDlg, &ps);
1544  }
1545  return TRUE;
1546  }
1547  case WM_DESTROY:
1548  {
1549  DeleteObject(pDlgData->hBitmap);
1550  HeapFree(GetProcessHeap(), 0, pDlgData);
1551  return TRUE;
1552  }
1553  }
1554 
1555  return FALSE;
1556 }
1557 
1558 
1559 static VOID
1561  IN OUT PGINA_CONTEXT pgContext)
1562 {
1563  TRACE("GUIdisplayLockedNotice()\n");
1564 
1565  pgContext->pWlxFuncs->WlxDialogBoxParam(
1566  pgContext->hWlx,
1567  pgContext->hDllInstance,
1569  GetDesktopWindow(),
1571  (LPARAM)pgContext);
1572 }
1573 
1575  GUIInitialize,
1581  GUILockedSAS,
1583 };
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
WCHAR DomainName[256]
Definition: msgina.h:51
struct _DLG_DATA * PDLG_DATA
#define IDD_UNLOCK
Definition: resource.h:29
#define IDS_PASSWORDEXPIRED
Definition: resource.h:90
DWORD dwOptions
Definition: solitaire.cpp:23
#define IDD_WELCOME
Definition: resource.h:8
#define IDC_LOGON_SHUTDOWN
Definition: resource.h:15
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDI_ROSLOGO
Definition: resource.h:42
#define IN
Definition: typedefs.h:38
static INT GUILockedSAS(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1479
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2208
#define WLX_SAS_ACTION_LOCK_WKSTA
Definition: winwlx.h:55
static VOID SetLockMessage(HWND hwnd, INT nDlgItem, PGINA_CONTEXT pgContext)
Definition: gui.c:1321
struct _LEGALNOTICEDATA * PLEGALNOTICEDATA
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define IDOK
Definition: winuser.h:824
#define CloseHandle
Definition: compat.h:398
#define IDC_LOGON_PASSWORD
Definition: resource.h:13
LPCSTR pText
Definition: txtscale.cpp:79
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
struct _DISPLAYSTATUSMSG * PDISPLAYSTATUSMSG
HBITMAP hBarBitmap
Definition: gui.c:34
struct _MSV1_0_CHANGEPASSWORD_REQUEST MSV1_0_CHANGEPASSWORD_REQUEST
#define ERROR_SUCCESS
Definition: deptool.c:10
#define IDYES
Definition: winuser.h:829
#define IDC_SECURITY_MESSAGE
Definition: resource.h:18
struct _LEGALNOTICEDATA LEGALNOTICEDATA
#define IDD_LEGALNOTICE
Definition: resource.h:54
USHORT MaximumLength
Definition: env_spec_w32.h:370
static BOOL DoUnlock(IN HWND hwndDlg, IN PGINA_CONTEXT pgContext, OUT LPINT Action)
Definition: gui.c:1340
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
DWORD BarWidth
Definition: gui.c:37
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
static INT_PTR CALLBACK LegalNoticeDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:1221
BOOL WINAPI RevertToSelf(VOID)
Definition: security.c:1487
uint16_t * PWSTR
Definition: typedefs.h:54
static VOID OnInitSecurityDlg(HWND hwnd, PGINA_CONTEXT pgContext)
Definition: gui.c:672
#define _countof(array)
Definition: fontsub.cpp:30
#define LOCALE_USER_DEFAULT
NTSTATUS ConnectToLsa(PGINA_CONTEXT pgContext)
Definition: lsa.c:11
#define DATE_SHORTDATE
Definition: winnls.h:193
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
#define WARN(fmt,...)
Definition: debug.h:111
#define IDC_CHANGEPWD_DOMAIN
Definition: resource.h:36
LONG NTSTATUS
Definition: precomp.h:26
HDESK hDesktop
Definition: gui.c:17
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:27
BOOL WINAPI UpdateWindow(_In_ HWND)
HWND hWnd
Definition: settings.c:17
#define IDD_CHANGEPWD
Definition: resource.h:34
DWORD dwOptions
Definition: gui.c:18
static INT OnShutDown(IN HWND hwndDlg, IN PGINA_CONTEXT pgContext)
Definition: gui.c:779
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL DoAdminUnlock(IN PGINA_CONTEXT pgContext, IN PWSTR UserName, IN PWSTR Domain, IN PWSTR Password)
Definition: msgina.c:665
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define ZeroMemory
Definition: winbase.h:1642
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define IDS_LOGONTITLE
Definition: resource.h:86
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
DWORD GetDefaultShutdownOptions(VOID)
Definition: shutdown.c:221
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT_PTR WPARAM
Definition: windef.h:207
#define STATUS_ACCOUNT_LOCKED_OUT
Definition: ntstatus.h:682
#define MB_ICONSTOP
Definition: winuser.h:797
#define GetWindowLongPtrW
Definition: winuser.h:4730
uint16_t * PWCHAR
Definition: typedefs.h:54
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:440
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
int32_t INT_PTR
Definition: typedefs.h:62
static BOOL OnChangePassword(IN HWND hwnd, IN PGINA_CONTEXT pgContext)
Definition: gui.c:705
static INT GUILoggedOutSAS(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1256
LONG ReadRegSzValue(IN HKEY hKey, IN LPCWSTR pszValue, OUT LPWSTR *pValue)
Definition: msgina.c:60
#define IDC_LOCKED_MESSAGE
Definition: resource.h:27
HANDLE hDllInstance
Definition: msgina.h:37
#define IDS_ACCOUNTEXPIRED
Definition: resource.h:91
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:410
int32_t INT
Definition: typedefs.h:56
static INT ResourceMessageBox(IN PGINA_CONTEXT pgContext, IN HWND hwnd, IN UINT uType, IN UINT uCaption, IN UINT uText)
Definition: gui.c:438
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
UNICODE_STRING AccountName
Definition: ntsecapi.h:510
#define STATUS_ACCOUNT_EXPIRED
Definition: ntstatus.h:622
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
#define IDS_ACCOUNTRESTRICTION
Definition: resource.h:95
#define STATUS_INVALID_LOGON_HOURS
Definition: ntstatus.h:333
struct GINA_CONTEXT * PGINA_CONTEXT
#define STATUS_ACCOUNT_RESTRICTION
Definition: ntstatus.h:332
BOOL WINAPI SetThreadDesktop(_In_ HDESK)
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define IDC_LEGALNOTICE_TEXT
Definition: resource.h:55
#define MB_ICONEXCLAMATION
Definition: winuser.h:779
static INT_PTR CALLBACK SecurityDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:828
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define IDC_LOGON_DOMAIN
Definition: resource.h:14
ULONG nShutdownAction
Definition: msgina.h:47
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
PWSTR pTitle
Definition: gui.c:19
#define IDC_CHANGEPWD_USERNAME
Definition: resource.h:35
GINA_UI GinaGraphicalUI
Definition: gui.c:1574
#define DUPLICATE_SAME_ACCESS
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
VOID NTAPI ProtocolStatus(NDIS_HANDLE BindingContext, NDIS_STATUS GenerelStatus, PVOID StatusBuffer, UINT StatusBufferSize)
Called by NDIS when the underlying driver has changed state.
Definition: lan.c:461
struct _DLG_DATA DLG_DATA
static const WCHAR szText[]
Definition: dialog.c:139
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID _Out_ PHANDLE _Out_ PQUOTA_LIMITS _Out_ PNTSTATUS SubStatus
unsigned int BOOL
Definition: ntddk_ex.h:94
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
long LONG
Definition: pedump.c:60
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define IDS_ACCOUNTLOCKED
Definition: resource.h:92
HBITMAP hBitmap
Definition: gui.c:33
#define GWLP_USERDATA
Definition: treelist.c:63
#define CB_ADDSTRING
Definition: winuser.h:1918
static INT_PTR CALLBACK ChangePasswordDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:616
#define WLX_SAS_ACTION_LOGOFF
Definition: winwlx.h:56
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
#define WLX_SAS_ACTION_UNLOCK_WKSTA
Definition: winwlx.h:60
#define IDD_LOGOFF
Definition: resource.h:41
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:652
LPWSTR pszCaption
Definition: gui.c:26
#define IDS_PASSWORDCHANGED
Definition: resource.h:85
LONG_PTR LPARAM
Definition: windef.h:208
NTSTATUS DoLoginTasks(IN OUT PGINA_CONTEXT pgContext, IN PWSTR UserName, IN PWSTR Domain, IN PWSTR Password, OUT PNTSTATUS SubStatus)
Definition: msgina.c:752
DWORD GetDefaultShutdownSelState(VOID)
Definition: shutdown.c:95
#define IDC_SECURITY_LOGONDATE
Definition: resource.h:19
BOOL WINAPI ImpersonateLoggedOnUser(HANDLE hToken)
Definition: misc.c:152
WCHAR UserName[256]
Definition: msgina.h:50
static BOOL GUIDisplayStatusMessage(IN PGINA_CONTEXT pgContext, IN HDESK hDesktop, IN DWORD dwOptions, IN PWSTR pTitle, IN PWSTR pMessage)
Definition: gui.c:260
#define BufSize
Definition: FsRtlTunnel.c:28
#define IDD_SECURITY
Definition: inetcpl.h:83
#define CB_RESETCONTENT
Definition: winuser.h:1941
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define CB_ERR
Definition: winuser.h:2410
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_DESTROY
Definition: winuser.h:1591
static INT GUILoggedOnSAS(IN OUT PGINA_CONTEXT pgContext, IN DWORD dwSasType)
Definition: gui.c:891
DWORD BarCounter
Definition: gui.c:36
#define PostMessage
Definition: winuser.h:5733
static BOOL DoChangePassword(IN PGINA_CONTEXT pgContext, IN HWND hwndDlg)
Definition: gui.c:461
static HINSTANCE hDllInstance
Definition: clb.c:30
#define IDD_LOGON
Definition: resource.h:143
#define IDS_INVALIDWORKSTATION
Definition: resource.h:94
static INT_PTR CALLBACK UnlockDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:1405
#define BM_CLICK
Definition: winuser.h:1899
#define STATUS_ACCOUNT_DISABLED
Definition: ntstatus.h:336
PWSTR pMessage
Definition: gui.c:20
#define IDC_BAR
Definition: resource.h:58
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL GUIInitialize(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:42
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define STATUS_PASSWORD_EXPIRED
Definition: ntstatus.h:335
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define WM_TIMER
Definition: winuser.h:1724
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738
static INT_PTR CALLBACK StatusDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:113
#define WM_CLOSE
Definition: winuser.h:1603
UNICODE_STRING NewPassword
Definition: ntsecapi.h:512
static INT_PTR CALLBACK LogonDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:1126
#define IDS_INVALIDLOGONHOURS
Definition: resource.h:93
int WINAPI GetWindowTextLengthW(_In_ HWND)
#define WINAPI
Definition: msvc.h:8
#define IDS_NONMATCHINGPASSWORDS
Definition: resource.h:84
SYSTEMTIME LogonTime
Definition: msgina.h:53
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
static VOID SetDomainComboBox(HWND hwndDomainComboBox, PGINA_CONTEXT pgContext)
Definition: gui.c:1091
#define IDC_UNLOCK_PASSWORD
Definition: resource.h:32
#define IDC_STATUS_MESSAGE
Definition: resource.h:6
DWORD BarHeight
Definition: gui.c:38
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define IDS_LOCKEDWRONGPASSWORD
Definition: resource.h:81
#define GetObject
Definition: wingdi.h:4463
#define IDC_LOGON_USERNAME
Definition: resource.h:12
#define WM_PAINT
Definition: winuser.h:1602
#define WLX_SAS_ACTION_LOGON
Definition: winwlx.h:53
PGINA_CONTEXT pgContext
Definition: gui.c:32
static BOOL DoLogon(IN HWND hwndDlg, IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:935
#define WLX_SAS_ACTION_SWITCH_CONSOLE
Definition: winwlx.h:69
#define IDC_CHANGEPWD_OLDPWD
Definition: resource.h:37
#define MB_ICONINFORMATION
Definition: winuser.h:796
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
int ret
#define IDS_LOGONWRONGUSERORPWD
Definition: resource.h:87
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define IDC_UNLOCK_USERNAME
Definition: resource.h:31
#define IDC_SECURITY_TASKMGR
Definition: resource.h:24
#define WLX_SAS_TYPE_CTRL_ALT_DEL
Definition: winwlx.h:36
BOOL WINAPI DrawStateW(_In_ HDC, _In_opt_ HBRUSH, _In_opt_ DRAWSTATEPROC, _In_ LPARAM, _In_ WPARAM, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define MB_ICONERROR
Definition: winuser.h:781
static DWORD WINAPI StartupWindowThread(LPVOID lpParam)
Definition: gui.c:221
#define CB_SETCURSEL
Definition: winuser.h:1943
#define WM_COMMAND
Definition: winuser.h:1722
Definition: gui.c:30
#define IDS_LOCKEDWRONGUSER
Definition: resource.h:82
static INT_PTR CALLBACK LogOffDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:728
DWORD LoadShutdownSelState(VOID)
Definition: shutdown.c:101
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:979
Status
Definition: gdiplustypes.h:24
#define IDS_LOGONMSG
Definition: resource.h:78
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define ERR(fmt,...)
Definition: debug.h:109
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:240
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define IDI_BAR
Definition: resource.h:62
BOOL bAutoAdminLogon
Definition: msgina.h:42
#define STATUS_INVALID_WORKSTATION
Definition: ntstatus.h:334
UINT_PTR TimerID
Definition: gui.c:35
#define IDC_UNLOCK_MESSAGE
Definition: resource.h:30
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1408
BOOL WINAPI DeleteDC(_In_ HDC)
static BOOL GUIRemoveStatusMessage(IN PGINA_CONTEXT pgContext)
Definition: gui.c:335
#define STATUS_PASSWORD_MUST_CHANGE
Definition: ntstatus.h:666
#define WLX_SAS_ACTION_NONE
Definition: winwlx.h:54
INT_PTR ShutdownDialog(IN HWND hwndDlg, IN DWORD ShutdownOptions, IN PGINA_CONTEXT pgContext)
Definition: shutdown.c:493
#define IDS_CHANGEPWDTITLE
Definition: resource.h:83
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define IDS_LOCKMSG
Definition: resource.h:77
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Definition: bl.h:1331
struct _DISPLAYSTATUSMSG DISPLAYSTATUSMSG
static INT_PTR CALLBACK LockedDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:1506
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType
Definition: ntsecapi.h:508
HANDLE StartupEvent
Definition: gui.c:21
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WLX_SAS_ACTION_PWD_CHANGED
Definition: winwlx.h:58
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define SetWindowText
Definition: winuser.h:5758
unsigned int UINT
Definition: ndis.h:50
static INT_PTR CALLBACK WelcomeDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:348
#define MB_OK
Definition: winuser.h:784
#define IMAGE_BITMAP
Definition: winuser.h:211
#define IDS_PASSWORDMUSTCHANGE
Definition: resource.h:89
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define IDD_STATUS
Definition: resource.h:22
#define IDC_CHANGEPWD_NEWPWD2
Definition: resource.h:39
#define IDS_LOGONUSERDISABLED
Definition: resource.h:88
static BOOL GetTextboxText(IN HWND hwndDlg, IN INT TextboxId, OUT LPWSTR *pText)
Definition: gui.c:414
#define WLX_SAS_ACTION_TASKLIST
Definition: winwlx.h:59
#define WM_DRAWITEM
Definition: winuser.h:1627
#define IDC_SECURITY_LOGOFF
Definition: resource.h:21
#define msg(x)
Definition: auth_time.c:54
LPWSTR pszText
Definition: gui.c:27
#define IDS_COMPUTERLOCKED
Definition: resource.h:80
NTSTATUS NTAPI LsaFreeReturnBuffer(PVOID)
#define DST_BITMAP
Definition: winuser.h:516
#define OUT
Definition: typedefs.h:39
UNICODE_STRING OldPassword
Definition: ntsecapi.h:511
GLuint res
Definition: glext.h:9613
#define IDD_LOCKED
Definition: resource.h:26
#define IDC_SECURITY_SHUTDOWN
Definition: resource.h:22
static VOID GUIDisplaySASNotice(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:397
static VOID GUIDisplayLockedNotice(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1560
unsigned int ULONG
Definition: retypes.h:1
#define GetWindowTextLength
Definition: winuser.h:5700
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
static VOID SetWelcomeText(HWND hWnd)
Definition: gui.c:52
#define SetWindowLongPtrW
Definition: winuser.h:5247
static HBITMAP
Definition: button.c:44
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
VOID SaveShutdownSelState(DWORD ShutdownCode)
#define IDNO
Definition: winuser.h:830
DWORD GetAllowedShutdownOptions(VOID)
Definition: shutdown.c:227
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
#define INFINITE
Definition: serial.h:102
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
return STATUS_SUCCESS
Definition: btrfs.c:2966
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1079
PGINA_CONTEXT Context
Definition: gui.c:16
GLuint64EXT * result
Definition: glext.h:11304
NTSTATUS NTAPI LsaCallAuthenticationPackage(HANDLE, ULONG, PVOID, ULONG, PVOID *, PULONG, PNTSTATUS)
BYTE * PBYTE
Definition: pedump.c:66
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define IDC_SECURITY_LOCK
Definition: resource.h:20
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394
#define SRCCOPY
Definition: wingdi.h:332
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
Definition: handle.c:149
HDC hdcMem
Definition: welcome.c:104
static INT OnLogOff(IN HWND hwndDlg, IN PGINA_CONTEXT pgContext)
Definition: gui.c:763
#define IDC_CHANGEPWD_NEWPWD1
Definition: resource.h:38
#define STATUS_LOGON_FAILURE
Definition: ntstatus.h:331
#define IDS_LOGONDATE
Definition: resource.h:79
char * Text
Definition: combotst.c:136
BOOL CreateProfile(IN OUT PGINA_CONTEXT pgContext, IN PWSTR UserName, IN PWSTR Domain, IN PWSTR Password)
Definition: msgina.c:785
int * LPINT
Definition: windef.h:178
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define IDC_SECURITY_CHANGEPWD
Definition: resource.h:23
off
Definition: i386-dis.c:3909
#define REG_SZ
Definition: layer.c:22
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1922