ReactOS  0.4.14-dev-608-gd495a4f
dxdiag_main.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "oleauto.h"
#include "oleidl.h"
#include "rpcproxy.h"
#include "initguid.h"
#include "dxdiag_private.h"
#include "wine/debug.h"
Include dependency graph for dxdiag_main.c:

Go to the source code of this file.

Classes

struct  IClassFactoryImpl
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (dxdiag)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
static HRESULT WINAPI DXDiagCF_QueryInterface (IClassFactory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI DXDiagCF_AddRef (IClassFactory *iface)
 
static ULONG WINAPI DXDiagCF_Release (IClassFactory *iface)
 
static HRESULT WINAPI DXDiagCF_CreateInstance (IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
 
static HRESULT WINAPI DXDiagCF_LockServer (IClassFactory *iface, BOOL dolock)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

HINSTANCE dxdiagn_instance = 0
 
LONG DXDIAGN_refCount = 0
 
static const IClassFactoryVtbl DXDiagCF_Vtbl
 
static IClassFactoryImpl DXDiag_CF = { { &DXDiagCF_Vtbl } }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file dxdiag_main.c.

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 133 of file dxdiag_main.c.

134 {
135  return DXDIAGN_refCount != 0 ? S_FALSE : S_OK;
136 }
LONG DXDIAGN_refCount
Definition: dxdiag_main.c:40
#define S_FALSE
Definition: winerror.h:2357
#define S_OK
Definition: intsafe.h:59

◆ DllGetClassObject()

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

Definition at line 141 of file dxdiag_main.c.

142 {
143  TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
144 
145  if (IsEqualGUID(rclsid, &CLSID_DxDiagProvider)) {
146  IClassFactory_AddRef(&DXDiag_CF.IClassFactory_iface);
148  return S_OK;
149  }
150 
151  FIXME("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
153 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
static IClassFactoryImpl DXDiag_CF
Definition: dxdiag_main.c:128
#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
IClassFactory IClassFactory_iface
Definition: main.c:58
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ DllMain()

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

Definition at line 43 of file dxdiag_main.c.

44 {
45  TRACE("%p,%x,%p\n", hInstDLL, fdwReason, lpvReserved);
46  if (fdwReason == DLL_PROCESS_ATTACH) {
47  dxdiagn_instance = hInstDLL;
48  DisableThreadLibraryCalls(hInstDLL);
49  }
50  return TRUE;
51 }
#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
#define TRACE(s)
Definition: solgame.cpp:4
HINSTANCE dxdiagn_instance
Definition: dxdiag_main.c:38

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 158 of file dxdiag_main.c.

159 {
161 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
HINSTANCE dxdiagn_instance
Definition: dxdiag_main.c:38

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 166 of file dxdiag_main.c.

167 {
169 }
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110
HINSTANCE dxdiagn_instance
Definition: dxdiag_main.c:38

◆ DXDiagCF_AddRef()

static ULONG WINAPI DXDiagCF_AddRef ( IClassFactory iface)
static

Definition at line 86 of file dxdiag_main.c.

87 {
89 
90  return 2; /* non-heap based object */
91 }
static void DXDIAGN_LockModule(void)

◆ DXDiagCF_CreateInstance()

static HRESULT WINAPI DXDiagCF_CreateInstance ( IClassFactory iface,
IUnknown pOuter,
REFIID  riid,
void **  ppv 
)
static

Definition at line 100 of file dxdiag_main.c.

102 {
103  TRACE("(%p)->(%p,%s,%p)\n", iface, pOuter, debugstr_guid(riid), ppv);
104 
105  return DXDiag_CreateDXDiagProvider(iface, pOuter, riid, ppv);
106 }
HRESULT DXDiag_CreateDXDiagProvider(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN
Definition: provider.c:219
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4

◆ DXDiagCF_LockServer()

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

Definition at line 108 of file dxdiag_main.c.

109 {
110  TRACE("(%d)\n", dolock);
111 
112  if (dolock)
114  else
116 
117  return S_OK;
118 }
static void DXDIAGN_UnlockModule(void)
static void DXDIAGN_LockModule(void)
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ DXDiagCF_QueryInterface()

static HRESULT WINAPI DXDiagCF_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 60 of file dxdiag_main.c.

61 {
62  if (ppv == NULL)
63  return E_POINTER;
64 
66  TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
68  TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
69  else if (IsEqualGUID(&IID_IExternalConnection, riid) ||
70  IsEqualGUID(&IID_IMarshal, riid)) {
71  TRACE("(%p)->(%s) ignoring\n", iface, debugstr_guid(riid));
72  *ppv = NULL;
73  return E_NOINTERFACE;
74  }
75  else {
76  FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
77  *ppv = NULL;
78  return E_NOINTERFACE;
79  }
80 
81  *ppv = iface;
82  IClassFactory_AddRef(iface);
83  return S_OK;
84 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define E_POINTER
Definition: winerror.h:2365
const GUID IID_IClassFactory

◆ DXDiagCF_Release()

static ULONG WINAPI DXDiagCF_Release ( IClassFactory iface)
static

Definition at line 93 of file dxdiag_main.c.

94 {
96 
97  return 1; /* non-heap based object */
98 }
static void DXDIAGN_UnlockModule(void)

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( dxdiag  )

Variable Documentation

◆ DXDiag_CF

IClassFactoryImpl DXDiag_CF = { { &DXDiagCF_Vtbl } }
static

Definition at line 128 of file dxdiag_main.c.

Referenced by DllGetClassObject().

◆ DXDiagCF_Vtbl

const IClassFactoryVtbl DXDiagCF_Vtbl
static
Initial value:
= {
}
static ULONG WINAPI DXDiagCF_Release(IClassFactory *iface)
Definition: dxdiag_main.c:93
static HRESULT WINAPI DXDiagCF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
Definition: dxdiag_main.c:100
static HRESULT WINAPI DXDiagCF_LockServer(IClassFactory *iface, BOOL dolock)
Definition: dxdiag_main.c:108
static HRESULT WINAPI DXDiagCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: dxdiag_main.c:60
static ULONG WINAPI DXDiagCF_AddRef(IClassFactory *iface)
Definition: dxdiag_main.c:86

Definition at line 120 of file dxdiag_main.c.

◆ dxdiagn_instance

◆ DXDIAGN_refCount

LONG DXDIAGN_refCount = 0

Definition at line 40 of file dxdiag_main.c.

Referenced by DllCanUnloadNow(), DXDIAGN_LockModule(), and DXDIAGN_UnlockModule().