xmllite/tests: Use an iface instead of a vtbl pointer in testinput.
Michael Stefaniuc
mstefani at redhat.de
Tue Dec 28 19:53:57 CST 2010
---
dlls/xmllite/tests/reader.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/xmllite/tests/reader.c b/dlls/xmllite/tests/reader.c
index 316f8f7..e31895a 100644
--- a/dlls/xmllite/tests/reader.c
+++ b/dlls/xmllite/tests/reader.c
@@ -19,6 +19,7 @@
*/
#define COBJMACROS
+#define CONST_VTABLE
#include <stdarg.h>
#include <stdio.h>
@@ -258,13 +259,13 @@ static void test_read_state_(IXmlReader *reader, XmlReadState expected,
typedef struct _testinput
{
- const IUnknownVtbl *lpVtbl;
+ IUnknown IUnknown_iface;
LONG ref;
} testinput;
static inline testinput *impl_from_IUnknown(IUnknown *iface)
{
- return (testinput *)((char*)iface - FIELD_OFFSET(testinput, lpVtbl));
+ return CONTAINING_RECORD(iface, testinput, IUnknown_iface);
}
static HRESULT WINAPI testinput_QueryInterface(IUnknown *iface, REFIID riid, void** ppvObj)
@@ -317,10 +318,10 @@ static HRESULT testinput_createinstance(void **ppObj)
input = HeapAlloc(GetProcessHeap(), 0, sizeof (*input));
if(!input) return E_OUTOFMEMORY;
- input->lpVtbl = &testinput_vtbl;
+ input->IUnknown_iface.lpVtbl = &testinput_vtbl;
input->ref = 1;
- *ppObj = &input->lpVtbl;
+ *ppObj = &input->IUnknown_iface;
return S_OK;
}
--
1.7.3.4
More information about the wine-patches
mailing list