ReactOS 0.4.15-dev-8096-ga0eec98
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; \
}
#define E_NOTIMPL
Definition: ddrawi.h:99
GLdouble n
Definition: glext.h:7729
#define WINAPI
Definition: msvc.h:6

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}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

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:66
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const void * wrapper_vtbl[]
Definition: ifacewrap.c:208
#define S_OK
Definition: intsafe.h:52
IUnknown IUnknown_iface
Definition: ifacewrap.c:28
IUnknown * ref_unk
Definition: ifacewrap.c:30
IUnknown * iface
Definition: ifacewrap.c:29
int ret

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}
#define InterlockedIncrement
Definition: armddk.h:53
static iface_wrapper_t * impl_from_IUnknown(IUnknown *iface)
Definition: ifacewrap.c:34
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
Definition: send.c:48

◆ 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}
const char * debugstr_mshtml_guid(const GUID *iid)
Definition: main.c:542
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ 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);
69 }
70
71 return ref;
72}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedDecrement
Definition: armddk.h:52

Variable Documentation

◆ wrapper_vtbl

const void* wrapper_vtbl[]
static

Definition at line 208 of file ifacewrap.c.

Referenced by wrap_iface().