ReactOS  0.4.13-dev-73-gcfe54aa
CExtractIcon.cpp File Reference
#include "precomp.h"
Include dependency graph for CExtractIcon.cpp:

Go to the source code of this file.

Classes

struct  IconLocation
 
class  CExtractIcon
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
VOID DuplicateString (LPCWSTR Source, LPWSTR *Destination)
 
HRESULT WINAPI SHCreateDefaultExtractIcon (REFIID riid, void **ppv)
 
EXTERN_C HRESULT WINAPI SHCreateFileExtractIconW (LPCWSTR pszPath, DWORD dwFileAttributes, REFIID riid, void **ppv)
 

Function Documentation

◆ DuplicateString()

VOID DuplicateString ( LPCWSTR  Source,
LPWSTR Destination 
)

Definition at line 72 of file CExtractIcon.cpp.

75 {
76  SIZE_T cb;
77 
78  if (*Destination)
80 
81  cb = (wcslen(Source) + 1) * sizeof(WCHAR);
83  if (!*Destination)
84  return;
86 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CopyMemory
Definition: winbase.h:1633
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2875
static DWORD cb
Definition: integrity.c:41
ULONG_PTR SIZE_T
Definition: typedefs.h:78
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3149
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by CExtractIcon::SetDefaultIcon(), CExtractIcon::SetNormalIcon(), CExtractIcon::SetOpenIcon(), and CExtractIcon::SetShortcutIcon().

◆ SHCreateDefaultExtractIcon()

HRESULT WINAPI SHCreateDefaultExtractIcon ( REFIID  riid,
void **  ppv 
)

◆ SHCreateFileExtractIconW()

EXTERN_C HRESULT WINAPI SHCreateFileExtractIconW ( LPCWSTR  pszPath,
DWORD  dwFileAttributes,
REFIID  riid,
void **  ppv 
)

Definition at line 350 of file CExtractIcon.cpp.

354 {
355  SHFILEINFOW shfi;
356  ULONG_PTR firet = SHGetFileInfoW(pszPath, dwFileAttributes, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_ICONLOCATION);
357  HRESULT hr = E_FAIL;
358  if (firet)
359  {
362  if (FAILED_UNEXPECTEDLY(hr))
363  return hr;
364 
365  hr = iconInit->SetNormalIcon(shfi.szDisplayName, shfi.iIcon);
366  if (FAILED_UNEXPECTEDLY(hr))
367  return hr;
368 
369  return iconInit->QueryInterface(riid, ppv);
370  }
371  if (FAILED_UNEXPECTEDLY(hr))
372  return hr;
373 
374  return hr;
375 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
uint32_t ULONG_PTR
Definition: typedefs.h:63
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
Definition: shell32_main.c:410
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
#define SHGFI_USEFILEATTRIBUTES
Definition: shellapi.h:179
WCHAR szDisplayName[MAX_PATH]
Definition: shellapi.h:373
HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv)
#define SHGFI_ICONLOCATION
Definition: shellapi.h:167
DWORD dwFileAttributes

Referenced by CZipFolder::GetUIObjectOf().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )