-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapi-ms-win-core-path-l1-1-0.c
150 lines (127 loc) · 4.17 KB
/
api-ms-win-core-path-l1-1-0.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#define WIN32_LEAN_AND_MEAN
#define WINPATHCCHAPI
#define PATHCCH_NO_DEPRECATE
#include <windows.h>
#include <pathcch.h>
#include <shlwapi.h>
HRESULT WINAPI PathAllocCanonicalize(PCWSTR pszPathIn, ULONG dwFlags,
PWSTR *ppszPathOut)
{
return E_NOTIMPL;
}
HRESULT WINAPI PathAllocCombine(PCWSTR pszPathIn, PCWSTR pszMore,
ULONG dwFlags, PWSTR *ppszPathOut)
{
return E_NOTIMPL;
}
HRESULT WINAPI PathCchAddBackslash(PWSTR pszPath, size_t cchPath)
{
return PathCchAddBackslashEx(pszPath, cchPath, NULL, NULL);
}
HRESULT WINAPI PathCchAddBackslashEx(PWSTR pszPath, size_t cchPath,
PWSTR *ppszEnd, size_t *pcchRemaining)
{
return PathAddBackslashW(pszPath) ? S_OK : E_FAIL;
}
HRESULT WINAPI PathCchAddExtension(PWSTR pszPath, size_t cchPath,
PCWSTR pszExt)
{
return PathAddExtensionW(pszPath, pszExt) ? S_OK : E_FAIL;
}
HRESULT WINAPI PathCchAppend(PWSTR pszPath, size_t cchPath, PCWSTR pszMore)
{
return PathCchAppendEx(pszPath, cchPath, pszMore, 0);
}
HRESULT WINAPI PathCchAppendEx(PWSTR pszPath, size_t cchPath, PCWSTR pszMore,
ULONG dwFlags)
{
return PathAppendW(pszPath, pszMore) ? S_OK : E_FAIL;
}
HRESULT WINAPI PathCchCanonicalize(PWSTR pszPathOut, size_t cchPathOut,
PCWSTR pszPathIn)
{
return PathCchCanonicalizeEx(pszPathOut, cchPathOut, pszPathIn, 0);
}
HRESULT WINAPI PathCchCanonicalizeEx(PWSTR pszPathOut, size_t cchPathOut,
PCWSTR pszPathIn, ULONG dwFlags)
{
return PathCanonicalizeW(pszPathOut, pszPathIn) ? S_OK : E_FAIL;
}
HRESULT WINAPI PathCchCombine(PWSTR pszPathOut, size_t cchPathOut,
PCWSTR pszPathIn, PCWSTR pszMore)
{
return PathCchCombineEx(pszPathOut, cchPathOut, pszPathIn, pszMore, 0);
}
HRESULT WINAPI PathCchCombineEx(PWSTR pszPathOut, size_t cchPathOut,
PCWSTR pszPathIn, PCWSTR pszMore,
ULONG dwFlags)
{
return PathCombineW(pszPathOut, pszPathIn, pszMore) ? S_OK : E_FAIL;
}
HRESULT WINAPI PathCchFindExtension(PCWSTR pszPath, size_t cchPath,
PCWSTR *ppszExt)
{
return ppszExt ? (*ppszExt = PathFindExtensionW(pszPath)) ? S_OK : E_FAIL
: E_INVALIDARG;
}
BOOL WINAPI PathCchIsRoot(PCWSTR pszPath)
{
return PathIsRootW(pszPath);
}
HRESULT WINAPI PathCchRemoveBackslash(PWSTR pszPath, size_t cchPath)
{
return PathCchRemoveBackslashEx(pszPath, cchPath, NULL, NULL);
}
HRESULT WINAPI PathCchRemoveBackslashEx(PWSTR pszPath, size_t cchPath,
PWSTR *ppszEnd, size_t *pcchRemaining)
{
return PathRemoveBackslashW(pszPath) ? S_OK : E_FAIL;
}
HRESULT WINAPI PathCchRemoveExtension(PWSTR pszPath, size_t cchPath)
{
PathRemoveExtensionW(pszPath);
return S_OK;
}
HRESULT WINAPI PathCchRemoveFileSpec(PWSTR pszPath, size_t cchPath)
{
return PathRemoveFileSpecW(pszPath) ? S_OK : E_FAIL;
}
HRESULT WINAPI PathCchRenameExtension(PWSTR pszPath, size_t cchPath,
PCWSTR pszExt)
{
return PathRenameExtensionW(pszPath, pszExt) ? S_OK : E_FAIL;
}
HRESULT WINAPI PathCchSkipRoot(PCWSTR pszPath, PCWSTR *ppszRootEnd)
{
if (pszPath && ppszRootEnd) {
if (pszPath[0] && pszPath[1] == L':') {
if (pszPath[2] == L'\\') {
*ppszRootEnd = &pszPath[3];
} else {
*ppszRootEnd = &pszPath[2];
}
return S_OK;
} else {
return (*ppszRootEnd = PathSkipRootW(pszPath)) ? S_OK : E_FAIL;
}
} else {
return E_INVALIDARG;
}
}
HRESULT WINAPI PathCchStripPrefix(PWSTR pszPath, size_t cchPath)
{
return E_NOTIMPL;
}
HRESULT WINAPI PathCchStripToRoot(PWSTR pszPath, size_t cchPath)
{
return PathStripToRootW(pszPath) ? S_OK : E_FAIL;
}
BOOL WINAPI PathIsUNCEx(PCWSTR pszPath, PCWSTR *ppszServer)
{
return PathIsUNCW(pszPath);
}
BOOL WINAPI _DllMainCRTStartup(HINSTANCE hinstDLL, DWORD fdwReason,
LPVOID lpvReserved)
{
return TRUE;
}