ReactOS 0.4.15-dev-7788-g1ad9096
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 pgContext->pWlxFuncs->WlxSwitchDesktopToWinlogon(
1071 pgContext->hWlx);
1072
1073 result = pgContext->pWlxFuncs->WlxDialogBoxParam(
1074 pgContext->hWlx,
1075 pgContext->hDllInstance,
1079 (LPARAM)pgContext);
1080
1083 {
1085 }
1086
1088 {
1089 pgContext->pWlxFuncs->WlxSwitchDesktopToUser(
1090 pgContext->hWlx);
1091 }
1092
1093 return result;
1094}
1095
1096
1097static
1098BOOL
1100 IN HWND hwndDlg,
1101 IN OUT PGINA_CONTEXT pgContext)
1102{
1103 LPWSTR UserName = NULL;
1105 LPWSTR Domain = NULL;
1106 BOOL result = FALSE;
1108
1109 if (GetTextboxText(hwndDlg, IDC_LOGON_USERNAME, &UserName) && *UserName == '\0')
1110 goto done;
1111
1112 if (GetTextboxText(hwndDlg, IDC_LOGON_DOMAIN, &Domain) && *Domain == '\0')
1113 goto done;
1114
1116 goto done;
1117
1118 Status = DoLoginTasks(pgContext, UserName, Domain, Password, &SubStatus);
1120 {
1121 ResourceMessageBox(pgContext,
1122 hwndDlg,
1126 goto done;
1127 }
1129 {
1130 TRACE("DoLoginTasks failed! Status 0x%08lx SubStatus 0x%08lx\n", Status, SubStatus);
1131
1133 {
1134 ResourceMessageBox(pgContext,
1135 hwndDlg,
1139 goto done;
1140 }
1142 {
1143 TRACE("Account locked!\n");
1144 ResourceMessageBox(pgContext,
1145 hwndDlg,
1149 goto done;
1150 }
1151 else if ((SubStatus == STATUS_PASSWORD_MUST_CHANGE) ||
1153 {
1155 ResourceMessageBox(pgContext,
1156 hwndDlg,
1160 else
1161 ResourceMessageBox(pgContext,
1162 hwndDlg,
1166
1167 if (!OnChangePassword(hwndDlg,
1168 pgContext))
1169 goto done;
1170
1171 Status = DoLoginTasks(pgContext,
1172 pgContext->UserName,
1173 pgContext->DomainName,
1174 pgContext->Password,
1175 &SubStatus);
1176 if (!NT_SUCCESS(Status))
1177 {
1178 TRACE("Login after password change failed! (Status 0x%08lx)\n", Status);
1179
1180 goto done;
1181 }
1182 }
1184 {
1185 ResourceMessageBox(pgContext,
1186 hwndDlg,
1190 }
1192 {
1193 ResourceMessageBox(pgContext,
1194 hwndDlg,
1198 goto done;
1199 }
1201 {
1202 ResourceMessageBox(pgContext,
1203 hwndDlg,
1207 goto done;
1208 }
1209 else
1210 {
1211 TRACE("Other error!\n");
1212 ResourceMessageBox(pgContext,
1213 hwndDlg,
1217 goto done;
1218 }
1219 }
1220 else if (!NT_SUCCESS(Status))
1221 {
1222 TRACE("DoLoginTasks failed! Status 0x%08lx\n", Status);
1223 goto done;
1224 }
1225
1226 if (!CreateProfile(pgContext, UserName, Domain, Password))
1227 {
1228 ERR("Failed to create the profile!\n");
1229 goto done;
1230 }
1231
1232 ZeroMemory(pgContext->Password, sizeof(pgContext->Password));
1233 wcscpy(pgContext->Password, Password);
1234
1235 result = TRUE;
1236
1237done:
1238 pgContext->bAutoAdminLogon = FALSE;
1239
1240 if (UserName != NULL)
1241 HeapFree(GetProcessHeap(), 0, UserName);
1242
1243 if (Password != NULL)
1245
1246 if (Domain != NULL)
1247 HeapFree(GetProcessHeap(), 0, Domain);
1248
1249 return result;
1250}
1251
1252
1253static
1254VOID
1256 HWND hwndDomainComboBox,
1257 PGINA_CONTEXT pgContext)
1258{
1259 WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1260 DWORD dwComputerNameLength;
1261 LONG lIndex = 0;
1262 LONG lFindIndex;
1263
1264 SendMessageW(hwndDomainComboBox, CB_RESETCONTENT, 0, 0);
1265
1266 dwComputerNameLength = _countof(szComputerName);
1267 if (GetComputerNameW(szComputerName, &dwComputerNameLength))
1268 {
1269 lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)szComputerName);
1270 }
1271
1272 if (wcslen(pgContext->DomainName) != 0)
1273 {
1274 lFindIndex = SendMessageW(hwndDomainComboBox, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)pgContext->DomainName);
1275 if (lFindIndex == CB_ERR)
1276 {
1277 lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)pgContext->DomainName);
1278 }
1279 else
1280 {
1281 lIndex = lFindIndex;
1282 }
1283 }
1284
1285 SendMessageW(hwndDomainComboBox, CB_SETCURSEL, lIndex, 0);
1286}
1287
1288
1289static INT_PTR CALLBACK
1291 IN HWND hwndDlg,
1292 IN UINT uMsg,
1295{
1296 PDLG_DATA pDlgData;
1297
1298 pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1299
1300 switch (uMsg)
1301 {
1302 case WM_INITDIALOG:
1303 {
1304 /* FIXME: take care of NoDomainUI */
1305 pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
1306 if (pDlgData == NULL)
1307 return FALSE;
1308
1309 DlgData_LoadBitmaps(pDlgData);
1310
1311 SetWelcomeText(hwndDlg);
1312
1313 if (pDlgData->pgContext->bAutoAdminLogon ||
1316
1317 if (pDlgData->pgContext->bAutoAdminLogon)
1319
1321
1322 if (pDlgData->pgContext->bDisableCAD)
1324
1325 if (!pDlgData->pgContext->bShutdownWithoutLogon)
1327
1329
1330 if (pDlgData->pgContext->bAutoAdminLogon)
1331 PostMessage(GetDlgItem(hwndDlg, IDOK), BM_CLICK, 0, 0);
1332
1333 return TRUE;
1334 }
1335
1336 case WM_PAINT:
1337 {
1338 PAINTSTRUCT ps;
1339 if (pDlgData && pDlgData->hLogoBitmap)
1340 {
1341 BeginPaint(hwndDlg, &ps);
1342 DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1343 EndPaint(hwndDlg, &ps);
1344 }
1345 return TRUE;
1346 }
1347
1348 case WM_DESTROY:
1349 DlgData_Destroy(hwndDlg);
1350 return TRUE;
1351
1352 case WM_COMMAND:
1353 switch (LOWORD(wParam))
1354 {
1355 case IDOK:
1356 if (DoLogon(hwndDlg, pDlgData->pgContext))
1358 return TRUE;
1359
1360 case IDCANCEL:
1362 return TRUE;
1363
1364 case IDC_LOGON_SHUTDOWN:
1365 if (OnShutDown(hwndDlg, pDlgData->pgContext) == IDOK)
1366 EndDialog(hwndDlg, pDlgData->pgContext->nShutdownAction);
1367 return TRUE;
1368 }
1369 break;
1370 }
1371
1372 return FALSE;
1373}
1374
1375
1376static
1377INT_PTR
1380 IN HWND hwndDlg,
1381 IN UINT uMsg,
1384{
1385 PLEGALNOTICEDATA pLegalNotice;
1386
1387 switch (uMsg)
1388 {
1389 case WM_INITDIALOG:
1390 pLegalNotice = (PLEGALNOTICEDATA)lParam;
1391 SetWindowTextW(hwndDlg, pLegalNotice->pszCaption);
1392 SetDlgItemTextW(hwndDlg, IDC_LEGALNOTICE_TEXT, pLegalNotice->pszText);
1393 return TRUE;
1394
1395 case WM_COMMAND:
1396 switch (LOWORD(wParam))
1397 {
1398 case IDOK:
1399 EndDialog(hwndDlg, 0);
1400 return TRUE;
1401
1402 case IDCANCEL:
1403 EndDialog(hwndDlg, 0);
1404 return TRUE;
1405 }
1406 break;
1407 }
1408
1409 return FALSE;
1410}
1411
1412
1413static INT
1415 IN OUT PGINA_CONTEXT pgContext)
1416{
1417 LEGALNOTICEDATA LegalNotice = {NULL, NULL};
1418 HKEY hKey = NULL;
1419 LONG rc;
1420 int result;
1421
1422 TRACE("GUILoggedOutSAS()\n");
1423
1425 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
1426 0,
1428 &hKey);
1429 if (rc == ERROR_SUCCESS)
1430 {
1432 L"LegalNoticeCaption",
1433 &LegalNotice.pszCaption);
1434
1436 L"LegalNoticeText",
1437 &LegalNotice.pszText);
1438
1440 }
1441
1442 if (LegalNotice.pszCaption != NULL && wcslen(LegalNotice.pszCaption) != 0 &&
1443 LegalNotice.pszText != NULL && wcslen(LegalNotice.pszText) != 0)
1444 {
1445 pgContext->pWlxFuncs->WlxDialogBoxParam(pgContext->hWlx,
1446 pgContext->hDllInstance,
1450 (LPARAM)&LegalNotice);
1451 }
1452
1453 if (LegalNotice.pszCaption != NULL)
1454 HeapFree(GetProcessHeap(), 0, LegalNotice.pszCaption);
1455
1456 if (LegalNotice.pszText != NULL)
1457 HeapFree(GetProcessHeap(), 0, LegalNotice.pszText);
1458
1459 result = pgContext->pWlxFuncs->WlxDialogBoxParam(
1460 pgContext->hWlx,
1461 pgContext->hDllInstance,
1465 (LPARAM)pgContext);
1468 {
1469 WARN("WlxLoggedOutSAS() returns 0x%x\n", result);
1470 return result;
1471 }
1472
1473 WARN("WlxDialogBoxParam() failed (0x%x)\n", result);
1474 return WLX_SAS_ACTION_NONE;
1475}
1476
1477
1478static VOID
1480 INT nDlgItem,
1481 PGINA_CONTEXT pgContext)
1482{
1483 WCHAR Buffer1[256];
1484 WCHAR Buffer2[256];
1485 WCHAR Buffer3[512];
1486
1487 LoadStringW(pgContext->hDllInstance, IDS_LOCKMSG, Buffer1, _countof(Buffer1));
1488
1489 wsprintfW(Buffer2, L"%s\\%s", pgContext->DomainName, pgContext->UserName);
1490 wsprintfW(Buffer3, Buffer1, Buffer2);
1491
1492 SetDlgItemTextW(hwnd, nDlgItem, Buffer3);
1493}
1494
1495
1496static
1497BOOL
1499 IN HWND hwndDlg,
1500 IN PGINA_CONTEXT pgContext,
1502{
1503 WCHAR Buffer1[256];
1504 WCHAR Buffer2[256];
1505 LPWSTR UserName = NULL;
1507 BOOL res = FALSE;
1508
1509 if (GetTextboxText(hwndDlg, IDC_UNLOCK_USERNAME, &UserName) && *UserName == '\0')
1510 {
1511 HeapFree(GetProcessHeap(), 0, UserName);
1512 return FALSE;
1513 }
1514
1516 {
1517 if (UserName != NULL && Password != NULL &&
1518 wcscmp(UserName, pgContext->UserName) == 0 &&
1519 wcscmp(Password, pgContext->Password) == 0)
1520 {
1522 res = TRUE;
1523 }
1524 else if (wcscmp(UserName, pgContext->UserName) == 0 &&
1525 wcscmp(Password, pgContext->Password) != 0)
1526 {
1527 /* Wrong Password */
1528 LoadStringW(pgContext->hDllInstance, IDS_LOCKEDWRONGPASSWORD, Buffer2, _countof(Buffer2));
1529 LoadStringW(pgContext->hDllInstance, IDS_COMPUTERLOCKED, Buffer1, _countof(Buffer1));
1530 MessageBoxW(hwndDlg, Buffer2, Buffer1, MB_OK | MB_ICONERROR);
1531 }
1532 else
1533 {
1534 /* Wrong user name */
1535 if (DoAdminUnlock(pgContext, UserName, NULL, Password))
1536 {
1538 res = TRUE;
1539 }
1540 else
1541 {
1542 LoadStringW(pgContext->hDllInstance, IDS_LOCKEDWRONGUSER, Buffer1, _countof(Buffer1));
1543 wsprintfW(Buffer2, Buffer1, pgContext->DomainName, pgContext->UserName);
1544 LoadStringW(pgContext->hDllInstance, IDS_COMPUTERLOCKED, Buffer1, _countof(Buffer1));
1545 MessageBoxW(hwndDlg, Buffer2, Buffer1, MB_OK | MB_ICONERROR);
1546 }
1547 }
1548 }
1549
1550 if (UserName != NULL)
1551 HeapFree(GetProcessHeap(), 0, UserName);
1552
1553 if (Password != NULL)
1555
1556 return res;
1557}
1558
1559
1560static
1561INT_PTR
1564 IN HWND hwndDlg,
1565 IN UINT uMsg,
1568{
1569 PDLG_DATA pDlgData;
1571
1572 pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1573
1574 switch (uMsg)
1575 {
1576 case WM_INITDIALOG:
1577 {
1578 pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
1579 if (pDlgData == NULL)
1580 return FALSE;
1581
1582 SetWelcomeText(hwndDlg);
1583
1584 SetLockMessage(hwndDlg, IDC_UNLOCK_MESSAGE, pDlgData->pgContext);
1585
1588
1589 if (pDlgData->pgContext->bDisableCAD)
1591
1592 DlgData_LoadBitmaps(pDlgData);
1593 return TRUE;
1594 }
1595
1596 case WM_PAINT:
1597 {
1598 PAINTSTRUCT ps;
1599 if (pDlgData && pDlgData->hLogoBitmap)
1600 {
1601 BeginPaint(hwndDlg, &ps);
1602 DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1603 EndPaint(hwndDlg, &ps);
1604 }
1605 return TRUE;
1606 }
1607 case WM_DESTROY:
1608 DlgData_Destroy(hwndDlg);
1609 return TRUE;
1610
1611 case WM_COMMAND:
1612 switch (LOWORD(wParam))
1613 {
1614 case IDOK:
1615 if (DoUnlock(hwndDlg, pDlgData->pgContext, &result))
1616 EndDialog(hwndDlg, result);
1617 return TRUE;
1618
1619 case IDCANCEL:
1621 return TRUE;
1622 }
1623 break;
1624 }
1625
1626 return FALSE;
1627}
1628
1629
1630static INT
1632 IN OUT PGINA_CONTEXT pgContext)
1633{
1634 int result;
1635
1636 TRACE("GUILockedSAS()\n");
1637
1638 result = pgContext->pWlxFuncs->WlxDialogBoxParam(
1639 pgContext->hWlx,
1640 pgContext->hDllInstance,
1644 (LPARAM)pgContext);
1647 {
1648 WARN("GUILockedSAS() returns 0x%x\n", result);
1649 return result;
1650 }
1651
1652 WARN("GUILockedSAS() failed (0x%x)\n", result);
1653 return WLX_SAS_ACTION_NONE;
1654}
1655
1656
1657static INT_PTR CALLBACK
1659 IN HWND hwndDlg,
1660 IN UINT uMsg,
1663{
1664 PDLG_DATA pDlgData;
1665
1666 pDlgData = (PDLG_DATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1667
1668 switch (uMsg)
1669 {
1670 case WM_INITDIALOG:
1671 {
1672 pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam);
1673 if (pDlgData == NULL)
1674 return FALSE;
1675
1676 DlgData_LoadBitmaps(pDlgData);
1677
1678 SetWelcomeText(hwndDlg);
1679
1680 SetLockMessage(hwndDlg, IDC_LOCKED_MESSAGE, pDlgData->pgContext);
1681 return TRUE;
1682 }
1683 case WM_PAINT:
1684 {
1685 PAINTSTRUCT ps;
1686 if (pDlgData && pDlgData->hLogoBitmap)
1687 {
1688 BeginPaint(hwndDlg, &ps);
1689 DrawStateW(ps.hdc, NULL, NULL, (LPARAM)pDlgData->hLogoBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
1690 EndPaint(hwndDlg, &ps);
1691 }
1692 return TRUE;
1693 }
1694 case WM_DESTROY:
1695 {
1696 DlgData_Destroy(hwndDlg);
1697 return TRUE;
1698 }
1699 }
1700
1701 return FALSE;
1702}
1703
1704
1705static VOID
1707 IN OUT PGINA_CONTEXT pgContext)
1708{
1709 TRACE("GUIdisplayLockedNotice()\n");
1710
1711 pgContext->pWlxFuncs->WlxDialogBoxParam(
1712 pgContext->hWlx,
1713 pgContext->hDllInstance,
1717 (LPARAM)pgContext);
1718}
1719
1729};
#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 IDI_ROSLOGO
Definition: resource.h:42
#define WARN(fmt,...)
Definition: debug.h:112
#define ERR(fmt,...)
Definition: debug.h:110
#define RegCloseKey(hKey)
Definition: registry.h:49
static HINSTANCE hDllInstance
Definition: clb.c:30
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
#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:32
#define IDD_STATUS
Definition: resource.h:22
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3362
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4132
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
#define ISKEYDOWN(x)
Definition: gui.c:36
static VOID SetDomainComboBox(HWND hwndDomainComboBox, PGINA_CONTEXT pgContext)
Definition: gui.c:1255
static BOOL DoLogon(IN HWND hwndDlg, IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1099
static INT_PTR CALLBACK LogonDialogProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: gui.c:1290
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:1563
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:1379
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:1658
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:1631
static INT GUILoggedOutSAS(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1414
struct _LEGALNOTICEDATA LEGALNOTICEDATA
GINA_UI GinaGraphicalUI
Definition: gui.c:1720
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:1479
static VOID GUIDisplayLockedNotice(IN OUT PGINA_CONTEXT pgContext)
Definition: gui.c:1706
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:1498
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 NTAPI 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:49
#define INFINITE
Definition: serial.h:102
static INT cxOld
Definition: eventvwr.c:4313
static INT cyOld
Definition: eventvwr.c:4313
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
GLfloat GLfloat p
Definition: glext.h:8902
GLuint64EXT * result
Definition: glext.h:11304
_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
LANGID WINAPI GetUserDefaultLangID(void)
Definition: lang.c:744
#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:1093
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:993
#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:92
#define _Inout_
Definition: ms_sal.h:378
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:785
BOOL DoAdminUnlock(IN PGINA_CONTEXT pgContext, IN PWSTR UserName, IN PWSTR Domain, IN PWSTR Password)
Definition: msgina.c:665
NTSTATUS DoLoginTasks(IN OUT PGINA_CONTEXT pgContext, IN PWSTR UserName, IN PWSTR Domain, IN PWSTR Password, OUT PNTSTATUS SubStatus)
Definition: msgina.c:752
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)
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:317
_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
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define 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:68
#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:1412
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
BOOL WINAPI RevertToSelf(void)
Definition: security.c:1608
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:243
_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:1539
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:196
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define WM_PAINT
Definition: winuser.h:1620
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define WM_CLOSE
Definition: winuser.h:1621
#define IMAGE_BITMAP
Definition: winuser.h:211
#define GetWindowLongPtrW
Definition: winuser.h:4829
#define IDCANCEL
Definition: winuser.h:831
BOOL WINAPI SetThreadDesktop(_In_ HDESK)
#define GetWindowTextLength
Definition: winuser.h:5799
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define WM_COMMAND
Definition: winuser.h:1740
#define CB_ERR
Definition: winuser.h:2435
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:2203
#define CB_SETCURSEL
Definition: winuser.h:1961
#define VK_CONTROL
Definition: winuser.h:2203
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:1959
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1940
#define WM_INITDIALOG
Definition: winuser.h:1739
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:830
#define WM_DRAWITEM
Definition: winuser.h:1645
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:656
#define MB_ICONERROR
Definition: winuser.h:787
#define MB_OKCANCEL
Definition: winuser.h:804
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:1742
#define BM_CLICK
Definition: winuser.h:1917
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define DST_BITMAP
Definition: winuser.h:516
#define IDNO
Definition: winuser.h:836
#define CB_ADDSTRING
Definition: winuser.h:1936
BOOL WINAPI UpdateWindow(_In_ HWND)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
int WINAPI GetWindowTextLengthW(_In_ HWND)
#define MB_ICONEXCLAMATION
Definition: winuser.h:785
#define MB_OK
Definition: winuser.h:790
#define PostMessage
Definition: winuser.h:5832
#define MB_ICONINFORMATION
Definition: winuser.h:802
#define MB_ICONSTOP
Definition: winuser.h:803
#define LR_DEFAULTCOLOR
Definition: winuser.h:1087
#define WM_DESTROY
Definition: winuser.h:1609
#define SetWindowText
Definition: winuser.h:5857
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:835
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SetWindowLongPtrW
Definition: winuser.h:5346
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:852
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:851
#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