/* GLOBALS *******************************************************************/
LIST_ENTRY LdrpUnloadHead;
-LONG LdrpLoaderLockAcquisitonCount;
+LONG LdrpLoaderLockAcquisitionCount;
BOOLEAN LdrpShowRecursiveLoads, LdrpBreakOnRecursiveDllLoads;
UNICODE_STRING LdrApiDefaultExtension = RTL_CONSTANT_STRING(L".DLL");
ULONG AlternateResourceModuleCount;
+extern PLDR_MANIFEST_PROBER_ROUTINE LdrpManifestProberRoutine;
/* FUNCTIONS *****************************************************************/
VOID
NTAPI
-LdrSetDllManifestProber(IN PVOID ProberFunction)
+LdrSetDllManifestProber(
+ _In_ PLDR_MANIFEST_PROBER_ROUTINE Routine)
{
- UNIMPLEMENTED;
+ LdrpManifestProberRoutine = Routine;
}
BOOLEAN
{
/* Generate a cookie */
return (((ULONG_PTR)NtCurrentTeb()->RealClientId.UniqueThread & 0xFFF) << 16) |
- (_InterlockedIncrement(&LdrpLoaderLockAcquisitonCount) & 0xFFFF);
+ (_InterlockedIncrement(&LdrpLoaderLockAcquisitionCount) & 0xFFFF);
}
/*
return STATUS_INVALID_PARAMETER_3;
}
- /* Do or Do Not. There is no Try */
- ASSERT((Disposition != NULL) || !(Flags & LDR_LOCK_LOADER_LOCK_FLAG_TRY_ONLY));
-
/* If the flag is set, make sure we have a valid pointer to use */
if ((Flags & LDR_LOCK_LOADER_LOCK_FLAG_TRY_ONLY) && !(Disposition))
{
UNICODE_STRING DllString1, DllString2;
BOOLEAN RedirectedDll = FALSE;
NTSTATUS Status;
- ULONG Cookie;
+ ULONG_PTR Cookie;
PUNICODE_STRING OldTldDll;
PTEB Teb = NtCurrentTeb();
while (NextEntry != ListHead)
{
/* Get the entry and NT Headers */
- LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList);
+ LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks);
NtHeader = RtlImageNtHeader(LdrEntry->DllBase);
if (NtHeader)
{
}
else if (Status != STATUS_SXS_KEY_NOT_FOUND)
{
- /* Unrecoverable SxS failure; */
+ /* Unrecoverable SxS failure */
goto Quickie;
}
else
while (InitEntry != InitListHead)
{
- InitModule = CONTAINING_RECORD(InitEntry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList);
+ InitModule = CONTAINING_RECORD(InitEntry, LDR_DATA_TABLE_ENTRY, InInitializationOrderLinks);
/* Increase the index */
ModulePtr->InitOrderIndex++;
PLIST_ENTRY ListHead, ListEntry;
PLDR_DATA_TABLE_ENTRY LdrEntry;
NTSTATUS Status;
- ULONG Cookie;
+ ULONG_PTR Cookie;
BOOLEAN Stop = FALSE;
/* Check parameters */
{
PLDR_DATA_TABLE_ENTRY LdrEntry;
NTSTATUS Status = STATUS_SUCCESS;
- ULONG Cookie;
+ ULONG_PTR Cookie;
BOOLEAN Locked = FALSE;
/* Check for invalid flags */
/* Get the entry */
LdrEntry = CONTAINING_RECORD(NextEntry,
LDR_DATA_TABLE_ENTRY,
- InInitializationOrderModuleList);
+ InInitializationOrderLinks);
NextEntry = NextEntry->Blink;
/* Remove flag */
LdrEntry->EntryPoint);
}
- /* FIXME: Call Shim Engine and notify */
+ /* Call Shim Engine and notify */
+ if (g_ShimsEnabled)
+ {
+ VOID (NTAPI* SE_DllUnloaded)(PVOID) = RtlDecodeSystemPointer(g_pfnSE_DllUnloaded);
+ SE_DllUnloaded(LdrEntry);
+ }
/* Unlink it */
CurrentEntry = LdrEntry;
- RemoveEntryList(&CurrentEntry->InInitializationOrderModuleList);
- RemoveEntryList(&CurrentEntry->InMemoryOrderModuleList);
+ RemoveEntryList(&CurrentEntry->InInitializationOrderLinks);
+ RemoveEntryList(&CurrentEntry->InMemoryOrderLinks);
RemoveEntryList(&CurrentEntry->HashLinks);
/* If there's more then one active unload */
{
/* Flush the cached DLL handle and clear the list */
LdrpLoadedDllHandleCache = NULL;
- CurrentEntry->InMemoryOrderModuleList.Flink = NULL;
+ CurrentEntry->InMemoryOrderLinks.Flink = NULL;
}
/* Add the entry on the unload list */
/* Set the entry and clear it from the list */
CurrentEntry = LdrEntry;
LdrpLoadedDllHandleCache = NULL;
- CurrentEntry->InMemoryOrderModuleList.Flink = NULL;
+ CurrentEntry->InMemoryOrderLinks.Flink = NULL;
/* Move it from the global to the local list */
RemoveEntryList(&CurrentEntry->HashLinks);