28#define DEFAULTSORTORDERINDEX 0x80
35 return type == PT_CONTROLS_NEWREGITEM ? 14 : 4;
41 if (
type == PT_CONTROLS_NEWREGITEM)
42 type = PT_CONTROLS_OLDREGITEM;
51 pidl->mkid.abID[0] =
type;
52 pidl->mkid.abID[1] =
order;
100 if (pidl && pidl->mkid.cb >=
sizeof(
WORD) + 1 + 1 +
sizeof(
GUID))
104 if (pidl->mkid.abID[0] == PT_CONTROLS_OLDREGITEM)
109 FIXME(
"Unexpected GUID PIDL type %#x\n", pidl->mkid.abID[0]);
130 CComPtr<IDefaultExtractIconInit> initIcon;
154 CComPtr<IEnumIDList> EnumIDList;
157 CComPtr<IShellFolder2> psfRecycleBin;
158 CComPtr<IShellFolder> psfDesktop;
164 hr = psfRecycleBin->EnumObjects(
NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &EnumIDList);
181 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s",
201 initIcon->SetNormalIcon(wTemp, icon_idx);
206 WARN(
"Failed to load an icon for the item, setting blank icon\n");
210 return initIcon->QueryInterface(iid, ppvOut);
234 if (!(
dwFlags & SHCONTF_FOLDERS))
239 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\%s\\Namespace",
267 for (
int idx = 0; ;
idx++)
309 public CComObjectRootEx<CComMultiThreadModelNoCS>,
331 if (
item.clsid == *pCLSID)
402 *pdwAttributes |= (
dwAttributes & (SFGAO_CANLINK|SFGAO_CANDELETE|SFGAO_CANRENAME|SFGAO_HASPROPSHEET));
417 FIXME(
"Check registry\n");
429 if (!lpszDisplayName)
432 if (lpszDisplayName[0] !=
L':' || lpszDisplayName[1] !=
L':')
434 FIXME(
"What should we do here?\n");
439 for (
pch = &lpszDisplayName[2]; *
pch && *
pch !=
L'\\'; ++
pch)
441 if (*
pch ==
L',' && !pchNextOfComma)
442 pchNextOfComma =
pch + 1;
451 FIXME(
"Delegate folder\n");
462 *ppidl = pidlTemp.Detach();
466 if (pdwAttributes && *pdwAttributes)
490 CComPtr<IPersistFolder> pFolder;
493 if (!ppvOut || !pidl || !pidl->mkid.cb)
501 ERR(
"CRegFolder::BindToObject called for non guid item!\n");
519 if (!pidl1 || !pidl2 || pidl1->mkid.cb == 0 || pidl2->mkid.cb == 0)
521 ERR(
"Got an empty pidl!\n");
528 if (!clsid1 && !clsid2)
530 ERR(
"Got no guid pidl!\n");
533 else if (clsid1 && clsid2)
535 if (
memcmp(clsid1, clsid2,
sizeof(
GUID)) == 0)
556 if (!rgfInOut || !cidl || !apidl)
562 while(cidl > 0 && *apidl)
567 ERR(
"Got unknown pidl\n");
573 *rgfInOut &= ~SFGAO_VALIDATE;
597 ERR(
"Got non guid item!\n");
622 if (!pidl || !pidl->mkid.cb)
649 return SHSetStrRet(strRet, wstrName);
660 int bWantsForParsing =
FALSE;
671 bWantsForParsing =
TRUE;
684 if (bWantsForParsing)
705 PWCHAR pItemName = pszPath;
711 pathlen =
wcslen(pszPath);
712 pItemName = &pszPath[pathlen];
715 if (++pathlen < cchPath)
716 *pItemName++ =
L'\\';
723 if (
SUCCEEDED(
hr) && pathlen + 2 + 38 + 1 < cchPath)
765 ERR(
"Pidl is not reg item!\n");
773 swprintf(
szName,
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr);
829 TRACE(
"CRegFolder has no column info\n");
837 ERR(
"Pidl is not reg item!\n");
850 return SHSetStrRet(&psd->
str,
"");
861 return SHSetStrRet(&psd->
str,
"");
887 if (pRequired && pRequired->
pszCpl)
901 if (CLSID_MyDocuments != *pCLSID)
907 FIXME(
"ROS MyDocs must implement IShellPropSheetExt\n");
940 CComPtr<IShellFolder> pOuterSF;
943 SFGAOF att = (psf && cidl) ?
SHGetAttributes(pOuterSF ? pOuterSF.p : psf, apidl[0], SFGAO_FOLDER) : 0;
953 return ShellObjectCreatorInit<CRegFolder>(
pInit, pidlRoot,
riid,
ppv);
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
static HRESULT CALLBACK RegFolderContextMenuCallback(IShellFolder *psf, HWND hwnd, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
static HRESULT CRegItemContextMenu_CreateInstance(PCIDLIST_ABSOLUTE pidlFolder, HWND hwnd, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IShellFolder *psf, IContextMenu **ppcm)
static UINT GetRegItemCLSIDOffset(PIDLTYPE type)
HRESULT CGuidItemExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID iid, LPVOID *ppvOut)
static DWORD SHELL_QueryCLSIDValue(_In_ REFCLSID clsid, _In_opt_ LPCWSTR SubKey, _In_opt_ LPCWSTR Value, _In_opt_ PVOID pData, _In_opt_ PDWORD pSize)
HRESULT CRegFolder_CreateInstance(PREGFOLDERINITDATA pInit, LPCITEMIDLIST pidlRoot, REFIID riid, void **ppv)
HRESULT FormatGUIDKey(LPWSTR KeyName, SIZE_T KeySize, LPCWSTR RegPath, const GUID *riid)
static bool HasCLSIDShellFolderValue(REFCLSID clsid, LPCWSTR Value)
static LPITEMIDLIST CreateRegItem(PIDLTYPE type, REFCLSID clsid, BYTE order=0)
PRTL_UNICODE_STRING_BUFFER Path
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void shell(int argc, const char *argv[])
#define RegCloseKey(hKey)
BOOL AddToEnumList(LPITEMIDLIST pidl)
const CLSID * GetPidlClsid(PCUITEMID_CHILD pidl)
HRESULT AddItemsFromKey(IShellFolder *pSF, HKEY hkey_root, LPCWSTR szRepPath)
HRESULT Initialize(const REGFOLDERINFO *pInfo, IShellFolder *pSF, DWORD dwFlags)
BOOL HasItemWithCLSID(LPCITEMIDLIST pidl)
STDMETHOD() EnumSearches(IEnumExtraSearch **ppenum) override
STDMETHOD() MapColumnToSCID(UINT column, SHCOLUMNID *pscid) override
STDMETHOD() GetDefaultSearchGUID(GUID *pguid) override
BOOL _IsInNameSpace(_In_ LPCITEMIDLIST pidl)
STDMETHOD() CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override
STDMETHOD() GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override
STDMETHOD() CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
const REQUIREDREGITEM * IsRequiredItem(LPCITEMIDLIST pidl) const
STDMETHOD() SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override
STDMETHOD() GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override
CComHeapPtr< ITEMIDLIST > m_pidlRoot
STDMETHOD() ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes) override
STDMETHOD() GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags) override
STDMETHOD() BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override
HRESULT WINAPI Initialize(PREGFOLDERINITDATA pInit, LPCITEMIDLIST pidlRoot)
STDMETHOD() GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override
STDMETHOD() GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override
IShellFolder * m_pOuterFolder
HRESULT GetGuidItemAttributes(LPCITEMIDLIST pidl, LPDWORD pdwAttributes)
STDMETHOD() GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override
STDMETHOD() GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut) override
STDMETHOD() BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
#define ERROR_INSUFFICIENT_BUFFER
#define GET_SHGDN_RELATION(dwFlags)
#define DFM_INVOKECOMMAND
#define GET_SHGDN_FOR(dwFlags)
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegLoadMUIStringA(IN HKEY hKey, IN LPCSTR pszValue OPTIONAL, OUT LPSTR pszOutBuf, IN DWORD cbOutBuf, OUT LPDWORD pcbData OPTIONAL, IN DWORD Flags, IN LPCSTR pszDirectory OPTIONAL)
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
#define FAILED_UNEXPECTEDLY(hr)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
#define SHELL_ExecuteControlPanelCPL(hwnd, cpl)
DWORD SHGetAttributes(_In_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ DWORD dwAttributes)
DWORD BindCtx_GetMode(_In_ IBindCtx *pbc, _In_ DWORD dwDefault)
EXTERN_C HRESULT SHBindToObject(_In_opt_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ REFIID riid, _Out_ void **ppvObj)
HRESULT SHELL32_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdo, UINT msg)
HRESULT SHILClone(_In_opt_ LPCITEMIDLIST pidl, _Outptr_ LPITEMIDLIST *ppidl)
void WINAPI SHFree(LPVOID pv)
LPVOID WINAPI SHAlloc(SIZE_T len)
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
DWORD WINAPI SHSetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DWORD dwType, LPCVOID pvData, DWORD cbData)
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
WCHAR swShell32Name[MAX_PATH]
GLuint GLuint GLsizei GLenum type
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLdouble GLdouble GLint GLint order
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
HRESULT SHELL32_ShowShellExtensionProperties(const CLSID *pClsid, IDataObject *pDO)
#define COM_INTERFACE_ENTRY_IID(iid, x)
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
#define DECLARE_NOT_AGGREGATABLE(x)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static HMODULE MODULEINFO DWORD cb
static IParseDisplayName ParseDisplayName
interface IBindCtx * LPBC
const GUID IID_IDataObject
BOOL WINAPI GUIDFromStringW(_In_ PCWSTR psz, _Out_ LPGUID pguid)
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
void WINAPI ILFree(LPITEMIDLIST pidl)
BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
BOOL _ILIsBitBucket(LPCITEMIDLIST pidl)
void _ILFreeaPidl(LPITEMIDLIST *apidl, UINT cidl)
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
static const WCHAR szName[]
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes)
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
#define MAKE_COMPARE_HRESULT(x)
HRESULT SHELL32_BindToSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidl, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
#define SHFSF_COL_COMMENT
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
#define IS_SHGDN_FOR_PARSING(flags)
HRESULT SHELL32_CompareChildren(IShellFolder2 *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
static __inline int SHELL32_GUIDToStringW(REFGUID guid, LPWSTR str)
static SFGAOF SHELL_CreateFolderEnumItemAttributeQuery(SHCONTF Flags, BOOL ForRegItem)
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE *ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl)
BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
BOOL SHELL_IncludeItemInFolderEnum(IShellFolder *pSF, PCUITEMID_CHILD pidl, SFGAOF Query, SHCONTF Flags)
HRESULT SHELL32_ParseNextElement(IShellFolder2 *psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST *pidlInOut, LPOLESTR szNext, DWORD *pEaten, DWORD *pdwAttributes)
#define DFM_CMD_PROPERTIES
#define IDI_SHELL_DESKTOP
#define IDI_SHELL_DOCUMENT
ITEMIDLIST UNALIGNED * LPITEMIDLIST
ITEMID_CHILD UNALIGNED * PUITEMID_CHILD
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
void InitializeFolderInfo(const REGFOLDERINFO *pInfo)
const CLSID * IsRegItem(LPCITEMIDLIST pidl) const
const REQUIREDREGITEM & GetAt(size_t i) const
UINT GetRequiredItemsCount() const
LPITEMIDLIST CreateItem(size_t i) const
const REGFOLDERINFO * m_pInfo
PIDLTYPE GetPidlType() const
LPCWSTR GetParsingPath() const
UINT GetCLSIDOffset() const
const REQUIREDREGITEM * Items
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define HRESULT_FROM_WIN32(x)
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
#define HKEY_CLASSES_ROOT
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define IID_PPV_ARG(Itype, ppType)