Author: mjansen
Date: Tue May 31 18:02:54 2016
New Revision: 71477
URL:
http://svn.reactos.org/svn/reactos?rev=71477&view=rev
Log:
[APPHELP][ACLAYER][APPSHIM_APITEST] Fix some WCHAR hack constructions that VS 2010
didn't like, as pointed out by Hermès
Modified:
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/reactos/dll/appcompat/shims/layer/versionlie.inl
trunk/rostests/apitests/appshim/versionlie.c
Modified: trunk/reactos/dll/appcompat/apphelp/sdbapi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdba…
==============================================================================
--- trunk/reactos/dll/appcompat/apphelp/sdbapi.c [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbapi.c [iso-8859-1] Tue May 31 18:02:54 2016
@@ -443,18 +443,19 @@
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;
Modified: trunk/reactos/dll/appcompat/shims/layer/versionlie.inl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/layer/…
==============================================================================
--- trunk/reactos/dll/appcompat/shims/layer/versionlie.inl [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/shims/layer/versionlie.inl [iso-8859-1] Tue May 31
18:02:54 2016
@@ -47,12 +47,13 @@
{
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 @@
#include <implement_shim.inl>
#undef VERSION_INFO
+
Modified: trunk/rostests/apitests/appshim/versionlie.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/appshim/versionl…
==============================================================================
--- trunk/rostests/apitests/appshim/versionlie.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/appshim/versionlie.c [iso-8859-1] Tue May 31 18:02:54 2016
@@ -161,6 +161,7 @@
}
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 @@
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))