Skip to content

improve proc_open error reporting on Windows #15685

Closed

Description

@determin1st

Description

i was launching processes recently and got a Warning: "CreateProcess failed with error code 8" that is generated here:

if (newprocok == FALSE) {

	if (newprocok == FALSE) {
		//DWORD dw = GetLastError();
		close_all_descriptors(descriptors, ndesc);
		//php_error_docref(NULL, E_WARNING, "CreateProcess failed, error code: %u", dw);
		php_win32_docref1_from_error(
			GetLastError(), ZSTR_VAL(command_str)
		);
		goto exit_fail;
	}

ive replaced php_error_docref function with windows specific function which said that was a lack of memory, instead of code 8. so kind of tested it.

Activity

  1. cmb69 commented on Sep 1, 2024

    @cmb69
    Member

    Oh, indeed, we should use php_win32_error_to_msg() what's similar to POSIX' strerror().

  2. self-assigned this
    on Sep 1, 2024
  3. cmb69 commented on Sep 3, 2024

    @cmb69
    Member

    #15687 has been merged, so this can be closed (would have been automatically, if I hadn't screwed up).

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions