ReactOS 0.4.15-dev-6057-gd708c79
FindFiles.c File Reference
#include "precomp.h"
#include <versionhelpers.h>
Include dependency graph for FindFiles.c:

Go to the source code of this file.

Macros

#define ok_err(error)    ok_int(GetLastError(), error)
 
#define testType1_A(lpFileName, dwInitialError, hExpectedHandleValue, dwExpectedError, bExpectedNullFilename)
 
#define testType1_W(lpFileName, dwInitialError, hExpectedHandleValue, dwExpectedError, bExpectedNullFilename)
 
#define testType2_A(lpFileName, dwInitialError, hUnexpectedHandleValue, dwExpectedError)
 
#define testType2_W(lpFileName, dwInitialError, hUnexpectedHandleValue, dwExpectedError)
 

Functions

static void Test_FindFirstFileA (void)
 
static void Test_FindFirstFileW (void)
 
static int init (void)
 
 START_TEST (FindFiles)
 

Variables

static CHAR OSDirA [MAX_PATH]
 
static WCHAR OSDirW [MAX_PATH]
 
static CHAR baseA [MAX_PATH]
 
static WCHAR baseW [MAX_PATH]
 
static CHAR selfnameA [MAX_PATH]
 
static WCHAR selfnameW [MAX_PATH]
 
static LPSTR exenameA
 
static LPWSTR exenameW
 
static INT myARGC
 
static LPSTRmyARGV
 

Macro Definition Documentation

◆ ok_err

#define ok_err (   error)     ok_int(GetLastError(), error)

Definition at line 40 of file FindFiles.c.

◆ testType1_A

#define testType1_A (   lpFileName,
  dwInitialError,
  hExpectedHandleValue,
  dwExpectedError,
  bExpectedNullFilename 
)
Value:
do { \
ZeroMemory(&fd, sizeof(fd)); \
SetLastError((dwInitialError)); \
ok(h == (hExpectedHandleValue), "FindFirstFileA returned 0x%p, expected 0x%p\n", h, (hExpectedHandleValue)); \
ok_err(dwExpectedError); \
if (bExpectedNullFilename) \
ok(fd.cFileName[0] == 0, "fd.cFileName != \"\"\n"); \
else \
ok(fd.cFileName[0] != 0, "fd.cFileName == \"\"\n"); \
FindClose(h); \
} while (0)
HANDLE WINAPI FindFirstFileA(IN LPCSTR lpFileName, OUT LPWIN32_FIND_DATAA lpFindFileData)
Definition: find.c:263
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
static int fd
Definition: io.c:51
_In_ LPCSTR lpFileName
Definition: winbase.h:3058

Definition at line 48 of file FindFiles.c.

◆ testType1_W

#define testType1_W (   lpFileName,
  dwInitialError,
  hExpectedHandleValue,
  dwExpectedError,
  bExpectedNullFilename 
)
Value:
do { \
ZeroMemory(&fd, sizeof(fd)); \
SetLastError((dwInitialError)); \
ok(h == (hExpectedHandleValue), "FindFirstFileW returned 0x%p, expected 0x%p\n", h, (hExpectedHandleValue)); \
ok_err(dwExpectedError); \
if (bExpectedNullFilename) \
ok(fd.cFileName[0] == 0, "fd.cFileName != \"\"\n"); \
else \
ok(fd.cFileName[0] != 0, "fd.cFileName == \"\"\n"); \
FindClose(h); \
} while (0)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320

Definition at line 62 of file FindFiles.c.

◆ testType2_A

#define testType2_A (   lpFileName,
  dwInitialError,
  hUnexpectedHandleValue,
  dwExpectedError 
)
Value:
do { \
ZeroMemory(&fd, sizeof(fd)); \
SetLastError((dwInitialError)); \
ok(h != (hUnexpectedHandleValue), "FindFirstFileA returned 0x%p\n", h); \
ok_err(dwExpectedError); \
ok(fd.cFileName[0] != 0, "fd.cFileName == \"\"\n"); \
FindClose(h); \
} while (0)

Definition at line 76 of file FindFiles.c.

◆ testType2_W

#define testType2_W (   lpFileName,
  dwInitialError,
  hUnexpectedHandleValue,
  dwExpectedError 
)
Value:
do { \
ZeroMemory(&fd, sizeof(fd)); \
SetLastError((dwInitialError)); \
ok(h != (hUnexpectedHandleValue), "FindFirstFileW returned 0x%p\n", h); \
ok_err(dwExpectedError); \
ok(fd.cFileName[0] != 0, "fd.cFileName == \"\"\n"); \
FindClose(h); \
} while (0)

Definition at line 87 of file FindFiles.c.

Function Documentation

◆ init()

static int init ( void  )
static

Definition at line 482 of file FindFiles.c.

483{
484 LPSTR p;
485 size_t i;
486
488 if (!GetCurrentDirectoryA(sizeof(baseA)/sizeof(baseA[0]), baseA)) return 0;
490
491 /* Strip the path of selfname */
492 if ((p = strrchr(selfnameA, '\\')) != NULL)
493 exenameA = p + 1;
494 else
496
497 if ((p = strrchr(exenameA, '/')) != NULL)
498 exenameA = p + 1;
499
500 if (!GetWindowsDirectoryA(OSDirA, sizeof(OSDirA)/sizeof(OSDirA[0]))) return 0;
501
502 /* Quick-and-dirty conversion ANSI --> UNICODE without the Win32 APIs */
503 for (i = 0 ; i <= strlen(baseA) ; ++i)
504 {
505 baseW[i] = (WCHAR)baseA[i];
506 }
507 for (i = 0 ; i <= strlen(selfnameA) ; ++i)
508 {
510 }
512 for (i = 0 ; i <= strlen(OSDirA) ; ++i)
513 {
514 OSDirW[i] = (WCHAR)OSDirA[i];
515 }
516
517 return 1;
518}
static LPSTR exenameA
Definition: FindFiles.c:27
static CHAR baseA[MAX_PATH]
Definition: FindFiles.c:23
static WCHAR OSDirW[MAX_PATH]
Definition: FindFiles.c:22
static INT myARGC
Definition: FindFiles.c:29
static CHAR OSDirA[MAX_PATH]
Definition: FindFiles.c:21
static WCHAR selfnameW[MAX_PATH]
Definition: FindFiles.c:26
static WCHAR baseW[MAX_PATH]
Definition: FindFiles.c:24
static LPWSTR exenameW
Definition: FindFiles.c:28
static LPSTR * myARGV
Definition: FindFiles.c:30
static CHAR selfnameA[MAX_PATH]
Definition: FindFiles.c:25
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define NULL
Definition: types.h:112
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2146
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2337
GLfloat GLfloat p
Definition: glext.h:8902
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
Definition: glfuncs.h:248
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
int winetest_get_mainargs(char ***pargv)
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( FindFiles  )

Definition at line 520 of file FindFiles.c.

521{
522 int b = init();
523 ok(b, "Basic init of FindFiles test\n");
524 if (!b) return;
525
528}
static void Test_FindFirstFileA(void)
Definition: FindFiles.c:99
static void Test_FindFirstFileW(void)
Definition: FindFiles.c:290
static int init(void)
Definition: FindFiles.c:482
#define ok(value,...)
Definition: atltest.h:57
GLboolean GLboolean GLboolean b
Definition: glext.h:6204

◆ Test_FindFirstFileA()

static void Test_FindFirstFileA ( void  )
static

Definition at line 99 of file FindFiles.c.

100{
104 HANDLE h;
105
106 /* Save the current directory */
108
109/*** Tests for the root directory - root directory ***/
110 /* Modify the current directory */
111 SetCurrentDirectoryA("C:\\");
112
114
117 testType2_A("C:\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
118
121 testType2_A("\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
122
123 /* Restore the old current directory */
125/*****************************************************/
126
127/*** Tests for the root directory - long directory ***/
128 /* Modify the current directory */
129 SetCurrentDirectoryA(OSDirA); /* We expect here that OSDir is of the form: C:\OSDir */
130
131 testType2_A("C:", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
132
135 testType2_A("C:\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
136
139 testType2_A("\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
140
141 /* Restore the old current directory */
143/*****************************************************/
144
145/*** Relative paths ***/
146 /*
147 * NOTE: This test does not give the same results if you launch the app
148 * from a root drive or from a long-form directory (of the form C:\dir).
149 */
150 // testType2_A("..", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
151 // testType1_A("..", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_FILE_NOT_FOUND, TRUE);
152/**********************/
153
154/*** Relative paths - root directory ***/
155 /* Modify the current directory */
156 SetCurrentDirectoryA("C:\\");
157
161 testType2_A(".\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
162
166 testType2_A("..\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
167
168 /* Restore the old current directory */
170/***************************************/
171
172/*** Relative paths - long directory ***/
173 /* Modify the current directory */
174 SetCurrentDirectoryA(OSDirA); /* We expect here that OSDir is of the form: C:\OSDir */
175
176 testType2_A(".", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
177
180 testType2_A(".\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
181
183
186 testType2_A("..\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
187
188 /* Restore the old current directory */
190/****************************************/
191
192/*** Unexisting path ***/
193 testType1_A("C:\\foobar", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_FILE_NOT_FOUND, TRUE);
194 testType1_A("C:\\foobar\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
195 testType1_A("C:\\foobar\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
196 testType1_A("C:\\foobar\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
197 testType1_A("C:\\foobar\\system32\\..\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
198
199 /* Possibly a DOS device */
200 testType1_A("C:\\foobar\\nul", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
201 testType1_A("C:\\foobar\\nul\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
202 testType1_A("C:\\foobar\\nul\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
203 testType1_A("C:\\foobar\\nul\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
204
205 testType1_A("C:\\foobar\\toto", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
206 testType1_A("C:\\foobar\\toto\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
207 testType1_A("C:\\foobar\\toto\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
208 testType1_A("C:\\foobar\\toto\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
209
210 strcpy(Buffer, "C:\\foobar\\");
213
214 strcpy(Buffer, "C:\\foobar\\.\\");
217/***********************/
218
219/*** Existing path ***/
221 testType2_A(Buffer, 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
222
224 strcat(Buffer, "\\");
226
228 strcat(Buffer, "\\\\");
230
232 strcat(Buffer, "\\*");
233 testType2_A(Buffer, 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
234
236 strcat(Buffer, "\\.\\*");
237 testType2_A(Buffer, 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
238
240 strcat(Buffer, "\\system32\\..\\*");
241 testType2_A(Buffer, 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
242
243 /* Possibly a DOS device */
245 strcat(Buffer, "\\nul");
246 testType1_A(Buffer, 0xdeadbeef, (HANDLE)0x00000001, 0xdeadbeef, FALSE);
247
249 strcat(Buffer, "\\nul\\");
251
253 strcat(Buffer, "\\nul\\\\");
255
257 strcat(Buffer, "\\nul\\*");
259
261 strcat(Buffer, "\\toto");
263
265 strcat(Buffer, "\\toto\\");
267
269 strcat(Buffer, "\\toto\\\\");
271
273 strcat(Buffer, "\\toto\\*");
275
276 // strcpy(Buffer, baseA);
277 // strcat(Buffer, "\\");
278 // strcat(Buffer, exenameA);
279 // testType2_A(Buffer, 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
280
281 // strcpy(Buffer, baseA);
282 // strcat(Buffer, "\\.\\");
283 // strcat(Buffer, exenameA);
284 // testType2_A(Buffer, 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
285/*********************/
286
287 return;
288}
#define testType1_A(lpFileName, dwInitialError, hExpectedHandleValue, dwExpectedError, bExpectedNullFilename)
Definition: FindFiles.c:48
#define testType2_A(lpFileName, dwInitialError, hUnexpectedHandleValue, dwExpectedError)
Definition: FindFiles.c:76
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
WCHAR CurrentDirectory[1024]
Definition: chkdsk.c:74
Definition: bufpool.h:45
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define ERROR_INVALID_NAME
Definition: compat.h:103
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
Definition: path.c:2206
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
char CHAR
Definition: xmlstorage.h:175

Referenced by START_TEST().

◆ Test_FindFirstFileW()

static void Test_FindFirstFileW ( void  )
static

Definition at line 290 of file FindFiles.c.

291{
295 HANDLE h;
296
297 /* Save the current directory */
299
300/*** Tests for the root directory - root directory ***/
301 /* Modify the current directory */
302 SetCurrentDirectoryW(L"C:\\");
303
305
308 testType2_W(L"C:\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
309
312 testType2_W(L"\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
313
314 /* Restore the old current directory */
316/*****************************************************/
317
318/*** Tests for the root directory - long directory ***/
319 /* Modify the current directory */
320 SetCurrentDirectoryW(OSDirW); /* We expect here that OSDir is of the form: C:\OSDir */
321
322 testType2_W(L"C:", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
323
326 testType2_W(L"C:\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
327
330 testType2_W(L"\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
331
332 /* Restore the old current directory */
334/*****************************************************/
335
336/*** Relative paths ***/
337 /*
338 * NOTE: This test does not give the same results if you launch the app
339 * from a root drive or from a long-form directory (of the form C:\dir).
340 */
341 // testType2_W(L"..", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
342 // testType1_W(L"..", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_FILE_NOT_FOUND, TRUE);
343/**********************/
344
345/*** Relative paths - root directory ***/
346 /* Modify the current directory */
347 SetCurrentDirectoryW(L"C:\\");
348
352 testType2_W(L".\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
353
357 testType2_W(L"..\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
358
359 /* Restore the old current directory */
361/***************************************/
362
363/*** Relative paths - long directory ***/
364 /* Modify the current directory */
365 SetCurrentDirectoryW(OSDirW); /* We expect here that OSDir is of the form: C:\OSDir */
366
367 testType2_W(L".", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
368
371 testType2_W(L".\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
372
374
377 testType2_W(L"..\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
378
379 /* Restore the old current directory */
381/****************************************/
382
383/*** Unexisting path ***/
384 testType1_W(L"C:\\foobar", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_FILE_NOT_FOUND, TRUE);
385 testType1_W(L"C:\\foobar\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
386 testType1_W(L"C:\\foobar\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
387 testType1_W(L"C:\\foobar\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
388 testType1_W(L"C:\\foobar\\system32\\..\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
389
390 /* Possibly a DOS device */
391 testType1_W(L"C:\\foobar\\nul", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
392 testType1_W(L"C:\\foobar\\nul\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
393 testType1_W(L"C:\\foobar\\nul\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
394 testType1_W(L"C:\\foobar\\nul\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
395
396 testType1_W(L"C:\\foobar\\toto", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
397 testType1_W(L"C:\\foobar\\toto\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
398 testType1_W(L"C:\\foobar\\toto\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
399 testType1_W(L"C:\\foobar\\toto\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_PATH_NOT_FOUND, TRUE);
400
401 wcscpy(Buffer, L"C:\\foobar\\");
404
405 wcscpy(Buffer, L"C:\\foobar\\.\\");
408/***********************/
409
410/*** Existing path ***/
412 testType2_W(Buffer, 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
413
415 wcscat(Buffer, L"\\");
417
419 wcscat(Buffer, L"\\\\");
421
423 wcscat(Buffer, L"\\*");
424 testType2_W(Buffer, 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
425
427 wcscat(Buffer, L"\\.\\*");
428 testType2_W(Buffer, 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
429
431 wcscat(Buffer, L"\\system32\\..\\*");
432 testType2_W(Buffer, 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
433
434 /* Possibly a DOS device */
436 wcscat(Buffer, L"\\nul");
437 testType1_W(Buffer, 0xdeadbeef, (HANDLE)0x00000001, 0xdeadbeef, FALSE);
438
440 wcscat(Buffer, L"\\nul\\");
442
444 wcscat(Buffer, L"\\nul\\\\");
446
448 wcscat(Buffer, L"\\nul\\*");
450
452 wcscat(Buffer, L"\\toto");
454
456 wcscat(Buffer, L"\\toto\\");
458
460 wcscat(Buffer, L"\\toto\\\\");
462
464 wcscat(Buffer, L"\\toto\\*");
466
467 // wcscpy(Buffer, baseW);
468 // wcscat(Buffer, L"\\");
469 // wcscat(Buffer, exenameW);
470 // testType2_W(Buffer, 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
471
472 // wcscpy(Buffer, baseW);
473 // wcscat(Buffer, L"\\.\\");
474 // wcscat(Buffer, exenameW);
475 // testType2_W(Buffer, 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
476/*********************/
477
478 return;
479}
#define testType1_W(lpFileName, dwInitialError, hExpectedHandleValue, dwExpectedError, bExpectedNullFilename)
Definition: FindFiles.c:62
#define testType2_W(lpFileName, dwInitialError, hUnexpectedHandleValue, dwExpectedError)
Definition: FindFiles.c:87
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:756
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2249
#define L(x)
Definition: ntvdm.h:50
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)

Referenced by START_TEST().

Variable Documentation

◆ baseA

CHAR baseA[MAX_PATH]
static

Definition at line 23 of file FindFiles.c.

Referenced by gl_color_shade_vertices(), and init().

◆ baseW

◆ exenameA

LPSTR exenameA
static

Definition at line 27 of file FindFiles.c.

Referenced by init(), and Test_FindFirstFileA().

◆ exenameW

LPWSTR exenameW
static

Definition at line 28 of file FindFiles.c.

Referenced by init(), Test_FindFirstFileW(), and test_mode_generic().

◆ myARGC

INT myARGC
static

Definition at line 29 of file FindFiles.c.

Referenced by init(), and START_TEST().

◆ myARGV

LPSTR* myARGV
static

Definition at line 30 of file FindFiles.c.

Referenced by init(), and START_TEST().

◆ OSDirA

CHAR OSDirA[MAX_PATH]
static

Definition at line 21 of file FindFiles.c.

Referenced by init(), and Test_FindFirstFileA().

◆ OSDirW

WCHAR OSDirW[MAX_PATH]
static

Definition at line 22 of file FindFiles.c.

Referenced by init(), and Test_FindFirstFileW().

◆ selfnameA

CHAR selfnameA[MAX_PATH]
static

Definition at line 25 of file FindFiles.c.

Referenced by init().

◆ selfnameW

WCHAR selfnameW[MAX_PATH]
static

Definition at line 26 of file FindFiles.c.

Referenced by init().