wined3d: Use the bo binding in wined3d_context_gl_map_bo_address().
[wine.git] / dlls / msado15 / command.c
bloba96fd7399082c75fe7f12c18a2d4e701726fe01e
1 /*
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
18 #include <stdarg.h>
19 #include "windef.h"
20 #include "winbase.h"
21 #define COBJMACROS
22 #include "objbase.h"
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);
32 struct command
34 _Command Command_iface;
35 LONG ref;
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 );
47 *obj = NULL;
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))
56 *obj = iface;
58 else
60 FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
61 return E_NOINTERFACE;
64 _Command_AddRef( iface );
65 return S_OK;
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 );
78 if (!ref)
80 TRACE( "destroying %p\n", command );
81 heap_free( command );
83 return ref;
86 static HRESULT WINAPI command_GetTypeInfoCount( _Command *iface, UINT *count )
88 FIXME( "%p, %p\n", iface, count );
89 return E_NOTIMPL;
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 );
95 return E_NOTIMPL;
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 );
102 return E_NOTIMPL;
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 );
110 return E_NOTIMPL;
113 static HRESULT WINAPI command_get_Properties( _Command *iface, Properties **props )
115 FIXME( "%p, %p\n", iface, props );
116 return E_NOTIMPL;
119 static HRESULT WINAPI command_get_ActiveConnection( _Command *iface, _Connection **connection )
121 FIXME( "%p, %p\n", iface, connection );
122 return E_NOTIMPL;
125 static HRESULT WINAPI command_putref_ActiveConnection( _Command *iface, _Connection *connection )
127 FIXME( "%p, %p\n", iface, connection );
128 return E_NOTIMPL;
131 static HRESULT WINAPI command_put_ActiveConnection( _Command *iface, VARIANT connection )
133 FIXME( "%p, %s\n", iface, debugstr_variant(&connection) );
134 return E_NOTIMPL;
137 static HRESULT WINAPI command_get_CommandText( _Command *iface, BSTR *text )
139 FIXME( "%p, %p\n", iface, text );
140 return E_NOTIMPL;
143 static HRESULT WINAPI command_put_CommandText( _Command *iface, BSTR text )
145 FIXME( "%p, %s\n", iface, debugstr_w(text) );
146 return E_NOTIMPL;
149 static HRESULT WINAPI command_get_CommandTimeout( _Command *iface, LONG *timeout )
151 FIXME( "%p, %p\n", iface, timeout );
152 return E_NOTIMPL;
155 static HRESULT WINAPI command_put_CommandTimeout( _Command *iface, LONG timeout )
157 FIXME( "%p, %d\n", iface, timeout );
158 return E_NOTIMPL;
161 static HRESULT WINAPI command_get_Prepared( _Command *iface, VARIANT_BOOL *prepared )
163 FIXME( "%p, %p\n", iface, prepared );
164 return E_NOTIMPL;
167 static HRESULT WINAPI command_put_Prepared( _Command *iface, VARIANT_BOOL prepared )
169 FIXME( "%p, %d\n", iface, prepared );
170 return E_NOTIMPL;
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 );
177 return E_NOTIMPL;
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 );
185 return E_NOTIMPL;
188 static HRESULT WINAPI command_get_Parameters( _Command *iface, Parameters **parameters )
190 FIXME( "%p, %p\n", iface, parameters );
191 return E_NOTIMPL;
194 static HRESULT WINAPI command_put_CommandType( _Command *iface, CommandTypeEnum type )
196 FIXME( "%p, %d\n", iface, type );
197 return E_NOTIMPL;
200 static HRESULT WINAPI command_get_CommandType( _Command *iface, CommandTypeEnum *type )
202 FIXME( "%p, %p\n", iface, type );
203 return E_NOTIMPL;
206 static HRESULT WINAPI command_get_Name(_Command *iface, BSTR *name)
208 FIXME( "%p, %p\n", iface, name );
209 return E_NOTIMPL;
212 static HRESULT WINAPI command_put_Name( _Command *iface, BSTR name )
214 FIXME( "%p, %s\n", iface, debugstr_w(name) );
215 return E_NOTIMPL;
218 static HRESULT WINAPI command_get_State( _Command *iface, LONG *state )
220 FIXME( "%p, %p\n", iface, state );
221 return E_NOTIMPL;
224 static HRESULT WINAPI command_Cancel( _Command *iface )
226 FIXME( "%p\n", iface );
227 return E_NOTIMPL;
230 static HRESULT WINAPI command_putref_CommandStream( _Command *iface, IUnknown *stream )
232 FIXME( "%p, %p\n", iface, stream );
233 return E_NOTIMPL;
236 static HRESULT WINAPI command_get_CommandStream( _Command *iface, VARIANT *stream )
238 FIXME( "%p, %p\n", iface, stream );
239 return E_NOTIMPL;
242 static HRESULT WINAPI command_put_Dialect( _Command *iface, BSTR dialect )
244 FIXME( "%p, %s\n", iface, debugstr_w(dialect) );
245 return E_NOTIMPL;
248 static HRESULT WINAPI command_get_Dialect( _Command *iface, BSTR *dialect )
250 FIXME( "%p, %p\n", iface, dialect );
251 return E_NOTIMPL;
254 static HRESULT WINAPI command_put_NamedParameters( _Command *iface, VARIANT_BOOL parameters )
256 FIXME( "%p, %d\n", iface, parameters );
257 return E_NOTIMPL;
260 static HRESULT WINAPI command_get_NamedParameters( _Command *iface, VARIANT_BOOL *parameters )
262 FIXME( "%p, %p\n", iface, parameters );
263 return E_NOTIMPL;
266 static const struct _CommandVtbl command_vtbl =
268 command_QueryInterface,
269 command_AddRef,
270 command_Release,
271 command_GetTypeInfoCount,
272 command_GetTypeInfo,
273 command_GetIDsOfNames,
274 command_Invoke,
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,
285 command_Execute,
286 command_CreateParameter,
287 command_get_Parameters,
288 command_put_CommandType,
289 command_get_CommandType,
290 command_get_Name,
291 command_put_Name,
292 command_get_State,
293 command_Cancel,
294 command_putref_CommandStream,
295 command_get_CommandStream,
296 command_put_Dialect,
297 command_get_Dialect,
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;
308 command->ref = 1;
310 *obj = &command->Command_iface;
311 TRACE( "returning iface %p\n", *obj );
312 return S_OK;