fix: Windows CI build (EventLogRecord + SUBCLASSPROC) - #1
Merged
Conversation
CsWin32 0.3 does not emit SUBCLASSPROC; call comctl32 SetWindowSubclass directly. Alias the Core EventLogRecord so the EventLog package type does not break IEventLogReader. Co-authored-by: Paul Smith <piranout@users.noreply.github.com>
Named record args are PascalCase. Do not assign EnumWindows LPARAM to GetWindowThreadProcessId's DWORD. HWND.Value is void* — cast to long. Co-authored-by: Paul Smith <piranout@users.noreply.github.com>
WindowsAppSDKSelfContained rejects AnyCPU, which is what `dotnet build Reentry.slnx -c Release` uses. Keep explicit -r / Platform. Co-authored-by: Paul Smith <piranout@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows
dotnet build Reentry.slnx -c Releasewas failing on main (9f581d0, run 32403780666). C# errors hid a later WASDK architecture check.Cause
System.Diagnostics.EventLogintroducesSystem.Diagnostics.Eventing.Reader.EventLogRecord, which collided withReentry.Core.Models.EventLogRecordinWin32EventLogReader. That also brokeIEventLogReader.ReadRecent.SUBCLASSPROC, soEndSessionHookcould not compile even with the subclass APIs listed inNativeMethods.txt.Win32ProcessProbe:LiveProcessnamed args are PascalCase (CommandLine/StartedUtc);_ = GetWindowThreadProcessId(...)assigned auintinto the EnumWindowsLPARAMparameter named_;HWND.Valueisvoid*and does not convert toLiveWindow.Handle(long).WindowsAppSDKSelfContainedrejectedAnyCPU(thedotnet builddefault) because no RID was set.Fix
EventLogRecordas the public/interface type. Keep theSystem.Diagnostics.EventLogpackage.comctl32SetWindowSubclass/RemoveWindowSubclass/DefSubclassProcwith a[UnmanagedFunctionPointer(CallingConvention.Winapi)]delegate. Same attach-to-HWND behavior, same try/catch so shutdown is never blocked. Drop unused CsWin32 subclass names fromNativeMethods.txt.Win32ProcessProbeconstruction and CsWin32 handle types.RuntimeIdentifiertowin-x64when Platform is AnyCPU / unset sodotnet build Reentry.slnx -c Releaseworks. Explicit-r/Platformstill win.No new features, no admin, no injection beyond this user-mode WndProc. Unpackaged WASDK 2.4, x64 shipping matches
publish.ps1/ release.Verify
dotnet build Reentry.slnx -c Releaseon windows-latestdotnet test tests/Reentry.Core.Tests -c Release(39 passed locally)