ReactOS  0.4.13-dev-259-g5ca9c9c
main.c File Reference
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "rpcproxy.h"
#include "wuapi.h"
#include "wine/debug.h"
#include "wuapi_private.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

struct  _wucf
 

Macros

#define COBJMACROS
 

Typedefs

typedef HRESULT(* fnCreateInstance) (LPVOID *ppObj)
 
typedef struct _wucf wucf
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wuapi)
 
static wucfimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI wucf_QueryInterface (IClassFactory *iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI wucf_AddRef (IClassFactory *iface)
 
static ULONG WINAPI wucf_Release (IClassFactory *iface)
 
static HRESULT WINAPI wucf_CreateInstance (IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
 
static HRESULT WINAPI wucf_LockServer (IClassFactory *iface, BOOL dolock)
 
BOOL WINAPI DllMain (HINSTANCE hinst, DWORD reason, LPVOID lpv)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

static const struct IClassFactoryVtbl wucf_vtbl
 
static wucf sessioncf = { { &wucf_vtbl }, UpdateSession_create }
 
static wucf updatescf = { { &wucf_vtbl }, AutomaticUpdates_create }
 
static wucf sysinfocf = { { &wucf_vtbl }, SystemInformation_create }
 
static HINSTANCE instance
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file main.c.

Typedef Documentation

◆ fnCreateInstance

typedef HRESULT(* fnCreateInstance) (LPVOID *ppObj)

Definition at line 38 of file main.c.

◆ wucf

typedef struct _wucf wucf

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 154 of file main.c.

155 {
156  return S_FALSE;
157 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 132 of file main.c.

133 {
134  IClassFactory *cf = NULL;
135 
136  TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
137 
138  if (IsEqualGUID( rclsid, &CLSID_UpdateSession ))
139  {
141  }
142  else if (IsEqualGUID( rclsid, &CLSID_AutomaticUpdates ))
143  {
145  }
146  else if (IsEqualGUID( rclsid, &CLSID_SystemInformation ))
147  {
149  }
150  if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
151  return IClassFactory_QueryInterface( cf, iid, ppv );
152 }
static wucf sessioncf
Definition: main.c:112
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static wucf updatescf
Definition: main.c:113
IClassFactory IClassFactory_iface
Definition: main.c:42
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static wucf sysinfocf
Definition: main.c:114

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinst,
DWORD  reason,
LPVOID  lpv 
)

Definition at line 118 of file main.c.

119 {
120  switch(reason)
121  {
122  case DLL_WINE_PREATTACH:
123  return FALSE; /* prefer native version */
124  case DLL_PROCESS_ATTACH:
125  instance = hinst;
127  break;
128  }
129  return TRUE;
130 }
#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 HINSTANCE instance
Definition: main.c:116
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
static HINSTANCE hinst
Definition: edit.c:551

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 162 of file main.c.

163 {
165 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
static HINSTANCE instance
Definition: main.c:116

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 170 of file main.c.

171 {
173 }
static HINSTANCE instance
Definition: main.c:116
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ impl_from_IClassFactory()

static wucf* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 46 of file main.c.

47 {
49 }
Definition: main.c:40
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
IClassFactory IClassFactory_iface
Definition: main.c:61

Referenced by wucf_CreateInstance().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wuapi  )

◆ wucf_AddRef()

static ULONG WINAPI wucf_AddRef ( IClassFactory iface)
static

Definition at line 64 of file main.c.

65 {
66  return 2;
67 }

◆ wucf_CreateInstance()

static HRESULT WINAPI wucf_CreateInstance ( IClassFactory iface,
LPUNKNOWN  pOuter,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 74 of file main.c.

76 {
77  wucf *This = impl_from_IClassFactory( iface );
78  HRESULT r;
79  IUnknown *punk;
80 
81  TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj);
82 
83  *ppobj = NULL;
84 
85  if (pOuter)
86  return CLASS_E_NOAGGREGATION;
87 
88  r = This->pfnCreateInstance( (LPVOID *)&punk );
89  if (FAILED(r))
90  return r;
91 
92  r = IUnknown_QueryInterface( punk, riid, ppobj );
93  IUnknown_Release( punk );
94  return r;
95 }
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static wucf * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:46
Definition: main.c:40
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
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ wucf_LockServer()

static HRESULT WINAPI wucf_LockServer ( IClassFactory iface,
BOOL  dolock 
)
static

Definition at line 97 of file main.c.

98 {
99  FIXME("(%p)->(%d)\n", iface, dolock);
100  return S_OK;
101 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59

◆ wucf_QueryInterface()

static HRESULT WINAPI wucf_QueryInterface ( IClassFactory iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 51 of file main.c.

52 {
53  if (IsEqualGUID(riid, &IID_IUnknown) ||
55  {
56  IClassFactory_AddRef( iface );
57  *ppobj = iface;
58  return S_OK;
59  }
60  FIXME("interface %s not implemented\n", debugstr_guid(riid));
61  return E_NOINTERFACE;
62 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
const GUID IID_IClassFactory

◆ wucf_Release()

static ULONG WINAPI wucf_Release ( IClassFactory iface)
static

Definition at line 69 of file main.c.

70 {
71  return 1;
72 }

Variable Documentation

◆ instance

HINSTANCE instance
static

Definition at line 116 of file main.c.

Referenced by DllMain(), DllRegisterServer(), and DllUnregisterServer().

◆ sessioncf

wucf sessioncf = { { &wucf_vtbl }, UpdateSession_create }
static

Definition at line 112 of file main.c.

Referenced by DllGetClassObject().

◆ sysinfocf

wucf sysinfocf = { { &wucf_vtbl }, SystemInformation_create }
static

Definition at line 114 of file main.c.

Referenced by DllGetClassObject().

◆ updatescf

wucf updatescf = { { &wucf_vtbl }, AutomaticUpdates_create }
static

Definition at line 113 of file main.c.

Referenced by DllGetClassObject().

◆ wucf_vtbl

const struct IClassFactoryVtbl wucf_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI wucf_AddRef(IClassFactory *iface)
Definition: main.c:64
static HRESULT WINAPI wucf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: main.c:74
static HRESULT WINAPI wucf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: main.c:51
static HRESULT WINAPI wucf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:97
static ULONG WINAPI wucf_Release(IClassFactory *iface)
Definition: main.c:69

Definition at line 103 of file main.c.