ReactOS  0.4.15-dev-440-g5f37b68
CZipExtract.cpp
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: Zip extraction
5  * COPYRIGHT: Copyright 2017-2019 Mark Jansen (mark.jansen@reactos.org)
6  */
7 
8 #include "precomp.h"
9 
10 class CZipExtract :
11  public IZip
12 {
18 public:
21  ,uf(NULL)
22  {
25  PWSTR Dir = m_Directory.GetBuffer();
28  }
29 
31  {
32  if (uf)
33  {
34  DPRINT1("WARNING: uf not closed!\n");
35  Close();
36  }
37  }
38 
39  void Close()
40  {
41  if (uf)
42  unzClose(uf);
43  uf = NULL;
44  }
45 
46  // *** IZip methods ***
48  {
49  if (riid == IID_IUnknown)
50  {
51  *ppvObject = this;
52  AddRef();
53  return S_OK;
54  }
55  return E_NOINTERFACE;
56  }
58  {
59  return 2;
60  }
62  {
63  return 1;
64  }
66  {
67  return uf;
68  }
69 
70  class CExtractSettingsPage : public CPropertyPageImpl<CExtractSettingsPage>
71  {
72  private:
75 
78 
79  public:
86  {
87  m_psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_WIZ_DEST_TITLE);
88  m_psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_WIZ_DEST_SUBTITLE);
89  m_psp.dwFlags |= PSP_USETITLE | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
90  }
91 
93  {
98  return 0;
99  }
100 
102  {
103  if (m_hExtractionThread != NULL)
104  {
105  /* We enter here when extraction has finished, and go to next page if it succeeded */
109  m_pExtract->Release();
111  {
112  return 0;
113  }
114  else
115  {
117  return TRUE;
118  }
119  }
120 
121  /* We end up here if the user manually clicks Next: start extraction */
123 
124  /* Grey out every control during extraction to prevent user interaction */
128  SetWizardButtons(0);
129 
130  CStringW strExtracting(MAKEINTRESOURCEW(IDS_EXTRACTING));
131  SetDlgItemTextW(IDC_STATUSTEXT, strExtracting);
132 
134  UpdateDirectory();
135 
136  m_pExtract->AddRef();
137 
140  this,
141  0, NULL);
142  if (!m_hExtractionThread)
143  {
144  /* Extraction thread creation failed, do not go to the next page */
145  DWORD err = GetLastError();
146  DPRINT1("ERROR, m_hExtractionThread: CreateThread failed: 0x%x\n", err);
147  m_pExtract->Release();
148 
150 
155  }
156  return TRUE;
157  }
158 
159  static DWORD WINAPI ExtractEntry(LPVOID lpParam)
160  {
161  CExtractSettingsPage* pPage = (CExtractSettingsPage*)lpParam;
162  bool res = pPage->m_pExtract->Extract(pPage->m_hWnd, pPage->GetDlgItem(IDC_PROGRESS), &(pPage->m_bExtractionThreadCancel));
163  /* Failing and cancelling extraction both mean we stay on the same property page */
164  pPage->m_bExtractionThreadCancel = !res;
165 
167  if (!res)
168  {
169  /* Extraction failed/cancelled: the page becomes interactive again */
173 
174  /* Reset the progress bar's appearance */
175  CWindow Progress(pPage->GetDlgItem(IDC_PROGRESS));
176  Progress.SendMessage(PBM_SETRANGE32, 0, 1);
177  Progress.SendMessage(PBM_SETPOS, 0, 0);
178  }
180 
181  return 0;
182  }
183 
185  {
186  if (m_hExtractionThread != NULL)
187  {
188  /* Extraction will check the value of m_bExtractionThreadCancel between each file in the archive */
190  return TRUE;
191  }
192  return FALSE;
193  }
194 
195  struct browse_info
196  {
199  };
200 
202  {
203  if (uMsg == BFFM_INITIALIZED)
204  {
206  CWindow dlg(hWnd);
207  dlg.SendMessage(BFFM_SETSELECTION, TRUE, (LPARAM)info->Directory);
208  dlg.CenterWindow(info->hWnd);
209  }
210  return 0;
211  }
212 
213  LRESULT OnBrowse(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
214  {
215  BROWSEINFOW bi = { m_hWnd };
217  bi.pszDisplayName = path;
221  bi.lpszTitle = title;
222 
224  UpdateDirectory();
225 
227  bi.lParam = (LPARAM)&info;
228 
230  pidl.Attach(SHBrowseForFolderW(&bi));
231 
232  WCHAR tmpPath[MAX_PATH];
233  if (pidl && SHGetPathFromIDListW(pidl, tmpPath))
234  {
235  m_pExtract->m_Directory = tmpPath;
238  }
239  return 0;
240  }
241 
242  LRESULT OnEnChangeDirectory(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
243  {
245  return 0;
246  }
247 
248  LRESULT OnPassword(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
249  {
252  {
254  }
255  return 0;
256  }
257 
259  {
262  }
263 
264  public:
266 
272  END_MSG_MAP()
273  };
274 
275 
276  class CCompleteSettingsPage : public CPropertyPageImpl<CCompleteSettingsPage>
277  {
278  private:
280 
281  public:
285  {
286  m_psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_WIZ_COMPL_TITLE);
287  m_psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_WIZ_COMPL_SUBTITLE);
288  m_psp.dwFlags |= PSP_USETITLE | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
289  }
290 
291 
293  {
296  PWSTR Ptr = Path.GetBuffer();
297  RECT rc;
299  HDC dc = GetDC();
300  PathCompactPathW(dc, Ptr, rc.right - rc.left);
301  ReleaseDC(dc);
302  Path.ReleaseBuffer();
305  return 0;
306  }
308  {
310  {
312  }
313  return FALSE;
314  }
315 
316  public:
318 
321  END_MSG_MAP()
322  };
323 
324 
325  void runWizard()
326  {
327  PROPSHEETHEADERW psh = { sizeof(psh), 0 };
328  psh.dwFlags = PSH_WIZARD97 | PSH_HEADER;
329  psh.hInstance = _AtlBaseModule.GetResourceInstance();
330 
331  CExtractSettingsPage extractPage(this, &m_Password);
332  CCompleteSettingsPage completePage(this);
333  HPROPSHEETPAGE hpsp[] =
334  {
335  extractPage.Create(),
336  completePage.Create()
337  };
338 
339  psh.phpage = hpsp;
340  psh.nPages = _countof(hpsp);
341 
342  PropertySheetW(&psh);
343  }
344 
345  bool Extract(HWND hDlg, HWND hProgress, const bool* bCancel)
346  {
349  int err = unzGetGlobalInfo64(uf, &gi);
350  if (err != UNZ_OK)
351  {
352  DPRINT1("ERROR, unzGetGlobalInfo64: 0x%x\n", err);
353  Close();
354  return false;
355  }
356 
357  CZipEnumerator zipEnum;
358  if (!zipEnum.initialize(this))
359  {
360  DPRINT1("ERROR, zipEnum.initialize\n");
361  Close();
362  return false;
363  }
364 
365  CWindow Progress(hProgress);
366  Progress.SendMessage(PBM_SETRANGE32, 0, gi.number_entry);
367  Progress.SendMessage(PBM_SETPOS, 0, 0);
368 
369  BYTE Buffer[2048];
370  CStringA BaseDirectory = m_Directory;
371  CStringA Name;
374  int CurrentFile = 0;
375  bool bOverwriteAll = false;
376  while (zipEnum.next(Name, Info))
377  {
378  if (*bCancel)
379  {
380  Close();
381  return false;
382  }
383 
384  bool is_dir = Name.GetLength() > 0 && Name[Name.GetLength()-1] == '/';
385 
386  char CombinedPath[MAX_PATH * 2] = { 0 };
387  PathCombineA(CombinedPath, BaseDirectory, Name);
388  CStringA FullPath = CombinedPath;
389  FullPath.Replace('/', '\\'); /* SHPathPrepareForWriteA does not handle '/' */
391  HRESULT hr = SHPathPrepareForWriteA(hDlg, NULL, FullPath, dwFlags);
392  if (FAILED_UNEXPECTEDLY(hr))
393  {
394  Close();
395  return false;
396  }
397  CurrentFile++;
398  if (is_dir)
399  continue;
400 
401  if (Info.flag & MINIZIP_PASSWORD_FLAG)
402  {
404  do
405  {
406  /* If there is a password set, try it */
407  if (!Password.IsEmpty())
408  {
410  if (err == UNZ_OK)
411  {
412  /* Try to read some bytes, because unzOpenCurrentFilePassword does not return failure */
413  char Buf[10];
414  err = unzReadCurrentFile(uf, Buf, sizeof(Buf));
416  if (err >= UNZ_OK)
417  {
418  /* 're'-open the file so that we can begin to extract */
420  break;
421  }
422  }
423  }
425  } while (Response == eAccept);
426 
427  if (Response == eSkip)
428  {
429  Progress.SendMessage(PBM_SETPOS, CurrentFile, 0);
430  continue;
431  }
432  else if (Response == eAbort)
433  {
434  Close();
435  return false;
436  }
437  }
438  else
439  {
441  }
442 
443  if (err != UNZ_OK)
444  {
445  DPRINT1("ERROR, unzOpenCurrentFilePassword: 0x%x\n", err);
446  Close();
447  return false;
448  }
449 
452  {
454  if (dwErr == ERROR_FILE_EXISTS)
455  {
456  bool bOverwrite = bOverwriteAll;
457  if (!bOverwriteAll)
458  {
459  eZipConfirmResponse Result = _CZipAskReplace(hDlg, FullPath);
460  switch (Result)
461  {
462  case eYesToAll:
463  bOverwriteAll = true;
464  case eYes:
465  bOverwrite = true;
466  break;
467  case eNo:
468  break;
469  case eCancel:
471  Close();
472  return false;
473  }
474  }
475 
476  if (bOverwrite)
477  {
480  {
481  dwErr = GetLastError();
482  }
483  }
484  else
485  {
487  continue;
488  }
489  }
491  {
493  DPRINT1("ERROR, CreateFileA: 0x%x (%s)\n", dwErr, bOverwriteAll ? "Y" : "N");
494  Close();
495  return false;
496  }
497  }
498 
499  do
500  {
501  if (*bCancel)
502  {
504  BOOL deleteResult = DeleteFileA(FullPath);
505  if (deleteResult == 0)
506  DPRINT1("ERROR, DeleteFileA: 0x%x\n", GetLastError());
507  Close();
508  return false;
509  }
510 
511  err = unzReadCurrentFile(uf, Buffer, sizeof(Buffer));
512 
513  if (err < 0)
514  {
515  DPRINT1("ERROR, unzReadCurrentFile: 0x%x\n", err);
516  break;
517  }
518  else if (err > 0)
519  {
520  DWORD dwWritten;
521  if (!WriteFile(hFile, Buffer, err, &dwWritten, NULL))
522  {
523  DPRINT1("ERROR, WriteFile: 0x%x\n", GetLastError());
524  break;
525  }
526  if (dwWritten != (DWORD)err)
527  {
528  DPRINT1("ERROR, WriteFile: dwWritten:%d err:%d\n", dwWritten, err);
529  break;
530  }
531  }
532 
533  } while (err > 0);
534 
535  /* Update Filetime */
536  FILETIME LocalFileTime;
537  DosDateTimeToFileTime((WORD)(Info.dosDate >> 16), (WORD)Info.dosDate, &LocalFileTime);
538  FILETIME FileTime;
539  LocalFileTimeToFileTime(&LocalFileTime, &FileTime);
540  SetFileTime(hFile, &FileTime, &FileTime, &FileTime);
541 
542  /* Done */
544 
545  if (err)
546  {
548  DPRINT1("ERROR, unzReadCurrentFile2: 0x%x\n", err);
549  Close();
550  return false;
551  }
552  else
553  {
555  if (err != UNZ_OK)
556  {
557  DPRINT1("ERROR(non-fatal), unzCloseCurrentFile: 0x%x\n", err);
558  }
559  }
560  Progress.SendMessage(PBM_SETPOS, CurrentFile, 0);
561  }
562 
563  Close();
564  return true;
565  }
566 };
567 
568 
570 {
571  CZipExtract extractor(Filename);
572  extractor.runWizard();
573 }
574 
HPROPSHEETPAGE Create()
Definition: rosdlgs.h:57
CCompleteSettingsPage(CZipExtract *extract)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define MAKEINTRESOURCE
Definition: winuser.h:591
const uint16_t * PCWSTR
Definition: typedefs.h:56
#define ERROR_FILE_EXISTS
Definition: winerror.h:165
#define PBM_SETRANGE32
Definition: commctrl.h:2184
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:407
#define E_NOINTERFACE
Definition: winerror.h:2364
UINT IsDlgButtonChecked(int nIDButton) const
Definition: atlwin.h:858
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
CStringW m_Filename
Definition: CZipExtract.cpp:13
eZipPasswordResponse _CZipAskPassword(HWND hDlg, const char *filename, CStringA &Password)
#define COMMAND_HANDLER(id, code, func)
Definition: atlwin.h:1826
Definition: precomp.h:71
GLsizei const GLchar ** path
Definition: glext.h:7234
REFIID riid
Definition: precomp.h:44
#define IDC_BROWSE
Definition: resource.h:21
uint16_t * PWSTR
Definition: typedefs.h:55
voidp unzFile
Definition: unzip.h:70
LRESULT OnEnChangeDirectory(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
#define UNZ_OK
Definition: unzip.h:74
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
BOOL EnableWindow(BOOL bEnable=TRUE)
Definition: atlwin.h:489
CZipExtract(PCWSTR Filename)
Definition: CZipExtract.cpp:19
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1288
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:27
HWND hWnd
Definition: settings.c:17
#define IDC_STATUSTEXT
Definition: resource.h:40
#define BFFM_INITIALIZED
Definition: shlobj.h:1163
#define PSWIZB_NEXT
Definition: prsht.h:154
#define INVALID_HANDLE_VALUE
Definition: compat.h:400
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
CStringA m_Password
Definition: CZipExtract.cpp:15
#define PBM_SETPOS
Definition: commctrl.h:2180
bool initialize(IZip *zip)
LONG left
Definition: windef.h:306
void Close()
Definition: CZipExtract.cpp:39
LONG right
Definition: windef.h:308
#define IDC_DIRECTORY
Definition: resource.h:10
int32_t INT
Definition: typedefs.h:57
LRESULT OnPassword(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
int ZEXPORT unzClose(unzFile file)
Definition: unzip.c:808
#define IDS_WIZ_DEST_TITLE
Definition: resource.h:48
#define SendMessageCallback
Definition: winuser.h:5819
struct TraceInfo Info
#define DWLP_MSGRESULT
Definition: winuser.h:864
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:934
BOOL extract(char *filename, const bin_file *bin)
Definition: mspatcha.c:158
bool m_DirectoryChanged
Definition: CZipExtract.cpp:16
CStringW m_Directory
Definition: CZipExtract.cpp:14
BOOL WINAPI SetFileTime(IN HANDLE hFile, CONST FILETIME *lpCreationTime OPTIONAL, CONST FILETIME *lpLastAccessTime OPTIONAL, CONST FILETIME *lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:1098
STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject)
Definition: CZipExtract.cpp:47
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define IDC_PROGRESS
Definition: resource.h:13
BOOL WINAPI LocalFileTimeToFileTime(IN CONST FILETIME *lpLocalFileTime, OUT LPFILETIME lpFileTime)
Definition: time.c:253
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
int ZEXPORT unzOpenCurrentFile(unzFile file)
Definition: unzip.c:1641
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
int ZEXPORT unzGetGlobalInfo64(unzFile file, unz_global_info64 *pglobal_info)
Definition: unzip.c:828
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:818
#define BFFM_SETSELECTION
Definition: shlobj.h:1183
#define SHPPFW_DIRCREATE
Definition: shlobj.h:303
unsigned int BOOL
Definition: ntddk_ex.h:94
LPWSTR pszDisplayName
Definition: shlobj.h:1129
Definition: IZip.hpp:8
#define GENERIC_WRITE
Definition: nt_native.h:90
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
eZipConfirmResponse _CZipAskReplace(HWND hDlg, PCSTR FullPath)
BOOL CheckDlgButton(int nIDButton, UINT nCheck)
Definition: atlwin.h:335
LONG_PTR SetWindowLongPtr(int nIndex, LONG_PTR dwNewLong)
Definition: atlwin.h:1208
BOOL WINAPI PathCompactPathW(HDC hDC, LPWSTR lpszPath, UINT dx)
Definition: path.c:2870
#define BIF_RETURNFSANCESTORS
Definition: shlobj.h:1147
#define STDMETHODIMP
Definition: basetyps.h:43
struct NameRec_ * Name
Definition: cdprocs.h:464
ULONG Release()
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:764
Definition: precomp.h:63
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:136
eZipConfirmResponse
Definition: precomp.h:69
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, unsigned len)
Definition: unzip.c:1684
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
#define IDS_WIZ_BROWSE_TITLE
Definition: resource.h:53
Definition: precomp.h:73
#define false
Definition: osdep.h:35
#define COMMAND_ID_HANDLER(id, func)
Definition: atlwin.h:1835
Definition: bufpool.h:45
STDMETHODIMP_(unzFile) getZip()
Definition: CZipExtract.cpp:65
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2905
#define SW_SHOW
Definition: winuser.h:769
HWND GetDlgItem(int nID)
Definition: atlwin.h:571
#define PSWIZB_FINISH
Definition: prsht.h:155
LPCWSTR lpszTitle
Definition: shlobj.h:1130
DWORD dwErr
Definition: service.c:36
#define IDC_SHOW_EXTRACTED
Definition: resource.h:18
unzFile uf
Definition: CZipExtract.cpp:17
int ZEXPORT unzCloseCurrentFile(unzFile file)
Definition: unzip.c:2004
#define BIF_NEWDIALOGSTYLE
Definition: shlobj.h:1150
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
Definition: time.c:75
LONG HRESULT
Definition: typedefs.h:78
#define END_MSG_MAP()
Definition: atlwin.h:1799
HINSTANCE hInstance
Definition: prsht.h:296
#define _countof(array)
Definition: sndvol32.h:68
const GUID IID_IUnknown
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
unzFile ZEXPORT unzOpen2_64(const void *path, zlib_filefunc64_def *pzlib_filefunc_def)
Definition: unzip.c:778
#define MAX_PATH
Definition: compat.h:26
zlib_filefunc64_def g_FFunc
Definition: zipfldr.cpp:43
#define WINAPI
Definition: msvc.h:6
#define IDS_WIZ_COMPL_TITLE
Definition: resource.h:50
PCXSTR GetString() const
Definition: atlsimpstr.h:361
BOOL CenterWindow(HWND hWndCenter=NULL)
Definition: atlwin.h:309
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
STDMETHODIMP_(ULONG) AddRef(void)
Definition: CZipExtract.cpp:57
LPSTR WINAPI PathCombineA(LPSTR lpszDest, LPCSTR lpszDir, LPCSTR lpszFile)
Definition: path.c:154
DWORD dwFlags
Definition: prsht.h:294
#define IDD_PROPPAGECOMPLETE
Definition: resource.h:16
int ZEXPORT unzOpenCurrentFilePassword(unzFile file, const char *password)
Definition: unzip.c:1646
Definition: ncftp.h:89
ULONG AddRef()
void runWizard()
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static const WCHAR L[]
Definition: oid.c:1250
T1_FIELD_DICT_PRIVATE password
Definition: t1tokens.h:64
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
CExtractSettingsPage(CZipExtract *extract, CStringA *password)
Definition: CZipExtract.cpp:80
#define CHAIN_MSG_MAP(theChainClass)
Definition: atlwin.h:1880
HWND m_hWnd
Definition: atlwin.h:268
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define MINIZIP_PASSWORD_FLAG
Definition: precomp.h:43
#define err(...)
UINT GetDlgItemText(int nID, LPTSTR lpStr, int nMaxCount) const
Definition: atlwin.h:583
#define PSP_USETITLE
Definition: prsht.h:26
_In_ HANDLE hFile
Definition: mswsock.h:90
#define PSBTN_NEXT
Definition: prsht.h:147
static INT CALLBACK s_BrowseCallbackProc(HWND hWnd, UINT uMsg, LPARAM lp, LPARAM pData)
unsigned char BYTE
Definition: xxhash.c:193
EXTERN_C HRESULT WINAPI SHPathPrepareForWriteA(HWND hwnd, IUnknown *modless, LPCSTR path, DWORD flags)
Definition: shlfileop.cpp:2223
int ReleaseDC(HDC hDC)
Definition: atlwin.h:1006
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi)
Definition: brsfolder.c:1309
int Replace(PCXSTR pszOld, PCXSTR pszNew)
Definition: cstringt.h:746
#define S_OK
Definition: intsafe.h:59
#define CREATE_ALWAYS
Definition: disk.h:72
UINT ulFlags
Definition: shlobj.h:1131
PRTL_UNICODE_STRING_BUFFER Path
bool next(CStringA &name, unz_file_info64 &info)
#define BIF_RETURNONLYFSDIRS
Definition: shlobj.h:1144
LPARAM lParam
Definition: shlobj.h:1133
STDMETHODIMP_(ULONG) Release(void)
Definition: CZipExtract.cpp:61
void _CZipExtract_runWizard(PCWSTR Filename)
BFFCALLBACK lpfn
Definition: shlobj.h:1132
unsigned int UINT
Definition: ndis.h:50
eZipPasswordResponse
Definition: precomp.h:60
#define IDC_DESTDIR
Definition: resource.h:17
#define BST_CHECKED
Definition: winuser.h:197
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1780
#define DPRINT1
Definition: precomp.h:8
Definition: precomp.h:62
#define IDS_WIZ_TITLE
Definition: resource.h:47
LRESULT OnBrowse(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
GLuint res
Definition: glext.h:9613
#define SHPPFW_NONE
Definition: shlobj.h:302
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2274
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
unsigned int ULONG
Definition: retypes.h:1
static const WCHAR dc[]
#define SHPPFW_IGNOREFILENAME
Definition: shlobj.h:306
#define CREATE_NEW
Definition: disk.h:69
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
CWindow GetParent() const
Definition: atlwin.h:654
#define IDS_WIZ_DEST_SUBTITLE
Definition: resource.h:49
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:408
#define IDS_WIZ_COMPL_SUBTITLE
Definition: resource.h:51
#define PSM_PRESSBUTTON
Definition: prsht.h:100
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
LONG_PTR LRESULT
Definition: windef.h:209
#define INFINITE
Definition: serial.h:102
#define IDD_PROPPAGEDESTINATION
Definition: resource.h:9
static DWORD WINAPI ExtractEntry(LPVOID lpParam)
static char title[]
Definition: ps.c:92
bool Extract(HWND hDlg, HWND hProgress, const bool *bCancel)
HDC GetDC()
Definition: atlwin.h:513
#define IDS_EXTRACTING
Definition: resource.h:44
#define IDC_PASSWORD
Definition: resource.h:12
ZPOS64_T number_entry
Definition: unzip.h:98
#define EN_CHANGE
Definition: winuser.h:2004