35static const WCHAR sNonexistentUser[] = {
'N',
'o',
'n',
'e',
'x',
'i',
's',
't',
'e',
'n',
't',
' ',
37static WCHAR sTooLongName[] = {
'T',
'h',
'i',
's',
' ',
'i',
's',
' ',
'a',
' ',
'b',
'a',
'd',
38 ' ',
'u',
's',
'e',
'r',
'n',
'a',
'm',
'e',0};
39static WCHAR sTooLongPassword[] = {
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
40 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
41 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
42 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
43 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
44 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
45 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
46 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
47 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
48 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
49 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
53static WCHAR sTestUserOldPass[] = {
'O',
'l',
'd',
'P',
'a',
's',
's',
'W',
'0',
'r',
'd',
'S',
'e',
't',
'!',
'~', 0};
54static const WCHAR sBadNetPath[] = {
'\\',
'\\',
'B',
'a',
' ',
' ',
'p',
'a',
't',
'h',0};
81 win_skip(
"GetUserNameW is not available.\n");
84 ok(rc,
"User Name Retrieved\n");
121 skip(
"Skipping usergetinfo_tests, create_test_user failed: 0x%08x\n", rc);
127 ok(rc ==
NERR_Success,
"NetUserGetInfo level 0 failed: 0x%08x.\n", rc);
129 pNetApiBufferSize(ui0, &
dwSize);
132 "Is allocated with NetApiBufferAllocate\n");
136 ok(rc ==
NERR_Success,
"NetUserGetInfo level 10 failed: 0x%08x.\n", rc);
138 pNetApiBufferSize(ui10, &
dwSize);
144 "Is allocated with NetApiBufferAllocate\n");
146 pNetApiBufferFree(ui0);
147 pNetApiBufferFree(ui10);
151 ok(rc ==
NERR_Success,
"NetUsetGetInfo for current user failed: 0x%08x.\n", rc);
152 pNetApiBufferFree(ui0);
167 "Bad Network Path: rc=%d\n",rc);
171 "Bad Network Path: rc=%d\n",rc);
178 trace(
"Deleting the test user failed. You might have to manually delete it.\n");
192 Result = pNetQueryDisplayInformation(
197 "Information Retrieved\n");
199 for(; EntryCount > 0; EntryCount--)
203 ok(!hasAdmin,
"One admin user\n");
210 ok(!hasGuest,
"One guest record\n");
220 pNetApiBufferFree(
Buffer);
223 ok(hasAdmin,
"Doesn't have 'Administrator' account\n");
231 rc = pNetUserModalsGet(
NULL, 2, (
LPBYTE *)&umi2);
235 pNetApiBufferFree(umi2);
258 trace(
"We are on NT4, we have to delete the user with the too long username\n");
264 skip(
"not enough permissions to add a user\n");
270 "Adding user with too long username returned 0x%08x\n",
ret);
277 "Adding user with too long password returned 0x%08x\n",
ret);
287 "Adding user with too long username/password returned 0x%08x\n",
ret);
298 skip(
"Insufficient permissions to add users. Skipping test.\n");
303 skip(
"User already exists, skipping test to not mess up the system\n");
309 "Adding user failed with error 0x%08x\n",
ret);
331 static const WCHAR admins[] = {
'A',
'd',
'm',
'i',
'n',
'i',
's',
't',
'r',
'a',
't',
'o',
'r',
's',0};
334 DWORD entries_read = 0, total_entries =0;
339 "NetLocalGroupGetInfo unexpectedly returned %d\n",
status);
345 pNetApiBufferFree(lgi);
349 ok(entries_read > 0 && total_entries > 0,
"Amount of entries is unexpectedly 0\n");
351 for(
i=0;
i<entries_read;
i++)
354 pNetApiBufferFree(
buffer);
364 {
'\\',
'\\',
'.',
'\\',
'c',
':',0};
366 {
'\\',
'\\',
'.',
'\\',
'c',
':',
'\\',0};
368 {
'\\',
'\\',
'.',
'\\',
'c',
':',
'\\',
'n',
'o',
's',
'u',
'c',
'h',
'p',
'a',
't',
'h',0};
370 {
'\\',
'\\',
'n',
'o',
's',
'u',
'c',
'h',
's',
'e',
'r',
'v',
'e',
'r',
'\\',
'c',
':',
'\\',0};
372 {
'\\',
'.',
'\\',
'c',
':',0};
374 {
'\\',
'\\',
'.',
'\\',
'c',
':',
'\\',
'\\',0};
376 {
'\\',
'\\',
'.',
'@',
'S',
'S',
'L',
'\\',
'c',
':',0};
378 {
'\\',
'\\',
'.',
'@',
's',
's',
'l',
'\\',
'c',
':',0};
380 {
'\\',
'\\',
'.',
'@',
't',
'l',
's',
'\\',
'c',
':',0};
382 {
'\\',
'\\',
'.',
'@',
'S',
'S',
'L',
'@',
'4',
'4',
'3',
'\\',
'c',
':',0};
384 {
'\\',
'\\',
'.',
'@',
'S',
'S',
'L',
'@',
'8',
'0',
'\\',
'c',
':',0};
386 {
'\\',
'\\',
'.',
'@',
'8',
'0',
'\\',
'c',
':',0};
388 {
'\\',
'\\',
'.',
'@',
'8',
'0',
'8',
'0',
'\\',
'c',
':',0};
390 {
'\\',
'\\',
'\\',
'c',
':',0};
394 {
'/',
'/',
'.',
'/',
'c',
':',0};
396 {
'\\',
'\\',
'.',
'\\',
'c',
':',
'/',0};
398 {
'\\',
'\\',
'.',
'\\',
'c',
':',
'\\',
'\\',
'\\',0};
399 static const WCHAR path21[] =
400 {
'\\',
'\\',
'.',
'\\',
'\\',
'c',
':',0};
401 static const WCHAR path22[] =
402 {
'\\',
'\\',
'.',
'\\',
'c',
':',
'd',
'i',
'r',0};
403 static const WCHAR path23[] =
405 static const WCHAR path24[] =
406 {
'\\',
'\\',
'.',
'\\',
'd',
'i',
'r',0};
407 static const WCHAR path25[] =
408 {
'\\',
'\\',
'.',
'\\',
'\\',0};
409 static const WCHAR path26[] =
410 {
'\\',
'\\',
'.',
'\\',
'c',
':',
'd',
'i',
'r',
'/',0};
411 static const WCHAR path27[] =
412 {
'\\',
'\\',
'.',
'/',
'c',
':',0};
413 static const WCHAR path28[] =
414 {
'\\',
'\\',
'.',
'@',
'8',
'0',
'@',
'S',
'S',
'L',
'\\',
'c',
':',0};
416 {
'h',
't',
't',
'p',
':',
'/',
'/',
'.',
'/',
'c',
':',0};
417 static const WCHAR result2[] =
418 {
'h',
't',
't',
'p',
':',
'/',
'/',
'.',
'/',
'c',
':',
'/',
'n',
'o',
's',
'u',
'c',
'h',
'p',
'a',
't',
'h',0};
419 static const WCHAR result3[] =
420 {
'h',
't',
't',
'p',
':',
'/',
'/',
'n',
'o',
's',
'u',
'c',
'h',
's',
'e',
'r',
'v',
'e',
'r',
'/',
'c',
':',0};
421 static const WCHAR result4[] =
422 {
'h',
't',
't',
'p',
':',
'/',
'/',
'.',
'/',
'c',
':',
'/',0};
423 static const WCHAR result5[] =
424 {
'h',
't',
't',
'p',
's',
':',
'/',
'/',
'.',
'/',
'c',
':',0};
425 static const WCHAR result6[] =
426 {
'h',
't',
't',
'p',
's',
':',
'/',
'/',
'.',
':',
'8',
'0',
'/',
'c',
':',0};
427 static const WCHAR result7[] =
428 {
'h',
't',
't',
'p',
':',
'/',
'/',
'.',
':',
'8',
'0',
'8',
'0',
'/',
'c',
':',0};
429 static const WCHAR result8[] =
430 {
'h',
't',
't',
'p',
':',
'/',
'/',
'/',
'c',
':',0};
431 static const WCHAR result9[] =
432 {
'h',
't',
't',
'p',
':',
'/',
'/',
'.',
'/',
'c',
':',
'/',
'/',0};
433 static const WCHAR result10[] =
434 {
'h',
't',
't',
'p',
':',
'/',
'/',
'.',
'/',
'/',
'c',
':',0};
435 static const WCHAR result11[] =
436 {
'h',
't',
't',
'p',
':',
'/',
'/',
'.',
'/',
'c',
':',
'd',
'i',
'r',0};
437 static const WCHAR result12[] =
438 {
'h',
't',
't',
'p',
':',
'/',
'/',
'.',0};
439 static const WCHAR result13[] =
440 {
'h',
't',
't',
'p',
':',
'/',
'/',
'.',
'/',
'd',
'i',
'r',0};
441 static const WCHAR result14[] =
442 {
'h',
't',
't',
'p',
':',
'/',
'/',
'.',
'/',0};
448 const WCHAR *ret_path;
486 if (!pDavGetHTTPFromUNCPath)
488 win_skip(
"DavGetHTTPFromUNCPath is missing\n" );
559 {
'h',
't',
't',
'p',
':',
'/',
'/',
's',
'e',
'r',
'v',
'e',
'r',
'/',
'p',
'a',
't',
'h',0};
561 {
'h',
't',
't',
'p',
's',
':',
'/',
'/',
'h',
'o',
's',
't',
'/',
'p',
'a',
't',
'h',0};
563 {
'\\',
'\\',
's',
'e',
'r',
'v',
'e',
'r',0};
565 {
'\\',
'\\',
's',
'e',
'r',
'v',
'e',
'r',
'\\',
'p',
'a',
't',
'h',0};
567 {
'\\',
'\\',
'h',
't',
't',
'p',
':',
'/',
'/',
's',
'e',
'r',
'v',
'e',
'r',
'/',
'p',
'a',
't',
'h',0};
569 {
'h',
't',
't',
'p',
':',
'/',
'/',0};
571 {
'h',
't',
't',
'p',
':',0};
575 {
'h',
't',
't',
'p',
':',
's',
'e',
'r',
'v',
'e',
'r',0};
577 {
'h',
't',
't',
'p',
':',
'/',
'/',
's',
'e',
'r',
'v',
'e',
'r',
':',
'8',
'0',0};
579 {
'h',
't',
't',
'p',
':',
'/',
'/',
's',
'e',
'r',
'v',
'e',
'r',
':',
'8',
'1',0};
581 {
'h',
't',
't',
'p',
's',
':',
'/',
'/',
's',
'e',
'r',
'v',
'e',
'r',
':',
'8',
'0',0};
583 {
'H',
'T',
'T',
'P',
':',
'/',
'/',
's',
'e',
'r',
'v',
'e',
'r',
'/',
'p',
'a',
't',
'h',0};
585 {
'h',
't',
't',
'p',
':',
'/',
'/',
's',
'e',
'r',
'v',
'e',
'r',
':',
'6',
'5',
'5',
'3',
'7',0};
587 {
'h',
't',
't',
'p',
':',
'/',
'/',
's',
'e',
'r',
'v',
'e',
'r',
'/',
'p',
'a',
't',
'h',
'/',0};
589 {
'h',
't',
't',
'p',
':',
'/',
'/',
's',
'e',
'r',
'v',
'e',
'r',
'/',
'p',
'a',
't',
'h',
'/',
'/',0};
591 {
'h',
't',
't',
'p',
':',
'/',
'/',
's',
'e',
'r',
'v',
'e',
'r',
':',
'/',
'p',
'a',
't',
'h',0};
593 {
'h',
't',
't',
'p',
':',
'/',
'/',
's',
'e',
'r',
'v',
'e',
'r',0};
595 {
'h',
't',
't',
'p',
's',
':',
'/',
'/',
's',
'e',
'r',
'v',
'e',
'r',
':',
'4',
'4',
'3',0};
596 static const WCHAR path21[] =
597 {
'h',
't',
't',
'p',
's',
':',
'/',
'/',
's',
'e',
'r',
'v',
'e',
'r',
':',
'8',
'0',0};
599 {
'\\',
'\\',
's',
'e',
'r',
'v',
'e',
'r',
'\\',
'D',
'a',
'v',
'W',
'W',
'W',
'R',
'o',
'o',
't',
'\\',
'p',
'a',
't',
'h',0};
600 static const WCHAR result2[] =
601 {
'\\',
'\\',
'h',
'o',
's',
't',
'@',
'S',
'S',
'L',
'\\',
'D',
'a',
'v',
'W',
'W',
'W',
'R',
'o',
'o',
't',
'\\',
603 static const WCHAR result3[] =
604 {
'\\',
'\\',
's',
'e',
'r',
'v',
'e',
'r',
'\\',
'D',
'a',
'v',
'W',
'W',
'W',
'R',
'o',
'o',
't',0};
605 static const WCHAR result4[] =
606 {
'\\',
'\\',
's',
'e',
'r',
'v',
'e',
'r',
'@',
'8',
'1',
'\\',
'D',
'a',
'v',
'W',
'W',
'W',
'R',
'o',
'o',
't',0};
607 static const WCHAR result5[] =
608 {
'\\',
'\\',
's',
'e',
'r',
'v',
'e',
'r',
'@',
'S',
'S',
'L',
'@',
'8',
'0',
'\\',
'D',
'a',
'v',
'W',
'W',
'W',
'R',
'o',
'o',
't',0};
609 static const WCHAR result6[] =
610 {
'\\',
'\\',
's',
'e',
'r',
'v',
'e',
'r',
'@',
'6',
'5',
'5',
'3',
'7',
'\\',
'D',
'a',
'v',
'W',
'W',
'W',
'R',
'o',
'o',
't',0};
611 static const WCHAR result7[] =
612 {
'\\',
'\\',
's',
'e',
'r',
'v',
'e',
'r',
'@',
'\\',
'D',
'a',
'v',
'W',
'W',
'W',
'R',
'o',
'o',
't',
'\\',
'p',
'a',
't',
'h',0};
613 static const WCHAR result8[] =
614 {
'\\',
'\\',
's',
'e',
'r',
'v',
'e',
'r',
'@',
'S',
'S',
'L',
'\\',
'D',
'a',
'v',
'W',
'W',
'W',
'R',
'o',
'o',
't',0};
615 static const WCHAR result9[] =
616 {
'\\',
'\\',
's',
'e',
'r',
'v',
'e',
'r',
'@',
'S',
'S',
'L',
'@',
'8',
'0',
'\\',
'D',
'a',
'v',
'W',
'W',
'W',
'R',
'o',
'o',
't',0};
622 const WCHAR *ret_path;
652 if (!pDavGetUNCFromHTTPPath)
654 win_skip(
"DavGetUNCFromHTTPPath is missing\n" );
708 pNetApiBufferFree=(
void*)
GetProcAddress(hnetapi32,
"NetApiBufferFree");
709 pNetApiBufferSize=(
void*)
GetProcAddress(hnetapi32,
"NetApiBufferSize");
710 pNetQueryDisplayInformation=(
void*)
GetProcAddress(hnetapi32,
"NetQueryDisplayInformation");
711 pNetUserGetInfo=(
void*)
GetProcAddress(hnetapi32,
"NetUserGetInfo");
712 pNetUserModalsGet=(
void*)
GetProcAddress(hnetapi32,
"NetUserModalsGet");
715 pNetLocalGroupGetInfo=(
void*)
GetProcAddress(hnetapi32,
"NetLocalGroupGetInfo");
716 pNetLocalGroupGetMembers=(
void*)
GetProcAddress(hnetapi32,
"NetLocalGroupGetMembers");
717 pDavGetHTTPFromUNCPath = (
void*)
GetProcAddress(hnetapi32,
"DavGetHTTPFromUNCPath");
718 pDavGetUNCFromHTTPPath = (
void*)
GetProcAddress(hnetapi32,
"DavGetUNCFromHTTPPath");
723 if (!pNetApiBufferFree) {
724 win_skip(
"Needed functions are not available\n");
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
#define ERROR_INVALID_HANDLE
#define ERROR_ACCESS_DENIED
#define ERROR_INVALID_NAME
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLint GLboolean GLint GLenum access
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define UF_NORMAL_ACCOUNT
#define MAX_PREFERRED_LENGTH
#define NERR_WkstaNotStarted
#define NERR_UserNotFound
#define NERR_PasswordTooShort
#define NERR_GroupNotFound
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static struct test_info tests[]
static void run_usergetinfo_tests(void)
static const WCHAR sEmptyStr[]
static WCHAR sTestUserName[]
static WCHAR sTestUserOldPass[]
static void test_DavGetHTTPFromUNCPath(void)
static LPBYTE *static LPBYTE PDWORD_PTR
static const WCHAR sInvalidName[]
static void run_usermodalsget_tests(void)
static const WCHAR sNonexistentUser[]
static NET_API_STATUS delete_test_user(void)
static void run_localgroupgetinfo_tests(void)
static BOOL init_access_tests(void)
static PVOID *static LPCWSTR
static PVOID *static LPBYTE *static LPBYTE *static LPBYTE
static const WCHAR sInvalidName2[]
static void run_userhandling_tests(void)
static void test_DavGetUNCFromHTTPPath(void)
static WCHAR computer_name[MAX_COMPUTERNAME_LENGTH+1]
static void run_querydisplayinformation1_tests(void)
static WCHAR sTooLongPassword[]
static WCHAR user_name[UNLEN+1]
static WCHAR sTooLongName[]
static NET_API_STATUS create_test_user(void)
static const WCHAR sBadNetPath[]
static const WCHAR path3[]
static const WCHAR path4[]
static const WCHAR path19[]
static const WCHAR path7[]
static const WCHAR path18[]
static const WCHAR path11[]
static const WCHAR path5[]
static const WCHAR path14[]
static const WCHAR path10[]
static const WCHAR path12[]
static const WCHAR path20[]
static const WCHAR path16[]
static const WCHAR path13[]
static const WCHAR path8[]
static const WCHAR path17[]
static const WCHAR path6[]
static const WCHAR path9[]
static const WCHAR path2[]
static const WCHAR path15[]
LPWSTR usri10_usr_comment
DWORD WINAPI GetLastError(void)
#define MAX_COMPUTERNAME_LENGTH
#define ERROR_BAD_NETPATH
#define ERROR_INVALID_LEVEL
#define ERROR_NETWORK_UNREACHABLE
#define RPC_S_SERVER_UNAVAILABLE
#define RPC_S_INVALID_NET_ADDR
#define ERROR_BAD_NET_NAME
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
#define DOMAIN_USER_RID_ADMIN
#define DOMAIN_USER_RID_GUEST