ReactOS 0.4.15-dev-7659-ga55345b
CZipFolder Class Reference

#include <CZipFolder.hpp>

Inheritance diagram for CZipFolder:
Collaboration diagram for CZipFolder:

Public Member Functions

 CZipFolder ()
 
 ~CZipFolder ()
 
void Close ()
 
 STDMETHODIMP_ (unzFile) getZip()
 
STDMETHODIMP GetDefaultSearchGUID (GUID *pguid)
 
STDMETHODIMP EnumSearches (IEnumExtraSearch **ppenum)
 
STDMETHODIMP GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
 
STDMETHODIMP GetDefaultColumnState (UINT iColumn, DWORD *pcsFlags)
 
STDMETHODIMP GetDetailsEx (PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
 
BOOL _GetFileTimeString (LPFILETIME lpFileTime, PWSTR pwszResult, UINT cchResult)
 
STDMETHODIMP GetDetailsOf (PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
 
STDMETHODIMP MapColumnToSCID (UINT column, SHCOLUMNID *pscid)
 
STDMETHODIMP ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes)
 
STDMETHODIMP EnumObjects (HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
 
STDMETHODIMP BindToObject (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
 
STDMETHODIMP BindToStorage (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
 
STDMETHODIMP CompareIDs (LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
 
STDMETHODIMP CreateViewObject (HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
 
STDMETHODIMP GetAttributesOf (UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
 
STDMETHODIMP GetUIObjectOf (HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
 
STDMETHODIMP GetDisplayNameOf (PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
 
STDMETHODIMP SetNameOf (HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
 
STDMETHODIMP GetCommandString (UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax)
 
STDMETHODIMP InvokeCommand (LPCMINVOKECOMMANDINFO pici)
 
STDMETHODIMP QueryContextMenu (HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
 
STDMETHODIMP Initialize (PCIDLIST_ABSOLUTE pidlFolder, LPDATAOBJECT pDataObj, HKEY hkeyProgID)
 
STDMETHODIMP GetCurFolder (PIDLIST_ABSOLUTE *pidl)
 
STDMETHODIMP Initialize (PCIDLIST_ABSOLUTE pidl)
 
STDMETHODIMP GetClassID (CLSID *lpClassId)
 
STDMETHODIMP Initialize (PCWSTR zipFile, PCWSTR zipDir, PCUIDLIST_ABSOLUTE curDir, PCUIDLIST_RELATIVE pidl)
 
- 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 GetDefaultSearchGUID ([out] GUID *lpguid)
 
HRESULT EnumSearches ([out] IEnumExtraSearch **ppenum)
 
HRESULT GetDefaultColumn ([in] DWORD dwReserved, [out] ULONG *pSort, [out] ULONG *pDisplay)
 
HRESULT GetDefaultColumnState ([in] UINT iColumn, [out] SHCOLSTATEF *pcsFlags)
 
HRESULT GetDetailsEx ([in] PCUITEMID_CHILD pidl, [in] const SHCOLUMNID *pscid, [out] VARIANT *pv)
 
HRESULT GetDetailsOf ([in] PCUITEMID_CHILD pidl, [in] UINT iColumn, [out] SHELLDETAILS *psd)
 
HRESULT MapColumnToSCID ([in] UINT iColumn, [in] SHCOLUMNID *pscid)
 
- Public Member Functions inherited from IShellFolder
HRESULT ParseDisplayName ([in] HWND hwndOwner, [in] LPBC pbcReserved, [in, string] LPOLESTR lpszDisplayName, [out] ULONG *pchEaten, [out] PIDLIST_RELATIVE *ppidl, [in, out, unique] ULONG *pdwAttributes)
 
HRESULT EnumObjects ([in] HWND hwndOwner, [in] SHCONTF grfFlags, [out] IEnumIDList **ppenumIDList)
 
HRESULT BindToObject ([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
 
HRESULT BindToStorage ([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvObj)
 
HRESULT CompareIDs ([in] LPARAM lParam, [in] PCUIDLIST_RELATIVE pidl1, [in] PCUIDLIST_RELATIVE pidl2)
 
HRESULT CreateViewObject ([in] HWND hwndOwner, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
 
HRESULT GetAttributesOf ([in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in, out] SFGAOF *rgfInOut)
 
HRESULT GetUIObjectOf ([in] HWND hwndOwner, [in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in] REFIID riid, [in, out, unique] UINT *prgfInOut, [out, iid_is(riid)] void **ppvOut)
 
HRESULT GetDisplayNameOf ([in] PCUITEMID_CHILD pidl, [in] SHGDNF uFlags, [out] STRRET *lpName)
 
HRESULT SetNameOf ([in] HWND hwnd, [in] PCUITEMID_CHILD pidl, [in, string] LPCOLESTR lpszName, [in] SHGDNF uFlags, [out] PITEMID_CHILD *ppidlOut)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
HRESULT QueryContextMenu ([in] HMENU hmenu, [in] UINT indexMenu, [in] UINT idCmdFirst, [in] UINT idCmdLast, [in] UINT uFlags)
 
HRESULT InvokeCommand ([in] LPCMINVOKECOMMANDINFO lpici)
 
HRESULT GetCommandString ([in] UINT_PTR idCmd, [in] UINT uType, [out] UINT *pwReserved, [out, size_is(cchMax)] LPSTR pszName, [in] UINT cchMax)
 
- Public Member Functions inherited from IShellExtInit
HRESULT Initialize ([in] PCIDLIST_ABSOLUTE pidlFolder, [in] IDataObject *pdtobj, [in] HKEY hkeyProgID)
 
HRESULT GetCurFolder ([out] PIDLIST_ABSOLUTE *ppidl)
 
HRESULT Initialize ([in] PCIDLIST_ABSOLUTE pidl)
 
HRESULT GetClassID ([out] CLSID *pClassID)
 
virtual STDMETHODIMP_ (unzFile) getZip() PURE
 

Static Public Member Functions

static HRESULT CALLBACK ZipFolderMenuCallback (IShellFolder *psf, HWND hwnd, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static DWORD WINAPI s_ExtractProc (LPVOID arg)
 
- 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)
 

Private Attributes

CStringW m_ZipFile
 
CStringW m_ZipDir
 
CComHeapPtr< ITEMIDLISTm_CurDir
 
unzFile m_UnzipFile
 

Additional Inherited Members

- Public Types inherited from IShellFolder2
typedef struct IShellFolder2::SHCOLUMNIDLPSHCOLUMNID
 
typedef const SHCOLUMNIDLPCSHCOLUMNID
 
- Public Types inherited from IShellFolder
enum  tagSHGDN {
  SHGDN_NORMAL = 0 , SHGDN_INFOLDER = 1 , SHGDN_FOREDITING = 0x1000 , SHGDN_INCLUDE_NONFILESYS = 0x2000 ,
  SHGDN_FORADDRESSBAR = 0x4000 , SHGDN_FORPARSING = 0x8000
}
 
enum  tagSHCONTF {
  SHCONTF_FOLDERS = 32 , SHCONTF_NONFOLDERS = 64 , SHCONTF_INCLUDEHIDDEN = 128 , SHCONTF_INIT_ON_FIRST_NEXT = 256 ,
  SHCONTF_NETPRINTERSRCH = 512 , SHCONTF_SHAREABLE = 1024 , SHCONTF_STORAGE = 2048 , SHCONTF_NAVIGATION_ENUM = 0x01000 ,
  SHCONTF_FASTITEMS = 0x02000 , SHCONTF_FLATLIST = 0x04000 , SHCONTF_ENABLE_ASYNC = 0x08000 , SHCONTF_INCLUDESUPERHIDDEN = 0x10000
}
 
typedef IShellFolderLPSHELLFOLDER
 
typedef enum IShellFolder::tagSHGDN SHGNO
 
typedef DWORD SHGDNF
 
typedef DWORD SHCONTF
 
typedef ULONG SFGAOF
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IContextMenu
typedef IContextMenuLPCONTEXTMENU
 
typedef struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMINVOKECOMMANDINFOLPCMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
 
typedef struct IContextMenu::tagCMInvokeCommandInfoExLPCMINVOKECOMMANDINFOEX
 
- Public Types inherited from IShellExtInit
typedef IShellExtInitLPSHELLEXTINIT
 
- Public Types inherited from IPersistFolder2
typedef IPersistFolder2LPPERSISTFOLDER2
 
- Public Types inherited from IPersistFolder
typedef IPersistFolderLPPERSISTFOLDER
 
- Public Types inherited from IPersist
typedef IPersistLPPERSIST
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Static Public Attributes inherited from IContextMenu
static const WCHAR CMDSTR_NEWFOLDERW [] = {'N','e','w','F','o','l','d','e','r',0}
 
static const WCHAR CMDSTR_VIEWLISTW [] = {'V','i','e','w','L','i','s','t',0}
 
static const WCHAR CMDSTR_VIEWDETAILSW [] = {'V','i','e','w','D','e','t','a','i','l','s',0}
 

Detailed Description

Definition at line 29 of file CZipFolder.hpp.

Constructor & Destructor Documentation

◆ CZipFolder()

CZipFolder::CZipFolder ( )
inline

Definition at line 46 of file CZipFolder.hpp.

48 {
49 }
unzFile m_UnzipFile
Definition: CZipFolder.hpp:43
#define NULL
Definition: types.h:112

◆ ~CZipFolder()

CZipFolder::~CZipFolder ( )
inline

Definition at line 51 of file CZipFolder.hpp.

52 {
53 Close();
54 }
void Close()
Definition: CZipFolder.hpp:56

Member Function Documentation

◆ _GetFileTimeString()

BOOL CZipFolder::_GetFileTimeString ( LPFILETIME  lpFileTime,
PWSTR  pwszResult,
UINT  cchResult 
)
inline

Definition at line 103 of file CZipFolder.hpp.

104 {
105 SYSTEMTIME st;
106
107 if (!FileTimeToSystemTime(lpFileTime, &st))
108 return FALSE;
109
110 size_t cchRemaining = cchResult;
111 PWSTR pwszEnd = pwszResult;
112 int cchWritten = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, pwszEnd, cchRemaining);
113 if (cchWritten)
114 --cchWritten; // GetDateFormatW returns count with terminating zero
115 else
116 return FALSE;
117 cchRemaining -= cchWritten;
118 pwszEnd += cchWritten;
119
120 StringCchCopyExW(pwszEnd, cchRemaining, L" ", &pwszEnd, &cchRemaining, 0);
121
122 cchWritten = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, pwszEnd, cchRemaining);
123 if (cchWritten)
124 --cchWritten; // GetTimeFormatW returns count with terminating zero
125 else
126 return FALSE;
127
128 return TRUE;
129 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:188
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1093
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:993
#define LOCALE_USER_DEFAULT
#define L(x)
Definition: ntvdm.h:50
STRSAFEAPI StringCchCopyExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags)
Definition: strsafe.h:184
uint16_t * PWSTR
Definition: typedefs.h:56
#define DATE_SHORTDATE
Definition: winnls.h:196

Referenced by GetDetailsOf().

◆ BindToObject()

STDMETHODIMP CZipFolder::BindToObject ( PCUIDLIST_RELATIVE  pidl,
LPBC  pbcReserved,
REFIID  riid,
LPVOID ppvOut 
)
inline

Definition at line 226 of file CZipFolder.hpp.

227 {
228 if (riid == IID_IShellFolder)
229 {
230 CStringW newZipDir = m_ZipDir;
231 PCUIDLIST_RELATIVE curpidl = pidl;
232 while (curpidl->mkid.cb)
233 {
234 const ZipPidlEntry* zipEntry = _ZipFromIL(curpidl);
235 if (!zipEntry)
236 {
237 return E_FAIL;
238 }
239 newZipDir += zipEntry->Name;
240 newZipDir += L'/';
241
242 curpidl = ILGetNext(curpidl);
243 }
244 return ShellObjectCreatorInit<CZipFolder>(m_ZipFile, newZipDir, m_CurDir, pidl, riid, ppvOut);
245 }
246 DbgPrint("%s(%S) UNHANDLED\n", __FUNCTION__, guid2string(riid));
247 return E_NOTIMPL;
248 }
WCHAR * guid2string(REFCLSID iid)
Definition: Debug.cpp:21
CStringW m_ZipFile
Definition: CZipFolder.hpp:40
CComHeapPtr< ITEMIDLIST > m_CurDir
Definition: CZipFolder.hpp:42
CStringW m_ZipDir
Definition: CZipFolder.hpp:41
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define __FUNCTION__
Definition: types.h:116
#define DbgPrint
Definition: hal.h:12
REFIID riid
Definition: atlbase.h:39
CAtlStringW CStringW
Definition: atlstr.h:130
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:855
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
WCHAR Name[1]
Definition: zippidl.hpp:28
const ZipPidlEntry * _ZipFromIL(LPCITEMIDLIST pidl)
Definition: zippidl.cpp:41

◆ BindToStorage()

STDMETHODIMP CZipFolder::BindToStorage ( PCUIDLIST_RELATIVE  pidl,
LPBC  pbcReserved,
REFIID  riid,
LPVOID ppvOut 
)
inline

Definition at line 249 of file CZipFolder.hpp.

250 {
252 return E_NOTIMPL;
253 }
#define UNIMPLEMENTED
Definition: debug.h:115

◆ Close()

void CZipFolder::Close ( )
inline

Definition at line 56 of file CZipFolder.hpp.

57 {
58 if (m_UnzipFile)
61 }
int ZEXPORT unzClose(unzFile file)
Definition: unzip.c:813

Referenced by ~CZipFolder().

◆ CompareIDs()

STDMETHODIMP CZipFolder::CompareIDs ( LPARAM  lParam,
PCUIDLIST_RELATIVE  pidl1,
PCUIDLIST_RELATIVE  pidl2 
)
inline

Implements IShellFolder.

Definition at line 254 of file CZipFolder.hpp.

255 {
256 const ZipPidlEntry* zipEntry1 = _ZipFromIL(pidl1);
257 const ZipPidlEntry* zipEntry2 = _ZipFromIL(pidl2);
258
259 if (!zipEntry1 || !zipEntry2)
260 return E_INVALIDARG;
261
262 int result = 0;
263 if (zipEntry1->ZipType != zipEntry2->ZipType)
264 result = zipEntry1->ZipType - zipEntry2->ZipType;
265 else
266 result = _wcsicmp(zipEntry1->Name, zipEntry2->Name);
267
268 if (!result && zipEntry1->ZipType == ZIP_PIDL_DIRECTORY)
269 {
270 PCUIDLIST_RELATIVE child1 = ILGetNext(pidl1);
271 PCUIDLIST_RELATIVE child2 = ILGetNext(pidl2);
272
273 if (child1->mkid.cb && child2->mkid.cb)
274 return CompareIDs(lParam, child1, child2);
275 else if (child1->mkid.cb)
276 result = 1;
277 else if (child2->mkid.cb)
278 result = -1;
279 }
280
282 }
STDMETHODIMP CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
Definition: CZipFolder.hpp:254
LPARAM lParam
Definition: combotst.c:139
#define E_INVALIDARG
Definition: ddrawi.h:101
GLuint64EXT * result
Definition: glext.h:11304
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:573
ZipPidlType ZipType
Definition: zippidl.hpp:22
@ ZIP_PIDL_DIRECTORY
Definition: zippidl.hpp:12

Referenced by CompareIDs().

◆ CreateViewObject()

STDMETHODIMP CZipFolder::CreateViewObject ( HWND  hwndOwner,
REFIID  riid,
LPVOID ppvOut 
)
inline

Definition at line 283 of file CZipFolder.hpp.

284 {
285 static const GUID UnknownIID = // {93F81976-6A0D-42C3-94DD-AA258A155470}
286 {0x93F81976, 0x6A0D, 0x42C3, {0x94, 0xDD, 0xAA, 0x25, 0x8A, 0x15, 0x54, 0x70}};
287 if (riid == IID_IShellView)
288 {
289 SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
290 CComPtr<IShellFolderViewCB> pcb;
291
292 HRESULT hr = _CFolderViewCB_CreateInstance(IID_PPV_ARG(IShellFolderViewCB, &pcb));
294 return hr;
295
296 sfvparams.psfvcb = pcb;
297 hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
298
299 return hr;
300 }
301 else if (riid == IID_IExplorerCommandProvider)
302 {
304 }
305 else if (riid == IID_IContextMenu)
306 {
307 // Folder context menu
308 return QueryInterface(riid, ppvOut);
309 }
310 if (UnknownIID != riid)
311 DbgPrint("%s(%S) UNHANDLED\n", __FUNCTION__, guid2string(riid));
312 return E_NOTIMPL;
313 }
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3844
HRESULT _CExplorerCommandProvider_CreateInstance(IContextMenu *zipObject, REFIID riid, LPVOID *ppvOut)
HRESULT _CFolderViewCB_CreateInstance(REFIID riid, LPVOID *ppvOut)
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
HRESULT hr
Definition: shlfolder.c:183
struct _SFV_CREATE SFV_CREATE
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1351
#define IID_PPV_ARG(Itype, ppType)

◆ EnumObjects()

STDMETHODIMP CZipFolder::EnumObjects ( HWND  hwndOwner,
DWORD  dwFlags,
LPENUMIDLIST *  ppEnumIDList 
)
inline

Definition at line 222 of file CZipFolder.hpp.

223 {
225 }
HRESULT _CEnumZipContents_CreateInstance(IZip *zip, DWORD flags, PCWSTR prefix, REFIID riid, LPVOID *ppvOut)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

◆ EnumSearches()

STDMETHODIMP CZipFolder::EnumSearches ( IEnumExtraSearch **  ppenum)
inline

Implements IShellFolder2.

Definition at line 80 of file CZipFolder.hpp.

81 {
83 return E_NOTIMPL;
84 }

◆ GetAttributesOf()

STDMETHODIMP CZipFolder::GetAttributesOf ( UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl,
DWORD rgfInOut 
)
inline

Definition at line 314 of file CZipFolder.hpp.

315 {
316 if (!rgfInOut || !cidl || !apidl)
317 return E_INVALIDARG;
318
319 *rgfInOut = 0;
320
321 //static DWORD dwFileAttrs = SFGAO_STREAM | SFGAO_HASPROPSHEET | SFGAO_CANDELETE | SFGAO_CANCOPY | SFGAO_CANMOVE;
322 //static DWORD dwFolderAttrs = SFGAO_FOLDER | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANDELETE | SFGAO_STORAGE | SFGAO_CANCOPY | SFGAO_CANMOVE;
323 static DWORD dwFileAttrs = SFGAO_STREAM;
324 static DWORD dwFolderAttrs = SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_BROWSABLE;
325
326
327 while (cidl > 0 && *apidl)
328 {
329 const ZipPidlEntry* zipEntry = _ZipFromIL(*apidl);
330
331 if (zipEntry)
332 {
333 if (zipEntry->ZipType == ZIP_PIDL_FILE)
334 *rgfInOut |= dwFileAttrs;
335 else
336 *rgfInOut |= dwFolderAttrs;
337 }
338 else
339 {
340 *rgfInOut = 0;
341 }
342
343 apidl++;
344 cidl--;
345 }
346
347 *rgfInOut &= ~SFGAO_VALIDATE;
348 return S_OK;
349 }
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:52
@ ZIP_PIDL_FILE
Definition: zippidl.hpp:13

◆ GetClassID()

STDMETHODIMP CZipFolder::GetClassID ( CLSID lpClassId)
inline

Implements IPersist.

Definition at line 612 of file CZipFolder.hpp.

613 {
614 DbgPrint("%s\n", __FUNCTION__);
615 return E_NOTIMPL;
616 }

◆ GetCommandString()

STDMETHODIMP CZipFolder::GetCommandString ( UINT_PTR  idCmd,
UINT  uFlags,
UINT pwReserved,
LPSTR  pszName,
UINT  cchMax 
)
inline

Implements IContextMenu.

Definition at line 467 of file CZipFolder.hpp.

468 {
469 if (idCmd != 0)
470 return E_INVALIDARG;
471
472 switch (uFlags)
473 {
474 case GCS_VERBA:
475 return StringCchCopyA(pszName, cchMax, EXTRACT_VERBA);
476 case GCS_VERBW:
477 return StringCchCopyW((PWSTR)pszName, cchMax, EXTRACT_VERBW);
478 case GCS_HELPTEXTA:
479 {
481 return StringCchCopyA(pszName, cchMax, helpText);
482 }
483 case GCS_HELPTEXTW:
484 {
486 return StringCchCopyW((PWSTR)pszName, cchMax, helpText);
487 }
488 case GCS_VALIDATEA:
489 case GCS_VALIDATEW:
490 return S_OK;
491 }
492
493 return E_INVALIDARG;
494 }
UINT cchMax
#define EXTRACT_VERBA
Definition: precomp.h:25
#define EXTRACT_VERBW
Definition: precomp.h:26
#define IDS_HELPTEXT
Definition: resource.h:74
UINT uFlags
Definition: api.c:59
CAtlStringA CStringA
Definition: atlstr.h:131
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
STRSAFEAPI StringCchCopyA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
Definition: strsafe.h:145
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581

◆ GetCurFolder()

STDMETHODIMP CZipFolder::GetCurFolder ( PIDLIST_ABSOLUTE pidl)
inline

Implements IPersistFolder2.

Definition at line 590 of file CZipFolder.hpp.

591 {
592 *pidl = ILClone(m_CurDir);
593 return S_OK;
594 }
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228

◆ GetDefaultColumn()

STDMETHODIMP CZipFolder::GetDefaultColumn ( DWORD  dwRes,
ULONG pSort,
ULONG pDisplay 
)
inline

Implements IShellFolder2.

Definition at line 85 of file CZipFolder.hpp.

86 {
88 return E_NOTIMPL;
89 }

◆ GetDefaultColumnState()

STDMETHODIMP CZipFolder::GetDefaultColumnState ( UINT  iColumn,
DWORD pcsFlags 
)
inline

Implements IShellFolder2.

Definition at line 90 of file CZipFolder.hpp.

91 {
92 if (!pcsFlags || iColumn >= _countof(g_ColumnDefs))
93 return E_INVALIDARG;
94 *pcsFlags = g_ColumnDefs[iColumn].dwDefaultState;
95 return S_OK;
96 }
static FolderViewColumns g_ColumnDefs[]
Definition: CZipFolder.hpp:17
#define _countof(array)
Definition: sndvol32.h:68
DWORD dwDefaultState
Definition: CFontExt.cpp:21

◆ GetDefaultSearchGUID()

STDMETHODIMP CZipFolder::GetDefaultSearchGUID ( GUID pguid)
inline

Implements IShellFolder2.

Definition at line 75 of file CZipFolder.hpp.

76 {
78 return E_NOTIMPL;
79 }

◆ GetDetailsEx()

STDMETHODIMP CZipFolder::GetDetailsEx ( PCUITEMID_CHILD  pidl,
const SHCOLUMNID pscid,
VARIANT pv 
)
inline

Implements IShellFolder2.

Definition at line 97 of file CZipFolder.hpp.

98 {
100 return E_NOTIMPL;
101 }

◆ GetDetailsOf()

STDMETHODIMP CZipFolder::GetDetailsOf ( PCUITEMID_CHILD  pidl,
UINT  iColumn,
SHELLDETAILS psd 
)
inline

Implements IShellFolder2.

Definition at line 130 of file CZipFolder.hpp.

131 {
132 if (iColumn >= _countof(g_ColumnDefs))
133 return E_FAIL;
134
135 psd->cxChar = g_ColumnDefs[iColumn].cxChar;
136 psd->fmt = g_ColumnDefs[iColumn].fmt;
137
138 if (pidl == NULL)
139 {
140 return SHSetStrRet(&psd->str, _AtlBaseModule.GetResourceInstance(), g_ColumnDefs[iColumn].iResource);
141 }
142
143 PCUIDLIST_RELATIVE curpidl = ILGetNext(pidl);
144 if (curpidl->mkid.cb != 0)
145 {
146 DPRINT1("ERROR, unhandled PIDL!\n");
147 return E_FAIL;
148 }
149
150 const ZipPidlEntry* zipEntry = _ZipFromIL(pidl);
151 if (!zipEntry)
152 return E_INVALIDARG;
153
154 WCHAR Buffer[100];
155 bool isDir = zipEntry->ZipType == ZIP_PIDL_DIRECTORY;
156 switch (iColumn)
157 {
158 case 0: /* Name, ReactOS specific? */
159 return GetDisplayNameOf(pidl, 0, &psd->str);
160 case 1: /* Type */
161 {
162 SHFILEINFOW shfi;
164 ULONG_PTR firet = SHGetFileInfoW(zipEntry->Name, dwAttributes, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_TYPENAME);
165 if (!firet)
166 return E_FAIL;
167 return SHSetStrRet(&psd->str, shfi.szTypeName);
168 }
169 case 2: /* Compressed size */
170 case 4: /* Size */
171 {
172 if (isDir)
173 return SHSetStrRet(&psd->str, L"");
174
175 ULONG64 Size = iColumn == 2 ? zipEntry->CompressedSize : zipEntry->UncompressedSize;
177 return E_FAIL;
178 return SHSetStrRet(&psd->str, Buffer);
179 }
180 case 3: /* Password */
181 if (isDir)
182 return SHSetStrRet(&psd->str, L"");
183 return SHSetStrRet(&psd->str, _AtlBaseModule.GetResourceInstance(), zipEntry->Password ? IDS_YES : IDS_NO);
184 case 5: /* Ratio */
185 {
186 if (isDir)
187 return SHSetStrRet(&psd->str, L"");
188
189 int ratio = 0;
190 if (zipEntry->UncompressedSize)
191 ratio = 100 - (int)((zipEntry->CompressedSize*100)/zipEntry->UncompressedSize);
192 StringCchPrintfW(Buffer, _countof(Buffer), L"%d%%", ratio);
193 return SHSetStrRet(&psd->str, Buffer);
194 }
195 case 6: /* Date */
196 {
197 if (isDir)
198 return SHSetStrRet(&psd->str, L"");
199 FILETIME ftLocal;
200 DosDateTimeToFileTime((WORD)(zipEntry->DosDate>>16), (WORD)zipEntry->DosDate, &ftLocal);
201 if (!_GetFileTimeString(&ftLocal, Buffer, _countof(Buffer)))
202 return E_FAIL;
203 return SHSetStrRet(&psd->str, Buffer);
204 }
205 }
206
208 return E_NOTIMPL;
209 }
#define IDS_YES
Definition: resource.h:16
#define IDS_NO
Definition: resource.h:17
#define DPRINT1
Definition: precomp.h:8
Definition: bufpool.h:45
STDMETHODIMP GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: CZipFolder.hpp:426
BOOL _GetFileTimeString(LPFILETIME lpFileTime, PWSTR pwszResult, UINT cchResult)
Definition: CZipFolder.hpp:103
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
BOOL WINAPI DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
Definition: time.c:75
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2380
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned __int64 ULONG64
Definition: imports.h:198
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
Definition: shell32_main.c:415
#define SHGFI_TYPENAME
Definition: shellapi.h:164
#define SHGFI_USEFILEATTRIBUTES
Definition: shellapi.h:178
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
STRRET str
Definition: shtypes.idl:108
ULONG64 UncompressedSize
Definition: zippidl.hpp:25
BOOLEAN Password
Definition: zippidl.hpp:21
ULONG DosDate
Definition: zippidl.hpp:26
ULONG64 CompressedSize
Definition: zippidl.hpp:24
WCHAR szTypeName[80]
Definition: shellapi.h:373
uint32_t ULONG_PTR
Definition: typedefs.h:65
DWORD dwAttributes
Definition: vdmdbg.h:34
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ GetDisplayNameOf()

STDMETHODIMP CZipFolder::GetDisplayNameOf ( PCUITEMID_CHILD  pidl,
DWORD  dwFlags,
LPSTRRET  strRet 
)
inline

Definition at line 426 of file CZipFolder.hpp.

427 {
428 if (!pidl)
429 return S_FALSE;
430
431 PCUIDLIST_RELATIVE curpidl = ILGetNext(pidl);
432 if (curpidl->mkid.cb != 0)
433 {
434 DPRINT1("ERROR, unhandled PIDL!\n");
435 return E_FAIL;
436 }
437
438 const ZipPidlEntry* zipEntry = _ZipFromIL(pidl);
439 if (!zipEntry)
440 return E_FAIL;
441
442 return SHSetStrRet(strRet, zipEntry->Name);
443 }
#define S_FALSE
Definition: winerror.h:2357

Referenced by GetDetailsOf().

◆ GetUIObjectOf()

STDMETHODIMP CZipFolder::GetUIObjectOf ( HWND  hwndOwner,
UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl,
REFIID  riid,
UINT prgfInOut,
LPVOID ppvOut 
)
inline

Definition at line 389 of file CZipFolder.hpp.

390 {
391 if ((riid == IID_IExtractIconA || riid == IID_IExtractIconW) && cidl == 1)
392 {
393 const ZipPidlEntry* zipEntry = _ZipFromIL(*apidl);
394 if (zipEntry)
395 {
397 return SHCreateFileExtractIconW(zipEntry->Name, dwAttributes, riid, ppvOut);
398 }
399 }
400 else if (riid == IID_IContextMenu && cidl >= 0)
401 {
402 // Context menu of an object inside the zip
403 const ZipPidlEntry* zipEntry = _ZipFromIL(*apidl);
404 if (zipEntry)
405 {
406 HKEY keys[1] = {0};
407 int nkeys = 0;
408 if (zipEntry->ZipType == ZIP_PIDL_DIRECTORY)
409 {
411 if (res != ERROR_SUCCESS)
412 return E_FAIL;
413 nkeys++;
414 }
415 return CDefFolderMenu_Create2(NULL, hwndOwner, cidl, apidl, this, ZipFolderMenuCallback, nkeys, keys, (IContextMenu**)ppvOut);
416 }
417 }
418 else if (riid == IID_IDataObject && cidl >= 1)
419 {
420 return CIDLData_CreateFromIDArray(m_CurDir, cidl, apidl, (IDataObject**)ppvOut);
421 }
422
423 DbgPrint("%s(%S) UNHANDLED\n", __FUNCTION__ , guid2string(riid));
424 return E_NOINTERFACE;
425 }
HRESULT WINAPI CDefFolderMenu_Create2(PCIDLIST_ABSOLUTE pidlFolder, HWND hwnd, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IShellFolder *psf, LPFNDFMCALLBACK lpfn, UINT nKeys, const HKEY *ahkeyClsKeys, IContextMenu **ppcm)
EXTERN_C HRESULT WINAPI SHCreateFileExtractIconW(_In_ LPCWSTR pszFile, _In_ DWORD dwFileAttributes, _In_ REFIID riid, _Outptr_ void **ppv)
static HRESULT CALLBACK ZipFolderMenuCallback(IShellFolder *psf, HWND hwnd, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CZipFolder.hpp:350
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3362
GLuint res
Definition: glext.h:9613
#define KEY_READ
Definition: nt_native.h:1023
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
const GUID IID_IDataObject
HRESULT WINAPI CIDLData_CreateFromIDArray(PCIDLIST_ABSOLUTE pidlFolder, UINT cpidlFiles, PCUIDLIST_RELATIVE_ARRAY lppidlFiles, LPDATAOBJECT *ppdataObject)
Definition: shellord.c:2218
#define E_NOINTERFACE
Definition: winerror.h:2364
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

◆ Initialize() [1/3]

STDMETHODIMP CZipFolder::Initialize ( PCIDLIST_ABSOLUTE  pidl)
inline

Implements IPersistFolder.

Definition at line 597 of file CZipFolder.hpp.

598 {
599 WCHAR tmpPath[MAX_PATH];
600
601 if (SHGetPathFromIDListW(pidl, tmpPath))
602 {
603 m_ZipFile = tmpPath;
604 m_CurDir.Attach(ILClone(pidl));
605 return S_OK;
606 }
607 DbgPrint("%s() => Unable to parse pidl\n", __FUNCTION__);
608 return E_INVALIDARG;
609 }
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1344

◆ Initialize() [2/3]

STDMETHODIMP CZipFolder::Initialize ( PCIDLIST_ABSOLUTE  pidlFolder,
LPDATAOBJECT  pDataObj,
HKEY  hkeyProgID 
)
inline

Definition at line 534 of file CZipFolder.hpp.

535 {
536 FORMATETC etc = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
537 STGMEDIUM stg;
538
539 HRESULT hr = pDataObj->GetData(&etc, &stg);
541 {
542 return hr;
543 }
544 hr = E_FAIL;
545 HDROP hdrop = (HDROP)GlobalLock(stg.hGlobal);
546 if (hdrop)
547 {
548 UINT uNumFiles = DragQueryFileW(hdrop, 0xFFFFFFFF, NULL, 0);
549 if (uNumFiles == 1)
550 {
551 WCHAR szFile[MAX_PATH * 2];
552 if (DragQueryFileW(hdrop, 0, szFile, _countof(szFile)))
553 {
554 CComHeapPtr<ITEMIDLIST> pidl;
555 hr = SHParseDisplayName(szFile, NULL, &pidl, 0, NULL);
557 {
558 hr = Initialize(pidl);
559 }
560 }
561 else
562 {
563 DbgPrint("Failed to query the file.\r\n");
564 }
565 }
566 else
567 {
568 DbgPrint("Invalid number of files: %d\r\n", uNumFiles);
569 }
570 GlobalUnlock(stg.hGlobal);
571 }
572 else
573 {
574 DbgPrint("Could not lock stg.hGlobal\r\n");
575 }
576 ReleaseStgMedium(&stg);
577 return hr;
578
579 }
#define CF_HDROP
Definition: constants.h:410
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
Definition: shellole.c:622
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
unsigned int UINT
Definition: ndis.h:50
HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
Definition: pidl.c:1396
static void Initialize()
Definition: xlate.c:212

◆ Initialize() [3/3]

STDMETHODIMP CZipFolder::Initialize ( PCWSTR  zipFile,
PCWSTR  zipDir,
PCUIDLIST_ABSOLUTE  curDir,
PCUIDLIST_RELATIVE  pidl 
)
inline

Definition at line 619 of file CZipFolder.hpp.

620 {
622 m_ZipDir = zipDir;
623
624 m_CurDir.Attach(ILCombine(curDir, pidl));
625 return S_OK;
626 }
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:703
voidp zipFile
Definition: zip.h:69

◆ InvokeCommand()

STDMETHODIMP CZipFolder::InvokeCommand ( LPCMINVOKECOMMANDINFO  pici)
inline

Implements IContextMenu.

Definition at line 495 of file CZipFolder.hpp.

496 {
497 if (!pici || (pici->cbSize != sizeof(CMINVOKECOMMANDINFO) && pici->cbSize != sizeof(CMINVOKECOMMANDINFOEX)))
498 return E_INVALIDARG;
499
500 if (pici->lpVerb == MAKEINTRESOURCEA(0) || (HIWORD(pici->lpVerb) && !strcmp(pici->lpVerb, EXTRACT_VERBA)))
501 {
502 BSTR ZipFile = m_ZipFile.AllocSysString();
504
505 DWORD tid;
507 if (hThread)
508 {
510 return S_OK;
511 }
512 }
513 return E_INVALIDARG;
514 }
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define InterlockedIncrement
Definition: armddk.h:53
static DWORD WINAPI s_ExtractProc(LPVOID arg)
Definition: CZipFolder.hpp:627
#define CloseHandle
Definition: compat.h:739
OLECHAR * BSTR
Definition: compat.h:2293
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
static TfClientId tid
HANDLE hThread
Definition: wizard.c:28
#define HIWORD(l)
Definition: typedefs.h:247

◆ MapColumnToSCID()

STDMETHODIMP CZipFolder::MapColumnToSCID ( UINT  column,
SHCOLUMNID pscid 
)
inline

Implements IShellFolder2.

Definition at line 210 of file CZipFolder.hpp.

211 {
213 return E_NOTIMPL;
214 }

◆ ParseDisplayName()

STDMETHODIMP CZipFolder::ParseDisplayName ( HWND  hwndOwner,
LPBC  pbc,
LPOLESTR  lpszDisplayName,
ULONG pchEaten,
PIDLIST_RELATIVE ppidl,
ULONG pdwAttributes 
)
inline

Implements IShellFolder.

Definition at line 217 of file CZipFolder.hpp.

218 {
220 return E_NOTIMPL;
221 }

◆ QueryContextMenu()

STDMETHODIMP CZipFolder::QueryContextMenu ( HMENU  hmenu,
UINT  indexMenu,
UINT  idCmdFirst,
UINT  idCmdLast,
UINT  uFlags 
)
inline

Implements IContextMenu.

Definition at line 515 of file CZipFolder.hpp.

516 {
517 UINT idCmd = idCmdFirst;
518
519 if (!(uFlags & CMF_DEFAULTONLY))
520 {
522
523 if (indexMenu)
524 {
525 InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
526 }
527 InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_STRING, idCmd++, menuText);
528 }
529
530 return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, idCmd - idCmdFirst);
531 }
#define IDS_MENUITEM
Definition: resource.h:73
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
static HMENU hmenu
Definition: win.c:66
#define FACILITY_NULL
Definition: winerror.h:22
#define SEVERITY_SUCCESS
Definition: winerror.h:64
BOOL WINAPI InsertMenuW(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
#define MF_STRING
Definition: winuser.h:138
#define MF_SEPARATOR
Definition: winuser.h:137
#define MF_BYPOSITION
Definition: winuser.h:203
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

◆ s_ExtractProc()

static DWORD WINAPI CZipFolder::s_ExtractProc ( LPVOID  arg)
inlinestatic

Definition at line 627 of file CZipFolder.hpp.

628 {
629 CComBSTR ZipFile;
630 ZipFile.Attach((BSTR)arg);
631
632 _CZipExtract_runWizard(ZipFile);
633
635 return 0;
636 }
void _CZipExtract_runWizard(PCWSTR Filename)
#define InterlockedDecrement
Definition: armddk.h:52

Referenced by InvokeCommand().

◆ SetNameOf()

STDMETHODIMP CZipFolder::SetNameOf ( HWND  hwndOwner,
PCUITEMID_CHILD  pidl,
LPCOLESTR  lpName,
DWORD  dwFlags,
PITEMID_CHILD pPidlOut 
)
inline

Implements IShellFolder.

Definition at line 444 of file CZipFolder.hpp.

445 {
447 return E_NOTIMPL;
448 }

◆ STDMETHODIMP_()

CZipFolder::STDMETHODIMP_ ( unzFile  )
inlinevirtual

Reimplemented from IZip.

Definition at line 64 of file CZipFolder.hpp.

65 {
66 if (!m_UnzipFile)
67 {
69 }
70
71 return m_UnzipFile;
72 }
zlib_filefunc64_def g_FFunc
Definition: zipfldr.cpp:44
unzFile ZEXPORT unzOpen2_64(const void *path, zlib_filefunc64_def *pzlib_filefunc_def)
Definition: unzip.c:783

◆ ZipFolderMenuCallback()

static HRESULT CALLBACK CZipFolder::ZipFolderMenuCallback ( IShellFolder psf,
HWND  hwnd,
IDataObject pdtobj,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inlinestatic

Definition at line 350 of file CZipFolder.hpp.

352 {
353 switch (uMsg)
354 {
356 {
357 CComQIIDPtr<I_ID(IContextMenu)> spContextMenu(psf);
358 if (!spContextMenu)
359 return E_NOINTERFACE;
360
361 QCMINFO *pqcminfo = (QCMINFO *)lParam;
362 HRESULT hr = spContextMenu->QueryContextMenu(pqcminfo->hmenu,
363 pqcminfo->indexMenu,
364 pqcminfo->idCmdFirst,
365 pqcminfo->idCmdLast,
366 CMF_NORMAL);
368 return hr;
369
370 pqcminfo->idCmdFirst += HRESULT_CODE(hr);
371 return S_OK;
372 }
374 {
375 CComQIIDPtr<I_ID(IContextMenu)> spContextMenu(psf);
376 if (!spContextMenu)
377 return E_NOINTERFACE;
378
379 CMINVOKECOMMANDINFO ici = { sizeof(ici) };
380 ici.lpVerb = MAKEINTRESOURCEA(wParam);
381 return spContextMenu->InvokeCommand(&ici);
382 }
384 case DFM_GETDEFSTATICID: // Required for Windows 7 to pick a default
385 return S_FALSE;
386 }
387 return E_NOTIMPL;
388 }
#define I_ID(Itype)
Definition: atlcomcli.h:215
WPARAM wParam
Definition: combotst.c:138
#define DFM_GETDEFSTATICID
Definition: precomp.h:47
#define DFM_INVOKECOMMANDEX
Definition: precomp.h:46
#define DFM_MERGECONTEXTMENU
Definition: precomp.h:44
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
HMENU hmenu
Definition: shlobj.h:1381
UINT idCmdLast
Definition: shlobj.h:1384
UINT idCmdFirst
Definition: shlobj.h:1383
UINT indexMenu
Definition: shlobj.h:1382
#define HRESULT_CODE(hr)
Definition: winerror.h:76

Referenced by GetUIObjectOf().

Member Data Documentation

◆ m_CurDir

CComHeapPtr<ITEMIDLIST> CZipFolder::m_CurDir
private

Definition at line 42 of file CZipFolder.hpp.

Referenced by BindToObject(), GetCurFolder(), GetUIObjectOf(), and Initialize().

◆ m_UnzipFile

unzFile CZipFolder::m_UnzipFile
private

Definition at line 43 of file CZipFolder.hpp.

Referenced by Close(), and STDMETHODIMP_().

◆ m_ZipDir

CStringW CZipFolder::m_ZipDir
private

Definition at line 41 of file CZipFolder.hpp.

Referenced by BindToObject(), EnumObjects(), and Initialize().

◆ m_ZipFile

CStringW CZipFolder::m_ZipFile
private

Definition at line 40 of file CZipFolder.hpp.

Referenced by BindToObject(), Initialize(), InvokeCommand(), and STDMETHODIMP_().


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