ReactOS 0.4.16-dev-106-g10b08aa
misc.c File Reference
#include "usrmgr.h"
Include dependency graph for misc.c:

Go to the source code of this file.

Functions

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

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:5797
#define MB_ICONERROR
Definition: winuser.h:790
#define MB_OK
Definition: winuser.h:793
#define MessageBox
Definition: winuser.h:5834
char TCHAR
Definition: xmlstorage.h:189
#define _tcslen
Definition: xmlstorage.h:198

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