Fungsi PathCchIsRoot (pathcch.h)
Menentukan apakah string jalur mengacu pada akar volume.
Fungsi ini berbeda dari PathIsRoot karena menerima jalur dengan awalan "\", "\?" dan "\?\UNC".
Sintaks
WINPATHCCHAPI BOOL PathCchIsRoot(
[in, optional] PCWSTR pszPath
);
Parameter
[in, optional] pszPath
Penunjuk ke string jalur.
Nilai kembali
Mengembalikan TRUE jika jalur yang ditentukan adalah root, atau FALSE jika tidak.
Keterangan
Tabel berikut ini memperlihatkan nilai pengembalian PathCchIsRoot untuk berbagai jalur.
Jalur | PathCchIsRoot |
---|---|
"c:\" | TRUE |
"c:" | FALSE |
"c:\path1" | FALSE |
"\path1" | TRUE |
"path1" | FALSE |
"\\path1\path2" | TRUE |
"\\path1\path2\" | FALSE |
"\\path1\path2\path3" | FALSE |
"\\path1" | TRUE |
"\\path1\" | FALSE |
"\\" | TRUE |
"\\?\UNC\" | TRUE |
"\\?\UNC\path1\path2" | TRUE |
"\\?\UNC\path1\path2\" | FALSE |
"\\?\UNC\path1\path2\path3" | FALSE |
"\\?\UNC\path1" | TRUE |
"\\?\UNC\path1\" | FALSE |
"\\?\c:\" | TRUE |
"\\?\c:" | FALSE |
"\\?\c:\path1" | FALSE |
"\\?\Volume{guid}\" | TRUE |
"\\?\Volume{guid}" | FALSE |
"\\?\Volume{guid}\path1" | SALAH |
NULL | SALAH |
"" | FALSE |
Fungsi ini mengembalikan TRUE untuk jalur seperti "", "X:" atau "\\server\share". Jalur seperti ".. \path2" atau "\\server" mengembalikan FALSE.
Persyaratan
Persyaratan | Nilai |
---|---|
Klien minimum yang didukung | Windows 8 [aplikasi desktop | Aplikasi UWP] |
Server minimum yang didukung | Windows Server 2012 [aplikasi desktop | Aplikasi UWP] |
Target Platform | Windows |
Header | pathcch.h |
Pustaka | Pathcch.lib |