diff options
author | Kissaki <kissaki@gmx.de> | 2013-11-25 02:18:29 +0400 |
---|---|---|
committer | Kissaki <kissaki@gmx.de> | 2013-11-25 02:18:29 +0400 |
commit | cd4e8350a5d2b128197804e02d7c711d11b6e72a (patch) | |
tree | 478ccb5e8218a15779ad78c3d4173c86221557a9 /overlay/dxgi.cpp | |
parent | dfbc1b927934471db3ae006353b5a15617cadcdf (diff) |
Overlay: Changes as per PR-comments
* Use sizeof() rather then size constant where possible
Diffstat (limited to 'overlay/dxgi.cpp')
-rw-r--r-- | overlay/dxgi.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/overlay/dxgi.cpp b/overlay/dxgi.cpp index 69a1b8c93..f959f9c88 100644 --- a/overlay/dxgi.cpp +++ b/overlay/dxgi.cpp @@ -128,9 +128,8 @@ void checkDXGIHook(bool preonly) { /// @param hDXGI must be a valid module handle. void hookDXGI(HMODULE hDXGI, bool preonly) { - const int modulenamesize = MODULEFILEPATH_BUFLEN; - wchar_t modulename[modulenamesize]; - GetModuleFileNameW(NULL, modulename, modulenamesize); + wchar_t modulename[MODULEFILEPATH_BUFLEN]; + GetModuleFileNameW(NULL, modulename, ARRAY_NUM_ELEMENTS(modulename)); ods("DXGI: hookDXGI in App '%ls'", modulename); // Add a ref to ourselves; we do NOT want to get unloaded directly from this process. @@ -140,7 +139,7 @@ void hookDXGI(HMODULE hDXGI, bool preonly) { bHooked = true; // Can we use the prepatch data? - GetModuleFileNameW(hDXGI, modulename, modulenamesize); + GetModuleFileNameW(hDXGI, modulename, ARRAY_NUM_ELEMENTS(modulename)); if (_wcsicmp(dxgi->wcFileName, modulename) == 0) { // The module seems to match the one we prepared d3dd for. @@ -185,7 +184,7 @@ extern "C" __declspec(dllexport) void __cdecl PrepareDXGI() { HMODULE hDXGI = LoadLibrary("DXGI.DLL"); if (hDXGI != NULL) { - GetModuleFileNameW(hDXGI, dxgi->wcFileName, MODULEFILEPATH_BUFLEN); + GetModuleFileNameW(hDXGI, dxgi->wcFileName, ARRAY_NUM_ELEMENTS(dxgi->wcFileName)); CreateDXGIFactory1Type pCreateDXGIFactory1 = reinterpret_cast<CreateDXGIFactory1Type>(GetProcAddress(hDXGI, "CreateDXGIFactory1")); ods("DXGI: Got CreateDXGIFactory1 at %p", pCreateDXGIFactory1); |