ReactOS  0.4.15-dev-499-g1f31905
ifacewrap.c File Reference
#include "mshtml_private.h"
#include <wine/asm.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:78
#define WINAPI
Definition: msvc.h:6
#define E_NOTIMPL
Definition: ddrawi.h:99

Definition at line 100 of file ifacewrap.c.

Function Documentation

◆ impl_from_IUnknown()

static iface_wrapper_t* impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 34 of file ifacewrap.c.

35 {
36  return CONTAINING_RECORD(iface, iface_wrapper_t, IUnknown_iface);
37 }
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 311 of file ifacewrap.c.

312 {
313  iface_wrapper_t *wrapper;
314 
315  wrapper = heap_alloc(sizeof(*wrapper));
316  if(!wrapper)
317  return E_OUTOFMEMORY;
318 
319  wrapper->IUnknown_iface.lpVtbl = (const IUnknownVtbl*)wrapper_vtbl;
320  wrapper->ref = 1;
321 
322  IUnknown_AddRef(iface);
323  wrapper->iface = iface;
324 
325  IUnknown_AddRef(ref_unk);
326  wrapper->ref_unk = ref_unk;
327 
328  *ret = &wrapper->IUnknown_iface;
329  return S_OK;
330 }
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:30
IUnknown IUnknown_iface
Definition: ifacewrap.c:28
static const void * wrapper_vtbl[]
Definition: ifacewrap.c:208
IUnknown * iface
Definition: ifacewrap.c:29

Referenced by HTMLObjectElement_QI().

◆ wrapper_AddRef()

static HRESULT WINAPI wrapper_AddRef ( IUnknown iface)
static

Definition at line 48 of file ifacewrap.c.

49 {
52 
53  TRACE("(%p) ref=%d\n", This, ref);
54 
55  return ref;
56 }
static iface_wrapper_t * impl_from_IUnknown(IUnknown *iface)
Definition: ifacewrap.c:34
Definition: send.c:48
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 39 of file ifacewrap.c.

40 {
42 
43  TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
44 
45  return IUnknown_QueryInterface(This->ref_unk, riid, ppv);
46 }
static iface_wrapper_t * impl_from_IUnknown(IUnknown *iface)
Definition: ifacewrap.c:34
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 58 of file ifacewrap.c.

59 {
62 
63  TRACE("(%p) ref=%d\n", This, ref);
64 
65  if(!ref) {
66  IUnknown_Release(This->iface);
67  IUnknown_Release(This->ref_unk);
68  heap_free(This);
69  }
70 
71  return ref;
72 }
static iface_wrapper_t * impl_from_IUnknown(IUnknown *iface)
Definition: ifacewrap.c:34
Definition: send.c:48
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 208 of file ifacewrap.c.

Referenced by wrap_iface().