[PATCH] gameux/tests: Drop game stats test workarounds for Windows <= 2000

Alex Henrie alexhenrie24 at gmail.com
Fri Feb 2 00:51:58 CST 2018


Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
This resolves a Coverity warning.

 dlls/gameux/tests/Makefile.in      |  2 +-
 dlls/gameux/tests/gamestatistics.c | 29 +----------------------------
 2 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/dlls/gameux/tests/Makefile.in b/dlls/gameux/tests/Makefile.in
index c90132d0ac..7b3f2f9cd1 100644
--- a/dlls/gameux/tests/Makefile.in
+++ b/dlls/gameux/tests/Makefile.in
@@ -1,5 +1,5 @@
 TESTDLL   = gameux.dll
-IMPORTS   = uuid shlwapi oleaut32 ole32 advapi32
+IMPORTS   = uuid shlwapi oleaut32 ole32 advapi32 shell32
 
 C_SRCS = \
 	gameexplorer.c \
diff --git a/dlls/gameux/tests/gamestatistics.c b/dlls/gameux/tests/gamestatistics.c
index dd9bd3748a..ff247fcb17 100644
--- a/dlls/gameux/tests/gamestatistics.c
+++ b/dlls/gameux/tests/gamestatistics.c
@@ -32,25 +32,6 @@
  */
 static WCHAR sExeName[MAX_PATH] = {0};
 static GUID gameInstanceId;
-static HRESULT WINAPI (*pSHGetFolderPathW)(HWND,int,HANDLE,DWORD,LPWSTR);
-/*******************************************************************************
- *_loadDynamicRoutines
- *
- * Helper function, prepares pointers to system procedures which may be not
- * available on older operating systems.
- *
- * Returns:
- *  TRUE                        procedures were loaded successfully
- *  FALSE                       procedures were not loaded successfully
- */
-static BOOL _loadDynamicRoutines(void)
-{
-    HMODULE hModule = LoadLibraryA( "shell32.dll" );
-
-    pSHGetFolderPathW = (LPVOID)GetProcAddress(hModule, "SHGetFolderPathW");
-    if (!pSHGetFolderPathW) return FALSE;
-    return TRUE;
-}
 
 /*******************************************************************************
  * Registers test suite executable as game in Games Explorer. Required to test
@@ -117,7 +98,7 @@ static HRESULT _buildStatisticsFilePath(LPCGUID guidApplicationId, LPWSTR *lpSta
     HRESULT hr;
     WCHAR sGuid[49], sPath[MAX_PATH];
 
-    hr = pSHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, sPath);
+    hr = SHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, sPath);
 
     if(SUCCEEDED(hr))
         hr = (StringFromGUID2(guidApplicationId, sGuid, sizeof(sGuid) / sizeof(sGuid[0])) != 0 ? S_OK : E_FAIL);
@@ -396,14 +377,6 @@ START_TEST(gamestatistics)
     IGameStatisticsMgr* gsm;
     IGameExplorer *ge;
 
-    if (!_loadDynamicRoutines())
-    {
-        /* this is not a failure, because a procedure loaded by address
-         * is always available on systems which has gameux.dll */
-        win_skip("too old system, cannot load required dynamic procedures\n");
-        return;
-    }
-
     hr = CoInitialize( NULL );
     ok(hr == S_OK, "failed to init COM\n");
 
-- 
2.16.1




More information about the wine-devel mailing list