Commit 52363aef authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

advapi32: Pass service name as argv[0] to ServiceMain.

parent d0244d76
......@@ -430,8 +430,7 @@ static DWORD WINAPI service_control_dispatcher(LPVOID arg)
!(service->full_access_handle = OpenServiceW( manager, data, GENERIC_READ|GENERIC_WRITE )))
FIXME( "failed to open service %s\n", debugstr_w(data) );
}
result = service_handle_start(service, data + info.name_size,
data_size / sizeof(WCHAR) - info.name_size );
result = service_handle_start(service, data, data_size / sizeof(WCHAR));
break;
case WINESERV_SENDCONTROL:
result = service_handle_control(service, info.control);
......
......@@ -299,11 +299,8 @@ static void scmdatabase_autostart_services(struct scmdatabase *db)
for (i = 0; i < size; i++)
{
DWORD err;
const WCHAR *argv[2];
service = services_list[i];
argv[0] = service->name;
argv[1] = NULL;
err = service_start(service, 1, argv);
err = service_start(service, 0, NULL);
if (err != ERROR_SUCCESS)
WINE_FIXME("Auto-start service %s failed to start: %d\n",
wine_dbgstr_w(service->name), err);
......
......@@ -94,6 +94,10 @@ static void WINAPI service_main(DWORD argc, char **argv)
SERVICE_STATUS status;
BOOL res;
service_ok(argc == 1, "argc = %d", argc);
if(argc)
service_ok(!strcmp(argv[0], service_name), "argv[0] = %s, expected %s", argv[0], service_name);
service_handle = pRegisterServiceCtrlHandlerExA(service_name, service_handler, NULL);
service_ok(service_handle != NULL, "RegisterServiceCtrlHandlerEx failed: %u\n", GetLastError());
if(!service_handle)
......
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