[NTUSER] Estabilish power callouts and invoke the cleanup procedure when unloading Win32k

This commit is contained in:
George Bișoc 2024-06-30 20:56:29 +02:00
parent 181b666fc4
commit 4093d0e164
No known key found for this signature in database
GPG key ID: 688C4FBE25D7DEF6
2 changed files with 11 additions and 3 deletions

View file

@ -917,6 +917,7 @@ DriverUnload(IN PDRIVER_OBJECT DriverObject)
FreeFontSupport();
ResetCsrApiPort();
ResetCsrProcess();
IntWin32PowerManagementCleanup();
}
// Return on failure
@ -984,8 +985,8 @@ DriverEntry(
CalloutData.ProcessCallout = Win32kProcessCallback;
CalloutData.ThreadCallout = Win32kThreadCallback;
// CalloutData.GlobalAtomTableCallout = NULL;
// CalloutData.PowerEventCallout = NULL;
// CalloutData.PowerStateCallout = NULL;
CalloutData.PowerEventCallout = IntHandlePowerEvent;
CalloutData.PowerStateCallout = IntHandlePowerState;
// CalloutData.JobCallout = NULL;
CalloutData.BatchFlushRoutine = NtGdiFlushUserBatch;
CalloutData.DesktopOpenProcedure = IntDesktopObjectOpen;

View file

@ -195,7 +195,14 @@ NtUserInitialize(
/* Save the EPROCESS of CSRSS */
InitCsrProcess(/*PsGetCurrentProcess()*/);
// Initialize Power Request List (use hPowerRequestEvent).
/* Initialize Power Request List */
Status = IntInitWin32PowerManagement(hPowerRequestEvent);
if (!NT_SUCCESS(Status))
{
UserLeave();
return Status;
}
// Initialize Media Change (use hMediaRequestEvent).
/* Initialize various GDI stuff (DirectX, fonts, language ID etc.) */