summaryrefslogtreecommitdiff
path: root/sal/osl/w32/file_url.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sal/osl/w32/file_url.cxx')
-rw-r--r--sal/osl/w32/file_url.cxx32
1 files changed, 16 insertions, 16 deletions
diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx
index c1b84cbf5a02..2cfa469b3c66 100644
--- a/sal/osl/w32/file_url.cxx
+++ b/sal/osl/w32/file_url.cxx
@@ -156,7 +156,7 @@ static BOOL IsValidFilePathComponent(
DWORD IsValidFilePath(rtl_uString *path, LPCWSTR *lppError, DWORD dwFlags, rtl_uString **corrected)
{
- LPCWSTR lpszPath = path->buffer;
+ LPCWSTR lpszPath = SAL_W(path->buffer);
LPCWSTR lpComponent = lpszPath;
BOOL fValid = TRUE;
DWORD dwPathType = PATHTYPE_ERROR;
@@ -170,13 +170,13 @@ DWORD IsValidFilePath(rtl_uString *path, LPCWSTR *lppError, DWORD dwFlags, rtl_u
DWORD dwCandidatPathType = PATHTYPE_ERROR;
- if ( 0 == rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( path->buffer, nLength, WSTR_LONG_PATH_PREFIX_UNC, SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX_UNC) - 1, SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX_UNC) - 1 ) )
+ if ( 0 == rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( path->buffer, nLength, SAL_U(WSTR_LONG_PATH_PREFIX_UNC), SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX_UNC) - 1, SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX_UNC) - 1 ) )
{
/* This is long path in UNC notation */
lpComponent = lpszPath + SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX_UNC) - 1;
dwCandidatPathType = PATHTYPE_ABSOLUTE_UNC | PATHTYPE_IS_LONGPATH;
}
- else if ( 0 == rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( path->buffer, nLength, WSTR_LONG_PATH_PREFIX, SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX) - 1, SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX) - 1 ) )
+ else if ( 0 == rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( path->buffer, nLength, SAL_U(WSTR_LONG_PATH_PREFIX), SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX) - 1, SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX) - 1 ) )
{
/* This is long path */
lpComponent = lpszPath + SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX) - 1;
@@ -281,7 +281,7 @@ DWORD IsValidFilePath(rtl_uString *path, LPCWSTR *lppError, DWORD dwFlags, rtl_u
sal_Int32 i = lpComponent - lpszPath;
rtl_uString_newReplaceStrAt(corrected, path, i, 1, nullptr);
//TODO: handle out-of-memory
- lpszPath = (*corrected)->buffer;
+ lpszPath = SAL_W((*corrected)->buffer);
lpComponent = lpszPath + i;
}
@@ -672,7 +672,7 @@ oslFileError osl_getSystemPathFromFileURL_( rtl_uString *strURL, rtl_uString **p
/* Indicates local root */
if ( nDecodedLen == nSkip )
- rtl_uString_newFromStr_WithLength( &strTempPath, WSTR_SYSTEM_ROOT_PATH, SAL_N_ELEMENTS(WSTR_SYSTEM_ROOT_PATH) - 1 );
+ rtl_uString_newFromStr_WithLength( &strTempPath, SAL_U(WSTR_SYSTEM_ROOT_PATH), SAL_N_ELEMENTS(WSTR_SYSTEM_ROOT_PATH) - 1 );
else
{
/* do not separate the directory and file case, so the maximal path length without prefix is MAX_PATH-12 */
@@ -683,14 +683,14 @@ oslFileError osl_getSystemPathFromFileURL_( rtl_uString *strURL, rtl_uString **p
else
{
::osl::LongPathBuffer< sal_Unicode > aBuf( MAX_LONG_PATH );
- sal_uInt32 nNewLen = GetCaseCorrectPathName( pDecodedURL + nSkip,
+ sal_uInt32 nNewLen = GetCaseCorrectPathName( SAL_W(pDecodedURL) + nSkip,
::osl::mingw_reinterpret_cast<LPWSTR>(aBuf),
aBuf.getBufSizeInSymbols(),
false );
if ( nNewLen <= MAX_PATH - 12
- || 0 == rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( pDecodedURL + nSkip, nDecodedLen - nSkip, WSTR_SYSTEM_ROOT_PATH, SAL_N_ELEMENTS(WSTR_SYSTEM_ROOT_PATH) - 1, SAL_N_ELEMENTS(WSTR_SYSTEM_ROOT_PATH) - 1 )
- || 0 == rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( pDecodedURL + nSkip, nDecodedLen - nSkip, WSTR_LONG_PATH_PREFIX, SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX) - 1, SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX) - 1 ) )
+ || 0 == rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( pDecodedURL + nSkip, nDecodedLen - nSkip, SAL_U(WSTR_SYSTEM_ROOT_PATH), SAL_N_ELEMENTS(WSTR_SYSTEM_ROOT_PATH) - 1, SAL_N_ELEMENTS(WSTR_SYSTEM_ROOT_PATH) - 1 )
+ || 0 == rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( pDecodedURL + nSkip, nDecodedLen - nSkip, SAL_U(WSTR_LONG_PATH_PREFIX), SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX) - 1, SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX) - 1 ) )
{
rtl_uString_newFromStr_WithLength( &strTempPath, aBuf, nNewLen );
}
@@ -699,7 +699,7 @@ oslFileError osl_getSystemPathFromFileURL_( rtl_uString *strURL, rtl_uString **p
/* it should be an UNC path, use the according prefix */
rtl_uString *strSuffix = nullptr;
rtl_uString *strPrefix = nullptr;
- rtl_uString_newFromStr_WithLength( &strPrefix, WSTR_LONG_PATH_PREFIX_UNC, SAL_N_ELEMENTS( WSTR_LONG_PATH_PREFIX_UNC ) - 1 );
+ rtl_uString_newFromStr_WithLength( &strPrefix, SAL_U(WSTR_LONG_PATH_PREFIX_UNC), SAL_N_ELEMENTS( WSTR_LONG_PATH_PREFIX_UNC ) - 1 );
rtl_uString_newFromStr_WithLength( &strSuffix, aBuf + 2, nNewLen - 2 );
rtl_uString_newConcat( &strTempPath, strPrefix, strSuffix );
@@ -711,7 +711,7 @@ oslFileError osl_getSystemPathFromFileURL_( rtl_uString *strURL, rtl_uString **p
{
rtl_uString *strSuffix = nullptr;
rtl_uString *strPrefix = nullptr;
- rtl_uString_newFromStr_WithLength( &strPrefix, WSTR_LONG_PATH_PREFIX, SAL_N_ELEMENTS( WSTR_LONG_PATH_PREFIX ) - 1 );
+ rtl_uString_newFromStr_WithLength( &strPrefix, SAL_U(WSTR_LONG_PATH_PREFIX), SAL_N_ELEMENTS( WSTR_LONG_PATH_PREFIX ) - 1 );
rtl_uString_newFromStr_WithLength( &strSuffix, aBuf, nNewLen );
rtl_uString_newConcat( &strTempPath, strPrefix, strSuffix );
@@ -903,8 +903,8 @@ oslFileError SAL_CALL osl_searchFileURL(
do
{
/* If search path is empty use a nullptr pointer instead according to MSDN documentation of SearchPath */
- LPCWSTR lpszSearchPath = ustrSystemSearchPath && ustrSystemSearchPath->length ? ustrSystemSearchPath->buffer : nullptr;
- LPCWSTR lpszSearchFile = ustrSysPath->buffer;
+ LPCWSTR lpszSearchPath = ustrSystemSearchPath && ustrSystemSearchPath->length ? SAL_W(ustrSystemSearchPath->buffer) : nullptr;
+ LPCWSTR lpszSearchFile = SAL_W(ustrSysPath->buffer);
/* Allocate space for buffer according to previous returned count of required chars */
/* +1 is not necessary if we follow MSDN documentation but for robustness we do so */
@@ -921,7 +921,7 @@ oslFileError SAL_CALL osl_searchFileURL(
if ( dwResult )
{
- rtl_uString_newFromStr( &ustrSysPath, lpBuffer );
+ rtl_uString_newFromStr( &ustrSysPath, SAL_U(lpBuffer) );
error = osl_getFileURLFromSystemPath( ustrSysPath, pustrPath );
}
else
@@ -932,7 +932,7 @@ oslFileError SAL_CALL osl_searchFileURL(
/* something went wrong, perhaps the path was absolute */
error = oslTranslateFileError( GetLastError() );
- hFind = FindFirstFile( ustrSysPath->buffer, &aFindFileData );
+ hFind = FindFirstFile( SAL_W(ustrSysPath->buffer), &aFindFileData );
if ( IsValidHandle(hFind) )
{
@@ -991,10 +991,10 @@ oslFileError SAL_CALL osl_getAbsoluteFileURL( rtl_uString* ustrBaseURL, rtl_uStr
osl_acquireMutex( g_CurrentDirectoryMutex );
GetCurrentDirectoryW( aCurrentDir.getBufSizeInSymbols(), ::osl::mingw_reinterpret_cast<LPWSTR>(aCurrentDir) );
- SetCurrentDirectoryW( ustrBaseSysPath->buffer );
+ SetCurrentDirectoryW( SAL_W(ustrBaseSysPath->buffer) );
}
- dwResult = GetFullPathNameW( ustrRelSysPath->buffer, aBuffer.getBufSizeInSymbols(), ::osl::mingw_reinterpret_cast<LPWSTR>(aBuffer), &lpFilePart );
+ dwResult = GetFullPathNameW( SAL_W(ustrRelSysPath->buffer), aBuffer.getBufSizeInSymbols(), ::osl::mingw_reinterpret_cast<LPWSTR>(aBuffer), &lpFilePart );
if ( ustrBaseSysPath )
{