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
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
GenerateConsoleCtrlEventwithCTRL_C_EVENT(0) as the event ID, but that's backwards from theGenerateConsoleCtrlEventdocs. If you're sending an event to a process group you have to useCTRL_BREAK_EVENT(1) instead. The docs specifically call out that sendingCTRL_C_EVENTto 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
Related Issues