msdasql: Add IColumnsInfo interface for ICommandText.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2021-10-29 17:32:47 +11:00 committed by Alexandre Julliard
parent e18045a662
commit d9e0dde2ca
2 changed files with 56 additions and 3 deletions

View file

@ -279,6 +279,7 @@ struct command
{ {
ICommandText ICommandText_iface; ICommandText ICommandText_iface;
ICommandProperties ICommandProperties_iface; ICommandProperties ICommandProperties_iface;
IColumnsInfo IColumnsInfo_iface;
LONG refs; LONG refs;
}; };
@ -292,6 +293,11 @@ static inline struct command *impl_from_ICommandProperties( ICommandProperties *
return CONTAINING_RECORD( iface, struct command, ICommandProperties_iface ); return CONTAINING_RECORD( iface, struct command, ICommandProperties_iface );
} }
static inline struct command *impl_from_IColumnsInfo( IColumnsInfo *iface )
{
return CONTAINING_RECORD( iface, struct command, IColumnsInfo_iface );
}
static HRESULT WINAPI command_QueryInterface(ICommandText *iface, REFIID riid, void **ppv) static HRESULT WINAPI command_QueryInterface(ICommandText *iface, REFIID riid, void **ppv)
{ {
struct command *command = impl_from_ICommandText( iface ); struct command *command = impl_from_ICommandText( iface );
@ -309,6 +315,10 @@ static HRESULT WINAPI command_QueryInterface(ICommandText *iface, REFIID riid, v
{ {
*ppv = &command->ICommandProperties_iface; *ppv = &command->ICommandProperties_iface;
} }
else if(IsEqualGUID(&IID_IColumnsInfo, riid))
{
*ppv = &command->IColumnsInfo_iface;
}
if(*ppv) if(*ppv)
{ {
@ -457,6 +467,49 @@ static const ICommandPropertiesVtbl commonpropsVtbl =
command_prop_SetProperties command_prop_SetProperties
}; };
static HRESULT WINAPI colsinfo_QueryInterface(IColumnsInfo *iface, REFIID riid, void **out)
{
struct command *command = impl_from_IColumnsInfo( iface );
return ICommandText_QueryInterface(&command->ICommandText_iface, riid, out);
}
static ULONG WINAPI colsinfo_AddRef(IColumnsInfo *iface)
{
struct command *command = impl_from_IColumnsInfo( iface );
return ICommandText_AddRef(&command->ICommandText_iface);
}
static ULONG WINAPI colsinfo_Release(IColumnsInfo *iface)
{
struct command *command = impl_from_IColumnsInfo( iface );
return ICommandText_Release(&command->ICommandText_iface);
}
static HRESULT WINAPI colsinfo_GetColumnInfo(IColumnsInfo *iface, DBORDINAL *columns,
DBCOLUMNINFO **colinfo, OLECHAR **stringsbuffer)
{
struct command *command = impl_from_IColumnsInfo( iface );
FIXME("%p, %p, %p, %p\n", command, columns, colinfo, stringsbuffer);
return E_NOTIMPL;
}
static HRESULT WINAPI colsinfo_MapColumnIDs(IColumnsInfo *iface, DBORDINAL column_ids,
const DBID *dbids, DBORDINAL *columns)
{
struct command *command = impl_from_IColumnsInfo( iface );
FIXME("%p, %lu, %p, %p\n", command, column_ids, dbids, columns);
return E_NOTIMPL;
}
static struct IColumnsInfoVtbl columninfoVtbl =
{
colsinfo_QueryInterface,
colsinfo_AddRef,
colsinfo_Release,
colsinfo_GetColumnInfo,
colsinfo_MapColumnIDs
};
static HRESULT WINAPI createcommand_CreateCommand(IDBCreateCommand *iface, IUnknown *outer, REFIID riid, static HRESULT WINAPI createcommand_CreateCommand(IDBCreateCommand *iface, IUnknown *outer, REFIID riid,
IUnknown **out) IUnknown **out)
{ {
@ -475,6 +528,7 @@ static HRESULT WINAPI createcommand_CreateCommand(IDBCreateCommand *iface, IUnkn
command->ICommandText_iface.lpVtbl = &commandVtbl; command->ICommandText_iface.lpVtbl = &commandVtbl;
command->ICommandProperties_iface.lpVtbl = &commonpropsVtbl; command->ICommandProperties_iface.lpVtbl = &commonpropsVtbl;
command->IColumnsInfo_iface.lpVtbl = &columninfoVtbl;
command->refs = 1; command->refs = 1;
hr = ICommandText_QueryInterface(&command->ICommandText_iface, riid, (void**)out); hr = ICommandText_QueryInterface(&command->ICommandText_iface, riid, (void**)out);

View file

@ -140,9 +140,8 @@ static void test_command_interfaces(IUnknown *cmd)
ICommandPrepare_Release(commandprepare); ICommandPrepare_Release(commandprepare);
hr = IUnknown_QueryInterface(cmd, &IID_IColumnsInfo, (void**)&colinfo); hr = IUnknown_QueryInterface(cmd, &IID_IColumnsInfo, (void**)&colinfo);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
if (hr == S_OK) IColumnsInfo_Release(colinfo);
IColumnsInfo_Release(colinfo);
hr = IUnknown_QueryInterface(cmd, &IID_ICommandStream, (void**)&commandstream); hr = IUnknown_QueryInterface(cmd, &IID_ICommandStream, (void**)&commandstream);
ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);