| 1 |
/** |
| 2 |
* This file is part of the mingw-w64 runtime package. |
| 3 |
* No warranty is given; refer to the file DISCLAIMER within this package. |
| 4 |
*/ |
| 5 |
|
| 6 |
#include <apiset.h> |
| 7 |
#include <apisetcconv.h> |
| 8 |
#include <minwindef.h> |
| 9 |
#include <minwinbase.h> |
| 10 |
|
| 11 |
#ifdef __cplusplus |
| 12 |
extern "C" { |
| 13 |
#endif |
| 14 |
|
| 15 |
#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP) |
| 16 |
|
| 17 |
#define VOLUME_PREFIX L"\\\\?\\Volume" |
| 18 |
#define VOLUME_PREFIX_LEN (ARRAYSIZE (VOLUME_PREFIX) - 1) |
| 19 |
|
| 20 |
#define PATHCCH_ALLOW_LONG_PATHS 0x00000001 |
| 21 |
#define PATHCCH_MAX_CCH 0x8000 |
| 22 |
|
| 23 |
WINPATHCCHAPI HRESULT APIENTRY PathAllocCombine (PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFlags, PWSTR *ppszPathOut); |
| 24 |
WINPATHCCHAPI HRESULT APIENTRY PathAllocCanonicalize (PCWSTR pszPathIn, unsigned long dwFlags, PWSTR *ppszPathOut); |
| 25 |
WINPATHCCHAPI HRESULT APIENTRY PathCchAddBackslash (PWSTR pszPath, size_t cchPath); |
| 26 |
WINPATHCCHAPI HRESULT APIENTRY PathCchAddBackslashEx (PWSTR pszPath, size_t cchPath, PWSTR *ppszEnd, size_t *pcchRemaining); |
| 27 |
WINPATHCCHAPI HRESULT APIENTRY PathCchAddExtension (PWSTR pszPath, size_t cchPath, PCWSTR pszExt); |
| 28 |
WINPATHCCHAPI HRESULT APIENTRY PathCchAppend (PWSTR pszPath, size_t cchPath, PCWSTR pszMore); |
| 29 |
WINPATHCCHAPI HRESULT APIENTRY PathCchAppendEx (PWSTR pszPath, size_t cchPath, PCWSTR pszMore, unsigned long dwFlags); |
| 30 |
WINPATHCCHAPI HRESULT APIENTRY PathCchCanonicalize (PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn); |
| 31 |
WINPATHCCHAPI HRESULT APIENTRY PathCchCanonicalizeEx (PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, unsigned long dwFlags); |
| 32 |
WINPATHCCHAPI HRESULT APIENTRY PathCchCombine (PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, PCWSTR pszMore); |
| 33 |
WINPATHCCHAPI HRESULT APIENTRY PathCchCombineEx (PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFlags); |
| 34 |
WINPATHCCHAPI HRESULT APIENTRY PathCchFindExtension (PCWSTR pszPath, size_t cchPath, PCWSTR *ppszExt); |
| 35 |
WINPATHCCHAPI WINBOOL APIENTRY PathCchIsRoot (PCWSTR pszPath); |
| 36 |
WINPATHCCHAPI HRESULT APIENTRY PathCchRemoveBackslashEx (PWSTR pszPath, size_t cchPath, PWSTR *ppszEnd, size_t *pcchRemaining); |
| 37 |
WINPATHCCHAPI HRESULT APIENTRY PathCchRemoveBackslash (PWSTR pszPath, size_t cchPath); |
| 38 |
WINPATHCCHAPI HRESULT APIENTRY PathCchRemoveExtension (PWSTR pszPath, size_t cchPath); |
| 39 |
WINPATHCCHAPI HRESULT APIENTRY PathCchRemoveFileSpec (PWSTR pszPath, size_t cchPath); |
| 40 |
WINPATHCCHAPI HRESULT APIENTRY PathCchRenameExtension (PWSTR pszPath, size_t cchPath, PCWSTR pszExt); |
| 41 |
WINPATHCCHAPI HRESULT APIENTRY PathCchSkipRoot (PCWSTR pszPath, PCWSTR *ppszRootEnd); |
| 42 |
WINPATHCCHAPI HRESULT APIENTRY PathCchStripPrefix (PWSTR pszPath, size_t cchPath); |
| 43 |
WINPATHCCHAPI HRESULT APIENTRY PathCchStripToRoot (PWSTR pszPath, size_t cchPath); |
| 44 |
WINPATHCCHAPI WINBOOL APIENTRY PathIsUNCEx (PCWSTR pszPath, PCWSTR *ppszServer); |
| 45 |
|
| 46 |
#ifndef PATHCCH_NO_DEPRECATE |
| 47 |
#undef PathAddBackslash |
| 48 |
#undef PathAddBackslashA |
| 49 |
#undef PathAddBackslashW |
| 50 |
|
| 51 |
#undef PathAddExtension |
| 52 |
#undef PathAddExtensionA |
| 53 |
#undef PathAddExtensionW |
| 54 |
|
| 55 |
#undef PathAppend |
| 56 |
#undef PathAppendA |
| 57 |
#undef PathAppendW |
| 58 |
|
| 59 |
#undef PathCanonicalize |
| 60 |
#undef PathCanonicalizeA |
| 61 |
#undef PathCanonicalizeW |
| 62 |
|
| 63 |
#undef PathCombine |
| 64 |
#undef PathCombineA |
| 65 |
#undef PathCombineW |
| 66 |
|
| 67 |
#undef PathRenameExtension |
| 68 |
#undef PathRenameExtensionA |
| 69 |
#undef PathRenameExtensionW |
| 70 |
|
| 71 |
#ifndef DEPRECATE_SUPPORTED |
| 72 |
#define PathIsRelativeWorker PathIsRelativeWorker_is_internal_to_pathcch; |
| 73 |
#define StrIsEqualWorker StrIsEqualWorker_is_internal_to_pathcch; |
| 74 |
#define FindPreviousBackslashWorker FindPreviousBackslashWorker_is_internal_to_pathcch; |
| 75 |
#define IsHexDigitWorker IsHexDigitWorker_is_internal_to_pathcch; |
| 76 |
#define StringIsGUIDWorker StringIsGUIDWorker_is_internal_to_pathcch; |
| 77 |
#define PathIsVolumeGUIDWorker PathIsVolumeGUIDWorker_is_internal_to_pathcch; |
| 78 |
#define IsValidExtensionWorker IsValidExtensionWorker_is_internal_to_pathcch; |
| 79 |
|
| 80 |
#define PathAddBackslash PathAddBackslash_instead_use_PathCchAddBackslash; |
| 81 |
#define PathAddBackslashA PathAddBackslash_instead_use_PathCchAddBackslash; |
| 82 |
#define PathAddBackslashW PathAddBackslash_instead_use_PathCchAddBackslash; |
| 83 |
|
| 84 |
#define PathAddExtension PathAddExtension_instead_use_PathCchAddExtension; |
| 85 |
#define PathAddExtensionA PathAddExtension_instead_use_PathCchAddExtension; |
| 86 |
#define PathAddExtensionW PathAddExtension_instead_use_PathCchAddExtension; |
| 87 |
|
| 88 |
#define PathAppend PathAppend_instead_use_PathCchAppend; |
| 89 |
#define PathAppendA PathAppend_instead_use_PathCchAppend; |
| 90 |
#define PathAppendW PathAppend_instead_use_PathCchAppend; |
| 91 |
|
| 92 |
#define PathCanonicalize PathCanonicalize_instead_use_PathCchCanonicalize; |
| 93 |
#define PathCanonicalizeA PathCanonicalize_instead_use_PathCchCanonicalize; |
| 94 |
#define PathCanonicalizeW PathCanonicalize_instead_use_PathCchCanonicalize; |
| 95 |
|
| 96 |
#define PathCombine PathCombine_instead_use_PathCchCombine; |
| 97 |
#define PathCombineA PathCombine_instead_use_PathCchCombine; |
| 98 |
#define PathCombineW PathCombine_instead_use_PathCchCombine; |
| 99 |
|
| 100 |
#define PathRenameExtension PathRenameExtension_instead_use_PathCchRenameExtension; |
| 101 |
#define PathRenameExtensionA PathRenameExtension_instead_use_PathCchRenameExtension; |
| 102 |
#define PathRenameExtensionW PathRenameExtension_instead_use_PathCchRenameExtension; |
| 103 |
#endif |
| 104 |
#endif |
| 105 |
#endif |
| 106 |
|
| 107 |
#ifdef __cplusplus |
| 108 |
} |
| 109 |
#endif |
| 110 |
|
| 111 |
#ifdef __cplusplus |
| 112 |
|
| 113 |
#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP) |
| 114 |
__CRT_INLINE WINBOOL PathIsUNCEx (PWSTR path, PWSTR *pserver) { |
| 115 |
return PathIsUNCEx (const_cast<PCWSTR> (path), const_cast<PCWSTR *> (pserver)); |
| 116 |
} |
| 117 |
|
| 118 |
__CRT_INLINE HRESULT PathCchSkipRoot (PWSTR path, PWSTR *prootend) { |
| 119 |
return PathCchSkipRoot (const_cast<PCWSTR> (path), const_cast<PCWSTR *> (prootend)); |
| 120 |
} |
| 121 |
|
| 122 |
__CRT_INLINE HRESULT PathCchFindExtension (PWSTR path, size_t n, PWSTR *pext) { |
| 123 |
return PathCchFindExtension (const_cast<PCWSTR> (path), n, const_cast<PCWSTR *> (pext)); |
| 124 |
} |
| 125 |
#endif |
| 126 |
#endif |