[NTDLL] Use the embedded manifest from the process to check compatibility.

This commit is contained in:
Mark Jansen 2018-12-23 18:36:59 +01:00
parent cbf47846e7
commit 029b8f2cf9
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
3 changed files with 16 additions and 8 deletions

View file

@ -93,7 +93,7 @@ ULONG RtlpDisableHeapLookaside; // TODO: Move to heap.c
ULONG RtlpShutdownProcessFlags; // TODO: Use it ULONG RtlpShutdownProcessFlags; // TODO: Use it
NTSTATUS LdrPerformRelocations(PIMAGE_NT_HEADERS NTHeaders, PVOID ImageBase); NTSTATUS LdrPerformRelocations(PIMAGE_NT_HEADERS NTHeaders, PVOID ImageBase);
void actctx_init(void); void actctx_init(PVOID* pOldShimData);
extern BOOLEAN RtlpUse16ByteSLists; extern BOOLEAN RtlpUse16ByteSLists;
#ifdef _WIN64 #ifdef _WIN64
@ -1539,7 +1539,7 @@ LdrpValidateImageForMp(IN PLDR_DATA_TABLE_ENTRY LdrDataTableEntry)
VOID VOID
NTAPI NTAPI
LdrpInitializeProcessCompat(PVOID* pOldShimData) LdrpInitializeProcessCompat(PVOID pProcessActctx, PVOID* pOldShimData)
{ {
static const struct static const struct
{ {
@ -1584,7 +1584,7 @@ LdrpInitializeProcessCompat(PVOID* pOldShimData)
SizeRequired = sizeof(Buffer); SizeRequired = sizeof(Buffer);
Status = RtlQueryInformationActivationContext(RTL_QUERY_ACTIVATION_CONTEXT_FLAG_NO_ADDREF, Status = RtlQueryInformationActivationContext(RTL_QUERY_ACTIVATION_CONTEXT_FLAG_NO_ADDREF,
NULL, pProcessActctx,
NULL, NULL,
CompatibilityInformationInActivationContext, CompatibilityInformationInActivationContext,
Buffer, Buffer,
@ -2187,10 +2187,7 @@ LdrpInitializeProcess(IN PCONTEXT Context,
&LdrpNtDllDataTableEntry->InInitializationOrderLinks); &LdrpNtDllDataTableEntry->InInitializationOrderLinks);
/* Initialize Wine's active context implementation for the current process */ /* Initialize Wine's active context implementation for the current process */
actctx_init(); actctx_init(&OldShimData);
/* ReactOS specific */
LdrpInitializeProcessCompat(&OldShimData);
/* Set the current directory */ /* Set the current directory */
Status = RtlSetCurrentDirectory_U(&CurrentDirectory); Status = RtlSetCurrentDirectory_U(&CurrentDirectory);

View file

@ -5000,7 +5000,7 @@ static NTSTATUS find_guid(ACTIVATION_CONTEXT* actctx, ULONG section_kind,
} }
/* initialize the activation context for the current process */ /* initialize the activation context for the current process */
void actctx_init(void) void actctx_init(PVOID* pOldShimData)
{ {
ACTCTXW ctx; ACTCTXW ctx;
HANDLE handle; HANDLE handle;
@ -5018,6 +5018,11 @@ void actctx_init(void)
process_actctx = check_actctx(handle); 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.dwFlags = 0;
ctx.hModule = NULL; ctx.hModule = NULL;
ctx.lpResourceName = NULL; ctx.lpResourceName = NULL;

View file

@ -243,4 +243,10 @@ WCHAR
NTAPI NTAPI
RtlpDowncaseUnicodeChar(IN WCHAR Source); RtlpDowncaseUnicodeChar(IN WCHAR Source);
/* ReactOS only */
VOID
NTAPI
LdrpInitializeProcessCompat(PVOID pProcessActctx, PVOID* pOldShimData);
/* EOF */ /* EOF */