LibreOffice Module extensions (master) 1
Macros | Functions | Variables
so_activex.cxx File Reference
#include <stdio.h>
#include "StdAfx2.h"
#include "resource.h"
#include <initguid.h>
#include <so_activex.h>
#include <so_activex_i.c>
#include "SOActiveX.h"
#include <comphelper\documentconstants.hxx>
#include <sal/types.h>
#include <exception>
Include dependency graph for so_activex.cxx:

Go to the source code of this file.

Macros

#define X64_LIB_NAME   L"so_activex_x64.dll"
 
#define X32_LIB_NAME   L"so_activex.dll"
 
#define REG_DELETE_KEY_A(key, aPath, nKeyAccess)   RegDeleteKeyA( key, aPath )
 
#define SUPPORTED_EXT_NUM   30
 
#define SUPPORTED_MSEXT_NUM   7
 

Functions

BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID)
 
STDAPI DllCanUnloadNow ()
 
STDAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
static LSTATUS createKey (HKEY hkey, const char *aKeyToCreate, REGSAM nKeyAccess, const char *aValue=nullptr, const char *aChildName=nullptr, const char *aChildValue=nullptr)
 
static LSTATUS createKey (HKEY hkey, const wchar_t *aKeyToCreate, REGSAM nKeyAccess, const wchar_t *aValue=nullptr, const wchar_t *aChildName=nullptr, const wchar_t *aChildValue=nullptr)
 
EXTERN_C __declspec (dllexport) HRESULT STDAPICALLTYPE DllUnregisterServerNative(int nMode
 
static HRESULT DllRegisterServerNative_Impl (int nMode, bool bForAllUsers, REGSAM nKeyAccess, const wchar_t *pProgramPath, const wchar_t *pLibName)
 
 if (bFor64Bit) hr = DllRegisterServerDoc_Impl( nMode, bForAllUsers, n64KeyAccess )
 
 if (SUCCEEDED(hr)) hr = DllRegisterServerDoc_Impl( nMode, bForAllUsers, n32KeyAccess )
 
static HRESULT DeleteKeyTree (HKEY hkey, const char *pPath, REGSAM nKeyAccess)
 
static HRESULT DllUnregisterServerNative_Impl (int nMode, bool bForAllUsers, REGSAM nKeyAccess)
 
STDAPI DllUnregisterServerNative (int nMode, BOOL bForAllUsers, BOOL bFor64Bit)
 
static HRESULT DllRegisterServerDoc_Impl (int nMode, bool bForAllUsers, REGSAM nKeyAccess)
 
static HRESULT DllUnregisterServerDoc_Impl (int nMode, bool bForAllUsers, REGSAM nKeyAccess)
 
STDAPI DllUnregisterServerDoc (int nMode, BOOL bForAllUsers, BOOL bFor64Bit)
 
STDAPI DllRegisterServer ()
 
STDAPI DllUnregisterServer ()
 

Variables

CComModule _Module
 
const REGSAM n64KeyAccess = KEY_ALL_ACCESS | KEY_WOW64_64KEY
 
const REGSAM n32KeyAccess = KEY_ALL_ACCESS
 
const bool bX64 = false
 
const char *const aFileExt []
 
const sal_Unicode *const aMimeType []
 
const int nForModes []
 
const char *const aClassID = "{67F2A879-82D5-4A6D-8CC5-FFB3C114B69D}"
 
const char *const aTypeLib = "{61FA3F13-8061-4796-B055-3697ED28CB38}"
 
const char *const aInterIDWinPeer = "{BF5D10F3-8A10-4A0B-B150-2B6AA2D7E118}"
 
const char *const aProxyStubWinPeer = "{00020424-0000-0000-C000-000000000046}"
 
const char *const aInterIDDispInt = "{9337694C-B27D-4384-95A4-9D8E0EABC9E5}"
 
const char *const aProxyStubDispInt = "{00020424-0000-0000-C000-000000000046}"
 
const char *const aInterIDActApprove = "{029E9F1E-2B3F-4297-9160-8197DE7ED54F}"
 
const char *const aProxyStubActApprove = "{00020424-0000-0000-C000-000000000046}"
 
const char *const aLocalPrefix = "Software\\Classes\\"
 
EXTERN_C BOOL bForAllUsers
 
EXTERN_C BOOL BOOL bFor64Bit
 
EXTERN_C BOOL BOOL const wchar_t * pProgramPath
 
return hr
 
const char *const aMSFileExt [] = { ".dot", ".doc", ".xlt", ".xls", ".pot", ".ppt", ".pps" }
 
const char *const aMSMimeType []
 
const int nForMSModes [] = { 1, 1, 2, 2, 4, 4, 4 }
 

Macro Definition Documentation

◆ REG_DELETE_KEY_A

#define REG_DELETE_KEY_A (   key,
  aPath,
  nKeyAccess 
)    RegDeleteKeyA( key, aPath )

Definition at line 72 of file so_activex.cxx.

◆ SUPPORTED_EXT_NUM

#define SUPPORTED_EXT_NUM   30

Definition at line 155 of file so_activex.cxx.

◆ SUPPORTED_MSEXT_NUM

#define SUPPORTED_MSEXT_NUM   7

Definition at line 559 of file so_activex.cxx.

◆ X32_LIB_NAME

#define X32_LIB_NAME   L"so_activex.dll"

Definition at line 62 of file so_activex.cxx.

◆ X64_LIB_NAME

#define X64_LIB_NAME   L"so_activex_x64.dll"

Definition at line 61 of file so_activex.cxx.

Function Documentation

◆ __declspec()

EXTERN_C __declspec ( dllexport  )

◆ createKey() [1/2]

static LSTATUS createKey ( HKEY  hkey,
const char *  aKeyToCreate,
REGSAM  nKeyAccess,
const char *  aValue = nullptr,
const char *  aChildName = nullptr,
const char *  aChildValue = nullptr 
)
static

Definition at line 225 of file so_activex.cxx.

Referenced by DllRegisterServerDoc_Impl(), and DllRegisterServerNative_Impl().

◆ createKey() [2/2]

static LSTATUS createKey ( HKEY  hkey,
const wchar_t *  aKeyToCreate,
REGSAM  nKeyAccess,
const wchar_t *  aValue = nullptr,
const wchar_t *  aChildName = nullptr,
const wchar_t *  aChildValue = nullptr 
)
static

Definition at line 248 of file so_activex.cxx.

◆ DeleteKeyTree()

static HRESULT DeleteKeyTree ( HKEY  hkey,
const char *  pPath,
REGSAM  nKeyAccess 
)
static

◆ DllCanUnloadNow()

STDAPI DllCanUnloadNow ( void  )

Definition at line 93 of file so_activex.cxx.

References _Module.

◆ DllGetClassObject()

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

Definition at line 101 of file so_activex.cxx.

References _Module.

◆ DllMain()

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

Definition at line 78 of file so_activex.cxx.

References _Module, and TRUE.

◆ DllRegisterServer()

STDAPI DllRegisterServer ( void  )

Definition at line 722 of file so_activex.cxx.

References bX64, DllRegisterServer(), FALSE, pProgramPath, SAL_N_ELEMENTS, and TRUE.

Referenced by DllRegisterServer().

◆ DllRegisterServerDoc_Impl()

static HRESULT DllRegisterServerDoc_Impl ( int  nMode,
bool  bForAllUsers,
REGSAM  nKeyAccess 
)
static

◆ DllRegisterServerNative_Impl()

static HRESULT DllRegisterServerNative_Impl ( int  nMode,
bool  bForAllUsers,
REGSAM  nKeyAccess,
const wchar_t *  pProgramPath,
const wchar_t *  pLibName 
)
static

◆ DllUnregisterServer()

STDAPI DllUnregisterServer ( void  )

Definition at line 758 of file so_activex.cxx.

References bX64, DllUnregisterServerDoc(), DllUnregisterServerNative(), FALSE, and TRUE.

◆ DllUnregisterServerDoc()

STDAPI DllUnregisterServerDoc ( int  nMode,
BOOL  bForAllUsers,
BOOL  bFor64Bit 
)

◆ DllUnregisterServerDoc_Impl()

static HRESULT DllUnregisterServerDoc_Impl ( int  nMode,
bool  bForAllUsers,
REGSAM  nKeyAccess 
)
static

◆ DllUnregisterServerNative()

STDAPI DllUnregisterServerNative ( int  nMode,
BOOL  bForAllUsers,
BOOL  bFor64Bit 
)

◆ DllUnregisterServerNative_Impl()

static HRESULT DllUnregisterServerNative_Impl ( int  nMode,
bool  bForAllUsers,
REGSAM  nKeyAccess 
)
static

◆ if() [1/2]

◆ if() [2/2]

if ( SUCCEEDED(hr ) = DllRegisterServerDoc_Impl( nMode, bForAllUsers, n32KeyAccess )

Variable Documentation

◆ _Module

CComModule _Module

Definition at line 48 of file so_activex.cxx.

Referenced by DllCanUnloadNow(), DllGetClassObject(), and DllMain().

◆ aClassID

const char* const aClassID = "{67F2A879-82D5-4A6D-8CC5-FFB3C114B69D}"

◆ aFileExt

const char* const aFileExt[]
Initial value:
= { ".vor",
".sds", ".sda", ".sdd", ".sdp", ".sdc", ".sdw", ".smf",
".stw", ".stc", ".sti", ".std",
".sxw", ".sxc", ".sxi", ".sxd", ".sxg", ".sxm",
".ott", ".otg", ".otp", ".ots", ".otf",
".odt", ".oth", ".odm", ".odg", ".odp", ".ods", ".odf"}

Definition at line 156 of file so_activex.cxx.

Referenced by DllRegisterServerNative_Impl(), and DllUnregisterServerNative_Impl().

◆ aInterIDActApprove

const char* const aInterIDActApprove = "{029E9F1E-2B3F-4297-9160-8197DE7ED54F}"

Definition at line 219 of file so_activex.cxx.

Referenced by DllRegisterServerNative_Impl(), and DllUnregisterServerNative_Impl().

◆ aInterIDDispInt

const char* const aInterIDDispInt = "{9337694C-B27D-4384-95A4-9D8E0EABC9E5}"

Definition at line 215 of file so_activex.cxx.

Referenced by DllRegisterServerNative_Impl(), and DllUnregisterServerNative_Impl().

◆ aInterIDWinPeer

const char* const aInterIDWinPeer = "{BF5D10F3-8A10-4A0B-B150-2B6AA2D7E118}"

Definition at line 211 of file so_activex.cxx.

Referenced by DllRegisterServerNative_Impl(), and DllUnregisterServerNative_Impl().

◆ aLocalPrefix

const char* const aLocalPrefix = "Software\\Classes\\"

◆ aMimeType

const sal_Unicode* const aMimeType[]

Definition at line 162 of file so_activex.cxx.

Referenced by DllRegisterServerNative_Impl(), and DllUnregisterServerNative_Impl().

◆ aMSFileExt

const char* const aMSFileExt[] = { ".dot", ".doc", ".xlt", ".xls", ".pot", ".ppt", ".pps" }

Definition at line 560 of file so_activex.cxx.

Referenced by DllRegisterServerDoc_Impl(), and DllUnregisterServerDoc_Impl().

◆ aMSMimeType

const char* const aMSMimeType[]
Initial value:
= { "application/msword",
"application/msword",
"application/vnd.ms-excel",
"application/vnd.ms-excel",
"application/vnd.ms-powerpoint",
"application/vnd.ms-powerpoint",
"application/vnd.ms-powerpoint" }

Definition at line 561 of file so_activex.cxx.

Referenced by DllRegisterServerDoc_Impl(), and DllUnregisterServerDoc_Impl().

◆ aProxyStubActApprove

const char* const aProxyStubActApprove = "{00020424-0000-0000-C000-000000000046}"

Definition at line 220 of file so_activex.cxx.

Referenced by DllRegisterServerNative_Impl().

◆ aProxyStubDispInt

const char* const aProxyStubDispInt = "{00020424-0000-0000-C000-000000000046}"

Definition at line 216 of file so_activex.cxx.

Referenced by DllRegisterServerNative_Impl().

◆ aProxyStubWinPeer

const char* const aProxyStubWinPeer = "{00020424-0000-0000-C000-000000000046}"

Definition at line 212 of file so_activex.cxx.

Referenced by DllRegisterServerNative_Impl().

◆ aTypeLib

const char* const aTypeLib = "{61FA3F13-8061-4796-B055-3697ED28CB38}"

Definition at line 208 of file so_activex.cxx.

Referenced by DllRegisterServerNative_Impl(), and DllUnregisterServerNative_Impl().

◆ bFor64Bit

EXTERN_C BOOL BOOL bFor64Bit
Initial value:
{
HRESULT hr = S_OK
return hr
Definition: so_activex.cxx:446

Definition at line 271 of file so_activex.cxx.

Referenced by DllUnregisterServerDoc(), and DllUnregisterServerNative().

◆ bForAllUsers

EXTERN_C BOOL bForAllUsers

◆ bX64

const bool bX64 = false

Definition at line 71 of file so_activex.cxx.

Referenced by DllRegisterServer(), and DllUnregisterServer().

◆ hr

return hr

◆ n32KeyAccess

const REGSAM n32KeyAccess = KEY_ALL_ACCESS

Definition at line 65 of file so_activex.cxx.

Referenced by DllUnregisterServerDoc(), and DllUnregisterServerNative().

◆ n64KeyAccess

const REGSAM n64KeyAccess = KEY_ALL_ACCESS | KEY_WOW64_64KEY

Definition at line 64 of file so_activex.cxx.

Referenced by DllUnregisterServerDoc(), and DllUnregisterServerNative().

◆ nForModes

const int nForModes[]
Initial value:
= { 16,
1, 2, 4, 4, 8, 16, 32,
16, 8, 4, 2,
16, 8, 4, 2, 16, 32,
16, 2, 4, 8, 32,
16, 16, 16, 2, 4, 8, 32 }

Definition at line 200 of file so_activex.cxx.

Referenced by DllRegisterServerNative_Impl(), and DllUnregisterServerNative_Impl().

◆ nForMSModes

const int nForMSModes[] = { 1, 1, 2, 2, 4, 4, 4 }

Definition at line 568 of file so_activex.cxx.

Referenced by DllRegisterServerDoc_Impl(), and DllUnregisterServerDoc_Impl().

◆ pProgramPath

EXTERN_C BOOL BOOL const wchar_t* pProgramPath
Initial value:
{
HRESULT hr = S_OK

Definition at line 437 of file so_activex.cxx.

Referenced by DllRegisterServer(), and DllRegisterServerNative_Impl().