msdaps: Standardize the COM usage in row_server.c.

This commit is contained in:
Michael Stefaniuc 2010-11-29 01:02:01 +01:00 committed by Alexandre Julliard
parent 87f42eb853
commit f27209eb58
1 changed files with 33 additions and 33 deletions

View File

@ -75,7 +75,7 @@ static inline DBLENGTH db_type_size(DBTYPE type, DBLENGTH var_len)
typedef struct
{
const IWineRowServerVtbl *vtbl;
IWineRowServer IWineRowServer_iface;
LONG ref;
@ -86,7 +86,7 @@ typedef struct
static inline server *impl_from_IWineRowServer(IWineRowServer *iface)
{
return (server *)((char*)iface - FIELD_OFFSET(server, vtbl));
return CONTAINING_RECORD(iface, server, IWineRowServer_iface);
}
static HRESULT WINAPI server_QueryInterface(IWineRowServer *iface, REFIID riid, void **obj)
@ -586,7 +586,7 @@ static HRESULT create_server(IUnknown *outer, const CLSID *class, void **obj)
server = HeapAlloc(GetProcessHeap(), 0, sizeof(*server));
if(!server) return E_OUTOFMEMORY;
server->vtbl = &server_vtbl;
server->IWineRowServer_iface.lpVtbl = &server_vtbl;
server->ref = 1;
server->class = *class;
server->inner_unk = NULL;
@ -613,8 +613,8 @@ HRESULT create_rowset_server(IUnknown *outer, void **obj)
typedef struct
{
const IRowVtbl *row_vtbl;
const IRowChangeVtbl *row_change_vtbl;
IRow IRow_iface;
IRowChange IRowChange_iface;
LONG ref;
@ -623,12 +623,12 @@ typedef struct
static inline row_proxy *impl_from_IRow(IRow *iface)
{
return (row_proxy *)((char*)iface - FIELD_OFFSET(row_proxy, row_vtbl));
return CONTAINING_RECORD(iface, row_proxy, IRow_iface);
}
static inline row_proxy *impl_from_IRowChange(IRowChange *iface)
{
return (row_proxy *)((char*)iface - FIELD_OFFSET(row_proxy, row_change_vtbl));
return CONTAINING_RECORD(iface, row_proxy, IRowChange_iface);
}
static HRESULT WINAPI row_QueryInterface(IRow *iface, REFIID iid, void **obj)
@ -639,11 +639,11 @@ static HRESULT WINAPI row_QueryInterface(IRow *iface, REFIID iid, void **obj)
if(IsEqualIID(iid, &IID_IUnknown) ||
IsEqualIID(iid, &IID_IRow))
{
*obj = &This->row_vtbl;
*obj = &This->IRow_iface;
}
else if(IsEqualIID(iid, &IID_IRowChange))
{
*obj = &This->row_change_vtbl;
*obj = &This->IRowChange_iface;
}
else
{
@ -831,23 +831,23 @@ static HRESULT create_row_proxy(IWineRowServer *server, IUnknown **obj)
proxy = HeapAlloc(GetProcessHeap(), 0, sizeof(*proxy));
if(!proxy) return E_OUTOFMEMORY;
proxy->row_vtbl = &row_vtbl;
proxy->row_change_vtbl = &row_change_vtbl;
proxy->IRow_iface.lpVtbl = &row_vtbl;
proxy->IRowChange_iface.lpVtbl = &row_change_vtbl;
proxy->ref = 1;
IWineRowServer_AddRef(server);
proxy->server = server;
*obj = (IUnknown*)&proxy->row_vtbl;
*obj = (IUnknown*)&proxy->IRow_iface;
TRACE("returning %p\n", *obj);
return S_OK;
}
typedef struct
{
const IRowsetVtbl *rowset_vtbl;
const IRowsetLocateVtbl *rowsetlocate_vtbl;
const IRowsetInfoVtbl *rowsetinfo_vtbl;
const IAccessorVtbl *accessor_vtbl;
IRowset IRowset_iface;
IRowsetLocate IRowsetLocate_iface;
IRowsetInfo IRowsetInfo_iface;
IAccessor IAccessor_iface;
LONG ref;
@ -856,22 +856,22 @@ typedef struct
static inline rowset_proxy *impl_from_IRowset(IRowset *iface)
{
return (rowset_proxy *)((char*)iface - FIELD_OFFSET(rowset_proxy, rowset_vtbl));
return CONTAINING_RECORD(iface, rowset_proxy, IRowset_iface);
}
static inline rowset_proxy *impl_from_IRowsetLocate(IRowsetLocate *iface)
{
return (rowset_proxy *)((char*)iface - FIELD_OFFSET(rowset_proxy, rowsetlocate_vtbl));
return CONTAINING_RECORD(iface, rowset_proxy, IRowsetLocate_iface);
}
static inline rowset_proxy *impl_from_IRowsetInfo(IRowsetInfo *iface)
{
return (rowset_proxy *)((char*)iface - FIELD_OFFSET(rowset_proxy, rowsetinfo_vtbl));
return CONTAINING_RECORD(iface, rowset_proxy, IRowsetInfo_iface);
}
static inline rowset_proxy *impl_from_IAccessor(IAccessor *iface)
{
return (rowset_proxy *)((char*)iface - FIELD_OFFSET(rowset_proxy, accessor_vtbl));
return CONTAINING_RECORD(iface, rowset_proxy, IAccessor_iface);
}
static HRESULT WINAPI rowset_QueryInterface(IRowset *iface, REFIID iid, void **obj)
@ -884,19 +884,19 @@ static HRESULT WINAPI rowset_QueryInterface(IRowset *iface, REFIID iid, void **o
if(IsEqualIID(iid, &IID_IUnknown) ||
IsEqualIID(iid, &IID_IRowset))
{
*obj = &This->rowset_vtbl;
*obj = &This->IRowset_iface;
}
else if(IsEqualIID(iid, &IID_IRowsetLocate))
{
*obj = &This->rowsetlocate_vtbl;
*obj = &This->IRowsetLocate_iface;
}
else if(IsEqualIID(iid, &IID_IRowsetInfo))
{
*obj = &This->rowsetinfo_vtbl;
*obj = &This->IRowsetInfo_iface;
}
else if(IsEqualIID(iid, &IID_IAccessor))
{
*obj = &This->accessor_vtbl;
*obj = &This->IAccessor_iface;
}
else
{
@ -1330,15 +1330,15 @@ static HRESULT create_rowset_proxy(IWineRowServer *server, IUnknown **obj)
proxy = HeapAlloc(GetProcessHeap(), 0, sizeof(*proxy));
if(!proxy) return E_OUTOFMEMORY;
proxy->rowset_vtbl = &rowset_vtbl;
proxy->rowsetlocate_vtbl = &rowsetlocate_vtbl;
proxy->rowsetinfo_vtbl = &rowsetinfo_vtbl;
proxy->accessor_vtbl = &accessor_vtbl;
proxy->IRowset_iface.lpVtbl = &rowset_vtbl;
proxy->IRowsetLocate_iface.lpVtbl = &rowsetlocate_vtbl;
proxy->IRowsetInfo_iface.lpVtbl = &rowsetinfo_vtbl;
proxy->IAccessor_iface.lpVtbl = &accessor_vtbl;
proxy->ref = 1;
IWineRowServer_AddRef(server);
proxy->server = server;
*obj = (IUnknown *)&proxy->rowset_vtbl;
*obj = (IUnknown *)&proxy->IRowset_iface;
TRACE("returning %p\n", *obj);
return S_OK;
}
@ -1360,7 +1360,7 @@ static HRESULT create_proxy(IWineRowServer *server, const CLSID *class, IUnknown
typedef struct
{
const IMarshalVtbl *marshal_vtbl;
IMarshal IMarshal_iface;
LONG ref;
CLSID unmarshal_class;
@ -1369,7 +1369,7 @@ typedef struct
static inline marshal *impl_from_IMarshal(IMarshal *iface)
{
return (marshal *)((char*)iface - FIELD_OFFSET(marshal, marshal_vtbl));
return CONTAINING_RECORD(iface, marshal, IMarshal_iface);
}
static HRESULT WINAPI marshal_QueryInterface(IMarshal *iface, REFIID iid, void **obj)
@ -1518,10 +1518,10 @@ static HRESULT create_marshal(IUnknown *outer, const CLSID *class, void **obj)
marshal->unmarshal_class = *class;
marshal->outer = outer; /* don't ref outer unk */
marshal->marshal_vtbl = &marshal_vtbl;
marshal->IMarshal_iface.lpVtbl = &marshal_vtbl;
marshal->ref = 1;
*obj = &marshal->marshal_vtbl;
*obj = &marshal->IMarshal_iface;
TRACE("returning %p\n", *obj);
return S_OK;
}