Commit 45822e6b authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

Fixed use of StrRetToStrN.

parent 6f3d5805
...@@ -1718,8 +1718,7 @@ HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrF ...@@ -1718,8 +1718,7 @@ HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrF
dwFlags, dwFlags,
&str))) &str)))
{ {
StrRetToStrN(lpstrFileName, MAX_PATH, &str, pidl); return StrRetToStrNA(lpstrFileName, MAX_PATH, &str, pidl);
return NOERROR;
} }
return E_FAIL; return E_FAIL;
} }
...@@ -1782,7 +1781,8 @@ LPITEMIDLIST GetPidlFromName(IShellFolder *psf,LPCSTR lpcstrFileName) ...@@ -1782,7 +1781,8 @@ LPITEMIDLIST GetPidlFromName(IShellFolder *psf,LPCSTR lpcstrFileName)
LPITEMIDLIST pidl; LPITEMIDLIST pidl;
ULONG ulEaten; ULONG ulEaten;
wchar_t lpwstrDirName[MAX_PATH]; wchar_t lpwstrDirName[MAX_PATH];
TRACE("sf=%p file=%s\n", psf, lpcstrFileName);
if(!lpcstrFileName) if(!lpcstrFileName)
return NULL; return NULL;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "unknwn.h" #include "unknwn.h"
#include "filedlgbrowser.h" #include "filedlgbrowser.h"
#include "winuser.h" #include "winuser.h"
#include "heap.h"
#include "commctrl.h" #include "commctrl.h"
#include "wine/obj_dataobject.h" #include "wine/obj_dataobject.h"
#include "debugtools.h" #include "debugtools.h"
...@@ -674,7 +675,7 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser * ...@@ -674,7 +675,7 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *
FileOpenDlgInfos *fodInfos; FileOpenDlgInfos *fodInfos;
ULONG ulAttr; ULONG ulAttr;
STRRET str; STRRET str;
char szPath[MAX_PATH]; WCHAR szPathW[MAX_PATH];
_ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface); _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
...@@ -696,9 +697,16 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser * ...@@ -696,9 +697,16 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *
if(!fodInfos->ShellInfos.lpstrCurrentFilter || if(!fodInfos->ShellInfos.lpstrCurrentFilter ||
!lstrlenW(fodInfos->ShellInfos.lpstrCurrentFilter)) !lstrlenW(fodInfos->ShellInfos.lpstrCurrentFilter))
return S_OK; return S_OK;
IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_FORPARSING, &str);
StrRetToStrN(szPath, MAX_PATH, &str, pidl); if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_FORPARSING, &str)))
return PathMatchSpecW((LPWSTR)szPath, fodInfos->ShellInfos.lpstrCurrentFilter)? S_OK : S_FALSE; { if (SUCCEEDED(StrRetToStrNW(szPathW, MAX_PATH, &str, pidl)))
{
if (PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
return S_OK;
}
}
return S_FALSE;
} }
/************************************************************************** /**************************************************************************
...@@ -724,7 +732,7 @@ HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IS ...@@ -724,7 +732,7 @@ HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IS
if (!ulAttr) if (!ulAttr)
{ {
if(SUCCEEDED(hRes = GetName(fodInfos->Shell.FOIShellFolder,pidl,SHGDN_NORMAL,lpstrFileName))) if(SUCCEEDED(hRes = GetName(fodInfos->Shell.FOIShellFolder,pidl,SHGDN_NORMAL,lpstrFileName)))
SetWindowTextW(fodInfos->DlgInfos.hwndFileName,(LPWSTR)lpstrFileName); SetWindowTextA(fodInfos->DlgInfos.hwndFileName,lpstrFileName);
} }
SHFree((LPVOID)pidl); SHFree((LPVOID)pidl);
......
...@@ -89,7 +89,8 @@ static BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPSTR l ...@@ -89,7 +89,8 @@ static BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPSTR l
TRACE("%p %p %lx %p\n", lpsf, lpi, dwFlags, lpFriendlyName); TRACE("%p %p %lx %p\n", lpsf, lpi, dwFlags, lpFriendlyName);
if (SUCCEEDED(IShellFolder_GetDisplayNameOf(lpsf, lpi, dwFlags, &str))) if (SUCCEEDED(IShellFolder_GetDisplayNameOf(lpsf, lpi, dwFlags, &str)))
{ bSuccess = StrRetToStrN (lpFriendlyName, MAX_PATH, &str, lpi); {
bSuccess = StrRetToStrNA (lpFriendlyName, MAX_PATH, &str, lpi);
} }
else else
bSuccess = FALSE; bSuccess = FALSE;
......
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