mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 08:04:47 +00:00
dxdiagn: COM cleanup for the IDxDiagContainer iface.
This commit is contained in:
parent
a7f0204045
commit
fd513acf2e
|
@ -28,10 +28,16 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(dxdiag);
|
WINE_DEFAULT_DEBUG_CHANNEL(dxdiag);
|
||||||
|
|
||||||
/* IDxDiagContainer IUnknown parts follow: */
|
static inline IDxDiagContainerImpl *impl_from_IDxDiagContainer(IDxDiagContainer *iface)
|
||||||
static HRESULT WINAPI IDxDiagContainerImpl_QueryInterface(PDXDIAGCONTAINER iface, REFIID riid, LPVOID *ppobj)
|
|
||||||
{
|
{
|
||||||
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 (!ppobj) return E_INVALIDARG;
|
||||||
|
|
||||||
|
@ -47,8 +53,9 @@ static HRESULT WINAPI IDxDiagContainerImpl_QueryInterface(PDXDIAGCONTAINER iface
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI IDxDiagContainerImpl_AddRef(PDXDIAGCONTAINER iface) {
|
static ULONG WINAPI IDxDiagContainerImpl_AddRef(IDxDiagContainer *iface)
|
||||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
{
|
||||||
|
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||||
ULONG refCount = InterlockedIncrement(&This->ref);
|
ULONG refCount = InterlockedIncrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
|
TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
|
||||||
|
@ -58,8 +65,9 @@ static ULONG WINAPI IDxDiagContainerImpl_AddRef(PDXDIAGCONTAINER iface) {
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI IDxDiagContainerImpl_Release(PDXDIAGCONTAINER iface) {
|
static ULONG WINAPI IDxDiagContainerImpl_Release(IDxDiagContainer *iface)
|
||||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
{
|
||||||
|
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||||
ULONG refCount = InterlockedDecrement(&This->ref);
|
ULONG refCount = InterlockedDecrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
|
TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
|
||||||
|
@ -75,8 +83,11 @@ static ULONG WINAPI IDxDiagContainerImpl_Release(PDXDIAGCONTAINER iface) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IDxDiagContainer Interface follow: */
|
/* IDxDiagContainer Interface follow: */
|
||||||
static HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfChildContainers(PDXDIAGCONTAINER iface, DWORD* pdwCount) {
|
static HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfChildContainers(IDxDiagContainer *iface,
|
||||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
DWORD *pdwCount)
|
||||||
|
{
|
||||||
|
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||||
|
|
||||||
TRACE("(%p)\n", iface);
|
TRACE("(%p)\n", iface);
|
||||||
if (NULL == pdwCount) {
|
if (NULL == pdwCount) {
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
@ -85,8 +96,10 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfChildContainers(PDXDIAGCON
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IDxDiagContainerImpl_EnumChildContainerNames(PDXDIAGCONTAINER iface, DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer) {
|
static HRESULT WINAPI IDxDiagContainerImpl_EnumChildContainerNames(IDxDiagContainer *iface,
|
||||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer)
|
||||||
|
{
|
||||||
|
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||||
IDxDiagContainerImpl_Container *p;
|
IDxDiagContainerImpl_Container *p;
|
||||||
DWORD i = 0;
|
DWORD i = 0;
|
||||||
|
|
||||||
|
@ -126,8 +139,10 @@ static HRESULT IDxDiagContainerImpl_GetChildContainerInternal(IDxDiagContainerIm
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IDxDiagContainerImpl_GetChildContainer(PDXDIAGCONTAINER iface, LPCWSTR pwszContainer, IDxDiagContainer **ppInstance) {
|
static HRESULT WINAPI IDxDiagContainerImpl_GetChildContainer(IDxDiagContainer *iface,
|
||||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
LPCWSTR pwszContainer, IDxDiagContainer **ppInstance)
|
||||||
|
{
|
||||||
|
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||||
IDxDiagContainerImpl_Container *pContainer = This->cont;
|
IDxDiagContainerImpl_Container *pContainer = This->cont;
|
||||||
LPWSTR tmp, orig_tmp;
|
LPWSTR tmp, orig_tmp;
|
||||||
INT tmp_len;
|
INT tmp_len;
|
||||||
|
@ -173,8 +188,11 @@ on_error:
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfProps(PDXDIAGCONTAINER iface, DWORD* pdwCount) {
|
static HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfProps(IDxDiagContainer *iface,
|
||||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
DWORD *pdwCount)
|
||||||
|
{
|
||||||
|
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||||
|
|
||||||
TRACE("(%p)\n", iface);
|
TRACE("(%p)\n", iface);
|
||||||
if (NULL == pdwCount) {
|
if (NULL == pdwCount) {
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
@ -183,8 +201,10 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfProps(PDXDIAGCONTAINER ifa
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(PDXDIAGCONTAINER iface, DWORD dwIndex, LPWSTR pwszPropName, DWORD cchPropName) {
|
static HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(IDxDiagContainer *iface, DWORD dwIndex,
|
||||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
LPWSTR pwszPropName, DWORD cchPropName)
|
||||||
|
{
|
||||||
|
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||||
IDxDiagContainerImpl_Property *p;
|
IDxDiagContainerImpl_Property *p;
|
||||||
DWORD i = 0;
|
DWORD i = 0;
|
||||||
|
|
||||||
|
@ -209,8 +229,10 @@ static HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(PDXDIAGCONTAINER iface,
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IDxDiagContainerImpl_GetProp(PDXDIAGCONTAINER iface, LPCWSTR pwszPropName, VARIANT* pvarProp) {
|
static HRESULT WINAPI IDxDiagContainerImpl_GetProp(IDxDiagContainer *iface, LPCWSTR pwszPropName,
|
||||||
IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface;
|
VARIANT *pvarProp)
|
||||||
|
{
|
||||||
|
IDxDiagContainerImpl *This = impl_from_IDxDiagContainer(iface);
|
||||||
IDxDiagContainerImpl_Property *p;
|
IDxDiagContainerImpl_Property *p;
|
||||||
|
|
||||||
TRACE("(%p, %s, %p)\n", iface, debugstr_w(pwszPropName), pvarProp);
|
TRACE("(%p, %s, %p)\n", iface, debugstr_w(pwszPropName), pvarProp);
|
||||||
|
@ -254,10 +276,10 @@ HRESULT DXDiag_CreateDXDiagContainer(REFIID riid, IDxDiagContainerImpl_Container
|
||||||
*ppobj = NULL;
|
*ppobj = NULL;
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
container->lpVtbl = &DxDiagContainer_Vtbl;
|
container->IDxDiagContainer_iface.lpVtbl = &DxDiagContainer_Vtbl;
|
||||||
container->ref = 0; /* will be inited with QueryInterface */
|
container->ref = 0; /* will be inited with QueryInterface */
|
||||||
container->cont = cont;
|
container->cont = cont;
|
||||||
container->pProv = pProv;
|
container->pProv = pProv;
|
||||||
IDxDiagProvider_AddRef(pProv);
|
IDxDiagProvider_AddRef(pProv);
|
||||||
return IDxDiagContainerImpl_QueryInterface((PDXDIAGCONTAINER)container, riid, ppobj);
|
return IDxDiagContainerImpl_QueryInterface(&container->IDxDiagContainer_iface, riid, ppobj);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,10 +61,8 @@ typedef struct IDxDiagContainerImpl_Property {
|
||||||
* IDxDiagContainer implementation structure
|
* IDxDiagContainer implementation structure
|
||||||
*/
|
*/
|
||||||
struct IDxDiagContainerImpl {
|
struct IDxDiagContainerImpl {
|
||||||
/* IUnknown fields */
|
IDxDiagContainer IDxDiagContainer_iface;
|
||||||
const IDxDiagContainerVtbl *lpVtbl;
|
LONG ref;
|
||||||
LONG ref;
|
|
||||||
/* IDxDiagContainer fields */
|
|
||||||
IDxDiagContainerImpl_Container *cont;
|
IDxDiagContainerImpl_Container *cont;
|
||||||
IDxDiagProvider *pProv;
|
IDxDiagProvider *pProv;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue