ReactOS  0.4.14-dev-1256-g2125fec
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)
 
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)
 
- 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 ()
 
- 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 27 of file ntobjfolder.cpp.

27  :
28  m_NtPath(NULL),
30 {
31 
32 }
PCITEMID_CHILD m_pcidlChild
Definition: ntobjfolder.h:17
smooth NULL
Definition: ftsmooth.c:416

◆ ~CNtObjectFolderExtractIcon()

CNtObjectFolderExtractIcon::~CNtObjectFolderExtractIcon ( )
virtual

Definition at line 34 of file ntobjfolder.cpp.

35 {
36  if (m_pcidlChild)
38 }
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
PCITEMID_CHILD m_pcidlChild
Definition: ntobjfolder.h:17
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 
)
virtual

Implements IExtractIconW.

Definition at line 94 of file ntobjfolder.cpp.

100 {
101  return SHDefExtractIconW(pszFile, nIconIndex, 0, phiconLarge, phiconSmall, nIconSize);
102 }
HRESULT WINAPI SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize)
Definition: iconcache.cpp:1032

◆ GetIconLocation()

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

Implements IExtractIconW.

Definition at line 49 of file ntobjfolder.cpp.

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

◆ Initialize()

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

Definition at line 40 of file ntobjfolder.cpp.

41 {
42  m_NtPath = ntPath;
43  if (cidl != 1)
44  return E_INVALIDARG;
45  m_pcidlChild = ILClone(apidl[0]);
46  return S_OK;
47 }
PCITEMID_CHILD m_pcidlChild
Definition: ntobjfolder.h:17
#define E_INVALIDARG
Definition: ddrawi.h:101
#define S_OK
Definition: intsafe.h:59
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228

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: