Fixed use of StrRetToStrN.
This commit is contained in:
parent
6f3d5805dd
commit
45822e6bdc
|
@ -1718,8 +1718,7 @@ HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrF
|
|||
dwFlags,
|
||||
&str)))
|
||||
{
|
||||
StrRetToStrN(lpstrFileName, MAX_PATH, &str, pidl);
|
||||
return NOERROR;
|
||||
return StrRetToStrNA(lpstrFileName, MAX_PATH, &str, pidl);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
@ -1782,7 +1781,8 @@ LPITEMIDLIST GetPidlFromName(IShellFolder *psf,LPCSTR lpcstrFileName)
|
|||
LPITEMIDLIST pidl;
|
||||
ULONG ulEaten;
|
||||
wchar_t lpwstrDirName[MAX_PATH];
|
||||
|
||||
|
||||
TRACE("sf=%p file=%s\n", psf, lpcstrFileName);
|
||||
|
||||
if(!lpcstrFileName)
|
||||
return NULL;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "unknwn.h"
|
||||
#include "filedlgbrowser.h"
|
||||
#include "winuser.h"
|
||||
#include "heap.h"
|
||||
#include "commctrl.h"
|
||||
#include "wine/obj_dataobject.h"
|
||||
#include "debugtools.h"
|
||||
|
@ -674,7 +675,7 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *
|
|||
FileOpenDlgInfos *fodInfos;
|
||||
ULONG ulAttr;
|
||||
STRRET str;
|
||||
char szPath[MAX_PATH];
|
||||
WCHAR szPathW[MAX_PATH];
|
||||
|
||||
_ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
|
||||
|
||||
|
@ -696,9 +697,16 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *
|
|||
if(!fodInfos->ShellInfos.lpstrCurrentFilter ||
|
||||
!lstrlenW(fodInfos->ShellInfos.lpstrCurrentFilter))
|
||||
return S_OK;
|
||||
IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_FORPARSING, &str);
|
||||
StrRetToStrN(szPath, MAX_PATH, &str, pidl);
|
||||
return PathMatchSpecW((LPWSTR)szPath, fodInfos->ShellInfos.lpstrCurrentFilter)? S_OK : S_FALSE;
|
||||
|
||||
if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_FORPARSING, &str)))
|
||||
{ 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
|
|||
if (!ulAttr)
|
||||
{
|
||||
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);
|
||||
|
|
|
@ -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);
|
||||
if (SUCCEEDED(IShellFolder_GetDisplayNameOf(lpsf, lpi, dwFlags, &str)))
|
||||
{ bSuccess = StrRetToStrN (lpFriendlyName, MAX_PATH, &str, lpi);
|
||||
{
|
||||
bSuccess = StrRetToStrNA (lpFriendlyName, MAX_PATH, &str, lpi);
|
||||
}
|
||||
else
|
||||
bSuccess = FALSE;
|
||||
|
|
Loading…
Reference in New Issue