Author: gedmurphy
Date: Mon Oct 1 17:23:28 2007
New Revision: 29328
URL:
http://svn.reactos.org/svn/reactos?rev=29328&view=rev
Log:
It's not pretty, but get desk.cpl building in msvc again.
Modified:
trunk/reactos/dll/cpl/desk/advmon.c
trunk/reactos/dll/cpl/desk/devsett.c
Modified: trunk/reactos/dll/cpl/desk/advmon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/advmon.c?rev=…
==============================================================================
--- trunk/reactos/dll/cpl/desk/advmon.c (original)
+++ trunk/reactos/dll/cpl/desk/advmon.c Mon Oct 1 17:23:28 2007
@@ -99,6 +99,9 @@
LocalFree((HLOCAL)lpDisplayName);
}
+
+typedef HPSXA (WINAPI * CPSEAE)(HKEY,LPCWSTR,UINT,IDataObject*);
+
BOOL
DisplayAdvancedSettings(HWND hWndParent, PDISPLAY_DEVICE_ENTRY DisplayDevice)
{
@@ -108,6 +111,11 @@
HPSXA hpsxaDev, hpsxaDisp;
BOOL Ret;
IDataObject *pdo;
+ HMODULE hShell32 = NULL;
+ CPSEAE msvc_SHCreatePropSheetExtArrayEx;
+
+ /* silence gcc warning */
+ msvc_SHCreatePropSheetExtArrayEx = NULL;
/* FIXME: Build the "%s and %s" caption string for the monitor and adapter
name */
szCaption[0] = _T('\0');
@@ -127,11 +135,23 @@
if (pdo != NULL)
BuildAdvPropTitle(pdo, szCaption, sizeof(szCaption) / sizeof(szCaption[0]));
+#ifdef _MSC_VER
+ hShell32 = LoadLibrary(_T("shell32.dll"));
+ if(hShell32 == NULL)
+ return FALSE;
+ msvc_SHCreatePropSheetExtArrayEx = (CPSEAE)GetProcAddress(hShell32, (LPCSTR)194);
+ hpsxaDev = msvc_SHCreatePropSheetExtArrayEx(HKEY_LOCAL_MACHINE,
REGSTR_PATH_CONTROLSFOLDER TEXT("\\Device"), MAX_ADVANCED_PAGES - psh.nPages,
pdo);
+#else
hpsxaDev = SHCreatePropSheetExtArrayEx(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER
TEXT("\\Device"), MAX_ADVANCED_PAGES - psh.nPages, pdo);
+#endif
if (hpsxaDev != NULL)
SHAddFromPropSheetExtArray(hpsxaDev, PropSheetAddPage, (LPARAM)&psh);
+#ifdef _MSC_VER
+ hpsxaDisp = msvc_SHCreatePropSheetExtArrayEx(HKEY_LOCAL_MACHINE,
REGSTR_PATH_CONTROLSFOLDER TEXT("\\Device"), MAX_ADVANCED_PAGES - psh.nPages,
pdo);
+#else
hpsxaDisp = SHCreatePropSheetExtArrayEx(HKEY_LOCAL_MACHINE,
REGSTR_PATH_CONTROLSFOLDER TEXT("\\Display"), MAX_ADVANCED_PAGES - psh.nPages,
pdo);
+#endif
if (hpsxaDisp != NULL)
SHAddFromPropSheetExtArray(hpsxaDisp, PropSheetAddPage, (LPARAM)&psh);
@@ -145,5 +165,8 @@
IDataObject_Release(pdo);
+ if (hShell32)
+ FreeLibrary(hShell32);
+
return Ret;
}
Modified: trunk/reactos/dll/cpl/desk/devsett.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/devsett.c?rev…
==============================================================================
--- trunk/reactos/dll/cpl/desk/devsett.c (original)
+++ trunk/reactos/dll/cpl/desk/devsett.c Mon Oct 1 17:23:28 2007
@@ -228,7 +228,7 @@
if (lpRegKey != NULL)
{
if (wcslen(lpRegKey) >= wcslen(szRegPrefix) &&
- !wcsnicmp(lpRegKey,
+ !_wcsnicmp(lpRegKey,
szRegPrefix,
wcslen(szRegPrefix)))
{