Mercurial > vba-linux
diff src/win32/7zip/7z/CPP/7zip/Archive/DllExports2.cpp @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/win32/7zip/7z/CPP/7zip/Archive/DllExports2.cpp Sat Mar 03 10:31:27 2012 -0600 1.3 @@ -0,0 +1,82 @@ 1.4 +// DLLExports.cpp 1.5 + 1.6 +#include "StdAfx.h" 1.7 + 1.8 +#include "../../Common/MyInitGuid.h" 1.9 +#include "../../Common/ComTry.h" 1.10 +#include "../../Common/Types.h" 1.11 +#include "../../Windows/PropVariant.h" 1.12 +#if defined(_WIN32) && defined(_7ZIP_LARGE_PAGES) 1.13 +extern "C" 1.14 +{ 1.15 +#include "../../../C/Alloc.h" 1.16 +} 1.17 +#endif 1.18 + 1.19 +#include "IArchive.h" 1.20 +#include "../ICoder.h" 1.21 +#include "../IPassword.h" 1.22 + 1.23 +HINSTANCE g_hInstance; 1.24 +#ifndef _UNICODE 1.25 +#ifdef _WIN32 1.26 +bool g_IsNT = false; 1.27 +static bool IsItWindowsNT() 1.28 +{ 1.29 + OSVERSIONINFO versionInfo; 1.30 + versionInfo.dwOSVersionInfoSize = sizeof(versionInfo); 1.31 + if (!::GetVersionEx(&versionInfo)) 1.32 + return false; 1.33 + return (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT); 1.34 +} 1.35 +#endif 1.36 +#endif 1.37 + 1.38 +extern "C" 1.39 +BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) 1.40 +{ 1.41 + if (dwReason == DLL_PROCESS_ATTACH) 1.42 + { 1.43 + g_hInstance = hInstance; 1.44 + #ifndef _UNICODE 1.45 + #ifdef _WIN32 1.46 + g_IsNT = IsItWindowsNT(); 1.47 + #endif 1.48 + #endif 1.49 + } 1.50 + return TRUE; 1.51 +} 1.52 + 1.53 +DEFINE_GUID(CLSID_CArchiveHandler, 1.54 +0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00); 1.55 + 1.56 +static const UInt16 kDecodeId = 0x2790; 1.57 + 1.58 +DEFINE_GUID(CLSID_CCodec, 1.59 +0x23170F69, 0x40C1, kDecodeId, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); 1.60 + 1.61 +STDAPI CreateCoder(const GUID *clsid, const GUID *iid, void **outObject); 1.62 +STDAPI CreateArchiver(const GUID *classID, const GUID *iid, void **outObject); 1.63 + 1.64 +STDAPI CreateObject(const GUID *clsid, const GUID *iid, void **outObject) 1.65 +{ 1.66 + // COM_TRY_BEGIN 1.67 + *outObject = 0; 1.68 + if (*iid == IID_ICompressCoder || *iid == IID_ICompressCoder2 || *iid == IID_ICompressFilter) 1.69 + { 1.70 + return CreateCoder(clsid, iid, outObject); 1.71 + } 1.72 + else 1.73 + { 1.74 + return CreateArchiver(clsid, iid, outObject); 1.75 + } 1.76 + // COM_TRY_END 1.77 +} 1.78 + 1.79 +STDAPI SetLargePageMode() 1.80 +{ 1.81 + #if defined(_WIN32) && defined(_7ZIP_LARGE_PAGES) 1.82 + SetLargePageSize(); 1.83 + #endif 1.84 + return S_OK; 1.85 +}