mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 23:45:42 +00:00
[LDR] Check forwarded imports against the manifest before trying to load them
CORE-15729
This commit is contained in:
parent
d9c4d28e59
commit
27cc4c6a08
1 changed files with 34 additions and 3 deletions
|
@ -1133,13 +1133,44 @@ FailurePath:
|
||||||
/* Make sure the conversion was OK */
|
/* Make sure the conversion was OK */
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* Load the forwarder, free the temp string */
|
WCHAR StringBuffer[MAX_PATH];
|
||||||
Status = LdrpLoadDll(FALSE,
|
UNICODE_STRING StaticString, *RedirectedImportName;
|
||||||
|
BOOLEAN Redirected = FALSE;
|
||||||
|
|
||||||
|
RtlInitEmptyUnicodeString(&StaticString, StringBuffer, sizeof(StringBuffer));
|
||||||
|
|
||||||
|
/* Check if the SxS Assemblies specify another file */
|
||||||
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
|
&TempUString,
|
||||||
|
&LdrApiDefaultExtension,
|
||||||
|
&StaticString,
|
||||||
|
NULL,
|
||||||
|
&RedirectedImportName,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
if (ShowSnaps)
|
||||||
|
{
|
||||||
|
DPRINT1("LDR: %Z got redirected to %wZ\n", &ForwarderName, RedirectedImportName);
|
||||||
|
}
|
||||||
|
/* Let Ldrp know */
|
||||||
|
Redirected = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RedirectedImportName = &TempUString;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Load the forwarder */
|
||||||
|
Status = LdrpLoadDll(Redirected,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&TempUString,
|
RedirectedImportName,
|
||||||
&ForwarderHandle,
|
&ForwarderHandle,
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
RtlFreeUnicodeString(&TempUString);
|
RtlFreeUnicodeString(&TempUString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue