shlwapi: Implement PathSearchAndQualify
Huw D M Davies
h.davies1 at physics.ox.ac.uk
Thu Sep 23 09:27:56 CDT 2004
Huw Davies <huw at codeweavers.com>
Implement PathSearchAndQualify and add a test.
--
Huw Davies
huw at codeweavers.com
Index: dlls/shlwapi/path.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/path.c,v
retrieving revision 1.46
diff -u -r1.46 path.c
--- dlls/shlwapi/path.c 10 Sep 2004 21:12:11 -0000 1.46
+++ dlls/shlwapi/path.c 23 Sep 2004 14:22:36 -0000
@@ -3115,8 +3115,9 @@
*/
BOOL WINAPI PathSearchAndQualifyA(LPCSTR lpszPath, LPSTR lpszBuf, UINT cchBuf)
{
- FIXME("(%s,%p,0x%08x)-stub\n", debugstr_a(lpszPath), lpszBuf, cchBuf);
- return FALSE;
+ TRACE("(%s,%p,0x%08x)\n", debugstr_a(lpszPath), lpszBuf, cchBuf);
+
+ return !!GetFullPathNameA(lpszPath, cchBuf, lpszBuf, NULL);
}
/*************************************************************************
@@ -3126,8 +3127,9 @@
*/
BOOL WINAPI PathSearchAndQualifyW(LPCWSTR lpszPath, LPWSTR lpszBuf, UINT cchBuf)
{
- FIXME("(%s,%p,0x%08x)-stub\n", debugstr_w(lpszPath), lpszBuf, cchBuf);
- return FALSE;
+ TRACE("(%s,%p,0x%08x)\n", debugstr_w(lpszPath), lpszBuf, cchBuf);
+
+ return !!GetFullPathNameW(lpszPath, cchBuf, lpszBuf, NULL);
}
/*************************************************************************
Index: dlls/shlwapi/tests/path.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/tests/path.c,v
retrieving revision 1.10
diff -u -r1.10 path.c
--- dlls/shlwapi/tests/path.c 9 Aug 2004 18:52:18 -0000 1.10
+++ dlls/shlwapi/tests/path.c 23 Sep 2004 14:22:36 -0000
@@ -293,6 +293,28 @@
}
}
+static void test_PathSearchAndQualify(void)
+{
+ WCHAR path1[] = {'c',':','\\','f','o','o',0};
+ WCHAR expect1[] = {'C',':','\\','f','o','o',0};
+ WCHAR path2[] = {'c',':','f','o','o',0};
+ WCHAR c_drive[] = {'c',':',0};
+ WCHAR foo[] = {'f','o','o',0};
+ WCHAR out[MAX_PATH];
+ WCHAR cur_dir[MAX_PATH];
+
+ ok(PathSearchAndQualifyW(path1, out, MAX_PATH) != 0,
+ "PathSearchAndQualify rets 0\n");
+ ok(!strcmpW(out, expect1), "strings don't match\n");
+
+ ok(PathSearchAndQualifyW(path2, out, MAX_PATH) != 0,
+ "PathSearchAndQualify rets 0\n");
+ GetFullPathNameW(c_drive, MAX_PATH, cur_dir, NULL);
+ PathAddBackslashW(cur_dir);
+ strcatW(cur_dir, foo);
+ ok(!strcmpW(out, cur_dir), "strings don't match\n");
+}
+
START_TEST(path)
{
test_UrlHash();
@@ -300,4 +322,6 @@
test_UrlCanonicalize();
test_UrlEscape();
test_UrlCombine();
+
+ test_PathSearchAndQualify();
}
More information about the wine-patches
mailing list