Skip to content

The Launch Windows processes in new process group example uses the wrong signal (CTRL_C instead of CTRL_BREAK) #53173

@danegsta

Description

@danegsta

Type of issue

Code doesn't work

Description

The example given for sending an interrupt signal to a process launched with a new process group uses GenerateConsoleCtrlEvent with CTRL_C_EVENT (0) as the event ID, but that's backwards from the GenerateConsoleCtrlEvent docs. If you're sending an event to a process group you have to use CTRL_BREAK_EVENT (1) instead. The docs specifically call out that sending CTRL_C_EVENT to a non-zero process group ID will silently fail (the API won't return an error, but no signal will be sent).

Page URL

https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-10/libraries#windows-process-management

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/whats-new/dotnet-10/libraries.md

Document Version Independent Id

176b57cd-f735-5a82-38ca-cb48fd37dd25

Platform Id

dbf755da-ae81-793c-08ce-0d07783aa362

Article author

@BillWagner

Metadata

  • ID: 068cbe90-a853-4ba4-df17-eef736df4514
  • PlatformId: dbf755da-ae81-793c-08ce-0d07783aa362
  • Service: dotnet-fundamentals

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions