ReactOS  0.4.12-dev-918-g6c6e7b8
zipfldr.cpp File Reference
#include "precomp.h"
#include <initguid.h>
#include "minizip/ioapi.h"
#include "minizip/iowin32.h"
Include dependency graph for zipfldr.cpp:

Go to the source code of this file.

Classes

class  CZipFldrModule
 

Functions

 DEFINE_GUID (CLSID_ZipFolderStorageHandler, 0xe88dcce0, 0xb7b3, 0x11d1, 0xa9, 0xf0, 0x00, 0xaa, 0x00, 0x60, 0xfa, 0x31)
 
 DEFINE_GUID (CLSID_ZipFolderSendTo, 0x888dca60, 0xfc0a, 0x11cf, 0x8f, 0x0f, 0x00, 0xc0, 0x4f, 0xd7, 0xd0, 0x62)
 
 DEFINE_GUID (CLSID_ZipFolderContextMenu, 0xb8cdcb65, 0xb1bf, 0x4b42, 0x94, 0x28, 0x1d, 0xfd, 0xb7, 0xee, 0x92, 0xaf)
 
 DEFINE_GUID (CLSID_ZipFolderRightDragHandler, 0xbd472f60, 0x27fa, 0x11cf, 0xb8, 0xb4, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
 DEFINE_GUID (CLSID_ZipFolderDropHandler, 0xed9d80b9, 0xd157, 0x457b, 0x91, 0x92, 0x0e, 0x72, 0x80, 0x31, 0x3b, 0xf0)
 
 DEFINE_GUID (CLSID_ZipFolderExtractAllCommand, 0xc3d9647b, 0x8fd9, 0x4ee6, 0x8b, 0xc7, 0x82, 0x7, 0x80, 0x9, 0x10, 0x5a)
 
static void init_zlib ()
 
EXTERN_C BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
 
STDAPI DllCanUnloadNow ()
 
STDAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
STDAPI DllRegisterServer ()
 
STDAPI DllUnregisterServer ()
 
EXTERN_C BOOL WINAPI RouteTheCall (IN HWND hWndOwner, IN HINSTANCE hInstance, IN LPCSTR lpStringArg, IN INT Show)
 

Variables

HMODULE g_hModule = NULL
 
LONG g_ModuleRefCnt = 0
 
CZipFldrModule gModule
 
zlib_filefunc64_def g_FFunc
 

Function Documentation

◆ DEFINE_GUID() [1/6]

DEFINE_GUID ( CLSID_ZipFolderStorageHandler  ,
0xe88dcce0  ,
0xb7b3  ,
0x11d1  ,
0xa9  ,
0xf0  ,
0x00  ,
0xaa  ,
0x00  ,
0x60  ,
0xfa  ,
0x31   
)

◆ DEFINE_GUID() [2/6]

DEFINE_GUID ( CLSID_ZipFolderSendTo  ,
0x888dca60  ,
0xfc0a  ,
0x11cf  ,
0x8f  ,
0x0f  ,
0x00  ,
0xc0  ,
0x4f  ,
0xd7  ,
0xd0  ,
0x62   
)

◆ DEFINE_GUID() [3/6]

DEFINE_GUID ( CLSID_ZipFolderContextMenu  ,
0xb8cdcb65  ,
0xb1bf  ,
0x4b42  ,
0x94  ,
0x28  ,
0x1d  ,
0xfd  ,
0xb7  ,
0xee  ,
0x92  ,
0xaf   
)

◆ DEFINE_GUID() [4/6]

DEFINE_GUID ( CLSID_ZipFolderRightDragHandler  ,
0xbd472f60  ,
0x27fa  ,
0x11cf  ,
0xb8  ,
0xb4  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)

◆ DEFINE_GUID() [5/6]

DEFINE_GUID ( CLSID_ZipFolderDropHandler  ,
0xed9d80b9  ,
0xd157  ,
0x457b  ,
0x91  ,
0x92  ,
0x0e  ,
0x72  ,
0x80  ,
0x31  ,
0x3b  ,
0xf0   
)

◆ DEFINE_GUID() [6/6]

DEFINE_GUID ( CLSID_ZipFolderExtractAllCommand  ,
0xc3d9647b  ,
0x8fd9  ,
0x4ee6  ,
0x8b  ,
0xc7  ,
0x82  ,
0x7  ,
0x80  ,
0x9  ,
0x10  ,
0x5a   
)

◆ DllCanUnloadNow()

STDAPI DllCanUnloadNow ( void  )

Definition at line 65 of file zipfldr.cpp.

66 {
67  if (g_ModuleRefCnt)
68  return S_FALSE;
69  return gModule.DllCanUnloadNow();
70 }
HRESULT DllCanUnloadNow()
Definition: atlbase.h:937
LONG g_ModuleRefCnt
Definition: zipfldr.cpp:11
#define S_FALSE
Definition: winerror.h:2357
CZipFldrModule gModule
Definition: zipfldr.cpp:36

◆ DllGetClassObject()

STDAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 72 of file zipfldr.cpp.

73 {
74  return gModule.DllGetClassObject(rclsid, riid, ppv);
75 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: atlbase.h:944
CZipFldrModule gModule
Definition: zipfldr.cpp:36

◆ DllMain()

EXTERN_C BOOL WINAPI DllMain ( HINSTANCE  hInstance,
DWORD  dwReason,
LPVOID  lpReserved 
)

Definition at line 50 of file zipfldr.cpp.

51 {
52  switch (dwReason)
53  {
54  case DLL_PROCESS_ATTACH:
57  gModule.Init(ObjectMap, hInstance, NULL);
58  init_zlib();
59  break;
60  }
61 
62  return TRUE;
63 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
DWORD dwReason
Definition: misc.cpp:154
HRESULT Init(_ATL_OBJMAP_ENTRY *p, HINSTANCE, const GUID *plibid)
Definition: atlbase.h:806
HINSTANCE hInstance
Definition: charmap.c:20
smooth NULL
Definition: ftsmooth.c:416
static void init_zlib()
Definition: zipfldr.cpp:44
CZipFldrModule gModule
Definition: zipfldr.cpp:36
HMODULE g_hModule
Definition: zipfldr.cpp:10

◆ DllRegisterServer()

STDAPI DllRegisterServer ( void  )

Definition at line 77 of file zipfldr.cpp.

78 {
79  HRESULT hr;
80 
83  return hr;
84 
86  if (FAILED(hr))
87  return hr;
88 
89  return S_OK;
90 }
#define TRUE
Definition: types.h:120
HRESULT DllRegisterServer(BOOL bRegTypeLib=TRUE)
Definition: atlbase.h:949
HRESULT hr
Definition: shlfolder.c:183
#define IDR_ZIPFLDR
Definition: resource.h:4
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI UpdateRegistryFromResource(LPCTSTR lpszRes, BOOL bRegister, struct _ATL_REGMAP_ENTRY *pMapEntries=NULL)
Definition: atlbase.h:451
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
#define S_OK
Definition: intsafe.h:59
CZipFldrModule gModule
Definition: zipfldr.cpp:36

◆ DllUnregisterServer()

STDAPI DllUnregisterServer ( void  )

Definition at line 92 of file zipfldr.cpp.

93 {
94  HRESULT hr;
95 
98  return hr;
99 
101  if (FAILED(hr))
102  return hr;
103 
104  return S_OK;
105 }
HRESULT hr
Definition: shlfolder.c:183
#define IDR_ZIPFLDR
Definition: resource.h:4
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI UpdateRegistryFromResource(LPCTSTR lpszRes, BOOL bRegister, struct _ATL_REGMAP_ENTRY *pMapEntries=NULL)
Definition: atlbase.h:451
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
#define S_OK
Definition: intsafe.h:59
CZipFldrModule gModule
Definition: zipfldr.cpp:36
HRESULT DllUnregisterServer(BOOL bUnRegTypeLib=TRUE)
Definition: atlbase.h:954

◆ init_zlib()

static void init_zlib ( )
static

Definition at line 44 of file zipfldr.cpp.

45 {
47 }
void fill_win32_filefunc64W(zlib_filefunc64_def *pzlib_filefunc_def)
Definition: iowin32.c:452
zlib_filefunc64_def g_FFunc
Definition: zipfldr.cpp:42

Referenced by DllMain().

◆ RouteTheCall()

EXTERN_C BOOL WINAPI RouteTheCall ( IN HWND  hWndOwner,
IN HINSTANCE  hInstance,
IN LPCSTR  lpStringArg,
IN INT  Show 
)

Definition at line 109 of file zipfldr.cpp.

114 {
115  CStringW path = lpStringArg;
116  PathRemoveBlanksW(path.GetBuffer());
117  path.ReleaseBuffer();
118  path = L"\"" + path + L"\"";
119  ShellExecuteW(NULL, L"open", L"explorer.exe", path.GetString(), NULL, SW_SHOWNORMAL);
120  return TRUE;
121 }
#define TRUE
Definition: types.h:120
VOID WINAPI PathRemoveBlanksW(LPWSTR lpszPath)
Definition: path.c:915
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR L[]
Definition: oid.c:1250
#define SW_SHOWNORMAL
Definition: winuser.h:764
Definition: services.c:325
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2236

Variable Documentation

◆ g_FFunc

Definition at line 42 of file zipfldr.cpp.

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

◆ g_hModule

HMODULE g_hModule = NULL

Definition at line 10 of file zipfldr.cpp.

Referenced by DllMain().

◆ g_ModuleRefCnt

LONG g_ModuleRefCnt = 0

Definition at line 11 of file zipfldr.cpp.

Referenced by DllCanUnloadNow().

◆ gModule