mirror of
https://github.com/reactos/reactos.git
synced 2025-06-05 09:20:30 +00:00
[DXDIAGN]
* Sync with Wine 1.7.1. It was synced just recently (8 years ago) but there's not harm in syncing it again ;) CORE-7469 svn path=/trunk/; revision=60500
This commit is contained in:
parent
f387b0fa6b
commit
0ef60d3d48
13 changed files with 2158 additions and 869 deletions
|
@ -1,28 +1,19 @@
|
|||
|
||||
|
||||
add_definitions(-D__WINESRC__)
|
||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
||||
|
||||
spec2def(dxdiagn.dll dxdiagn.spec)
|
||||
|
||||
add_library(dxdiagn SHARED
|
||||
list(APPEND SOURCE
|
||||
container.c
|
||||
dxdiag_main.c
|
||||
provider.c
|
||||
regsvr.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dxdiagn.def)
|
||||
|
||||
set_module_type(dxdiagn win32dll UNICODE)
|
||||
|
||||
target_link_libraries(dxdiagn uuid wine)
|
||||
|
||||
add_importlibs(dxdiagn
|
||||
user32
|
||||
advapi32
|
||||
ole32
|
||||
oleaut32
|
||||
msvcrt
|
||||
kernel32
|
||||
ntdll)
|
||||
|
||||
add_idl_headers(dxdiagn_idlheader fil_data.idl)
|
||||
add_library(dxdiagn SHARED ${SOURCE} dxdiagn.rc)
|
||||
set_module_type(dxdiagn win32dll)
|
||||
target_link_libraries(dxdiagn strmiids dxguid uuid wine)
|
||||
add_dependencies(dxdiagn dxdiagn_idlheader)
|
||||
add_importlibs(dxdiagn d3d9 ddraw version ole32 oleaut32 psapi user32 msvcrt kernel32 ntdll)
|
||||
add_pch(dxdiagn dxdiag_private.h)
|
||||
add_cd_file(TARGET dxdiagn DESTINATION reactos/system32 FOR all)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
/*
|
||||
* IDxDiagContainer Implementation
|
||||
*
|
||||
*
|
||||
* Copyright 2004 Raphael Junqueira
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -15,129 +15,147 @@
|
|||
*
|
||||
* 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 <config.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#include "dxdiag_private.h"
|
||||
#include <wine/debug.h>
|
||||
#include <wine/unicode.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(dxdiag);
|
||||
|
||||
/* IDxDiagContainer IUnknown parts follow: */
|
||||
HRESULT WINAPI IDxDiagContainerImpl_QueryInterface(PDXDIAGCONTAINER iface, REFIID riid, LPVOID *ppobj)
|
||||
static inline IDxDiagContainerImpl *impl_from_IDxDiagContainer(IDxDiagContainer *iface)
|
||||
{
|
||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
||||
return CONTAINING_RECORD(iface, IDxDiagContainerImpl, IDxDiagContainer_iface);
|
||||
}
|
||||
|
||||
/* IDxDiagContainer IUnknown parts follow: */
|
||||
static HRESULT WINAPI IDxDiagContainerImpl_QueryInterface(IDxDiagContainer *iface, REFIID riid,
|
||||
void **ppobj)
|
||||
{
|
||||
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||
|
||||
if (!ppobj) return E_INVALIDARG;
|
||||
|
||||
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||
|| IsEqualGUID(riid, &IID_IDxDiagContainer)) {
|
||||
IDxDiagContainerImpl_AddRef(iface);
|
||||
IUnknown_AddRef(iface);
|
||||
*ppobj = This;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
|
||||
*ppobj = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
ULONG WINAPI IDxDiagContainerImpl_AddRef(PDXDIAGCONTAINER iface) {
|
||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
||||
static ULONG WINAPI IDxDiagContainerImpl_AddRef(IDxDiagContainer *iface)
|
||||
{
|
||||
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||
ULONG refCount = InterlockedIncrement(&This->ref);
|
||||
|
||||
TRACE("(%p)->(ref before=%lu)\n", This, refCount - 1);
|
||||
TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
|
||||
|
||||
DXDIAGN_LockModule();
|
||||
|
||||
return refCount;
|
||||
}
|
||||
|
||||
ULONG WINAPI IDxDiagContainerImpl_Release(PDXDIAGCONTAINER iface) {
|
||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
||||
static ULONG WINAPI IDxDiagContainerImpl_Release(IDxDiagContainer *iface)
|
||||
{
|
||||
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||
ULONG refCount = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("(%p)->(ref before=%lu)\n", This, refCount + 1);
|
||||
TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
|
||||
|
||||
if (!refCount) {
|
||||
IDxDiagProvider_Release(This->pProv);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
DXDIAGN_UnlockModule();
|
||||
|
||||
|
||||
return refCount;
|
||||
}
|
||||
|
||||
/* IDxDiagContainer Interface follow: */
|
||||
HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfChildContainers(PDXDIAGCONTAINER iface, DWORD* pdwCount) {
|
||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
||||
static HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfChildContainers(IDxDiagContainer *iface,
|
||||
DWORD *pdwCount)
|
||||
{
|
||||
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||
|
||||
TRACE("(%p)\n", iface);
|
||||
if (NULL == pdwCount) {
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
*pdwCount = This->nSubContainers;
|
||||
*pdwCount = This->cont->nSubContainers;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDxDiagContainerImpl_EnumChildContainerNames(PDXDIAGCONTAINER iface, DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer) {
|
||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
||||
IDxDiagContainerImpl_SubContainer* p = NULL;
|
||||
static HRESULT WINAPI IDxDiagContainerImpl_EnumChildContainerNames(IDxDiagContainer *iface,
|
||||
DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer)
|
||||
{
|
||||
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||
IDxDiagContainerImpl_Container *p;
|
||||
DWORD i = 0;
|
||||
|
||||
TRACE("(%p, %lu, %s, %lu)\n", iface, dwIndex, debugstr_w(pwszContainer), cchContainer);
|
||||
TRACE("(%p, %u, %p, %u)\n", iface, dwIndex, pwszContainer, cchContainer);
|
||||
|
||||
if (NULL == pwszContainer) {
|
||||
if (NULL == pwszContainer || 0 == cchContainer) {
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
if (256 > cchContainer) {
|
||||
return DXDIAG_E_INSUFFICIENT_BUFFER;
|
||||
}
|
||||
|
||||
p = This->subContainers;
|
||||
while (NULL != p) {
|
||||
LIST_FOR_EACH_ENTRY(p, &This->cont->subContainers, IDxDiagContainerImpl_Container, entry)
|
||||
{
|
||||
if (dwIndex == i) {
|
||||
if (cchContainer <= strlenW(p->contName)) {
|
||||
return DXDIAG_E_INSUFFICIENT_BUFFER;
|
||||
}
|
||||
TRACE("Found container name %s, copying string\n", debugstr_w(p->contName));
|
||||
lstrcpynW(pwszContainer, p->contName, cchContainer);
|
||||
return S_OK;
|
||||
return (cchContainer <= strlenW(p->contName)) ?
|
||||
DXDIAG_E_INSUFFICIENT_BUFFER : S_OK;
|
||||
}
|
||||
p = p->next;
|
||||
++i;
|
||||
}
|
||||
|
||||
TRACE("Failed to find container name at specified index\n");
|
||||
*pwszContainer = '\0';
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDxDiagContainerImpl_GetChildContainerInternal(PDXDIAGCONTAINER iface, LPCWSTR pwszContainer, IDxDiagContainer** ppInstance) {
|
||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
||||
IDxDiagContainerImpl_SubContainer* p = NULL;
|
||||
static HRESULT IDxDiagContainerImpl_GetChildContainerInternal(IDxDiagContainerImpl_Container *cont, LPCWSTR pwszContainer, IDxDiagContainerImpl_Container **subcont) {
|
||||
IDxDiagContainerImpl_Container *p;
|
||||
|
||||
p = This->subContainers;
|
||||
while (NULL != p) {
|
||||
LIST_FOR_EACH_ENTRY(p, &cont->subContainers, IDxDiagContainerImpl_Container, entry)
|
||||
{
|
||||
if (0 == lstrcmpW(p->contName, pwszContainer)) {
|
||||
*ppInstance = (PDXDIAGCONTAINER)p->pCont;
|
||||
*subcont = p;
|
||||
return S_OK;
|
||||
}
|
||||
p = p->next;
|
||||
}
|
||||
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDxDiagContainerImpl_GetChildContainer(PDXDIAGCONTAINER iface, LPCWSTR pwszContainer, IDxDiagContainer** ppInstance) {
|
||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
||||
IDxDiagContainer* pContainer = NULL;
|
||||
static HRESULT WINAPI IDxDiagContainerImpl_GetChildContainer(IDxDiagContainer *iface,
|
||||
LPCWSTR pwszContainer, IDxDiagContainer **ppInstance)
|
||||
{
|
||||
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||
IDxDiagContainerImpl_Container *pContainer = This->cont;
|
||||
LPWSTR tmp, orig_tmp;
|
||||
INT tmp_len;
|
||||
WCHAR* cur;
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
|
||||
FIXME("(%p, %s, %p)\n", iface, debugstr_w(pwszContainer), ppInstance);
|
||||
TRACE("(%p, %s, %p)\n", iface, debugstr_w(pwszContainer), ppInstance);
|
||||
|
||||
if (NULL == ppInstance || NULL == pwszContainer) {
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
pContainer = (PDXDIAGCONTAINER) This;
|
||||
*ppInstance = NULL;
|
||||
|
||||
tmp_len = strlenW(pwszContainer) + 1;
|
||||
orig_tmp = tmp = HeapAlloc(GetProcessHeap(), 0, tmp_len * sizeof(WCHAR));
|
||||
|
@ -147,17 +165,22 @@ HRESULT WINAPI IDxDiagContainerImpl_GetChildContainer(PDXDIAGCONTAINER iface, LP
|
|||
cur = strchrW(tmp, '.');
|
||||
while (NULL != cur) {
|
||||
*cur = '\0'; /* cut tmp string to '.' */
|
||||
if (!*(cur + 1)) break; /* Account for a lone terminating period, as in "cont1.cont2.". */
|
||||
TRACE("Trying to get parent container %s\n", debugstr_w(tmp));
|
||||
hr = IDxDiagContainerImpl_GetChildContainerInternal(pContainer, tmp, &pContainer);
|
||||
if (!SUCCEEDED(hr) || NULL == pContainer)
|
||||
if (FAILED(hr))
|
||||
goto on_error;
|
||||
cur++; /* go after '.' (just replaced by \0) */
|
||||
tmp = cur;
|
||||
cur = strchrW(tmp, '.');
|
||||
}
|
||||
|
||||
hr = IDxDiagContainerImpl_GetChildContainerInternal(pContainer, tmp, ppInstance);
|
||||
TRACE("Trying to get container %s\n", debugstr_w(tmp));
|
||||
hr = IDxDiagContainerImpl_GetChildContainerInternal(pContainer, tmp, &pContainer);
|
||||
if (SUCCEEDED(hr)) {
|
||||
IDxDiagContainerImpl_AddRef((PDXDIAGCONTAINER)*ppInstance);
|
||||
hr = DXDiag_CreateDXDiagContainer(&IID_IDxDiagContainer, pContainer, This->pProv, (void **)ppInstance);
|
||||
if (SUCCEEDED(hr))
|
||||
TRACE("Succeeded in getting the container instance\n");
|
||||
}
|
||||
|
||||
on_error:
|
||||
|
@ -165,130 +188,68 @@ on_error:
|
|||
return hr;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfProps(PDXDIAGCONTAINER iface, DWORD* pdwCount) {
|
||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
||||
static HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfProps(IDxDiagContainer *iface,
|
||||
DWORD *pdwCount)
|
||||
{
|
||||
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||
|
||||
TRACE("(%p)\n", iface);
|
||||
if (NULL == pdwCount) {
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
*pdwCount = This->nProperties;
|
||||
*pdwCount = This->cont->nProperties;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(PDXDIAGCONTAINER iface, DWORD dwIndex, LPWSTR pwszPropName, DWORD cchPropName) {
|
||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
||||
IDxDiagContainerImpl_Property* p = NULL;
|
||||
static HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(IDxDiagContainer *iface, DWORD dwIndex,
|
||||
LPWSTR pwszPropName, DWORD cchPropName)
|
||||
{
|
||||
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||
IDxDiagContainerImpl_Property *p;
|
||||
DWORD i = 0;
|
||||
|
||||
FIXME("(%p, %lu, %s, %lu)\n", iface, dwIndex, debugstr_w(pwszPropName), cchPropName);
|
||||
TRACE("(%p, %u, %p, %u)\n", iface, dwIndex, pwszPropName, cchPropName);
|
||||
|
||||
if (NULL == pwszPropName) {
|
||||
if (NULL == pwszPropName || 0 == cchPropName) {
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
if (256 > cchPropName) {
|
||||
return DXDIAG_E_INSUFFICIENT_BUFFER;
|
||||
}
|
||||
|
||||
p = This->properties;
|
||||
while (NULL != p) {
|
||||
LIST_FOR_EACH_ENTRY(p, &This->cont->properties, IDxDiagContainerImpl_Property, entry)
|
||||
{
|
||||
if (dwIndex == i) {
|
||||
if (cchPropName <= lstrlenW(p->vName)) {
|
||||
return DXDIAG_E_INSUFFICIENT_BUFFER;
|
||||
}
|
||||
lstrcpynW(pwszPropName, p->vName, cchPropName);
|
||||
return S_OK;
|
||||
TRACE("Found property name %s, copying string\n", debugstr_w(p->propName));
|
||||
lstrcpynW(pwszPropName, p->propName, cchPropName);
|
||||
return (cchPropName <= strlenW(p->propName)) ?
|
||||
DXDIAG_E_INSUFFICIENT_BUFFER : S_OK;
|
||||
}
|
||||
p = p->next;
|
||||
++i;
|
||||
}
|
||||
|
||||
TRACE("Failed to find property name at specified index\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDxDiagContainerImpl_GetProp(PDXDIAGCONTAINER iface, LPCWSTR pwszPropName, VARIANT* pvarProp) {
|
||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
||||
IDxDiagContainerImpl_Property* p = NULL;
|
||||
FIXME("(%p, %s, %p)\n", iface, debugstr_w(pwszPropName), pvarProp);
|
||||
static HRESULT WINAPI IDxDiagContainerImpl_GetProp(IDxDiagContainer *iface, LPCWSTR pwszPropName,
|
||||
VARIANT *pvarProp)
|
||||
{
|
||||
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||
IDxDiagContainerImpl_Property *p;
|
||||
|
||||
TRACE("(%p, %s, %p)\n", iface, debugstr_w(pwszPropName), pvarProp);
|
||||
|
||||
if (NULL == pvarProp || NULL == pwszPropName) {
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
p = This->properties;
|
||||
while (NULL != p) {
|
||||
if (0 == lstrcmpW(p->vName, pwszPropName)) {
|
||||
VariantCopy(pvarProp, &p->v);
|
||||
return S_OK;
|
||||
LIST_FOR_EACH_ENTRY(p, &This->cont->properties, IDxDiagContainerImpl_Property, entry)
|
||||
{
|
||||
if (0 == lstrcmpW(p->propName, pwszPropName)) {
|
||||
VariantInit(pvarProp);
|
||||
return VariantCopy(pvarProp, &p->vProp);
|
||||
}
|
||||
p = p->next;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDxDiagContainerImpl_AddProp(PDXDIAGCONTAINER iface, LPCWSTR pwszPropName, VARIANT* pVarProp) {
|
||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
||||
IDxDiagContainerImpl_Property* p = NULL;
|
||||
IDxDiagContainerImpl_Property* pNew = NULL;
|
||||
|
||||
FIXME("(%p, %s, %p)\n", iface, debugstr_w(pwszPropName), pVarProp);
|
||||
|
||||
if (NULL == pVarProp || NULL == pwszPropName) {
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
pNew = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDxDiagContainerImpl_Property));
|
||||
if (NULL == pNew) {
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
VariantInit(&pNew->v);
|
||||
VariantCopy(&pNew->v, pVarProp);
|
||||
pNew->vName = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwszPropName) + 1) * sizeof(WCHAR));
|
||||
lstrcpyW(pNew->vName, pwszPropName);
|
||||
pNew->next = NULL;
|
||||
|
||||
p = This->properties;
|
||||
if (NULL == p) {
|
||||
This->properties = pNew;
|
||||
} else {
|
||||
while (NULL != p->next) {
|
||||
p = p->next;
|
||||
}
|
||||
p->next = pNew;
|
||||
}
|
||||
++This->nProperties;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDxDiagContainerImpl_AddChildContainer(PDXDIAGCONTAINER iface, LPCWSTR pszContName, PDXDIAGCONTAINER pSubCont) {
|
||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
||||
IDxDiagContainerImpl_SubContainer* p = NULL;
|
||||
IDxDiagContainerImpl_SubContainer* pNew = NULL;
|
||||
|
||||
FIXME("(%p, %s, %p)\n", iface, debugstr_w(pszContName), pSubCont);
|
||||
|
||||
if (NULL == pSubCont || NULL == pszContName) {
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
pNew = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDxDiagContainerImpl_SubContainer));
|
||||
if (NULL == pNew) {
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
pNew->pCont = pSubCont;
|
||||
pNew->contName = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pszContName) + 1) * sizeof(WCHAR));
|
||||
lstrcpyW(pNew->contName, pszContName);
|
||||
pNew->next = NULL;
|
||||
|
||||
p = This->subContainers;
|
||||
if (NULL == p) {
|
||||
This->subContainers = pNew;
|
||||
} else {
|
||||
while (NULL != p->next) {
|
||||
p = p->next;
|
||||
}
|
||||
p->next = pNew;
|
||||
}
|
||||
++This->nSubContainers;
|
||||
return S_OK;
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
static const IDxDiagContainerVtbl DxDiagContainer_Vtbl =
|
||||
|
@ -305,17 +266,20 @@ static const IDxDiagContainerVtbl DxDiagContainer_Vtbl =
|
|||
};
|
||||
|
||||
|
||||
HRESULT DXDiag_CreateDXDiagContainer(REFIID riid, LPVOID *ppobj) {
|
||||
HRESULT DXDiag_CreateDXDiagContainer(REFIID riid, IDxDiagContainerImpl_Container *cont, IDxDiagProvider *pProv, LPVOID *ppobj) {
|
||||
IDxDiagContainerImpl* container;
|
||||
|
||||
TRACE("(%p, %p)\n", debugstr_guid(riid), ppobj);
|
||||
TRACE("(%s, %p)\n", debugstr_guid(riid), ppobj);
|
||||
|
||||
container = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDxDiagContainerImpl));
|
||||
container = HeapAlloc(GetProcessHeap(), 0, sizeof(IDxDiagContainerImpl));
|
||||
if (NULL == container) {
|
||||
*ppobj = NULL;
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
container->lpVtbl = &DxDiagContainer_Vtbl;
|
||||
container->IDxDiagContainer_iface.lpVtbl = &DxDiagContainer_Vtbl;
|
||||
container->ref = 0; /* will be inited with QueryInterface */
|
||||
return IDxDiagContainerImpl_QueryInterface((PDXDIAGCONTAINER)container, riid, ppobj);
|
||||
container->cont = cont;
|
||||
container->pProv = pProv;
|
||||
IDxDiagProvider_AddRef(pProv);
|
||||
return IDxDiagContainerImpl_QueryInterface(&container->IDxDiagContainer_iface, riid, ppobj);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
/*
|
||||
* DXDiag
|
||||
*
|
||||
*
|
||||
* Copyright 2004 Raphael Junqueira
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -15,24 +15,38 @@
|
|||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include <config.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <objbase.h>
|
||||
#include <oleauto.h>
|
||||
#include <oleidl.h>
|
||||
#include <rpcproxy.h>
|
||||
#include <initguid.h>
|
||||
#include "dxdiag_private.h"
|
||||
#include <wine/debug.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(dxdiag);
|
||||
|
||||
HINSTANCE dxdiagn_instance = 0;
|
||||
|
||||
LONG DXDIAGN_refCount = 0;
|
||||
|
||||
/* At process attach */
|
||||
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
TRACE("%p,%lx,%p\n", hInstDLL, fdwReason, lpvReserved);
|
||||
TRACE("%p,%x,%p\n", hInstDLL, fdwReason, lpvReserved);
|
||||
if (fdwReason == DLL_PROCESS_ATTACH) {
|
||||
DisableThreadLibraryCalls(hInstDLL);
|
||||
dxdiagn_instance = hInstDLL;
|
||||
DisableThreadLibraryCalls(hInstDLL);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -41,46 +55,60 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
* DXDiag ClassFactory
|
||||
*/
|
||||
typedef struct {
|
||||
const IClassFactoryVtbl *lpVtbl;
|
||||
REFCLSID rclsid;
|
||||
HRESULT (*pfnCreateInstanceFactory)(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj);
|
||||
IClassFactory IClassFactory_iface;
|
||||
} IClassFactoryImpl;
|
||||
|
||||
static HRESULT WINAPI DXDiagCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
||||
FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
|
||||
static HRESULT WINAPI DXDiagCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
if (ppv == NULL)
|
||||
return E_POINTER;
|
||||
|
||||
if (ppobj == NULL) return E_POINTER;
|
||||
if (IsEqualGUID(&IID_IUnknown, riid))
|
||||
TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
|
||||
else if (IsEqualGUID(&IID_IClassFactory, riid))
|
||||
TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
|
||||
else {
|
||||
FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
|
||||
*ppv = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
return E_NOINTERFACE;
|
||||
*ppv = iface;
|
||||
IClassFactory_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static ULONG WINAPI DXDiagCF_AddRef(LPCLASSFACTORY iface) {
|
||||
static ULONG WINAPI DXDiagCF_AddRef(IClassFactory *iface)
|
||||
{
|
||||
DXDIAGN_LockModule();
|
||||
|
||||
return 2; /* non-heap based object */
|
||||
}
|
||||
|
||||
static ULONG WINAPI DXDiagCF_Release(LPCLASSFACTORY iface) {
|
||||
static ULONG WINAPI DXDiagCF_Release(IClassFactory * iface)
|
||||
{
|
||||
DXDIAGN_UnlockModule();
|
||||
|
||||
return 1; /* non-heap based object */
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DXDiagCF_CreateInstance(LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj) {
|
||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
||||
TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
|
||||
static HRESULT WINAPI DXDiagCF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid,
|
||||
void **ppv)
|
||||
{
|
||||
TRACE("(%p)->(%p,%s,%p)\n", iface, pOuter, debugstr_guid(riid), ppv);
|
||||
|
||||
return This->pfnCreateInstanceFactory(iface, pOuter, riid, ppobj);
|
||||
return DXDiag_CreateDXDiagProvider(iface, pOuter, riid, ppv);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DXDiagCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
|
||||
static HRESULT WINAPI DXDiagCF_LockServer(IClassFactory *iface, BOOL dolock)
|
||||
{
|
||||
TRACE("(%d)\n", dolock);
|
||||
|
||||
if (dolock)
|
||||
DXDIAGN_LockModule();
|
||||
else
|
||||
DXDIAGN_UnlockModule();
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -92,10 +120,7 @@ static const IClassFactoryVtbl DXDiagCF_Vtbl = {
|
|||
DXDiagCF_LockServer
|
||||
};
|
||||
|
||||
static IClassFactoryImpl DXDiag_CFS[] = {
|
||||
{ &DXDiagCF_Vtbl, &CLSID_DxDiagProvider, DXDiag_CreateDXDiagProvider },
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
static IClassFactoryImpl DXDiag_CF = { { &DXDiagCF_Vtbl } };
|
||||
|
||||
/***********************************************************************
|
||||
* DllCanUnloadNow (DXDIAGN.@)
|
||||
|
@ -110,18 +135,30 @@ HRESULT WINAPI DllCanUnloadNow(void)
|
|||
*/
|
||||
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||
{
|
||||
int i = 0;
|
||||
TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
||||
|
||||
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;
|
||||
if (IsEqualGUID(rclsid, &CLSID_DxDiagProvider)) {
|
||||
IClassFactory_AddRef(&DXDiag_CF.IClassFactory_iface);
|
||||
*ppv = &DXDiag_CF.IClassFactory_iface;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
FIXME("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
||||
FIXME("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
||||
return CLASS_E_CLASSNOTAVAILABLE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* DllRegisterServer (DXDIAGN.@)
|
||||
*/
|
||||
HRESULT WINAPI DllRegisterServer(void)
|
||||
{
|
||||
return __wine_register_resources( dxdiagn_instance );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* DllUnregisterServer (DXDIAGN.@)
|
||||
*/
|
||||
HRESULT WINAPI DllUnregisterServer(void)
|
||||
{
|
||||
return __wine_unregister_resources( dxdiagn_instance );
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef __WINE_DXDIAG_PRIVATE_H
|
||||
|
@ -29,57 +29,36 @@
|
|||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
//#include "wingdi.h"
|
||||
//#include "winuser.h"
|
||||
//#include "objbase.h"
|
||||
//#include "oleauto.h"
|
||||
#include <wingdi.h>
|
||||
|
||||
#include <dxdiag.h>
|
||||
#include <wine/list.h>
|
||||
#include <wine/dxdiag.h>
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
/* DXDiag Interfaces: */
|
||||
typedef struct IDxDiagProviderImpl IDxDiagProviderImpl;
|
||||
typedef struct IDxDiagContainerImpl IDxDiagContainerImpl;
|
||||
|
||||
/* ---------------- */
|
||||
/* IDxDiagProvider */
|
||||
/* ---------------- */
|
||||
|
||||
/*****************************************************************************
|
||||
* IDxDiagProvider implementation structure
|
||||
*/
|
||||
struct IDxDiagProviderImpl {
|
||||
/* IUnknown fields */
|
||||
const IDxDiagProviderVtbl *lpVtbl;
|
||||
LONG ref;
|
||||
/* IDxDiagProvider fields */
|
||||
BOOL init;
|
||||
DXDIAG_INIT_PARAMS params;
|
||||
IDxDiagContainer* pRootContainer;
|
||||
};
|
||||
|
||||
/* 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);
|
||||
typedef struct IDxDiagContainerImpl_Container IDxDiagContainerImpl_Container;
|
||||
|
||||
/* ---------------- */
|
||||
/* IDxDiagContainer */
|
||||
/* ---------------- */
|
||||
|
||||
typedef struct IDxDiagContainerImpl_SubContainer {
|
||||
IDxDiagContainer* pCont;
|
||||
WCHAR* contName;
|
||||
struct IDxDiagContainerImpl_SubContainer* next;
|
||||
} IDxDiagContainerImpl_SubContainer;
|
||||
struct IDxDiagContainerImpl_Container {
|
||||
struct list entry;
|
||||
WCHAR *contName;
|
||||
|
||||
struct list subContainers;
|
||||
DWORD nSubContainers;
|
||||
struct list properties;
|
||||
DWORD nProperties;
|
||||
};
|
||||
|
||||
typedef struct IDxDiagContainerImpl_Property {
|
||||
LPWSTR vName;
|
||||
VARIANT v;
|
||||
struct IDxDiagContainerImpl_Property* next;
|
||||
struct list entry;
|
||||
WCHAR *propName;
|
||||
VARIANT vProp;
|
||||
} IDxDiagContainerImpl_Property;
|
||||
|
||||
|
||||
|
@ -87,38 +66,27 @@ typedef struct IDxDiagContainerImpl_Property {
|
|||
* IDxDiagContainer implementation structure
|
||||
*/
|
||||
struct IDxDiagContainerImpl {
|
||||
/* IUnknown fields */
|
||||
const IDxDiagContainerVtbl *lpVtbl;
|
||||
LONG ref;
|
||||
/* IDxDiagContainer fields */
|
||||
IDxDiagContainerImpl_Property* properties;
|
||||
IDxDiagContainerImpl_SubContainer* subContainers;
|
||||
DWORD nProperties;
|
||||
DWORD nSubContainers;
|
||||
IDxDiagContainer IDxDiagContainer_iface;
|
||||
LONG ref;
|
||||
IDxDiagContainerImpl_Container *cont;
|
||||
IDxDiagProvider *pProv;
|
||||
};
|
||||
|
||||
/* IUnknown: */
|
||||
extern HRESULT WINAPI IDxDiagContainerImpl_QueryInterface(PDXDIAGCONTAINER iface, REFIID riid, LPVOID *ppobj);
|
||||
extern ULONG WINAPI IDxDiagContainerImpl_AddRef(PDXDIAGCONTAINER iface);
|
||||
|
||||
/** Internal */
|
||||
extern HRESULT WINAPI IDxDiagContainerImpl_AddProp(PDXDIAGCONTAINER iface, LPCWSTR pwszPropName, VARIANT* pVarProp);
|
||||
extern HRESULT WINAPI IDxDiagContainerImpl_AddChildContainer(PDXDIAGCONTAINER iface, LPCWSTR pszContName, PDXDIAGCONTAINER pSubCont);
|
||||
|
||||
/**
|
||||
* factories
|
||||
*/
|
||||
extern HRESULT DXDiag_CreateDXDiagProvider(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj);
|
||||
extern HRESULT DXDiag_CreateDXDiagProvider(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
|
||||
|
||||
/** internal factory */
|
||||
extern HRESULT DXDiag_CreateDXDiagContainer(REFIID riid, LPVOID *ppobj);
|
||||
extern HRESULT DXDiag_InitRootDXDiagContainer(IDxDiagContainer* pRootCont);
|
||||
extern HRESULT DXDiag_CreateDXDiagContainer(REFIID riid, IDxDiagContainerImpl_Container *cont, IDxDiagProvider *pProv, LPVOID *ppobj) DECLSPEC_HIDDEN;
|
||||
|
||||
/**********************************************************************
|
||||
* Dll lifetime tracking declaration for dxdiagn.dll
|
||||
*/
|
||||
extern LONG DXDIAGN_refCount;
|
||||
extern LONG DXDIAGN_refCount DECLSPEC_HIDDEN;
|
||||
static inline void DXDIAGN_LockModule(void) { InterlockedIncrement( &DXDIAGN_refCount ); }
|
||||
static inline void DXDIAGN_UnlockModule(void) { InterlockedDecrement( &DXDIAGN_refCount ); }
|
||||
|
||||
extern HINSTANCE dxdiagn_instance DECLSPEC_HIDDEN;
|
||||
|
||||
#endif
|
||||
|
|
28
reactos/dll/directx/wine/dxdiagn/dxdiagn.idl
Normal file
28
reactos/dll/directx/wine/dxdiagn/dxdiagn.idl
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* COM Classes for dxdiagn
|
||||
*
|
||||
* Copyright 2010 Alexandre Julliard
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
[
|
||||
helpstring("DxDiagProvider Class"),
|
||||
threading(apartment),
|
||||
progid("DxDiag.DxDiagProvider.1"),
|
||||
vi_progid("DxDiag.DxDiagProvider"),
|
||||
uuid(a65b8071-3bfe-4213-9a5b-491da4461ca7)
|
||||
]
|
||||
coclass DxDiagProvider { interface IDxDiagProvider; }
|
40
reactos/dll/directx/wine/dxdiagn/dxdiagn.rc
Normal file
40
reactos/dll/directx/wine/dxdiagn/dxdiagn.rc
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE
|
||||
{
|
||||
IDS_REGIONAL_SETTING "Regional Setting"
|
||||
IDS_PAGE_FILE_FORMAT "%1!u!MB used, %2!u!MB available"
|
||||
}
|
||||
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
|
||||
#define WINE_FILEDESCRIPTION_STR "Wine DxDiag 8"
|
||||
#define WINE_FILENAME_STR "dxdiagn.dll"
|
||||
#define WINE_FILEVERSION 5,3,1,904
|
||||
#define WINE_FILEVERSION_STR "5.3.1.904"
|
||||
#define WINE_PRODUCTVERSION 5,3,1,904
|
||||
#define WINE_PRODUCTVERSION_STR "5.3.1.904"
|
||||
|
||||
#include <wine/wine_common_ver.rc>
|
||||
|
||||
1 WINE_REGISTRY dxdiagn.rgs
|
24
reactos/dll/directx/wine/dxdiagn/dxdiagn.rgs
Normal file
24
reactos/dll/directx/wine/dxdiagn/dxdiagn.rgs
Normal file
|
@ -0,0 +1,24 @@
|
|||
HKCR
|
||||
{
|
||||
NoRemove Interface
|
||||
{
|
||||
}
|
||||
NoRemove CLSID
|
||||
{
|
||||
'{A65B8071-3BFE-4213-9A5B-491DA4461CA7}' = s 'DxDiagProvider Class'
|
||||
{
|
||||
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
|
||||
ProgId = s 'DxDiag.DxDiagProvider.1'
|
||||
VersionIndependentProgId = s 'DxDiag.DxDiagProvider'
|
||||
}
|
||||
}
|
||||
'DxDiag.DxDiagProvider.1' = s 'DxDiagProvider Class'
|
||||
{
|
||||
CLSID = s '{A65B8071-3BFE-4213-9A5B-491DA4461CA7}'
|
||||
}
|
||||
'DxDiag.DxDiagProvider' = s 'DxDiagProvider Class'
|
||||
{
|
||||
CLSID = s '{A65B8071-3BFE-4213-9A5B-491DA4461CA7}'
|
||||
CurVer = s 'DxDiag.DxDiagProvider.1'
|
||||
}
|
||||
}
|
45
reactos/dll/directx/wine/dxdiagn/fil_data.idl
Normal file
45
reactos/dll/directx/wine/dxdiagn/fil_data.idl
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Vitaliy Margolen
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
import "objidl.idl";
|
||||
import "strmif.idl";
|
||||
import "unknwn.idl";
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* IAMFilterData interface
|
||||
*/
|
||||
[
|
||||
object,
|
||||
uuid(97f7c4d4-547b-4a5f-8332-536430ad2e4d),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IAMFilterData : IUnknown
|
||||
{
|
||||
typedef [unique] IAMFilterData *LPIAMFILTERDATA;
|
||||
|
||||
HRESULT ParseFilterData(
|
||||
[in] BYTE * rgbFilterData,
|
||||
[in] ULONG cb,
|
||||
[out] BYTE ** prgbRegFilter2);
|
||||
|
||||
HRESULT CreateFilterData(
|
||||
[in] REGFILTER2 * prf2,
|
||||
[out] BYTE ** prgbFilterData,
|
||||
[out] ULONG * pcb);
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,558 +0,0 @@
|
|||
/*
|
||||
* self-registerable dll functions for dxdiag.dll
|
||||
*
|
||||
* Copyright (C) 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 WIN32_NO_STATUS
|
||||
#define _INC_WINDOWS
|
||||
#define COM_NO_WINDOWS_H
|
||||
|
||||
#include <stdarg.h>
|
||||
//#include <string.h>
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
//#include "wingdi.h"
|
||||
//#include "winuser.h"
|
||||
#include <winreg.h>
|
||||
//#include "winerror.h"
|
||||
|
||||
#include <initguid.h>
|
||||
#include "dxdiag_private.h"
|
||||
#include <wine/debug.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(dxdiag);
|
||||
|
||||
/*
|
||||
* Near the bottom of this file are the exported DllRegisterServer and
|
||||
* DllUnregisterServer, which make all this worthwhile.
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
* interface for self-registering
|
||||
*/
|
||||
struct regsvr_interface
|
||||
{
|
||||
IID const *iid; /* NULL for end of list */
|
||||
LPCSTR name; /* can be NULL to omit */
|
||||
IID const *base_iid; /* can be NULL to omit */
|
||||
int num_methods; /* can be <0 to omit */
|
||||
CLSID const *ps_clsid; /* can be NULL to omit */
|
||||
CLSID const *ps_clsid32; /* can be NULL to omit */
|
||||
};
|
||||
|
||||
static HRESULT register_interfaces(struct regsvr_interface const *list);
|
||||
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
|
||||
|
||||
struct regsvr_coclass
|
||||
{
|
||||
CLSID const *clsid; /* NULL for end of list */
|
||||
LPCSTR name; /* can be NULL to omit */
|
||||
LPCSTR ips; /* can be NULL to omit */
|
||||
LPCSTR ips32; /* can be NULL to omit */
|
||||
LPCSTR ips32_tmodel; /* can be NULL to omit */
|
||||
LPCSTR progid; /* can be NULL to omit */
|
||||
LPCSTR viprogid; /* can be NULL to omit */
|
||||
LPCSTR progid_extra; /* can be NULL to omit */
|
||||
};
|
||||
|
||||
static HRESULT register_coclasses(struct regsvr_coclass const *list);
|
||||
static HRESULT unregister_coclasses(struct regsvr_coclass const *list);
|
||||
|
||||
/***********************************************************************
|
||||
* static string constants
|
||||
*/
|
||||
static WCHAR const interface_keyname[10] = {
|
||||
'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 };
|
||||
static WCHAR const base_ifa_keyname[14] = {
|
||||
'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c',
|
||||
'e', 0 };
|
||||
static WCHAR const num_methods_keyname[11] = {
|
||||
'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 };
|
||||
static WCHAR const ps_clsid_keyname[15] = {
|
||||
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
|
||||
'i', 'd', 0 };
|
||||
static WCHAR const ps_clsid32_keyname[17] = {
|
||||
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
|
||||
'i', 'd', '3', '2', 0 };
|
||||
static WCHAR const clsid_keyname[6] = {
|
||||
'C', 'L', 'S', 'I', 'D', 0 };
|
||||
static WCHAR const curver_keyname[7] = {
|
||||
'C', 'u', 'r', 'V', 'e', 'r', 0 };
|
||||
static WCHAR const ips_keyname[13] = {
|
||||
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
|
||||
0 };
|
||||
static WCHAR const ips32_keyname[15] = {
|
||||
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
|
||||
'3', '2', 0 };
|
||||
static WCHAR const progid_keyname[7] = {
|
||||
'P', 'r', 'o', 'g', 'I', 'D', 0 };
|
||||
static WCHAR const viprogid_keyname[25] = {
|
||||
'V', 'e', 'r', 's', 'i', 'o', 'n', 'I', 'n', 'd', 'e', 'p',
|
||||
'e', 'n', 'd', 'e', 'n', 't', 'P', 'r', 'o', 'g', 'I', 'D',
|
||||
0 };
|
||||
static char const tmodel_valuename[] = "ThreadingModel";
|
||||
|
||||
/***********************************************************************
|
||||
* static helper functions
|
||||
*/
|
||||
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid);
|
||||
static LONG register_key_defvalueW(HKEY base, WCHAR const *name,
|
||||
WCHAR const *value);
|
||||
static LONG register_key_defvalueA(HKEY base, WCHAR const *name,
|
||||
char const *value);
|
||||
static LONG register_progid(WCHAR const *clsid,
|
||||
char const *progid, char const *curver_progid,
|
||||
char const *name, char const *extra);
|
||||
static LONG recursive_delete_key(HKEY key);
|
||||
static LONG recursive_delete_keyA(HKEY base, char const *name);
|
||||
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
|
||||
|
||||
/***********************************************************************
|
||||
* register_interfaces
|
||||
*/
|
||||
static HRESULT register_interfaces(struct regsvr_interface const *list)
|
||||
{
|
||||
LONG res = ERROR_SUCCESS;
|
||||
HKEY interface_key;
|
||||
|
||||
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &interface_key, NULL);
|
||||
if (res != ERROR_SUCCESS) goto error_return;
|
||||
|
||||
for (; res == ERROR_SUCCESS && list->iid; ++list) {
|
||||
WCHAR buf[39];
|
||||
HKEY iid_key;
|
||||
|
||||
StringFromGUID2(list->iid, buf, 39);
|
||||
res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &iid_key, NULL);
|
||||
if (res != ERROR_SUCCESS) goto error_close_interface_key;
|
||||
|
||||
if (list->name) {
|
||||
res = RegSetValueExA(iid_key, NULL, 0, REG_SZ,
|
||||
(CONST BYTE*)(list->name),
|
||||
strlen(list->name) + 1);
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
}
|
||||
|
||||
if (list->base_iid) {
|
||||
register_key_guid(iid_key, base_ifa_keyname, list->base_iid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
}
|
||||
|
||||
if (0 <= list->num_methods) {
|
||||
static WCHAR const fmt[3] = { '%', 'd', 0 };
|
||||
HKEY key;
|
||||
|
||||
res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &key, NULL);
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
|
||||
wsprintfW(buf, fmt, list->num_methods);
|
||||
res = RegSetValueExW(key, NULL, 0, REG_SZ,
|
||||
(CONST BYTE*)buf,
|
||||
(lstrlenW(buf) + 1) * sizeof(WCHAR));
|
||||
RegCloseKey(key);
|
||||
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
}
|
||||
|
||||
if (list->ps_clsid) {
|
||||
register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
}
|
||||
|
||||
if (list->ps_clsid32) {
|
||||
register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
}
|
||||
|
||||
error_close_iid_key:
|
||||
RegCloseKey(iid_key);
|
||||
}
|
||||
|
||||
error_close_interface_key:
|
||||
RegCloseKey(interface_key);
|
||||
error_return:
|
||||
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* unregister_interfaces
|
||||
*/
|
||||
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
|
||||
{
|
||||
LONG res = ERROR_SUCCESS;
|
||||
HKEY interface_key;
|
||||
|
||||
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0,
|
||||
KEY_READ | KEY_WRITE, &interface_key);
|
||||
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
|
||||
if (res != ERROR_SUCCESS) goto error_return;
|
||||
|
||||
for (; res == ERROR_SUCCESS && list->iid; ++list) {
|
||||
WCHAR buf[39];
|
||||
|
||||
StringFromGUID2(list->iid, buf, 39);
|
||||
res = recursive_delete_keyW(interface_key, buf);
|
||||
}
|
||||
|
||||
RegCloseKey(interface_key);
|
||||
error_return:
|
||||
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* register_coclasses
|
||||
*/
|
||||
static HRESULT register_coclasses(struct regsvr_coclass const *list)
|
||||
{
|
||||
LONG res = ERROR_SUCCESS;
|
||||
HKEY coclass_key;
|
||||
|
||||
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &coclass_key, NULL);
|
||||
if (res != ERROR_SUCCESS) goto error_return;
|
||||
|
||||
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
|
||||
WCHAR buf[39];
|
||||
HKEY clsid_key;
|
||||
|
||||
StringFromGUID2(list->clsid, buf, 39);
|
||||
res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL);
|
||||
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
||||
|
||||
if (list->name) {
|
||||
res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ,
|
||||
(CONST BYTE*)(list->name),
|
||||
strlen(list->name) + 1);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
}
|
||||
|
||||
if (list->ips) {
|
||||
res = register_key_defvalueA(clsid_key, ips_keyname, list->ips);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
}
|
||||
|
||||
if (list->ips32) {
|
||||
HKEY ips32_key;
|
||||
|
||||
res = RegCreateKeyExW(clsid_key, ips32_keyname, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL,
|
||||
&ips32_key, NULL);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
|
||||
res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ,
|
||||
(CONST BYTE*)list->ips32,
|
||||
lstrlenA(list->ips32) + 1);
|
||||
if (res == ERROR_SUCCESS && list->ips32_tmodel)
|
||||
res = RegSetValueExA(ips32_key, tmodel_valuename, 0, REG_SZ,
|
||||
(CONST BYTE*)list->ips32_tmodel,
|
||||
strlen(list->ips32_tmodel) + 1);
|
||||
RegCloseKey(ips32_key);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
}
|
||||
|
||||
if (list->progid) {
|
||||
res = register_key_defvalueA(clsid_key, progid_keyname,
|
||||
list->progid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
|
||||
res = register_progid(buf, list->progid, NULL,
|
||||
list->name, list->progid_extra);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
}
|
||||
|
||||
if (list->viprogid) {
|
||||
res = register_key_defvalueA(clsid_key, viprogid_keyname,
|
||||
list->viprogid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
|
||||
res = register_progid(buf, list->viprogid, list->progid,
|
||||
list->name, list->progid_extra);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
}
|
||||
|
||||
error_close_clsid_key:
|
||||
RegCloseKey(clsid_key);
|
||||
}
|
||||
|
||||
error_close_coclass_key:
|
||||
RegCloseKey(coclass_key);
|
||||
error_return:
|
||||
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* unregister_coclasses
|
||||
*/
|
||||
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
|
||||
{
|
||||
LONG res = ERROR_SUCCESS;
|
||||
HKEY coclass_key;
|
||||
|
||||
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0,
|
||||
KEY_READ | KEY_WRITE, &coclass_key);
|
||||
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
|
||||
if (res != ERROR_SUCCESS) goto error_return;
|
||||
|
||||
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
|
||||
WCHAR buf[39];
|
||||
|
||||
StringFromGUID2(list->clsid, buf, 39);
|
||||
res = recursive_delete_keyW(coclass_key, buf);
|
||||
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
||||
|
||||
if (list->progid) {
|
||||
res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->progid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
||||
}
|
||||
|
||||
if (list->viprogid) {
|
||||
res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->viprogid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
||||
}
|
||||
}
|
||||
|
||||
error_close_coclass_key:
|
||||
RegCloseKey(coclass_key);
|
||||
error_return:
|
||||
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* regsvr_key_guid
|
||||
*/
|
||||
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
|
||||
{
|
||||
WCHAR buf[39];
|
||||
|
||||
StringFromGUID2(guid, buf, 39);
|
||||
return register_key_defvalueW(base, name, buf);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* regsvr_key_defvalueW
|
||||
*/
|
||||
static LONG register_key_defvalueW(
|
||||
HKEY base,
|
||||
WCHAR const *name,
|
||||
WCHAR const *value)
|
||||
{
|
||||
LONG res;
|
||||
HKEY key;
|
||||
|
||||
res = RegCreateKeyExW(base, name, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &key, NULL);
|
||||
if (res != ERROR_SUCCESS) return res;
|
||||
res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
|
||||
(lstrlenW(value) + 1) * sizeof(WCHAR));
|
||||
RegCloseKey(key);
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* regsvr_key_defvalueA
|
||||
*/
|
||||
static LONG register_key_defvalueA(
|
||||
HKEY base,
|
||||
WCHAR const *name,
|
||||
char const *value)
|
||||
{
|
||||
LONG res;
|
||||
HKEY key;
|
||||
|
||||
res = RegCreateKeyExW(base, name, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &key, NULL);
|
||||
if (res != ERROR_SUCCESS) return res;
|
||||
res = RegSetValueExA(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
|
||||
lstrlenA(value) + 1);
|
||||
RegCloseKey(key);
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* regsvr_progid
|
||||
*/
|
||||
static LONG register_progid(
|
||||
WCHAR const *clsid,
|
||||
char const *progid,
|
||||
char const *curver_progid,
|
||||
char const *name,
|
||||
char const *extra)
|
||||
{
|
||||
LONG res;
|
||||
HKEY progid_key;
|
||||
|
||||
res = RegCreateKeyExA(HKEY_CLASSES_ROOT, progid, 0,
|
||||
NULL, 0, KEY_READ | KEY_WRITE, NULL,
|
||||
&progid_key, NULL);
|
||||
if (res != ERROR_SUCCESS) return res;
|
||||
|
||||
if (name) {
|
||||
res = RegSetValueExA(progid_key, NULL, 0, REG_SZ,
|
||||
(CONST BYTE*)name, strlen(name) + 1);
|
||||
if (res != ERROR_SUCCESS) goto error_close_progid_key;
|
||||
}
|
||||
|
||||
if (clsid) {
|
||||
res = register_key_defvalueW(progid_key, clsid_keyname, clsid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_progid_key;
|
||||
}
|
||||
|
||||
if (curver_progid) {
|
||||
res = register_key_defvalueA(progid_key, curver_keyname,
|
||||
curver_progid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_progid_key;
|
||||
}
|
||||
|
||||
if (extra) {
|
||||
HKEY extra_key;
|
||||
|
||||
res = RegCreateKeyExA(progid_key, extra, 0,
|
||||
NULL, 0, KEY_READ | KEY_WRITE, NULL,
|
||||
&extra_key, NULL);
|
||||
if (res == ERROR_SUCCESS)
|
||||
RegCloseKey(extra_key);
|
||||
}
|
||||
|
||||
error_close_progid_key:
|
||||
RegCloseKey(progid_key);
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* recursive_delete_key
|
||||
*/
|
||||
static LONG recursive_delete_key(HKEY key)
|
||||
{
|
||||
LONG res;
|
||||
WCHAR subkey_name[MAX_PATH];
|
||||
DWORD cName;
|
||||
HKEY subkey;
|
||||
|
||||
for (;;) {
|
||||
cName = sizeof(subkey_name) / sizeof(WCHAR);
|
||||
res = RegEnumKeyExW(key, 0, subkey_name, &cName,
|
||||
NULL, NULL, NULL, NULL);
|
||||
if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) {
|
||||
res = ERROR_SUCCESS; /* presumably we're done enumerating */
|
||||
break;
|
||||
}
|
||||
res = RegOpenKeyExW(key, subkey_name, 0,
|
||||
KEY_READ | KEY_WRITE, &subkey);
|
||||
if (res == ERROR_FILE_NOT_FOUND) continue;
|
||||
if (res != ERROR_SUCCESS) break;
|
||||
|
||||
res = recursive_delete_key(subkey);
|
||||
RegCloseKey(subkey);
|
||||
if (res != ERROR_SUCCESS) break;
|
||||
}
|
||||
|
||||
if (res == ERROR_SUCCESS) res = RegDeleteKeyW(key, 0);
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* recursive_delete_keyA
|
||||
*/
|
||||
static LONG recursive_delete_keyA(HKEY base, char const *name)
|
||||
{
|
||||
LONG res;
|
||||
HKEY key;
|
||||
|
||||
res = RegOpenKeyExA(base, name, 0, KEY_READ | KEY_WRITE, &key);
|
||||
if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
|
||||
if (res != ERROR_SUCCESS) return res;
|
||||
res = recursive_delete_key(key);
|
||||
RegCloseKey(key);
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* recursive_delete_keyW
|
||||
*/
|
||||
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
|
||||
{
|
||||
LONG res;
|
||||
HKEY key;
|
||||
|
||||
res = RegOpenKeyExW(base, name, 0, KEY_READ | KEY_WRITE, &key);
|
||||
if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
|
||||
if (res != ERROR_SUCCESS) return res;
|
||||
res = recursive_delete_key(key);
|
||||
RegCloseKey(key);
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* coclass list
|
||||
*/
|
||||
static struct regsvr_coclass const coclass_list[] = {
|
||||
{
|
||||
&CLSID_DxDiagProvider,
|
||||
"DxDiagProvider Class",
|
||||
NULL,
|
||||
"dxdiagn.dll",
|
||||
"Apartment",
|
||||
NULL,
|
||||
"DxDiag.DxDiagProvider.1",
|
||||
"DxDiag.DxDiagProvider"
|
||||
},
|
||||
{ NULL } /* list terminator */
|
||||
};
|
||||
|
||||
/***********************************************************************
|
||||
* interface list
|
||||
*/
|
||||
|
||||
static struct regsvr_interface const interface_list[] = {
|
||||
{ NULL } /* list terminator */
|
||||
};
|
||||
|
||||
/***********************************************************************
|
||||
* DllRegisterServer (DXDIAGN.@)
|
||||
*/
|
||||
HRESULT WINAPI DllRegisterServer(void)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("\n");
|
||||
|
||||
hr = register_coclasses(coclass_list);
|
||||
if (SUCCEEDED(hr))
|
||||
hr = register_interfaces(interface_list);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* DllUnregisterServer (DXDIAGN.@)
|
||||
*/
|
||||
HRESULT WINAPI DllUnregisterServer(void)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("\n");
|
||||
|
||||
hr = unregister_coclasses(coclass_list);
|
||||
if (SUCCEEDED(hr))
|
||||
hr = unregister_interfaces(interface_list);
|
||||
return hr;
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
/*
|
||||
* Copyright 2004 Raphael Junqueira
|
||||
* Resource identifiers for dxdiagn
|
||||
*
|
||||
* Copyright 2011 Andrew Nguyen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -13,14 +15,10 @@
|
|||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#define WINE_FILEDESCRIPTION_STR "Wine DxDiag 8"
|
||||
#define WINE_FILENAME_STR "dxdiagn.dll"
|
||||
#define WINE_FILEVERSION 5,3,1,902
|
||||
#define WINE_FILEVERSION_STR "5.3.1.902"
|
||||
#define WINE_PRODUCTVERSION 5,3,1,902
|
||||
#define WINE_PRODUCTVERSION_STR "5.3"
|
||||
#include <windef.h>
|
||||
|
||||
#include "wine/wine_common_ver.rc"
|
||||
#define IDS_REGIONAL_SETTING 1
|
||||
#define IDS_PAGE_FILE_FORMAT 2
|
155
reactos/include/reactos/wine/dxdiag.h
Normal file
155
reactos/include/reactos/wine/dxdiag.h
Normal file
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* Copyright (C) 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __WINE_DXDIAG_H
|
||||
#define __WINE_DXDIAG_H
|
||||
|
||||
#include <ole2.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* defined(__cplusplus) */
|
||||
|
||||
/*****************************************************************************
|
||||
* #defines and error codes
|
||||
*/
|
||||
#define DXDIAG_DX9_SDK_VERSION 111
|
||||
|
||||
#define _FACDXDIAG 0x007
|
||||
#define MAKE_DXDIAGHRESULT( code ) MAKE_HRESULT( 1, _FACDXDIAG, code )
|
||||
|
||||
/*
|
||||
* DXDiag Errors
|
||||
*/
|
||||
#define DXDIAG_E_INSUFFICIENT_BUFFER MAKE_DXDIAGHRESULT(0x007A)
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* DXDiag structures Typedefs
|
||||
*/
|
||||
typedef struct _DXDIAG_INIT_PARAMS {
|
||||
DWORD dwSize;
|
||||
DWORD dwDxDiagHeaderVersion;
|
||||
BOOL bAllowWHQLChecks;
|
||||
VOID* pReserved;
|
||||
} DXDIAG_INIT_PARAMS;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Predeclare the interfaces
|
||||
*/
|
||||
/* CLSIDs */
|
||||
DEFINE_GUID(CLSID_DxDiagProvider, 0xA65B8071, 0x3BFE, 0x4213, 0x9A, 0x5B, 0x49, 0x1D, 0xA4, 0x46, 0x1C, 0xA7);
|
||||
|
||||
/* IIDs */
|
||||
DEFINE_GUID(IID_IDxDiagProvider, 0x9C6B4CB0, 0x23F8, 0x49CC, 0xA3, 0xED, 0x45, 0xA5, 0x50, 0x00, 0xA6, 0xD2);
|
||||
DEFINE_GUID(IID_IDxDiagContainer, 0x7D0F462F, 0x4064, 0x4862, 0xBC, 0x7F, 0x93, 0x3E, 0x50, 0x58, 0xC1, 0x0F);
|
||||
|
||||
/* typedef definitions */
|
||||
typedef struct IDxDiagProvider *LPDXDIAGPROVIDER, *PDXDIAGPROVIDER;
|
||||
typedef struct IDxDiagContainer *LPDXDIAGCONTAINER, *PDXDIAGCONTAINER;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDxDiagContainer interface
|
||||
*/
|
||||
#ifdef WINE_NO_UNICODE_MACROS
|
||||
#undef GetProp
|
||||
#endif
|
||||
|
||||
#define INTERFACE IDxDiagContainer
|
||||
DECLARE_INTERFACE_(IDxDiagContainer,IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
|
||||
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release)(THIS) PURE;
|
||||
/*** IDxDiagContainer methods ***/
|
||||
STDMETHOD(GetNumberOfChildContainers)(THIS_ DWORD* pdwCount) PURE;
|
||||
STDMETHOD(EnumChildContainerNames)(THIS_ DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer) PURE;
|
||||
STDMETHOD(GetChildContainer)(THIS_ LPCWSTR pwszContainer, IDxDiagContainer** ppInstance) PURE;
|
||||
STDMETHOD(GetNumberOfProps)(THIS_ DWORD* pdwCount) PURE;
|
||||
STDMETHOD(EnumPropNames)(THIS_ DWORD dwIndex, LPWSTR pwszPropName, DWORD cchPropName) PURE;
|
||||
STDMETHOD(GetProp)(THIS_ LPCWSTR pwszPropName, VARIANT* pvarProp) PURE;
|
||||
};
|
||||
#undef INTERFACE
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
/*** IUnknown methods ***/
|
||||
#define IDxDiagContainer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDxDiagContainer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDxDiagContainer_Release(p) (p)->lpVtbl->Release(p)
|
||||
/*** IDxDiagContainer methods ***/
|
||||
#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->lpVtbl->GetNumberOfChildContainers(p,a)
|
||||
#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->lpVtbl->EnumChildContainerNames(p,a,b,c)
|
||||
#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->lpVtbl->GetChildContainer(p,a,b)
|
||||
#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->lpVtbl->GetNumberOfProps(p,a)
|
||||
#define IDxDiagContainer_EnumPropNames(p,a,b,c) (p)->lpVtbl->EnumPropNames(p,a,b,c)
|
||||
#define IDxDiagContainer_GetProp(p,a,b) (p)->lpVtbl->GetProp(p,a,b)
|
||||
#else
|
||||
/*** IUnknown methods ***/
|
||||
#define IDxDiagContainer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDxDiagContainer_AddRef(p) (p)->AddRef()
|
||||
#define IDxDiagContainer_Release(p) (p)->Release()
|
||||
/*** IDxDiagContainer methods ***/
|
||||
#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->GetNumberOfChildContainers(a)
|
||||
#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->EnumChildContainerNames(a,b,c)
|
||||
#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->GetChildContainer(a,b)
|
||||
#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->GetNumberOfProps(a)
|
||||
#define IDxDiagContainer_EnumPropNames(p,a,b,c) (p)->EnumPropNames(a,b,c)
|
||||
#define IDxDiagContainer_GetProp(p,a,b) (p)->GetProp(a,b)
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* IDxDiagProvider interface
|
||||
*/
|
||||
#define INTERFACE IDxDiagProvider
|
||||
DECLARE_INTERFACE_(IDxDiagProvider,IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
|
||||
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release)(THIS) PURE;
|
||||
/*** IDxDiagProvider methods ***/
|
||||
STDMETHOD(Initialize)(THIS_ DXDIAG_INIT_PARAMS* pParams) PURE;
|
||||
STDMETHOD(GetRootContainer)(THIS_ IDxDiagContainer** ppInstance) PURE;
|
||||
};
|
||||
#undef INTERFACE
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
/*** IUnknown methods ***/
|
||||
#define IDxDiagProvider_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDxDiagProvider_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDxDiagProvider_Release(p) (p)->lpVtbl->Release(p)
|
||||
/*** IDxDiagProvider methods ***/
|
||||
#define IDxDiagProvider_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
|
||||
#define IDxDiagProvider_GetRootContainer(p,a) (p)->lpVtbl->GetRootContainer(p,a)
|
||||
#else
|
||||
/*** IUnknown methods ***/
|
||||
#define IDxDiagProvider_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDxDiagProvider_AddRef(p) (p)->AddRef()
|
||||
#define IDxDiagProvider_Release(p) (p)->Release()
|
||||
/*** IDxDiagProvider methods ***/
|
||||
#define IDxDiagProvider_Initialize(p,a) (p)->Initialize(a)
|
||||
#define IDxDiagProvider_GetRootContainer(p,a) (p)->GetRootContainer(a)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -40,7 +40,7 @@ reactos/dll/directx/wine/dmusic # Synced to Wine-1.5.26
|
|||
reactos/dll/directx/wine/dplay # Synced to Wine-1.7.1
|
||||
reactos/dll/directx/wine/dplayx # Synced to Wine-1.7.1
|
||||
reactos/dll/directx/wine/dsound # Synced to Wine-1.7.1
|
||||
reactos/dll/directx/wine/dxdiagn # Synced to Wine-0_9_5
|
||||
reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.1
|
||||
reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.1
|
||||
reactos/dll/directx/wine/msdmo # Autosync
|
||||
reactos/dll/directx/wine/qedit # Autosync
|
||||
|
|
Loading…
Reference in a new issue