[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:
Michael Martin
2009-12-07 03:34:25 +00:00
parent a80552f8a9
commit 4ed40feb22
3 changed files with 14 additions and 4 deletions
+2 -2
View File
@@ -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;
+7 -1
View File
@@ -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)))
+5 -1
View File
@@ -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);