37#define TEST_GRANTED_ACCESS(a,b) test_granted_access(a,b,__LINE__)
44 sizeof(obj_info),
NULL);
59 ok(len_with_null <=
MAX_PATH,
"should fit into MAX_PATH\n");
63 ok(
lstrcmpA(
buf,
"foo") == 0,
"should not touch the buffer\n");
67 ok(
lstrcmpA(
buf,
"foo") == 0,
"should not touch the buffer\n");
68 ok(
len == len_with_null,
"GetWindowsDirectoryW returned %d, expected %d\n",
74 ok(
len ==
strlen(
buf),
"returned length should be equal to the length of string\n");
75 ok(
len == len_with_null-1,
"GetWindowsDirectoryA returned %d, expected %d\n",
76 len, len_with_null-1);
83 static const WCHAR fooW[] = {
'f',
'o',
'o',0};
88 win_skip(
"GetWindowsDirectoryW is not implemented\n");
91 ok(len_with_null <=
MAX_PATH,
"should fit into MAX_PATH\n");
96 ok(
len == len_with_null,
"GetWindowsDirectoryW returned %d, expected %d\n",
102 ok(
len == len_with_null,
"GetWindowsDirectoryW returned %d, expected %d\n",
108 ok(
len ==
lstrlenW(
buf),
"returned length should be equal to the length of string\n");
109 ok(
len == len_with_null-1,
"GetWindowsDirectoryW returned %d, expected %d\n",
110 len, len_with_null-1);
123 ok(len_with_null <=
MAX_PATH,
"should fit into MAX_PATH\n");
127 ok(
lstrcmpA(
buf,
"foo") == 0,
"should not touch the buffer\n");
128 ok(
len == len_with_null,
"GetSystemDirectoryA returned %d, expected %d\n",
133 ok(
lstrcmpA(
buf,
"foo") == 0,
"should not touch the buffer\n");
134 ok(
len == len_with_null,
"GetSystemDirectoryA returned %d, expected %d\n",
140 ok(
len ==
strlen(
buf),
"returned length should be equal to the length of string\n");
141 ok(
len == len_with_null-1,
"GetSystemDirectoryW returned %d, expected %d\n",
142 len, len_with_null-1);
149 static const WCHAR fooW[] = {
'f',
'o',
'o',0};
154 win_skip(
"GetSystemDirectoryW is not available\n");
157 ok(len_with_null <=
MAX_PATH,
"should fit into MAX_PATH\n");
162 ok(
len == len_with_null,
"GetSystemDirectoryW returned %d, expected %d\n",
168 ok(
len == len_with_null,
"GetSystemDirectoryW returned %d, expected %d\n",
174 ok(
len ==
lstrlenW(
buf),
"returned length should be equal to the length of string\n");
175 ok(
len == len_with_null-1,
"GetSystemDirectoryW returned %d, expected %d\n",
176 len, len_with_null-1);
196 ok(
ret <
MAX_PATH,
"System directory should fit into MAX_PATH\n");
200 ok(
ret ==
TRUE,
"could not chdir to the System directory\n");
363 static const WCHAR empty_strW[] = { 0 };
364 static const WCHAR tmp_dir_name[] = {
'P',
'l',
'e',
'a',
's',
'e',
' ',
'R',
'e',
'm',
'o',
'v',
'e',
' ',
'M',
'e',0};
368 static const WCHAR questionW[] = {
'?',0};
374 win_skip(
"CreateDirectoryW is not available\n");
385 ok(
ret <
MAX_PATH,
"System directory should fit into MAX_PATH\n");
393 "should not create existing path ret %u err %u\n",
ret,
GetLastError());
397 "should not create existing path ret %u err %u\n",
ret,
GetLastError());
403 "should deny access to the drive root ret %u err %u\n",
ret,
GetLastError());
408 ok(
ret ==
TRUE,
"CreateDirectoryW should always succeed\n");
412 "should not create existing path ret %u err %u\n",
ret,
GetLastError());
415 ok(
ret ==
TRUE,
"RemoveDirectoryW should always succeed\n");
420 "CreateDirectoryW with ? wildcard name should fail with error 183, ret=%s error=%d\n",
423 ok(
ret ==
FALSE,
"RemoveDirectoryW should have failed\n");
428 "CreateDirectoryW with * wildcard name should fail with error 183, ret=%s error=%d\n",
431 ok(
ret ==
FALSE,
"RemoveDirectoryW should have failed\n");
439 "CreateDirectoryW with multiple nonexistent directories in path should fail ret %u err %u\n",
442 ok(
ret ==
FALSE,
"RemoveDirectoryW should have failed\n");
456 ok(
ret ==
TRUE,
"CreateDirectoryA should always succeed\n");
464 "Expected ERROR_SHARING_VIOLATION, got %u\n",
GetLastError());
471 ok(
ret ==
TRUE,
"RemoveDirectoryA should always succeed\n");
477 "RemoveDirectoryA with ? wildcard name should fail, ret=%s error=%d\n",
484 "RemoveDirectoryA with * wildcard name should fail, ret=%s error=%d\n",
493 static const WCHAR tmp_dir_name[] = {
'P',
'l',
'e',
'a',
's',
'e',
' ',
'R',
'e',
'm',
'o',
'v',
'e',
' ',
'M',
'e',0};
494 static const WCHAR questionW[] = {
'?',0};
501 win_skip(
"CreateDirectoryW is not available\n");
505 ok(
ret ==
TRUE,
"CreateDirectoryW should always succeed\n");
513 "Expected ERROR_SHARING_VIOLATION, got %u\n",
GetLastError());
520 ok(
ret ==
TRUE,
"RemoveDirectoryW should always succeed\n");
525 "RemoveDirectoryW with wildcard should fail with error 183, ret=%s error=%d\n",
531 "RemoveDirectoryW with * wildcard name should fail with error 183, ret=%s error=%d\n",
ACPI_SIZE strlen(const char *String)
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define GetCurrentDirectoryW(x, y)
#define GetProcAddress(x, y)
#define ERROR_ACCESS_DENIED
#define ERROR_INVALID_NAME
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
static const WCHAR slashW[]
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLint GLboolean GLint GLenum access
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
#define ERROR_ALREADY_EXISTS
#define ERROR_FILE_NOT_FOUND
#define TEST_GRANTED_ACCESS(a, b)
static void test_SetCurrentDirectoryA(void)
static void test_CreateDirectoryW(void)
static void test_GetSystemDirectoryW(void)
static void test_GetSystemDirectoryA(void)
static void test_GetWindowsDirectoryW(void)
static void test_GetWindowsDirectoryA(void)
static void test_RemoveDirectoryW(void)
static void test_CreateDirectoryA(void)
static OBJECT_INFORMATION_CLASS
static void test_RemoveDirectoryA(void)
static void test_granted_access(HANDLE handle, ACCESS_MASK access, int line)
static const WCHAR fooW[]
static const WCHAR dotdotW[]
static const WCHAR dotW[]
static char tmpdir[MAX_PATH]
PRTL_USER_PROCESS_PARAMETERS ProcessParameters
DWORD WINAPI GetLastError(void)
#define ERROR_SHARING_VIOLATION
#define ERROR_PATH_NOT_FOUND
#define ERROR_BAD_PATHNAME