ReactOS 0.4.16-dev-112-g52265ae
misc.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS User Manager Control Panel
4 * FILE: dll/cpl/usrmgr/misc.c
5 * PURPOSE: Miscellaneous functions
6 *
7 * PROGRAMMERS: Eric Kohl
8 */
9
10#include "usrmgr.h"
11
12BOOL
14 INT nIdDlgItem,
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
BOOL CheckAccountName(HWND hwndDlg, INT nIdDlgItem, LPTSTR lpAccountName)
Definition: misc.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
#define _tcspbrk
Definition: tchar.h:1412
#define TEXT(s)
Definition: k32.h:26
unsigned int UINT
Definition: ndis.h:50
int32_t INT
Definition: typedefs.h:58
_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
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define _tcslen
Definition: xmlstorage.h:198