ReactOS  0.4.15-dev-1177-g6cb3b62
users.c File Reference
#include "usrmgr.h"
Include dependency graph for users.c:

Go to the source code of this file.

Classes

struct  _USER_DATA
 

Typedefs

typedef struct _USER_DATA USER_DATA
 
typedef struct _USER_DATAPUSER_DATA
 

Functions

static BOOL CheckPasswords (HWND hwndDlg, INT nIdDlgItem1, INT nIdDlgItem2)
 
INT_PTR CALLBACK ChangePasswordDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID UserChangePassword (HWND hwndDlg)
 
static VOID UpdateNewUserOptions (HWND hwndDlg, PUSER_INFO_3 userInfo, BOOL bInit)
 
INT_PTR CALLBACK NewUserDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID UserNew (HWND hwndDlg)
 
static VOID UserRename (HWND hwndDlg)
 
static BOOL UserDelete (HWND hwndDlg)
 
static VOID SetUsersListColumns (HWND hwndListView)
 
static VOID UpdateUsersList (HWND hwndListView)
 
static VOID OnInitDialog (HWND hwndDlg)
 
static BOOL OnBeginLabelEdit (LPNMLVDISPINFO pnmv)
 
static BOOL OnEndLabelEdit (LPNMLVDISPINFO pnmv)
 
static BOOL OnNotify (HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr)
 
static VOID UpdateUserProperties (HWND hwndDlg)
 
INT_PTR CALLBACK UsersPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Typedef Documentation

◆ PUSER_DATA

◆ USER_DATA

Function Documentation

◆ ChangePasswordDlgProc()

INT_PTR CALLBACK ChangePasswordDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 57 of file users.c.

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 }
#define WM_GETTEXTLENGTH
Definition: winuser.h:1601
#define IDOK
Definition: winuser.h:824
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_In_ DWORD nLength
Definition: wincon.h:476
#define SendDlgItemMessage
Definition: winuser.h:5817
int32_t INT
Definition: typedefs.h:58
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
LPWSTR usri1003_password
Definition: lmaccess.h:372
#define FALSE
Definition: types.h:117
#define GetDlgItemText
Definition: winuser.h:5760
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define DWLP_USER
Definition: winuser.h:866
static BOOL CheckPasswords(HWND hwndDlg, INT nIdDlgItem1, INT nIdDlgItem2)
Definition: users.c:30
#define WM_COMMAND
Definition: winuser.h:1722
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define IDC_EDIT_PASSWORD1
Definition: resource.h:50
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
struct _USER_INFO_1003 * PUSER_INFO_1003
#define LOWORD(l)
Definition: pedump.c:82
#define IDC_EDIT_PASSWORD2
Definition: resource.h:51

Referenced by UserChangePassword().

◆ CheckPasswords()

static BOOL CheckPasswords ( HWND  hwndDlg,
INT  nIdDlgItem1,
INT  nIdDlgItem2 
)
static

Definition at line 30 of file users.c.

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 }
#define PWLEN
Definition: lmcons.h:37
int _tcscmp(const _TCHAR *s1, const _TCHAR *s2)
Definition: tcscmp.h:8
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
char TCHAR
Definition: xmlstorage.h:189
#define GetDlgItemText
Definition: winuser.h:5760
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5797
#define TEXT(s)
Definition: k32.h:26
unsigned int UINT
Definition: ndis.h:50
#define MB_OK
Definition: winuser.h:784

Referenced by ChangePasswordDlgProc(), and NewUserDlgProc().

◆ NewUserDlgProc()

INT_PTR CALLBACK NewUserDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 186 of file users.c.

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 }
#define IDC_USER_NEW_DISABLED
Definition: resource.h:62
#define WM_GETTEXTLENGTH
Definition: winuser.h:1601
LPWSTR usri3_comment
Definition: lmaccess.h:244
#define IDOK
Definition: winuser.h:824
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define IDC_USER_NEW_DESCRIPTION
Definition: resource.h:56
#define EM_SETLIMITTEXT
Definition: winuser.h:1993
_In_ DWORD nLength
Definition: wincon.h:476
HWND WINAPI SetFocus(_In_opt_ HWND)
#define IDC_USER_NEW_FORCE_CHANGE
Definition: resource.h:59
#define SendDlgItemMessage
Definition: winuser.h:5817
int32_t INT
Definition: typedefs.h:58
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define UF_PASSWD_CANT_CHANGE
Definition: lmaccess.h:28
#define FALSE
Definition: types.h:117
LPWSTR usri3_full_name
Definition: lmaccess.h:248
smooth NULL
Definition: ftsmooth.c:416
DWORD usri3_flags
Definition: lmaccess.h:245
#define IDC_USER_NEW_FULL_NAME
Definition: resource.h:55
#define IDC_USER_NEW_PASSWORD1
Definition: resource.h:57
LPWSTR usri3_name
Definition: lmaccess.h:239
#define GetDlgItemText
Definition: winuser.h:5760
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define EM_SETSEL
Definition: winuser.h:2000
#define IDC_USER_NEW_CANNOT_CHANGE
Definition: resource.h:60
#define IDC_USER_NEW_NAME
Definition: resource.h:54
#define SetDlgItemText
Definition: winuser.h:5824
#define IDC_USER_NEW_NEVER_EXPIRES
Definition: resource.h:61
#define DWLP_USER
Definition: winuser.h:866
static BOOL CheckPasswords(HWND hwndDlg, INT nIdDlgItem1, INT nIdDlgItem2)
Definition: users.c:30
static VOID UpdateNewUserOptions(HWND hwndDlg, PUSER_INFO_3 userInfo, BOOL bInit)
Definition: users.c:156
#define UF_DONT_EXPIRE_PASSWD
Definition: lmaccess.h:37
#define WM_COMMAND
Definition: winuser.h:1722
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
LPWSTR usri3_password
Definition: lmaccess.h:240
#define TEXT(s)
Definition: k32.h:26
#define UF_ACCOUNTDISABLE
Definition: lmaccess.h:24
struct _USER_INFO_3 * PUSER_INFO_3
DWORD usri3_password_expired
Definition: lmaccess.h:267
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL CheckAccountName(HWND hwndDlg, INT nIdDlgItem, LPTSTR lpAccountName)
Definition: misc.c:27
#define IDC_USER_NEW_PASSWORD2
Definition: resource.h:58
#define HIWORD(l)
Definition: typedefs.h:247
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define EN_CHANGE
Definition: winuser.h:2004

Referenced by UserNew().

◆ OnBeginLabelEdit()

static BOOL OnBeginLabelEdit ( LPNMLVDISPINFO  pnmv)
static

Definition at line 536 of file users.c.

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 }
#define TRUE
Definition: types.h:120
#define EM_SETLIMITTEXT
Definition: winuser.h:1993
#define FALSE
Definition: types.h:117
#define ListView_GetEditControl(hwndLV)
Definition: commctrl.h:2539
smooth NULL
Definition: ftsmooth.c:416
HWND hwndEdit
Definition: combotst.c:65
#define SendMessage
Definition: winuser.h:5818

Referenced by OnNotify().

◆ OnEndLabelEdit()

static BOOL OnEndLabelEdit ( LPNMLVDISPINFO  pnmv)
static

Definition at line 551 of file users.c.

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 }
#define TRUE
Definition: types.h:120
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2680
LPWSTR usri0_name
Definition: lmaccess.h:201
#define NERR_Success
Definition: lmerr.h:5
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
static const WCHAR szText[]
Definition: dialog.c:139
smooth NULL
Definition: ftsmooth.c:416
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2687
char TCHAR
Definition: xmlstorage.h:189
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5797
#define lstrcmp
Definition: winbase.h:3712
NET_API_STATUS WINAPI NetUserSetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE buf, LPDWORD parm_err)
Definition: user.c:3975
#define TEXT(s)
Definition: k32.h:26
#define lstrcpy
Definition: winbase.h:3714
#define UNLEN
Definition: sspi.c:28
#define MB_OK
Definition: winuser.h:784
BOOL CheckAccountName(HWND hwndDlg, INT nIdDlgItem, LPTSTR lpAccountName)
Definition: misc.c:27
#define wsprintf
Definition: winuser.h:5840
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by OnNotify().

◆ OnInitDialog()

static VOID OnInitDialog ( HWND  hwndDlg)
static

Definition at line 509 of file users.c.

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 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
static HICON
Definition: imagelist.c:84
#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 LVSIL_SMALL
Definition: commctrl.h:2295
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2730
HINSTANCE hApplet
Definition: access.c:17
#define IDI_LOCKED_USER
Definition: resource.h:7
#define ILC_COLOR32
Definition: commctrl.h:354
static VOID SetUsersListColumns(HWND hwndListView)
Definition: users.c:429
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
static VOID UpdateUsersList(HWND hwndListView)
Definition: users.c:461
HWND hwndListView
Definition: eventvwr.c:83
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2300
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
Definition: commctrl.h:2721
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
#define VOID
Definition: acefi.h:82
#define ILC_MASK
Definition: commctrl.h:347
#define IDC_USERS_LIST
Definition: resource.h:14
HICON hIcon
Definition: msconfig.c:44
#define IDI_USER
Definition: resource.h:6
#define LoadImage
Definition: winuser.h:5790
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077

Referenced by UsersPageProc().

◆ OnNotify()

static BOOL OnNotify ( HWND  hwndDlg,
PUSER_DATA  pUserData,
NMHDR phdr 
)
static

Definition at line 605 of file users.c.

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 }
#define LVN_BEGINLABELEDIT
Definition: commctrl.h:3154
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
long y
Definition: polytest.cpp:48
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
long x
Definition: polytest.cpp:48
#define TPM_LEFTALIGN
Definition: winuser.h:2352
static BOOL OnEndLabelEdit(LPNMLVDISPINFO pnmv)
Definition: users.c:551
HMENU hPopupMenu
Definition: users.c:21
UINT code
Definition: winuser.h:3134
#define FALSE
Definition: types.h:117
UINT_PTR idFrom
Definition: winuser.h:3133
INT iCurrentItem
Definition: users.c:23
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LPNMLVDISPINFO
Definition: commctrl.h:77
#define IDC_USERS_LIST
Definition: resource.h:14
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1722
#define NM_CLICK
Definition: commctrl.h:130
#define NM_DBLCLK
Definition: commctrl.h:131
struct tagNMLISTVIEW * LPNMLISTVIEW
POINT ptAction
Definition: commctrl.h:3035
#define NM_RCLICK
Definition: commctrl.h:133
unsigned int UINT
Definition: ndis.h:50
#define SendMessage
Definition: winuser.h:5818
UINT WINAPI GetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
static BOOL OnBeginLabelEdit(LPNMLVDISPINFO pnmv)
Definition: users.c:536
#define LVN_ENDLABELEDIT
Definition: commctrl.h:3155
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)

Referenced by UsersPageProc().

◆ SetUsersListColumns()

static VOID SetUsersListColumns ( HWND  hwndListView)
static

Definition at line 429 of file users.c.

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 }
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:2583
#define LVCF_TEXT
Definition: commctrl.h:2584
#define LV_COLUMN
Definition: commctrl.h:2543
#define IDS_DESCRIPTION
Definition: resource.h:92
#define INT
Definition: polytest.cpp:20
#define LVCFMT_LEFT
Definition: commctrl.h:2594
HINSTANCE hApplet
Definition: access.c:17
& rect
Definition: startmenu.cpp:1413
#define LVCF_SUBITEM
Definition: commctrl.h:2585
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2632
#define IDS_FULLNAME
Definition: resource.h:91
HWND hwndListView
Definition: eventvwr.c:83
char TCHAR
Definition: xmlstorage.h:189
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define LVCF_FMT
Definition: commctrl.h:2582
#define IDS_NAME
Definition: resource.h:90
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define memset(x, y, z)
Definition: compat.h:39
#define LoadString
Definition: winuser.h:5794

Referenced by OnInitDialog().

◆ UpdateNewUserOptions()

static VOID UpdateNewUserOptions ( HWND  hwndDlg,
PUSER_INFO_3  userInfo,
BOOL  bInit 
)
static

Definition at line 156 of file users.c.

159 {
161  !userInfo->usri3_password_expired);
163  !userInfo->usri3_password_expired);
164 
167 
168  if (bInit)
169  {
172 
175 
178 
181  }
182 }
#define IDC_USER_NEW_DISABLED
Definition: resource.h:62
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define IDC_USER_NEW_FORCE_CHANGE
Definition: resource.h:59
#define UF_PASSWD_CANT_CHANGE
Definition: lmaccess.h:28
DWORD usri3_flags
Definition: lmaccess.h:245
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_USER_NEW_CANNOT_CHANGE
Definition: resource.h:60
#define IDC_USER_NEW_NEVER_EXPIRES
Definition: resource.h:61
#define UF_DONT_EXPIRE_PASSWD
Definition: lmaccess.h:37
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define UF_ACCOUNTDISABLE
Definition: lmaccess.h:24
DWORD usri3_password_expired
Definition: lmaccess.h:267
#define BST_CHECKED
Definition: winuser.h:197

Referenced by NewUserDlgProc().

◆ UpdateUserProperties()

static VOID UpdateUserProperties ( HWND  hwndDlg)
static

Definition at line 650 of file users.c.

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 }
#define LV_ITEM
Definition: commctrl.h:2333
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2430
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define ListView_SetItem(hwnd, pitem)
Definition: commctrl.h:2397
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2680
#define LVNI_SELECTED
Definition: commctrl.h:2420
int32_t INT
Definition: typedefs.h:58
unsigned char * LPBYTE
Definition: typedefs.h:53
smooth NULL
Definition: ftsmooth.c:416
NET_API_STATUS WINAPI NetUserGetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE *bufptr)
Definition: user.c:3147
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2687
LPWSTR usri2_full_name
Definition: lmaccess.h:222
char TCHAR
Definition: xmlstorage.h:189
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LVIF_IMAGE
Definition: commctrl.h:2306
#define IDC_USERS_LIST
Definition: resource.h:14
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
#define UNLEN
Definition: sspi.c:28
#define UF_ACCOUNTDISABLE
Definition: lmaccess.h:24
DWORD usri2_flags
Definition: lmaccess.h:219
#define memset(x, y, z)
Definition: compat.h:39
LPWSTR usri2_comment
Definition: lmaccess.h:218

Referenced by UsersPageProc().

◆ UpdateUsersList()

static VOID UpdateUsersList ( HWND  hwndListView)
static

Definition at line 461 of file users.c.

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 }
#define LV_ITEM
Definition: commctrl.h:2333
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2404
int32_t INT
Definition: typedefs.h:58
#define NERR_Success
Definition: lmerr.h:5
#define LVIF_TEXT
Definition: commctrl.h:2305
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
unsigned char * LPBYTE
Definition: typedefs.h:53
HWND hwndListView
Definition: eventvwr.c:83
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2687
#define LVIF_IMAGE
Definition: commctrl.h:2306
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERROR_MORE_DATA
Definition: dderror.h:13
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
#define UF_ACCOUNTDISABLE
Definition: lmaccess.h:24
#define FILTER_NORMAL_ACCOUNT
Definition: lmaccess.h:40
#define LVIF_STATE
Definition: commctrl.h:2308
#define memset(x, y, z)
Definition: compat.h:39
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

Referenced by OnInitDialog().

◆ UserChangePassword()

static VOID UserChangePassword ( HWND  hwndDlg)
static

Definition at line 110 of file users.c.

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 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2430
#define IDD_CHANGE_PASSWORD
Definition: resource.h:49
#define IDOK
Definition: winuser.h:824
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2680
#define ZeroMemory
Definition: winbase.h:1648
HINSTANCE hApplet
Definition: access.c:17
#define LVNI_SELECTED
Definition: commctrl.h:2420
int32_t INT
Definition: typedefs.h:58
#define NERR_Success
Definition: lmerr.h:5
unsigned char * LPBYTE
Definition: typedefs.h:53
static const WCHAR szText[]
Definition: dialog.c:139
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
char TCHAR
Definition: xmlstorage.h:189
#define GetProcessHeap()
Definition: compat.h:484
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define DialogBoxParam
Definition: winuser.h:5739
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5797
#define IDC_USERS_LIST
Definition: resource.h:14
NET_API_STATUS WINAPI NetUserSetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE buf, LPDWORD parm_err)
Definition: user.c:3975
#define TEXT(s)
Definition: k32.h:26
#define UNLEN
Definition: sspi.c:28
#define MB_OK
Definition: winuser.h:784
#define wsprintf
Definition: winuser.h:5840
INT_PTR CALLBACK ChangePasswordDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: users.c:57
static SERVICE_STATUS status
Definition: service.c:31
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define HeapFree(x, y, z)
Definition: compat.h:483
Definition: ps.c:97

Referenced by UsersPageProc().

◆ UserDelete()

static BOOL UserDelete ( HWND  hwndDlg)
static

Definition at line 387 of file users.c.

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 }
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2430
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define TRUE
Definition: types.h:120
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2680
#define LVNI_SELECTED
Definition: commctrl.h:2420
int32_t INT
Definition: typedefs.h:58
#define MB_ICONWARNING
Definition: winuser.h:780
#define NERR_Success
Definition: lmerr.h:5
#define FALSE
Definition: types.h:117
#define MB_YESNO
Definition: winuser.h:811
static const WCHAR szText[]
Definition: dialog.c:139
smooth NULL
Definition: ftsmooth.c:416
#define ListView_DeleteItem(hwnd, i)
Definition: commctrl.h:2407
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
char TCHAR
Definition: xmlstorage.h:189
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
NET_API_STATUS WINAPI NetUserDel(LPCWSTR servername, LPCWSTR username)
Definition: user.c:2543
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5797
#define IDC_USERS_LIST
Definition: resource.h:14
#define TEXT(s)
Definition: k32.h:26
#define UNLEN
Definition: sspi.c:28
#define MB_OK
Definition: winuser.h:784
#define IDNO
Definition: winuser.h:830
#define wsprintf
Definition: winuser.h:5840
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by UsersPageProc().

◆ UserNew()

static VOID UserNew ( HWND  hwndDlg)
static

Definition at line 302 of file users.c.

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 }
#define LV_ITEM
Definition: commctrl.h:2333
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDOK
Definition: winuser.h:824
#define TRUE
Definition: types.h:120
#define ZeroMemory
Definition: winbase.h:1648
HINSTANCE hApplet
Definition: access.c:17
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2404
int32_t INT
Definition: typedefs.h:58
#define NERR_Success
Definition: lmerr.h:5
#define LVIF_TEXT
Definition: commctrl.h:2305
#define USER_PRIV_USER
Definition: lmaccess.h:117
#define USER_MAXSTORAGE_UNLIMITED
Definition: lmaccess.h:111
unsigned char * LPBYTE
Definition: typedefs.h:53
static const WCHAR szText[]
Definition: dialog.c:139
NET_API_STATUS WINAPI NetUserAdd(LPCWSTR servername, DWORD level, LPBYTE bufptr, LPDWORD parm_err)
Definition: user.c:2273
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2687
char TCHAR
Definition: xmlstorage.h:189
#define GetProcessHeap()
Definition: compat.h:484
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LVIF_IMAGE
Definition: commctrl.h:2306
#define DialogBoxParam
Definition: winuser.h:5739
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5797
#define IDC_USERS_LIST
Definition: resource.h:14
#define TEXT(s)
Definition: k32.h:26
#define UF_ACCOUNTDISABLE
Definition: lmaccess.h:24
#define DOMAIN_GROUP_RID_USERS
Definition: setypes.h:612
#define MB_OK
Definition: winuser.h:784
#define IDD_USER_NEW
Definition: resource.h:53
#define TIMEQ_FOREVER
Definition: lmaccess.h:110
#define LVIF_STATE
Definition: commctrl.h:2308
#define wsprintf
Definition: winuser.h:5840
static SERVICE_STATUS status
Definition: service.c:31
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define HeapFree(x, y, z)
Definition: compat.h:483
#define UF_SCRIPT
Definition: lmaccess.h:23
INT_PTR CALLBACK NewUserDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: users.c:186
Definition: ps.c:97

Referenced by UsersPageProc().

◆ UserRename()

static VOID UserRename ( HWND  hwndDlg)
static

Definition at line 369 of file users.c.

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 }
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2430
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define LVNI_SELECTED
Definition: commctrl.h:2420
int32_t INT
Definition: typedefs.h:58
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_USERS_LIST
Definition: resource.h:14
#define ListView_EditLabel(hwndLV, i)
Definition: commctrl.h:2536

Referenced by UsersPageProc().

◆ UsersPageProc()

INT_PTR CALLBACK UsersPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 689 of file users.c.

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 
707 
708  OnInitDialog(hwndDlg);
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 MAKEINTRESOURCE
Definition: winuser.h:591
BOOL UserProperties(HWND hwndDlg)
Definition: userprops.c:901
#define IDM_USER_RENAME
Definition: resource.h:107
#define IDC_USERS_PROPERTIES
Definition: resource.h:34
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
HMENU hPopupMenu
Definition: users.c:21
HINSTANCE hApplet
Definition: access.c:17
static BOOL UserDelete(HWND hwndDlg)
Definition: users.c:387
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
static BOOL OnNotify(HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr)
Definition: users.c:605
static VOID UserRename(HWND hwndDlg)
Definition: users.c:369
#define FALSE
Definition: types.h:117
#define WM_DESTROY
Definition: winuser.h:1591
#define IDC_USERS_ADD
Definition: resource.h:32
#define IDM_POPUP_USER
Definition: resource.h:103
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define IDM_USER_NEW
Definition: resource.h:105
#define DWLP_USER
Definition: winuser.h:866
#define IDM_USER_CHANGE_PASSWORD
Definition: resource.h:104
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1722
BOOL WINAPI DestroyMenu(_In_ HMENU)
static VOID UpdateUserProperties(HWND hwndDlg)
Definition: users.c:650
#define LoadMenu
Definition: winuser.h:5792
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static VOID UserChangePassword(HWND hwndDlg)
Definition: users.c:110
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
static VOID OnInitDialog(HWND hwndDlg)
Definition: users.c:509
#define IDM_USER_DELETE
Definition: resource.h:106
#define IDM_USER_PROPERTIES
Definition: resource.h:108
static VOID UserNew(HWND hwndDlg)
Definition: users.c:302
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDC_USERS_REMOVE
Definition: resource.h:33
struct _USER_DATA * PUSER_DATA
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:483
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by UsrmgrApplet().