msi: End the search for a directory signature if the parent cannot be found.

This commit is contained in:
Hans Leidekker 2010-05-25 12:19:02 +02:00 committed by Alexandre Julliard
parent c2ce561469
commit c35856dd09
2 changed files with 26 additions and 3 deletions

View File

@ -929,7 +929,8 @@ static UINT ACTION_AppSearchDr(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATU
'D','r','L','o','c','a','t','o','r',' ',
'w','h','e','r','e',' ',
'S','i','g','n','a','t','u','r','e','_',' ','=',' ', '\'','%','s','\'',0};
LPWSTR parentName = NULL, parent = NULL;
LPWSTR parent = NULL;
LPCWSTR parentName;
WCHAR path[MAX_PATH];
WCHAR expanded[MAX_PATH];
MSIRECORD *row;
@ -949,14 +950,15 @@ static UINT ACTION_AppSearchDr(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATU
}
/* check whether parent is set */
parentName = msi_dup_record_field(row,2);
parentName = MSI_RecordGetString(row, 2);
if (parentName)
{
MSISIGNATURE parentSig;
rc = ACTION_AppSearchSigName(package, parentName, &parentSig, &parent);
ACTION_FreeSignature(&parentSig);
msi_free(parentName);
if (!parent)
return ERROR_SUCCESS;
}
sz = MAX_PATH;

View File

@ -8742,6 +8742,9 @@ static void test_appsearch_drlocator(void)
r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = create_drlocator_table(hdb);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
@ -8800,6 +8803,18 @@ static void test_appsearch_drlocator(void)
r = add_drlocator_entry(hdb, path);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = create_reglocator_table(hdb);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
/* parent */
r = add_reglocator_entry(hdb, "'NewSignature12', 2, 'htmlfile\\shell\\open\\nonexistent', '', 1");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
/* parent is in RegLocator, no path, depth 0, no signature */
sprintf(path, "'NewSignature13', 'NewSignature12', '', 0");
r = add_drlocator_entry(hdb, path);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = create_signature_table(hdb);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
@ -8906,6 +8921,12 @@ static void test_appsearch_drlocator(void)
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
size = MAX_PATH;
strcpy(path, "c:\\");
r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!prop[0], "Expected \"\", got \"%s\"\n", prop);
DeleteFileA("FileName1");
DeleteFileA("FileName3.dll");
DeleteFileA("FileName4.dll");