ReactOS 0.4.16-dev-1505-g12fa72a
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 goto done;
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 goto done;
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 SecureZeroMemory(pgContext->Password, sizeof(pgContext->Password));
733 wcscpy(pgContext->Password, NewPassword1);
734 }
735
736done:
737 /* Zero out the password buffers */
738 SecureZeroMemory(&OldPassword, sizeof(OldPassword));
739 SecureZeroMemory(&NewPassword1, sizeof(NewPassword1));
740 SecureZeroMemory(&NewPassword2, sizeof(NewPassword2));
741
742 if (RequestBuffer != NULL)
743 {
744 /* Zero out the password buffers before freeing them */
745 SecureZeroMemory(RequestBuffer->OldPassword.Buffer,
746 RequestBuffer->OldPassword.MaximumLength);
747 SecureZeroMemory(&RequestBuffer->OldPassword, sizeof(RequestBuffer->OldPassword));
748 SecureZeroMemory(RequestBuffer->NewPassword.Buffer,
749 RequestBuffer->NewPassword.MaximumLength);
750 SecureZeroMemory(&RequestBuffer->NewPassword, sizeof(RequestBuffer->NewPassword));
751 HeapFree(GetProcessHeap(), 0, RequestBuffer);
752 }
753
754 if (ResponseBuffer != NULL)
755 LsaFreeReturnBuffer(ResponseBuffer);
756
757 return res;
758}
759
760
761static INT_PTR CALLBACK
763 IN HWND hwndDlg,
764 IN UINT uMsg,
767{
768 PGINA_CONTEXT pgContext;
769
770 pgContext = (PGINA_CONTEXT)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
771
772 switch (uMsg)
773 {
774 case WM_INITDIALOG:
775 {
776 pgContext = (PGINA_CONTEXT)lParam;
777 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pgContext);
778
779 SetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_USERNAME, pgContext->UserName);
780 SendDlgItemMessageW(hwndDlg, IDC_CHANGEPWD_DOMAIN, CB_ADDSTRING, 0, (LPARAM)pgContext->DomainName);
783 return TRUE;
784 }
785
786 case WM_COMMAND:
787 switch (LOWORD(wParam))
788 {
789 case IDOK:
790 if (DoChangePassword(pgContext, hwndDlg))
791 {
792 EndDialog(hwndDlg, TRUE);
793 }
794 else
795 {
799 }
800 return TRUE;
801
802 case IDCANCEL:
803 EndDialog(hwndDlg, FALSE);
804 return TRUE;
805 }
806 break;
807
808 case WM_CLOSE:
809 EndDialog(hwndDlg, FALSE);
810 return TRUE;
811 }
812
813 return FALSE;
814}
815
816
817static VOID
819 PGINA_CONTEXT pgContext)
820{
821 WCHAR Buffer1[256];
822 WCHAR Buffer2[256];
823 WCHAR Buffer3[256];
824 WCHAR Buffer4[512];
825
826 LoadStringW(pgContext->hDllInstance, IDS_LOGONMSG, Buffer1, _countof(Buffer1));
827
828 wsprintfW(Buffer2, L"%s\\%s", pgContext->DomainName, pgContext->UserName);
829 wsprintfW(Buffer4, Buffer1, Buffer2);
830
832
833 LoadStringW(pgContext->hDllInstance, IDS_LOGONDATE, Buffer1, _countof(Buffer1));
834
836 (SYSTEMTIME*)&pgContext->LogonTime, NULL, Buffer2, _countof(Buffer2));
837
839 (SYSTEMTIME*)&pgContext->LogonTime, NULL, Buffer3, _countof(Buffer3));
840
841 wsprintfW(Buffer4, Buffer1, Buffer2, Buffer3);
842
844
845 if (pgContext->bAutoAdminLogon)
847}
848
849
850static BOOL
852 IN HWND hwnd,
853 IN PGINA_CONTEXT pgContext)
854{
855 INT res;
856
857 TRACE("OnChangePassword()\n");
858
859 res = pgContext->pWlxFuncs->WlxDialogBoxParam(
860 pgContext->hWlx,
861 pgContext->hDllInstance,
863 hwnd,
865 (LPARAM)pgContext);
866
867 TRACE("Result: %x\n", res);
868
869 return FALSE;
870}
871
872
873static INT_PTR CALLBACK
875 IN HWND hwndDlg,
876 IN UINT uMsg,
879{
880 switch (uMsg)
881 {
882 case WM_INITDIALOG:
883 return TRUE;
884
885 case WM_COMMAND:
886 switch (LOWORD(wParam))
887 {
888 case IDYES:
889 EndDialog(hwndDlg, IDYES);
890 return TRUE;
891
892 case IDNO:
893 EndDialog(hwndDlg, IDNO);
894 return TRUE;
895 }
896 break;
897
898 case WM_CLOSE:
899 EndDialog(hwndDlg, IDNO);
900 return TRUE;
901 }
902
903 return FALSE;
904}
905
906
907static
908INT
910 IN HWND hwndDlg,
911 IN PGINA_CONTEXT pgContext)
912{
913 return pgContext->pWlxFuncs->WlxDialogBoxParam(
914 pgContext->hWlx,
915 pgContext->hDllInstance,
917 hwndDlg,
919 (LPARAM)pgContext);
920}
921
922
923static
924INT
926 IN HWND hwndDlg,
927 IN PGINA_CONTEXT pgContext)
928{
929 INT ret;
930 DWORD ShutdownOptions;
931
932 TRACE("OnShutDown(%p %p)\n", hwndDlg, pgContext);
933
934 pgContext->nShutdownAction = GetDefaultShutdownSelState();
935 ShutdownOptions = GetDefaultShutdownOptions();
936
937 if (pgContext->UserToken != NULL)
938 {
939 if (ImpersonateLoggedOnUser(pgContext->UserToken))
940 {
941 pgContext->nShutdownAction = LoadShutdownSelState();
942 ShutdownOptions = GetAllowedShutdownOptions();
943 RevertToSelf();
944 }
945 else
946 {
947 ERR("WL: ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError());
948 }
949 }
950
951 ret = ShutdownDialog(hwndDlg, ShutdownOptions, pgContext);
952
953 if (ret == IDOK)
954 {
955 if (pgContext->UserToken != NULL)
956 {
957 if (ImpersonateLoggedOnUser(pgContext->UserToken))
958 {
959 SaveShutdownSelState(pgContext->nShutdownAction);
960 RevertToSelf();
961 }
962 else
963 {
964 ERR("WL: ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError());
965 }
966 }
967 }
968
969 return ret;
970}
971
972
973static INT_PTR CALLBACK
975 IN HWND hwndDlg,
976 IN UINT uMsg,
979{
980 PGINA_CONTEXT pgContext;
981
982 pgContext = (PGINA_CONTEXT)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
983
984 switch (uMsg)
985 {
986 case WM_INITDIALOG:
987 {
988 pgContext = (PGINA_CONTEXT)lParam;
989 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pgContext);
990
991 SetWelcomeText(hwndDlg);
992
994 SetFocus(GetDlgItem(hwndDlg, IDNO));
995 return TRUE;
996 }
997
998 case WM_COMMAND:
999 {
1000 switch (LOWORD(wParam))
1001 {
1002 case IDC_SECURITY_LOCK:
1004 return TRUE;
1006 if (ISKEYDOWN(VK_CONTROL))
1007 {
1008 if (ResourceMessageBox(pgContext,
1009 hwndDlg,
1013 {
1015 }
1016 }
1017 else if (OnLogOff(hwndDlg, pgContext) == IDYES)
1018 {
1020 }
1021 return TRUE;
1023 /* Emergency restart feature */
1024 if (ISKEYDOWN(VK_CONTROL))
1025 {
1026 if (ResourceMessageBox(pgContext,
1027 hwndDlg,
1031 {
1032 BOOLEAN Old;
1033
1034 ERR("Emergency restarting NT...\n");
1038 }
1039 }
1040 else if (OnShutDown(hwndDlg, pgContext) == IDOK)
1041 {
1042 EndDialog(hwndDlg, pgContext->nShutdownAction);
1043 }
1044 return TRUE;
1046 if (OnChangePassword(hwndDlg, pgContext))
1048 return TRUE;
1051 return TRUE;
1052 case IDCANCEL:
1054 return TRUE;
1055 }
1056 break;
1057 }
1058 case WM_CLOSE:
1059 {
1061 return TRUE;
1062 }
1063 }
1064
1065 return FALSE;
1066}
1067
1068static INT
1070 IN OUT PGINA_CONTEXT pgContext,
1071 IN DWORD dwSasType)
1072{
1073 INT result;
1074
1075 TRACE("GUILoggedOnSAS()\n");
1076
1077 if (dwSasType != WLX_SAS_TYPE_CTRL_ALT_DEL)
1078 {
1079 /* Nothing to do for WLX_SAS_TYPE_TIMEOUT; the dialog will
1080 * close itself thanks to the use of WlxDialogBoxParam */
1081 return WLX_SAS_ACTION_NONE;
1082 }
1083
1084 result = pgContext->pWlxFuncs->WlxDialogBoxParam(
1085 pgContext->hWlx,
1086 pgContext->hDllInstance,
1090 (LPARAM)pgContext);
1091
1094 {
1096 }
1097
1098 return result;
1099}
1100
1101
1102static
1103BOOL
1105 IN HWND hwndDlg,
1106 IN OUT PGINA_CONTEXT pgContext)
1107{
1108 LPWSTR UserName = NULL;
1110 LPWSTR Domain = NULL;
1111 BOOL result = FALSE;
1113
1114 if (GetTextboxText(hwndDlg, IDC_LOGON_USERNAME, &UserName) && *UserName == '\0')
1115 goto done;
1116
1117 if (GetTextboxText(hwndDlg, IDC_LOGON_DOMAIN, &Domain) && *Domain == '\0')
1118 goto done;
1119
1121 goto done;
1122
1123 Status = DoLoginTasks(pgContext, UserName, Domain, Password, &SubStatus);
1125 {
1126 ResourceMessageBox(pgContext,
1127 hwndDlg,
1131 goto done;
1132 }
1134 {
1135 TRACE("DoLoginTasks failed! Status 0x%08lx SubStatus 0x%08lx\n", Status, SubStatus);
1136
1138 {
1139 ResourceMessageBox(pgContext,
1140 hwndDlg,
1144 goto done;
1145 }
1147 {
1148 TRACE("Account locked!\n");
1149 ResourceMessageBox(pgContext,
1150 hwndDlg,
1154 goto done;
1155 }
1156 else if ((SubStatus == STATUS_PASSWORD_MUST_CHANGE) ||
1158 {
1160 {
1161 ResourceMessageBox(pgContext,
1162 hwndDlg,
1166 }
1167 else
1168 {
1169 ResourceMessageBox(pgContext,
1170 hwndDlg,
1174 }
1175
1176 if (!OnChangePassword(hwndDlg, pgContext))
1177 goto done;
1178
1179 Status = DoLoginTasks(pgContext,
1180 pgContext->UserName,
1181 pgContext->DomainName,
1182 pgContext->Password,
1183 &SubStatus);
1184 if (!NT_SUCCESS(Status))
1185 {
1186 TRACE("Login after password change failed! (Status 0x%08lx)\n", Status);
1187 goto done;
1188 }
1189 }
1191 {
1192 ResourceMessageBox(pgContext,
1193 hwndDlg,
1197 }
1199 {
1200 ResourceMessageBox(pgContext,
1201 hwndDlg,
1205 goto done;
1206 }
1208 {
1209 ResourceMessageBox(pgContext,
1210 hwndDlg,
1214 goto done;
1215 }
1216 else
1217 {
1218 TRACE("Other error!\n");
1219 ResourceMessageBox(pgContext,
1220 hwndDlg,
1224 goto done;
1225 }
1226 }
1227 else if (!NT_SUCCESS(Status))
1228 {
1229 TRACE("DoLoginTasks failed! Status 0x%08lx\n", Status);
1230 goto done;
1231 }
1232
1233 if (!CreateProfile(pgContext, UserName, Domain, Password))
1234 {
1235 ERR("Failed to create the profile!\n");
1236 goto done;
1237 }
1238
1239 SecureZeroMemory(pgContext->Password, sizeof(pgContext->Password));
1240 wcscpy(pgContext->Password, Password);
1241
1242 result = TRUE;
1243
1244done:
1245 pgContext->bAutoAdminLogon = FALSE;
1246
1247 if (UserName != NULL)
1248 HeapFree(GetProcessHeap(), 0, UserName);
1249
1250 if (Password != NULL)
1251 {
1252 /* Zero out the password buffer before freeing it */
1253 SIZE_T pwdLen = (wcslen(Password) + 1) * sizeof(WCHAR);
1254 SecureZeroMemory(Password, pwdLen);
1256 }
1257
1258 if (Domain != NULL)
1259 HeapFree(GetProcessHeap(), 0, Domain);
1260
1261 return result;
1262}
1263
1264
1265static
1266VOID
1268 HWND hwndDomainComboBox,
1269 PGINA_CONTEXT pgContext)
1270{
1271 WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1272 DWORD dwComputerNameLength;
1273 LONG lIndex = 0;
1274 LONG lFindIndex;
1275
1276 SendMessageW(hwndDomainComboBox, CB_RESETCONTENT, 0, 0);
1277
1278 dwComputerNameLength = _countof(szComputerName);
1279 if (GetComputerNameW(szComputerName, &dwComputerNameLength))
1280 {
1281 lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)szComputerName);
1282 }
1283
1284 if (wcslen(pgContext->DomainName) != 0)
1285 {
1286 lFindIndex = SendMessageW(hwndDomainComboBox, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)pgContext->DomainName);
1287 if (lFindIndex == CB_ERR)
1288 {
1289 lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)pgContext->DomainName);
1290 }
1291 else
1292 {
1293 lIndex = lFindIndex;
1294 }
1295 }
1296
1297 SendMessageW(hwndDomainComboBox, CB_SETCURSEL, lIndex, 0);
1298}
1299
1300
1301static INT_PTR CALLBACK
1303 IN HWND hwndDlg,
1304 IN UINT uMsg,
1307{
1308 PDLG_DATA pDlgData;
1309
1310 pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1311
1312 switch (uMsg)
1313 {
1314 case WM_INITDIALOG:
1315 {
1316 /* FIXME: take care of NoDomainUI */
1317 pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
1318 if (pDlgData == NULL)
1319 return FALSE;
1320
1321 DlgData_LoadBitmaps(pDlgData);
1322
1323 SetWelcomeText(hwndDlg);
1324
1325 if (pDlgData->pgContext->bAutoAdminLogon ||
1328
1329 if (pDlgData->pgContext->bAutoAdminLogon)
1331
1333
1334 if (pDlgData->pgContext->bDisableCAD)
1336
1337 if (!pDlgData->pgContext->bShutdownWithoutLogon)
1339
1341
1342 if (pDlgData->pgContext->bAutoAdminLogon)
1343 PostMessage(GetDlgItem(hwndDlg, IDOK), BM_CLICK, 0, 0);
1344
1345 return TRUE;
1346 }
1347
1348 case WM_PAINT:
1349 {
1350 PAINTSTRUCT ps;
1351 if (pDlgData && pDlgData->hLogoBitmap)
1352 {
1353 BeginPaint(hwndDlg, &ps);
1354 DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1355 EndPaint(hwndDlg, &ps);
1356 }
1357 return TRUE;
1358 }
1359
1360 case WM_DESTROY:
1361 DlgData_Destroy(hwndDlg);
1362 return TRUE;
1363
1364 case WM_COMMAND:
1365 switch (LOWORD(wParam))
1366 {
1367 case IDOK:
1368 if (DoLogon(hwndDlg, pDlgData->pgContext))
1370 return TRUE;
1371
1372 case IDCANCEL:
1374 return TRUE;
1375
1376 case IDC_LOGON_SHUTDOWN:
1377 if (OnShutDown(hwndDlg, pDlgData->pgContext) == IDOK)
1378 EndDialog(hwndDlg, pDlgData->pgContext->nShutdownAction);
1379 return TRUE;
1380 }
1381 break;
1382 }
1383
1384 return FALSE;
1385}
1386
1387
1388static
1389INT_PTR
1392 IN HWND hwndDlg,
1393 IN UINT uMsg,
1396{
1397 PLEGALNOTICEDATA pLegalNotice;
1398
1399 switch (uMsg)
1400 {
1401 case WM_INITDIALOG:
1402 pLegalNotice = (PLEGALNOTICEDATA)lParam;
1403 SetWindowTextW(hwndDlg, pLegalNotice->pszCaption);
1404 SetDlgItemTextW(hwndDlg, IDC_LEGALNOTICE_TEXT, pLegalNotice->pszText);
1405 return TRUE;
1406
1407 case WM_COMMAND:
1408 switch (LOWORD(wParam))
1409 {
1410 case IDOK:
1411 EndDialog(hwndDlg, 0);
1412 return TRUE;
1413
1414 case IDCANCEL:
1415 EndDialog(hwndDlg, 0);
1416 return TRUE;
1417 }
1418 break;
1419 }
1420
1421 return FALSE;
1422}
1423
1424
1425static INT
1427 IN OUT PGINA_CONTEXT pgContext)
1428{
1429 LEGALNOTICEDATA LegalNotice = {NULL, NULL};
1430 HKEY hKey = NULL;
1431 LONG rc;
1432 int result;
1433
1434 TRACE("GUILoggedOutSAS()\n");
1435
1437 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
1438 0,
1440 &hKey);
1441 if (rc == ERROR_SUCCESS)
1442 {
1444 L"LegalNoticeCaption",
1445 &LegalNotice.pszCaption);
1446
1448 L"LegalNoticeText",
1449 &LegalNotice.pszText);
1450
1452 }
1453
1454 if (LegalNotice.pszCaption != NULL && wcslen(LegalNotice.pszCaption) != 0 &&
1455 LegalNotice.pszText != NULL && wcslen(LegalNotice.pszText) != 0)
1456 {
1457 pgContext->pWlxFuncs->WlxDialogBoxParam(pgContext->hWlx,
1458 pgContext->hDllInstance,
1462 (LPARAM)&LegalNotice);
1463 }
1464
1465 if (LegalNotice.pszCaption != NULL)
1466 HeapFree(GetProcessHeap(), 0, LegalNotice.pszCaption);
1467
1468 if (LegalNotice.pszText != NULL)
1469 HeapFree(GetProcessHeap(), 0, LegalNotice.pszText);
1470
1471 result = pgContext->pWlxFuncs->WlxDialogBoxParam(
1472 pgContext->hWlx,
1473 pgContext->hDllInstance,
1477 (LPARAM)pgContext);
1480 {
1481 WARN("WlxLoggedOutSAS() returns 0x%x\n", result);
1482 return result;
1483 }
1484
1485 WARN("WlxDialogBoxParam() failed (0x%x)\n", result);
1486 return WLX_SAS_ACTION_NONE;
1487}
1488
1489
1490static VOID
1492 INT nDlgItem,
1493 PGINA_CONTEXT pgContext)
1494{
1495 WCHAR Buffer1[256];
1496 WCHAR Buffer2[256];
1497 WCHAR Buffer3[512];
1498
1499 LoadStringW(pgContext->hDllInstance, IDS_LOCKMSG, Buffer1, _countof(Buffer1));
1500
1501 wsprintfW(Buffer2, L"%s\\%s", pgContext->DomainName, pgContext->UserName);
1502 wsprintfW(Buffer3, Buffer1, Buffer2);
1503
1504 SetDlgItemTextW(hwnd, nDlgItem, Buffer3);
1505}
1506
1507
1508static
1509BOOL
1511 IN HWND hwndDlg,
1512 IN PGINA_CONTEXT pgContext,
1514{
1515 WCHAR Buffer1[256];
1516 WCHAR Buffer2[256];
1517 LPWSTR UserName = NULL;
1519 BOOL res = FALSE;
1520
1521 if (GetTextboxText(hwndDlg, IDC_UNLOCK_USERNAME, &UserName) && *UserName == '\0')
1522 {
1523 HeapFree(GetProcessHeap(), 0, UserName);
1524 return FALSE;
1525 }
1526
1528 {
1529 if (UserName != NULL && Password != NULL &&
1530 wcscmp(UserName, pgContext->UserName) == 0 &&
1531 wcscmp(Password, pgContext->Password) == 0)
1532 {
1534 res = TRUE;
1535 }
1536 else if (wcscmp(UserName, pgContext->UserName) == 0 &&
1537 wcscmp(Password, pgContext->Password) != 0)
1538 {
1539 /* Wrong Password */
1540 LoadStringW(pgContext->hDllInstance, IDS_LOCKEDWRONGPASSWORD, Buffer2, _countof(Buffer2));
1541 LoadStringW(pgContext->hDllInstance, IDS_COMPUTERLOCKED, Buffer1, _countof(Buffer1));
1542 MessageBoxW(hwndDlg, Buffer2, Buffer1, MB_OK | MB_ICONERROR);
1543 }
1544 else
1545 {
1546 /* Wrong user name */
1547 if (DoAdminUnlock(pgContext, UserName, NULL, Password))
1548 {
1550 res = TRUE;
1551 }
1552 else
1553 {
1554 LoadStringW(pgContext->hDllInstance, IDS_LOCKEDWRONGUSER, Buffer1, _countof(Buffer1));
1555 wsprintfW(Buffer2, Buffer1, pgContext->DomainName, pgContext->UserName);
1556 LoadStringW(pgContext->hDllInstance, IDS_COMPUTERLOCKED, Buffer1, _countof(Buffer1));
1557 MessageBoxW(hwndDlg, Buffer2, Buffer1, MB_OK | MB_ICONERROR);
1558 }
1559 }
1560 }
1561
1562 if (UserName != NULL)
1563 HeapFree(GetProcessHeap(), 0, UserName);
1564
1565 if (Password != NULL)
1566 {
1567 /* Zero out the password buffer before freeing it */
1568 SIZE_T pwdLen = (wcslen(Password) + 1) * sizeof(WCHAR);
1569 SecureZeroMemory(Password, pwdLen);
1571 }
1572
1573 return res;
1574}
1575
1576
1577static
1578INT_PTR
1581 IN HWND hwndDlg,
1582 IN UINT uMsg,
1585{
1586 PDLG_DATA pDlgData;
1588
1589 pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1590
1591 switch (uMsg)
1592 {
1593 case WM_INITDIALOG:
1594 {
1595 pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
1596 if (pDlgData == NULL)
1597 return FALSE;
1598
1599 SetWelcomeText(hwndDlg);
1600
1601 SetLockMessage(hwndDlg, IDC_UNLOCK_MESSAGE, pDlgData->pgContext);
1602
1605
1606 if (pDlgData->pgContext->bDisableCAD)
1608
1609 DlgData_LoadBitmaps(pDlgData);
1610 return TRUE;
1611 }
1612
1613 case WM_PAINT:
1614 {
1615 PAINTSTRUCT ps;
1616 if (pDlgData && pDlgData->hLogoBitmap)
1617 {
1618 BeginPaint(hwndDlg, &ps);
1619 DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1620 EndPaint(hwndDlg, &ps);
1621 }
1622 return TRUE;
1623 }
1624 case WM_DESTROY:
1625 DlgData_Destroy(hwndDlg);
1626 return TRUE;
1627
1628 case WM_COMMAND:
1629 switch (LOWORD(wParam))
1630 {
1631 case IDOK:
1632 if (DoUnlock(hwndDlg, pDlgData->pgContext, &result))
1633 EndDialog(hwndDlg, result);
1634 return TRUE;
1635
1636 case IDCANCEL:
1638 return TRUE;
1639 }
1640 break;
1641 }
1642
1643 return FALSE;
1644}
1645
1646
1647static INT
1649 IN OUT PGINA_CONTEXT pgContext)
1650{
1651 int result;
1652
1653 TRACE("GUILockedSAS()\n");
1654
1655 result = pgContext->pWlxFuncs->WlxDialogBoxParam(
1656 pgContext->hWlx,
1657 pgContext->hDllInstance,
1661 (LPARAM)pgContext);
1664 {
1665 WARN("GUILockedSAS() returns 0x%x\n", result);
1666 return result;
1667 }
1668
1669 WARN("GUILockedSAS() failed (0x%x)\n", result);
1670 return WLX_SAS_ACTION_NONE;
1671}
1672
1673
1674static INT_PTR CALLBACK
1676 IN HWND hwndDlg,
1677 IN UINT uMsg,
1680{
1681 PDLG_DATA pDlgData;
1682
1683 pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1684
1685 switch (uMsg)
1686 {
1687 case WM_INITDIALOG:
1688 {
1689 pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
1690 if (pDlgData == NULL)
1691 return FALSE;
1692
1693 DlgData_LoadBitmaps(pDlgData);
1694
1695 SetWelcomeText(hwndDlg);
1696
1697 SetLockMessage(hwndDlg, IDC_LOCKED_MESSAGE, pDlgData->pgContext);
1698 return TRUE;
1699 }
1700 case WM_PAINT:
1701 {
1702 PAINTSTRUCT ps;
1703 if (pDlgData && pDlgData->hLogoBitmap)
1704 {
1705 BeginPaint(hwndDlg, &ps);
1706 DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1707 EndPaint(hwndDlg, &ps);
1708 }
1709 return TRUE;
1710 }
1711 case WM_DESTROY:
1712 {
1713 DlgData_Destroy(hwndDlg);
1714 return TRUE;
1715 }
1716 }
1717
1718 return FALSE;
1719}
1720
1721
1722static VOID
1724 IN OUT PGINA_CONTEXT pgContext)
1725{
1726 TRACE("GUIdisplayLockedNotice()\n");
1727
1728 pgContext->pWlxFuncs->WlxDialogBoxParam(
1729 pgContext->hWlx,
1730 pgContext->hDllInstance,
1734 (LPARAM)pgContext);
1735}
1736
1746};
#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:1182
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:1267
static BOOL DoLogon(IN HWND hwndDlg, IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1104
static INT_PTR CALLBACK LogonDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:1302
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:874
static DWORD WINAPI StartupWindowThread(LPVOID lpParam)
Definition: gui.c:359
static INT OnShutDown(IN HWND hwndDlg, IN PGINA_CONTEXT pgContext)
Definition: gui.c:925
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:1580
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:1391
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:1069
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:974
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:1675
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:1648
static INT GUILoggedOutSAS(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1426
struct _LEGALNOTICEDATA LEGALNOTICEDATA
GINA_UI GinaGraphicalUI
Definition: gui.c:1737
static INT_PTR CALLBACK ChangePasswordDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:762
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:1491
static VOID GUIDisplayLockedNotice(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1723
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:851
struct _DISPLAYSTATUSMSG DISPLAYSTATUSMSG
struct _LEGALNOTICEDATA * PLEGALNOTICEDATA
#define IDT_BAR
Definition: gui.c:34
static VOID OnInitSecurityDlg(HWND hwnd, PGINA_CONTEXT pgContext)
Definition: gui.c:818
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:909
static BOOL DoUnlock(IN HWND hwndDlg, IN PGINA_CONTEXT pgContext, OUT LPINT Action)
Definition: gui.c:1510
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
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
#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 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
ULONG_PTR SIZE_T
Definition: typedefs.h:80
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
_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 SecureZeroMemory
Definition: winbase.h:1754
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:4914
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:1648
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define WM_CLOSE
Definition: winuser.h:1649
#define IMAGE_BITMAP
Definition: winuser.h:211
#define GetWindowLongPtrW
Definition: winuser.h:4931
#define IDCANCEL
Definition: winuser.h:842
BOOL WINAPI SetThreadDesktop(_In_ HDESK)
#define GetWindowTextLength
Definition: winuser.h:5910
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define WM_COMMAND
Definition: winuser.h:1768
#define CB_ERR
Definition: winuser.h:2471
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:2555
#define CB_SETCURSEL
Definition: winuser.h:1990
#define VK_CONTROL
Definition: winuser.h:2239
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:1988
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1969
#define WM_INITDIALOG
Definition: winuser.h:1767
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:1673
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:1770
#define BM_CLICK
Definition: winuser.h:1946
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:1965
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:5943
#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:1637
#define SetWindowText
Definition: winuser.h:5968
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:5457
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