ReactOS 0.4.16-dev-136-g52192f1
CZipFolder.hpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Zip Shell Extension
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Main class
5 * COPYRIGHT: Copyright 2017 Mark Jansen (mark.jansen@reactos.org)
6 * Copyright 2023 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
7 */
8
10{
11 int iResource;
13 int cxChar;
14 int fmt;
15};
16
18{
26};
27
28
30 public CComCoClass<CZipFolder, &CLSID_ZipFolderStorageHandler>,
31 public CComObjectRootEx<CComMultiThreadModelNoCS>,
32 public IShellFolder2,
33 //public IStorage,
34 public IContextMenu,
35 public IShellExtInit,
36 //public IPersistFile,
37 public IPersistFolder2,
38 public IZip
39{
40 CStringW m_ZipFile;
41 CStringW m_ZipDir;
42 CComHeapPtr<ITEMIDLIST> m_CurDir;
44
45public:
48 {
49 }
50
52 {
53 Close();
54 }
55
56 void Close()
57 {
58 if (m_UnzipFile)
61 }
62
63 // *** IZip methods ***
65 {
66 if (!m_UnzipFile)
67 {
69 }
70
71 return m_UnzipFile;
72 }
73
74 // *** IShellFolder2 methods ***
76 {
78 return E_NOTIMPL;
79 }
81 {
83 return E_NOTIMPL;
84 }
85 STDMETHODIMP GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
86 {
88 return E_NOTIMPL;
89 }
91 {
92 if (!pcsFlags || iColumn >= _countof(g_ColumnDefs))
93 return E_INVALIDARG;
94 *pcsFlags = g_ColumnDefs[iColumn].dwDefaultState;
95 return S_OK;
96 }
98 {
100 return E_NOTIMPL;
101 }
102 // Adapted from CFileDefExt::GetFileTimeString
103 BOOL _GetFileTimeString(LPFILETIME lpFileTime, PWSTR pwszResult, UINT cchResult)
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 }
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 }
211 {
213 return E_NOTIMPL;
214 }
215
216 // *** IShellFolder methods ***
217 STDMETHODIMP ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes)
218 {
220 return E_NOTIMPL;
221 }
222 STDMETHODIMP EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
223 {
225 }
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 }
250 {
252 return E_NOTIMPL;
253 }
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 }
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 }
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 }
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) };
381 return spContextMenu->InvokeCommand(&ici);
382 }
383 case DFM_GETDEFSTATICID: // Required for Windows 7 to pick a default
384 return S_FALSE;
385 }
386 return E_NOTIMPL;
387 }
388 STDMETHODIMP GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
389 {
390 if ((riid == IID_IExtractIconA || riid == IID_IExtractIconW) && cidl == 1)
391 {
392 const ZipPidlEntry* zipEntry = _ZipFromIL(*apidl);
393 if (zipEntry)
394 {
396 return SHCreateFileExtractIconW(zipEntry->Name, dwAttributes, riid, ppvOut);
397 }
398 }
399 else if (riid == IID_IContextMenu && cidl >= 0)
400 {
401 // Context menu of an object inside the zip
402 const ZipPidlEntry* zipEntry = _ZipFromIL(*apidl);
403 if (zipEntry)
404 {
405 HKEY keys[1] = {0};
406 int nkeys = 0;
407 if (zipEntry->ZipType == ZIP_PIDL_DIRECTORY)
408 {
410 if (res != ERROR_SUCCESS)
411 return E_FAIL;
412 nkeys++;
413 }
414 return CDefFolderMenu_Create2(NULL, hwndOwner, cidl, apidl, this, ZipFolderMenuCallback, nkeys, keys, (IContextMenu**)ppvOut);
415 }
416 }
417 else if (riid == IID_IDataObject && cidl >= 1)
418 {
419 return CIDLData_CreateFromIDArray(m_CurDir, cidl, apidl, (IDataObject**)ppvOut);
420 }
421
422 DbgPrint("%s(%S) UNHANDLED\n", __FUNCTION__ , guid2string(riid));
423 return E_NOINTERFACE;
424 }
426 {
427 if (!pidl)
428 return S_FALSE;
429
430 PCUIDLIST_RELATIVE curpidl = ILGetNext(pidl);
431 if (curpidl->mkid.cb != 0)
432 {
433 DPRINT1("ERROR, unhandled PIDL!\n");
434 return E_FAIL;
435 }
436
437 const ZipPidlEntry* zipEntry = _ZipFromIL(pidl);
438 if (!zipEntry)
439 return E_FAIL;
440
441 return SHSetStrRet(strRet, zipEntry->Name);
442 }
444 {
446 return E_NOTIMPL;
447 }
449 //STDMETHODIMP CreateStream(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream **ppstm);
450 //STDMETHODIMP OpenStream(LPCOLESTR pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream **ppstm);
451 //STDMETHODIMP CreateStorage(LPCOLESTR pwcsName, DWORD grfMode, DWORD dwStgFmt, DWORD reserved2, IStorage **ppstg);
452 //STDMETHODIMP OpenStorage(LPCOLESTR pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstg);
453 //STDMETHODIMP CopyTo(DWORD ciidExclude, const IID *rgiidExclude, SNB snbExclude, IStorage *pstgDest);
454 //STDMETHODIMP MoveElementTo(LPCOLESTR pwcsName, IStorage *pstgDest, LPCOLESTR pwcsNewName, DWORD grfFlags);
455 //STDMETHODIMP Commit(DWORD grfCommitFlags);
456 //STDMETHODIMP Revert();
457 //STDMETHODIMP EnumElements(DWORD reserved1, void *reserved2, DWORD reserved3, IEnumSTATSTG **ppenum);
458 //STDMETHODIMP DestroyElement(LPCOLESTR pwcsName);
459 //STDMETHODIMP RenameElement(LPCOLESTR pwcsOldName, LPCOLESTR pwcsNewName);
460 //STDMETHODIMP SetElementTimes(LPCOLESTR pwcsName, const FILETIME *pctime, const FILETIME *patime, const FILETIME *pmtime);
461 //STDMETHODIMP SetClass(REFCLSID clsid);
462 //STDMETHODIMP SetStateBits(DWORD grfStateBits, DWORD grfMask);
463 //STDMETHODIMP Stat(STATSTG *pstatstg, DWORD grfStatFlag);
464
465 // *** IContextMenu methods ***
467 {
468 if (idCmd != 0)
469 return E_INVALIDARG;
470
471 switch (uFlags)
472 {
473 case GCS_VERBA:
474 return StringCchCopyA(pszName, cchMax, EXTRACT_VERBA);
475 case GCS_VERBW:
476 return StringCchCopyW((PWSTR)pszName, cchMax, EXTRACT_VERBW);
477 case GCS_HELPTEXTA:
478 {
479 CStringA helpText(MAKEINTRESOURCEA(IDS_HELPTEXT));
480 return StringCchCopyA(pszName, cchMax, helpText);
481 }
482 case GCS_HELPTEXTW:
483 {
484 CStringW helpText(MAKEINTRESOURCEA(IDS_HELPTEXT));
485 return StringCchCopyW((PWSTR)pszName, cchMax, helpText);
486 }
487 case GCS_VALIDATEA:
488 case GCS_VALIDATEW:
489 return S_OK;
490 }
491
492 return E_INVALIDARG;
493 }
495 {
496 if (!pici || (pici->cbSize != sizeof(CMINVOKECOMMANDINFO) && pici->cbSize != sizeof(CMINVOKECOMMANDINFOEX)))
497 return E_INVALIDARG;
498
499 if (pici->lpVerb == MAKEINTRESOURCEA(0) || (HIWORD(pici->lpVerb) && !strcmp(pici->lpVerb, EXTRACT_VERBA)))
500 {
501 BSTR ZipFile = m_ZipFile.AllocSysString();
503
504 DWORD tid;
506 if (hThread)
507 {
509 return S_OK;
510 }
511 }
512 return E_INVALIDARG;
513 }
514 STDMETHODIMP QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
515 {
516 UINT idCmd = idCmdFirst;
517
518 if (!(uFlags & CMF_DEFAULTONLY))
519 {
520 CStringW menuText(MAKEINTRESOURCEW(IDS_MENUITEM));
521
522 if (indexMenu)
523 {
524 InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
525 }
526 InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_STRING, idCmd++, menuText);
527 }
528
529 return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, idCmd - idCmdFirst);
530 }
531
532 // *** IShellExtInit methods ***
534 {
535 FORMATETC etc = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
536 STGMEDIUM stg;
537
538 HRESULT hr = pDataObj->GetData(&etc, &stg);
540 {
541 return hr;
542 }
543 hr = E_FAIL;
544 HDROP hdrop = (HDROP)GlobalLock(stg.hGlobal);
545 if (hdrop)
546 {
547 UINT uNumFiles = DragQueryFileW(hdrop, 0xFFFFFFFF, NULL, 0);
548 if (uNumFiles == 1)
549 {
550 WCHAR szFile[MAX_PATH * 2];
551 if (DragQueryFileW(hdrop, 0, szFile, _countof(szFile)))
552 {
553 CComHeapPtr<ITEMIDLIST> pidl;
554 hr = SHParseDisplayName(szFile, NULL, &pidl, 0, NULL);
556 {
557 hr = Initialize(pidl);
558 }
559 }
560 else
561 {
562 DbgPrint("Failed to query the file.\r\n");
563 }
564 }
565 else
566 {
567 DbgPrint("Invalid number of files: %d\r\n", uNumFiles);
568 }
569 GlobalUnlock(stg.hGlobal);
570 }
571 else
572 {
573 DbgPrint("Could not lock stg.hGlobal\r\n");
574 }
575 ReleaseStgMedium(&stg);
576 return hr;
577
578 }
579
582 //STDMETHODIMP IsDirty();
583 //STDMETHODIMP Load(LPCOLESTR pszFileName, DWORD dwMode);
584 //STDMETHODIMP Save(LPCOLESTR pszFileName, BOOL fRemember);
585 //STDMETHODIMP SaveCompleted(LPCOLESTR pszFileName);
586 //STDMETHODIMP GetCurFile(LPOLESTR *ppszFileName);
587
590 {
591 *pidl = ILClone(m_CurDir);
592 return S_OK;
593 }
594
595 // *** IPersistFolder methods ***
597 {
598 WCHAR tmpPath[MAX_PATH];
599
600 if (SHGetPathFromIDListW(pidl, tmpPath))
601 {
602 m_ZipFile = tmpPath;
603 m_CurDir.Attach(ILClone(pidl));
604 return S_OK;
605 }
606 DbgPrint("%s() => Unable to parse pidl\n", __FUNCTION__);
607 return E_INVALIDARG;
608 }
609
610 // *** IPersist methods ***
612 {
613 DbgPrint("%s\n", __FUNCTION__);
614 return E_NOTIMPL;
615 }
616
617
619 {
621 m_ZipDir = zipDir;
622
623 m_CurDir.Attach(ILCombine(curDir, pidl));
624 return S_OK;
625 }
627 {
628 CComBSTR ZipFile;
629 ZipFile.Attach((BSTR)arg);
630
631 _CZipExtract_runWizard(ZipFile);
632
634 return 0;
635 }
636
637public:
638 DECLARE_NO_REGISTRY() // Handled manually because this object is exposed via multiple clsid's
640
642
644 COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
645 COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
646// COM_INTERFACE_ENTRY_IID(IID_IStorage, IStorage)
647 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
648 COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
649 //COM_INTERFACE_ENTRY_IID(IID_IPersistFile, IPersistFile)
650 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
651 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
654};
655
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:4663
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)
HRESULT _CEnumZipContents_CreateInstance(IZip *zip, DWORD flags, PCWSTR prefix, REFIID riid, LPVOID *ppvOut)
HRESULT _CExplorerCommandProvider_CreateInstance(IContextMenu *zipObject, REFIID riid, LPVOID *ppvOut)
EXTERN_C HRESULT WINAPI SHCreateFileExtractIconW(_In_ LPCWSTR pszFile, _In_ DWORD dwFileAttributes, _In_ REFIID riid, _Outptr_ void **ppv)
HRESULT _CFolderViewCB_CreateInstance(REFIID riid, LPVOID *ppvOut)
void _CZipExtract_runWizard(PCWSTR Filename)
static FolderViewColumns g_ColumnDefs[]
Definition: CZipFolder.hpp:17
WCHAR * guid2string(REFCLSID iid)
Definition: Debug.cpp:21
UINT cchMax
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define I_ID(Itype)
Definition: atlcomcli.h:215
#define IDS_YES
Definition: resource.h:16
#define IDS_NO
Definition: resource.h:17
#define IDS_COL_TYPE
Definition: resource.h:9
#define CF_HDROP
Definition: constants.h:410
#define DPRINT1
Definition: precomp.h:8
#define STDMETHODIMP
Definition: basetyps.h:43
#define UNIMPLEMENTED
Definition: debug.h:118
Definition: bufpool.h:45
STDMETHODIMP EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
Definition: CZipFolder.hpp:222
STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO pici)
Definition: CZipFolder.hpp:494
STDMETHODIMP GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
Definition: CZipFolder.hpp:85
STDMETHODIMP GetClassID(CLSID *lpClassId)
Definition: CZipFolder.hpp:611
CStringW m_ZipFile
Definition: CZipFolder.hpp:40
STDMETHODIMP EnumSearches(IEnumExtraSearch **ppenum)
Definition: CZipFolder.hpp:80
STDMETHODIMP GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax)
Definition: CZipFolder.hpp:466
STDMETHODIMP BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
Definition: CZipFolder.hpp:249
STDMETHODIMP_(unzFile) getZip()
Definition: CZipFolder.hpp:64
STDMETHODIMP GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
Definition: CZipFolder.hpp:90
STDMETHODIMP SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
Definition: CZipFolder.hpp:443
STDMETHODIMP ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes)
Definition: CZipFolder.hpp:217
STDMETHODIMP GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
Definition: CZipFolder.hpp:97
STDMETHODIMP Initialize(PCIDLIST_ABSOLUTE pidlFolder, LPDATAOBJECT pDataObj, HKEY hkeyProgID)
Definition: CZipFolder.hpp:533
STDMETHODIMP CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
Definition: CZipFolder.hpp:283
void Close()
Definition: CZipFolder.hpp:56
static HRESULT CALLBACK ZipFolderMenuCallback(IShellFolder *psf, HWND hwnd, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CZipFolder.hpp:350
STDMETHODIMP QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
Definition: CZipFolder.hpp:514
STDMETHODIMP BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
Definition: CZipFolder.hpp:226
STDMETHODIMP GetDefaultSearchGUID(GUID *pguid)
Definition: CZipFolder.hpp:75
static DWORD WINAPI s_ExtractProc(LPVOID arg)
Definition: CZipFolder.hpp:626
CComHeapPtr< ITEMIDLIST > m_CurDir
Definition: CZipFolder.hpp:42
STDMETHODIMP Initialize(PCWSTR zipFile, PCWSTR zipDir, PCUIDLIST_ABSOLUTE curDir, PCUIDLIST_RELATIVE pidl)
Definition: CZipFolder.hpp:618
unzFile m_UnzipFile
Definition: CZipFolder.hpp:43
STDMETHODIMP GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: CZipFolder.hpp:425
STDMETHODIMP GetCurFolder(PIDLIST_ABSOLUTE *pidl)
Definition: CZipFolder.hpp:589
STDMETHODIMP CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
Definition: CZipFolder.hpp:254
STDMETHODIMP MapColumnToSCID(UINT column, SHCOLUMNID *pscid)
Definition: CZipFolder.hpp:210
STDMETHODIMP GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
Definition: CZipFolder.hpp:314
CStringW m_ZipDir
Definition: CZipFolder.hpp:41
STDMETHODIMP Initialize(PCIDLIST_ABSOLUTE pidl)
Definition: CZipFolder.hpp:596
BOOL _GetFileTimeString(LPFILETIME lpFileTime, PWSTR pwszResult, UINT cchResult)
Definition: CZipFolder.hpp:103
STDMETHODIMP GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
Definition: CZipFolder.hpp:388
STDMETHODIMP GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
Definition: CZipFolder.hpp:130
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDS_COL_NAME
Definition: resource.h:6
#define IDS_COL_SIZE
Definition: resource.h:8
#define DFM_GETDEFSTATICID
Definition: precomp.h:47
#define DFM_MERGECONTEXTMENU
Definition: precomp.h:44
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
zlib_filefunc64_def g_FFunc
Definition: zipfldr.cpp:44
#define EXTRACT_VERBA
Definition: precomp.h:25
#define EXTRACT_VERBW
Definition: precomp.h:26
#define IDS_COL_DATE_MOD
Definition: resource.h:44
#define IDS_COL_RATIO
Definition: resource.h:43
#define IDS_MENUITEM
Definition: resource.h:73
#define IDS_COL_COMPRSIZE
Definition: resource.h:40
#define IDS_COL_PASSWORD
Definition: resource.h:41
#define IDS_HELPTEXT
Definition: resource.h:74
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
UINT uFlags
Definition: api.c:59
#define CloseHandle
Definition: compat.h:739
OLECHAR * BSTR
Definition: compat.h:2293
#define MAX_PATH
Definition: compat.h:34
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define CALLBACK
Definition: compat.h:35
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
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
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:188
BOOL WINAPI DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
Definition: time.c:75
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
Definition: shellole.c:622
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2388
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
#define __FUNCTION__
Definition: types.h:116
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint res
Definition: glext.h:9613
GLuint64EXT * result
Definition: glext.h:11304
#define DbgPrint
Definition: hal.h:12
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
REFIID riid
Definition: atlbase.h:39
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define S_OK
Definition: intsafe.h:52
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 BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:679
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:651
#define END_COM_MAP()
Definition: atlcom.h:592
#define DECLARE_NO_REGISTRY()
Definition: atlcom.h:639
unsigned __int64 ULONG64
Definition: imports.h:198
static TfClientId tid
static LPOLESTR
Definition: stg_prop.c:27
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
HANDLE hThread
Definition: wizard.c:28
#define KEY_READ
Definition: nt_native.h:1023
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define LOCALE_USER_DEFAULT
#define L(x)
Definition: ntvdm.h:50
interface IBindCtx * LPBC
Definition: objfwd.h:18
interface IDataObject * LPDATAOBJECT
Definition: objfwd.h:21
const GUID IID_IDataObject
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
Definition: pidl.c:1400
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:718
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1348
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:872
const GUID IID_IPersist
Definition: proxy.cpp:14
#define LVCFMT_LEFT
Definition: commctrl.h:2603
#define LVCFMT_RIGHT
Definition: commctrl.h:2604
#define REFIID
Definition: guiddef.h:118
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
Definition: shell32_main.c:414
#define SHGFI_TYPENAME
Definition: shellapi.h:167
#define SHGFI_USEFILEATTRIBUTES
Definition: shellapi.h:181
HRESULT WINAPI CIDLData_CreateFromIDArray(PCIDLIST_ABSOLUTE pidlFolder, UINT cpidlFiles, PCUIDLIST_RELATIVE_ARRAY lppidlFiles, LPDATAOBJECT *ppdataObject)
Definition: shellord.c:2413
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:621
HRESULT hr
Definition: shlfolder.c:183
struct _SFV_CREATE SFV_CREATE
const ITEMIDLIST_ABSOLUTE UNALIGNED * PCUIDLIST_ABSOLUTE
Definition: shtypes.idl:63
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
@ SHCOLSTATE_TYPE_DATE
Definition: shtypes.idl:123
@ SHCOLSTATE_TYPE_STR
Definition: shtypes.idl:121
@ SHCOLSTATE_ONBYDEFAULT
Definition: shtypes.idl:125
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
STRSAFEAPI StringCchCopyExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags)
Definition: strsafe.h:184
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
DWORD dwDefaultState
Definition: CFontExt.cpp:21
Definition: IZip.hpp:9
STRRET str
Definition: shtypes.idl:108
WCHAR Name[1]
Definition: zippidl.hpp:28
ULONG64 UncompressedSize
Definition: zippidl.hpp:25
BOOLEAN Password
Definition: zippidl.hpp:21
ZipPidlType ZipType
Definition: zippidl.hpp:22
ULONG DosDate
Definition: zippidl.hpp:26
ULONG64 CompressedSize
Definition: zippidl.hpp:24
HMENU hmenu
Definition: shlobj.h:1390
UINT idCmdLast
Definition: shlobj.h:1393
UINT idCmdFirst
Definition: shlobj.h:1392
UINT indexMenu
Definition: shlobj.h:1391
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1360
WCHAR szTypeName[80]
Definition: shellapi.h:376
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
unzFile ZEXPORT unzOpen2_64(const void *path, zlib_filefunc64_def *pzlib_filefunc_def)
Definition: unzip.c:783
int ZEXPORT unzClose(unzFile file)
Definition: unzip.c:813
voidp unzFile
Definition: unzip.h:70
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
static HMENU hmenu
Definition: win.c:66
_In_ LPCSTR lpName
Definition: winbase.h:2789
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define FACILITY_NULL
Definition: winerror.h:22
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define SEVERITY_SUCCESS
Definition: winerror.h:64
#define HRESULT_CODE(hr)
Definition: winerror.h:76
#define DATE_SHORTDATE
Definition: winnls.h:196
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
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 MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
static void Initialize()
Definition: xlate.c:212
#define IID_PPV_ARG(Itype, ppType)
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
voidp zipFile
Definition: zip.h:69
const ZipPidlEntry * _ZipFromIL(LPCITEMIDLIST pidl)
Definition: zippidl.cpp:41
@ ZIP_PIDL_FILE
Definition: zippidl.hpp:13
@ ZIP_PIDL_DIRECTORY
Definition: zippidl.hpp:12