34#define WIN32_NO_STATUS
65 { 0,
FILE_ATTRIBUTE_NORMAL, {
'l',
'o',
'n',
'g',
'f',
'i',
'l',
'e',
'n',
'a',
'm',
'e',
'.',
't',
'm',
'p'},
"normal" },
180 UINT data_pos, data_size;
189 pRtlInitUnicodeString( &dummy_mask,
dummyW );
198 skip(
"can't test if we can't open the directory\n");
202 U(
io).Status = 0xdeadbeef;
207 data_len =
io.Information;
222 U(
io).Status = 0xdeadbeef;
228 data_len =
io.Information;
242 "Wrong number %d of %s files found (single_entry=%d,mask=%s)\n",
247 ok(
testfiles[
i].nfound == 1,
"Wrong number %d of %s files found (single_entry=%d,restart=%d)\n",
266 if (!pRtlDosPathNameToNtPathName_U( testdir, &ntdirname,
NULL,
NULL ))
268 ok(0,
"RtlDosPathNametoNtPathName_U failed\n");
276 U(
io).Status = 0xdeadbeef;
281 data_len =
io.Information;
286 while (data_pos < data_len)
303 pRtlInitUnicodeString( &prev_str, prev );
304 pRtlInitUnicodeString( &name_str,
name );
305 res = pRtlCompareUnicodeString( &prev_str, &name_str,
TRUE );
312 if (
info->NextEntryOffset == 0)
314 U(
io).Status = 0xdeadbeef;
320 data_len =
io.Information;
323 else data_pos +=
info->NextEntryOffset;
327 pRtlFreeUnicodeString( &ntdirname );
340 U(
io).Status = 0xdeadbeef;
341 U(
io).Information = 0xdeadbeef;
349 ok(
data[0] == 0x55555555,
"%u: wrong offset %x\n",
class,
data[0] );
371 "%u: wrong status %x\n",
class,
status );
375 for (data_size = 1; data_size <
sizeof(
data); data_size++)
383 ok(
data[0] == 0,
"%u: wrong offset %x\n",
class,
data[0] );
389 ok(
data[0] == 0x55555555,
"%u: wrong offset %x\n",
class,
data[0] );
399 "%u: wrong size %u\n",
class, data_size );
404 "%u: wrong size %u\n",
class, data_size );
409 "%u: wrong size %u\n",
class, data_size );
414 "%u: wrong size %u\n",
class, data_size );
419 "%u: wrong size %u\n",
class, data_size );
424 "%u: wrong size %u\n",
class, data_size );
429 "%u: wrong size %u\n",
class, data_size );
467 strcat(testdirA,
"NtQueryDirectoryFile.tmp");
468 pRtlMultiByteToUnicodeN(testdirW,
sizeof(testdirW),
NULL, testdirA,
strlen(testdirA)+1);
472 if (!pRtlDosPathNameToNtPathName_U(testdirW, &ntdirname,
NULL,
NULL))
474 ok(0,
"RtlDosPathNametoNtPathName_U failed\n");
500 skip(
"can't test if we can't open the directory\n");
520 U(
io).Status = 0xdeadbeef;
535 U(
io).Status = 0xdeadbeef;
536 U(
io).Information = 0xdeadbeef;
555 U(
io).Status = 0xdeadbeef;
556 U(
io).Information = 0xdeadbeef;
569 ok(
filename[1] == 0x5555,
"incorrect long file name: %s\n",
576 U(
io).Status = 0xdeadbeef;
585 "incorrect long file name: %s\n",
595 data_size =
sizeof(
data);
596 U(
io).Status = 0xdeadbeef;
597 U(
io).Information = 0xdeadbeef;
606 ok( fbdi->
FileName[0] ==
'.',
"incorrect long file name: %s\n",
610 "wrong offset %x\n",
next->NextEntryOffset );
611 ok(
next->FileNameLength == 2 *
sizeof(
WCHAR),
"wrong length %x\n",
next->FileNameLength );
618 U(
io).Status = 0xdeadbeef;
619 U(
io).Information = 0xdeadbeef;
628 ok( fbdi->
FileName[0] ==
'.',
"incorrect long file name: %s\n",
631 ok(
next->NextEntryOffset == 0x55555555,
"wrong offset %x\n",
next->NextEntryOffset );
635 U(
io).Status = 0xdeadbeef;
636 U(
io).Information = 0xdeadbeef;
648 U(
io).Status = 0xdeadbeef;
649 U(
io).Information = 0xdeadbeef;
658 ok( fbdi->
FileName[0] ==
'.',
"incorrect long file name: %s\n",
661 ok(
next->NextEntryOffset == 0,
"wrong offset %x\n",
next->NextEntryOffset );
662 ok(
next->FileNameLength == 2 *
sizeof(
WCHAR),
"wrong length %x\n",
next->FileNameLength );
670 U(
io).Status = 0xdeadbeef;
671 U(
io).Information = 0xdeadbeef;
679 "wrong offset %x\n",
names->NextEntryOffset );
680 ok(
names->FileNameLength ==
sizeof(
WCHAR),
"wrong length %x\n",
names->FileNameLength );
681 ok(
names->FileName[0] ==
'.',
"incorrect long file name: %s\n",
684 ok(
names->NextEntryOffset == 0,
"wrong offset %x\n",
names->NextEntryOffset );
685 ok(
names->FileNameLength == 2 *
sizeof(
WCHAR),
"wrong length %x\n",
names->FileNameLength );
698 U(
io).Status = 0xdeadbeef;
699 data_size =
sizeof(
data);
705 U(
io).Status = 0xdeadbeef;
711 U(
io).Status = 0xdeadbeef;
719 U(
io).Status = 0xdeadbeef;
728 pRtlFreeUnicodeString(&ntdirname);
761 static const char testfile[] =
"TesT";
762 static const WCHAR testfile_w[] = {
'T',
'e',
's',
'T'};
763 static int testfile_len =
sizeof(testfile) - 1;
764 static WCHAR testmask[] = {
't',
'e',
's',
't'};
772 UINT data_size, data_len;
781 strcat(testdir,
"case.tmp");
785 pRtlMultiByteToUnicodeN(testdir_w,
sizeof(testdir_w),
NULL, testdir,
strlen(testdir) + 1);
786 if (!pRtlDosPathNameToNtPathName_U(testdir_w, &ntdirname,
NULL,
NULL))
788 ok(0,
"RtlDosPathNametoNtPathName_U failed\n");
800 skip(
"can't test if we can't open the directory\n");
804 mask.Buffer = testmask;
805 mask.Length =
mask.MaximumLength =
sizeof(testmask);
809 data_len =
io.Information;
815 ok(name_len == testfile_len,
"unexpected filename length %u\n", name_len);
816 ok(!
memcmp(
name, testfile_w, testfile_len *
sizeof(
WCHAR)),
"unexpected filename %s\n",
823 pRtlFreeUnicodeString(&ntdirname);
831 if (!pRtlWow64EnableFsRedirection || !pRtlWow64EnableFsRedirectionEx)
833 skip(
"Wow64 redirection not supported\n" );
836 status = pRtlWow64EnableFsRedirectionEx(
FALSE, &old );
839 skip(
"Wow64 redirection not supported\n" );
842 ok( !
status,
"RtlWow64EnableFsRedirectionEx failed status %x\n",
status );
845 ok( !
status,
"RtlWow64EnableFsRedirectionEx failed status %x\n",
status );
846 ok( !
cur,
"RtlWow64EnableFsRedirectionEx got %u\n",
cur );
849 ok( !
status,
"RtlWow64EnableFsRedirectionEx failed status %x\n",
status );
851 ok( !
status,
"RtlWow64EnableFsRedirectionEx failed status %x\n",
status );
852 ok(
cur == 1,
"RtlWow64EnableFsRedirectionEx got %u\n",
cur );
854 status = pRtlWow64EnableFsRedirection(
TRUE );
855 ok( !
status,
"RtlWow64EnableFsRedirectionEx failed status %x\n",
status );
857 ok( !
status,
"RtlWow64EnableFsRedirectionEx failed status %x\n",
status );
858 ok( !
cur,
"RtlWow64EnableFsRedirectionEx got %u\n",
cur );
862 status = pRtlWow64EnableFsRedirectionEx(
TRUE, (
void*)1 );
864 status = pRtlWow64EnableFsRedirectionEx(
TRUE, (
void*)0xDEADBEEF );
868 ok( !
status,
"RtlWow64EnableFsRedirectionEx failed status %x\n",
status );
870 ok( !
status,
"RtlWow64EnableFsRedirectionEx failed status %x\n",
status );
871 ok(
cur == 1,
"RtlWow64EnableFsRedirectionEx got %u\n",
cur );
873 pRtlWow64EnableFsRedirectionEx( old, &
cur );
882 skip(
"not running on NT, skipping test\n");
891 pRtlCreateUnicodeStringFromAsciiz = (
void *)
GetProcAddress(
hntdll,
"RtlCreateUnicodeStringFromAsciiz");
898 pRtlWow64EnableFsRedirectionEx = (
void *)
GetProcAddress(
hntdll,
"RtlWow64EnableFsRedirectionEx");
char * strcat(char *DstString, const char *SrcString)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
static const WCHAR nameW[]
#define FILE_DIRECTORY_FILE
#define FileIdExtdDirectoryInformation
#define FileIdExtdBothDirectoryInformation
#define STATUS_INVALID_HANDLE
#define STATUS_NOT_IMPLEMENTED
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define GetCurrentProcess()
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
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)
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
@ FilePositionInformation
@ FileIdGlobalTxDirectoryInformation
@ FileDirectoryInformation
@ FileReparsePointInformation
@ FileObjectIdInformation
@ FileIdBothDirectoryInformation
@ FileFullDirectoryInformation
@ FileBothDirectoryInformation
@ FileIdFullDirectoryInformation
#define FILE_SYNCHRONOUS_IO_NONALERT
#define FILE_OPEN_FOR_BACKUP_INTENT
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLfloat GLfloat GLfloat GLfloat h
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 OBJ_CASE_INSENSITIVE
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
static POBJECT_ATTRIBUTES
static void tear_down_attribute_test(const WCHAR *testdir)
static void test_NtQueryDirectoryFile_case(void)
static DWORD LPDWORD LPCSTR DWORD srclen
static DWORD LPDWORD reslen
static struct testfile_s testfiles[]
static void test_NtQueryDirectoryFile(void)
static void test_redirection(void)
static const WCHAR dotdotW[]
static const WCHAR dummyW[]
static void reset_found_files(void)
static const int max_test_dir_size
static const int test_dir_count
static const WCHAR dotW[]
static void tear_down_case_test(const char *testdir)
static void test_NtQueryDirectoryFile_classes(HANDLE handle, UNICODE_STRING *mask)
static const WCHAR backslashW[]
static void set_up_case_test(const char *testdir)
static DWORD LPDWORD LPCSTR src
static void set_up_attribute_test(const WCHAR *testdir)
static FILE_INFORMATION_CLASS
static void test_directory_sort(const WCHAR *testdir)
static PWSTR CURDIR *static LPCWSTR
static void tally_test_file(FILE_BOTH_DIRECTORY_INFORMATION *dir_info)
static void test_flags_NtQueryDirectoryFile(OBJECT_ATTRIBUTES *attr, const char *testdirA, UNICODE_STRING *mask, BOOLEAN single_entry, BOOLEAN restart_flag)
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK io
#define InitializeObjectAttributes(p, n, a, r, s)
#define FILE_LIST_DIRECTORY
#define FILE_ATTRIBUTE_HIDDEN
#define FILE_ATTRIBUTE_SYSTEM
#define FILE_ATTRIBUTE_DIRECTORY
#define FILE_ATTRIBUTE_REPARSE_POINT
#define STATUS_ACCESS_VIOLATION
#define STATUS_INVALID_INFO_CLASS
static unsigned __int64 next
#define offsetof(TYPE, MEMBER)
#define STATUS_BUFFER_OVERFLOW
#define STATUS_NO_SUCH_FILE
#define STATUS_INFO_LENGTH_MISMATCH
#define STATUS_NO_MORE_FILES
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
DWORD WINAPI GetLastError(void)
#define ERROR_PATH_NOT_FOUND
#define DUPLICATE_SAME_ACCESS