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,
|
dwFlags,
|
||||||
&str)))
|
&str)))
|
||||||
{
|
{
|
||||||
StrRetToStrN(lpstrFileName, MAX_PATH, &str, pidl);
|
return StrRetToStrNA(lpstrFileName, MAX_PATH, &str, pidl);
|
||||||
return NOERROR;
|
|
||||||
}
|
}
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
@ -1783,6 +1782,7 @@ LPITEMIDLIST GetPidlFromName(IShellFolder *psf,LPCSTR lpcstrFileName)
|
||||||
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 @@
|
||||||
#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 *
|
||||||
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 *
|
||||||
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
|
||||||
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
|
||||||
|
|
||||||
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;
|
||||||
|
|
Loading…
Reference in New Issue