[MSI_WINETEST]
[reactos.git] / rostests / winetests / msi / automation.c
index 8a0eede..edc6cbe 100644 (file)
@@ -1863,7 +1863,11 @@ static void test_Session(IDispatch *pSession)
     /* Session::Mode, get */
     hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTATEND, &bool);
     ok(hr == S_OK, "Session_ModeGet failed, hresult 0x%08x\n", hr);
-    todo_wine ok(!bool, "Reboot at end session mode is %d\n", bool);
+    ok(!bool, "Reboot at end session mode is %d\n", bool);
+
+    hr = Session_ModeGet(pSession, MSIRUNMODE_MAINTENANCE, &bool);
+    ok(hr == S_OK, "Session_ModeGet failed, hresult 0x%08x\n", hr);
+    ok(!bool, "Maintenance mode is %d\n", bool);
 
     /* Session::Mode, put */
     hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, TRUE);
@@ -1874,6 +1878,17 @@ static void test_Session(IDispatch *pSession)
     hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, FALSE);  /* set it again so we don't reboot */
     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);
+    hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTNOW, &bool);
+    ok(hr == S_OK, "Session_ModeGet failed, hresult 0x%08x\n", hr);
+    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);
+
+    hr = Session_ModePut(pSession, MSIRUNMODE_MAINTENANCE, TRUE);
+    ok(hr == DISP_E_EXCEPTION, "Session_ModePut failed, hresult 0x%08x\n", hr);
+
     /* Session::Database, get */
     hr = Session_Database(pSession, &pDatabase);
     ok(hr == S_OK, "Session_Database failed, hresult 0x%08x\n", hr);