diff options
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/path2utl.cpp')
-rw-r--r-- | src/libs/dutil/WixToolset.DUtil/path2utl.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/path2utl.cpp b/src/libs/dutil/WixToolset.DUtil/path2utl.cpp index 45157d0b..61c1803a 100644 --- a/src/libs/dutil/WixToolset.DUtil/path2utl.cpp +++ b/src/libs/dutil/WixToolset.DUtil/path2utl.cpp | |||
@@ -131,6 +131,46 @@ LExit: | |||
131 | return hr; | 131 | return hr; |
132 | } | 132 | } |
133 | 133 | ||
134 | DAPI_(HRESULT) PathConcatRelativeToBase( | ||
135 | __in LPCWSTR wzBase, | ||
136 | __in_opt LPCWSTR wzRelative, | ||
137 | __deref_out_z LPWSTR* psczCombined | ||
138 | ) | ||
139 | { | ||
140 | HRESULT hr = S_OK; | ||
141 | LPWSTR sczCanonicalizedRelative = NULL; | ||
142 | |||
143 | if (!wzBase || !*wzBase) | ||
144 | { | ||
145 | PathExitWithRootFailure(hr, E_INVALIDARG, "wzBase is required."); | ||
146 | } | ||
147 | |||
148 | if (PathIsRooted(wzRelative)) | ||
149 | { | ||
150 | PathExitWithRootFailure(hr, E_INVALIDARG, "wzRelative cannot be rooted."); | ||
151 | } | ||
152 | |||
153 | hr = StrAllocString(psczCombined, wzBase, 0); | ||
154 | PathExitOnFailure(hr, "Failed to copy base to output."); | ||
155 | |||
156 | if (wzRelative && *wzRelative) | ||
157 | { | ||
158 | hr = PathBackslashTerminate(psczCombined); | ||
159 | PathExitOnFailure(hr, "Failed to backslashify."); | ||
160 | |||
161 | hr = PathCanonicalizeForComparison(wzRelative, 0, &sczCanonicalizedRelative); | ||
162 | PathExitOnFailure(hr, "Failed to canonicalize wzRelative."); | ||
163 | |||
164 | hr = StrAllocConcat(psczCombined, sczCanonicalizedRelative, 0); | ||
165 | PathExitOnFailure(hr, "Failed to append relative to output."); | ||
166 | } | ||
167 | |||
168 | LExit: | ||
169 | ReleaseStr(sczCanonicalizedRelative); | ||
170 | |||
171 | return hr; | ||
172 | } | ||
173 | |||
134 | DAPI_(HRESULT) PathDirectoryContainsPath( | 174 | DAPI_(HRESULT) PathDirectoryContainsPath( |
135 | __in_z LPCWSTR wzDirectory, | 175 | __in_z LPCWSTR wzDirectory, |
136 | __in_z LPCWSTR wzPath | 176 | __in_z LPCWSTR wzPath |