ReactOS  0.4.14-dev-55-g2da92ac
ifacewrap.c File Reference
#include "mshtml_private.h"
Include dependency graph for ifacewrap.c:

Go to the source code of this file.

Classes

struct  iface_wrapper_t
 

Macros

#define DEFINE_WRAPPER_FUNC(n, x, off)
 

Functions

static iface_wrapper_timpl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI wrapper_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static HRESULT WINAPI wrapper_AddRef (IUnknown *iface)
 
static HRESULT WINAPI wrapper_Release (IUnknown *iface)
 
HRESULT wrap_iface (IUnknown *iface, IUnknown *ref_unk, IUnknown **ret)
 

Variables

static const voidwrapper_vtbl []
 

Macro Definition Documentation

◆ DEFINE_WRAPPER_FUNC

#define DEFINE_WRAPPER_FUNC (   n,
  x,
  off 
)
Value:
static HRESULT WINAPI wrapper_func_##n(IUnknown *iface) { \
ERR("Not implemented for this architecture\n"); \
return E_NOTIMPL; \
}
GLdouble n
Definition: glext.h:7729
LONG HRESULT
Definition: typedefs.h:77
#define WINAPI
Definition: msvc.h:8
#define E_NOTIMPL
Definition: ddrawi.h:99

Definition at line 99 of file ifacewrap.c.

Function Documentation

◆ impl_from_IUnknown()

static iface_wrapper_t* impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 33 of file ifacewrap.c.

34 {
35  return CONTAINING_RECORD(iface, iface_wrapper_t, IUnknown_iface);
36 }
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 wrapper_AddRef(), wrapper_QueryInterface(), and wrapper_Release().

◆ wrap_iface()

HRESULT wrap_iface ( IUnknown iface,
IUnknown ref_unk,
IUnknown **  ret 
)

Definition at line 310 of file ifacewrap.c.

311 {
312  iface_wrapper_t *wrapper;
313 
314  wrapper = heap_alloc(sizeof(*wrapper));
315  if(!wrapper)
316  return E_OUTOFMEMORY;
317 
318  wrapper->IUnknown_iface.lpVtbl = (const IUnknownVtbl*)wrapper_vtbl;
319  wrapper->ref = 1;
320 
321  IUnknown_AddRef(iface);
322  wrapper->iface = iface;
323 
324  IUnknown_AddRef(ref_unk);
325  wrapper->ref_unk = ref_unk;
326 
327  *ret = &wrapper->IUnknown_iface;
328  return S_OK;
329 }
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
int ret
#define S_OK
Definition: intsafe.h:59
IUnknown * ref_unk
Definition: ifacewrap.c:29
IUnknown IUnknown_iface
Definition: ifacewrap.c:27
static const void * wrapper_vtbl[]
Definition: ifacewrap.c:207
IUnknown * iface
Definition: ifacewrap.c:28

Referenced by HTMLObjectElement_QI().

◆ wrapper_AddRef()

static HRESULT WINAPI wrapper_AddRef ( IUnknown iface)
static

Definition at line 47 of file ifacewrap.c.

48 {
51 
52  TRACE("(%p) ref=%d\n", This, ref);
53 
54  return ref;
55 }
static iface_wrapper_t * impl_from_IUnknown(IUnknown *iface)
Definition: ifacewrap.c:33
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53

◆ wrapper_QueryInterface()

static HRESULT WINAPI wrapper_QueryInterface ( IUnknown iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 38 of file ifacewrap.c.

39 {
41 
42  TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
43 
44  return IUnknown_QueryInterface(This->ref_unk, riid, ppv);
45 }
static iface_wrapper_t * impl_from_IUnknown(IUnknown *iface)
Definition: ifacewrap.c:33
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * debugstr_mshtml_guid(const GUID *iid)
Definition: main.c:535
#define TRACE(s)
Definition: solgame.cpp:4

◆ wrapper_Release()

static HRESULT WINAPI wrapper_Release ( IUnknown iface)
static

Definition at line 57 of file ifacewrap.c.

58 {
61 
62  TRACE("(%p) ref=%d\n", This, ref);
63 
64  if(!ref) {
65  IUnknown_Release(This->iface);
66  IUnknown_Release(This->ref_unk);
67  heap_free(This);
68  }
69 
70  return ref;
71 }
static iface_wrapper_t * impl_from_IUnknown(IUnknown *iface)
Definition: ifacewrap.c:33
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Variable Documentation

◆ wrapper_vtbl

const void* wrapper_vtbl[]
static

Definition at line 207 of file ifacewrap.c.

Referenced by wrap_iface().