Use the ACP define in MB/WC conversion functions.
This commit is contained in:
parent
28a8cacaf5
commit
67cfcfb919
@ -140,11 +140,11 @@ LPSTR WINAPI PathCombineA(LPSTR lpszDest, LPCSTR lpszDir, LPCSTR lpszFile)
|
|||||||
WCHAR szDir[MAX_PATH];
|
WCHAR szDir[MAX_PATH];
|
||||||
WCHAR szFile[MAX_PATH];
|
WCHAR szFile[MAX_PATH];
|
||||||
if (lpszDir)
|
if (lpszDir)
|
||||||
MultiByteToWideChar(0,0,lpszDir,-1,szDir,MAX_PATH);
|
MultiByteToWideChar(CP_ACP,0,lpszDir,-1,szDir,MAX_PATH);
|
||||||
if (lpszFile)
|
if (lpszFile)
|
||||||
MultiByteToWideChar(0,0,lpszFile,-1,szFile,MAX_PATH);
|
MultiByteToWideChar(CP_ACP,0,lpszFile,-1,szFile,MAX_PATH);
|
||||||
PathCombineW(szDest, lpszDir ? szDir : NULL, lpszFile ? szFile : NULL);
|
PathCombineW(szDest, lpszDir ? szDir : NULL, lpszFile ? szFile : NULL);
|
||||||
WideCharToMultiByte(0,0,szDest,-1,lpszDest,MAX_PATH,0,0);
|
WideCharToMultiByte(CP_ACP,0,szDest,-1,lpszDest,MAX_PATH,0,0);
|
||||||
}
|
}
|
||||||
return lpszDest;
|
return lpszDest;
|
||||||
}
|
}
|
||||||
@ -1125,10 +1125,10 @@ BOOL WINAPI PathFileExistsDefExtA(LPSTR lpszPath,DWORD dwWhich)
|
|||||||
if (lpszPath)
|
if (lpszPath)
|
||||||
{
|
{
|
||||||
WCHAR szPath[MAX_PATH];
|
WCHAR szPath[MAX_PATH];
|
||||||
MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
|
MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
|
||||||
bRet = PathFileExistsDefExtW(szPath, dwWhich);
|
bRet = PathFileExistsDefExtW(szPath, dwWhich);
|
||||||
if (bRet)
|
if (bRet)
|
||||||
WideCharToMultiByte(0,0,szPath,-1,lpszPath,MAX_PATH,0,0);
|
WideCharToMultiByte(CP_ACP,0,szPath,-1,lpszPath,MAX_PATH,0,0);
|
||||||
}
|
}
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
@ -1238,7 +1238,7 @@ BOOL WINAPI PathFindOnPathExA(LPSTR lpszFile,LPCSTR *lppszOtherDirs,DWORD dwWhic
|
|||||||
if (!lpszFile || !PathIsFileSpecA(lpszFile))
|
if (!lpszFile || !PathIsFileSpecA(lpszFile))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
MultiByteToWideChar(0,0,lpszFile,-1,szFile,MAX_PATH);
|
MultiByteToWideChar(CP_ACP,0,lpszFile,-1,szFile,MAX_PATH);
|
||||||
|
|
||||||
/* Search provided directories first */
|
/* Search provided directories first */
|
||||||
if (lppszOtherDirs && *lppszOtherDirs)
|
if (lppszOtherDirs && *lppszOtherDirs)
|
||||||
@ -1248,11 +1248,11 @@ BOOL WINAPI PathFindOnPathExA(LPSTR lpszFile,LPCSTR *lppszOtherDirs,DWORD dwWhic
|
|||||||
|
|
||||||
while (lpszOtherPath && *lpszOtherPath && (*lpszOtherPath)[0])
|
while (lpszOtherPath && *lpszOtherPath && (*lpszOtherPath)[0])
|
||||||
{
|
{
|
||||||
MultiByteToWideChar(0,0,*lpszOtherPath,-1,szOther,MAX_PATH);
|
MultiByteToWideChar(CP_ACP,0,*lpszOtherPath,-1,szOther,MAX_PATH);
|
||||||
PathCombineW(buff, szOther, szFile);
|
PathCombineW(buff, szOther, szFile);
|
||||||
if (PathFileExistsDefExtW(buff, dwWhich))
|
if (PathFileExistsDefExtW(buff, dwWhich))
|
||||||
{
|
{
|
||||||
WideCharToMultiByte(0,0,buff,-1,lpszFile,MAX_PATH,0,0);
|
WideCharToMultiByte(CP_ACP,0,buff,-1,lpszFile,MAX_PATH,0,0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
lpszOtherPath++;
|
lpszOtherPath++;
|
||||||
@ -1261,7 +1261,7 @@ BOOL WINAPI PathFindOnPathExA(LPSTR lpszFile,LPCSTR *lppszOtherDirs,DWORD dwWhic
|
|||||||
/* Not found, try system and path dirs */
|
/* Not found, try system and path dirs */
|
||||||
if (SHLWAPI_PathFindInOtherDirs(szFile, dwWhich))
|
if (SHLWAPI_PathFindInOtherDirs(szFile, dwWhich))
|
||||||
{
|
{
|
||||||
WideCharToMultiByte(0,0,szFile,-1,lpszFile,MAX_PATH,0,0);
|
WideCharToMultiByte(CP_ACP,0,szFile,-1,lpszFile,MAX_PATH,0,0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1368,10 +1368,10 @@ BOOL WINAPI PathCompactPathExA(LPSTR lpszDest, LPCSTR lpszPath,
|
|||||||
WCHAR szPath[MAX_PATH];
|
WCHAR szPath[MAX_PATH];
|
||||||
WCHAR szDest[MAX_PATH];
|
WCHAR szDest[MAX_PATH];
|
||||||
|
|
||||||
MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
|
MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
|
||||||
szDest[0] = '\0';
|
szDest[0] = '\0';
|
||||||
bRet = PathCompactPathExW(szDest, szPath, cchMax, dwFlags);
|
bRet = PathCompactPathExW(szDest, szPath, cchMax, dwFlags);
|
||||||
WideCharToMultiByte(0,0,szDest,-1,lpszDest,MAX_PATH,0,0);
|
WideCharToMultiByte(CP_ACP,0,szDest,-1,lpszDest,MAX_PATH,0,0);
|
||||||
}
|
}
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
@ -2338,9 +2338,9 @@ BOOL WINAPI PathCanonicalizeA(LPSTR lpszBuf, LPCSTR lpszPath)
|
|||||||
{
|
{
|
||||||
WCHAR szPath[MAX_PATH];
|
WCHAR szPath[MAX_PATH];
|
||||||
WCHAR szBuff[MAX_PATH];
|
WCHAR szBuff[MAX_PATH];
|
||||||
MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
|
MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
|
||||||
bRet = PathCanonicalizeW(szBuff, szPath);
|
bRet = PathCanonicalizeW(szBuff, szPath);
|
||||||
WideCharToMultiByte(0,0,szBuff,-1,lpszBuf,MAX_PATH,0,0);
|
WideCharToMultiByte(CP_ACP,0,szBuff,-1,lpszBuf,MAX_PATH,0,0);
|
||||||
}
|
}
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
@ -2778,9 +2778,9 @@ BOOL WINAPI PathCompactPathA(HDC hDC, LPSTR lpszPath, UINT dx)
|
|||||||
if (lpszPath)
|
if (lpszPath)
|
||||||
{
|
{
|
||||||
WCHAR szPath[MAX_PATH];
|
WCHAR szPath[MAX_PATH];
|
||||||
MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
|
MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
|
||||||
bRet = PathCompactPathW(hDC, szPath, dx);
|
bRet = PathCompactPathW(hDC, szPath, dx);
|
||||||
WideCharToMultiByte(0,0,szPath,-1,lpszPath,MAX_PATH,0,0);
|
WideCharToMultiByte(CP_ACP,0,szPath,-1,lpszPath,MAX_PATH,0,0);
|
||||||
}
|
}
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
@ -3010,7 +3010,7 @@ BOOL WINAPI PathMakeSystemFolderA(LPCSTR lpszPath)
|
|||||||
if (lpszPath && *lpszPath)
|
if (lpszPath && *lpszPath)
|
||||||
{
|
{
|
||||||
WCHAR szPath[MAX_PATH];
|
WCHAR szPath[MAX_PATH];
|
||||||
MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
|
MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
|
||||||
bRet = PathMakeSystemFolderW(szPath);
|
bRet = PathMakeSystemFolderW(szPath);
|
||||||
}
|
}
|
||||||
return bRet;
|
return bRet;
|
||||||
@ -3326,10 +3326,10 @@ BOOL WINAPI PathRelativePathToA(LPSTR lpszPath, LPCSTR lpszFrom, DWORD dwAttrFro
|
|||||||
WCHAR szPath[MAX_PATH];
|
WCHAR szPath[MAX_PATH];
|
||||||
WCHAR szFrom[MAX_PATH];
|
WCHAR szFrom[MAX_PATH];
|
||||||
WCHAR szTo[MAX_PATH];
|
WCHAR szTo[MAX_PATH];
|
||||||
MultiByteToWideChar(0,0,lpszFrom,-1,szFrom,MAX_PATH);
|
MultiByteToWideChar(CP_ACP,0,lpszFrom,-1,szFrom,MAX_PATH);
|
||||||
MultiByteToWideChar(0,0,lpszTo,-1,szTo,MAX_PATH);
|
MultiByteToWideChar(CP_ACP,0,lpszTo,-1,szTo,MAX_PATH);
|
||||||
bRet = PathRelativePathToW(szPath,szFrom,dwAttrFrom,szTo,dwAttrTo);
|
bRet = PathRelativePathToW(szPath,szFrom,dwAttrFrom,szTo,dwAttrTo);
|
||||||
WideCharToMultiByte(0,0,szPath,-1,lpszPath,MAX_PATH,0,0);
|
WideCharToMultiByte(CP_ACP,0,szPath,-1,lpszPath,MAX_PATH,0,0);
|
||||||
}
|
}
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
@ -3475,7 +3475,7 @@ VOID WINAPI PathSetDlgItemPathA(HWND hDlg, int id, LPCSTR lpszPath)
|
|||||||
TRACE("(%p,%8x,%s)\n",hDlg, id, debugstr_a(lpszPath));
|
TRACE("(%p,%8x,%s)\n",hDlg, id, debugstr_a(lpszPath));
|
||||||
|
|
||||||
if (lpszPath)
|
if (lpszPath)
|
||||||
MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
|
MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
|
||||||
else
|
else
|
||||||
szPath[0] = '\0';
|
szPath[0] = '\0';
|
||||||
PathSetDlgItemPathW(hDlg, id, szPath);
|
PathSetDlgItemPathW(hDlg, id, szPath);
|
||||||
@ -3679,7 +3679,7 @@ BOOL WINAPI PathIsDirectoryEmptyA(LPCSTR lpszPath)
|
|||||||
if (lpszPath)
|
if (lpszPath)
|
||||||
{
|
{
|
||||||
WCHAR szPath[MAX_PATH];
|
WCHAR szPath[MAX_PATH];
|
||||||
MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
|
MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
|
||||||
bRet = PathIsDirectoryEmptyW(szPath);
|
bRet = PathIsDirectoryEmptyW(szPath);
|
||||||
}
|
}
|
||||||
return bRet;
|
return bRet;
|
||||||
@ -3896,10 +3896,10 @@ HRESULT WINAPI SHGetWebFolderFilePathA(LPCSTR lpszFile, LPSTR lpszPath, DWORD dw
|
|||||||
|
|
||||||
TRACE("(%s,%p,%ld)\n", lpszFile, lpszPath, dwPathLen);
|
TRACE("(%s,%p,%ld)\n", lpszFile, lpszPath, dwPathLen);
|
||||||
|
|
||||||
MultiByteToWideChar(0, 0, lpszFile, -1, szFile, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, szFile, MAX_PATH);
|
||||||
szPath[0] = '\0';
|
szPath[0] = '\0';
|
||||||
hRet = SHGetWebFolderFilePathW(szFile, szPath, dwPathLen);
|
hRet = SHGetWebFolderFilePathW(szFile, szPath, dwPathLen);
|
||||||
WideCharToMultiByte(0, 0, szPath, -1, lpszPath, dwPathLen, 0, 0);
|
WideCharToMultiByte(CP_ACP, 0, szPath, -1, lpszPath, dwPathLen, 0, 0);
|
||||||
return hRet;
|
return hRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user