Skip to content

SDL_CreateProcess fails with "DuplicateHandle(): The handle is invalid." on win32 GUI apps #14977

@droc101

Description

@droc101

SDL_CreateProcess seems to fail for Win32 GUI programs run without an attached console (such as when opened from explorer)
SDL_GetError() returns DuplicateHandle(): The handle is invalid.

This may be because GetStdHandle(STD_OUTPUT_HANDLE) is nullptr.

This occurs with the pipe_stdio argument both true and false.

OS: Windows 11
SDL Version: 3.4.0

Minimal reproduction:
CMakeLists.txt
main.cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions