Added patch to forward exitcode from child process when in wineconsole.

This commit is contained in:
Sebastian Lackner 2015-07-13 02:30:20 +02:00
parent cd4db49a74
commit 1d9163af16
5 changed files with 118 additions and 13 deletions

View File

@ -39,6 +39,11 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
-----------------------------------
**Bug fixes and features included in the next upcoming release [1]:**
* Forward exitcode from child process when in wineconsole
**Bug fixes and features in Wine Staging 1.7.47 [230]:**
*Note: The following list only contains features and bug fixes which are not

4
debian/changelog vendored
View File

@ -1,3 +1,7 @@
wine-staging (1.7.48) UNRELEASED; urgency=low
* Added patch to forward exitcode from child process when in wineconsole.
-- Sebastian Lackner <sebastian@fds-team.de> Mon, 13 Jul 2015 02:29:48 +0200
wine-staging (1.7.47) unstable; urgency=low
* Added patch to silence repeated winhttp "no support on this platform"
message.

View File

@ -51,7 +51,7 @@ usage()
# Show version information
version()
{
echo "Wine Staging 1.7.47"
echo "Wine Staging 1.7.48 (unreleased)"
echo "Copyright (C) 2014-2015 the Wine Staging project authors."
echo ""
echo "Patchset to be applied on upstream Wine:"
@ -251,6 +251,7 @@ patch_enable_all ()
enable_winecfg_Libraries="$1"
enable_winecfg_Staging="$1"
enable_winecfg_Unmounted_Devices="$1"
enable_wineconsole_Forward_Exitcode="$1"
enable_wineconsole_Insert_Mode="$1"
enable_wined3d_Accounting="$1"
enable_wined3d_CSMT_Helper="$1"
@ -830,6 +831,9 @@ patch_enable ()
winecfg-Unmounted_Devices)
enable_winecfg_Unmounted_Devices="$2"
;;
wineconsole-Forward_Exitcode)
enable_wineconsole_Forward_Exitcode="$2"
;;
wineconsole-Insert_Mode)
enable_wineconsole_Insert_Mode="$2"
;;
@ -4852,6 +4856,18 @@ if test "$enable_winecfg_Unmounted_Devices" -eq 1; then
) >> "$patchlist"
fi
# Patchset wineconsole-Forward_Exitcode
# |
# | Modified files:
# | * programs/wineconsole/winecon_private.h, programs/wineconsole/wineconsole.c
# |
if test "$enable_wineconsole_Forward_Exitcode" -eq 1; then
patch_apply wineconsole-Forward_Exitcode/0001-wineconsole-Forward-child-process-exitcode.patch
(
echo '+ { "Michael Müller", "wineconsole: Forward child process exitcode.", 1 },';
) >> "$patchlist"
fi
# Patchset wineconsole-Insert_Mode
# |
# | This patchset fixes the following Wine bugs:
@ -4900,6 +4916,18 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then
) >> "$patchlist"
fi
# Patchset wined3d-wined3d_swapchain_present
# |
# | Modified files:
# | * dlls/wined3d/swapchain.c
# |
if test "$enable_wined3d_wined3d_swapchain_present" -eq 1; then
patch_apply wined3d-wined3d_swapchain_present/0001-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch
(
echo '+ { "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME.", 1 },';
) >> "$patchlist"
fi
# Patchset wined3d-MESA_GPU_Info
# |
# | Modified files:
@ -4984,18 +5012,6 @@ if test "$enable_wined3d_resource_check_usage" -eq 1; then
) >> "$patchlist"
fi
# Patchset wined3d-wined3d_swapchain_present
# |
# | Modified files:
# | * dlls/wined3d/swapchain.c
# |
if test "$enable_wined3d_wined3d_swapchain_present" -eq 1; then
patch_apply wined3d-wined3d_swapchain_present/0001-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch
(
echo '+ { "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME.", 1 },';
) >> "$patchlist"
fi
# Patchset wined3d-CSMT_Main
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,79 @@
From 00afdfb01837f15c91eded183b6f53509d7a9d2d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 13 Jul 2015 02:22:47 +0200
Subject: wineconsole: Forward child process exitcode.
---
programs/wineconsole/winecon_private.h | 1 +
programs/wineconsole/wineconsole.c | 24 ++++++++++++++++++------
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/programs/wineconsole/winecon_private.h b/programs/wineconsole/winecon_private.h
index 2178dd0..5608f99 100644
--- a/programs/wineconsole/winecon_private.h
+++ b/programs/wineconsole/winecon_private.h
@@ -59,6 +59,7 @@ struct inner_data {
HANDLE hConIn; /* console input handle */
HANDLE hConOut; /* screen buffer handle: has to be changed when active sb changes */
HANDLE hSynchro; /* waitable handle signalled by server when something in server has been modified */
+ HANDLE hProcess; /* handle to the child process or NULL */
HWND hWnd; /* handle of 'user' window or NULL for 'curses' */
INT nCmdShow; /* argument of WinMain */
BOOL in_set_config; /* to handle re-entrant calls to WINECON_SetConfig */
diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c
index ed5f816..a0c8dcf 100644
--- a/programs/wineconsole/wineconsole.c
+++ b/programs/wineconsole/wineconsole.c
@@ -519,6 +519,7 @@ static void WINECON_Delete(struct inner_data* data)
if (data->hConIn) CloseHandle(data->hConIn);
if (data->hConOut) CloseHandle(data->hConOut);
if (data->hSynchro) CloseHandle(data->hSynchro);
+ if (data->hProcess) CloseHandle(data->hProcess);
HeapFree(GetProcessHeap(), 0, data->curcfg.registry);
HeapFree(GetProcessHeap(), 0, data->cells);
HeapFree(GetProcessHeap(), 0, data);
@@ -719,15 +720,16 @@ static BOOL WINECON_Spawn(struct inner_data* data, LPWSTR cmdLine)
}
done = CreateProcessW(NULL, cmdLine, NULL, NULL, TRUE, 0L, NULL, NULL, &startup, &info);
+ if (done)
+ {
+ data->hProcess = info.hProcess;
+ CloseHandle(info.hThread);
+ }
/* we no longer need the handles passed to the child for the console */
CloseHandle(startup.hStdInput);
CloseHandle(startup.hStdOutput);
CloseHandle(startup.hStdError);
-
- CloseHandle(info.hProcess);
- CloseHandle(info.hThread);
-
return done;
}
@@ -862,8 +864,18 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, INT nCmdSh
if (ret)
{
- WINE_TRACE("calling MainLoop.\n");
- ret = data->fnMainLoop(data);
+ DWORD exitcode;
+
+ WINE_TRACE("calling MainLoop.\n");
+ ret = data->fnMainLoop(data);
+
+ if (data->hProcess &&
+ WaitForSingleObject(data->hProcess, INFINITE) == WAIT_OBJECT_0 &&
+ GetExitCodeProcess(data->hProcess, &exitcode))
+ {
+ WINE_TRACE("forwarding exitcode %u from child process\n", exitcode);
+ ret = exitcode;
+ }
}
WINECON_Delete(data);
--
2.4.5

View File

@ -0,0 +1 @@
Fixes: Forward exitcode from child process when in wineconsole