2 * Copyright 2019 Alistair Leslie-Hughes
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include "msado15_backcompat.h"
25 #include "wine/debug.h"
26 #include "wine/heap.h"
28 #include "msado15_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(msado15
);
34 _Command Command_iface
;
38 static inline struct command
*impl_from_Command( _Command
*iface
)
40 return CONTAINING_RECORD( iface
, struct command
, Command_iface
);
43 static HRESULT WINAPI
command_QueryInterface( _Command
*iface
, REFIID riid
, void **obj
)
45 TRACE( "%p, %s, %p\n", iface
, debugstr_guid(riid
), obj
);
49 if (IsEqualIID(riid
, &IID_IUnknown
) ||
50 IsEqualIID(riid
, &IID_IDispatch
) ||
51 IsEqualIID(riid
, &IID__ADO
) ||
52 IsEqualIID(riid
, &IID_Command15
) ||
53 IsEqualIID(riid
, &IID_Command25
) ||
54 IsEqualIID(riid
, &IID__Command
))
60 FIXME( "interface %s not implemented\n", debugstr_guid(riid
) );
64 _Command_AddRef( iface
);
68 static ULONG WINAPI
command_AddRef( _Command
*iface
)
70 struct command
*command
= impl_from_Command( iface
);
71 return InterlockedIncrement( &command
->ref
);
74 static ULONG WINAPI
command_Release( _Command
*iface
)
76 struct command
*command
= impl_from_Command( iface
);
77 LONG ref
= InterlockedDecrement( &command
->ref
);
80 TRACE( "destroying %p\n", command
);
86 static HRESULT WINAPI
command_GetTypeInfoCount( _Command
*iface
, UINT
*count
)
88 FIXME( "%p, %p\n", iface
, count
);
92 static HRESULT WINAPI
command_GetTypeInfo( _Command
*iface
, UINT index
, LCID lcid
, ITypeInfo
**info
)
94 FIXME( "%p, %u, %u, %p\n", iface
, index
, lcid
, info
);
98 static HRESULT WINAPI
command_GetIDsOfNames( _Command
*iface
, REFIID riid
, LPOLESTR
*names
, UINT count
,
99 LCID lcid
, DISPID
*dispid
)
101 FIXME( "%p, %s, %p, %u, %u, %p\n", iface
, debugstr_guid(riid
), names
, count
, lcid
, dispid
);
105 static HRESULT WINAPI
command_Invoke( _Command
*iface
, DISPID member
, REFIID riid
, LCID lcid
, WORD flags
,
106 DISPPARAMS
*params
, VARIANT
*result
, EXCEPINFO
*excep_info
, UINT
*arg_err
)
108 FIXME( "%p, %d, %s, %d, %d, %p, %p, %p, %p\n", iface
, member
, debugstr_guid(riid
), lcid
, flags
, params
,
109 result
, excep_info
, arg_err
);
113 static HRESULT WINAPI
command_get_Properties( _Command
*iface
, Properties
**props
)
115 FIXME( "%p, %p\n", iface
, props
);
119 static HRESULT WINAPI
command_get_ActiveConnection( _Command
*iface
, _Connection
**connection
)
121 FIXME( "%p, %p\n", iface
, connection
);
125 static HRESULT WINAPI
command_putref_ActiveConnection( _Command
*iface
, _Connection
*connection
)
127 FIXME( "%p, %p\n", iface
, connection
);
131 static HRESULT WINAPI
command_put_ActiveConnection( _Command
*iface
, VARIANT connection
)
133 FIXME( "%p, %s\n", iface
, debugstr_variant(&connection
) );
137 static HRESULT WINAPI
command_get_CommandText( _Command
*iface
, BSTR
*text
)
139 FIXME( "%p, %p\n", iface
, text
);
143 static HRESULT WINAPI
command_put_CommandText( _Command
*iface
, BSTR text
)
145 FIXME( "%p, %s\n", iface
, debugstr_w(text
) );
149 static HRESULT WINAPI
command_get_CommandTimeout( _Command
*iface
, LONG
*timeout
)
151 FIXME( "%p, %p\n", iface
, timeout
);
155 static HRESULT WINAPI
command_put_CommandTimeout( _Command
*iface
, LONG timeout
)
157 FIXME( "%p, %d\n", iface
, timeout
);
161 static HRESULT WINAPI
command_get_Prepared( _Command
*iface
, VARIANT_BOOL
*prepared
)
163 FIXME( "%p, %p\n", iface
, prepared
);
167 static HRESULT WINAPI
command_put_Prepared( _Command
*iface
, VARIANT_BOOL prepared
)
169 FIXME( "%p, %d\n", iface
, prepared
);
173 static HRESULT WINAPI
command_Execute( _Command
*iface
, VARIANT
*affected
, VARIANT
*parameters
,
174 LONG options
, _Recordset
**recordset
)
176 FIXME( "%p, %p, %p, %d, %p\n", iface
, affected
, parameters
, options
, recordset
);
180 static HRESULT WINAPI
command_CreateParameter( _Command
*iface
, BSTR name
, DataTypeEnum type
,
181 ParameterDirectionEnum direction
, LONG size
, VARIANT value
,
182 _Parameter
**parameter
)
184 FIXME( "%p, %s, %d, %d, %d, %p\n", iface
, debugstr_w(name
), type
, direction
, size
, parameter
);
188 static HRESULT WINAPI
command_get_Parameters( _Command
*iface
, Parameters
**parameters
)
190 FIXME( "%p, %p\n", iface
, parameters
);
194 static HRESULT WINAPI
command_put_CommandType( _Command
*iface
, CommandTypeEnum type
)
196 FIXME( "%p, %d\n", iface
, type
);
200 static HRESULT WINAPI
command_get_CommandType( _Command
*iface
, CommandTypeEnum
*type
)
202 FIXME( "%p, %p\n", iface
, type
);
206 static HRESULT WINAPI
command_get_Name(_Command
*iface
, BSTR
*name
)
208 FIXME( "%p, %p\n", iface
, name
);
212 static HRESULT WINAPI
command_put_Name( _Command
*iface
, BSTR name
)
214 FIXME( "%p, %s\n", iface
, debugstr_w(name
) );
218 static HRESULT WINAPI
command_get_State( _Command
*iface
, LONG
*state
)
220 FIXME( "%p, %p\n", iface
, state
);
224 static HRESULT WINAPI
command_Cancel( _Command
*iface
)
226 FIXME( "%p\n", iface
);
230 static HRESULT WINAPI
command_putref_CommandStream( _Command
*iface
, IUnknown
*stream
)
232 FIXME( "%p, %p\n", iface
, stream
);
236 static HRESULT WINAPI
command_get_CommandStream( _Command
*iface
, VARIANT
*stream
)
238 FIXME( "%p, %p\n", iface
, stream
);
242 static HRESULT WINAPI
command_put_Dialect( _Command
*iface
, BSTR dialect
)
244 FIXME( "%p, %s\n", iface
, debugstr_w(dialect
) );
248 static HRESULT WINAPI
command_get_Dialect( _Command
*iface
, BSTR
*dialect
)
250 FIXME( "%p, %p\n", iface
, dialect
);
254 static HRESULT WINAPI
command_put_NamedParameters( _Command
*iface
, VARIANT_BOOL parameters
)
256 FIXME( "%p, %d\n", iface
, parameters
);
260 static HRESULT WINAPI
command_get_NamedParameters( _Command
*iface
, VARIANT_BOOL
*parameters
)
262 FIXME( "%p, %p\n", iface
, parameters
);
266 static const struct _CommandVtbl command_vtbl
=
268 command_QueryInterface
,
271 command_GetTypeInfoCount
,
273 command_GetIDsOfNames
,
275 command_get_Properties
,
276 command_get_ActiveConnection
,
277 command_putref_ActiveConnection
,
278 command_put_ActiveConnection
,
279 command_get_CommandText
,
280 command_put_CommandText
,
281 command_get_CommandTimeout
,
282 command_put_CommandTimeout
,
283 command_get_Prepared
,
284 command_put_Prepared
,
286 command_CreateParameter
,
287 command_get_Parameters
,
288 command_put_CommandType
,
289 command_get_CommandType
,
294 command_putref_CommandStream
,
295 command_get_CommandStream
,
298 command_put_NamedParameters
,
299 command_get_NamedParameters
302 HRESULT
Command_create( void **obj
)
304 struct command
*command
;
306 if (!(command
= heap_alloc( sizeof(*command
) ))) return E_OUTOFMEMORY
;
307 command
->Command_iface
.lpVtbl
= &command_vtbl
;
310 *obj
= &command
->Command_iface
;
311 TRACE( "returning iface %p\n", *obj
);