ReactOS  0.4.14-dev-1296-g56aa513
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  * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
6  * Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
7  */
8 
9 #include "msgina.h"
10 
11 #include <wingdi.h>
12 #include <winnls.h>
13 #include <winreg.h>
14 
15 typedef struct _DISPLAYSTATUSMSG
16 {
18  HDESK hDesktop;
24 
25 typedef struct _LEGALNOTICEDATA
26 {
30 
31 typedef struct _DLG_DATA
32 {
43 
44 static PDLG_DATA
45 DlgData_Create(HWND hwndDlg, PGINA_CONTEXT pgContext)
46 {
47  PDLG_DATA pDlgData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pDlgData));
48  if (pDlgData)
49  {
50  pDlgData->pgContext = pgContext;
51  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pDlgData);
52  }
53  return pDlgData;
54 }
55 
56 static BOOL
58 {
59  BITMAP bm;
60 
61  if (!pDlgData)
62  return FALSE;
63 
64  pDlgData->hLogoBitmap = LoadImageW(pDlgData->pgContext->hDllInstance,
66  0, 0, LR_DEFAULTCOLOR);
67  GetObject(pDlgData->hLogoBitmap, sizeof(bm), &bm);
68  pDlgData->LogoWidth = bm.bmWidth;
69  pDlgData->LogoHeight = bm.bmHeight;
70 
73  GetObject(pDlgData->hBarBitmap, sizeof(bm), &bm);
74  pDlgData->BarWidth = bm.bmWidth;
75  pDlgData->BarHeight = bm.bmHeight;
76 
77  return (pDlgData->hLogoBitmap != NULL && pDlgData->hBarBitmap != NULL);
78 }
79 
80 static void
82 {
83  if (!pDlgData)
84  return;
85 
86  DeleteObject(pDlgData->hLogoBitmap);
87  DeleteObject(pDlgData->hBarBitmap);
88  HeapFree(GetProcessHeap(), 0, pDlgData);
89 }
90 
91 static BOOL
93  IN OUT PGINA_CONTEXT pgContext)
94 {
95  TRACE("GUIInitialize(%p)\n", pgContext);
96  return TRUE;
97 }
98 
99 static
100 VOID
102 {
103  PWCHAR pBuffer = NULL, p;
104  HKEY hKey;
105  DWORD BufSize, dwType, dwWelcomeSize, dwTitleLength;
106  LONG rc;
107 
108  TRACE("SetWelcomeText(%p)\n", hWnd);
109 
110  /* Open the Winlogon key */
112  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
113  0,
115  &hKey);
116  if (rc != ERROR_SUCCESS)
117  {
118  WARN("RegOpenKeyExW() failed with error %lu\n", rc);
119  return;
120  }
121 
122  /* Get the size of the Welcome value */
123  dwWelcomeSize = 0;
124  rc = RegQueryValueExW(hKey,
125  L"Welcome",
126  NULL,
127  &dwType,
128  NULL,
129  &dwWelcomeSize);
130  if (rc == ERROR_FILE_NOT_FOUND || dwWelcomeSize == 0 || dwType != REG_SZ)
131  goto done;
132 
133  dwTitleLength = GetWindowTextLengthW(hWnd);
134  BufSize = dwWelcomeSize + ((dwTitleLength + 1) * sizeof(WCHAR));
135 
137  if (pBuffer == NULL)
138  goto done;
139 
140  GetWindowTextW(hWnd, pBuffer, BufSize / sizeof(WCHAR));
141  wcscat(pBuffer, L" ");
142  p = &pBuffer[dwTitleLength + 1];
143 
144  RegQueryValueExW(hKey,
145  L"Welcome",
146  NULL,
147  &dwType,
148  (PBYTE)p,
149  &dwWelcomeSize);
150 
152 
153 done:
154  if (pBuffer != NULL)
156 
157  RegCloseKey(hKey);
158 }
159 
160 
161 static INT_PTR CALLBACK
163  IN HWND hwndDlg,
164  IN UINT uMsg,
165  IN WPARAM wParam,
166  IN LPARAM lParam)
167 {
168  PDLG_DATA pDlgData;
170 
171  pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
172 
173  switch (uMsg)
174  {
175  case WM_INITDIALOG:
176  {
178  if (!msg)
179  return FALSE;
180 
181  msg->Context->hStatusWindow = hwndDlg;
182 
183  if (msg->pTitle)
184  SetWindowTextW(hwndDlg, msg->pTitle);
185  SetDlgItemTextW(hwndDlg, IDC_STATUS_MESSAGE, msg->pMessage);
186  SetEvent(msg->StartupEvent);
187 
188  pDlgData = DlgData_Create(hwndDlg, msg->Context);
189  if (pDlgData == NULL)
190  return FALSE;
191 
192  if (DlgData_LoadBitmaps(pDlgData))
193  {
194  pDlgData->TimerID = SetTimer(hwndDlg, -1, 20, NULL);
195  }
196  return TRUE;
197  }
198 
199  case WM_TIMER:
200  {
201  if (pDlgData && pDlgData->hBarBitmap)
202  {
203  /*
204  * Default rotation bar image width is 413 (same as logo)
205  * We can divide 413 by 7 without remainder
206  */
207  pDlgData->BarCounter = (pDlgData->BarCounter + 7) % pDlgData->BarWidth;
208  InvalidateRect(hwndDlg, NULL, FALSE);
209  UpdateWindow(hwndDlg);
210  }
211  return TRUE;
212  }
213 
214  case WM_DRAWITEM:
215  {
217 
218  if (lpDis->CtlID != IDC_BAR)
219  {
220  return FALSE;
221  }
222 
223  if (pDlgData && pDlgData->hBarBitmap)
224  {
225  HDC hdcMem;
226  HGDIOBJ hOld;
227  DWORD off = pDlgData->BarCounter;
228  DWORD iw = pDlgData->BarWidth;
229  DWORD ih = pDlgData->BarHeight;
230 
231  hdcMem = CreateCompatibleDC(lpDis->hDC);
232  hOld = SelectObject(hdcMem, pDlgData->hBarBitmap);
233  BitBlt(lpDis->hDC, off, 0, iw - off, ih, hdcMem, 0, 0, SRCCOPY);
234  BitBlt(lpDis->hDC, 0, 0, off, ih, hdcMem, iw - off, 0, SRCCOPY);
235  SelectObject(hdcMem, hOld);
236  DeleteDC(hdcMem);
237 
238  return TRUE;
239  }
240  return FALSE;
241  }
242 
243  case WM_DESTROY:
244  {
245  if (pDlgData && pDlgData->hBarBitmap)
246  {
247  KillTimer(hwndDlg, pDlgData->TimerID);
248  }
249  DlgData_Destroy(pDlgData);
250  return TRUE;
251  }
252  }
253  return FALSE;
254 }
255 
256 static DWORD WINAPI
258 {
259  HDESK hDesk;
261 
262  /* When SetThreadDesktop is called the system closes the desktop handle when needed
263  so we have to create a new handle because this handle may still be in use by winlogon */
265  msg->hDesktop,
267  (HANDLE*)&hDesk,
268  0,
269  FALSE,
271  {
272  ERR("Duplicating handle failed!\n");
273  HeapFree(GetProcessHeap(), 0, lpParam);
274  return FALSE;
275  }
276 
277  if(!SetThreadDesktop(hDesk))
278  {
279  ERR("Setting thread desktop failed!\n");
280  HeapFree(GetProcessHeap(), 0, lpParam);
281  return FALSE;
282  }
283 
285  hDllInstance,
289  (LPARAM)lpParam);
290 
291  HeapFree(GetProcessHeap(), 0, lpParam);
292  return TRUE;
293 }
294 
295 static BOOL
297  IN PGINA_CONTEXT pgContext,
298  IN HDESK hDesktop,
300  IN PWSTR pTitle,
301  IN PWSTR pMessage)
302 {
304  HANDLE Thread;
305  DWORD ThreadId;
306 
307  TRACE("GUIDisplayStatusMessage(%ws)\n", pMessage);
308 
309  if (!pgContext->hStatusWindow)
310  {
311  /*
312  * If everything goes correctly, 'msg' is freed
313  * by the 'StartupWindowThread' thread.
314  */
317  sizeof(*msg));
318  if(!msg)
319  return FALSE;
320 
321  msg->Context = pgContext;
322  msg->dwOptions = dwOptions;
323  msg->pTitle = pTitle;
324  msg->pMessage = pMessage;
325  msg->hDesktop = hDesktop;
326 
327  msg->StartupEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
328 
329  if (!msg->StartupEvent)
330  {
331  HeapFree(GetProcessHeap(), 0, msg);
332  return FALSE;
333  }
334 
336  0,
338  (PVOID)msg,
339  0,
340  &ThreadId);
341  if (Thread)
342  {
343  /* 'msg' will be freed by 'StartupWindowThread' */
344 
346  WaitForSingleObject(msg->StartupEvent, INFINITE);
347  CloseHandle(msg->StartupEvent);
348  return TRUE;
349  }
350  else
351  {
352  /*
353  * The 'StartupWindowThread' thread couldn't be created,
354  * so we need to free the allocated 'msg'.
355  */
356  HeapFree(GetProcessHeap(), 0, msg);
357  }
358 
359  return FALSE;
360  }
361 
362  if (pTitle)
363  SetWindowTextW(pgContext->hStatusWindow, pTitle);
364 
365  SetDlgItemTextW(pgContext->hStatusWindow, IDC_STATUS_MESSAGE, pMessage);
366 
367  return TRUE;
368 }
369 
370 static BOOL
372  IN PGINA_CONTEXT pgContext)
373 {
374  if (pgContext->hStatusWindow)
375  {
376  EndDialog(pgContext->hStatusWindow, 0);
377  pgContext->hStatusWindow = NULL;
378  }
379 
380  return TRUE;
381 }
382 
383 static INT_PTR CALLBACK
385  IN HWND hwndDlg,
386  IN UINT uMsg,
387  IN WPARAM wParam,
388  IN LPARAM lParam)
389 {
390  PDLG_DATA pDlgData;
391 
392  pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
393 
394  switch (uMsg)
395  {
396  case WM_INITDIALOG:
397  {
398  pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
399  if (pDlgData == NULL)
400  return FALSE;
401 
402  DlgData_LoadBitmaps(pDlgData);
403  return TRUE;
404  }
405 
406  case WM_PAINT:
407  {
408  PAINTSTRUCT ps;
409  if (pDlgData && pDlgData->hLogoBitmap)
410  {
411  BeginPaint(hwndDlg, &ps);
412  DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
413  EndPaint(hwndDlg, &ps);
414  }
415  return TRUE;
416  }
417  case WM_DESTROY:
418  {
419  DlgData_Destroy(pDlgData);
420  return TRUE;
421  }
422  }
423  return FALSE;
424 }
425 
426 static VOID
428  IN OUT PGINA_CONTEXT pgContext)
429 {
430  TRACE("GUIDisplaySASNotice()\n");
431 
432  /* Display the notice window */
433  pgContext->pWlxFuncs->WlxDialogBoxParam(pgContext->hWlx,
434  pgContext->hDllInstance,
438  (LPARAM)pgContext);
439 }
440 
441 /* Get the text contained in a textbox. Allocates memory in pText
442  * to contain the text. Returns TRUE in case of success */
443 static BOOL
445  IN HWND hwndDlg,
446  IN INT TextboxId,
447  OUT LPWSTR *pText)
448 {
449  LPWSTR Text;
450  int Count;
451 
452  Count = GetWindowTextLength(GetDlgItem(hwndDlg, TextboxId));
453  Text = HeapAlloc(GetProcessHeap(), 0, (Count + 1) * sizeof(WCHAR));
454  if (!Text)
455  return FALSE;
456  if (Count != GetWindowTextW(GetDlgItem(hwndDlg, TextboxId), Text, Count + 1))
457  {
459  return FALSE;
460  }
461  *pText = Text;
462  return TRUE;
463 }
464 
465 
466 static
467 INT
469  IN PGINA_CONTEXT pgContext,
470  IN HWND hwnd,
471  IN UINT uType,
472  IN UINT uCaption,
473  IN UINT uText)
474 {
475  WCHAR szCaption[256];
476  WCHAR szText[256];
477 
478  LoadStringW(pgContext->hDllInstance, uCaption, szCaption, _countof(szCaption));
479  LoadStringW(pgContext->hDllInstance, uText, szText, _countof(szText));
480 
481  return pgContext->pWlxFuncs->WlxMessageBox(pgContext->hWlx,
482  hwnd,
483  szText,
484  szCaption,
485  uType);
486 }
487 
488 
489 static
490 BOOL
492  IN PGINA_CONTEXT pgContext,
493  IN HWND hwndDlg)
494 {
495  WCHAR UserName[256];
496  WCHAR Domain[256];
497  WCHAR OldPassword[256];
498  WCHAR NewPassword1[256];
499  WCHAR NewPassword2[256];
500  PMSV1_0_CHANGEPASSWORD_REQUEST RequestBuffer = NULL;
501  PMSV1_0_CHANGEPASSWORD_RESPONSE ResponseBuffer = NULL;
502  ULONG RequestBufferSize;
503  ULONG ResponseBufferSize = 0;
504  LPWSTR Ptr;
505  BOOL res = FALSE;
508 
509  GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_USERNAME, UserName, _countof(UserName));
510  GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_DOMAIN, Domain, _countof(Domain));
511  GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_OLDPWD, OldPassword, _countof(OldPassword));
512  GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_NEWPWD1, NewPassword1, _countof(NewPassword1));
513  GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_NEWPWD2, NewPassword2, _countof(NewPassword2));
514 
515  /* Compare the two passwords and fail if they do not match */
516  if (wcscmp(NewPassword1, NewPassword2) != 0)
517  {
518  ResourceMessageBox(pgContext,
519  hwndDlg,
523  return FALSE;
524  }
525 
526  /* Calculate the request buffer size */
527  RequestBufferSize = sizeof(MSV1_0_CHANGEPASSWORD_REQUEST) +
528  ((wcslen(Domain) + 1) * sizeof(WCHAR)) +
529  ((wcslen(UserName) + 1) * sizeof(WCHAR)) +
530  ((wcslen(OldPassword) + 1) * sizeof(WCHAR)) +
531  ((wcslen(NewPassword1) + 1) * sizeof(WCHAR));
532 
533  /* Allocate the request buffer */
534  RequestBuffer = HeapAlloc(GetProcessHeap(),
536  RequestBufferSize);
537  if (RequestBuffer == NULL)
538  {
539  ERR("HeapAlloc failed\n");
540  return FALSE;
541  }
542 
543  /* Initialize the request buffer */
544  RequestBuffer->MessageType = MsV1_0ChangePassword;
545  RequestBuffer->Impersonating = TRUE;
546 
547  Ptr = (LPWSTR)((ULONG_PTR)RequestBuffer + sizeof(MSV1_0_CHANGEPASSWORD_REQUEST));
548 
549  /* Pack the domain name */
550  RequestBuffer->DomainName.Length = wcslen(Domain) * sizeof(WCHAR);
551  RequestBuffer->DomainName.MaximumLength = RequestBuffer->DomainName.Length + sizeof(WCHAR);
552  RequestBuffer->DomainName.Buffer = Ptr;
553 
554  RtlCopyMemory(RequestBuffer->DomainName.Buffer,
555  Domain,
556  RequestBuffer->DomainName.MaximumLength);
557 
558  Ptr = (LPWSTR)((ULONG_PTR)Ptr + RequestBuffer->DomainName.MaximumLength);
559 
560  /* Pack the user name */
561  RequestBuffer->AccountName.Length = wcslen(UserName) * sizeof(WCHAR);
562  RequestBuffer->AccountName.MaximumLength = RequestBuffer->AccountName.Length + sizeof(WCHAR);
563  RequestBuffer->AccountName.Buffer = Ptr;
564 
565  RtlCopyMemory(RequestBuffer->AccountName.Buffer,
566  UserName,
567  RequestBuffer->AccountName.MaximumLength);
568 
569  Ptr = (LPWSTR)((ULONG_PTR)Ptr + RequestBuffer->AccountName.MaximumLength);
570 
571  /* Pack the old password */
572  RequestBuffer->OldPassword.Length = wcslen(OldPassword) * sizeof(WCHAR);
573  RequestBuffer->OldPassword.MaximumLength = RequestBuffer->OldPassword.Length + sizeof(WCHAR);
574  RequestBuffer->OldPassword.Buffer = Ptr;
575 
576  RtlCopyMemory(RequestBuffer->OldPassword.Buffer,
577  OldPassword,
578  RequestBuffer->OldPassword.MaximumLength);
579 
580  Ptr = (LPWSTR)((ULONG_PTR)Ptr + RequestBuffer->OldPassword.MaximumLength);
581 
582  /* Pack the new password */
583  RequestBuffer->NewPassword.Length = wcslen(NewPassword1) * sizeof(WCHAR);
584  RequestBuffer->NewPassword.MaximumLength = RequestBuffer->NewPassword.Length + sizeof(WCHAR);
585  RequestBuffer->NewPassword.Buffer = Ptr;
586 
587  RtlCopyMemory(RequestBuffer->NewPassword.Buffer,
588  NewPassword1,
589  RequestBuffer->NewPassword.MaximumLength);
590 
591  /* Connect to the LSA server */
592  if (ConnectToLsa(pgContext) != ERROR_SUCCESS)
593  {
594  ERR("ConnectToLsa() failed\n");
595  goto done;
596  }
597 
598  /* Call the authentication package */
599  Status = LsaCallAuthenticationPackage(pgContext->LsaHandle,
600  pgContext->AuthenticationPackage,
601  RequestBuffer,
602  RequestBufferSize,
603  (PVOID*)&ResponseBuffer,
604  &ResponseBufferSize,
605  &ProtocolStatus);
606  if (!NT_SUCCESS(Status))
607  {
608  ERR("LsaCallAuthenticationPackage failed (Status 0x%08lx)\n", Status);
609  goto done;
610  }
611 
613  {
614  TRACE("LsaCallAuthenticationPackage failed (ProtocolStatus 0x%08lx)\n", ProtocolStatus);
615  goto done;
616  }
617 
618  res = TRUE;
619 
620  ResourceMessageBox(pgContext,
621  hwndDlg,
625 
626  if ((wcscmp(UserName, pgContext->UserName) == 0) &&
627  (wcscmp(Domain, pgContext->DomainName) == 0) &&
628  (wcscmp(OldPassword, pgContext->Password) == 0))
629  {
630  ZeroMemory(pgContext->Password, sizeof(pgContext->Password));
631  wcscpy(pgContext->Password, NewPassword1);
632  }
633 
634 done:
635  if (RequestBuffer != NULL)
636  HeapFree(GetProcessHeap(), 0, RequestBuffer);
637 
638  if (ResponseBuffer != NULL)
639  LsaFreeReturnBuffer(ResponseBuffer);
640 
641  return res;
642 }
643 
644 
645 static INT_PTR CALLBACK
647  IN HWND hwndDlg,
648  IN UINT uMsg,
649  IN WPARAM wParam,
650  IN LPARAM lParam)
651 {
652  PGINA_CONTEXT pgContext;
653 
654  pgContext = (PGINA_CONTEXT)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
655 
656  switch (uMsg)
657  {
658  case WM_INITDIALOG:
659  {
660  pgContext = (PGINA_CONTEXT)lParam;
661  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pgContext);
662 
663  SetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_USERNAME, pgContext->UserName);
664  SendDlgItemMessageW(hwndDlg, IDC_CHANGEPWD_DOMAIN, CB_ADDSTRING, 0, (LPARAM)pgContext->DomainName);
667  return TRUE;
668  }
669 
670  case WM_COMMAND:
671  switch (LOWORD(wParam))
672  {
673  case IDOK:
674  if (DoChangePassword(pgContext, hwndDlg))
675  {
676  EndDialog(hwndDlg, TRUE);
677  }
678  else
679  {
683  }
684  return TRUE;
685 
686  case IDCANCEL:
687  EndDialog(hwndDlg, FALSE);
688  return TRUE;
689  }
690  break;
691 
692  case WM_CLOSE:
693  EndDialog(hwndDlg, FALSE);
694  return TRUE;
695  }
696 
697  return FALSE;
698 }
699 
700 
701 static VOID
703  PGINA_CONTEXT pgContext)
704 {
705  WCHAR Buffer1[256];
706  WCHAR Buffer2[256];
707  WCHAR Buffer3[256];
708  WCHAR Buffer4[512];
709 
710  LoadStringW(pgContext->hDllInstance, IDS_LOGONMSG, Buffer1, _countof(Buffer1));
711 
712  wsprintfW(Buffer2, L"%s\\%s", pgContext->DomainName, pgContext->UserName);
713  wsprintfW(Buffer4, Buffer1, Buffer2);
714 
716 
717  LoadStringW(pgContext->hDllInstance, IDS_LOGONDATE, Buffer1, _countof(Buffer1));
718 
720  (SYSTEMTIME*)&pgContext->LogonTime, NULL, Buffer2, _countof(Buffer2));
721 
723  (SYSTEMTIME*)&pgContext->LogonTime, NULL, Buffer3, _countof(Buffer3));
724 
725  wsprintfW(Buffer4, Buffer1, Buffer2, Buffer3);
726 
728 
729  if (pgContext->bAutoAdminLogon)
731 }
732 
733 
734 static BOOL
736  IN HWND hwnd,
737  IN PGINA_CONTEXT pgContext)
738 {
739  INT res;
740 
741  TRACE("OnChangePassword()\n");
742 
743  res = pgContext->pWlxFuncs->WlxDialogBoxParam(
744  pgContext->hWlx,
745  pgContext->hDllInstance,
747  hwnd,
749  (LPARAM)pgContext);
750 
751  TRACE("Result: %x\n", res);
752 
753  return FALSE;
754 }
755 
756 
757 static INT_PTR CALLBACK
759  IN HWND hwndDlg,
760  IN UINT uMsg,
761  IN WPARAM wParam,
762  IN LPARAM lParam)
763 {
764  switch (uMsg)
765  {
766  case WM_INITDIALOG:
767  return TRUE;
768 
769  case WM_COMMAND:
770  switch (LOWORD(wParam))
771  {
772  case IDYES:
773  EndDialog(hwndDlg, IDYES);
774  return TRUE;
775 
776  case IDNO:
777  EndDialog(hwndDlg, IDNO);
778  return TRUE;
779  }
780  break;
781 
782  case WM_CLOSE:
783  EndDialog(hwndDlg, IDNO);
784  return TRUE;
785  }
786 
787  return FALSE;
788 }
789 
790 
791 static
792 INT
794  IN HWND hwndDlg,
795  IN PGINA_CONTEXT pgContext)
796 {
797  return pgContext->pWlxFuncs->WlxDialogBoxParam(
798  pgContext->hWlx,
799  pgContext->hDllInstance,
801  hwndDlg,
803  (LPARAM)pgContext);
804 }
805 
806 
807 static
808 INT
810  IN HWND hwndDlg,
811  IN PGINA_CONTEXT pgContext)
812 {
813  INT ret;
814  DWORD ShutdownOptions;
815 
816  TRACE("OnShutDown(%p %p)\n", hwndDlg, pgContext);
817 
818  pgContext->nShutdownAction = GetDefaultShutdownSelState();
819  ShutdownOptions = GetDefaultShutdownOptions();
820 
821  if (pgContext->UserToken != NULL)
822  {
823  if (ImpersonateLoggedOnUser(pgContext->UserToken))
824  {
825  pgContext->nShutdownAction = LoadShutdownSelState();
826  ShutdownOptions = GetAllowedShutdownOptions();
827  RevertToSelf();
828  }
829  else
830  {
831  ERR("WL: ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError());
832  }
833  }
834 
835  ret = ShutdownDialog(hwndDlg, ShutdownOptions, pgContext);
836 
837  if (ret == IDOK)
838  {
839  if (pgContext->UserToken != NULL)
840  {
841  if (ImpersonateLoggedOnUser(pgContext->UserToken))
842  {
843  SaveShutdownSelState(pgContext->nShutdownAction);
844  RevertToSelf();
845  }
846  else
847  {
848  ERR("WL: ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError());
849  }
850  }
851  }
852 
853  return ret;
854 }
855 
856 
857 static INT_PTR CALLBACK
859  IN HWND hwndDlg,
860  IN UINT uMsg,
861  IN WPARAM wParam,
862  IN LPARAM lParam)
863 {
864  PGINA_CONTEXT pgContext;
865 
866  pgContext = (PGINA_CONTEXT)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
867 
868  switch (uMsg)
869  {
870  case WM_INITDIALOG:
871  {
872  pgContext = (PGINA_CONTEXT)lParam;
873  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pgContext);
874 
875  SetWelcomeText(hwndDlg);
876 
878  SetFocus(GetDlgItem(hwndDlg, IDNO));
879  return TRUE;
880  }
881 
882  case WM_COMMAND:
883  {
884  switch (LOWORD(wParam))
885  {
886  case IDC_SECURITY_LOCK:
888  return TRUE;
889  case IDC_SECURITY_LOGOFF:
890  if (OnLogOff(hwndDlg, pgContext) == IDYES)
892  return TRUE;
894  if (OnShutDown(hwndDlg, pgContext) == IDOK)
895  EndDialog(hwndDlg, pgContext->nShutdownAction);
896  return TRUE;
898  if (OnChangePassword(hwndDlg, pgContext))
900  return TRUE;
903  return TRUE;
904  case IDCANCEL:
905  EndDialog(hwndDlg, WLX_SAS_ACTION_NONE);
906  return TRUE;
907  }
908  break;
909  }
910  case WM_CLOSE:
911  {
912  EndDialog(hwndDlg, WLX_SAS_ACTION_NONE);
913  return TRUE;
914  }
915  }
916 
917  return FALSE;
918 }
919 
920 static INT
922  IN OUT PGINA_CONTEXT pgContext,
923  IN DWORD dwSasType)
924 {
925  INT result;
926 
927  TRACE("GUILoggedOnSAS()\n");
928 
929  if (dwSasType != WLX_SAS_TYPE_CTRL_ALT_DEL)
930  {
931  /* Nothing to do for WLX_SAS_TYPE_TIMEOUT ; the dialog will
932  * close itself thanks to the use of WlxDialogBoxParam */
933  return WLX_SAS_ACTION_NONE;
934  }
935 
936  pgContext->pWlxFuncs->WlxSwitchDesktopToWinlogon(
937  pgContext->hWlx);
938 
939  result = pgContext->pWlxFuncs->WlxDialogBoxParam(
940  pgContext->hWlx,
941  pgContext->hDllInstance,
945  (LPARAM)pgContext);
946 
949  {
951  }
952 
954  {
955  pgContext->pWlxFuncs->WlxSwitchDesktopToUser(
956  pgContext->hWlx);
957  }
958 
959  return result;
960 }
961 
962 
963 static
964 BOOL
966  IN HWND hwndDlg,
967  IN OUT PGINA_CONTEXT pgContext)
968 {
969  LPWSTR UserName = NULL;
970  LPWSTR Password = NULL;
971  LPWSTR Domain = NULL;
972  BOOL result = FALSE;
974 
975  if (GetTextboxText(hwndDlg, IDC_LOGON_USERNAME, &UserName) && *UserName == '\0')
976  goto done;
977 
978  if (GetTextboxText(hwndDlg, IDC_LOGON_DOMAIN, &Domain) && *Domain == '\0')
979  goto done;
980 
981  if (!GetTextboxText(hwndDlg, IDC_LOGON_PASSWORD, &Password))
982  goto done;
983 
984  Status = DoLoginTasks(pgContext, UserName, Domain, Password, &SubStatus);
986  {
987  ResourceMessageBox(pgContext,
988  hwndDlg,
992  goto done;
993  }
995  {
996  TRACE("DoLoginTasks failed! Status 0x%08lx SubStatus 0x%08lx\n", Status, SubStatus);
997 
999  {
1000  ResourceMessageBox(pgContext,
1001  hwndDlg,
1005  goto done;
1006  }
1008  {
1009  TRACE("Account locked!\n");
1010  ResourceMessageBox(pgContext,
1011  hwndDlg,
1012  MB_OK | MB_ICONERROR,
1015  goto done;
1016  }
1017  else if ((SubStatus == STATUS_PASSWORD_MUST_CHANGE) ||
1019  {
1021  ResourceMessageBox(pgContext,
1022  hwndDlg,
1023  MB_OK | MB_ICONSTOP,
1026  else
1027  ResourceMessageBox(pgContext,
1028  hwndDlg,
1029  MB_OK | MB_ICONSTOP,
1032 
1033  if (!OnChangePassword(hwndDlg,
1034  pgContext))
1035  goto done;
1036 
1037  Status = DoLoginTasks(pgContext,
1038  pgContext->UserName,
1039  pgContext->DomainName,
1040  pgContext->Password,
1041  &SubStatus);
1042  if (!NT_SUCCESS(Status))
1043  {
1044  TRACE("Login after password change failed! (Status 0x%08lx)\n", Status);
1045 
1046  goto done;
1047  }
1048  }
1049  else if (SubStatus == STATUS_ACCOUNT_EXPIRED)
1050  {
1051  ResourceMessageBox(pgContext,
1052  hwndDlg,
1056  }
1058  {
1059  ResourceMessageBox(pgContext,
1060  hwndDlg,
1061  MB_OK | MB_ICONERROR,
1064  goto done;
1065  }
1067  {
1068  ResourceMessageBox(pgContext,
1069  hwndDlg,
1070  MB_OK | MB_ICONERROR,
1073  goto done;
1074  }
1075  else
1076  {
1077  TRACE("Other error!\n");
1078  ResourceMessageBox(pgContext,
1079  hwndDlg,
1080  MB_OK | MB_ICONERROR,
1083  goto done;
1084  }
1085  }
1086  else if (!NT_SUCCESS(Status))
1087  {
1088  TRACE("DoLoginTasks failed! Status 0x%08lx\n", Status);
1089  goto done;
1090  }
1091 
1092  if (!CreateProfile(pgContext, UserName, Domain, Password))
1093  {
1094  ERR("Failed to create the profile!\n");
1095  goto done;
1096  }
1097 
1098  ZeroMemory(pgContext->Password, sizeof(pgContext->Password));
1099  wcscpy(pgContext->Password, Password);
1100 
1101  result = TRUE;
1102 
1103 done:
1104  pgContext->bAutoAdminLogon = FALSE;
1105 
1106  if (UserName != NULL)
1107  HeapFree(GetProcessHeap(), 0, UserName);
1108 
1109  if (Password != NULL)
1111 
1112  if (Domain != NULL)
1113  HeapFree(GetProcessHeap(), 0, Domain);
1114 
1115  return result;
1116 }
1117 
1118 
1119 static
1120 VOID
1122  HWND hwndDomainComboBox,
1123  PGINA_CONTEXT pgContext)
1124 {
1125  WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1126  DWORD dwComputerNameLength;
1127  LONG lIndex = 0;
1128  LONG lFindIndex;
1129 
1130  SendMessageW(hwndDomainComboBox, CB_RESETCONTENT, 0, 0);
1131 
1132  dwComputerNameLength = _countof(szComputerName);
1133  if (GetComputerNameW(szComputerName, &dwComputerNameLength))
1134  {
1135  lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)szComputerName);
1136  }
1137 
1138  if (wcslen(pgContext->DomainName) != 0)
1139  {
1140  lFindIndex = SendMessageW(hwndDomainComboBox, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)pgContext->DomainName);
1141  if (lFindIndex == CB_ERR)
1142  {
1143  lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)pgContext->DomainName);
1144  }
1145  else
1146  {
1147  lIndex = lFindIndex;
1148  }
1149  }
1150 
1151  SendMessageW(hwndDomainComboBox, CB_SETCURSEL, lIndex, 0);
1152 }
1153 
1154 
1155 static INT_PTR CALLBACK
1157  IN HWND hwndDlg,
1158  IN UINT uMsg,
1159  IN WPARAM wParam,
1160  IN LPARAM lParam)
1161 {
1162  PDLG_DATA pDlgData;
1163 
1164  pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1165 
1166  switch (uMsg)
1167  {
1168  case WM_INITDIALOG:
1169  {
1170  /* FIXME: take care of NoDomainUI */
1171  pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
1172  if (pDlgData == NULL)
1173  return FALSE;
1174 
1175  DlgData_LoadBitmaps(pDlgData);
1176 
1177  SetWelcomeText(hwndDlg);
1178 
1179  if (pDlgData->pgContext->bAutoAdminLogon ||
1180  !pDlgData->pgContext->bDontDisplayLastUserName)
1181  SetDlgItemTextW(hwndDlg, IDC_LOGON_USERNAME, pDlgData->pgContext->UserName);
1182 
1183  if (pDlgData->pgContext->bAutoAdminLogon)
1184  SetDlgItemTextW(hwndDlg, IDC_LOGON_PASSWORD, pDlgData->pgContext->Password);
1185 
1187 
1188  if (pDlgData->pgContext->bDisableCAD)
1189  EnableWindow(GetDlgItem(hwndDlg, IDCANCEL), FALSE);
1190 
1191  if (!pDlgData->pgContext->bShutdownWithoutLogon)
1193 
1195 
1196  if (pDlgData->pgContext->bAutoAdminLogon)
1197  PostMessage(GetDlgItem(hwndDlg, IDOK), BM_CLICK, 0, 0);
1198 
1199  return TRUE;
1200  }
1201 
1202  case WM_PAINT:
1203  {
1204  PAINTSTRUCT ps;
1205  if (pDlgData && pDlgData->hLogoBitmap)
1206  {
1207  BeginPaint(hwndDlg, &ps);
1208  DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1209  EndPaint(hwndDlg, &ps);
1210  }
1211  return TRUE;
1212  }
1213 
1214  case WM_DESTROY:
1215  DlgData_Destroy(pDlgData);
1216  return TRUE;
1217 
1218  case WM_COMMAND:
1219  switch (LOWORD(wParam))
1220  {
1221  case IDOK:
1222  if (DoLogon(hwndDlg, pDlgData->pgContext))
1223  EndDialog(hwndDlg, WLX_SAS_ACTION_LOGON);
1224  return TRUE;
1225 
1226  case IDCANCEL:
1227  EndDialog(hwndDlg, WLX_SAS_ACTION_NONE);
1228  return TRUE;
1229 
1230  case IDC_LOGON_SHUTDOWN:
1231  if (OnShutDown(hwndDlg, pDlgData->pgContext) == IDOK)
1232  EndDialog(hwndDlg, pDlgData->pgContext->nShutdownAction);
1233  return TRUE;
1234  }
1235  break;
1236  }
1237 
1238  return FALSE;
1239 }
1240 
1241 
1242 static
1243 INT_PTR
1244 CALLBACK
1246  IN HWND hwndDlg,
1247  IN UINT uMsg,
1248  IN WPARAM wParam,
1249  IN LPARAM lParam)
1250 {
1251  PLEGALNOTICEDATA pLegalNotice;
1252 
1253  switch (uMsg)
1254  {
1255  case WM_INITDIALOG:
1256  pLegalNotice = (PLEGALNOTICEDATA)lParam;
1257  SetWindowTextW(hwndDlg, pLegalNotice->pszCaption);
1258  SetDlgItemTextW(hwndDlg, IDC_LEGALNOTICE_TEXT, pLegalNotice->pszText);
1259  return TRUE;
1260 
1261  case WM_COMMAND:
1262  switch (LOWORD(wParam))
1263  {
1264  case IDOK:
1265  EndDialog(hwndDlg, 0);
1266  return TRUE;
1267 
1268  case IDCANCEL:
1269  EndDialog(hwndDlg, 0);
1270  return TRUE;
1271  }
1272  break;
1273  }
1274 
1275  return FALSE;
1276 }
1277 
1278 
1279 static INT
1281  IN OUT PGINA_CONTEXT pgContext)
1282 {
1283  LEGALNOTICEDATA LegalNotice = {NULL, NULL};
1284  HKEY hKey = NULL;
1285  LONG rc;
1286  int result;
1287 
1288  TRACE("GUILoggedOutSAS()\n");
1289 
1291  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
1292  0,
1294  &hKey);
1295  if (rc == ERROR_SUCCESS)
1296  {
1297  ReadRegSzValue(hKey,
1298  L"LegalNoticeCaption",
1299  &LegalNotice.pszCaption);
1300 
1301  ReadRegSzValue(hKey,
1302  L"LegalNoticeText",
1303  &LegalNotice.pszText);
1304 
1305  RegCloseKey(hKey);
1306  }
1307 
1308  if (LegalNotice.pszCaption != NULL && wcslen(LegalNotice.pszCaption) != 0 &&
1309  LegalNotice.pszText != NULL && wcslen(LegalNotice.pszText) != 0)
1310  {
1311  pgContext->pWlxFuncs->WlxDialogBoxParam(pgContext->hWlx,
1312  pgContext->hDllInstance,
1314  GetDesktopWindow(),
1316  (LPARAM)&LegalNotice);
1317  }
1318 
1319  if (LegalNotice.pszCaption != NULL)
1320  HeapFree(GetProcessHeap(), 0, LegalNotice.pszCaption);
1321 
1322  if (LegalNotice.pszText != NULL)
1323  HeapFree(GetProcessHeap(), 0, LegalNotice.pszText);
1324 
1325  result = pgContext->pWlxFuncs->WlxDialogBoxParam(
1326  pgContext->hWlx,
1327  pgContext->hDllInstance,
1329  GetDesktopWindow(),
1331  (LPARAM)pgContext);
1332  if (result >= WLX_SAS_ACTION_LOGON &&
1334  {
1335  WARN("WlxLoggedOutSAS() returns 0x%x\n", result);
1336  return result;
1337  }
1338 
1339  WARN("WlxDialogBoxParam() failed (0x%x)\n", result);
1340  return WLX_SAS_ACTION_NONE;
1341 }
1342 
1343 
1344 static VOID
1346  INT nDlgItem,
1347  PGINA_CONTEXT pgContext)
1348 {
1349  WCHAR Buffer1[256];
1350  WCHAR Buffer2[256];
1351  WCHAR Buffer3[512];
1352 
1353  LoadStringW(pgContext->hDllInstance, IDS_LOCKMSG, Buffer1, _countof(Buffer1));
1354 
1355  wsprintfW(Buffer2, L"%s\\%s", pgContext->DomainName, pgContext->UserName);
1356  wsprintfW(Buffer3, Buffer1, Buffer2);
1357 
1358  SetDlgItemTextW(hwnd, nDlgItem, Buffer3);
1359 }
1360 
1361 
1362 static
1363 BOOL
1365  IN HWND hwndDlg,
1366  IN PGINA_CONTEXT pgContext,
1367  OUT LPINT Action)
1368 {
1369  WCHAR Buffer1[256];
1370  WCHAR Buffer2[256];
1371  LPWSTR UserName = NULL;
1372  LPWSTR Password = NULL;
1373  BOOL res = FALSE;
1374 
1375  if (GetTextboxText(hwndDlg, IDC_UNLOCK_USERNAME, &UserName) && *UserName == '\0')
1376  {
1377  HeapFree(GetProcessHeap(), 0, UserName);
1378  return FALSE;
1379  }
1380 
1382  {
1383  if (UserName != NULL && Password != NULL &&
1384  wcscmp(UserName, pgContext->UserName) == 0 &&
1385  wcscmp(Password, pgContext->Password) == 0)
1386  {
1388  res = TRUE;
1389  }
1390  else if (wcscmp(UserName, pgContext->UserName) == 0 &&
1391  wcscmp(Password, pgContext->Password) != 0)
1392  {
1393  /* Wrong Password */
1394  LoadStringW(pgContext->hDllInstance, IDS_LOCKEDWRONGPASSWORD, Buffer2, _countof(Buffer2));
1395  LoadStringW(pgContext->hDllInstance, IDS_COMPUTERLOCKED, Buffer1, _countof(Buffer1));
1396  MessageBoxW(hwndDlg, Buffer2, Buffer1, MB_OK | MB_ICONERROR);
1397  }
1398  else
1399  {
1400  /* Wrong user name */
1401  if (DoAdminUnlock(pgContext, UserName, NULL, Password))
1402  {
1404  res = TRUE;
1405  }
1406  else
1407  {
1408  LoadStringW(pgContext->hDllInstance, IDS_LOCKEDWRONGUSER, Buffer1, _countof(Buffer1));
1409  wsprintfW(Buffer2, Buffer1, pgContext->DomainName, pgContext->UserName);
1410  LoadStringW(pgContext->hDllInstance, IDS_COMPUTERLOCKED, Buffer1, _countof(Buffer1));
1411  MessageBoxW(hwndDlg, Buffer2, Buffer1, MB_OK | MB_ICONERROR);
1412  }
1413  }
1414  }
1415 
1416  if (UserName != NULL)
1417  HeapFree(GetProcessHeap(), 0, UserName);
1418 
1419  if (Password != NULL)
1421 
1422  return res;
1423 }
1424 
1425 
1426 static
1427 INT_PTR
1428 CALLBACK
1430  IN HWND hwndDlg,
1431  IN UINT uMsg,
1432  IN WPARAM wParam,
1433  IN LPARAM lParam)
1434 {
1435  PDLG_DATA pDlgData;
1437 
1438  pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1439 
1440  switch (uMsg)
1441  {
1442  case WM_INITDIALOG:
1443  {
1444  pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
1445  if (pDlgData == NULL)
1446  return FALSE;
1447 
1448  SetWelcomeText(hwndDlg);
1449 
1450  SetLockMessage(hwndDlg, IDC_UNLOCK_MESSAGE, pDlgData->pgContext);
1451 
1452  SetDlgItemTextW(hwndDlg, IDC_UNLOCK_USERNAME, pDlgData->pgContext->UserName);
1454 
1455  if (pDlgData->pgContext->bDisableCAD)
1456  EnableWindow(GetDlgItem(hwndDlg, IDCANCEL), FALSE);
1457 
1458  DlgData_LoadBitmaps(pDlgData);
1459  return TRUE;
1460  }
1461 
1462  case WM_PAINT:
1463  {
1464  PAINTSTRUCT ps;
1465  if (pDlgData && pDlgData->hLogoBitmap)
1466  {
1467  BeginPaint(hwndDlg, &ps);
1468  DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1469  EndPaint(hwndDlg, &ps);
1470  }
1471  return TRUE;
1472  }
1473  case WM_DESTROY:
1474  DlgData_Destroy(pDlgData);
1475  return TRUE;
1476 
1477  case WM_COMMAND:
1478  switch (LOWORD(wParam))
1479  {
1480  case IDOK:
1481  if (DoUnlock(hwndDlg, pDlgData->pgContext, &result))
1482  EndDialog(hwndDlg, result);
1483  return TRUE;
1484 
1485  case IDCANCEL:
1486  EndDialog(hwndDlg, WLX_SAS_ACTION_NONE);
1487  return TRUE;
1488  }
1489  break;
1490  }
1491 
1492  return FALSE;
1493 }
1494 
1495 
1496 static INT
1498  IN OUT PGINA_CONTEXT pgContext)
1499 {
1500  int result;
1501 
1502  TRACE("GUILockedSAS()\n");
1503 
1504  result = pgContext->pWlxFuncs->WlxDialogBoxParam(
1505  pgContext->hWlx,
1506  pgContext->hDllInstance,
1508  GetDesktopWindow(),
1510  (LPARAM)pgContext);
1511  if (result >= WLX_SAS_ACTION_LOGON &&
1513  {
1514  WARN("GUILockedSAS() returns 0x%x\n", result);
1515  return result;
1516  }
1517 
1518  WARN("GUILockedSAS() failed (0x%x)\n", result);
1519  return WLX_SAS_ACTION_NONE;
1520 }
1521 
1522 
1523 static INT_PTR CALLBACK
1525  IN HWND hwndDlg,
1526  IN UINT uMsg,
1527  IN WPARAM wParam,
1528  IN LPARAM lParam)
1529 {
1530  PDLG_DATA pDlgData;
1531 
1532  pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1533 
1534  switch (uMsg)
1535  {
1536  case WM_INITDIALOG:
1537  {
1538  pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
1539  if (pDlgData == NULL)
1540  return FALSE;
1541 
1542  DlgData_LoadBitmaps(pDlgData);
1543 
1544  SetWelcomeText(hwndDlg);
1545 
1546  SetLockMessage(hwndDlg, IDC_LOCKED_MESSAGE, pDlgData->pgContext);
1547  return TRUE;
1548  }
1549  case WM_PAINT:
1550  {
1551  PAINTSTRUCT ps;
1552  if (pDlgData && pDlgData->hLogoBitmap)
1553  {
1554  BeginPaint(hwndDlg, &ps);
1555  DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1556  EndPaint(hwndDlg, &ps);
1557  }
1558  return TRUE;
1559  }
1560  case WM_DESTROY:
1561  {
1562  DlgData_Destroy(pDlgData);
1563  return TRUE;
1564  }
1565  }
1566 
1567  return FALSE;
1568 }
1569 
1570 
1571 static VOID
1573  IN OUT PGINA_CONTEXT pgContext)
1574 {
1575  TRACE("GUIdisplayLockedNotice()\n");
1576 
1577  pgContext->pWlxFuncs->WlxDialogBoxParam(
1578  pgContext->hWlx,
1579  pgContext->hDllInstance,
1581  GetDesktopWindow(),
1583  (LPARAM)pgContext);
1584 }
1585 
1587  GUIInitialize,
1593  GUILockedSAS,
1595 };
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:39
static INT GUILockedSAS(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1497
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2265
#define WLX_SAS_ACTION_LOCK_WKSTA
Definition: winwlx.h:55
static VOID SetLockMessage(HWND hwnd, INT nDlgItem, PGINA_CONTEXT pgContext)
Definition: gui.c:1345
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:406
#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:35
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:1364
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
DWORD BarWidth
Definition: gui.c:40
#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:1245
BOOL WINAPI RevertToSelf(VOID)
Definition: security.c:1487
uint16_t * PWSTR
Definition: typedefs.h:55
static VOID OnInitSecurityDlg(HWND hwnd, PGINA_CONTEXT pgContext)
Definition: gui.c:702
BOOL bDontDisplayLastUserName
Definition: msgina.h:43
#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:18
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:19
static INT OnShutDown(IN HWND hwndDlg, IN PGINA_CONTEXT pgContext)
Definition: gui.c:809
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:1648
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:4804
uint16_t * PWCHAR
Definition: typedefs.h:55
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:443
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
int32_t INT_PTR
Definition: typedefs.h:63
static BOOL OnChangePassword(IN HWND hwnd, IN PGINA_CONTEXT pgContext)
Definition: gui.c:735
static INT GUILoggedOutSAS(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1280
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:405
int32_t INT
Definition: typedefs.h:57
static INT ResourceMessageBox(IN PGINA_CONTEXT pgContext, IN HWND hwnd, IN UINT uType, IN UINT uCaption, IN UINT uText)
Definition: gui.c:468
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
UNICODE_STRING AccountName
Definition: ntsecapi.h:513
#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:64
#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:858
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:20
#define IDC_CHANGEPWD_USERNAME
Definition: resource.h:35
GINA_UI GinaGraphicalUI
Definition: gui.c:1586
#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
DWORD LogoHeight
Definition: gui.c:39
#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:646
#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:656
LPWSTR pszCaption
Definition: gui.c:27
#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:296
#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:921
DWORD BarCounter
Definition: gui.c:37
#define PostMessage
Definition: winuser.h:5807
static BOOL DoChangePassword(IN PGINA_CONTEXT pgContext, IN HWND hwndDlg)
Definition: gui.c:491
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:1429
#define BM_CLICK
Definition: winuser.h:1899
#define STATUS_ACCOUNT_DISABLED
Definition: ntstatus.h:336
PWSTR pMessage
Definition: gui.c:21
#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:92
#define GetProcessHeap()
Definition: compat.h:403
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)
static void DlgData_Destroy(PDLG_DATA pDlgData)
Definition: gui.c:81
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define STATUS_PASSWORD_EXPIRED
Definition: ntstatus.h:335
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL bShutdownWithoutLogon
Definition: msgina.h:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define _countof(array)
Definition: sndvol32.h:68
#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:162
#define WM_CLOSE
Definition: winuser.h:1603
UNICODE_STRING NewPassword
Definition: ntsecapi.h:515
static INT_PTR CALLBACK LogonDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:1156
#define IDS_INVALIDLOGONHOURS
Definition: resource.h:93
int WINAPI GetWindowTextLengthW(_In_ HWND)
#define WINAPI
Definition: msvc.h:6
#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:1121
#define IDC_UNLOCK_PASSWORD
Definition: resource.h:32
#define IDC_STATUS_MESSAGE
Definition: resource.h:6
DWORD BarHeight
Definition: gui.c:41
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:4467
#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:33
static BOOL DoLogon(IN HWND hwndDlg, IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:965
#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:257
#define CB_SETCURSEL
Definition: winuser.h:1943
#define WM_COMMAND
Definition: winuser.h:1722
Definition: gui.c:31
#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:758
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:36
static PDLG_DATA DlgData_Create(HWND hwndDlg, PGINA_CONTEXT pgContext)
Definition: gui.c:45
#define IDC_UNLOCK_MESSAGE
Definition: resource.h:30
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
BOOL WINAPI DeleteDC(_In_ HDC)
static BOOL GUIRemoveStatusMessage(IN PGINA_CONTEXT pgContext)
Definition: gui.c:371
#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:1524
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType
Definition: ntsecapi.h:511
HANDLE StartupEvent
Definition: gui.c:22
__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:5832
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:384
#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
DWORD LogoWidth
Definition: gui.c:38
#define IDS_LOGONUSERDISABLED
Definition: resource.h:88
static BOOL GetTextboxText(IN HWND hwndDlg, IN INT TextboxId, OUT LPWSTR *pText)
Definition: gui.c:444
#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:28
#define IDS_COMPUTERLOCKED
Definition: resource.h:80
NTSTATUS NTAPI LsaFreeReturnBuffer(PVOID)
#define DST_BITMAP
Definition: winuser.h:516
#define OUT
Definition: typedefs.h:40
UNICODE_STRING OldPassword
Definition: ntsecapi.h:514
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:427
static VOID GUIDisplayLockedNotice(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1572
unsigned int ULONG
Definition: retypes.h:1
#define GetWindowTextLength
Definition: winuser.h:5774
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:101
#define SetWindowLongPtrW
Definition: winuser.h:5321
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
WCHAR Password[256]
Definition: msgina.h:52
#define INFINITE
Definition: serial.h:102
BOOL bDisableCAD
Definition: msgina.h:41
static BOOL DlgData_LoadBitmaps(PDLG_DATA pDlgData)
Definition: gui.c:57
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
return STATUS_SUCCESS
Definition: btrfs.c:2938
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:17
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:402
#define SRCCOPY
Definition: wingdi.h:332
HBITMAP hLogoBitmap
Definition: gui.c:34
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:793
#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