mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 04:13:35 +00:00
[dll/ntdll]
- LdrLoadDll: Create a module activation context for modules when loaded by LoadLibrary and friends. Fixes loading assemblies of modules when loaded from threads. - find_actctx_dll: Silence debugging. [dll/kernel32] - CreateRemoteThread: Do not try to activate the processes default activation context, as the processes default activation context is not created properly yet. Will be fixed in near future. Several application broken by recent SXS commit are now back to working, including Media Player Class 6.4.9 and Opera 9.64. OO 3.0 install no longer errors on loading ms runtime. svn path=/trunk/; revision=44450
This commit is contained in:
@@ -66,8 +66,8 @@ NTSTATUS find_actctx_dll( LPCWSTR libname, WCHAR *fullname )
|
||||
size = needed;
|
||||
}
|
||||
|
||||
DPRINT1("manafestpath === %S\n", info->lpAssemblyManifestPath);
|
||||
DPRINT1("DirectoryName === %S\n", info->lpAssemblyDirectoryName);
|
||||
DPRINT("manafestpath === %S\n", info->lpAssemblyManifestPath);
|
||||
DPRINT("DirectoryName === %S\n", info->lpAssemblyDirectoryName);
|
||||
if (!info->lpAssemblyManifestPath || !info->lpAssemblyDirectoryName)
|
||||
{
|
||||
status = STATUS_SXS_KEY_NOT_FOUND;
|
||||
|
||||
@@ -838,7 +838,7 @@ LdrLoadDll (IN PWSTR SearchPath OPTIONAL,
|
||||
{
|
||||
NTSTATUS Status;
|
||||
PLDR_DATA_TABLE_ENTRY Module;
|
||||
|
||||
ULONG_PTR cookie;
|
||||
PPEB Peb = NtCurrentPeb();
|
||||
|
||||
TRACE_LDR("LdrLoadDll, loading %wZ%s%S\n",
|
||||
@@ -851,12 +851,18 @@ LdrLoadDll (IN PWSTR SearchPath OPTIONAL,
|
||||
if (NT_SUCCESS(Status) &&
|
||||
(!LoadFlags || 0 == (*LoadFlags & LOAD_LIBRARY_AS_DATAFILE)))
|
||||
{
|
||||
if (!create_module_activation_context( Module ))
|
||||
{
|
||||
RtlActivateActivationContext(0, Module->EntryPointActivationContext, &cookie);
|
||||
}
|
||||
|
||||
if (!(Module->Flags & LDRP_PROCESS_ATTACH_CALLED))
|
||||
{
|
||||
RtlEnterCriticalSection(Peb->LoaderLock);
|
||||
Status = LdrpAttachProcess();
|
||||
RtlLeaveCriticalSection(Peb->LoaderLock);
|
||||
}
|
||||
if (Module->EntryPointActivationContext) RtlDeactivateActivationContext(0, cookie);
|
||||
}
|
||||
|
||||
if ((!Module) && (NT_SUCCESS(Status)))
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
/* FIXME: NDK */
|
||||
#define HIGH_PRIORITY 31
|
||||
#define SXS_SUPPORT_FIXME
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
static
|
||||
@@ -164,8 +165,10 @@ CreateRemoteThread(HANDLE hProcess,
|
||||
PTEB Teb;
|
||||
PVOID ActivationContextStack;
|
||||
THREAD_BASIC_INFORMATION ThreadBasicInfo;
|
||||
#ifndef SXS_SUPPORT_FIXME
|
||||
ACTIVATION_CONTEXT_BASIC_INFORMATION ActivationCtxInfo;
|
||||
ULONG_PTR Cookie;
|
||||
#endif
|
||||
ULONG retLen;
|
||||
|
||||
/* Get the TEB */
|
||||
@@ -186,7 +189,7 @@ CreateRemoteThread(HANDLE hProcess,
|
||||
|
||||
/* Save it */
|
||||
Teb->ActivationContextStackPointer = ActivationContextStack;
|
||||
|
||||
#ifndef SXS_SUPPORT_FIXME
|
||||
/* Query the Context */
|
||||
Status = RtlQueryInformationActivationContext(1,
|
||||
0,
|
||||
@@ -210,6 +213,7 @@ CreateRemoteThread(HANDLE hProcess,
|
||||
}
|
||||
else
|
||||
DPRINT1("RtlQueryInformationActivationContext failed %x\n", Status);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
DPRINT1("RtlAllocateActivationContextStack failed %x\n", Status);
|
||||
|
||||
Reference in New Issue
Block a user