eric pouech (@epo) commented about programs/cmd/builtins.c:
+ if (*(thisparam)) + wcscpy(path_argument, thisparam); + + if (*(thisparam = WCMD_parameter(args, ++argn, &rawarg, FALSE, FALSE))) + sei.lpParameters = rawarg; + else + sei.lpParameters = L"";
- memset( &st, 0, sizeof(STARTUPINFOW) ); - st.cb = sizeof(STARTUPINFOW); + if (WCMD_search_command(path_argument, &sc, FALSE) == NO_ERROR) + sei.lpFile = sc.path; + else sei.lpFile = path_argument;
- if (CreateProcessW( file, cmdline, NULL, NULL, TRUE, 0, NULL, NULL, &st, &pi )) + if (GetBinaryTypeW(sei.lpFile, &binary_type)) for this part, I think you need also to share with the existing helpers for spwaning external process
* likely spawn_external_full path has to be reworked (as you need here to pass process_flags and STARTUPINFO to CreateProcess), and split in several helpers, * the console mode changes in spawn_external_full path are needed * search_command shall give you the kind of action needed: * external executable for CreateProcess * internal builtin command ('start /b dir' which I'm not sure it's supported in this MR) * ShellExecute * no match * execute_single_command shall give an example of how the manage the output of search_command (yes that's cumbersome) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11608#note_149344