ReactOS 0.4.16-dev-1146-gc477928
users.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS User Manager Control Panel
4 * FILE: dll/cpl/usrmgr/users.c
5 * PURPOSE: Users property page
6 *
7 * PROGRAMMERS: Eric Kohl
8 */
9
10/*
11 * TODO:
12 * - Add new user to the users group.
13 * - Remove a user from all groups.
14 * - Use localized messages.
15 */
16
17#include "usrmgr.h"
18#include <winreg.h>
19
20typedef struct _USER_DATA
21{
23
25
27
28
29
30static BOOL
32 INT nIdDlgItem1,
33 INT nIdDlgItem2)
34{
35 TCHAR szPassword1[PWLEN];
36 TCHAR szPassword2[PWLEN];
37 UINT uLen1;
38 UINT uLen2;
39
40 uLen1 = GetDlgItemText(hwndDlg, nIdDlgItem1, szPassword1, PWLEN);
41 uLen2 = GetDlgItemText(hwndDlg, nIdDlgItem2, szPassword2, PWLEN);
42
43 /* Check the passwords */
44 if (uLen1 != uLen2 || _tcscmp(szPassword1, szPassword2) != 0)
45 {
46 MessageBox(hwndDlg,
47 TEXT("The passwords you entered are not the same!"),
48 TEXT("ERROR"),
50 return FALSE;
51 }
52
53 return TRUE;
54}
55
56
59 UINT uMsg,
62{
63 PUSER_INFO_1003 userInfo;
64
66
67 userInfo = (PUSER_INFO_1003)GetWindowLongPtr(hwndDlg, DWLP_USER);
68
69 switch (uMsg)
70 {
71 case WM_INITDIALOG:
72 userInfo = (PUSER_INFO_1003)lParam;
74 break;
75
76 case WM_COMMAND:
77 switch (LOWORD(wParam))
78 {
79 case IDOK:
81 {
82 /* Store the password */
83 userInfo->usri1003_password =
85
86 EndDialog(hwndDlg, IDOK);
87 }
88 break;
89
90 case IDCANCEL:
91 EndDialog(hwndDlg, IDCANCEL);
92 break;
93 }
94 break;
95
96 default:
97 return FALSE;
98 }
99
100 return TRUE;
101}
102
103
104static VOID
106{
107 TCHAR szUserName[UNLEN + 1];
109 INT nItem;
110 HWND hwndLV;
112
113 ZeroMemory(&user, sizeof(USER_INFO_1003));
114
115 hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
116 nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
117 if (nItem == -1)
118 return;
119
120 /* Get the new user name */
122 nItem, 0,
123 szUserName,
124 UNLEN + 1);
125
128 hwndDlg,
130 (LPARAM)&user) == IDOK)
131 {
133 szUserName,
134 1003,
135 (LPBYTE)&user,
136 NULL);
137 if (status != NERR_Success)
138 {
139 TCHAR szText[256];
140 wsprintf(szText, TEXT("Error: %u"), status);
141 MessageBox(NULL, szText, TEXT("NetUserSetInfo"), MB_ICONERROR | MB_OK);
142 }
143 }
144
145 HeapFree(GetProcessHeap(), 0, user.usri1003_password);
146}
147
148
149static VOID
151 PUSER_INFO_3 userInfo,
152 BOOL bInit)
153{
155 !userInfo->usri3_password_expired);
157 !userInfo->usri3_password_expired);
158
161
162 if (bInit)
163 {
166
169
172
175 }
176}
177
178
181 UINT uMsg,
184{
185 PUSER_INFO_3 userInfo;
186 INT nLength;
187
189
190 userInfo = (PUSER_INFO_3)GetWindowLongPtr(hwndDlg, DWLP_USER);
191
192 switch (uMsg)
193 {
194 case WM_INITDIALOG:
195 userInfo = (PUSER_INFO_3)lParam;
198 UpdateNewUserOptions(hwndDlg, userInfo, TRUE);
199 break;
200
201 case WM_COMMAND:
202 switch (LOWORD(wParam))
203 {
205 if (HIWORD(wParam) == EN_CHANGE)
206 {
208 EnableWindow(GetDlgItem(hwndDlg, IDOK), (nLength > 0));
209 }
210 break;
211
213 userInfo->usri3_password_expired = !userInfo->usri3_password_expired;
214 UpdateNewUserOptions(hwndDlg, userInfo, FALSE);
215 break;
216
219 UpdateNewUserOptions(hwndDlg, userInfo, FALSE);
220 break;
221
224 UpdateNewUserOptions(hwndDlg, userInfo, FALSE);
225 break;
226
228 userInfo->usri3_flags ^= UF_ACCOUNTDISABLE;
229 break;
230
231 case IDOK:
233 {
236 break;
237 }
238
240 {
243 break;
244 }
245
246 /* Store the user name */
248
249 /* Store the full user name */
251
252 /* Store the description */
254
255 /* Store the password */
257
258 EndDialog(hwndDlg, IDOK);
259 break;
260
261 case IDCANCEL:
262 EndDialog(hwndDlg, IDCANCEL);
263 break;
264 }
265 break;
266
267 default:
268 return FALSE;
269 }
270
271 return TRUE;
272}
273
274
275static VOID
276UserNew(HWND hwndDlg)
277{
280 LV_ITEM lvi;
281 INT iItem;
282 HWND hwndLV;
283
284 ZeroMemory(&user, sizeof(USER_INFO_3));
285
286 user.usri3_priv = USER_PRIV_USER;
287 user.usri3_flags = UF_SCRIPT;
288 user.usri3_acct_expires = TIMEQ_FOREVER;
289 user.usri3_max_storage = USER_MAXSTORAGE_UNLIMITED;
290 user.usri3_primary_group_id = DOMAIN_GROUP_RID_USERS;
291
292 user.usri3_password_expired = TRUE;
293
296 hwndDlg,
298 (LPARAM)&user) == IDOK)
299 {
301 3,
302 (LPBYTE)&user,
303 NULL);
304 if (status != NERR_Success)
305 {
306 TCHAR szText[256];
307 wsprintf(szText, TEXT("Error: %u"), status);
308 MessageBox(NULL, szText, TEXT("NetUserAdd"), MB_ICONERROR | MB_OK);
309 return;
310 }
311
312 hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
313
314 ZeroMemory(&lvi, sizeof(lvi));
315 lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
316 lvi.pszText = user.usri3_name;
317 lvi.state = 0;
318 lvi.iImage = (user.usri3_flags & UF_ACCOUNTDISABLE) ? 1 : 0;
319 iItem = ListView_InsertItem(hwndLV, &lvi);
320
321 ListView_SetItemText(hwndLV, iItem, 1,
322 user.usri3_full_name);
323
324 ListView_SetItemText(hwndLV, iItem, 2,
325 user.usri3_comment);
326 }
327
328 HeapFree(GetProcessHeap(), 0, user.usri3_name);
329 HeapFree(GetProcessHeap(), 0, user.usri3_full_name);
330 HeapFree(GetProcessHeap(), 0, user.usri3_comment);
331 HeapFree(GetProcessHeap(), 0, user.usri3_password);
332}
333
334
335static VOID
337{
338 HWND hwndLV;
339 INT nItem;
340
341 hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
342 if (hwndLV == NULL)
343 return;
344
345 nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
346 if (nItem != -1)
347 {
348 (void)ListView_EditLabel(hwndLV, nItem);
349 }
350}
351
352
353static BOOL
355{
356 TCHAR szUserName[UNLEN + 1];
357 TCHAR szText[256];
358 INT nItem;
359 HWND hwndLV;
361
362 hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
363 nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
364 if (nItem == -1)
365 return FALSE;
366
367 /* Get the new user name */
369 nItem, 0,
370 szUserName,
371 UNLEN + 1);
372
373 /* Display a warning message because the delete operation cannot be reverted */
374 wsprintf(szText, TEXT("Do you really want to delete the user \"%s\"?"), szUserName);
375 if (MessageBox(NULL, szText, TEXT("User Accounts"), MB_ICONWARNING | MB_YESNO) == IDNO)
376 return FALSE;
377
378 /* Delete the user */
379 status = NetUserDel(NULL, szUserName);
380 if (status != NERR_Success)
381 {
382 TCHAR szText[256];
383 wsprintf(szText, TEXT("Error: %u"), status);
384 MessageBox(NULL, szText, TEXT("NetUserDel"), MB_ICONERROR | MB_OK);
385 return FALSE;
386 }
387
388 /* Delete the user from the list */
389 (void)ListView_DeleteItem(hwndLV, nItem);
390
391 return TRUE;
392}
393
394
395static VOID
397{
399 RECT rect;
400 TCHAR szStr[32];
401
403
404 memset(&column, 0x00, sizeof(column));
407 column.cx = (INT)((rect.right - rect.left) * 0.25);
408 column.iSubItem = 0;
409 LoadString(hApplet, IDS_NAME, szStr, sizeof(szStr) / sizeof(szStr[0]));
410 column.pszText = szStr;
412
413 column.cx = (INT)((rect.right - rect.left) * 0.50);
414 column.iSubItem = 1;
415 LoadString(hApplet, IDS_FULLNAME, szStr, sizeof(szStr) / sizeof(szStr[0]));
416 column.pszText = szStr;
418
419 column.cx = (INT)((rect.right - rect.left) * 0.25);
420 column.iSubItem = 2;
421 LoadString(hApplet, IDS_DESCRIPTION, szStr, sizeof(szStr) / sizeof(szStr[0]));
422 column.pszText = szStr;
424}
425
426
427static VOID
429{
430 NET_API_STATUS netStatus;
432 DWORD entriesread;
433 DWORD totalentries;
434 DWORD resume_handle = 0;
435 DWORD i;
436 LV_ITEM lvi;
437 INT iItem;
438
439 for (;;)
440 {
441 netStatus = NetUserEnum(NULL, 20, FILTER_NORMAL_ACCOUNT,
442 (LPBYTE*)&pBuffer,
443 1024, &entriesread,
444 &totalentries, &resume_handle);
445 if (netStatus != NERR_Success && netStatus != ERROR_MORE_DATA)
446 break;
447
448 for (i = 0; i < entriesread; i++)
449 {
450 memset(&lvi, 0x00, sizeof(lvi));
451 lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
452 lvi.pszText = pBuffer[i].usri20_name;
453 lvi.state = 0;
454 lvi.iImage = (pBuffer[i].usri20_flags & UF_ACCOUNTDISABLE) ? 1 : 0;
455 iItem = ListView_InsertItem(hwndListView, &lvi);
456
457 if (pBuffer[i].usri20_full_name != NULL)
459 pBuffer[i].usri20_full_name);
460
461 if (pBuffer[i].usri20_comment != NULL)
463 pBuffer[i].usri20_comment);
464 }
465
467
468 /* No more data left */
469 if (netStatus != ERROR_MORE_DATA)
470 break;
471 }
472}
473
474
475static VOID
477{
479 HIMAGELIST hImgList;
480 HICON hIcon;
481
482 /* Create the image list */
483 hImgList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 5, 5);
485 ImageList_AddIcon(hImgList, hIcon);
487 ImageList_AddIcon(hImgList, hIcon);
489
491
493
495
497
499}
500
501
502static BOOL
504{
506
507 hwndEdit = ListView_GetEditControl(pnmv->hdr.hwndFrom);
508 if (hwndEdit == NULL)
509 return TRUE;
510
512
513 return FALSE;
514}
515
516
517static BOOL
519{
520 TCHAR szOldUserName[UNLEN + 1];
521 TCHAR szNewUserName[UNLEN + 1];
522 USER_INFO_0 useri0;
524
525 /* Leave, if there is no valid listview item */
526 if (pnmv->item.iItem == -1)
527 return FALSE;
528
529 /* Get the new user name */
530 ListView_GetItemText(pnmv->hdr.hwndFrom,
531 pnmv->item.iItem, 0,
532 szOldUserName,
533 UNLEN + 1);
534
535 /* Leave, if the user canceled the edit action */
536 if (pnmv->item.pszText == NULL)
537 return FALSE;
538
539 /* Get the new user name */
540 lstrcpy(szNewUserName, pnmv->item.pszText);
541
542 /* Leave, if the user name was not changed */
543 if (lstrcmp(szOldUserName, szNewUserName) == 0)
544 return FALSE;
545
546 /* Check the user name for illegal characters */
547 if (!CheckAccountName(NULL, 0, szNewUserName))
548 return FALSE;
549
550 /* Change the user name */
551 useri0.usri0_name = szNewUserName;
552
553 status = NetUserSetInfo(NULL, szOldUserName, 0, (LPBYTE)&useri0, NULL);
554 if (status != NERR_Success)
555 {
556 TCHAR szText[256];
557 wsprintf(szText, TEXT("Error: %u"), status);
558 MessageBox(NULL, szText, TEXT("NetUserSetInfo"), MB_ICONERROR | MB_OK);
559 return FALSE;
560 }
561
562 /* Update the listview item */
563 ListView_SetItemText(pnmv->hdr.hwndFrom,
564 pnmv->item.iItem, 0,
565 szNewUserName);
566
567 return TRUE;
568}
569
570
571static BOOL
572OnNotify(HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr)
573{
574 LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)phdr;
575
576 switch (phdr->idFrom)
577 {
578 case IDC_USERS_LIST:
579 switch(phdr->code)
580 {
581 case NM_CLICK:
582 pUserData->iCurrentItem = lpnmlv->iItem;
583 break;
584
585 case NM_DBLCLK:
586 if (lpnmlv->iItem != -1)
587 {
588 UINT uItem;
589
590 uItem = GetMenuDefaultItem(GetSubMenu(pUserData->hPopupMenu, 1),
591 FALSE, 0);
592 if (uItem != (UINT)-1)
593 SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(uItem, 0), 0);
594 }
595 break;
596
597 case NM_RCLICK:
599 TrackPopupMenu(GetSubMenu(pUserData->hPopupMenu, (lpnmlv->iItem == -1) ? 0 : 1),
600 TPM_LEFTALIGN, lpnmlv->ptAction.x, lpnmlv->ptAction.y, 0, hwndDlg, NULL);
601 break;
602
604 return OnBeginLabelEdit((LPNMLVDISPINFO)phdr);
605
606 case LVN_ENDLABELEDIT:
607 return OnEndLabelEdit((LPNMLVDISPINFO)phdr);
608 }
609 break;
610 }
611
612 return FALSE;
613}
614
615
616static VOID
618{
619 TCHAR szUserName[UNLEN + 1];
620 INT iItem;
621 HWND hwndLV;
622 PUSER_INFO_2 pUserInfo = NULL;
623 LV_ITEM lvi;
624
625 hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
626 iItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
627 if (iItem == -1)
628 return;
629
630 /* Get the new user name */
632 iItem, 0,
633 szUserName,
634 UNLEN + 1);
635
636 NetUserGetInfo(NULL, szUserName, 2, (LPBYTE*)&pUserInfo);
637
638 memset(&lvi, 0x00, sizeof(lvi));
639 lvi.iItem = iItem;
640 lvi.iSubItem = 0;
641 lvi.mask = LVIF_IMAGE;
642 lvi.iImage = (pUserInfo->usri2_flags & UF_ACCOUNTDISABLE) ? 1 : 0;
643 (void)ListView_SetItem(hwndLV, &lvi);
644
645 ListView_SetItemText(hwndLV, iItem, 1,
646 pUserInfo->usri2_full_name);
647
648 ListView_SetItemText(hwndLV, iItem, 2,
649 pUserInfo->usri2_comment);
650
651 NetApiBufferFree(pUserInfo);
652}
653
655{
656 HKEY hKey;
657 LONG lResult;
658 BOOL bIsChecked;
659 PCWSTR pszAutoAdminLogonValue;
660
662 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
663 0,
664 NULL,
667 NULL,
668 &hKey,
669 NULL);
670 if (lResult != ERROR_SUCCESS)
671 {
672 ERR("OnToggleRequireLogon: Failed to open or create Winlogon registry key. Error code: %ld\n", lResult);
673 return;
674 }
675
677 pszAutoAdminLogonValue = bIsChecked ? L"0" : L"1";
678
679 lResult = RegSetValueExW(hKey,
680 L"AutoAdminLogon",
681 0,
682 REG_SZ,
683 (const BYTE*)pszAutoAdminLogonValue,
684 2 * sizeof(WCHAR));
685 if (lResult != ERROR_SUCCESS)
686 {
687 ERR("OnToggleRequireLogon: Failed to set AutoAdminLogon registry value. Error code: %ld\n", lResult);
688 }
689
691}
692
695 UINT uMsg,
698{
699 PUSER_DATA pUserData;
700
702
703 pUserData = (PUSER_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
704
705 switch (uMsg)
706 {
707 case WM_INITDIALOG:
708 {
709 LONG lResult;
710 HKEY hKey;
711 WCHAR szAutoAdminLogonValue[2];
712 DWORD dwType;
713 DWORD dwSize = sizeof(szAutoAdminLogonValue);
714 BOOL bRequireLogon = TRUE;
715
716 pUserData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pUserData));
717 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pUserData);
718
719 pUserData->hPopupMenu = LoadMenu(hApplet, MAKEINTRESOURCE(IDM_POPUP_USER));
720
721 OnInitDialog(hwndDlg);
723 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
724 0, KEY_READ, &hKey);
725 if (lResult != ERROR_SUCCESS)
726 {
728 break;
729 }
730
731 lResult = RegQueryValueExW(hKey,
732 L"AutoAdminLogon",
733 NULL,
734 &dwType,
735 (LPBYTE)szAutoAdminLogonValue,
736 &dwSize);
738
739 if (lResult == ERROR_SUCCESS && dwType == REG_SZ &&
740 wcscmp(szAutoAdminLogonValue, L"1") == 0)
741 {
742 bRequireLogon = FALSE;
743 }
744
746
747 SetMenuDefaultItem(GetSubMenu(pUserData->hPopupMenu, 1),
749 FALSE);
750 break;
751 }
752
753 case WM_COMMAND:
754 switch (LOWORD(wParam))
755 {
757 UserChangePassword(hwndDlg);
758 break;
759
760 case IDM_USER_RENAME:
761 UserRename(hwndDlg);
762 break;
763
764 case IDM_USER_NEW:
765 case IDC_USERS_ADD:
766 UserNew(hwndDlg);
767 break;
768
769 case IDM_USER_DELETE:
770 case IDC_USERS_REMOVE:
771 UserDelete(hwndDlg);
772 break;
773
776 if (UserProperties(hwndDlg))
777 {
778 UpdateUserProperties(hwndDlg);
779 }
780 break;
782 OnToggleRequireLogon(hwndDlg);
783 break;
784 }
785 break;
786
787 case WM_NOTIFY:
788 return OnNotify(hwndDlg, pUserData, (NMHDR *)lParam);
789
790 case WM_DESTROY:
791 DestroyMenu(pUserData->hPopupMenu);
792 HeapFree(GetProcessHeap(), 0, pUserData);
793 break;
794 }
795
796 return FALSE;
797}
#define VOID
Definition: acefi.h:82
#define IDS_DESCRIPTION
Definition: resource.h:4
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define ERR(fmt,...)
Definition: precomp.h:57
#define RegCloseKey(hKey)
Definition: registry.h:49
WPARAM wParam
Definition: combotst.c:138
HWND hwndEdit
Definition: combotst.c:65
LPARAM lParam
Definition: combotst.c:139
#define ERROR_MORE_DATA
Definition: dderror.h:13
#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
HINSTANCE hApplet
Definition: access.c:17
BOOL CheckAccountName(HWND hwndDlg, INT nIdDlgItem, LPTSTR lpAccountName)
Definition: misc.c:13
#define IDM_USER_DELETE
Definition: resource.h:106
#define IDC_USERS_PROPERTIES
Definition: resource.h:34
#define IDS_FULLNAME
Definition: resource.h:91
#define IDC_USER_NEW_FULL_NAME
Definition: resource.h:55
#define IDC_USER_NEW_CANNOT_CHANGE
Definition: resource.h:60
#define IDC_USER_NEW_DESCRIPTION
Definition: resource.h:56
#define IDC_USERS_REMOVE
Definition: resource.h:33
#define IDM_USER_CHANGE_PASSWORD
Definition: resource.h:104
#define IDC_USER_NEW_NAME
Definition: resource.h:54
#define IDM_POPUP_USER
Definition: resource.h:103
#define IDD_CHANGE_PASSWORD
Definition: resource.h:49
#define IDC_EDIT_PASSWORD1
Definition: resource.h:50
#define IDC_USERS_LIST
Definition: resource.h:14
#define IDC_EDIT_PASSWORD2
Definition: resource.h:51
#define IDM_USER_RENAME
Definition: resource.h:107
#define IDD_USER_NEW
Definition: resource.h:53
#define IDC_USER_NEW_NEVER_EXPIRES
Definition: resource.h:61
#define IDM_USER_PROPERTIES
Definition: resource.h:108
#define IDS_NAME
Definition: resource.h:90
#define IDI_USER
Definition: resource.h:6
#define IDC_USER_NEW_PASSWORD2
Definition: resource.h:58
#define IDC_USER_NEW_FORCE_CHANGE
Definition: resource.h:59
#define IDC_USERS_STARTUP_REQUIRE
Definition: resource.h:35
#define IDM_USER_NEW
Definition: resource.h:105
#define IDC_USER_NEW_DISABLED
Definition: resource.h:62
#define IDC_USERS_ADD
Definition: resource.h:32
#define IDC_USER_NEW_PASSWORD1
Definition: resource.h:57
#define IDI_LOCKED_USER
Definition: resource.h:7
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
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
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
NET_API_STATUS WINAPI NetUserEnum(LPCWSTR servername, DWORD level, DWORD filter, LPBYTE *bufptr, DWORD prefmaxlen, LPDWORD entriesread, LPDWORD totalentries, LPDWORD resume_handle)
Definition: user.c:2740
NET_API_STATUS WINAPI NetUserAdd(LPCWSTR servername, DWORD level, LPBYTE bufptr, LPDWORD parm_err)
Definition: user.c:2273
NET_API_STATUS WINAPI NetUserGetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE *bufptr)
Definition: user.c:3147
NET_API_STATUS WINAPI NetUserSetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE buf, LPDWORD parm_err)
Definition: user.c:3975
NET_API_STATUS WINAPI NetUserDel(LPCWSTR servername, LPCWSTR username)
Definition: user.c:2543
HWND hwndListView
Definition: eventvwr.c:66
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define _tcscmp
Definition: tchar.h:1424
#define TEXT(s)
Definition: k32.h:26
#define REG_SZ
Definition: layer.c:22
#define UF_ACCOUNTDISABLE
Definition: lmaccess.h:24
#define USER_PRIV_USER
Definition: lmaccess.h:117
#define UF_DONT_EXPIRE_PASSWD
Definition: lmaccess.h:37
#define UF_PASSWD_CANT_CHANGE
Definition: lmaccess.h:28
struct _USER_INFO_3 * PUSER_INFO_3
struct _USER_INFO_1003 * PUSER_INFO_1003
#define UF_SCRIPT
Definition: lmaccess.h:23
#define TIMEQ_FOREVER
Definition: lmaccess.h:110
#define USER_MAXSTORAGE_UNLIMITED
Definition: lmaccess.h:111
#define FILTER_NORMAL_ACCOUNT
Definition: lmaccess.h:40
#define PWLEN
Definition: lmcons.h:37
#define NERR_Success
Definition: lmerr.h:5
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static HICON
Definition: imagelist.c:80
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
HICON hIcon
Definition: msconfig.c:44
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define _In_
Definition: no_sal2.h:158
#define KEY_READ
Definition: nt_native.h:1023
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
#define L(x)
Definition: ntvdm.h:50
#define MAKEINTRESOURCE(i)
Definition: ntverrsrc.c:25
#define LOWORD(l)
Definition: pedump.c:82
long LONG
Definition: pedump.c:60
#define INT
Definition: polytest.cpp:20
#define LVSIL_SMALL
Definition: commctrl.h:2304
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2413
#define ListView_EditLabel(hwndLV, i)
Definition: commctrl.h:2545
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2641
#define NM_DBLCLK
Definition: commctrl.h:131
#define LVIF_STATE
Definition: commctrl.h:2317
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2309
#define ListView_GetEditControl(hwndLV)
Definition: commctrl.h:2548
#define LVNI_SELECTED
Definition: commctrl.h:2429
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2689
#define LVN_ENDLABELEDIT
Definition: commctrl.h:3164
#define LVCF_WIDTH
Definition: commctrl.h:2592
#define ILC_COLOR32
Definition: commctrl.h:358
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2439
#define NM_CLICK
Definition: commctrl.h:130
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2739
#define LVN_BEGINLABELEDIT
Definition: commctrl.h:3163
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
Definition: commctrl.h:2730
#define LV_ITEM
Definition: commctrl.h:2342
struct tagNMLISTVIEW * LPNMLISTVIEW
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2696
#define LVIF_TEXT
Definition: commctrl.h:2314
#define ListView_SetItem(hwnd, pitem)
Definition: commctrl.h:2406
#define LVCF_FMT
Definition: commctrl.h:2591
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define NM_RCLICK
Definition: commctrl.h:133
#define LVCF_SUBITEM
Definition: commctrl.h:2594
#define LVCFMT_LEFT
Definition: commctrl.h:2603
#define ILC_MASK
Definition: commctrl.h:351
#define ListView_DeleteItem(hwnd, i)
Definition: commctrl.h:2416
#define LVIF_IMAGE
Definition: commctrl.h:2315
#define LVCF_TEXT
Definition: commctrl.h:2593
#define LV_COLUMN
Definition: commctrl.h:2552
PVOID pBuffer
#define LPNMLVDISPINFO
Definition: commctrl.h:77
#define WM_NOTIFY
Definition: richedit.h:61
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define memset(x, y, z)
Definition: compat.h:39
#define UNLEN
Definition: sspi.c:28
& rect
Definition: startmenu.cpp:1413
HMENU hPopupMenu
Definition: users.c:22
INT iCurrentItem
Definition: users.c:24
LPWSTR usri0_name
Definition: lmaccess.h:201
LPWSTR usri1003_password
Definition: lmaccess.h:372
DWORD usri2_flags
Definition: lmaccess.h:219
LPWSTR usri2_full_name
Definition: lmaccess.h:222
LPWSTR usri2_comment
Definition: lmaccess.h:218
LPWSTR usri3_name
Definition: lmaccess.h:239
LPWSTR usri3_password
Definition: lmaccess.h:240
LPWSTR usri3_comment
Definition: lmaccess.h:244
DWORD usri3_flags
Definition: lmaccess.h:245
DWORD usri3_password_expired
Definition: lmaccess.h:267
LPWSTR usri3_full_name
Definition: lmaccess.h:248
Definition: ps.c:97
UINT_PTR idFrom
Definition: winuser.h:3169
UINT code
Definition: winuser.h:3170
POINT ptAction
Definition: commctrl.h:3044
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
BOOL UserProperties(HWND hwndDlg)
Definition: userprops.c:828
static BOOL UserDelete(HWND hwndDlg)
Definition: users.c:354
struct _USER_DATA * PUSER_DATA
INT_PTR CALLBACK ChangePasswordDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: users.c:58
static VOID SetUsersListColumns(HWND hwndListView)
Definition: users.c:396
INT_PTR CALLBACK UsersPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: users.c:694
static VOID UpdateUsersList(HWND hwndListView)
Definition: users.c:428
VOID OnToggleRequireLogon(_In_ HWND hwndDlg)
Definition: users.c:654
static VOID OnInitDialog(HWND hwndDlg)
Definition: users.c:476
static VOID UpdateNewUserOptions(HWND hwndDlg, PUSER_INFO_3 userInfo, BOOL bInit)
Definition: users.c:150
static VOID UserNew(HWND hwndDlg)
Definition: users.c:276
static BOOL OnNotify(HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr)
Definition: users.c:572
struct _USER_DATA USER_DATA
static BOOL OnBeginLabelEdit(LPNMLVDISPINFO pnmv)
Definition: users.c:503
INT_PTR CALLBACK NewUserDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: users.c:180
static VOID UserChangePassword(HWND hwndDlg)
Definition: users.c:105
static VOID UpdateUserProperties(HWND hwndDlg)
Definition: users.c:617
static BOOL CheckPasswords(HWND hwndDlg, INT nIdDlgItem1, INT nIdDlgItem2)
Definition: users.c:31
static BOOL OnEndLabelEdit(LPNMLVDISPINFO pnmv)
Definition: users.c:518
static VOID UserRename(HWND hwndDlg)
Definition: users.c:336
LPTSTR GetDlgItemTextAlloc(HWND hwndDlg, INT nDlgItem)
Definition: usrmgr.c:19
#define ZeroMemory
Definition: winbase.h:1743
#define lstrcmp
Definition: winbase.h:3903
#define lstrcpy
Definition: winbase.h:3905
_In_ DWORD nLength
Definition: wincon.h:473
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define MAKEWPARAM(l, h)
Definition: winuser.h:4020
#define WM_GETTEXTLENGTH
Definition: winuser.h:1630
UINT WINAPI GetMenuDefaultItem(_In_ HMENU hMenu, _In_ UINT fByPos, _In_ UINT gmdiFlags)
#define DWLP_USER
Definition: winuser.h:883
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define IDCANCEL
Definition: winuser.h:842
#define BST_UNCHECKED
Definition: winuser.h:199
#define IMAGE_ICON
Definition: winuser.h:212
#define GetDlgItemText
Definition: winuser.h:5805
#define WM_COMMAND
Definition: winuser.h:1751
#define DialogBoxParam
Definition: winuser.h:5784
#define WM_INITDIALOG
Definition: winuser.h:1750
#define MB_YESNO
Definition: winuser.h:828
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:841
#define MB_ICONERROR
Definition: winuser.h:798
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define EM_SETLIMITTEXT
Definition: winuser.h:2022
#define TPM_LEFTALIGN
Definition: winuser.h:2388
#define IDNO
Definition: winuser.h:847
#define SendMessage
Definition: winuser.h:5863
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define EM_SETSEL
Definition: winuser.h:2029
#define LoadMenu
Definition: winuser.h:5837
#define MB_OK
Definition: winuser.h:801
#define wsprintf
Definition: winuser.h:5885
#define MB_ICONWARNING
Definition: winuser.h:797
#define LoadImage
Definition: winuser.h:5835
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define LoadString
Definition: winuser.h:5839
#define MessageBox
Definition: winuser.h:5842
#define LR_DEFAULTCOLOR
Definition: winuser.h:1098
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define WM_DESTROY
Definition: winuser.h:1620
#define SendDlgItemMessage
Definition: winuser.h:5862
#define SetDlgItemText
Definition: winuser.h:5869
#define BST_CHECKED
Definition: winuser.h:197
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2390
#define EN_CHANGE
Definition: winuser.h:2033
#define DOMAIN_GROUP_RID_USERS
Definition: setypes.h:640
char TCHAR
Definition: xmlstorage.h:189
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193