ReactOS 0.4.15-dev-7788-g1ad9096
precomp.h File Reference
#include <windef.h>
#include <winbase.h>
#include <shlobj.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlcoll.h>
#include <atlconv.h>
#include <atlstr.h>
#include <ui/rosdlgs.h>
#include <shlwapi.h>
#include <shellapi.h>
#include <strsafe.h>
#include <reactos/debug.h>
#include <shellutils.h>
#include "minizip/unzip.h"
#include "minizip/ioapi.h"
#include "resource.h"
#include "zippidl.hpp"
#include "IZip.hpp"
#include "CZipEnumerator.hpp"
#include "CZipFolder.hpp"
#include "CZipCreator.hpp"
#include "CSendToZip.hpp"
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define COM_NO_WINDOWS_H
 
#define NTOS_MODE_USER
 
#define NTSTATUS   LONG
 
#define EXTRACT_VERBA   "extract"
 
#define EXTRACT_VERBW   L"extract"
 
#define MINIZIP_COMPATIBLE_VERSION   36
 
#define MINIZIP_PASSWORD_FLAG   1
 
#define MINIZIP_UTF8_FLAG   (1 << 11)
 

Enumerations

enum  eZipPasswordResponse { eAbort , eSkip , eAccept }
 
enum  eZipConfirmResponse { eYes , eYesToAll , eNo , eCancel }
 
enum  eZipExtractError {
  eNoError , eExtractAbort , eDirectoryError , eFileError ,
  eOpenError , eUnpackError
}
 

Functions

UINT GetZipCodePage (BOOL bUnZip)
 
WCHARguid2string (REFCLSID iid)
 
HRESULT _CEnumZipContents_CreateInstance (IZip *zip, DWORD flags, PCWSTR prefix, REFIID riid, LPVOID *ppvOut)
 
HRESULT _CExplorerCommandProvider_CreateInstance (IContextMenu *zipObject, REFIID riid, LPVOID *ppvOut)
 
HRESULT _CFolderViewCB_CreateInstance (REFIID riid, LPVOID *ppvOut)
 
void _CZipExtract_runWizard (PCWSTR Filename)
 
eZipPasswordResponse _CZipAskPassword (HWND hDlg, PCWSTR filename, CStringA &Password)
 
eZipConfirmResponse _CZipAskReplace (HWND hDlg, PCWSTR FullPath)
 

Variables

EXTERN_C const GUID CLSID_ZipFolderStorageHandler
 
EXTERN_C const GUID CLSID_ZipFolderSendTo
 
EXTERN_C const GUID CLSID_ZipFolderContextMenu
 
EXTERN_C const GUID CLSID_ZipFolderRightDragHandler
 
EXTERN_C const GUID CLSID_ZipFolderDropHandler
 
EXTERN_C const GUID CLSID_ZipFolderExtractAllCommand
 
LONG g_ModuleRefCnt
 
zlib_filefunc64_def g_FFunc
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 4 of file precomp.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 5 of file precomp.h.

◆ EXTRACT_VERBA

#define EXTRACT_VERBA   "extract"

Definition at line 25 of file precomp.h.

◆ EXTRACT_VERBW

#define EXTRACT_VERBW   L"extract"

Definition at line 26 of file precomp.h.

◆ MINIZIP_COMPATIBLE_VERSION

#define MINIZIP_COMPATIBLE_VERSION   36

Definition at line 41 of file precomp.h.

◆ MINIZIP_PASSWORD_FLAG

#define MINIZIP_PASSWORD_FLAG   1

Definition at line 42 of file precomp.h.

◆ MINIZIP_UTF8_FLAG

#define MINIZIP_UTF8_FLAG   (1 << 11)

Definition at line 43 of file precomp.h.

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 6 of file precomp.h.

◆ NTSTATUS

Definition at line 21 of file precomp.h.

Enumeration Type Documentation

◆ eZipConfirmResponse

Enumerator
eYes 
eYesToAll 
eNo 
eCancel 

Definition at line 69 of file precomp.h.

70{
71 eYes,
73 eNo,
75};
@ eCancel
Definition: precomp.h:74
@ eNo
Definition: precomp.h:73
@ eYes
Definition: precomp.h:71
@ eYesToAll
Definition: precomp.h:72

◆ eZipExtractError

Enumerator
eNoError 
eExtractAbort 
eDirectoryError 
eFileError 
eOpenError 
eUnpackError 

Definition at line 79 of file precomp.h.

80{
87};
@ 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

Enumerator
eAbort 
eSkip 
eAccept 

Definition at line 60 of file precomp.h.

61{
62 eAbort,
63 eSkip,
64 eAccept,
65};
@ eAccept
Definition: precomp.h:64
@ eSkip
Definition: precomp.h:63
@ eAbort
Definition: precomp.h:62

Function Documentation

◆ _CEnumZipContents_CreateInstance()

HRESULT _CEnumZipContents_CreateInstance ( IZip zip,
DWORD  flags,
PCWSTR  prefix,
REFIID  riid,
LPVOID ppvOut 
)

Definition at line 105 of file CEnumZipContents.cpp.

106{
107 return ShellObjectCreatorInit<CEnumZipContents>(zip, flags, prefix, riid, ppvOut);
108}
GLbitfield flags
Definition: glext.h:7161
REFIID riid
Definition: atlbase.h:39

Referenced by CZipFolder::EnumObjects().

◆ _CExplorerCommandProvider_CreateInstance()

HRESULT _CExplorerCommandProvider_CreateInstance ( IContextMenu zipObject,
REFIID  riid,
LPVOID ppvOut 
)

Definition at line 186 of file CExplorerCommand.cpp.

187{
188 return ShellObjectCreatorInit<CExplorerCommandProvider>(zipObject, riid, ppvOut);
189}

Referenced by CZipFolder::CreateViewObject().

◆ _CFolderViewCB_CreateInstance()

HRESULT _CFolderViewCB_CreateInstance ( REFIID  riid,
LPVOID ppvOut 
)

Definition at line 51 of file CFolderViewCB.cpp.

52{
53 return ShellObjectCreator<CFolderViewCB>(riid, ppvOut);
54}

Referenced by CZipFolder::CreateViewObject().

◆ _CZipAskPassword()

eZipPasswordResponse _CZipAskPassword ( HWND  hDlg,
PCWSTR  filename,
CStringA Password 
)

Definition at line 68 of file CZipPassword.cpp.

69{
70 if (filename)
73 INT_PTR Result = password.DoModal(hDlg);
74 switch (Result)
75 {
76 case IDOK: return eAccept;
77 case IDSKIP: return eSkip;
78 default:
79 case IDCANCEL: return eAbort;
80 }
81}
#define IDSKIP
Definition: resource.h:34
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
const char * filename
Definition: ioapi.h:137
static WCHAR password[]
Definition: url.c:33
@ Password
Definition: telnetd.h:65
int32_t INT_PTR
Definition: typedefs.h:64
#define IDCANCEL
Definition: winuser.h:831
#define IDOK
Definition: winuser.h:830
_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

Referenced by CZipExtract::ExtractSingle(), and CZipExtract::CExtractSettingsPage::OnPassword().

◆ _CZipAskReplace()

eZipConfirmResponse _CZipAskReplace ( HWND  hDlg,
PCWSTR  FullPath 
)

Definition at line 53 of file CConfirmReplace.cpp.

54{
57 INT_PTR Result = confirm.DoModal(hDlg);
58 switch (Result)
59 {
60 case IDYES: return eYes;
61 case IDYESALL: return eYesToAll;
62 default:
63 case IDNO: return eNo;
64 case IDCANCEL: return eCancel;
65 }
66}
int confirm(const char *cmd, const char *file)
Definition: cmds.c:1636
#define IDYESALL
Definition: resource.h:29
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:939
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IDNO
Definition: winuser.h:836
#define IDYES
Definition: winuser.h:835

Referenced by CZipExtract::ExtractSingle().

◆ _CZipExtract_runWizard()

void _CZipExtract_runWizard ( PCWSTR  Filename)

Definition at line 718 of file CZipExtract.cpp.

719{
720 CZipExtract extractor(Filename);
721 extractor.runWizard();
722}

Referenced by CZipFolder::s_ExtractProc().

◆ GetZipCodePage()

UINT GetZipCodePage ( BOOL  bUnZip)

Definition at line 90 of file zipfldr.cpp.

91{
92 WCHAR szValue[16];
93 DWORD dwType, cbValue = sizeof(szValue);
94 UINT nDefaultCodePage = (bUnZip ? CP_ACP : CP_UTF8);
95
96 LONG error = SHGetValueW(HKEY_CURRENT_USER, L"Software\\ReactOS",
97 (bUnZip ? L"UnZipCodePage" : L"ZipCodePage"),
98 &dwType, szValue, &cbValue);
99 if (error != ERROR_SUCCESS)
100 return nDefaultCodePage;
101
102 if (cbValue == sizeof(DWORD) && (dwType == REG_DWORD || dwType == REG_BINARY))
103 return *(DWORD*)szValue;
104
105 if (dwType != REG_SZ && dwType != REG_EXPAND_SZ)
106 return nDefaultCodePage;
107
108 szValue[_countof(szValue) - 1] = UNICODE_NULL;
109 return (UINT)wcstol(szValue, NULL, 0);
110}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
unsigned long DWORD
Definition: ntddk_ex.h:95
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define REG_SZ
Definition: layer.c:22
#define error(str)
Definition: mkdosfs.c:1605
unsigned int UINT
Definition: ndis.h:50
#define REG_BINARY
Definition: nt_native.h:1496
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
#define REG_DWORD
Definition: sdbapi.c:596
#define CP_UTF8
Definition: nls.h:20
#define _countof(array)
Definition: sndvol32.h:68
#define HKEY_CURRENT_USER
Definition: winreg.h:11
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CZipCreatorImpl::JustDoIt().

◆ guid2string()

WCHAR * guid2string ( REFCLSID  iid)

Definition at line 21 of file Debug.cpp.

22{
23 static WCHAR buf[2][300];
24 static int idx = 0;
25
26 idx ^= 1;
27
28 LPOLESTR tmp;
29 HRESULT hr = ProgIDFromCLSID(iid, &tmp);
30 if (SUCCEEDED(hr))
31 {
32 wcscpy(buf[idx], tmp);
33 CoTaskMemFree(tmp);
34 return buf[idx];
35 }
38 {
39 return buf[idx];
40 }
42
43 return buf[idx];
44}
static bool GetInterfaceName(const WCHAR *InterfaceString, WCHAR *buf, size_t size)
Definition: Debug.cpp:10
unsigned int idx
Definition: utils.c:41
HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID)
Definition: compobj.c:2530
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static LPOLESTR
Definition: stg_prop.c:27
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
HRESULT hr
Definition: shlfolder.c:183

Referenced by CZipFolder::BindToObject(), CZipFolder::CreateViewObject(), and CZipFolder::GetUIObjectOf().

Variable Documentation

◆ CLSID_ZipFolderContextMenu

EXTERN_C const GUID CLSID_ZipFolderContextMenu

Definition at line 30 of file precomp.h.

◆ CLSID_ZipFolderDropHandler

EXTERN_C const GUID CLSID_ZipFolderDropHandler

Definition at line 32 of file precomp.h.

◆ CLSID_ZipFolderExtractAllCommand

EXTERN_C const GUID CLSID_ZipFolderExtractAllCommand

Definition at line 34 of file precomp.h.

Referenced by CExplorerCommand::GetCanonicalName().

◆ CLSID_ZipFolderRightDragHandler

EXTERN_C const GUID CLSID_ZipFolderRightDragHandler

Definition at line 31 of file precomp.h.

◆ CLSID_ZipFolderSendTo

EXTERN_C const GUID CLSID_ZipFolderSendTo

Definition at line 29 of file precomp.h.

Referenced by CSendToZip::GetClassID().

◆ CLSID_ZipFolderStorageHandler

EXTERN_C const GUID CLSID_ZipFolderStorageHandler

Definition at line 28 of file precomp.h.

◆ g_FFunc

zlib_filefunc64_def g_FFunc
extern

Definition at line 44 of file zipfldr.cpp.

Referenced by CZipExtract::Extract(), init_zlib(), and CZipFolder::STDMETHODIMP_().

◆ g_ModuleRefCnt