https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9b55e647fae5c899f2269…
commit 9b55e647fae5c899f22699a6f432ae44e2c11146
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Tue Feb 6 19:32:51 2018 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sat Feb 24 19:33:42 2018 +0100
[ACPPAGE] Enable version lies until Win7 + some cleanup
---
dll/shellext/acppage/ACPPage.cpp | 57 +++++++++++++++++++++----------
dll/shellext/acppage/CLayerStringList.hpp | 2 +-
dll/shellext/acppage/CLayerUIPropPage.cpp | 4 +--
dll/shellext/acppage/CLayerUIPropPage.hpp | 2 +-
4 files changed, 42 insertions(+), 23 deletions(-)
diff --git a/dll/shellext/acppage/ACPPage.cpp b/dll/shellext/acppage/ACPPage.cpp
index 446d98d429..18d035fb9c 100644
--- a/dll/shellext/acppage/ACPPage.cpp
+++ b/dll/shellext/acppage/ACPPage.cpp
@@ -2,7 +2,7 @@
* PROJECT: ReactOS Compatibility Layer Shell Extension
* LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: acppage entrypoint
- * COPYRIGHT: Copyright 2015 Mark Jansen (mark.jansen(a)reactos.org)
+ * COPYRIGHT: Copyright 2015-2018 Mark Jansen (mark.jansen(a)reactos.org)
*/
#include "precomp.h"
@@ -15,10 +15,6 @@ LONG g_ModuleRefCnt = 0;
class CLayerUIPropPageModule : public CComModule
{
public:
- void Term()
- {
- CComModule::Term();
- }
};
BEGIN_OBJECT_MAP(ObjectMap)
@@ -37,6 +33,9 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID
lpReserved)
g_hModule = hInstance;
gModule.Init(ObjectMap, hInstance, NULL);
break;
+ case DLL_PROCESS_DETACH:
+ gModule.Term();
+ break;
}
return(TRUE);
@@ -62,10 +61,6 @@ STDAPI DllRegisterServer()
if (FAILED(hr))
return hr;
- hr = gModule.UpdateRegistryFromResource(IDR_ACPPAGE, TRUE, NULL);
- if (FAILED(hr))
- return hr;
-
return S_OK;
}
@@ -77,10 +72,6 @@ STDAPI DllUnregisterServer()
if (FAILED(hr))
return hr;
- hr = gModule.UpdateRegistryFromResource(IDR_ACPPAGE, FALSE, NULL);
- if (FAILED(hr))
- return hr;
-
return S_OK;
}
@@ -91,23 +82,53 @@ struct CCoInit
HRESULT hres;
};
+EXTERN_C
+inline ULONG
+Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...)
+{
+ char Buffer[512];
+ char* Current = Buffer;
+ size_t Length = _countof(Buffer);
+ const char* fname = strrchr(filename, '\\');
+ if (fname == NULL)
+ {
+ fname = strrchr(filename, '/');
+ if (fname != NULL)
+ fname++;
+ }
+ else
+ fname++;
+
+ if (fname == NULL)
+ fname = filename;
+
+ StringCchPrintfExA(Current, Length, &Current, &Length,
STRSAFE_NULL_ON_FAILURE, "%s:%d: ", fname, line);
+ va_list ArgList;
+ va_start(ArgList, lpFormat);
+ StringCchVPrintfExA(Current, Length, &Current, &Length,
STRSAFE_NULL_ON_FAILURE, lpFormat, ArgList);
+ va_end(ArgList);
+ OutputDebugStringA(Buffer);
+ return 0;
+}
+
+
EXTERN_C
BOOL WINAPI GetExeFromLnk(PCWSTR pszLnk, PWSTR pszExe, size_t cchSize)
{
CCoInit init;
- if (FAILED(init.hres))
+ if (FAILED_UNEXPECTEDLY(init.hres))
return FALSE;
CComPtr<IShellLinkW> spShellLink;
- if (FAILED(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IShellLinkW, &spShellLink))))
+ if (FAILED_UNEXPECTEDLY(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IShellLinkW, &spShellLink))))
return FALSE;
CComPtr<IPersistFile> spPersistFile;
- if (FAILED(spShellLink->QueryInterface(IID_PPV_ARG(IPersistFile,
&spPersistFile))))
+ if (FAILED_UNEXPECTEDLY(spShellLink->QueryInterface(IID_PPV_ARG(IPersistFile,
&spPersistFile))))
return FALSE;
- if (FAILED(spPersistFile->Load(pszLnk, STGM_READ)) ||
FAILED(spShellLink->Resolve(NULL, SLR_NO_UI | SLR_NOUPDATE | SLR_NOSEARCH)))
+ if (FAILED_UNEXPECTEDLY(spPersistFile->Load(pszLnk, STGM_READ)) ||
FAILED_UNEXPECTEDLY(spShellLink->Resolve(NULL, SLR_NO_UI | SLR_NOUPDATE |
SLR_NOSEARCH)))
return FALSE;
- return SUCCEEDED(spShellLink->GetPath(pszExe, cchSize, NULL, SLGP_RAWPATH));
+ return !FAILED_UNEXPECTEDLY(spShellLink->GetPath(pszExe, cchSize, NULL,
SLGP_RAWPATH));
}
diff --git a/dll/shellext/acppage/CLayerStringList.hpp
b/dll/shellext/acppage/CLayerStringList.hpp
index af8c04fe95..2a0f5bfcf1 100644
--- a/dll/shellext/acppage/CLayerStringList.hpp
+++ b/dll/shellext/acppage/CLayerStringList.hpp
@@ -2,7 +2,7 @@
* PROJECT: ReactOS Compatibility Layer Shell Extension
* LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: CLayerStringList implementation
- * COPYRIGHT: Copyright 2015-2017 Mark Jansen (mark.jansen(a)reactos.org)
+ * COPYRIGHT: Copyright 2015-2018 Mark Jansen (mark.jansen(a)reactos.org)
*/
#pragma once
diff --git a/dll/shellext/acppage/CLayerUIPropPage.cpp
b/dll/shellext/acppage/CLayerUIPropPage.cpp
index 812854e7f5..a60f03ef2f 100644
--- a/dll/shellext/acppage/CLayerUIPropPage.cpp
+++ b/dll/shellext/acppage/CLayerUIPropPage.cpp
@@ -2,7 +2,7 @@
* PROJECT: ReactOS Compatibility Layer Shell Extension
* LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: CLayerUIPropPage implementation
- * COPYRIGHT: Copyright 2015-2017 Mark Jansen (mark.jansen(a)reactos.org)
+ * COPYRIGHT: Copyright 2015-2018 Mark Jansen (mark.jansen(a)reactos.org)
*/
#include "precomp.h"
@@ -33,13 +33,11 @@ static struct {
{ L"Windows XP (SP2)", L"WINXPSP2" },
{ L"Windows XP (SP3)", L"WINXPSP3" },
{ L"Windows Server 2003 (SP1)", L"WINSRV03SP1" },
-#if 0
{ L"Windows Server 2008 (SP1)", L"WINSRV08SP1" },
{ L"Windows Vista", L"VISTARTM" },
{ L"Windows Vista (SP1)", L"VISTASP1" },
{ L"Windows Vista (SP2)", L"VISTASP2" },
{ L"Windows 7", L"WIN7RTM" },
-#endif
{ NULL, NULL }
};
diff --git a/dll/shellext/acppage/CLayerUIPropPage.hpp
b/dll/shellext/acppage/CLayerUIPropPage.hpp
index c65a914d86..e86e8eb42a 100644
--- a/dll/shellext/acppage/CLayerUIPropPage.hpp
+++ b/dll/shellext/acppage/CLayerUIPropPage.hpp
@@ -2,7 +2,7 @@
* PROJECT: ReactOS Compatibility Layer Shell Extension
* LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: CLayerUIPropPage definition
- * COPYRIGHT: Copyright 2015-2017 Mark Jansen (mark.jansen(a)reactos.org)
+ * COPYRIGHT: Copyright 2015-2018 Mark Jansen (mark.jansen(a)reactos.org)
*/
#pragma once