steam_helper: Run console apps with a new console
This should allow Wine to show a wineconsole dialog for games which make use of it. Suggested by Vincent.
This commit is contained in:
parent
948aeac50d
commit
d73b927e2d
2 changed files with 11 additions and 2 deletions
|
@ -742,7 +742,7 @@ $(STEAMEXE_CONFIGURE_FILES): $(STEAMEXE_SYN) $(MAKEFILE_DEP) | $(STEAMEXE_OBJ) $
|
|||
cp ../$(STEAMEXE_SYN)/Makefile . && \
|
||||
echo >> ./Makefile 'SRCDIR := ../$(STEAMEXE_SYN)' && \
|
||||
echo >> ./Makefile 'vpath % $$(SRCDIR)' && \
|
||||
echo >> ./Makefile 'steam_exe_LDFLAGS := -m32 -lsteam_api $$(steam_exe_LDFLAGS)'
|
||||
echo >> ./Makefile 'steam_exe_LDFLAGS := -m32 -lsteam_api -lole32 $$(steam_exe_LDFLAGS)'
|
||||
|
||||
## steam goals
|
||||
STEAMEXE_TARGETS = steam steam_configure
|
||||
|
|
|
@ -142,6 +142,7 @@ static HANDLE run_process(void)
|
|||
WCHAR *cmdline = GetCommandLineW();
|
||||
STARTUPINFOW si = { sizeof(si) };
|
||||
PROCESS_INFORMATION pi;
|
||||
DWORD flags = 0;
|
||||
|
||||
/* skip argv[0] */
|
||||
if (*cmdline == '"')
|
||||
|
@ -169,6 +170,8 @@ static HANDLE run_process(void)
|
|||
WCHAR *start, *end, *dos, *remainder, *new_cmdline;
|
||||
size_t argv0_len;
|
||||
int r;
|
||||
DWORD_PTR console;
|
||||
SHFILEINFOW sfi;
|
||||
|
||||
static const WCHAR dquoteW[] = {'"',0};
|
||||
|
||||
|
@ -220,6 +223,12 @@ static HANDLE run_process(void)
|
|||
|
||||
dos = wine_get_dos_file_name(scratchA);
|
||||
|
||||
CoInitialize(NULL);
|
||||
|
||||
console = SHGetFileInfoW(dos, 0, &sfi, sizeof(sfi), SHGFI_EXETYPE);
|
||||
if (console && !HIWORD(console))
|
||||
flags |= CREATE_NEW_CONSOLE;
|
||||
|
||||
new_cmdline = (WCHAR *)HeapAlloc(GetProcessHeap(), 0,
|
||||
(lstrlenW(dos) + 3 + lstrlenW(remainder) + 1) * sizeof(WCHAR));
|
||||
lstrcpyW(new_cmdline, dquoteW);
|
||||
|
@ -233,7 +242,7 @@ static HANDLE run_process(void)
|
|||
run:
|
||||
WINE_TRACE("Running command %s\n", wine_dbgstr_w(cmdline));
|
||||
|
||||
if (!CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
|
||||
if (!CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, flags, NULL, NULL, &si, &pi))
|
||||
{
|
||||
WINE_ERR("Failed to create process %s: %u\n", wine_dbgstr_w(cmdline), GetLastError());
|
||||
return INVALID_HANDLE_VALUE;
|
||||
|
|
Loading…
Reference in a new issue