ReactOS  0.4.13-dev-79-gcd489d8
dxdiag_main.c File Reference
#include "config.h"
#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 134 of file dxdiag_main.c.

135 {
136  return DXDIAGN_refCount != 0 ? S_FALSE : S_OK;
137 }
LONG DXDIAGN_refCount
Definition: dxdiag_main.c:41
#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 142 of file dxdiag_main.c.

143 {
144  TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
145 
146  if (IsEqualGUID(rclsid, &CLSID_DxDiagProvider)) {
147  IClassFactory_AddRef(&DXDiag_CF.IClassFactory_iface);
149  return S_OK;
150  }
151 
152  FIXME("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
154 }
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:129
#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:4021

◆ DllMain()

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

Definition at line 44 of file dxdiag_main.c.

45 {
46  TRACE("%p,%x,%p\n", hInstDLL, fdwReason, lpvReserved);
47  if (fdwReason == DLL_PROCESS_ATTACH) {
48  dxdiagn_instance = hInstDLL;
49  DisableThreadLibraryCalls(hInstDLL);
50  }
51  return TRUE;
52 }
#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:39

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 159 of file dxdiag_main.c.

160 {
162 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
HINSTANCE dxdiagn_instance
Definition: dxdiag_main.c:39

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 167 of file dxdiag_main.c.

168 {
170 }
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110
HINSTANCE dxdiagn_instance
Definition: dxdiag_main.c:39

◆ DXDiagCF_AddRef()

static ULONG WINAPI DXDiagCF_AddRef ( IClassFactory iface)
static

Definition at line 87 of file dxdiag_main.c.

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

◆ DXDiagCF_CreateInstance()

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

Definition at line 101 of file dxdiag_main.c.

103 {
104  TRACE("(%p)->(%p,%s,%p)\n", iface, pOuter, debugstr_guid(riid), ppv);
105 
106  return DXDiag_CreateDXDiagProvider(iface, pOuter, riid, ppv);
107 }
HRESULT DXDiag_CreateDXDiagProvider(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN
Definition: provider.c:216
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 109 of file dxdiag_main.c.

110 {
111  TRACE("(%d)\n", dolock);
112 
113  if (dolock)
115  else
117 
118  return S_OK;
119 }
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 61 of file dxdiag_main.c.

62 {
63  if (ppv == NULL)
64  return E_POINTER;
65 
67  TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
69  TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
70  else if (IsEqualGUID(&IID_IExternalConnection, riid) ||
71  IsEqualGUID(&IID_IMarshal, riid)) {
72  TRACE("(%p)->(%s) ignoring\n", iface, debugstr_guid(riid));
73  *ppv = NULL;
74  return E_NOINTERFACE;
75  }
76  else {
77  FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
78  *ppv = NULL;
79  return E_NOINTERFACE;
80  }
81 
82  *ppv = iface;
83  IClassFactory_AddRef(iface);
84  return S_OK;
85 }
#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:4021
#define E_POINTER
Definition: winerror.h:2365
const GUID IID_IClassFactory

◆ DXDiagCF_Release()

static ULONG WINAPI DXDiagCF_Release ( IClassFactory iface)
static

Definition at line 94 of file dxdiag_main.c.

95 {
97 
98  return 1; /* non-heap based object */
99 }
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 129 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:94
static HRESULT WINAPI DXDiagCF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
Definition: dxdiag_main.c:101
static HRESULT WINAPI DXDiagCF_LockServer(IClassFactory *iface, BOOL dolock)
Definition: dxdiag_main.c:109
static HRESULT WINAPI DXDiagCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: dxdiag_main.c:61
static ULONG WINAPI DXDiagCF_AddRef(IClassFactory *iface)
Definition: dxdiag_main.c:87

Definition at line 121 of file dxdiag_main.c.

◆ dxdiagn_instance

◆ DXDIAGN_refCount

LONG DXDIAGN_refCount = 0

Definition at line 41 of file dxdiag_main.c.

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