Author: mjmartin Date: Mon Dec 7 04:34:25 2009 New Revision: 44450
URL: http://svn.reactos.org/svn/reactos?rev=44450&view=rev Log: [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.
Modified: trunk/reactos/dll/ntdll/ldr/actctx.c trunk/reactos/dll/ntdll/ldr/utils.c trunk/reactos/dll/win32/kernel32/thread/thread.c
Modified: trunk/reactos/dll/ntdll/ldr/actctx.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/actctx.c?rev=... ============================================================================== --- trunk/reactos/dll/ntdll/ldr/actctx.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/actctx.c [iso-8859-1] Mon Dec 7 04:34:25 2009 @@ -66,8 +66,8 @@ 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;
Modified: trunk/reactos/dll/ntdll/ldr/utils.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/utils.c?rev=4... ============================================================================== --- trunk/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] Mon Dec 7 04:34:25 2009 @@ -838,7 +838,7 @@ { 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 @@ 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)))
Modified: trunk/reactos/dll/win32/kernel32/thread/thread.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/thread/t... ============================================================================== --- trunk/reactos/dll/win32/kernel32/thread/thread.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/thread/thread.c [iso-8859-1] Mon Dec 7 04:34:25 2009 @@ -17,6 +17,7 @@
/* FIXME: NDK */ #define HIGH_PRIORITY 31 +#define SXS_SUPPORT_FIXME
/* FUNCTIONS *****************************************************************/ static @@ -164,8 +165,10 @@ 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 @@
/* Save it */ Teb->ActivationContextStackPointer = ActivationContextStack; - +#ifndef SXS_SUPPORT_FIXME /* Query the Context */ Status = RtlQueryInformationActivationContext(1, 0, @@ -210,6 +213,7 @@ } else DPRINT1("RtlQueryInformationActivationContext failed %x\n", Status); +#endif } else DPRINT1("RtlAllocateActivationContextStack failed %x\n", Status);