Commit 7f0c8b3c authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

msi/tests: Test deferral of StartServices and StopServices.

parent b8f982fa
......@@ -259,16 +259,27 @@ static const char sss_install_exec_seq_dat[] =
"InstallValidate\t\t1400\n"
"InstallInitialize\t\t1500\n"
"StopServices\t\t4000\n"
"stop_immediate\tNOT REMOVE\t4001\n"
"stop_deferred\tNOT REMOVE\t4002\n"
"DeleteServices\t\t5000\n"
"MoveFiles\t\t5100\n"
"InstallFiles\t\t5200\n"
"DuplicateFiles\t\t5300\n"
"StartServices\t\t5400\n"
"start_deferred\tNOT REMOVE\t5401\n"
"RegisterProduct\t\t5500\n"
"PublishFeatures\t\t5600\n"
"PublishProduct\t\t5700\n"
"InstallFinalize\t\t6000\n";
static const char sss_custom_action_dat[] =
"Action\tType\tSource\tTarget\n"
"s72\ti2\tS64\tS0\n"
"CustomAction\tAction\n"
"stop_immediate\t1\tcustom.dll\tsss_started\n"
"stop_deferred\t1025\tcustom.dll\tsss_stopped\n"
"start_deferred\t1025\tcustom.dll\tsss_started\n";
static const char sds_install_exec_seq_dat[] =
"Action\tCondition\tSequence\n"
"s72\tS255\tI2\n"
......@@ -1848,6 +1859,7 @@ static const msi_table sss_tables[] =
ADD_TABLE(file),
ADD_TABLE(sss_install_exec_seq),
ADD_TABLE(sss_service_control),
ADD_TABLE(sss_custom_action),
ADD_TABLE(media),
ADD_TABLE(property)
};
......
......@@ -1239,3 +1239,38 @@ todo_wine
CloseServiceHandle(manager);
return ERROR_SUCCESS;
}
UINT WINAPI sss_started(MSIHANDLE hinst)
{
SC_HANDLE manager, service;
SERVICE_STATUS status;
BOOL ret;
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
service = OpenServiceA(manager, "Spooler", SC_MANAGER_ALL_ACCESS);
ret = QueryServiceStatus(service, &status);
ok(hinst, ret, "QueryServiceStatus failed: %u\n", GetLastError());
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
ok(hinst, status.dwCurrentState == SERVICE_RUNNING, "got %u\n", status.dwCurrentState);
CloseServiceHandle(service);
CloseServiceHandle(manager);
return ERROR_SUCCESS;
}
UINT WINAPI sss_stopped(MSIHANDLE hinst)
{
SC_HANDLE manager, service;
SERVICE_STATUS status;
BOOL ret;
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
service = OpenServiceA(manager, "Spooler", SC_MANAGER_ALL_ACCESS);
ret = QueryServiceStatus(service, &status);
ok(hinst, ret, "QueryServiceStatus failed: %u\n", GetLastError());
ok(hinst, status.dwCurrentState == SERVICE_STOPPED, "got %u\n", status.dwCurrentState);
CloseServiceHandle(service);
CloseServiceHandle(manager);
return ERROR_SUCCESS;
}
......@@ -11,3 +11,5 @@
@ stdcall sds_absent(long)
@ stdcall sis_present(long)
@ stdcall sis_absent(long)
@ stdcall sss_started(long)
@ stdcall sss_stopped(long)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment