2015-02-21 21:21:02 +00:00
|
|
|
/*
|
2015-02-23 16:28:13 +00:00
|
|
|
* PROJECT: ReactOS shell extensions
|
2015-02-21 21:21:02 +00:00
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
2015-09-27 18:40:24 +00:00
|
|
|
* FILE: dll/shellext/ntobjshex/ntobjfolder.h
|
2015-02-23 16:28:13 +00:00
|
|
|
* PURPOSE: NT Object Namespace shell extension
|
|
|
|
* PROGRAMMERS: David Quintana <gigaherz@gmail.com>
|
2015-02-21 21:21:02 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
extern const GUID CLSID_NtObjectFolder;
|
|
|
|
|
2017-06-23 21:28:36 +00:00
|
|
|
class CNtObjectFolderExtractIcon :
|
2015-02-21 21:21:02 +00:00
|
|
|
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
2017-06-23 21:28:36 +00:00
|
|
|
public IExtractIconW
|
2015-02-21 21:21:02 +00:00
|
|
|
{
|
2017-06-23 21:28:36 +00:00
|
|
|
PCWSTR m_NtPath;
|
|
|
|
PCITEMID_CHILD m_pcidlChild;
|
|
|
|
|
|
|
|
public:
|
|
|
|
CNtObjectFolderExtractIcon();
|
|
|
|
|
|
|
|
virtual ~CNtObjectFolderExtractIcon();
|
2015-02-21 21:21:02 +00:00
|
|
|
|
2017-06-23 21:28:36 +00:00
|
|
|
HRESULT Initialize(LPCWSTR ntPath, PCIDLIST_ABSOLUTE parent, UINT cidl, PCUITEMID_CHILD_ARRAY apidl);
|
2015-02-21 21:21:02 +00:00
|
|
|
|
2017-06-23 21:28:36 +00:00
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetIconLocation(
|
|
|
|
UINT uFlags,
|
|
|
|
LPWSTR szIconFile,
|
|
|
|
UINT cchMax,
|
|
|
|
INT *piIndex,
|
|
|
|
UINT *pwFlags);
|
|
|
|
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE Extract(
|
|
|
|
LPCWSTR pszFile,
|
|
|
|
UINT nIconIndex,
|
|
|
|
HICON *phiconLarge,
|
|
|
|
HICON *phiconSmall,
|
|
|
|
UINT nIconSize);
|
|
|
|
|
|
|
|
DECLARE_NOT_AGGREGATABLE(CNtObjectFolderExtractIcon)
|
|
|
|
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
|
|
|
|
|
|
|
BEGIN_COM_MAP(CNtObjectFolderExtractIcon)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IExtractIconW, IExtractIconW)
|
|
|
|
END_COM_MAP()
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class CNtObjectFolder :
|
|
|
|
public CComCoClass<CNtObjectFolder, &CLSID_NtObjectFolder>,
|
|
|
|
public CCommonFolder<CNtObjectFolder, NtPidlEntry, CNtObjectFolderExtractIcon>
|
|
|
|
{
|
2015-02-21 21:21:02 +00:00
|
|
|
public:
|
2017-06-24 22:01:46 +00:00
|
|
|
DECLARE_REGISTRY_RESOURCEID(IDR_NTOBJECTFOLDER)
|
2015-02-21 21:21:02 +00:00
|
|
|
|
|
|
|
CNtObjectFolder();
|
|
|
|
virtual ~CNtObjectFolder();
|
|
|
|
|
|
|
|
// IShellFolder
|
|
|
|
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE EnumObjects(
|
|
|
|
HWND hwndOwner,
|
|
|
|
SHCONTF grfFlags,
|
|
|
|
IEnumIDList **ppenumIDList);
|
|
|
|
|
2017-06-23 23:23:17 +00:00
|
|
|
protected:
|
2017-06-23 21:28:36 +00:00
|
|
|
virtual HRESULT STDMETHODCALLTYPE InternalBindToObject(
|
|
|
|
PWSTR path,
|
|
|
|
const NtPidlEntry * info,
|
|
|
|
LPITEMIDLIST first,
|
|
|
|
LPCITEMIDLIST rest,
|
|
|
|
LPITEMIDLIST fullPidl,
|
2015-02-21 21:21:02 +00:00
|
|
|
LPBC pbcReserved,
|
2017-06-23 21:28:36 +00:00
|
|
|
IShellFolder** ppsfChild);
|
2017-06-23 23:23:17 +00:00
|
|
|
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE ResolveSymLink(
|
2017-06-23 21:28:36 +00:00
|
|
|
const NtPidlEntry * info,
|
2017-06-23 23:23:17 +00:00
|
|
|
LPITEMIDLIST * fullPidl);
|
2015-02-21 21:21:02 +00:00
|
|
|
|
2017-06-23 23:23:17 +00:00
|
|
|
public:
|
2015-02-21 21:21:02 +00:00
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetDefaultColumnState(
|
|
|
|
UINT iColumn,
|
|
|
|
SHCOLSTATEF *pcsFlags);
|
|
|
|
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetDetailsEx(
|
|
|
|
LPCITEMIDLIST pidl,
|
|
|
|
const SHCOLUMNID *pscid,
|
|
|
|
VARIANT *pv);
|
|
|
|
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetDetailsOf(
|
|
|
|
LPCITEMIDLIST pidl,
|
|
|
|
UINT iColumn,
|
|
|
|
SHELLDETAILS *psd);
|
|
|
|
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE MapColumnToSCID(
|
|
|
|
UINT iColumn,
|
|
|
|
SHCOLUMNID *pscid);
|
|
|
|
|
|
|
|
// IPersistFolder
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidl);
|
|
|
|
|
|
|
|
// Internal
|
2015-02-22 20:18:48 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidl, PCWSTR ntPath);
|
2015-02-21 21:21:02 +00:00
|
|
|
|
2017-06-23 21:28:36 +00:00
|
|
|
protected:
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE CompareIDs(LPARAM lParam, const NtPidlEntry * first, const NtPidlEntry * second);
|
|
|
|
virtual ULONG STDMETHODCALLTYPE ConvertAttributes(const NtPidlEntry * entry, PULONG inMask);
|
|
|
|
virtual BOOL STDMETHODCALLTYPE IsFolder(const NtPidlEntry * info);
|
|
|
|
virtual BOOL STDMETHODCALLTYPE IsSymLink(const NtPidlEntry * info);
|
2015-03-14 03:15:36 +00:00
|
|
|
|
2017-06-23 21:28:36 +00:00
|
|
|
virtual HRESULT GetInfoFromPidl(LPCITEMIDLIST pcidl, const NtPidlEntry ** pentry);
|
2015-02-21 21:21:02 +00:00
|
|
|
|
2017-06-23 21:28:36 +00:00
|
|
|
HRESULT FormatValueData(DWORD contentType, PVOID td, DWORD contentsLength, PCWSTR * strContents);
|
2015-02-21 21:21:02 +00:00
|
|
|
|
2017-06-23 21:28:36 +00:00
|
|
|
HRESULT FormatContentsForDisplay(const NtPidlEntry * info, HKEY rootKey, LPCWSTR ntPath, PCWSTR * strContents);
|
2015-02-21 21:21:02 +00:00
|
|
|
};
|