From: Stefan Dösinger Subject: [PATCH 5/5] d3d9: Make D3DPERF functions hookable. Message-Id: <1435059566-11498-5-git-send-email-stefan@codeweavers.com> Date: Tue, 23 Jun 2015 13:39:26 +0200 PIX from the DX SDK needs this. I once looked into making this tool work on Wine at the request of a graphics driver developer. These patches aren't enough to make PIX happy, there's also something wrong in the order of operations when we load libraries that prevents pixhelper.dll from being loaded into the process. This can be worked around with a LoadLibraryA("pixhelper.dll") hack. --- dlls/d3d9/d3d9_main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/d3d9/d3d9_main.c b/dlls/d3d9/d3d9_main.c index 0afdc04..bfbbc45 100644 --- a/dlls/d3d9/d3d9_main.c +++ b/dlls/d3d9/d3d9_main.c @@ -82,7 +82,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH Direct3DCreate9Ex(UINT sdk_version, IDirect3D9E * No documentation available for this function. * SDK only says it is internal and shouldn't be used. */ -void* WINAPI Direct3DShaderValidatorCreate9(void) +void* WINAPI DECLSPEC_HOTPATCH Direct3DShaderValidatorCreate9(void) { static int once; @@ -93,7 +93,7 @@ void* WINAPI Direct3DShaderValidatorCreate9(void) /*********************************************************************** * D3DPERF_BeginEvent (D3D9.@) */ -int WINAPI D3DPERF_BeginEvent(D3DCOLOR color, const WCHAR *name) +int WINAPI DECLSPEC_HOTPATCH D3DPERF_BeginEvent(D3DCOLOR color, const WCHAR *name) { TRACE("color 0x%08x, name %s.\n", color, debugstr_w(name)); @@ -103,7 +103,7 @@ int WINAPI D3DPERF_BeginEvent(D3DCOLOR color, const WCHAR *name) /*********************************************************************** * D3DPERF_EndEvent (D3D9.@) */ -int WINAPI D3DPERF_EndEvent(void) { +int WINAPI DECLSPEC_HOTPATCH D3DPERF_EndEvent(void) { TRACE("(void) : stub\n"); return --D3DPERF_event_level; @@ -112,7 +112,7 @@ int WINAPI D3DPERF_EndEvent(void) { /*********************************************************************** * D3DPERF_GetStatus (D3D9.@) */ -DWORD WINAPI D3DPERF_GetStatus(void) { +DWORD WINAPI DECLSPEC_HOTPATCH D3DPERF_GetStatus(void) { FIXME("(void) : stub\n"); return 0; @@ -122,7 +122,7 @@ DWORD WINAPI D3DPERF_GetStatus(void) { * D3DPERF_SetOptions (D3D9.@) * */ -void WINAPI D3DPERF_SetOptions(DWORD options) +void WINAPI DECLSPEC_HOTPATCH D3DPERF_SetOptions(DWORD options) { FIXME("(%#x) : stub\n", options); } @@ -130,7 +130,7 @@ void WINAPI D3DPERF_SetOptions(DWORD options) /*********************************************************************** * D3DPERF_QueryRepeatFrame (D3D9.@) */ -BOOL WINAPI D3DPERF_QueryRepeatFrame(void) { +BOOL WINAPI DECLSPEC_HOTPATCH D3DPERF_QueryRepeatFrame(void) { FIXME("(void) : stub\n"); return FALSE; @@ -139,7 +139,7 @@ BOOL WINAPI D3DPERF_QueryRepeatFrame(void) { /*********************************************************************** * D3DPERF_SetMarker (D3D9.@) */ -void WINAPI D3DPERF_SetMarker(D3DCOLOR color, const WCHAR *name) +void WINAPI DECLSPEC_HOTPATCH D3DPERF_SetMarker(D3DCOLOR color, const WCHAR *name) { FIXME("color 0x%08x, name %s stub!\n", color, debugstr_w(name)); } @@ -147,7 +147,7 @@ void WINAPI D3DPERF_SetMarker(D3DCOLOR color, const WCHAR *name) /*********************************************************************** * D3DPERF_SetRegion (D3D9.@) */ -void WINAPI D3DPERF_SetRegion(D3DCOLOR color, const WCHAR *name) +void WINAPI DECLSPEC_HOTPATCH D3DPERF_SetRegion(D3DCOLOR color, const WCHAR *name) { FIXME("color 0x%08x, name %s stub!\n", color, debugstr_w(name)); } -- 2.3.6