On Sun, Jul 30, 2017 at 05:37:02PM +0800, Jactry Zeng wrote:
diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c index 1e19f7c72e..57fb849f16 100644 --- a/dlls/shell32/shellitem.c +++ b/dlls/shell32/shellitem.c @@ -662,6 +662,66 @@ HRESULT WINAPI SHCreateItemFromIDList(PCIDLIST_ABSOLUTE pidl, REFIID riid, void return ret; }
+HRESULT WINAPI SHCreateItemInKnownFolder(REFKNOWNFOLDERID rfid, DWORD flags,
LPWSTR filename, REFIID riid, void **ppv)
+{
- HRESULT hr;
- WCHAR *pathW = NULL;
- IShellFolder *desktop = NULL, *folder = NULL;
- LPITEMIDLIST pidl_folder = NULL, pidl = NULL;
- TRACE("%p, %x, %s, %s, %p\n", rfid, flags, wine_dbgstr_w(filename),
debugstr_guid(riid), ppv);
- if(!rfid || !ppv)
return E_INVALIDARG;
- if(flags)
FIXME("flags 0x%08x not supported\n", flags);
- *ppv = NULL;
- hr = SHGetDesktopFolder(&desktop);
- if(hr != S_OK) return hr;
- hr = SHGetKnownFolderPath(rfid, 0, NULL, &pathW);
- if(hr != S_OK) return hr;
- hr = IShellFolder_ParseDisplayName(desktop, NULL, NULL, pathW, NULL, &pidl_folder, NULL);
- if(hr != S_OK)
goto cleanup;
You probably want to use SHGetKnownFolderIDList() instead of these last two calls.
Huw.