Commit ed3ad885 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

Get rid of W->A calls.

parent 862e922c
...@@ -1288,7 +1288,8 @@ BOOL WINAPI ChooseColorW( LPCHOOSECOLORW lpChCol ) ...@@ -1288,7 +1288,8 @@ BOOL WINAPI ChooseColorW( LPCHOOSECOLORW lpChCol )
{ {
HRSRC hResInfo; HRSRC hResInfo;
HGLOBAL hDlgTmpl; HGLOBAL hDlgTmpl;
if (!(hResInfo = FindResourceA(COMDLG32_hInstance, "CHOOSE_COLOR", (LPSTR)RT_DIALOG))) static const WCHAR wszCHOOSE_COLOR[] = {'C','H','O','O','S','E','_','C','O','L','O','R',0};
if (!(hResInfo = FindResourceW(COMDLG32_hInstance, wszCHOOSE_COLOR, (LPWSTR)RT_DIALOG)))
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE); COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE; return FALSE;
......
...@@ -314,7 +314,7 @@ BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType) ...@@ -314,7 +314,7 @@ BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType)
ZeroMemory(&fodInfos, sizeof(FileOpenDlgInfos)); ZeroMemory(&fodInfos, sizeof(FileOpenDlgInfos));
/* Pass in the original ofn */ /* Pass in the original ofn */
fodInfos.ofnInfos = ofn; fodInfos.ofnInfos = (LPOPENFILENAMEW)ofn;
/* save current directory */ /* save current directory */
if (ofn->Flags & OFN_NOCHANGEDIR) if (ofn->Flags & OFN_NOCHANGEDIR)
...@@ -445,13 +445,13 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType) ...@@ -445,13 +445,13 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
{ {
BOOL ret; BOOL ret;
FileOpenDlgInfos fodInfos; FileOpenDlgInfos fodInfos;
LPSTR lpstrSavDir = NULL; LPWSTR lpstrSavDir = NULL;
/* Initialize FileOpenDlgInfos structure */ /* Initialize FileOpenDlgInfos structure */
ZeroMemory(&fodInfos, sizeof(FileOpenDlgInfos)); ZeroMemory(&fodInfos, sizeof(FileOpenDlgInfos));
/* Pass in the original ofn */ /* Pass in the original ofn */
fodInfos.ofnInfos = (LPOPENFILENAMEA) ofn; fodInfos.ofnInfos = ofn;
fodInfos.title = ofn->lpstrTitle; fodInfos.title = ofn->lpstrTitle;
fodInfos.defext = ofn->lpstrDefExt; fodInfos.defext = ofn->lpstrDefExt;
...@@ -479,8 +479,8 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType) ...@@ -479,8 +479,8 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
/* save current directory */ /* save current directory */
if (ofn->Flags & OFN_NOCHANGEDIR) if (ofn->Flags & OFN_NOCHANGEDIR)
{ {
lpstrSavDir = MemAlloc(MAX_PATH); lpstrSavDir = MemAlloc(MAX_PATH*sizeof(WCHAR));
GetCurrentDirectoryA(MAX_PATH, lpstrSavDir); GetCurrentDirectoryW(MAX_PATH, lpstrSavDir);
} }
fodInfos.unicode = TRUE; fodInfos.unicode = TRUE;
...@@ -500,7 +500,7 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType) ...@@ -500,7 +500,7 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
if (lpstrSavDir) if (lpstrSavDir)
{ {
SetCurrentDirectoryA(lpstrSavDir); SetCurrentDirectoryW(lpstrSavDir);
MemFree(lpstrSavDir); MemFree(lpstrSavDir);
} }
...@@ -729,12 +729,12 @@ HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd) ...@@ -729,12 +729,12 @@ HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd)
hinst = fodInfos->ofnInfos->hInstance; hinst = fodInfos->ofnInfos->hInstance;
if(fodInfos->unicode) if(fodInfos->unicode)
{ {
LPOPENFILENAMEW ofn = (LPOPENFILENAMEW) fodInfos->ofnInfos; LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
hRes = FindResourceW( hinst, ofn->lpTemplateName, (LPWSTR)RT_DIALOG); hRes = FindResourceW( hinst, ofn->lpTemplateName, (LPWSTR)RT_DIALOG);
} }
else else
{ {
LPOPENFILENAMEA ofn = fodInfos->ofnInfos; LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)fodInfos->ofnInfos;
hRes = FindResourceA( hinst, ofn->lpTemplateName, (LPSTR)RT_DIALOG); hRes = FindResourceA( hinst, ofn->lpTemplateName, (LPSTR)RT_DIALOG);
} }
if (!hRes) if (!hRes)
...@@ -807,7 +807,7 @@ HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode) ...@@ -807,7 +807,7 @@ HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode)
ofnNotify.hdr.hwndFrom=hwndParentDlg; ofnNotify.hdr.hwndFrom=hwndParentDlg;
ofnNotify.hdr.idFrom=0; ofnNotify.hdr.idFrom=0;
ofnNotify.hdr.code = uCode; ofnNotify.hdr.code = uCode;
ofnNotify.lpOFN = (LPOPENFILENAMEW) fodInfos->ofnInfos; ofnNotify.lpOFN = fodInfos->ofnInfos;
ofnNotify.pszFile = NULL; ofnNotify.pszFile = NULL;
ret = SendMessageW(fodInfos->DlgInfos.hwndCustomDlg,WM_NOTIFY,0,(LPARAM)&ofnNotify); ret = SendMessageW(fodInfos->DlgInfos.hwndCustomDlg,WM_NOTIFY,0,(LPARAM)&ofnNotify);
} }
...@@ -817,7 +817,7 @@ HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode) ...@@ -817,7 +817,7 @@ HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode)
ofnNotify.hdr.hwndFrom=hwndParentDlg; ofnNotify.hdr.hwndFrom=hwndParentDlg;
ofnNotify.hdr.idFrom=0; ofnNotify.hdr.idFrom=0;
ofnNotify.hdr.code = uCode; ofnNotify.hdr.code = uCode;
ofnNotify.lpOFN = fodInfos->ofnInfos; ofnNotify.lpOFN = (LPOPENFILENAMEA)fodInfos->ofnInfos;
ofnNotify.pszFile = NULL; ofnNotify.pszFile = NULL;
ret = SendMessageA(fodInfos->DlgInfos.hwndCustomDlg,WM_NOTIFY,0,(LPARAM)&ofnNotify); ret = SendMessageA(fodInfos->DlgInfos.hwndCustomDlg,WM_NOTIFY,0,(LPARAM)&ofnNotify);
} }
...@@ -1587,12 +1587,12 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPWSTR lpstrFileList, UINT nFileCo ...@@ -1587,12 +1587,12 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPWSTR lpstrFileList, UINT nFileCo
if(fodInfos->unicode) if(fodInfos->unicode)
{ {
LPOPENFILENAMEW ofn = (LPOPENFILENAMEW) fodInfos->ofnInfos; LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
ofn->lpstrFile[0] = '\0'; ofn->lpstrFile[0] = '\0';
} }
else else
{ {
LPOPENFILENAMEA ofn = fodInfos->ofnInfos; LPOPENFILENAMEA ofn = (LPOPENFILENAMEA) fodInfos->ofnInfos;
ofn->lpstrFile[0] = '\0'; ofn->lpstrFile[0] = '\0';
} }
...@@ -1645,13 +1645,13 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPWSTR lpstrFileList, UINT nFileCo ...@@ -1645,13 +1645,13 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPWSTR lpstrFileList, UINT nFileCo
} }
if(fodInfos->unicode) if(fodInfos->unicode)
{ {
LPOPENFILENAMEW ofn = (LPOPENFILENAMEW) fodInfos->ofnInfos; LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
strcpyW( ofn->lpstrFile, lpstrPathSpec); strcpyW( ofn->lpstrFile, lpstrPathSpec);
memcpy( ofn->lpstrFile + nSizePath, lpstrFileList, sizeUsed*sizeof(WCHAR) ); memcpy( ofn->lpstrFile + nSizePath, lpstrFileList, sizeUsed*sizeof(WCHAR) );
} }
else else
{ {
LPOPENFILENAMEA ofn = fodInfos->ofnInfos; LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)fodInfos->ofnInfos;
if (ofn->lpstrFile != NULL) if (ofn->lpstrFile != NULL)
{ {
...@@ -2032,7 +2032,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) ...@@ -2032,7 +2032,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
{ {
if(fodInfos->unicode) if(fodInfos->unicode)
{ {
LPOPENFILENAMEW ofn = (LPOPENFILENAMEW) fodInfos->ofnInfos; LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
strncpyW(ofn->lpstrFile, lpstrPathAndFile, ofn->nMaxFile); strncpyW(ofn->lpstrFile, lpstrPathAndFile, ofn->nMaxFile);
if (ofn->Flags & OFN_ALLOWMULTISELECT) if (ofn->Flags & OFN_ALLOWMULTISELECT)
...@@ -2040,7 +2040,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) ...@@ -2040,7 +2040,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
} }
else else
{ {
LPOPENFILENAMEA ofn = fodInfos->ofnInfos; LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)fodInfos->ofnInfos;
WideCharToMultiByte(CP_ACP, 0, lpstrPathAndFile, -1, WideCharToMultiByte(CP_ACP, 0, lpstrPathAndFile, -1,
ofn->lpstrFile, ofn->nMaxFile, NULL, NULL); ofn->lpstrFile, ofn->nMaxFile, NULL, NULL);
...@@ -2063,12 +2063,12 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) ...@@ -2063,12 +2063,12 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
LPWSTR lpstrFileTitle = PathFindFileNameW(lpstrPathAndFile); LPWSTR lpstrFileTitle = PathFindFileNameW(lpstrPathAndFile);
if(fodInfos->unicode) if(fodInfos->unicode)
{ {
LPOPENFILENAMEW ofn = (LPOPENFILENAMEW) fodInfos->ofnInfos; LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
strncpyW(ofn->lpstrFileTitle, lpstrFileTitle, ofn->nMaxFileTitle); strncpyW(ofn->lpstrFileTitle, lpstrFileTitle, ofn->nMaxFileTitle);
} }
else else
{ {
LPOPENFILENAMEA ofn = fodInfos->ofnInfos; LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)fodInfos->ofnInfos;
WideCharToMultiByte(CP_ACP, 0, lpstrFileTitle, -1, WideCharToMultiByte(CP_ACP, 0, lpstrFileTitle, -1,
ofn->lpstrFileTitle, ofn->nMaxFileTitle, NULL, NULL); ofn->lpstrFileTitle, ofn->nMaxFileTitle, NULL, NULL);
} }
...@@ -2077,7 +2077,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) ...@@ -2077,7 +2077,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
/* copy currently selected filter to lpstrCustomFilter */ /* copy currently selected filter to lpstrCustomFilter */
if (fodInfos->ofnInfos->lpstrCustomFilter) if (fodInfos->ofnInfos->lpstrCustomFilter)
{ {
LPOPENFILENAMEA ofn = fodInfos->ofnInfos; LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)fodInfos->ofnInfos;
int len = WideCharToMultiByte(CP_ACP, 0, fodInfos->ShellInfos.lpstrCurrentFilter, -1, int len = WideCharToMultiByte(CP_ACP, 0, fodInfos->ShellInfos.lpstrCurrentFilter, -1,
NULL, 0, NULL, NULL); NULL, 0, NULL, NULL);
if (len + strlen(ofn->lpstrCustomFilter) + 1 <= ofn->nMaxCustFilter) if (len + strlen(ofn->lpstrCustomFilter) + 1 <= ofn->nMaxCustFilter)
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
typedef struct typedef struct
{ {
LPOPENFILENAMEA ofnInfos; LPOPENFILENAMEW ofnInfos;
BOOL unicode; BOOL unicode;
LPWSTR initdir; LPWSTR initdir;
LPWSTR filename; LPWSTR filename;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment