ReactOS 0.4.16-dev-122-g325d74c
msi_main.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "shlwapi.h"
#include "oleauto.h"
#include "rpcproxy.h"
#include "msipriv.h"
#include "msiserver.h"
#include "wine/debug.h"
Include dependency graph for msi_main.c:

Go to the source code of this file.

Classes

struct  class_factory
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
static void LockModule (void)
 
static void UnlockModule (void)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
static struct class_factoryimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI MsiCF_QueryInterface (LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI MsiCF_AddRef (LPCLASSFACTORY iface)
 
static ULONG WINAPI MsiCF_Release (LPCLASSFACTORY iface)
 
static HRESULT WINAPI MsiCF_CreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
 
static HRESULT WINAPI MsiCF_LockServer (LPCLASSFACTORY iface, BOOL dolock)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi)
 
HRESULT WINAPI DllCanUnloadNow (void)
 

Variables

static LONG dll_count
 
INSTALLUILEVEL gUILevel = INSTALLUILEVEL_DEFAULT
 
HWND gUIhwnd = 0
 
INSTALLUI_HANDLERA gUIHandlerA = NULL
 
INSTALLUI_HANDLERW gUIHandlerW = NULL
 
INSTALLUI_HANDLER_RECORD gUIHandlerRecord = NULL
 
DWORD gUIFilter = 0
 
DWORD gUIFilterRecord = 0
 
LPVOID gUIContext = NULL
 
LPVOID gUIContextRecord = NULL
 
WCHARgszLogFile = NULL
 
HINSTANCE msi_hInstance
 
static const IClassFactoryVtbl MsiCF_Vtbl
 
static struct class_factory MsiServer_CF = { { &MsiCF_Vtbl }, create_msiserver }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file msi_main.c.

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 216 of file msi_main.c.

217{
218 return dll_count == 0 ? S_OK : S_FALSE;
219}
#define S_OK
Definition: intsafe.h:52
static LONG dll_count
Definition: msi_main.c:38
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 174 of file msi_main.c.

175{
176 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
177
178 if ( IsEqualCLSID (rclsid, &CLSID_MsiInstaller) )
179 {
180 *ppv = &MsiServer_CF;
181 return S_OK;
182 }
183
184 if( IsEqualCLSID (rclsid, &CLSID_MsiServerMessage) ||
185 IsEqualCLSID (rclsid, &CLSID_MsiServer) ||
186 IsEqualCLSID (rclsid, &CLSID_PSFactoryBuffer) ||
187 IsEqualCLSID (rclsid, &CLSID_MsiServerX3) )
188 {
189 FIXME("create %s object\n", debugstr_guid( rclsid ));
190 }
191
193}
#define FIXME(fmt,...)
Definition: precomp.h:53
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
static struct class_factory MsiServer_CF
Definition: msi_main.c:169
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ DllGetVersion()

HRESULT WINAPI DllGetVersion ( DLLVERSIONINFO pdvi)

Definition at line 198 of file msi_main.c.

199{
200 TRACE("%p\n",pdvi);
201
202 if (pdvi->cbSize < sizeof(DLLVERSIONINFO))
203 return E_INVALIDARG;
204
209
210 return S_OK;
211}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define MSI_MINORVERSION
Definition: msipriv.h:730
#define MSI_BUILDNUMBER
Definition: msipriv.h:731
#define MSI_MAJORVERSION
Definition: msipriv.h:729
#define DLLVER_PLATFORM_WINDOWS
Definition: shlwapi.h:1963
DWORD dwMajorVersion
Definition: shlwapi.h:1957
DWORD dwBuildNumber
Definition: shlwapi.h:1959
DWORD dwMinorVersion
Definition: shlwapi.h:1958
DWORD dwPlatformID
Definition: shlwapi.h:1960

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 70 of file msi_main.c.

71{
72 switch (fdwReason)
73 {
75 msi_hInstance = hinstDLL;
78 break;
80 if (lpvReserved) break;
85 break;
86 }
87 return TRUE;
88}
void release_typelib(void)
Definition: apps.c:159
#define free
Definition: debug_ros.c:5
#define TRUE
Definition: types.h:120
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define GetCurrentProcess()
Definition: compat.h:759
#define IsWow64Process
Definition: compat.h:760
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
void msi_dialog_unregister_class(void)
Definition: dialog.c:4098
void msi_free_handle_table(void)
Definition: handle.c:71
BOOL is_wow64
Definition: msi.c:52
static IN DWORD IN LPVOID lpvReserved
HINSTANCE msi_hInstance
Definition: msi_main.c:51
WCHAR * gszLogFile
Definition: msi_main.c:50

◆ impl_from_IClassFactory()

static struct class_factory * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 96 of file msi_main.c.

97{
98 return CONTAINING_RECORD(iface, struct class_factory, IClassFactory_iface);
99}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by MsiCF_CreateInstance(), and MsiCF_QueryInterface().

◆ LockModule()

static void LockModule ( void  )
static

Definition at line 57 of file msi_main.c.

58{
60}
#define InterlockedIncrement
Definition: armddk.h:53

Referenced by MsiCF_AddRef(), and MsiCF_LockServer().

◆ MsiCF_AddRef()

static ULONG WINAPI MsiCF_AddRef ( LPCLASSFACTORY  iface)
static

Definition at line 118 of file msi_main.c.

119{
120 LockModule();
121 return 2;
122}
static void LockModule(void)
Definition: msi_main.c:57

◆ MsiCF_CreateInstance()

static HRESULT WINAPI MsiCF_CreateInstance ( LPCLASSFACTORY  iface,
LPUNKNOWN  pOuter,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 130 of file msi_main.c.

132{
134 IUnknown *unk = NULL;
135 HRESULT r;
136
137 TRACE("%p %p %s %p\n", This, pOuter, debugstr_guid(riid), ppobj);
138
139 r = This->create_object( pOuter, (LPVOID*) &unk );
140 if (SUCCEEDED(r))
141 {
142 r = IUnknown_QueryInterface( unk, riid, ppobj );
143 IUnknown_Release( unk );
144 }
145 return r;
146}
#define NULL
Definition: types.h:112
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static struct class_factory * impl_from_IClassFactory(IClassFactory *iface)
Definition: msi_main.c:96

◆ MsiCF_LockServer()

static HRESULT WINAPI MsiCF_LockServer ( LPCLASSFACTORY  iface,
BOOL  dolock 
)
static

Definition at line 148 of file msi_main.c.

149{
150 TRACE("%p %d\n", iface, dolock);
151
152 if (dolock)
153 LockModule();
154 else
155 UnlockModule();
156
157 return S_OK;
158}
static void UnlockModule(void)
Definition: msi_main.c:62

◆ MsiCF_QueryInterface()

static HRESULT WINAPI MsiCF_QueryInterface ( LPCLASSFACTORY  iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 101 of file msi_main.c.

103{
105
106 TRACE("%p %s %p\n",This,debugstr_guid(riid),ppobj);
107
108 if( IsEqualCLSID( riid, &IID_IUnknown ) ||
110 {
111 IClassFactory_AddRef( iface );
112 *ppobj = iface;
113 return S_OK;
114 }
115 return E_NOINTERFACE;
116}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ MsiCF_Release()

static ULONG WINAPI MsiCF_Release ( LPCLASSFACTORY  iface)
static

Definition at line 124 of file msi_main.c.

125{
126 UnlockModule();
127 return 1;
128}

◆ UnlockModule()

static void UnlockModule ( void  )
static

Definition at line 62 of file msi_main.c.

63{
65}
#define InterlockedDecrement
Definition: armddk.h:52

Referenced by MsiCF_LockServer(), and MsiCF_Release().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msi  )

Variable Documentation

◆ dll_count

LONG dll_count
static

Definition at line 38 of file msi_main.c.

Referenced by DllCanUnloadNow(), LockModule(), and UnlockModule().

◆ gszLogFile

WCHAR* gszLogFile = NULL

Definition at line 50 of file msi_main.c.

Referenced by DllMain(), MSI_OpenPackageW(), and MsiEnableLogW().

◆ gUIContext

LPVOID gUIContext = NULL

Definition at line 48 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), MsiSetExternalUIA(), and MsiSetExternalUIW().

◆ gUIContextRecord

LPVOID gUIContextRecord = NULL

Definition at line 49 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), and MsiSetExternalUIRecord().

◆ gUIFilter

DWORD gUIFilter = 0

Definition at line 46 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), MsiSetExternalUIA(), and MsiSetExternalUIW().

◆ gUIFilterRecord

DWORD gUIFilterRecord = 0

Definition at line 47 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), and MsiSetExternalUIRecord().

◆ gUIHandlerA

INSTALLUI_HANDLERA gUIHandlerA = NULL

Definition at line 43 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), MsiSetExternalUIA(), and MsiSetExternalUIW().

◆ gUIHandlerRecord

INSTALLUI_HANDLER_RECORD gUIHandlerRecord = NULL

Definition at line 45 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), and MsiSetExternalUIRecord().

◆ gUIHandlerW

INSTALLUI_HANDLERW gUIHandlerW = NULL

Definition at line 44 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), MsiSetExternalUIA(), and MsiSetExternalUIW().

◆ gUIhwnd

HWND gUIhwnd = 0

Definition at line 42 of file msi_main.c.

Referenced by internal_ui_handler(), and MsiSetInternalUI().

◆ gUILevel

Definition at line 41 of file msi_main.c.

Referenced by MSI_CreatePackage(), and MsiSetInternalUI().

◆ msi_hInstance

◆ MsiCF_Vtbl

const IClassFactoryVtbl MsiCF_Vtbl
static
Initial value:
=
{
}
static ULONG WINAPI MsiCF_AddRef(LPCLASSFACTORY iface)
Definition: msi_main.c:118
static ULONG WINAPI MsiCF_Release(LPCLASSFACTORY iface)
Definition: msi_main.c:124
static HRESULT WINAPI MsiCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj)
Definition: msi_main.c:101
static HRESULT WINAPI MsiCF_LockServer(LPCLASSFACTORY iface, BOOL dolock)
Definition: msi_main.c:148
static HRESULT WINAPI MsiCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: msi_main.c:130

Definition at line 160 of file msi_main.c.

◆ MsiServer_CF

struct class_factory MsiServer_CF = { { &MsiCF_Vtbl }, create_msiserver }
static

Definition at line 169 of file msi_main.c.

Referenced by DllGetClassObject().