ReactOS 0.4.15-dev-7942-gd23573b
CNtObjectFolderExtractIcon Class Reference

#include <ntobjfolder.h>

Inheritance diagram for CNtObjectFolderExtractIcon:
Collaboration diagram for CNtObjectFolderExtractIcon:

Public Member Functions

 CNtObjectFolderExtractIcon ()
 
virtual ~CNtObjectFolderExtractIcon ()
 
HRESULT Initialize (LPCWSTR ntPath, PCIDLIST_ABSOLUTE parent, UINT cidl, PCUITEMID_CHILD_ARRAY apidl)
 
STDMETHOD() GetIconLocation (UINT uFlags, LPWSTR szIconFile, UINT cchMax, INT *piIndex, UINT *pwFlags) override
 
STDMETHOD() Extract (LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) override
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
HRESULT GetIconLocation ([in] UINT uFlags, [out, size_is(cchMax)] LPWSTR szIconFile, [in] UINT cchMax, [out] INT *piIndex, [out] UINT *pwFlags)
 
HRESULT Extract ([in] LPCWSTR pszFile, [in] UINT nIconIndex, [out] HICON *phiconLarge, [out] HICON *phiconSmall, [in] UINT nIconSize)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Private Attributes

PCWSTR m_NtPath
 
PCITEMID_CHILD m_pcidlChild
 

Additional Inherited Members

- Public Types inherited from IExtractIconW
typedef IExtractIconWLPEXTRACTICONW
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 

Detailed Description

Definition at line 12 of file ntobjfolder.h.

Constructor & Destructor Documentation

◆ CNtObjectFolderExtractIcon()

CNtObjectFolderExtractIcon::CNtObjectFolderExtractIcon ( )

Definition at line 26 of file ntobjfolder.cpp.

26 :
29{
30
31}
PCITEMID_CHILD m_pcidlChild
Definition: ntobjfolder.h:17
#define NULL
Definition: types.h:112

◆ ~CNtObjectFolderExtractIcon()

CNtObjectFolderExtractIcon::~CNtObjectFolderExtractIcon ( )
virtual

Definition at line 33 of file ntobjfolder.cpp.

34{
35 if (m_pcidlChild)
37}
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:938
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

Member Function Documentation

◆ Extract()

HRESULT STDMETHODCALLTYPE CNtObjectFolderExtractIcon::Extract ( LPCWSTR  pszFile,
UINT  nIconIndex,
HICON phiconLarge,
HICON phiconSmall,
UINT  nIconSize 
)
override

Implements IExtractIconW.

Definition at line 97 of file ntobjfolder.cpp.

103{
104 return SHDefExtractIconW(pszFile, nIconIndex, 0, phiconLarge, phiconSmall, nIconSize);
105}
HRESULT WINAPI SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize)
Definition: iconcache.cpp:1009

◆ GetIconLocation()

HRESULT STDMETHODCALLTYPE CNtObjectFolderExtractIcon::GetIconLocation ( UINT  uFlags,
LPWSTR  szIconFile,
UINT  cchMax,
INT piIndex,
UINT pwFlags 
)
override

Implements IExtractIconW.

Definition at line 48 of file ntobjfolder.cpp.

54{
56
57 if ((entry->cb < sizeof(NtPidlEntry)) || (entry->magic != NT_OBJECT_PIDL_MAGIC))
58 return E_INVALIDARG;
59
60 UINT flags = 0;
61
62 switch (entry->objectType)
63 {
67 *piIndex = -((uFlags & GIL_OPENICON) ? IDI_NTOBJECTDIROPEN : IDI_NTOBJECTDIR);
68 *pwFlags = flags;
69 return S_OK;
70
71 case DEVICE_OBJECT:
73 *piIndex = -IDI_NTOBJECTDEVICE;
74 *pwFlags = flags;
75 return S_OK;
76
77 case PORT_OBJECT:
79 *piIndex = -IDI_NTOBJECTPORT;
80 *pwFlags = flags;
81 return S_OK;
82
83 case KEY_OBJECT:
85 *piIndex = -IDI_REGISTRYKEY;
86 *pwFlags = flags;
87 return S_OK;
88
89 default:
91 *piIndex = -IDI_NTOBJECTITEM;
92 *pwFlags = flags;
93 return S_OK;
94 }
95}
HINSTANCE g_hInstance
Definition: MainWindow.cpp:18
UINT cchMax
#define E_INVALIDARG
Definition: ddrawi.h:101
#define IDI_NTOBJECTDEVICE
Definition: resource.h:7
#define IDI_NTOBJECTPORT
Definition: resource.h:8
#define IDI_REGISTRYKEY
Definition: resource.h:9
#define IDI_NTOBJECTDIROPEN
Definition: resource.h:5
#define IDI_NTOBJECTDIR
Definition: resource.h:4
#define IDI_NTOBJECTITEM
Definition: resource.h:6
UINT uFlags
Definition: api.c:59
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
struct _DEVICE_OBJECT DEVICE_OBJECT
GLbitfield flags
Definition: glext.h:7161
#define S_OK
Definition: intsafe.h:52
uint32_t entry
Definition: isohybrid.c:63
unsigned int UINT
Definition: ndis.h:50
@ KEY_OBJECT
Definition: ntobjenum.h:16
@ SYMBOLICLINK_OBJECT
Definition: ntobjenum.h:14
@ DIRECTORY_OBJECT
Definition: ntobjenum.h:14
@ PORT_OBJECT
Definition: ntobjenum.h:19
#define NT_OBJECT_PIDL_MAGIC
Definition: ntobjenum.h:25

◆ Initialize()

HRESULT CNtObjectFolderExtractIcon::Initialize ( LPCWSTR  ntPath,
PCIDLIST_ABSOLUTE  parent,
UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl 
)

Definition at line 39 of file ntobjfolder.cpp.

40{
41 m_NtPath = ntPath;
42 if (cidl != 1)
43 return E_INVALIDARG;
44 m_pcidlChild = ILClone(apidl[0]);
45 return S_OK;
46}
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237

Member Data Documentation

◆ m_NtPath

PCWSTR CNtObjectFolderExtractIcon::m_NtPath
private

Definition at line 16 of file ntobjfolder.h.

Referenced by Initialize().

◆ m_pcidlChild

PCITEMID_CHILD CNtObjectFolderExtractIcon::m_pcidlChild
private

Definition at line 17 of file ntobjfolder.h.

Referenced by GetIconLocation(), Initialize(), and ~CNtObjectFolderExtractIcon().


The documentation for this class was generated from the following files: