msi: Implement MsiGet/SetMode(MSIRUNMODE_REBOOTNOW).

This commit is contained in:
Hans Leidekker 2012-04-02 13:15:56 +02:00 committed by Alexandre Julliard
parent a6b3d77021
commit 15ee85dee8
3 changed files with 9 additions and 4 deletions

View File

@ -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:

View File

@ -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;

View File

@ -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);