ReactOS 0.4.15-dev-7788-g1ad9096
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 * Copyright 2023 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
7 */
8
9#include "precomp.h"
10#include <atlpath.h>
11
13 public IZip
14{
20public:
23 ,uf(NULL)
24 {
30 }
31
33 {
34 if (uf)
35 {
36 DPRINT1("WARNING: uf not closed!\n");
37 Close();
38 }
39 }
40
41 void Close()
42 {
43 if (uf)
44 unzClose(uf);
45 uf = NULL;
46 }
47
48 // *** IZip methods ***
50 {
51 if (riid == IID_IUnknown)
52 {
53 *ppvObject = this;
54 AddRef();
55 return S_OK;
56 }
57 return E_NOINTERFACE;
58 }
60 {
61 return 2;
62 }
64 {
65 return 1;
66 }
68 {
69 return uf;
70 }
71
72 class CExtractSettingsPage : public CPropertyPageImpl<CExtractSettingsPage>
73 {
74 private:
77
81
82 public:
89 {
91 m_psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_WIZ_DEST_SUBTITLE);
92 m_psp.dwFlags |= PSP_USETITLE | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
93 }
94
96 {
101 return 0;
102 }
103
105 {
107 {
108 /* We enter here when extraction has finished, and go to next page if it succeeded */
114 {
115 return 0;
116 }
117 else
118 {
120 return TRUE;
121 }
122 }
123
124 /* We end up here if the user manually clicks Next: start extraction */
126
127 /* Grey out every control during extraction to prevent user interaction */
132
136 SetDlgItemTextW(IDC_STATUSTEXT, strExtracting);
137
140
142
145 this,
146 0, NULL);
148 {
149 /* Extraction thread creation failed, do not go to the next page */
151 DPRINT1("ERROR, m_hExtractionThread: CreateThread failed: 0x%x\n", err);
153
155
160 }
161 return TRUE;
162 }
163
165 {
167 }
168
170 {
172 bool res = pPage->m_pExtract->Extract(pPage->m_hWnd, pPage->GetDlgItem(IDC_PROGRESS), &(pPage->m_bExtractionThreadCancel));
173 /* Failing and cancelling extraction both mean we stay on the same property page */
175
177 if (!res)
178 {
179 /* Extraction failed/cancelled: the page becomes interactive again */
183
184 /* Reset the progress bar's appearance */
185 CWindow Progress(pPage->GetDlgItem(IDC_PROGRESS));
186 Progress.SendMessage(PBM_SETRANGE32, 0, 1);
187 Progress.SendMessage(PBM_SETPOS, 0, 0);
188 pPage->WizardReset();
189 }
191
192 return 0;
193 }
194
196 {
198 {
199 /* Extraction will check the value of m_bExtractionThreadCancel between each file in the archive */
201 return TRUE;
202 }
203 return FALSE;
204 }
205
207 {
210 };
211
213 {
214 if (uMsg == BFFM_INITIALIZED)
215 {
217 CWindow dlg(hWnd);
218 dlg.SendMessage(BFFM_SETSELECTION, TRUE, (LPARAM)info->Directory);
219 dlg.CenterWindow(info->hWnd);
220 }
221 return 0;
222 }
223
224 LRESULT OnBrowse(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
225 {
226 BROWSEINFOW bi = { m_hWnd };
228 bi.pszDisplayName = path;
232 bi.lpszTitle = title;
233
236
238 bi.lParam = (LPARAM)&info;
239
241 pidl.Attach(SHBrowseForFolderW(&bi));
242
243 WCHAR tmpPath[MAX_PATH];
244 if (pidl && SHGetPathFromIDListW(pidl, tmpPath))
245 {
246 m_pExtract->m_Directory = tmpPath;
249 }
250 return 0;
251 }
252
253 LRESULT OnEnChangeDirectory(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
254 {
256 return 0;
257 }
258
259 LRESULT OnPassword(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
260 {
263 {
265 }
266 return 0;
267 }
268
270 {
273 }
274
275 public:
277
284 };
285
286
287 class CCompleteSettingsPage : public CPropertyPageImpl<CCompleteSettingsPage>
288 {
289 private:
291
292 public:
296 {
297 m_psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_WIZ_COMPL_TITLE);
298 m_psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_WIZ_COMPL_SUBTITLE);
299 m_psp.dwFlags |= PSP_USETITLE | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
300 }
301
302
304 {
307 PWSTR Ptr = Path.GetBuffer(MAX_PATH);
308 RECT rc;
310 HDC dc = GetDC();
311 PathCompactPathW(dc, Ptr, rc.right - rc.left);
312 ReleaseDC(dc);
313 Path.ReleaseBuffer();
316 return 0;
317 }
319 {
321 {
323 }
324 return FALSE;
325 }
326
327 public:
329
333 };
334
335
336 /* NOTE: This callback is needed to set large icon correctly. */
338 {
339 if (uMsg == PSCB_INITIALIZED)
340 {
341 HICON hIcon = LoadIconW(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCEW(IDI_ZIPFLDR));
342 CWindow dlg(hwndDlg);
343 dlg.SetIcon(hIcon, TRUE);
344 }
345
346 return 0;
347 }
348
350 {
351 PROPSHEETHEADERW psh = { sizeof(psh), 0 };
352 psh.dwFlags = PSH_WIZARD97 | PSH_HEADER | PSH_USEICONID | PSH_USECALLBACK;
353 psh.hInstance = _AtlBaseModule.GetResourceInstance();
354
355 CExtractSettingsPage extractPage(this, &m_Password);
356 CCompleteSettingsPage completePage(this);
357 HPROPSHEETPAGE hpsp[] =
358 {
359 extractPage.Create(),
360 completePage.Create()
361 };
362
363 psh.phpage = hpsp;
364 psh.nPages = _countof(hpsp);
366 psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
367 psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
369
370 PropertySheetW(&psh);
371 }
372
374 HWND hDlg,
375 PCWSTR FullPath,
376 bool is_dir,
380 bool* bOverwriteAll,
381 const bool* bCancel,
382 int* ErrorCode
383 )
384 {
385 int err;
386 BYTE Buffer[2048];
388 HRESULT hr = SHPathPrepareForWriteW(hDlg, NULL, FullPath, dwFlags);
390 {
391 *ErrorCode = hr;
392 return eDirectoryError;
393 }
394 if (is_dir)
395 return eNoError;
396
397 if (Info->flag & MINIZIP_PASSWORD_FLAG)
398 {
400 do
401 {
402 /* If there is a password set, try it */
403 if (!Password.IsEmpty())
404 {
406 if (err == UNZ_OK)
407 {
408 /* Try to read some bytes, because unzOpenCurrentFilePassword does not return failure */
409 char Buf[10];
410 err = unzReadCurrentFile(uf, Buf, sizeof(Buf));
412 if (err >= UNZ_OK)
413 {
414 /* 're'-open the file so that we can begin to extract */
416 break;
417 }
418 }
419 }
421 } while (Response == eAccept);
422
423 if (Response == eSkip)
424 {
425 return eNoError;
426 }
427 else if (Response == eAbort)
428 {
429 return eExtractAbort;
430 }
431 }
432 else
433 {
435 }
436
437 if (err != UNZ_OK)
438 {
439 DPRINT1("ERROR, unzOpenCurrentFilePassword: 0x%x\n", err);
440 *ErrorCode = err;
441 return eOpenError;
442 }
443
446 {
449 {
450 bool bOverwrite = *bOverwriteAll;
451 if (!*bOverwriteAll)
452 {
454 switch (Result)
455 {
456 case eYesToAll:
457 *bOverwriteAll = true;
458 /* fall through */
459 case eYes:
460 bOverwrite = true;
461 break;
462 case eNo:
463 break;
464 case eCancel:
466 return eExtractAbort;
467 }
468 }
469
470 if (bOverwrite)
471 {
474 {
476 }
477 }
478 else
479 {
481 return eNoError;
482 }
483 }
485 {
487 DPRINT1("ERROR, CreateFile: 0x%x (%s)\n", dwErr, *bOverwriteAll ? "Y" : "N");
488 *ErrorCode = dwErr;
489 return eFileError;
490 }
491 }
492
493 do
494 {
495 if (*bCancel)
496 {
498 BOOL deleteResult = DeleteFileW(FullPath);
499 if (!deleteResult)
500 DPRINT1("ERROR, DeleteFile: 0x%x\n", GetLastError());
501 return eExtractAbort;
502 }
503
505
506 if (err < 0)
507 {
508 DPRINT1("ERROR, unzReadCurrentFile: 0x%x\n", err);
509 break;
510 }
511 else if (err > 0)
512 {
513 DWORD dwWritten;
514 if (!WriteFile(hFile, Buffer, err, &dwWritten, NULL))
515 {
516 DPRINT1("ERROR, WriteFile: 0x%x\n", GetLastError());
517 break;
518 }
519 if (dwWritten != (DWORD)err)
520 {
521 DPRINT1("ERROR, WriteFile: dwWritten:%d err:%d\n", dwWritten, err);
522 break;
523 }
524 }
525
526 } while (err > 0);
527
528 /* Update Filetime */
529 FILETIME LocalFileTime;
530 DosDateTimeToFileTime((WORD)(Info->dosDate >> 16), (WORD)Info->dosDate, &LocalFileTime);
531 FILETIME FileTime;
532 LocalFileTimeToFileTime(&LocalFileTime, &FileTime);
533 SetFileTime(hFile, &FileTime, &FileTime, &FileTime);
534
535 /* Done */
537
538 if (err)
539 {
541 DPRINT1("ERROR, unzReadCurrentFile2: 0x%x\n", err);
542 *ErrorCode = err;
543 return eUnpackError;
544 }
545 else
546 {
548 if (err != UNZ_OK)
549 {
550 DPRINT1("ERROR(non-fatal), unzCloseCurrentFile: 0x%x\n", err);
551 }
552 }
553 return eNoError;
554 }
555
556 bool Extract(HWND hDlg, HWND hProgress, const bool* bCancel)
557 {
560 int err = unzGetGlobalInfo64(uf, &gi);
561 if (err != UNZ_OK)
562 {
563 DPRINT1("ERROR, unzGetGlobalInfo64: 0x%x\n", err);
564 Close();
565 return false;
566 }
567
568 CZipEnumerator zipEnum;
569 if (!zipEnum.initialize(this))
570 {
571 DPRINT1("ERROR, zipEnum.initialize\n");
572 Close();
573 return false;
574 }
575
576 CWindow Progress(hProgress);
577 Progress.SendMessage(PBM_SETRANGE32, 0, gi.number_entry);
578 Progress.SendMessage(PBM_SETPOS, 0, 0);
579
580 CStringW BaseDirectory = m_Directory;
584 int CurrentFile = 0;
585 bool bOverwriteAll = false;
586 while (zipEnum.next(Name, Info))
587 {
588 if (*bCancel)
589 {
590 Close();
591 return false;
592 }
593
594 bool is_dir = Name.GetLength() > 0 && Name[Name.GetLength()-1] == '/';
595
596 // Build a combined path
597 CPathW FullPath(BaseDirectory);
598 FullPath += Name;
599
600 // We use SHPathPrepareForWrite for this path.
601 // SHPathPrepareForWrite will prepare the necessary directories.
602 // Windows and ReactOS SHPathPrepareForWrite do not support '/'.
603 FullPath.m_strPath.Replace(L'/', L'\\');
604
605 Retry:
606 eZipExtractError Result = ExtractSingle(hDlg, FullPath, is_dir, &Info, Name, Password, &bOverwriteAll, bCancel, &err);
607 if (Result != eDirectoryError)
608 CurrentFile++;
609 switch (Result)
610 {
611 case eNoError:
612 break;
613
614 case eExtractAbort:
615 case eUnpackError:
616 {
617 Close();
618 return false;
619 }
620
621 case eDirectoryError:
622 {
623 WCHAR StrippedPath[MAX_PATH] = { 0 };
624
625 StrCpyNW(StrippedPath, FullPath, _countof(StrippedPath));
626 if (!is_dir)
627 PathRemoveFileSpecW(StrippedPath);
628 PathStripPathW(StrippedPath);
629 if (ShowExtractError(hDlg, StrippedPath, err, eDirectoryError) == IDRETRY)
630 goto Retry;
631 Close();
632 return false;
633 }
634
635 case eFileError:
636 {
637 int Result = ShowExtractError(hDlg, FullPath, err, eFileError);
638 switch (Result)
639 {
640 case IDABORT:
641 Close();
642 return false;
643 case IDRETRY:
644 CurrentFile--;
645 goto Retry;
646 case IDIGNORE:
647 break;
648 }
649 break;
650 }
651
652 case eOpenError:
653 {
654 if (err == UNZ_BADZIPFILE &&
655 Info.compression_method != 0 &&
656 Info.compression_method != Z_DEFLATED &&
657 Info.compression_method != Z_BZIP2ED)
658 {
659 if (ShowExtractError(hDlg, FullPath, Info.compression_method, eOpenError) == IDYES)
660 break;
661 }
662 Close();
663 return false;
664 }
665 }
666 if (Result == eNoError && is_dir)
667 continue;
668 Progress.SendMessage(PBM_SETPOS, CurrentFile, 0);
669 }
670
671 Close();
672 return true;
673 }
674
676 {
678 CStringW strErr, strText;
679 PWSTR Win32ErrorString;
680
681 if (ErrorType == eFileError || ErrorType == eOpenError)
683 else
684 strText.LoadString(GetModuleHandleA("shell32.dll"), 128); // IDS_CREATEFOLDER_DENIED
685
686 strText.FormatMessage(strText.GetString(), path);
687
688 if (ErrorType == eFileError || HRESULT_FACILITY(Error) == FACILITY_WIN32)
689 {
691 NULL, ErrorType == eFileError ? Error : HRESULT_CODE(Error), 0,
692 (PWSTR)&Win32ErrorString, 0, NULL) != 0)
693 {
694 strErr.SetString(Win32ErrorString);
695 LocalFree(Win32ErrorString);
696 }
697 }
698 if (ErrorType == eOpenError)
700 else if (strErr.GetLength() == 0)
702
703 strText.Append(L"\r\n\r\n" + strErr);
704
705 UINT mbFlags = MB_ICONWARNING;
706 if (ErrorType == eDirectoryError)
707 mbFlags |= MB_RETRYCANCEL;
708 else if (ErrorType == eFileError)
709 mbFlags |= MB_ABORTRETRYIGNORE;
710 else if (ErrorType == eOpenError)
711 mbFlags |= MB_YESNO;
712
713 return MessageBoxW(hDlg, strText, strTitle, mbFlags);
714 }
715};
716
717
719{
720 CZipExtract extractor(Filename);
721 extractor.runWizard();
722}
723
eZipConfirmResponse _CZipAskReplace(HWND hDlg, PCWSTR FullPath)
void _CZipExtract_runWizard(PCWSTR Filename)
eZipPasswordResponse _CZipAskPassword(HWND hDlg, PCWSTR filename, CStringA &Password)
PRTL_UNICODE_STRING_BUFFER Path
struct NameRec_ * Name
Definition: cdprocs.h:460
HWND hWnd
Definition: settings.c:17
#define IDB_HEADER
Definition: resource.h:30
#define DPRINT1
Definition: precomp.h:8
DWORD dwErr
Definition: service.c:36
#define IDB_WATERMARK
Definition: resource.h:4
BOOL Error
Definition: chkdsk.c:66
#define STDMETHODIMP
Definition: basetyps.h:43
const GUID IID_IUnknown
#define IDC_BROWSE
Definition: resource.h:21
StringType m_strPath
Definition: atlpath.h:102
HPROPSHEETPAGE Create()
Definition: rosdlgs.h:57
void Append(_In_count_(nLength) PCXSTR pszSrc, _In_ int nLength)
Definition: atlsimpstr.h:271
void SetString(_In_opt_z_ PCXSTR pszSrc)
Definition: atlsimpstr.h:309
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
PXSTR GetString() noexcept
Definition: atlsimpstr.h:367
int GetLength() const noexcept
Definition: atlsimpstr.h:362
BOOL LoadString(_In_ UINT nID)
Definition: cstringt.h:639
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:818
void __cdecl FormatMessage(UINT nFormatID,...)
Definition: cstringt.h:855
UINT IsDlgButtonChecked(int nIDButton) const
Definition: atlwin.h:926
HDC GetDC()
Definition: atlwin.h:547
BOOL CheckDlgButton(int nIDButton, UINT nCheck)
Definition: atlwin.h:369
BOOL CenterWindow(HWND hWndCenter=NULL)
Definition: atlwin.h:315
HWND GetDlgItem(_In_ int nID) const
Definition: atlwin.h:605
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1116
HICON SetIcon(HICON hIcon, BOOL bBigIcon=TRUE)
Definition: atlwin.h:1216
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:816
CWindow GetParent() const
Definition: atlwin.h:700
int ReleaseDC(HDC hDC)
Definition: atlwin.h:1074
HWND m_hWnd
Definition: atlwin.h:273
BOOL EnableWindow(BOOL bEnable=TRUE)
Definition: atlwin.h:523
Definition: bufpool.h:45
void Attach(T *lp)
Definition: atlalloc.h:162
CCompleteSettingsPage(CZipExtract *extract)
CExtractSettingsPage(CZipExtract *extract, CStringA *password)
Definition: CZipExtract.cpp:83
LRESULT OnEnChangeDirectory(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
LRESULT OnBrowse(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
LRESULT OnPassword(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
static INT CALLBACK s_BrowseCallbackProc(HWND hWnd, UINT uMsg, LPARAM lp, LPARAM pData)
static DWORD WINAPI ExtractEntry(LPVOID lpParam)
void runWizard()
STDMETHODIMP_(ULONG) Release(void)
Definition: CZipExtract.cpp:63
void Close()
Definition: CZipExtract.cpp:41
static INT CALLBACK s_PropSheetCallbackProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
bool m_DirectoryChanged
Definition: CZipExtract.cpp:18
STDMETHODIMP_(ULONG) AddRef(void)
Definition: CZipExtract.cpp:59
CStringW m_Filename
Definition: CZipExtract.cpp:15
CZipExtract(PCWSTR Filename)
Definition: CZipExtract.cpp:21
int ShowExtractError(HWND hDlg, PCWSTR path, int Error, eZipExtractError ErrorType)
STDMETHODIMP_(unzFile) getZip()
Definition: CZipExtract.cpp:67
STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject)
Definition: CZipExtract.cpp:49
CStringW m_Directory
Definition: CZipExtract.cpp:16
eZipExtractError ExtractSingle(HWND hDlg, PCWSTR FullPath, bool is_dir, unz_file_info64 *Info, CStringW Name, CStringA Password, bool *bOverwriteAll, const bool *bCancel, int *ErrorCode)
CStringA m_Password
Definition: CZipExtract.cpp:17
unzFile uf
Definition: CZipExtract.cpp:19
bool Extract(HWND hDlg, HWND hProgress, const bool *bCancel)
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
Definition: classpnp.h:312
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDC_STATUSTEXT
Definition: resource.h:40
zlib_filefunc64_def g_FFunc
Definition: zipfldr.cpp:44
#define MINIZIP_PASSWORD_FLAG
Definition: precomp.h:42
eZipExtractError
Definition: precomp.h:80
@ eUnpackError
Definition: precomp.h:86
@ eNoError
Definition: precomp.h:81
@ eExtractAbort
Definition: precomp.h:82
@ eOpenError
Definition: precomp.h:85
@ eFileError
Definition: precomp.h:84
@ eDirectoryError
Definition: precomp.h:83
eZipPasswordResponse
Definition: precomp.h:61
@ eAccept
Definition: precomp.h:64
@ eSkip
Definition: precomp.h:63
@ eAbort
Definition: precomp.h:62
eZipConfirmResponse
Definition: precomp.h:70
@ eCancel
Definition: precomp.h:74
@ eNo
Definition: precomp.h:73
@ eYes
Definition: precomp.h:71
@ eYesToAll
Definition: precomp.h:72
#define IDS_EXTRACTING
Definition: resource.h:52
#define IDC_DIRECTORY
Definition: resource.h:18
#define IDS_WIZ_BROWSE_TITLE
Definition: resource.h:64
#define IDS_CANTEXTRACTFILE
Definition: resource.h:53
#define IDS_WIZ_COMPL_SUBTITLE
Definition: resource.h:62
#define IDS_WIZ_COMPL_TITLE
Definition: resource.h:61
#define IDC_DESTDIR
Definition: resource.h:25
#define IDC_SHOW_EXTRACTED
Definition: resource.h:26
#define IDC_PASSWORD
Definition: resource.h:20
#define IDD_PROPPAGEDESTINATION
Definition: resource.h:17
#define IDS_ERRORTITLE
Definition: resource.h:47
#define IDS_WIZ_DEST_TITLE
Definition: resource.h:59
#define IDS_DECOMPRESSERROR
Definition: resource.h:54
#define IDC_PROGRESS
Definition: resource.h:21
#define IDS_WIZ_DEST_SUBTITLE
Definition: resource.h:60
#define IDI_ZIPFLDR
Definition: resource.h:4
#define IDD_PROPPAGECOMPLETE
Definition: resource.h:24
#define IDS_UNKNOWNERROR
Definition: resource.h:55
#define IDS_WIZ_TITLE
Definition: resource.h:58
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2913
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define CALLBACK
Definition: compat.h:35
#define Z_DEFLATED
Definition: zlib.h:146
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI SetFileTime(IN HANDLE hFile, CONST FILETIME *lpCreationTime OPTIONAL, CONST FILETIME *lpLastAccessTime OPTIONAL, CONST FILETIME *lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:948
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
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 DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
Definition: time.c:75
BOOL WINAPI LocalFileTimeToFileTime(IN CONST FILETIME *lpLocalFileTime, OUT LPFILETIME lpFileTime)
Definition: time.c:253
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi)
Definition: brsfolder.c:1419
void WINAPI PathStripPathW(LPWSTR lpszPath)
Definition: path.c:694
BOOL WINAPI PathRemoveFileSpecW(LPWSTR lpszPath)
Definition: path.c:629
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:823
BOOL WINAPI PathCompactPathW(HDC hDC, LPWSTR lpszPath, UINT dx)
Definition: path.c:2891
LPWSTR WINAPI StrCpyNW(LPWSTR dst, LPCWSTR src, int count)
Definition: string.c:536
#define INFINITE
Definition: serial.h:102
static void extract(LPCWSTR cabfile, LPWSTR destdir)
Definition: extrac32.c:99
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:939
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
GLuint res
Definition: glext.h:9613
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
REFIID riid
Definition: atlbase.h:39
ULONG AddRef()
ULONG Release()
#define S_OK
Definition: intsafe.h:52
#define CHAIN_MSG_MAP(theChainClass)
Definition: atlwin.h:1998
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1898
#define COMMAND_ID_HANDLER(id, func)
Definition: atlwin.h:1953
#define END_MSG_MAP()
Definition: atlwin.h:1917
#define COMMAND_HANDLER(id, code, func)
Definition: atlwin.h:1944
static const WCHAR dc[]
#define CREATE_ALWAYS
Definition: disk.h:72
#define CREATE_NEW
Definition: disk.h:69
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
static WCHAR password[]
Definition: url.c:33
HICON hIcon
Definition: msconfig.c:44
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned int UINT
Definition: ndis.h:50
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define GENERIC_WRITE
Definition: nt_native.h:90
#define L(x)
Definition: ntvdm.h:50
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1344
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSP_USETITLE
Definition: prsht.h:26
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSWIZB_FINISH
Definition: prsht.h:155
#define PSBTN_NEXT
Definition: prsht.h:147
#define PSH_USEICONID
Definition: prsht.h:42
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define PSM_PRESSBUTTON
Definition: prsht.h:100
static char title[]
Definition: ps.c:92
#define PBM_SETRANGE32
Definition: commctrl.h:2188
#define PBM_SETPOS
Definition: commctrl.h:2184
#define REFIID
Definition: guiddef.h:118
#define err(...)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2379
EXTERN_C HRESULT WINAPI SHPathPrepareForWriteW(HWND hwnd, IUnknown *modless, LPCWSTR path, DWORD flags)
Definition: shlfileop.cpp:2232
HRESULT hr
Definition: shlfolder.c:183
#define BIF_RETURNONLYFSDIRS
Definition: shlobj.h:1210
#define BIF_RETURNFSANCESTORS
Definition: shlobj.h:1213
#define SHPPFW_IGNOREFILENAME
Definition: shlobj.h:334
#define BFFM_SETSELECTION
Definition: shlobj.h:1249
#define SHPPFW_DIRCREATE
Definition: shlobj.h:331
#define BFFM_INITIALIZED
Definition: shlobj.h:1229
#define SHPPFW_NONE
Definition: shlobj.h:330
#define BIF_NEWDIALOGSTYLE
Definition: shlobj.h:1216
#define _countof(array)
Definition: sndvol32.h:68
#define false
Definition: stdbool.h:37
bool next(CStringW &name, unz_file_info64 &info)
bool initialize(IZip *zip)
Definition: IZip.hpp:9
Definition: ncftp.h:89
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwFlags
Definition: prsht.h:294
LPCWSTR pszIcon
Definition: prsht.h:299
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
BFFCALLBACK lpfn
Definition: shlobj.h:1198
UINT ulFlags
Definition: shlobj.h:1197
LPWSTR pszDisplayName
Definition: shlobj.h:1195
LPCWSTR lpszTitle
Definition: shlobj.h:1196
LPARAM lParam
Definition: shlobj.h:1199
LONG right
Definition: windef.h:308
LONG left
Definition: windef.h:306
ZPOS64_T number_entry
Definition: unzip.h:98
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
@ Password
Definition: telnetd.h:65
#define SetWindowLongPtr
Definition: treelist.c:70
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
int ZEXPORT unzOpenCurrentFilePassword(unzFile file, const char *password)
Definition: unzip.c:1653
unzFile ZEXPORT unzOpen2_64(const void *path, zlib_filefunc64_def *pzlib_filefunc_def)
Definition: unzip.c:783
int ZEXPORT unzOpenCurrentFile(unzFile file)
Definition: unzip.c:1648
int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, unsigned len)
Definition: unzip.c:1691
int ZEXPORT unzGetGlobalInfo64(unzFile file, unz_global_info64 *pglobal_info)
Definition: unzip.c:833
int ZEXPORT unzCloseCurrentFile(unzFile file)
Definition: unzip.c:2014
int ZEXPORT unzClose(unzFile file)
Definition: unzip.c:813
#define UNZ_BADZIPFILE
Definition: unzip.h:79
voidp unzFile
Definition: unzip.h:70
#define UNZ_OK
Definition: unzip.h:74
#define Z_BZIP2ED
Definition: unzip.h:62
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:423
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:419
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define ERROR_FILE_EXISTS
Definition: winerror.h:165
#define FACILITY_WIN32
Definition: winerror.h:27
#define HRESULT_CODE(hr)
Definition: winerror.h:76
#define GetDlgItemText
Definition: winuser.h:5785
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define MB_RETRYCANCEL
Definition: winuser.h:805
#define MB_YESNO
Definition: winuser.h:817
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define IDIGNORE
Definition: winuser.h:834
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define MB_ABORTRETRYIGNORE
Definition: winuser.h:791
#define SendMessageCallback
Definition: winuser.h:5844
#define IDABORT
Definition: winuser.h:832
#define MB_ICONWARNING
Definition: winuser.h:786
#define DWLP_MSGRESULT
Definition: winuser.h:870
#define SW_SHOW
Definition: winuser.h:775
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:835
#define IDRETRY
Definition: winuser.h:833
#define MAKEINTRESOURCE
Definition: winuser.h:591
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2075
#define BST_CHECKED
Definition: winuser.h:197
#define EN_CHANGE
Definition: winuser.h:2022
_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:409
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193