#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.
32{
35}
#define GetProcAddress(x, y)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Referenced by START_TEST().
◆ NTSTATUS()
◆ START_TEST()
Definition at line 544 of file directory.c.
545{
547
550
553
556
559
561}
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 void test_RemoveDirectoryA(void)
◆ test_CreateDirectoryA()
static void test_CreateDirectoryA |
( |
void |
| ) |
|
|
static |
Definition at line 179 of file directory.c.
180{
184
189
194
196 ok(
ret <
MAX_PATH,
"System directory should fit into MAX_PATH\n");
197
200 ok(
ret ==
TRUE,
"could not chdir to the System directory\n");
201
205
206
210
217
222
226
230
231
238
245
252
253
254
255
261
269
275
276
277
278
284
291 {
295 }
296
302
303
304
305
311
318 {
322 }
323
329
330
331
332
338
345 {
349 }
350
357}
#define ERROR_INVALID_PARAMETER
#define GetCurrentDirectoryW(x, y)
#define ERROR_ACCESS_DENIED
#define ERROR_INVALID_NAME
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
#define ERROR_ALREADY_EXISTS
static char tmpdir[MAX_PATH]
DWORD WINAPI GetLastError(void)
#define ERROR_PATH_NOT_FOUND
#define ERROR_BAD_PATHNAME
Referenced by START_TEST().
◆ test_CreateDirectoryW()
static void test_CreateDirectoryW |
( |
void |
| ) |
|
|
static |
Definition at line 359 of file directory.c.
360{
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};
370
373 {
374 win_skip(
"CreateDirectoryW is not available\n");
375 return;
376 }
379
383
385 ok(
ret <
MAX_PATH,
"System directory should fit into MAX_PATH\n");
386
390
393 "should not create existing path ret %u err %u\n",
ret,
GetLastError());
394
397 "should not create existing path ret %u err %u\n",
ret,
GetLastError());
398
403 "should deny access to the drive root ret %u err %u\n",
ret,
GetLastError());
404
408 ok(
ret ==
TRUE,
"CreateDirectoryW should always succeed\n");
409
412 "should not create existing path ret %u err %u\n",
ret,
GetLastError());
413
415 ok(
ret ==
TRUE,
"RemoveDirectoryW should always succeed\n");
416
420 "CreateDirectoryW with ? wildcard name should fail with error 183, ret=%s error=%d\n",
423 ok(
ret ==
FALSE,
"RemoveDirectoryW should have failed\n");
424
428 "CreateDirectoryW with * wildcard name should fail with error 183, ret=%s error=%d\n",
431 ok(
ret ==
FALSE,
"RemoveDirectoryW should have failed\n");
432
439 "CreateDirectoryW with multiple nonexistent directories in path should fail ret %u err %u\n",
442 ok(
ret ==
FALSE,
"RemoveDirectoryW should have failed\n");
443
445}
#define ERROR_CALL_NOT_IMPLEMENTED
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
static const WCHAR slashW[]
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
static const WCHAR dotdotW[]
static const WCHAR dotW[]
Referenced by START_TEST().
◆ test_GetSystemDirectoryA()
static void test_GetSystemDirectoryA |
( |
void |
| ) |
|
|
static |
Definition at line 117 of file directory.c.
118{
121
123 ok(len_with_null <=
MAX_PATH,
"should fit into MAX_PATH\n");
124
127 ok(
lstrcmpA(
buf,
"foo") == 0,
"should not touch the buffer\n");
128 ok(
len == len_with_null,
"GetSystemDirectoryA returned %d, expected %d\n",
130
133 ok(
lstrcmpA(
buf,
"foo") == 0,
"should not touch the buffer\n");
134 ok(
len == len_with_null,
"GetSystemDirectoryA returned %d, expected %d\n",
136
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);
143}
ACPI_SIZE strlen(const char *String)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
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.
146{
149 static const WCHAR fooW[] = {
'f',
'o',
'o',0};
150
153 {
154 win_skip(
"GetSystemDirectoryW is not available\n");
155 return;
156 }
157 ok(len_with_null <=
MAX_PATH,
"should fit into MAX_PATH\n");
158
162 ok(
len == len_with_null,
"GetSystemDirectoryW returned %d, expected %d\n",
164
168 ok(
len == len_with_null,
"GetSystemDirectoryW returned %d, expected %d\n",
170
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);
177}
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
static const WCHAR fooW[]
Referenced by START_TEST().
◆ test_GetWindowsDirectoryA()
static void test_GetWindowsDirectoryA |
( |
void |
| ) |
|
|
static |
Definition at line 53 of file directory.c.
54{
57
59 ok(len_with_null <=
MAX_PATH,
"should fit into MAX_PATH\n");
60
63 ok(
lstrcmpA(
buf,
"foo") == 0,
"should not touch the buffer\n");
64
67 ok(
lstrcmpA(
buf,
"foo") == 0,
"should not touch the buffer\n");
68 ok(
len == len_with_null,
"GetWindowsDirectoryW returned %d, expected %d\n",
70
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);
77}
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.
80{
83 static const WCHAR fooW[] = {
'f',
'o',
'o',0};
84
87 {
88 win_skip(
"GetWindowsDirectoryW is not implemented\n");
89 return;
90 }
91 ok(len_with_null <=
MAX_PATH,
"should fit into MAX_PATH\n");
92
96 ok(
len == len_with_null,
"GetWindowsDirectoryW returned %d, expected %d\n",
98
102 ok(
len == len_with_null,
"GetWindowsDirectoryW returned %d, expected %d\n",
104
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);
111}
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Referenced by START_TEST().
◆ test_granted_access()
Definition at line 38 of file directory.c.
39{
42
44 sizeof(obj_info),
NULL);
48}
GLuint GLint GLboolean GLint GLenum access
◆ test_RemoveDirectoryA()
static void test_RemoveDirectoryA |
( |
void |
| ) |
|
|
static |
Definition at line 447 of file directory.c.
448{
452
456 ok(
ret ==
TRUE,
"CreateDirectoryA should always succeed\n");
457
460
464 "Expected ERROR_SHARING_VIOLATION, got %u\n",
GetLastError());
465
468
471 ok(
ret ==
TRUE,
"RemoveDirectoryA should always succeed\n");
472
477 "RemoveDirectoryA with ? wildcard name should fail, ret=%s error=%d\n",
479
484 "RemoveDirectoryA with * wildcard name should fail, ret=%s error=%d\n",
486}
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
#define TEST_GRANTED_ACCESS(a, b)
PRTL_USER_PROCESS_PARAMETERS ProcessParameters
#define ERROR_SHARING_VIOLATION
Referenced by START_TEST().
◆ test_RemoveDirectoryW()
static void test_RemoveDirectoryW |
( |
void |
| ) |
|
|
static |
Definition at line 488 of file directory.c.
489{
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};
495
500 {
501 win_skip(
"CreateDirectoryW is not available\n");
502 return;
503 }
504
505 ok(
ret ==
TRUE,
"CreateDirectoryW should always succeed\n");
506
509
513 "Expected ERROR_SHARING_VIOLATION, got %u\n",
GetLastError());
514
517
520 ok(
ret ==
TRUE,
"RemoveDirectoryW should always succeed\n");
521
525 "RemoveDirectoryW with wildcard should fail with error 183, ret=%s error=%d\n",
527
531 "RemoveDirectoryW with * wildcard name should fail with error 183, ret=%s error=%d\n",
533}
Referenced by START_TEST().
◆ test_SetCurrentDirectoryA()
static void test_SetCurrentDirectoryA |
( |
void |
| ) |
|
|
static |
◆ OBJECT_INFORMATION_CLASS
◆ PULONG
◆ PVOID
◆ ULONG