Use a masked comparison ((format->Type & FormatTypeMask) == MultiByteStringFormatType) so the Type field is matched correctly when it contains flags. Tighten the size-unit loop condition by requiring i+1 < sizeof(PhSizeUnitNamesCounted)/sizeof(PH_STRINGREF) to avoid out-of-bounds access when the code references the next unit.
Use ReadULongPtrAcquire to read Condition->Value into a local variable before checking the PH_QUEUED_LOCK_WAITERS flag and passing the value to PhpfWakeQueuedLockEx. This prevents re-reading races and ensures proper acquire memory ordering in PhfPulseCondition and PhfPulseAllCondition while preserving existing wake semantics.
Add optional TotalLength to PhHttpReadDataToBuffer to allow pre-allocation when the total size is known; otherwise fall back to page-sized allocation and ensure reallocation grows enough for incoming chunks. Update callers to pass 0 when unknown. Change PhHttpDownloadToFile to tolerate missing Content-Length (common with chunked transfers): query Content-Length optionally, avoid failing if absent, only set file size hint and compute percent/progress when a total is available, and only validate final size when total was provided. Replace several WinHttp option queries to use the request handle instead of the session handle (certificate, request times, connection stats, extended error), switch PhHttpQueryStatusCode to use WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, and add a null-check in the WinHTTP status callback to avoid dereferencing a null context. Small cleanups: ensure allocation/resizing logic always meets needed capacity.
Replace direct load of FastLock->Value with ReadULongAcquire(&FastLock->Value) to enforce acquire memory ordering before the CAS in the fast-lock acquisition loop. This ensures proper ordering and visibility when acquiring the exclusive fast lock.
Fixes HScrollVisible when computing HScrollHeight; correctly handle fixed column indexing when copying columns (return fixed column for index 0 and adjust lookup); fix centered text rectangle calculation to use TextRect.left + width; and adjust PhTnpEnsureVisibleNode call to pass the focused node index (remove off-by-one). These changes correct visual/layout issues and off-by-one errors when interacting with columns and node focus.
Use the correct variables parentNameFilePart to PhCompareStringRef instead of apiSetNameShort to compare the intended name parts, and pass &context to PhEnumWindows in PhEndWindowSession instead of &clientId so the window enumeration callback receives the proper context. These changes correct mismatched argument usage and ensure callbacks and comparisons operate on the right data.
Introduce scroll-anchoring support to the treenew control: add explanatory comments and anchoring behavior. Define anchor-related macros and declare helper APIs (PhTnpGetMaxVScrollPosition, PhTnpFindFlatListNode, PhTnpPrepareVScrollAnchor, PhTnpGetAnchoredVScrollPosition) used to snapshot/restore viewport during structural updates to avoid visible jumps.
Add routines to download GitHub IP ranges and Azure service tags and return address prefixes Bump HTTP version to 3.0 for a release request, tidy MSIX packaging steps, and update author year.
The queue lock already provides synchronization, so using the NoFence variants removes redundant memory fences and reduces overhead without changing semantics.
Replace __analysis_assume_lock_acquired annotations with the standardized _Analysis_assume_lock_acquired_ calls and add explicit braces around case branches. The annotations are inserted before releasing/acquiring queued locks, critical sections and fast locks to aid static analysis; wrapping the case bodies in scopes prevents scoping issues and potential warnings. No functional behavior changes intended.
PhDbgObjectListLock (queued exclusive), so the NoFence variants avoid redundant memory fences and reduce overhead during debug object insertion/removal.
Improve Rich header validation/robustness:
- Simplified/decrypted rich header loop and compute buffer end pointer; use PhMappedImageProbe and SEH to guard mapped memory accesses.
- Validate richHeaderLength alignment to PRODITEM size and derive entry count from length instead of scanning.
- Reworked hash handling to use a length variable returned by PhFinalHash and pass the actual hash length to PhBufferToHexString.
- Replace ProdIdHeader number/count assignment to use the finalized entry array count/items.
- Implement full Rich checksum computation (DOS header + entries) with rotations and per-entry contribution, validate against stored key and return STATUS_INVALID_IMAGE_HASH on mismatch.
- Make Rich total-length vs NT headers offset non-fatal (keep an assert in DEBUG builds) and fall back to NT headers offset as boundary.
- Minor bounds-check and formatting fixes in dynamic relocations and other hash output conversions.
These changes improve safety against malformed or tampered PE Rich headers and reduce crash potential when parsing mapped images.
Replace heap allocations with PhAllocateStack across multiple functions in phlib/nativefile.c, add NULL checks that return STATUS_INSUFFICIENT_RESOURCES, and switch PhFree calls to PhFreeStack. Also capture and check status from NtQueryVolumeInformationFile to handle failures early, and improve PhDeleteDirectoryWin32 comments and logic (opening flags, enumeration/deletion flow, and idempotent success when the directory no longer exists). Includes minor clarity/comments around direct I/O alignment and bypass I/O usage.