Commit 594e0b67 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shell32: Forward couple of IKnownFolder methods to regular API equivalents.

parent 2c98d5b9
......@@ -379,6 +379,7 @@
@ stdcall SHGetItemFromDataObject(ptr long ptr ptr)
@ stdcall SHGetItemFromObject(ptr ptr ptr)
@ stdcall SHGetKnownFolderIDList(ptr long ptr ptr)
@ stdcall SHGetKnownFolderItem(ptr long long ptr ptr)
@ stdcall SHGetKnownFolderPath(ptr long ptr ptr)
@ stdcall SHGetLocalizedName(wstr ptr long ptr)
@ stdcall SHGetMalloc(ptr)
......
......@@ -5103,12 +5103,13 @@ static HRESULT WINAPI knownfolder_GetCategory(
static HRESULT WINAPI knownfolder_GetShellItem(
IKnownFolder *iface,
DWORD dwFlags,
DWORD flags,
REFIID riid,
void **ppv)
{
FIXME("0x%08x, %s, %p\n", dwFlags, debugstr_guid(riid), ppv);
return E_NOTIMPL;
struct knownfolder *knownfolder = impl_from_IKnownFolder(iface);
TRACE("(%p, 0x%08x, %s, %p)\n", knownfolder, flags, debugstr_guid(riid), ppv);
return SHGetKnownFolderItem(&knownfolder->id, flags, NULL, riid, ppv);
}
static HRESULT get_known_folder_path(
......@@ -5275,11 +5276,12 @@ static HRESULT WINAPI knownfolder_SetPath(
static HRESULT WINAPI knownfolder_GetIDList(
IKnownFolder *iface,
DWORD dwFlags,
DWORD flags,
PIDLIST_ABSOLUTE *ppidl)
{
FIXME("0x%08x, %p\n", dwFlags, ppidl);
return E_NOTIMPL;
struct knownfolder *knownfolder = impl_from_IKnownFolder( iface );
TRACE("(%p, 0x%08x, %p)\n", knownfolder, flags, ppidl);
return SHGetKnownFolderIDList(&knownfolder->id, flags, NULL, ppidl);
}
static HRESULT WINAPI knownfolder_GetFolderType(
......@@ -5717,6 +5719,26 @@ HRESULT WINAPI SHGetKnownFolderIDList(REFKNOWNFOLDERID rfid, DWORD flags, HANDLE
return E_NOTIMPL;
}
HRESULT WINAPI SHGetKnownFolderItem(REFKNOWNFOLDERID rfid, KNOWN_FOLDER_FLAG flags, HANDLE hToken,
REFIID riid, void **ppv)
{
PIDLIST_ABSOLUTE pidl;
HRESULT hr;
TRACE("%s, 0x%08x, %p, %s, %p\n", debugstr_guid(rfid), flags, hToken, debugstr_guid(riid), ppv);
hr = SHGetKnownFolderIDList(rfid, flags, hToken, &pidl);
if (FAILED(hr))
{
*ppv = NULL;
return hr;
}
hr = SHCreateItemFromIDList(pidl, riid, ppv);
CoTaskMemFree(pidl);
return hr;
}
static void register_system_knownfolders(void)
{
int i;
......
......@@ -42,6 +42,21 @@ extern "C" {
DECLARE_HANDLE(HPSXA);
#endif
typedef enum
{
KF_FLAG_DEFAULT = 0x00000000,
KF_FLAG_SIMPLE_IDLIST = 0x00000100,
KF_FLAG_NOT_PARENT_RELATIVE = 0x00000200,
KF_FLAG_DEFAULT_PATH = 0x00000400,
KF_FLAG_INIT = 0x00000800,
KF_FLAG_NO_ALIAS = 0x00001000,
KF_FLAG_DONT_UNEXPAND = 0x00002000,
KF_FLAG_DONT_VERIFY = 0x00004000,
KF_FLAG_CREATE = 0x00008000,
KF_FLAG_NO_APPCONTAINER_REDIRECTION = 0x00010000,
KF_FLAG_ALIAS_ONLY = 0x80000000
} KNOWN_FOLDER_FLAG;
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA,LPFNADDPROPSHEETPAGE,LPARAM);
LPVOID WINAPI SHAlloc(ULONG) __WINE_ALLOC_SIZE(1);
HRESULT WINAPI SHCoCreateInstance(LPCWSTR,const CLSID*,IUnknown*,REFIID,LPVOID*);
......@@ -62,6 +77,8 @@ HRESULT WINAPI SHGetInstanceExplorer(IUnknown**);
HRESULT WINAPI SHGetFolderPathAndSubDirA(HWND,int,HANDLE,DWORD,LPCSTR,LPSTR);
HRESULT WINAPI SHGetFolderPathAndSubDirW(HWND,int,HANDLE,DWORD,LPCWSTR,LPWSTR);
#define SHGetFolderPathAndSubDir WINELIB_NAME_AW(SHGetFolderPathAndSubDir)
HRESULT WINAPI SHGetKnownFolderIDList(REFKNOWNFOLDERID,DWORD,HANDLE,PIDLIST_ABSOLUTE*);
HRESULT WINAPI SHGetKnownFolderItem(REFKNOWNFOLDERID,KNOWN_FOLDER_FLAG,HANDLE,REFIID,void**);
HRESULT WINAPI SHGetKnownFolderPath(REFKNOWNFOLDERID,DWORD,HANDLE,PWSTR*);
BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST,LPSTR);
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST,LPWSTR);
......@@ -92,15 +109,6 @@ BOOL WINAPI Shell_GetImageLists(HIMAGELIST*,HIMAGELIST*);
BOOL WINAPI SignalFileOpen(PCIDLIST_ABSOLUTE);
BOOL WINAPI ImportPrivacySettings(LPCWSTR, BOOL*, BOOL*);
#define KF_FLAG_SIMPLE_IDLIST 0x00000100
#define KF_FLAG_NOT_PARENT_RELATIVE 0x00000200
#define KF_FLAG_DEFAULT_PATH 0x00000400
#define KF_FLAG_INIT 0x00000800
#define KF_FLAG_NO_ALIAS 0x00001000
#define KF_FLAG_DONT_UNEXPAND 0x00002000
#define KF_FLAG_DONT_VERIFY 0x00004000
#define KF_FLAG_CREATE 0x00008000
#define SHFMT_ERROR __MSABI_LONG(0xFFFFFFFF) /* Error on last format, drive may be formattable */
#define SHFMT_CANCEL __MSABI_LONG(0xFFFFFFFE) /* Last format was cancelled */
#define SHFMT_NOFORMAT __MSABI_LONG(0xFFFFFFFD) /* Drive is not formattable */
......
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