[PATCH 1/3] msdasql: Implement ICommandProperties GetProperties

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Thu Nov 18 02:42:18 CST 2021


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/msdasql/msdasql_main.c   |   1 +
 dlls/msdasql/session.c        | 242 +++++++++++++++++++++++++++++++++-
 dlls/msdasql/tests/provider.c | 146 ++++++++++++++++++++
 3 files changed, 387 insertions(+), 2 deletions(-)

diff --git a/dlls/msdasql/msdasql_main.c b/dlls/msdasql/msdasql_main.c
index bc208a74cc5..84afdb06145 100644
--- a/dlls/msdasql/msdasql_main.c
+++ b/dlls/msdasql/msdasql_main.c
@@ -37,6 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msdasql);
 
 DEFINE_GUID(DBPROPSET_DATASOURCEINFO, 0xc8b522bb, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
 DEFINE_GUID(DBPROPSET_DBINIT,    0xc8b522bc, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
+DEFINE_GUID(DBPROPSET_ROWSET,    0xc8b522be, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
 
 DEFINE_GUID(DBGUID_DEFAULT,      0xc8b521fb, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
 
diff --git a/dlls/msdasql/session.c b/dlls/msdasql/session.c
index b4239c59037..9cd41eedfd8 100644
--- a/dlls/msdasql/session.c
+++ b/dlls/msdasql/session.c
@@ -35,6 +35,29 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(msdasql);
 
+static DWORD propsid[79] = {
+        DBPROP_ABORTPRESERVE, DBPROP_BLOCKINGSTORAGEOBJECTS, DBPROP_BOOKMARKS, DBPROP_BOOKMARKSKIPPED,
+        DBPROP_BOOKMARKTYPE, DBPROP_CANFETCHBACKWARDS, DBPROP_CANHOLDROWS, DBPROP_CANSCROLLBACKWARDS,
+        DBPROP_COLUMNRESTRICT, DBPROP_COMMITPRESERVE, DBPROP_DELAYSTORAGEOBJECTS, DBPROP_IMMOBILEROWS,
+        DBPROP_LITERALBOOKMARKS, DBPROP_LITERALIDENTITY, DBPROP_MAXOPENROWS, DBPROP_MAXPENDINGROWS,
+        DBPROP_MAXROWS, DBPROP_NOTIFICATIONPHASES, DBPROP_OTHERUPDATEDELETE, DBPROP_OWNINSERT,
+        DBPROP_OWNUPDATEDELETE, DBPROP_QUICKRESTART, DBPROP_REENTRANTEVENTS, DBPROP_REMOVEDELETED,
+        DBPROP_REPORTMULTIPLECHANGES, DBPROP_ROWRESTRICT, DBPROP_ROWTHREADMODEL, DBPROP_TRANSACTEDOBJECT,
+        DBPROP_UPDATABILITY, DBPROP_STRONGIDENTITY, DBPROP_IAccessor, DBPROP_IColumnsInfo,
+        DBPROP_IColumnsRowset, DBPROP_IConnectionPointContainer, DBPROP_IRowset, DBPROP_IRowsetChange,
+        DBPROP_IRowsetIdentity, DBPROP_IRowsetInfo, DBPROP_IRowsetLocate, DBPROP_IRowsetResynch,
+        DBPROP_IRowsetUpdate, DBPROP_ISupportErrorInfo, DBPROP_ISequentialStream, DBPROP_NOTIFYCOLUMNSET,
+        DBPROP_NOTIFYROWDELETE, DBPROP_NOTIFYROWFIRSTCHANGE, DBPROP_NOTIFYROWINSERT, DBPROP_NOTIFYROWRESYNCH,
+        DBPROP_NOTIFYROWSETRELEASE, DBPROP_NOTIFYROWSETFETCHPOSITIONCHANGE, DBPROP_NOTIFYROWUNDOCHANGE, DBPROP_NOTIFYROWUNDODELETE,
+        DBPROP_NOTIFYROWUNDOINSERT, DBPROP_NOTIFYROWUPDATE, DBPROP_CHANGEINSERTEDROWS, DBPROP_RETURNPENDINGINSERTS,
+        DBPROP_IConvertType, DBPROP_NOTIFICATIONGRANULARITY, DBPROP_IMultipleResults, DBPROP_ACCESSORDER,
+        DBPROP_BOOKMARKINFO, DBPROP_UNIQUEROWS, DBPROP_IRowsetFind, DBPROP_IRowsetScroll,
+        DBPROP_IRowsetRefresh, DBPROP_FINDCOMPAREOPS, DBPROP_ORDEREDBOOKMARKS, DBPROP_CLIENTCURSOR,
+        DBPROP_ACTIVESESSIONS, DBPROP_ASYNCTXNCOMMIT, DBPROP_AUTH_CACHE_AUTHINFO, DBPROP_AUTH_ENCRYPT_PASSWORD,
+        DBPROP_AUTH_INTEGRATED, DBPROP_AUTH_MASK_PASSWORD, DBPROP_AUTH_PASSWORD, DBPROP_AUTH_PERSIST_ENCRYPTED,
+        DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, DBPROP_AUTH_USERID, DBPROP_BLOCKINGSTORAGEOBJECTS
+};
+
 struct msdasql_session
 {
     IUnknown session_iface;
@@ -294,6 +317,13 @@ static ULONG WINAPI createcommand_Release(IDBCreateCommand *iface)
     return IUnknown_Release(&session->session_iface);
 }
 
+struct command_props
+{
+    DWORD id;
+    BOOL readonly;
+    VARIANT value;
+};
+
 struct command
 {
     ICommandText ICommandText_iface;
@@ -305,6 +335,8 @@ struct command
     LONG refs;
     WCHAR *query;
     IUnknown *session;
+
+    struct command_props properties[79];
 };
 
 static inline struct command *impl_from_ICommandText( ICommandText *iface )
@@ -933,8 +965,133 @@ static HRESULT WINAPI command_prop_GetProperties(ICommandProperties *iface, ULON
         const DBPROPIDSET propertyidsets[], ULONG *sets_cnt, DBPROPSET **propertyset)
 {
     struct command *command = impl_from_ICommandProperties( iface );
-    FIXME("%p %d %p %p %p\n", command, count, propertyidsets, sets_cnt, propertyset);
-    return E_NOTIMPL;
+    DBPROPSET *propset = NULL;
+    int i, j, k;
+
+    DWORD row_props[68] = {
+            DBPROP_ABORTPRESERVE, DBPROP_BLOCKINGSTORAGEOBJECTS, DBPROP_BOOKMARKS, DBPROP_BOOKMARKSKIPPED,
+            DBPROP_BOOKMARKTYPE, DBPROP_CANFETCHBACKWARDS, DBPROP_CANHOLDROWS, DBPROP_CANSCROLLBACKWARDS,
+            DBPROP_COLUMNRESTRICT, DBPROP_COMMITPRESERVE, DBPROP_DELAYSTORAGEOBJECTS, DBPROP_IMMOBILEROWS,
+            DBPROP_LITERALBOOKMARKS, DBPROP_LITERALIDENTITY, DBPROP_MAXOPENROWS, DBPROP_MAXPENDINGROWS,
+            DBPROP_MAXROWS, DBPROP_NOTIFICATIONPHASES, DBPROP_OTHERUPDATEDELETE, DBPROP_OWNINSERT,
+            DBPROP_OWNUPDATEDELETE, DBPROP_QUICKRESTART, DBPROP_REENTRANTEVENTS, DBPROP_REMOVEDELETED,
+            DBPROP_REPORTMULTIPLECHANGES, DBPROP_ROWRESTRICT, DBPROP_ROWTHREADMODEL, DBPROP_TRANSACTEDOBJECT,
+            DBPROP_UPDATABILITY, DBPROP_STRONGIDENTITY, DBPROP_IAccessor, DBPROP_IColumnsInfo,
+            DBPROP_IColumnsRowset, DBPROP_IConnectionPointContainer, DBPROP_IRowset, DBPROP_IRowsetChange,
+            DBPROP_IRowsetIdentity, DBPROP_IRowsetInfo, DBPROP_IRowsetLocate, DBPROP_IRowsetResynch,
+            DBPROP_IRowsetUpdate, DBPROP_ISupportErrorInfo, DBPROP_ISequentialStream, DBPROP_NOTIFYCOLUMNSET,
+            DBPROP_NOTIFYROWDELETE, DBPROP_NOTIFYROWFIRSTCHANGE, DBPROP_NOTIFYROWINSERT, DBPROP_NOTIFYROWRESYNCH,
+            DBPROP_NOTIFYROWSETRELEASE, DBPROP_NOTIFYROWSETFETCHPOSITIONCHANGE, DBPROP_NOTIFYROWUNDOCHANGE, DBPROP_NOTIFYROWUNDODELETE,
+            DBPROP_NOTIFYROWUNDOINSERT, DBPROP_NOTIFYROWUPDATE, DBPROP_CHANGEINSERTEDROWS, DBPROP_RETURNPENDINGINSERTS,
+            DBPROP_IConvertType, DBPROP_NOTIFICATIONGRANULARITY, DBPROP_IMultipleResults, DBPROP_ACCESSORDER,
+            DBPROP_BOOKMARKINFO, DBPROP_UNIQUEROWS, DBPROP_IRowsetFind, DBPROP_IRowsetScroll,
+            DBPROP_IRowsetRefresh, DBPROP_FINDCOMPAREOPS, DBPROP_ORDEREDBOOKMARKS, DBPROP_CLIENTCURSOR
+    };
+
+    DWORD prov_props[12] = {
+            DBPROP_ABORTPRESERVE, DBPROP_ACTIVESESSIONS, DBPROP_ASYNCTXNCOMMIT, DBPROP_AUTH_CACHE_AUTHINFO,
+            DBPROP_AUTH_ENCRYPT_PASSWORD, DBPROP_AUTH_INTEGRATED, DBPROP_AUTH_MASK_PASSWORD, DBPROP_AUTH_PASSWORD,
+            DBPROP_AUTH_PERSIST_ENCRYPTED, DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, DBPROP_AUTH_USERID, DBPROP_BLOCKINGSTORAGEOBJECTS
+    };
+
+    TRACE("%p %d %p %p %p\n", command, count, propertyidsets, sets_cnt, propertyset);
+
+    /* All Properties */
+    if (count == 0)
+    {
+        propset = CoTaskMemAlloc(2 * sizeof(DBPROPSET));
+        if (!propset)
+            return E_OUTOFMEMORY;
+
+        propset[0].guidPropertySet = DBPROPSET_ROWSET;
+        propset[0].cProperties = ARRAY_SIZE(row_props);
+        propset[0].rgProperties = CoTaskMemAlloc(propset[0].cProperties * sizeof(DBPROP));
+        if (!propset[0].rgProperties)
+        {
+            CoTaskMemFree(propset);
+            return E_OUTOFMEMORY;
+        }
+
+        for (j=0; j < propset[0].cProperties; j++)
+        {
+            propset[0].rgProperties[j].dwPropertyID = row_props[j];
+
+            for(k = 0; k < ARRAY_SIZE(command->properties); k++)
+            {
+                if (command->properties[k].id == row_props[j])
+                {
+                    V_VT(&propset[0].rgProperties[j].vValue) = VT_EMPTY;
+                    VariantCopy(&propset[0].rgProperties[j].vValue, &command->properties[k].value);
+                    break;
+                }
+            }
+        }
+
+        propset[1].guidPropertySet = DBPROPSET_PROVIDERROWSET;
+
+        propset[1].cProperties = ARRAY_SIZE(prov_props);
+        propset[1].rgProperties = CoTaskMemAlloc(propset[1].cProperties * sizeof(DBPROP));
+        if (!propset[1].rgProperties)
+        {
+            CoTaskMemFree(propset[0].rgProperties);
+            CoTaskMemFree(propset);
+            return E_OUTOFMEMORY;
+        }
+        for (j=0; j < propset[1].cProperties; j++)
+        {
+            propset[1].rgProperties[j].dwPropertyID = prov_props[j];
+
+            for(k = 0; k < ARRAY_SIZE(command->properties); k++)
+            {
+                if (command->properties[k].id == prov_props[j])
+                {
+                    V_VT(&propset[1].rgProperties[j].vValue) = VT_EMPTY;
+                    VariantCopy(&propset[1].rgProperties[j].vValue, &command->properties[k].value);
+                    break;
+                }
+            }
+        }
+
+        *sets_cnt = 2;
+    }
+    else
+    {
+        propset = CoTaskMemAlloc(count * sizeof(DBPROPSET));
+        if (!propset)
+            return E_OUTOFMEMORY;
+
+        for (i=0; i < count; i++)
+        {
+            TRACE("Property id %d (count %d, set %s)\n", i, propertyidsets[i].cPropertyIDs,
+                    debugstr_guid(&propertyidsets[i].guidPropertySet));
+
+            propset[i].cProperties = propertyidsets[i].cPropertyIDs;
+            propset[i].rgProperties = CoTaskMemAlloc(propset[i].cProperties * sizeof(DBPROP));
+
+            for (j=0; j < propset[i].cProperties; j++)
+            {
+                propset[i].rgProperties[j].dwPropertyID = propertyidsets[i].rgPropertyIDs[j];
+
+                for(k = 0; k < ARRAY_SIZE(command->properties); k++)
+                {
+                    if (command->properties[k].id == propertyidsets[i].rgPropertyIDs[j])
+                    {
+                        V_VT(&propset[i].rgProperties[j].vValue) = VT_EMPTY;
+                        VariantCopy(&propset[i].rgProperties[j].vValue, &command->properties[k].value);
+                        break;
+                    }
+                }
+            }
+
+
+        }
+
+        *sets_cnt = count;
+    }
+
+    *propertyset = propset;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI command_prop_SetProperties(ICommandProperties *iface, ULONG count,
@@ -1129,6 +1286,7 @@ static HRESULT WINAPI createcommand_CreateCommand(IDBCreateCommand *iface, IUnkn
     struct msdasql_session *session = impl_from_IDBCreateCommand( iface );
     struct command *command;
     HRESULT hr;
+    int i;
 
     TRACE("%p, %p, %s, %p\n", session, outer, debugstr_guid(riid), out);
 
@@ -1148,6 +1306,86 @@ static HRESULT WINAPI createcommand_CreateCommand(IDBCreateCommand *iface, IUnkn
     command->refs = 1;
     command->query = NULL;
 
+    for(i = 0; i < ARRAY_SIZE(command->properties); i++)
+    {
+        command->properties[i].id = propsid[i];
+        VariantInit(&command->properties[i].value);
+
+        switch(propsid[i])
+        {
+            case DBPROP_BOOKMARKTYPE:
+            case DBPROP_NOTIFICATIONGRANULARITY:
+            case DBPROP_ACCESSORDER:
+                V_VT(&command->properties[i].value) = VT_I4;
+                V_I4(&command->properties[i].value) = 1;
+                break;
+            case DBPROP_MAXOPENROWS:
+            case DBPROP_MAXPENDINGROWS:
+            case DBPROP_MAXROWS:
+            case DBPROP_UPDATABILITY:
+            case DBPROP_BOOKMARKINFO:
+            case DBPROP_AUTH_ENCRYPT_PASSWORD:
+                V_VT(&command->properties[i].value) = VT_I4;
+                V_I4(&command->properties[i].value) = 0;
+                break;
+            case DBPROP_FINDCOMPAREOPS:
+                V_VT(&command->properties[i].value) = VT_I4;
+                V_I4(&command->properties[i].value) = 27;
+                break;
+            case DBPROP_NOTIFICATIONPHASES:
+                V_VT(&command->properties[i].value) = VT_I4;
+                V_I4(&command->properties[i].value) = 31;
+                break;
+            case DBPROP_ROWTHREADMODEL:
+                V_VT(&command->properties[i].value) = VT_I4;
+                V_I4(&command->properties[i].value) = 2;
+                break;
+            case DBPROP_NOTIFYCOLUMNSET:
+            case DBPROP_NOTIFYROWDELETE:
+            case DBPROP_NOTIFYROWFIRSTCHANGE:
+            case DBPROP_NOTIFYROWINSERT:
+            case DBPROP_NOTIFYROWRESYNCH:
+            case DBPROP_NOTIFYROWSETRELEASE:
+            case DBPROP_NOTIFYROWSETFETCHPOSITIONCHANGE:
+            case DBPROP_NOTIFYROWUNDOCHANGE:
+            case DBPROP_NOTIFYROWUNDODELETE:
+            case DBPROP_NOTIFYROWUNDOINSERT:
+            case DBPROP_NOTIFYROWUPDATE:
+                V_VT(&command->properties[i].value) = VT_I4;
+                V_I4(&command->properties[i].value) = 3;
+                break;
+            case DBPROP_IAccessor:
+            case DBPROP_IColumnsInfo:
+            case DBPROP_IColumnsRowset:
+            case DBPROP_IRowset:
+            case DBPROP_IRowsetInfo:
+            case DBPROP_ISupportErrorInfo:
+            case DBPROP_IConvertType:
+            case DBPROP_IRowsetScroll:
+            case DBPROP_IRowsetRefresh:
+                command->properties[i].readonly = TRUE;
+                /* Fall through */
+            case DBPROP_BLOCKINGSTORAGEOBJECTS:
+            case DBPROP_IMMOBILEROWS:
+            case DBPROP_LITERALIDENTITY:
+            case DBPROP_REENTRANTEVENTS:
+            case DBPROP_CHANGEINSERTEDROWS:
+            case DBPROP_ORDEREDBOOKMARKS:
+            case DBPROP_CLIENTCURSOR:
+                V_VT(&command->properties[i].value) = VT_BOOL;
+                V_BOOL(&command->properties[i].value) = VARIANT_TRUE;
+                break;
+            case DBPROP_AUTH_INTEGRATED:
+                V_VT(&command->properties[i].value) = VT_I4;
+                V_I4(&command->properties[i].value) = 14;
+                break;
+            default:
+                V_VT(&command->properties[i].value) = VT_BOOL;
+                V_BOOL(&command->properties[i].value) = VARIANT_FALSE;
+                break;
+        }
+    }
+
     IUnknown_QueryInterface(&session->session_iface, &IID_IUnknown, (void**)&command->session);
 
     hr = ICommandText_QueryInterface(&command->ICommandText_iface, riid, (void**)out);
diff --git a/dlls/msdasql/tests/provider.c b/dlls/msdasql/tests/provider.c
index b520b127d67..c40f92a273b 100644
--- a/dlls/msdasql/tests/provider.c
+++ b/dlls/msdasql/tests/provider.c
@@ -34,9 +34,11 @@
 DEFINE_GUID(DBPROPSET_DATASOURCEINFO, 0xc8b522bb, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
 DEFINE_GUID(DBPROPSET_DBINITALL, 0xc8b522ca, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
 DEFINE_GUID(DBPROPSET_DBINIT,    0xc8b522bc, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
+DEFINE_GUID(DBPROPSET_ROWSET,    0xc8b522be, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
 
 DEFINE_GUID(DBGUID_DEFAULT,      0xc8b521fb, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
 
+
 static BOOL db_created;
 static char mdbpath[MAX_PATH];
 
@@ -183,6 +185,149 @@ static void test_Properties(void)
     IDBProperties_Release(props);
 }
 
+static void test_command_properties(ICommandProperties *props)
+{
+    HRESULT hr;
+    ULONG count;
+    DBPROPSET *propset;
+    int i;
+
+    DWORD row_props[68] = {
+            DBPROP_ABORTPRESERVE, DBPROP_BLOCKINGSTORAGEOBJECTS, DBPROP_BOOKMARKS, DBPROP_BOOKMARKSKIPPED,
+            DBPROP_BOOKMARKTYPE, DBPROP_CANFETCHBACKWARDS, DBPROP_CANHOLDROWS, DBPROP_CANSCROLLBACKWARDS,
+            DBPROP_COLUMNRESTRICT, DBPROP_COMMITPRESERVE, DBPROP_DELAYSTORAGEOBJECTS, DBPROP_IMMOBILEROWS,
+            DBPROP_LITERALBOOKMARKS, DBPROP_LITERALIDENTITY, DBPROP_MAXOPENROWS, DBPROP_MAXPENDINGROWS,
+            DBPROP_MAXROWS, DBPROP_NOTIFICATIONPHASES, DBPROP_OTHERUPDATEDELETE, DBPROP_OWNINSERT,
+            DBPROP_OWNUPDATEDELETE, DBPROP_QUICKRESTART, DBPROP_REENTRANTEVENTS, DBPROP_REMOVEDELETED,
+            DBPROP_REPORTMULTIPLECHANGES, DBPROP_ROWRESTRICT, DBPROP_ROWTHREADMODEL, DBPROP_TRANSACTEDOBJECT,
+            DBPROP_UPDATABILITY, DBPROP_STRONGIDENTITY, DBPROP_IAccessor, DBPROP_IColumnsInfo,
+            DBPROP_IColumnsRowset, DBPROP_IConnectionPointContainer, DBPROP_IRowset, DBPROP_IRowsetChange,
+            DBPROP_IRowsetIdentity, DBPROP_IRowsetInfo, DBPROP_IRowsetLocate, DBPROP_IRowsetResynch,
+            DBPROP_IRowsetUpdate, DBPROP_ISupportErrorInfo, DBPROP_ISequentialStream, DBPROP_NOTIFYCOLUMNSET,
+            DBPROP_NOTIFYROWDELETE, DBPROP_NOTIFYROWFIRSTCHANGE, DBPROP_NOTIFYROWINSERT, DBPROP_NOTIFYROWRESYNCH,
+            DBPROP_NOTIFYROWSETRELEASE, DBPROP_NOTIFYROWSETFETCHPOSITIONCHANGE, DBPROP_NOTIFYROWUNDOCHANGE, DBPROP_NOTIFYROWUNDODELETE,
+            DBPROP_NOTIFYROWUNDOINSERT, DBPROP_NOTIFYROWUPDATE, DBPROP_CHANGEINSERTEDROWS, DBPROP_RETURNPENDINGINSERTS,
+            DBPROP_IConvertType, DBPROP_NOTIFICATIONGRANULARITY, DBPROP_IMultipleResults, DBPROP_ACCESSORDER,
+            DBPROP_BOOKMARKINFO, DBPROP_UNIQUEROWS, DBPROP_IRowsetFind, DBPROP_IRowsetScroll,
+            DBPROP_IRowsetRefresh, DBPROP_FINDCOMPAREOPS, DBPROP_ORDEREDBOOKMARKS, DBPROP_CLIENTCURSOR
+    };
+
+    DWORD prov_props[12] = {
+            DBPROP_ABORTPRESERVE, DBPROP_ACTIVESESSIONS, DBPROP_ASYNCTXNCOMMIT, DBPROP_AUTH_CACHE_AUTHINFO,
+            DBPROP_AUTH_ENCRYPT_PASSWORD, DBPROP_AUTH_INTEGRATED, DBPROP_AUTH_MASK_PASSWORD, DBPROP_AUTH_PASSWORD,
+            DBPROP_AUTH_PERSIST_ENCRYPTED, DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, DBPROP_AUTH_USERID, DBPROP_BLOCKINGSTORAGEOBJECTS
+    };
+
+    hr = ICommandProperties_GetProperties(props, 0, NULL, &count, &propset);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(count == 2, "got %d\n", count);
+    ok(propset[0].cProperties == 68, "got %d\n", propset[0].cProperties);
+    ok(propset[1].cProperties == 12, "got %d\n", propset[1].cProperties);
+
+    ok(IsEqualGUID(&DBPROPSET_ROWSET, &propset[0].guidPropertySet), "got %s\n",
+        debugstr_guid(&propset[0].guidPropertySet));
+    for (i = 0; i < propset[0].cProperties; i++)
+    {
+        ok(propset[0].rgProperties[i].dwPropertyID == row_props[i], "%d: got 0x%08x\n", i, propset[0].rgProperties[i].dwPropertyID);
+
+        switch(propset[0].rgProperties[i].dwPropertyID )
+        {
+            case DBPROP_BOOKMARKTYPE:
+            case DBPROP_NOTIFICATIONGRANULARITY:
+            case DBPROP_ACCESSORDER:
+                ok(V_VT(&propset[0].rgProperties[i].vValue) == VT_I4, "%d: got %d\n", i, V_VT(&propset[0].rgProperties[i].vValue));
+                ok(V_I4(&propset[0].rgProperties[i].vValue) == 1, "%d: got %d\n", i, V_I4(&propset[0].rgProperties[i].vValue));
+                break;
+            case DBPROP_MAXOPENROWS:
+            case DBPROP_MAXPENDINGROWS:
+            case DBPROP_MAXROWS:
+            case DBPROP_UPDATABILITY:
+            case DBPROP_BOOKMARKINFO:
+                ok(V_VT(&propset[0].rgProperties[i].vValue) == VT_I4, "%d: got %d\n", i, V_VT(&propset[0].rgProperties[i].vValue));
+                ok(V_I4(&propset[0].rgProperties[i].vValue) == 0, "%d: got %d\n", i, V_I4(&propset[0].rgProperties[i].vValue));
+                break;
+            case DBPROP_FINDCOMPAREOPS:
+                ok(V_VT(&propset[0].rgProperties[i].vValue) == VT_I4, "%d: got %d\n", i, V_VT(&propset[0].rgProperties[i].vValue));
+                ok(V_I4(&propset[0].rgProperties[i].vValue) == 27, "%d: got %d\n", i, V_I4(&propset[0].rgProperties[i].vValue));
+                break;
+            case DBPROP_NOTIFICATIONPHASES:
+                ok(V_VT(&propset[0].rgProperties[i].vValue) == VT_I4, "%d: got %d\n", i, V_VT(&propset[0].rgProperties[i].vValue));
+                ok(V_I4(&propset[0].rgProperties[i].vValue) == 31, "%d: got %d\n", i, V_I4(&propset[0].rgProperties[i].vValue));
+                break;
+            case DBPROP_ROWTHREADMODEL:
+                ok(V_VT(&propset[0].rgProperties[i].vValue) == VT_I4, "%d: got %d\n", i, V_VT(&propset[0].rgProperties[i].vValue));
+                ok(V_I4(&propset[0].rgProperties[i].vValue) == 2, "%d: got %d\n", i, V_I4(&propset[0].rgProperties[i].vValue));
+                break;
+            case DBPROP_NOTIFYCOLUMNSET:
+            case DBPROP_NOTIFYROWDELETE:
+            case DBPROP_NOTIFYROWFIRSTCHANGE:
+            case DBPROP_NOTIFYROWINSERT:
+            case DBPROP_NOTIFYROWRESYNCH:
+            case DBPROP_NOTIFYROWSETRELEASE:
+            case DBPROP_NOTIFYROWSETFETCHPOSITIONCHANGE:
+            case DBPROP_NOTIFYROWUNDOCHANGE:
+            case DBPROP_NOTIFYROWUNDODELETE:
+            case DBPROP_NOTIFYROWUNDOINSERT:
+            case DBPROP_NOTIFYROWUPDATE:
+                ok(V_VT(&propset[0].rgProperties[i].vValue) == VT_I4, "%d: got %d\n", i, V_VT(&propset[0].rgProperties[i].vValue));
+                ok(V_I4(&propset[0].rgProperties[i].vValue) == 3, "%d: got %d\n", i, V_I4(&propset[0].rgProperties[i].vValue));
+                break;
+            case DBPROP_BLOCKINGSTORAGEOBJECTS:
+            case DBPROP_IMMOBILEROWS:
+            case DBPROP_LITERALIDENTITY:
+            case DBPROP_REENTRANTEVENTS:
+            case DBPROP_IAccessor:
+            case DBPROP_IColumnsInfo:
+            case DBPROP_IColumnsRowset:
+            case DBPROP_IRowset:
+            case DBPROP_IRowsetInfo:
+            case DBPROP_ISupportErrorInfo:
+            case DBPROP_CHANGEINSERTEDROWS:
+            case DBPROP_IConvertType:
+            case DBPROP_IRowsetScroll:
+            case DBPROP_IRowsetRefresh:
+            case DBPROP_ORDEREDBOOKMARKS:
+            case DBPROP_CLIENTCURSOR:
+                ok(V_VT(&propset[0].rgProperties[i].vValue) == VT_BOOL, "%d: got %d\n", i, V_VT(&propset[0].rgProperties[i].vValue));
+                ok(V_BOOL(&propset[0].rgProperties[i].vValue) == VARIANT_TRUE, "%d: got %d\n", i, V_I4(&propset[0].rgProperties[i].vValue));
+                break;
+            default:
+                ok(V_VT(&propset[0].rgProperties[i].vValue) == VT_BOOL, "%d: got %d\n", i, V_VT(&propset[0].rgProperties[i].vValue));
+                ok(V_BOOL(&propset[0].rgProperties[i].vValue) == VARIANT_FALSE, "%d: got %d\n", i, V_I4(&propset[0].rgProperties[i].vValue));
+                break;
+        }
+    }
+
+    ok(IsEqualGUID(&DBPROPSET_PROVIDERROWSET, &propset[1].guidPropertySet), "got %s\n",
+        debugstr_guid(&propset[1].guidPropertySet));
+    for (i = 0; i < propset[1].cProperties; i++)
+    {
+        ok(propset[1].rgProperties[i].dwPropertyID == prov_props[i], "%d: got 0x%08x\n", i, propset[1].rgProperties[i].dwPropertyID);
+
+        switch(propset[1].rgProperties[i].dwPropertyID )
+        {
+            case DBPROP_AUTH_ENCRYPT_PASSWORD:
+                ok(V_VT(&propset[1].rgProperties[i].vValue) == VT_I4, "%d: got %d\n", i, V_VT(&propset[1].rgProperties[i].vValue));
+                ok(V_I4(&propset[1].rgProperties[i].vValue) == 0, "%d: got %d\n", i, V_I4(&propset[1].rgProperties[i].vValue));
+                break;
+            case DBPROP_AUTH_INTEGRATED:
+                ok(V_VT(&propset[1].rgProperties[i].vValue) == VT_I4, "%d: got %d\n", i, V_VT(&propset[1].rgProperties[i].vValue));
+                ok(V_I4(&propset[1].rgProperties[i].vValue) == 14, "%d: got %d\n", i, V_I4(&propset[1].rgProperties[i].vValue));
+                break;
+            case DBPROP_BLOCKINGSTORAGEOBJECTS:
+                ok(V_VT(&propset[1].rgProperties[i].vValue) == VT_BOOL, "%d: got %d\n", i, V_VT(&propset[1].rgProperties[i].vValue));
+                todo_wine ok(V_BOOL(&propset[1].rgProperties[i].vValue) == VARIANT_FALSE, "%d: got %d\n", i, V_I4(&propset[1].rgProperties[i].vValue));
+                break;
+            default:
+                ok(V_VT(&propset[1].rgProperties[i].vValue) == VT_BOOL, "%d: got %d\n", i, V_VT(&propset[1].rgProperties[i].vValue));
+                ok(V_BOOL(&propset[1].rgProperties[i].vValue) == VARIANT_FALSE, "%d: got %d\n", i, V_I4(&propset[1].rgProperties[i].vValue));
+                break;
+        }
+    }
+
+    CoTaskMemFree(propset);
+}
+
 static void test_command_interfaces(IUnknown *cmd)
 {
     HRESULT hr;
@@ -198,6 +343,7 @@ static void test_command_interfaces(IUnknown *cmd)
 
     hr = IUnknown_QueryInterface(cmd, &IID_ICommandProperties, (void**)&commandProp);
     ok(hr == S_OK, "got 0x%08x\n", hr);
+    test_command_properties(commandProp);
     ICommandProperties_Release(commandProp);
 
     hr = IUnknown_QueryInterface(cmd, &IID_ICommandWithParameters, (void**)&cmdwithparams);
-- 
2.33.0




More information about the wine-devel mailing list