ReactOS 0.4.17-dev-966-gf06eace
provider.c
Go to the documentation of this file.
1/*
2 * IDxDiagProvider Implementation
3 *
4 * Copyright 2004-2005 Raphael Junqueira
5 * Copyright 2010 Andrew Nguyen
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 *
21 */
22
23
24#define COBJMACROS
25#include "dxdiag_private.h"
26#include "winver.h"
27#include "objidl.h"
28#include "uuids.h"
29#include "vfw.h"
30#include "mmddk.h"
31#include "d3d9.h"
32#include "strmif.h"
33#include "initguid.h"
34#include "mmdeviceapi.h"
35#include "wine/fil_data.h"
36#include "psapi.h"
37#include "wbemcli.h"
38#include "dsound.h"
39
40#include "wine/debug.h"
41
43
46
48{
49 IDxDiagProvider IDxDiagProvider_iface;
54};
55
56static inline IDxDiagProviderImpl *impl_from_IDxDiagProvider(IDxDiagProvider *iface)
57{
58 return CONTAINING_RECORD(iface, IDxDiagProviderImpl, IDxDiagProvider_iface);
59}
60
61/* IDxDiagProvider IUnknown parts follow: */
63 void **ppobj)
64{
66
67 if (!ppobj) return E_INVALIDARG;
68
70 || IsEqualGUID(riid, &IID_IDxDiagProvider)) {
71 IUnknown_AddRef(iface);
72 *ppobj = &This->IDxDiagProvider_iface;
73 return S_OK;
74 }
75
76 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
77 *ppobj = NULL;
78 return E_NOINTERFACE;
79}
80
81static ULONG WINAPI IDxDiagProviderImpl_AddRef(IDxDiagProvider *iface)
82{
84 ULONG refCount = InterlockedIncrement(&This->ref);
85
86 TRACE("(%p)->(ref before=%lu)\n", This, refCount - 1);
87
89
90 return refCount;
91}
92
93static ULONG WINAPI IDxDiagProviderImpl_Release(IDxDiagProvider *iface)
94{
96 ULONG refCount = InterlockedDecrement(&This->ref);
97
98 TRACE("(%p)->(ref before=%lu)\n", This, refCount + 1);
99
100 if (!refCount) {
101 free_information_tree(This->info_root);
103 }
104
106
107 return refCount;
108}
109
110/* IDxDiagProvider Interface follow: */
111static HRESULT WINAPI IDxDiagProviderImpl_Initialize(IDxDiagProvider *iface,
112 DXDIAG_INIT_PARAMS *pParams)
113{
115 HRESULT hr;
116
117 TRACE("(%p,%p)\n", iface, pParams);
118
119 if (NULL == pParams) {
120 return E_POINTER;
121 }
122 if (pParams->dwSize != sizeof(DXDIAG_INIT_PARAMS) ||
124 return E_INVALIDARG;
125 }
126
127 if (!This->info_root)
128 {
129 hr = build_information_tree(&This->info_root);
130 if (FAILED(hr))
131 return hr;
132 }
133
134 This->init = TRUE;
135 memcpy(&This->params, pParams, pParams->dwSize);
136 return S_OK;
137}
138
140 IDxDiagContainer **ppInstance)
141{
143
144 TRACE("(%p,%p)\n", iface, ppInstance);
145
146 if (FALSE == This->init) {
147 return CO_E_NOTINITIALIZED;
148 }
149
150 return DXDiag_CreateDXDiagContainer(&IID_IDxDiagContainer, This->info_root,
151 &This->IDxDiagProvider_iface, (void **)ppInstance);
152}
153
154static const IDxDiagProviderVtbl DxDiagProvider_Vtbl =
155{
161};
162
163HRESULT DXDiag_CreateDXDiagProvider(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) {
164 IDxDiagProviderImpl* provider;
165
166 TRACE("(%p, %s, %p)\n", punkOuter, debugstr_guid(riid), ppobj);
167
168 *ppobj = NULL;
169 if (punkOuter) return CLASS_E_NOAGGREGATION;
170
172 if (NULL == provider) return E_OUTOFMEMORY;
173 provider->IDxDiagProvider_iface.lpVtbl = &DxDiagProvider_Vtbl;
174 provider->ref = 0; /* will be inited with QueryInterface */
176}
177
179{
180 VariantClear(&prop->vProp);
181 HeapFree(GetProcessHeap(), 0, prop->propName);
182 HeapFree(GetProcessHeap(), 0, prop);
183}
184
186{
188
189 if (!node)
190 return;
191
192 HeapFree(GetProcessHeap(), 0, node->contName);
193
195 {
196 IDxDiagContainerImpl_Property *prop, *prop_cursor2;
197
198 LIST_FOR_EACH_ENTRY_SAFE(prop, prop_cursor2, &ptr->properties, IDxDiagContainerImpl_Property, entry)
199 {
200 list_remove(&prop->entry);
202 }
203
204 list_remove(&ptr->entry);
206 }
207
209}
210
212{
214
216 if (!ret)
217 return NULL;
218
219 if (name)
220 {
221 ret->contName = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(name) + 1) * sizeof(*name));
222 if (!ret->contName)
223 {
225 return NULL;
226 }
227 lstrcpyW(ret->contName, name);
228 }
229
230 list_init(&ret->subContainers);
231 list_init(&ret->properties);
232
233 return ret;
234}
235
237{
239
241 if (!ret)
242 return NULL;
243
244 ret->propName = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(name) + 1) * sizeof(*name));
245 if (!ret->propName)
246 {
248 return NULL;
249 }
250 lstrcpyW(ret->propName, name);
251
252 return ret;
253}
254
256{
257 list_add_tail(&node->subContainers, &subCont->entry);
258 ++node->nSubContainers;
259}
260
262{
264 BSTR bstr;
265
266 prop = allocate_property_information(propName);
267 if (!prop)
268 return E_OUTOFMEMORY;
269
270 bstr = SysAllocString(str);
271 if (!bstr)
272 {
274 return E_OUTOFMEMORY;
275 }
276
277 V_VT(&prop->vProp) = VT_BSTR;
278 V_BSTR(&prop->vProp) = bstr;
279
280 list_add_tail(&node->properties, &prop->entry);
281 ++node->nProperties;
282
283 return S_OK;
284}
285
287{
289
290 prop = allocate_property_information(propName);
291 if (!prop)
292 return E_OUTOFMEMORY;
293
294 V_VT(&prop->vProp) = VT_UI4;
295 V_UI4(&prop->vProp) = data;
296
297 list_add_tail(&node->properties, &prop->entry);
298 ++node->nProperties;
299
300 return S_OK;
301}
302
304{
306
307 prop = allocate_property_information(propName);
308 if (!prop)
309 return E_OUTOFMEMORY;
310
311 V_VT(&prop->vProp) = VT_I4;
312 V_I4(&prop->vProp) = data;
313
314 list_add_tail(&node->properties, &prop->entry);
315 ++node->nProperties;
316
317 return S_OK;
318}
319
321{
323
324 prop = allocate_property_information(propName);
325 if (!prop)
326 return E_OUTOFMEMORY;
327
328 V_VT(&prop->vProp) = VT_BOOL;
329 V_BOOL(&prop->vProp) = data ? VARIANT_TRUE : VARIANT_FALSE;
330
331 list_add_tail(&node->properties, &prop->entry);
332 ++node->nProperties;
333
334 return S_OK;
335}
336
338{
340 HRESULT hr;
341
342 prop = allocate_property_information(propName);
343 if (!prop)
344 return E_OUTOFMEMORY;
345
346 V_VT(&prop->vProp) = VT_UI8;
347 V_UI8(&prop->vProp) = data;
348
349 hr = VariantChangeType(&prop->vProp, &prop->vProp, 0, VT_BSTR);
350 if (FAILED(hr))
351 {
353 return hr;
354 }
355
356 list_add_tail(&node->properties, &prop->entry);
357 ++node->nProperties;
358
359 return S_OK;
360}
361
362/* Copied from programs/taskkill/taskkill.c. */
364{
365 DWORD *pid_list, alloc_bytes = 1024 * sizeof(*pid_list), needed_bytes;
366
367 pid_list = HeapAlloc(GetProcessHeap(), 0, alloc_bytes);
368 if (!pid_list)
369 return NULL;
370
371 for (;;)
372 {
373 DWORD *realloc_list;
374
375 if (!EnumProcesses(pid_list, alloc_bytes, &needed_bytes))
376 {
377 HeapFree(GetProcessHeap(), 0, pid_list);
378 return NULL;
379 }
380
381 /* EnumProcesses can't signal an insufficient buffer condition, so the
382 * only way to possibly determine whether a larger buffer is required
383 * is to see whether the written number of bytes is the same as the
384 * buffer size. If so, the buffer will be reallocated to twice the
385 * size. */
386 if (alloc_bytes != needed_bytes)
387 break;
388
389 alloc_bytes *= 2;
390 realloc_list = HeapReAlloc(GetProcessHeap(), 0, pid_list, alloc_bytes);
391 if (!realloc_list)
392 {
393 HeapFree(GetProcessHeap(), 0, pid_list);
394 return NULL;
395 }
396 pid_list = realloc_list;
397 }
398
399 *list_count = needed_bytes / sizeof(*pid_list);
400 return pid_list;
401}
402
403/* Copied from programs/taskkill/taskkill.c. */
405{
408 DWORD required_size;
409
411 if (!process)
412 return FALSE;
413
414 if (!EnumProcessModules(process, &module, sizeof(module), &required_size))
415 {
417 return FALSE;
418 }
419
420 if (!GetModuleBaseNameW(process, module, buf, chars))
421 {
423 return FALSE;
424 }
425
427 return TRUE;
428}
429
430/* dxdiagn's detection scheme is simply to look for a process called conf.exe. */
432{
435
436 if (pid_list)
437 {
438 DWORD i;
439 WCHAR process_name[MAX_PATH];
440
441 for (i = 0; i < list_count; i++)
442 {
443 if (get_process_name_from_pid(pid_list[i], process_name, ARRAY_SIZE(process_name)) &&
444 !lstrcmpW(L"conf.exe", process_name))
445 {
446 HeapFree(GetProcessHeap(), 0, pid_list);
447 return TRUE;
448 }
449 }
450 HeapFree(GetProcessHeap(), 0, pid_list);
451 }
452
453 return FALSE;
454}
455
457{
458 WCHAR system_lang[80], regional_setting[100], user_lang[80], language_str[300];
459 HRESULT hr;
460
461 /* szLanguagesLocalized */
463 LoadStringW(dxdiagn_instance, IDS_REGIONAL_SETTING, regional_setting, ARRAY_SIZE(regional_setting));
465
466 swprintf(language_str, ARRAY_SIZE(language_str), L"%s (%s: %s)", system_lang, regional_setting,
467 user_lang);
468
469 hr = add_bstr_property(node, L"szLanguagesLocalized", language_str);
470 if (FAILED(hr))
471 return hr;
472
473 /* szLanguagesEnglish */
476
477 swprintf(language_str, ARRAY_SIZE(language_str), L"%s (%s: %s)", system_lang,
478 L"Regional Setting", user_lang);
479
480 hr = add_bstr_property(node, L"szLanguagesEnglish", language_str);
481 if (FAILED(hr))
482 return hr;
483
484 return S_OK;
485}
486
488{
489 SYSTEMTIME curtime;
490 WCHAR date_str[80], time_str[80], datetime_str[200];
491 HRESULT hr;
492
493 GetLocalTime(&curtime);
494
495 GetTimeFormatW(LOCALE_NEUTRAL, 0, &curtime, L"HH':'mm':'ss", time_str, ARRAY_SIZE(time_str));
496
497 /* szTimeLocalized */
498 GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &curtime, NULL, date_str, ARRAY_SIZE(date_str));
499
500 swprintf(datetime_str, ARRAY_SIZE(datetime_str), L"%s, %s", date_str, time_str);
501
502 hr = add_bstr_property(node, L"szTimeLocalized", datetime_str);
503 if (FAILED(hr))
504 return hr;
505
506 /* szTimeEnglish */
507 GetDateFormatW(LOCALE_NEUTRAL, 0, &curtime, L"M'/'d'/'yyyy", date_str, ARRAY_SIZE(date_str));
508
509 swprintf(datetime_str, ARRAY_SIZE(datetime_str), L"%s, %s", date_str, time_str);
510
511 hr = add_bstr_property(node, L"szTimeEnglish", datetime_str);
512 if (FAILED(hr))
513 return hr;
514
515 return S_OK;
516}
517
519{
520 static const WCHAR *prop_list[] =
521 {
522 L"szOSLocalized", L"szOSExLocalized", L"szOSExLongLocalized",
523 L"szOSEnglish", L"szOSExEnglish", L"szOSExLongEnglish"
524 };
525 size_t i;
526 HRESULT hr;
527
528 /* FIXME: OS detection should be performed, and localized OS strings
529 * should contain translated versions of the "build" phrase. */
530 for (i = 0; i < ARRAY_SIZE(prop_list); i++)
531 {
532 hr = add_bstr_property(node, prop_list[i], L"Windows XP Professional");
533 if (FAILED(hr))
534 return hr;
535 }
536
537 return S_OK;
538}
539
541{
543 IWbemServices *wbem_service;
544 IWbemClassObject *wbem_class;
545 IEnumWbemClassObject *wbem_enum;
546 VARIANT cpu_name, cpu_no, clock_speed;
547 WCHAR print_buf[200];
548 BSTR bstr;
549 ULONG no;
550 HRESULT hr;
551
552 hr = CoCreateInstance(&CLSID_WbemLocator, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemLocator, (void**)&wbem_locator);
553 if(FAILED(hr))
554 return hr;
555
556 bstr = SysAllocString(L"\\\\.\\root\\cimv2");
557 if(!bstr) {
558 IWbemLocator_Release(wbem_locator);
559 return E_OUTOFMEMORY;
560 }
561 hr = IWbemLocator_ConnectServer(wbem_locator, bstr, NULL, NULL, NULL, 0, NULL, NULL, &wbem_service);
562 IWbemLocator_Release(wbem_locator);
563 SysFreeString(bstr);
564 if(FAILED(hr))
565 return hr;
566
567 bstr = SysAllocString(L"Win32_Processor");
568 if(!bstr) {
569 IWbemServices_Release(wbem_service);
570 return E_OUTOFMEMORY;
571 }
572 hr = IWbemServices_CreateInstanceEnum(wbem_service, bstr, WBEM_FLAG_SYSTEM_ONLY, NULL, &wbem_enum);
573 IWbemServices_Release(wbem_service);
574 SysFreeString(bstr);
575 if(FAILED(hr))
576 return hr;
577
578 hr = IEnumWbemClassObject_Next(wbem_enum, 1000, 1, &wbem_class, &no);
579 IEnumWbemClassObject_Release(wbem_enum);
580 if(FAILED(hr))
581 return hr;
582
583 hr = IWbemClassObject_Get(wbem_class, L"NumberOfLogicalProcessors", 0, &cpu_no, NULL, NULL);
584 if(FAILED(hr)) {
585 IWbemClassObject_Release(wbem_class);
586 return hr;
587 }
588 hr = IWbemClassObject_Get(wbem_class, L"MaxClockSpeed", 0, &clock_speed, NULL, NULL);
589 if(FAILED(hr)) {
590 IWbemClassObject_Release(wbem_class);
591 return hr;
592 }
593 hr = IWbemClassObject_Get(wbem_class, L"Name", 0, &cpu_name, NULL, NULL);
594 IWbemClassObject_Release(wbem_class);
595 if(FAILED(hr))
596 return hr;
597
598 swprintf(print_buf, ARRAY_SIZE(print_buf), L"%s(%d CPUs), ~%dMHz",
599 V_BSTR(&cpu_name), V_I4(&cpu_no), V_I4(&clock_speed));
600 VariantClear(&cpu_name);
601 VariantClear(&cpu_no);
602 VariantClear(&clock_speed);
603
604 return add_bstr_property(node, L"szProcessorEnglish", print_buf);
605}
606
608{
609 HRESULT hr;
610 MEMORYSTATUSEX msex;
612 DWORD count, usedpage_mb, availpage_mb;
613 WCHAR buffer[MAX_PATH], computer_name[MAX_COMPUTERNAME_LENGTH + 1], print_buf[200], localized_pagefile_fmt[200];
614 DWORD_PTR args[2];
615
616 hr = add_ui4_property(node, L"dwDirectXVersionMajor", 9);
617 if (FAILED(hr))
618 return hr;
619
620 hr = add_ui4_property(node, L"dwDirectXVersionMinor", 0);
621 if (FAILED(hr))
622 return hr;
623
624 hr = add_bstr_property(node, L"szDirectXVersionLetter", L"c");
625 if (FAILED(hr))
626 return hr;
627
628 hr = add_bstr_property(node, L"szDirectXVersionEnglish", L"4.09.0000.0904");
629 if (FAILED(hr))
630 return hr;
631
632 hr = add_bstr_property(node, L"szDirectXVersionLongEnglish", L"= \"DirectX 9.0c (4.09.0000.0904)");
633 if (FAILED(hr))
634 return hr;
635
636 hr = add_bool_property(node, L"bDebug", FALSE);
637 if (FAILED(hr))
638 return hr;
639
640 hr = add_bool_property(node, L"bIsD3DDebugRuntime", FALSE);
641 if (FAILED(hr))
642 return hr;
643
644 hr = add_bool_property(node, L"bNECPC98", FALSE);
645 if (FAILED(hr))
646 return hr;
647
648 msex.dwLength = sizeof(msex);
650
651 hr = add_ull_as_bstr_property(node, L"ullPhysicalMemory", msex.ullTotalPhys);
652 if (FAILED(hr))
653 return hr;
654
655 hr = add_ull_as_bstr_property(node, L"ullUsedPageFile", msex.ullTotalPageFile - msex.ullAvailPageFile);
656 if (FAILED(hr))
657 return hr;
658
659 hr = add_ull_as_bstr_property(node, L"ullAvailPageFile", msex.ullAvailPageFile);
660 if (FAILED(hr))
661 return hr;
662
663 hr = add_bool_property(node, L"bNetMeetingRunning", is_netmeeting_running());
664 if (FAILED(hr))
665 return hr;
666
667 info.dwOSVersionInfoSize = sizeof(info);
669
670 hr = add_ui4_property(node, L"dwOSMajorVersion", info.dwMajorVersion);
671 if (FAILED(hr))
672 return hr;
673
674 hr = add_ui4_property(node, L"dwOSMinorVersion", info.dwMinorVersion);
675 if (FAILED(hr))
676 return hr;
677
678 hr = add_ui4_property(node, L"dwOSBuildNumber", info.dwBuildNumber);
679 if (FAILED(hr))
680 return hr;
681
682 hr = add_ui4_property(node, L"dwOSPlatformID", info.dwPlatformId);
683 if (FAILED(hr))
684 return hr;
685
686 hr = add_bstr_property(node, L"szCSDVersion", info.szCSDVersion);
687 if (FAILED(hr))
688 return hr;
689
690 /* FIXME: Roundoff should not be done with truncated division. */
691 swprintf(print_buf, ARRAY_SIZE(print_buf), L"%I64uMB RAM", msex.ullTotalPhys / (1024 * 1024));
692 hr = add_bstr_property(node, L"szPhysicalMemoryEnglish", print_buf);
693 if (FAILED(hr))
694 return hr;
695
696 usedpage_mb = (DWORD)((msex.ullTotalPageFile - msex.ullAvailPageFile) / (1024 * 1024));
697 availpage_mb = (DWORD)(msex.ullAvailPageFile / (1024 * 1024));
698 LoadStringW(dxdiagn_instance, IDS_PAGE_FILE_FORMAT, localized_pagefile_fmt,
699 ARRAY_SIZE(localized_pagefile_fmt));
700 args[0] = usedpage_mb;
701 args[1] = availpage_mb;
703 0, 0, print_buf, ARRAY_SIZE(print_buf), (va_list *)args);
704
705 hr = add_bstr_property(node, L"szPageFileLocalized", print_buf);
706 if (FAILED(hr))
707 return hr;
708
709 swprintf(print_buf, ARRAY_SIZE(print_buf), L"%uMB used, %uMB available", usedpage_mb, availpage_mb);
710
711 hr = add_bstr_property(node, L"szPageFileEnglish", print_buf);
712 if (FAILED(hr))
713 return hr;
714
716
717 hr = add_bstr_property(node, L"szWindowsDir", buffer);
718 if (FAILED(hr))
719 return hr;
720
723 return E_FAIL;
724
725 hr = add_bstr_property(node, L"szMachineNameLocalized", computer_name);
726 if (FAILED(hr))
727 return hr;
728
729 hr = add_bstr_property(node, L"szMachineNameEnglish", computer_name);
730 if (FAILED(hr))
731 return hr;
732
733 hr = add_bstr_property(node, L"szSystemManufacturerEnglish", L"");
734 if (FAILED(hr))
735 return hr;
736
737 hr = add_bstr_property(node, L"szSystemModelEnglish", L"");
738 if (FAILED(hr))
739 return hr;
740
741 hr = add_bstr_property(node, L"szBIOSEnglish", L"");
742 if (FAILED(hr))
743 return hr;
744
746 if (FAILED(hr))
747 return hr;
748
749 hr = add_bstr_property(node, L"szSetupParamEnglish", L"Not present");
750 if (FAILED(hr))
751 return hr;
752
753 hr = add_bstr_property(node, L"szDxDiagVersion", L"");
754 if (FAILED(hr))
755 return hr;
756
758 if (FAILED(hr))
759 return hr;
760
762 if (FAILED(hr))
763 return hr;
764
766 if (FAILED(hr))
767 return hr;
768
769 return S_OK;
770}
771
772/* The logic from pixelformat_for_depth() in dlls/wined3d/utils.c is reversed. */
774{
775 switch (format)
776 {
777 case D3DFMT_P8: return 8;
778 case D3DFMT_X1R5G5B5: return 15;
779 case D3DFMT_R5G6B5: return 16;
780 /* This case will fail to distinguish an original bpp of 24. */
781 case D3DFMT_X8R8G8B8: return 32;
782 default:
783 FIXME("Unknown D3DFORMAT %d, returning 32 bpp\n", format);
784 return 32;
785 }
786}
787
788static BOOL get_texture_memory(GUID *adapter, DWORD *available_mem)
789{
790 IDirectDraw7 *pDirectDraw;
791 HRESULT hr;
792 DDSCAPS2 dd_caps;
793
794 hr = DirectDrawCreateEx(adapter, (void **)&pDirectDraw, &IID_IDirectDraw7, NULL);
795 if (SUCCEEDED(hr))
796 {
798 dd_caps.dwCaps2 = dd_caps.dwCaps3 = dd_caps.dwCaps4 = 0;
799 hr = IDirectDraw7_GetAvailableVidMem(pDirectDraw, &dd_caps, available_mem, NULL);
800 IDirectDraw7_Release(pDirectDraw);
801 if (SUCCEEDED(hr))
802 return TRUE;
803 }
804
805 return FALSE;
806}
807
809{
810 unsigned int i;
811 static const struct
812 {
813 DWORD id;
814 const WCHAR *name;
815 }
816 vendors[] =
817 {
818 {0x1002, L"ATI Technologies Inc."},
819 {0x10de, L"NVIDIA"},
820 {0x15ad, L"VMware"},
821 {0x1af4, L"Red Hat"},
822 {0x8086, L"Intel Corporation"},
823 };
824
825 for (i = 0; i < ARRAY_SIZE(vendors); ++i)
826 {
827 if (vendors[i].id == vendor_id)
828 return vendors[i].name;
829 }
830
831 FIXME("Unknown PCI vendor ID 0x%04lx.\n", vendor_id);
832
833 return L"Unknown";
834}
835
837{
838 IDxDiagContainerImpl_Container *display_adapter;
839 HRESULT hr;
840 IDirect3D9 *pDirect3D9;
841 WCHAR buffer[256];
843
844 pDirect3D9 = Direct3DCreate9(D3D_SDK_VERSION);
845 if (!pDirect3D9)
846 return E_FAIL;
847
848 count = IDirect3D9_GetAdapterCount(pDirect3D9);
849 for (index = 0; index < count; index++)
850 {
851 D3DADAPTER_IDENTIFIER9 adapter_info;
852 D3DDISPLAYMODE adapter_mode;
853 D3DCAPS9 device_caps;
854 DWORD available_mem = 0;
855 BOOL hardware_accel;
856
858 display_adapter = allocate_information_node(buffer);
859 if (!display_adapter)
860 {
862 goto cleanup;
863 }
864
865 add_subcontainer(node, display_adapter);
866
867 hr = IDirect3D9_GetAdapterIdentifier(pDirect3D9, index, 0, &adapter_info);
868 if (SUCCEEDED(hr))
869 {
870 WCHAR driverW[sizeof(adapter_info.Driver)];
871 WCHAR descriptionW[sizeof(adapter_info.Description)];
872 WCHAR devicenameW[sizeof(adapter_info.DeviceName)];
873
875 MultiByteToWideChar(CP_ACP, 0, adapter_info.Description, -1, descriptionW,
876 ARRAY_SIZE(descriptionW));
877 MultiByteToWideChar(CP_ACP, 0, adapter_info.DeviceName, -1, devicenameW,
878 ARRAY_SIZE(devicenameW));
879
880 hr = add_bstr_property(display_adapter, L"szDriverName", driverW);
881 if (FAILED(hr))
882 goto cleanup;
883
884 hr = add_bstr_property(display_adapter, L"szDescription", descriptionW);
885 if (FAILED(hr))
886 goto cleanup;
887
888 hr = add_bstr_property(display_adapter, L"szDeviceName", devicenameW);
889 if (FAILED(hr))
890 goto cleanup;
891
892 swprintf(buffer, ARRAY_SIZE(buffer), L"%u.%u.%04u.%04u",
893 HIWORD(adapter_info.DriverVersion.HighPart), LOWORD(adapter_info.DriverVersion.HighPart),
894 HIWORD(adapter_info.DriverVersion.LowPart), LOWORD(adapter_info.DriverVersion.LowPart));
895
896 hr = add_bstr_property(display_adapter, L"szDriverVersion", buffer);
897 if (FAILED(hr))
898 goto cleanup;
899
900 swprintf(buffer, ARRAY_SIZE(buffer), L"0x%04x", adapter_info.VendorId);
901 hr = add_bstr_property(display_adapter, L"szVendorId", buffer);
902 if (FAILED(hr))
903 goto cleanup;
904
905 swprintf(buffer, ARRAY_SIZE(buffer), L"0x%04x", adapter_info.DeviceId);
906 hr = add_bstr_property(display_adapter, L"szDeviceId", buffer);
907 if (FAILED(hr))
908 goto cleanup;
909
910 swprintf(buffer, ARRAY_SIZE(buffer), L"0x%08x", adapter_info.SubSysId);
911 hr = add_bstr_property(display_adapter, L"szSubSysId", buffer);
912 if (FAILED(hr))
913 goto cleanup;
914
915 swprintf(buffer, ARRAY_SIZE(buffer), L"0x%04x", adapter_info.Revision);
916 hr = add_bstr_property(display_adapter, L"szRevisionId", buffer);
917 if (FAILED(hr))
918 goto cleanup;
919
920 StringFromGUID2(&adapter_info.DeviceIdentifier, buffer, 39);
921 hr = add_bstr_property(display_adapter, L"szDeviceIdentifier", buffer);
922 if (FAILED(hr))
923 goto cleanup;
924
925 hr = add_bstr_property(display_adapter, L"szManufacturer",
927 if (FAILED(hr))
928 goto cleanup;
929 }
930
931 hr = IDirect3D9_GetAdapterDisplayMode(pDirect3D9, index, &adapter_mode);
932 if (SUCCEEDED(hr))
933 {
934 hr = add_ui4_property(display_adapter, L"dwWidth", adapter_mode.Width);
935 if (FAILED(hr))
936 goto cleanup;
937
938 hr = add_ui4_property(display_adapter, L"dwHeight", adapter_mode.Height);
939 if (FAILED(hr))
940 goto cleanup;
941
942 hr = add_ui4_property(display_adapter, L"dwRefreshRate", adapter_mode.RefreshRate);
943 if (FAILED(hr))
944 goto cleanup;
945
946 hr = add_ui4_property(display_adapter, L"dwBpp", depth_for_pixelformat(adapter_mode.Format));
947 if (FAILED(hr))
948 goto cleanup;
949
950 swprintf(buffer, ARRAY_SIZE(buffer), L"%d x %d (%d bit) (%dHz)", adapter_mode.Width,
951 adapter_mode.Height, depth_for_pixelformat(adapter_mode.Format),
952 adapter_mode.RefreshRate);
953
954 hr = add_bstr_property(display_adapter, L"szDisplayModeLocalized", buffer);
955 if (FAILED(hr))
956 goto cleanup;
957
958 hr = add_bstr_property(display_adapter, L"szDisplayModeEnglish", buffer);
959 if (FAILED(hr))
960 goto cleanup;
961 }
962
963 hr = add_bstr_property(display_adapter, L"szKeyDeviceKey", L"");
964 if (FAILED(hr))
965 goto cleanup;
966
967 hr = add_bstr_property(display_adapter, L"szKeyDeviceID", L"");
968 if (FAILED(hr))
969 goto cleanup;
970
971 hr = add_bstr_property(display_adapter, L"szChipType", L"");
972 if (FAILED(hr))
973 goto cleanup;
974
975 hr = add_bstr_property(display_adapter, L"szDACType", L"");
976 if (FAILED(hr))
977 goto cleanup;
978
979 hr = add_bstr_property(display_adapter, L"szRevision", L"");
980 if (FAILED(hr))
981 goto cleanup;
982
983 if (!get_texture_memory(&adapter_info.DeviceIdentifier, &available_mem))
984 WARN("get_texture_memory helper failed\n");
985
986 swprintf(buffer, ARRAY_SIZE(buffer), L"%.1f MB", available_mem / 1000000.0f);
987
988 hr = add_bstr_property(display_adapter, L"szDisplayMemoryLocalized", buffer);
989 if (FAILED(hr))
990 goto cleanup;
991
992 hr = add_bstr_property(display_adapter, L"szDisplayMemoryEnglish", buffer);
993 if (FAILED(hr))
994 goto cleanup;
995
996 hr = IDirect3D9_GetDeviceCaps(pDirect3D9, index, D3DDEVTYPE_HAL, &device_caps);
997 hardware_accel = SUCCEEDED(hr);
998
999 hr = add_bool_property(display_adapter, L"b3DAccelerationEnabled", hardware_accel);
1000 if (FAILED(hr))
1001 goto cleanup;
1002
1003 hr = add_bool_property(display_adapter, L"b3DAccelerationExists", hardware_accel);
1004 if (FAILED(hr))
1005 goto cleanup;
1006
1007 hr = add_bool_property(display_adapter, L"bAGPEnabled", hardware_accel);
1008 if (FAILED(hr))
1009 goto cleanup;
1010
1011 hr = add_bool_property(display_adapter, L"bAGPExistenceValid", hardware_accel);
1012 if (FAILED(hr))
1013 goto cleanup;
1014
1015 hr = add_bool_property(display_adapter, L"bAGPExists", hardware_accel);
1016 if (FAILED(hr))
1017 goto cleanup;
1018
1019 hr = add_bool_property(display_adapter, L"bDDAccelerationEnabled", hardware_accel);
1020 if (FAILED(hr))
1021 goto cleanup;
1022
1023 hr = add_bool_property(display_adapter, L"bNoHardware", FALSE);
1024 if (FAILED(hr))
1025 goto cleanup;
1026
1027 hr = add_bool_property(display_adapter, L"bCanRenderWindow", TRUE);
1028 if (FAILED(hr))
1029 goto cleanup;
1030
1031 hr = add_bstr_property(display_adapter, L"szMonitorName", L"Generic PnP Monitor");
1032 if (FAILED(hr))
1033 goto cleanup;
1034
1035 hr = add_bstr_property(display_adapter, L"szMonitorMaxRes", L"Failed to get parameter");
1036 if (FAILED(hr))
1037 goto cleanup;
1038
1039 hr = add_bstr_property(display_adapter, L"szDriverAttributes", L"Final Retail");
1040 if (FAILED(hr))
1041 goto cleanup;
1042
1043 hr = add_bstr_property(display_adapter, L"szDriverLanguageEnglish", L"English");
1044 if (FAILED(hr))
1045 goto cleanup;
1046
1047 hr = add_bstr_property(display_adapter, L"szDriverLanguageLocalized", L"English");
1048 if (FAILED(hr))
1049 goto cleanup;
1050
1051 hr = add_bstr_property(display_adapter, L"szDriverDateEnglish", L"1/1/2016 10:00:00");
1052 if (FAILED(hr))
1053 goto cleanup;
1054
1055 hr = add_bstr_property(display_adapter, L"szDriverDateLocalized", L"1/1/2016 10:00:00 AM");
1056 if (FAILED(hr))
1057 goto cleanup;
1058
1059 hr = add_i4_property(display_adapter, L"lDriverSize", 10 * 1024 * 1024);
1060 if (FAILED(hr))
1061 goto cleanup;
1062
1063 hr = add_bstr_property(display_adapter, L"szMiniVdd", L"n/a");
1064 if (FAILED(hr))
1065 goto cleanup;
1066
1067 hr = add_bstr_property(display_adapter, L"szMiniVddDateLocalized", L"n/a");
1068 if (FAILED(hr))
1069 goto cleanup;
1070
1071 hr = add_bstr_property(display_adapter, L"szMiniVddDateEnglish", L"n/a");
1072 if (FAILED(hr))
1073 goto cleanup;
1074
1075 hr = add_i4_property(display_adapter, L"lMiniVddSize", 0);
1076 if (FAILED(hr))
1077 goto cleanup;
1078
1079 hr = add_bstr_property(display_adapter, L"szVdd", L"n/a");
1080 if (FAILED(hr))
1081 goto cleanup;
1082
1083 hr = add_bool_property(display_adapter, L"bDriverBeta", FALSE);
1084 if (FAILED(hr))
1085 goto cleanup;
1086
1087 hr = add_bool_property(display_adapter, L"bDriverDebug", FALSE);
1088 if (FAILED(hr))
1089 goto cleanup;
1090
1091 hr = add_bool_property(display_adapter, L"bDriverSigned", TRUE);
1092 if (FAILED(hr))
1093 goto cleanup;
1094
1095 hr = add_bool_property(display_adapter, L"bDriverSignedValid", TRUE);
1096 if (FAILED(hr))
1097 goto cleanup;
1098
1099 hr = add_bstr_property(display_adapter, L"szDriverSignDate", L"n/a");
1100 if (FAILED(hr))
1101 goto cleanup;
1102
1103 hr = add_ui4_property(display_adapter, L"dwDDIVersion", 11);
1104 if (FAILED(hr))
1105 goto cleanup;
1106
1107 hr = add_bstr_property(display_adapter, L"szDDIVersionEnglish", L"11");
1108 if (FAILED(hr))
1109 goto cleanup;
1110
1111 hr = add_bstr_property(display_adapter, L"szDDIVersionLocalized", L"11");
1112 if (FAILED(hr))
1113 goto cleanup;
1114
1115 hr = add_ui4_property(display_adapter, L"iAdapter", index);
1116 if (FAILED(hr))
1117 goto cleanup;
1118
1119 hr = add_ui4_property(display_adapter, L"dwWHQLLevel", 0);
1120 if (FAILED(hr))
1121 goto cleanup;
1122 }
1123
1124 hr = S_OK;
1125cleanup:
1126 IDirect3D9_Release(pDirect3D9);
1127 return hr;
1128}
1129
1131{
1132 static const WCHAR *empty_properties[] =
1133 {
1134 L"szDeviceIdentifier", L"szVendorId", L"szDeviceId", L"szKeyDeviceKey",
1135 L"szKeyDeviceID", L"szDriverName", L"szDriverVersion", L"szSubSysId",
1136 L"szRevisionId", L"szManufacturer", L"szChipType", L"szDACType", L"szRevision"
1137 };
1138
1139 IDxDiagContainerImpl_Container *display_adapter;
1140 HRESULT hr;
1141 IDirectDraw7 *pDirectDraw;
1142 DDSCAPS2 dd_caps;
1143 DISPLAY_DEVICEW disp_dev;
1144 DDSURFACEDESC2 surface_descr;
1145 DWORD tmp;
1146 WCHAR buffer[256];
1147
1148 display_adapter = allocate_information_node(L"0");
1149 if (!display_adapter)
1150 return E_OUTOFMEMORY;
1151
1152 add_subcontainer(node, display_adapter);
1153
1154 disp_dev.cb = sizeof(disp_dev);
1155 if (EnumDisplayDevicesW( NULL, 0, &disp_dev, 0 ))
1156 {
1157 hr = add_bstr_property(display_adapter, L"szDeviceName", disp_dev.DeviceName);
1158 if (FAILED(hr))
1159 return hr;
1160
1161 hr = add_bstr_property(display_adapter, L"szDescription", disp_dev.DeviceString);
1162 if (FAILED(hr))
1163 return hr;
1164 }
1165
1166 /* Silently ignore a failure from DirectDrawCreateEx. */
1167 hr = DirectDrawCreateEx(NULL, (void **)&pDirectDraw, &IID_IDirectDraw7, NULL);
1168 if (FAILED(hr))
1169 return S_OK;
1170
1172 dd_caps.dwCaps2 = dd_caps.dwCaps3 = dd_caps.dwCaps4 = 0;
1173 hr = IDirectDraw7_GetAvailableVidMem(pDirectDraw, &dd_caps, &tmp, NULL);
1174 if (SUCCEEDED(hr))
1175 {
1176 swprintf(buffer, ARRAY_SIZE(buffer), L"%.1f MB", tmp / 1000000.0f);
1177
1178 hr = add_bstr_property(display_adapter, L"szDisplayMemoryLocalized", buffer);
1179 if (FAILED(hr))
1180 goto cleanup;
1181
1182 hr = add_bstr_property(display_adapter, L"szDisplayMemoryEnglish", buffer);
1183 if (FAILED(hr))
1184 goto cleanup;
1185 }
1186
1187 surface_descr.dwSize = sizeof(surface_descr);
1188 hr = IDirectDraw7_GetDisplayMode(pDirectDraw, &surface_descr);
1189 if (SUCCEEDED(hr))
1190 {
1191 if (surface_descr.dwFlags & DDSD_WIDTH)
1192 {
1193 hr = add_ui4_property(display_adapter, L"dwWidth", surface_descr.dwWidth);
1194 if (FAILED(hr))
1195 goto cleanup;
1196 }
1197
1198 if (surface_descr.dwFlags & DDSD_HEIGHT)
1199 {
1200 hr = add_ui4_property(display_adapter, L"dwHeight", surface_descr.dwHeight);
1201 if (FAILED(hr))
1202 goto cleanup;
1203 }
1204
1205 if (surface_descr.dwFlags & DDSD_PIXELFORMAT)
1206 {
1207 hr = add_ui4_property(display_adapter, L"dwBpp",
1208 surface_descr.ddpfPixelFormat.dwRGBBitCount);
1209 if (FAILED(hr))
1210 goto cleanup;
1211 }
1212 }
1213
1214 hr = add_ui4_property(display_adapter, L"dwRefreshRate", 60);
1215 if (FAILED(hr))
1216 goto cleanup;
1217
1218 for (tmp = 0; tmp < ARRAY_SIZE(empty_properties); tmp++)
1219 {
1220 hr = add_bstr_property(display_adapter, empty_properties[tmp], L"");
1221 if (FAILED(hr))
1222 goto cleanup;
1223 }
1224
1225 hr = S_OK;
1226cleanup:
1227 IDirectDraw7_Release(pDirectDraw);
1228 return hr;
1229}
1230
1232{
1233 HRESULT hr;
1234
1235 /* Try to use Direct3D to obtain the required information first. */
1237 if (hr != E_FAIL)
1238 return hr;
1239
1241}
1242
1244{
1249};
1250
1251static LPWSTR guid_to_string(LPWSTR lpwstr, REFGUID lpcguid)
1252{
1253 wsprintfW(lpwstr, L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", lpcguid->Data1, lpcguid->Data2,
1254 lpcguid->Data3, lpcguid->Data4[0], lpcguid->Data4[1], lpcguid->Data4[2], lpcguid->Data4[3], lpcguid->Data4[4],
1255 lpcguid->Data4[5], lpcguid->Data4[6], lpcguid->Data4[7]);
1256
1257 return lpwstr;
1258}
1259
1261{
1262 struct enum_context *enum_ctx = context;
1264 WCHAR buffer[256];
1265 const WCHAR *p, *name;
1266 UINT32 i, count;
1267
1268 /* the default device is enumerated twice, one time without GUID */
1269 if (!guid) return TRUE;
1270
1271 swprintf(buffer, ARRAY_SIZE(buffer), L"%u", enum_ctx->index);
1273 if (!device)
1274 {
1275 enum_ctx->hr = E_OUTOFMEMORY;
1276 return FALSE;
1277 }
1278
1279 add_subcontainer(enum_ctx->cont, device);
1280
1282 enum_ctx->hr = add_bstr_property(device, L"szGuidDeviceID", buffer);
1283 if (FAILED(enum_ctx->hr))
1284 return FALSE;
1285
1286 enum_ctx->hr = add_bstr_property(device, L"szDescription", desc);
1287 if (FAILED(enum_ctx->hr))
1288 return FALSE;
1289
1290 enum_ctx->hr = add_bstr_property(device, L"szDriverPath", module);
1291 if (FAILED(enum_ctx->hr))
1292 return FALSE;
1293
1294 name = module;
1295 if ((p = wcsrchr(name, '\\'))) name = p + 1;
1296 if ((p = wcsrchr(name, '/'))) name = p + 1;
1297
1298 enum_ctx->hr = add_bstr_property(device, L"szDriverName", name);
1299 if (FAILED(enum_ctx->hr))
1300 return FALSE;
1301
1302 if (enum_ctx->devices && SUCCEEDED(IMMDeviceCollection_GetCount(enum_ctx->devices, &count)))
1303 {
1304 static const PROPERTYKEY devicepath_key =
1305 {
1306 {0xb3f8fa53, 0x0004, 0x438e, {0x90, 0x03, 0x51, 0xa4, 0x6e, 0x13, 0x9b, 0xfc}}, 2
1307 };
1308 IPropertyStore *ps;
1309 WCHAR *start, *end;
1310 IMMDevice *mmdev;
1311 PROPVARIANT pv;
1312 HRESULT hr;
1313
1314 for (i = 0; i < count; ++i)
1315 {
1316 mmdev = NULL;
1317 ps = NULL;
1318 hr = IMMDeviceCollection_Item(enum_ctx->devices, i, &mmdev);
1319 if (SUCCEEDED(hr))
1320 hr = IMMDevice_OpenPropertyStore(mmdev, STGM_READ, &ps);
1321 PropVariantInit(&pv);
1322 if (SUCCEEDED(hr))
1323 hr = IPropertyStore_GetValue(ps, (const PROPERTYKEY*)&PKEY_AudioEndpoint_GUID, &pv);
1324 if (SUCCEEDED(hr))
1325 {
1327 hr = pv.vt == VT_LPWSTR && !wcsicmp(buffer, pv.pwszVal) ? S_OK : E_FAIL;
1328 PropVariantClear(&pv);
1329 }
1330 PropVariantInit(&pv);
1331 if (SUCCEEDED(hr))
1332 hr = IPropertyStore_GetValue(ps, &devicepath_key, &pv);
1333 if (SUCCEEDED(hr) && pv.vt == VT_LPWSTR)
1334 {
1335 if ((start = wcsstr(pv.pwszVal, L"}.")))
1336 start += 2;
1337 else
1338 start = pv.pwszVal;
1339 if (wcsnicmp(start, L"ROOT", 4) && (end = wcschr(start, '\\')) && (end = wcschr(end + 1, '\\'))
1340 && end - start < ARRAY_SIZE(buffer))
1341 {
1342 memcpy(buffer, start, (end - start) * sizeof(WCHAR));
1343 buffer[end - start] = 0;
1344 start = buffer;
1345 }
1346 add_bstr_property(device, L"szHardwareID", start);
1347 PropVariantClear(&pv);
1348 }
1349 if (ps)
1350 IPropertyStore_Release(ps);
1351 if (mmdev)
1352 IMMDevice_Release(mmdev);
1353 if (SUCCEEDED(hr))
1354 break;
1355 }
1356 }
1357
1358 enum_ctx->index++;
1359 return TRUE;
1360}
1361
1363{
1364 struct enum_context enum_ctx;
1366 IMMDeviceEnumerator *mmdevenum;
1367
1368 cont = allocate_information_node(L"DxDiag_SoundDevices");
1369 if (!cont)
1370 return E_OUTOFMEMORY;
1371
1373
1374 enum_ctx.cont = cont;
1375 enum_ctx.hr = S_OK;
1376 enum_ctx.index = 0;
1377
1378 enum_ctx.devices = NULL;
1379 if (SUCCEEDED(CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator,
1380 (void **)&mmdevenum)))
1381 {
1382 IMMDeviceEnumerator_EnumAudioEndpoints(mmdevenum, eAll, DEVICE_STATE_ACTIVE, &enum_ctx.devices);
1383 IMMDeviceEnumerator_Release(mmdevenum);
1384 }
1385
1387 if (enum_ctx.devices)
1388 {
1389 IMMDeviceCollection_Release(enum_ctx.devices);
1390 enum_ctx.devices = NULL;
1391 }
1392 if (FAILED(enum_ctx.hr))
1393 return enum_ctx.hr;
1394
1395 cont = allocate_information_node(L"DxDiag_SoundCaptureDevices");
1396 if (!cont)
1397 return E_OUTOFMEMORY;
1398
1400
1401 enum_ctx.cont = cont;
1402 enum_ctx.hr = S_OK;
1403 enum_ctx.index = 0;
1404
1406 if (FAILED(enum_ctx.hr))
1407 return enum_ctx.hr;
1408
1409 return S_OK;
1410}
1411
1413{
1414 return S_OK;
1415}
1416
1418{
1419 return S_OK;
1420}
1421
1423{
1424 return S_OK;
1425}
1426
1428{
1429 return S_OK;
1430}
1431
1433{
1434 HRESULT hr;
1435 WCHAR *szFile;
1436 WCHAR szVersion_v[1024];
1437 DWORD retval, hdl;
1438 void *pVersionInfo = NULL;
1439 BOOL boolret = FALSE;
1440 UINT uiLength;
1441 VS_FIXEDFILEINFO *pFileInfo;
1442
1443 TRACE("Filling container %p for %s in %s\n", node,
1444 debugstr_w(szFileName), debugstr_w(szFilePath));
1445
1446 szFile = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * (lstrlenW(szFilePath) +
1447 lstrlenW(szFileName) + 2 /* slash + terminator */));
1448 if (!szFile)
1449 return E_OUTOFMEMORY;
1450
1451 lstrcpyW(szFile, szFilePath);
1452 lstrcatW(szFile, L"\\");
1453 lstrcatW(szFile, szFileName);
1454
1455 retval = GetFileVersionInfoSizeW(szFile, &hdl);
1456 if (retval)
1457 {
1458 pVersionInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, retval);
1459 if (!pVersionInfo)
1460 {
1461 hr = E_OUTOFMEMORY;
1462 goto cleanup;
1463 }
1464
1465 if (GetFileVersionInfoW(szFile, 0, retval, pVersionInfo) &&
1466 VerQueryValueW(pVersionInfo, L"\\", (void **)&pFileInfo, &uiLength))
1467 boolret = TRUE;
1468 }
1469
1470 hr = add_bstr_property(node, L"szPath", szFile);
1471 if (FAILED(hr))
1472 goto cleanup;
1473
1474 hr = add_bstr_property(node, L"szName", szFileName);
1475 if (FAILED(hr))
1476 goto cleanup;
1477
1478 hr = add_bool_property(node, L"bExists", boolret);
1479 if (FAILED(hr))
1480 goto cleanup;
1481
1482 if (boolret)
1483 {
1484 swprintf(szVersion_v, ARRAY_SIZE(szVersion_v), L"%u.%02u.%04u.%04u",
1485 HIWORD(pFileInfo->dwFileVersionMS), LOWORD(pFileInfo->dwFileVersionMS),
1486 HIWORD(pFileInfo->dwFileVersionLS), LOWORD(pFileInfo->dwFileVersionLS));
1487
1488 TRACE("Found version as (%s)\n", debugstr_w(szVersion_v));
1489
1490 hr = add_bstr_property(node, L"szVersion", szVersion_v);
1491 if (FAILED(hr))
1492 goto cleanup;
1493
1494 hr = add_bstr_property(node, L"szAttributes", L"Final Retail");
1495 if (FAILED(hr))
1496 goto cleanup;
1497
1498 hr = add_bstr_property(node, L"szLanguageEnglish", L"English");
1499 if (FAILED(hr))
1500 goto cleanup;
1501
1502 hr = add_ui4_property(node, L"dwFileTimeHigh", pFileInfo->dwFileDateMS);
1503 if (FAILED(hr))
1504 goto cleanup;
1505
1506 hr = add_ui4_property(node, L"dwFileTimeLow", pFileInfo->dwFileDateLS);
1507 if (FAILED(hr))
1508 goto cleanup;
1509
1510 hr = add_bool_property(node, L"bBeta",
1511 ((pFileInfo->dwFileFlags & pFileInfo->dwFileFlagsMask) & VS_FF_PRERELEASE) != 0);
1512 if (FAILED(hr))
1513 goto cleanup;
1514
1515 hr = add_bool_property(node, L"bDebug",
1516 ((pFileInfo->dwFileFlags & pFileInfo->dwFileFlagsMask) & VS_FF_DEBUG) != 0);
1517 if (FAILED(hr))
1518 goto cleanup;
1519 }
1520
1521 hr = S_OK;
1522cleanup:
1523 HeapFree(GetProcessHeap(), 0, pVersionInfo);
1524 HeapFree(GetProcessHeap(), 0, szFile);
1525
1526 return hr;
1527}
1529{
1530 static const WCHAR dlls[][15] =
1531 {
1532 L"d3d8.dll",
1533 L"d3d9.dll",
1534 L"ddraw.dll",
1535 L"devenum.dll",
1536 L"dinput8.dll",
1537 L"dinput.dll",
1538 L"dmband.dll",
1539 L"dmcompos.dll",
1540 L"dmime.dll",
1541 L"dmloader.dll",
1542 L"dmscript.dll",
1543 L"dmstyle.dll",
1544 L"dmsynth.dll",
1545 L"dmusic.dll",
1546 L"dplayx.dll",
1547 L"dpnet.dll",
1548 L"dsound.dll",
1549 L"dswave.dll",
1550 L"dxdiagn.dll",
1551 L"quartz.dll"
1552 };
1553
1554 HRESULT hr;
1556 INT i;
1557
1559
1560 for (i = 0; i < ARRAY_SIZE(dlls); i++)
1561 {
1562 WCHAR szFileID[5];
1563 IDxDiagContainerImpl_Container *file_container;
1564
1565 swprintf(szFileID, ARRAY_SIZE(szFileID), L"%d", i);
1566
1567 file_container = allocate_information_node(szFileID);
1568 if (!file_container)
1569 return E_OUTOFMEMORY;
1570
1571 hr = fill_file_description(file_container, szFilePath, dlls[i]);
1572 if (FAILED(hr))
1573 {
1574 free_information_tree(file_container);
1575 continue;
1576 }
1577
1578 add_subcontainer(node, file_container);
1579 }
1580
1581 return S_OK;
1582}
1583
1584static HRESULT read_property_names(IPropertyBag *pPropBag, VARIANT *friendly_name, VARIANT *clsid_name)
1585{
1586 HRESULT hr;
1587
1588 VariantInit(friendly_name);
1589 VariantInit(clsid_name);
1590
1591 hr = IPropertyBag_Read(pPropBag, L"FriendlyName", friendly_name, 0);
1592 if (FAILED(hr))
1593 return hr;
1594
1595 hr = IPropertyBag_Read(pPropBag, L"CLSID", clsid_name, 0);
1596 if (FAILED(hr))
1597 {
1598 VariantClear(friendly_name);
1599 return hr;
1600 }
1601
1602 return S_OK;
1603}
1604
1606{
1607 HRESULT hr;
1608 IFilterMapper2 *pFileMapper = NULL;
1609 IAMFilterData *pFilterData = NULL;
1610 BYTE *ppRF = NULL;
1611 REGFILTER2 *pRF = NULL;
1612 WCHAR bufferW[10];
1613 ULONG j;
1614 DWORD dwNOutputs = 0;
1615 DWORD dwNInputs = 0;
1616
1617 hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC, &IID_IFilterMapper2,
1618 (void **)&pFileMapper);
1619 if (FAILED(hr))
1620 return hr;
1621
1622 hr = IFilterMapper2_QueryInterface(pFileMapper, &IID_IAMFilterData, (void **)&pFilterData);
1623 if (FAILED(hr))
1624 goto cleanup;
1625
1626 hr = IAMFilterData_ParseFilterData(pFilterData, pData, cb, &ppRF);
1627 if (FAILED(hr))
1628 goto cleanup;
1629 pRF = ((REGFILTER2**)ppRF)[0];
1630
1631 swprintf(bufferW, ARRAY_SIZE(bufferW), L"v%d", pRF->dwVersion);
1632 hr = add_bstr_property(subcont, L"szVersion", bufferW);
1633 if (FAILED(hr))
1634 goto cleanup;
1635
1636 if (pRF->dwVersion == 1)
1637 {
1638 for (j = 0; j < pRF->cPins; j++)
1639 if (pRF->rgPins[j].bOutput)
1640 dwNOutputs++;
1641 else
1642 dwNInputs++;
1643 }
1644 else if (pRF->dwVersion == 2)
1645 {
1646 for (j = 0; j < pRF->cPins2; j++)
1648 dwNOutputs++;
1649 else
1650 dwNInputs++;
1651 }
1652
1653 hr = add_ui4_property(subcont, L"dwInputs", dwNInputs);
1654 if (FAILED(hr))
1655 goto cleanup;
1656
1657 hr = add_ui4_property(subcont, L"dwOutputs", dwNOutputs);
1658 if (FAILED(hr))
1659 goto cleanup;
1660
1661 hr = add_ui4_property(subcont, L"dwMerit", pRF->dwMerit);
1662 if (FAILED(hr))
1663 goto cleanup;
1664
1665 hr = S_OK;
1666cleanup:
1667 CoTaskMemFree(pRF);
1668 if (pFilterData) IAMFilterData_Release(pFilterData);
1669 if (pFileMapper) IFilterMapper2_Release(pFileMapper);
1670
1671 return hr;
1672}
1673
1675{
1676 HRESULT hr;
1677 IPropertyBag *pPropFilterBag = NULL;
1678 BYTE *pData;
1679 VARIANT friendly_name;
1680 VARIANT clsid_name;
1681 VARIANT v;
1682
1683 VariantInit(&friendly_name);
1684 VariantInit(&clsid_name);
1685 VariantInit(&v);
1686
1687 hr = IMoniker_BindToStorage(pMoniker, NULL, NULL, &IID_IPropertyBag, (void **)&pPropFilterBag);
1688 if (FAILED(hr))
1689 return hr;
1690
1691 hr = read_property_names(pPropFilterBag, &friendly_name, &clsid_name);
1692 if (FAILED(hr))
1693 goto cleanup;
1694
1695 TRACE("Name = %s\n", debugstr_w(V_BSTR(&friendly_name)));
1696 TRACE("CLSID = %s\n", debugstr_w(V_BSTR(&clsid_name)));
1697
1698 hr = add_bstr_property(subcont, L"szName", V_BSTR(&friendly_name));
1699 if (FAILED(hr))
1700 goto cleanup;
1701
1702 hr = add_bstr_property(subcont, L"ClsidFilter", V_BSTR(&clsid_name));
1703 if (FAILED(hr))
1704 goto cleanup;
1705
1706 hr = IPropertyBag_Read(pPropFilterBag, L"FilterData", &v, NULL);
1707 if (FAILED(hr))
1708 goto cleanup;
1709
1710 hr = SafeArrayAccessData(V_ARRAY(&v), (void **)&pData);
1711 if (FAILED(hr))
1712 goto cleanup;
1713
1714 hr = fill_filter_data_information(subcont, pData, V_ARRAY(&v)->rgsabound->cElements);
1716 if (FAILED(hr))
1717 goto cleanup;
1718
1719 hr = S_OK;
1720cleanup:
1721 VariantClear(&v);
1722 VariantClear(&clsid_name);
1723 VariantClear(&friendly_name);
1724 if (pPropFilterBag) IPropertyBag_Release(pPropFilterBag);
1725
1726 return hr;
1727}
1728
1730{
1731 HRESULT hr;
1732 int i = 0;
1733 ICreateDevEnum *pCreateDevEnum;
1734 IEnumMoniker *pEmCat = NULL;
1735 IMoniker *pMCat = NULL;
1736 IEnumMoniker *pEnum = NULL;
1737
1738 hr = CoCreateInstance(&CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER,
1739 &IID_ICreateDevEnum, (void **)&pCreateDevEnum);
1740 if (FAILED(hr))
1741 return hr;
1742
1743 hr = ICreateDevEnum_CreateClassEnumerator(pCreateDevEnum, &CLSID_ActiveMovieCategories, &pEmCat, 0);
1744 if (hr != S_OK)
1745 goto cleanup;
1746
1747 while (IEnumMoniker_Next(pEmCat, 1, &pMCat, NULL) == S_OK)
1748 {
1749 VARIANT vCatName;
1750 VARIANT vCatClsid;
1751 IPropertyBag *pPropBag;
1752 CLSID clsidCat;
1753 IMoniker *pMoniker = NULL;
1754
1755 hr = IMoniker_BindToStorage(pMCat, NULL, NULL, &IID_IPropertyBag, (void **)&pPropBag);
1756 if (FAILED(hr))
1757 {
1758 IMoniker_Release(pMCat);
1759 break;
1760 }
1761
1762 hr = read_property_names(pPropBag, &vCatName, &vCatClsid);
1763 IPropertyBag_Release(pPropBag);
1764 if (FAILED(hr))
1765 {
1766 IMoniker_Release(pMCat);
1767 break;
1768 }
1769
1770 hr = CLSIDFromString(V_BSTR(&vCatClsid), &clsidCat);
1771 if (FAILED(hr))
1772 {
1773 IMoniker_Release(pMCat);
1774 VariantClear(&vCatClsid);
1775 VariantClear(&vCatName);
1776 break;
1777 }
1778
1779 hr = ICreateDevEnum_CreateClassEnumerator(pCreateDevEnum, &clsidCat, &pEnum, 0);
1780 if (hr != S_OK)
1781 {
1782 IMoniker_Release(pMCat);
1783 VariantClear(&vCatClsid);
1784 VariantClear(&vCatName);
1785 continue;
1786 }
1787
1788 TRACE("Enumerating class %s\n", debugstr_guid(&clsidCat));
1789
1790 while (IEnumMoniker_Next(pEnum, 1, &pMoniker, NULL) == S_OK)
1791 {
1792 WCHAR bufferW[10];
1794
1795 swprintf(bufferW, ARRAY_SIZE(bufferW), L"%d", i);
1796 subcont = allocate_information_node(bufferW);
1797 if (!subcont)
1798 {
1799 hr = E_OUTOFMEMORY;
1800 IMoniker_Release(pMoniker);
1801 break;
1802 }
1803
1804 hr = add_bstr_property(subcont, L"szCatName", V_BSTR(&vCatName));
1805 if (FAILED(hr))
1806 {
1807 free_information_tree(subcont);
1808 IMoniker_Release(pMoniker);
1809 break;
1810 }
1811
1812 hr = add_bstr_property(subcont, L"ClsidCat", V_BSTR(&vCatClsid));
1813 if (FAILED(hr))
1814 {
1815 free_information_tree(subcont);
1816 IMoniker_Release(pMoniker);
1817 break;
1818 }
1819
1820 hr = fill_filter_container(subcont, pMoniker);
1821 IMoniker_Release(pMoniker);
1822 if (FAILED(hr))
1823 {
1824 WARN("Skipping invalid filter\n");
1825 free_information_tree(subcont);
1826 hr = S_OK;
1827 continue;
1828 }
1829
1830 add_subcontainer(node, subcont);
1831 i++;
1832 }
1833
1834 IEnumMoniker_Release(pEnum);
1835 IMoniker_Release(pMCat);
1836 VariantClear(&vCatClsid);
1837 VariantClear(&vCatName);
1838
1839 if (FAILED(hr))
1840 break;
1841 }
1842
1843cleanup:
1844 if (pEmCat) IEnumMoniker_Release(pEmCat);
1845 ICreateDevEnum_Release(pCreateDevEnum);
1846 return hr;
1847}
1848
1850{
1851 return S_OK;
1852}
1853
1855{
1856 static const struct
1857 {
1858 const WCHAR *name;
1860 } root_children[] =
1861 {
1862 {L"DxDiag_SystemInfo", build_systeminfo_tree},
1863 {L"DxDiag_DisplayDevices", build_displaydevices_tree},
1864 {L"DxDiag_DirectSound", build_directsound_tree},
1865 {L"DxDiag_DirectMusic", build_directmusic_tree},
1866 {L"DxDiag_DirectInput", build_directinput_tree},
1867 {L"DxDiag_DirectPlay", build_directplay_tree},
1868 {L"DxDiag_SystemDevices", build_systemdevices_tree},
1869 {L"DxDiag_DirectXFiles", build_directxfiles_tree},
1870 {L"DxDiag_DirectShowFilters", build_directshowfilters_tree},
1871 {L"DxDiag_LogicalDisks", build_logicaldisks_tree},
1872 };
1873
1875 size_t index;
1876
1877 info_root = allocate_information_node(NULL);
1878 if (!info_root)
1879 return E_OUTOFMEMORY;
1880
1881 for (index = 0; index < ARRAY_SIZE(root_children); index++)
1882 {
1884 HRESULT hr;
1885
1886 node = allocate_information_node(root_children[index].name);
1887 if (!node)
1888 {
1889 free_information_tree(info_root);
1890 return E_OUTOFMEMORY;
1891 }
1892
1893 hr = root_children[index].initfunc(node);
1894 if (FAILED(hr))
1895 {
1897 free_information_tree(info_root);
1898 return hr;
1899 }
1900
1901 add_subcontainer(info_root, node);
1902 }
1903
1904 *pinfo_root = info_root;
1905 return S_OK;
1906}
#define CO_E_NOTINITIALIZED
static struct list dlls
Definition: apartment.c:63
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
@ REG_PINFLAG_B_OUTPUT
Definition: axextend.idl:221
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:446
@ D3DFMT_X1R5G5B5
Definition: d3d8types.h:607
@ D3DFMT_R5G6B5
Definition: d3d8types.h:606
@ D3DFMT_P8
Definition: d3d8types.h:618
@ D3DFMT_X8R8G8B8
Definition: d3d8types.h:605
@ D3DDEVTYPE_HAL
Definition: d3d8types.h:576
enum _D3DFORMAT D3DFORMAT
IDirect3D9 *WINAPI Direct3DCreate9(UINT SDKVersion)
Definition: d3d9.c:57
#define IDirect3D9_GetDeviceCaps(p, a, b, c)
Definition: d3d9.h:222
#define IDirect3D9_GetAdapterDisplayMode(p, a, b)
Definition: d3d9.h:216
#define IDirect3D9_GetAdapterIdentifier(p, a, b, c)
Definition: d3d9.h:213
#define IDirect3D9_Release(p)
Definition: d3d9.h:209
#define IDirect3D9_GetAdapterCount(p)
Definition: d3d9.h:212
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
HRESULT hr
Definition: delayimp.cpp:582
static LPVOID LPUNKNOWN
Definition: dinput.c:53
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT WINAPI DirectDrawCreateEx(LPGUID lpGUID, LPVOID *lplpDD, REFIID id, LPUNKNOWN pUnkOuter)
Definition: main.c:139
HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW lpDSEnumCallback, LPVOID lpContext)
Definition: enum.c:210
HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW lpDSEnumCallback, LPVOID lpContext)
Definition: enum.c:228
HRESULT DXDiag_CreateDXDiagContainer(REFIID riid, IDxDiagContainerImpl_Container *cont, IDxDiagProvider *pProv, LPVOID *ppobj)
Definition: container.c:275
static HRESULT build_information_tree(IDxDiagContainerImpl_Container **pinfo_root)
Definition: provider.c:1854
static const WCHAR * vendor_id_to_manufacturer_string(DWORD vendor_id)
Definition: provider.c:808
static ULONG WINAPI IDxDiagProviderImpl_AddRef(IDxDiagProvider *iface)
Definition: provider.c:81
static HRESULT add_ui4_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, DWORD data)
Definition: provider.c:286
static const IDxDiagProviderVtbl DxDiagProvider_Vtbl
Definition: provider.c:154
static HRESULT add_ull_as_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, ULONGLONG data)
Definition: provider.c:337
static BOOL is_netmeeting_running(void)
Definition: provider.c:431
static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:607
static HRESULT read_property_names(IPropertyBag *pPropBag, VARIANT *friendly_name, VARIANT *clsid_name)
Definition: provider.c:1584
static HRESULT add_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, const WCHAR *str)
Definition: provider.c:261
static HRESULT build_directsound_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1362
static HRESULT build_directshowfilters_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1729
static HRESULT fill_file_description(IDxDiagContainerImpl_Container *node, const WCHAR *szFilePath, const WCHAR *szFileName)
Definition: provider.c:1432
static IDxDiagContainerImpl_Property * allocate_property_information(const WCHAR *name)
Definition: provider.c:236
static IDxDiagProviderImpl * impl_from_IDxDiagProvider(IDxDiagProvider *iface)
Definition: provider.c:56
static void add_subcontainer(IDxDiagContainerImpl_Container *node, IDxDiagContainerImpl_Container *subCont)
Definition: provider.c:255
BOOL CALLBACK dsound_enum(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID context)
Definition: provider.c:1260
static IDxDiagContainerImpl_Container * allocate_information_node(const WCHAR *name)
Definition: provider.c:211
static void free_property_information(IDxDiagContainerImpl_Property *prop)
Definition: provider.c:178
static HRESULT fill_processor_information(IDxDiagContainerImpl_Container *node)
Definition: provider.c:540
static HRESULT fill_language_information(IDxDiagContainerImpl_Container *node)
Definition: provider.c:456
static HRESULT fill_filter_container(IDxDiagContainerImpl_Container *subcont, IMoniker *pMoniker)
Definition: provider.c:1674
static BOOL get_texture_memory(GUID *adapter, DWORD *available_mem)
Definition: provider.c:788
static ULONG WINAPI IDxDiagProviderImpl_Release(IDxDiagProvider *iface)
Definition: provider.c:93
static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node)
Definition: provider.c:836
static HRESULT build_displaydevices_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1231
static HRESULT add_bool_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, BOOL data)
Definition: provider.c:320
static DWORD depth_for_pixelformat(D3DFORMAT format)
Definition: provider.c:773
static HRESULT fill_filter_data_information(IDxDiagContainerImpl_Container *subcont, BYTE *pData, ULONG cb)
Definition: provider.c:1605
static HRESULT build_systemdevices_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1427
static HRESULT build_logicaldisks_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1849
static HRESULT build_directxfiles_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1528
static HRESULT WINAPI IDxDiagProviderImpl_GetRootContainer(IDxDiagProvider *iface, IDxDiagContainer **ppInstance)
Definition: provider.c:139
static HRESULT fill_datetime_information(IDxDiagContainerImpl_Container *node)
Definition: provider.c:487
static HRESULT WINAPI IDxDiagProviderImpl_Initialize(IDxDiagProvider *iface, DXDIAG_INIT_PARAMS *pParams)
Definition: provider.c:111
static BOOL get_process_name_from_pid(DWORD pid, WCHAR *buf, DWORD chars)
Definition: provider.c:404
static HRESULT build_directinput_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1417
HRESULT DXDiag_CreateDXDiagProvider(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj)
Definition: provider.c:163
static HRESULT fill_os_string_information(IDxDiagContainerImpl_Container *node, OSVERSIONINFOW *info)
Definition: provider.c:518
static HRESULT build_directplay_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1422
static HRESULT build_directmusic_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1412
static HRESULT WINAPI IDxDiagProviderImpl_QueryInterface(IDxDiagProvider *iface, REFIID riid, void **ppobj)
Definition: provider.c:62
static HRESULT add_i4_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, LONG data)
Definition: provider.c:303
static void free_information_tree(IDxDiagContainerImpl_Container *node)
Definition: provider.c:185
static LPWSTR guid_to_string(LPWSTR lpwstr, REFGUID lpcguid)
Definition: provider.c:1251
static HRESULT fill_display_information_fallback(IDxDiagContainerImpl_Container *node)
Definition: provider.c:1130
#define IDS_PAGE_FILE_FORMAT
Definition: resource.h:24
#define IDS_REGIONAL_SETTING
Definition: resource.h:23
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
Definition: combase.c:709
INT WINAPI StringFromGUID2(REFGUID guid, LPOLESTR str, INT cmax)
Definition: combase.c:1525
HRESULT WINAPI CLSIDFromString(LPCOLESTR str, LPCLSID clsid)
Definition: combase.c:1470
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
static WCHAR no[MAX_STRING_RESOURCE_LEN]
Definition: object.c:2406
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
#define wcsnicmp
Definition: compat.h:14
#define wcsrchr
Definition: compat.h:16
#define CP_ACP
Definition: compat.h:109
#define HeapAlloc
Definition: compat.h:733
#define HeapReAlloc
Definition: compat.h:734
OLECHAR * BSTR
Definition: compat.h:2293
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define lstrcpyW
Definition: compat.h:749
#define MultiByteToWideChar
Definition: compat.h:110
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
@ VT_UI8
Definition: compat.h:2315
@ VT_BSTR
Definition: compat.h:2303
@ VT_LPWSTR
Definition: compat.h:2325
@ VT_I4
Definition: compat.h:2298
@ VT_BOOL
Definition: compat.h:2306
@ VT_UI4
Definition: compat.h:2313
#define wcsicmp
Definition: compat.h:15
#define lstrlenW
Definition: compat.h:750
static void cleanup(void)
Definition: main.c:1335
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2331
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2370
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
Definition: proc.c:1274
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:272
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
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4152
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1675
BOOL WINAPI EnumProcesses(DWORD *ids, DWORD count, DWORD *used)
Definition: debug.c:1204
DWORD WINAPI DECLSPEC_HOTPATCH GetModuleBaseNameW(HANDLE process, HMODULE module, WCHAR *name, DWORD size)
Definition: debug.c:1371
BOOL WINAPI DECLSPEC_HOTPATCH EnumProcessModules(HANDLE process, HMODULE *module, DWORD count, DWORD *needed)
Definition: debug.c:1058
GUID guid
Definition: version.c:147
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:967
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1171
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:738
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118
_ACRTIMP wchar_t *__cdecl wcsstr(const wchar_t *, const wchar_t *)
Definition: wcs.c:2998
char * va_list
Definition: vadefs.h:50
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1137
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1168
#define swprintf
Definition: precomp.h:40
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
HINSTANCE dxdiagn_instance
Definition: dxdiag_main.c:38
static void DXDIAGN_UnlockModule(void)
static void DXDIAGN_LockModule(void)
#define DXDIAG_DX9_SDK_VERSION
Definition: dxdiag.h:6
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
return adapter
GLuint start
Definition: gl.h:1545
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint buffer
Definition: glext.h:5915
GLuint index
Definition: glext.h:6031
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat GLfloat p
Definition: glext.h:8902
GLuint id
Definition: glext.h:5910
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
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
unsigned int UINT
Definition: sysinfo.c:13
BOOL NTAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
Definition: heapmem.c:1272
#define PROCESS_VM_READ
Definition: pstypes.h:157
#define PROCESS_QUERY_INFORMATION
Definition: pstypes.h:162
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1101
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:1001
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
struct tm time_str
Definition: mktime.c:5
@ eAll
Definition: mmdeviceapi.idl:65
static PVOID ptr
Definition: dispmode.c:27
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
static WCHAR computer_name[MAX_COMPUTERNAME_LENGTH+1]
Definition: access.c:33
#define DWORD
Definition: nt_native.h:44
#define LOCALE_NEUTRAL
#define LOCALE_USER_DEFAULT
#define LOCALE_SYSTEM_DEFAULT
#define STGM_READ
Definition: objbase.h:936
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:240
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:273
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_ARRAY(A)
Definition: oleauto.h:222
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_I4(A)
Definition: oleauto.h:247
#define V_UI4(A)
Definition: oleauto.h:270
#define V_UI8(A)
Definition: oleauto.h:272
const GUID IID_IPropertyBag
#define LOWORD(l)
Definition: pedump.c:82
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
static const WCHAR driverW[]
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
DWORD IDirectDraw7
Definition: vmrender.idl:21
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
static WCHAR szFilePath[]
Definition: qotd.c:14
const WCHAR * str
#define D3D_SDK_VERSION
Definition: d3d8.h:52
#define DDSD_WIDTH
Definition: ddraw.h:212
#define DDSD_PIXELFORMAT
Definition: ddraw.h:218
#define DDSD_HEIGHT
Definition: ddraw.h:211
#define DDSCAPS_VIDEOMEMORY
Definition: ddraw.h:266
#define DDSCAPS_LOCALVIDMEM
Definition: ddraw.h:278
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
Definition: list.h:157
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:242
#define LoadStringW
Definition: utils.h:64
#define TRACE(s)
Definition: solgame.cpp:4
IDxDiagContainerImpl_Container * info_root
Definition: provider.c:53
IDxDiagProvider IDxDiagProvider_iface
Definition: provider.c:49
DXDIAG_INIT_PARAMS params
Definition: provider.c:52
DWORD dwVersion
Definition: axextend.idl:238
const REGFILTERPINS * rgPins
Definition: axextend.idl:246
ULONG cPins
Definition: axextend.idl:245
DWORD dwMerit
Definition: axextend.idl:239
const REGFILTERPINS2 * rgPins2
Definition: axextend.idl:253
ULONG cPins2
Definition: axextend.idl:252
char Driver[MAX_DEVICE_IDENTIFIER_STRING]
Definition: d3d9types.h:1263
char Description[MAX_DEVICE_IDENTIFIER_STRING]
Definition: d3d9types.h:1264
LARGE_INTEGER DriverVersion
Definition: d3d9types.h:1266
D3DFORMAT Format
Definition: d3d8types.h:1042
DWORD dwRGBBitCount
Definition: ddraw.h:1077
DWORD dwCaps4
Definition: ddraw.h:739
DWORD dwCaps3
Definition: ddraw.h:736
DWORD dwCaps2
Definition: ddraw.h:735
DWORD dwCaps
Definition: ddraw.h:734
DWORD dwWidth
Definition: ddraw.h:1157
DWORD dwHeight
Definition: ddraw.h:1156
DDPIXELFORMAT ddpfPixelFormat
Definition: ddraw.h:1187
DWORD dwFlags
Definition: ddraw.h:1155
DWORD dwSize
Definition: ddraw.h:1154
WCHAR DeviceName[32]
Definition: wingdi.h:3264
WCHAR DeviceString[128]
Definition: wingdi.h:3265
DWORD dwDxDiagHeaderVersion
Definition: dxdiag.h:20
Definition: scsiwmi.h:51
unsigned char Data4[8]
Definition: scsiwmi.h:55
unsigned long Data1
Definition: scsiwmi.h:52
unsigned short Data2
Definition: scsiwmi.h:53
unsigned short Data3
Definition: scsiwmi.h:54
Definition: match.c:390
Definition: http.c:7252
char * name
Definition: wpp.c:52
Definition: devices.h:37
IDxDiagContainerImpl_Container * cont
Definition: provider.c:1245
IMMDeviceCollection * devices
Definition: provider.c:1246
HRESULT hr
Definition: provider.c:1247
Definition: name.c:39
DWORD dwFileVersionLS
Definition: compat.h:903
DWORD dwFileVersionMS
Definition: compat.h:902
DWORD dwFileDateLS
Definition: compat.h:912
DWORD dwFileFlagsMask
Definition: compat.h:906
DWORD dwFileDateMS
Definition: compat.h:911
static BOOL enumerate_processes(void)
Definition: taskkill.c:162
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint32_t DWORD_PTR
Definition: typedefs.h:65
uint16_t * LPWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
uint64_t ULONGLONG
Definition: typedefs.h:67
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t UINT32
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
ULONG LowPart
Definition: typedefs.h:106
Definition: dlist.c:348
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, const VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:939
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:626
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:547
#define VS_FF_PRERELEASE
Definition: verrsrc.h:43
#define VS_FF_DEBUG
Definition: verrsrc.h:42
@ WBEM_FLAG_SYSTEM_ONLY
Definition: wbemcli.idl:203
int retval
Definition: wcstombs.cpp:91
BOOL WINAPI EnumDisplayDevicesW(LPCWSTR lpDevice, DWORD iDevNum, PDISPLAY_DEVICEW lpDisplayDevice, DWORD dwFlags)
Definition: display.c:78
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:398
#define FORMAT_MESSAGE_ARGUMENT_ARRAY
Definition: winbase.h:401
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:268
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771
#define E_POINTER
Definition: winerror.h:3480
#define LOCALE_SENGLANGUAGE
Definition: winnls.h:32
#define LOCALE_SNATIVELANGNAME
Definition: winnls.h:38
#define DATE_LONGDATE
Definition: winnls.h:217
unsigned char BYTE
Definition: xxhash.c:193