ReactOS 0.4.15-dev-8096-ga0eec98
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  tagIClassFactoryImpl
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct tagIClassFactoryImpl IClassFactoryImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
static void LockModule (void)
 
static void UnlockModule (void)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
static IClassFactoryImplimpl_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 IClassFactoryImpl MsiServer_CF = { { &MsiCF_Vtbl }, create_msiserver }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file msi_main.c.

Typedef Documentation

◆ IClassFactoryImpl

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 215 of file msi_main.c.

216{
217 return dll_count == 0 ? S_OK : S_FALSE;
218}
#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 173 of file msi_main.c.

174{
175 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
176
177 if ( IsEqualCLSID (rclsid, &CLSID_MsiInstaller) )
178 {
179 *ppv = &MsiServer_CF;
180 return S_OK;
181 }
182
183 if( IsEqualCLSID (rclsid, &CLSID_MsiServerMessage) ||
184 IsEqualCLSID (rclsid, &CLSID_MsiServer) ||
185 IsEqualCLSID (rclsid, &CLSID_PSFactoryBuffer) ||
186 IsEqualCLSID (rclsid, &CLSID_MsiServerX3) )
187 {
188 FIXME("create %s object\n", debugstr_guid( rclsid ));
189 }
190
192}
#define FIXME(fmt,...)
Definition: debug.h:114
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
static IClassFactoryImpl MsiServer_CF
Definition: msi_main.c:168
#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 197 of file msi_main.c.

198{
199 TRACE("%p\n",pdvi);
200
201 if (pdvi->cbSize < sizeof(DLLVERSIONINFO))
202 return E_INVALIDARG;
203
208
209 return S_OK;
210}
#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:1961
DWORD dwMajorVersion
Definition: shlwapi.h:1955
DWORD dwBuildNumber
Definition: shlwapi.h:1957
DWORD dwMinorVersion
Definition: shlwapi.h:1956
DWORD dwPlatformID
Definition: shlwapi.h:1958

◆ 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 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:4184
void msi_free_handle_table(void)
Definition: handle.c:71
BOOL is_wow64
Definition: msi.c:54
static IN DWORD IN LPVOID lpvReserved
HINSTANCE msi_hInstance
Definition: msi_main.c:51
WCHAR * gszLogFile
Definition: msi_main.c:50
static void msi_free(void *mem)
Definition: msipriv.h:1159

◆ impl_from_IClassFactory()

static IClassFactoryImpl * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 95 of file msi_main.c.

96{
97 return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
98}
#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 117 of file msi_main.c.

118{
119 LockModule();
120 return 2;
121}
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 129 of file msi_main.c.

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

◆ MsiCF_LockServer()

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

Definition at line 147 of file msi_main.c.

148{
149 TRACE("%p %d\n", iface, dolock);
150
151 if (dolock)
152 LockModule();
153 else
154 UnlockModule();
155
156 return S_OK;
157}
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 100 of file msi_main.c.

102{
104
105 TRACE("%p %s %p\n",This,debugstr_guid(riid),ppobj);
106
107 if( IsEqualCLSID( riid, &IID_IUnknown ) ||
109 {
110 IClassFactory_AddRef( iface );
111 *ppobj = iface;
112 return S_OK;
113 }
114 return E_NOINTERFACE;
115}
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 123 of file msi_main.c.

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

◆ 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:117
static ULONG WINAPI MsiCF_Release(LPCLASSFACTORY iface)
Definition: msi_main.c:123
static HRESULT WINAPI MsiCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj)
Definition: msi_main.c:100
static HRESULT WINAPI MsiCF_LockServer(LPCLASSFACTORY iface, BOOL dolock)
Definition: msi_main.c:147
static HRESULT WINAPI MsiCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: msi_main.c:129

Definition at line 159 of file msi_main.c.

◆ MsiServer_CF

IClassFactoryImpl MsiServer_CF = { { &MsiCF_Vtbl }, create_msiserver }
static

Definition at line 168 of file msi_main.c.

Referenced by DllGetClassObject().