diff options
author | Jan Klass <kissaki@posteo.de> | 2017-07-10 20:21:53 +0300 |
---|---|---|
committer | Jan Klass <kissaki@posteo.de> | 2017-07-11 01:42:08 +0300 |
commit | ce864c77d709098400f4597363133327348aef83 (patch) | |
tree | 46ef860fa76467c18fd13af4c372299f9ab45fc2 /overlay | |
parent | 8029f3fe4a07418485479348d462ec95f7d3f9a5 (diff) |
Cast to correct API types
It is better to be explicit and API correct, even if the resulting
types ended up to be the same through typedefs or the implementation
reinterpret-casting to a memory address pointer.
Diffstat (limited to 'overlay')
-rw-r--r-- | overlay/d3d10.cpp | 2 | ||||
-rw-r--r-- | overlay/d3d11.cpp | 2 | ||||
-rw-r--r-- | overlay/d3d9.cpp | 2 | ||||
-rw-r--r-- | overlay/dxgi.cpp | 2 | ||||
-rw-r--r-- | overlay/lib.cpp | 6 | ||||
-rw-r--r-- | overlay/opengl.cpp | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/overlay/d3d10.cpp b/overlay/d3d10.cpp index 5c5a9a019..0f23fcd02 100644 --- a/overlay/d3d10.cpp +++ b/overlay/d3d10.cpp @@ -630,7 +630,7 @@ void hookD3D10(HMODULE hD3D10, bool preonly) { // Add a ref to ourselves; we do NOT want to get unloaded directly from this process. HMODULE hTempSelf = NULL; - GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char *>(&hookD3D10), &hTempSelf); + GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<LPCTSTR>(&hookD3D10), &hTempSelf); bHooked = true; diff --git a/overlay/d3d11.cpp b/overlay/d3d11.cpp index 361083516..8d0927efa 100644 --- a/overlay/d3d11.cpp +++ b/overlay/d3d11.cpp @@ -639,7 +639,7 @@ void hookD3D11(HMODULE hD3D11, bool preonly) { // Add a ref to ourselves; we do NOT want to get unloaded directly from this process. HMODULE hTempSelf = NULL; - GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char *>(&hookD3D11), &hTempSelf); + GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<LPCTSTR>(&hookD3D11), &hTempSelf); bHooked = true; diff --git a/overlay/d3d9.cpp b/overlay/d3d9.cpp index 84376e038..b1964537d 100644 --- a/overlay/d3d9.cpp +++ b/overlay/d3d9.cpp @@ -1000,7 +1000,7 @@ static void hookD3D9(HMODULE hD3D, bool preonly) { // Add a ref to ourselves; we do NOT want to get unloaded directly from this process. HMODULE hTempSelf = NULL; - GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char *>(&hookD3D9), &hTempSelf); + GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<LPCTSTR>(&hookD3D9), &hTempSelf); bHooked = true; diff --git a/overlay/dxgi.cpp b/overlay/dxgi.cpp index 03fb1165b..58748682c 100644 --- a/overlay/dxgi.cpp +++ b/overlay/dxgi.cpp @@ -148,7 +148,7 @@ void hookDXGI(HMODULE hDXGI, bool preonly) { // Add a ref to ourselves; we do NOT want to get unloaded directly from this process. HMODULE hTempSelf = NULL; - GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char *>(&hookDXGI), &hTempSelf); + GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<LPCTSTR>(&hookDXGI), &hTempSelf); bHooked = true; diff --git a/overlay/lib.cpp b/overlay/lib.cpp index dd331bbbf..a8900ece1 100644 --- a/overlay/lib.cpp +++ b/overlay/lib.cpp @@ -391,7 +391,7 @@ extern "C" __declspec(dllexport) void __cdecl InstallHooks() { if (dwWaitResult == WAIT_OBJECT_0) { if (sd != NULL && ! sd->bHooked) { HMODULE hSelf = NULL; - GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (char *) &InstallHooks, &hSelf); + GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, reinterpret_cast<LPCTSTR>(&InstallHooks), &hSelf); if (hSelf == NULL) { ods("Lib: Failed to find myself"); } else { @@ -695,7 +695,7 @@ bool IsFnInModule(voidFunc fnptr, wchar_t *refmodulepath, const std::string &log BOOL success = GetModuleHandleEx( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, - reinterpret_cast<LPCSTR>(fnptr), &hModule); + reinterpret_cast<LPCTSTR>(fnptr), &hModule); if (!success) { ods((logPrefix + ": Failed to get module for " + fnName).c_str()); } else { @@ -710,7 +710,7 @@ int GetFnOffsetInModule(voidFunc fnptr, wchar_t *refmodulepath, unsigned int ref HMODULE hModule = NULL; - if (! GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (char *) fnptr, &hModule)) { + if (! GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, reinterpret_cast<LPCTSTR>(fnptr), &hModule)) { ods((logPrefix + ": Failed to get module for " + fnName).c_str()); return -1; } diff --git a/overlay/opengl.cpp b/overlay/opengl.cpp index 59284626b..1a1c38307 100644 --- a/overlay/opengl.cpp +++ b/overlay/opengl.cpp @@ -356,7 +356,7 @@ void checkOpenGLHook() { // Add a ref to ourselves; we do NOT want to get unloaded directly from this process. HMODULE hTempSelf = NULL; - GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char *>(&checkOpenGLHook), &hTempSelf); + GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<LPCTSTR>(&checkOpenGLHook), &hTempSelf); #define INJECT(handle, name) {\ o##name = reinterpret_cast<t##name>(GetProcAddress(handle, #name));\ |