ReactOS  0.4.15-dev-1187-g119f102
main.c File Reference
#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 37 of file main.c.

◆ wucf

typedef struct _wucf wucf

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 153 of file main.c.

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

◆ DllGetClassObject()

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

Definition at line 131 of file main.c.

132 {
133  IClassFactory *cf = NULL;
134 
135  TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
136 
137  if (IsEqualGUID( rclsid, &CLSID_UpdateSession ))
138  {
140  }
141  else if (IsEqualGUID( rclsid, &CLSID_AutomaticUpdates ))
142  {
144  }
145  else if (IsEqualGUID( rclsid, &CLSID_SystemInformation ))
146  {
148  }
149  if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
150  return IClassFactory_QueryInterface( cf, iid, ppv );
151 }
static wucf sessioncf
Definition: main.c:111
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:112
IClassFactory IClassFactory_iface
Definition: main.c:41
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static wucf sysinfocf
Definition: main.c:113

◆ DllMain()

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

Definition at line 117 of file main.c.

118 {
119  switch(reason)
120  {
121  case DLL_WINE_PREATTACH:
122  return FALSE; /* prefer native version */
123  case DLL_PROCESS_ATTACH:
124  instance = hinst;
126  break;
127  }
128  return TRUE;
129 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
static HINSTANCE instance
Definition: main.c:115
#define FALSE
Definition: types.h:117
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 161 of file main.c.

162 {
164 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
static HINSTANCE instance
Definition: main.c:115

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 169 of file main.c.

170 {
172 }
static HINSTANCE instance
Definition: main.c:115
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 45 of file main.c.

46 {
48 }
Definition: main.c:39
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:62

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 63 of file main.c.

64 {
65  return 2;
66 }

◆ wucf_CreateInstance()

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

Definition at line 73 of file main.c.

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

◆ wucf_LockServer()

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

Definition at line 96 of file main.c.

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

◆ wucf_QueryInterface()

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

Definition at line 50 of file main.c.

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

◆ wucf_Release()

static ULONG WINAPI wucf_Release ( IClassFactory iface)
static

Definition at line 68 of file main.c.

69 {
70  return 1;
71 }

Variable Documentation

◆ instance

HINSTANCE instance
static

Definition at line 115 of file main.c.

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

◆ sessioncf

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

Definition at line 111 of file main.c.

Referenced by DllGetClassObject().

◆ sysinfocf

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

Definition at line 113 of file main.c.

Referenced by DllGetClassObject().

◆ updatescf

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

Definition at line 112 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:63
static HRESULT WINAPI wucf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: main.c:73
static HRESULT WINAPI wucf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: main.c:50
static HRESULT WINAPI wucf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:96
static ULONG WINAPI wucf_Release(IClassFactory *iface)
Definition: main.c:68

Definition at line 102 of file main.c.