ReactOS  0.4.14-dev-77-gd9e7c48
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 
19 typedef struct _USER_DATA
20 {
22 
24 
26 
27 
28 
29 static BOOL
31  INT nIdDlgItem1,
32  INT nIdDlgItem2)
33 {
34  TCHAR szPassword1[PWLEN];
35  TCHAR szPassword2[PWLEN];
36  UINT uLen1;
37  UINT uLen2;
38 
39  uLen1 = GetDlgItemText(hwndDlg, nIdDlgItem1, szPassword1, PWLEN);
40  uLen2 = GetDlgItemText(hwndDlg, nIdDlgItem2, szPassword2, PWLEN);
41 
42  /* Check the passwords */
43  if (uLen1 != uLen2 || _tcscmp(szPassword1, szPassword2) != 0)
44  {
45  MessageBox(hwndDlg,
46  TEXT("The passwords you entered are not the same!"),
47  TEXT("ERROR"),
49  return FALSE;
50  }
51 
52  return TRUE;
53 }
54 
55 
58  UINT uMsg,
59  WPARAM wParam,
60  LPARAM lParam)
61 {
62  PUSER_INFO_1003 userInfo;
63  INT nLength;
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 
83  /* Store the password */
85  if (nLength > 0)
86  {
89  }
90 
91  EndDialog(hwndDlg, IDOK);
92  }
93  break;
94 
95  case IDCANCEL:
96  EndDialog(hwndDlg, IDCANCEL);
97  break;
98  }
99  break;
100 
101  default:
102  return FALSE;
103  }
104 
105  return TRUE;
106 }
107 
108 
109 static VOID
111 {
112  TCHAR szUserName[UNLEN];
114  INT nItem;
115  HWND hwndLV;
117 
118  ZeroMemory(&user, sizeof(USER_INFO_1003));
119 
120  hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
121  nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
122  if (nItem == -1)
123  return;
124 
125  /* Get the new user name */
126  ListView_GetItemText(hwndLV,
127  nItem, 0,
128  szUserName,
129  UNLEN);
130 
133  hwndDlg,
135  (LPARAM)&user) == IDOK)
136  {
138  szUserName,
139  1003,
140  (LPBYTE)&user,
141  NULL);
142  if (status != NERR_Success)
143  {
144  TCHAR szText[256];
145  wsprintf(szText, TEXT("Error: %u"), status);
146  MessageBox(NULL, szText, TEXT("NetUserSetInfo"), MB_ICONERROR | MB_OK);
147  }
148  }
149 
150  if (user.usri1003_password)
151  HeapFree(GetProcessHeap(), 0, user.usri1003_password);
152 }
153 
154 
155 static VOID
157  PUSER_INFO_3 userInfo,
158  BOOL bInit)
159 {
161  !userInfo->usri3_password_expired);
163  !userInfo->usri3_password_expired);
164 
167 
168  if (bInit)
169  {
172 
175 
178 
181  }
182 }
183 
184 
187  UINT uMsg,
188  WPARAM wParam,
189  LPARAM lParam)
190 {
191  PUSER_INFO_3 userInfo;
192  INT nLength;
193 
195 
196  userInfo = (PUSER_INFO_3)GetWindowLongPtr(hwndDlg, DWLP_USER);
197 
198  switch (uMsg)
199  {
200  case WM_INITDIALOG:
201  userInfo = (PUSER_INFO_3)lParam;
202  SetWindowLongPtr(hwndDlg, DWLP_USER, lParam);
204  UpdateNewUserOptions(hwndDlg, userInfo, TRUE);
205  break;
206 
207  case WM_COMMAND:
208  switch (LOWORD(wParam))
209  {
210  case IDC_USER_NEW_NAME:
211  if (HIWORD(wParam) == EN_CHANGE)
212  {
214  EnableWindow(GetDlgItem(hwndDlg, IDOK), (nLength > 0));
215  }
216  break;
217 
219  userInfo->usri3_password_expired = !userInfo->usri3_password_expired;
220  UpdateNewUserOptions(hwndDlg, userInfo, FALSE);
221  break;
222 
224  userInfo->usri3_flags ^= UF_PASSWD_CANT_CHANGE;
225  UpdateNewUserOptions(hwndDlg, userInfo, FALSE);
226  break;
227 
229  userInfo->usri3_flags ^= UF_DONT_EXPIRE_PASSWD;
230  UpdateNewUserOptions(hwndDlg, userInfo, FALSE);
231  break;
232 
234  userInfo->usri3_flags ^= UF_ACCOUNTDISABLE;
235  break;
236 
237  case IDOK:
238  if (!CheckAccountName(hwndDlg, IDC_USER_NEW_NAME, NULL))
239  {
242  break;
243  }
244 
246  {
249  break;
250  }
251 
252  /* Store the user name */
254  if (nLength > 0)
255  {
256  userInfo->usri3_name = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR));
257  GetDlgItemText(hwndDlg, IDC_USER_NEW_NAME, userInfo->usri3_name, nLength + 1);
258  }
259 
260  /* Store the full user name */
262  if (nLength > 0)
263  {
264  userInfo->usri3_full_name = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR));
266  }
267 
268  /* Store the description */
270  if (nLength > 0)
271  {
272  userInfo->usri3_comment = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR));
274  }
275 
276  /* Store the password */
278  if (nLength > 0)
279  {
280  userInfo->usri3_password = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR));
282  }
283 
284  EndDialog(hwndDlg, IDOK);
285  break;
286 
287  case IDCANCEL:
288  EndDialog(hwndDlg, IDCANCEL);
289  break;
290  }
291  break;
292 
293  default:
294  return FALSE;
295  }
296 
297  return TRUE;
298 }
299 
300 
301 static VOID
302 UserNew(HWND hwndDlg)
303 {
306  LV_ITEM lvi;
307  INT iItem;
308  HWND hwndLV;
309 
310  ZeroMemory(&user, sizeof(USER_INFO_3));
311 
312  user.usri3_priv = USER_PRIV_USER;
313  user.usri3_flags = UF_SCRIPT;
314  user.usri3_acct_expires = TIMEQ_FOREVER;
315  user.usri3_max_storage = USER_MAXSTORAGE_UNLIMITED;
316  user.usri3_primary_group_id = DOMAIN_GROUP_RID_USERS;
317 
318  user.usri3_password_expired = TRUE;
319 
322  hwndDlg,
324  (LPARAM)&user) == IDOK)
325  {
327  3,
328  (LPBYTE)&user,
329  NULL);
330  if (status != NERR_Success)
331  {
332  TCHAR szText[256];
333  wsprintf(szText, TEXT("Error: %u"), status);
334  MessageBox(NULL, szText, TEXT("NetUserAdd"), MB_ICONERROR | MB_OK);
335  return;
336  }
337 
338  hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
339 
340  ZeroMemory(&lvi, sizeof(lvi));
341  lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
342  lvi.pszText = user.usri3_name;
343  lvi.state = 0;
344  lvi.iImage = (user.usri3_flags & UF_ACCOUNTDISABLE) ? 1 : 0;
345  iItem = ListView_InsertItem(hwndLV, &lvi);
346 
347  ListView_SetItemText(hwndLV, iItem, 1,
348  user.usri3_full_name);
349 
350  ListView_SetItemText(hwndLV, iItem, 2,
351  user.usri3_comment);
352  }
353 
354  if (user.usri3_name)
355  HeapFree(GetProcessHeap(), 0, user.usri3_name);
356 
357  if (user.usri3_full_name)
358  HeapFree(GetProcessHeap(), 0, user.usri3_full_name);
359 
360  if (user.usri3_comment)
361  HeapFree(GetProcessHeap(), 0, user.usri3_comment);
362 
363  if (user.usri3_password)
364  HeapFree(GetProcessHeap(), 0, user.usri3_password);
365 }
366 
367 
368 static VOID
369 UserRename(HWND hwndDlg)
370 {
371  HWND hwndLV;
372  INT nItem;
373 
374  hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
375  if (hwndLV == NULL)
376  return;
377 
378  nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
379  if (nItem != -1)
380  {
381  (void)ListView_EditLabel(hwndLV, nItem);
382  }
383 }
384 
385 
386 static BOOL
387 UserDelete(HWND hwndDlg)
388 {
389  TCHAR szUserName[UNLEN];
390  TCHAR szText[256];
391  INT nItem;
392  HWND hwndLV;
394 
395  hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
396  nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
397  if (nItem == -1)
398  return FALSE;
399 
400  /* Get the new user name */
401  ListView_GetItemText(hwndLV,
402  nItem, 0,
403  szUserName,
404  UNLEN);
405 
406  /* Display a warning message because the delete operation cannot be reverted */
407  wsprintf(szText, TEXT("Do you really want to delete the user \"%s\"?"), szUserName);
408  if (MessageBox(NULL, szText, TEXT("User Accounts"), MB_ICONWARNING | MB_YESNO) == IDNO)
409  return FALSE;
410 
411  /* Delete the user */
412  status = NetUserDel(NULL, szUserName);
413  if (status != NERR_Success)
414  {
415  TCHAR szText[256];
416  wsprintf(szText, TEXT("Error: %u"), status);
417  MessageBox(NULL, szText, TEXT("NetUserDel"), MB_ICONERROR | MB_OK);
418  return FALSE;
419  }
420 
421  /* Delete the user from the list */
422  (void)ListView_DeleteItem(hwndLV, nItem);
423 
424  return TRUE;
425 }
426 
427 
428 static VOID
430 {
432  RECT rect;
433  TCHAR szStr[32];
434 
436 
437  memset(&column, 0x00, sizeof(column));
439  column.fmt=LVCFMT_LEFT;
440  column.cx = (INT)((rect.right - rect.left) * 0.25);
441  column.iSubItem = 0;
442  LoadString(hApplet, IDS_NAME, szStr, sizeof(szStr) / sizeof(szStr[0]));
443  column.pszText = szStr;
445 
446  column.cx = (INT)((rect.right - rect.left) * 0.50);
447  column.iSubItem = 1;
448  LoadString(hApplet, IDS_FULLNAME, szStr, sizeof(szStr) / sizeof(szStr[0]));
449  column.pszText = szStr;
451 
452  column.cx = (INT)((rect.right - rect.left) * 0.25);
453  column.iSubItem = 2;
454  LoadString(hApplet, IDS_DESCRIPTION, szStr, sizeof(szStr) / sizeof(szStr[0]));
455  column.pszText = szStr;
457 }
458 
459 
460 static VOID
462 {
463  NET_API_STATUS netStatus;
465  DWORD entriesread;
466  DWORD totalentries;
467  DWORD resume_handle = 0;
468  DWORD i;
469  LV_ITEM lvi;
470  INT iItem;
471 
472  for (;;)
473  {
474  netStatus = NetUserEnum(NULL, 20, FILTER_NORMAL_ACCOUNT,
475  (LPBYTE*)&pBuffer,
476  1024, &entriesread,
477  &totalentries, &resume_handle);
478  if (netStatus != NERR_Success && netStatus != ERROR_MORE_DATA)
479  break;
480 
481  for (i = 0; i < entriesread; i++)
482  {
483  memset(&lvi, 0x00, sizeof(lvi));
484  lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
485  lvi.pszText = pBuffer[i].usri20_name;
486  lvi.state = 0;
487  lvi.iImage = (pBuffer[i].usri20_flags & UF_ACCOUNTDISABLE) ? 1 : 0;
488  iItem = ListView_InsertItem(hwndListView, &lvi);
489 
490  if (pBuffer[i].usri20_full_name != NULL)
492  pBuffer[i].usri20_full_name);
493 
494  if (pBuffer[i].usri20_comment != NULL)
496  pBuffer[i].usri20_comment);
497  }
498 
500 
501  /* No more data left */
502  if (netStatus != ERROR_MORE_DATA)
503  break;
504  }
505 }
506 
507 
508 static VOID
510 {
512  HIMAGELIST hImgList;
513  HICON hIcon;
514 
515  /* Create the image list */
516  hImgList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 5, 5);
518  ImageList_AddIcon(hImgList, hIcon);
520  ImageList_AddIcon(hImgList, hIcon);
522 
524 
526 
528 
530 
532 }
533 
534 
535 static BOOL
537 {
538  HWND hwndEdit;
539 
540  hwndEdit = ListView_GetEditControl(pnmv->hdr.hwndFrom);
541  if (hwndEdit == NULL)
542  return TRUE;
543 
545 
546  return FALSE;
547 }
548 
549 
550 static BOOL
552 {
553  TCHAR szOldUserName[UNLEN];
554  TCHAR szNewUserName[UNLEN];
555  USER_INFO_0 useri0;
557 
558  /* Leave, if there is no valid listview item */
559  if (pnmv->item.iItem == -1)
560  return FALSE;
561 
562  /* Get the new user name */
563  ListView_GetItemText(pnmv->hdr.hwndFrom,
564  pnmv->item.iItem, 0,
565  szOldUserName,
566  UNLEN);
567 
568  /* Leave, if the user canceled the edit action */
569  if (pnmv->item.pszText == NULL)
570  return FALSE;
571 
572  /* Get the new user name */
573  lstrcpy(szNewUserName, pnmv->item.pszText);
574 
575  /* Leave, if the user name was not changed */
576  if (lstrcmp(szOldUserName, szNewUserName) == 0)
577  return FALSE;
578 
579  /* Check the user name for illegal characters */
580  if (!CheckAccountName(NULL, 0, szNewUserName))
581  return FALSE;
582 
583  /* Change the user name */
584  useri0.usri0_name = szNewUserName;
585 
586  status = NetUserSetInfo(NULL, szOldUserName, 0, (LPBYTE)&useri0, NULL);
587  if (status != NERR_Success)
588  {
589  TCHAR szText[256];
590  wsprintf(szText, TEXT("Error: %u"), status);
591  MessageBox(NULL, szText, TEXT("NetUserSetInfo"), MB_ICONERROR | MB_OK);
592  return FALSE;
593  }
594 
595  /* Update the listview item */
596  ListView_SetItemText(pnmv->hdr.hwndFrom,
597  pnmv->item.iItem, 0,
598  szNewUserName);
599 
600  return TRUE;
601 }
602 
603 
604 static BOOL
605 OnNotify(HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr)
606 {
607  LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)phdr;
608 
609  switch (phdr->idFrom)
610  {
611  case IDC_USERS_LIST:
612  switch(phdr->code)
613  {
614  case NM_CLICK:
615  pUserData->iCurrentItem = lpnmlv->iItem;
616  break;
617 
618  case NM_DBLCLK:
619  if (lpnmlv->iItem != -1)
620  {
621  UINT uItem;
622 
623  uItem = GetMenuDefaultItem(GetSubMenu(pUserData->hPopupMenu, 1),
624  FALSE, 0);
625  if (uItem != (UINT)-1)
626  SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(uItem, 0), 0);
627  }
628  break;
629 
630  case NM_RCLICK:
631  ClientToScreen(GetDlgItem(hwndDlg, IDC_USERS_LIST), &lpnmlv->ptAction);
632  TrackPopupMenu(GetSubMenu(pUserData->hPopupMenu, (lpnmlv->iItem == -1) ? 0 : 1),
633  TPM_LEFTALIGN, lpnmlv->ptAction.x, lpnmlv->ptAction.y, 0, hwndDlg, NULL);
634  break;
635 
636  case LVN_BEGINLABELEDIT:
637  return OnBeginLabelEdit((LPNMLVDISPINFO)phdr);
638 
639  case LVN_ENDLABELEDIT:
640  return OnEndLabelEdit((LPNMLVDISPINFO)phdr);
641  }
642  break;
643  }
644 
645  return FALSE;
646 }
647 
648 
649 static VOID
651 {
652  TCHAR szUserName[UNLEN];
653  INT iItem;
654  HWND hwndLV;
655  PUSER_INFO_2 pUserInfo = NULL;
656  LV_ITEM lvi;
657 
658  hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
659  iItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
660  if (iItem == -1)
661  return;
662 
663  /* Get the new user name */
664  ListView_GetItemText(hwndLV,
665  iItem, 0,
666  szUserName,
667  UNLEN);
668 
669  NetUserGetInfo(NULL, szUserName, 2, (LPBYTE*)&pUserInfo);
670 
671  memset(&lvi, 0x00, sizeof(lvi));
672  lvi.iItem = iItem;
673  lvi.iSubItem = 0;
674  lvi.mask = LVIF_IMAGE;
675  lvi.iImage = (pUserInfo->usri2_flags & UF_ACCOUNTDISABLE) ? 1 : 0;
676  (void)ListView_SetItem(hwndLV, &lvi);
677 
678  ListView_SetItemText(hwndLV, iItem, 1,
679  pUserInfo->usri2_full_name);
680 
681  ListView_SetItemText(hwndLV, iItem, 2,
682  pUserInfo->usri2_comment);
683 
684  NetApiBufferFree(pUserInfo);
685 }
686 
687 
690  UINT uMsg,
691  WPARAM wParam,
692  LPARAM lParam)
693 {
694  PUSER_DATA pUserData;
695 
697 
698  pUserData = (PUSER_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
699 
700  switch (uMsg)
701  {
702  case WM_INITDIALOG:
703  pUserData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(USER_DATA));
704  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pUserData);
705 
706  pUserData->hPopupMenu = LoadMenu(hApplet, MAKEINTRESOURCE(IDM_POPUP_USER));
707 
708  OnInitDialog(hwndDlg);
709  SetMenuDefaultItem(GetSubMenu(pUserData->hPopupMenu, 1),
711  FALSE);
712  break;
713 
714  case WM_COMMAND:
715  switch (LOWORD(wParam))
716  {
718  UserChangePassword(hwndDlg);
719  break;
720 
721  case IDM_USER_RENAME:
722  UserRename(hwndDlg);
723  break;
724 
725  case IDM_USER_NEW:
726  case IDC_USERS_ADD:
727  UserNew(hwndDlg);
728  break;
729 
730  case IDM_USER_DELETE:
731  case IDC_USERS_REMOVE:
732  UserDelete(hwndDlg);
733  break;
734 
735  case IDM_USER_PROPERTIES:
737  if (UserProperties(hwndDlg))
738  {
739  UpdateUserProperties(hwndDlg);
740  }
741  break;
742  }
743  break;
744 
745  case WM_NOTIFY:
746  return OnNotify(hwndDlg, pUserData, (NMHDR *)lParam);
747 
748  case WM_DESTROY:
749  DestroyMenu(pUserData->hPopupMenu);
750  HeapFree(GetProcessHeap(), 0, pUserData);
751  break;
752  }
753 
754  return FALSE;
755 }
#define IDC_USER_NEW_DISABLED
Definition: resource.h:62
#define WM_GETTEXTLENGTH
Definition: winuser.h:1601
#define LV_ITEM
Definition: commctrl.h:2309
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2406
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define IDD_CHANGE_PASSWORD
Definition: resource.h:49
static HICON
Definition: imagelist.c:84
LPWSTR usri3_comment
Definition: lmaccess.h:244
#define TRUE
Definition: types.h:120
#define LVN_BEGINLABELEDIT
Definition: commctrl.h:3130
#define MAKEWPARAM(l, h)
Definition: winuser.h:3948
#define IDOK
Definition: winuser.h:824
BOOL UserProperties(HWND hwndDlg)
Definition: userprops.c:901
#define IDM_USER_RENAME
Definition: resource.h:107
#define IMAGE_ICON
Definition: winuser.h:212
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define LVCF_WIDTH
Definition: commctrl.h:2559
#define LVSIL_SMALL
Definition: commctrl.h:2271
long y
Definition: polytest.cpp:48
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
struct _USER_DATA USER_DATA
#define ListView_SetItem(hwnd, pitem)
Definition: commctrl.h:2373
#define LVCF_TEXT
Definition: commctrl.h:2560
#define PWLEN
Definition: lmcons.h:37
long x
Definition: polytest.cpp:48
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define IDC_USERS_PROPERTIES
Definition: resource.h:34
int _tcscmp(const _TCHAR *s1, const _TCHAR *s2)
Definition: tcscmp.h:8
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define TPM_LEFTALIGN
Definition: winuser.h:2352
#define IDC_USER_NEW_DESCRIPTION
Definition: resource.h:56
#define EM_SETLIMITTEXT
Definition: winuser.h:1993
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2656
static BOOL OnEndLabelEdit(LPNMLVDISPINFO pnmv)
Definition: users.c:551
#define LV_COLUMN
Definition: commctrl.h:2519
#define IDS_DESCRIPTION
Definition: resource.h:92
#define INT
Definition: polytest.cpp:20
LPWSTR usri0_name
Definition: lmaccess.h:201
#define CALLBACK
Definition: compat.h:27
_In_ DWORD nLength
Definition: wincon.h:461
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2706
HMENU hPopupMenu
Definition: users.c:21
#define LVCFMT_LEFT
Definition: commctrl.h:2570
#define ZeroMemory
Definition: winbase.h:1635
HWND WINAPI SetFocus(_In_opt_ HWND)
HINSTANCE hApplet
Definition: access.c:17
#define LVNI_SELECTED
Definition: commctrl.h:2396
UINT_PTR WPARAM
Definition: windef.h:207
#define IDC_USER_NEW_FORCE_CHANGE
Definition: resource.h:59
static BOOL UserDelete(HWND hwndDlg)
Definition: users.c:387
#define SendDlgItemMessage
Definition: winuser.h:5743
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2380
INT_PTR CALLBACK UsersPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: users.c:689
int32_t INT_PTR
Definition: typedefs.h:62
#define IDI_LOCKED_USER
Definition: resource.h:7
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
& rect
Definition: startmenu.cpp:1413
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define MB_ICONWARNING
Definition: winuser.h:780
#define NERR_Success
Definition: lmerr.h:5
#define ILC_COLOR32
Definition: commctrl.h:343
static VOID SetUsersListColumns(HWND hwndListView)
Definition: users.c:429
static BOOL OnNotify(HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr)
Definition: users.c:605
#define LVIF_TEXT
Definition: commctrl.h:2281
#define LVCF_SUBITEM
Definition: commctrl.h:2561
static VOID UserRename(HWND hwndDlg)
Definition: users.c:369
UINT code
Definition: winuser.h:3133
#define USER_PRIV_USER
Definition: lmaccess.h:117
LPWSTR usri1003_password
Definition: lmaccess.h:372
#define USER_MAXSTORAGE_UNLIMITED
Definition: lmaccess.h:111
#define UF_PASSWD_CANT_CHANGE
Definition: lmaccess.h:28
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 ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2608
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
unsigned char * LPBYTE
Definition: typedefs.h:52
#define MB_YESNO
Definition: winuser.h:811
static const WCHAR szText[]
Definition: dialog.c:139
unsigned int BOOL
Definition: ntddk_ex.h:94
static VOID UpdateUsersList(HWND hwndListView)
Definition: users.c:461
UINT_PTR idFrom
Definition: winuser.h:3132
#define ListView_GetEditControl(hwndLV)
Definition: commctrl.h:2515
LPWSTR usri3_full_name
Definition: lmaccess.h:248
INT iCurrentItem
Definition: users.c:23
#define IDS_FULLNAME
Definition: resource.h:91
NET_API_STATUS WINAPI NetUserAdd(LPCWSTR servername, DWORD level, LPBYTE bufptr, LPDWORD parm_err)
Definition: user.c:2273
HWND hwndListView
Definition: eventvwr.c:83
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2276
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
DWORD usri3_flags
Definition: lmaccess.h:245
#define IDC_USER_NEW_FULL_NAME
Definition: resource.h:55
LONG_PTR LPARAM
Definition: windef.h:208
#define ListView_DeleteItem(hwnd, i)
Definition: commctrl.h:2383
NET_API_STATUS WINAPI NetUserGetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE *bufptr)
Definition: user.c:3147
#define IDC_USER_NEW_PASSWORD1
Definition: resource.h:57
#define WM_DESTROY
Definition: winuser.h:1591
#define IDC_USERS_ADD
Definition: resource.h:32
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2663
char TCHAR
Definition: xmlstorage.h:189
LPWSTR usri3_name
Definition: lmaccess.h:239
#define IDM_POPUP_USER
Definition: resource.h:103
#define GetDlgItemText
Definition: winuser.h:5686
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDM_USER_NEW
Definition: resource.h:105
#define LPNMLVDISPINFO
Definition: commctrl.h:82
#define EM_SETSEL
Definition: winuser.h:2000
#define LVIF_IMAGE
Definition: commctrl.h:2282
#define IDC_USER_NEW_CANNOT_CHANGE
Definition: resource.h:60
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
Definition: commctrl.h:2697
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
#define IDC_USER_NEW_NAME
Definition: resource.h:54
#define SetDlgItemText
Definition: winuser.h:5750
#define IDC_USER_NEW_NEVER_EXPIRES
Definition: resource.h:61
#define DialogBoxParam
Definition: winuser.h:5665
NET_API_STATUS WINAPI NetUserDel(LPCWSTR servername, LPCWSTR username)
Definition: user.c:2543
#define DWLP_USER
Definition: winuser.h:866
static BOOL CheckPasswords(HWND hwndDlg, INT nIdDlgItem1, INT nIdDlgItem2)
Definition: users.c:30
#define MB_ICONERROR
Definition: winuser.h:781
#define VOID
Definition: acefi.h:82
static VOID UpdateNewUserOptions(HWND hwndDlg, PUSER_INFO_3 userInfo, BOOL bInit)
Definition: users.c:156
#define ILC_MASK
Definition: commctrl.h:336
#define UF_DONT_EXPIRE_PASSWD
Definition: lmaccess.h:37
#define IDM_USER_CHANGE_PASSWORD
Definition: resource.h:104
#define MessageBox
Definition: winuser.h:5723
#define IDC_USERS_LIST
Definition: resource.h:14
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1722
#define BST_UNCHECKED
Definition: winuser.h:199
#define NM_CLICK
Definition: commctrl.h:130
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define lstrcmp
Definition: winbase.h:3689
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
static VOID UpdateUserProperties(HWND hwndDlg)
Definition: users.c:650
LPWSTR usri3_password
Definition: lmaccess.h:240
HWND hwndEdit
Definition: combotst.c:65
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
NET_API_STATUS WINAPI NetUserSetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE buf, LPDWORD parm_err)
Definition: user.c:3975
#define LVCF_FMT
Definition: commctrl.h:2558
#define TEXT(s)
Definition: k32.h:26
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
#define LoadMenu
Definition: winuser.h:5718
#define NM_DBLCLK
Definition: commctrl.h:131
struct tagNMLISTVIEW * LPNMLISTVIEW
HICON hIcon
Definition: msconfig.c:44
POINT ptAction
Definition: commctrl.h:3011
#define lstrcpy
Definition: winbase.h:3691
#define IDI_USER
Definition: resource.h:6
#define UNLEN
Definition: sspi.c:28
#define NM_RCLICK
Definition: commctrl.h:133
#define UF_ACCOUNTDISABLE
Definition: lmaccess.h:24
struct _USER_INFO_3 * PUSER_INFO_3
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define DOMAIN_GROUP_RID_USERS
Definition: setypes.h:612
#define FILTER_NORMAL_ACCOUNT
Definition: lmaccess.h:40
unsigned int UINT
Definition: ndis.h:50
DWORD usri3_password_expired
Definition: lmaccess.h:267
#define MB_OK
Definition: winuser.h:784
static VOID UserChangePassword(HWND hwndDlg)
Definition: users.c:110
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define BST_CHECKED
Definition: winuser.h:197
BOOL CheckAccountName(HWND hwndDlg, INT nIdDlgItem, LPTSTR lpAccountName)
Definition: misc.c:27
#define IDS_NAME
Definition: resource.h:90
#define IDD_USER_NEW
Definition: resource.h:53
#define IDC_USER_NEW_PASSWORD2
Definition: resource.h:58
static VOID OnInitDialog(HWND hwndDlg)
Definition: users.c:509
#define TIMEQ_FOREVER
Definition: lmaccess.h:110
#define IDM_USER_DELETE
Definition: resource.h:106
#define SendMessage
Definition: winuser.h:5744
#define HIWORD(l)
Definition: typedefs.h:246
#define IDM_USER_PROPERTIES
Definition: resource.h:108
UINT WINAPI GetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
static BOOL OnBeginLabelEdit(LPNMLVDISPINFO pnmv)
Definition: users.c:536
#define LoadImage
Definition: winuser.h:5716
static VOID UserNew(HWND hwndDlg)
Definition: users.c:302
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define IDNO
Definition: winuser.h:830
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define LVIF_STATE
Definition: commctrl.h:2284
#define wsprintf
Definition: winuser.h:5766
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
INT_PTR CALLBACK ChangePasswordDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: users.c:57
#define LVN_ENDLABELEDIT
Definition: commctrl.h:3131
#define memset(x, y, z)
Definition: compat.h:39
#define IDC_EDIT_PASSWORD1
Definition: resource.h:50
static SERVICE_STATUS status
Definition: service.c:31
#define IDC_USERS_REMOVE
Definition: resource.h:33
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
struct _USER_DATA * PUSER_DATA
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
struct _USER_INFO_1003 * PUSER_INFO_1003
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define LoadString
Definition: winuser.h:5720
#define UF_SCRIPT
Definition: lmaccess.h:23
#define WM_NOTIFY
Definition: richedit.h:61
#define IDC_EDIT_PASSWORD2
Definition: resource.h:51
#define ListView_EditLabel(hwndLV, i)
Definition: commctrl.h:2512
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
INT_PTR CALLBACK NewUserDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: users.c:186
Definition: ps.c:97
#define EN_CHANGE
Definition: winuser.h:2004