ReactOS  0.4.15-dev-1367-g07cc0b5
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 
12 VOID
13 DebugPrintf(LPTSTR szFormat, ...)
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 }
25 
26 BOOL
28  INT nIdDlgItem,
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
#define _vstprintf
Definition: tchar.h:540
_In_ LPCSTR lpAccountName
Definition: winbase.h:2704
int32_t INT
Definition: typedefs.h:58
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define va_end(ap)
Definition: acmsvcex.h:90
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
VOID DebugPrintf(LPTSTR szFormat,...)
Definition: misc.c:13
char * va_list
Definition: acmsvcex.h:78
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define GetDlgItemText
Definition: winuser.h:5760
va_start(ap, x)
#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 NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784
BOOL CheckAccountName(HWND hwndDlg, INT nIdDlgItem, LPTSTR lpAccountName)
Definition: misc.c:27
#define _tcspbrk
Definition: tchar.h:1412