ReactOS 0.4.15-dev-8145-ga541a46
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)
 
LPTSTR GetDlgItemTextAlloc (HWND hwndDlg, INT nDlgItem)
 
LPTSTR GetComboBoxLBTextAlloc (HWND hwndDlg, INT nDlgItem, INT nIndex)
 
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:2741
#define GetDlgItemText
Definition: winuser.h:5785
#define MB_ICONERROR
Definition: winuser.h:787
#define MB_OK
Definition: winuser.h:790
#define MessageBox
Definition: winuser.h:5822
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:1740
#define WM_INITDIALOG
Definition: winuser.h:1739

◆ GetComboBoxLBTextAlloc()

LPTSTR GetComboBoxLBTextAlloc ( HWND  hwndDlg,
INT  nDlgItem,
INT  nIndex 
)

Definition at line 28 of file usrmgr.c.

29{
30 INT nLength = (INT)SendDlgItemMessage(hwndDlg, nDlgItem, CB_GETLBTEXTLEN, nIndex, 0);
31 LPTSTR psz = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR));
32 if (psz)
33 SendDlgItemMessage(hwndDlg, nDlgItem, CB_GETLBTEXT, nIndex, (LPARAM)psz);
34 return psz;
35}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define INT
Definition: polytest.cpp:20
int32_t INT
Definition: typedefs.h:58
_In_ DWORD nLength
Definition: wincon.h:473
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_GETLBTEXTLEN
Definition: winuser.h:1953
#define CB_GETLBTEXT
Definition: winuser.h:1952
#define SendDlgItemMessage
Definition: winuser.h:5842
CHAR * LPTSTR
Definition: xmlstorage.h:192

Referenced by SetUserProfileData().

◆ GetDlgItemTextAlloc()

LPTSTR GetDlgItemTextAlloc ( HWND  hwndDlg,
INT  nDlgItem 
)

Definition at line 19 of file usrmgr.c.

20{
21 INT nLength = GetWindowTextLength(GetDlgItem(hwndDlg, nDlgItem));
22 LPTSTR psz = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR));
23 if (psz)
24 GetDlgItemText(hwndDlg, nDlgItem, psz, nLength + 1);
25 return psz;
26}
#define GetWindowTextLength
Definition: winuser.h:5799
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)

Referenced by ChangePasswordDlgProc(), NewGroupDlgProc(), NewUserDlgProc(), SetGeneralGroupData(), SetUserGeneralData(), and SetUserProfileData().

◆ GroupProperties()

BOOL GroupProperties ( HWND  hwndDlg)

Definition at line 597 of file groupprops.c.

598{
599 PROPSHEETPAGE psp[1];
600 PROPSHEETHEADER psh;
601 TCHAR szGroupName[UNLEN + 1];
602 INT nItem;
603 HWND hwndLV;
604
605 hwndLV = GetDlgItem(hwndDlg, IDC_GROUPS_LIST);
606 nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
607 if (nItem == -1)
608 return FALSE;
609
610 /* Get the new user name */
612 nItem, 0,
613 szGroupName,
614 UNLEN + 1);
615
616 ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
617 psh.dwSize = sizeof(PROPSHEETHEADER);
618 psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
619 psh.hwndParent = hwndDlg;
620 psh.hInstance = hApplet;
621 psh.hIcon = NULL;
622 psh.pszCaption = szGroupName;
623 psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
624 psh.nStartPage = 0;
625 psh.ppsp = psp;
626
628
629 return (PropertySheet(&psh) == IDOK);
630}
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:516
static VOID InitGroupPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc, LPTSTR pszGroup)
Definition: groupprops.c:584
#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
#define ZeroMemory
Definition: winbase.h:1712
#define IDOK
Definition: winuser.h:830

Referenced by GroupsPageProc().

◆ GroupsPageProc()

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

Definition at line 425 of file groups.c.

429{
430 PGROUP_DATA pGroupData;
431
434 UNREFERENCED_PARAMETER(hwndDlg);
435
436
437 pGroupData = (PGROUP_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
438
439 switch (uMsg)
440 {
441 case WM_INITDIALOG:
442 pGroupData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GROUP_DATA));
443 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGroupData);
444
446
447 OnGroupsPageInitDialog(hwndDlg);
450 FALSE);
451 break;
452
453 case WM_COMMAND:
454 switch (LOWORD(wParam))
455 {
456 case IDM_GROUP_NEW:
457 case IDC_GROUPS_ADD:
458 GroupNew(hwndDlg);
459 break;
460
461 case IDM_GROUP_RENAME:
462 GroupRename(hwndDlg);
463 break;
464
465 case IDM_GROUP_DELETE:
467 GroupDelete(hwndDlg);
468 break;
469
472 if (GroupProperties(hwndDlg) == IDOK)
473 UpdateGroupProperties(hwndDlg);
474 break;
475 }
476 break;
477
478 case WM_NOTIFY:
479 return OnGroupsPageNotify(hwndDlg, pGroupData, (NMHDR *)lParam);
480
481 case WM_DESTROY:
482 DestroyMenu(pGroupData->hPopupMenu);
483 HeapFree(GetProcessHeap(), 0, pGroupData);
484 break;
485 }
486
487 return FALSE;
488}
#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 HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL GroupProperties(HWND hwndDlg)
Definition: groupprops.c:597
static BOOL GroupDelete(HWND hwndDlg)
Definition: groups.c:244
struct _GROUP_DATA * PGROUP_DATA
static BOOL OnGroupsPageNotify(HWND hwndDlg, PGROUP_DATA pGroupData, NMHDR *phdr)
Definition: groups.c:380
static VOID GroupNew(HWND hwndDlg)
Definition: groups.c:182
static VOID UpdateGroupProperties(HWND hwndDlg)
Definition: groups.c:91
static VOID OnGroupsPageInitDialog(HWND hwndDlg)
Definition: groups.c:286
static VOID GroupRename(HWND hwndDlg)
Definition: groups.c:229
__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:872
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define LoadMenu
Definition: winuser.h:5817
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define WM_DESTROY
Definition: winuser.h:1609
#define MAKEINTRESOURCE
Definition: winuser.h:591

Referenced by UsrmgrApplet().

◆ UserProperties()

BOOL UserProperties ( HWND  hwndDlg)

Definition at line 828 of file userprops.c.

829{
830 PROPSHEETPAGE psp[3];
831 PROPSHEETHEADER psh;
832 TCHAR szUserName[UNLEN + 1];
833 INT nItem;
834 HWND hwndLV;
835
836 hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST);
837 nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
838 if (nItem == -1)
839 return FALSE;
840
841 /* Get the new user name */
843 nItem, 0,
844 szUserName,
845 UNLEN + 1);
846
847 ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
848 psh.dwSize = sizeof(PROPSHEETHEADER);
849 psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
850 psh.hwndParent = hwndDlg;
851 psh.hInstance = hApplet;
852 psh.hIcon = NULL;
853 psh.pszCaption = szUserName;
854 psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
855 psh.nStartPage = 0;
856 psh.ppsp = psp;
857
861
862 return (PropertySheet(&psh) == IDOK);
863}
#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:815
INT_PTR CALLBACK UserMembershipPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: userprops.c:571
INT_PTR CALLBACK UserProfilePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: userprops.c:143
INT_PTR CALLBACK UserGeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: userprops.c:730

Referenced by UsersPageProc().

◆ UsersPageProc()

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

Definition at line 655 of file users.c.

659{
660 PUSER_DATA pUserData;
661
663
664 pUserData = (PUSER_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
665
666 switch (uMsg)
667 {
668 case WM_INITDIALOG:
669 pUserData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(USER_DATA));
670 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pUserData);
671
673
674 OnInitDialog(hwndDlg);
677 FALSE);
678 break;
679
680 case WM_COMMAND:
681 switch (LOWORD(wParam))
682 {
684 UserChangePassword(hwndDlg);
685 break;
686
687 case IDM_USER_RENAME:
688 UserRename(hwndDlg);
689 break;
690
691 case IDM_USER_NEW:
692 case IDC_USERS_ADD:
693 UserNew(hwndDlg);
694 break;
695
696 case IDM_USER_DELETE:
697 case IDC_USERS_REMOVE:
698 UserDelete(hwndDlg);
699 break;
700
703 if (UserProperties(hwndDlg))
704 {
705 UpdateUserProperties(hwndDlg);
706 }
707 break;
708 }
709 break;
710
711 case WM_NOTIFY:
712 return OnNotify(hwndDlg, pUserData, (NMHDR *)lParam);
713
714 case WM_DESTROY:
715 DestroyMenu(pUserData->hPopupMenu);
716 HeapFree(GetProcessHeap(), 0, pUserData);
717 break;
718 }
719
720 return FALSE;
721}
#define 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:828
static BOOL UserDelete(HWND hwndDlg)
Definition: users.c:353
struct _USER_DATA * PUSER_DATA
static VOID OnInitDialog(HWND hwndDlg)
Definition: users.c:475
static VOID UserNew(HWND hwndDlg)
Definition: users.c:275
static BOOL OnNotify(HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr)
Definition: users.c:571
static VOID UserChangePassword(HWND hwndDlg)
Definition: users.c:104
static VOID UpdateUserProperties(HWND hwndDlg)
Definition: users.c:616
static VOID UserRename(HWND hwndDlg)
Definition: users.c:335

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(), AddToCombobox(), AddToInputListView(), AddUserProfile(), AddUsersToGroup(), AdvancedPageProc(), AdvAppearanceDlg_Init(), Ala_InitData(), AppearancePageProc(), Applet(), Applet1(), AppletInit(), ApplyConsoleInfo(), ApplyCursorScheme(), AskForReboot(), 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(), EnumScreenSavers(), FillResetComboBox(), FilterKeysDlgProc(), FinishDlgProc(), FontTypeChange(), GeneralPageProc(), GeneralPropertyPageLocalesEnumProc(), GetDeviceDisplayInfo(), 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(), InstallScreenSaverW(), 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(), OnProfileTypeInit(), OnSelChange(), OnSet(), OnVirtMemDialogOk(), pCDevSettings_GetMonitorName(), Pos_InitPage(), PrintErrorMsgBox(), PropSheetProc(), RefreshCursorList(), RegisterClockControl(), RenameHardwareProfile(), RenameProfileDlgProc(), ResourceMessageBox(), RosImageProc(), SafeRemovalDlgProc(), SafeRemoveDevice(), 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().