4 #include <winpr/path.h>
5 #include <winpr/tchar.h>
6 #include <winpr/winpr.h>
8 static const TCHAR testServer[] = _T(
"server\\share\\path\\file");
9 static const TCHAR testPathUNC[] = _T(
"\\\\server\\share\\path\\file");
10 static const TCHAR testPathNotUNC[] = _T(
"C:\\share\\path\\file");
12 int TestPathIsUNCEx(
int argc,
char* argv[])
15 LPCTSTR Server = NULL;
16 TCHAR Path[PATHCCH_MAX_CCH] = { 0 };
23 _tcsncpy(Path, testPathUNC, ARRAYSIZE(Path));
25 status = PathIsUNCEx(Path, &Server);
29 _tprintf(_T(
"PathIsUNCEx status: 0x%d\n"), status);
33 if (_tcsncmp(Server, testServer, ARRAYSIZE(testServer)) != 0)
35 _tprintf(_T(
"Server Name Mismatch: Actual: %s, Expected: %s\n"), Server, testServer);
41 _tcsncpy(Path, testPathNotUNC, ARRAYSIZE(Path));
43 status = PathIsUNCEx(Path, &Server);
47 _tprintf(_T(
"PathIsUNCEx status: 0x%08") _T(PRIX32) _T(
"\n"), status);