diff --git a/dlls/kernel/process.c b/dlls/kernel/process.c index e00cae29ab3..0f457fd1f97 100644 --- a/dlls/kernel/process.c +++ b/dlls/kernel/process.c @@ -2740,9 +2740,11 @@ BOOL WINAPI WriteProcessMemory( HANDLE process, LPVOID addr, LPCVOID buffer, SIZ */ BOOL WINAPI FlushInstructionCache(HANDLE hProcess, LPCVOID lpBaseAddress, SIZE_T dwSize) { + NTSTATUS status; if (GetVersion() & 0x80000000) return TRUE; /* not NT, always TRUE */ - FIXME("(%p,%p,0x%08lx): stub\n",hProcess, lpBaseAddress, dwSize); - return TRUE; + status = NtFlushInstructionCache( hProcess, lpBaseAddress, dwSize ); + if (status) SetLastError( RtlNtStatusToDosError(status) ); + return !status; } diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 146d27149d3..50b29c69a89 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -115,7 +115,7 @@ @ stdcall NtEnumerateValueKey (long long long long long long) @ stub NtExtendSection @ stdcall NtFlushBuffersFile(long ptr) -@ stub NtFlushInstructionCache +@ stdcall NtFlushInstructionCache(long ptr long) @ stdcall NtFlushKey(long) @ stdcall NtFlushVirtualMemory(long ptr ptr long) @ stub NtFlushWriteBuffer @@ -698,7 +698,7 @@ @ stdcall ZwEnumerateValueKey(long long long ptr long ptr) NtEnumerateValueKey @ stub ZwExtendSection @ stdcall ZwFlushBuffersFile(long ptr) NtFlushBuffersFile -@ stub ZwFlushInstructionCache +@ stdcall ZwFlushInstructionCache(long ptr long) NtFlushInstructionCache @ stdcall ZwFlushKey(long) NtFlushKey @ stdcall ZwFlushVirtualMemory(long ptr ptr long) NtFlushVirtualMemory @ stub ZwFlushWriteBuffer diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index c0c240e0cbf..c786ed6ad67 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -154,3 +154,20 @@ NTSTATUS WINAPI NtSetInformationProcess( ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength); return 0; } + +/****************************************************************************** + * NtFlushInstructionCache [NTDLL.@] + * ZwFlushInstructionCache [NTDLL.@] + */ +NTSTATUS WINAPI NtFlushInstructionCache( + IN HANDLE ProcessHandle, + IN LPCVOID BaseAddress, + IN ULONG Size) +{ +#ifdef __i386__ + TRACE("%p %p %ld - no-op on x86\n", ProcessHandle, BaseAddress, Size ); +#else + FIXME("%p %p %ld\n", ProcessHandle, BaseAddress, Size ); +#endif + return STATUS_SUCCESS; +} diff --git a/include/winternl.h b/include/winternl.h index aa90a757a6f..776d588e33c 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -1242,6 +1242,7 @@ NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULON 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 NtFlushInstructionCache(HANDLE,LPCVOID,ULONG); NTSTATUS WINAPI NtFlushKey(HKEY); NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,ULONG*,ULONG); NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);