Commit 22689f6f authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msdasql: Add ICommandPrepare interface for ICommandText.

parent 9bdcf444
...@@ -281,6 +281,7 @@ struct command ...@@ -281,6 +281,7 @@ struct command
ICommandProperties ICommandProperties_iface; ICommandProperties ICommandProperties_iface;
IColumnsInfo IColumnsInfo_iface; IColumnsInfo IColumnsInfo_iface;
IConvertType IConvertType_iface; IConvertType IConvertType_iface;
ICommandPrepare ICommandPrepare_iface;
LONG refs; LONG refs;
}; };
...@@ -304,6 +305,11 @@ static inline struct command *impl_from_IConvertType( IConvertType *iface ) ...@@ -304,6 +305,11 @@ static inline struct command *impl_from_IConvertType( IConvertType *iface )
return CONTAINING_RECORD( iface, struct command, IConvertType_iface ); return CONTAINING_RECORD( iface, struct command, IConvertType_iface );
} }
static inline struct command *impl_from_ICommandPrepare( ICommandPrepare *iface )
{
return CONTAINING_RECORD( iface, struct command, ICommandPrepare_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 );
...@@ -329,6 +335,10 @@ static HRESULT WINAPI command_QueryInterface(ICommandText *iface, REFIID riid, v ...@@ -329,6 +335,10 @@ static HRESULT WINAPI command_QueryInterface(ICommandText *iface, REFIID riid, v
{ {
*ppv = &command->IConvertType_iface; *ppv = &command->IConvertType_iface;
} }
else if(IsEqualGUID(&IID_ICommandPrepare, riid))
{
*ppv = &command->ICommandPrepare_iface;
}
if(*ppv) if(*ppv)
{ {
...@@ -553,6 +563,47 @@ static struct IConvertTypeVtbl converttypeVtbl = ...@@ -553,6 +563,47 @@ static struct IConvertTypeVtbl converttypeVtbl =
converttype_CanConvert converttype_CanConvert
}; };
static HRESULT WINAPI commandprepare_QueryInterface(ICommandPrepare *iface, REFIID riid, void **out)
{
struct command *command = impl_from_ICommandPrepare( iface );
return ICommandText_QueryInterface(&command->ICommandText_iface, riid, out);
}
static ULONG WINAPI commandprepare_AddRef(ICommandPrepare *iface)
{
struct command *command = impl_from_ICommandPrepare( iface );
return ICommandText_AddRef(&command->ICommandText_iface);
}
static ULONG WINAPI commandprepare_Release(ICommandPrepare *iface)
{
struct command *command = impl_from_ICommandPrepare( iface );
return ICommandText_Release(&command->ICommandText_iface);
}
static HRESULT WINAPI commandprepare_Prepare(ICommandPrepare *iface, ULONG runs)
{
struct command *command = impl_from_ICommandPrepare( iface );
FIXME("%p, %u\n", command, runs);
return E_NOTIMPL;
}
static HRESULT WINAPI commandprepare_Unprepare(ICommandPrepare *iface)
{
struct command *command = impl_from_ICommandPrepare( iface );
FIXME("%p\n", command);
return E_NOTIMPL;
}
struct ICommandPrepareVtbl commandprepareVtbl =
{
commandprepare_QueryInterface,
commandprepare_AddRef,
commandprepare_Release,
commandprepare_Prepare,
commandprepare_Unprepare
};
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)
{ {
...@@ -573,6 +624,7 @@ static HRESULT WINAPI createcommand_CreateCommand(IDBCreateCommand *iface, IUnkn ...@@ -573,6 +624,7 @@ static HRESULT WINAPI createcommand_CreateCommand(IDBCreateCommand *iface, IUnkn
command->ICommandProperties_iface.lpVtbl = &commonpropsVtbl; command->ICommandProperties_iface.lpVtbl = &commonpropsVtbl;
command->IColumnsInfo_iface.lpVtbl = &columninfoVtbl; command->IColumnsInfo_iface.lpVtbl = &columninfoVtbl;
command->IConvertType_iface.lpVtbl = &converttypeVtbl; command->IConvertType_iface.lpVtbl = &converttypeVtbl;
command->ICommandPrepare_iface.lpVtbl = &commandprepareVtbl;
command->refs = 1; command->refs = 1;
hr = ICommandText_QueryInterface(&command->ICommandText_iface, riid, (void**)out); hr = ICommandText_QueryInterface(&command->ICommandText_iface, riid, (void**)out);
......
...@@ -134,9 +134,8 @@ static void test_command_interfaces(IUnknown *cmd) ...@@ -134,9 +134,8 @@ static void test_command_interfaces(IUnknown *cmd)
IConvertType_Release(convertype); IConvertType_Release(convertype);
hr = IUnknown_QueryInterface(cmd, &IID_ICommandPrepare, (void**)&commandprepare); hr = IUnknown_QueryInterface(cmd, &IID_ICommandPrepare, (void**)&commandprepare);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
if (hr == S_OK) ICommandPrepare_Release(commandprepare);
ICommandPrepare_Release(commandprepare);
hr = IUnknown_QueryInterface(cmd, &IID_IColumnsInfo, (void**)&colinfo); hr = IUnknown_QueryInterface(cmd, &IID_IColumnsInfo, (void**)&colinfo);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
......
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