From de4cab20a8be723414461213382014d0229e9af5 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Tue, 11 Mar 2008 18:08:57 -0500 Subject: [PATCH] msi: Deformat the service name and display name when installing the service. --- dlls/msi/action.c | 9 ++++++--- dlls/msi/tests/install.c | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index cfef95896aa..2e5b8ee1d9d 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -4470,7 +4470,8 @@ static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param) MSIRECORD *row; MSIFILE *file; SC_HANDLE hscm, service = NULL; - LPCWSTR name, disp, comp, depends, pass; + LPCWSTR comp, depends, pass; + LPWSTR name, disp; LPCWSTR load_order, serv_name, key; DWORD serv_type, start_type; DWORD err_control; @@ -4497,8 +4498,8 @@ static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param) if (depends && *depends) FIXME("Dependency list unhandled!\n"); - name = MSI_RecordGetString(rec, 2); - disp = MSI_RecordGetString(rec, 3); + deformat_string(package, MSI_RecordGetString(rec, 2), &name); + deformat_string(package, MSI_RecordGetString(rec, 3), &disp); serv_type = MSI_RecordGetInteger(rec, 4); err_control = MSI_RecordGetInteger(rec, 6); load_order = MSI_RecordGetString(rec, 7); @@ -4536,6 +4537,8 @@ static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param) done: CloseServiceHandle(service); CloseServiceHandle(hscm); + msi_free(name); + msi_free(disp); return ERROR_SUCCESS; } diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 00cd7054364..0c3ae20b5ea 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -146,7 +146,9 @@ static const CHAR property_dat[] = "Property\tValue\n" "Setup\tSetup\n" "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n" "AdminProperties\tPOSTADMIN\n" - "ROOTDRIVE\tC:\\\n"; + "ROOTDRIVE\tC:\\\n" + "SERVNAME\tTestService\n" + "SERVDISP\tTestServiceDisp\n"; static const CHAR registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n" "s72\ti2\tl255\tL255\tL0\ts72\n" @@ -160,7 +162,7 @@ static const CHAR service_install_dat[] = "ServiceInstall\tName\tDisplayName\tSe "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n" "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n" "ServiceInstall\tServiceInstall\n" - "TestService\tTestService\tTestService\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t"; + "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t"; static const CHAR service_control_dat[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n" "s72\tl255\ti2\tL255\tI2\ts72\n"