#include <stdarg.h>
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winternl.h"
Go to the source code of this file.
◆ TEST_GRANTED_ACCESS
◆ init()
Definition at line 31 of file directory.c.
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
#define GetProcAddress(x, y)
Referenced by START_TEST().
◆ NTSTATUS()
◆ START_TEST()
Definition at line 544 of file directory.c.
static void test_RemoveDirectoryA(void)
static void test_GetWindowsDirectoryW(void)
static void test_CreateDirectoryW(void)
static void test_GetSystemDirectoryA(void)
static void test_RemoveDirectoryW(void)
static void test_SetCurrentDirectoryA(void)
static void test_GetWindowsDirectoryA(void)
static void test_GetSystemDirectoryW(void)
static void test_CreateDirectoryA(void)
◆ test_CreateDirectoryA()
static void test_CreateDirectoryA |
( |
void |
| ) |
|
|
static |
Definition at line 179 of file directory.c.
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");
#define ERROR_INVALID_PARAMETER
#define GetCurrentDirectoryW(x, y)
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
DWORD WINAPI GetLastError(VOID)
#define ERROR_ACCESS_DENIED
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
static char tmpdir[MAX_PATH]
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
int WINAPI lstrlenA(LPCSTR lpString)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
#define ERROR_INVALID_NAME
#define ERROR_PATH_NOT_FOUND
#define ERROR_ALREADY_EXISTS
#define ERROR_BAD_PATHNAME
Referenced by START_TEST().
◆ test_CreateDirectoryW()
static void test_CreateDirectoryW |
( |
void |
| ) |
|
|
static |
Definition at line 359 of file directory.c.
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");
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
#define GetCurrentDirectoryW(x, y)
DWORD WINAPI GetLastError(VOID)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
#define ERROR_ACCESS_DENIED
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
static char tmpdir[MAX_PATH]
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
#define ERROR_CALL_NOT_IMPLEMENTED
static const WCHAR dotdotW[]
#define ERROR_INVALID_NAME
#define ERROR_PATH_NOT_FOUND
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
#define ERROR_ALREADY_EXISTS
static const WCHAR dotW[]
static const WCHAR slashW[]
Referenced by START_TEST().
◆ test_GetSystemDirectoryA()
static void test_GetSystemDirectoryA |
( |
void |
| ) |
|
|
static |
Definition at line 117 of file directory.c.
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);
ACPI_SIZE strlen(const char *String)
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
GLenum GLuint GLenum GLsizei const GLchar * buf
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Referenced by START_TEST().
◆ test_GetSystemDirectoryW()
static void test_GetSystemDirectoryW |
( |
void |
| ) |
|
|
static |
Definition at line 145 of file directory.c.
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);
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
DWORD WINAPI GetLastError(VOID)
GLenum GLuint GLenum GLsizei const GLchar * buf
static const WCHAR fooW[]
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
#define ERROR_CALL_NOT_IMPLEMENTED
Referenced by START_TEST().
◆ test_GetWindowsDirectoryA()
static void test_GetWindowsDirectoryA |
( |
void |
| ) |
|
|
static |
Definition at line 53 of file directory.c.
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);
ACPI_SIZE strlen(const char *String)
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
GLenum GLuint GLenum GLsizei const GLchar * buf
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Referenced by START_TEST().
◆ test_GetWindowsDirectoryW()
static void test_GetWindowsDirectoryW |
( |
void |
| ) |
|
|
static |
Definition at line 79 of file directory.c.
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);
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
DWORD WINAPI GetLastError(VOID)
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
GLenum GLuint GLenum GLsizei const GLchar * buf
static const WCHAR fooW[]
#define ERROR_CALL_NOT_IMPLEMENTED
Referenced by START_TEST().
◆ test_granted_access()
Definition at line 38 of file directory.c.
44 sizeof(obj_info),
NULL);
GLuint GLint GLboolean GLint GLenum access
static SERVICE_STATUS status
◆ test_RemoveDirectoryA()
static void test_RemoveDirectoryA |
( |
void |
| ) |
|
|
static |
Definition at line 447 of file directory.c.
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",
DWORD WINAPI GetLastError(VOID)
PRTL_USER_PROCESS_PARAMETERS ProcessParameters
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
static char tmpdir[MAX_PATH]
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
#define ERROR_SHARING_VIOLATION
#define TEST_GRANTED_ACCESS(a, b)
int WINAPI lstrlenA(LPCSTR lpString)
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
#define ERROR_INVALID_NAME
#define ERROR_PATH_NOT_FOUND
Referenced by START_TEST().
◆ test_RemoveDirectoryW()
static void test_RemoveDirectoryW |
( |
void |
| ) |
|
|
static |
Definition at line 488 of file directory.c.
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",
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
#define GetCurrentDirectoryW(x, y)
DWORD WINAPI GetLastError(VOID)
PRTL_USER_PROCESS_PARAMETERS ProcessParameters
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
static char tmpdir[MAX_PATH]
#define ERROR_SHARING_VIOLATION
#define TEST_GRANTED_ACCESS(a, b)
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_NAME
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Referenced by START_TEST().
◆ test_SetCurrentDirectoryA()
static void test_SetCurrentDirectoryA |
( |
void |
| ) |
|
|
static |
Definition at line 535 of file directory.c.
DWORD WINAPI GetLastError(VOID)
#define ERROR_FILE_NOT_FOUND
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
#define ERROR_PATH_NOT_FOUND
Referenced by START_TEST().
◆ OBJECT_INFORMATION_CLASS
◆ PULONG
◆ PVOID
◆ ULONG