From ebf0070899e8ab82c9f9de5f96c9f7d5953b5fff Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sun, 7 Nov 2021 19:11:57 +1100 Subject: [PATCH] msdasql: Implement ICommandProperties SetProperties. Signed-off-by: Alistair Leslie-Hughes --- dlls/msdasql/session.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/dlls/msdasql/session.c b/dlls/msdasql/session.c index 795927fe778..01cd7cf10ea 100644 --- a/dlls/msdasql/session.c +++ b/dlls/msdasql/session.c @@ -1233,7 +1233,41 @@ static HRESULT WINAPI command_prop_SetProperties(ICommandProperties *iface, ULON DBPROPSET propertyset[]) { struct command *command = impl_from_ICommandProperties( iface ); - FIXME("%p, %lu, %p\n", command, count, propertyset); + int i, j, k; + + TRACE("%p %lu, %p\n", command, count, propertyset); + + for(i=0; i < count; i++) + { + TRACE("set %s, count %ld\n", debugstr_guid(&propertyset[i].guidPropertySet), propertyset[i].cProperties); + for(j=0; j < propertyset[i].cProperties; j++) + { + for(k=0; k < command->prop_count; k++) + { + if (command->properties[k].property_id == propertyset[i].rgProperties[j].dwPropertyID) + { + TRACE("Found property 0x%08lx\n", command->properties[k].property_id); + if (command->properties[k].flags & DBPROPFLAGS_WRITE) + { + if (command->properties[k].vartype == VT_BOOL) + { + command->properties[k].value = V_BOOL(&propertyset[i].rgProperties[j].vValue); + } + else if (command->properties[k].vartype == VT_I4) + { + command->properties[k].value = V_I4(&propertyset[i].rgProperties[j].vValue); + } + else + ERR("Unknown variant type %d\n", command->properties[j].vartype); + } + else + WARN("Attempting to set Readonly property\n"); + + break; + } + } + } + } return S_OK; }