Author: akhaldi
Date: Fri May 29 08:46:58 2015
New Revision: 67945
URL:
http://svn.reactos.org/svn/reactos?rev=67945&view=rev
Log:
[NTDLL_WINETEST] Sync with Wine Staging 1.7.43.
Modified:
trunk/rostests/winetests/ntdll/change.c
trunk/rostests/winetests/ntdll/file.c
trunk/rostests/winetests/ntdll/om.c
trunk/rostests/winetests/ntdll/pipe.c
trunk/rostests/winetests/ntdll/port.c
trunk/rostests/winetests/ntdll/reg.c
trunk/rostests/winetests/ntdll/rtl.c
Modified: trunk/rostests/winetests/ntdll/change.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/change.c?…
==============================================================================
--- trunk/rostests/winetests/ntdll/change.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/change.c [iso-8859-1] Fri May 29 08:46:58 2015
@@ -99,19 +99,19 @@
r = pNtNotifyChangeDirectoryFile(hdir,hEvent,NULL,NULL,&iosb,buffer,sizeof
buffer,filter,0);
ok(r==STATUS_PENDING, "should return status pending\n");
- r = WaitForSingleObject( hEvent, 0 );
+ r = WaitForSingleObject( hEvent, 100 );
ok( r == STATUS_TIMEOUT, "should timeout\n" );
- r = WaitForSingleObject( hdir, 0 );
+ r = WaitForSingleObject( hdir, 100 );
ok( r == STATUS_TIMEOUT, "should timeout\n" );
r = CreateDirectoryW( subdir, NULL );
ok( r == TRUE, "failed to create directory\n");
- r = WaitForSingleObject( hdir, 0 );
+ r = WaitForSingleObject( hdir, 100 );
ok( r == STATUS_TIMEOUT, "should timeout\n" );
- r = WaitForSingleObject( hEvent, 0 );
+ r = WaitForSingleObject( hEvent, 100 );
ok( r == WAIT_OBJECT_0, "event should be ready\n" );
ok( U(iosb).Status == STATUS_SUCCESS, "information wrong\n");
@@ -299,7 +299,7 @@
CloseHandle(hdir);
ok(U(iosb).Status == STATUS_SUCCESS, "status wrong\n");
- todo_wine ok(U(iosb2).Status == STATUS_CANCELLED, "status wrong\n");
+ ok(U(iosb2).Status == STATUS_CANCELLED, "status wrong
%x\n",U(iosb2).Status);
ok(iosb.Information == 0, "info wrong\n");
ok(iosb2.Information == 0, "info wrong\n");
Modified: trunk/rostests/winetests/ntdll/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/file.c?re…
==============================================================================
--- trunk/rostests/winetests/ntdll/file.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/file.c [iso-8859-1] Fri May 29 08:46:58 2015
@@ -111,6 +111,16 @@
return WaitForSingleObject( obj, 0 ) == WAIT_OBJECT_0;
}
+static const char* debugstr_longlong(ULONGLONG ll)
+{
+ static char str[17];
+ if (sizeof(ll) > sizeof(unsigned long) && ll >> 32)
+ sprintf(str, "%lx%08lx", (unsigned long)(ll >> 32), (unsigned
long)ll);
+ else
+ sprintf(str, "%lx", (unsigned long)ll);
+ return str;
+}
+
#define PIPENAME "\\\\.\\pipe\\ntdll_tests_file.c"
#define TEST_BUF_LEN 3
@@ -685,7 +695,7 @@
ok( U(iosb).Status == STATUS_CANCELLED, "wrong status %x\n", U(iosb).Status
);
ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information );
ok( is_signaled( event ), "event is signaled\n" );
- todo_wine ok( !apc_count, "apc was called\n" );
+ ok( !apc_count, "apc was called\n" );
SleepEx( 1, TRUE ); /* alertable sleep */
ok( apc_count == 1, "apc was not called\n" );
@@ -711,7 +721,7 @@
ok( U(iosb).Status == STATUS_CANCELLED, "wrong status %x\n", U(iosb).Status
);
ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information );
ok( is_signaled( event ), "event is signaled\n" );
- todo_wine ok( !apc_count, "apc was called\n" );
+ ok( !apc_count, "apc was called\n" );
SleepEx( 1, TRUE ); /* alertable sleep */
ok( apc_count == 1, "apc was not called\n" );
CloseHandle( handle );
@@ -737,7 +747,7 @@
ok( U(iosb).Status == STATUS_CANCELLED, "wrong status %x\n",
U(iosb).Status );
ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information );
ok( is_signaled( event ), "event is signaled\n" );
- todo_wine ok( !apc_count, "apc was called\n" );
+ ok( !apc_count, "apc was called\n" );
SleepEx( 1, TRUE ); /* alertable sleep */
ok( apc_count == 1, "apc was not called\n" );
@@ -763,7 +773,7 @@
ok( U(iosb).Status == STATUS_CANCELLED, "wrong status %x\n",
U(iosb).Status );
ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information );
ok( is_signaled( event ), "event is signaled\n" );
- todo_wine ok( !apc_count, "apc was called\n" );
+ ok( !apc_count, "apc was called\n" );
SleepEx( 1, TRUE ); /* alertable sleep */
ok( apc_count == 2, "apc was not called\n" );
@@ -1232,6 +1242,62 @@
CloseHandle( hPipeClt );
}
+static void test_file_full_size_information(void)
+{
+ IO_STATUS_BLOCK io;
+ FILE_FS_FULL_SIZE_INFORMATION ffsi;
+ FILE_FS_SIZE_INFORMATION fsi;
+ HANDLE h;
+ NTSTATUS res;
+
+ if(!(h = create_temp_file(0))) return ;
+
+ memset(&ffsi,0,sizeof(ffsi));
+ memset(&fsi,0,sizeof(fsi));
+
+ /* Assume No Quota Settings configured on Wine Testbot */
+ res = pNtQueryVolumeInformationFile(h, &io, &ffsi, sizeof ffsi,
FileFsFullSizeInformation);
+ ok(res == STATUS_SUCCESS, "cannot get attributes, res %x\n", res);
+ res = pNtQueryVolumeInformationFile(h, &io, &fsi, sizeof fsi,
FileFsSizeInformation);
+ ok(res == STATUS_SUCCESS, "cannot get attributes, res %x\n", res);
+
+ /* Test for FileFsSizeInformation */
+ ok(fsi.TotalAllocationUnits.QuadPart > 0,
+ "[fsi] TotalAllocationUnits expected positive, got 0x%s\n",
+ debugstr_longlong(fsi.TotalAllocationUnits.QuadPart));
+ ok(fsi.AvailableAllocationUnits.QuadPart > 0,
+ "[fsi] AvailableAllocationUnits expected positive, got 0x%s\n",
+ debugstr_longlong(fsi.AvailableAllocationUnits.QuadPart));
+
+ /* Assume file system is NTFS */
+ ok(fsi.BytesPerSector == 512, "[fsi] BytesPerSector expected 512, got
%d\n",fsi.BytesPerSector);
+ ok(fsi.SectorsPerAllocationUnit == 8, "[fsi] SectorsPerAllocationUnit expected
8, got %d\n",fsi.SectorsPerAllocationUnit);
+
+ ok(ffsi.TotalAllocationUnits.QuadPart > 0,
+ "[ffsi] TotalAllocationUnits expected positive, got negative value
0x%s\n",
+ debugstr_longlong(ffsi.TotalAllocationUnits.QuadPart));
+ ok(ffsi.CallerAvailableAllocationUnits.QuadPart > 0,
+ "[ffsi] CallerAvailableAllocationUnits expected positive, got negative value
0x%s\n",
+ debugstr_longlong(ffsi.CallerAvailableAllocationUnits.QuadPart));
+ ok(ffsi.ActualAvailableAllocationUnits.QuadPart > 0,
+ "[ffsi] ActualAvailableAllocationUnits expected positive, got negative value
0x%s\n",
+ debugstr_longlong(ffsi.ActualAvailableAllocationUnits.QuadPart));
+ ok(ffsi.TotalAllocationUnits.QuadPart == fsi.TotalAllocationUnits.QuadPart,
+ "[ffsi] TotalAllocationUnits error fsi:0x%s, ffsi:0x%s\n",
+ debugstr_longlong(fsi.TotalAllocationUnits.QuadPart),
+ debugstr_longlong(ffsi.TotalAllocationUnits.QuadPart));
+ ok(ffsi.CallerAvailableAllocationUnits.QuadPart ==
fsi.AvailableAllocationUnits.QuadPart,
+ "[ffsi] CallerAvailableAllocationUnits error fsi:0x%s, ffsi: 0x%s\n",
+ debugstr_longlong(fsi.AvailableAllocationUnits.QuadPart),
+ debugstr_longlong(ffsi.CallerAvailableAllocationUnits.QuadPart));
+
+ /* Assume file system is NTFS */
+ ok(ffsi.BytesPerSector == 512, "[ffsi] BytesPerSector expected 512, got
%d\n",ffsi.BytesPerSector);
+ ok(ffsi.SectorsPerAllocationUnit == 8, "[ffsi] SectorsPerAllocationUnit expected
8, got %d\n",ffsi.SectorsPerAllocationUnit);
+
+ CloseHandle( h );
+}
+
static void test_file_basic_information(void)
{
IO_STATUS_BLOCK io;
@@ -1382,11 +1448,12 @@
{
char tmp_path[MAX_PATH], buffer[MAX_PATH + 16];
DWORD dirpos;
- HANDLE handle, handle2;
+ HANDLE handle, handle2, mapping;
NTSTATUS res;
IO_STATUS_BLOCK io;
FILE_DISPOSITION_INFORMATION fdi;
BOOL fileDeleted;
+ void *ptr;
GetTempPathA( MAX_PATH, tmp_path );
@@ -1550,6 +1617,72 @@
todo_wine
ok( !fileDeleted, "Directory shouldn't have been deleted\n" );
RemoveDirectoryA( buffer );
+
+ /* cannot set disposition on file with file mapping opened */
+ GetTempFileNameA( tmp_path, "dis", 0, buffer );
+ handle = CreateFileA(buffer, GENERIC_READ | GENERIC_WRITE | DELETE, 0, NULL,
CREATE_ALWAYS, 0, 0);
+ ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" );
+ mapping = CreateFileMappingA( handle, NULL, PAGE_READWRITE, 0, 64 * 1024,
"DelFileTest" );
+ ok( mapping != NULL, "failed to create file mapping\n");
+ fdi.DoDeleteFile = TRUE;
+ res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi,
FileDispositionInformation );
+ ok( res == STATUS_CANNOT_DELETE, "unexpected FileDispositionInformation result
(expected STATUS_CANNOT_DELETE, got %x)\n", res );
+ CloseHandle( handle );
+ fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES &&
GetLastError() == ERROR_FILE_NOT_FOUND;
+ ok( !fileDeleted, "File shouldn't have been deleted\n" );
+ CloseHandle( mapping );
+ DeleteFileA( buffer );
+
+ /* can set disposition on file with file mapping closed */
+ GetTempFileNameA( tmp_path, "dis", 0, buffer );
+ handle = CreateFileA(buffer, GENERIC_READ | GENERIC_WRITE | DELETE, 0, NULL,
CREATE_ALWAYS, 0, 0);
+ ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" );
+ mapping = CreateFileMappingA( handle, NULL, PAGE_READWRITE, 0, 64 * 1024,
"DelFileTest" );
+ ok( mapping != NULL, "failed to create file mapping\n");
+ CloseHandle( mapping );
+ fdi.DoDeleteFile = TRUE;
+ res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi,
FileDispositionInformation );
+ ok( res == STATUS_SUCCESS, "unexpected FileDispositionInformation result
(expected STATUS_SUCCESS, got %x)\n", res );
+ CloseHandle( handle );
+ fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES &&
GetLastError() == ERROR_FILE_NOT_FOUND;
+ ok( fileDeleted, "File should have been deleted\n" );
+ DeleteFileA( buffer );
+
+ /* cannot set disposition on file which is mapped to memory */
+ GetTempFileNameA( tmp_path, "dis", 0, buffer );
+ handle = CreateFileA(buffer, GENERIC_READ | GENERIC_WRITE | DELETE, 0, NULL,
CREATE_ALWAYS, 0, 0);
+ ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" );
+ mapping = CreateFileMappingA( handle, NULL, PAGE_READWRITE, 0, 64 * 1024,
"DelFileTest" );
+ ok( mapping != NULL, "failed to create file mapping\n");
+ ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 4096 );
+ ok( ptr != NULL, "MapViewOfFile failed\n");
+ CloseHandle( mapping );
+ fdi.DoDeleteFile = TRUE;
+ res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi,
FileDispositionInformation );
+ ok( res == STATUS_CANNOT_DELETE, "unexpected FileDispositionInformation result
(expected STATUS_CANNOT_DELETE, got %x)\n", res );
+ CloseHandle( handle );
+ fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES &&
GetLastError() == ERROR_FILE_NOT_FOUND;
+ ok( !fileDeleted, "File shouldn't have been deleted\n" );
+ UnmapViewOfFile( ptr );
+ DeleteFileA( buffer );
+
+ /* can set disposition on file which is mapped to memory and unmapped again */
+ GetTempFileNameA( tmp_path, "dis", 0, buffer );
+ handle = CreateFileA(buffer, GENERIC_READ | GENERIC_WRITE | DELETE, 0, NULL,
CREATE_ALWAYS, 0, 0);
+ ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" );
+ mapping = CreateFileMappingA( handle, NULL, PAGE_READWRITE, 0, 64 * 1024,
"DelFileTest" );
+ ok( mapping != NULL, "failed to create file mapping\n");
+ ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 4096 );
+ ok( ptr != NULL, "MapViewOfFile failed\n");
+ CloseHandle( mapping );
+ UnmapViewOfFile( ptr );
+ fdi.DoDeleteFile = TRUE;
+ res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi,
FileDispositionInformation );
+ ok( res == STATUS_SUCCESS, "unexpected FileDispositionInformation result
(expected STATUS_SUCCESS, got %x)\n", res );
+ CloseHandle( handle );
+ fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES &&
GetLastError() == ERROR_FILE_NOT_FOUND;
+ ok( fileDeleted, "File should have been deleted\n" );
+ DeleteFileA( buffer );
}
static void test_iocompletion(void)
@@ -2496,7 +2629,6 @@
ret = ReadFile(hfile, buf, 0, &bytes, &ovl);
/* ReadFile return value depends on Windows version and testing it is not practical
*/
if (!ret)
-todo_wine
ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got
%d\n", GetLastError());
ret = GetLastError();
ok(bytes == 0, "bytes %u\n", bytes);
@@ -2527,7 +2659,6 @@
ret = ReadFile(hfile, NULL, 0, &bytes, &ovl);
/* ReadFile return value depends on Windows version and testing it is not practical
*/
if (!ret)
-todo_wine
ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got
%d\n", GetLastError());
ret = GetLastError();
ok(bytes == 0, "bytes %u\n", bytes);
@@ -2676,6 +2807,8 @@
{
ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got
%d\n", GetLastError());
ok(bytes == 0, "bytes %u\n", bytes);
+ ret = WaitForSingleObject(hfile, 3000);
+ ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret);
}
else ok(bytes == 4, "bytes %u\n", bytes);
ok((NTSTATUS)ovl.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got
%#lx\n", ovl.Internal);
@@ -2707,6 +2840,8 @@
{
ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got
%d\n", GetLastError());
ok(bytes == 0, "bytes %u\n", bytes);
+ ret = WaitForSingleObject(hfile, 3000);
+ ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret);
}
else ok(bytes == 14, "bytes %u\n", bytes);
ok((NTSTATUS)ovl.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got
%#lx\n", ovl.Internal);
@@ -2951,6 +3086,7 @@
test_file_all_information();
test_file_both_information();
test_file_name_information();
+ test_file_full_size_information();
test_file_all_name_information();
test_file_disposition_information();
test_query_volume_information_file();
Modified: trunk/rostests/winetests/ntdll/om.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/om.c?rev=…
==============================================================================
--- trunk/rostests/winetests/ntdll/om.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/om.c [iso-8859-1] Fri May 29 08:46:58 2015
@@ -688,8 +688,8 @@
len = 0;
status = pNtQueryObject( handle, ObjectTypeInformation, buffer, 0, &len );
- todo_wine ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed
%x\n", status );
- todo_wine ok( len >= sizeof(OBJECT_TYPE_INFORMATION) + sizeof(type_event) +
sizeof(WCHAR), "unexpected len %u\n", len );
+ ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed %x\n",
status );
+ ok( len >= sizeof(OBJECT_TYPE_INFORMATION) + sizeof(type_event) + sizeof(WCHAR),
"unexpected len %u\n", len );
len = 0;
status = pNtQueryObject( handle, ObjectNameInformation, buffer,
sizeof(UNICODE_STRING), &len );
@@ -698,8 +698,8 @@
len = 0;
status = pNtQueryObject( handle, ObjectTypeInformation, buffer,
sizeof(OBJECT_TYPE_INFORMATION), &len );
- todo_wine ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed
%x\n", status );
- todo_wine ok( len >= sizeof(OBJECT_TYPE_INFORMATION) + sizeof(type_event) +
sizeof(WCHAR), "unexpected len %u\n", len );
+ ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed %x\n",
status );
+ ok( len >= sizeof(OBJECT_TYPE_INFORMATION) + sizeof(type_event) + sizeof(WCHAR),
"unexpected len %u\n", len );
len = 0;
status = pNtQueryObject( handle, ObjectNameInformation, buffer, sizeof(buffer),
&len );
@@ -720,17 +720,17 @@
len = 0;
memset( buffer, 0, sizeof(buffer) );
status = pNtQueryObject( handle, ObjectTypeInformation, buffer, sizeof(buffer),
&len );
- todo_wine ok( status == STATUS_SUCCESS, "NtQueryObject failed %x\n", status
);
- todo_wine ok( len > sizeof(OBJECT_TYPE_INFORMATION), "unexpected len
%u\n", len );
+ ok( status == STATUS_SUCCESS, "NtQueryObject failed %x\n", status );
+ ok( len > sizeof(OBJECT_TYPE_INFORMATION), "unexpected len %u\n", len
);
str = (UNICODE_STRING *)buffer;
- todo_wine ok( len >= sizeof(OBJECT_TYPE_INFORMATION) + str->Length +
sizeof(WCHAR), "unexpected len %u\n", len );
- todo_wine ok( str->Buffer && !memcmp( str->Buffer, type_event,
sizeof(type_file) ),
+ ok( len >= sizeof(OBJECT_TYPE_INFORMATION) + str->Length + sizeof(WCHAR),
"unexpected len %u\n", len );
+ ok( str->Buffer && !memcmp( str->Buffer, type_event, sizeof(type_event)
),
"wrong/bad type name %s (%p)\n",
wine_dbgstr_w(str->Buffer), str->Buffer );
len -= sizeof(WCHAR);
status = pNtQueryObject( handle, ObjectTypeInformation, buffer, len, &len );
- todo_wine ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed
%x\n", status );
- todo_wine ok( len >= sizeof(OBJECT_TYPE_INFORMATION) + sizeof(type_event) +
sizeof(WCHAR), "unexpected len %u\n", len );
+ ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed %x\n",
status );
+ ok( len >= sizeof(OBJECT_TYPE_INFORMATION) + sizeof(type_event) + sizeof(WCHAR),
"unexpected len %u\n", len );
pNtClose( handle );
@@ -775,12 +775,12 @@
len = 0;
memset( buffer, 0, sizeof(buffer) );
status = pNtQueryObject( handle, ObjectTypeInformation, buffer, sizeof(buffer),
&len );
- todo_wine ok( status == STATUS_SUCCESS, "NtQueryObject failed %x\n", status
);
- todo_wine ok( len > sizeof(OBJECT_TYPE_INFORMATION), "unexpected len
%u\n", len );
+ ok( status == STATUS_SUCCESS, "NtQueryObject failed %x\n", status );
+ ok( len > sizeof(OBJECT_TYPE_INFORMATION), "unexpected len %u\n", len
);
str = (UNICODE_STRING *)buffer;
expected_len = sizeof(OBJECT_TYPE_INFORMATION) + str->Length + sizeof(WCHAR);
- todo_wine ok( len >= expected_len, "unexpected len %u\n", len );
- todo_wine ok( str->Buffer && !memcmp( str->Buffer, type_file,
sizeof(type_file) ),
+ ok( len >= expected_len, "unexpected len %u\n", len );
+ ok( str->Buffer && !memcmp( str->Buffer, type_file, sizeof(type_file)
),
"wrong/bad type name %s (%p)\n",
wine_dbgstr_w(str->Buffer), str->Buffer );
pNtClose( handle );
@@ -1030,6 +1030,101 @@
status = pNtReleaseKeyedEvent( event, (void *)8, 0, &timeout );
ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtReleaseKeyedEvent %x\n",
status );
NtClose( event );
+}
+
+static void test_null_device(void)
+{
+ OBJECT_ATTRIBUTES attr;
+ IO_STATUS_BLOCK iosb;
+ UNICODE_STRING str;
+ NTSTATUS status;
+ DWORD num_bytes;
+ OVERLAPPED ov;
+ char buf[64];
+ HANDLE null;
+ BOOL ret;
+
+ memset(buf, 0xAA, sizeof(buf));
+ memset(&ov, 0, sizeof(ov));
+ ov.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
+
+ pRtlCreateUnicodeStringFromAsciiz(&str, "\\Device\\Null");
+ InitializeObjectAttributes(&attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL);
+ status = pNtOpenSymbolicLinkObject(&null, SYMBOLIC_LINK_QUERY, &attr);
+ ok(status == STATUS_OBJECT_TYPE_MISMATCH,
+ "expected STATUS_OBJECT_TYPE_MISMATCH, got %08x\n", status);
+
+ status = pNtOpenFile(&null, GENERIC_READ | GENERIC_WRITE, &attr, &iosb,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN);
+ ok(status == STATUS_SUCCESS,
+ "expected STATUS_SUCCESS, got %08x\n", status);
+
+ SetLastError(0xdeadbeef);
+ ret = WriteFile(null, buf, sizeof(buf), &num_bytes, NULL);
+ todo_wine
+ ok(!ret, "WriteFile unexpectedly succeeded\n");
+ todo_wine
+ ok(GetLastError() == ERROR_INVALID_PARAMETER,
+ "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
+
+ SetLastError(0xdeadbeef);
+ ret = ReadFile(null, buf, sizeof(buf), &num_bytes, NULL);
+ todo_wine
+ ok(!ret, "ReadFile unexpectedly succeeded\n");
+ todo_wine
+ ok(GetLastError() == ERROR_INVALID_PARAMETER,
+ "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
+
+ num_bytes = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = WriteFile(null, buf, sizeof(buf), &num_bytes, &ov);
+ if (ret || GetLastError() != ERROR_IO_PENDING)
+ {
+ ok(ret, "WriteFile failed with error %u\n", GetLastError());
+ }
+ else
+ {
+ num_bytes = 0xdeadbeef;
+ ret = GetOverlappedResult(null, &ov, &num_bytes, TRUE);
+ ok(ret, "GetOverlappedResult failed with error %u\n", GetLastError());
+ }
+ ok(num_bytes == sizeof(buf), "expected num_bytes = %u, got %u\n",
+ (DWORD)sizeof(buf), num_bytes);
+
+ num_bytes = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = ReadFile(null, buf, sizeof(buf), &num_bytes, &ov);
+ if (ret || GetLastError() != ERROR_IO_PENDING)
+ {
+ ok(!ret, "ReadFile unexpectedly succeeded\n");
+ }
+ else
+ {
+ num_bytes = 0xdeadbeef;
+ ret = GetOverlappedResult(null, &ov, &num_bytes, TRUE);
+ ok(!ret, "GetOverlappedResult unexpectedly succeeded\n");
+ }
+ ok(GetLastError() == ERROR_HANDLE_EOF,
+ "expected ERROR_HANDLE_EOF, got %u\n", GetLastError());
+
+ pNtClose(null);
+
+ null = CreateFileA("\\\\.\\Null", GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ ok(null == INVALID_HANDLE_VALUE, "CreateFileA unexpectedly succeeded\n");
+ ok(GetLastError() == ERROR_FILE_NOT_FOUND,
+ "expected ERROR_FILE_NOT_FOUND, got %u\n", GetLastError());
+
+ null = CreateFileA("\\\\.\\Device\\Null", GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ ok(null == INVALID_HANDLE_VALUE, "CreateFileA unexpectedly succeeded\n");
+ ok(GetLastError() == ERROR_PATH_NOT_FOUND,
+ "expected ERROR_PATH_NOT_FOUND, got %u\n", GetLastError());
+
+ pRtlFreeUnicodeString(&str);
+ CloseHandle(ov.hEvent);
}
START_TEST(om)
@@ -1081,4 +1176,5 @@
test_type_mismatch();
test_event();
test_keyed_events();
-}
+ test_null_device();
+}
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] Fri May 29 08:46:58 2015
@@ -469,12 +469,10 @@
ok(res == STATUS_PENDING, "NtFsControlFile returned %x\n", res);
res = pNtCancelIoFile(hPipe, &cancel_sb);
- todo_wine ok(!res, "NtCancelIoFile returned %x\n", res);
-
- todo_wine {
- ok(U(iosb).Status == STATUS_CANCELLED, "Wrong iostatus %x\n",
U(iosb).Status);
- ok(WaitForSingleObject(hEvent, 0) == 0, "hEvent not signaled\n");
- }
+ ok(!res, "NtCancelIoFile returned %x\n", res);
+
+ ok(U(iosb).Status == STATUS_CANCELLED, "Wrong iostatus %x\n",
U(iosb).Status);
+ ok(WaitForSingleObject(hEvent, 0) == 0, "hEvent not signaled\n");
ok(!ioapc_called, "IOAPC ran too early\n");
Modified: trunk/rostests/winetests/ntdll/port.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/port.c?re…
==============================================================================
--- trunk/rostests/winetests/ntdll/port.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/port.c [iso-8859-1] Fri May 29 08:46:58 2015
@@ -115,7 +115,7 @@
static HMODULE hntdll = 0;
static NTSTATUS (WINAPI *pNtCompleteConnectPort)(HANDLE);
static NTSTATUS (WINAPI *pNtAcceptConnectPort)(PHANDLE,ULONG,PLPC_MESSAGE,ULONG,
- ULONG,PLPC_SECTION_READ);
+ PLPC_SECTION_WRITE,PLPC_SECTION_READ);
static NTSTATUS (WINAPI *pNtReplyPort)(HANDLE,PLPC_MESSAGE);
static NTSTATUS (WINAPI *pNtReplyWaitReceivePort)(PHANDLE,PULONG,PLPC_MESSAGE,
PLPC_MESSAGE);
@@ -182,7 +182,7 @@
ok(!*LpcMessage->msg.Data, "Expected empty string!\n");
}
- status = pNtAcceptConnectPort(pAcceptPortHandle, 0, &LpcMessage->msg, 1, 0,
NULL);
+ status = pNtAcceptConnectPort(pAcceptPortHandle, 0, &LpcMessage->msg, 1, NULL,
NULL);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status);
status = pNtCompleteConnectPort(*pAcceptPortHandle);
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] Fri May 29 08:46:58 2015
@@ -709,7 +709,7 @@
type = 0xdead;
len = 0xbeef;
status = pNtQueryLicenseValue(&name, &type, buffer, sizeof(buffer),
&len);
- ok(status == STATUS_OBJECT_NAME_NOT_FOUND, "NtQueryLicenseValue unexpected
suceeded\n");
+ ok(status == STATUS_OBJECT_NAME_NOT_FOUND, "NtQueryLicenseValue unexpected
succeeded\n");
ok(type == 0xdead, "expected unmodified value for type, got %u\n", type);
ok(len == 0xbeef, "expected unmodified value for len, got %u\n", len);
@@ -1509,8 +1509,8 @@
test_RtlpNtQueryValueKey();
test_NtFlushKey();
test_NtQueryKey();
+ test_NtQueryLicenseKey();
test_NtQueryValueKey();
- test_NtQueryLicenseKey();
test_long_value_name();
test_NtDeleteKey();
test_symlinks();
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] Fri May 29 08:46:58 2015
@@ -64,6 +64,7 @@
/* Function ptrs for ntdll calls */
static HMODULE hntdll = 0;
static PVOID (WINAPI *pWinSqmStartSession)(PVOID unknown1, DWORD unknown2, DWORD
unknown3);
+static BOOL (WINAPI *pWinSqmIsOptedIn)(void);
static NTSTATUS (WINAPI *pWinSqmEndSession)(PVOID unknown1);
static SIZE_T (WINAPI *pRtlCompareMemory)(LPCVOID,LPCVOID,SIZE_T);
static SIZE_T (WINAPI *pRtlCompareMemoryUlong)(PULONG, SIZE_T, ULONG);
@@ -125,6 +126,7 @@
ok(hntdll != 0, "LoadLibrary failed\n");
if (hntdll) {
pWinSqmStartSession = (void *)GetProcAddress(hntdll,
"WinSqmStartSession");
+ pWinSqmIsOptedIn = (void *)GetProcAddress(hntdll, "WinSqmIsOptedIn");
pWinSqmEndSession = (void *)GetProcAddress(hntdll,
"WinSqmEndSession");
pRtlCompareMemory = (void *)GetProcAddress(hntdll, "RtlCompareMemory");
pRtlCompareMemoryUlong = (void *)GetProcAddress(hntdll,
"RtlCompareMemoryUlong");
@@ -211,6 +213,8 @@
args = 3 - call_stdcall_func3( pWinSqmStartSession, NULL, 0, 0 ) / 4;
ok(args == 3, "WinSqmStartSession expected to take %d arguments instead of
3\n", args);
+ args = 3 - call_stdcall_func3( pWinSqmIsOptedIn, NULL, 0, 0 ) / 4;
+ ok(args == 0, "WinSqmIsOptedIn expected to take %d arguments instead of
0\n", args);
args = 3 - call_stdcall_func3( pWinSqmEndSession, NULL, 0, 0 ) / 4;
ok(args == 1, "WinSqmEndSession expected to take %d arguments instead of
1\n", args);