Skip to content

Commit

Permalink
compobj: Manually define the IMalloc16 structure.
Browse files Browse the repository at this point in the history
For clarity.

Signed-off-by: Zebediah Figura <[email protected]>
Signed-off-by: Alexandre Julliard <[email protected]>
  • Loading branch information
zfigura authored and julliard committed Jan 21, 2020
1 parent da81680 commit 4f7ebaf
Showing 1 changed file with 17 additions and 26 deletions.
43 changes: 17 additions & 26 deletions dlls/compobj.dll16/compobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole);
typedef LPSTR LPOLESTR16;
typedef LPCSTR LPCOLESTR16;

#define STDMETHOD16CALLTYPE __cdecl
#define STDMETHOD16(m) HRESULT (STDMETHOD16CALLTYPE *m)
#define STDMETHOD16_(t,m) t (STDMETHOD16CALLTYPE *m)

#define CHARS_IN_GUID 39

/***********************************************************************
* IMalloc16 interface
*/

typedef struct IMalloc16 *LPMALLOC16;
typedef struct
{
SEGPTR QueryInterface;
SEGPTR AddRef;
SEGPTR Release;
SEGPTR Alloc;
SEGPTR Realloc;
SEGPTR Free;
SEGPTR GetSize;
SEGPTR DidAlloc;
SEGPTR HeapMinimize;
} IMalloc16Vtbl;

#define INTERFACE IMalloc16
DECLARE_INTERFACE_(IMalloc16,IUnknown)
typedef struct
{
/*** IUnknown methods ***/
STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD16_(ULONG,AddRef)(THIS) PURE;
STDMETHOD16_(ULONG,Release)(THIS) PURE;
/*** IMalloc16 methods ***/
STDMETHOD16_(LPVOID,Alloc)(THIS_ DWORD cb) PURE;
STDMETHOD16_(LPVOID,Realloc)(THIS_ LPVOID pv, DWORD cb) PURE;
STDMETHOD16_(void,Free)(THIS_ LPVOID pv) PURE;
STDMETHOD16_(DWORD,GetSize)(THIS_ LPVOID pv) PURE;
STDMETHOD16_(INT16,DidAlloc)(THIS_ LPVOID pv) PURE;
STDMETHOD16_(LPVOID,HeapMinimize)(THIS) PURE;
};
#undef INTERFACE
SEGPTR lpVtbl;
} IMalloc16, *LPMALLOC16;

static HTASK16 hETask = 0;
static WORD Table_ETask[62];
Expand Down Expand Up @@ -220,7 +211,7 @@ IMalloc16_Constructor(void)
This = HeapAlloc( GetProcessHeap(), 0, sizeof(IMalloc16Impl) );
if (!msegvt16)
{
#define VTENT(x) vt16.x = (void*)GetProcAddress16(hcomp,"IMalloc16_"#x);assert(vt16.x)
#define VTENT(x) vt16.x = (SEGPTR)GetProcAddress16(hcomp,"IMalloc16_"#x);assert(vt16.x)
VTENT(QueryInterface);
VTENT(AddRef);
VTENT(Release);
Expand All @@ -233,7 +224,7 @@ IMalloc16_Constructor(void)
#undef VTENT
msegvt16 = MapLS( &vt16 );
}
This->IMalloc16_iface.lpVtbl = (const IMalloc16Vtbl*)msegvt16;
This->IMalloc16_iface.lpVtbl = msegvt16;
This->ref = 1;
return (LPMALLOC16)MapLS( This );
}
Expand Down

0 comments on commit 4f7ebaf

Please sign in to comment.