Milestone 5: deliver embedded RDP sessions and lifecycle hardening

This commit is contained in:
Keith Smith
2026-03-03 18:59:26 -07:00
parent 230a401386
commit 36006bd4aa
2941 changed files with 724359 additions and 77 deletions

View File

@@ -0,0 +1,52 @@
#include <stdio.h>
#include <winpr/crt.h>
#include <winpr/path.h>
#include <winpr/tchar.h>
#include <winpr/winpr.h>
static const TCHAR testServer[] = _T("server\\share\\path\\file");
static const TCHAR testPathUNC[] = _T("\\\\server\\share\\path\\file");
static const TCHAR testPathNotUNC[] = _T("C:\\share\\path\\file");
int TestPathIsUNCEx(int argc, char* argv[])
{
BOOL status = 0;
LPCTSTR Server = nullptr;
TCHAR Path[PATHCCH_MAX_CCH] = WINPR_C_ARRAY_INIT;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
/* Path is UNC */
_tcsncpy(Path, testPathUNC, ARRAYSIZE(Path));
status = PathIsUNCEx(Path, &Server);
if (!status)
{
_tprintf(_T("PathIsUNCEx status: 0x%d\n"), status);
return -1;
}
if (_tcsncmp(Server, testServer, ARRAYSIZE(testServer)) != 0)
{
_tprintf(_T("Server Name Mismatch: Actual: %s, Expected: %s\n"), Server, testServer);
return -1;
}
/* Path is not UNC */
_tcsncpy(Path, testPathNotUNC, ARRAYSIZE(Path));
status = PathIsUNCEx(Path, &Server);
if (status)
{
_tprintf(_T("PathIsUNCEx status: 0x%08") _T(PRIX32) _T("\n"), status);
return -1;
}
return 0;
}