ReactOS 0.4.15-dev-5893-g1bb4167
usrmgr.h File Reference
#include <stdarg.h>
#include <wine/debug.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <commctrl.h>
#include <cpl.h>
#include <tchar.h>
#include <lmaccess.h>
#include <lmapibuf.h>
#include <lmerr.h>
#include "resource.h"
Include dependency graph for usrmgr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _APPLET
 

Macros

#define dbgstrx(x)   (const char*)(x)
 
#define WIN32_NO_STATUS
 

Typedefs

typedef struct _APPLET APPLET
 
typedef struct _APPLETPAPPLET
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (usrmgr)
 
INT_PTR CALLBACK UsersPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK GroupsPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK ExtraPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL GroupProperties (HWND hwndDlg)
 
BOOL CheckAccountName (HWND hwndDlg, INT nIdDlgItem, LPTSTR lpAccountName)
 
BOOL UserProperties (HWND hwndDlg)
 

Variables

HINSTANCE hApplet
 

Macro Definition Documentation

◆ dbgstrx

#define dbgstrx (   x)    (const char*)(x)

Definition at line 12 of file usrmgr.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 15 of file usrmgr.h.

Typedef Documentation

◆ APPLET

◆ PAPPLET

typedef struct _APPLET * PAPPLET

Function Documentation

◆ CheckAccountName()

BOOL CheckAccountName ( HWND  hwndDlg,
INT  nIdDlgItem,
LPTSTR  lpAccountName 
)

Definition at line 13 of file misc.c.

16{
17 TCHAR szAccountName[256];
18 UINT uLen;
19
20 if (lpAccountName)
21 uLen = _tcslen(lpAccountName);
22 else
23 uLen = GetDlgItemText(hwndDlg, nIdDlgItem, szAccountName, 256);
24
25 /* Check the account name */
26 if (uLen > 0 &&
27 _tcspbrk((lpAccountName) ? lpAccountName : szAccountName, TEXT("\"*+,/\\:;<=>?[]|")) != NULL)
28 {
29 MessageBox(hwndDlg,
30 TEXT("The account name you entered is invalid! An account name must not contain the following characters: *+,/:;<=>?[\\]|"),
31 TEXT("ERROR"),
33 return FALSE;
34 }
35
36 return TRUE;
37}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define _tcspbrk
Definition: tchar.h:1412
#define TEXT(s)
Definition: k32.h:26
unsigned int UINT
Definition: ndis.h:50
_In_ LPCSTR lpAccountName
Definition: winbase.h:2728
#define GetDlgItemText
Definition: winuser.h:5775
#define MB_ICONERROR
Definition: winuser.h:781
#define MB_OK
Definition: winuser.h:784
#define MessageBox
Definition: winuser.h:5812
char TCHAR
Definition: xmlstorage.h:189
#define _tcslen
Definition: xmlstorage.h:198

Referenced by NewGroupDlgProc(), NewUserDlgProc(), OnEndLabelEdit(), and OnGroupsPageEndLabelEdit().

◆ ExtraPageProc()

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

Definition at line 13 of file extra.c.

17{
21
22 switch (uMsg)
23 {
24 case WM_INITDIALOG:
25 break;
26
27 case WM_COMMAND:
28 break;
29 }
30
31 return FALSE;
32}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define WM_COMMAND
Definition: winuser.h:1730
#define WM_INITDIALOG
Definition: winuser.h:1729

◆ GroupProperties()

BOOL GroupProperties ( HWND  hwndDlg)

Definition at line 610 of file groupprops.c.

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 */
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}
HINSTANCE hApplet
Definition: access.c:17
#define IDD_GROUP_GENERAL
Definition: resource.h:42
#define IDC_GROUPS_LIST
Definition: resource.h:16
INT_PTR CALLBACK GroupGeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: groupprops.c:529
static VOID InitGroupPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc, LPTSTR pszGroup)
Definition: groupprops.c:597
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PropertySheet
Definition: prsht.h:400
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PROPSHEETPAGE
Definition: prsht.h:389
#define LVNI_SELECTED
Definition: commctrl.h:2424
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2684
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2434
#define UNLEN
Definition: sspi.c:28
int32_t INT
Definition: typedefs.h:58
#define ZeroMemory
Definition: winbase.h:1670
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:824

Referenced by GroupsPageProc().

◆ GroupsPageProc()

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

Definition at line 436 of file groups.c.

440{
441 PGROUP_DATA pGroupData;
442
445 UNREFERENCED_PARAMETER(hwndDlg);
446
447
448 pGroupData = (PGROUP_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
449
450 switch (uMsg)
451 {
452 case WM_INITDIALOG:
453 pGroupData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GROUP_DATA));
454 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGroupData);
455
457
458 OnGroupsPageInitDialog(hwndDlg);
461 FALSE);
462 break;
463
464 case WM_COMMAND:
465 switch (LOWORD(wParam))
466 {
467 case IDM_GROUP_NEW:
468 case IDC_GROUPS_ADD:
469 GroupNew(hwndDlg);
470 break;
471
472 case IDM_GROUP_RENAME:
473 GroupRename(hwndDlg);
474 break;
475
476 case IDM_GROUP_DELETE:
478 GroupDelete(hwndDlg);
479 break;
480
483 if (GroupProperties(hwndDlg) == IDOK)
484 UpdateGroupProperties(hwndDlg);
485 break;
486 }
487 break;
488
489 case WM_NOTIFY:
490 return OnGroupsPageNotify(hwndDlg, pGroupData, (NMHDR *)lParam);
491
492 case WM_DESTROY:
493 DestroyMenu(pGroupData->hPopupMenu);
494 HeapFree(GetProcessHeap(), 0, pGroupData);
495 break;
496 }
497
498 return FALSE;
499}
#define IDM_GROUP_DELETE
Definition: resource.h:99
#define IDM_GROUP_RENAME
Definition: resource.h:100
#define IDM_GROUP_NEW
Definition: resource.h:98
#define IDM_POPUP_GROUP
Definition: resource.h:96
#define IDC_GROUPS_PROPERTIES
Definition: resource.h:40
#define IDC_GROUPS_ADD
Definition: resource.h:38
#define IDC_GROUPS_REMOVE
Definition: resource.h:39
#define IDM_GROUP_PROPERTIES
Definition: resource.h:101
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL GroupProperties(HWND hwndDlg)
Definition: groupprops.c:610
static BOOL GroupDelete(HWND hwndDlg)
Definition: groups.c:255
struct _GROUP_DATA * PGROUP_DATA
static BOOL OnGroupsPageNotify(HWND hwndDlg, PGROUP_DATA pGroupData, NMHDR *phdr)
Definition: groups.c:391
static VOID GroupNew(HWND hwndDlg)
Definition: groups.c:190
static VOID UpdateGroupProperties(HWND hwndDlg)
Definition: groups.c:91
static VOID OnGroupsPageInitDialog(HWND hwndDlg)
Definition: groups.c:297
static VOID GroupRename(HWND hwndDlg)
Definition: groups.c:240
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61
HMENU hPopupMenu
Definition: groups.c:14
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define DWLP_USER
Definition: winuser.h:866
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define LoadMenu
Definition: winuser.h:5807
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define WM_DESTROY
Definition: winuser.h:1599
#define MAKEINTRESOURCE
Definition: winuser.h:591

Referenced by UsrmgrApplet().

◆ 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 + 1];
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 */
916 nItem, 0,
917 szUserName,
918 UNLEN + 1);
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 IDD_USER_PROFILE
Definition: resource.h:69
#define IDC_USERS_LIST
Definition: resource.h:14
#define IDD_USER_GENERAL
Definition: resource.h:22
#define IDD_USER_MEMBERSHIP
Definition: resource.h:64
static VOID InitUserPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc, LPTSTR pszUser)
Definition: userprops.c:888
INT_PTR CALLBACK UserMembershipPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: userprops.c:620
INT_PTR CALLBACK UserProfilePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: userprops.c:192
INT_PTR CALLBACK UserGeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: userprops.c:803

Referenced by UsersPageProc().

◆ UsersPageProc()

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

Definition at line 689 of file users.c.

693{
694 PUSER_DATA pUserData;
695
697
698 pUserData = (PUSER_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
699
700 switch (uMsg)
701 {
702 case WM_INITDIALOG:
703 pUserData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(USER_DATA));
704 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pUserData);
705
707
708 OnInitDialog(hwndDlg);
711 FALSE);
712 break;
713
714 case WM_COMMAND:
715 switch (LOWORD(wParam))
716 {
718 UserChangePassword(hwndDlg);
719 break;
720
721 case IDM_USER_RENAME:
722 UserRename(hwndDlg);
723 break;
724
725 case IDM_USER_NEW:
726 case IDC_USERS_ADD:
727 UserNew(hwndDlg);
728 break;
729
730 case IDM_USER_DELETE:
731 case IDC_USERS_REMOVE:
732 UserDelete(hwndDlg);
733 break;
734
737 if (UserProperties(hwndDlg))
738 {
739 UpdateUserProperties(hwndDlg);
740 }
741 break;
742 }
743 break;
744
745 case WM_NOTIFY:
746 return OnNotify(hwndDlg, pUserData, (NMHDR *)lParam);
747
748 case WM_DESTROY:
749 DestroyMenu(pUserData->hPopupMenu);
750 HeapFree(GetProcessHeap(), 0, pUserData);
751 break;
752 }
753
754 return FALSE;
755}
#define IDM_USER_DELETE
Definition: resource.h:106
#define IDC_USERS_PROPERTIES
Definition: resource.h:34
#define IDC_USERS_REMOVE
Definition: resource.h:33
#define IDM_USER_CHANGE_PASSWORD
Definition: resource.h:104
#define IDM_POPUP_USER
Definition: resource.h:103
#define IDM_USER_RENAME
Definition: resource.h:107
#define IDM_USER_PROPERTIES
Definition: resource.h:108
#define IDM_USER_NEW
Definition: resource.h:105
#define IDC_USERS_ADD
Definition: resource.h:32
HMENU hPopupMenu
Definition: users.c:21
BOOL UserProperties(HWND hwndDlg)
Definition: userprops.c:901
static BOOL UserDelete(HWND hwndDlg)
Definition: users.c:387
struct _USER_DATA * PUSER_DATA
static VOID OnInitDialog(HWND hwndDlg)
Definition: users.c:509
static VOID UserNew(HWND hwndDlg)
Definition: users.c:302
static BOOL OnNotify(HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr)
Definition: users.c:605
static VOID UserChangePassword(HWND hwndDlg)
Definition: users.c:110
static VOID UpdateUserProperties(HWND hwndDlg)
Definition: users.c:650
static VOID UserRename(HWND hwndDlg)
Definition: users.c:369

Referenced by UsrmgrApplet().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( usrmgr  )

Variable Documentation

◆ hApplet

HINSTANCE hApplet
extern

Definition at line 17 of file access.c.

Referenced by AddColumns(), AddComboBoxTime(), AddGroupToUser(), AddItem(), AddListViewItems(), AddPageProc(), AddScreenSavers(), AddToCombobox(), AddToInputListView(), AddUserProfile(), AddUsersToGroup(), AdvancedPageProc(), AdvAppearanceDlg_Init(), Ala_InitData(), AppearancePageProc(), Applet(), Applet1(), AppletInit(), ApplyConsoleInfo(), ApplyCursorScheme(), BrowseCursor(), BrowseRequiredFile(), BuildAdvPropTitle(), ButtonProc(), ChangeUserProfileType(), ClickLockProc(), ConfirmDlgProc(), CopyHardwareProfile(), CopyProfileDlgProc(), CopyUserProfile(), CPlApplet(), CustomizeLocalePropertySheet(), DeleteHardwareProfile(), DeleteUserCursorScheme(), DeleteUserProfile(), DelScheme(), DisplayAdvancedSettings(), DisplayAdvancedSettingsInitPropSheetPage(), DisplayApplet(), DisplayPageProc(), DllMain(), download_proc(), EditVariableDlgProc(), EnumerateCursorSchemes(), FillResetComboBox(), FilterKeysDlgProc(), FinishDlgProc(), FontTypeChange(), GeneralPageProc(), GeneralPropertyPageLocalesEnumProc(), GetGeneralGroupData(), GetIconFromLocation(), GetProfileName(), GetSystemInformation(), GetUserMembershipData(), GroupNew(), GroupProperties(), GroupsPageProc(), HardwarePageProc(), HardwareProfileProperties(), HardwareWizardInit(), InitApplet(), InitAudioDlg(), InitBackgroundDialog(), InitGroupMembersList(), InitGroupPropSheetPage(), InitImageList(), InitIntlPropSheetPage(), InitLogo(), InitPagefileList(), InitProbeListPage(), InitPropSheetPage(), InitSettings(), InitSystemUptime(), InitUnitsSysCB(), InitUserGroupsList(), InitUserPropSheetPage(), InitVolumeControls(), install_addon(), KeyboardApplet(), KeyboardPageProc(), KeySettingsDialogProc(), LaunchDeviceManager(), LoadConfig(), LoadInitialCursorScheme(), LoadNewCursorScheme(), LoadRecoveryOptions(), LoadSoundFiles(), LoadThemes(), LocalesEnumProc(), MainPageProc(), MmSysApplet(), MouseApplet(), MousePageProc(), OnBrowseButton(), OnCommandSettingsPage(), OnCreate(), OnCustomButton(), OnDisplayDeviceChanged(), OnEditVariable(), OnGroupsPageInitDialog(), OnInitDialog(), OnInitHardProfDialog(), OnNewVariable(), OnNotifySettingsPage(), OnProfileTypeInit(), OnSelChange(), OnSet(), OnVirtMemDialogOk(), pCDevSettings_GetMonitorName(), Pos_InitPage(), PrintErrorMsgBox(), PropSheetProc(), RefreshCursorList(), RegisterClockControl(), RenameHardwareProfile(), RenameProfileDlgProc(), ResourceMessageBox(), RosImageProc(), SafeRemovalDlgProc(), SaveCursorScheme(), SaveScheme(), SaveSettings(), ScreenSaverPageProc(), set_status(), SetEnvironmentDialogListViewColumns(), SetGroupsListColumns(), SetListViewColumns(), SetProcSpeed(), SetTimeZoneName(), SettingsOnInitDialog(), SettingsPageCallbackProc(), SettingsPageProc(), SetUsersListColumns(), ShowCreateShortcutWizard(), ShowRemoveStartMenuItems(), SoundsDlgProc(), SpeakerVolume(), SwitchDisplayMode(), SyncNTPStatusInit(), SystemApplet(), TimeZonePageProc(), UnregisterClockControl(), UpdateDisplay(), UpdateInputListView(), UpdateKeySettingsListView(), UpdatePagefileEntry(), UserChangePassword(), UserNew(), UserProperties(), UsersPageProc(), UsrmgrApplet(), VolumeDlgProc(), and WelcomeDlgProc().