ReactOS 0.4.15-dev-7961-gdcf9eb0
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 }
384 case DFM_GETDEFSTATICID: // Required for Windows 7 to pick a default
385 return S_FALSE;
386 }
387 return E_NOTIMPL;
388 }
389 STDMETHODIMP GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
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 }
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 }
445 {
447 return E_NOTIMPL;
448 }
450 //STDMETHODIMP CreateStream(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream **ppstm);
451 //STDMETHODIMP OpenStream(LPCOLESTR pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream **ppstm);
452 //STDMETHODIMP CreateStorage(LPCOLESTR pwcsName, DWORD grfMode, DWORD dwStgFmt, DWORD reserved2, IStorage **ppstg);
453 //STDMETHODIMP OpenStorage(LPCOLESTR pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstg);
454 //STDMETHODIMP CopyTo(DWORD ciidExclude, const IID *rgiidExclude, SNB snbExclude, IStorage *pstgDest);
455 //STDMETHODIMP MoveElementTo(LPCOLESTR pwcsName, IStorage *pstgDest, LPCOLESTR pwcsNewName, DWORD grfFlags);
456 //STDMETHODIMP Commit(DWORD grfCommitFlags);
457 //STDMETHODIMP Revert();
458 //STDMETHODIMP EnumElements(DWORD reserved1, void *reserved2, DWORD reserved3, IEnumSTATSTG **ppenum);
459 //STDMETHODIMP DestroyElement(LPCOLESTR pwcsName);
460 //STDMETHODIMP RenameElement(LPCOLESTR pwcsOldName, LPCOLESTR pwcsNewName);
461 //STDMETHODIMP SetElementTimes(LPCOLESTR pwcsName, const FILETIME *pctime, const FILETIME *patime, const FILETIME *pmtime);
462 //STDMETHODIMP SetClass(REFCLSID clsid);
463 //STDMETHODIMP SetStateBits(DWORD grfStateBits, DWORD grfMask);
464 //STDMETHODIMP Stat(STATSTG *pstatstg, DWORD grfStatFlag);
465
466 // *** IContextMenu methods ***
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 {
480 CStringA helpText(MAKEINTRESOURCEA(IDS_HELPTEXT));
481 return StringCchCopyA(pszName, cchMax, helpText);
482 }
483 case GCS_HELPTEXTW:
484 {
485 CStringW helpText(MAKEINTRESOURCEA(IDS_HELPTEXT));
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 }
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 }
515 STDMETHODIMP QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
516 {
517 UINT idCmd = idCmdFirst;
518
519 if (!(uFlags & CMF_DEFAULTONLY))
520 {
521 CStringW menuText(MAKEINTRESOURCEW(IDS_MENUITEM));
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 }
532
533 // *** IShellExtInit methods ***
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 }
580
583 //STDMETHODIMP IsDirty();
584 //STDMETHODIMP Load(LPCOLESTR pszFileName, DWORD dwMode);
585 //STDMETHODIMP Save(LPCOLESTR pszFileName, BOOL fRemember);
586 //STDMETHODIMP SaveCompleted(LPCOLESTR pszFileName);
587 //STDMETHODIMP GetCurFile(LPOLESTR *ppszFileName);
588
591 {
592 *pidl = ILClone(m_CurDir);
593 return S_OK;
594 }
595
596 // *** IPersistFolder methods ***
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 }
610
611 // *** IPersist methods ***
613 {
614 DbgPrint("%s\n", __FUNCTION__);
615 return E_NOTIMPL;
616 }
617
618
620 {
622 m_ZipDir = zipDir;
623
624 m_CurDir.Attach(ILCombine(curDir, pidl));
625 return S_OK;
626 }
628 {
629 CComBSTR ZipFile;
630 ZipFile.Attach((BSTR)arg);
631
632 _CZipExtract_runWizard(ZipFile);
633
635 return 0;
636 }
637
638public:
639 DECLARE_NO_REGISTRY() // Handled manually because this object is exposed via multiple clsid's
641
643
645 COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
646 COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
647// COM_INTERFACE_ENTRY_IID(IID_IStorage, IStorage)
648 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
649 COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
650 //COM_INTERFACE_ENTRY_IID(IID_IPersistFile, IPersistFile)
651 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
652 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
655};
656
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3857
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:115
Definition: bufpool.h:45
STDMETHODIMP EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
Definition: CZipFolder.hpp:222
STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO pici)
Definition: CZipFolder.hpp:495
STDMETHODIMP GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
Definition: CZipFolder.hpp:85
STDMETHODIMP GetClassID(CLSID *lpClassId)
Definition: CZipFolder.hpp:612
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:467
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:444
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:534
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:515
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:627
CComHeapPtr< ITEMIDLIST > m_CurDir
Definition: CZipFolder.hpp:42
STDMETHODIMP Initialize(PCWSTR zipFile, PCWSTR zipDir, PCUIDLIST_ABSOLUTE curDir, PCUIDLIST_RELATIVE pidl)
Definition: CZipFolder.hpp:619
unzFile m_UnzipFile
Definition: CZipFolder.hpp:43
STDMETHODIMP GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: CZipFolder.hpp:426
STDMETHODIMP GetCurFolder(PIDLIST_ABSOLUTE *pidl)
Definition: CZipFolder.hpp:590
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:597
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:389
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_INVOKECOMMANDEX
Definition: precomp.h:46
#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:1405
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:712
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1353
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:864
const GUID IID_IPersist
Definition: proxy.cpp:14
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define LVCFMT_RIGHT
Definition: commctrl.h:2599
#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:415
#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:2213
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:579
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:68
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:1381
UINT idCmdLast
Definition: shlobj.h:1384
UINT idCmdFirst
Definition: shlobj.h:1383
UINT indexMenu
Definition: shlobj.h:1382
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1351
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