Module: wine Branch: master Commit: 15ee85dee89e892c2850f4b05c886b9d6b2c6276 URL: http://source.winehq.org/git/wine.git/?a=commit;h=15ee85dee89e892c2850f4b05c...
Author: Hans Leidekker hans@codeweavers.com Date: Mon Apr 2 13:15:56 2012 +0200
msi: Implement MsiGet/SetMode(MSIRUNMODE_REBOOTNOW).
---
dlls/msi/install.c | 8 ++++++-- dlls/msi/msipriv.h | 1 + dlls/msi/tests/automation.c | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 709f4dc..a6c832a 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -764,6 +764,10 @@ BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode) r = package->need_reboot_at_end; break;
+ case MSIRUNMODE_REBOOTNOW: + r = package->need_reboot_now; + break; + case MSIRUNMODE_LOGENABLED: r = (package->log_file != INVALID_HANDLE_VALUE); break; @@ -819,8 +823,8 @@ UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState) break;
case MSIRUNMODE_REBOOTNOW: - FIXME("unimplemented run mode: %d\n", iRunMode); - r = ERROR_FUNCTION_FAILED; + package->need_reboot_now = (fState != 0); + r = ERROR_SUCCESS; break;
default: diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index bf15f50..4ed4fd6 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -407,6 +407,7 @@ typedef struct tagMSIPACKAGE unsigned char commit_action_running : 1; unsigned char rollback_action_running : 1; unsigned char need_reboot_at_end : 1; + unsigned char need_reboot_now : 1; unsigned char need_rollback : 1; } MSIPACKAGE;
diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c index 8ae18bd..630ff76 100644 --- a/dlls/msi/tests/automation.c +++ b/dlls/msi/tests/automation.c @@ -1887,7 +1887,7 @@ static void test_Session(IDispatch *pSession) ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr);
hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, TRUE); - todo_wine ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); + ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); if (hr == DISP_E_EXCEPTION) ok_exception(hr, szModeFlag);
hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTNOW, &bool); @@ -1895,7 +1895,7 @@ static void test_Session(IDispatch *pSession) ok(bool, "Reboot now mode is %d, expected 1\n", bool);
hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, FALSE); /* set it again so we don't reboot */ - todo_wine ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); + ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); if (hr == DISP_E_EXCEPTION) ok_exception(hr, szModeFlag);
hr = Session_ModePut(pSession, MSIRUNMODE_MAINTENANCE, TRUE);