ReactOS  0.4.14-dev-614-gbfd8a84
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)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (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 }
 
static IClassFactoryImpl WineMsiCustomRemote_CF = { { &MsiCF_Vtbl }, create_msi_custom_remote }
 
static IClassFactoryImpl WineMsiRemotePackage_CF = { { &MsiCF_Vtbl }, create_msi_remote_package }
 

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 229 of file msi_main.c.

230 {
231  return dll_count == 0 ? S_OK : S_FALSE;
232 }
#define S_FALSE
Definition: winerror.h:2357
#define S_OK
Definition: intsafe.h:59
static LONG dll_count
Definition: msi_main.c:38

◆ DllGetClassObject()

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

Definition at line 175 of file msi_main.c.

176 {
177  TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
178 
179  if ( IsEqualCLSID (rclsid, &CLSID_MsiInstaller) )
180  {
181  *ppv = &MsiServer_CF;
182  return S_OK;
183  }
184 
185  if ( IsEqualCLSID (rclsid, &CLSID_WineMsiRemoteCustomAction) )
186  {
188  return S_OK;
189  }
190 
191  if ( IsEqualCLSID (rclsid, &CLSID_WineMsiRemotePackage) )
192  {
194  return S_OK;
195  }
196 
197  if( IsEqualCLSID (rclsid, &CLSID_MsiServerMessage) ||
198  IsEqualCLSID (rclsid, &CLSID_MsiServer) ||
199  IsEqualCLSID (rclsid, &CLSID_PSFactoryBuffer) ||
200  IsEqualCLSID (rclsid, &CLSID_MsiServerX3) )
201  {
202  FIXME("create %s object\n", debugstr_guid( rclsid ));
203  }
204 
206 }
static IClassFactoryImpl MsiServer_CF
Definition: msi_main.c:168
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IClassFactoryImpl WineMsiRemotePackage_CF
Definition: msi_main.c:170
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
static IClassFactoryImpl WineMsiCustomRemote_CF
Definition: msi_main.c:169

◆ DllGetVersion()

HRESULT WINAPI DllGetVersion ( DLLVERSIONINFO pdvi)

Definition at line 211 of file msi_main.c.

212 {
213  TRACE("%p\n",pdvi);
214 
215  if (pdvi->cbSize < sizeof(DLLVERSIONINFO))
216  return E_INVALIDARG;
217 
222 
223  return S_OK;
224 }
DWORD dwMinorVersion
Definition: shlwapi.h:1956
#define MSI_BUILDNUMBER
Definition: msipriv.h:708
DWORD dwBuildNumber
Definition: shlwapi.h:1957
#define E_INVALIDARG
Definition: ddrawi.h:101
DWORD dwMajorVersion
Definition: shlwapi.h:1955
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwPlatformID
Definition: shlwapi.h:1958
#define MSI_MAJORVERSION
Definition: msipriv.h:706
#define S_OK
Definition: intsafe.h:59
#define MSI_MINORVERSION
Definition: msipriv.h:707
#define DLLVER_PLATFORM_WINDOWS
Definition: shlwapi.h:1961

◆ DllMain()

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

Definition at line 70 of file msi_main.c.

71 {
72  switch (fdwReason)
73  {
74  case DLL_PROCESS_ATTACH:
75  msi_hInstance = hinstDLL;
76  DisableThreadLibraryCalls(hinstDLL);
78  break;
79  case DLL_PROCESS_DETACH:
80  if (lpvReserved) break;
85  break;
86  }
87  return TRUE;
88 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
static IN DWORD IN LPVOID lpvReserved
void msi_free_handle_table(void)
Definition: handle.c:69
#define DLL_PROCESS_DETACH
Definition: compat.h:119
void msi_dialog_unregister_class(void)
Definition: dialog.c:4091
BOOL WINAPI IsWow64Process(IN HANDLE hProcess, OUT PBOOL Wow64Process)
Definition: proc.c:1974
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
static BOOL is_wow64
Definition: loader.c:55
HINSTANCE msi_hInstance
Definition: msi_main.c:51
WCHAR * gszLogFile
Definition: msi_main.c:50
void release_typelib(void)
Definition: apps.c:159
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 237 of file msi_main.c.

238 {
240 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
HINSTANCE msi_hInstance
Definition: msi_main.c:51

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 245 of file msi_main.c.

246 {
248 }
HINSTANCE msi_hInstance
Definition: msi_main.c:51
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ 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 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

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
static LONG dll_count
Definition: msi_main.c:38

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 }
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: msi_main.c:95
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ 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
#define TRACE(s)
Definition: solgame.cpp:4
static void LockModule(void)
Definition: msi_main.c:57
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: msi_main.c:95
#define S_OK
Definition: intsafe.h:59
const GUID IID_IClassFactory
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96

◆ 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 }
static void UnlockModule(void)
Definition: msi_main.c:62

◆ UnlockModule()

static void UnlockModule ( void  )
static

Definition at line 62 of file msi_main.c.

63 {
65 }
#define InterlockedDecrement
Definition: armddk.h:52
static LONG dll_count
Definition: msi_main.c:38

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 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
static ULONG WINAPI MsiCF_Release(LPCLASSFACTORY iface)
Definition: msi_main.c:123

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().

◆ WineMsiCustomRemote_CF

IClassFactoryImpl WineMsiCustomRemote_CF = { { &MsiCF_Vtbl }, create_msi_custom_remote }
static

Definition at line 169 of file msi_main.c.

Referenced by DllGetClassObject().

◆ WineMsiRemotePackage_CF

IClassFactoryImpl WineMsiRemotePackage_CF = { { &MsiCF_Vtbl }, create_msi_remote_package }
static

Definition at line 170 of file msi_main.c.

Referenced by DllGetClassObject().