diff options
Diffstat (limited to 'src/dutil/path2utl.cpp')
| -rw-r--r-- | src/dutil/path2utl.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/dutil/path2utl.cpp b/src/dutil/path2utl.cpp index 8f5f03a1..ff3a946d 100644 --- a/src/dutil/path2utl.cpp +++ b/src/dutil/path2utl.cpp | |||
| @@ -3,6 +3,21 @@ | |||
| 3 | #include "precomp.h" | 3 | #include "precomp.h" |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | // Exit macros | ||
| 7 | #define PathExitOnLastError(x, s, ...) ExitOnLastErrorSource(DUTIL_SOURCE_PATHUTIL, x, s, __VA_ARGS__) | ||
| 8 | #define PathExitOnLastErrorDebugTrace(x, s, ...) ExitOnLastErrorDebugTraceSource(DUTIL_SOURCE_PATHUTIL, x, s, __VA_ARGS__) | ||
| 9 | #define PathExitWithLastError(x, s, ...) ExitWithLastErrorSource(DUTIL_SOURCE_PATHUTIL, x, s, __VA_ARGS__) | ||
| 10 | #define PathExitOnFailure(x, s, ...) ExitOnFailureSource(DUTIL_SOURCE_PATHUTIL, x, s, __VA_ARGS__) | ||
| 11 | #define PathExitOnRootFailure(x, s, ...) ExitOnRootFailureSource(DUTIL_SOURCE_PATHUTIL, x, s, __VA_ARGS__) | ||
| 12 | #define PathExitOnFailureDebugTrace(x, s, ...) ExitOnFailureDebugTraceSource(DUTIL_SOURCE_PATHUTIL, x, s, __VA_ARGS__) | ||
| 13 | #define PathExitOnNull(p, x, e, s, ...) ExitOnNullSource(DUTIL_SOURCE_PATHUTIL, p, x, e, s, __VA_ARGS__) | ||
| 14 | #define PathExitOnNullWithLastError(p, x, s, ...) ExitOnNullWithLastErrorSource(DUTIL_SOURCE_PATHUTIL, p, x, s, __VA_ARGS__) | ||
| 15 | #define PathExitOnNullDebugTrace(p, x, e, s, ...) ExitOnNullDebugTraceSource(DUTIL_SOURCE_PATHUTIL, p, x, e, s, __VA_ARGS__) | ||
| 16 | #define PathExitOnInvalidHandleWithLastError(p, x, s, ...) ExitOnInvalidHandleWithLastErrorSource(DUTIL_SOURCE_PATHUTIL, p, x, s, __VA_ARGS__) | ||
| 17 | #define PathExitOnWin32Error(e, x, s, ...) ExitOnWin32ErrorSource(DUTIL_SOURCE_PATHUTIL, e, x, s, __VA_ARGS__) | ||
| 18 | #define PathExitOnGdipFailure(g, x, s, ...) ExitOnGdipFailureSource(DUTIL_SOURCE_PATHUTIL, g, x, s, __VA_ARGS__) | ||
| 19 | |||
| 20 | |||
| 6 | DAPI_(HRESULT) PathCanonicalizePath( | 21 | DAPI_(HRESULT) PathCanonicalizePath( |
| 7 | __in_z LPCWSTR wzPath, | 22 | __in_z LPCWSTR wzPath, |
| 8 | __deref_out_z LPWSTR* psczCanonicalized | 23 | __deref_out_z LPWSTR* psczCanonicalized |
| @@ -12,7 +27,7 @@ DAPI_(HRESULT) PathCanonicalizePath( | |||
| 12 | int cch = MAX_PATH + 1; | 27 | int cch = MAX_PATH + 1; |
| 13 | 28 | ||
| 14 | hr = StrAlloc(psczCanonicalized, cch); | 29 | hr = StrAlloc(psczCanonicalized, cch); |
| 15 | ExitOnFailure(hr, "Failed to allocate string for the canonicalized path."); | 30 | PathExitOnFailure(hr, "Failed to allocate string for the canonicalized path."); |
| 16 | 31 | ||
| 17 | if (::PathCanonicalizeW(*psczCanonicalized, wzPath)) | 32 | if (::PathCanonicalizeW(*psczCanonicalized, wzPath)) |
| 18 | { | 33 | { |
| @@ -39,10 +54,10 @@ DAPI_(HRESULT) PathDirectoryContainsPath( | |||
| 39 | LPWSTR sczOriginalDirectory = NULL; | 54 | LPWSTR sczOriginalDirectory = NULL; |
| 40 | 55 | ||
| 41 | hr = PathCanonicalizePath(wzPath, &sczOriginalPath); | 56 | hr = PathCanonicalizePath(wzPath, &sczOriginalPath); |
| 42 | ExitOnFailure(hr, "Failed to canonicalize the path."); | 57 | PathExitOnFailure(hr, "Failed to canonicalize the path."); |
| 43 | 58 | ||
| 44 | hr = PathCanonicalizePath(wzDirectory, &sczOriginalDirectory); | 59 | hr = PathCanonicalizePath(wzDirectory, &sczOriginalDirectory); |
| 45 | ExitOnFailure(hr, "Failed to canonicalize the directory."); | 60 | PathExitOnFailure(hr, "Failed to canonicalize the directory."); |
| 46 | 61 | ||
| 47 | if (!sczOriginalPath || !*sczOriginalPath) | 62 | if (!sczOriginalPath || !*sczOriginalPath) |
| 48 | { | 63 | { |
