[NTDLL] Use the embedded manifest from the process to check compatibility. 1871/head
authorMark Jansen <mark.jansen@reactos.org>
Sun, 23 Dec 2018 17:36:59 +0000 (18:36 +0100)
committerMark Jansen <mark.jansen@reactos.org>
Wed, 21 Aug 2019 16:57:52 +0000 (18:57 +0200)
dll/ntdll/ldr/ldrinit.c
sdk/lib/rtl/actctx.c
sdk/lib/rtl/rtlp.h

index c23783a..37e731c 100644 (file)
@@ -93,7 +93,7 @@ ULONG RtlpDisableHeapLookaside; // TODO: Move to heap.c
 ULONG RtlpShutdownProcessFlags; // TODO: Use it
 
 NTSTATUS LdrPerformRelocations(PIMAGE_NT_HEADERS NTHeaders, PVOID ImageBase);
-void actctx_init(void);
+void actctx_init(PVOID* pOldShimData);
 extern BOOLEAN RtlpUse16ByteSLists;
 
 #ifdef _WIN64
@@ -1539,7 +1539,7 @@ LdrpValidateImageForMp(IN PLDR_DATA_TABLE_ENTRY LdrDataTableEntry)
 
 VOID
 NTAPI
-LdrpInitializeProcessCompat(PVOID* pOldShimData)
+LdrpInitializeProcessCompat(PVOID pProcessActctx, PVOID* pOldShimData)
 {
     static const struct
     {
@@ -1584,7 +1584,7 @@ LdrpInitializeProcessCompat(PVOID* pOldShimData)
 
     SizeRequired = sizeof(Buffer);
     Status = RtlQueryInformationActivationContext(RTL_QUERY_ACTIVATION_CONTEXT_FLAG_NO_ADDREF,
-                                                  NULL,
+                                                  pProcessActctx,
                                                   NULL,
                                                   CompatibilityInformationInActivationContext,
                                                   Buffer,
@@ -2187,10 +2187,7 @@ LdrpInitializeProcess(IN PCONTEXT Context,
                    &LdrpNtDllDataTableEntry->InInitializationOrderLinks);
 
     /* Initialize Wine's active context implementation for the current process */
-    actctx_init();
-
-    /* ReactOS specific */
-    LdrpInitializeProcessCompat(&OldShimData);
+    actctx_init(&OldShimData);
 
     /* Set the current directory */
     Status = RtlSetCurrentDirectory_U(&CurrentDirectory);
index 62a6af8..e51e7c4 100644 (file)
@@ -5000,7 +5000,7 @@ static NTSTATUS find_guid(ACTIVATION_CONTEXT* actctx, ULONG section_kind,
 }
 
 /* initialize the activation context for the current process */
-void actctx_init(void)
+void actctx_init(PVOID* pOldShimData)
 {
     ACTCTXW ctx;
     HANDLE handle;
@@ -5018,6 +5018,11 @@ void actctx_init(void)
         process_actctx = check_actctx(handle);
     }
 
+    /* ReactOS specific:
+       Now that we have found the process_actctx we can initialize the process compat subsystem */
+    LdrpInitializeProcessCompat(process_actctx, pOldShimData);
+
+
     ctx.dwFlags  = 0;
     ctx.hModule  = NULL;
     ctx.lpResourceName = NULL;
index 1d13f7a..c1cc8dc 100644 (file)
@@ -243,4 +243,10 @@ WCHAR
 NTAPI
 RtlpDowncaseUnicodeChar(IN WCHAR Source);
 
+/* ReactOS only */
+VOID
+NTAPI
+LdrpInitializeProcessCompat(PVOID pProcessActctx, PVOID* pOldShimData);
+
+
 /* EOF */