*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
+#include "winuser.h"
#include "objbase.h"
#include "winerror.h"
#include "wine/debug.h"
+#include "dplay.h"
+#include "dplobby.h"
+#include "initguid.h"
#include "dpinit.h"
WINE_DEFAULT_DEBUG_CHANNEL(dplay);
typedef struct
{
/* IUnknown fields */
- const IClassFactoryVtbl *lpVtbl;
- DWORD ref;
+ IClassFactory IClassFactory_iface;
+ LONG ref;
} IClassFactoryImpl;
+static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
+{
+ return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
+}
+
static HRESULT WINAPI
DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
- IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+ IClassFactoryImpl *This = impl_from_IClassFactory(iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
static ULONG WINAPI
DP_and_DPL_AddRef(LPCLASSFACTORY iface) {
- IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+ IClassFactoryImpl *This = impl_from_IClassFactory(iface);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY iface) {
- IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+ IClassFactoryImpl *This = impl_from_IClassFactory(iface);
/* static class (reference starts @ 1), won't ever be freed */
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI DP_and_DPL_CreateInstance(
LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj
) {
- IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+ IClassFactoryImpl *This = impl_from_IClassFactory(iface);
TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
}
static HRESULT WINAPI DP_and_DPL_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
- IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+ IClassFactoryImpl *This = impl_from_IClassFactory(iface);
FIXME("(%p)->(%d),stub!\n",This,dolock);
return S_OK;
}
DP_and_DPL_LockServer
};
-static IClassFactoryImpl DP_and_DPL_CF = {&DP_and_DPL_Vtbl, 1 };
+static IClassFactoryImpl DP_and_DPL_CF = {{&DP_and_DPL_Vtbl}, 1 };
/*******************************************************************************
- * DllGetClassObject [DPLAYX.11]
+ * DllGetClassObject [DPLAYX.@]
* Retrieves DP or DPL class object from a DLL object
*
* NOTES
* Failure: CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, E_INVALIDARG,
* E_UNEXPECTED
*/
-DWORD WINAPI DPLAYX_DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID *ppv)
+HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if ( IsEqualCLSID( riid, &IID_IClassFactory ) )
{
- *ppv = (LPVOID)&DP_and_DPL_CF;
+ *ppv = &DP_and_DPL_CF;
IClassFactory_AddRef( (IClassFactory*)*ppv );
return S_OK;