ReactOS 0.4.16-dev-1305-ge26ad0d
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#include <ndk/exfuncs.h>
15#include <ndk/setypes.h>
16
17typedef struct _DISPLAYSTATUSMSG
18{
20 HDESK hDesktop;
26
27typedef struct _LEGALNOTICEDATA
28{
32
33// Timer ID for the animated dialog bar.
34#define IDT_BAR 1
35
36#define ISKEYDOWN(x) (GetKeyState(x) & 0x8000)
37
38typedef struct _DLG_DATA
39{
50
51static PDLG_DATA
53{
54 PDLG_DATA pDlgData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pDlgData));
55 if (pDlgData)
56 {
57 pDlgData->pgContext = pgContext;
58 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pDlgData);
59 }
60 return pDlgData;
61}
62
63static VOID
65{
66 BITMAP bm;
67
68 if (!pDlgData)
69 {
70 return;
71 }
72
73 pDlgData->hLogoBitmap = LoadImageW(pDlgData->pgContext->hDllInstance,
75 0, 0, LR_DEFAULTCOLOR);
76 if (pDlgData->hLogoBitmap)
77 {
78 GetObject(pDlgData->hLogoBitmap, sizeof(bm), &bm);
79 pDlgData->LogoWidth = bm.bmWidth;
80 pDlgData->LogoHeight = bm.bmHeight;
81 }
82
83 pDlgData->hBarBitmap = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_BAR),
85 if (pDlgData->hBarBitmap)
86 {
87 GetObject(pDlgData->hBarBitmap, sizeof(bm), &bm);
88 pDlgData->BarWidth = bm.bmWidth;
89 pDlgData->BarHeight = bm.bmHeight;
90 }
91}
92
93static VOID
95{
96 PDLG_DATA pDlgData;
97
98 pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
99 if (!pDlgData)
100 {
101 return;
102 }
103
105
106 if (pDlgData->hBarBitmap)
107 {
108 DeleteObject(pDlgData->hBarBitmap);
109 }
110
111 if (pDlgData->hLogoBitmap)
112 {
113 DeleteObject(pDlgData->hLogoBitmap);
114 }
115
116 HeapFree(GetProcessHeap(), 0, pDlgData);
117}
118
119static BOOL
121 IN OUT PGINA_CONTEXT pgContext)
122{
123 TRACE("GUIInitialize(%p)\n", pgContext);
124 return TRUE;
125}
126
127static
128VOID
130{
131 PWCHAR pBuffer = NULL, p;
132 HKEY hKey;
133 DWORD BufSize, dwType, dwWelcomeSize, dwTitleLength;
134 LONG rc;
135
136 TRACE("SetWelcomeText(%p)\n", hWnd);
137
138 /* Open the Winlogon key */
140 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
141 0,
143 &hKey);
144 if (rc != ERROR_SUCCESS)
145 {
146 WARN("RegOpenKeyExW() failed with error %lu\n", rc);
147 return;
148 }
149
150 /* Get the size of the Welcome value */
151 dwWelcomeSize = 0;
153 L"Welcome",
154 NULL,
155 &dwType,
156 NULL,
157 &dwWelcomeSize);
158 if (rc == ERROR_FILE_NOT_FOUND || dwWelcomeSize == 0 || dwType != REG_SZ)
159 goto done;
160
161 dwTitleLength = GetWindowTextLengthW(hWnd);
162 BufSize = dwWelcomeSize + ((dwTitleLength + 1) * sizeof(WCHAR));
163
165 if (pBuffer == NULL)
166 goto done;
167
169 wcscat(pBuffer, L" ");
170 p = &pBuffer[dwTitleLength + 1];
171
173 L"Welcome",
174 NULL,
175 &dwType,
176 (PBYTE)p,
177 &dwWelcomeSize);
178
180
181done:
182 if (pBuffer != NULL)
184
186}
187
188static VOID
190{
191 INT xOld, yOld, cxOld, cyOld;
192 INT xNew, yNew, cxNew, cyNew;
193 INT cxLabel, cyLabel, dyLabel;
194 RECT rc, rcBar, rcLabel, rcWnd;
195 BITMAP bmLogo, bmBar;
196 DWORD style, exstyle;
197 HWND hwndLogo = GetDlgItem(hwndDlg, IDC_ROSLOGO);
198 HWND hwndBar = GetDlgItem(hwndDlg, IDC_BAR);
199 HWND hwndLabel = GetDlgItem(hwndDlg, IDC_STATUS_MESSAGE);
200
201 /* This adjustment is for CJK only */
203 {
204 case LANG_CHINESE:
205 case LANG_JAPANESE:
206 case LANG_KOREAN:
207 break;
208
209 default:
210 return;
211 }
212
213 if (!GetObjectW(pDlgData->hLogoBitmap, sizeof(BITMAP), &bmLogo) ||
214 !GetObjectW(pDlgData->hBarBitmap, sizeof(BITMAP), &bmBar))
215 {
216 return;
217 }
218
219 GetWindowRect(hwndBar, &rcBar);
220 MapWindowPoints(NULL, hwndDlg, (LPPOINT)&rcBar, 2);
221 dyLabel = bmLogo.bmHeight - rcBar.top;
222
223 GetWindowRect(hwndLabel, &rcLabel);
224 MapWindowPoints(NULL, hwndDlg, (LPPOINT)&rcLabel, 2);
225 cxLabel = rcLabel.right - rcLabel.left;
226 cyLabel = rcLabel.bottom - rcLabel.top;
227
228 MoveWindow(hwndLogo, 0, 0, bmLogo.bmWidth, bmLogo.bmHeight, TRUE);
229 MoveWindow(hwndBar, 0, bmLogo.bmHeight, bmLogo.bmWidth, bmBar.bmHeight, TRUE);
230 MoveWindow(hwndLabel, rcLabel.left, rcLabel.top + dyLabel, cxLabel, cyLabel, TRUE);
231
232 GetWindowRect(hwndDlg, &rcWnd);
233 xOld = rcWnd.left;
234 yOld = rcWnd.top;
235 cxOld = rcWnd.right - rcWnd.left;
236 cyOld = rcWnd.bottom - rcWnd.top;
237
238 GetClientRect(hwndDlg, &rc);
239 SetRect(&rc, 0, 0, bmLogo.bmWidth, rc.bottom - rc.top); /* new client size */
240
242 exstyle = (DWORD)GetWindowLongPtrW(hwndDlg, GWL_EXSTYLE);
243 AdjustWindowRectEx(&rc, style, FALSE, exstyle);
244
245 cxNew = rc.right - rc.left;
246 cyNew = (rc.bottom - rc.top) + dyLabel;
247 xNew = xOld - (cxNew - cxOld) / 2;
248 yNew = yOld - (cyNew - cyOld) / 2;
249 MoveWindow(hwndDlg, xNew, yNew, cxNew, cyNew, TRUE);
250}
251
252static INT_PTR CALLBACK
254 IN HWND hwndDlg,
255 IN UINT uMsg,
258{
259 PDLG_DATA pDlgData;
261
262 pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
263
264 switch (uMsg)
265 {
266 case WM_INITDIALOG:
267 {
269 if (!msg)
270 return FALSE;
271
272 msg->Context->hStatusWindow = hwndDlg;
273
274 if (msg->pTitle)
275 SetWindowTextW(hwndDlg, msg->pTitle);
276 SetDlgItemTextW(hwndDlg, IDC_STATUS_MESSAGE, msg->pMessage);
277 SetEvent(msg->StartupEvent);
278
279 pDlgData = DlgData_Create(hwndDlg, msg->Context);
280 if (pDlgData == NULL)
281 return FALSE;
282
283 DlgData_LoadBitmaps(pDlgData);
284 if (pDlgData->hBarBitmap)
285 {
286 if (SetTimer(hwndDlg, IDT_BAR, 20, NULL) == 0)
287 {
288 ERR("SetTimer(IDT_BAR) failed: %d\n", GetLastError());
289 }
290 else
291 {
292 /* Get the animation bar control */
293 pDlgData->hWndBarCtrl = GetDlgItem(hwndDlg, IDC_BAR);
294 }
295 }
296
297 AdjustStatusMessageWindow(hwndDlg, pDlgData);
298 return TRUE;
299 }
300
301 case WM_TIMER:
302 {
303 if (pDlgData && pDlgData->hBarBitmap)
304 {
305 /*
306 * Default rotation bar image width is 413 (same as logo)
307 * We can divide 413 by 7 without remainder
308 */
309 pDlgData->BarCounter = (pDlgData->BarCounter + 7) % pDlgData->BarWidth;
311 UpdateWindow(pDlgData->hWndBarCtrl);
312 }
313 return TRUE;
314 }
315
316 case WM_DRAWITEM:
317 {
319
320 if (lpDis->CtlID != IDC_BAR)
321 {
322 return FALSE;
323 }
324
325 if (pDlgData && pDlgData->hBarBitmap)
326 {
327 HDC hdcMem;
328 HGDIOBJ hOld;
329 DWORD off = pDlgData->BarCounter;
330 DWORD iw = pDlgData->BarWidth;
331 DWORD ih = pDlgData->BarHeight;
332
333 hdcMem = CreateCompatibleDC(lpDis->hDC);
334 hOld = SelectObject(hdcMem, pDlgData->hBarBitmap);
335 BitBlt(lpDis->hDC, off, 0, iw - off, ih, hdcMem, 0, 0, SRCCOPY);
336 BitBlt(lpDis->hDC, 0, 0, off, ih, hdcMem, iw - off, 0, SRCCOPY);
337 SelectObject(hdcMem, hOld);
339
340 return TRUE;
341 }
342 return FALSE;
343 }
344
345 case WM_DESTROY:
346 {
347 if (pDlgData && pDlgData->hBarBitmap)
348 {
349 KillTimer(hwndDlg, IDT_BAR);
350 }
351 DlgData_Destroy(hwndDlg);
352 return TRUE;
353 }
354 }
355 return FALSE;
356}
357
358static DWORD WINAPI
360{
361 HDESK hDesk;
363
364 /* When SetThreadDesktop is called the system closes the desktop handle when needed
365 so we have to create a new handle because this handle may still be in use by winlogon */
367 msg->hDesktop,
369 (HANDLE*)&hDesk,
370 0,
371 FALSE,
373 {
374 ERR("Duplicating handle failed!\n");
375 HeapFree(GetProcessHeap(), 0, lpParam);
376 return FALSE;
377 }
378
379 if(!SetThreadDesktop(hDesk))
380 {
381 ERR("Setting thread desktop failed!\n");
382 HeapFree(GetProcessHeap(), 0, lpParam);
383 return FALSE;
384 }
385
391 (LPARAM)lpParam);
392
393 HeapFree(GetProcessHeap(), 0, lpParam);
394 return TRUE;
395}
396
397static BOOL
399 IN PGINA_CONTEXT pgContext,
400 IN HDESK hDesktop,
402 IN PWSTR pTitle,
403 IN PWSTR pMessage)
404{
407 DWORD ThreadId;
408
409 TRACE("GUIDisplayStatusMessage(%ws)\n", pMessage);
410
411 if (!pgContext->hStatusWindow)
412 {
413 /*
414 * If everything goes correctly, 'msg' is freed
415 * by the 'StartupWindowThread' thread.
416 */
419 sizeof(*msg));
420 if(!msg)
421 return FALSE;
422
423 msg->Context = pgContext;
424 msg->dwOptions = dwOptions;
425 msg->pTitle = pTitle;
426 msg->pMessage = pMessage;
427 msg->hDesktop = hDesktop;
428
429 msg->StartupEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
430
431 if (!msg->StartupEvent)
432 {
434 return FALSE;
435 }
436
438 0,
440 (PVOID)msg,
441 0,
442 &ThreadId);
443 if (Thread)
444 {
445 /* 'msg' will be freed by 'StartupWindowThread' */
446
448 WaitForSingleObject(msg->StartupEvent, INFINITE);
449 CloseHandle(msg->StartupEvent);
450 return TRUE;
451 }
452 else
453 {
454 /*
455 * The 'StartupWindowThread' thread couldn't be created,
456 * so we need to free the allocated 'msg'.
457 */
459 }
460
461 return FALSE;
462 }
463
464 if (pTitle)
465 SetWindowTextW(pgContext->hStatusWindow, pTitle);
466
467 SetDlgItemTextW(pgContext->hStatusWindow, IDC_STATUS_MESSAGE, pMessage);
468
469 return TRUE;
470}
471
472static BOOL
474 IN PGINA_CONTEXT pgContext)
475{
476 if (pgContext->hStatusWindow)
477 {
478 EndDialog(pgContext->hStatusWindow, 0);
479 pgContext->hStatusWindow = NULL;
480 }
481
482 return TRUE;
483}
484
485static INT_PTR CALLBACK
487 IN HWND hwndDlg,
488 IN UINT uMsg,
491{
492 PDLG_DATA pDlgData;
493
494 pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
495
496 switch (uMsg)
497 {
498 case WM_INITDIALOG:
499 {
500 pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
501 if (pDlgData == NULL)
502 return FALSE;
503
504 DlgData_LoadBitmaps(pDlgData);
505 return TRUE;
506 }
507
508 case WM_PAINT:
509 {
510 PAINTSTRUCT ps;
511 if (pDlgData && pDlgData->hLogoBitmap)
512 {
513 BeginPaint(hwndDlg, &ps);
514 DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
515 EndPaint(hwndDlg, &ps);
516 }
517 return TRUE;
518 }
519 case WM_DESTROY:
520 {
521 DlgData_Destroy(hwndDlg);
522 return TRUE;
523 }
524 }
525 return FALSE;
526}
527
528static VOID
530 IN OUT PGINA_CONTEXT pgContext)
531{
532 TRACE("GUIDisplaySASNotice()\n");
533
534 /* Display the notice window */
535 pgContext->pWlxFuncs->WlxDialogBoxParam(pgContext->hWlx,
536 pgContext->hDllInstance,
540 (LPARAM)pgContext);
541}
542
543/* Get the text contained in a textbox. Allocates memory in pText
544 * to contain the text. Returns TRUE in case of success */
545static BOOL
547 IN HWND hwndDlg,
548 IN INT TextboxId,
550{
551 LPWSTR Text;
552 int Count;
553
554 Count = GetWindowTextLength(GetDlgItem(hwndDlg, TextboxId));
555 Text = HeapAlloc(GetProcessHeap(), 0, (Count + 1) * sizeof(WCHAR));
556 if (!Text)
557 return FALSE;
558 if (Count != GetWindowTextW(GetDlgItem(hwndDlg, TextboxId), Text, Count + 1))
559 {
561 return FALSE;
562 }
563 *pText = Text;
564 return TRUE;
565}
566
567
568static
569INT
571 IN PGINA_CONTEXT pgContext,
572 IN HWND hwnd,
573 IN UINT uType,
574 IN UINT uCaption,
575 IN UINT uText)
576{
577 WCHAR szCaption[256];
578 WCHAR szText[256];
579
580 LoadStringW(pgContext->hDllInstance, uCaption, szCaption, _countof(szCaption));
581 LoadStringW(pgContext->hDllInstance, uText, szText, _countof(szText));
582
583 return pgContext->pWlxFuncs->WlxMessageBox(pgContext->hWlx,
584 hwnd,
585 szText,
586 szCaption,
587 uType);
588}
589
590
591static
592BOOL
594 IN PGINA_CONTEXT pgContext,
595 IN HWND hwndDlg)
596{
597 WCHAR UserName[256];
598 WCHAR Domain[256];
599 WCHAR OldPassword[256];
600 WCHAR NewPassword1[256];
601 WCHAR NewPassword2[256];
602 PMSV1_0_CHANGEPASSWORD_REQUEST RequestBuffer = NULL;
603 PMSV1_0_CHANGEPASSWORD_RESPONSE ResponseBuffer = NULL;
604 ULONG RequestBufferSize;
605 ULONG ResponseBufferSize = 0;
606 LPWSTR Ptr;
607 BOOL res = FALSE;
610
611 GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_USERNAME, UserName, _countof(UserName));
612 GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_DOMAIN, Domain, _countof(Domain));
613 GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_OLDPWD, OldPassword, _countof(OldPassword));
614 GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_NEWPWD1, NewPassword1, _countof(NewPassword1));
615 GetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_NEWPWD2, NewPassword2, _countof(NewPassword2));
616
617 /* Compare the two passwords and fail if they do not match */
618 if (wcscmp(NewPassword1, NewPassword2) != 0)
619 {
620 ResourceMessageBox(pgContext,
621 hwndDlg,
625 return FALSE;
626 }
627
628 /* Calculate the request buffer size */
629 RequestBufferSize = sizeof(MSV1_0_CHANGEPASSWORD_REQUEST) +
630 ((wcslen(Domain) + 1) * sizeof(WCHAR)) +
631 ((wcslen(UserName) + 1) * sizeof(WCHAR)) +
632 ((wcslen(OldPassword) + 1) * sizeof(WCHAR)) +
633 ((wcslen(NewPassword1) + 1) * sizeof(WCHAR));
634
635 /* Allocate the request buffer */
636 RequestBuffer = HeapAlloc(GetProcessHeap(),
638 RequestBufferSize);
639 if (RequestBuffer == NULL)
640 {
641 ERR("HeapAlloc failed\n");
642 return FALSE;
643 }
644
645 /* Initialize the request buffer */
646 RequestBuffer->MessageType = MsV1_0ChangePassword;
647 RequestBuffer->Impersonating = TRUE;
648
649 Ptr = (LPWSTR)((ULONG_PTR)RequestBuffer + sizeof(MSV1_0_CHANGEPASSWORD_REQUEST));
650
651 /* Pack the domain name */
652 RequestBuffer->DomainName.Length = (USHORT)wcslen(Domain) * sizeof(WCHAR);
653 RequestBuffer->DomainName.MaximumLength = RequestBuffer->DomainName.Length + sizeof(WCHAR);
654 RequestBuffer->DomainName.Buffer = Ptr;
655
656 RtlCopyMemory(RequestBuffer->DomainName.Buffer,
657 Domain,
658 RequestBuffer->DomainName.MaximumLength);
659
660 Ptr = (LPWSTR)((ULONG_PTR)Ptr + RequestBuffer->DomainName.MaximumLength);
661
662 /* Pack the user name */
663 RequestBuffer->AccountName.Length = (USHORT)wcslen(UserName) * sizeof(WCHAR);
664 RequestBuffer->AccountName.MaximumLength = RequestBuffer->AccountName.Length + sizeof(WCHAR);
665 RequestBuffer->AccountName.Buffer = Ptr;
666
667 RtlCopyMemory(RequestBuffer->AccountName.Buffer,
668 UserName,
669 RequestBuffer->AccountName.MaximumLength);
670
671 Ptr = (LPWSTR)((ULONG_PTR)Ptr + RequestBuffer->AccountName.MaximumLength);
672
673 /* Pack the old password */
674 RequestBuffer->OldPassword.Length = (USHORT)wcslen(OldPassword) * sizeof(WCHAR);
675 RequestBuffer->OldPassword.MaximumLength = RequestBuffer->OldPassword.Length + sizeof(WCHAR);
676 RequestBuffer->OldPassword.Buffer = Ptr;
677
678 RtlCopyMemory(RequestBuffer->OldPassword.Buffer,
679 OldPassword,
680 RequestBuffer->OldPassword.MaximumLength);
681
682 Ptr = (LPWSTR)((ULONG_PTR)Ptr + RequestBuffer->OldPassword.MaximumLength);
683
684 /* Pack the new password */
685 RequestBuffer->NewPassword.Length = (USHORT)wcslen(NewPassword1) * sizeof(WCHAR);
686 RequestBuffer->NewPassword.MaximumLength = RequestBuffer->NewPassword.Length + sizeof(WCHAR);
687 RequestBuffer->NewPassword.Buffer = Ptr;
688
689 RtlCopyMemory(RequestBuffer->NewPassword.Buffer,
690 NewPassword1,
691 RequestBuffer->NewPassword.MaximumLength);
692
693 /* Connect to the LSA server */
694 if (ConnectToLsa(pgContext) != ERROR_SUCCESS)
695 {
696 ERR("ConnectToLsa() failed\n");
697 goto done;
698 }
699
700 /* Call the authentication package */
701 Status = LsaCallAuthenticationPackage(pgContext->LsaHandle,
702 pgContext->AuthenticationPackage,
703 RequestBuffer,
704 RequestBufferSize,
705 (PVOID*)&ResponseBuffer,
706 &ResponseBufferSize,
708 if (!NT_SUCCESS(Status))
709 {
710 ERR("LsaCallAuthenticationPackage failed (Status 0x%08lx)\n", Status);
711 goto done;
712 }
713
715 {
716 TRACE("LsaCallAuthenticationPackage failed (ProtocolStatus 0x%08lx)\n", ProtocolStatus);
717 goto done;
718 }
719
720 res = TRUE;
721
722 ResourceMessageBox(pgContext,
723 hwndDlg,
727
728 if ((wcscmp(UserName, pgContext->UserName) == 0) &&
729 (wcscmp(Domain, pgContext->DomainName) == 0) &&
730 (wcscmp(OldPassword, pgContext->Password) == 0))
731 {
732 ZeroMemory(pgContext->Password, sizeof(pgContext->Password));
733 wcscpy(pgContext->Password, NewPassword1);
734 }
735
736done:
737 if (RequestBuffer != NULL)
738 HeapFree(GetProcessHeap(), 0, RequestBuffer);
739
740 if (ResponseBuffer != NULL)
741 LsaFreeReturnBuffer(ResponseBuffer);
742
743 return res;
744}
745
746
747static INT_PTR CALLBACK
749 IN HWND hwndDlg,
750 IN UINT uMsg,
753{
754 PGINA_CONTEXT pgContext;
755
756 pgContext = (PGINA_CONTEXT)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
757
758 switch (uMsg)
759 {
760 case WM_INITDIALOG:
761 {
762 pgContext = (PGINA_CONTEXT)lParam;
763 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pgContext);
764
765 SetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_USERNAME, pgContext->UserName);
766 SendDlgItemMessageW(hwndDlg, IDC_CHANGEPWD_DOMAIN, CB_ADDSTRING, 0, (LPARAM)pgContext->DomainName);
769 return TRUE;
770 }
771
772 case WM_COMMAND:
773 switch (LOWORD(wParam))
774 {
775 case IDOK:
776 if (DoChangePassword(pgContext, hwndDlg))
777 {
778 EndDialog(hwndDlg, TRUE);
779 }
780 else
781 {
785 }
786 return TRUE;
787
788 case IDCANCEL:
789 EndDialog(hwndDlg, FALSE);
790 return TRUE;
791 }
792 break;
793
794 case WM_CLOSE:
795 EndDialog(hwndDlg, FALSE);
796 return TRUE;
797 }
798
799 return FALSE;
800}
801
802
803static VOID
805 PGINA_CONTEXT pgContext)
806{
807 WCHAR Buffer1[256];
808 WCHAR Buffer2[256];
809 WCHAR Buffer3[256];
810 WCHAR Buffer4[512];
811
812 LoadStringW(pgContext->hDllInstance, IDS_LOGONMSG, Buffer1, _countof(Buffer1));
813
814 wsprintfW(Buffer2, L"%s\\%s", pgContext->DomainName, pgContext->UserName);
815 wsprintfW(Buffer4, Buffer1, Buffer2);
816
818
819 LoadStringW(pgContext->hDllInstance, IDS_LOGONDATE, Buffer1, _countof(Buffer1));
820
822 (SYSTEMTIME*)&pgContext->LogonTime, NULL, Buffer2, _countof(Buffer2));
823
825 (SYSTEMTIME*)&pgContext->LogonTime, NULL, Buffer3, _countof(Buffer3));
826
827 wsprintfW(Buffer4, Buffer1, Buffer2, Buffer3);
828
830
831 if (pgContext->bAutoAdminLogon)
833}
834
835
836static BOOL
838 IN HWND hwnd,
839 IN PGINA_CONTEXT pgContext)
840{
841 INT res;
842
843 TRACE("OnChangePassword()\n");
844
845 res = pgContext->pWlxFuncs->WlxDialogBoxParam(
846 pgContext->hWlx,
847 pgContext->hDllInstance,
849 hwnd,
851 (LPARAM)pgContext);
852
853 TRACE("Result: %x\n", res);
854
855 return FALSE;
856}
857
858
859static INT_PTR CALLBACK
861 IN HWND hwndDlg,
862 IN UINT uMsg,
865{
866 switch (uMsg)
867 {
868 case WM_INITDIALOG:
869 return TRUE;
870
871 case WM_COMMAND:
872 switch (LOWORD(wParam))
873 {
874 case IDYES:
875 EndDialog(hwndDlg, IDYES);
876 return TRUE;
877
878 case IDNO:
879 EndDialog(hwndDlg, IDNO);
880 return TRUE;
881 }
882 break;
883
884 case WM_CLOSE:
885 EndDialog(hwndDlg, IDNO);
886 return TRUE;
887 }
888
889 return FALSE;
890}
891
892
893static
894INT
896 IN HWND hwndDlg,
897 IN PGINA_CONTEXT pgContext)
898{
899 return pgContext->pWlxFuncs->WlxDialogBoxParam(
900 pgContext->hWlx,
901 pgContext->hDllInstance,
903 hwndDlg,
905 (LPARAM)pgContext);
906}
907
908
909static
910INT
912 IN HWND hwndDlg,
913 IN PGINA_CONTEXT pgContext)
914{
915 INT ret;
916 DWORD ShutdownOptions;
917
918 TRACE("OnShutDown(%p %p)\n", hwndDlg, pgContext);
919
920 pgContext->nShutdownAction = GetDefaultShutdownSelState();
921 ShutdownOptions = GetDefaultShutdownOptions();
922
923 if (pgContext->UserToken != NULL)
924 {
925 if (ImpersonateLoggedOnUser(pgContext->UserToken))
926 {
927 pgContext->nShutdownAction = LoadShutdownSelState();
928 ShutdownOptions = GetAllowedShutdownOptions();
929 RevertToSelf();
930 }
931 else
932 {
933 ERR("WL: ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError());
934 }
935 }
936
937 ret = ShutdownDialog(hwndDlg, ShutdownOptions, pgContext);
938
939 if (ret == IDOK)
940 {
941 if (pgContext->UserToken != NULL)
942 {
943 if (ImpersonateLoggedOnUser(pgContext->UserToken))
944 {
945 SaveShutdownSelState(pgContext->nShutdownAction);
946 RevertToSelf();
947 }
948 else
949 {
950 ERR("WL: ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError());
951 }
952 }
953 }
954
955 return ret;
956}
957
958
959static INT_PTR CALLBACK
961 IN HWND hwndDlg,
962 IN UINT uMsg,
965{
966 PGINA_CONTEXT pgContext;
967
968 pgContext = (PGINA_CONTEXT)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
969
970 switch (uMsg)
971 {
972 case WM_INITDIALOG:
973 {
974 pgContext = (PGINA_CONTEXT)lParam;
975 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pgContext);
976
977 SetWelcomeText(hwndDlg);
978
980 SetFocus(GetDlgItem(hwndDlg, IDNO));
981 return TRUE;
982 }
983
984 case WM_COMMAND:
985 {
986 switch (LOWORD(wParam))
987 {
990 return TRUE;
993 {
994 if (ResourceMessageBox(pgContext,
995 hwndDlg,
999 {
1001 }
1002 }
1003 else if (OnLogOff(hwndDlg, pgContext) == IDYES)
1004 {
1006 }
1007 return TRUE;
1009 /* Emergency restart feature */
1010 if (ISKEYDOWN(VK_CONTROL))
1011 {
1012 if (ResourceMessageBox(pgContext,
1013 hwndDlg,
1017 {
1018 BOOLEAN Old;
1019
1020 ERR("Emergency restarting NT...\n");
1024 }
1025 }
1026 else if (OnShutDown(hwndDlg, pgContext) == IDOK)
1027 {
1028 EndDialog(hwndDlg, pgContext->nShutdownAction);
1029 }
1030 return TRUE;
1032 if (OnChangePassword(hwndDlg, pgContext))
1034 return TRUE;
1037 return TRUE;
1038 case IDCANCEL:
1040 return TRUE;
1041 }
1042 break;
1043 }
1044 case WM_CLOSE:
1045 {
1047 return TRUE;
1048 }
1049 }
1050
1051 return FALSE;
1052}
1053
1054static INT
1056 IN OUT PGINA_CONTEXT pgContext,
1057 IN DWORD dwSasType)
1058{
1059 INT result;
1060
1061 TRACE("GUILoggedOnSAS()\n");
1062
1063 if (dwSasType != WLX_SAS_TYPE_CTRL_ALT_DEL)
1064 {
1065 /* Nothing to do for WLX_SAS_TYPE_TIMEOUT; the dialog will
1066 * close itself thanks to the use of WlxDialogBoxParam */
1067 return WLX_SAS_ACTION_NONE;
1068 }
1069
1070 result = pgContext->pWlxFuncs->WlxDialogBoxParam(
1071 pgContext->hWlx,
1072 pgContext->hDllInstance,
1076 (LPARAM)pgContext);
1077
1080 {
1082 }
1083
1084 return result;
1085}
1086
1087
1088static
1089BOOL
1091 IN HWND hwndDlg,
1092 IN OUT PGINA_CONTEXT pgContext)
1093{
1094 LPWSTR UserName = NULL;
1096 LPWSTR Domain = NULL;
1097 BOOL result = FALSE;
1099
1100 if (GetTextboxText(hwndDlg, IDC_LOGON_USERNAME, &UserName) && *UserName == '\0')
1101 goto done;
1102
1103 if (GetTextboxText(hwndDlg, IDC_LOGON_DOMAIN, &Domain) && *Domain == '\0')
1104 goto done;
1105
1107 goto done;
1108
1109 Status = DoLoginTasks(pgContext, UserName, Domain, Password, &SubStatus);
1111 {
1112 ResourceMessageBox(pgContext,
1113 hwndDlg,
1117 goto done;
1118 }
1120 {
1121 TRACE("DoLoginTasks failed! Status 0x%08lx SubStatus 0x%08lx\n", Status, SubStatus);
1122
1124 {
1125 ResourceMessageBox(pgContext,
1126 hwndDlg,
1130 goto done;
1131 }
1133 {
1134 TRACE("Account locked!\n");
1135 ResourceMessageBox(pgContext,
1136 hwndDlg,
1140 goto done;
1141 }
1142 else if ((SubStatus == STATUS_PASSWORD_MUST_CHANGE) ||
1144 {
1146 ResourceMessageBox(pgContext,
1147 hwndDlg,
1151 else
1152 ResourceMessageBox(pgContext,
1153 hwndDlg,
1157
1158 if (!OnChangePassword(hwndDlg,
1159 pgContext))
1160 goto done;
1161
1162 Status = DoLoginTasks(pgContext,
1163 pgContext->UserName,
1164 pgContext->DomainName,
1165 pgContext->Password,
1166 &SubStatus);
1167 if (!NT_SUCCESS(Status))
1168 {
1169 TRACE("Login after password change failed! (Status 0x%08lx)\n", Status);
1170
1171 goto done;
1172 }
1173 }
1175 {
1176 ResourceMessageBox(pgContext,
1177 hwndDlg,
1181 }
1183 {
1184 ResourceMessageBox(pgContext,
1185 hwndDlg,
1189 goto done;
1190 }
1192 {
1193 ResourceMessageBox(pgContext,
1194 hwndDlg,
1198 goto done;
1199 }
1200 else
1201 {
1202 TRACE("Other error!\n");
1203 ResourceMessageBox(pgContext,
1204 hwndDlg,
1208 goto done;
1209 }
1210 }
1211 else if (!NT_SUCCESS(Status))
1212 {
1213 TRACE("DoLoginTasks failed! Status 0x%08lx\n", Status);
1214 goto done;
1215 }
1216
1217 if (!CreateProfile(pgContext, UserName, Domain, Password))
1218 {
1219 ERR("Failed to create the profile!\n");
1220 goto done;
1221 }
1222
1223 ZeroMemory(pgContext->Password, sizeof(pgContext->Password));
1224 wcscpy(pgContext->Password, Password);
1225
1226 result = TRUE;
1227
1228done:
1229 pgContext->bAutoAdminLogon = FALSE;
1230
1231 if (UserName != NULL)
1232 HeapFree(GetProcessHeap(), 0, UserName);
1233
1234 if (Password != NULL)
1236
1237 if (Domain != NULL)
1238 HeapFree(GetProcessHeap(), 0, Domain);
1239
1240 return result;
1241}
1242
1243
1244static
1245VOID
1247 HWND hwndDomainComboBox,
1248 PGINA_CONTEXT pgContext)
1249{
1250 WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1251 DWORD dwComputerNameLength;
1252 LONG lIndex = 0;
1253 LONG lFindIndex;
1254
1255 SendMessageW(hwndDomainComboBox, CB_RESETCONTENT, 0, 0);
1256
1257 dwComputerNameLength = _countof(szComputerName);
1258 if (GetComputerNameW(szComputerName, &dwComputerNameLength))
1259 {
1260 lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)szComputerName);
1261 }
1262
1263 if (wcslen(pgContext->DomainName) != 0)
1264 {
1265 lFindIndex = SendMessageW(hwndDomainComboBox, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)pgContext->DomainName);
1266 if (lFindIndex == CB_ERR)
1267 {
1268 lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)pgContext->DomainName);
1269 }
1270 else
1271 {
1272 lIndex = lFindIndex;
1273 }
1274 }
1275
1276 SendMessageW(hwndDomainComboBox, CB_SETCURSEL, lIndex, 0);
1277}
1278
1279
1280static INT_PTR CALLBACK
1282 IN HWND hwndDlg,
1283 IN UINT uMsg,
1286{
1287 PDLG_DATA pDlgData;
1288
1289 pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1290
1291 switch (uMsg)
1292 {
1293 case WM_INITDIALOG:
1294 {
1295 /* FIXME: take care of NoDomainUI */
1296 pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
1297 if (pDlgData == NULL)
1298 return FALSE;
1299
1300 DlgData_LoadBitmaps(pDlgData);
1301
1302 SetWelcomeText(hwndDlg);
1303
1304 if (pDlgData->pgContext->bAutoAdminLogon ||
1307
1308 if (pDlgData->pgContext->bAutoAdminLogon)
1310
1312
1313 if (pDlgData->pgContext->bDisableCAD)
1315
1316 if (!pDlgData->pgContext->bShutdownWithoutLogon)
1318
1320
1321 if (pDlgData->pgContext->bAutoAdminLogon)
1322 PostMessage(GetDlgItem(hwndDlg, IDOK), BM_CLICK, 0, 0);
1323
1324 return TRUE;
1325 }
1326
1327 case WM_PAINT:
1328 {
1329 PAINTSTRUCT ps;
1330 if (pDlgData && pDlgData->hLogoBitmap)
1331 {
1332 BeginPaint(hwndDlg, &ps);
1333 DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1334 EndPaint(hwndDlg, &ps);
1335 }
1336 return TRUE;
1337 }
1338
1339 case WM_DESTROY:
1340 DlgData_Destroy(hwndDlg);
1341 return TRUE;
1342
1343 case WM_COMMAND:
1344 switch (LOWORD(wParam))
1345 {
1346 case IDOK:
1347 if (DoLogon(hwndDlg, pDlgData->pgContext))
1349 return TRUE;
1350
1351 case IDCANCEL:
1353 return TRUE;
1354
1355 case IDC_LOGON_SHUTDOWN:
1356 if (OnShutDown(hwndDlg, pDlgData->pgContext) == IDOK)
1357 EndDialog(hwndDlg, pDlgData->pgContext->nShutdownAction);
1358 return TRUE;
1359 }
1360 break;
1361 }
1362
1363 return FALSE;
1364}
1365
1366
1367static
1368INT_PTR
1371 IN HWND hwndDlg,
1372 IN UINT uMsg,
1375{
1376 PLEGALNOTICEDATA pLegalNotice;
1377
1378 switch (uMsg)
1379 {
1380 case WM_INITDIALOG:
1381 pLegalNotice = (PLEGALNOTICEDATA)lParam;
1382 SetWindowTextW(hwndDlg, pLegalNotice->pszCaption);
1383 SetDlgItemTextW(hwndDlg, IDC_LEGALNOTICE_TEXT, pLegalNotice->pszText);
1384 return TRUE;
1385
1386 case WM_COMMAND:
1387 switch (LOWORD(wParam))
1388 {
1389 case IDOK:
1390 EndDialog(hwndDlg, 0);
1391 return TRUE;
1392
1393 case IDCANCEL:
1394 EndDialog(hwndDlg, 0);
1395 return TRUE;
1396 }
1397 break;
1398 }
1399
1400 return FALSE;
1401}
1402
1403
1404static INT
1406 IN OUT PGINA_CONTEXT pgContext)
1407{
1408 LEGALNOTICEDATA LegalNotice = {NULL, NULL};
1409 HKEY hKey = NULL;
1410 LONG rc;
1411 int result;
1412
1413 TRACE("GUILoggedOutSAS()\n");
1414
1416 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
1417 0,
1419 &hKey);
1420 if (rc == ERROR_SUCCESS)
1421 {
1423 L"LegalNoticeCaption",
1424 &LegalNotice.pszCaption);
1425
1427 L"LegalNoticeText",
1428 &LegalNotice.pszText);
1429
1431 }
1432
1433 if (LegalNotice.pszCaption != NULL && wcslen(LegalNotice.pszCaption) != 0 &&
1434 LegalNotice.pszText != NULL && wcslen(LegalNotice.pszText) != 0)
1435 {
1436 pgContext->pWlxFuncs->WlxDialogBoxParam(pgContext->hWlx,
1437 pgContext->hDllInstance,
1441 (LPARAM)&LegalNotice);
1442 }
1443
1444 if (LegalNotice.pszCaption != NULL)
1445 HeapFree(GetProcessHeap(), 0, LegalNotice.pszCaption);
1446
1447 if (LegalNotice.pszText != NULL)
1448 HeapFree(GetProcessHeap(), 0, LegalNotice.pszText);
1449
1450 result = pgContext->pWlxFuncs->WlxDialogBoxParam(
1451 pgContext->hWlx,
1452 pgContext->hDllInstance,
1456 (LPARAM)pgContext);
1459 {
1460 WARN("WlxLoggedOutSAS() returns 0x%x\n", result);
1461 return result;
1462 }
1463
1464 WARN("WlxDialogBoxParam() failed (0x%x)\n", result);
1465 return WLX_SAS_ACTION_NONE;
1466}
1467
1468
1469static VOID
1471 INT nDlgItem,
1472 PGINA_CONTEXT pgContext)
1473{
1474 WCHAR Buffer1[256];
1475 WCHAR Buffer2[256];
1476 WCHAR Buffer3[512];
1477
1478 LoadStringW(pgContext->hDllInstance, IDS_LOCKMSG, Buffer1, _countof(Buffer1));
1479
1480 wsprintfW(Buffer2, L"%s\\%s", pgContext->DomainName, pgContext->UserName);
1481 wsprintfW(Buffer3, Buffer1, Buffer2);
1482
1483 SetDlgItemTextW(hwnd, nDlgItem, Buffer3);
1484}
1485
1486
1487static
1488BOOL
1490 IN HWND hwndDlg,
1491 IN PGINA_CONTEXT pgContext,
1493{
1494 WCHAR Buffer1[256];
1495 WCHAR Buffer2[256];
1496 LPWSTR UserName = NULL;
1498 BOOL res = FALSE;
1499
1500 if (GetTextboxText(hwndDlg, IDC_UNLOCK_USERNAME, &UserName) && *UserName == '\0')
1501 {
1502 HeapFree(GetProcessHeap(), 0, UserName);
1503 return FALSE;
1504 }
1505
1507 {
1508 if (UserName != NULL && Password != NULL &&
1509 wcscmp(UserName, pgContext->UserName) == 0 &&
1510 wcscmp(Password, pgContext->Password) == 0)
1511 {
1513 res = TRUE;
1514 }
1515 else if (wcscmp(UserName, pgContext->UserName) == 0 &&
1516 wcscmp(Password, pgContext->Password) != 0)
1517 {
1518 /* Wrong Password */
1519 LoadStringW(pgContext->hDllInstance, IDS_LOCKEDWRONGPASSWORD, Buffer2, _countof(Buffer2));
1520 LoadStringW(pgContext->hDllInstance, IDS_COMPUTERLOCKED, Buffer1, _countof(Buffer1));
1521 MessageBoxW(hwndDlg, Buffer2, Buffer1, MB_OK | MB_ICONERROR);
1522 }
1523 else
1524 {
1525 /* Wrong user name */
1526 if (DoAdminUnlock(pgContext, UserName, NULL, Password))
1527 {
1529 res = TRUE;
1530 }
1531 else
1532 {
1533 LoadStringW(pgContext->hDllInstance, IDS_LOCKEDWRONGUSER, Buffer1, _countof(Buffer1));
1534 wsprintfW(Buffer2, Buffer1, pgContext->DomainName, pgContext->UserName);
1535 LoadStringW(pgContext->hDllInstance, IDS_COMPUTERLOCKED, Buffer1, _countof(Buffer1));
1536 MessageBoxW(hwndDlg, Buffer2, Buffer1, MB_OK | MB_ICONERROR);
1537 }
1538 }
1539 }
1540
1541 if (UserName != NULL)
1542 HeapFree(GetProcessHeap(), 0, UserName);
1543
1544 if (Password != NULL)
1546
1547 return res;
1548}
1549
1550
1551static
1552INT_PTR
1555 IN HWND hwndDlg,
1556 IN UINT uMsg,
1559{
1560 PDLG_DATA pDlgData;
1562
1563 pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1564
1565 switch (uMsg)
1566 {
1567 case WM_INITDIALOG:
1568 {
1569 pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
1570 if (pDlgData == NULL)
1571 return FALSE;
1572
1573 SetWelcomeText(hwndDlg);
1574
1575 SetLockMessage(hwndDlg, IDC_UNLOCK_MESSAGE, pDlgData->pgContext);
1576
1579
1580 if (pDlgData->pgContext->bDisableCAD)
1582
1583 DlgData_LoadBitmaps(pDlgData);
1584 return TRUE;
1585 }
1586
1587 case WM_PAINT:
1588 {
1589 PAINTSTRUCT ps;
1590 if (pDlgData && pDlgData->hLogoBitmap)
1591 {
1592 BeginPaint(hwndDlg, &ps);
1593 DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1594 EndPaint(hwndDlg, &ps);
1595 }
1596 return TRUE;
1597 }
1598 case WM_DESTROY:
1599 DlgData_Destroy(hwndDlg);
1600 return TRUE;
1601
1602 case WM_COMMAND:
1603 switch (LOWORD(wParam))
1604 {
1605 case IDOK:
1606 if (DoUnlock(hwndDlg, pDlgData->pgContext, &result))
1607 EndDialog(hwndDlg, result);
1608 return TRUE;
1609
1610 case IDCANCEL:
1612 return TRUE;
1613 }
1614 break;
1615 }
1616
1617 return FALSE;
1618}
1619
1620
1621static INT
1623 IN OUT PGINA_CONTEXT pgContext)
1624{
1625 int result;
1626
1627 TRACE("GUILockedSAS()\n");
1628
1629 result = pgContext->pWlxFuncs->WlxDialogBoxParam(
1630 pgContext->hWlx,
1631 pgContext->hDllInstance,
1635 (LPARAM)pgContext);
1638 {
1639 WARN("GUILockedSAS() returns 0x%x\n", result);
1640 return result;
1641 }
1642
1643 WARN("GUILockedSAS() failed (0x%x)\n", result);
1644 return WLX_SAS_ACTION_NONE;
1645}
1646
1647
1648static INT_PTR CALLBACK
1650 IN HWND hwndDlg,
1651 IN UINT uMsg,
1654{
1655 PDLG_DATA pDlgData;
1656
1657 pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1658
1659 switch (uMsg)
1660 {
1661 case WM_INITDIALOG:
1662 {
1663 pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
1664 if (pDlgData == NULL)
1665 return FALSE;
1666
1667 DlgData_LoadBitmaps(pDlgData);
1668
1669 SetWelcomeText(hwndDlg);
1670
1671 SetLockMessage(hwndDlg, IDC_LOCKED_MESSAGE, pDlgData->pgContext);
1672 return TRUE;
1673 }
1674 case WM_PAINT:
1675 {
1676 PAINTSTRUCT ps;
1677 if (pDlgData && pDlgData->hLogoBitmap)
1678 {
1679 BeginPaint(hwndDlg, &ps);
1680 DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1681 EndPaint(hwndDlg, &ps);
1682 }
1683 return TRUE;
1684 }
1685 case WM_DESTROY:
1686 {
1687 DlgData_Destroy(hwndDlg);
1688 return TRUE;
1689 }
1690 }
1691
1692 return FALSE;
1693}
1694
1695
1696static VOID
1698 IN OUT PGINA_CONTEXT pgContext)
1699{
1700 TRACE("GUIdisplayLockedNotice()\n");
1701
1702 pgContext->pWlxFuncs->WlxDialogBoxParam(
1703 pgContext->hWlx,
1704 pgContext->hDllInstance,
1708 (LPARAM)pgContext);
1709}
1710
1720};
#define BufSize
Definition: FsRtlTunnel.c:28
unsigned char BOOLEAN
Arabic default style
Definition: afstyles.h:94
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
LONG NTSTATUS
Definition: precomp.h:26
#define IDD_LOGON
Definition: resource.h:141
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define IDI_ROSLOGO
Definition: resource.h:42
#define RegCloseKey(hKey)
Definition: registry.h:49
static HINSTANCE hDllInstance
Definition: clb.c:9
WPARAM wParam
Definition: combotst.c:138
char * Text
Definition: combotst.c:136
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:446
wcscat
wcscpy
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define IDD_STATUS
Definition: resource.h:22
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
BOOL WINAPI ImpersonateLoggedOnUser(HANDLE hToken)
Definition: misc.c:152
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define GetCurrentProcess()
Definition: compat.h:759
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
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
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:137
LANGID WINAPI GetUserDefaultLangID(void)
Definition: locale.c:1177
BOOL WINAPI RevertToSelf(void)
Definition: security.c:855
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
Definition: string.c:1220
#define ISKEYDOWN(x)
Definition: gui.c:36
static VOID SetDomainComboBox(HWND hwndDomainComboBox, PGINA_CONTEXT pgContext)
Definition: gui.c:1246
static BOOL DoLogon(IN HWND hwndDlg, IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1090
static INT_PTR CALLBACK LogonDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:1281
static BOOL GetTextboxText(IN HWND hwndDlg, IN INT TextboxId, OUT LPWSTR *pText)
Definition: gui.c:546
static INT_PTR CALLBACK LogOffDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:860
static DWORD WINAPI StartupWindowThread(LPVOID lpParam)
Definition: gui.c:359
static INT OnShutDown(IN HWND hwndDlg, IN PGINA_CONTEXT pgContext)
Definition: gui.c:911
static INT_PTR CALLBACK WelcomeDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:486
struct _DLG_DATA * PDLG_DATA
static INT_PTR CALLBACK UnlockDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:1554
static INT_PTR CALLBACK StatusDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:253
static INT_PTR CALLBACK LegalNoticeDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:1370
static PDLG_DATA DlgData_Create(HWND hwndDlg, PGINA_CONTEXT pgContext)
Definition: gui.c:52
static INT GUILoggedOnSAS(IN OUT PGINA_CONTEXT pgContext, IN DWORD dwSasType)
Definition: gui.c:1055
static VOID DlgData_Destroy(_Inout_ HWND hwndDlg)
Definition: gui.c:94
static INT_PTR CALLBACK SecurityDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:960
static VOID SetWelcomeText(HWND hWnd)
Definition: gui.c:129
static INT_PTR CALLBACK LockedDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:1649
struct _DISPLAYSTATUSMSG * PDISPLAYSTATUSMSG
static BOOL GUIInitialize(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:120
static INT GUILockedSAS(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1622
static INT GUILoggedOutSAS(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1405
struct _LEGALNOTICEDATA LEGALNOTICEDATA
GINA_UI GinaGraphicalUI
Definition: gui.c:1711
static INT_PTR CALLBACK ChangePasswordDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:748
static VOID AdjustStatusMessageWindow(HWND hwndDlg, PDLG_DATA pDlgData)
Definition: gui.c:189
static BOOL DoChangePassword(IN PGINA_CONTEXT pgContext, IN HWND hwndDlg)
Definition: gui.c:593
static BOOL GUIDisplayStatusMessage(IN PGINA_CONTEXT pgContext, IN HDESK hDesktop, IN DWORD dwOptions, IN PWSTR pTitle, IN PWSTR pMessage)
Definition: gui.c:398
static VOID SetLockMessage(HWND hwnd, INT nDlgItem, PGINA_CONTEXT pgContext)
Definition: gui.c:1470
static VOID GUIDisplayLockedNotice(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1697
static INT ResourceMessageBox(IN PGINA_CONTEXT pgContext, IN HWND hwnd, IN UINT uType, IN UINT uCaption, IN UINT uText)
Definition: gui.c:570
static BOOL GUIRemoveStatusMessage(IN PGINA_CONTEXT pgContext)
Definition: gui.c:473
static BOOL OnChangePassword(IN HWND hwnd, IN PGINA_CONTEXT pgContext)
Definition: gui.c:837
struct _DISPLAYSTATUSMSG DISPLAYSTATUSMSG
struct _LEGALNOTICEDATA * PLEGALNOTICEDATA
#define IDT_BAR
Definition: gui.c:34
static VOID OnInitSecurityDlg(HWND hwnd, PGINA_CONTEXT pgContext)
Definition: gui.c:804
static VOID GUIDisplaySASNotice(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:529
static INT OnLogOff(IN HWND hwndDlg, IN PGINA_CONTEXT pgContext)
Definition: gui.c:895
static BOOL DoUnlock(IN HWND hwndDlg, IN PGINA_CONTEXT pgContext, OUT LPINT Action)
Definition: gui.c:1489
static VOID DlgData_LoadBitmaps(_Inout_ PDLG_DATA pDlgData)
Definition: gui.c:64
struct _DLG_DATA DLG_DATA
NTSTATUS ConnectToLsa(PGINA_CONTEXT pgContext)
Definition: lsa.c:11
#define IDC_ROSLOGO
Definition: resource.h:69
#define IDC_CHANGEPWD_USERNAME
Definition: resource.h:35
#define IDS_COMPUTERLOCKED
Definition: resource.h:97
#define IDS_ACCOUNTLOCKED
Definition: resource.h:109
#define IDS_LOCKEDWRONGUSER
Definition: resource.h:99
#define IDS_CHANGEPWDTITLE
Definition: resource.h:100
#define IDS_INVALIDLOGONHOURS
Definition: resource.h:110
#define IDC_CHANGEPWD_OLDPWD
Definition: resource.h:37
#define IDC_STATUS_MESSAGE
Definition: resource.h:6
#define IDC_BAR
Definition: resource.h:70
#define IDC_CHANGEPWD_DOMAIN
Definition: resource.h:36
#define IDS_LOGONWRONGUSERORPWD
Definition: resource.h:104
#define IDC_UNLOCK_USERNAME
Definition: resource.h:31
#define IDS_PASSWORDMUSTCHANGE
Definition: resource.h:106
#define IDS_LOCKMSG
Definition: resource.h:94
#define IDC_SECURITY_TASKMGR
Definition: resource.h:24
#define IDC_CHANGEPWD_NEWPWD2
Definition: resource.h:39
#define IDC_SECURITY_CHANGEPWD
Definition: resource.h:23
#define IDC_CHANGEPWD_NEWPWD1
Definition: resource.h:38
#define IDS_LOCKEDWRONGPASSWORD
Definition: resource.h:98
#define IDD_CHANGEPWD
Definition: resource.h:34
#define IDS_NONMATCHINGPASSWORDS
Definition: resource.h:101
#define IDS_LOGONTITLE
Definition: resource.h:103
#define IDC_LOCKED_MESSAGE
Definition: resource.h:27
#define IDC_SECURITY_SHUTDOWN
Definition: resource.h:22
#define IDC_SECURITY_MESSAGE
Definition: resource.h:18
#define IDD_UNLOCK
Definition: resource.h:29
#define IDD_LEGALNOTICE
Definition: resource.h:66
#define IDS_INVALIDWORKSTATION
Definition: resource.h:111
#define IDD_LOCKED
Definition: resource.h:26
#define IDC_SECURITY_LOGOFF
Definition: resource.h:21
#define IDC_SECURITY_LOGONDATE
Definition: resource.h:19
#define IDD_WELCOME
Definition: resource.h:8
#define IDC_LOGON_DOMAIN
Definition: resource.h:14
#define IDS_PASSWORDEXPIRED
Definition: resource.h:107
#define IDC_UNLOCK_PASSWORD
Definition: resource.h:32
#define IDS_PASSWORDCHANGED
Definition: resource.h:102
#define IDC_LOGON_PASSWORD
Definition: resource.h:13
#define IDS_EMERGENCYRESTARTTITLE
Definition: resource.h:129
#define IDC_LOGON_SHUTDOWN
Definition: resource.h:15
#define IDS_LOGONUSERDISABLED
Definition: resource.h:105
#define IDD_LOGOFF
Definition: resource.h:41
#define IDS_ACCOUNTEXPIRED
Definition: resource.h:108
#define IDC_UNLOCK_MESSAGE
Definition: resource.h:30
#define IDI_BAR
Definition: resource.h:76
#define IDS_EMERGENCYLOGOFFTITLE
Definition: resource.h:127
#define IDS_EMERGENCYRESTART
Definition: resource.h:130
#define IDC_SECURITY_LOCK
Definition: resource.h:20
#define IDS_LOGONMSG
Definition: resource.h:95
#define IDC_LEGALNOTICE_TEXT
Definition: resource.h:67
#define IDC_LOGON_USERNAME
Definition: resource.h:12
#define IDS_LOGONDATE
Definition: resource.h:96
#define IDS_ACCOUNTRESTRICTION
Definition: resource.h:112
#define IDS_EMERGENCYLOGOFF
Definition: resource.h:128
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
#define INFINITE
Definition: serial.h:102
static INT cxOld
Definition: eventvwr.c:4341
static INT cyOld
Definition: eventvwr.c:4341
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
FxAutoRegKey hKey
pKey DeleteObject()
Status
Definition: gdiplustypes.h:25
GLuint res
Definition: glext.h:9613
GLuint64EXT * result
Definition: glext.h:11304
GLfloat GLfloat p
Definition: glext.h:8902
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define IDD_SECURITY
Definition: inetcpl.h:83
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
#define REG_SZ
Definition: layer.c:22
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1089
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:989
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define SE_SHUTDOWN_PRIVILEGE
Definition: security.c:673
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
LONG ReadRegSzValue(IN HKEY hKey, IN LPCWSTR pszValue, OUT LPWSTR *pValue)
Definition: msgina.c:60
BOOL CreateProfile(IN OUT PGINA_CONTEXT pgContext, IN PWSTR UserName, IN PWSTR Domain, IN PWSTR Password)
Definition: msgina.c:831
BOOL DoAdminUnlock(IN PGINA_CONTEXT pgContext, IN PWSTR UserName, IN PWSTR Domain, IN PWSTR Password)
Definition: msgina.c:711
NTSTATUS DoLoginTasks(IN OUT PGINA_CONTEXT pgContext, IN PWSTR UserName, IN PWSTR Domain, IN PWSTR Password, OUT PNTSTATUS SubStatus)
Definition: msgina.c:798
DWORD GetAllowedShutdownOptions(VOID)
Definition: shutdown.c:783
VOID SaveShutdownSelState(DWORD ShutdownCode)
DWORD LoadShutdownSelState(VOID)
Definition: shutdown.c:441
DWORD GetDefaultShutdownSelState(VOID)
Definition: shutdown.c:435
INT_PTR ShutdownDialog(IN HWND hwndDlg, IN DWORD ShutdownOptions, IN PGINA_CONTEXT pgContext)
Definition: shutdown.c:1149
DWORD GetDefaultShutdownOptions(VOID)
Definition: shutdown.c:777
struct GINA_CONTEXT * PGINA_CONTEXT
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
@ ShutdownReboot
Definition: extypes.h:177
NTSYSAPI NTSTATUS NTAPI RtlAdjustPrivilege(_In_ ULONG Privilege, _In_ BOOLEAN NewValue, _In_ BOOLEAN ForThread, _Out_ PBOOLEAN OldValue)
#define _Inout_
Definition: no_sal2.h:162
int Count
Definition: noreturn.cpp:7
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define DWORD
Definition: nt_native.h:44
#define LOCALE_USER_DEFAULT
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
_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
NTSTATUS NTAPI NtShutdownSystem(IN SHUTDOWN_ACTION Action)
Definition: shutdown.c:43
struct _MSV1_0_CHANGEPASSWORD_REQUEST MSV1_0_CHANGEPASSWORD_REQUEST
@ MsV1_0ChangePassword
Definition: ntsecapi.h:223
NTSTATUS NTAPI LsaCallAuthenticationPackage(HANDLE, ULONG, PVOID, ULONG, PVOID *, PULONG, PNTSTATUS)
NTSTATUS NTAPI LsaFreeReturnBuffer(PVOID)
#define STATUS_INVALID_LOGON_HOURS
Definition: ntstatus.h:347
#define STATUS_ACCOUNT_DISABLED
Definition: ntstatus.h:350
#define STATUS_PASSWORD_MUST_CHANGE
Definition: ntstatus.h:680
#define STATUS_PASSWORD_EXPIRED
Definition: ntstatus.h:349
#define STATUS_INVALID_WORKSTATION
Definition: ntstatus.h:348
#define STATUS_ACCOUNT_EXPIRED
Definition: ntstatus.h:636
#define STATUS_ACCOUNT_LOCKED_OUT
Definition: ntstatus.h:696
#define STATUS_LOGON_FAILURE
Definition: ntstatus.h:345
#define STATUS_ACCOUNT_RESTRICTION
Definition: ntstatus.h:346
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
BYTE * PBYTE
Definition: pedump.c:66
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
PVOID pBuffer
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define LANG_CHINESE
Definition: nls.h:42
#define LANG_JAPANESE
Definition: nls.h:76
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define LANG_KOREAN
Definition: nls.h:84
#define STATUS_SUCCESS
Definition: shellext.h:65
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwOptions
Definition: solitaire.cpp:25
BOOL bAutoAdminLogon
Definition: msgina.h:42
WCHAR DomainName[256]
Definition: msgina.h:51
SYSTEMTIME LogonTime
Definition: msgina.h:53
BOOL bDontDisplayLastUserName
Definition: msgina.h:43
BOOL bShutdownWithoutLogon
Definition: msgina.h:44
BOOL bDisableCAD
Definition: msgina.h:41
WCHAR UserName[256]
Definition: msgina.h:50
ULONG nShutdownAction
Definition: msgina.h:47
HANDLE hDllInstance
Definition: msgina.h:37
WCHAR Password[256]
Definition: msgina.h:52
Definition: bl.h:1331
HDESK hDesktop
Definition: gui.c:20
HANDLE StartupEvent
Definition: gui.c:24
PWSTR pTitle
Definition: gui.c:22
PWSTR pMessage
Definition: gui.c:23
DWORD dwOptions
Definition: gui.c:21
PGINA_CONTEXT Context
Definition: gui.c:19
Definition: gui.c:39
PGINA_CONTEXT pgContext
Definition: gui.c:40
HBITMAP hLogoBitmap
Definition: gui.c:41
HBITMAP hBarBitmap
Definition: gui.c:42
DWORD BarHeight
Definition: gui.c:48
DWORD BarWidth
Definition: gui.c:47
DWORD LogoHeight
Definition: gui.c:46
HWND hWndBarCtrl
Definition: gui.c:43
DWORD BarCounter
Definition: gui.c:44
DWORD LogoWidth
Definition: gui.c:45
LPWSTR pszText
Definition: gui.c:30
LPWSTR pszCaption
Definition: gui.c:29
USHORT MaximumLength
Definition: ntsecapi.h:164
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType
Definition: ntsecapi.h:511
UNICODE_STRING AccountName
Definition: ntsecapi.h:513
UNICODE_STRING NewPassword
Definition: ntsecapi.h:515
UNICODE_STRING OldPassword
Definition: ntsecapi.h:514
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
@ Password
Definition: telnetd.h:65
#define GWLP_USERDATA
Definition: treelist.c:63
LPCSTR pText
Definition: txtscale.cpp:79
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT_PTR
Definition: typedefs.h:64
int32_t INT
Definition: typedefs.h:58
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
int ret
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510
HDC hdcMem
Definition: welcome.c:104
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1382
#define ZeroMemory
Definition: winbase.h:1753
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:276
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
int * LPINT
Definition: windef.h:178
#define WINAPI
Definition: msvc.h:6
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define SRCCOPY
Definition: wingdi.h:333
#define GetObject
Definition: wingdi.h:4468
BOOL WINAPI DeleteDC(_In_ HDC)
#define DATE_SHORTDATE
Definition: winnls.h:209
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define WM_PAINT
Definition: winuser.h:1639
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define WM_CLOSE
Definition: winuser.h:1640
#define IMAGE_BITMAP
Definition: winuser.h:211
#define GetWindowLongPtrW
Definition: winuser.h:4905
#define IDCANCEL
Definition: winuser.h:842
BOOL WINAPI SetThreadDesktop(_In_ HDESK)
#define GetWindowTextLength
Definition: winuser.h:5884
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define WM_COMMAND
Definition: winuser.h:1759
#define CB_ERR
Definition: winuser.h:2454
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2540
#define CB_SETCURSEL
Definition: winuser.h:1980
#define VK_CONTROL
Definition: winuser.h:2222
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define CB_RESETCONTENT
Definition: winuser.h:1978
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1959
#define WM_INITDIALOG
Definition: winuser.h:1758
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:841
#define WM_DRAWITEM
Definition: winuser.h:1664
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define MB_ICONERROR
Definition: winuser.h:798
#define MB_OKCANCEL
Definition: winuser.h:815
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WM_TIMER
Definition: winuser.h:1761
#define BM_CLICK
Definition: winuser.h:1936
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define DST_BITMAP
Definition: winuser.h:516
#define IDNO
Definition: winuser.h:847
#define CB_ADDSTRING
Definition: winuser.h:1955
BOOL WINAPI UpdateWindow(_In_ HWND)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
int WINAPI GetWindowTextLengthW(_In_ HWND)
#define MB_ICONEXCLAMATION
Definition: winuser.h:796
#define MB_OK
Definition: winuser.h:801
#define PostMessage
Definition: winuser.h:5917
#define MB_ICONINFORMATION
Definition: winuser.h:813
#define MB_ICONSTOP
Definition: winuser.h:814
#define LR_DEFAULTCOLOR
Definition: winuser.h:1098
#define WM_DESTROY
Definition: winuser.h:1628
#define SetWindowText
Definition: winuser.h:5942
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:846
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SetWindowLongPtrW
Definition: winuser.h:5431
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 GWL_STYLE
Definition: winuser.h:863
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define GWL_EXSTYLE
Definition: winuser.h:862
#define WLX_SAS_ACTION_NONE
Definition: winwlx.h:54
#define WLX_SAS_ACTION_FORCE_LOGOFF
Definition: winwlx.h:61
#define WLX_SAS_ACTION_UNLOCK_WKSTA
Definition: winwlx.h:60
#define WLX_SAS_TYPE_CTRL_ALT_DEL
Definition: winwlx.h:36
#define WLX_SAS_ACTION_PWD_CHANGED
Definition: winwlx.h:58
#define WLX_SAS_ACTION_SWITCH_CONSOLE
Definition: winwlx.h:69
#define WLX_SAS_ACTION_LOGON
Definition: winwlx.h:53
#define WLX_SAS_ACTION_TASKLIST
Definition: winwlx.h:59
#define WLX_SAS_ACTION_LOCK_WKSTA
Definition: winwlx.h:55
#define WLX_SAS_ACTION_LOGOFF
Definition: winwlx.h:56
#define DUPLICATE_SAME_ACCESS
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184