ReactOS  0.4.14-dev-77-gd9e7c48
provider.c File Reference
#include "config.h"
#include "dxdiag_private.h"
#include "wine/unicode.h"
#include "winver.h"
#include "objidl.h"
#include "uuids.h"
#include "vfw.h"
#include "mmddk.h"
#include "d3d9.h"
#include "strmif.h"
#include "initguid.h"
#include "fil_data.h"
#include "psapi.h"
#include "wbemcli.h"
#include "dsound.h"
#include "wine/debug.h"
Include dependency graph for provider.c:

Go to the source code of this file.

Classes

struct  IDxDiagProviderImpl
 
struct  enum_context
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 
#define NONAMELESSSTRUCT
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (dxdiag)
 
static HRESULT build_information_tree (IDxDiagContainerImpl_Container **pinfo_root)
 
static void free_information_tree (IDxDiagContainerImpl_Container *node)
 
static IDxDiagProviderImplimpl_from_IDxDiagProvider (IDxDiagProvider *iface)
 
static HRESULT WINAPI IDxDiagProviderImpl_QueryInterface (IDxDiagProvider *iface, REFIID riid, void **ppobj)
 
static ULONG WINAPI IDxDiagProviderImpl_AddRef (IDxDiagProvider *iface)
 
static ULONG WINAPI IDxDiagProviderImpl_Release (IDxDiagProvider *iface)
 
static HRESULT WINAPI IDxDiagProviderImpl_Initialize (IDxDiagProvider *iface, DXDIAG_INIT_PARAMS *pParams)
 
static HRESULT WINAPI IDxDiagProviderImpl_GetRootContainer (IDxDiagProvider *iface, IDxDiagContainer **ppInstance)
 
HRESULT DXDiag_CreateDXDiagProvider (LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj)
 
static void free_property_information (IDxDiagContainerImpl_Property *prop)
 
static IDxDiagContainerImpl_Containerallocate_information_node (const WCHAR *name)
 
static IDxDiagContainerImpl_Propertyallocate_property_information (const WCHAR *name)
 
static void add_subcontainer (IDxDiagContainerImpl_Container *node, IDxDiagContainerImpl_Container *subCont)
 
static HRESULT add_bstr_property (IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
 
static HRESULT add_ui4_property (IDxDiagContainerImpl_Container *node, const WCHAR *propName, DWORD data)
 
static HRESULT add_i4_property (IDxDiagContainerImpl_Container *node, const WCHAR *propName, LONG data)
 
static HRESULT add_bool_property (IDxDiagContainerImpl_Container *node, const WCHAR *propName, BOOL data)
 
static HRESULT add_ull_as_bstr_property (IDxDiagContainerImpl_Container *node, const WCHAR *propName, ULONGLONG data)
 
static DWORDenumerate_processes (DWORD *list_count)
 
static BOOL get_process_name_from_pid (DWORD pid, WCHAR *buf, DWORD chars)
 
static BOOL is_netmeeting_running (void)
 
static HRESULT fill_language_information (IDxDiagContainerImpl_Container *node)
 
static HRESULT fill_datetime_information (IDxDiagContainerImpl_Container *node)
 
static HRESULT fill_os_string_information (IDxDiagContainerImpl_Container *node, OSVERSIONINFOW *info)
 
static HRESULT fill_processor_information (IDxDiagContainerImpl_Container *node)
 
static HRESULT build_systeminfo_tree (IDxDiagContainerImpl_Container *node)
 
static DWORD depth_for_pixelformat (D3DFORMAT format)
 
static BOOL get_texture_memory (GUID *adapter, DWORD *available_mem)
 
static const WCHARvendor_id_to_manufacturer_string (DWORD vendor_id)
 
static HRESULT fill_display_information_d3d (IDxDiagContainerImpl_Container *node)
 
static HRESULT fill_display_information_fallback (IDxDiagContainerImpl_Container *node)
 
static HRESULT build_displaydevices_tree (IDxDiagContainerImpl_Container *node)
 
static LPWSTR guid_to_string (LPWSTR lpwstr, REFGUID lpcguid)
 
BOOL CALLBACK dsound_enum (LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID context)
 
static HRESULT build_directsound_tree (IDxDiagContainerImpl_Container *node)
 
static HRESULT build_directmusic_tree (IDxDiagContainerImpl_Container *node)
 
static HRESULT build_directinput_tree (IDxDiagContainerImpl_Container *node)
 
static HRESULT build_directplay_tree (IDxDiagContainerImpl_Container *node)
 
static HRESULT build_systemdevices_tree (IDxDiagContainerImpl_Container *node)
 
static HRESULT fill_file_description (IDxDiagContainerImpl_Container *node, const WCHAR *szFilePath, const WCHAR *szFileName)
 
static HRESULT build_directxfiles_tree (IDxDiagContainerImpl_Container *node)
 
static HRESULT read_property_names (IPropertyBag *pPropBag, VARIANT *friendly_name, VARIANT *clsid_name)
 
static HRESULT fill_filter_data_information (IDxDiagContainerImpl_Container *subcont, BYTE *pData, ULONG cb)
 
static HRESULT fill_filter_container (IDxDiagContainerImpl_Container *subcont, IMoniker *pMoniker)
 
static HRESULT build_directshowfilters_tree (IDxDiagContainerImpl_Container *node)
 
static HRESULT build_logicaldisks_tree (IDxDiagContainerImpl_Container *node)
 

Variables

static const WCHAR szEmpty [] = {0}
 
static const WCHAR szDescription [] = {'s','z','D','e','s','c','r','i','p','t','i','o','n',0}
 
static const WCHAR szDeviceName [] = {'s','z','D','e','v','i','c','e','N','a','m','e',0}
 
static const WCHAR szKeyDeviceID [] = {'s','z','K','e','y','D','e','v','i','c','e','I','D',0}
 
static const WCHAR szKeyDeviceKey [] = {'s','z','K','e','y','D','e','v','i','c','e','K','e','y',0}
 
static const WCHAR szVendorId [] = {'s','z','V','e','n','d','o','r','I','d',0}
 
static const WCHAR szDeviceId [] = {'s','z','D','e','v','i','c','e','I','d',0}
 
static const WCHAR szDeviceIdentifier [] = {'s','z','D','e','v','i','c','e','I','d','e','n','t','i','f','i','e','r',0}
 
static const WCHAR dwWidth [] = {'d','w','W','i','d','t','h',0}
 
static const WCHAR dwHeight [] = {'d','w','H','e','i','g','h','t',0}
 
static const WCHAR dwBpp [] = {'d','w','B','p','p',0}
 
static const WCHAR szDisplayMemoryLocalized [] = {'s','z','D','i','s','p','l','a','y','M','e','m','o','r','y','L','o','c','a','l','i','z','e','d',0}
 
static const WCHAR szDisplayMemoryEnglish [] = {'s','z','D','i','s','p','l','a','y','M','e','m','o','r','y','E','n','g','l','i','s','h',0}
 
static const WCHAR szDisplayModeLocalized [] = {'s','z','D','i','s','p','l','a','y','M','o','d','e','L','o','c','a','l','i','z','e','d',0}
 
static const WCHAR szDisplayModeEnglish [] = {'s','z','D','i','s','p','l','a','y','M','o','d','e','E','n','g','l','i','s','h',0}
 
static const WCHAR szDriverName [] = {'s','z','D','r','i','v','e','r','N','a','m','e',0}
 
static const WCHAR szDriverVersion [] = {'s','z','D','r','i','v','e','r','V','e','r','s','i','o','n',0}
 
static const WCHAR szSubSysId [] = {'s','z','S','u','b','S','y','s','I','d',0}
 
static const WCHAR szRevisionId [] = {'s','z','R','e','v','i','s','i','o','n','I','d',0}
 
static const WCHAR dwRefreshRate [] = {'d','w','R','e','f','r','e','s','h','R','a','t','e',0}
 
static const WCHAR szManufacturer [] = {'s','z','M','a','n','u','f','a','c','t','u','r','e','r',0}
 
static const WCHAR szChipType [] = {'s','z','C','h','i','p','T','y','p','e',0}
 
static const WCHAR szDACType [] = {'s','z','D','A','C','T','y','p','e',0}
 
static const WCHAR szRevision [] = {'s','z','R','e','v','i','s','i','o','n',0}
 
static const WCHAR szMonitorName [] = {'s','z','M','o','n','i','t','o','r','N','a','m','e',0}
 
static const WCHAR szMonitorMaxRes [] = {'s','z','M','o','n','i','t','o','r','M','a','x','R','e','s',0}
 
static const WCHAR szDriverAttributes [] = {'s','z','D','r','i','v','e','r','A','t','t','r','i','b','u','t','e','s',0}
 
static const WCHAR szDriverLanguageEnglish [] = {'s','z','D','r','i','v','e','r','L','a','n','g','u','a','g','e','E','n','g','l','i','s','h',0}
 
static const WCHAR szDriverLanguageLocalized [] = {'s','z','D','r','i','v','e','r','L','a','n','g','u','a','g','e','L','o','c','a','l','i','z','e','d',0}
 
static const WCHAR szDriverDateEnglish [] = {'s','z','D','r','i','v','e','r','D','a','t','e','E','n','g','l','i','s','h',0}
 
static const WCHAR szDriverDateLocalized [] = {'s','z','D','r','i','v','e','r','D','a','t','e','L','o','c','a','l','i','z','e','d',0}
 
static const WCHAR lDriverSize [] = {'l','D','r','i','v','e','r','S','i','z','e',0}
 
static const WCHAR szMiniVdd [] = {'s','z','M','i','n','i','V','d','d',0}
 
static const WCHAR szMiniVddDateLocalized [] = {'s','z','M','i','n','i','V','d','d','D','a','t','e','L','o','c','a','l','i','z','e','d',0}
 
static const WCHAR szMiniVddDateEnglish [] = {'s','z','M','i','n','i','V','d','d','D','a','t','e','E','n','g','l','i','s','h',0}
 
static const WCHAR lMiniVddSize [] = {'l','M','i','n','i','V','d','d','S','i','z','e',0}
 
static const WCHAR szVdd [] = {'s','z','V','d','d',0}
 
static const WCHAR bCanRenderWindow [] = {'b','C','a','n','R','e','n','d','e','r','W','i','n','d','o','w',0}
 
static const WCHAR bDriverBeta [] = {'b','D','r','i','v','e','r','B','e','t','a',0}
 
static const WCHAR bDriverDebug [] = {'b','D','r','i','v','e','r','D','e','b','u','g',0}
 
static const WCHAR bDriverSigned [] = {'b','D','r','i','v','e','r','S','i','g','n','e','d',0}
 
static const WCHAR bDriverSignedValid [] = {'b','D','r','i','v','e','r','S','i','g','n','e','d','V','a','l','i','d',0}
 
static const WCHAR szDriverSignDate [] = {'s','z','D','r','i','v','e','r','S','i','g','n','D','a','t','e',0}
 
static const WCHAR dwDDIVersion [] = {'d','w','D','D','I','V','e','r','s','i','o','n',0}
 
static const WCHAR szDDIVersionEnglish [] = {'s','z','D','D','I','V','e','r','s','i','o','n','E','n','g','l','i','s','h',0}
 
static const WCHAR szDDIVersionLocalized [] = {'s','z','D','D','I','V','e','r','s','i','o','n','L','o','c','a','l','i','z','e','d',0}
 
static const WCHAR iAdapter [] = {'i','A','d','a','p','t','e','r',0}
 
static const WCHAR dwWHQLLevel [] = {'d','w','W','H','Q','L','L','e','v','e','l',0}
 
static const IDxDiagProviderVtbl DxDiagProvider_Vtbl
 
static const WCHAR szGUIDFmt []
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 25 of file provider.c.

◆ NONAMELESSSTRUCT

#define NONAMELESSSTRUCT

Definition at line 27 of file provider.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 26 of file provider.c.

Function Documentation

◆ add_bool_property()

static HRESULT add_bool_property ( IDxDiagContainerImpl_Container node,
const WCHAR propName,
BOOL  data 
)
inlinestatic

Definition at line 373 of file provider.c.

374 {
376 
378  if (!prop)
379  return E_OUTOFMEMORY;
380 
381  V_VT(&prop->vProp) = VT_BOOL;
382  V_BOOL(&prop->vProp) = data ? VARIANT_TRUE : VARIANT_FALSE;
383 
384  list_add_tail(&node->properties, &prop->entry);
385  ++node->nProperties;
386 
387  return S_OK;
388 }
static IDxDiagContainerImpl_Property * allocate_property_information(const WCHAR *name)
Definition: provider.c:289
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define V_BOOL(A)
Definition: oleauto.h:224
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
const WCHAR * prop
Definition: container.c:30
Definition: dlist.c:348

Referenced by build_systeminfo_tree(), fill_display_information_d3d(), and fill_file_description().

◆ add_bstr_property()

static HRESULT add_bstr_property ( IDxDiagContainerImpl_Container node,
const WCHAR propName,
const WCHAR str 
)
inlinestatic

Definition at line 314 of file provider.c.

315 {
317  BSTR bstr;
318 
320  if (!prop)
321  return E_OUTOFMEMORY;
322 
323  bstr = SysAllocString(str);
324  if (!bstr)
325  {
327  return E_OUTOFMEMORY;
328  }
329 
330  V_VT(&prop->vProp) = VT_BSTR;
331  V_BSTR(&prop->vProp) = bstr;
332 
333  list_add_tail(&node->properties, &prop->entry);
334  ++node->nProperties;
335 
336  return S_OK;
337 }
static IDxDiagContainerImpl_Property * allocate_property_information(const WCHAR *name)
Definition: provider.c:289
OLECHAR * BSTR
Definition: compat.h:1934
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const WCHAR * str
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:59
static void free_property_information(IDxDiagContainerImpl_Property *prop)
Definition: provider.c:231
const WCHAR * prop
Definition: container.c:30
Definition: dlist.c:348

Referenced by build_directshowfilters_tree(), build_systeminfo_tree(), dsound_enum(), fill_datetime_information(), fill_display_information_d3d(), fill_display_information_fallback(), fill_file_description(), fill_filter_container(), fill_filter_data_information(), fill_language_information(), fill_os_string_information(), and fill_processor_information().

◆ add_i4_property()

static HRESULT add_i4_property ( IDxDiagContainerImpl_Container node,
const WCHAR propName,
LONG  data 
)
inlinestatic

Definition at line 356 of file provider.c.

357 {
359 
361  if (!prop)
362  return E_OUTOFMEMORY;
363 
364  V_VT(&prop->vProp) = VT_I4;
365  V_I4(&prop->vProp) = data;
366 
367  list_add_tail(&node->properties, &prop->entry);
368  ++node->nProperties;
369 
370  return S_OK;
371 }
Definition: compat.h:1939
static IDxDiagContainerImpl_Property * allocate_property_information(const WCHAR *name)
Definition: provider.c:289
#define V_I4(A)
Definition: oleauto.h:247
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
const WCHAR * prop
Definition: container.c:30
Definition: dlist.c:348

Referenced by fill_display_information_d3d().

◆ add_subcontainer()

static void add_subcontainer ( IDxDiagContainerImpl_Container node,
IDxDiagContainerImpl_Container subCont 
)
inlinestatic

Definition at line 308 of file provider.c.

309 {
310  list_add_tail(&node->subContainers, &subCont->entry);
311  ++node->nSubContainers;
312 }
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
Definition: dlist.c:348

Referenced by build_directshowfilters_tree(), build_directsound_tree(), build_directxfiles_tree(), build_information_tree(), dsound_enum(), fill_display_information_d3d(), and fill_display_information_fallback().

◆ add_ui4_property()

static HRESULT add_ui4_property ( IDxDiagContainerImpl_Container node,
const WCHAR propName,
DWORD  data 
)
inlinestatic

Definition at line 339 of file provider.c.

340 {
342 
344  if (!prop)
345  return E_OUTOFMEMORY;
346 
347  V_VT(&prop->vProp) = VT_UI4;
348  V_UI4(&prop->vProp) = data;
349 
350  list_add_tail(&node->properties, &prop->entry);
351  ++node->nProperties;
352 
353  return S_OK;
354 }
static IDxDiagContainerImpl_Property * allocate_property_information(const WCHAR *name)
Definition: provider.c:289
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define V_UI4(A)
Definition: oleauto.h:270
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
const WCHAR * prop
Definition: container.c:30
Definition: dlist.c:348

Referenced by build_systeminfo_tree(), fill_display_information_d3d(), fill_display_information_fallback(), fill_file_description(), and fill_filter_data_information().

◆ add_ull_as_bstr_property()

static HRESULT add_ull_as_bstr_property ( IDxDiagContainerImpl_Container node,
const WCHAR propName,
ULONGLONG  data 
)
inlinestatic

Definition at line 390 of file provider.c.

391 {
393  HRESULT hr;
394 
396  if (!prop)
397  return E_OUTOFMEMORY;
398 
399  V_VT(&prop->vProp) = VT_UI8;
400  V_UI8(&prop->vProp) = data;
401 
402  hr = VariantChangeType(&prop->vProp, &prop->vProp, 0, VT_BSTR);
403  if (FAILED(hr))
404  {
406  return hr;
407  }
408 
409  list_add_tail(&node->properties, &prop->entry);
410  ++node->nProperties;
411 
412  return S_OK;
413 }
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:965
HRESULT hr
Definition: shlfolder.c:183
static IDxDiagContainerImpl_Property * allocate_property_information(const WCHAR *name)
Definition: provider.c:289
#define V_UI8(A)
Definition: oleauto.h:272
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
static void free_property_information(IDxDiagContainerImpl_Property *prop)
Definition: provider.c:231
const WCHAR * prop
Definition: container.c:30
Definition: dlist.c:348

Referenced by build_systeminfo_tree().

◆ allocate_information_node()

static IDxDiagContainerImpl_Container* allocate_information_node ( const WCHAR name)
static

Definition at line 264 of file provider.c.

265 {
267 
269  if (!ret)
270  return NULL;
271 
272  if (name)
273  {
274  ret->contName = HeapAlloc(GetProcessHeap(), 0, (strlenW(name) + 1) * sizeof(*name));
275  if (!ret->contName)
276  {
277  HeapFree(GetProcessHeap(), 0, ret);
278  return NULL;
279  }
280  strcpyW(ret->contName, name);
281  }
282 
283  list_init(&ret->subContainers);
284  list_init(&ret->properties);
285 
286  return ret;
287 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int ret
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
Definition: name.c:36
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by build_directshowfilters_tree(), build_directsound_tree(), build_directxfiles_tree(), build_information_tree(), dsound_enum(), fill_display_information_d3d(), and fill_display_information_fallback().

◆ allocate_property_information()

static IDxDiagContainerImpl_Property* allocate_property_information ( const WCHAR name)
static

Definition at line 289 of file provider.c.

290 {
292 
294  if (!ret)
295  return NULL;
296 
297  ret->propName = HeapAlloc(GetProcessHeap(), 0, (strlenW(name) + 1) * sizeof(*name));
298  if (!ret->propName)
299  {
300  HeapFree(GetProcessHeap(), 0, ret);
301  return NULL;
302  }
303  strcpyW(ret->propName, name);
304 
305  return ret;
306 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int ret
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
Definition: name.c:36
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by add_bool_property(), add_bstr_property(), add_i4_property(), add_ui4_property(), and add_ull_as_bstr_property().

◆ build_directinput_tree()

static HRESULT build_directinput_tree ( IDxDiagContainerImpl_Container node)
static

Definition at line 1475 of file provider.c.

1476 {
1477  return S_OK;
1478 }
#define S_OK
Definition: intsafe.h:59

Referenced by build_information_tree().

◆ build_directmusic_tree()

static HRESULT build_directmusic_tree ( IDxDiagContainerImpl_Container node)
static

Definition at line 1470 of file provider.c.

1471 {
1472  return S_OK;
1473 }
#define S_OK
Definition: intsafe.h:59

Referenced by build_information_tree().

◆ build_directplay_tree()

static HRESULT build_directplay_tree ( IDxDiagContainerImpl_Container node)
static

Definition at line 1480 of file provider.c.

1481 {
1482  return S_OK;
1483 }
#define S_OK
Definition: intsafe.h:59

Referenced by build_information_tree().

◆ build_directshowfilters_tree()

static HRESULT build_directshowfilters_tree ( IDxDiagContainerImpl_Container node)
static

Definition at line 1820 of file provider.c.

1821 {
1822  static const WCHAR szCatName[] = {'s','z','C','a','t','N','a','m','e',0};
1823  static const WCHAR ClsidCatW[] = {'C','l','s','i','d','C','a','t',0};
1824  static const WCHAR szIdFormat[] = {'%','d',0};
1825 
1826  HRESULT hr;
1827  int i = 0;
1828  ICreateDevEnum *pCreateDevEnum;
1829  IEnumMoniker *pEmCat = NULL;
1830  IMoniker *pMCat = NULL;
1831  IEnumMoniker *pEnum = NULL;
1832 
1833  hr = CoCreateInstance(&CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER,
1834  &IID_ICreateDevEnum, (void **)&pCreateDevEnum);
1835  if (FAILED(hr))
1836  return hr;
1837 
1838  hr = ICreateDevEnum_CreateClassEnumerator(pCreateDevEnum, &CLSID_ActiveMovieCategories, &pEmCat, 0);
1839  if (FAILED(hr))
1840  goto cleanup;
1841 
1842  while (IEnumMoniker_Next(pEmCat, 1, &pMCat, NULL) == S_OK)
1843  {
1844  VARIANT vCatName;
1845  VARIANT vCatClsid;
1846  IPropertyBag *pPropBag;
1847  CLSID clsidCat;
1848  IMoniker *pMoniker = NULL;
1849 
1850  hr = IMoniker_BindToStorage(pMCat, NULL, NULL, &IID_IPropertyBag, (void **)&pPropBag);
1851  if (FAILED(hr))
1852  {
1853  IMoniker_Release(pMCat);
1854  break;
1855  }
1856 
1857  hr = read_property_names(pPropBag, &vCatName, &vCatClsid);
1858  IPropertyBag_Release(pPropBag);
1859  if (FAILED(hr))
1860  {
1861  IMoniker_Release(pMCat);
1862  break;
1863  }
1864 
1865  hr = CLSIDFromString(V_BSTR(&vCatClsid), &clsidCat);
1866  if (FAILED(hr))
1867  {
1868  IMoniker_Release(pMCat);
1869  VariantClear(&vCatClsid);
1870  VariantClear(&vCatName);
1871  break;
1872  }
1873 
1874  hr = ICreateDevEnum_CreateClassEnumerator(pCreateDevEnum, &clsidCat, &pEnum, 0);
1875  if (hr != S_OK)
1876  {
1877  IMoniker_Release(pMCat);
1878  VariantClear(&vCatClsid);
1879  VariantClear(&vCatName);
1880  continue;
1881  }
1882 
1883  TRACE("Enumerating class %s\n", debugstr_guid(&clsidCat));
1884 
1885  while (IEnumMoniker_Next(pEnum, 1, &pMoniker, NULL) == S_OK)
1886  {
1887  WCHAR bufferW[10];
1889 
1890  snprintfW(bufferW, sizeof(bufferW)/sizeof(bufferW[0]), szIdFormat, i);
1891  subcont = allocate_information_node(bufferW);
1892  if (!subcont)
1893  {
1894  hr = E_OUTOFMEMORY;
1895  IMoniker_Release(pMoniker);
1896  break;
1897  }
1898 
1899  hr = add_bstr_property(subcont, szCatName, V_BSTR(&vCatName));
1900  if (FAILED(hr))
1901  {
1902  free_information_tree(subcont);
1903  IMoniker_Release(pMoniker);
1904  break;
1905  }
1906 
1907  hr = add_bstr_property(subcont, ClsidCatW, V_BSTR(&vCatClsid));
1908  if (FAILED(hr))
1909  {
1910  free_information_tree(subcont);
1911  IMoniker_Release(pMoniker);
1912  break;
1913  }
1914 
1915  hr = fill_filter_container(subcont, pMoniker);
1916  IMoniker_Release(pMoniker);
1917  if (FAILED(hr))
1918  {
1919  WARN("Skipping invalid filter\n");
1920  free_information_tree(subcont);
1921  hr = S_OK;
1922  continue;
1923  }
1924 
1925  add_subcontainer(node, subcont);
1926  i++;
1927  }
1928 
1929  IEnumMoniker_Release(pEnum);
1930  IMoniker_Release(pMCat);
1931  VariantClear(&vCatClsid);
1932  VariantClear(&vCatName);
1933 
1934  if (FAILED(hr))
1935  break;
1936  }
1937 
1938 cleanup:
1939  if (pEmCat) IEnumMoniker_Release(pEmCat);
1940  ICreateDevEnum_Release(pCreateDevEnum);
1941  return hr;
1942 }
#define snprintfW
Definition: unicode.h:60
HRESULT hr
Definition: shlfolder.c:183
static void add_subcontainer(IDxDiagContainerImpl_Container *node, IDxDiagContainerImpl_Container *subCont)
Definition: provider.c:308
static IDxDiagContainerImpl_Container * allocate_information_node(const WCHAR *name)
Definition: provider.c:264
#define WARN(fmt,...)
Definition: debug.h:111
static HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
Definition: provider.c:314
static HRESULT fill_filter_container(IDxDiagContainerImpl_Container *subcont, IMoniker *pMoniker)
Definition: provider.c:1761
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IPropertyBag
#define debugstr_guid
Definition: kernel32.h:35
static void free_information_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:238
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_BSTR(A)
Definition: oleauto.h:226
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
static HRESULT read_property_names(IPropertyBag *pPropBag, VARIANT *friendly_name, VARIANT *clsid_name)
Definition: provider.c:1662
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2247
char * cleanup(char *str)
Definition: wpickclick.c:99
Definition: dlist.c:348

Referenced by build_information_tree().

◆ build_directsound_tree()

static HRESULT build_directsound_tree ( IDxDiagContainerImpl_Container node)
static

Definition at line 1431 of file provider.c.

1432 {
1433  static const WCHAR DxDiag_SoundDevices[] = {'D','x','D','i','a','g','_','S','o','u','n','d','D','e','v','i','c','e','s',0};
1434  static const WCHAR DxDiag_SoundCaptureDevices[] = {'D','x','D','i','a','g','_','S','o','u','n','d','C','a','p','t','u','r','e','D','e','v','i','c','e','s',0};
1435 
1436  struct enum_context enum_ctx;
1438 
1440  if (!cont)
1441  return E_OUTOFMEMORY;
1442 
1444 
1445  enum_ctx.cont = cont;
1446  enum_ctx.hr = S_OK;
1447  enum_ctx.index = 0;
1448 
1449  DirectSoundEnumerateW(dsound_enum, &enum_ctx);
1450  if (FAILED(enum_ctx.hr))
1451  return enum_ctx.hr;
1452 
1454  if (!cont)
1455  return E_OUTOFMEMORY;
1456 
1458 
1459  enum_ctx.cont = cont;
1460  enum_ctx.hr = S_OK;
1461  enum_ctx.index = 0;
1462 
1464  if (FAILED(enum_ctx.hr))
1465  return enum_ctx.hr;
1466 
1467  return S_OK;
1468 }
static void add_subcontainer(IDxDiagContainerImpl_Container *node, IDxDiagContainerImpl_Container *subCont)
Definition: provider.c:308
static IDxDiagContainerImpl_Container * allocate_information_node(const WCHAR *name)
Definition: provider.c:264
static const WCHAR DxDiag_SoundCaptureDevices[]
Definition: container.c:41
static const WCHAR DxDiag_SoundDevices[]
Definition: container.c:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW lpDSEnumCallback, LPVOID lpContext)
Definition: enum.c:228
IDxDiagContainerImpl_Container * cont
Definition: provider.c:1360
__wchar_t WCHAR
Definition: xmlstorage.h:180
HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW lpDSEnumCallback, LPVOID lpContext)
Definition: enum.c:210
#define S_OK
Definition: intsafe.h:59
BOOL CALLBACK dsound_enum(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID context)
Definition: provider.c:1382
Definition: dlist.c:348

Referenced by build_information_tree().

◆ build_directxfiles_tree()

static HRESULT build_directxfiles_tree ( IDxDiagContainerImpl_Container node)
static

Definition at line 1604 of file provider.c.

1605 {
1606  static const WCHAR dlls[][15] =
1607  {
1608  {'d','3','d','8','.','d','l','l',0},
1609  {'d','3','d','9','.','d','l','l',0},
1610  {'d','d','r','a','w','.','d','l','l',0},
1611  {'d','e','v','e','n','u','m','.','d','l','l',0},
1612  {'d','i','n','p','u','t','8','.','d','l','l',0},
1613  {'d','i','n','p','u','t','.','d','l','l',0},
1614  {'d','m','b','a','n','d','.','d','l','l',0},
1615  {'d','m','c','o','m','p','o','s','.','d','l','l',0},
1616  {'d','m','i','m','e','.','d','l','l',0},
1617  {'d','m','l','o','a','d','e','r','.','d','l','l',0},
1618  {'d','m','s','c','r','i','p','t','.','d','l','l',0},
1619  {'d','m','s','t','y','l','e','.','d','l','l',0},
1620  {'d','m','s','y','n','t','h','.','d','l','l',0},
1621  {'d','m','u','s','i','c','.','d','l','l',0},
1622  {'d','p','l','a','y','x','.','d','l','l',0},
1623  {'d','p','n','e','t','.','d','l','l',0},
1624  {'d','s','o','u','n','d','.','d','l','l',0},
1625  {'d','s','w','a','v','e','.','d','l','l',0},
1626  {'d','x','d','i','a','g','n','.','d','l','l',0},
1627  {'q','u','a','r','t','z','.','d','l','l',0}
1628  };
1629 
1630  HRESULT hr;
1632  INT i;
1633 
1635 
1636  for (i = 0; i < sizeof(dlls) / sizeof(dlls[0]); i++)
1637  {
1638  static const WCHAR szFormat[] = {'%','d',0};
1639 
1640  WCHAR szFileID[5];
1641  IDxDiagContainerImpl_Container *file_container;
1642 
1643  snprintfW(szFileID, sizeof(szFileID)/sizeof(szFileID[0]), szFormat, i);
1644 
1645  file_container = allocate_information_node(szFileID);
1646  if (!file_container)
1647  return E_OUTOFMEMORY;
1648 
1649  hr = fill_file_description(file_container, szFilePath, dlls[i]);
1650  if (FAILED(hr))
1651  {
1652  free_information_tree(file_container);
1653  continue;
1654  }
1655 
1656  add_subcontainer(node, file_container);
1657  }
1658 
1659  return S_OK;
1660 }
#define snprintfW
Definition: unicode.h:60
static WCHAR szFilePath[]
Definition: qotd.c:14
HRESULT hr
Definition: shlfolder.c:183
static void add_subcontainer(IDxDiagContainerImpl_Container *node, IDxDiagContainerImpl_Container *subCont)
Definition: provider.c:308
static IDxDiagContainerImpl_Container * allocate_information_node(const WCHAR *name)
Definition: provider.c:264
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static void free_information_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:238
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
static HRESULT fill_file_description(IDxDiagContainerImpl_Container *node, const WCHAR *szFilePath, const WCHAR *szFileName)
Definition: provider.c:1490
#define S_OK
Definition: intsafe.h:59
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2312
Definition: dlist.c:348

Referenced by build_information_tree().

◆ build_displaydevices_tree()

static HRESULT build_displaydevices_tree ( IDxDiagContainerImpl_Container node)
static

Definition at line 1346 of file provider.c.

1347 {
1348  HRESULT hr;
1349 
1350  /* Try to use Direct3D to obtain the required information first. */
1352  if (hr != E_FAIL)
1353  return hr;
1354 
1356 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node)
Definition: provider.c:948
#define E_FAIL
Definition: ddrawi.h:102
static HRESULT fill_display_information_fallback(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1245
LONG HRESULT
Definition: typedefs.h:77
Definition: dlist.c:348

Referenced by build_information_tree().

◆ build_information_tree()

static HRESULT build_information_tree ( IDxDiagContainerImpl_Container **  pinfo_root)
static

Definition at line 1949 of file provider.c.

1950 {
1951  static const WCHAR DxDiag_SystemInfo[] = {'D','x','D','i','a','g','_','S','y','s','t','e','m','I','n','f','o',0};
1952  static const WCHAR DxDiag_DisplayDevices[] = {'D','x','D','i','a','g','_','D','i','s','p','l','a','y','D','e','v','i','c','e','s',0};
1953  static const WCHAR DxDiag_DirectSound[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','S','o','u','n','d',0};
1954  static const WCHAR DxDiag_DirectMusic[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','M','u','s','i','c',0};
1955  static const WCHAR DxDiag_DirectInput[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','I','n','p','u','t',0};
1956  static const WCHAR DxDiag_DirectPlay[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','P','l','a','y',0};
1957  static const WCHAR DxDiag_SystemDevices[] = {'D','x','D','i','a','g','_','S','y','s','t','e','m','D','e','v','i','c','e','s',0};
1958  static const WCHAR DxDiag_DirectXFiles[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','X','F','i','l','e','s',0};
1959  static const WCHAR DxDiag_DirectShowFilters[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','S','h','o','w','F','i','l','t','e','r','s',0};
1960  static const WCHAR DxDiag_LogicalDisks[] = {'D','x','D','i','a','g','_','L','o','g','i','c','a','l','D','i','s','k','s',0};
1961 
1962  static const struct
1963  {
1964  const WCHAR *name;
1965  HRESULT (*initfunc)(IDxDiagContainerImpl_Container *);
1966  } root_children[] =
1967  {
1970  {DxDiag_DirectSound, build_directsound_tree},
1971  {DxDiag_DirectMusic, build_directmusic_tree},
1972  {DxDiag_DirectInput, build_directinput_tree},
1973  {DxDiag_DirectPlay, build_directplay_tree},
1974  {DxDiag_SystemDevices, build_systemdevices_tree},
1975  {DxDiag_DirectXFiles, build_directxfiles_tree},
1976  {DxDiag_DirectShowFilters, build_directshowfilters_tree},
1977  {DxDiag_LogicalDisks, build_logicaldisks_tree},
1978  };
1979 
1980  IDxDiagContainerImpl_Container *info_root;
1981  size_t index;
1982 
1983  info_root = allocate_information_node(NULL);
1984  if (!info_root)
1985  return E_OUTOFMEMORY;
1986 
1987  for (index = 0; index < sizeof(root_children)/sizeof(root_children[0]); index++)
1988  {
1990  HRESULT hr;
1991 
1992  node = allocate_information_node(root_children[index].name);
1993  if (!node)
1994  {
1995  free_information_tree(info_root);
1996  return E_OUTOFMEMORY;
1997  }
1998 
1999  hr = root_children[index].initfunc(node);
2000  if (FAILED(hr))
2001  {
2003  free_information_tree(info_root);
2004  return hr;
2005  }
2006 
2007  add_subcontainer(info_root, node);
2008  }
2009 
2010  *pinfo_root = info_root;
2011  return S_OK;
2012 }
static HRESULT build_systemdevices_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1485
#define HRESULT
Definition: msvc.h:9
HRESULT hr
Definition: shlfolder.c:183
static HRESULT build_displaydevices_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1346
static void add_subcontainer(IDxDiagContainerImpl_Container *node, IDxDiagContainerImpl_Container *subCont)
Definition: provider.c:308
static IDxDiagContainerImpl_Container * allocate_information_node(const WCHAR *name)
Definition: provider.c:264
static HRESULT build_logicaldisks_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1944
static HRESULT build_directinput_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1475
static HRESULT build_directsound_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1431
static HRESULT build_directshowfilters_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1820
static const WCHAR DxDiag_SystemInfo[]
Definition: container.c:37
struct node node
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
static HRESULT build_directxfiles_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1604
GLuint index
Definition: glext.h:6031
static void free_information_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:238
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:686
static HRESULT build_directplay_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1480
#define index(s, c)
Definition: various.h:29
#define S_OK
Definition: intsafe.h:59
static HRESULT build_directmusic_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1470
Definition: name.c:36
static const WCHAR DxDiag_DisplayDevices[]
Definition: container.c:38
Definition: dlist.c:348
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by IDxDiagProviderImpl_Initialize().

◆ build_logicaldisks_tree()

static HRESULT build_logicaldisks_tree ( IDxDiagContainerImpl_Container node)
static

Definition at line 1944 of file provider.c.

1945 {
1946  return S_OK;
1947 }
#define S_OK
Definition: intsafe.h:59

Referenced by build_information_tree().

◆ build_systemdevices_tree()

static HRESULT build_systemdevices_tree ( IDxDiagContainerImpl_Container node)
static

Definition at line 1485 of file provider.c.

1486 {
1487  return S_OK;
1488 }
#define S_OK
Definition: intsafe.h:59

Referenced by build_information_tree().

◆ build_systeminfo_tree()

static HRESULT build_systeminfo_tree ( IDxDiagContainerImpl_Container node)
static

Definition at line 686 of file provider.c.

687 {
688  static const WCHAR dwDirectXVersionMajor[] = {'d','w','D','i','r','e','c','t','X','V','e','r','s','i','o','n','M','a','j','o','r',0};
689  static const WCHAR dwDirectXVersionMinor[] = {'d','w','D','i','r','e','c','t','X','V','e','r','s','i','o','n','M','i','n','o','r',0};
690  static const WCHAR szDirectXVersionLetter[] = {'s','z','D','i','r','e','c','t','X','V','e','r','s','i','o','n','L','e','t','t','e','r',0};
691  static const WCHAR szDirectXVersionLetter_v[] = {'c',0};
692  static const WCHAR bDebug[] = {'b','D','e','b','u','g',0};
693  static const WCHAR bNECPC98[] = {'b','N','E','C','P','C','9','8',0};
694  static const WCHAR szDirectXVersionEnglish[] = {'s','z','D','i','r','e','c','t','X','V','e','r','s','i','o','n','E','n','g','l','i','s','h',0};
695  static const WCHAR szDirectXVersionEnglish_v[] = {'4','.','0','9','.','0','0','0','0','.','0','9','0','4',0};
696  static const WCHAR szDirectXVersionLongEnglish[] = {'s','z','D','i','r','e','c','t','X','V','e','r','s','i','o','n','L','o','n','g','E','n','g','l','i','s','h',0};
697  static const WCHAR szDirectXVersionLongEnglish_v[] = {'=',' ','"','D','i','r','e','c','t','X',' ','9','.','0','c',' ','(','4','.','0','9','.','0','0','0','0','.','0','9','0','4',')',0};
698  static const WCHAR ullPhysicalMemory[] = {'u','l','l','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0};
699  static const WCHAR ullUsedPageFile[] = {'u','l','l','U','s','e','d','P','a','g','e','F','i','l','e',0};
700  static const WCHAR ullAvailPageFile[] = {'u','l','l','A','v','a','i','l','P','a','g','e','F','i','l','e',0};
701  static const WCHAR bNetMeetingRunning[] = {'b','N','e','t','M','e','e','t','i','n','g','R','u','n','n','i','n','g',0};
702  static const WCHAR szWindowsDir[] = {'s','z','W','i','n','d','o','w','s','D','i','r',0};
703  static const WCHAR dwOSMajorVersion[] = {'d','w','O','S','M','a','j','o','r','V','e','r','s','i','o','n',0};
704  static const WCHAR dwOSMinorVersion[] = {'d','w','O','S','M','i','n','o','r','V','e','r','s','i','o','n',0};
705  static const WCHAR dwOSBuildNumber[] = {'d','w','O','S','B','u','i','l','d','N','u','m','b','e','r',0};
706  static const WCHAR dwOSPlatformID[] = {'d','w','O','S','P','l','a','t','f','o','r','m','I','D',0};
707  static const WCHAR szCSDVersion[] = {'s','z','C','S','D','V','e','r','s','i','o','n',0};
708  static const WCHAR szPhysicalMemoryEnglish[] = {'s','z','P','h','y','s','i','c','a','l','M','e','m','o','r','y','E','n','g','l','i','s','h',0};
709  static const WCHAR szPageFileLocalized[] = {'s','z','P','a','g','e','F','i','l','e','L','o','c','a','l','i','z','e','d',0};
710  static const WCHAR szPageFileEnglish[] = {'s','z','P','a','g','e','F','i','l','e','E','n','g','l','i','s','h',0};
711  static const WCHAR szMachineNameLocalized[] = {'s','z','M','a','c','h','i','n','e','N','a','m','e','L','o','c','a','l','i','z','e','d',0};
712  static const WCHAR szMachineNameEnglish[] = {'s','z','M','a','c','h','i','n','e','N','a','m','e','E','n','g','l','i','s','h',0};
713  static const WCHAR szSystemManufacturerEnglish[] = {'s','z','S','y','s','t','e','m','M','a','n','u','f','a','c','t','u','r','e','r','E','n','g','l','i','s','h',0};
714  static const WCHAR szSystemModelEnglish[] = {'s','z','S','y','s','t','e','m','M','o','d','e','l','E','n','g','l','i','s','h',0};
715  static const WCHAR szBIOSEnglish[] = {'s','z','B','I','O','S','E','n','g','l','i','s','h',0};
716  static const WCHAR szSetupParamEnglish[] = {'s','z','S','e','t','u','p','P','a','r','a','m','E','n','g','l','i','s','h',0};
717  static const WCHAR szDxDiagVersion[] = {'s','z','D','x','D','i','a','g','V','e','r','s','i','o','n',0};
718 
719  static const WCHAR notpresentW[] = {'N','o','t',' ','p','r','e','s','e','n','t',0};
720 
721  static const WCHAR pagefile_fmtW[] = {'%','u','M','B',' ','u','s','e','d',',',' ','%','u','M','B',' ','a','v','a','i','l','a','b','l','e',0};
722  static const WCHAR physmem_fmtW[] = {'%','u','M','B',' ','R','A','M',0};
723 
724  HRESULT hr;
725  MEMORYSTATUSEX msex;
727  DWORD count, usedpage_mb, availpage_mb;
728  WCHAR buffer[MAX_PATH], computer_name[MAX_COMPUTERNAME_LENGTH + 1], print_buf[200], localized_pagefile_fmt[200];
729  DWORD_PTR args[2];
730 
731  hr = add_ui4_property(node, dwDirectXVersionMajor, 9);
732  if (FAILED(hr))
733  return hr;
734 
735  hr = add_ui4_property(node, dwDirectXVersionMinor, 0);
736  if (FAILED(hr))
737  return hr;
738 
739  hr = add_bstr_property(node, szDirectXVersionLetter, szDirectXVersionLetter_v);
740  if (FAILED(hr))
741  return hr;
742 
743  hr = add_bstr_property(node, szDirectXVersionEnglish, szDirectXVersionEnglish_v);
744  if (FAILED(hr))
745  return hr;
746 
747  hr = add_bstr_property(node, szDirectXVersionLongEnglish, szDirectXVersionLongEnglish_v);
748  if (FAILED(hr))
749  return hr;
750 
752  if (FAILED(hr))
753  return hr;
754 
755  hr = add_bool_property(node, bNECPC98, FALSE);
756  if (FAILED(hr))
757  return hr;
758 
759  msex.dwLength = sizeof(msex);
760  GlobalMemoryStatusEx(&msex);
761 
762  hr = add_ull_as_bstr_property(node, ullPhysicalMemory, msex.ullTotalPhys);
763  if (FAILED(hr))
764  return hr;
765 
766  hr = add_ull_as_bstr_property(node, ullUsedPageFile, msex.ullTotalPageFile - msex.ullAvailPageFile);
767  if (FAILED(hr))
768  return hr;
769 
770  hr = add_ull_as_bstr_property(node, ullAvailPageFile, msex.ullAvailPageFile);
771  if (FAILED(hr))
772  return hr;
773 
774  hr = add_bool_property(node, bNetMeetingRunning, is_netmeeting_running());
775  if (FAILED(hr))
776  return hr;
777 
778  info.dwOSVersionInfoSize = sizeof(info);
780 
781  hr = add_ui4_property(node, dwOSMajorVersion, info.dwMajorVersion);
782  if (FAILED(hr))
783  return hr;
784 
785  hr = add_ui4_property(node, dwOSMinorVersion, info.dwMinorVersion);
786  if (FAILED(hr))
787  return hr;
788 
789  hr = add_ui4_property(node, dwOSBuildNumber, info.dwBuildNumber);
790  if (FAILED(hr))
791  return hr;
792 
793  hr = add_ui4_property(node, dwOSPlatformID, info.dwPlatformId);
794  if (FAILED(hr))
795  return hr;
796 
797  hr = add_bstr_property(node, szCSDVersion, info.szCSDVersion);
798  if (FAILED(hr))
799  return hr;
800 
801  /* FIXME: Roundoff should not be done with truncated division. */
802  snprintfW(print_buf, sizeof(print_buf)/sizeof(WCHAR), physmem_fmtW, (DWORD)(msex.ullTotalPhys / (1024 * 1024)));
803  hr = add_bstr_property(node, szPhysicalMemoryEnglish, print_buf);
804  if (FAILED(hr))
805  return hr;
806 
807  usedpage_mb = (DWORD)((msex.ullTotalPageFile - msex.ullAvailPageFile) / (1024 * 1024));
808  availpage_mb = (DWORD)(msex.ullAvailPageFile / (1024 * 1024));
809  LoadStringW(dxdiagn_instance, IDS_PAGE_FILE_FORMAT, localized_pagefile_fmt, sizeof(localized_pagefile_fmt)/sizeof(WCHAR));
810  args[0] = usedpage_mb;
811  args[1] = availpage_mb;
813  localized_pagefile_fmt, 0, 0, print_buf,
814  sizeof(print_buf)/sizeof(*print_buf), (__ms_va_list*)args);
815 
816  hr = add_bstr_property(node, szPageFileLocalized, print_buf);
817  if (FAILED(hr))
818  return hr;
819 
820  snprintfW(print_buf, sizeof(print_buf)/sizeof(WCHAR), pagefile_fmtW, usedpage_mb, availpage_mb);
821 
822  hr = add_bstr_property(node, szPageFileEnglish, print_buf);
823  if (FAILED(hr))
824  return hr;
825 
827 
828  hr = add_bstr_property(node, szWindowsDir, buffer);
829  if (FAILED(hr))
830  return hr;
831 
832  count = sizeof(computer_name)/sizeof(WCHAR);
834  return E_FAIL;
835 
836  hr = add_bstr_property(node, szMachineNameLocalized, computer_name);
837  if (FAILED(hr))
838  return hr;
839 
840  hr = add_bstr_property(node, szMachineNameEnglish, computer_name);
841  if (FAILED(hr))
842  return hr;
843 
844  hr = add_bstr_property(node, szSystemManufacturerEnglish, szEmpty);
845  if (FAILED(hr))
846  return hr;
847 
848  hr = add_bstr_property(node, szSystemModelEnglish, szEmpty);
849  if (FAILED(hr))
850  return hr;
851 
852  hr = add_bstr_property(node, szBIOSEnglish, szEmpty);
853  if (FAILED(hr))
854  return hr;
855 
857  if (FAILED(hr))
858  return hr;
859 
860  hr = add_bstr_property(node, szSetupParamEnglish, notpresentW);
861  if (FAILED(hr))
862  return hr;
863 
864  hr = add_bstr_property(node, szDxDiagVersion, szEmpty);
865  if (FAILED(hr))
866  return hr;
867 
869  if (FAILED(hr))
870  return hr;
871 
873  if (FAILED(hr))
874  return hr;
875 
877  if (FAILED(hr))
878  return hr;
879 
880  return S_OK;
881 }
static const char __ms_va_list
Definition: printf.c:70
#define snprintfW
Definition: unicode.h:60
static HRESULT add_bool_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, BOOL data)
Definition: provider.c:373
HRESULT hr
Definition: shlfolder.c:183
static HRESULT add_ull_as_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, ULONGLONG data)
Definition: provider.c:390
static HRESULT fill_language_information(IDxDiagContainerImpl_Container *node)
Definition: provider.c:511
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define FORMAT_MESSAGE_ARGUMENT_ARRAY
Definition: winbase.h:405
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:402
static HRESULT add_ui4_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, DWORD data)
Definition: provider.c:339
static HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
Definition: provider.c:314
GLuint buffer
Definition: glext.h:5915
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:440
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
Definition: version.c:37
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
BOOL bDebug
Definition: service.c:37
#define E_FAIL
Definition: ddrawi.h:102
Definition: match.c:390
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define DWORD
Definition: nt_native.h:44
static HRESULT fill_processor_information(IDxDiagContainerImpl_Container *node)
Definition: provider.c:610
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
struct _test_info info[]
Definition: SetCursorPos.c:19
static WCHAR computer_name[MAX_COMPUTERNAME_LENGTH+1]
Definition: access.c:33
static BOOL is_netmeeting_running(void)
Definition: provider.c:484
static const WCHAR szEmpty[]
Definition: provider.c:47
#define IDS_PAGE_FILE_FORMAT
Definition: resource.h:26
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static HRESULT fill_os_string_information(IDxDiagContainerImpl_Container *node, OSVERSIONINFOW *info)
Definition: provider.c:582
static HRESULT fill_datetime_information(IDxDiagContainerImpl_Container *node)
Definition: provider.c:545
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:240
#define S_OK
Definition: intsafe.h:59
HINSTANCE dxdiagn_instance
Definition: dxdiag_main.c:39
BOOL NTAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
Definition: heapmem.c:1272
Definition: dlist.c:348

Referenced by build_information_tree().

◆ depth_for_pixelformat()

static DWORD depth_for_pixelformat ( D3DFORMAT  format)
static

Definition at line 884 of file provider.c.

885 {
886  switch (format)
887  {
888  case D3DFMT_P8: return 8;
889  case D3DFMT_X1R5G5B5: return 15;
890  case D3DFMT_R5G6B5: return 16;
891  /* This case will fail to distinguish an original bpp of 24. */
892  case D3DFMT_X8R8G8B8: return 32;
893  default:
894  FIXME("Unknown D3DFORMAT %d, returning 32 bpp\n", format);
895  return 32;
896  }
897 }
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define FIXME(fmt,...)
Definition: debug.h:110

Referenced by fill_display_information_d3d().

◆ dsound_enum()

BOOL CALLBACK dsound_enum ( LPGUID  guid,
LPCWSTR  desc,
LPCWSTR  module,
LPVOID  context 
)

Definition at line 1382 of file provider.c.

1383 {
1384  static const WCHAR deviceid_fmtW[] = {'%','u',0};
1385  static const WCHAR szGuidDeviceID[] = {'s','z','G','u','i','d','D','e','v','i','c','e','I','D',0};
1386  static const WCHAR szDriverPath[] = {'s','z','D','r','i','v','e','r','P','a','t','h',0};
1387 
1388  struct enum_context *enum_ctx = context;
1390  WCHAR buffer[256];
1391  const WCHAR *p, *name;
1392 
1393  /* the default device is enumerated twice, one time without GUID */
1394  if (!guid) return TRUE;
1395 
1396  snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), deviceid_fmtW, enum_ctx->index);
1398  if (!device)
1399  {
1400  enum_ctx->hr = E_OUTOFMEMORY;
1401  return FALSE;
1402  }
1403 
1404  add_subcontainer(enum_ctx->cont, device);
1405 
1407  enum_ctx->hr = add_bstr_property(device, szGuidDeviceID, buffer);
1408  if (FAILED(enum_ctx->hr))
1409  return FALSE;
1410 
1411  enum_ctx->hr = add_bstr_property(device, szDescription, desc);
1412  if (FAILED(enum_ctx->hr))
1413  return FALSE;
1414 
1415  enum_ctx->hr = add_bstr_property(device, szDriverPath, module);
1416  if (FAILED(enum_ctx->hr))
1417  return FALSE;
1418 
1419  name = module;
1420  if ((p = strrchrW(name, '\\'))) name = p + 1;
1421  if ((p = strrchrW(name, '/'))) name = p + 1;
1422 
1423  enum_ctx->hr = add_bstr_property(device, szDriverName, name);
1424  if (FAILED(enum_ctx->hr))
1425  return FALSE;
1426 
1427  enum_ctx->index++;
1428  return TRUE;
1429 }
#define TRUE
Definition: types.h:120
HMODULE module
Definition: main.cpp:47
#define snprintfW
Definition: unicode.h:60
Definition: http.c:6587
static void add_subcontainer(IDxDiagContainerImpl_Container *node, IDxDiagContainerImpl_Container *subCont)
Definition: provider.c:308
static IDxDiagContainerImpl_Container * allocate_information_node(const WCHAR *name)
Definition: provider.c:264
static HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
Definition: provider.c:314
GLuint buffer
Definition: glext.h:5915
const GUID * guid
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
IDxDiagContainerImpl_Container * cont
Definition: provider.c:1360
HRESULT hr
Definition: provider.c:1361
static const WCHAR szDriverName[]
Definition: provider.c:66
__wchar_t WCHAR
Definition: xmlstorage.h:180
static LPWSTR guid_to_string(LPWSTR lpwstr, REFGUID lpcguid)
Definition: provider.c:1372
WINE_UNICODE_INLINE WCHAR * strrchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:254
Definition: name.c:36
GLfloat GLfloat p
Definition: glext.h:8902
static const WCHAR szDescription[]
Definition: provider.c:52
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by build_directsound_tree().

◆ DXDiag_CreateDXDiagProvider()

HRESULT DXDiag_CreateDXDiagProvider ( LPCLASSFACTORY  iface,
LPUNKNOWN  punkOuter,
REFIID  riid,
LPVOID ppobj 
)

factories

Definition at line 216 of file provider.c.

216  {
217  IDxDiagProviderImpl* provider;
218 
219  TRACE("(%p, %s, %p)\n", punkOuter, debugstr_guid(riid), ppobj);
220 
221  *ppobj = NULL;
222  if (punkOuter) return CLASS_E_NOAGGREGATION;
223 
225  if (NULL == provider) return E_OUTOFMEMORY;
226  provider->IDxDiagProvider_iface.lpVtbl = &DxDiagProvider_Vtbl;
227  provider->ref = 0; /* will be inited with QueryInterface */
229 }
REFIID riid
Definition: precomp.h:44
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
IDxDiagProvider IDxDiagProvider_iface
Definition: provider.c:102
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static HRESULT WINAPI IDxDiagProviderImpl_QueryInterface(IDxDiagProvider *iface, REFIID riid, void **ppobj)
Definition: provider.c:115
static const IDxDiagProviderVtbl DxDiagProvider_Vtbl
Definition: provider.c:207

Referenced by DXDiagCF_CreateInstance().

◆ enumerate_processes()

static DWORD* enumerate_processes ( DWORD list_count)
static

Definition at line 416 of file provider.c.

417 {
418  DWORD *pid_list, alloc_bytes = 1024 * sizeof(*pid_list), needed_bytes;
419 
420  pid_list = HeapAlloc(GetProcessHeap(), 0, alloc_bytes);
421  if (!pid_list)
422  return NULL;
423 
424  for (;;)
425  {
426  DWORD *realloc_list;
427 
428  if (!EnumProcesses(pid_list, alloc_bytes, &needed_bytes))
429  {
430  HeapFree(GetProcessHeap(), 0, pid_list);
431  return NULL;
432  }
433 
434  /* EnumProcesses can't signal an insufficient buffer condition, so the
435  * only way to possibly determine whether a larger buffer is required
436  * is to see whether the written number of bytes is the same as the
437  * buffer size. If so, the buffer will be reallocated to twice the
438  * size. */
439  if (alloc_bytes != needed_bytes)
440  break;
441 
442  alloc_bytes *= 2;
443  realloc_list = HeapReAlloc(GetProcessHeap(), 0, pid_list, alloc_bytes);
444  if (!realloc_list)
445  {
446  HeapFree(GetProcessHeap(), 0, pid_list);
447  return NULL;
448  }
449  pid_list = realloc_list;
450  }
451 
452  *list_count = needed_bytes / sizeof(*pid_list);
453  return pid_list;
454 }
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
Definition: list.h:155
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI EnumProcesses(DWORD *lpidProcess, DWORD cb, LPDWORD lpcbNeeded)
Definition: psapi.c:458
#define HeapReAlloc
Definition: compat.h:393
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by is_netmeeting_running().

◆ fill_datetime_information()

static HRESULT fill_datetime_information ( IDxDiagContainerImpl_Container node)
static

Definition at line 545 of file provider.c.

546 {
547  static const WCHAR date_fmtW[] = {'M','\'','/','\'','d','\'','/','\'','y','y','y','y',0};
548  static const WCHAR time_fmtW[] = {'H','H','\'',':','\'','m','m','\'',':','\'','s','s',0};
549  static const WCHAR datetime_fmtW[] = {'%','s',',',' ','%','s',0};
550  static const WCHAR szTimeLocalized[] = {'s','z','T','i','m','e','L','o','c','a','l','i','z','e','d',0};
551  static const WCHAR szTimeEnglish[] = {'s','z','T','i','m','e','E','n','g','l','i','s','h',0};
552 
553  SYSTEMTIME curtime;
554  WCHAR date_str[80], time_str[80], datetime_str[200];
555  HRESULT hr;
556 
557  GetLocalTime(&curtime);
558 
559  GetTimeFormatW(LOCALE_NEUTRAL, 0, &curtime, time_fmtW, time_str, sizeof(time_str)/sizeof(WCHAR));
560 
561  /* szTimeLocalized */
562  GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &curtime, NULL, date_str, sizeof(date_str)/sizeof(WCHAR));
563 
564  snprintfW(datetime_str, sizeof(datetime_str)/sizeof(WCHAR), datetime_fmtW, date_str, time_str);
565 
566  hr = add_bstr_property(node, szTimeLocalized, datetime_str);
567  if (FAILED(hr))
568  return hr;
569 
570  /* szTimeEnglish */
571  GetDateFormatW(LOCALE_NEUTRAL, 0, &curtime, date_fmtW, date_str, sizeof(date_str)/sizeof(WCHAR));
572 
573  snprintfW(datetime_str, sizeof(datetime_str)/sizeof(WCHAR), datetime_fmtW, date_str, time_str);
574 
575  hr = add_bstr_property(node, szTimeEnglish, datetime_str);
576  if (FAILED(hr))
577  return hr;
578 
579  return S_OK;
580 }
#define snprintfW
Definition: unicode.h:60
HRESULT hr
Definition: shlfolder.c:183
#define LOCALE_USER_DEFAULT
static HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
Definition: provider.c:314
smooth NULL
Definition: ftsmooth.c:416
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:276
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:979
#define S_OK
Definition: intsafe.h:59
#define DATE_LONGDATE
Definition: winnls.h:194
struct tm time_str
Definition: mktime.c:5
#define LOCALE_NEUTRAL
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1079
Definition: dlist.c:348

Referenced by build_systeminfo_tree().

◆ fill_display_information_d3d()

static HRESULT fill_display_information_d3d ( IDxDiagContainerImpl_Container node)
static

Definition at line 948 of file provider.c.

949 {
950  IDxDiagContainerImpl_Container *display_adapter;
951  HRESULT hr;
952  IDirect3D9 *pDirect3D9;
953  WCHAR buffer[256];
954  UINT index, count;
955 
956  pDirect3D9 = Direct3DCreate9(D3D_SDK_VERSION);
957  if (!pDirect3D9)
958  return E_FAIL;
959 
960  count = IDirect3D9_GetAdapterCount(pDirect3D9);
961  for (index = 0; index < count; index++)
962  {
963  static const WCHAR adapterid_fmtW[] = {'%','u',0};
964  static const WCHAR driverversion_fmtW[] = {'%','u','.','%','u','.','%','0','4','u','.','%','0','4','u',0};
965  static const WCHAR id_fmtW[] = {'0','x','%','0','4','x',0};
966  static const WCHAR subsysid_fmtW[] = {'0','x','%','0','8','x',0};
967  static const WCHAR mem_fmt[] = {'%','.','1','f',' ','M','B',0};
968  static const WCHAR b3DAccelerationExists[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','x','i','s','t','s',0};
969  static const WCHAR b3DAccelerationEnabled[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0};
970  static const WCHAR bDDAccelerationEnabled[] = {'b','D','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0};
971  static const WCHAR bNoHardware[] = {'b','N','o','H','a','r','d','w','a','r','e',0};
972  static const WCHAR mode_fmtW[] = {'%','d',' ','x',' ','%','d',' ','(','%','d',' ','b','i','t',')',' ','(','%','d','H','z',')',0};
973  static const WCHAR gernericPNPMonitorW[] = {'G','e','n','e','r','i','c',' ','P','n','P',' ','M','o','n','i','t','o','r',0};
974  static const WCHAR failedToGetParameterW[] = {'F','a','i','l','e','d',' ','t','o',' ','g','e','t',' ','p','a','r','a','m','e','t','e','r',0};
975  static const WCHAR driverAttributesW[] = {'F','i','n','a','l',' ','R','e','t','a','i','l',0};
976  static const WCHAR englishW[] = {'E','n','g','l','i','s','h',0};
977  static const WCHAR driverDateEnglishW[] = {'1','/','1','/','2','0','1','6',' ','1','0',':','0','0',':','0','0',0};
978  static const WCHAR driverDateLocalW[] = {'1','/','1','/','2','0','1','6',' ','1','0',':','0','0',':','0','0',' ','A','M',0};
979  static const WCHAR naW[] = {'n','/','a',0};
980  static const WCHAR ddi11W[] = {'1','1',0};
981 
982  D3DADAPTER_IDENTIFIER9 adapter_info;
983  D3DDISPLAYMODE adapter_mode;
984  D3DCAPS9 device_caps;
985  DWORD available_mem = 0;
986  BOOL hardware_accel;
987 
988  snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), adapterid_fmtW, index);
989  display_adapter = allocate_information_node(buffer);
990  if (!display_adapter)
991  {
992  hr = E_OUTOFMEMORY;
993  goto cleanup;
994  }
995 
996  add_subcontainer(node, display_adapter);
997 
998  hr = IDirect3D9_GetAdapterIdentifier(pDirect3D9, index, 0, &adapter_info);
999  if (SUCCEEDED(hr))
1000  {
1001  WCHAR driverW[sizeof(adapter_info.Driver)];
1002  WCHAR descriptionW[sizeof(adapter_info.Description)];
1003  WCHAR devicenameW[sizeof(adapter_info.DeviceName)];
1004 
1005  MultiByteToWideChar(CP_ACP, 0, adapter_info.Driver, -1, driverW, sizeof(driverW)/sizeof(WCHAR));
1006  MultiByteToWideChar(CP_ACP, 0, adapter_info.Description, -1, descriptionW, sizeof(descriptionW)/sizeof(WCHAR));
1007  MultiByteToWideChar(CP_ACP, 0, adapter_info.DeviceName, -1, devicenameW, sizeof(devicenameW)/sizeof(WCHAR));
1008 
1009  hr = add_bstr_property(display_adapter, szDriverName, driverW);
1010  if (FAILED(hr))
1011  goto cleanup;
1012 
1013  hr = add_bstr_property(display_adapter, szDescription, descriptionW);
1014  if (FAILED(hr))
1015  goto cleanup;
1016 
1017  hr = add_bstr_property(display_adapter, szDeviceName, devicenameW);
1018  if (FAILED(hr))
1019  goto cleanup;
1020 
1021  snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), driverversion_fmtW,
1022  HIWORD(adapter_info.DriverVersion.u.HighPart), LOWORD(adapter_info.DriverVersion.u.HighPart),
1023  HIWORD(adapter_info.DriverVersion.u.LowPart), LOWORD(adapter_info.DriverVersion.u.LowPart));
1024 
1025  hr = add_bstr_property(display_adapter, szDriverVersion, buffer);
1026  if (FAILED(hr))
1027  goto cleanup;
1028 
1029  snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), id_fmtW, adapter_info.VendorId);
1030  hr = add_bstr_property(display_adapter, szVendorId, buffer);
1031  if (FAILED(hr))
1032  goto cleanup;
1033 
1034  snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), id_fmtW, adapter_info.DeviceId);
1035  hr = add_bstr_property(display_adapter, szDeviceId, buffer);
1036  if (FAILED(hr))
1037  goto cleanup;
1038 
1039  snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), subsysid_fmtW, adapter_info.SubSysId);
1040  hr = add_bstr_property(display_adapter, szSubSysId, buffer);
1041  if (FAILED(hr))
1042  goto cleanup;
1043 
1044  snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), id_fmtW, adapter_info.Revision);
1045  hr = add_bstr_property(display_adapter, szRevisionId, buffer);
1046  if (FAILED(hr))
1047  goto cleanup;
1048 
1049  StringFromGUID2(&adapter_info.DeviceIdentifier, buffer, 39);
1050  hr = add_bstr_property(display_adapter, szDeviceIdentifier, buffer);
1051  if (FAILED(hr))
1052  goto cleanup;
1053 
1055  if (FAILED(hr))
1056  goto cleanup;
1057  }
1058 
1059  hr = IDirect3D9_GetAdapterDisplayMode(pDirect3D9, index, &adapter_mode);
1060  if (SUCCEEDED(hr))
1061  {
1062  hr = add_ui4_property(display_adapter, dwWidth, adapter_mode.Width);
1063  if (FAILED(hr))
1064  goto cleanup;
1065 
1066  hr = add_ui4_property(display_adapter, dwHeight, adapter_mode.Height);
1067  if (FAILED(hr))
1068  goto cleanup;
1069 
1070  hr = add_ui4_property(display_adapter, dwRefreshRate, adapter_mode.RefreshRate);
1071  if (FAILED(hr))
1072  goto cleanup;
1073 
1074  hr = add_ui4_property(display_adapter, dwBpp, depth_for_pixelformat(adapter_mode.Format));
1075  if (FAILED(hr))
1076  goto cleanup;
1077 
1078  snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), mode_fmtW, adapter_mode.Width, adapter_mode.Height,
1079  depth_for_pixelformat(adapter_mode.Format), adapter_mode.RefreshRate);
1080 
1081  hr = add_bstr_property(display_adapter, szDisplayModeLocalized, buffer);
1082  if (FAILED(hr))
1083  goto cleanup;
1084 
1085  hr = add_bstr_property(display_adapter, szDisplayModeEnglish, buffer);
1086  if (FAILED(hr))
1087  goto cleanup;
1088  }
1089 
1090  hr = add_bstr_property(display_adapter, szKeyDeviceKey, szEmpty);
1091  if (FAILED(hr))
1092  goto cleanup;
1093 
1094  hr = add_bstr_property(display_adapter, szKeyDeviceID, szEmpty);
1095  if (FAILED(hr))
1096  goto cleanup;
1097 
1098  hr = add_bstr_property(display_adapter, szChipType, szEmpty);
1099  if (FAILED(hr))
1100  goto cleanup;
1101 
1102  hr = add_bstr_property(display_adapter, szDACType, szEmpty);
1103  if (FAILED(hr))
1104  goto cleanup;
1105 
1106  hr = add_bstr_property(display_adapter, szRevision, szEmpty);
1107  if (FAILED(hr))
1108  goto cleanup;
1109 
1110  if (!get_texture_memory(&adapter_info.DeviceIdentifier, &available_mem))
1111  WARN("get_texture_memory helper failed\n");
1112 
1113  snprintfW(buffer, sizeof(buffer)/sizeof(buffer[0]), mem_fmt, available_mem / 1000000.0f);
1114 
1115  hr = add_bstr_property(display_adapter, szDisplayMemoryLocalized, buffer);
1116  if (FAILED(hr))
1117  goto cleanup;
1118 
1119  hr = add_bstr_property(display_adapter, szDisplayMemoryEnglish, buffer);
1120  if (FAILED(hr))
1121  goto cleanup;
1122 
1123  hr = IDirect3D9_GetDeviceCaps(pDirect3D9, index, D3DDEVTYPE_HAL, &device_caps);
1124  hardware_accel = SUCCEEDED(hr);
1125 
1126  hr = add_bool_property(display_adapter, b3DAccelerationEnabled, hardware_accel);
1127  if (FAILED(hr))
1128  goto cleanup;
1129 
1130  hr = add_bool_property(display_adapter, b3DAccelerationExists, hardware_accel);
1131  if (FAILED(hr))
1132  goto cleanup;
1133 
1134  hr = add_bool_property(display_adapter, bDDAccelerationEnabled, hardware_accel);
1135  if (FAILED(hr))
1136  goto cleanup;
1137 
1138  hr = add_bool_property(display_adapter, bNoHardware, FALSE);
1139  if (FAILED(hr))
1140  goto cleanup;
1141 
1142  hr = add_bool_property(display_adapter, bCanRenderWindow, TRUE);
1143  if (FAILED(hr))
1144  goto cleanup;
1145 
1146  hr = add_bstr_property(display_adapter, szMonitorName, gernericPNPMonitorW);
1147  if (FAILED(hr))
1148  goto cleanup;
1149 
1150  hr = add_bstr_property(display_adapter, szMonitorMaxRes, failedToGetParameterW);
1151  if (FAILED(hr))
1152  goto cleanup;
1153 
1154  hr = add_bstr_property(display_adapter, szDriverAttributes, driverAttributesW);
1155  if (FAILED(hr))
1156  goto cleanup;
1157 
1158  hr = add_bstr_property(display_adapter, szDriverLanguageEnglish, englishW);
1159  if (FAILED(hr))
1160  goto cleanup;
1161 
1162  hr = add_bstr_property(display_adapter, szDriverLanguageLocalized, englishW);
1163  if (FAILED(hr))
1164  goto cleanup;
1165 
1166  hr = add_bstr_property(display_adapter, szDriverDateEnglish, driverDateEnglishW);
1167  if (FAILED(hr))
1168  goto cleanup;
1169 
1170  hr = add_bstr_property(display_adapter, szDriverDateLocalized, driverDateLocalW);
1171  if (FAILED(hr))
1172  goto cleanup;
1173 
1174  hr = add_i4_property(display_adapter, lDriverSize, 10 * 1024 * 1024);
1175  if (FAILED(hr))
1176  goto cleanup;
1177 
1178  hr = add_bstr_property(display_adapter, szMiniVdd, naW);
1179  if (FAILED(hr))
1180  goto cleanup;
1181 
1182  hr = add_bstr_property(display_adapter, szMiniVddDateLocalized, naW);
1183  if (FAILED(hr))
1184  goto cleanup;
1185 
1186  hr = add_bstr_property(display_adapter, szMiniVddDateEnglish, naW);
1187  if (FAILED(hr))
1188  goto cleanup;
1189 
1190  hr = add_i4_property(display_adapter, lMiniVddSize, 0);
1191  if (FAILED(hr))
1192  goto cleanup;
1193 
1194  hr = add_bstr_property(display_adapter, szVdd, naW);
1195  if (FAILED(hr))
1196  goto cleanup;
1197 
1198  hr = add_bool_property(display_adapter, bDriverBeta, FALSE);
1199  if (FAILED(hr))
1200  goto cleanup;
1201 
1202  hr = add_bool_property(display_adapter, bDriverDebug, FALSE);
1203  if (FAILED(hr))
1204  goto cleanup;
1205 
1206  hr = add_bool_property(display_adapter, bDriverSigned, TRUE);
1207  if (FAILED(hr))
1208  goto cleanup;
1209 
1210  hr = add_bool_property(display_adapter, bDriverSignedValid, TRUE);
1211  if (FAILED(hr))
1212  goto cleanup;
1213 
1214  hr = add_bstr_property(display_adapter, szDriverSignDate, naW);
1215  if (FAILED(hr))
1216  goto cleanup;
1217 
1218  hr = add_ui4_property(display_adapter, dwDDIVersion, 11);
1219  if (FAILED(hr))
1220  goto cleanup;
1221 
1222  hr = add_bstr_property(display_adapter, szDDIVersionEnglish, ddi11W);
1223  if (FAILED(hr))
1224  goto cleanup;
1225 
1226  hr = add_bstr_property(display_adapter, szDDIVersionLocalized, ddi11W);
1227  if (FAILED(hr))
1228  goto cleanup;
1229 
1230  hr = add_ui4_property(display_adapter, iAdapter, index);
1231  if (FAILED(hr))
1232  goto cleanup;
1233 
1234  hr = add_ui4_property(display_adapter, dwWHQLLevel, 0);
1235  if (FAILED(hr))
1236  goto cleanup;
1237  }
1238 
1239  hr = S_OK;
1240 cleanup:
1241  IDirect3D9_Release(pDirect3D9);
1242  return hr;
1243 }
#define TRUE
Definition: types.h:120
#define snprintfW
Definition: unicode.h:60
static HRESULT add_bool_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, BOOL data)
Definition: provider.c:373
static const WCHAR lDriverSize[]
Definition: provider.c:82
HRESULT hr
Definition: shlfolder.c:183
static const WCHAR szDeviceId[]
Definition: provider.c:57
static const WCHAR szVdd[]
Definition: provider.c:87
static const WCHAR dwRefreshRate[]
Definition: provider.c:70
#define CP_ACP
Definition: compat.h:99
static void add_subcontainer(IDxDiagContainerImpl_Container *node, IDxDiagContainerImpl_Container *subCont)
Definition: provider.c:308
GLuint GLuint GLsizei count
Definition: gl.h:1545
static IDxDiagContainerImpl_Container * allocate_information_node(const WCHAR *name)
Definition: provider.c:264
#define WARN(fmt,...)
Definition: debug.h:111
static HRESULT add_ui4_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, DWORD data)
Definition: provider.c:339
static const WCHAR dwWHQLLevel[]
Definition: provider.c:98
static HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
Definition: provider.c:314
GLuint buffer
Definition: glext.h:5915
static const WCHAR szDisplayMemoryLocalized[]
Definition: provider.c:62
static const WCHAR szDeviceIdentifier[]
Definition: provider.c:58
char Description[MAX_DEVICE_IDENTIFIER_STRING]
Definition: d3d9types.h:1230
static const WCHAR szDriverVersion[]
Definition: provider.c:67
static const WCHAR szKeyDeviceID[]
Definition: provider.c:54
LARGE_INTEGER DriverVersion
Definition: d3d9types.h:1232
#define E_FAIL
Definition: ddrawi.h:102
IDirect3D9 *WINAPI Direct3DCreate9(UINT SDKVersion)
Definition: d3d9.c:57
#define IDirect3D9_GetAdapterCount(p)
Definition: d3d9.h:223
#define IDirect3D9_Release(p)
Definition: d3d9.h:220
static const WCHAR szDACType[]
Definition: provider.c:73
static const WCHAR szDDIVersionEnglish[]
Definition: provider.c:95
static const WCHAR szMonitorMaxRes[]
Definition: provider.c:76
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
struct _LARGE_INTEGER::@2201 u
static const WCHAR dwDDIVersion[]
Definition: provider.c:94
static const WCHAR bCanRenderWindow[]
Definition: provider.c:88
static const WCHAR szDriverDateLocalized[]
Definition: provider.c:81
GLuint index
Definition: glext.h:6031
static const WCHAR szDriverName[]
Definition: provider.c:66
static const WCHAR szRevision[]
Definition: provider.c:74
static const WCHAR dwHeight[]
Definition: provider.c:60
static const WCHAR szKeyDeviceKey[]
Definition: provider.c:55
static const WCHAR szDriverDateEnglish[]
Definition: provider.c:80
static const WCHAR szEmpty[]
Definition: provider.c:47
GLfloat f
Definition: glext.h:7540
#define D3D_SDK_VERSION
Definition: d3d8.h:56
static const WCHAR bDriverSigned[]
Definition: provider.c:91
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR szMiniVddDateLocalized[]
Definition: provider.c:84
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR szMonitorName[]
Definition: provider.c:75
static const WCHAR dwBpp[]
Definition: provider.c:61
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2343
static const WCHAR lMiniVddSize[]
Definition: provider.c:86
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR bDriverSignedValid[]
Definition: provider.c:92
static const WCHAR * vendor_id_to_manufacturer_string(DWORD vendor_id)
Definition: provider.c:919
static HRESULT add_i4_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, LONG data)
Definition: provider.c:356
static const WCHAR szMiniVdd[]
Definition: provider.c:83
static const WCHAR szDisplayModeEnglish[]
Definition: provider.c:65
#define IDirect3D9_GetAdapterIdentifier(p, a, b, c)
Definition: d3d9.h:224
static const WCHAR szDisplayMemoryEnglish[]
Definition: provider.c:63
static const WCHAR szDriverLanguageLocalized[]
Definition: provider.c:79
#define index(s, c)
Definition: various.h:29
static const WCHAR szRevisionId[]
Definition: provider.c:69
static BOOL get_texture_memory(GUID *adapter, DWORD *available_mem)
Definition: provider.c:899
#define IDirect3D9_GetDeviceCaps(p, a, b, c)
Definition: d3d9.h:233
static const WCHAR bDriverDebug[]
Definition: provider.c:90
static const WCHAR szDeviceName[]
Definition: provider.c:53
D3DFORMAT Format
Definition: d3d8types.h:1042
#define S_OK
Definition: intsafe.h:59
static const WCHAR szMiniVddDateEnglish[]
Definition: provider.c:85
static const WCHAR szDriverLanguageEnglish[]
Definition: provider.c:78
static const WCHAR szChipType[]
Definition: provider.c:72
static const WCHAR szDriverAttributes[]
Definition: provider.c:77
unsigned int UINT
Definition: ndis.h:50
static const WCHAR szDDIVersionLocalized[]
Definition: provider.c:96
#define MultiByteToWideChar
Definition: compat.h:100
char Driver[MAX_DEVICE_IDENTIFIER_STRING]
Definition: d3d9types.h:1229
static const WCHAR descriptionW[]
Definition: error.c:30
#define HIWORD(l)
Definition: typedefs.h:246
char * cleanup(char *str)
Definition: wpickclick.c:99
static const WCHAR iAdapter[]
Definition: provider.c:97
static const WCHAR szManufacturer[]
Definition: provider.c:71
#define LOWORD(l)
Definition: pedump.c:82
static const WCHAR szDriverSignDate[]
Definition: provider.c:93
static const WCHAR dwWidth[]
Definition: provider.c:59
static DWORD depth_for_pixelformat(D3DFORMAT format)
Definition: provider.c:884
static const WCHAR szDisplayModeLocalized[]
Definition: provider.c:64
static const WCHAR szVendorId[]
Definition: provider.c:56
static const WCHAR bDriverBeta[]
Definition: provider.c:89
static const WCHAR szDescription[]
Definition: provider.c:52
#define SUCCEEDED(hr)
Definition: intsafe.h:57
Definition: dlist.c:348
#define IDirect3D9_GetAdapterDisplayMode(p, a, b)
Definition: d3d9.h:227
static const WCHAR szSubSysId[]
Definition: provider.c:68

Referenced by build_displaydevices_tree().

◆ fill_display_information_fallback()

static HRESULT fill_display_information_fallback ( IDxDiagContainerImpl_Container node)
static

Definition at line 1245 of file provider.c.

1246 {
1247  static const WCHAR szAdapterID[] = {'0',0};
1248  static const WCHAR *empty_properties[] = {szDeviceIdentifier, szVendorId, szDeviceId,
1252 
1253  IDxDiagContainerImpl_Container *display_adapter;
1254  HRESULT hr;
1255  IDirectDraw7 *pDirectDraw;
1256  DDSCAPS2 dd_caps;
1257  DISPLAY_DEVICEW disp_dev;
1258  DDSURFACEDESC2 surface_descr;
1259  DWORD tmp;
1260  WCHAR buffer[256];
1261 
1262  display_adapter = allocate_information_node(szAdapterID);
1263  if (!display_adapter)
1264  return E_OUTOFMEMORY;
1265 
1266  add_subcontainer(node, display_adapter);
1267 
1268  disp_dev.cb = sizeof(disp_dev);
1269  if (EnumDisplayDevicesW( NULL, 0, &disp_dev, 0 ))
1270  {
1271  hr = add_bstr_property(display_adapter, szDeviceName, disp_dev.DeviceName);
1272  if (FAILED(hr))
1273  return hr;
1274 
1275  hr = add_bstr_property(display_adapter, szDescription, disp_dev.DeviceString);
1276  if (FAILED(hr))
1277  return hr;
1278  }
1279 
1280  /* Silently ignore a failure from DirectDrawCreateEx. */
1281  hr = DirectDrawCreateEx(NULL, (void **)&pDirectDraw, &IID_IDirectDraw7, NULL);
1282  if (FAILED(hr))
1283  return S_OK;
1284 
1286  dd_caps.dwCaps2 = dd_caps.dwCaps3 = dd_caps.u1.dwCaps4 = 0;
1287  hr = IDirectDraw7_GetAvailableVidMem(pDirectDraw, &dd_caps, &tmp, NULL);
1288  if (SUCCEEDED(hr))
1289  {
1290  static const WCHAR mem_fmt[] = {'%','.','1','f',' ','M','B',0};
1291 
1292  snprintfW(buffer, sizeof(buffer)/sizeof(buffer[0]), mem_fmt, tmp / 1000000.0f);
1293 
1294  hr = add_bstr_property(display_adapter, szDisplayMemoryLocalized, buffer);
1295  if (FAILED(hr))
1296  goto cleanup;
1297 
1298  hr = add_bstr_property(display_adapter, szDisplayMemoryEnglish, buffer);
1299  if (FAILED(hr))
1300  goto cleanup;
1301  }
1302 
1303  surface_descr.dwSize = sizeof(surface_descr);
1304  hr = IDirectDraw7_GetDisplayMode(pDirectDraw, &surface_descr);
1305  if (SUCCEEDED(hr))
1306  {
1307  if (surface_descr.dwFlags & DDSD_WIDTH)
1308  {
1309  hr = add_ui4_property(display_adapter, dwWidth, surface_descr.dwWidth);
1310  if (FAILED(hr))
1311  goto cleanup;
1312  }
1313 
1314  if (surface_descr.dwFlags & DDSD_HEIGHT)
1315  {
1316  hr = add_ui4_property(display_adapter, dwHeight, surface_descr.dwHeight);
1317  if (FAILED(hr))
1318  goto cleanup;
1319  }
1320 
1321  if (surface_descr.dwFlags & DDSD_PIXELFORMAT)
1322  {
1323  hr = add_ui4_property(display_adapter, dwBpp, surface_descr.u4.ddpfPixelFormat.u1.dwRGBBitCount);
1324  if (FAILED(hr))
1325  goto cleanup;
1326  }
1327  }
1328 
1329  hr = add_ui4_property(display_adapter, dwRefreshRate, 60);
1330  if (FAILED(hr))
1331  goto cleanup;
1332 
1333  for (tmp = 0; tmp < sizeof(empty_properties)/sizeof(empty_properties[0]); tmp++)
1334  {
1335  hr = add_bstr_property(display_adapter, empty_properties[tmp], szEmpty);
1336  if (FAILED(hr))
1337  goto cleanup;
1338  }
1339 
1340  hr = S_OK;
1341 cleanup:
1342  IDirectDraw7_Release(pDirectDraw);
1343  return hr;
1344 }
DWORD dwFlags
Definition: ddraw.h:1153
#define snprintfW
Definition: unicode.h:60
HRESULT hr
Definition: shlfolder.c:183
static const WCHAR szDeviceId[]
Definition: provider.c:57
DWORD dwCaps2
Definition: ddraw.h:733
static const WCHAR dwRefreshRate[]
Definition: provider.c:70
static void add_subcontainer(IDxDiagContainerImpl_Container *node, IDxDiagContainerImpl_Container *subCont)
Definition: provider.c:308
static IDxDiagContainerImpl_Container * allocate_information_node(const WCHAR *name)
Definition: provider.c:264
WCHAR DeviceString[128]
Definition: wingdi.h:2814
static HRESULT add_ui4_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, DWORD data)
Definition: provider.c:339
static HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
Definition: provider.c:314
DWORD dwCaps4
Definition: ddraw.h:737
GLuint buffer
Definition: glext.h:5915
static const WCHAR szDisplayMemoryLocalized[]
Definition: provider.c:62
static const WCHAR szDeviceIdentifier[]
Definition: provider.c:58
static const WCHAR szDriverVersion[]
Definition: provider.c:67
static const WCHAR szKeyDeviceID[]
Definition: provider.c:54
HRESULT WINAPI DirectDrawCreateEx(LPGUID lpGUID, LPVOID *lplpDD, REFIID id, LPUNKNOWN pUnkOuter)
Definition: main.c:139
WCHAR DeviceName[32]
Definition: wingdi.h:2813
DWORD dwWidth
Definition: ddraw.h:1155
static const WCHAR szDACType[]
Definition: provider.c:73
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
DDPIXELFORMAT ddpfPixelFormat
Definition: ddraw.h:1185
DWORD dwCaps
Definition: ddraw.h:732
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI EnumDisplayDevicesW(LPCWSTR lpDevice, DWORD iDevNum, PDISPLAY_DEVICEW lpDisplayDevice, DWORD dwFlags)
Definition: display.c:78
static const WCHAR szDriverName[]
Definition: provider.c:66
#define DDSCAPS_VIDEOMEMORY
Definition: ddraw.h:264
static const WCHAR szRevision[]
Definition: provider.c:74
static const WCHAR dwHeight[]
Definition: provider.c:60
static const WCHAR szKeyDeviceKey[]
Definition: provider.c:55
#define DDSD_HEIGHT
Definition: ddraw.h:209
static const WCHAR szEmpty[]
Definition: provider.c:47
GLfloat f
Definition: glext.h:7540
DWORD dwRGBBitCount
Definition: ddraw.h:1075
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR dwBpp[]
Definition: provider.c:61
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR szDisplayMemoryEnglish[]
Definition: provider.c:63
DWORD dwSize
Definition: ddraw.h:1152
#define DDSCAPS_LOCALVIDMEM
Definition: ddraw.h:276
DWORD dwCaps3
Definition: ddraw.h:734
static const WCHAR szRevisionId[]
Definition: provider.c:69
static const WCHAR szDeviceName[]
Definition: provider.c:53
DWORD dwHeight
Definition: ddraw.h:1154
#define DDSD_WIDTH
Definition: ddraw.h:210
#define DDSD_PIXELFORMAT
Definition: ddraw.h:216
#define S_OK
Definition: intsafe.h:59
DWORD IDirectDraw7
Definition: vmrender.idl:21
static const WCHAR szChipType[]
Definition: provider.c:72
char * cleanup(char *str)
Definition: wpickclick.c:99
static const WCHAR szManufacturer[]
Definition: provider.c:71
static const WCHAR dwWidth[]
Definition: provider.c:59
static const WCHAR szVendorId[]
Definition: provider.c:56
static const WCHAR szDescription[]
Definition: provider.c:52
#define SUCCEEDED(hr)
Definition: intsafe.h:57
Definition: dlist.c:348
static const WCHAR szSubSysId[]
Definition: provider.c:68

Referenced by build_displaydevices_tree().

◆ fill_file_description()

static HRESULT fill_file_description ( IDxDiagContainerImpl_Container node,
const WCHAR szFilePath,
const WCHAR szFileName 
)
static

Definition at line 1490 of file provider.c.

1491 {
1492  static const WCHAR szSlashSep[] = {'\\',0};
1493  static const WCHAR szPath[] = {'s','z','P','a','t','h',0};
1494  static const WCHAR szName[] = {'s','z','N','a','m','e',0};
1495  static const WCHAR szVersion[] = {'s','z','V','e','r','s','i','o','n',0};
1496  static const WCHAR szAttributes[] = {'s','z','A','t','t','r','i','b','u','t','e','s',0};
1497  static const WCHAR szLanguageEnglish[] = {'s','z','L','a','n','g','u','a','g','e','E','n','g','l','i','s','h',0};
1498  static const WCHAR dwFileTimeHigh[] = {'d','w','F','i','l','e','T','i','m','e','H','i','g','h',0};
1499  static const WCHAR dwFileTimeLow[] = {'d','w','F','i','l','e','T','i','m','e','L','o','w',0};
1500  static const WCHAR bBeta[] = {'b','B','e','t','a',0};
1501  static const WCHAR bDebug[] = {'b','D','e','b','u','g',0};
1502  static const WCHAR bExists[] = {'b','E','x','i','s','t','s',0};
1503 
1504  /* Values */
1505  static const WCHAR szFinal_Retail_v[] = {'F','i','n','a','l',' ','R','e','t','a','i','l',0};
1506  static const WCHAR szEnglish_v[] = {'E','n','g','l','i','s','h',0};
1507  static const WCHAR szVersionFormat[] = {'%','u','.','%','0','2','u','.','%','0','4','u','.','%','0','4','u',0};
1508 
1509  HRESULT hr;
1510  WCHAR *szFile;
1511  WCHAR szVersion_v[1024];
1512  DWORD retval, hdl;
1513  void *pVersionInfo = NULL;
1514  BOOL boolret = FALSE;
1515  UINT uiLength;
1516  VS_FIXEDFILEINFO *pFileInfo;
1517 
1518  TRACE("Filling container %p for %s in %s\n", node,
1519  debugstr_w(szFileName), debugstr_w(szFilePath));
1520 
1521  szFile = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * (lstrlenW(szFilePath) +
1522  lstrlenW(szFileName) + 2 /* slash + terminator */));
1523  if (!szFile)
1524  return E_OUTOFMEMORY;
1525 
1526  lstrcpyW(szFile, szFilePath);
1527  lstrcatW(szFile, szSlashSep);
1528  lstrcatW(szFile, szFileName);
1529 
1530  retval = GetFileVersionInfoSizeW(szFile, &hdl);
1531  if (retval)
1532  {
1533  pVersionInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, retval);
1534  if (!pVersionInfo)
1535  {
1536  hr = E_OUTOFMEMORY;
1537  goto cleanup;
1538  }
1539 
1540  if (GetFileVersionInfoW(szFile, 0, retval, pVersionInfo) &&
1541  VerQueryValueW(pVersionInfo, szSlashSep, (void **)&pFileInfo, &uiLength))
1542  boolret = TRUE;
1543  }
1544 
1545  hr = add_bstr_property(node, szPath, szFile);
1546  if (FAILED(hr))
1547  goto cleanup;
1548 
1549  hr = add_bstr_property(node, szName, szFileName);
1550  if (FAILED(hr))
1551  goto cleanup;
1552 
1553  hr = add_bool_property(node, bExists, boolret);
1554  if (FAILED(hr))
1555  goto cleanup;
1556 
1557  if (boolret)
1558  {
1559  snprintfW(szVersion_v, sizeof(szVersion_v)/sizeof(szVersion_v[0]),
1560  szVersionFormat,
1561  HIWORD(pFileInfo->dwFileVersionMS),
1562  LOWORD(pFileInfo->dwFileVersionMS),
1563  HIWORD(pFileInfo->dwFileVersionLS),
1564  LOWORD(pFileInfo->dwFileVersionLS));
1565 
1566  TRACE("Found version as (%s)\n", debugstr_w(szVersion_v));
1567 
1568  hr = add_bstr_property(node, szVersion, szVersion_v);
1569  if (FAILED(hr))
1570  goto cleanup;
1571 
1572  hr = add_bstr_property(node, szAttributes, szFinal_Retail_v);
1573  if (FAILED(hr))
1574  goto cleanup;
1575 
1576  hr = add_bstr_property(node, szLanguageEnglish, szEnglish_v);
1577  if (FAILED(hr))
1578  goto cleanup;
1579 
1580  hr = add_ui4_property(node, dwFileTimeHigh, pFileInfo->dwFileDateMS);
1581  if (FAILED(hr))
1582  goto cleanup;
1583 
1584  hr = add_ui4_property(node, dwFileTimeLow, pFileInfo->dwFileDateLS);
1585  if (FAILED(hr))
1586  goto cleanup;
1587 
1588  hr = add_bool_property(node, bBeta, ((pFileInfo->dwFileFlags & pFileInfo->dwFileFlagsMask) & VS_FF_PRERELEASE) != 0);
1589  if (FAILED(hr))
1590  goto cleanup;
1591 
1592  hr = add_bool_property(node, bDebug, ((pFileInfo->dwFileFlags & pFileInfo->dwFileFlagsMask) & VS_FF_DEBUG) != 0);
1593  if (FAILED(hr))
1594  goto cleanup;
1595  }
1596 
1597  hr = S_OK;
1598 cleanup:
1599  HeapFree(GetProcessHeap(), 0, pVersionInfo);
1600  HeapFree(GetProcessHeap(), 0, szFile);
1601 
1602  return hr;
1603 }
#define TRUE
Definition: types.h:120
#define snprintfW
Definition: unicode.h:60
static HRESULT add_bool_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, BOOL data)
Definition: provider.c:373
static WCHAR szFilePath[]
Definition: qotd.c:14
HRESULT hr
Definition: shlfolder.c:183
DWORD dwFileDateMS
Definition: compat.h:560
static HRESULT add_ui4_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, DWORD data)
Definition: provider.c:339
static HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
Definition: provider.c:314
#define VS_FF_DEBUG
Definition: verrsrc.h:42
DWORD dwFileVersionLS
Definition: compat.h:552
BOOL bDebug
Definition: service.c:37
#define lstrlenW
Definition: compat.h:407
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define VS_FF_PRERELEASE
Definition: verrsrc.h:43
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
DWORD dwFileFlagsMask
Definition: compat.h:555
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DWORD dwFileDateLS
Definition: compat.h:561
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwFileVersionMS
Definition: compat.h:551
static LPCWSTR szVersion
Definition: asmcache.c:748
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:616
#define S_OK
Definition: intsafe.h:59
#define lstrcpyW
Definition: compat.h:406
LPCWSTR szPath
Definition: env.c:35
unsigned int UINT
Definition: ndis.h:50
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:850
static const WCHAR szName[]
Definition: msipriv.h:1194
#define HIWORD(l)
Definition: typedefs.h:246
char * cleanup(char *str)
Definition: wpickclick.c:99
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1054
Definition: dlist.c:348

Referenced by build_directxfiles_tree().

◆ fill_filter_container()

static HRESULT fill_filter_container ( IDxDiagContainerImpl_Container subcont,
IMoniker pMoniker 
)
static

Definition at line 1761 of file provider.c.

1762 {
1763  static const WCHAR szName[] = {'s','z','N','a','m','e',0};
1764  static const WCHAR ClsidFilterW[] = {'C','l','s','i','d','F','i','l','t','e','r',0};
1765  static const WCHAR wszFilterDataName[] = {'F','i','l','t','e','r','D','a','t','a',0};
1766 
1767  HRESULT hr;
1768  IPropertyBag *pPropFilterBag = NULL;
1769  BYTE *pData;
1771  VARIANT clsid_name;
1772  VARIANT v;
1773 
1775  VariantInit(&clsid_name);
1776  VariantInit(&v);
1777 
1778  hr = IMoniker_BindToStorage(pMoniker, NULL, NULL, &IID_IPropertyBag, (void **)&pPropFilterBag);
1779  if (FAILED(hr))
1780  return hr;
1781 
1782  hr = read_property_names(pPropFilterBag, &friendly_name, &clsid_name);
1783  if (FAILED(hr))
1784  goto cleanup;
1785 
1786  TRACE("Name = %s\n", debugstr_w(V_BSTR(&friendly_name)));
1787  TRACE("CLSID = %s\n", debugstr_w(V_BSTR(&clsid_name)));
1788 
1790  if (FAILED(hr))
1791  goto cleanup;
1792 
1793  hr = add_bstr_property(subcont, ClsidFilterW, V_BSTR(&clsid_name));
1794  if (FAILED(hr))
1795  goto cleanup;
1796 
1797  hr = IPropertyBag_Read(pPropFilterBag, wszFilterDataName, &v, NULL);
1798  if (FAILED(hr))
1799  goto cleanup;
1800 
1801  hr = SafeArrayAccessData(V_ARRAY(&v), (void **)&pData);
1802  if (FAILED(hr))
1803  goto cleanup;
1804 
1805  hr = fill_filter_data_information(subcont, pData, V_ARRAY(&v)->rgsabound->cElements);
1807  if (FAILED(hr))
1808  goto cleanup;
1809 
1810  hr = S_OK;
1811 cleanup:
1812  VariantClear(&v);
1813  VariantClear(&clsid_name);
1815  if (pPropFilterBag) IPropertyBag_Release(pPropFilterBag);
1816 
1817  return hr;
1818 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT fill_filter_data_information(IDxDiagContainerImpl_Container *subcont, BYTE *pData, ULONG cb)
Definition: provider.c:1686
#define V_ARRAY(A)
Definition: oleauto.h:222
static HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
Definition: provider.c:314
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1139
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IPropertyBag
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
unsigned char BYTE
Definition: mem.h:68
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040
static const WCHAR wszFilterDataName[]
Definition: filtermapper.c:90
static const WCHAR friendly_name[]
Definition: devenum.c:38
static HRESULT read_property_names(IPropertyBag *pPropBag, VARIANT *friendly_name, VARIANT *clsid_name)
Definition: provider.c:1662
static const WCHAR szName[]
Definition: msipriv.h:1194
char * cleanup(char *str)
Definition: wpickclick.c:99
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1170

Referenced by build_directshowfilters_tree().

◆ fill_filter_data_information()

static HRESULT fill_filter_data_information ( IDxDiagContainerImpl_Container subcont,
BYTE pData,
ULONG  cb 
)
static

Definition at line 1686 of file provider.c.

1687 {
1688  static const WCHAR szVersionW[] = {'s','z','V','e','r','s','i','o','n',0};
1689  static const WCHAR dwInputs[] = {'d','w','I','n','p','u','t','s',0};
1690  static const WCHAR dwOutputs[] = {'d','w','O','u','t','p','u','t','s',0};
1691  static const WCHAR dwMeritW[] = {'d','w','M','e','r','i','t',0};
1692  static const WCHAR szVersionFormat[] = {'v','%','d',0};
1693 
1694  HRESULT hr;
1695  IFilterMapper2 *pFileMapper = NULL;
1696  IAMFilterData *pFilterData = NULL;
1697  BYTE *ppRF = NULL;
1698  REGFILTER2 *pRF = NULL;
1699  WCHAR bufferW[10];
1700  ULONG j;
1701  DWORD dwNOutputs = 0;
1702  DWORD dwNInputs = 0;
1703 
1704  hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC, &IID_IFilterMapper2,
1705  (void **)&pFileMapper);
1706  if (FAILED(hr))
1707  return hr;
1708 
1709  hr = IFilterMapper2_QueryInterface(pFileMapper, &IID_IAMFilterData, (void **)&pFilterData);
1710  if (FAILED(hr))
1711  goto cleanup;
1712 
1713  hr = IAMFilterData_ParseFilterData(pFilterData, pData, cb, (BYTE **)&ppRF);
1714  if (FAILED(hr))
1715  goto cleanup;
1716  pRF = ((REGFILTER2**)ppRF)[0];
1717 
1718  snprintfW(bufferW, sizeof(bufferW)/sizeof(bufferW[0]), szVersionFormat, pRF->dwVersion);
1719  hr = add_bstr_property(subcont, szVersionW, bufferW);
1720  if (FAILED(hr))
1721  goto cleanup;
1722 
1723  if (pRF->dwVersion == 1)
1724  {
1725  for (j = 0; j < pRF->u.s1.cPins; j++)
1726  if (pRF->u.s1.rgPins[j].bOutput)
1727  dwNOutputs++;
1728  else
1729  dwNInputs++;
1730  }
1731  else if (pRF->dwVersion == 2)
1732  {
1733  for (j = 0; j < pRF->u.s2.cPins2; j++)
1734  if (pRF->u.s2.rgPins2[j].dwFlags & REG_PINFLAG_B_OUTPUT)
1735  dwNOutputs++;
1736  else
1737  dwNInputs++;
1738  }
1739 
1740  hr = add_ui4_property(subcont, dwInputs, dwNInputs);
1741  if (FAILED(hr))
1742  goto cleanup;
1743 
1744  hr = add_ui4_property(subcont, dwOutputs, dwNOutputs);
1745  if (FAILED(hr))
1746  goto cleanup;
1747 
1748  hr = add_ui4_property(subcont, dwMeritW, pRF->dwMerit);
1749  if (FAILED(hr))
1750  goto cleanup;
1751 
1752  hr = S_OK;
1753 cleanup:
1754  CoTaskMemFree(pRF);
1755  if (pFilterData) IAMFilterData_Release(pFilterData);
1756  if (pFileMapper) IFilterMapper2_Release(pFileMapper);
1757 
1758  return hr;
1759 }
#define snprintfW
Definition: unicode.h:60
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
HRESULT hr
Definition: shlfolder.c:183
static HRESULT add_ui4_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, DWORD data)
Definition: provider.c:339
const REGFILTERPINS2 * rgPins2
Definition: axextend.idl:246
static HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
Definition: provider.c:314
DWORD dwMerit
Definition: axextend.idl:232
smooth NULL
Definition: ftsmooth.c:416
const REGFILTERPINS * rgPins
Definition: axextend.idl:239
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
ULONG cPins2
Definition: axextend.idl:245
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static DWORD cb
Definition: integrity.c:41
unsigned char BYTE
Definition: mem.h:68
ULONG cPins
Definition: axextend.idl:238
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
DWORD dwVersion
Definition: axextend.idl:231
unsigned int ULONG
Definition: retypes.h:1
char * cleanup(char *str)
Definition: wpickclick.c:99
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827

Referenced by fill_filter_container().

◆ fill_language_information()

static HRESULT fill_language_information ( IDxDiagContainerImpl_Container node)
static

Definition at line 511 of file provider.c.

512 {
513  static const WCHAR regional_setting_engW[] = {'R','e','g','i','o','n','a','l',' ','S','e','t','t','i','n','g',0};
514  static const WCHAR languages_fmtW[] = {'%','s',' ','(','%','s',':',' ','%','s',')',0};
515  static const WCHAR szLanguagesLocalized[] = {'s','z','L','a','n','g','u','a','g','e','s','L','o','c','a','l','i','z','e','d',0};
516  static const WCHAR szLanguagesEnglish[] = {'s','z','L','a','n','g','u','a','g','e','s','E','n','g','l','i','s','h',0};
517 
518  WCHAR system_lang[80], regional_setting[100], user_lang[80], language_str[300];
519  HRESULT hr;
520 
521  /* szLanguagesLocalized */
522  GetLocaleInfoW(LOCALE_SYSTEM_DEFAULT, LOCALE_SNATIVELANGNAME, system_lang, sizeof(system_lang)/sizeof(WCHAR));
523  LoadStringW(dxdiagn_instance, IDS_REGIONAL_SETTING, regional_setting, sizeof(regional_setting)/sizeof(WCHAR));
524  GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SNATIVELANGNAME, user_lang, sizeof(user_lang)/sizeof(WCHAR));
525 
526  snprintfW(language_str, sizeof(language_str)/sizeof(WCHAR), languages_fmtW, system_lang, regional_setting, user_lang);
527 
528  hr = add_bstr_property(node, szLanguagesLocalized, language_str);
529  if (FAILED(hr))
530  return hr;
531 
532  /* szLanguagesEnglish */
533  GetLocaleInfoW(LOCALE_SYSTEM_DEFAULT, LOCALE_SENGLANGUAGE, system_lang, sizeof(system_lang)/sizeof(WCHAR));
534  GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SENGLANGUAGE, user_lang, sizeof(user_lang)/sizeof(WCHAR));
535 
536  snprintfW(language_str, sizeof(language_str)/sizeof(WCHAR), languages_fmtW, system_lang, regional_setting_engW, user_lang);
537 
538  hr = add_bstr_property(node, szLanguagesEnglish, language_str);
539  if (FAILED(hr))
540  return hr;
541 
542  return S_OK;
543 }
#define snprintfW
Definition: unicode.h:60
HRESULT hr
Definition: shlfolder.c:183
#define LOCALE_SENGLANGUAGE
Definition: winnls.h:27
#define LOCALE_USER_DEFAULT
static HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
Definition: provider.c:314
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1098
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define LOCALE_SYSTEM_DEFAULT
#define LOCALE_SNATIVELANGNAME
Definition: winnls.h:29
#define S_OK
Definition: intsafe.h:59
#define IDS_REGIONAL_SETTING
Definition: resource.h:25
HINSTANCE dxdiagn_instance
Definition: dxdiag_main.c:39
Definition: dlist.c:348

Referenced by build_systeminfo_tree().

◆ fill_os_string_information()

static HRESULT fill_os_string_information ( IDxDiagContainerImpl_Container node,
OSVERSIONINFOW info 
)
static

Definition at line 582 of file provider.c.

583 {
584  static const WCHAR winxpW[] = {'W','i','n','d','o','w','s',' ','X','P',' ','P','r','o','f','e','s','s','i','o','n','a','l',0};
585  static const WCHAR szOSLocalized[] = {'s','z','O','S','L','o','c','a','l','i','z','e','d',0};
586  static const WCHAR szOSExLocalized[] = {'s','z','O','S','E','x','L','o','c','a','l','i','z','e','d',0};
587  static const WCHAR szOSExLongLocalized[] = {'s','z','O','S','E','x','L','o','n','g','L','o','c','a','l','i','z','e','d',0};
588  static const WCHAR szOSEnglish[] = {'s','z','O','S','E','n','g','l','i','s','h',0};
589  static const WCHAR szOSExEnglish[] = {'s','z','O','S','E','x','E','n','g','l','i','s','h',0};
590  static const WCHAR szOSExLongEnglish[] = {'s','z','O','S','E','x','L','o','n','g','E','n','g','l','i','s','h',0};
591 
592  static const WCHAR *prop_list[] = {szOSLocalized, szOSExLocalized, szOSExLongLocalized,
593  szOSEnglish, szOSExEnglish, szOSExLongEnglish};
594 
595  size_t i;
596  HRESULT hr;
597 
598  /* FIXME: OS detection should be performed, and localized OS strings
599  * should contain translated versions of the "build" phrase. */
600  for (i = 0; i < sizeof(prop_list)/sizeof(prop_list[0]); i++)
601  {
602  hr = add_bstr_property(node, prop_list[i], winxpW);
603  if (FAILED(hr))
604  return hr;
605  }
606 
607  return S_OK;
608 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
Definition: provider.c:314
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
Definition: dlist.c:348

Referenced by build_systeminfo_tree().

◆ fill_processor_information()

static HRESULT fill_processor_information ( IDxDiagContainerImpl_Container node)
static

Definition at line 610 of file provider.c.

611 {
612  static const WCHAR szProcessorEnglish[] = {'s','z','P','r','o','c','e','s','s','o','r','E','n','g','l','i','s','h',0};
613 
614  static const WCHAR cimv2W[] = {'\\','\\','.','\\','r','o','o','t','\\','c','i','m','v','2',0};
615  static const WCHAR proc_classW[] = {'W','i','n','3','2','_','P','r','o','c','e','s','s','o','r',0};
616  static const WCHAR nameW[] = {'N','a','m','e',0};
617  static const WCHAR max_clock_speedW[] = {'M','a','x','C','l','o','c','k','S','p','e','e','d',0};
618  static const WCHAR cpu_noW[] = {'N','u','m','b','e','r','O','f','L','o','g','i','c','a','l','P','r','o','c','e','s','s','o','r','s',0};
619 
620  static const WCHAR processor_fmtW[] = {'%','s','(','%','d',' ','C','P','U','s',')',',',' ','~','%','d','M','H','z',0};
621 
623  IWbemServices *wbem_service;
624  IWbemClassObject *wbem_class;
625  IEnumWbemClassObject *wbem_enum;
626  VARIANT cpu_name, cpu_no, clock_speed;
627  WCHAR print_buf[200];
628  BSTR bstr;
629  ULONG no;
630  HRESULT hr;
631 
632  hr = CoCreateInstance(&CLSID_WbemLocator, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemLocator, (void**)&wbem_locator);
633  if(FAILED(hr))
634  return hr;
635 
636  bstr = SysAllocString(cimv2W);
637  if(!bstr) {
638  IWbemLocator_Release(wbem_locator);
639  return E_OUTOFMEMORY;
640  }
641  hr = IWbemLocator_ConnectServer(wbem_locator, bstr, NULL, NULL, NULL, 0, NULL, NULL, &wbem_service);
642  IWbemLocator_Release(wbem_locator);
643  SysFreeString(bstr);
644  if(FAILED(hr))
645  return hr;
646 
647  bstr = SysAllocString(proc_classW);
648  if(!bstr) {
649  IWbemServices_Release(wbem_service);
650  return E_OUTOFMEMORY;
651  }
652  hr = IWbemServices_CreateInstanceEnum(wbem_service, bstr, WBEM_FLAG_SYSTEM_ONLY, NULL, &wbem_enum);
653  IWbemServices_Release(wbem_service);
654  SysFreeString(bstr);
655  if(FAILED(hr))
656  return hr;
657 
658  hr = IEnumWbemClassObject_Next(wbem_enum, 1000, 1, &wbem_class, &no);
659  IEnumWbemClassObject_Release(wbem_enum);
660  if(FAILED(hr))
661  return hr;
662 
663  hr = IWbemClassObject_Get(wbem_class, cpu_noW, 0, &cpu_no, NULL, NULL);
664  if(FAILED(hr)) {
665  IWbemClassObject_Release(wbem_class);
666  return hr;
667  }
668  hr = IWbemClassObject_Get(wbem_class, max_clock_speedW, 0, &clock_speed, NULL, NULL);
669  if(FAILED(hr)) {
670  IWbemClassObject_Release(wbem_class);
671  return hr;
672  }
673  hr = IWbemClassObject_Get(wbem_class, nameW, 0, &cpu_name, NULL, NULL);
674  IWbemClassObject_Release(wbem_class);
675  if(FAILED(hr))
676  return hr;
677 
678  sprintfW(print_buf, processor_fmtW, V_BSTR(&cpu_name), V_I4(&cpu_no), V_I4(&clock_speed));
679  VariantClear(&cpu_name);
680  VariantClear(&cpu_no);
681  VariantClear(&clock_speed);
682 
683  return add_bstr_property(node, szProcessorEnglish, print_buf);
684 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
Definition: provider.c:314
OLECHAR * BSTR
Definition: compat.h:1934
#define V_I4(A)
Definition: oleauto.h:247
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
static const WCHAR nameW[]
Definition: main.c:46
static WCHAR no[MAX_STRING_RESOURCE_LEN]
Definition: object.c:2340
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_BSTR(A)
Definition: oleauto.h:226
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define sprintfW
Definition: unicode.h:58
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int ULONG
Definition: retypes.h:1
Definition: dlist.c:348

Referenced by build_systeminfo_tree().

◆ free_information_tree()

static void free_information_tree ( IDxDiagContainerImpl_Container node)
static

Definition at line 238 of file provider.c.

239 {
241 
242  if (!node)
243  return;
244 
245  HeapFree(GetProcessHeap(), 0, node->contName);
246 
248  {
249  IDxDiagContainerImpl_Property *prop, *prop_cursor2;
250 
251  LIST_FOR_EACH_ENTRY_SAFE(prop, prop_cursor2, &ptr->properties, IDxDiagContainerImpl_Property, entry)
252  {
253  list_remove(&prop->entry);
255  }
256 
257  list_remove(&ptr->entry);
259  }
260 
262 }
static PVOID ptr
Definition: dispmode.c:27
static void free_information_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:238
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define GetProcessHeap()
Definition: compat.h:395
uint32_t entry
Definition: isohybrid.c:63
static void free_property_information(IDxDiagContainerImpl_Property *prop)
Definition: provider.c:231
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
#define HeapFree(x, y, z)
Definition: compat.h:394
Definition: dlist.c:348

Referenced by build_directshowfilters_tree(), build_directxfiles_tree(), build_information_tree(), and IDxDiagProviderImpl_Release().

◆ free_property_information()

static void free_property_information ( IDxDiagContainerImpl_Property prop)
static

Definition at line 231 of file provider.c.

232 {
233  VariantClear(&prop->vProp);
234  HeapFree(GetProcessHeap(), 0, prop->propName);
235  HeapFree(GetProcessHeap(), 0, prop);
236 }
#define GetProcessHeap()
Definition: compat.h:395
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by add_bstr_property(), add_ull_as_bstr_property(), and free_information_tree().

◆ get_process_name_from_pid()

static BOOL get_process_name_from_pid ( DWORD  pid,
WCHAR buf,
DWORD  chars 
)
static

Definition at line 457 of file provider.c.

458 {
459  HANDLE process;
460  HMODULE module;
461  DWORD required_size;
462 
464  if (!process)
465  return FALSE;
466 
467  if (!EnumProcessModules(process, &module, sizeof(module), &required_size))
468  {
470  return FALSE;
471  }
472 
473  if (!GetModuleBaseNameW(process, module, buf, chars))
474  {
476  return FALSE;
477  }
478 
480  return TRUE;
481 }
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
HMODULE module
Definition: main.cpp:47
#define PROCESS_QUERY_INFORMATION
Definition: pstypes.h:158
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static HANDLE process
Definition: process.c:76
DWORD WINAPI GetModuleBaseNameW(HANDLE hProcess, HMODULE hModule, LPWSTR lpBaseName, DWORD nSize)
Definition: psapi.c:930
BOOL WINAPI EnumProcessModules(HANDLE hProcess, HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded)
Definition: psapi.c:542
unsigned long DWORD
Definition: ntddk_ex.h:95
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
Definition: proc.c:1227
#define PROCESS_VM_READ
Definition: pstypes.h:153

Referenced by is_netmeeting_running().

◆ get_texture_memory()

static BOOL get_texture_memory ( GUID adapter,
DWORD available_mem 
)
static

Definition at line 899 of file provider.c.

900 {
901  IDirectDraw7 *pDirectDraw;
902  HRESULT hr;
903  DDSCAPS2 dd_caps;
904 
905  hr = DirectDrawCreateEx(adapter, (void **)&pDirectDraw, &IID_IDirectDraw7, NULL);
906  if (SUCCEEDED(hr))
907  {
909  dd_caps.dwCaps2 = dd_caps.dwCaps3 = dd_caps.u1.dwCaps4 = 0;
910  hr = IDirectDraw7_GetAvailableVidMem(pDirectDraw, &dd_caps, available_mem, NULL);
911  IDirectDraw7_Release(pDirectDraw);
912  if (SUCCEEDED(hr))
913  return TRUE;
914  }
915 
916  return FALSE;
917 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
DWORD dwCaps2
Definition: ddraw.h:733
DWORD dwCaps4
Definition: ddraw.h:737
HRESULT WINAPI DirectDrawCreateEx(LPGUID lpGUID, LPVOID *lplpDD, REFIID id, LPUNKNOWN pUnkOuter)
Definition: main.c:139
DWORD dwCaps
Definition: ddraw.h:732
smooth NULL
Definition: ftsmooth.c:416
#define DDSCAPS_VIDEOMEMORY
Definition: ddraw.h:264
LONG HRESULT
Definition: typedefs.h:77
#define DDSCAPS_LOCALVIDMEM
Definition: ddraw.h:276
DWORD dwCaps3
Definition: ddraw.h:734
DWORD IDirectDraw7
Definition: vmrender.idl:21
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by fill_display_information_d3d().

◆ guid_to_string()

static LPWSTR guid_to_string ( LPWSTR  lpwstr,
REFGUID  lpcguid 
)
static

Definition at line 1372 of file provider.c.

1373 {
1374  wsprintfW(lpwstr, szGUIDFmt, lpcguid->Data1, lpcguid->Data2,
1375  lpcguid->Data3, lpcguid->Data4[0], lpcguid->Data4[1],
1376  lpcguid->Data4[2], lpcguid->Data4[3], lpcguid->Data4[4],
1377  lpcguid->Data4[5], lpcguid->Data4[6], lpcguid->Data4[7]);
1378 
1379  return lpwstr;
1380 }
static const WCHAR szGUIDFmt[]
Definition: provider.c:1365
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
unsigned short Data2
Definition: scsiwmi.h:53
unsigned long Data1
Definition: scsiwmi.h:52
unsigned char Data4[8]
Definition: scsiwmi.h:55
unsigned short Data3
Definition: scsiwmi.h:54

Referenced by dsound_enum().

◆ IDxDiagProviderImpl_AddRef()

static ULONG WINAPI IDxDiagProviderImpl_AddRef ( IDxDiagProvider *  iface)
static

Definition at line 134 of file provider.c.

135 {
137  ULONG refCount = InterlockedIncrement(&This->ref);
138 
139  TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
140 
142 
143  return refCount;
144 }
static void DXDIAGN_LockModule(void)
#define TRACE(s)
Definition: solgame.cpp:4
static IDxDiagProviderImpl * impl_from_IDxDiagProvider(IDxDiagProvider *iface)
Definition: provider.c:109
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ IDxDiagProviderImpl_GetRootContainer()

static HRESULT WINAPI IDxDiagProviderImpl_GetRootContainer ( IDxDiagProvider *  iface,
IDxDiagContainer **  ppInstance 
)
static

Definition at line 192 of file provider.c.

194 {
196 
197  TRACE("(%p,%p)\n", iface, ppInstance);
198 
199  if (FALSE == This->init) {
200  return CO_E_NOTINITIALIZED;
201  }
202 
203  return DXDiag_CreateDXDiagContainer(&IID_IDxDiagContainer, This->info_root,
204  &This->IDxDiagProvider_iface, (void **)ppInstance);
205 }
#define CO_E_NOTINITIALIZED
#define TRACE(s)
Definition: solgame.cpp:4
static IDxDiagProviderImpl * impl_from_IDxDiagProvider(IDxDiagProvider *iface)
Definition: provider.c:109
HRESULT DXDiag_CreateDXDiagContainer(REFIID riid, IDxDiagContainerImpl_Container *cont, IDxDiagProvider *pProv, LPVOID *ppobj)
Definition: container.c:277

◆ IDxDiagProviderImpl_Initialize()

static HRESULT WINAPI IDxDiagProviderImpl_Initialize ( IDxDiagProvider *  iface,
DXDIAG_INIT_PARAMS pParams 
)
static

Definition at line 164 of file provider.c.

166 {
168  HRESULT hr;
169 
170  TRACE("(%p,%p)\n", iface, pParams);
171 
172  if (NULL == pParams) {
173  return E_POINTER;
174  }
175  if (pParams->dwSize != sizeof(DXDIAG_INIT_PARAMS) ||
177  return E_INVALIDARG;
178  }
179 
180  if (!This->info_root)
181  {
182  hr = build_information_tree(&This->info_root);
183  if (FAILED(hr))
184  return hr;
185  }
186 
187  This->init = TRUE;
188  memcpy(&This->params, pParams, pParams->dwSize);
189  return S_OK;
190 }
#define TRUE
Definition: types.h:120
#define DXDIAG_DX9_SDK_VERSION
Definition: dxdiag.h:6
HRESULT hr
Definition: shlfolder.c:183
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static IDxDiagProviderImpl * impl_from_IDxDiagProvider(IDxDiagProvider *iface)
Definition: provider.c:109
DWORD dwDxDiagHeaderVersion
Definition: dxdiag.h:20
static HRESULT build_information_tree(IDxDiagContainerImpl_Container **pinfo_root)
Definition: provider.c:1949
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ IDxDiagProviderImpl_QueryInterface()

static HRESULT WINAPI IDxDiagProviderImpl_QueryInterface ( IDxDiagProvider *  iface,
REFIID  riid,
void **  ppobj 
)
static

Definition at line 115 of file provider.c.

117 {
119 
120  if (!ppobj) return E_INVALIDARG;
121 
123  || IsEqualGUID(riid, &IID_IDxDiagProvider)) {
124  IUnknown_AddRef(iface);
125  *ppobj = This;
126  return S_OK;
127  }
128 
129  WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
130  *ppobj = NULL;
131  return E_NOINTERFACE;
132 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IUnknown
static IDxDiagProviderImpl * impl_from_IDxDiagProvider(IDxDiagProvider *iface)
Definition: provider.c:109
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

Referenced by DXDiag_CreateDXDiagProvider().

◆ IDxDiagProviderImpl_Release()

static ULONG WINAPI IDxDiagProviderImpl_Release ( IDxDiagProvider *  iface)
static

Definition at line 146 of file provider.c.

147 {
149  ULONG refCount = InterlockedDecrement(&This->ref);
150 
151  TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
152 
153  if (!refCount) {
154  free_information_tree(This->info_root);
156  }
157 
159 
160  return refCount;
161 }
static void DXDIAGN_UnlockModule(void)
static void free_information_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:238
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
static IDxDiagProviderImpl * impl_from_IDxDiagProvider(IDxDiagProvider *iface)
Definition: provider.c:109
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ impl_from_IDxDiagProvider()

static IDxDiagProviderImpl* impl_from_IDxDiagProvider ( IDxDiagProvider *  iface)
inlinestatic

Definition at line 109 of file provider.c.

110 {
111  return CONTAINING_RECORD(iface, IDxDiagProviderImpl, IDxDiagProvider_iface);
112 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by IDxDiagProviderImpl_AddRef(), IDxDiagProviderImpl_GetRootContainer(), IDxDiagProviderImpl_Initialize(), IDxDiagProviderImpl_QueryInterface(), and IDxDiagProviderImpl_Release().

◆ is_netmeeting_running()

static BOOL is_netmeeting_running ( void  )
static

Definition at line 484 of file provider.c.

485 {
486  static const WCHAR conf_exe[] = {'c','o','n','f','.','e','x','e',0};
487 
489  DWORD *pid_list = enumerate_processes(&list_count);
490 
491  if (pid_list)
492  {
493  DWORD i;
494  WCHAR process_name[MAX_PATH];
495 
496  for (i = 0; i < list_count; i++)
497  {
498  if (get_process_name_from_pid(pid_list[i], process_name, sizeof(process_name)/sizeof(WCHAR)) &&
499  !lstrcmpW(conf_exe, process_name))
500  {
501  HeapFree(GetProcessHeap(), 0, pid_list);
502  return TRUE;
503  }
504  }
505  HeapFree(GetProcessHeap(), 0, pid_list);
506  }
507 
508  return FALSE;
509 }
#define TRUE
Definition: types.h:120
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static BOOL get_process_name_from_pid(DWORD pid, WCHAR *buf, DWORD chars)
Definition: provider.c:457
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
Definition: list.h:155
static DWORD * enumerate_processes(DWORD *list_count)
Definition: provider.c:416
#define GetProcessHeap()
Definition: compat.h:395
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by