Warn the user if he is running the test in interactive mode but the
[wine] / dlls / dxdiagn / dxdiag_private.h
1 /*
2  * DXDiag private include file
3  *
4  * Copyright 2004 Raphael Junqueira
5  *
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.
10  *
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.
15  *
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WINE_DXDIAG_PRIVATE_H
22 #define __WINE_DXDIAG_PRIVATE_H
23
24 #include <stdarg.h>
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "wingdi.h"
29 #include "winuser.h"
30 #include "objbase.h"
31 #include "oleauto.h"
32
33 #include "dxdiag.h"
34
35 /* DXDiag Interfaces: */
36 typedef struct IDxDiagProviderImpl  IDxDiagProviderImpl;
37 typedef struct IDxDiagContainerImpl IDxDiagContainerImpl;
38
39 /* ---------------- */
40 /* IDxDiagProvider  */
41 /* ---------------- */
42
43 /*****************************************************************************
44  * Predeclare the interface implementation structures
45  */
46 extern IDxDiagProviderVtbl DxDiagProvider_Vtbl;
47
48 /*****************************************************************************
49  * IDxDiagProvider implementation structure
50  */
51 struct IDxDiagProviderImpl {
52   /* IUnknown fields */
53   IDxDiagProviderVtbl *lpVtbl;
54   DWORD       ref;
55   /* IDxDiagProvider fields */
56   BOOL        init;
57   DXDIAG_INIT_PARAMS params;
58   IDxDiagContainer* pRootContainer;
59 };
60
61 /* IUnknown: */
62 extern HRESULT WINAPI IDxDiagProviderImpl_QueryInterface(PDXDIAGPROVIDER iface, REFIID riid, LPVOID *ppobj);
63 extern ULONG WINAPI IDxDiagProviderImpl_AddRef(PDXDIAGPROVIDER iface);
64 extern ULONG WINAPI IDxDiagProviderImpl_Release(PDXDIAGPROVIDER iface);
65
66 /* IDxDiagProvider: */
67 extern HRESULT WINAPI IDxDiagProviderImpl_Initialize(PDXDIAGPROVIDER iface, DXDIAG_INIT_PARAMS* pParams);
68 extern HRESULT WINAPI IDxDiagProviderImpl_GetRootContainer(PDXDIAGPROVIDER iface, IDxDiagContainer** ppInstance);
69
70 /* ---------------- */
71 /* IDxDiagContainer  */
72 /* ---------------- */
73
74 typedef struct IDxDiagContainerImpl_SubContainer {
75   IDxDiagContainer* pCont;
76   WCHAR* contName;
77   struct IDxDiagContainerImpl_SubContainer* next;
78 } IDxDiagContainerImpl_SubContainer;
79
80 typedef struct IDxDiagContainerImpl_Property {
81   LPWSTR vName;
82   VARIANT v;
83   struct IDxDiagContainerImpl_Property* next;
84 } IDxDiagContainerImpl_Property;
85
86
87 /*****************************************************************************
88  * Predeclare the interface implementation structures
89  */
90 extern IDxDiagContainerVtbl DxDiagContainer_Vtbl;
91
92 /*****************************************************************************
93  * IDxDiagContainer implementation structure
94  */
95 struct IDxDiagContainerImpl {
96   /* IUnknown fields */
97   IDxDiagContainerVtbl *lpVtbl;
98   DWORD       ref;
99   /* IDxDiagContainer fields */
100   IDxDiagContainerImpl_Property* properties;  
101   IDxDiagContainerImpl_SubContainer* subContainers;
102   DWORD nProperties;
103   DWORD nSubContainers;
104 };
105
106 /* IUnknown: */
107 extern HRESULT WINAPI IDxDiagContainerImpl_QueryInterface(PDXDIAGCONTAINER iface, REFIID riid, LPVOID *ppobj);
108 extern ULONG WINAPI IDxDiagContainerImpl_AddRef(PDXDIAGCONTAINER iface);
109 extern ULONG WINAPI IDxDiagContainerImpl_Release(PDXDIAGCONTAINER iface);
110
111 /* IDxDiagContainer: */
112 extern HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfChildContainers(PDXDIAGCONTAINER iface,  DWORD* pdwCount);
113 extern HRESULT WINAPI IDxDiagContainerImpl_EnumChildContainerNames(PDXDIAGCONTAINER iface, DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer);
114 extern HRESULT WINAPI IDxDiagContainerImpl_GetChildContainer(PDXDIAGCONTAINER iface, LPCWSTR pwszContainer, IDxDiagContainer** ppInstance);
115 extern HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfProps(PDXDIAGCONTAINER iface, DWORD* pdwCount);
116 extern HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(PDXDIAGCONTAINER iface, DWORD dwIndex, LPWSTR pwszPropName, DWORD cchPropName);
117 extern HRESULT WINAPI IDxDiagContainerImpl_GetProp(PDXDIAGCONTAINER iface, LPCWSTR pwszPropName, VARIANT* pvarProp);
118
119 /** Internal */
120 extern HRESULT WINAPI IDxDiagContainerImpl_AddProp(PDXDIAGCONTAINER iface, LPCWSTR pwszPropName, VARIANT* pVarProp);
121 extern HRESULT WINAPI IDxDiagContainerImpl_AddChildContainer(PDXDIAGCONTAINER iface, LPCWSTR pszContName, PDXDIAGCONTAINER pSubCont);
122
123 /**
124  * factories
125  */
126 extern HRESULT DXDiag_CreateDXDiagProvider(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj);
127
128 /** internal factory */
129 extern HRESULT DXDiag_CreateDXDiagContainer(REFIID riid, LPVOID *ppobj);
130 extern HRESULT DXDiag_InitRootDXDiagContainer(IDxDiagContainer* pRootCont);
131
132 /**********************************************************************
133  * Dll lifetime tracking declaration for dxdiagn.dll
134  */
135 extern LONG DXDIAGN_refCount;
136 static inline void DXDIAGN_LockModule() { InterlockedIncrement( &DXDIAGN_refCount ); }
137 static inline void DXDIAGN_UnlockModule() { InterlockedDecrement( &DXDIAGN_refCount ); }
138
139 #endif