From 1d9163af16c756d57e0f5cd605bc10f620b1e218 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 13 Jul 2015 02:30:20 +0200 Subject: [PATCH] Added patch to forward exitcode from child process when in wineconsole. --- README.md | 5 ++ debian/changelog | 4 + patches/patchinstall.sh | 42 +++++++--- ...nsole-Forward-child-process-exitcode.patch | 79 +++++++++++++++++++ .../wineconsole-Forward_Exitcode/definition | 1 + 5 files changed, 118 insertions(+), 13 deletions(-) create mode 100644 patches/wineconsole-Forward_Exitcode/0001-wineconsole-Forward-child-process-exitcode.patch create mode 100644 patches/wineconsole-Forward_Exitcode/definition diff --git a/README.md b/README.md index 019b2e91..18412450 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/debian/changelog b/debian/changelog index 4a1581a1..2d7fbbe4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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. diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index b894b9a2..f743192d 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -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: diff --git a/patches/wineconsole-Forward_Exitcode/0001-wineconsole-Forward-child-process-exitcode.patch b/patches/wineconsole-Forward_Exitcode/0001-wineconsole-Forward-child-process-exitcode.patch new file mode 100644 index 00000000..82c1f6db --- /dev/null +++ b/patches/wineconsole-Forward_Exitcode/0001-wineconsole-Forward-child-process-exitcode.patch @@ -0,0 +1,79 @@ +From 00afdfb01837f15c91eded183b6f53509d7a9d2d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +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 + diff --git a/patches/wineconsole-Forward_Exitcode/definition b/patches/wineconsole-Forward_Exitcode/definition new file mode 100644 index 00000000..3e19c6b5 --- /dev/null +++ b/patches/wineconsole-Forward_Exitcode/definition @@ -0,0 +1 @@ +Fixes: Forward exitcode from child process when in wineconsole