Commit 475824e7 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msdasql: Implement IRowsetInfo GetProperties.

The only way to actually set these properties is via the ICommandProperties interface found on ICommandText(eg rowset->caller). Signed-off-by: 's avatarAlistair Leslie-Hughes <leslie_alistair@hotmail.com>
parent 4934c127
......@@ -905,8 +905,19 @@ static HRESULT WINAPI rowset_info_GetProperties(IRowsetInfo *iface, const ULONG
const DBPROPIDSET propertyidsets[], ULONG *out_count, DBPROPSET **propertysets)
{
struct msdasql_rowset *rowset = impl_from_IRowsetInfo( iface );
FIXME("%p, %lu, %p, %p, %p\n", rowset, count, propertyidsets, out_count, propertysets);
return E_NOTIMPL;
HRESULT hr;
ICommandProperties *props;
TRACE("%p, %lu, %p, %p, %p\n", rowset, count, propertyidsets, out_count, propertysets);
hr = IUnknown_QueryInterface(rowset->caller, &IID_ICommandProperties, (void**)&props);
if (FAILED(hr))
return hr;
hr = ICommandProperties_GetProperties(props, count, propertyidsets, out_count, propertysets);
ICommandProperties_Release(props);
return hr;
}
static HRESULT WINAPI rowset_info_GetReferencedRowset(IRowsetInfo *iface, DBORDINAL ordinal,
......
......@@ -496,6 +496,43 @@ static void test_rowset_interfaces(IRowset *rowset, ICommandText *commandtext)
ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
}
static void test_rowset_info(IRowset *rowset)
{
IRowsetInfo *info;
HRESULT hr;
ULONG propcnt;
DBPROPIDSET propidset;
DBPROPSET *propset;
int i;
DWORD row_props[] = {
DBPROP_CANSCROLLBACKWARDS, DBPROP_IRowsetUpdate, DBPROP_IRowsetResynch,
DBPROP_IConnectionPointContainer, DBPROP_BOOKMARKSKIPPED, DBPROP_REMOVEDELETED,
DBPROP_IConvertType, DBPROP_NOTIFICATIONGRANULARITY, DBPROP_IMultipleResults, DBPROP_ACCESSORDER,
DBPROP_BOOKMARKINFO, DBPROP_UNIQUEROWS
};
hr = IRowset_QueryInterface(rowset, &IID_IRowsetInfo, (void**)&info);
ok(hr == S_OK, "got 0x%08lx\n", hr);
propidset.rgPropertyIDs = row_props;
propidset.cPropertyIDs = ARRAY_SIZE(row_props);
propidset.guidPropertySet = DBPROPSET_ROWSET;
hr = IRowsetInfo_GetProperties(info, 1, &propidset, &propcnt, &propset);
ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(propset->cProperties == ARRAY_SIZE(row_props), "got %lu\n", propset->cProperties);
for(i=0; i < ARRAY_SIZE(row_props); i++)
{
ok(propset->rgProperties[i].dwPropertyID == row_props[i], "expected 0x%08lx got 0x%08lx\n",
propset->rgProperties[i].dwPropertyID, row_props[i]);
}
CoTaskMemFree(propset);
IRowsetInfo_Release(info);
}
static void test_command_rowset(IUnknown *cmd)
{
ICommandText *command_text;
......@@ -587,6 +624,8 @@ static void test_command_rowset(IUnknown *cmd)
CoTaskMemFree(stringsbuffer);
IColumnsInfo_Release(colinfo);
test_rowset_info(rowset);
IRowset_Release(rowset);
IUnknown_Release(unk);
}
......
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