Commit 033ae921 authored by Raphael Junqueira's avatar Raphael Junqueira Committed by Alexandre Julliard

Added dxdiagn.dll with a simple implementation of IDxDiagProvider.

parent 186b419e
......@@ -1537,6 +1537,7 @@ dlls/dpnhpast/Makefile
dlls/dsound/Makefile
dlls/dsound/tests/Makefile
dlls/dswave/Makefile
dlls/dxdiagn/Makefile
dlls/dxerr8/Makefile
dlls/dxerr9/Makefile
dlls/dxguid/Makefile
......
......@@ -51,6 +51,7 @@ BASEDIRS = \
dpnhpast \
dsound \
dswave \
dxdiagn \
gdi \
iccvid \
icmp \
......@@ -266,6 +267,7 @@ SYMLINKS_SO = \
dpnhpast.dll.so \
dsound.dll.so \
dswave.dll.so \
dxdiagn.dll.so \
gdi32.dll.so \
iccvid.dll.so \
icmp.dll.so \
......@@ -512,6 +514,9 @@ dsound.dll.so: dsound/dsound.dll.so
dswave.dll.so: dswave/dswave.dll.so
$(RM) $@ && $(LN_S) dswave/dswave.dll.so $@
dxdiagn.dll.so: dxdiagn/dxdiagn.dll.so
$(RM) $@ && $(LN_S) dxdiagn/dxdiagn.dll.so $@
gdi32.dll.so: gdi/gdi32.dll.so
$(RM) $@ && $(LN_S) gdi/gdi32.dll.so $@
......@@ -962,6 +967,7 @@ IMPORT_LIBS = \
libdpnhpast \
libdsound \
libdswave \
libdxdiagn \
libgdi32 \
libglu32 \
libglut32 \
......@@ -1246,6 +1252,11 @@ libdswave.def: dswave/dswave.spec.def
libdswave.a: dswave/dswave.spec.def
$(DLLTOOL) -k -l $@ -d dswave/dswave.spec.def
libdxdiagn.def: dxdiagn/dxdiagn.spec.def
$(RM) $@ && $(LN_S) dxdiagn/dxdiagn.spec.def $@
libdxdiagn.a: dxdiagn/dxdiagn.spec.def
$(DLLTOOL) -k -l $@ -d dxdiagn/dxdiagn.spec.def
libgdi32.def: gdi/gdi32.spec.def
$(RM) $@ && $(LN_S) gdi/gdi32.spec.def $@
libgdi32.a: gdi/gdi32.spec.def
......@@ -1680,6 +1691,7 @@ dpnet/dpnet.spec.def: $(WINEBUILD)
dpnhpast/dpnhpast.spec.def: $(WINEBUILD)
dsound/dsound.spec.def: $(WINEBUILD)
dswave/dswave.spec.def: $(WINEBUILD)
dxdiagn/dxdiagn.spec.def: $(WINEBUILD)
gdi/gdi32.spec.def: $(WINEBUILD)
glu32/glu32.spec.def: $(WINEBUILD)
glut32/glut32.spec.def: $(WINEBUILD)
......@@ -1804,6 +1816,7 @@ dpnet/dpnet.dll.so: dpnet
dpnhpast/dpnhpast.dll.so: dpnhpast
dsound/dsound.dll.so: dsound
dswave/dswave.dll.so: dswave
dxdiagn/dxdiagn.dll.so: dxdiagn
gdi/gdi32.dll.so: gdi
glu32/glu32.dll.so: glu32
glut32/glut32.dll.so: glut32
......
Makefile
dxdiagn.dll.dbg.c
dxdiagn.spec.def
version.res
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = dxdiagn.dll
IMPORTS = ole32 user32 advapi32 kernel32
EXTRALIBS = -ldxguid -luuid
C_SRCS = \
dxdiag_main.c \
provider.c \
regsvr.c
RC_SRCS = version.rc
@MAKE_DLL_RULES@
### Dependencies:
/*
* DXDiag
*
* Copyright 2004 Raphael Junqueira
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "config.h"
#include "dxdiag_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dxdiag);
/* At process attach */
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
TRACE("%p,%lx,%p\n", hInstDLL, fdwReason, lpvReserved);
if (fdwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hInstDLL);
}
return TRUE;
}
/*******************************************************************************
* DXDiag ClassFactory
*/
typedef struct {
/* IUnknown fields */
ICOM_VFIELD(IClassFactory);
DWORD ref;
REFCLSID rclsid;
HRESULT (*pfnCreateInstanceFactory)(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj);
} IClassFactoryImpl;
static HRESULT WINAPI DXDiagCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI DXDiagCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI DXDiagCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI DXDiagCF_CreateInstance(LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
return This->pfnCreateInstanceFactory(iface, pOuter, riid, ppobj);
}
static HRESULT WINAPI DXDiagCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n",This,dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) DXDiagCF_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
DXDiagCF_QueryInterface,
DXDiagCF_AddRef,
DXDiagCF_Release,
DXDiagCF_CreateInstance,
DXDiagCF_LockServer
};
static IClassFactoryImpl DXDiag_CFS[] = {
{ &DXDiagCF_Vtbl, 1, &CLSID_DxDiagProvider, DXDiag_CreateDXDiagProvider },
{ NULL, 0, NULL, NULL }
};
/***********************************************************************
* DllCanUnloadNow (DXDiag.@)
*/
HRESULT WINAPI DllCanUnloadNow(void)
{
return S_FALSE;
}
/***********************************************************************
* DllGetClassObject (DXDiag.@)
*/
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
int i = 0;
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
while (NULL != DXDiag_CFS[i].rclsid) {
if (IsEqualGUID(rclsid, DXDiag_CFS[i].rclsid)) {
DXDiagCF_AddRef((IClassFactory*) &DXDiag_CFS[i]);
*ppv = &DXDiag_CFS[i];
return S_OK;
}
++i;
}
FIXME("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;
}
/*
* DXDiag private include file
*
* Copyright 2004 Raphael Junqueira
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_DXDIAG_PRIVATE_H
#define __WINE_DXDIAG_PRIVATE_H
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "oleauto.h"
#include "dxdiag.h"
/* DXDiag Interfaces: */
typedef struct IDxDiagProviderImpl IDxDiagProviderImpl;
typedef struct IDxDiagContainerImpl IDxDiagContainerImpl;
/* ---------------- */
/* IDxDiagProvider */
/* ---------------- */
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern ICOM_VTABLE(IDxDiagProvider) DirectPlay8Client_Vtbl;
/*****************************************************************************
* IDxDiagProvider implementation structure
*/
struct IDxDiagProviderImpl
{
/* IUnknown fields */
ICOM_VFIELD(IDxDiagProvider);
DWORD ref;
/* IDxDiagProvider fields */
};
/* IUnknown: */
extern HRESULT WINAPI IDxDiagProviderImpl_QueryInterface(PDXDIAGPROVIDER iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDxDiagProviderImpl_AddRef(PDXDIAGPROVIDER iface);
extern ULONG WINAPI IDxDiagProviderImpl_Release(PDXDIAGPROVIDER iface);
/* IDxDiagProvider: */
extern HRESULT WINAPI IDxDiagProviderImpl_Initialize(PDXDIAGPROVIDER iface, DXDIAG_INIT_PARAMS* pParams);
extern HRESULT WINAPI IDxDiagProviderImpl_GetRootContainer(PDXDIAGPROVIDER iface, IDxDiagContainer** ppInstance);
/**
* factories
*/
extern HRESULT DXDiag_CreateDXDiagProvider(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj);
#endif
@ stdcall -private DllCanUnloadNow() DllCanUnloadNow
@ stdcall -private DllGetClassObject(ptr ptr ptr) DllGetClassObject
@ stdcall -private DllRegisterServer() DllRegisterServer
@ stdcall -private DllUnregisterServer() DllUnregisterServer
/*
* IDxDiagProvider Implementation
*
* Copyright 2004 Raphael Junqueira
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "config.h"
#include "dxdiag_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dxdiag);
/* IDxDiagProvider IUnknown parts follow: */
HRESULT WINAPI IDxDiagProviderImpl_QueryInterface(PDXDIAGPROVIDER iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDxDiagProviderImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IDxDiagProvider)) {
IDxDiagProviderImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDxDiagProviderImpl_AddRef(PDXDIAGPROVIDER iface) {
ICOM_THIS(IDxDiagProviderImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDxDiagProviderImpl_Release(PDXDIAGPROVIDER iface) {
ICOM_THIS(IDxDiagProviderImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDxDiagProvider Interface follow: */
HRESULT WINAPI IDxDiagProviderImpl_Initialize(PDXDIAGPROVIDER iface, DXDIAG_INIT_PARAMS* pParams) {
return S_OK;
}
HRESULT WINAPI IDxDiagProviderImpl_GetRootContainer(PDXDIAGPROVIDER iface, IDxDiagContainer** ppInstance) {
return S_OK;
}
ICOM_VTABLE(IDxDiagProvider) DxDiagProvider_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDxDiagProviderImpl_QueryInterface,
IDxDiagProviderImpl_AddRef,
IDxDiagProviderImpl_Release,
IDxDiagProviderImpl_Initialize,
IDxDiagProviderImpl_GetRootContainer
};
HRESULT DXDiag_CreateDXDiagProvider(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) {
IDxDiagProviderImpl* provider;
TRACE("(%p, %s, %p)\n", punkOuter, debugstr_guid(riid), ppobj);
provider = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDxDiagProviderImpl));
if (NULL == provider) {
*ppobj = NULL;
return E_OUTOFMEMORY;
}
provider->lpVtbl = &DxDiagProvider_Vtbl;
provider->ref = 0; /* will be inited with QueryInterface */
return IDxDiagProviderImpl_QueryInterface ((PDXDIAGPROVIDER)provider, riid, ppobj);
}
/*
* Copyright 2004 Raphael Junqueira
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define WINE_FILEDESCRIPTION_STR "Wine DxDiag 8"
#define WINE_FILENAME_STR "dxdiagn.dll"
#define WINE_FILEVERSION 5,1,2,600
#define WINE_FILEVERSION_STR "5.1.2.600"
#define WINE_PRODUCTVERSION 5,1,2,600
#define WINE_PRODUCTVERSION_STR "5.1"
#define WINE_PRODUCTNAME_STR "Wine DirectX"
#include "wine/wine_common_ver.rc"
......@@ -2008,6 +2008,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
11,,dpnet.dll,1
11,,dsound.dll,1
11,,dswave.dll,1
11,,dxdiagn.dll,1
11,,msi.dll,1
11,,ole32.dll,1
11,,oleaut32.dll,1
......
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