diff --git a/gfxhook/config.c b/gfxhook/config.c index 230ee0d..98db059 100644 --- a/gfxhook/config.c +++ b/gfxhook/config.c @@ -1,7 +1,6 @@ #include #include -#include #include #include "gfxhook/config.h" diff --git a/gfxhook/d3d11.c b/gfxhook/d3d11.c index 1fc3295..cd60529 100644 --- a/gfxhook/d3d11.c +++ b/gfxhook/d3d11.c @@ -3,13 +3,11 @@ #include #include -#include #include #include "gfxhook/gfx.h" #include "gfxhook/util.h" -#include "hook/com-proxy.h" #include "hook/table.h" #include "hooklib/dll.h" @@ -157,8 +155,8 @@ HRESULT WINAPI D3D11CreateDeviceAndSwapChain( { DXGI_SWAP_CHAIN_DESC *desc; HWND hwnd; - LONG width; - LONG height; + UINT width; + UINT height; dprintf("D3D11: D3D11CreateDeviceAndSwapChain hook hit\n"); @@ -172,8 +170,6 @@ HRESULT WINAPI D3D11CreateDeviceAndSwapChain( height = desc->BufferDesc.Height; } else { hwnd = NULL; - width = 0; - height = 0; } if (hwnd != NULL) { diff --git a/gfxhook/d3d9.c b/gfxhook/d3d9.c index c8de146..34a165d 100644 --- a/gfxhook/d3d9.c +++ b/gfxhook/d3d9.c @@ -2,7 +2,6 @@ #include #include -#include #include #include "hook/com-proxy.h" @@ -10,7 +9,6 @@ #include "hooklib/dll.h" -#include "gfxhook/config.h" #include "gfxhook/gfx.h" #include "gfxhook/util.h" @@ -103,8 +101,6 @@ fail: if (d3d9 != NULL) { FreeLibrary(d3d9); } - - return; } IDirect3D9 * WINAPI Direct3DCreate9(UINT sdk_ver) diff --git a/gfxhook/dxgi.c b/gfxhook/dxgi.c index 4de0f74..f97c506 100644 --- a/gfxhook/dxgi.c +++ b/gfxhook/dxgi.c @@ -284,8 +284,8 @@ static HRESULT STDMETHODCALLTYPE my_IDXGIFactory_CreateSwapChain( struct com_proxy *proxy; IDXGIFactory *real; HWND hwnd; - LONG width; - LONG height; + UINT width; + UINT height; dprintf("DXGI: IDXGIFactory::CreateSwapChain hook hit\n"); @@ -300,8 +300,6 @@ static HRESULT STDMETHODCALLTYPE my_IDXGIFactory_CreateSwapChain( height = desc->BufferDesc.Height; } else { hwnd = NULL; - width = 0; - height = 0; } if (hwnd != NULL) { @@ -323,8 +321,8 @@ static HRESULT STDMETHODCALLTYPE my_IDXGIFactory_CreateSwapChain( HWND_TOP, 0, 0, - width, - height, + (int) width, + (int) height, SWP_FRAMECHANGED | SWP_NOSENDCHANGING); ShowWindow(hwnd, SW_SHOWMAXIMIZED); diff --git a/gfxhook/gfx.c b/gfxhook/gfx.c index 6c341b9..0ac1761 100644 --- a/gfxhook/gfx.c +++ b/gfxhook/gfx.c @@ -1,7 +1,6 @@ #include #include -#include #include #include "gfxhook/config.h" diff --git a/gfxhook/util.c b/gfxhook/util.c index 14268f3..4da45b3 100644 --- a/gfxhook/util.c +++ b/gfxhook/util.c @@ -1,7 +1,5 @@ #include -#include - #include "gfxhook/util.h" #include "util/dprintf.h" @@ -16,7 +14,7 @@ void gfx_util_ensure_win_visible(HWND hwnd) ShowWindow(hwnd, SW_RESTORE); } -void gfx_util_borderless_fullscreen_windowed(HWND hwnd, LONG width, LONG height) +void gfx_util_borderless_fullscreen_windowed(HWND hwnd, UINT width, UINT height) { BOOL ok; HRESULT hr; @@ -31,8 +29,8 @@ void gfx_util_borderless_fullscreen_windowed(HWND hwnd, LONG width, LONG height) HWND_TOP, 0, 0, - width, - height, + (int) width, + (int) height, SWP_FRAMECHANGED | SWP_NOSENDCHANGING); if (!ok) { diff --git a/gfxhook/util.h b/gfxhook/util.h index b300bba..d0c2401 100644 --- a/gfxhook/util.h +++ b/gfxhook/util.h @@ -3,5 +3,5 @@ #include void gfx_util_ensure_win_visible(HWND hwnd); -void gfx_util_borderless_fullscreen_windowed(HWND hwnd, LONG width, LONG height); +void gfx_util_borderless_fullscreen_windowed(HWND hwnd, UINT width, UINT height); HRESULT gfx_util_frame_window(HWND hwnd); diff --git a/hooklib/dll.h b/hooklib/dll.h index 2927a50..b4fc1b7 100644 --- a/hooklib/dll.h +++ b/hooklib/dll.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include