2 * msdaps initialisation.
4 * Copyright 2010 Huw Davies
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #define NONAMELESSUNION
25 #define NONAMELESSSTRUCT
35 #define DBINITCONSTANTS
38 #include "row_server.h"
40 #include "wine/debug.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(oledb
);
44 extern BOOL WINAPI
msdaps_DllMain(HINSTANCE
, DWORD
, LPVOID
) DECLSPEC_HIDDEN
;
45 extern HRESULT WINAPI
msdaps_DllGetClassObject(REFCLSID
, REFIID
, LPVOID
*) DECLSPEC_HIDDEN
;
46 extern HRESULT WINAPI
msdaps_DllCanUnloadNow(void) DECLSPEC_HIDDEN
;
47 extern HRESULT WINAPI
msdaps_DllRegisterServer(void) DECLSPEC_HIDDEN
;
48 extern HRESULT WINAPI
msdaps_DllUnregisterServer(void) DECLSPEC_HIDDEN
;
50 /*****************************************************************************
53 BOOL WINAPI
DllMain(HINSTANCE instance
, DWORD reason
, LPVOID reserved
)
55 return msdaps_DllMain(instance
, reason
, reserved
);
59 /******************************************************************************
64 IClassFactory IClassFactory_iface
;
65 HRESULT (*create_object
)( IUnknown
*, LPVOID
* );
68 static inline cf
*impl_from_IClassFactory(IClassFactory
*iface
)
70 return CONTAINING_RECORD(iface
, cf
, IClassFactory_iface
);
73 static HRESULT WINAPI
CF_QueryInterface(IClassFactory
*iface
, REFIID riid
, void **obj
)
75 cf
*This
= impl_from_IClassFactory(iface
);
77 TRACE("(%p, %s, %p)\n", This
, debugstr_guid(riid
), obj
);
79 if( IsEqualCLSID( riid
, &IID_IUnknown
) ||
80 IsEqualCLSID( riid
, &IID_IClassFactory
) )
82 IClassFactory_AddRef( iface
);
89 static ULONG WINAPI
CF_AddRef(IClassFactory
*iface
)
94 static ULONG WINAPI
CF_Release(IClassFactory
*iface
)
99 static HRESULT WINAPI
CF_CreateInstance(IClassFactory
*iface
, IUnknown
*pOuter
, REFIID riid
, void **obj
)
101 cf
*This
= impl_from_IClassFactory(iface
);
102 IUnknown
*unk
= NULL
;
105 TRACE("(%p, %p, %s, %p)\n", This
, pOuter
, debugstr_guid(riid
), obj
);
107 r
= This
->create_object( pOuter
, (void **) &unk
);
110 r
= IUnknown_QueryInterface( unk
, riid
, obj
);
111 IUnknown_Release( unk
);
116 static HRESULT WINAPI
CF_LockServer(IClassFactory
*iface
, BOOL dolock
)
118 FIXME("(%p, %d): stub\n", iface
, dolock
);
122 static const IClassFactoryVtbl CF_Vtbl
=
131 static cf row_server_cf
= { { &CF_Vtbl
}, create_row_server
};
132 static cf row_proxy_cf
= { { &CF_Vtbl
}, create_row_marshal
};
133 static cf rowset_server_cf
= { { &CF_Vtbl
}, create_rowset_server
};
134 static cf rowset_proxy_cf
= { { &CF_Vtbl
}, create_rowset_marshal
};
136 /***********************************************************************
139 HRESULT WINAPI
DllGetClassObject(REFCLSID clsid
, REFIID iid
, LPVOID
*obj
)
141 TRACE("(%s, %s, %p)\n", debugstr_guid(clsid
), debugstr_guid(iid
), obj
);
143 if (IsEqualCLSID(clsid
, &CLSID_wine_row_server
))
145 *obj
= &row_server_cf
;
149 if (IsEqualCLSID(clsid
, &CLSID_wine_row_proxy
))
151 *obj
= &row_proxy_cf
;
155 if (IsEqualCLSID(clsid
, &CLSID_wine_rowset_server
))
157 *obj
= &rowset_server_cf
;
161 if (IsEqualCLSID(clsid
, &CLSID_wine_rowset_proxy
))
163 *obj
= &rowset_proxy_cf
;
167 return msdaps_DllGetClassObject(clsid
, iid
, obj
);
170 /***********************************************************************
173 HRESULT WINAPI
DllCanUnloadNow(void)
175 return msdaps_DllCanUnloadNow();
178 /***********************************************************************
181 HRESULT WINAPI
DllRegisterServer(void)
183 return msdaps_DllRegisterServer();
186 /***********************************************************************
187 * DllUnregisterServer
189 HRESULT WINAPI
DllUnregisterServer(void)
191 return msdaps_DllUnregisterServer();