-
-
Notifications
You must be signed in to change notification settings - Fork 369
Fix crash on ×32 devices #3581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Fix crash on ×32 devices #3581
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a crash on ×32 devices by switching from CsWin32–generated methods to DllImport calls for window style functions. Key changes include updating method signatures and calls to use pointer-sized types, modifying the PInvoke wrappers to support both 32-bit and 64-bit architectures, and updating documentation in NativeMethods.txt to reflect the change.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
Flow.Launcher.Infrastructure/Win32Helper.cs | Updated GetWindowStyle and SetWindowStyle to use nint and GetWindowLongPtr |
Flow.Launcher.Infrastructure/PInvokeExtensions.cs | Refactored DllImport declarations and added GetWindowLongPtr logic for architecture-specific behavior |
Flow.Launcher.Infrastructure/NativeMethods.txt | Updated reference from GetWindowLong to WINDOW_LONG_PTR_INDEX |
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
🥷 Code experts: no user but you matched threshold 10 Jack251970 has most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughThe changes introduce a managed wrapper for the native Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Win32Helper
participant PInvoke
participant NativeAPI
Caller->>Win32Helper: GetWindowStyle(hWnd, nIndex)
Win32Helper->>PInvoke: GetWindowLongPtr(hWnd, nIndex)
PInvoke->>NativeAPI: GetWindowLongPtr (native call)
NativeAPI-->>PInvoke: nint value
PInvoke-->>Win32Helper: nint value
Win32Helper-->>Caller: nint value
Caller->>Win32Helper: SetWindowStyle(hWnd, nIndex, newLong)
Win32Helper->>PInvoke: SetWindowLongPtr(hWnd, nIndex, newLong)
PInvoke->>NativeAPI: SetWindowLongPtr (native call)
NativeAPI-->>PInvoke: nint result
PInvoke-->>Win32Helper: nint result
Win32Helper-->>Caller: nint result
Suggested labels
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code Graph Analysis (2)Flow.Launcher.Infrastructure/PInvokeExtensions.cs (1)
Flow.Launcher.Infrastructure/Win32Helper.cs (1)
🪛 GitHub Check: Check SpellingFlow.Launcher.Infrastructure/PInvokeExtensions.cs[warning] 16-16: 🪛 GitHub Actions: Check SpellingFlow.Launcher.Infrastructure/PInvokeExtensions.cs[warning] 16-16: [warning] 21-21: [warning] 24-24: [warning] 25-25: Flow.Launcher.Infrastructure/Win32Helper.cs[warning] 18-18: [warning] 41-41: [warning] 41-41: [warning] 52-52: [warning] 53-53: [warning] 53-53: [warning] 54-54: [warning] 54-54: [warning] 55-55: [warning] 55-55: [warning] 58-58: [warning] 58-58: [warning] 60-60: [warning] 60-60: [warning] 69-69: [warning] 69-69: [warning] 71-71: [warning] 71-71: [warning] 87-87: [warning] 88-88: [warning] 89-89: [warning] 93-93: [warning] 95-95: [warning] 95-95: [warning] 161-161: [warning] 172-172: [warning] 177-177: [warning] 188-188: [warning] 262-262: [warning] 275-275: [warning] 276-276: [warning] 516-516: [warning] 522-522: [warning] 548-548: [warning] 621-621: [warning] 644-644: [warning] 644-644: [warning] 645-645: [warning] 681-681: [warning] 682-682: [warning] 683-683: [warning] 684-684: [warning] 725-725: [warning] 728-728: [warning] 730-730: [warning] 750-750: ⏰ Context from checks skipped due to timeout of 90000ms (6)
🔇 Additional comments (8)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
CsWin32 doesn't generate GetWindowLong on other than x86 and vice versa. So we should use DllImport instead of CSWin32
For more info, visit microsoft/CsWin32#882.