ReactOS 0.4.15-dev-7958-gcd0bb1a
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
19typedef struct _USER_DATA
20{
22
24
26
27
28
29static 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,
61{
62 PUSER_INFO_1003 userInfo;
63
65
66 userInfo = (PUSER_INFO_1003)GetWindowLongPtr(hwndDlg, DWLP_USER);
67
68 switch (uMsg)
69 {
70 case WM_INITDIALOG:
71 userInfo = (PUSER_INFO_1003)lParam;
73 break;
74
75 case WM_COMMAND:
76 switch (LOWORD(wParam))
77 {
78 case IDOK:
80 {
81 /* Store the password */
82 userInfo->usri1003_password =
84
85 EndDialog(hwndDlg, IDOK);
86 }
87 break;
88
89 case IDCANCEL:
90 EndDialog(hwndDlg, IDCANCEL);
91 break;
92 }
93 break;
94
95 default:
96 return FALSE;
97 }
98
99 return TRUE;
100}
101
102
103static VOID
105{
106 TCHAR szUserName[UNLEN + 1];
108 INT nItem;
109 HWND hwndLV;
111
112 ZeroMemory(&user, sizeof(USER_INFO_1003));
113
114 hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
115 nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
116 if (nItem == -1)
117 return;
118
119 /* Get the new user name */
121 nItem, 0,
122 szUserName,
123 UNLEN + 1);
124
127 hwndDlg,
129 (LPARAM)&user) == IDOK)
130 {
132 szUserName,
133 1003,
134 (LPBYTE)&user,
135 NULL);
136 if (status != NERR_Success)
137 {
138 TCHAR szText[256];
139 wsprintf(szText, TEXT("Error: %u"), status);
140 MessageBox(NULL, szText, TEXT("NetUserSetInfo"), MB_ICONERROR | MB_OK);
141 }
142 }
143
144 HeapFree(GetProcessHeap(), 0, user.usri1003_password);
145}
146
147
148static VOID
150 PUSER_INFO_3 userInfo,
151 BOOL bInit)
152{
154 !userInfo->usri3_password_expired);
156 !userInfo->usri3_password_expired);
157
160
161 if (bInit)
162 {
165
168
171
174 }
175}
176
177
180 UINT uMsg,
183{
184 PUSER_INFO_3 userInfo;
185 INT nLength;
186
188
189 userInfo = (PUSER_INFO_3)GetWindowLongPtr(hwndDlg, DWLP_USER);
190
191 switch (uMsg)
192 {
193 case WM_INITDIALOG:
194 userInfo = (PUSER_INFO_3)lParam;
197 UpdateNewUserOptions(hwndDlg, userInfo, TRUE);
198 break;
199
200 case WM_COMMAND:
201 switch (LOWORD(wParam))
202 {
204 if (HIWORD(wParam) == EN_CHANGE)
205 {
207 EnableWindow(GetDlgItem(hwndDlg, IDOK), (nLength > 0));
208 }
209 break;
210
212 userInfo->usri3_password_expired = !userInfo->usri3_password_expired;
213 UpdateNewUserOptions(hwndDlg, userInfo, FALSE);
214 break;
215
218 UpdateNewUserOptions(hwndDlg, userInfo, FALSE);
219 break;
220
223 UpdateNewUserOptions(hwndDlg, userInfo, FALSE);
224 break;
225
227 userInfo->usri3_flags ^= UF_ACCOUNTDISABLE;
228 break;
229
230 case IDOK:
232 {
235 break;
236 }
237
239 {
242 break;
243 }
244
245 /* Store the user name */
247
248 /* Store the full user name */
250
251 /* Store the description */
253
254 /* Store the password */
256
257 EndDialog(hwndDlg, IDOK);
258 break;
259
260 case IDCANCEL:
261 EndDialog(hwndDlg, IDCANCEL);
262 break;
263 }
264 break;
265
266 default:
267 return FALSE;
268 }
269
270 return TRUE;
271}
272
273
274static VOID
275UserNew(HWND hwndDlg)
276{
279 LV_ITEM lvi;
280 INT iItem;
281 HWND hwndLV;
282
283 ZeroMemory(&user, sizeof(USER_INFO_3));
284
285 user.usri3_priv = USER_PRIV_USER;
286 user.usri3_flags = UF_SCRIPT;
287 user.usri3_acct_expires = TIMEQ_FOREVER;
288 user.usri3_max_storage = USER_MAXSTORAGE_UNLIMITED;
289 user.usri3_primary_group_id = DOMAIN_GROUP_RID_USERS;
290
291 user.usri3_password_expired = TRUE;
292
295 hwndDlg,
297 (LPARAM)&user) == IDOK)
298 {
300 3,
301 (LPBYTE)&user,
302 NULL);
303 if (status != NERR_Success)
304 {
305 TCHAR szText[256];
306 wsprintf(szText, TEXT("Error: %u"), status);
307 MessageBox(NULL, szText, TEXT("NetUserAdd"), MB_ICONERROR | MB_OK);
308 return;
309 }
310
311 hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
312
313 ZeroMemory(&lvi, sizeof(lvi));
314 lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
315 lvi.pszText = user.usri3_name;
316 lvi.state = 0;
317 lvi.iImage = (user.usri3_flags & UF_ACCOUNTDISABLE) ? 1 : 0;
318 iItem = ListView_InsertItem(hwndLV, &lvi);
319
320 ListView_SetItemText(hwndLV, iItem, 1,
321 user.usri3_full_name);
322
323 ListView_SetItemText(hwndLV, iItem, 2,
324 user.usri3_comment);
325 }
326
327 HeapFree(GetProcessHeap(), 0, user.usri3_name);
328 HeapFree(GetProcessHeap(), 0, user.usri3_full_name);
329 HeapFree(GetProcessHeap(), 0, user.usri3_comment);
330 HeapFree(GetProcessHeap(), 0, user.usri3_password);
331}
332
333
334static VOID
336{
337 HWND hwndLV;
338 INT nItem;
339
340 hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
341 if (hwndLV == NULL)
342 return;
343
344 nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
345 if (nItem != -1)
346 {
347 (void)ListView_EditLabel(hwndLV, nItem);
348 }
349}
350
351
352static BOOL
354{
355 TCHAR szUserName[UNLEN + 1];
356 TCHAR szText[256];
357 INT nItem;
358 HWND hwndLV;
360
361 hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
362 nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
363 if (nItem == -1)
364 return FALSE;
365
366 /* Get the new user name */
368 nItem, 0,
369 szUserName,
370 UNLEN + 1);
371
372 /* Display a warning message because the delete operation cannot be reverted */
373 wsprintf(szText, TEXT("Do you really want to delete the user \"%s\"?"), szUserName);
374 if (MessageBox(NULL, szText, TEXT("User Accounts"), MB_ICONWARNING | MB_YESNO) == IDNO)
375 return FALSE;
376
377 /* Delete the user */
378 status = NetUserDel(NULL, szUserName);
379 if (status != NERR_Success)
380 {
381 TCHAR szText[256];
382 wsprintf(szText, TEXT("Error: %u"), status);
383 MessageBox(NULL, szText, TEXT("NetUserDel"), MB_ICONERROR | MB_OK);
384 return FALSE;
385 }
386
387 /* Delete the user from the list */
388 (void)ListView_DeleteItem(hwndLV, nItem);
389
390 return TRUE;
391}
392
393
394static VOID
396{
398 RECT rect;
399 TCHAR szStr[32];
400
402
403 memset(&column, 0x00, sizeof(column));
406 column.cx = (INT)((rect.right - rect.left) * 0.25);
407 column.iSubItem = 0;
408 LoadString(hApplet, IDS_NAME, szStr, sizeof(szStr) / sizeof(szStr[0]));
409 column.pszText = szStr;
411
412 column.cx = (INT)((rect.right - rect.left) * 0.50);
413 column.iSubItem = 1;
414 LoadString(hApplet, IDS_FULLNAME, szStr, sizeof(szStr) / sizeof(szStr[0]));
415 column.pszText = szStr;
417
418 column.cx = (INT)((rect.right - rect.left) * 0.25);
419 column.iSubItem = 2;
420 LoadString(hApplet, IDS_DESCRIPTION, szStr, sizeof(szStr) / sizeof(szStr[0]));
421 column.pszText = szStr;
423}
424
425
426static VOID
428{
429 NET_API_STATUS netStatus;
431 DWORD entriesread;
432 DWORD totalentries;
433 DWORD resume_handle = 0;
434 DWORD i;
435 LV_ITEM lvi;
436 INT iItem;
437
438 for (;;)
439 {
440 netStatus = NetUserEnum(NULL, 20, FILTER_NORMAL_ACCOUNT,
441 (LPBYTE*)&pBuffer,
442 1024, &entriesread,
443 &totalentries, &resume_handle);
444 if (netStatus != NERR_Success && netStatus != ERROR_MORE_DATA)
445 break;
446
447 for (i = 0; i < entriesread; i++)
448 {
449 memset(&lvi, 0x00, sizeof(lvi));
450 lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
451 lvi.pszText = pBuffer[i].usri20_name;
452 lvi.state = 0;
453 lvi.iImage = (pBuffer[i].usri20_flags & UF_ACCOUNTDISABLE) ? 1 : 0;
454 iItem = ListView_InsertItem(hwndListView, &lvi);
455
456 if (pBuffer[i].usri20_full_name != NULL)
458 pBuffer[i].usri20_full_name);
459
460 if (pBuffer[i].usri20_comment != NULL)
462 pBuffer[i].usri20_comment);
463 }
464
466
467 /* No more data left */
468 if (netStatus != ERROR_MORE_DATA)
469 break;
470 }
471}
472
473
474static VOID
476{
478 HIMAGELIST hImgList;
479 HICON hIcon;
480
481 /* Create the image list */
482 hImgList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 5, 5);
484 ImageList_AddIcon(hImgList, hIcon);
486 ImageList_AddIcon(hImgList, hIcon);
488
490
492
494
496
498}
499
500
501static BOOL
503{
505
506 hwndEdit = ListView_GetEditControl(pnmv->hdr.hwndFrom);
507 if (hwndEdit == NULL)
508 return TRUE;
509
511
512 return FALSE;
513}
514
515
516static BOOL
518{
519 TCHAR szOldUserName[UNLEN + 1];
520 TCHAR szNewUserName[UNLEN + 1];
521 USER_INFO_0 useri0;
523
524 /* Leave, if there is no valid listview item */
525 if (pnmv->item.iItem == -1)
526 return FALSE;
527
528 /* Get the new user name */
529 ListView_GetItemText(pnmv->hdr.hwndFrom,
530 pnmv->item.iItem, 0,
531 szOldUserName,
532 UNLEN + 1);
533
534 /* Leave, if the user canceled the edit action */
535 if (pnmv->item.pszText == NULL)
536 return FALSE;
537
538 /* Get the new user name */
539 lstrcpy(szNewUserName, pnmv->item.pszText);
540
541 /* Leave, if the user name was not changed */
542 if (lstrcmp(szOldUserName, szNewUserName) == 0)
543 return FALSE;
544
545 /* Check the user name for illegal characters */
546 if (!CheckAccountName(NULL, 0, szNewUserName))
547 return FALSE;
548
549 /* Change the user name */
550 useri0.usri0_name = szNewUserName;
551
552 status = NetUserSetInfo(NULL, szOldUserName, 0, (LPBYTE)&useri0, NULL);
553 if (status != NERR_Success)
554 {
555 TCHAR szText[256];
556 wsprintf(szText, TEXT("Error: %u"), status);
557 MessageBox(NULL, szText, TEXT("NetUserSetInfo"), MB_ICONERROR | MB_OK);
558 return FALSE;
559 }
560
561 /* Update the listview item */
562 ListView_SetItemText(pnmv->hdr.hwndFrom,
563 pnmv->item.iItem, 0,
564 szNewUserName);
565
566 return TRUE;
567}
568
569
570static BOOL
571OnNotify(HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr)
572{
573 LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)phdr;
574
575 switch (phdr->idFrom)
576 {
577 case IDC_USERS_LIST:
578 switch(phdr->code)
579 {
580 case NM_CLICK:
581 pUserData->iCurrentItem = lpnmlv->iItem;
582 break;
583
584 case NM_DBLCLK:
585 if (lpnmlv->iItem != -1)
586 {
587 UINT uItem;
588
589 uItem = GetMenuDefaultItem(GetSubMenu(pUserData->hPopupMenu, 1),
590 FALSE, 0);
591 if (uItem != (UINT)-1)
592 SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(uItem, 0), 0);
593 }
594 break;
595
596 case NM_RCLICK:
598 TrackPopupMenu(GetSubMenu(pUserData->hPopupMenu, (lpnmlv->iItem == -1) ? 0 : 1),
599 TPM_LEFTALIGN, lpnmlv->ptAction.x, lpnmlv->ptAction.y, 0, hwndDlg, NULL);
600 break;
601
603 return OnBeginLabelEdit((LPNMLVDISPINFO)phdr);
604
605 case LVN_ENDLABELEDIT:
606 return OnEndLabelEdit((LPNMLVDISPINFO)phdr);
607 }
608 break;
609 }
610
611 return FALSE;
612}
613
614
615static VOID
617{
618 TCHAR szUserName[UNLEN + 1];
619 INT iItem;
620 HWND hwndLV;
621 PUSER_INFO_2 pUserInfo = NULL;
622 LV_ITEM lvi;
623
624 hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
625 iItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
626 if (iItem == -1)
627 return;
628
629 /* Get the new user name */
631 iItem, 0,
632 szUserName,
633 UNLEN + 1);
634
635 NetUserGetInfo(NULL, szUserName, 2, (LPBYTE*)&pUserInfo);
636
637 memset(&lvi, 0x00, sizeof(lvi));
638 lvi.iItem = iItem;
639 lvi.iSubItem = 0;
640 lvi.mask = LVIF_IMAGE;
641 lvi.iImage = (pUserInfo->usri2_flags & UF_ACCOUNTDISABLE) ? 1 : 0;
642 (void)ListView_SetItem(hwndLV, &lvi);
643
644 ListView_SetItemText(hwndLV, iItem, 1,
645 pUserInfo->usri2_full_name);
646
647 ListView_SetItemText(hwndLV, iItem, 2,
648 pUserInfo->usri2_comment);
649
650 NetApiBufferFree(pUserInfo);
651}
652
653
656 UINT uMsg,
659{
660 PUSER_DATA pUserData;
661
663
664 pUserData = (PUSER_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
665
666 switch (uMsg)
667 {
668 case WM_INITDIALOG:
669 pUserData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(USER_DATA));
670 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pUserData);
671
672 pUserData->hPopupMenu = LoadMenu(hApplet, MAKEINTRESOURCE(IDM_POPUP_USER));
673
674 OnInitDialog(hwndDlg);
675 SetMenuDefaultItem(GetSubMenu(pUserData->hPopupMenu, 1),
677 FALSE);
678 break;
679
680 case WM_COMMAND:
681 switch (LOWORD(wParam))
682 {
684 UserChangePassword(hwndDlg);
685 break;
686
687 case IDM_USER_RENAME:
688 UserRename(hwndDlg);
689 break;
690
691 case IDM_USER_NEW:
692 case IDC_USERS_ADD:
693 UserNew(hwndDlg);
694 break;
695
696 case IDM_USER_DELETE:
697 case IDC_USERS_REMOVE:
698 UserDelete(hwndDlg);
699 break;
700
703 if (UserProperties(hwndDlg))
704 {
705 UpdateUserProperties(hwndDlg);
706 }
707 break;
708 }
709 break;
710
711 case WM_NOTIFY:
712 return OnNotify(hwndDlg, pUserData, (NMHDR *)lParam);
713
714 case WM_DESTROY:
715 DestroyMenu(pUserData->hPopupMenu);
716 HeapFree(GetProcessHeap(), 0, pUserData);
717 break;
718 }
719
720 return FALSE;
721}
#define VOID
Definition: acefi.h:82
#define IDS_DESCRIPTION
Definition: resource.h:4
void user(int argc, const char *argv[])
Definition: cmds.c:1350
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 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 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
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#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
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 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
static HICON
Definition: imagelist.c:84
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 UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define LOWORD(l)
Definition: pedump.c:82
#define INT
Definition: polytest.cpp:20
#define LVSIL_SMALL
Definition: commctrl.h:2299
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2408
#define ListView_EditLabel(hwndLV, i)
Definition: commctrl.h:2540
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2636
#define NM_DBLCLK
Definition: commctrl.h:131
#define LVIF_STATE
Definition: commctrl.h:2312
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2304
#define ListView_GetEditControl(hwndLV)
Definition: commctrl.h:2543
#define LVNI_SELECTED
Definition: commctrl.h:2424
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2684
#define LVN_ENDLABELEDIT
Definition: commctrl.h:3159
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define ILC_COLOR32
Definition: commctrl.h:358
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2434
#define NM_CLICK
Definition: commctrl.h:130
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734
#define LVN_BEGINLABELEDIT
Definition: commctrl.h:3158
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
Definition: commctrl.h:2725
#define LV_ITEM
Definition: commctrl.h:2337
struct tagNMLISTVIEW * LPNMLISTVIEW
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2691
#define LVIF_TEXT
Definition: commctrl.h:2309
#define ListView_SetItem(hwnd, pitem)
Definition: commctrl.h:2401
#define LVCF_FMT
Definition: commctrl.h:2586
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define NM_RCLICK
Definition: commctrl.h:133
#define LVCF_SUBITEM
Definition: commctrl.h:2589
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define ILC_MASK
Definition: commctrl.h:351
#define ListView_DeleteItem(hwnd, i)
Definition: commctrl.h:2411
#define LVIF_IMAGE
Definition: commctrl.h:2310
#define LVCF_TEXT
Definition: commctrl.h:2588
#define LV_COLUMN
Definition: commctrl.h:2547
PVOID pBuffer
#define LPNMLVDISPINFO
Definition: commctrl.h:77
#define WM_NOTIFY
Definition: richedit.h:61
#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:21
INT iCurrentItem
Definition: users.c:23
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:3158
UINT code
Definition: winuser.h:3159
POINT ptAction
Definition: commctrl.h:3039
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
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:353
struct _USER_DATA * PUSER_DATA
INT_PTR CALLBACK ChangePasswordDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: users.c:57
static VOID SetUsersListColumns(HWND hwndListView)
Definition: users.c:395
INT_PTR CALLBACK UsersPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: users.c:655
static VOID UpdateUsersList(HWND hwndListView)
Definition: users.c:427
static VOID OnInitDialog(HWND hwndDlg)
Definition: users.c:475
static VOID UpdateNewUserOptions(HWND hwndDlg, PUSER_INFO_3 userInfo, BOOL bInit)
Definition: users.c:149
static VOID UserNew(HWND hwndDlg)
Definition: users.c:275
static BOOL OnNotify(HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr)
Definition: users.c:571
struct _USER_DATA USER_DATA
static BOOL OnBeginLabelEdit(LPNMLVDISPINFO pnmv)
Definition: users.c:502
INT_PTR CALLBACK NewUserDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: users.c:179
static VOID UserChangePassword(HWND hwndDlg)
Definition: users.c:104
static VOID UpdateUserProperties(HWND hwndDlg)
Definition: users.c:616
static BOOL CheckPasswords(HWND hwndDlg, INT nIdDlgItem1, INT nIdDlgItem2)
Definition: users.c:30
static BOOL OnEndLabelEdit(LPNMLVDISPINFO pnmv)
Definition: users.c:517
static VOID UserRename(HWND hwndDlg)
Definition: users.c:335
LPTSTR GetDlgItemTextAlloc(HWND hwndDlg, INT nDlgItem)
Definition: usrmgr.c:19
#define ZeroMemory
Definition: winbase.h:1712
#define lstrcmp
Definition: winbase.h:3872
#define lstrcpy
Definition: winbase.h:3874
_In_ DWORD nLength
Definition: wincon.h:473
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define MAKEWPARAM(l, h)
Definition: winuser.h:4009
#define WM_GETTEXTLENGTH
Definition: winuser.h:1619
UINT WINAPI GetMenuDefaultItem(_In_ HMENU hMenu, _In_ UINT fByPos, _In_ UINT gmdiFlags)
#define DWLP_USER
Definition: winuser.h:872
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define IDCANCEL
Definition: winuser.h:831
#define BST_UNCHECKED
Definition: winuser.h:199
#define IMAGE_ICON
Definition: winuser.h:212
#define GetDlgItemText
Definition: winuser.h:5785
#define WM_COMMAND
Definition: winuser.h:1740
#define DialogBoxParam
Definition: winuser.h:5764
#define WM_INITDIALOG
Definition: winuser.h:1739
#define MB_YESNO
Definition: winuser.h:817
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:830
#define MB_ICONERROR
Definition: winuser.h:787
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:2011
#define TPM_LEFTALIGN
Definition: winuser.h:2377
#define IDNO
Definition: winuser.h:836
#define SendMessage
Definition: winuser.h:5843
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define EM_SETSEL
Definition: winuser.h:2018
#define LoadMenu
Definition: winuser.h:5817
#define MB_OK
Definition: winuser.h:790
#define wsprintf
Definition: winuser.h:5865
#define MB_ICONWARNING
Definition: winuser.h:786
#define LoadImage
Definition: winuser.h:5815
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define LoadString
Definition: winuser.h:5819
#define MessageBox
Definition: winuser.h:5822
#define LR_DEFAULTCOLOR
Definition: winuser.h:1087
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define WM_DESTROY
Definition: winuser.h:1609
#define SendDlgItemMessage
Definition: winuser.h:5842
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define SetDlgItemText
Definition: winuser.h:5849
#define BST_CHECKED
Definition: winuser.h:197
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2053
#define EN_CHANGE
Definition: winuser.h:2022
#define DOMAIN_GROUP_RID_USERS
Definition: setypes.h:640
char TCHAR
Definition: xmlstorage.h:189