From b6338878a88ac2b04841d2c6eee0696e414a3e88 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 22 Apr 2003 04:04:17 +0000 Subject: [PATCH] Moved kernel32.FlushFileBuffers to ntdll.NtFlushBuffersFile. --- dlls/ntdll/file.c | 15 +++++++++++++++ dlls/ntdll/ntdll.spec | 6 +++--- files/file.c | 15 +++++++++------ include/winternl.h | 1 + 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index c7db40e986a..a111cf70642 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -491,3 +491,18 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile ( IoStatusBlock->Information = len; return STATUS_SUCCESS; } + +/****************************************************************** + * NtFlushBuffersFile (NTDLL.@) + */ +NTSTATUS WINAPI NtFlushBuffersFile( HANDLE hFile, IO_STATUS_BLOCK* IoStatusBlock ) +{ + NTSTATUS ret; + SERVER_START_REQ( flush_file ) + { + req->handle = hFile; + ret = wine_server_call( req ); + } + SERVER_END_REQ; + return ret; +} diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 55729526837..35d711de142 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -107,7 +107,7 @@ @ stdcall NtEnumerateKey (long long long long long long) @ stdcall NtEnumerateValueKey (long long long long long long) @ stub NtExtendSection -@ stub NtFlushBuffersFile +@ stdcall NtFlushBuffersFile(long ptr) @ stub NtFlushInstructionCache @ stdcall NtFlushKey(long) @ stdcall NtFlushVirtualMemory(long ptr ptr long) @@ -441,7 +441,7 @@ @ stdcall RtlInt64ToUnicodeString(long long long ptr) @ stdcall RtlIntegerToChar(long long long ptr) @ stdcall RtlIntegerToUnicodeString(long long ptr) -@ stdcall RtlIsDosDeviceName_U(wstr) RtlIsDosDeviceName_U +@ stdcall RtlIsDosDeviceName_U(wstr) @ stub RtlIsGenericTableEmpty @ stdcall RtlIsNameLegalDOS8Dot3(ptr ptr ptr) @ stdcall RtlIsTextUnicode(ptr long ptr) @@ -634,7 +634,7 @@ @ stdcall ZwEnumerateKey(long long long ptr long ptr) NtEnumerateKey @ stdcall ZwEnumerateValueKey(long long long ptr long ptr) NtEnumerateValueKey @ stub ZwExtendSection -@ stub ZwFlushBuffersFile +@ stdcall ZwFlushBuffersFile(long ptr) NtFlushBuffersFile @ stub ZwFlushInstructionCache @ stdcall ZwFlushKey(long) NtFlushKey @ stdcall ZwFlushVirtualMemory(long ptr ptr long) NtFlushVirtualMemory diff --git a/files/file.c b/files/file.c index 0313936bbe9..9e45fa0c744 100644 --- a/files/file.c +++ b/files/file.c @@ -2361,14 +2361,17 @@ UINT WINAPI SetHandleCount( UINT count ) */ BOOL WINAPI FlushFileBuffers( HANDLE hFile ) { - BOOL ret; - SERVER_START_REQ( flush_file ) + NTSTATUS nts; + IO_STATUS_BLOCK ioblk; + + nts = NtFlushBuffersFile( hFile, &ioblk ); + if (nts != STATUS_SUCCESS) { - req->handle = hFile; - ret = !wine_server_call_err( req ); + SetLastError( RtlNtStatusToDosError( nts ) ); + return FALSE; } - SERVER_END_REQ; - return ret; + + return TRUE; } diff --git a/include/winternl.h b/include/winternl.h index 97c4d5c186b..44a44243d38 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -850,6 +850,7 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_S NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG); NTSTATUS WINAPI NtEnumerateKey(HKEY,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *); NTSTATUS WINAPI NtEnumerateValueKey(HKEY,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG); +NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*); NTSTATUS WINAPI NtFlushKey(HKEY); NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,ULONG*,ULONG); NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG); -- 2.11.4.GIT