Remove volatile qualifiers per project rules and use explicit acquire/release accessors for cross-thread reads and writes of the cancel flag, progress counters, result count, window handle and close-dialog flag. This follows the project convention of not using volatile in definitions.
Reuse ProcessItem->QueryHandle instead of opening and closing a separate process handle, so the dialog no longer owns the handle.
Fix context teardown ordering: unregister the symbol callback and remove the window context before the final dereference, which may free the context. Use acquire/release accesses for the Destroying flag.
Finalize all statements and close the database so the informer DB is treated as unavailable instead of running partially initialized.
Add sqlite3_finalize/sqlite3_close dynamic imports and PhpInformerCloseDatabase. Rename the misspelled PhpInfomerLoadSQLite to PhpInformerLoadSQLite.
Also remove the extra ProcessStartKey added in PhInformerGetProcessStartKeys for handle messages.
Include <ntxcapi.h> at the start of the non-kernel header block instead of at the end, so the ASSERT declarations are available to the headers that follow it.
Skip ACEs for inactive logon sessions when updating desktop and window station DACLs, using LsaEnumerateLogonSessions. Grant access to the logon SID instead of the user SID, and treat GENERIC_ALL as already granted for window stations.
PhRunAsExecutionAlias now returns STATUS_NOT_IMPLEMENTED for aliases and STATUS_NOT_FOUND otherwise, so aliases are rejected instead of falling through. Always request PROCESS_QUERY_LIMITED_INFORMATION when opening the parent process.
Replace manual command line splitting and quoting in the run-as-interactive-user and TrustedInstaller paths with PhParseCommandLineFuzzy and PhQuoteCommandLine.