Platform SDK: Debugging and Error Handling

FlushInstructionCache

The FlushInstructionCache function flushes the instruction cache for the specified process.

BOOL FlushInstructionCache(
  HANDLE hProcess,        // handle to process 
  LPCVOID lpBaseAddress,  // base of region to flush
  DWORD dwSize            // length of region to flush
);

Parameters

hProcess
[in] Handle to a process whose instruction cache is to be flushed.
lpBaseAddress
[in] Pointer to the base of the region to be flushed. This parameter can be NULL.
dwSize
[in] Specifies the length, in bytes, of the region to be flushed if the lpBaseAddress parameter is not NULL.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

Windows NT/ 2000: Applications should call FlushInstructionCache if they generate or modify code in memory. The CPU cannot detect the change, and may execute the old code it cached.

Windows 95/98: The FlushInstructionCache function has no effect; it always returns TRUE.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Winbase.h; include Windows.h.
  Library: Use Kernel32.lib.

See Also

Debugging Overview, Debugging Functions