[APPHELP][ACLAYER][APPSHIM_APITEST] Fix some WCHAR hack constructions that VS 2010...
authorMark Jansen <mark.jansen@reactos.org>
Tue, 31 May 2016 18:02:54 +0000 (18:02 +0000)
committerMark Jansen <mark.jansen@reactos.org>
Tue, 31 May 2016 18:02:54 +0000 (18:02 +0000)
svn path=/trunk/; revision=71477

reactos/dll/appcompat/apphelp/sdbapi.c
reactos/dll/appcompat/shims/layer/versionlie.inl
rostests/apitests/appshim/versionlie.c

index 4dc1cf6..5d7b0a4 100644 (file)
@@ -443,18 +443,19 @@ void WINAPI SdbCloseDatabase(PDB db)
 BOOL WINAPI SdbGetAppPatchDir(HSDB db, LPWSTR path, DWORD size)
 {
     static WCHAR* default_dir = NULL;
+    static CONST WCHAR szAppPatch[] = {'\\','A','p','p','P','a','t','c','h',0};
 
     if(!default_dir)
     {
         WCHAR* tmp = NULL;
-        UINT len = GetSystemWindowsDirectoryW(NULL, 0) + lstrlenW((CONST WCHAR[]){'\\','A','p','p','P','a','t','c','h',0});
+        UINT len = GetSystemWindowsDirectoryW(NULL, 0) + lstrlenW(szAppPatch);
         tmp = SdbAlloc((len + 1)* sizeof(WCHAR));
         if(tmp)
         {
             UINT r = GetSystemWindowsDirectoryW(tmp, len+1);
             if (r && r < len)
             {
-                if (SUCCEEDED(StringCchCatW(tmp, len+1, (CONST WCHAR[]){'\\','A','p','p','P','a','t','c','h',0})))
+                if (SUCCEEDED(StringCchCatW(tmp, len+1, szAppPatch)))
                 {
                     if(InterlockedCompareExchangePointer((void**)&default_dir, tmp, NULL) == NULL)
                         tmp = NULL;
index 368cf66..99970be 100644 (file)
@@ -47,12 +47,13 @@ BOOL WINAPI SHIM_OBJ_NAME(Notify)(DWORD fdwReason)
 {
     if (fdwReason == SHIM_REASON_ATTACH && VERSION_INFO.wServicePackMajor)
     {
+        static CONST WCHAR szServicePack[] = {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','%','u',0};
         HRESULT hr = StringCbPrintfA(VERSION_INFO.szCSDVersionA, sizeof(VERSION_INFO.szCSDVersionA),
             "Service Pack %u", VERSION_INFO.wServicePackMajor);
         if (FAILED(hr))
             return FALSE;
         StringCbPrintfW(VERSION_INFO.szCSDVersionW, sizeof(VERSION_INFO.szCSDVersionW),
-            (CONST WCHAR[]){'S','e','r','v','i','c','e',' ','P','a','c','k',' ','%','u',0}, VERSION_INFO.wServicePackMajor);
+            szServicePack, VERSION_INFO.wServicePackMajor);
         if (FAILED(hr))
             return FALSE;
     }
@@ -71,3 +72,4 @@ BOOL WINAPI SHIM_OBJ_NAME(Notify)(DWORD fdwReason)
 #include <implement_shim.inl>
 
 #undef VERSION_INFO
+
index 6f65947..be8ca83 100644 (file)
@@ -161,6 +161,7 @@ static void verify_shimw_imp(PHOOKAPI hook, const VersionLieInfo* info, PCSTR sh
         }
         if (ok1 && ok2)
         {
+            static const WCHAR szCSDFMT[] = {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','%','u',0};
             WCHAR szCSDVersion[128] = { 0 };
             winetest_ok(v1.dwOSVersionInfoSize == v2.dwOSVersionInfoSize, "Expected dwOSVersionInfoSize to be equal, was: %u, %u for %s\n", v1.dwOSVersionInfoSize, v2.dwOSVersionInfoSize, shim);
             winetest_ok(info->dwMajorVersion == v2.dwMajorVersion, "Expected dwMajorVersion to be equal, was: %u, %u for %s\n", info->dwMajorVersion, v2.dwMajorVersion, shim);
@@ -169,7 +170,7 @@ static void verify_shimw_imp(PHOOKAPI hook, const VersionLieInfo* info, PCSTR sh
             winetest_ok(info->dwPlatformId == v2.dwPlatformId, "Expected dwPlatformId to be equal, was: %u, %u for %s\n", info->dwPlatformId, v2.dwPlatformId, shim);
 
             if (info->wServicePackMajor)
-                swprintf(szCSDVersion, (const WCHAR[]){'S','e','r','v','i','c','e',' ','P','a','c','k',' ','%','u',0}, info->wServicePackMajor);
+                swprintf(szCSDVersion, szCSDFMT, info->wServicePackMajor);
             winetest_ok(lstrcmpW(szCSDVersion, v2.szCSDVersion) == 0, "Expected szCSDVersion to be equal, was: %s, %s for %s\n", wine_dbgstr_w(szCSDVersion), wine_dbgstr_w(v2.szCSDVersion), shim);
 
             if (v1.dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW))