Skip to content

Report Windows exit codes as int32 in the "exited" event - #2103

Open
Shumaf Lovpache (Soarex16) wants to merge 1 commit into
microsoft:mainfrom
Soarex16:windows-exit-code-int32
Open

Shumaf Lovpache (Soarex16) wants to merge 1 commit into
microsoft:mainfrom
Soarex16:windows-exit-code-int32

Conversation

@Soarex16

Copy link
Copy Markdown

On Windows, Popen.wait() returns the exit code as an unsigned 32-bit DWORD, and the launcher sent it unchanged in the exited event. A code with the high bit set, such as 0xC000013A (STATUS_CONTROL_C_EXIT), then falls outside the int32 range that the DAP schema requires for exitCode, so a client that decodes the field as an int32 rejects the event.

The launcher now maps a Windows exit code to the int32 with the same bits: 0xC000013A becomes -1073741510, and 0xFFFFFFFF becomes -1.

Fixes #2102

On Windows, `Popen.wait()` returns the exit code as an unsigned 32-bit `DWORD`, and the launcher sent it unchanged in the `exited` event. A code with the high bit set, such as `0xC000013A` (`STATUS_CONTROL_C_EXIT`), then falls outside the int32 range that the DAP schema requires for `exitCode`, so a client that decodes the field as an int32 rejects the event.

The launcher now maps a Windows exit code to the int32 with the same bits: `0xC000013A` becomes `-1073741510`, and `0xFFFFFFFF` becomes `-1`.

Fixes microsoft#2102
@Soarex16
Shumaf Lovpache (Soarex16) requested a review from a team as a code owner November 27, 2026 15:54
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exited event reports Windows exit codes as uint32, outside the int32 range of the DAP schema

1 participant