Author: tfaber
Date: Wed Jul 11 07:04:50 2012
New Revision: 56866
URL:
http://svn.reactos.org/svn/reactos?rev=56866&view=rev
Log:
[NTDLL_WINETEST]
- Sync to Wine 1.5.4
- Reverts r55730 (Skip an obviously nonsensical test of trying to sprintf into NULL)
Modified:
trunk/rostests/winetests/ntdll/ (props changed)
trunk/rostests/winetests/ntdll/atom.c
trunk/rostests/winetests/ntdll/error.c
trunk/rostests/winetests/ntdll/generated.c
trunk/rostests/winetests/ntdll/info.c
trunk/rostests/winetests/ntdll/path.c
trunk/rostests/winetests/ntdll/pipe.c
trunk/rostests/winetests/ntdll/reg.c
trunk/rostests/winetests/ntdll/rtl.c
trunk/rostests/winetests/ntdll/string.c
Propchange: trunk/rostests/winetests/ntdll/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Wed Jul 11 07:04:50 2012
@@ -1,0 +1,2 @@
+([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))?
+(\d+)
Propchange: trunk/rostests/winetests/ntdll/
------------------------------------------------------------------------------
bugtraq:message = See issue #%BUGID% for more details.
Propchange: trunk/rostests/winetests/ntdll/
------------------------------------------------------------------------------
bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/rostests/winetests/ntdll/
------------------------------------------------------------------------------
tsvn:logminsize = 10
Modified: trunk/rostests/winetests/ntdll/atom.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/atom.c?re…
==============================================================================
--- trunk/rostests/winetests/ntdll/atom.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/atom.c [iso-8859-1] Wed Jul 11 07:04:50 2012
@@ -443,7 +443,7 @@
ok(!res, "Added atom (%x)\n", res);
- memset(abi->Name, 0xcc, 255 * sizeof(WCHAR));
+ memset( ptr, 0xcc, sizeof(ptr) );
res = pNtQueryInformationAtom( atom, AtomBasicInformation, (void*)ptr, ptr_size, NULL
);
ok(!res, "atom lookup\n");
ok(!lstrcmpW(abi->Name, testAtom1), "ok strings\n");
@@ -457,7 +457,7 @@
ok(abi->NameLength == lstrlenW(testAtom1) * sizeof(WCHAR) ||
broken(abi->NameLength == sizeof(WCHAR)), /* nt4 */
"string length %u\n",abi->NameLength);
- memset(abi->Name, 0xcc, lstrlenW(testAtom1) * sizeof(WCHAR));
+ memset( ptr, 0xcc, sizeof(ptr) );
ptr_size = sizeof(ATOM_BASIC_INFORMATION) + lstrlenW(testAtom1) * sizeof(WCHAR);
res = pNtQueryInformationAtom( atom, AtomBasicInformation, (void*)ptr, ptr_size, NULL
);
ok(!res, "atom lookup %x\n", res);
@@ -466,8 +466,8 @@
ok(abi->Name[lstrlenW(testAtom1)] == 0, "buffer overwrite %x\n",
abi->Name[lstrlenW(testAtom1)]);
ok(abi->Name[lstrlenW(testAtom1) + 1] == 0xcccc, "buffer overwrite
%x\n", abi->Name[lstrlenW(testAtom1) + 1]);
+ memset( ptr, 0xcc, sizeof(ptr) );
ptr_size = sizeof(ATOM_BASIC_INFORMATION) + 4 * sizeof(WCHAR);
- abi->Name[0] = abi->Name[1] = abi->Name[2] = abi->Name[3] =
'\0';
res = pNtQueryInformationAtom( atom, AtomBasicInformation, (void*)ptr, ptr_size, NULL
);
ok(!res, "couldn't find atom\n");
ok(abi->NameLength == 8, "wrong string length %u\n",
abi->NameLength);
Modified: trunk/rostests/winetests/ntdll/error.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/error.c?r…
==============================================================================
--- trunk/rostests/winetests/ntdll/error.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/error.c [iso-8859-1] Wed Jul 11 07:04:50 2012
@@ -2,7 +2,7 @@
* Unit tests for RtlNtStatusToDosError function
*
* Copyright (c) 2002 Andriy Palamarchuk
- * Copyright (c) 2010 André Hentschel
+ * Copyright (c) 2010 André Hentschel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Modified: trunk/rostests/winetests/ntdll/generated.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/generated…
==============================================================================
--- trunk/rostests/winetests/ntdll/generated.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/generated.c [iso-8859-1] Wed Jul 11 07:04:50 2012
@@ -375,7 +375,6 @@
/* CCHAR */
TEST_TYPE_SIZE (CCHAR, 1)
TEST_TYPE_ALIGN (CCHAR, 1)
- TEST_TYPE_SIGNED(CCHAR)
}
static void test_pack_CHAR(void)
@@ -383,7 +382,6 @@
/* CHAR */
TEST_TYPE_SIZE (CHAR, 1)
TEST_TYPE_ALIGN (CHAR, 1)
- TEST_TYPE_SIGNED(CHAR)
}
static void test_pack_DWORDLONG(void)
@@ -438,42 +436,6 @@
TEST_TYPE_SIZE (EXECUTION_STATE, 4)
TEST_TYPE_ALIGN (EXECUTION_STATE, 4)
TEST_TYPE_UNSIGNED(EXECUTION_STATE)
-}
-
-static void test_pack_FLOATING_SAVE_AREA(void)
-{
-#if 0 // this doesn't exist on amd64
- /* FLOATING_SAVE_AREA */
- TEST_TYPE_SIZE (FLOATING_SAVE_AREA, 112)
- TEST_TYPE_ALIGN (FLOATING_SAVE_AREA, 4)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, ControlWord, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, ControlWord, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, ControlWord, 0)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, StatusWord, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, StatusWord, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, StatusWord, 4)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, TagWord, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, TagWord, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, TagWord, 8)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, ErrorOffset, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, ErrorOffset, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, ErrorOffset, 12)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, ErrorSelector, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, ErrorSelector, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, ErrorSelector, 16)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, DataOffset, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, DataOffset, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, DataOffset, 20)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, DataSelector, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, DataSelector, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, DataSelector, 24)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, RegisterArea, 80)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, RegisterArea, 1)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, RegisterArea, 28)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, Cr0NpxState, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, Cr0NpxState, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, Cr0NpxState, 108)
-#endif
}
static void test_pack_FPO_DATA(void)
@@ -877,7 +839,9 @@
static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY(void)
{
/* IMAGE_LOAD_CONFIG_DIRECTORY */
-// TEST_TYPE_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, 88)
+#ifndef __REACTOS__
+ TEST_TYPE_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, 88)
+#endif
TEST_TYPE_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, 8)
TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, Size, 4)
TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, Size, 4)
@@ -900,7 +864,7 @@
TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, CriticalSectionDefaultTimeout, 4)
TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, CriticalSectionDefaultTimeout, 4)
TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, CriticalSectionDefaultTimeout, 20)
-#if 0 // wine headers are broken
+#ifndef __REACTOS__ // wine headers are broken
TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitFreeBlockThreshold, 4)
TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitFreeBlockThreshold, 4)
TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitFreeBlockThreshold, 24)
@@ -1982,17 +1946,6 @@
TEST_TARGET_ALIGN(PEXCEPTION_RECORD, 8)
}
-static void test_pack_PFLOATING_SAVE_AREA(void)
-{
-#if 0
- /* PFLOATING_SAVE_AREA */
- TEST_TYPE_SIZE (PFLOATING_SAVE_AREA, 8)
- TEST_TYPE_ALIGN (PFLOATING_SAVE_AREA, 8)
- TEST_TARGET_SIZE (PFLOATING_SAVE_AREA, 112)
- TEST_TARGET_ALIGN(PFLOATING_SAVE_AREA, 4)
-#endif
-}
-
static void test_pack_PFPO_DATA(void)
{
/* PFPO_DATA */
@@ -2163,7 +2116,7 @@
/* PIMAGE_LOAD_CONFIG_DIRECTORY */
TEST_TYPE_SIZE (PIMAGE_LOAD_CONFIG_DIRECTORY, 8)
TEST_TYPE_ALIGN (PIMAGE_LOAD_CONFIG_DIRECTORY, 8)
-#if 0// wine headers are broken
+#ifndef __REACTOS__ // wine headers are broken
TEST_TARGET_SIZE (PIMAGE_LOAD_CONFIG_DIRECTORY, 88)
#endif
TEST_TARGET_ALIGN(PIMAGE_LOAD_CONFIG_DIRECTORY, 8)
@@ -3794,7 +3747,6 @@
/* CCHAR */
TEST_TYPE_SIZE (CCHAR, 1)
TEST_TYPE_ALIGN (CCHAR, 1)
- TEST_TYPE_SIGNED(CCHAR)
}
static void test_pack_CHAR(void)
@@ -3802,7 +3754,6 @@
/* CHAR */
TEST_TYPE_SIZE (CHAR, 1)
TEST_TYPE_ALIGN (CHAR, 1)
- TEST_TYPE_SIGNED(CHAR)
}
static void test_pack_DWORDLONG(void)
@@ -3857,40 +3808,6 @@
TEST_TYPE_SIZE (EXECUTION_STATE, 4)
TEST_TYPE_ALIGN (EXECUTION_STATE, 4)
TEST_TYPE_UNSIGNED(EXECUTION_STATE)
-}
-
-static void test_pack_FLOATING_SAVE_AREA(void)
-{
- /* FLOATING_SAVE_AREA */
- TEST_TYPE_SIZE (FLOATING_SAVE_AREA, 112)
- TEST_TYPE_ALIGN (FLOATING_SAVE_AREA, 4)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, ControlWord, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, ControlWord, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, ControlWord, 0)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, StatusWord, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, StatusWord, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, StatusWord, 4)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, TagWord, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, TagWord, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, TagWord, 8)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, ErrorOffset, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, ErrorOffset, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, ErrorOffset, 12)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, ErrorSelector, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, ErrorSelector, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, ErrorSelector, 16)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, DataOffset, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, DataOffset, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, DataOffset, 20)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, DataSelector, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, DataSelector, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, DataSelector, 24)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, RegisterArea, 80)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, RegisterArea, 1)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, RegisterArea, 28)
- TEST_FIELD_SIZE (FLOATING_SAVE_AREA, Cr0NpxState, 4)
- TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, Cr0NpxState, 4)
- TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, Cr0NpxState, 108)
}
static void test_pack_FPO_DATA(void)
@@ -5397,15 +5314,6 @@
TEST_TARGET_ALIGN(PEXCEPTION_RECORD, 4)
}
-static void test_pack_PFLOATING_SAVE_AREA(void)
-{
- /* PFLOATING_SAVE_AREA */
- TEST_TYPE_SIZE (PFLOATING_SAVE_AREA, 4)
- TEST_TYPE_ALIGN (PFLOATING_SAVE_AREA, 4)
- TEST_TARGET_SIZE (PFLOATING_SAVE_AREA, 112)
- TEST_TARGET_ALIGN(PFLOATING_SAVE_AREA, 4)
-}
-
static void test_pack_PFPO_DATA(void)
{
/* PFPO_DATA */
@@ -6933,7 +6841,6 @@
test_pack_EXECUTION_STATE();
test_pack_FARPROC();
test_pack_FLOAT();
- test_pack_FLOATING_SAVE_AREA();
test_pack_FPO_DATA();
test_pack_GENERIC_MAPPING();
test_pack_GLOBALHANDLE();
@@ -7033,7 +6940,6 @@
test_pack_PCWSTR();
test_pack_PEXCEPTION_POINTERS();
test_pack_PEXCEPTION_RECORD();
- test_pack_PFLOATING_SAVE_AREA();
test_pack_PFPO_DATA();
test_pack_PGENERIC_MAPPING();
test_pack_PHANDLE();
Modified: trunk/rostests/winetests/ntdll/info.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/info.c?re…
==============================================================================
--- trunk/rostests/winetests/ntdll/info.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/info.c [iso-8859-1] Wed Jul 11 07:04:50 2012
@@ -1293,7 +1293,8 @@
{
ok (mbi.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "mbi.AllocationProtect
is 0x%x, expected 0x%x\n", mbi.AllocationProtect, PAGE_EXECUTE_WRITECOPY);
ok (mbi.State == MEM_COMMIT, "mbi.State is 0x%x, expected 0x%X\n",
mbi.State, MEM_COMMIT);
- ok (mbi.Protect == PAGE_READWRITE, "mbi.Protect is 0x%x, expected
0x%X\n", mbi.Protect, PAGE_READWRITE);
+ ok (mbi.Protect == PAGE_READWRITE || mbi.Protect == PAGE_WRITECOPY,
+ "mbi.Protect is 0x%x\n", mbi.Protect);
}
else skip( "bss is outside of module\n" ); /* this can happen on Mac OS
*/
}
Modified: trunk/rostests/winetests/ntdll/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/path.c?re…
==============================================================================
--- trunk/rostests/winetests/ntdll/path.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/path.c [iso-8859-1] Wed Jul 11 07:04:50 2012
@@ -135,6 +135,7 @@
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\nul.txt", 1000,
6 },
+ // ReactOS r54114
{ "c:\\nul", 6, 6 },
{ NULL, 0 }
};
Modified: trunk/rostests/winetests/ntdll/pipe.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/pipe.c?re…
==============================================================================
--- trunk/rostests/winetests/ntdll/pipe.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/pipe.c [iso-8859-1] Wed Jul 11 07:04:50 2012
@@ -147,20 +147,34 @@
timeout.QuadPart = -100000000000ll;
-/* create a pipe with sharing = 0 */
- res = pNtCreateNamedPipeFile(&handle, FILE_READ_ATTRIBUTES | SYNCHRONIZE,
&attr, &iosb, 0, 2 /*FILE_CREATE*/,
+/* create a pipe with FILE_OVERWRITE */
+ res = pNtCreateNamedPipeFile(&handle, FILE_READ_ATTRIBUTES | SYNCHRONIZE,
&attr, &iosb, FILE_SHARE_READ, 4 /*FILE_OVERWRITE*/,
0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &timeout);
todo_wine ok(res == STATUS_INVALID_PARAMETER, "NtCreateNamedPipeFile returned
%x\n", res);
if (!res)
CloseHandle(handle);
+/* create a pipe with FILE_OVERWRITE_IF */
+ res = pNtCreateNamedPipeFile(&handle, FILE_READ_ATTRIBUTES | SYNCHRONIZE,
&attr, &iosb, FILE_SHARE_READ, 5 /*FILE_OVERWRITE_IF*/,
+ 0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &timeout);
+ todo_wine ok(res == STATUS_INVALID_PARAMETER, "NtCreateNamedPipeFile returned
%x\n", res);
+ if (!res)
+ CloseHandle(handle);
+
+/* create a pipe with sharing = 0 */
+ res = pNtCreateNamedPipeFile(&handle, FILE_READ_ATTRIBUTES | SYNCHRONIZE,
&attr, &iosb, 0, 2 /*FILE_CREATE*/,
+ 0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &timeout);
+ ok(res == STATUS_INVALID_PARAMETER, "NtCreateNamedPipeFile returned %x\n",
res);
+ if (!res)
+ CloseHandle(handle);
+
/* create a pipe without r/w access */
res = pNtCreateNamedPipeFile(&handle, SYNCHRONIZE, &attr, &iosb,
FILE_SHARE_READ | FILE_SHARE_WRITE, 2 /*FILE_CREATE*/,
0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &timeout);
ok(!res, "NtCreateNamedPipeFile returned %x\n", res);
res = pNtQueryInformationFile(handle, &iosb, &info, sizeof(info),
(FILE_INFORMATION_CLASS)24);
- todo_wine ok(res == STATUS_ACCESS_DENIED, "NtQueryInformationFile returned
%x\n", res);
+ ok(res == STATUS_ACCESS_DENIED, "NtQueryInformationFile returned %x\n",
res);
/* test FILE_CREATE creation disposition */
res = pNtCreateNamedPipeFile(&handle2, SYNCHRONIZE, &attr, &iosb,
FILE_SHARE_READ | FILE_SHARE_WRITE, 2 /*FILE_CREATE*/,
@@ -172,6 +186,60 @@
CloseHandle(handle);
}
+static void test_create(void)
+{
+ HANDLE hserver;
+ NTSTATUS res;
+ int j, k;
+ FILE_PIPE_LOCAL_INFORMATION info;
+ IO_STATUS_BLOCK iosb;
+
+ static const DWORD access[] = { 0, GENERIC_READ, GENERIC_WRITE, GENERIC_READ |
GENERIC_WRITE};
+ static const DWORD sharing[] = { FILE_SHARE_READ, FILE_SHARE_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE };
+ static const DWORD pipe_config[]= { 1, 0,
2 };
+
+ for (j = 0; j < sizeof(sharing) / sizeof(DWORD); j++) {
+ for (k = 0; k < sizeof(access) / sizeof(DWORD); k++) {
+ HANDLE hclient;
+ BOOL should_succeed = TRUE;
+
+ res = create_pipe(&hserver, sharing[j], FILE_SYNCHRONOUS_IO_NONALERT);
+ if (res) {
+ ok(0, "NtCreateNamedPipeFile returned %x, sharing: %x\n", res,
sharing[j]);
+ continue;
+ }
+
+ res = pNtQueryInformationFile(hserver, &iosb, &info, sizeof(info),
(FILE_INFORMATION_CLASS)24);
+ ok(!res, "NtQueryInformationFile for server returned %x, sharing:
%x\n", res, sharing[j]);
+ ok(info.NamedPipeConfiguration == pipe_config[j], "wrong duplex status
for pipe: %d, expected %d\n",
+ info.NamedPipeConfiguration, pipe_config[j]);
+
+ hclient = CreateFileW(testpipe, access[k], 0, 0, OPEN_EXISTING, 0, 0);
+ if (hclient != INVALID_HANDLE_VALUE) {
+ res = pNtQueryInformationFile(hclient, &iosb, &info,
sizeof(info), (FILE_INFORMATION_CLASS)24);
+ ok(!res, "NtQueryInformationFile for client returned %x, access: %x,
sharing: %x\n",
+ res, access[k], sharing[j]);
+ ok(info.NamedPipeConfiguration == pipe_config[j], "wrong duplex
status for pipe: %d, expected %d\n",
+ info.NamedPipeConfiguration, pipe_config[j]);
+ CloseHandle(hclient);
+ }
+
+ if (access[k] & GENERIC_WRITE)
+ should_succeed &= !!(sharing[j] & FILE_SHARE_WRITE);
+ if (access[k] & GENERIC_READ)
+ should_succeed &= !!(sharing[j] & FILE_SHARE_READ);
+
+ if (should_succeed)
+ ok(hclient != INVALID_HANDLE_VALUE, "CreateFile failed for sharing
%x, access: %x, GetLastError: %d\n",
+ sharing[j], access[k], GetLastError());
+ else
+ ok(hclient == INVALID_HANDLE_VALUE, "CreateFile succeeded for
sharing %x, access: %x\n", sharing[j], access[k]);
+
+ CloseHandle(hserver);
+ }
+ }
+}
+
static BOOL ioapc_called;
static void CALLBACK ioapc(void *arg, PIO_STATUS_BLOCK io, ULONG reserved)
{
@@ -238,8 +306,10 @@
Sleep(400);
if (main_thread) {
+ DWORD ret;
userapc_called = FALSE;
- ok(pQueueUserAPC(&userapc, main_thread, 0), "can't queue user apc,
GetLastError: %x\n", GetLastError());
+ ret = pQueueUserAPC(&userapc, main_thread, 0);
+ ok(ret, "can't queue user apc, GetLastError: %x\n",
GetLastError());
CloseHandle(main_thread);
}
@@ -264,6 +334,7 @@
HANDLE hPipe;
NTSTATUS res;
HANDLE hThread;
+ DWORD ret;
memset(&iosb, 0x55, sizeof(iosb));
@@ -275,7 +346,8 @@
/* queue an user apc before calling listen */
userapc_called = FALSE;
- ok(pQueueUserAPC(&userapc, GetCurrentThread(), 0), "can't queue user
apc, GetLastError: %x\n", GetLastError());
+ ret = pQueueUserAPC(&userapc, GetCurrentThread(), 0);
+ ok(ret, "can't queue user apc, GetLastError: %x\n", GetLastError());
res = listen_pipe(hPipe, hEvent, &iosb, TRUE);
todo_wine ok(res == STATUS_CANCELLED, "NtFsControlFile returned %x\n",
res);
@@ -332,6 +404,7 @@
HANDLE hPipe;
NTSTATUS res;
HANDLE hThread;
+ DWORD ret;
memset(&iosb, 0x55, sizeof(iosb));
@@ -345,7 +418,8 @@
ok(hThread != INVALID_HANDLE_VALUE, "can't create thread, GetLastError:
%x\n", GetLastError());
userapc_called = FALSE;
- ok(pQueueUserAPC(&userapc, GetCurrentThread(), 0), "can't queue user
apc, GetLastError: %x\n", GetLastError());
+ ret = pQueueUserAPC(&userapc, GetCurrentThread(), 0);
+ ok(ret, "can't queue user apc, GetLastError: %x\n", GetLastError());
res = listen_pipe(hPipe, hEvent, &iosb, TRUE);
todo_wine ok(!res, "NtFsControlFile returned %x\n", res);
@@ -413,6 +487,9 @@
trace("starting invalid create tests\n");
test_create_invalid();
+ trace("starting create tests\n");
+ test_create();
+
trace("starting overlapped tests\n");
test_overlapped();
Modified: trunk/rostests/winetests/ntdll/reg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/reg.c?rev…
==============================================================================
--- trunk/rostests/winetests/ntdll/reg.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/reg.c [iso-8859-1] Wed Jul 11 07:04:50 2012
@@ -396,7 +396,8 @@
/* Only attributes */
status = pNtCreateKey(NULL, 0, &attr, 0, 0, 0, 0);
- ok(status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got:
0x%08x\n", status);
+ ok(status == STATUS_ACCESS_VIOLATION || status == STATUS_ACCESS_DENIED /* Win7 */,
+ "Expected STATUS_ACCESS_VIOLATION or STATUS_ACCESS_DENIED, got:
0x%08x\n", status);
/* Length > sizeof(OBJECT_ATTRIBUTES) */
attr.Length *= 2;
@@ -1243,6 +1244,41 @@
pNtClose( key64 );
}
+static void test_long_value_name(void)
+{
+ HANDLE key;
+ NTSTATUS status, expected;
+ OBJECT_ATTRIBUTES attr;
+ UNICODE_STRING ValName;
+ DWORD i;
+
+ InitializeObjectAttributes(&attr, &winetestpath, 0, 0, 0);
+ status = pNtOpenKey(&key, KEY_WRITE|KEY_READ, &attr);
+ ok(status == STATUS_SUCCESS, "NtOpenKey Failed: 0x%08x\n", status);
+
+ ValName.MaximumLength = 0xfffc;
+ ValName.Length = ValName.MaximumLength - sizeof(WCHAR);
+ ValName.Buffer = HeapAlloc(GetProcessHeap(), 0, ValName.MaximumLength);
+ for (i = 0; i < ValName.Length / sizeof(WCHAR); i++)
+ ValName.Buffer[i] = 'a';
+ ValName.Buffer[i] = 0;
+
+ status = pNtDeleteValueKey(key, &ValName);
+ ok(status == STATUS_OBJECT_NAME_NOT_FOUND, "NtDeleteValueKey with nonexistent
long value name returned 0x%08x\n", status);
+ status = pNtSetValueKey(key, &ValName, 0, REG_DWORD, &i, sizeof(i));
+ ok(status == STATUS_INVALID_PARAMETER || broken(status == STATUS_SUCCESS) /* nt4 */,
+ "NtSetValueKey with long value name returned 0x%08x\n", status);
+ expected = (status == STATUS_SUCCESS) ? STATUS_SUCCESS :
STATUS_OBJECT_NAME_NOT_FOUND;
+ status = pNtDeleteValueKey(key, &ValName);
+ ok(status == expected, "NtDeleteValueKey with long value name returned
0x%08x\n", status);
+
+ status = pNtQueryValueKey(key, &ValName, KeyValueBasicInformation, NULL, 0,
&i);
+ ok(status == STATUS_OBJECT_NAME_NOT_FOUND, "NtQueryValueKey with nonexistent
long value name returned 0x%08x\n", status);
+
+ pRtlFreeUnicodeString(&ValName);
+ pNtClose(key);
+}
+
START_TEST(reg)
{
static const WCHAR winetest[] =
{'\\','W','i','n','e','T','e','s','t',0};
@@ -1264,6 +1300,7 @@
test_RtlpNtQueryValueKey();
test_NtFlushKey();
test_NtQueryValueKey();
+ test_long_value_name();
test_NtDeleteKey();
test_symlinks();
test_redirection();
Modified: trunk/rostests/winetests/ntdll/rtl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/rtl.c?rev…
==============================================================================
--- trunk/rostests/winetests/ntdll/rtl.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/rtl.c [iso-8859-1] Wed Jul 11 07:04:50 2012
@@ -1154,7 +1154,7 @@
CHAR buffer[20];
CHAR *res;
IN_ADDR ip;
- DWORD len;
+ DWORD_PTR len;
if (!pRtlIpv4AddressToStringA)
{
@@ -1173,13 +1173,10 @@
len = strlen(buffer);
ok(res == (buffer + len), "got %p with '%s' (expected %p)\n", res,
buffer, buffer + len);
- if (0) {
- /* this crashes in windows */
- res = pRtlIpv4AddressToStringA(&ip, NULL);
- ok( (res == (char *)~0) ||
- broken(res == (char *)0 + len), /* XP and w2003 */
- "got %p (expected ~0)\n", res);
- }
+ res = pRtlIpv4AddressToStringA(&ip, NULL);
+ ok( (res == (char *)~0) ||
+ broken(res == (char *)len), /* XP and w2003 */
+ "got %p (expected ~0)\n", res);
if (0) {
/* this crashes in windows */
Modified: trunk/rostests/winetests/ntdll/string.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/string.c?…
==============================================================================
--- trunk/rostests/winetests/ntdll/string.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/string.c [iso-8859-1] Wed Jul 11 07:04:50 2012
@@ -1146,8 +1146,8 @@
static void test_wcslwrupr(void)
{
static WCHAR teststringW[] =
{'a','b','r','a','c','a','d','a','b','r','a',0};
- static WCHAR emptyW[1] = {0};
- static const WCHAR constemptyW[1] = {0};
+ static WCHAR emptyW[] = {0};
+ static const WCHAR constemptyW[] = {0};
if (0) /* crashes on native */
{
@@ -1255,9 +1255,9 @@
static void test_bsearch(void)
{
int arr[7] = { 1, 3, 4, 8, 16, 23, 42 };
- int *x, l, i,j ;
-
- /* just try all all sizes */
+ int *x, l, i, j;
+
+ /* just try all array sizes */
for (j=1;j<sizeof(arr)/sizeof(arr[0]);j++) {
for (i=0;i<j;i++) {
l = arr[i];