Commit 8333a1ae authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msado15: Add a stub _Connection implementation.

parent 7353f6f1
MODULE = msado15.dll MODULE = msado15.dll
IMPORTS = oleaut32
EXTRADLLFLAGS = -mno-cygwin EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ C_SRCS = \
connection.c \
main.c main.c
IDL_SRCS = msado15_tlb.idl IDL_SRCS = \
msado15_classes.idl \
msado15_tlb.idl
...@@ -19,10 +19,18 @@ ...@@ -19,10 +19,18 @@
#include <stdarg.h> #include <stdarg.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "initguid.h"
#define COBJMACROS
#include "objbase.h" #include "objbase.h"
#include "rpcproxy.h" #include "rpcproxy.h"
#include "msado15_backcompat.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
#include "msado15_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(msado15);
static HINSTANCE hinstance; static HINSTANCE hinstance;
...@@ -38,6 +46,104 @@ BOOL WINAPI DllMain( HINSTANCE dll, DWORD reason, LPVOID reserved ) ...@@ -38,6 +46,104 @@ BOOL WINAPI DllMain( HINSTANCE dll, DWORD reason, LPVOID reserved )
return TRUE; return TRUE;
} }
typedef HRESULT (*fnCreateInstance)( void **obj );
struct msadocf
{
IClassFactory IClassFactory_iface;
fnCreateInstance pfnCreateInstance;
};
static inline struct msadocf *impl_from_IClassFactory( IClassFactory *iface )
{
return CONTAINING_RECORD( iface, struct msadocf, IClassFactory_iface );
}
static HRESULT WINAPI msadocf_QueryInterface( IClassFactory *iface, REFIID riid, void **obj )
{
if (IsEqualGUID( riid, &IID_IUnknown ) || IsEqualGUID( riid, &IID_IClassFactory ))
{
IClassFactory_AddRef( iface );
*obj = iface;
return S_OK;
}
FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
return E_NOINTERFACE;
}
static ULONG WINAPI msadocf_AddRef( IClassFactory *iface )
{
return 2;
}
static ULONG WINAPI msadocf_Release( IClassFactory *iface )
{
return 1;
}
static HRESULT WINAPI msadocf_CreateInstance( IClassFactory *iface, LPUNKNOWN outer, REFIID riid, void **obj )
{
struct msadocf *cf = impl_from_IClassFactory( iface );
IUnknown *unknown;
HRESULT hr;
TRACE( "%p, %s, %p\n", outer, debugstr_guid(riid), obj );
*obj = NULL;
if (outer)
return CLASS_E_NOAGGREGATION;
hr = cf->pfnCreateInstance( (void **)&unknown );
if (FAILED(hr))
return hr;
hr = IUnknown_QueryInterface( unknown, riid, obj );
IUnknown_Release( unknown );
return hr;
}
static HRESULT WINAPI msadocf_LockServer( IClassFactory *iface, BOOL dolock )
{
FIXME( "%p, %d\n", iface, dolock );
return S_OK;
}
static const struct IClassFactoryVtbl msadocf_vtbl =
{
msadocf_QueryInterface,
msadocf_AddRef,
msadocf_Release,
msadocf_CreateInstance,
msadocf_LockServer
};
static struct msadocf connection_cf = { { &msadocf_vtbl }, Connection_create };
/***********************************************************************
* DllGetClassObject
*/
HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **obj )
{
IClassFactory *cf = NULL;
TRACE( "%s, %s, %p\n", debugstr_guid(clsid), debugstr_guid(iid), obj );
if (IsEqualGUID( clsid, &CLSID_Connection ))
{
cf = &connection_cf.IClassFactory_iface;
}
if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
return IClassFactory_QueryInterface( cf, iid, obj );
}
/******************************************************************
* DllCanUnloadNow
*/
HRESULT WINAPI DllCanUnloadNow(void)
{
return S_FALSE;
}
/*********************************************************************** /***********************************************************************
* DllRegisterServer * DllRegisterServer
*/ */
......
@ stub DllCanUnloadNow @ stdcall -private DllCanUnloadNow()
@ stub DllGetClassObject @ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stdcall -private DllRegisterServer() @ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer() @ stdcall -private DllUnregisterServer()
/*
* Copyright 2019 Hans Leidekker for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#pragma makedep register
[
threading(apartment),
progid("ADODB.Connection.6.0"),
vi_progid("ADODB.Connection"),
uuid(00000514-0000-0010-8000-00aa006d2ea4)
]
coclass Connection { interface _Connection; }
/*
* Copyright 2019 Hans Leidekker for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _WINE_MSADO15_PRIVATE_H_
#define _WINE_MSADO15_PRIVATE_H_
HRESULT Connection_create( void ** ) DECLSPEC_HIDDEN;
#endif /* _WINE_MSADO15_PRIVATE_H_ */
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