ReactOS  0.4.14-dev-384-g5b37caa
userprops.c File Reference
#include "usrmgr.h"
Include dependency graph for userprops.c:

Go to the source code of this file.

Classes

struct  _GENERAL_USER_DATA
 
struct  _PROFILE_USER_DATA
 
struct  _MEMBERSHIP_USER_DATA
 

Macros

#define VALID_GENERAL_FLAGS   (UF_PASSWD_CANT_CHANGE | UF_DONT_EXPIRE_PASSWD | UF_ACCOUNTDISABLE | UF_LOCKOUT)
 

Typedefs

typedef struct _GENERAL_USER_DATA GENERAL_USER_DATA
 
typedef struct _GENERAL_USER_DATAPGENERAL_USER_DATA
 
typedef struct _PROFILE_USER_DATA PROFILE_USER_DATA
 
typedef struct _PROFILE_USER_DATAPPROFILE_USER_DATA
 
typedef struct _MEMBERSHIP_USER_DATA MEMBERSHIP_USER_DATA
 
typedef struct _MEMBERSHIP_USER_DATAPMEMBERSHIP_USER_DATA
 

Functions

static VOID GetUserProfileData (HWND hwndDlg, PPROFILE_USER_DATA pUserData)
 
static BOOL SetUserProfileData (HWND hwndDlg, PPROFILE_USER_DATA pUserData)
 
INT_PTR CALLBACK UserProfilePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID GetUserMembershipData (HWND hwndDlg, PMEMBERSHIP_USER_DATA pUserData)
 
static VOID RemoveGroupFromUser (HWND hwndDlg, PMEMBERSHIP_USER_DATA pUserData)
 
static VOID InitUserGroupsList (HWND hwndDlg)
 
static BOOL AddSelectedGroupsToUser (HWND hwndDlg, PMEMBERSHIP_USER_DATA pUserData)
 
INT_PTR CALLBACK AddGroupToUserDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID AddGroupToUser (HWND hwndDlg, PMEMBERSHIP_USER_DATA pUserData)
 
static BOOL OnUserPropSheetNotify (HWND hwndDlg, PMEMBERSHIP_USER_DATA pUserData, LPARAM lParam)
 
INT_PTR CALLBACK UserMembershipPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID UpdateUserOptions (HWND hwndDlg, PGENERAL_USER_DATA pUserData, BOOL bInit)
 
static VOID GetUserGeneralData (HWND hwndDlg, PGENERAL_USER_DATA pUserData)
 
static BOOL SetUserGeneralData (HWND hwndDlg, PGENERAL_USER_DATA pUserData)
 
INT_PTR CALLBACK UserGeneralPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID InitUserPropSheetPage (PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc, LPTSTR pszUser)
 
BOOL UserProperties (HWND hwndDlg)
 

Macro Definition Documentation

◆ VALID_GENERAL_FLAGS

Definition at line 19 of file userprops.c.

Typedef Documentation

◆ GENERAL_USER_DATA

◆ MEMBERSHIP_USER_DATA

◆ PGENERAL_USER_DATA

◆ PMEMBERSHIP_USER_DATA

◆ PPROFILE_USER_DATA

◆ PROFILE_USER_DATA

Function Documentation

◆ AddGroupToUser()

static VOID AddGroupToUser ( HWND  hwndDlg,
PMEMBERSHIP_USER_DATA  pUserData 
)
static

Definition at line 543 of file userprops.c.

545 {
546  HWND hwndLV;
548  DWORD i;
549  DWORD dwTotal;
550  LV_ITEM lvi;
551 
554  hwndDlg,
556  (LPARAM)pUserData) == IDOK)
557  {
558  // TODO: Update Membership list!
559  hwndLV = GetDlgItem(hwndDlg, IDC_USER_MEMBERSHIP_LIST);
560 
561  if (pUserData->pGroupData)
562  NetApiBufferFree(pUserData->pGroupData);
563 
564  (void)ListView_DeleteAllItems(hwndLV);
565 
566  status = NetUserGetLocalGroups(NULL, pUserData->szUserName, 0, 0,
567  (LPBYTE*)&pUserData->pGroupData,
569  &pUserData->dwGroupCount,
570  &dwTotal);
571  if (status != NERR_Success)
572  return;
573 
574  for (i = 0; i < pUserData->dwGroupCount; i++)
575  {
576  ZeroMemory(&lvi, sizeof(lvi));
577  lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
578  lvi.pszText = pUserData->pGroupData[i].lgrui0_name;
579  lvi.state = 0;
580  lvi.iImage = 0;
581 
582  (void)ListView_InsertItem(hwndLV, &lvi);
583  }
584  }
585 }
#define LV_ITEM
Definition: commctrl.h:2333
#define MAX_PREFERRED_LENGTH
Definition: lmcons.h:48
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDOK
Definition: winuser.h:824
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define ZeroMemory
Definition: winbase.h:1642
HINSTANCE hApplet
Definition: access.c:17
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2404
#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:52
#define IDC_USER_MEMBERSHIP_LIST
Definition: resource.h:65
smooth NULL
Definition: ftsmooth.c:416
#define IDD_USER_ADD_MEMBERSHIP
Definition: resource.h:82
LONG_PTR LPARAM
Definition: windef.h:208
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
NET_API_STATUS WINAPI NetUserGetLocalGroups(LPCWSTR servername, LPCWSTR username, DWORD level, DWORD flags, LPBYTE *bufptr, DWORD prefmaxlen, LPDWORD entriesread, LPDWORD totalentries)
Definition: user.c:3324
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LVIF_IMAGE
Definition: commctrl.h:2306
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DialogBoxParam
Definition: winuser.h:5665
INT_PTR CALLBACK AddGroupToUserDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: userprops.c:499
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
#define LVIF_STATE
Definition: commctrl.h:2308
static SERVICE_STATUS status
Definition: service.c:31
#define ListView_DeleteAllItems(hwnd)
Definition: commctrl.h:2410
Definition: ps.c:97

Referenced by UserMembershipPageProc().

◆ AddGroupToUserDlgProc()

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

Definition at line 499 of file userprops.c.

503 {
504  PMEMBERSHIP_USER_DATA pUserData;
505 
507 
508  pUserData= (PMEMBERSHIP_USER_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
509 
510  switch (uMsg)
511  {
512  case WM_INITDIALOG:
513  pUserData= (PMEMBERSHIP_USER_DATA)lParam;
514  SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pUserData);
515  InitUserGroupsList(hwndDlg);
516  break;
517 
518  case WM_COMMAND:
519  switch (LOWORD(wParam))
520  {
521  case IDOK:
522  if (AddSelectedGroupsToUser(hwndDlg, pUserData))
523  EndDialog(hwndDlg, IDOK);
524  else
525  EndDialog(hwndDlg, IDCANCEL);
526  break;
527 
528  case IDCANCEL:
529  EndDialog(hwndDlg, IDCANCEL);
530  break;
531  }
532  break;
533 
534  default:
535  return FALSE;
536  }
537 
538  return TRUE;
539 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
struct _MEMBERSHIP_USER_DATA * PMEMBERSHIP_USER_DATA
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
static VOID InitUserGroupsList(HWND hwndDlg)
Definition: userprops.c:363
int32_t INT_PTR
Definition: typedefs.h:62
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
static BOOL AddSelectedGroupsToUser(HWND hwndDlg, PMEMBERSHIP_USER_DATA pUserData)
Definition: userprops.c:439
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1722
#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

Referenced by AddGroupToUser().

◆ AddSelectedGroupsToUser()

static BOOL AddSelectedGroupsToUser ( HWND  hwndDlg,
PMEMBERSHIP_USER_DATA  pUserData 
)
static

Definition at line 439 of file userprops.c.

441 {
442  HWND hwndLV;
443  INT nItem;
444  TCHAR szGroupName[UNLEN];
445  BOOL bResult = FALSE;
446  BOOL bFound;
447  DWORD i;
448  LOCALGROUP_MEMBERS_INFO_3 memberInfo;
450 
451  hwndLV = GetDlgItem(hwndDlg, IDC_USER_ADD_MEMBERSHIP_LIST);
452 
453  if (ListView_GetSelectedCount(hwndLV) > 0)
454  {
455  nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
456  while (nItem != -1)
457  {
458  /* Get the new user name */
459  ListView_GetItemText(hwndLV,
460  nItem, 0,
461  szGroupName,
462  UNLEN);
463 
464  bFound = FALSE;
465  for (i = 0; i < pUserData->dwGroupCount; i++)
466  {
467  if (_tcscmp(pUserData->pGroupData[i].lgrui0_name, szGroupName) == 0)
468  bFound = TRUE;
469  }
470 
471  if (!bFound)
472  {
473  memberInfo.lgrmi3_domainandname = pUserData->szUserName;
474 
475  status = NetLocalGroupAddMembers(NULL, szGroupName, 3,
476  (LPBYTE)&memberInfo, 1);
477  if (status == NERR_Success)
478  {
479  DebugPrintf(_TEXT("Selected group: %s"), szGroupName);
480  bResult = TRUE;
481  }
482  else
483  {
484  TCHAR szText[256];
485  wsprintf(szText, TEXT("Error: %u"), status);
486  MessageBox(NULL, szText, TEXT("NetLocalGroupAddMembers"), MB_ICONERROR | MB_OK);
487  }
488  }
489 
490  nItem = ListView_GetNextItem(hwndLV, nItem, LVNI_SELECTED);
491  }
492  }
493 
494  return bResult;
495 }
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2430
#define TRUE
Definition: types.h:120
NET_API_STATUS WINAPI NetLocalGroupAddMembers(LPCWSTR servername, LPCWSTR groupname, DWORD level, LPBYTE buf, DWORD totalentries)
Definition: local_group.c:520
PLOCALGROUP_USERS_INFO_0 pGroupData
Definition: userprops.c:28
int _tcscmp(const _TCHAR *s1, const _TCHAR *s2)
Definition: tcscmp.h:8
#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:56
#define NERR_Success
Definition: lmerr.h:5
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:52
#define ListView_GetSelectedCount(hwndLV)
Definition: commctrl.h:2705
static const WCHAR szText[]
Definition: dialog.c:139
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID DebugPrintf(LPTSTR szFormat,...)
Definition: misc.c:13
smooth NULL
Definition: ftsmooth.c:416
#define _TEXT(x)
Definition: tchar.h:1543
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
char TCHAR
Definition: xmlstorage.h:189
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5723
#define TEXT(s)
Definition: k32.h:26
#define IDC_USER_ADD_MEMBERSHIP_LIST
Definition: resource.h:83
#define UNLEN
Definition: sspi.c:28
#define MB_OK
Definition: winuser.h:784
#define wsprintf
Definition: winuser.h:5766
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by AddGroupToUserDlgProc().

◆ GetUserGeneralData()

static VOID GetUserGeneralData ( HWND  hwndDlg,
PGENERAL_USER_DATA  pUserData 
)
static

Definition at line 720 of file userprops.c.

722 {
723  PUSER_INFO_3 pUserInfo = NULL;
724 
725  SetDlgItemText(hwndDlg, IDC_USER_GENERAL_NAME, pUserData->szUserName);
726 
727  NetUserGetInfo(NULL, pUserData->szUserName, 3, (LPBYTE*)&pUserInfo);
728 
731 
732  pUserData->dwFlags = pUserInfo->usri3_flags;
733  pUserData->dwPasswordExpired = pUserInfo->usri3_password_expired;
734 
735  NetApiBufferFree(pUserInfo);
736 
737  UpdateUserOptions(hwndDlg, pUserData, TRUE);
738 }
LPWSTR usri3_comment
Definition: lmaccess.h:244
#define TRUE
Definition: types.h:120
#define IDC_USER_GENERAL_DESCRIPTION
Definition: resource.h:25
#define IDC_USER_GENERAL_FULL_NAME
Definition: resource.h:24
unsigned char * LPBYTE
Definition: typedefs.h:52
LPWSTR usri3_full_name
Definition: lmaccess.h:248
smooth NULL
Definition: ftsmooth.c:416
DWORD usri3_flags
Definition: lmaccess.h:245
NET_API_STATUS WINAPI NetUserGetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE *bufptr)
Definition: user.c:3147
DWORD dwPasswordExpired
Definition: userprops.c:15
#define SetDlgItemText
Definition: winuser.h:5750
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
DWORD usri3_password_expired
Definition: lmaccess.h:267
TCHAR szUserName[1]
Definition: userprops.c:16
#define IDC_USER_GENERAL_NAME
Definition: resource.h:23
static VOID UpdateUserOptions(HWND hwndDlg, PGENERAL_USER_DATA pUserData, BOOL bInit)
Definition: userprops.c:685

Referenced by UserGeneralPageProc().

◆ GetUserMembershipData()

static VOID GetUserMembershipData ( HWND  hwndDlg,
PMEMBERSHIP_USER_DATA  pUserData 
)
static

Definition at line 261 of file userprops.c.

262 {
264  DWORD dwTotal;
265  DWORD i;
266  HIMAGELIST hImgList;
267  HICON hIcon;
268  LV_ITEM lvi;
269  HWND hwndLV;
271  RECT rect;
272 
273 
274  hwndLV = GetDlgItem(hwndDlg, IDC_USER_MEMBERSHIP_LIST);
275 
276  /* Create the image list */
277  hImgList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 5, 5);
279  ImageList_AddIcon(hImgList, hIcon);
281  (void)ListView_SetImageList(hwndLV, hImgList, LVSIL_SMALL);
282 
283  /* Set the list column */
284  GetClientRect(hwndLV, &rect);
285 
286  memset(&column, 0x00, sizeof(column));
288  column.fmt = LVCFMT_LEFT;
289  column.cx = (INT)(rect.right - rect.left);
290  column.iSubItem = 0;
291  (void)ListView_InsertColumn(hwndLV, 0, &column);
292 
293 
294  status = NetUserGetLocalGroups(NULL, pUserData->szUserName, 0, 0,
295  (LPBYTE*)&pUserData->pGroupData,
297  &pUserData->dwGroupCount,
298  &dwTotal);
299  if (status != NERR_Success)
300  return;
301 
302  for (i = 0; i < pUserData->dwGroupCount; i++)
303  {
304  ZeroMemory(&lvi, sizeof(lvi));
305  lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
306  lvi.pszText = pUserData->pGroupData[i].lgrui0_name;
307  lvi.state = 0;
308  lvi.iImage = 0;
309 
310  (void)ListView_InsertItem(hwndLV, &lvi);
311  }
312 }
#define LV_ITEM
Definition: commctrl.h:2333
#define MAX_PREFERRED_LENGTH
Definition: lmcons.h:48
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDI_GROUP
Definition: resource.h:8
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 LVCF_WIDTH
Definition: commctrl.h:2583
#define LVSIL_SMALL
Definition: commctrl.h:2295
PLOCALGROUP_USERS_INFO_0 pGroupData
Definition: userprops.c:28
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define LV_COLUMN
Definition: commctrl.h:2543
#define INT
Definition: polytest.cpp:20
#define LVCFMT_LEFT
Definition: commctrl.h:2594
#define ZeroMemory
Definition: winbase.h:1642
HINSTANCE hApplet
Definition: access.c:17
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2404
& rect
Definition: startmenu.cpp:1413
#define NERR_Success
Definition: lmerr.h:5
#define ILC_COLOR32
Definition: commctrl.h:354
#define LVIF_TEXT
Definition: commctrl.h:2305
#define LVCF_SUBITEM
Definition: commctrl.h:2585
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2632
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
unsigned char * LPBYTE
Definition: typedefs.h:52
#define IDC_USER_MEMBERSHIP_LIST
Definition: resource.h:65
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2300
smooth NULL
Definition: ftsmooth.c:416
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
NET_API_STATUS WINAPI NetUserGetLocalGroups(LPCWSTR servername, LPCWSTR username, DWORD level, DWORD flags, LPBYTE *bufptr, DWORD prefmaxlen, LPDWORD entriesread, LPDWORD totalentries)
Definition: user.c:3324
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LVIF_IMAGE
Definition: commctrl.h:2306
unsigned long DWORD
Definition: ntddk_ex.h:95
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
#define ILC_MASK
Definition: commctrl.h:347
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define LVCF_FMT
Definition: commctrl.h:2582
HICON hIcon
Definition: msconfig.c:44
#define LoadImage
Definition: winuser.h:5716
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define LVIF_STATE
Definition: commctrl.h:2308
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
#define memset(x, y, z)
Definition: compat.h:39
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by UserMembershipPageProc().

◆ GetUserProfileData()

static VOID GetUserProfileData ( HWND  hwndDlg,
PPROFILE_USER_DATA  pUserData 
)
static

Definition at line 35 of file userprops.c.

37 {
38  PUSER_INFO_3 userInfo = NULL;
40  BOOL bLocal;
41  TCHAR szDrive[8];
42  INT i;
43  INT nSel;
44 
45  status = NetUserGetInfo(NULL, pUserData->szUserName, 3, (LPBYTE*)&userInfo);
46  if (status != NERR_Success)
47  return;
48 
51 
52 
53  bLocal = (userInfo->usri3_home_dir_drive == NULL) ||
54  (_tcslen(userInfo->usri3_home_dir_drive) == 0);
57 
58  for (i = 0; i < 26; i++)
59  {
60  wsprintf(szDrive, _T("%c:"), (TCHAR)('A' + i));
62  CB_INSERTSTRING, -1, (LPARAM)szDrive);
63  }
64 
65  if (bLocal)
66  {
70  }
71  else
72  {
76  }
77 
79  CB_SETCURSEL, nSel, 0);
80 
81  NetApiBufferFree(userInfo);
82 }
LPWSTR usri3_home_dir
Definition: lmaccess.h:243
LPWSTR usri3_profile
Definition: lmaccess.h:265
#define IDC_USER_PROFILE_LOCAL
Definition: resource.h:72
int32_t INT
Definition: typedefs.h:56
LPWSTR usri3_home_dir_drive
Definition: lmaccess.h:266
#define NERR_Success
Definition: lmerr.h:5
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:52
#define IDC_USER_PROFILE_PATH
Definition: resource.h:70
unsigned int BOOL
Definition: ntddk_ex.h:94
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
#define CB_INSERTSTRING
Definition: winuser.h:1939
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
NET_API_STATUS WINAPI NetUserGetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE *bufptr)
Definition: user.c:3147
TCHAR szUserName[1]
Definition: userprops.c:23
#define IDC_USER_PROFILE_DRIVE
Definition: resource.h:75
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
char TCHAR
Definition: xmlstorage.h:189
#define IDC_USER_PROFILE_LOCAL_PATH
Definition: resource.h:74
#define _T(x)
Definition: vfdio.h:22
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_USER_PROFILE_SCRIPT
Definition: resource.h:71
#define IDC_USER_PROFILE_REMOTE
Definition: resource.h:73
#define SetDlgItemText
Definition: winuser.h:5750
#define CB_SETCURSEL
Definition: winuser.h:1943
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define IDC_USER_PROFILE_REMOTE_PATH
Definition: resource.h:76
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
#define SendMessage
Definition: winuser.h:5744
LPWSTR usri3_script_path
Definition: lmaccess.h:246
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define wsprintf
Definition: winuser.h:5766
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1922

Referenced by UserProfilePageProc().

◆ InitUserGroupsList()

static VOID InitUserGroupsList ( HWND  hwndDlg)
static

Definition at line 363 of file userprops.c.

364 {
365  HWND hwndLV;
367  RECT rect;
368  TCHAR szStr[32];
369 
370  NET_API_STATUS netStatus;
372  DWORD entriesread;
373  DWORD totalentries;
374  DWORD_PTR resume_handle = 0;
375  DWORD i;
376  LV_ITEM lvi;
377  INT iItem;
378 
379  HIMAGELIST hImgList;
380  HICON hIcon;
381 
382  hwndLV = GetDlgItem(hwndDlg, IDC_USER_ADD_MEMBERSHIP_LIST);
383  GetClientRect(hwndLV, &rect);
384 
385  hImgList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 5, 5);
387  ImageList_AddIcon(hImgList, hIcon);
389 
390  (void)ListView_SetImageList(hwndLV, hImgList, LVSIL_SMALL);
392 
393  memset(&column, 0x00, sizeof(column));
395  column.fmt = LVCFMT_LEFT;
396  column.cx = (INT)((rect.right - rect.left) * 0.40);
397  column.iSubItem = 0;
398  LoadString(hApplet, IDS_NAME, szStr, sizeof(szStr) / sizeof(szStr[0]));
399  column.pszText = szStr;
400  (void)ListView_InsertColumn(hwndLV, 0, &column);
401 
402  column.cx = (INT)((rect.right - rect.left) * 0.60);
403  column.iSubItem = 1;
404  LoadString(hApplet, IDS_DESCRIPTION, szStr, sizeof(szStr) / sizeof(szStr[0]));
405  column.pszText = szStr;
406  (void)ListView_InsertColumn(hwndLV, 1, &column);
407 
408  for (;;)
409  {
410  netStatus = NetLocalGroupEnum(NULL, 1, (LPBYTE*)&pBuffer,
411  1024, &entriesread,
412  &totalentries, &resume_handle);
413  if (netStatus != NERR_Success && netStatus != ERROR_MORE_DATA)
414  break;
415 
416  for (i = 0; i < entriesread; i++)
417  {
418  memset(&lvi, 0x00, sizeof(lvi));
419  lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
420  lvi.pszText = pBuffer[i].lgrpi1_name;
421  lvi.state = 0;
422  lvi.iImage = 0;
423  iItem = ListView_InsertItem(hwndLV, &lvi);
424 
425  ListView_SetItemText(hwndLV, iItem, 1,
426  pBuffer[i].lgrpi1_comment);
427  }
428 
430 
431  /* No more data left */
432  if (netStatus != ERROR_MORE_DATA)
433  break;
434  }
435 }
#define LV_ITEM
Definition: commctrl.h:2333
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDI_GROUP
Definition: resource.h:8
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 LVCF_WIDTH
Definition: commctrl.h:2583
#define LVSIL_SMALL
Definition: commctrl.h:2295
#define LVCF_TEXT
Definition: commctrl.h:2584
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define LV_COLUMN
Definition: commctrl.h:2543
#define IDS_DESCRIPTION
Definition: resource.h:92
#define INT
Definition: polytest.cpp:20
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2730
#define LVCFMT_LEFT
Definition: commctrl.h:2594
HINSTANCE hApplet
Definition: access.c:17
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2404
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
#define NERR_Success
Definition: lmerr.h:5
#define ILC_COLOR32
Definition: commctrl.h:354
#define LVIF_TEXT
Definition: commctrl.h:2305
#define LVCF_SUBITEM
Definition: commctrl.h:2585
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2632
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
unsigned char * LPBYTE
Definition: typedefs.h:52
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2300
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
char TCHAR
Definition: xmlstorage.h:189
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LVIF_IMAGE
Definition: commctrl.h:2306
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
Definition: commctrl.h:2721
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
#define ILC_MASK
Definition: commctrl.h:347
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define ERROR_MORE_DATA
Definition: dderror.h:13
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define LVCF_FMT
Definition: commctrl.h:2582
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
#define IDC_USER_ADD_MEMBERSHIP_LIST
Definition: resource.h:83
HICON hIcon
Definition: msconfig.c:44
#define IDS_NAME
Definition: resource.h:90
#define LoadImage
Definition: winuser.h:5716
NET_API_STATUS WINAPI NetLocalGroupEnum(LPCWSTR servername, DWORD level, LPBYTE *bufptr, DWORD prefmaxlen, LPDWORD entriesread, LPDWORD totalentries, PDWORD_PTR resumehandle)
Definition: local_group.c:974
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define LVIF_STATE
Definition: commctrl.h:2308
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
#define memset(x, y, z)
Definition: compat.h:39
#define LoadString
Definition: winuser.h:5720

Referenced by AddGroupToUserDlgProc().

◆ InitUserPropSheetPage()

static VOID InitUserPropSheetPage ( PROPSHEETPAGE psp,
WORD  idDlg,
DLGPROC  DlgProc,
LPTSTR  pszUser 
)
static

Definition at line 888 of file userprops.c.

889 {
890  ZeroMemory(psp, sizeof(PROPSHEETPAGE));
891  psp->dwSize = sizeof(PROPSHEETPAGE);
892  psp->dwFlags = PSP_DEFAULT;
893  psp->hInstance = hApplet;
894  psp->pszTemplate = MAKEINTRESOURCE(idDlg);
895  psp->pfnDlgProc = DlgProc;
896  psp->lParam = (LPARAM)pszUser;
897 }
WORD idDlg
Definition: desk.c:109
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define ZeroMemory
Definition: winbase.h:1642
HINSTANCE hApplet
Definition: access.c:17
LONG_PTR LPARAM
Definition: windef.h:208
#define PSP_DEFAULT
Definition: prsht.h:22
DLGPROC DlgProc
Definition: desk.c:110
#define PROPSHEETPAGE
Definition: prsht.h:371

Referenced by UserProperties().

◆ OnUserPropSheetNotify()

static BOOL OnUserPropSheetNotify ( HWND  hwndDlg,
PMEMBERSHIP_USER_DATA  pUserData,
LPARAM  lParam 
)
static

Definition at line 589 of file userprops.c.

592 {
593  LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)lParam;
594 
595  switch (((LPNMHDR)lParam)->idFrom)
596  {
598  switch (((LPNMHDR)lParam)->code)
599  {
600  case NM_CLICK:
601  EnableWindow(GetDlgItem(hwndDlg, IDC_USER_MEMBERSHIP_REMOVE), (lpnmlv->iItem != -1));
602  break;
603 
604  case LVN_KEYDOWN:
605  if (((LPNMLVKEYDOWN)lParam)->wVKey == VK_DELETE)
606  {
607  RemoveGroupFromUser(hwndDlg, pUserData);
608  }
609  break;
610 
611  }
612  break;
613  }
614 
615  return FALSE;
616 }
#define LVN_KEYDOWN
Definition: commctrl.h:3180
#define IDC_USER_MEMBERSHIP_LIST
Definition: resource.h:65
#define VK_DELETE
Definition: winuser.h:2208
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_USER_MEMBERSHIP_REMOVE
Definition: resource.h:67
#define NM_CLICK
Definition: commctrl.h:130
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
struct tagNMLISTVIEW * LPNMLISTVIEW
static VOID RemoveGroupFromUser(HWND hwndDlg, PMEMBERSHIP_USER_DATA pUserData)
Definition: userprops.c:316
LPARAM lParam
Definition: combotst.c:139

Referenced by UserMembershipPageProc().

◆ RemoveGroupFromUser()

static VOID RemoveGroupFromUser ( HWND  hwndDlg,
PMEMBERSHIP_USER_DATA  pUserData 
)
static

Definition at line 316 of file userprops.c.

318 {
319  TCHAR szGroupName[UNLEN];
320  TCHAR szText[256];
321  LOCALGROUP_MEMBERS_INFO_3 memberInfo;
322  HWND hwndLV;
323  INT nItem;
325 
326  hwndLV = GetDlgItem(hwndDlg, IDC_USER_MEMBERSHIP_LIST);
327  nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
328  if (nItem == -1)
329  return;
330 
331  /* Get the new user name */
332  ListView_GetItemText(hwndLV,
333  nItem, 0,
334  szGroupName,
335  UNLEN);
336 
337  /* Display a warning message because the remove operation cannot be reverted */
338  wsprintf(szText, TEXT("Do you really want to remove the user \"%s\" from the group \"%s\"?"),
339  pUserData->szUserName, szGroupName);
340  if (MessageBox(NULL, szText, TEXT("User Accounts"), MB_ICONWARNING | MB_YESNO) == IDNO)
341  return;
342 
343  memberInfo.lgrmi3_domainandname = pUserData->szUserName;
344 
345  status = NetLocalGroupDelMembers(NULL, szGroupName,
346  3, (LPBYTE)&memberInfo, 1);
347  if (status != NERR_Success)
348  {
349  TCHAR szText[256];
350  wsprintf(szText, TEXT("Error: %u"), status);
351  MessageBox(NULL, szText, TEXT("NetLocalGroupDelMembers"), MB_ICONERROR | MB_OK);
352  return;
353  }
354 
355  (void)ListView_DeleteItem(hwndLV, nItem);
356 
357  if (ListView_GetItemCount(hwndLV) == 0)
359 }
NET_API_STATUS WINAPI NetLocalGroupDelMembers(LPCWSTR servername, LPCWSTR groupname, DWORD level, LPBYTE buf, DWORD totalentries)
Definition: local_group.c:817
#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_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2680
#define LVNI_SELECTED
Definition: commctrl.h:2420
int32_t INT
Definition: typedefs.h:56
#define MB_ICONWARNING
Definition: winuser.h:780
#define NERR_Success
Definition: lmerr.h:5
unsigned char * LPBYTE
Definition: typedefs.h:52
#define MB_YESNO
Definition: winuser.h:811
static const WCHAR szText[]
Definition: dialog.c:139
#define IDC_USER_MEMBERSHIP_LIST
Definition: resource.h:65
smooth NULL
Definition: ftsmooth.c:416
#define ListView_DeleteItem(hwnd, i)
Definition: commctrl.h:2407
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2303
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
char TCHAR
Definition: xmlstorage.h:189
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_USER_MEMBERSHIP_REMOVE
Definition: resource.h:67
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5723
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#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:5766
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by OnUserPropSheetNotify(), and UserMembershipPageProc().

◆ SetUserGeneralData()

static BOOL SetUserGeneralData ( HWND  hwndDlg,
PGENERAL_USER_DATA  pUserData 
)
static

Definition at line 742 of file userprops.c.

744 {
745  PUSER_INFO_3 pUserInfo = NULL;
746  LPTSTR pszFullName = NULL;
747  LPTSTR pszComment = NULL;
749  DWORD dwIndex;
750  INT nLength;
751 
752  NetUserGetInfo(NULL, pUserData->szUserName, 3, (LPBYTE*)&pUserInfo);
753 
754  pUserInfo->usri3_flags =
755  (pUserData->dwFlags & VALID_GENERAL_FLAGS) |
756  (pUserInfo->usri3_flags & ~VALID_GENERAL_FLAGS);
757 
758  pUserInfo->usri3_password_expired = pUserData->dwPasswordExpired;
759 
761  if (nLength == 0)
762  {
763  pUserInfo->usri3_full_name = NULL;
764  }
765  else
766  {
767  pszFullName = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR));
768  GetDlgItemText(hwndDlg, IDC_USER_GENERAL_FULL_NAME, pszFullName, nLength + 1);
769  pUserInfo->usri3_full_name = pszFullName;
770  }
771 
773  if (nLength == 0)
774  {
775  pUserInfo->usri3_full_name = NULL;
776  }
777  else
778  {
779  pszComment = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR));
780  GetDlgItemText(hwndDlg, IDC_USER_GENERAL_DESCRIPTION, pszComment, nLength + 1);
781  pUserInfo->usri3_comment = pszComment;
782  }
783 
784  status = NetUserSetInfo(NULL, pUserData->szUserName, 3, (LPBYTE)pUserInfo, &dwIndex);
785  if (status != NERR_Success)
786  {
787  DebugPrintf(_T("Status: %lu Index: %lu"), status, dwIndex);
788  }
789 
790  if (pszFullName)
791  HeapFree(GetProcessHeap(), 0, pszFullName);
792 
793  if (pszComment)
794  HeapFree(GetProcessHeap(), 0, pszComment);
795 
796  NetApiBufferFree(pUserInfo);
797 
798  return (status == NERR_Success);
799 }
LPWSTR usri3_comment
Definition: lmaccess.h:244
#define VALID_GENERAL_FLAGS
Definition: userprops.c:19
_In_ DWORD nLength
Definition: wincon.h:461
#define IDC_USER_GENERAL_DESCRIPTION
Definition: resource.h:25
#define IDC_USER_GENERAL_FULL_NAME
Definition: resource.h:24
int32_t INT
Definition: typedefs.h:56
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define NERR_Success
Definition: lmerr.h:5
unsigned char * LPBYTE
Definition: typedefs.h:52
LPWSTR usri3_full_name
Definition: lmaccess.h:248
VOID DebugPrintf(LPTSTR szFormat,...)
Definition: misc.c:13
smooth NULL
Definition: ftsmooth.c:416
DWORD usri3_flags
Definition: lmaccess.h:245
NET_API_STATUS WINAPI NetUserGetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE *bufptr)
Definition: user.c:3147
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define GetDlgItemText
Definition: winuser.h:5686
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DWORD dwPasswordExpired
Definition: userprops.c:15
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
NET_API_STATUS WINAPI NetUserSetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE buf, LPDWORD parm_err)
Definition: user.c:3975
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
DWORD usri3_password_expired
Definition: lmaccess.h:267
TCHAR szUserName[1]
Definition: userprops.c:16
#define GetWindowTextLength
Definition: winuser.h:5700
static SERVICE_STATUS status
Definition: service.c:31
#define HeapFree(x, y, z)
Definition: compat.h:402
Definition: ps.c:97

Referenced by UserGeneralPageProc().

◆ SetUserProfileData()

static BOOL SetUserProfileData ( HWND  hwndDlg,
PPROFILE_USER_DATA  pUserData 
)
static

Definition at line 86 of file userprops.c.

88 {
89  PUSER_INFO_3 pUserInfo = NULL;
90  LPTSTR pszProfilePath = NULL;
91  LPTSTR pszScriptPath = NULL;
92  LPTSTR pszHomeDir = NULL;
93  LPTSTR pszHomeDrive = NULL;
95  DWORD dwIndex;
96  INT nLength;
97  INT nIndex;
98 
99  NetUserGetInfo(NULL, pUserData->szUserName, 3, (LPBYTE*)&pUserInfo);
100 
101  /* Get the profile path */
103  if (nLength == 0)
104  {
105  pUserInfo->usri3_profile = NULL;
106  }
107  else
108  {
109  pszProfilePath = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR));
110  GetDlgItemText(hwndDlg, IDC_USER_PROFILE_PATH, pszProfilePath, nLength + 1);
111  pUserInfo->usri3_profile = pszProfilePath;
112  }
113 
114  /* Get the script path */
116  if (nLength == 0)
117  {
118  pUserInfo->usri3_script_path = NULL;
119  }
120  else
121  {
122  pszScriptPath = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR));
123  GetDlgItemText(hwndDlg, IDC_USER_PROFILE_SCRIPT, pszScriptPath, nLength + 1);
124  pUserInfo->usri3_script_path = pszScriptPath;
125  }
126 
128  {
129  /* Local home directory */
131  if (nLength == 0)
132  {
133  pUserInfo->usri3_home_dir = NULL;
134  }
135  else
136  {
137  pszHomeDir = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR));
138  GetDlgItemText(hwndDlg, IDC_USER_PROFILE_LOCAL_PATH, pszHomeDir, nLength + 1);
139  pUserInfo->usri3_home_dir = pszHomeDir;
140  }
141  }
142  else
143  {
144  /* Remote home directory */
146  if (nLength == 0)
147  {
148  pUserInfo->usri3_home_dir = NULL;
149  }
150  else
151  {
152  pszHomeDir = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR));
153  GetDlgItemText(hwndDlg, IDC_USER_PROFILE_REMOTE_PATH, pszHomeDir, nLength + 1);
154  pUserInfo->usri3_home_dir = pszHomeDir;
155  }
156 
157  nIndex = SendMessage(GetDlgItem(hwndDlg, IDC_USER_PROFILE_DRIVE), CB_GETCURSEL, 0, 0);
158  if (nIndex != CB_ERR)
159  {
161  pszHomeDrive = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR));
162  SendMessage(GetDlgItem(hwndDlg, IDC_USER_PROFILE_DRIVE), CB_GETLBTEXT, nIndex, (LPARAM)pszHomeDrive);
163  pUserInfo->usri3_home_dir_drive = pszHomeDrive;
164  }
165  }
166 
167  status = NetUserSetInfo(NULL, pUserData->szUserName, 3, (LPBYTE)pUserInfo, &dwIndex);
168  if (status != NERR_Success)
169  {
170  DebugPrintf(_T("Status: %lu Index: %lu"), status, dwIndex);
171  }
172 
173  if (pszProfilePath)
174  HeapFree(GetProcessHeap(), 0, pszProfilePath);
175 
176  if (pszScriptPath)
177  HeapFree(GetProcessHeap(), 0, pszScriptPath);
178 
179  if (pszHomeDir)
180  HeapFree(GetProcessHeap(), 0, pszHomeDir);
181 
182  if (pszHomeDrive)
183  HeapFree(GetProcessHeap(), 0, pszHomeDrive);
184 
185  NetApiBufferFree(pUserInfo);
186 
187  return (status == NERR_Success);
188 }
#define CB_GETLBTEXTLEN
Definition: winuser.h:1935
#define CB_GETLBTEXT
Definition: winuser.h:1934
LPWSTR usri3_home_dir
Definition: lmaccess.h:243
LPWSTR usri3_profile
Definition: lmaccess.h:265
_In_ DWORD nLength
Definition: wincon.h:461
#define IDC_USER_PROFILE_LOCAL
Definition: resource.h:72
int32_t INT
Definition: typedefs.h:56
#define CB_GETCURSEL
Definition: winuser.h:1925
CHAR * LPTSTR
Definition: xmlstorage.h:192
LPWSTR usri3_home_dir_drive
Definition: lmaccess.h:266
#define NERR_Success
Definition: lmerr.h:5
unsigned char * LPBYTE
Definition: typedefs.h:52
#define IDC_USER_PROFILE_PATH
Definition: resource.h:70
VOID DebugPrintf(LPTSTR szFormat,...)
Definition: misc.c:13
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
NET_API_STATUS WINAPI NetUserGetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE *bufptr)
Definition: user.c:3147
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
TCHAR szUserName[1]
Definition: userprops.c:23
#define CB_ERR
Definition: winuser.h:2410
#define IDC_USER_PROFILE_DRIVE
Definition: resource.h:75
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
char TCHAR
Definition: xmlstorage.h:189
#define IDC_USER_PROFILE_LOCAL_PATH
Definition: resource.h:74
#define _T(x)
Definition: vfdio.h:22
#define GetDlgItemText
Definition: winuser.h:5686
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_USER_PROFILE_SCRIPT
Definition: resource.h:71
unsigned long DWORD
Definition: ntddk_ex.h:95
NET_API_STATUS WINAPI NetUserSetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE buf, LPDWORD parm_err)
Definition: user.c:3975
#define IDC_USER_PROFILE_REMOTE_PATH
Definition: resource.h:76
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
#define BST_CHECKED
Definition: winuser.h:197
#define SendMessage
Definition: winuser.h:5744
LPWSTR usri3_script_path
Definition: lmaccess.h:246
#define GetWindowTextLength
Definition: winuser.h:5700
static SERVICE_STATUS status
Definition: service.c:31
#define HeapFree(x, y, z)
Definition: compat.h:402
Definition: ps.c:97

Referenced by UserProfilePageProc().

◆ UpdateUserOptions()

static VOID UpdateUserOptions ( HWND  hwndDlg,
PGENERAL_USER_DATA  pUserData,
BOOL  bInit 
)
static

Definition at line 685 of file userprops.c.

688 {
690  !pUserData->dwPasswordExpired);
692  !pUserData->dwPasswordExpired);
694  (pUserData->dwFlags & (UF_PASSWD_CANT_CHANGE | UF_DONT_EXPIRE_PASSWD)) == 0);
695 
697  (pUserData->dwFlags & UF_LOCKOUT) != 0);
698 
699  if (bInit)
700  {
703 
706 
709 
712 
714  (pUserData->dwFlags & UF_LOCKOUT) ? BST_CHECKED : BST_UNCHECKED);
715  }
716 }
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define IDC_USER_GENERAL_DISABLED
Definition: resource.h:29
#define IDC_USER_GENERAL_LOCKED
Definition: resource.h:30
#define UF_PASSWD_CANT_CHANGE
Definition: lmaccess.h:28
#define IDC_USER_GENERAL_CANNOT_CHANGE
Definition: resource.h:27
DWORD dwPasswordExpired
Definition: userprops.c:15
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#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
#define IDC_USER_GENERAL_FORCE_CHANGE
Definition: resource.h:26
#define BST_CHECKED
Definition: winuser.h:197
#define UF_LOCKOUT
Definition: lmaccess.h:26
#define IDC_USER_GENERAL_NEVER_EXPIRES
Definition: resource.h:28

Referenced by GetUserGeneralData(), and UserGeneralPageProc().

◆ UserGeneralPageProc()

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

Definition at line 803 of file userprops.c.

807 {
808  PGENERAL_USER_DATA pUserData;
809 
812  UNREFERENCED_PARAMETER(hwndDlg);
813 
814  pUserData= (PGENERAL_USER_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
815 
816  switch (uMsg)
817  {
818  case WM_INITDIALOG:
821  sizeof(GENERAL_USER_DATA) +
822  lstrlen((LPTSTR)((PROPSHEETPAGE *)lParam)->lParam) * sizeof(TCHAR));
823  lstrcpy(pUserData->szUserName, (LPTSTR)((PROPSHEETPAGE *)lParam)->lParam);
824 
825  SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pUserData);
826 
827  GetUserGeneralData(hwndDlg,
828  pUserData);
829  break;
830 
831  case WM_COMMAND:
832  switch (LOWORD(wParam))
833  {
836  if (HIWORD(wParam) == EN_CHANGE)
837  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
838  break;
839 
841  pUserData->dwPasswordExpired = !pUserData->dwPasswordExpired;
842  UpdateUserOptions(hwndDlg, pUserData, FALSE);
843  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
844  break;
845 
847  pUserData->dwFlags ^= UF_PASSWD_CANT_CHANGE;
848  UpdateUserOptions(hwndDlg, pUserData, FALSE);
849  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
850  break;
851 
853  pUserData->dwFlags ^= UF_DONT_EXPIRE_PASSWD;
854  UpdateUserOptions(hwndDlg, pUserData, FALSE);
855  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
856  break;
857 
859  pUserData->dwFlags ^= UF_ACCOUNTDISABLE;
860  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
861  break;
862 
864  pUserData->dwFlags ^= UF_LOCKOUT;
865  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
866  break;
867  }
868  break;
869 
870  case WM_NOTIFY:
871  if (((LPPSHNOTIFY)lParam)->hdr.code == PSN_APPLY)
872  {
873  SetUserGeneralData(hwndDlg, pUserData);
874  return TRUE;
875  }
876  break;
877 
878  case WM_DESTROY:
879  HeapFree(GetProcessHeap(), 0, pUserData);
880  break;
881  }
882 
883  return FALSE;
884 }
#define TRUE
Definition: types.h:120
char hdr[14]
Definition: iptest.cpp:33
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define IDC_USER_GENERAL_DESCRIPTION
Definition: resource.h:25
#define PSN_APPLY
Definition: prsht.h:117
int32_t INT_PTR
Definition: typedefs.h:62
struct _GENERAL_USER_DATA * PGENERAL_USER_DATA
#define IDC_USER_GENERAL_FULL_NAME
Definition: resource.h:24
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define IDC_USER_GENERAL_DISABLED
Definition: resource.h:29
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define IDC_USER_GENERAL_LOCKED
Definition: resource.h:30
#define UF_PASSWD_CANT_CHANGE
Definition: lmaccess.h:28
static BOOL SetUserGeneralData(HWND hwndDlg, PGENERAL_USER_DATA pUserData)
Definition: userprops.c:742
#define IDC_USER_GENERAL_CANNOT_CHANGE
Definition: resource.h:27
#define WM_DESTROY
Definition: winuser.h:1591
char TCHAR
Definition: xmlstorage.h:189
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DWORD dwPasswordExpired
Definition: userprops.c:15
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define DWLP_USER
Definition: winuser.h:866
#define UF_DONT_EXPIRE_PASSWD
Definition: lmaccess.h:37
#define WM_COMMAND
Definition: winuser.h:1722
HWND WINAPI GetParent(_In_ HWND)
#define lstrlen
Definition: winbase.h:3700
struct _GENERAL_USER_DATA GENERAL_USER_DATA
#define lstrcpy
Definition: winbase.h:3698
static VOID GetUserGeneralData(HWND hwndDlg, PGENERAL_USER_DATA pUserData)
Definition: userprops.c:720
#define UF_ACCOUNTDISABLE
Definition: lmaccess.h:24
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define IDC_USER_GENERAL_FORCE_CHANGE
Definition: resource.h:26
TCHAR szUserName[1]
Definition: userprops.c:16
#define UF_LOCKOUT
Definition: lmaccess.h:26
#define HIWORD(l)
Definition: typedefs.h:246
#define GetWindowLongPtr
Definition: treelist.c:73
static VOID UpdateUserOptions(HWND hwndDlg, PGENERAL_USER_DATA pUserData, BOOL bInit)
Definition: userprops.c:685
#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:402
#define PROPSHEETPAGE
Definition: prsht.h:371
#define WM_NOTIFY
Definition: richedit.h:61
#define IDC_USER_GENERAL_NEVER_EXPIRES
Definition: resource.h:28
#define EN_CHANGE
Definition: winuser.h:2004

Referenced by UserProperties().

◆ UserMembershipPageProc()

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

Definition at line 620 of file userprops.c.

624 {
625  PMEMBERSHIP_USER_DATA pUserData;
626 
629  UNREFERENCED_PARAMETER(hwndDlg);
630 
631  pUserData= (PMEMBERSHIP_USER_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
632 
633  switch (uMsg)
634  {
635  case WM_INITDIALOG:
638  sizeof(MEMBERSHIP_USER_DATA) +
639  lstrlen((LPTSTR)((PROPSHEETPAGE *)lParam)->lParam) * sizeof(TCHAR));
640  lstrcpy(pUserData->szUserName, (LPTSTR)((PROPSHEETPAGE *)lParam)->lParam);
641 
642  SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pUserData);
643 
644  GetUserMembershipData(hwndDlg, pUserData);
645  break;
646 
647  case WM_COMMAND:
648  switch (LOWORD(wParam))
649  {
651  AddGroupToUser(hwndDlg, pUserData);
652  break;
653 
655  RemoveGroupFromUser(hwndDlg, pUserData);
656  break;
657  }
658  break;
659 
660  case WM_NOTIFY:
661  if (((LPPSHNOTIFY)lParam)->hdr.code == PSN_APPLY)
662  {
663  return TRUE;
664  }
665  else
666  {
667  return OnUserPropSheetNotify(hwndDlg, pUserData, lParam);
668  }
669  break;
670 
671 
672  case WM_DESTROY:
673  if (pUserData->pGroupData)
674  NetApiBufferFree(pUserData->pGroupData);
675 
676  HeapFree(GetProcessHeap(), 0, pUserData);
677  break;
678  }
679 
680  return FALSE;
681 }
#define TRUE
Definition: types.h:120
char hdr[14]
Definition: iptest.cpp:33
PLOCALGROUP_USERS_INFO_0 pGroupData
Definition: userprops.c:28
struct _MEMBERSHIP_USER_DATA * PMEMBERSHIP_USER_DATA
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
struct _MEMBERSHIP_USER_DATA MEMBERSHIP_USER_DATA
static VOID AddGroupToUser(HWND hwndDlg, PMEMBERSHIP_USER_DATA pUserData)
Definition: userprops.c:543
#define PSN_APPLY
Definition: prsht.h:117
int32_t INT_PTR
Definition: typedefs.h:62
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define WM_DESTROY
Definition: winuser.h:1591
char TCHAR
Definition: xmlstorage.h:189
static BOOL OnUserPropSheetNotify(HWND hwndDlg, PMEMBERSHIP_USER_DATA pUserData, LPARAM lParam)
Definition: userprops.c:589
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define IDC_USER_MEMBERSHIP_REMOVE
Definition: resource.h:67
#define DWLP_USER
Definition: winuser.h:866
#define IDC_USER_MEMBERSHIP_ADD
Definition: resource.h:66
#define WM_COMMAND
Definition: winuser.h:1722
#define lstrlen
Definition: winbase.h:3700
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
#define lstrcpy
Definition: winbase.h:3698
static VOID RemoveGroupFromUser(HWND hwndDlg, PMEMBERSHIP_USER_DATA pUserData)
Definition: userprops.c:316
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static VOID GetUserMembershipData(HWND hwndDlg, PMEMBERSHIP_USER_DATA pUserData)
Definition: userprops.c:261
#define GetWindowLongPtr
Definition: treelist.c:73
#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:402
#define PROPSHEETPAGE
Definition: prsht.h:371
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by UserProperties().

◆ UserProfilePageProc()

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

Definition at line 192 of file userprops.c.

196 {
197  PPROFILE_USER_DATA pUserData;
198 
201  UNREFERENCED_PARAMETER(hwndDlg);
202 
203  pUserData= (PPROFILE_USER_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
204 
205  switch (uMsg)
206  {
207  case WM_INITDIALOG:
210  sizeof(PROFILE_USER_DATA) +
211  lstrlen((LPTSTR)((PROPSHEETPAGE *)lParam)->lParam) * sizeof(TCHAR));
212  lstrcpy(pUserData->szUserName, (LPTSTR)((PROPSHEETPAGE *)lParam)->lParam);
213 
214  SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pUserData);
215 
216  GetUserProfileData(hwndDlg,
217  pUserData);
218  break;
219 
220  case WM_COMMAND:
221  switch (LOWORD(wParam))
222  {
225  if (HIWORD(wParam) == EN_CHANGE)
226  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
227  break;
228 
233  break;
234 
239  break;
240  }
241  break;
242 
243  case WM_DESTROY:
244  HeapFree(GetProcessHeap(), 0, pUserData);
245  break;
246 
247  case WM_NOTIFY:
248  if (((LPPSHNOTIFY)lParam)->hdr.code == PSN_APPLY)
249  {
250  SetUserProfileData(hwndDlg, pUserData);
251  return TRUE;
252  }
253  break;
254  }
255 
256  return FALSE;
257 }
#define TRUE
Definition: types.h:120
char hdr[14]
Definition: iptest.cpp:33
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define IDC_USER_PROFILE_LOCAL
Definition: resource.h:72
#define PSN_APPLY
Definition: prsht.h:117
int32_t INT_PTR
Definition: typedefs.h:62
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
CHAR * LPTSTR
Definition: xmlstorage.h:192
static VOID GetUserProfileData(HWND hwndDlg, PPROFILE_USER_DATA pUserData)
Definition: userprops.c:35
#define IDC_USER_PROFILE_PATH
Definition: resource.h:70
struct _PROFILE_USER_DATA PROFILE_USER_DATA
TCHAR szUserName[1]
Definition: userprops.c:23
#define IDC_USER_PROFILE_DRIVE
Definition: resource.h:75
#define WM_DESTROY
Definition: winuser.h:1591
char TCHAR
Definition: xmlstorage.h:189
static BOOL SetUserProfileData(HWND hwndDlg, PPROFILE_USER_DATA pUserData)
Definition: userprops.c:86
#define IDC_USER_PROFILE_LOCAL_PATH
Definition: resource.h:74
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_USER_PROFILE_SCRIPT
Definition: resource.h:71
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define IDC_USER_PROFILE_REMOTE
Definition: resource.h:73
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1722
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define IDC_USER_PROFILE_REMOTE_PATH
Definition: resource.h:76
#define lstrlen
Definition: winbase.h:3700
#define lstrcpy
Definition: winbase.h:3698
struct _PROFILE_USER_DATA * PPROFILE_USER_DATA
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HIWORD(l)
Definition: typedefs.h:246
#define GetWindowLongPtr
Definition: treelist.c:73
#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:402
#define PROPSHEETPAGE
Definition: prsht.h:371
#define WM_NOTIFY
Definition: richedit.h:61
#define EN_CHANGE
Definition: winuser.h:2004

Referenced by UserProperties().

◆ UserProperties()

BOOL UserProperties ( HWND  hwndDlg)

Definition at line 901 of file userprops.c.

902 {
903  PROPSHEETPAGE psp[3];
904  PROPSHEETHEADER psh;
905  TCHAR szUserName[UNLEN];
906  INT nItem;
907  HWND hwndLV;
908 
909  hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
910  nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
911  if (nItem == -1)
912  return FALSE;
913 
914  /* Get the new user name */
915  ListView_GetItemText(hwndLV,
916  nItem, 0,
917  szUserName,
918  UNLEN);
919 
920  ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
921  psh.dwSize = sizeof(PROPSHEETHEADER);
922  psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
923  psh.hwndParent = hwndDlg;
924  psh.hInstance = hApplet;
925  psh.hIcon = NULL;
926  psh.pszCaption = szUserName;
927  psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
928  psh.nStartPage = 0;
929  psh.ppsp = psp;
930 
934 
935  return (PropertySheet(&psh) == IDOK);
936 }
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2430
#define IDOK
Definition: winuser.h:824
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2680
#define ZeroMemory
Definition: winbase.h:1642
HINSTANCE hApplet
Definition: access.c:17
#define LVNI_SELECTED
Definition: commctrl.h:2420
int32_t INT
Definition: typedefs.h:56
#define IDD_USER_MEMBERSHIP
Definition: resource.h:64
#define IDD_USER_GENERAL
Definition: resource.h:22
INT_PTR CALLBACK UserProfilePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: userprops.c:192
smooth NULL
Definition: ftsmooth.c:416
#define PROPSHEETHEADER
Definition: prsht.h:374
#define IDD_USER_PROFILE
Definition: resource.h:69
static VOID InitUserPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc, LPTSTR pszUser)
Definition: userprops.c:888
char TCHAR
Definition: xmlstorage.h:189
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PSH_PROPTITLE
Definition: prsht.h:40
INT_PTR CALLBACK UserGeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: userprops.c:803
#define IDC_USERS_LIST
Definition: resource.h:14
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define UNLEN
Definition: sspi.c:28
#define PropertySheet
Definition: prsht.h:382
INT_PTR CALLBACK UserMembershipPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: userprops.c:620
#define PROPSHEETPAGE
Definition: prsht.h:371

Referenced by UsersPageProc().