ReactOS  0.4.15-dev-5459-gb85f005
groupprops.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/groupprops.c
5  * PURPOSE: Group property sheet
6  *
7  * PROGRAMMERS: Eric Kohl
8  */
9 
10 #include "usrmgr.h"
11 
12 typedef struct _GENERAL_GROUP_DATA
13 {
16 
17 
18 static VOID
20  LPTSTR pTextSid)
21 {
23  DWORD dwSubAuthorities;
24  DWORD dwSidRev = SID_REVISION;
26  DWORD dwSidSize;
27 
29 
30  dwSubAuthorities = *GetSidSubAuthorityCount(pSid);
31 
32  dwSidSize = wsprintf(pTextSid, TEXT("S-%lu-"), dwSidRev);
33 
34  if ((psia->Value[0] != 0) || (psia->Value[1] != 0))
35  {
36  dwSidSize += wsprintf(pTextSid + lstrlen(pTextSid),
37  TEXT("0x%02hx%02hx%02hx%02hx%02hx%02hx"),
38  (USHORT)psia->Value[0],
39  (USHORT)psia->Value[1],
40  (USHORT)psia->Value[2],
41  (USHORT)psia->Value[3],
42  (USHORT)psia->Value[4],
43  (USHORT)psia->Value[5]);
44  }
45  else
46  {
47  dwSidSize += wsprintf(pTextSid + lstrlen(pTextSid),
48  TEXT("%lu"),
49  (ULONG)(psia->Value[5]) +
50  (ULONG)(psia->Value[4] << 8) +
51  (ULONG)(psia->Value[3] << 16) +
52  (ULONG)(psia->Value[2] << 24));
53  }
54 
55  for (dwCounter = 0 ; dwCounter < dwSubAuthorities ; dwCounter++)
56  {
57  dwSidSize += wsprintf(pTextSid + dwSidSize, TEXT("-%lu"),
59  }
60 }
61 
62 
63 static VOID
65  PGENERAL_GROUP_DATA pGroupData)
66 {
67  HWND hwndLV;
69  RECT rect;
70  TCHAR szStr[32];
71  HIMAGELIST hImgList;
72  HICON hIcon;
73 
74  NET_API_STATUS netStatus;
75  PUSER_INFO_20 pUserBuffer;
76  DWORD entriesread;
77  DWORD totalentries;
78  DWORD resume_handle = 0;
79  DWORD i;
80  LV_ITEM lvi;
81  INT iItem;
82 
83  hwndLV = GetDlgItem(hwndDlg, IDC_USER_ADD_MEMBERSHIP_LIST);
84  GetClientRect(hwndLV, &rect);
85 
86  hImgList = ImageList_Create(16,16,ILC_COLOR32 | ILC_MASK,5,5);
88  ImageList_AddIcon(hImgList,hIcon);
91  ImageList_AddIcon(hImgList, hIcon);
94  ImageList_AddIcon(hImgList, hIcon);
96 
97  (void)ListView_SetImageList(hwndLV, hImgList, LVSIL_SMALL);
99 
100  memset(&column, 0x00, sizeof(column));
102  column.fmt = LVCFMT_LEFT;
103  column.cx = (INT)((rect.right - rect.left) * 0.40);
104  column.iSubItem = 0;
105  LoadString(hApplet, IDS_NAME, szStr, sizeof(szStr) / sizeof(szStr[0]));
106  column.pszText = szStr;
107  (void)ListView_InsertColumn(hwndLV, 0, &column);
108 
109  column.cx = (INT)((rect.right - rect.left) * 0.60);
110  column.iSubItem = 1;
111  LoadString(hApplet, IDS_DESCRIPTION, szStr, sizeof(szStr) / sizeof(szStr[0]));
112  column.pszText = szStr;
113  (void)ListView_InsertColumn(hwndLV, 1, &column);
114 
115  /* TODO: Enumerate global groups and add them to the list! */
116 
117  for (;;)
118  {
119  netStatus = NetUserEnum(NULL, 20, FILTER_NORMAL_ACCOUNT,
120  (LPBYTE*)&pUserBuffer,
121  1024, &entriesread,
122  &totalentries, &resume_handle);
123  if (netStatus != NERR_Success && netStatus != ERROR_MORE_DATA)
124  break;
125 
126  for (i = 0; i < entriesread; i++)
127  {
128  memset(&lvi, 0x00, sizeof(lvi));
129  lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
130  lvi.pszText = pUserBuffer[i].usri20_name;
131  lvi.state = 0;
132  lvi.iImage = (pUserBuffer[i].usri20_flags & UF_ACCOUNTDISABLE) ? 2 : 1;
133  iItem = ListView_InsertItem(hwndLV, &lvi);
134 
135  ListView_SetItemText(hwndLV, iItem, 1,
136  pUserBuffer[i].usri20_full_name);
137 
138  ListView_SetItemText(hwndLV, iItem, 2,
139  pUserBuffer[i].usri20_comment);
140  }
141 
142  NetApiBufferFree(pUserBuffer);
143 
144  /* No more data left */
145  if (netStatus != ERROR_MORE_DATA)
146  break;
147  }
148 }
149 
150 
151 static BOOL
153  PGENERAL_GROUP_DATA pGroupData)
154 {
155  HWND hwndLV;
156  INT nSelectedItems;
157  INT nItem;
158  TCHAR szUserName[UNLEN + 1];
159  BOOL bResult = FALSE;
160  LOCALGROUP_MEMBERS_INFO_3 memberInfo;
162 
163  hwndLV = GetDlgItem(hwndDlg, IDC_USER_ADD_MEMBERSHIP_LIST);
164 
165  nSelectedItems = ListView_GetSelectedCount(hwndLV);
166  if (nSelectedItems > 0)
167  {
168  nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
169  while (nItem != -1)
170  {
171  /* Get the new user name */
172  ListView_GetItemText(hwndLV,
173  nItem, 0,
174  szUserName,
175  UNLEN + 1);
176  TRACE("Selected user: %s", dbgstrx(szUserName));
177 
178  memberInfo.lgrmi3_domainandname = szUserName;
179 
181  (LPBYTE)&memberInfo, 1);
183  {
184  TCHAR szText[256];
185  wsprintf(szText, TEXT("Error: %u"), status);
186  MessageBox(NULL, szText, TEXT("NetLocalGroupAddMembers"), MB_ICONERROR | MB_OK);
187  }
188  else
189  {
190  bResult = TRUE;
191  }
192 
193  nItem = ListView_GetNextItem(hwndLV, nItem, LVNI_SELECTED);
194  }
195  }
196 
197  return bResult;
198 }
199 
200 
203  UINT uMsg,
204  WPARAM wParam,
205  LPARAM lParam)
206 {
207  PGENERAL_GROUP_DATA pGroupData;
208 
210 
211  pGroupData = (PGENERAL_GROUP_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
212 
213  switch (uMsg)
214  {
215  case WM_INITDIALOG:
216  pGroupData = (PGENERAL_GROUP_DATA)lParam;
217  SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pGroupData);
218  InitGroupMembersList(hwndDlg, pGroupData);
219  break;
220 
221  case WM_COMMAND:
222  switch (LOWORD(wParam))
223  {
224  case IDOK:
225  if (AddSelectedUsersToGroup(hwndDlg, pGroupData))
226  EndDialog(hwndDlg, IDOK);
227  else
228  EndDialog(hwndDlg, IDCANCEL);
229  break;
230 
231  case IDCANCEL:
232  EndDialog(hwndDlg, IDCANCEL);
233  break;
234  }
235  break;
236 
237  default:
238  return FALSE;
239  }
240 
241  return TRUE;
242 }
243 
244 
245 static VOID
247  PGENERAL_GROUP_DATA pGroupData)
248 {
249  HWND hwndLV;
250 // NET_API_STATUS status;
251  PLOCALGROUP_MEMBERS_INFO_1 membersInfo = NULL;
252  DWORD dwRead;
253  DWORD dwTotal;
254  DWORD_PTR resumeHandle = 0;
255  DWORD i;
256  LV_ITEM lvi;
257  TCHAR szGroupName[256];
258 
261  hwndDlg,
263  (LPARAM)pGroupData) == IDOK)
264  {
265  hwndLV = GetDlgItem(hwndDlg, IDC_GROUP_GENERAL_MEMBERS);
266 
267  (void)ListView_DeleteAllItems(hwndLV);
268 
269 // DebugPrintf(_T("Removed all users from the list!"));
270 
271  /* Set group members */
272  NetLocalGroupGetMembers(NULL, pGroupData->szGroupName, 1, (LPBYTE*)&membersInfo,
273  MAX_PREFERRED_LENGTH, &dwRead, &dwTotal,
274  &resumeHandle);
275 
276  for (i = 0; i < dwRead; i++)
277  {
278  ZeroMemory(&lvi, sizeof(lvi));
279  lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
280  lvi.pszText = membersInfo[i].lgrmi1_name;
281  lvi.state = 0;
282  lvi.iImage = (membersInfo[i].lgrmi1_sidusage == SidTypeGroup ||
283  membersInfo[i].lgrmi1_sidusage == SidTypeWellKnownGroup) ? 1 : 0;
284 
285  if (membersInfo[i].lgrmi1_sidusage == SidTypeWellKnownGroup)
286  {
287  TCHAR szSid[256];
288 
289  GetTextSid(membersInfo[i].lgrmi1_sid, szSid);
290 
291  wsprintf(szGroupName,
292  TEXT("%s (%s)"),
293  membersInfo[i].lgrmi1_name,
294  szSid);
295 
296  lvi.pszText = szGroupName;
297  }
298 
299 
300  (void)ListView_InsertItem(hwndLV, &lvi);
301  }
302 
303  NetApiBufferFree(membersInfo);
304  }
305 }
306 
307 
308 static VOID
310  PGENERAL_GROUP_DATA pGroupData)
311 {
312  TCHAR szUserName[UNLEN + 1];
313  TCHAR szText[256];
314  LOCALGROUP_MEMBERS_INFO_3 memberInfo;
315  HWND hwndLV;
316  INT nItem;
318 
319  hwndLV = GetDlgItem(hwndDlg, IDC_GROUP_GENERAL_MEMBERS);
320  nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
321  if (nItem == -1)
322  return;
323 
324  /* Get the new user name */
325  ListView_GetItemText(hwndLV,
326  nItem, 0,
327  szUserName,
328  UNLEN + 1);
329 
330  /* Display a warning message because the remove operation cannot be reverted */
331  wsprintf(szText, TEXT("Do you really want to remove the user \"%s\" from the group \"%s\"?"),
332  szUserName, pGroupData->szGroupName);
333  if (MessageBox(NULL, szText, TEXT("User Accounts"), MB_ICONWARNING | MB_YESNO) == IDNO)
334  return;
335 
336  memberInfo.lgrmi3_domainandname = szUserName;
337 
339  3, (LPBYTE)&memberInfo, 1);
340  if (status != NERR_Success)
341  {
342  TCHAR szText[256];
343  wsprintf(szText, TEXT("Error: %u"), status);
344  MessageBox(NULL, szText, TEXT("NetLocalGroupDelMembers"), MB_ICONERROR | MB_OK);
345  return;
346  }
347 
348  (void)ListView_DeleteItem(hwndLV, nItem);
349 
350  if (ListView_GetItemCount(hwndLV) == 0)
352 }
353 
354 
355 static BOOL
357  PGENERAL_GROUP_DATA pGroupData,
358  LPARAM lParam)
359 {
360  LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)lParam;
361 
362  switch (((LPNMHDR)lParam)->idFrom)
363  {
365  switch (((LPNMHDR)lParam)->code)
366  {
367  case NM_CLICK:
368  EnableWindow(GetDlgItem(hwndDlg, IDC_GROUP_GENERAL_REMOVE), (lpnmlv->iItem != -1));
369  break;
370 
371  case LVN_KEYDOWN:
372  if (((LPNMLVKEYDOWN)lParam)->wVKey == VK_DELETE)
373  {
374  RemoveUserFromGroup(hwndDlg, pGroupData);
375  }
376  break;
377 
378  }
379  break;
380  }
381 
382  return FALSE;
383 }
384 
385 
386 static VOID
388  PGENERAL_GROUP_DATA pGroupData)
389 {
390  PLOCALGROUP_INFO_1 groupInfo = NULL;
391  PLOCALGROUP_MEMBERS_INFO_2 membersInfo = NULL;
392  DWORD dwRead;
393  DWORD dwTotal;
394  DWORD_PTR resumeHandle = 0;
395  DWORD i;
396  LV_ITEM lvi;
397  HWND hwndLV;
399  RECT rect;
400  HIMAGELIST hImgList;
401  HICON hIcon;
402  TCHAR szGroupName[256];
403 
404 
405  hwndLV = GetDlgItem(hwndDlg, IDC_GROUP_GENERAL_MEMBERS);
406 
407  /* Create the image list */
408  hImgList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 5, 5);
410  ImageList_AddIcon(hImgList, hIcon);
413  ImageList_AddIcon(hImgList, hIcon);
415 
416  (void)ListView_SetImageList(hwndLV, hImgList, LVSIL_SMALL);
417 
418  /* Set the list column */
419  GetClientRect(hwndLV, &rect);
420 
421  memset(&column, 0x00, sizeof(column));
423  column.fmt = LVCFMT_LEFT;
424  column.cx = (INT)(rect.right - rect.left);
425  column.iSubItem = 0;
426  (void)ListView_InsertColumn(hwndLV, 0, &column);
427 
428  /* Set group name */
429  SetDlgItemText(hwndDlg, IDC_GROUP_GENERAL_NAME, pGroupData->szGroupName);
430 
431  /* Set group description */
432  NetLocalGroupGetInfo(NULL, pGroupData->szGroupName, 1, (LPBYTE*)&groupInfo);
433  SetDlgItemText(hwndDlg, IDC_GROUP_GENERAL_DESCRIPTION, groupInfo->lgrpi1_comment);
434  NetApiBufferFree(groupInfo);
435 
436  /* Set group members */
437  NetLocalGroupGetMembers(NULL, pGroupData->szGroupName, 2, (LPBYTE*)&membersInfo,
438  MAX_PREFERRED_LENGTH, &dwRead, &dwTotal,
439  &resumeHandle);
440 
441  for (i = 0; i < dwRead; i++)
442  {
443  ZeroMemory(&lvi, sizeof(lvi));
444  lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
445  lvi.state = 0;
446  if (membersInfo[i].lgrmi2_sidusage == SidTypeGroup ||
447  membersInfo[i].lgrmi2_sidusage == SidTypeWellKnownGroup)
448  {
449  lvi.iImage = 0;
450  }
451  else if (membersInfo[i].lgrmi2_sidusage == SidTypeUser)
452  {
453  /* FIXME: handle locked user properly! */
454  lvi.iImage = 1;
455  }
456 
457  if (membersInfo[i].lgrmi2_sidusage == SidTypeWellKnownGroup)
458  {
459  TCHAR szSid[256];
460 
461  GetTextSid(membersInfo[i].lgrmi2_sid, szSid);
462 
463  wsprintf(szGroupName,
464  TEXT("%s (%s)"),
465  membersInfo[i].lgrmi2_domainandname,
466  szSid);
467 
468  lvi.pszText = szGroupName;
469  }
470  else
471  {
472  LPWSTR ptr;
473 
474  ptr = wcschr(membersInfo[i].lgrmi2_domainandname, L'\\');
475  if (ptr != NULL)
476  {
477  lvi.pszText = ++ptr;
478  }
479  else
480  {
481  lvi.pszText = membersInfo[i].lgrmi2_domainandname;
482  }
483  }
484 
485  (void)ListView_InsertItem(hwndLV, &lvi);
486  }
487 
488  NetApiBufferFree(membersInfo);
489 }
490 
491 
492 static BOOL
494  PGENERAL_GROUP_DATA pGroupData)
495 {
496  LOCALGROUP_INFO_1 groupInfo;
497  LPTSTR pszComment = NULL;
498  INT nLength;
500  DWORD dwIndex;
501 
502  /* Get the group description */
504  if (nLength == 0)
505  {
506  groupInfo.lgrpi1_comment = NULL;
507  }
508  else
509  {
510  pszComment = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR));
511  GetDlgItemText(hwndDlg, IDC_GROUP_GENERAL_DESCRIPTION, pszComment, nLength + 1);
512  groupInfo.lgrpi1_comment = pszComment;
513  }
514 
515  status = NetLocalGroupSetInfo(NULL, pGroupData->szGroupName, 1, (LPBYTE)&groupInfo, &dwIndex);
516  if (status != NERR_Success)
517  {
518  ERR("NetLocalGroupSetInfo failed. Status: %lu Index: %lu", status, dwIndex);
519  }
520 
521  if (pszComment)
522  HeapFree(GetProcessHeap(), 0, pszComment);
523 
524  return TRUE;
525 }
526 
527 
530  UINT uMsg,
531  WPARAM wParam,
532  LPARAM lParam)
533 {
534  PGENERAL_GROUP_DATA pGroupData;
535 
538  UNREFERENCED_PARAMETER(hwndDlg);
539 
540  pGroupData= (PGENERAL_GROUP_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
541 
542  switch (uMsg)
543  {
544  case WM_INITDIALOG:
547  sizeof(GENERAL_GROUP_DATA) +
548  lstrlen((LPTSTR)((PROPSHEETPAGE *)lParam)->lParam) * sizeof(TCHAR));
549  lstrcpy(pGroupData->szGroupName, (LPTSTR)((PROPSHEETPAGE *)lParam)->lParam);
550 
551  SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pGroupData);
552 
553  GetGeneralGroupData(hwndDlg,
554  pGroupData);
555  break;
556 
557  case WM_COMMAND:
558  switch (LOWORD(wParam))
559  {
561  if (HIWORD(wParam) == EN_CHANGE)
562  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
563  break;
564 
566  AddUsersToGroup(hwndDlg, pGroupData);
567  break;
568 
570  RemoveUserFromGroup(hwndDlg, pGroupData);
571  break;
572  }
573  break;
574 
575  case WM_NOTIFY:
576  if (((LPPSHNOTIFY)lParam)->hdr.code == PSN_APPLY)
577  {
578  SetGeneralGroupData(hwndDlg, pGroupData);
579  return TRUE;
580  }
581  else
582  {
583  return OnGroupPropSheetNotify(hwndDlg, pGroupData, lParam);
584  }
585  break;
586 
587  case WM_DESTROY:
588  HeapFree(GetProcessHeap(), 0, pGroupData);
589  break;
590  }
591 
592  return FALSE;
593 }
594 
595 
596 static VOID
598 {
599  ZeroMemory(psp, sizeof(PROPSHEETPAGE));
600  psp->dwSize = sizeof(PROPSHEETPAGE);
601  psp->dwFlags = PSP_DEFAULT;
602  psp->hInstance = hApplet;
603  psp->pszTemplate = MAKEINTRESOURCE(idDlg);
604  psp->pfnDlgProc = DlgProc;
605  psp->lParam = (LPARAM)pszGroup;
606 }
607 
608 
609 BOOL
611 {
612  PROPSHEETPAGE psp[1];
613  PROPSHEETHEADER psh;
614  TCHAR szGroupName[UNLEN + 1];
615  INT nItem;
616  HWND hwndLV;
617 
618  hwndLV = GetDlgItem(hwndDlg, IDC_GROUPS_LIST);
619  nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
620  if (nItem == -1)
621  return FALSE;
622 
623  /* Get the new user name */
624  ListView_GetItemText(hwndLV,
625  nItem, 0,
626  szGroupName,
627  UNLEN + 1);
628 
629  ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
630  psh.dwSize = sizeof(PROPSHEETHEADER);
631  psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
632  psh.hwndParent = hwndDlg;
633  psh.hInstance = hApplet;
634  psh.hIcon = NULL;
635  psh.pszCaption = szGroupName;
636  psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
637  psh.nStartPage = 0;
638  psh.ppsp = psp;
639 
641 
642  return (PropertySheet(&psh) == IDOK);
643 }
NET_API_STATUS WINAPI NetLocalGroupDelMembers(LPCWSTR servername, LPCWSTR groupname, DWORD level, LPBYTE buf, DWORD totalentries)
Definition: local_group.c:817
#define LV_ITEM
Definition: commctrl.h:2337
#define MAX_PREFERRED_LENGTH
Definition: lmcons.h:48
WORD idDlg
Definition: desk.c:110
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2434
#define IDI_GROUP
Definition: resource.h:8
static HICON
Definition: imagelist.c:84
NET_API_STATUS WINAPI NetLocalGroupAddMembers(LPCWSTR servername, LPCWSTR groupname, DWORD level, LPBYTE buf, DWORD totalentries)
Definition: local_group.c:520
#define IDOK
Definition: winuser.h:824
char hdr[14]
Definition: iptest.cpp:33
#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:2587
#define LVSIL_SMALL
Definition: commctrl.h:2299
#define LVCF_TEXT
Definition: commctrl.h:2588
* PSID_IDENTIFIER_AUTHORITY
Definition: setypes.h:464
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define IDC_GROUP_GENERAL_MEMBERS
Definition: resource.h:45
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2684
#define SID_REVISION
Definition: setypes.h:481
#define LV_COLUMN
Definition: commctrl.h:2547
#define INT
Definition: polytest.cpp:20
#define IDD_GROUP_GENERAL
Definition: resource.h:42
#define CALLBACK
Definition: compat.h:35
_In_ DWORD nLength
Definition: wincon.h:473
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define ZeroMemory
Definition: winbase.h:1670
INT_PTR CALLBACK AddUsersToGroupDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: groupprops.c:202
LPWSTR lgrpi1_comment
Definition: lmaccess.h:510
HINSTANCE hApplet
Definition: access.c:17
#define LVNI_SELECTED
Definition: commctrl.h:2424
UINT_PTR WPARAM
Definition: windef.h:207
static VOID GetGeneralGroupData(HWND hwndDlg, PGENERAL_GROUP_DATA pGroupData)
Definition: groupprops.c:387
#define PSN_APPLY
Definition: prsht.h:117
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2408
PDWORD WINAPI GetSidSubAuthority(PSID pSid, DWORD nSubAuthority)
Definition: security.c:898
int32_t INT_PTR
Definition: typedefs.h:64
#define IDI_LOCKED_USER
Definition: resource.h:7
struct _GENERAL_GROUP_DATA * PGENERAL_GROUP_DATA
int32_t INT
Definition: typedefs.h:58
#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
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define IDS_DESCRIPTION
Definition: resource.h:4
DWORD dwCounter
Definition: mutex.c:10
#define MB_ICONWARNING
Definition: winuser.h:780
#define NERR_Success
Definition: lmerr.h:5
#define ILC_COLOR32
Definition: commctrl.h:358
#define LVIF_TEXT
Definition: commctrl.h:2309
#define LVCF_SUBITEM
Definition: commctrl.h:2589
NET_API_STATUS WINAPI NetLocalGroupSetInfo(LPCWSTR servername, LPCWSTR groupname, DWORD level, LPBYTE buf, LPDWORD parm_err)
Definition: local_group.c:1732
#define IDC_GROUP_GENERAL_NAME
Definition: resource.h:43
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2636
#define L(x)
Definition: ntvdm.h:50
#define LVN_KEYDOWN
Definition: commctrl.h:3184
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
unsigned char * LPBYTE
Definition: typedefs.h:53
#define ListView_GetSelectedCount(hwndLV)
Definition: commctrl.h:2709
#define FALSE
Definition: types.h:117
#define MB_YESNO
Definition: winuser.h:811
unsigned int BOOL
Definition: ntddk_ex.h:94
static VOID InitGroupMembersList(HWND hwndDlg, PGENERAL_GROUP_DATA pGroupData)
Definition: groupprops.c:64
BOOL GroupProperties(HWND hwndDlg)
Definition: groupprops.c:610
NET_API_STATUS WINAPI NetLocalGroupGetInfo(LPCWSTR servername, LPCWSTR groupname, DWORD level, LPBYTE *bufptr)
Definition: local_group.c:1225
#define IDC_GROUP_GENERAL_REMOVE
Definition: resource.h:47
static PVOID ptr
Definition: dispmode.c:27
INT_PTR CALLBACK GroupGeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: groupprops.c:529
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2304
#define PROPSHEETHEADER
Definition: prsht.h:392
#define dbgstrx(x)
Definition: usrmgr.h:12
#define IDD_USER_ADD_MEMBERSHIP
Definition: resource.h:82
LONG_PTR LPARAM
Definition: windef.h:208
#define ListView_DeleteItem(hwnd, i)
Definition: commctrl.h:2411
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2307
#define VK_DELETE
Definition: winuser.h:2223
#define WM_DESTROY
Definition: winuser.h:1599
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2691
char TCHAR
Definition: xmlstorage.h:189
static VOID AddUsersToGroup(HWND hwndDlg, PGENERAL_GROUP_DATA pGroupData)
Definition: groupprops.c:246
#define PSP_DEFAULT
Definition: prsht.h:22
#define TRACE(s)
Definition: solgame.cpp:4
#define GetDlgItemText
Definition: winuser.h:5775
#define GetProcessHeap()
Definition: compat.h:736
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
static BOOL SetGeneralGroupData(HWND hwndDlg, PGENERAL_GROUP_DATA pGroupData)
Definition: groupprops.c:493
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
NET_API_STATUS WINAPI NetLocalGroupGetMembers(LPCWSTR servername, LPCWSTR localgroupname, DWORD level, LPBYTE *bufptr, DWORD prefmaxlen, LPDWORD entriesread, LPDWORD totalentries, PDWORD_PTR resumehandle)
Definition: local_group.c:1354
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define LVIF_IMAGE
Definition: commctrl.h:2310
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
Definition: commctrl.h:2725
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
#define IDC_GROUP_GENERAL_ADD
Definition: resource.h:46
#define SetDlgItemText
Definition: winuser.h:5839
#define IDC_GROUP_GENERAL_DESCRIPTION
Definition: resource.h:44
#define DialogBoxParam
Definition: winuser.h:5754
#define DWLP_USER
Definition: winuser.h:866
#define MB_ICONERROR
Definition: winuser.h:781
static VOID GetTextSid(PSID pSid, LPTSTR pTextSid)
Definition: groupprops.c:19
#define ERROR_MEMBER_IN_ALIAS
Definition: winerror.h:859
#define ILC_MASK
Definition: commctrl.h:351
PUCHAR WINAPI GetSidSubAuthorityCount(PSID pSid)
Definition: security.c:910
#define MessageBox
Definition: winuser.h:5812
#define WM_COMMAND
Definition: winuser.h:1730
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define NM_CLICK
Definition: commctrl.h:130
#define ERROR_MORE_DATA
Definition: dderror.h:13
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2886
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define ERR(fmt,...)
Definition: debug.h:110
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
#define LVCF_FMT
Definition: commctrl.h:2586
#define lstrlen
Definition: winbase.h:3747
#define TEXT(s)
Definition: k32.h:26
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
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 IDC_USER_ADD_MEMBERSHIP_LIST
Definition: resource.h:83
unsigned short USHORT
Definition: pedump.c:61
struct tagNMLISTVIEW * LPNMLISTVIEW
HICON hIcon
Definition: msconfig.c:44
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define lstrcpy
Definition: winbase.h:3745
#define IDI_USER
Definition: resource.h:6
#define UNLEN
Definition: sspi.c:28
#define UF_ACCOUNTDISABLE
Definition: lmaccess.h:24
#define FILTER_NORMAL_ACCOUNT
Definition: lmaccess.h:40
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784
static BOOL OnGroupPropSheetNotify(HWND hwndDlg, PGENERAL_GROUP_DATA pGroupData, LPARAM lParam)
Definition: groupprops.c:356
static PSID pSid
Definition: security.c:74
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define IDS_NAME
Definition: resource.h:90
TCHAR szGroupName[1]
Definition: groupprops.c:14
static VOID InitGroupPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc, LPTSTR pszGroup)
Definition: groupprops.c:597
#define PropertySheet
Definition: prsht.h:400
static VOID RemoveUserFromGroup(HWND hwndDlg, PGENERAL_GROUP_DATA pGroupData)
Definition: groupprops.c:309
#define HIWORD(l)
Definition: typedefs.h:247
unsigned int ULONG
Definition: retypes.h:1
#define GetWindowTextLength
Definition: winuser.h:5789
#define LoadImage
Definition: winuser.h:5805
struct _GENERAL_GROUP_DATA GENERAL_GROUP_DATA
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define IDNO
Definition: winuser.h:830
#define GetWindowLongPtr
Definition: treelist.c:73
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
#define LVIF_STATE
Definition: commctrl.h:2312
#define wsprintf
Definition: winuser.h:5855
#define LR_DEFAULTCOLOR
Definition: winuser.h:1081
static BOOL AddSelectedUsersToGroup(HWND hwndDlg, PGENERAL_GROUP_DATA pGroupData)
Definition: groupprops.c:152
#define memset(x, y, z)
Definition: compat.h:39
static SERVICE_STATUS status
Definition: service.c:31
#define WM_INITDIALOG
Definition: winuser.h:1729
LPARAM lParam
Definition: combotst.c:139
DLGPROC DlgProc
Definition: desk.c:111
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:735
#define LoadString
Definition: winuser.h:5809
#define PROPSHEETPAGE
Definition: prsht.h:389
#define WM_NOTIFY
Definition: richedit.h:61
PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID pSid)
Definition: security.c:887
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
#define ListView_DeleteAllItems(hwnd)
Definition: commctrl.h:2414
#define IDC_GROUPS_LIST
Definition: resource.h:16
Definition: ps.c:97
#define EN_CHANGE
Definition: winuser.h:2012