This changeset overhauls several UI infrastructure paths: it adds richer column drag/drop visuals, expands the search box with fuzzy matching and match-range APIs, and refactors theme handling (including Explorer-style palette support, buffered/non-client paint cleanup, and new theme file utilities). It also hardens core behavior with many reliability fixes, such as bounded HTTP download buffering, safer process/service enumeration and handle ownership updates, improved window/context lifecycle handling, DPI/layout fixes, and broader consistency updates across dialog/list-view drawing and helper APIs.
The provider thread state and run-id reads now use acquire semantics, while state writes use release semantics to prevent stale reads during start/stop/boost transitions. The defer-delete path also relies on the interlocked list push's ordering instead of an extra explicit barrier. This keeps the synchronization correct and avoids redundant memory-ordering operations.
Add SAL lock-state assumptions to queued lock acquire, try-acquire, and release fast paths in `queuedlock.h`. This teaches static analysis that the inline interlocked operations really acquire, hold, and release the lock, reducing false positives without changing runtime behavior.
Add a relocation-based skip index and span calculation to avoid per-byte callback checks when using `PhpImgCoherencySkip`, then compare eligible ranges with AVX-512/AVX2/SSE (falling back to scalar). The inspect loop now preserves existing skip and fault semantics by retrying faulting vector blocks byte-by-byte, and the new relocation index storage is initialized and freed with the coherency context.
This change updates phlib with broader native API compatibility shims, new CRC32/CRC32C tables, and safer utility helpers. It also fixes a number of synchronization, formatting, environment, and process-creation edge cases, adds correlation-vector support, hardens SID conversion and image-resource loading, and cleans up several Windows compatibility fixes across the library.
Switch the settings hashtable to store `PPH_SETTING` entries instead of inline `PH_SETTING` values so cached setting pointers remain valid when the table grows. Updated hash/equality, lookup, and enumeration paths to dereference pointer entries consistently via a small helper.
`PhAddSetting` now heap-allocates each setting for process-lifetime storage and cleans up on duplicate insertion failure to avoid leaks.
Store the performance-counter span between provider runs and expose helpers to read it in raw ticks or milliseconds. This lets callers calculate rates from the real elapsed time instead of the nominal interval, which improves accuracy when providers are boosted, delayed, or paused.
Improve phlib utility correctness and API contracts across GUI, memory, math, and SIMD support. This updates `PhSendMessageTimeout` to return `NTSTATUS`, fixes pointer subtraction and tick/time macros, adds null guards around image list helpers, and corrects a debug rectangle comparison.
The change also expands public helper coverage with heap, image-directory, 128-bit math, delta-clamping, and SIMD utility declarations, while adding SAL/NTAPI annotations so callers get clearer success/failure and nullability guarantees.
Clean up the `ENSURE_BUFFER`, `OK_BUFFER`, and `ADVANCE_BUFFER` helper macros in `phlib/format.c` after using `format_i.h`. This prevents macro leakage and avoids accidental redefinition or reuse outside the intended formatting code paths.
Extend the extended list-view custom draw path with a subitem draw callback. The control now stores a `PPH_EXTLV_DRAW_SUBITEM` handler, opts into `CDRF_NOTIFYSUBITEMDRAW` when present, and skips default rendering when the callback handles a subitem. A new `ELVM_SETSUBITEMDRAWFUNCTION` message wires the callback into the control.
Reworked `phlib/directdraw.cpp` to use DIB-based rendering paths and remove unnecessary screen-DC dependencies in bitmap/icon and snapshot code. Window selection logic now skips cloaked windows, improves snapshot hit-testing by enumerating visible top-level/child windows, and tightens window class registration/creation handling (including proper instance/cbSize setup and atom checks). This also adds a new layered popup shadow system (`PhCreate/Update/DestroyWindowShadow` and affinity support) that draws DPI-scaled rounded soft shadows for popup menus on modern Windows where system drop shadows are no longer reliably applied.
Introduce `PhAllocateHeap` and `PhReAllocateExSafe` in `phlib/basesup.c` to provide heap allocation paths with explicit `NTSTATUS` handling and zero-initialization support. The debug-heap path now also honors `HEAP_ZERO_MEMORY`, keeping allocation behavior consistent between debug and normal builds.
Extend phnative with new native APIs for security descriptor and processor statistics handling. This adds self-relative SD conversion helpers and introduces per-processor information queries plus utility/performance delta/statistics calculations (including multi-group support and Windows-version-aware distribution parsing).
Move CLR metadata schema and P/Invoke flag definitions into the public header, add helpers for resolving table names, strings, blobs, GUIDs, tokens, attributes, assembly metadata, and P/Invoke maps, and introduce standalone Portable PDB parsing and source lookup support.
Switch service buffer allocations in `phlib/svcsup.c` to `PhAllocateSafe`/`PhAllocateZeroSafe` with explicit `STATUS_NO_MEMORY` handling to avoid exception-based failures. Add `PhGetServiceGroupOrderIndex` to resolve a service’s load-order group index from `HKLM\...\ServiceGroupOrder\List` with proper REG_MULTI_SZ validation. Also update `PhWaitForServiceStatus` to use `PhQueryWaitTime`, compute a fixed deadline, and compare wait hints in consistent timeout units.
Add a SIMD-aware `PhpPrintableAsciiBlock` helper (AVX2 and 128-bit intrinsics) to quickly recognize full printable ASCII chunks, including TAB/LF/CR. Wire it into both UTF-8 and generic string search loops to skip per-byte decoding/classification when safe, while preserving scalar handling at boundaries and transitions.
Expose provider selection and capability queries in phcrypt, including BCrypt ML-DSA detection, incremental hash entry points, and fixed ML-DSA size constants. The update also tightens SymCrypt wrappers with stricter parameter and buffer validation, safer constant-time padding handling, and broader API documentation for the expanded crypto surface.
Correct the AVX-512 implementations in `phlib/basesup.c` by restoring the proper types, intrinsics, and comments for the float-to-ulong and ulong-to-float copy helpers. This fixes the two fast paths being accidentally swapped while keeping the scalar conversion semantics intact.
Harden the low-level time/query helpers by using ordered shared-data reads, adding unbiased interrupt time support, and introducing a more precise QPC fast path for x64/ARM64. The update also raises queued work item priority, adds missing bitmap utility routines, and improves several hot memory/entropy paths with AVX-512 and histogram optimizations.
Expand SIMD acceleration across phlib base64 and string utilities: unify encode shuffles through PH_INT128 wrappers, add AVX2/SSSE3 fast decode for base64, and introduce AVX-512/AVX2/SSSE3 tiers for string length/compare/search, hashing, hex encode/decode, and integer parsing hot paths. The changes preserve scalar fallbacks and exact behavior (including padding/whitespace and invalid-input handling) while reducing per-character loops. This also adds a PH_NATIVE_NAME_WILDCARDS switch with RTL fallback and tightens PhConvertUtf16ToAsciiEx replacement semantics (ANSI_NULL to drop non-ASCII).