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

This commit is contained in:
Jacek Caban 2012-06-15 16:37:27 +02:00 committed by Alexandre Julliard
parent d0244d761d
commit 52363aef65
3 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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