From 7cab2e99c314b08fa4d81e82b32035d7293f4327 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Tue, 20 Aug 2013 20:20:39 +0900 Subject: [PATCH] ntdll: Last parameter of NtSetIoCompletion is 64-bit on 64-bit platforms. --- dlls/ntdll/sync.c | 4 ++-- dlls/ntdll/tests/file.c | 14 +++++++++++--- include/winternl.h | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c index 58dde65b1e9..7e3b57f6828 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c @@ -1297,11 +1297,11 @@ NTSTATUS WINAPI NtCreateIoCompletion( PHANDLE CompletionPort, ACCESS_MASK Desire */ NTSTATUS WINAPI NtSetIoCompletion( HANDLE CompletionPort, ULONG_PTR CompletionKey, ULONG_PTR CompletionValue, NTSTATUS Status, - ULONG NumberOfBytesTransferred ) + SIZE_T NumberOfBytesTransferred ) { NTSTATUS status; - TRACE("(%p, %lx, %lx, %x, %d)\n", CompletionPort, CompletionKey, + TRACE("(%p, %lx, %lx, %x, %lx)\n", CompletionPort, CompletionKey, CompletionValue, Status, NumberOfBytesTransferred); SERVER_START_REQ( add_completion ) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 3a1efdd8a57..77a8431ad53 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -72,7 +72,7 @@ static NTSTATUS (WINAPI *pNtCreateIoCompletion)(PHANDLE, ACCESS_MASK, POBJECT_AT static NTSTATUS (WINAPI *pNtOpenIoCompletion)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES); static NTSTATUS (WINAPI *pNtQueryIoCompletion)(HANDLE, IO_COMPLETION_INFORMATION_CLASS, PVOID, ULONG, PULONG); static NTSTATUS (WINAPI *pNtRemoveIoCompletion)(HANDLE, PULONG_PTR, PULONG_PTR, PIO_STATUS_BLOCK, PLARGE_INTEGER); -static NTSTATUS (WINAPI *pNtSetIoCompletion)(HANDLE, ULONG_PTR, ULONG_PTR, NTSTATUS, ULONG); +static NTSTATUS (WINAPI *pNtSetIoCompletion)(HANDLE, ULONG_PTR, ULONG_PTR, NTSTATUS, SIZE_T); static NTSTATUS (WINAPI *pNtSetInformationFile)(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS); static NTSTATUS (WINAPI *pNtQueryInformationFile)(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS); static NTSTATUS (WINAPI *pNtQueryDirectoryFile)(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK, @@ -990,8 +990,11 @@ static void test_iocp_setcompletion(HANDLE h) { NTSTATUS res; ULONG count; + SIZE_T size = 3; - res = pNtSetIoCompletion( h, CKEY_FIRST, CVALUE_FIRST, STATUS_INVALID_DEVICE_REQUEST, 3 ); + if (sizeof(size) > 4) size |= (ULONGLONG)0x12345678 << 32; + + res = pNtSetIoCompletion( h, CKEY_FIRST, CVALUE_FIRST, STATUS_INVALID_DEVICE_REQUEST, size ); ok( res == STATUS_SUCCESS, "NtSetIoCompletion failed: %x\n", res ); count = get_pending_msgs(h); @@ -1000,7 +1003,12 @@ static void test_iocp_setcompletion(HANDLE h) if (get_msg(h)) { ok( completionKey == CKEY_FIRST, "Invalid completion key: %lx\n", completionKey ); - ok( ioSb.Information == 3, "Invalid ioSb.Information: %ld\n", ioSb.Information ); + /* FIXME: Remove once Wine is fixed */ + if (sizeof(size) > 4) +todo_wine + ok( ioSb.Information == size, "Invalid ioSb.Information: %lu\n", ioSb.Information ); + else + ok( ioSb.Information == size, "Invalid ioSb.Information: %lu\n", ioSb.Information ); ok( U(ioSb).Status == STATUS_INVALID_DEVICE_REQUEST, "Invalid ioSb.Status: %x\n", U(ioSb).Status); ok( completionValue == CVALUE_FIRST, "Invalid completion value: %lx\n", completionValue ); } diff --git a/include/winternl.h b/include/winternl.h index 07ebbab5ecf..d3c1ce82415 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2208,7 +2208,7 @@ NTSYSAPI NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLA NTSYSAPI NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetIntervalProfile(ULONG,KPROFILE_SOURCE); -NTSYSAPI NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG_PTR,ULONG_PTR,NTSTATUS,ULONG); +NTSYSAPI NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG_PTR,ULONG_PTR,NTSTATUS,SIZE_T); NTSYSAPI NTSTATUS WINAPI NtSetLdtEntries(ULONG,LDT_ENTRY,ULONG,LDT_ENTRY); NTSYSAPI NTSTATUS WINAPI NtSetLowEventPair(HANDLE); NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighEventPair(HANDLE);