ReactOS  0.4.15-dev-313-g8fde48b
misc.c File Reference
#include "usrmgr.h"
Include dependency graph for misc.c:

Go to the source code of this file.

Functions

VOID DebugPrintf (LPTSTR szFormat,...)
 
BOOL CheckAccountName (HWND hwndDlg, INT nIdDlgItem, LPTSTR lpAccountName)
 

Function Documentation

◆ CheckAccountName()

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

Definition at line 27 of file misc.c.

30 {
31  TCHAR szAccountName[256];
32  UINT uLen;
33 
34  if (lpAccountName)
35  uLen = _tcslen(lpAccountName);
36  else
37  uLen = GetDlgItemText(hwndDlg, nIdDlgItem, szAccountName, 256);
38 
39  /* Check the account name */
40  if (uLen > 0 &&
41  _tcspbrk((lpAccountName) ? lpAccountName : szAccountName, TEXT("\"*+,/\\:;<=>?[]|")) != NULL)
42  {
43  MessageBox(hwndDlg,
44  TEXT("The account name you entered is invalid! An account name must not contain the following characters: *+,/:;<=>?[\\]|"),
45  TEXT("ERROR"),
47  return FALSE;
48  }
49 
50  return TRUE;
51 }
#define TRUE
Definition: types.h:120
_In_ LPCSTR lpAccountName
Definition: winbase.h:2704
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
smooth NULL
Definition: ftsmooth.c:416
char TCHAR
Definition: xmlstorage.h:189
#define GetDlgItemText
Definition: winuser.h:5760
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5797
#define TEXT(s)
Definition: k32.h:26
unsigned int UINT
Definition: ndis.h:50
#define MB_OK
Definition: winuser.h:784
#define _tcspbrk
Definition: tchar.h:1412

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

◆ DebugPrintf()

VOID DebugPrintf ( LPTSTR  szFormat,
  ... 
)

Definition at line 13 of file misc.c.

14 {
15  TCHAR szOut[512];
16  va_list arg_ptr;
17 
18 
19  va_start (arg_ptr, szFormat);
20  _vstprintf (szOut, szFormat, arg_ptr);
21  va_end (arg_ptr);
22 
23  MessageBox(NULL, szOut, _T("Debug"), MB_OK);
24 }
#define _vstprintf
Definition: tchar.h:540
#define va_end(ap)
Definition: acmsvcex.h:90
smooth NULL
Definition: ftsmooth.c:416
char * va_list
Definition: acmsvcex.h:78
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define MessageBox
Definition: winuser.h:5797
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define MB_OK
Definition: winuser.h:784

Referenced by AddSelectedGroupsToUser(), AddSelectedUsersToGroup(), SetGeneralGroupData(), SetUserGeneralData(), and SetUserProfileData().