Commit 046bcc91 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: The PATH environment variable can be longer than MAX_PATH, so dynamically…

msi: The PATH environment variable can be longer than MAX_PATH, so dynamically allocate strings to deal with that.
parent 37c5e040
......@@ -7330,6 +7330,8 @@ static void test_appsearch_reglocator(void)
BOOL space, version;
HKEY hklm, classes;
HKEY hkcu, users;
LPSTR pathdata;
LPSTR pathvar;
LPCSTR str;
LPSTR ptr;
LONG res;
......@@ -7772,12 +7774,22 @@ static void test_appsearch_reglocator(void)
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
ExpandEnvironmentStringsA("%PATH%", path, MAX_PATH);
size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
pathvar = HeapAlloc(GetProcessHeap(), 0, size);
ExpandEnvironmentStringsA("%PATH%", pathvar, size);
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
size = 0;
r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(pathdata, pathvar),
"Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
HeapFree(GetProcessHeap(), 0, pathvar);
HeapFree(GetProcessHeap(), 0, pathdata);
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
......
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