Skip to content

Commit 087f876

Browse files
DinahK-2SOCopilot
andcommitted
Preserve GetCursorPos error reporting
Mark the P/Invoke as SetLastError-aware so failed cursor queries report the correct Win32 error. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 39014fc commit 087f876

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

test/e2e/ItE2E/Public/Ui.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function Initialize-WtWin32Input {
5151
[DllImport("user32.dll")] public static extern bool IsIconic(IntPtr hWnd);
5252
[DllImport("user32.dll")] public static extern bool AllowSetForegroundWindow(uint dwProcessId);
5353
[DllImport("user32.dll")] public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint pid);
54-
[DllImport("user32.dll")] public static extern bool GetCursorPos(out POINT point);
54+
[DllImport("user32.dll", SetLastError=true)] public static extern bool GetCursorPos(out POINT point);
5555
[DllImport("user32.dll")] public static extern bool SetCursorPos(int x, int y);
5656
[DllImport("user32.dll")] public static extern short GetAsyncKeyState(int virtualKey);
5757
[DllImport("user32.dll", SetLastError=true)] public static extern uint SendInput(uint count, INPUT[] inputs, int size);

0 commit comments

Comments
 (0)