PINT_CALLBACK_HEADER Mem;
PTHREADINFO W32Thread;
+ W32Thread = PsGetCurrentThreadWin32Thread();
+ ASSERT(W32Thread);
+
+ if (W32Thread->TIF_flags & TIF_INCLEANUP)
+ {
+ ERR("CbFM Thread is already in cleanup\n");
+ return;
+ }
+
ASSERT(Data);
Mem = ((PINT_CALLBACK_HEADER)Data - 1);
- W32Thread = PsGetCurrentThreadWin32Thread();
- ASSERT(W32Thread);
-
/* Remove the memory block from the thread's callback list */
RemoveEntryList(&Mem->ListEntry);
&ResultLength);
if (!NT_SUCCESS(Status))
{
+ ERR("Error Callback to User space Status %lx\n",Status);
UserEnterCo();
- return -1;
+ return 0;
}
_SEH2_TRY
}
HMENU APIENTRY
-co_IntLoadSysMenuTemplate()
+co_IntLoadSysMenuTemplate(VOID)
{
LRESULT Result = 0;
NTSTATUS Status;
Common->offPfn = offPfn;
Common->Ansi = Ansi;
RtlZeroMemory(&Common->ModuleName, sizeof(Common->ModuleName));
- RtlCopyMemory(&Common->ModuleName, ModuleName->Buffer, ModuleName->Length);
+ if (ModuleName->Buffer && ModuleName->Length)
+ {
+ RtlCopyMemory(&Common->ModuleName, ModuleName->Buffer, ModuleName->Length);
+ // If ModuleName->Buffer NULL while in destroy,
+ // this will make User32:Hook.c complain about not loading the library module.
+ // Fix symptom for CORE-10549.
+ }
Extra = (PCHAR) Common + sizeof(HOOKPROC_CALLBACK_ARGUMENTS);
switch(HookId)
if (!NT_SUCCESS(Status))
{
- ERR("Failure to make Callback! Status 0x%x",Status);
+ ERR("Failure to make Callback! Status 0x%x\n",Status);
goto Fault_Exit;
}