Commit fd6ba85f authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

oleaut32: Use an iface instead of a vtbl pointer in IRecordInfoImpl.

parent f3810015
......@@ -41,7 +41,7 @@ typedef struct {
} fieldstr;
typedef struct {
const IRecordInfoVtbl *lpVtbl;
IRecordInfo IRecordInfo_iface;
LONG ref;
GUID guid;
......@@ -53,6 +53,11 @@ typedef struct {
ITypeInfo *pTypeInfo;
} IRecordInfoImpl;
static inline IRecordInfoImpl *impl_from_IRecordInfo(IRecordInfo *iface)
{
return CONTAINING_RECORD(iface, IRecordInfoImpl, IRecordInfo_iface);
}
static HRESULT copy_to_variant(void *src, VARIANT *pvar, enum VARENUM vt)
{
TRACE("%p %p %d\n", src, pvar, vt);
......@@ -155,7 +160,7 @@ static HRESULT WINAPI IRecordInfoImpl_QueryInterface(IRecordInfo *iface, REFIID
static ULONG WINAPI IRecordInfoImpl_AddRef(IRecordInfo *iface)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) -> %d\n", This, ref);
return ref;
......@@ -163,7 +168,7 @@ static ULONG WINAPI IRecordInfoImpl_AddRef(IRecordInfo *iface)
static ULONG WINAPI IRecordInfoImpl_Release(IRecordInfo *iface)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) -> %d\n", This, ref);
......@@ -182,7 +187,7 @@ static ULONG WINAPI IRecordInfoImpl_Release(IRecordInfo *iface)
static HRESULT WINAPI IRecordInfoImpl_RecordInit(IRecordInfo *iface, PVOID pvNew)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
TRACE("(%p)->(%p)\n", This, pvNew);
if(!pvNew)
......@@ -194,7 +199,7 @@ static HRESULT WINAPI IRecordInfoImpl_RecordInit(IRecordInfo *iface, PVOID pvNew
static HRESULT WINAPI IRecordInfoImpl_RecordClear(IRecordInfo *iface, PVOID pvExisting)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
int i;
PVOID var;
......@@ -251,7 +256,7 @@ static HRESULT WINAPI IRecordInfoImpl_RecordClear(IRecordInfo *iface, PVOID pvEx
static HRESULT WINAPI IRecordInfoImpl_RecordCopy(IRecordInfo *iface, PVOID pvExisting,
PVOID pvNew)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
TRACE("(%p)->(%p %p)\n", This, pvExisting, pvNew);
......@@ -264,7 +269,7 @@ static HRESULT WINAPI IRecordInfoImpl_RecordCopy(IRecordInfo *iface, PVOID pvExi
static HRESULT WINAPI IRecordInfoImpl_GetGuid(IRecordInfo *iface, GUID *pguid)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
TRACE("(%p)->(%p)\n", This, pguid);
......@@ -277,7 +282,7 @@ static HRESULT WINAPI IRecordInfoImpl_GetGuid(IRecordInfo *iface, GUID *pguid)
static HRESULT WINAPI IRecordInfoImpl_GetName(IRecordInfo *iface, BSTR *pbstrName)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
TRACE("(%p)->(%p)\n", This, pbstrName);
......@@ -290,8 +295,8 @@ static HRESULT WINAPI IRecordInfoImpl_GetName(IRecordInfo *iface, BSTR *pbstrNam
static HRESULT WINAPI IRecordInfoImpl_GetSize(IRecordInfo *iface, ULONG *pcbSize)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
TRACE("(%p)->(%p)\n", This, pcbSize);
if(!pcbSize)
......@@ -303,7 +308,7 @@ static HRESULT WINAPI IRecordInfoImpl_GetSize(IRecordInfo *iface, ULONG *pcbSize
static HRESULT WINAPI IRecordInfoImpl_GetTypeInfo(IRecordInfo *iface, ITypeInfo **ppTypeInfo)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
TRACE("(%p)->(%p)\n", This, ppTypeInfo);
......@@ -319,7 +324,7 @@ static HRESULT WINAPI IRecordInfoImpl_GetTypeInfo(IRecordInfo *iface, ITypeInfo
static HRESULT WINAPI IRecordInfoImpl_GetField(IRecordInfo *iface, PVOID pvData,
LPCOLESTR szFieldName, VARIANT *pvarField)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
int i;
TRACE("(%p)->(%p %s %p)\n", This, pvData, debugstr_w(szFieldName), pvarField);
......@@ -341,7 +346,7 @@ static HRESULT WINAPI IRecordInfoImpl_GetField(IRecordInfo *iface, PVOID pvData,
static HRESULT WINAPI IRecordInfoImpl_GetFieldNoCopy(IRecordInfo *iface, PVOID pvData,
LPCOLESTR szFieldName, VARIANT *pvarField, PVOID *ppvDataCArray)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
int i;
TRACE("(%p)->(%p %s %p %p)\n", This, pvData, debugstr_w(szFieldName), pvarField, ppvDataCArray);
......@@ -365,7 +370,7 @@ static HRESULT WINAPI IRecordInfoImpl_GetFieldNoCopy(IRecordInfo *iface, PVOID p
static HRESULT WINAPI IRecordInfoImpl_PutField(IRecordInfo *iface, ULONG wFlags, PVOID pvData,
LPCOLESTR szFieldName, VARIANT *pvarField)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
int i;
TRACE("(%p)->(%08x %p %s %p)\n", This, wFlags, pvData, debugstr_w(szFieldName),
......@@ -393,7 +398,7 @@ static HRESULT WINAPI IRecordInfoImpl_PutField(IRecordInfo *iface, ULONG wFlags,
static HRESULT WINAPI IRecordInfoImpl_PutFieldNoCopy(IRecordInfo *iface, ULONG wFlags,
PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
int i;
FIXME("(%p)->(%08x %p %s %p) stub\n", This, wFlags, pvData, debugstr_w(szFieldName), pvarField);
......@@ -414,7 +419,7 @@ static HRESULT WINAPI IRecordInfoImpl_PutFieldNoCopy(IRecordInfo *iface, ULONG w
static HRESULT WINAPI IRecordInfoImpl_GetFieldNames(IRecordInfo *iface, ULONG *pcNames,
BSTR *rgBstrNames)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
ULONG n = This->n_vars, i;
TRACE("(%p)->(%p %p)\n", This, pcNames, rgBstrNames);
......@@ -436,7 +441,7 @@ static HRESULT WINAPI IRecordInfoImpl_GetFieldNames(IRecordInfo *iface, ULONG *p
static BOOL WINAPI IRecordInfoImpl_IsMatchingType(IRecordInfo *iface, IRecordInfo *pRecordInfo)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
FIXME("(%p)->(%p) stub\n", This, pRecordInfo);
......@@ -445,7 +450,7 @@ static BOOL WINAPI IRecordInfoImpl_IsMatchingType(IRecordInfo *iface, IRecordInf
static PVOID WINAPI IRecordInfoImpl_RecordCreate(IRecordInfo *iface)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
TRACE("(%p)\n", This);
......@@ -455,7 +460,7 @@ static PVOID WINAPI IRecordInfoImpl_RecordCreate(IRecordInfo *iface)
static HRESULT WINAPI IRecordInfoImpl_RecordCreateCopy(IRecordInfo *iface, PVOID pvSource,
PVOID *ppvDest)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
TRACE("(%p)->(%p %p)\n", This, pvSource, ppvDest);
......@@ -468,7 +473,7 @@ static HRESULT WINAPI IRecordInfoImpl_RecordCreateCopy(IRecordInfo *iface, PVOID
static HRESULT WINAPI IRecordInfoImpl_RecordDestroy(IRecordInfo *iface, PVOID pvRecord)
{
IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
IRecordInfoImpl *This = impl_from_IRecordInfo(iface);
HRESULT hres;
TRACE("(%p)->(%p)\n", This, pvRecord);
......@@ -585,7 +590,7 @@ HRESULT WINAPI GetRecordInfoFromTypeInfo(ITypeInfo* pTI, IRecordInfo** ppRecInfo
}
ret = HeapAlloc(GetProcessHeap(), 0, sizeof(*ret));
ret->lpVtbl = &IRecordInfoImplVtbl;
ret->IRecordInfo_iface.lpVtbl = &IRecordInfoImplVtbl;
ret->ref = 1;
ret->pTypeInfo = pTypeInfo;
ret->n_vars = typeattr->cVars;
......@@ -621,8 +626,8 @@ HRESULT WINAPI GetRecordInfoFromTypeInfo(ITypeInfo* pTI, IRecordInfo** ppRecInfo
WARN("GetDocumentation failed: %08x\n", hres);
ITypeInfo_ReleaseVarDesc(pTypeInfo, vardesc);
}
*ppRecInfo = (IRecordInfo*)ret;
*ppRecInfo = &ret->IRecordInfo_iface;
return S_OK;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment