Commit da922769 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

setupapi: SetupInstallServicesFromInfSection doesn't fail if there are no…

setupapi: SetupInstallServicesFromInfSection doesn't fail if there are no AddService or DelService directives in the section.
parent 700eec96
......@@ -1447,12 +1447,16 @@ BOOL WINAPI SetupInstallServicesFromInfSectionW( HINF hinf, PCWSTR section, DWOR
SC_HANDLE scm;
INFCONTEXT context;
INT section_flags;
BOOL ok, ret = FALSE;
BOOL ok, ret = TRUE;
if (!(ok = SetupFindFirstLineW( hinf, section, NULL, &context )))
{
SetLastError( ERROR_SECTION_NOT_FOUND );
return FALSE;
}
if (!(scm = OpenSCManagerW( NULL, NULL, SC_MANAGER_ALL_ACCESS ))) return FALSE;
if (!(ok = SetupFindFirstLineW( hinf, section, AddService, &context )))
SetLastError( ERROR_SECTION_NOT_FOUND );
ok = SetupFindFirstLineW( hinf, section, AddService, &context );
while (ok)
{
if (!SetupGetStringFieldW( &context, 1, service_name, MAX_INF_STRING_LENGTH, NULL ))
......@@ -1465,8 +1469,7 @@ BOOL WINAPI SetupInstallServicesFromInfSectionW( HINF hinf, PCWSTR section, DWOR
ok = SetupFindNextMatchLineW( &context, AddService, &context );
}
if (!(ok = SetupFindFirstLineW( hinf, section, DelService, &context )))
SetLastError( ERROR_SECTION_NOT_FOUND );
ok = SetupFindFirstLineW( hinf, section, DelService, &context );
while (ok)
{
if (!SetupGetStringFieldW( &context, 1, service_name, MAX_INF_STRING_LENGTH, NULL ))
......
......@@ -322,6 +322,20 @@ static void test_install_svc_from(void)
CloseServiceHandle(svc_handle);
CloseServiceHandle(scm_handle);
strcpy(inf, "[Version]\nSignature=\"$Chicago$\"\n");
strcat(inf, "[XSP.InstallPerVer]\n");
strcat(inf, "AddReg=AspEventlogMsg.Reg,Perf.Reg,AspVersions.Reg,FreeADO.Reg,IndexServer.Reg\n");
create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile);
infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
SetLastError(0xdeadbeef);
ret = SetupInstallServicesFromInfSectionA(infhandle, "XSP.InstallPerVer", 0);
ok(ret, "Expected success\n");
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %08x\n", GetLastError());
SetupCloseInfFile(infhandle);
DeleteFile(inffile);
/* TODO: Test the Flags */
}
......
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