original[0] = 0;
res_query = RegQueryValueExA(hroot, acceptlanguage, 0, NULL, (PBYTE)original, &len);
- RegDeleteValue(hroot, acceptlanguage);
+ RegDeleteValueA(hroot, acceptlanguage);
/* Some windows versions use "lang-COUNTRY" as default */
memset(language, 0, sizeof(language));
len = GetLocaleInfoA(lcid, LOCALE_SISO639LANGNAME, language, sizeof(language));
if (len) {
- lstrcat(language, "-");
+ lstrcatA(language, "-");
memset(buffer, 0, sizeof(buffer));
len = GetLocaleInfoA(lcid, LOCALE_SISO3166CTRYNAME, buffer, sizeof(buffer) - len - 1);
- lstrcat(language, buffer);
+ lstrcatA(language, buffer);
}
else
{
}
/* without a value in the registry, a default language is returned */
- RegDeleteValue(hroot, acceptlanguage);
+ RegDeleteValueA(hroot, acceptlanguage);
len = maxlen;
memset(buffer, '#', maxlen);
}
else
{
- RegDeleteValue(hroot, acceptlanguage);
+ RegDeleteValueA(hroot, acceptlanguage);
}
RegCloseKey(hroot);
}
clsA.cbWndExtra = 0;
clsA.hInstance = GetModuleHandleA(NULL);
clsA.hIcon = 0;
- clsA.hCursor = LoadCursorA(0, IDC_ARROW);
+ clsA.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
clsA.hbrBackground = NULL;
clsA.lpszMenuName = NULL;
clsA.lpszClassName = "Shlwapi test class";
RegisterClassA(&clsA);
hwnd = CreateWindowA("Shlwapi test class", "Test", WS_VISIBLE, 0, 0, 100, 100,
- NULL, NULL, GetModuleHandle(NULL), 0);
+ NULL, NULL, GetModuleHandleA(NULL), 0);
ok(IsWindow(hwnd), "failed to create window\n");
/* null window */
flags = FDTF_NOAUTOREADINGORDER | FDTF_SHORTTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
- ret = GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff2, sizeof(buff2));
+ ret = GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
flags = FDTF_NOAUTOREADINGORDER | FDTF_LONGTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
- ret = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2));
+ ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
flags = FDTF_NOAUTOREADINGORDER | FDTF_LONGTIME | FDTF_SHORTTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
- ret = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2));
+ ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
flags = FDTF_NOAUTOREADINGORDER | FDTF_SHORTDATE;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
- ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
+ ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
flags = FDTF_NOAUTOREADINGORDER | FDTF_LONGDATE;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
- ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
+ ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
flags = FDTF_NOAUTOREADINGORDER | FDTF_LONGDATE | FDTF_SHORTDATE;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
- ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
+ ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
flags = FDTF_NOAUTOREADINGORDER | FDTF_LONGDATE | FDTF_SHORTTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d, length %d\n", ret, lstrlenA(buff)+1);
- ret = GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3));
+ ret = GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3));
ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
ok(lstrcmpA(buff3, buff + lstrlenA(buff) - lstrlenA(buff3)) == 0,
"expected (%s), got (%s) for time part\n",
buff3, buff + lstrlenA(buff) - lstrlenA(buff3));
- ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
+ ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
buff[lstrlenA(buff2)] = '\0';
ok(lstrcmpA(buff2, buff) == 0, "expected (%s) got (%s) for date part\n",
flags = FDTF_NOAUTOREADINGORDER | FDTF_LONGDATE | FDTF_LONGTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
- ret = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3));
+ ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3));
ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
ok(lstrcmpA(buff3, buff + lstrlenA(buff) - lstrlenA(buff3)) == 0,
"expected (%s), got (%s) for time part\n",
buff3, buff + lstrlenA(buff) - lstrlenA(buff3));
- ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
+ ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
buff[lstrlenA(buff2)] = '\0';
ok(lstrcmpA(buff2, buff) == 0, "expected (%s) got (%s) for date part\n",
flags = FDTF_NOAUTOREADINGORDER | FDTF_SHORTDATE | FDTF_SHORTTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
- ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
+ ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
strcat(buff2, " ");
- ret = GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3));
+ ret = GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3));
ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
strcat(buff2, buff3);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
flags = FDTF_NOAUTOREADINGORDER | FDTF_SHORTDATE | FDTF_LONGTIME;
ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
- ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
+ ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
strcat(buff2, " ");
- ret = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3));
+ ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3));
ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
strcat(buff2, buff3);
ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
static void test_IUnknown_QueryServiceExec(void)
{
- IServiceProvider *provider = IServiceProviderImpl_Construct();
+ IServiceProvider *provider;
static const GUID dummy_serviceid = { 0xdeadbeef };
static const GUID dummy_groupid = { 0xbeefbeef };
call_trace_t trace_expected;
return;
}
+ provider = IServiceProviderImpl_Construct();
+
/* null source pointer */
hr = pIUnknown_QueryServiceExec(NULL, &dummy_serviceid, &dummy_groupid, 0, 0, 0, 0);
ok(hr == E_FAIL, "got 0x%08x\n", hr);
static void test_IUnknown_ProfferService(void)
{
- IServiceProvider *provider = IServiceProviderImpl_Construct();
- IProfferService *proff = IProfferServiceImpl_Construct();
+ IServiceProvider *provider;
+ IProfferService *proff;
static const GUID dummy_serviceid = { 0xdeadbeef };
call_trace_t trace_expected;
HRESULT hr;
return;
}
+ provider = IServiceProviderImpl_Construct();
+ proff = IProfferServiceImpl_Construct();
+
/* null source pointer */
hr = pIUnknown_ProfferService(NULL, &dummy_serviceid, 0, 0);
ok(hr == E_FAIL, "got 0x%08x\n", hr);
hwnd = pSHCreateWorkerWindowA(0, NULL, 0, 0, 0, 0);
ok(hwnd != 0, "expected window\n");
- GetClassName(hwnd, classA, 20);
+ GetClassNameA(hwnd, classA, 20);
ok(lstrcmpA(classA, "WorkerA") == 0, "expected WorkerA class, got %s\n", classA);
ret = GetWindowLongPtrA(hwnd, 0);
/* class info */
memset(&cliA, 0, sizeof(cliA));
- res = GetClassInfoA(GetModuleHandle("shlwapi.dll"), "WorkerA", &cliA);
+ res = GetClassInfoA(GetModuleHandleA("shlwapi.dll"), "WorkerA", &cliA);
ok(res, "failed to get class info\n");
ok(cliA.style == 0, "got 0x%08x\n", cliA.style);
ok(cliA.cbClsExtra == 0, "got %d\n", cliA.cbClsExtra);
hwnd = pSHCreateWorkerWindowA(0, NULL, 0, 0, 0, 0xdeadbeef);
ok(hwnd != 0, "expected window\n");
- GetClassName(hwnd, classA, 20);
+ GetClassNameA(hwnd, classA, 20);
ok(lstrcmpA(classA, "WorkerA") == 0, "expected WorkerA class, got %s\n", classA);
ret = GetWindowLongPtrA(hwnd, 0);
static HRESULT (WINAPI *pPathCreateFromUrlW)(LPCWSTR, LPWSTR, LPDWORD, DWORD);
static HRESULT (WINAPI *pPathCreateFromUrlAlloc)(LPCWSTR, LPWSTR*, DWORD);
static BOOL (WINAPI *pPathAppendA)(LPSTR, LPCSTR);
+static BOOL (WINAPI *pPathUnExpandEnvStringsA)(LPCSTR, LPSTR, UINT);
+static BOOL (WINAPI *pPathUnExpandEnvStringsW)(LPCWSTR, LPWSTR, UINT);
/* ################ */
ok(ret == TEST_PATHFROMURL[i].ret, "ret %08x from url %s\n", ret, TEST_PATHFROMURL[i].url);
if(SUCCEEDED(ret) && TEST_PATHFROMURL[i].path) {
if(!(TEST_PATHFROMURL[i].todo & 0x2)) {
- ok(!lstrcmpi(ret_path, TEST_PATHFROMURL[i].path), "got %s expected %s from url %s\n", ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
+ ok(!lstrcmpiA(ret_path, TEST_PATHFROMURL[i].path), "got %s expected %s from url %s\n", ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
ok(len == strlen(ret_path), "ret len %d from url %s\n", len, TEST_PATHFROMURL[i].url);
} else todo_wine
/* Wrong string, don't bother checking the length */
- ok(!lstrcmpi(ret_path, TEST_PATHFROMURL[i].path), "got %s expected %s from url %s\n", ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
+ ok(!lstrcmpiA(ret_path, TEST_PATHFROMURL[i].path), "got %s expected %s from url %s\n", ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
}
if (pPathCreateFromUrlW) {
lstrcpyA(dest, "control");
str = PathCombineA(dest, "C:\\", NULL);
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "C:\\"), "Expected C:\\, got %s\n", str);
+ ok(!lstrcmpA(str, "C:\\"), "Expected C:\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try empty file part */
lstrcpyA(dest, "control");
str = PathCombineA(dest, "C:\\", "");
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "C:\\"), "Expected C:\\, got %s\n", str);
+ ok(!lstrcmpA(str, "C:\\"), "Expected C:\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try empty directory and file part */
lstrcpyA(dest, "control");
str = PathCombineA(dest, "", "");
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "\\") ||
- broken(!lstrcmp(str, "control")), /* Win95 and some W2K */
+ ok(!lstrcmpA(str, "\\") ||
+ broken(!lstrcmpA(str, "control")), /* Win95 and some W2K */
"Expected \\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
lstrcpyA(dest, "control");
str = PathCombineA(dest, NULL, "one\\two\\three");
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "one\\two\\three"), "Expected one\\two\\three, got %s\n", str);
+ ok(!lstrcmpA(str, "one\\two\\three"), "Expected one\\two\\three, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try NULL directory and empty file part */
lstrcpyA(dest, "control");
str = PathCombineA(dest, NULL, "");
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "\\") ||
- broken(!lstrcmp(str, "one\\two\\three")), /* Win95 and some W2K */
+ ok(!lstrcmpA(str, "\\") ||
+ broken(!lstrcmpA(str, "one\\two\\three")), /* Win95 and some W2K */
"Expected \\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef ||
broken(GetLastError() == ERROR_INVALID_PARAMETER), /* Win95 */
broken(str != NULL), /* Win95 and some W2K */
"Expected str == NULL, got %p\n", str);
ok(lstrlenA(dest) == 0 ||
- broken(!lstrcmp(dest, "control")), /* Win95 and some W2K */
+ broken(!lstrcmpA(dest, "control")), /* Win95 and some W2K */
"Expected 0 length, got %i\n", lstrlenA(dest));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
lstrcpyA(dest, "control");
str = PathCombineA(dest, "C:", "one\\two\\three");
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str);
+ ok(!lstrcmpA(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try directory with backslash */
lstrcpyA(dest, "control");
str = PathCombineA(dest, "C:\\", "one\\two\\three");
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str);
+ ok(!lstrcmpA(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try directory with backslash and file with prepended backslash */
lstrcpyA(dest, "control");
str = PathCombineA(dest, "C:\\", "\\one\\two\\three");
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str);
+ ok(!lstrcmpA(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try previous test, with backslash appended as well */
lstrcpyA(dest, "control");
str = PathCombineA(dest, "C:\\", "\\one\\two\\three\\");
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", str);
+ ok(!lstrcmpA(str, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a relative directory */
if (str)
{
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "one\\two\\three\\"), "Expected one\\two\\three\\, got %s\n", str);
+ ok(!lstrcmpA(str, "one\\two\\three\\"), "Expected one\\two\\three\\, got %s\n", str);
}
/* try forward slashes */
lstrcpyA(dest, "control");
str = PathCombineA(dest, "C:\\", "one/two/three\\");
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "C:\\one/two/three\\"), "Expected one/two/three\\, got %s\n", str);
+ ok(!lstrcmpA(str, "C:\\one/two/three\\"), "Expected one/two/three\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a really weird directory */
lstrcpyA(dest, "control");
str = PathCombineA(dest, "C:\\/\\/", "\\one\\two\\three\\");
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", str);
+ ok(!lstrcmpA(str, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try periods */
lstrcpyA(dest, "control");
str = PathCombineA(dest, "C:\\", "one\\..\\two\\.\\three");
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "C:\\two\\three"), "Expected C:\\two\\three, got %s\n", str);
+ ok(!lstrcmpA(str, "C:\\two\\three"), "Expected C:\\two\\three, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try .. as file */
lstrcpyA(dest, "control");
str = PathCombineA(dest, "C:\\", "..");
ok(str == dest, "Expected str == dest, got %p\n", str);
- ok(!lstrcmp(str, "C:\\"), "Expected C:\\, got %s\n", str);
+ ok(!lstrcmpA(str, "C:\\"), "Expected C:\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
memset(too_long, 'a', LONG_LEN);
str = PathCombineA(dest, "C:\\", too_long);
ok(str == NULL, "Expected str == NULL, got %p\n", str);
ok(lstrlenA(dest) == 0 ||
- broken(!lstrcmp(dest, "control")), /* Win95 and some W2K */
+ broken(!lstrcmpA(dest, "control")), /* Win95 and some W2K */
"Expected 0 length, got %i\n", lstrlenA(dest));
todo_wine ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
str = PathCombineA(dest, too_long, "one\\two\\three");
ok(str == NULL, "Expected str == NULL, got %p\n", str);
ok(lstrlenA(dest) == 0 ||
- broken(!lstrcmp(dest, "control")), /* Win95 and some W2K */
+ broken(!lstrcmpA(dest, "control")), /* Win95 and some W2K */
"Expected 0 length, got %i\n", lstrlenA(dest));
todo_wine ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
str = PathCombineA(dest, one, two);
ok(str == NULL, "Expected str == NULL, got %p\n", str);
ok(lstrlenA(dest) == 0 ||
- broken(!lstrcmp(dest, "control")), /* Win95 and some W2K */
+ broken(!lstrcmpA(dest, "control")), /* Win95 and some W2K */
"Expected 0 length, got %i\n", lstrlenA(dest));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
}
SetLastError(0xdeadbeef);
str = PathAddBackslashA(path);
ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
- ok(!lstrcmp(path, "one\\two\\"), "Expected one\\two\\, got %s\n", path);
+ ok(!lstrcmpA(path, "one\\two\\"), "Expected one\\two\\, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try periods */
SetLastError(0xdeadbeef);
str = PathAddBackslashA(path);
ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
- ok(!lstrcmp(path, "one\\..\\two\\"), "Expected one\\..\\two\\, got %s\n", path);
+ ok(!lstrcmpA(path, "one\\..\\two\\"), "Expected one\\..\\two\\, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try just a space */
SetLastError(0xdeadbeef);
str = PathAddBackslashA(path);
ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
- ok(!lstrcmp(path, " \\"), "Expected \\, got %s\n", path);
+ ok(!lstrcmpA(path, " \\"), "Expected \\, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* path already has backslash */
SetLastError(0xdeadbeef);
str = PathAddBackslashA(path);
ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
- ok(!lstrcmp(path, "C:\\one\\"), "Expected C:\\one\\, got %s\n", path);
+ ok(!lstrcmpA(path, "C:\\one\\"), "Expected C:\\one\\, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
memset(too_long, 'a', LONG_LEN);
char half[HALF_LEN];
BOOL res;
- lstrcpy(path, "C:\\one");
+ lstrcpyA(path, "C:\\one");
/* try NULL pszMore */
SetLastError(0xdeadbeef);
res = PathAppendA(path, NULL);
ok(!res, "Expected failure\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(path, "C:\\one"), "Expected C:\\one, got %s\n", path);
+ ok(!lstrcmpA(path, "C:\\one"), "Expected C:\\one, got %s\n", path);
/* try empty pszMore */
SetLastError(0xdeadbeef);
res = PathAppendA(path, "");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(path, "C:\\one"), "Expected C:\\one, got %s\n", path);
+ ok(!lstrcmpA(path, "C:\\one"), "Expected C:\\one, got %s\n", path);
/* try NULL pszPath */
SetLastError(0xdeadbeef);
res = PathAppendA(path, "two\\three");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(path, "two\\three"), "Expected \\two\\three, got %s\n", path);
+ ok(!lstrcmpA(path, "two\\three"), "Expected \\two\\three, got %s\n", path);
/* try empty pszPath and empty pszMore */
path[0] = '\0';
res = PathAppendA(path, "");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(path, "\\"), "Expected \\, got %s\n", path);
+ ok(!lstrcmpA(path, "\\"), "Expected \\, got %s\n", path);
/* try legit params */
- lstrcpy(path, "C:\\one");
+ lstrcpyA(path, "C:\\one");
SetLastError(0xdeadbeef);
res = PathAppendA(path, "two\\three");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path);
+ ok(!lstrcmpA(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path);
/* try pszPath with backslash after it */
- lstrcpy(path, "C:\\one\\");
+ lstrcpyA(path, "C:\\one\\");
SetLastError(0xdeadbeef);
res = PathAppendA(path, "two\\three");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path);
+ ok(!lstrcmpA(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path);
/* try pszMore with backslash before it */
- lstrcpy(path, "C:\\one");
+ lstrcpyA(path, "C:\\one");
SetLastError(0xdeadbeef);
res = PathAppendA(path, "\\two\\three");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path);
+ ok(!lstrcmpA(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path);
/* try pszMore with backslash after it */
- lstrcpy(path, "C:\\one");
+ lstrcpyA(path, "C:\\one");
SetLastError(0xdeadbeef);
res = PathAppendA(path, "two\\three\\");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(path, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", path);
+ ok(!lstrcmpA(path, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", path);
/* try spaces in pszPath */
- lstrcpy(path, "C: \\ one ");
+ lstrcpyA(path, "C: \\ one ");
SetLastError(0xdeadbeef);
res = PathAppendA(path, "two\\three");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(path, "C: \\ one \\two\\three"), "Expected C: \\ one \\two\\three, got %s\n", path);
+ ok(!lstrcmpA(path, "C: \\ one \\two\\three"), "Expected C: \\ one \\two\\three, got %s\n", path);
/* try spaces in pszMore */
- lstrcpy(path, "C:\\one");
+ lstrcpyA(path, "C:\\one");
SetLastError(0xdeadbeef);
res = PathAppendA(path, " two \\ three ");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(path, "C:\\one\\ two \\ three "), "Expected 'C:\\one\\ two \\ three ', got %s\n", path);
+ ok(!lstrcmpA(path, "C:\\one\\ two \\ three "), "Expected 'C:\\one\\ two \\ three ', got %s\n", path);
/* pszPath is too long */
memset(too_long, 'a', LONG_LEN);
res = PathAppendA(too_long, "two\\three");
ok(!res, "Expected failure\n");
todo_wine ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(lstrlen(too_long) == 0 ||
- broken(lstrlen(too_long) == (LONG_LEN - 1)), /* Win95 and some W2K */
- "Expected length of too_long to be zero, got %i\n", lstrlen(too_long));
+ ok(lstrlenA(too_long) == 0 ||
+ broken(lstrlenA(too_long) == (LONG_LEN - 1)), /* Win95 and some W2K */
+ "Expected length of too_long to be zero, got %i\n", lstrlenA(too_long));
/* pszMore is too long */
- lstrcpy(path, "C:\\one");
+ lstrcpyA(path, "C:\\one");
memset(too_long, 'a', LONG_LEN);
too_long[LONG_LEN - 1] = '\0';
SetLastError(0xdeadbeef);
res = PathAppendA(path, too_long);
ok(!res, "Expected failure\n");
todo_wine ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(lstrlen(path) == 0 ||
- broken(!lstrcmp(path, "C:\\one")), /* Win95 and some W2K */
- "Expected length of path to be zero, got %i\n", lstrlen(path));
+ ok(lstrlenA(path) == 0 ||
+ broken(!lstrcmpA(path, "C:\\one")), /* Win95 and some W2K */
+ "Expected length of path to be zero, got %i\n", lstrlenA(path));
/* both params combined are too long */
memset(path, 'a', HALF_LEN);
SetLastError(0xdeadbeef);
res = PathAppendA(path, half);
ok(!res, "Expected failure\n");
- ok(lstrlen(path) == 0 ||
- broken(lstrlen(path) == (HALF_LEN - 1)), /* Win95 and some W2K */
- "Expected length of path to be zero, got %i\n", lstrlen(path));
+ ok(lstrlenA(path) == 0 ||
+ broken(lstrlenA(path) == (HALF_LEN - 1)), /* Win95 and some W2K */
+ "Expected length of path to be zero, got %i\n", lstrlenA(path));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
}
BOOL res;
/* try a NULL source */
- lstrcpy(dest, "test");
+ lstrcpyA(dest, "test");
SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, NULL);
ok(!res, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
- ok(dest[0] == 0 || !lstrcmp(dest, "test"),
+ ok(dest[0] == 0 || !lstrcmpA(dest, "test"),
"Expected either an empty string (Vista) or test, got %s\n", dest);
/* try an empty source */
- lstrcpy(dest, "test");
+ lstrcpyA(dest, "test");
SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(dest, "\\") ||
- broken(!lstrcmp(dest, "test")), /* Win95 and some W2K */
+ ok(!lstrcmpA(dest, "\\") ||
+ broken(!lstrcmpA(dest, "test")), /* Win95 and some W2K */
"Expected \\, got %s\n", dest);
/* try a NULL dest */
res = PathCanonicalizeA(dest, "C:\\");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(dest, "C:\\"), "Expected C:\\, got %s\n", dest);
+ ok(!lstrcmpA(dest, "C:\\"), "Expected C:\\, got %s\n", dest);
/* try non-empty dest */
- lstrcpy(dest, "test");
+ lstrcpyA(dest, "test");
SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "C:\\");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(dest, "C:\\"), "Expected C:\\, got %s\n", dest);
+ ok(!lstrcmpA(dest, "C:\\"), "Expected C:\\, got %s\n", dest);
/* try a space for source */
- lstrcpy(dest, "test");
+ lstrcpyA(dest, "test");
SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, " ");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(dest, " "), "Expected ' ', got %s\n", dest);
+ ok(!lstrcmpA(dest, " "), "Expected ' ', got %s\n", dest);
/* try a relative path */
- lstrcpy(dest, "test");
+ lstrcpyA(dest, "test");
SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "one\\two");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(dest, "one\\two"), "Expected one\\two, got %s\n", dest);
+ ok(!lstrcmpA(dest, "one\\two"), "Expected one\\two, got %s\n", dest);
/* try current dir and previous dir */
- lstrcpy(dest, "test");
+ lstrcpyA(dest, "test");
SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "C:\\one\\.\\..\\two\\three\\..");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(dest, "C:\\two"), "Expected C:\\two, got %s\n", dest);
+ ok(!lstrcmpA(dest, "C:\\two"), "Expected C:\\two, got %s\n", dest);
/* try simple forward slashes */
- lstrcpy(dest, "test");
+ lstrcpyA(dest, "test");
SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "C:\\one/two/three\\four/five\\six");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(dest, "C:\\one/two/three\\four/five\\six"),
+ ok(!lstrcmpA(dest, "C:\\one/two/three\\four/five\\six"),
"Expected C:\\one/two/three\\four/five\\six, got %s\n", dest);
/* try simple forward slashes with same dir */
- lstrcpy(dest, "test");
+ lstrcpyA(dest, "test");
SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "C:\\one/.\\two");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(dest, "C:\\one/.\\two"), "Expected C:\\one/.\\two, got %s\n", dest);
+ ok(!lstrcmpA(dest, "C:\\one/.\\two"), "Expected C:\\one/.\\two, got %s\n", dest);
/* try simple forward slashes with change dir */
- lstrcpy(dest, "test");
+ lstrcpyA(dest, "test");
SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "C:\\one/.\\two\\..");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(dest, "C:\\one/.") ||
- !lstrcmp(dest, "C:\\one/"), /* Vista */
+ ok(!lstrcmpA(dest, "C:\\one/.") ||
+ !lstrcmpA(dest, "C:\\one/"), /* Vista */
"Expected \"C:\\one/.\" or \"C:\\one/\", got \"%s\"\n", dest);
/* try forward slashes with change dirs
* NOTE: if there is a forward slash in between two backslashes,
* everything in between the two backslashes is considered on dir
*/
- lstrcpy(dest, "test");
+ lstrcpyA(dest, "test");
SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "C:\\one/.\\..\\two/three\\..\\four/.five");
ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
- ok(!lstrcmp(dest, "C:\\four/.five"), "Expected C:\\four/.five, got %s\n", dest);
+ ok(!lstrcmpA(dest, "C:\\four/.five"), "Expected C:\\four/.five, got %s\n", dest);
/* try src is too long */
memset(too_long, 'a', LONG_LEN);
too_long[LONG_LEN - 1] = '\0';
- lstrcpy(dest, "test");
+ lstrcpyA(dest, "test");
SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, too_long);
ok(!res ||
ok(GetLastError() == 0xdeadbeef || GetLastError() == ERROR_FILENAME_EXCED_RANGE /* Vista */,
"Expected 0xdeadbeef or ERROR_FILENAME_EXCED_RANGE, got %d\n", GetLastError());
}
- ok(lstrlen(too_long) == LONG_LEN - 1, "Expected length LONG_LEN - 1, got %i\n", lstrlen(too_long));
+ ok(lstrlenA(too_long) == LONG_LEN - 1, "Expected length LONG_LEN - 1, got %i\n", lstrlenA(too_long));
}
static void test_PathFindExtensionA(void)
SetLastError(0xdeadbeef);
ext = PathFindExtensionA(path);
ok(ext == path, "Expected ext == path, got %p\n", ext);
- ok(lstrlen(ext) == 0, "Expected length 0, got %i\n", lstrlen(ext));
+ ok(lstrlenA(ext) == 0, "Expected length 0, got %i\n", lstrlenA(ext));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a path without an extension */
- lstrcpy(path, "file");
+ lstrcpyA(path, "file");
SetLastError(0xdeadbeef);
ext = PathFindExtensionA(path);
- ok(ext == path + lstrlen(path), "Expected ext == path, got %p\n", ext);
- ok(lstrlen(ext) == 0, "Expected length 0, got %i\n", lstrlen(ext));
+ ok(ext == path + lstrlenA(path), "Expected ext == path, got %p\n", ext);
+ ok(lstrlenA(ext) == 0, "Expected length 0, got %i\n", lstrlenA(ext));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a path with an extension */
- lstrcpy(path, "file.txt");
+ lstrcpyA(path, "file.txt");
SetLastError(0xdeadbeef);
ext = PathFindExtensionA(path);
- ok(ext == path + lstrlen("file"),
- "Expected ext == path + lstrlen(\"file\"), got %p\n", ext);
- ok(!lstrcmp(ext, ".txt"), "Expected .txt, got %s\n", ext);
+ ok(ext == path + lstrlenA("file"),
+ "Expected ext == path + lstrlenA(\"file\"), got %p\n", ext);
+ ok(!lstrcmpA(ext, ".txt"), "Expected .txt, got %s\n", ext);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a path with two extensions */
- lstrcpy(path, "file.txt.doc");
+ lstrcpyA(path, "file.txt.doc");
SetLastError(0xdeadbeef);
ext = PathFindExtensionA(path);
- ok(ext == path + lstrlen("file.txt"),
- "Expected ext == path + lstrlen(\"file.txt\"), got %p\n", ext);
- ok(!lstrcmp(ext, ".doc"), "Expected .txt, got %s\n", ext);
+ ok(ext == path + lstrlenA("file.txt"),
+ "Expected ext == path + lstrlenA(\"file.txt\"), got %p\n", ext);
+ ok(!lstrcmpA(ext, ".doc"), "Expected .txt, got %s\n", ext);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a path longer than MAX_PATH without an extension*/
/* try a path longer than MAX_PATH with an extension*/
memset(too_long, 'a', LONG_LEN);
too_long[LONG_LEN - 1] = '\0';
- lstrcpy(too_long + 300, ".abcde");
- too_long[lstrlen(too_long)] = 'a';
+ lstrcpyA(too_long + 300, ".abcde");
+ too_long[lstrlenA(too_long)] = 'a';
SetLastError(0xdeadbeef);
ext = PathFindExtensionA(too_long);
ok(ext == too_long + 300, "Expected ext == too_long + 300, got %p\n", ext);
- ok(lstrlen(ext) == LONG_LEN - 301, "Expected LONG_LEN - 301, got %i\n", lstrlen(ext));
+ ok(lstrlenA(ext) == LONG_LEN - 301, "Expected LONG_LEN - 301, got %i\n", lstrlenA(ext));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
}
for (j = 0; j < 26; j++)
{
SetLastError(0xdeadbeef);
- lstrcpy(path, "aaaaaaaaa");
+ lstrcpyA(path, "aaaaaaaaa");
root = PathBuildRootA(path, j);
ok(root == path, "Expected root == path, got %p\n", root);
- ok(!lstrcmp(root, root_expected[j]), "Expected %s, got %s\n", root_expected[j], root);
+ ok(!lstrcmpA(root, root_expected[j]), "Expected %s, got %s\n", root_expected[j], root);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
}
/* test a negative drive number */
SetLastError(0xdeadbeef);
- lstrcpy(path, "aaaaaaaaa");
+ lstrcpyA(path, "aaaaaaaaa");
root = PathBuildRootA(path, -1);
ok(root == path, "Expected root == path, got %p\n", root);
- ok(!lstrcmp(path, "aaaaaaaaa") ||
+ ok(!lstrcmpA(path, "aaaaaaaaa") ||
lstrlenA(path) == 0, /* Vista */
"Expected aaaaaaaaa or empty string, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* test a drive number greater than 25 */
SetLastError(0xdeadbeef);
- lstrcpy(path, "aaaaaaaaa");
+ lstrcpyA(path, "aaaaaaaaa");
root = PathBuildRootA(path, 26);
ok(root == path, "Expected root == path, got %p\n", root);
- ok(!lstrcmp(path, "aaaaaaaaa") ||
+ ok(!lstrcmpA(path, "aaaaaaaaa") ||
lstrlenA(path) == 0, /* Vista */
"Expected aaaaaaaaa or empty string, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* length of path is less than 4 */
SetLastError(0xdeadbeef);
- lstrcpy(path, "aa");
+ lstrcpyA(path, "aa");
root = PathBuildRootA(path, 0);
ok(root == path, "Expected root == path, got %p\n", root);
- ok(!lstrcmp(path, "A:\\"), "Expected A:\\, got %s\n", path);
+ ok(!lstrcmpA(path, "A:\\"), "Expected A:\\, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* path is NULL */
/* test NULL path1 */
SetLastError(0xdeadbeef);
- lstrcpy(path2, "C:\\");
- lstrcpy(out, "aaa");
+ lstrcpyA(path2, "C:\\");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(NULL, path2, out);
ok(count == 0, "Expected 0, got %i\n", count);
todo_wine
{
- ok(!lstrcmp(out, "aaa"), "Expected aaa, got %s\n", out);
+ ok(!lstrcmpA(out, "aaa"), "Expected aaa, got %s\n", out);
}
- ok(!lstrcmp(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
+ ok(!lstrcmpA(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* test NULL path2 */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "C:\\");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "C:\\");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, NULL, out);
ok(count == 0, "Expected 0, got %i\n", count);
todo_wine
{
- ok(!lstrcmp(out, "aaa"), "Expected aaa, got %s\n", out);
+ ok(!lstrcmpA(out, "aaa"), "Expected aaa, got %s\n", out);
}
- ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
+ ok(!lstrcmpA(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* test empty path1 */
SetLastError(0xdeadbeef);
path1[0] = '\0';
- lstrcpy(path2, "C:\\");
- lstrcpy(out, "aaa");
+ lstrcpyA(path2, "C:\\");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 0, "Expected 0, got %i\n", count);
- ok(lstrlen(out) == 0, "Expected 0 length out, got %i\n", lstrlen(out));
- ok(lstrlen(path1) == 0, "Expected 0 length path1, got %i\n", lstrlen(path1));
- ok(!lstrcmp(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
+ ok(lstrlenA(out) == 0, "Expected 0 length out, got %i\n", lstrlenA(out));
+ ok(lstrlenA(path1) == 0, "Expected 0 length path1, got %i\n", lstrlenA(path1));
+ ok(!lstrcmpA(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* test empty path1 */
SetLastError(0xdeadbeef);
path2[0] = '\0';
- lstrcpy(path1, "C:\\");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "C:\\");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 0, "Expected 0, got %i\n", count);
- ok(lstrlen(out) == 0, "Expected 0 length out, got %i\n", lstrlen(out));
- ok(lstrlen(path2) == 0, "Expected 0 length path2, got %i\n", lstrlen(path2));
- ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
+ ok(lstrlenA(out) == 0, "Expected 0 length out, got %i\n", lstrlenA(out));
+ ok(lstrlenA(path2) == 0, "Expected 0 length path2, got %i\n", lstrlenA(path2));
+ ok(!lstrcmpA(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* paths are legit, out is NULL */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "C:\\");
- lstrcpy(path2, "C:\\");
+ lstrcpyA(path1, "C:\\");
+ lstrcpyA(path2, "C:\\");
count = PathCommonPrefixA(path1, path2, NULL);
ok(count == 3, "Expected 3, got %i\n", count);
- ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
- ok(!lstrcmp(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
+ ok(!lstrcmpA(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
+ ok(!lstrcmpA(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* all parameters legit */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "C:\\");
- lstrcpy(path2, "C:\\");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "C:\\");
+ lstrcpyA(path2, "C:\\");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 3, "Expected 3, got %i\n", count);
- ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
- ok(!lstrcmp(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
- ok(!lstrcmp(out, "C:\\"), "Expected C:\\, got %s\n", out);
+ ok(!lstrcmpA(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
+ ok(!lstrcmpA(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
+ ok(!lstrcmpA(out, "C:\\"), "Expected C:\\, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* path1 and path2 not the same, but common prefix */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "C:\\one\\two");
- lstrcpy(path2, "C:\\one\\three");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "C:\\one\\two");
+ lstrcpyA(path2, "C:\\one\\three");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 6, "Expected 6, got %i\n", count);
- ok(!lstrcmp(path1, "C:\\one\\two"), "Expected C:\\one\\two, got %s\n", path1);
- ok(!lstrcmp(path2, "C:\\one\\three"), "Expected C:\\one\\three, got %s\n", path2);
- ok(!lstrcmp(out, "C:\\one"), "Expected C:\\one, got %s\n", out);
+ ok(!lstrcmpA(path1, "C:\\one\\two"), "Expected C:\\one\\two, got %s\n", path1);
+ ok(!lstrcmpA(path2, "C:\\one\\three"), "Expected C:\\one\\three, got %s\n", path2);
+ ok(!lstrcmpA(out, "C:\\one"), "Expected C:\\one, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try . prefix */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "one\\.two");
- lstrcpy(path2, "one\\.three");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "one\\.two");
+ lstrcpyA(path2, "one\\.three");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 3, "Expected 3, got %i\n", count);
- ok(!lstrcmp(path1, "one\\.two"), "Expected one\\.two, got %s\n", path1);
- ok(!lstrcmp(path2, "one\\.three"), "Expected one\\.three, got %s\n", path2);
- ok(!lstrcmp(out, "one"), "Expected one, got %s\n", out);
+ ok(!lstrcmpA(path1, "one\\.two"), "Expected one\\.two, got %s\n", path1);
+ ok(!lstrcmpA(path2, "one\\.three"), "Expected one\\.three, got %s\n", path2);
+ ok(!lstrcmpA(out, "one"), "Expected one, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try .. prefix */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "one\\..two");
- lstrcpy(path2, "one\\..three");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "one\\..two");
+ lstrcpyA(path2, "one\\..three");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 3, "Expected 3, got %i\n", count);
- ok(!lstrcmp(path1, "one\\..two"), "Expected one\\..two, got %s\n", path1);
- ok(!lstrcmp(path2, "one\\..three"), "Expected one\\..three, got %s\n", path2);
- ok(!lstrcmp(out, "one"), "Expected one, got %s\n", out);
+ ok(!lstrcmpA(path1, "one\\..two"), "Expected one\\..two, got %s\n", path1);
+ ok(!lstrcmpA(path2, "one\\..three"), "Expected one\\..three, got %s\n", path2);
+ ok(!lstrcmpA(out, "one"), "Expected one, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try ... prefix */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "one\\...two");
- lstrcpy(path2, "one\\...three");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "one\\...two");
+ lstrcpyA(path2, "one\\...three");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 3, "Expected 3, got %i\n", count);
- ok(!lstrcmp(path1, "one\\...two"), "Expected one\\...two, got %s\n", path1);
- ok(!lstrcmp(path2, "one\\...three"), "Expected one\\...three, got %s\n", path2);
- ok(!lstrcmp(out, "one"), "Expected one, got %s\n", out);
+ ok(!lstrcmpA(path1, "one\\...two"), "Expected one\\...two, got %s\n", path1);
+ ok(!lstrcmpA(path2, "one\\...three"), "Expected one\\...three, got %s\n", path2);
+ ok(!lstrcmpA(out, "one"), "Expected one, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try .\ prefix */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "one\\.\\two");
- lstrcpy(path2, "one\\.\\three");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "one\\.\\two");
+ lstrcpyA(path2, "one\\.\\three");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 5, "Expected 5, got %i\n", count);
- ok(!lstrcmp(path1, "one\\.\\two"), "Expected one\\.\\two, got %s\n", path1);
- ok(!lstrcmp(path2, "one\\.\\three"), "Expected one\\.\\three, got %s\n", path2);
- ok(!lstrcmp(out, "one\\."), "Expected one\\., got %s\n", out);
+ ok(!lstrcmpA(path1, "one\\.\\two"), "Expected one\\.\\two, got %s\n", path1);
+ ok(!lstrcmpA(path2, "one\\.\\three"), "Expected one\\.\\three, got %s\n", path2);
+ ok(!lstrcmpA(out, "one\\."), "Expected one\\., got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try ..\ prefix */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "one\\..\\two");
- lstrcpy(path2, "one\\..\\three");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "one\\..\\two");
+ lstrcpyA(path2, "one\\..\\three");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 6, "Expected 6, got %i\n", count);
- ok(!lstrcmp(path1, "one\\..\\two"), "Expected one\\..\\two, got %s\n", path1);
- ok(!lstrcmp(path2, "one\\..\\three"), "Expected one\\..\\three, got %s\n", path2);
- ok(!lstrcmp(out, "one\\.."), "Expected one\\.., got %s\n", out);
+ ok(!lstrcmpA(path1, "one\\..\\two"), "Expected one\\..\\two, got %s\n", path1);
+ ok(!lstrcmpA(path2, "one\\..\\three"), "Expected one\\..\\three, got %s\n", path2);
+ ok(!lstrcmpA(out, "one\\.."), "Expected one\\.., got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try ...\\ prefix */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "one\\...\\two");
- lstrcpy(path2, "one\\...\\three");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "one\\...\\two");
+ lstrcpyA(path2, "one\\...\\three");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 7, "Expected 7, got %i\n", count);
- ok(!lstrcmp(path1, "one\\...\\two"), "Expected one\\...\\two, got %s\n", path1);
- ok(!lstrcmp(path2, "one\\...\\three"), "Expected one\\...\\three, got %s\n", path2);
- ok(!lstrcmp(out, "one\\..."), "Expected one\\..., got %s\n", out);
+ ok(!lstrcmpA(path1, "one\\...\\two"), "Expected one\\...\\two, got %s\n", path1);
+ ok(!lstrcmpA(path2, "one\\...\\three"), "Expected one\\...\\three, got %s\n", path2);
+ ok(!lstrcmpA(out, "one\\..."), "Expected one\\..., got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try prefix that is not an msdn labeled prefix type */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "same");
- lstrcpy(path2, "same");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "same");
+ lstrcpyA(path2, "same");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 4, "Expected 4, got %i\n", count);
- ok(!lstrcmp(path1, "same"), "Expected same, got %s\n", path1);
- ok(!lstrcmp(path2, "same"), "Expected same, got %s\n", path2);
- ok(!lstrcmp(out, "same"), "Expected same, got %s\n", out);
+ ok(!lstrcmpA(path1, "same"), "Expected same, got %s\n", path1);
+ ok(!lstrcmpA(path2, "same"), "Expected same, got %s\n", path2);
+ ok(!lstrcmpA(out, "same"), "Expected same, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try . after directory */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "one\\mid.\\two");
- lstrcpy(path2, "one\\mid.\\three");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "one\\mid.\\two");
+ lstrcpyA(path2, "one\\mid.\\three");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 8, "Expected 8, got %i\n", count);
- ok(!lstrcmp(path1, "one\\mid.\\two"), "Expected one\\mid.\\two, got %s\n", path1);
- ok(!lstrcmp(path2, "one\\mid.\\three"), "Expected one\\mid.\\three, got %s\n", path2);
- ok(!lstrcmp(out, "one\\mid."), "Expected one\\mid., got %s\n", out);
+ ok(!lstrcmpA(path1, "one\\mid.\\two"), "Expected one\\mid.\\two, got %s\n", path1);
+ ok(!lstrcmpA(path2, "one\\mid.\\three"), "Expected one\\mid.\\three, got %s\n", path2);
+ ok(!lstrcmpA(out, "one\\mid."), "Expected one\\mid., got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try . in the middle of a directory */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "one\\mid.end\\two");
- lstrcpy(path2, "one\\mid.end\\three");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "one\\mid.end\\two");
+ lstrcpyA(path2, "one\\mid.end\\three");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 11, "Expected 11, got %i\n", count);
- ok(!lstrcmp(path1, "one\\mid.end\\two"), "Expected one\\mid.end\\two, got %s\n", path1);
- ok(!lstrcmp(path2, "one\\mid.end\\three"), "Expected one\\mid.end\\three, got %s\n", path2);
- ok(!lstrcmp(out, "one\\mid.end"), "Expected one\\mid.end, got %s\n", out);
+ ok(!lstrcmpA(path1, "one\\mid.end\\two"), "Expected one\\mid.end\\two, got %s\n", path1);
+ ok(!lstrcmpA(path2, "one\\mid.end\\three"), "Expected one\\mid.end\\three, got %s\n", path2);
+ ok(!lstrcmpA(out, "one\\mid.end"), "Expected one\\mid.end, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try comparing a .. with the expanded path */
SetLastError(0xdeadbeef);
- lstrcpy(path1, "one\\..\\two");
- lstrcpy(path2, "two");
- lstrcpy(out, "aaa");
+ lstrcpyA(path1, "one\\..\\two");
+ lstrcpyA(path2, "two");
+ lstrcpyA(out, "aaa");
count = PathCommonPrefixA(path1, path2, out);
ok(count == 0, "Expected 0, got %i\n", count);
- ok(!lstrcmp(path1, "one\\..\\two"), "Expected one\\..\\two, got %s\n", path1);
- ok(!lstrcmp(path2, "two"), "Expected two, got %s\n", path2);
- ok(lstrlen(out) == 0, "Expected 0 length out, got %i\n", lstrlen(out));
+ ok(!lstrcmpA(path1, "one\\..\\two"), "Expected one\\..\\two, got %s\n", path1);
+ ok(!lstrcmpA(path2, "two"), "Expected two, got %s\n", path2);
+ ok(lstrlenA(out) == 0, "Expected 0 length out, got %i\n", lstrlenA(out));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
}
ok(ret == -1, "got %d\n", ret);
}
-/* ################ */
+static void test_PathUnExpandEnvStrings(void)
+{
+ static const WCHAR sysrootW[] = {'%','S','y','s','t','e','m','R','o','o','t','%',0};
+ static const WCHAR sysdriveW[] = {'%','S','y','s','t','e','m','D','r','i','v','e','%',0};
+ static const WCHAR nonpathW[] = {'p','a','t','h',0};
+ static const char sysrootA[] = "%SystemRoot%";
+ static const char sysdriveA[] = "%SystemDrive%";
+ WCHAR pathW[MAX_PATH], buffW[MAX_PATH], sysdrvW[3];
+ char path[MAX_PATH], buff[MAX_PATH], sysdrvA[3], envvarA[10];
+ BOOL ret;
+ UINT len;
+
+ if (!pPathUnExpandEnvStringsA || !pPathUnExpandEnvStringsW)
+ {
+ win_skip("PathUnExpandEnvStrings not available\n");
+ return;
+ }
+
+ /* something that can't be represented with env var */
+ strcpy(path, "somepath_name");
+ strcpy(buff, "xx");
+ SetLastError(0xdeadbeef);
+ ret = pPathUnExpandEnvStringsA(path, buff, sizeof(buff));
+ ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
+ ok(buff[0] == 'x', "wrong return string %s\n", buff);
+
+ len = GetSystemDirectoryA(path, MAX_PATH);
+ ok(len > 0, "failed to get sysdir\n");
+
+ sysdrvA[0] = path[0];
+ strcpy(&sysdrvA[1], ":");
+
+ /* buffer size is not enough */
+ strcpy(buff, "xx");
+ SetLastError(0xdeadbeef);
+ ret = pPathUnExpandEnvStringsA(path, buff, 5);
+ ok(!ret && GetLastError() == 0xdeadbeef, "got %d\n", ret);
+ ok(buff[0] == 'x', "wrong return string %s\n", buff);
+
+ /* buffer size is enough to hold variable name only */
+ strcpy(buff, "xx");
+ SetLastError(0xdeadbeef);
+ ret = pPathUnExpandEnvStringsA(path, buff, sizeof(sysrootA));
+ ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
+ ok(buff[0] == 'x', "wrong return string %s\n", buff);
+
+ /* enough size */
+ buff[0] = 0;
+ ret = pPathUnExpandEnvStringsA(path, buff, sizeof(buff));
+ ok(ret, "got %d\n", ret);
+ ok(!strncmp(buff, sysrootA, sizeof(sysrootA)-1), "wrong return string %s\n", buff);
+
+ /* expanded value occurs multiple times */
+ /* for drive C: it unexpands it like 'C:C:' -> '%SystemDrive%C:' */
+ buff[0] = 0;
+ strcpy(path, sysdrvA);
+ strcat(path, sysdrvA);
+ ret = pPathUnExpandEnvStringsA(path, buff, sizeof(buff));
+ ok(ret, "got %d\n", ret);
+ /* expected string */
+ strcpy(path, sysdriveA);
+ strcat(path, sysdrvA);
+ ok(!strcmp(buff, path), "wrong unexpanded string %s, expected %s\n", buff, path);
+
+ /* now with altered variable */
+ ret = GetEnvironmentVariableA("SystemDrive", envvarA, sizeof(envvarA));
+ ok(ret, "got %d\n", ret);
+
+ ret = SetEnvironmentVariableA("SystemDrive", "WW");
+ ok(ret, "got %d\n", ret);
+
+ /* variables are not cached */
+ strcpy(path, sysdrvA);
+ strcat(path, sysdrvA);
+ SetLastError(0xdeadbeef);
+ ret = pPathUnExpandEnvStringsA(path, buff, sizeof(buff));
+ ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
+
+ ret = SetEnvironmentVariableA("SystemDrive", envvarA);
+ ok(ret, "got %d\n", ret);
+
+ /* PathUnExpandEnvStringsW */
+
+ /* something that can't be represented with env var */
+ lstrcpyW(pathW, nonpathW);
+ buffW[0] = 'x'; buffW[1] = 0;
+ SetLastError(0xdeadbeef);
+ ret = pPathUnExpandEnvStringsW(pathW, buffW, sizeof(buffW)/sizeof(WCHAR));
+ ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
+ ok(buffW[0] == 'x', "wrong return string %s\n", wine_dbgstr_w(buffW));
+
+ len = GetSystemDirectoryW(pathW, MAX_PATH);
+ ok(len > 0, "failed to get sysdir\n");
+
+ sysdrvW[0] = pathW[0];
+ sysdrvW[1] = ':';
+ sysdrvW[2] = 0;
+
+ /* buffer size is not enough */
+ buffW[0] = 'x'; buffW[1] = 0;
+ SetLastError(0xdeadbeef);
+ ret = pPathUnExpandEnvStringsW(pathW, buffW, 5);
+ ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
+ ok(buffW[0] == 'x', "wrong return string %s\n", wine_dbgstr_w(buffW));
+
+ /* buffer size is enough to hold variable name only */
+ buffW[0] = 'x'; buffW[1] = 0;
+ SetLastError(0xdeadbeef);
+ ret = pPathUnExpandEnvStringsW(pathW, buffW, sizeof(sysrootW)/sizeof(WCHAR));
+ ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
+ ok(buffW[0] == 'x', "wrong return string %s\n", wine_dbgstr_w(buffW));
+
+ /* enough size */
+ buffW[0] = 0;
+ ret = pPathUnExpandEnvStringsW(pathW, buffW, sizeof(buffW)/sizeof(WCHAR));
+ ok(ret, "got %d\n", ret);
+ ok(!memcmp(buffW, sysrootW, sizeof(sysrootW) - sizeof(WCHAR)), "wrong return string %s\n", wine_dbgstr_w(buffW));
+
+ /* expanded value occurs multiple times */
+ /* for drive C: it unexpands it like 'C:C:' -> '%SystemDrive%C:' */
+ buffW[0] = 0;
+ lstrcpyW(pathW, sysdrvW);
+ lstrcatW(pathW, sysdrvW);
+ ret = pPathUnExpandEnvStringsW(pathW, buffW, sizeof(buff)/sizeof(WCHAR));
+ ok(ret, "got %d\n", ret);
+ /* expected string */
+ lstrcpyW(pathW, sysdriveW);
+ lstrcatW(pathW, sysdrvW);
+ ok(!lstrcmpW(buffW, pathW), "wrong unexpanded string %s, expected %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(pathW));
+}
START_TEST(path)
{
pPathIsValidCharA = (void*)GetProcAddress(hShlwapi, (LPSTR)455);
pPathIsValidCharW = (void*)GetProcAddress(hShlwapi, (LPSTR)456);
pPathAppendA = (void*)GetProcAddress(hShlwapi, "PathAppendA");
+ pPathUnExpandEnvStringsA = (void*)GetProcAddress(hShlwapi, "PathUnExpandEnvStringsA");
+ pPathUnExpandEnvStringsW = (void*)GetProcAddress(hShlwapi, "PathUnExpandEnvStringsW");
test_PathSearchAndQualify();
test_PathCreateFromUrl();
test_PathCommonPrefixA();
test_PathUnquoteSpaces();
test_PathGetDriveNumber();
+ test_PathUnExpandEnvStrings();
}