https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ab240d1b6d7ccaf1ed60f…
commit ab240d1b6d7ccaf1ed60f93a314be9f7d4e742c0
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Wed Apr 11 00:18:17 2018 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Thu Apr 12 18:49:25 2018 +0200
[NTDLL] Allow shimdata to override the process manifest.
---
dll/ntdll/ldr/ldrinit.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/dll/ntdll/ldr/ldrinit.c b/dll/ntdll/ldr/ldrinit.c
index b35321e8c6..5162f1afed 100644
--- a/dll/ntdll/ldr/ldrinit.c
+++ b/dll/ntdll/ldr/ldrinit.c
@@ -1470,9 +1470,25 @@ LdrpInitializeProcessCompat(PVOID* pOldShimData)
SIZE_T SizeRequired;
NTSTATUS Status;
DWORD n, cur;
+ ReactOS_ShimData* pShimData = *pOldShimData;
C_ASSERT(RTL_NUMBER_OF(GuidOrder) == RTL_NUMBER_OF(GuidVersions));
+ if (pShimData)
+ {
+ if (pShimData->dwMagic != REACTOS_SHIMDATA_MAGIC ||
+ pShimData->dwSize != sizeof(ReactOS_ShimData))
+ {
+ DPRINT1("LdrpInitializeProcessCompat: Corrupt pShimData (0x%x,
%u)\n", pShimData->dwMagic, pShimData->dwSize);
+ return;
+ }
+ if (pShimData->dwRosProcessCompatVersion)
+ {
+ DPRINT1("LdrpInitializeProcessCompat: ProcessCompatVersion already set
to 0x%x\n", pShimData->dwRosProcessCompatVersion);
+ return;
+ }
+ }
+
SizeRequired = sizeof(Buffer);
Status =
RtlQueryInformationActivationContext(RTL_QUERY_ACTIVATION_CONTEXT_FLAG_NO_ADDREF,
NULL,
@@ -1501,8 +1517,6 @@ LdrpInitializeProcessCompat(PVOID* pOldShimData)
if (ContextCompatInfo->Elements[n].Type ==
ACTCX_COMPATIBILITY_ELEMENT_TYPE_OS &&
RtlCompareMemory(&ContextCompatInfo->Elements[n].Id,
GuidOrder[cur], sizeof(GUID)) == sizeof(GUID))
{
- ReactOS_ShimData* pShimData = *pOldShimData;
-
/* If this process did not need shim data before, allocate and store it
*/
if (pShimData == NULL)
{