summaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-06-03 17:50:50 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-06-07 19:44:36 -0500
commit68ec803fc7f48bb0e0463dc45f6ce40e1f07dbf5 (patch)
treeb40803c4ba8d5312ed3d95c66778c2bc87cf0de9 /src/libs/dutil/WixToolset.DUtil
parent8810aa8908ed7887616d86dd5fb821fcfa92f444 (diff)
downloadwix-68ec803fc7f48bb0e0463dc45f6ce40e1f07dbf5.tar.gz
wix-68ec803fc7f48bb0e0463dc45f6ce40e1f07dbf5.tar.bz2
wix-68ec803fc7f48bb0e0463dc45f6ce40e1f07dbf5.zip
Make sure base paths are fully qualified in Burn.
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/pathutil.h10
-rw-r--r--src/libs/dutil/WixToolset.DUtil/path2utl.cpp19
2 files changed, 29 insertions, 0 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/pathutil.h b/src/libs/dutil/WixToolset.DUtil/inc/pathutil.h
index f36e6ebc..971ef887 100644
--- a/src/libs/dutil/WixToolset.DUtil/inc/pathutil.h
+++ b/src/libs/dutil/WixToolset.DUtil/inc/pathutil.h
@@ -299,6 +299,16 @@ DAPI_(HRESULT) PathConcatRelativeToBase(
299 ); 299 );
300 300
301/******************************************************************* 301/*******************************************************************
302 PathConcatRelativeToFullyQualifiedBase - ensures the base path is
303 fully qualified and then calls PathConcatRelativeToBase.
304*******************************************************************/
305DAPI_(HRESULT) PathConcatRelativeToFullyQualifiedBase(
306 __in LPCWSTR wzBase,
307 __in_opt LPCWSTR wzRelative,
308 __deref_out_z LPWSTR* psczCombined
309 );
310
311/*******************************************************************
302 PathCompareCanonicalized - canonicalizes the two paths using PathCanonicalizeForComparison 312 PathCompareCanonicalized - canonicalizes the two paths using PathCanonicalizeForComparison
303 which does not resolve relative paths into fully qualified paths. 313 which does not resolve relative paths into fully qualified paths.
304 The strings are then compared using ::CompareStringW(). 314 The strings are then compared using ::CompareStringW().
diff --git a/src/libs/dutil/WixToolset.DUtil/path2utl.cpp b/src/libs/dutil/WixToolset.DUtil/path2utl.cpp
index c6ff608c..3c4b2f88 100644
--- a/src/libs/dutil/WixToolset.DUtil/path2utl.cpp
+++ b/src/libs/dutil/WixToolset.DUtil/path2utl.cpp
@@ -162,6 +162,25 @@ LExit:
162 return hr; 162 return hr;
163} 163}
164 164
165DAPI_(HRESULT) PathConcatRelativeToFullyQualifiedBase(
166 __in LPCWSTR wzBase,
167 __in_opt LPCWSTR wzRelative,
168 __deref_out_z LPWSTR* psczCombined
169 )
170{
171 HRESULT hr = S_OK;
172
173 if (!PathIsFullyQualified(wzBase))
174 {
175 PathExitWithRootFailure(hr, E_INVALIDARG, "wzBase must be fully qualified: %ls.", wzBase);
176 }
177
178 hr = PathConcatRelativeToBase(wzBase, wzRelative, psczCombined);
179
180LExit:
181 return hr;
182}
183
165DAPI_(HRESULT) PathCompareCanonicalized( 184DAPI_(HRESULT) PathCompareCanonicalized(
166 __in_z LPCWSTR wzPath1, 185 __in_z LPCWSTR wzPath1,
167 __in_z LPCWSTR wzPath2, 186 __in_z LPCWSTR wzPath2,