[DXDIAGN] Sync with Wine Staging 4.18. CORE-16441

This commit is contained in:
Amine Khaldi 2019-10-26 13:05:45 +01:00
parent 4188095a3a
commit d6c879a0e0
8 changed files with 93 additions and 142 deletions

View file

@ -2,7 +2,6 @@
add_definitions(-D__WINESRC__)
include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
spec2def(dxdiagn.dll dxdiagn.spec)
add_idl_headers(dxdiagn_idlheader fil_data.idl)
list(APPEND SOURCE
container.c
@ -18,7 +17,7 @@ add_library(dxdiagn MODULE
set_module_type(dxdiagn win32dll)
target_link_libraries(dxdiagn strmiids dxguid uuid wine)
add_dependencies(dxdiagn dxdiagn_idlheader)
add_dependencies(dxdiagn wineheaders)
add_importlibs(dxdiagn d3d9 ddraw version ole32 oleaut32 psapi user32 dsound msvcrt kernel32 ntdll)
add_pch(dxdiagn precomp.h SOURCE)
add_cd_file(TARGET dxdiagn DESTINATION reactos/system32 FOR all)

View file

@ -19,12 +19,10 @@
*
*/
#include "config.h"
#define COBJMACROS
#include "dxdiag_private.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(dxdiag);
@ -114,7 +112,7 @@ static HRESULT WINAPI IDxDiagContainerImpl_EnumChildContainerNames(IDxDiagContai
if (dwIndex == i) {
TRACE("Found container name %s, copying string\n", debugstr_w(p->contName));
lstrcpynW(pwszContainer, p->contName, cchContainer);
return (cchContainer <= strlenW(p->contName)) ?
return (cchContainer <= lstrlenW(p->contName)) ?
DXDIAG_E_INSUFFICIENT_BUFFER : S_OK;
}
++i;
@ -157,20 +155,12 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetChildContainer(IDxDiagContainer *i
*ppInstance = NULL;
tmp_len = strlenW(pwszContainer) + 1;
tmp_len = lstrlenW(pwszContainer) + 1;
orig_tmp = tmp = HeapAlloc(GetProcessHeap(), 0, tmp_len * sizeof(WCHAR));
if (NULL == tmp) return E_FAIL;
lstrcpynW(tmp, pwszContainer, tmp_len);
/* special handling for an empty string and leaf container */
if (!tmp[0] && list_empty(&pContainer->subContainers)) {
hr = DXDiag_CreateDXDiagContainer(&IID_IDxDiagContainer, pContainer, This->pProv, (void **)ppInstance);
if (SUCCEEDED(hr))
TRACE("Succeeded in getting the container instance\n");
goto out;
}
cur = strchrW(tmp, '.');
cur = wcschr(tmp, '.');
while (NULL != cur) {
*cur = '\0'; /* cut tmp string to '.' */
if (!*(cur + 1)) break; /* Account for a lone terminating period, as in "cont1.cont2.". */
@ -180,7 +170,7 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetChildContainer(IDxDiagContainer *i
goto out;
cur++; /* go after '.' (just replaced by \0) */
tmp = cur;
cur = strchrW(tmp, '.');
cur = wcschr(tmp, '.');
}
TRACE("Trying to get container %s\n", debugstr_w(tmp));
@ -227,7 +217,7 @@ static HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(IDxDiagContainer *iface
if (dwIndex == i) {
TRACE("Found property name %s, copying string\n", debugstr_w(p->propName));
lstrcpynW(pwszPropName, p->propName, cchPropName);
return (cchPropName <= strlenW(p->propName)) ?
return (cchPropName <= lstrlenW(p->propName)) ?
DXDIAG_E_INSUFFICIENT_BUFFER : S_OK;
}
++i;

View file

@ -21,7 +21,6 @@
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"

View file

@ -1,47 +0,0 @@
/*
* Copyright (C) 2009 Vitaliy Margolen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#pragma makedep header
import "objidl.idl";
import "strmif.idl";
import "unknwn.idl";
/*****************************************************************************
* IAMFilterData interface
*/
[
object,
uuid(97f7c4d4-547b-4a5f-8332-536430ad2e4d),
pointer_default(unique)
]
interface IAMFilterData : IUnknown
{
typedef [unique] IAMFilterData *LPIAMFILTERDATA;
HRESULT ParseFilterData(
[in] BYTE * rgbFilterData,
[in] ULONG cb,
[out] BYTE ** prgbRegFilter2);
HRESULT CreateFilterData(
[in] REGFILTER2 * prf2,
[out] BYTE ** prgbFilterData,
[out] ULONG * pcb);
}

View file

@ -11,7 +11,7 @@
#include <wingdi.h>
#include <objbase.h>
#include <initguid.h>
#include <fil_data.h>
#include <wine/fil_data.h>
#include <wbemcli.h>
#include <wine/dxdiag.h>

View file

@ -2,8 +2,6 @@
#ifndef __WINE_DXDIAG_PRECOMP_H
#define __WINE_DXDIAG_PRECOMP_H
#include <wine/config.h>
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H

View file

@ -20,13 +20,16 @@
*
*/
#include "config.h"
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#ifdef __REACTOS__
#include <wchar.h>
#endif
#include "dxdiag_private.h"
#include "wine/unicode.h"
#include "winver.h"
#include "objidl.h"
#include "uuids.h"
@ -35,7 +38,7 @@
#include "d3d9.h"
#include "strmif.h"
#include "initguid.h"
#include "fil_data.h"
#include "wine/fil_data.h"
#include "psapi.h"
#include "wbemcli.h"
#include "dsound.h"
@ -271,13 +274,13 @@ static IDxDiagContainerImpl_Container *allocate_information_node(const WCHAR *na
if (name)
{
ret->contName = HeapAlloc(GetProcessHeap(), 0, (strlenW(name) + 1) * sizeof(*name));
ret->contName = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(name) + 1) * sizeof(*name));
if (!ret->contName)
{
HeapFree(GetProcessHeap(), 0, ret);
return NULL;
}
strcpyW(ret->contName, name);
lstrcpyW(ret->contName, name);
}
list_init(&ret->subContainers);
@ -294,13 +297,13 @@ static IDxDiagContainerImpl_Property *allocate_property_information(const WCHAR
if (!ret)
return NULL;
ret->propName = HeapAlloc(GetProcessHeap(), 0, (strlenW(name) + 1) * sizeof(*name));
ret->propName = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(name) + 1) * sizeof(*name));
if (!ret->propName)
{
HeapFree(GetProcessHeap(), 0, ret);
return NULL;
}
strcpyW(ret->propName, name);
lstrcpyW(ret->propName, name);
return ret;
}
@ -495,7 +498,7 @@ static BOOL is_netmeeting_running(void)
for (i = 0; i < list_count; i++)
{
if (get_process_name_from_pid(pid_list[i], process_name, sizeof(process_name)/sizeof(WCHAR)) &&
if (get_process_name_from_pid(pid_list[i], process_name, ARRAY_SIZE(process_name)) &&
!lstrcmpW(conf_exe, process_name))
{
HeapFree(GetProcessHeap(), 0, pid_list);
@ -519,21 +522,23 @@ static HRESULT fill_language_information(IDxDiagContainerImpl_Container *node)
HRESULT hr;
/* szLanguagesLocalized */
GetLocaleInfoW(LOCALE_SYSTEM_DEFAULT, LOCALE_SNATIVELANGNAME, system_lang, sizeof(system_lang)/sizeof(WCHAR));
LoadStringW(dxdiagn_instance, IDS_REGIONAL_SETTING, regional_setting, sizeof(regional_setting)/sizeof(WCHAR));
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SNATIVELANGNAME, user_lang, sizeof(user_lang)/sizeof(WCHAR));
GetLocaleInfoW(LOCALE_SYSTEM_DEFAULT, LOCALE_SNATIVELANGNAME, system_lang, ARRAY_SIZE(system_lang));
LoadStringW(dxdiagn_instance, IDS_REGIONAL_SETTING, regional_setting, ARRAY_SIZE(regional_setting));
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SNATIVELANGNAME, user_lang, ARRAY_SIZE(user_lang));
snprintfW(language_str, sizeof(language_str)/sizeof(WCHAR), languages_fmtW, system_lang, regional_setting, user_lang);
swprintf(language_str, languages_fmtW, system_lang, regional_setting,
user_lang);
hr = add_bstr_property(node, szLanguagesLocalized, language_str);
if (FAILED(hr))
return hr;
/* szLanguagesEnglish */
GetLocaleInfoW(LOCALE_SYSTEM_DEFAULT, LOCALE_SENGLANGUAGE, system_lang, sizeof(system_lang)/sizeof(WCHAR));
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SENGLANGUAGE, user_lang, sizeof(user_lang)/sizeof(WCHAR));
GetLocaleInfoW(LOCALE_SYSTEM_DEFAULT, LOCALE_SENGLANGUAGE, system_lang, ARRAY_SIZE(system_lang));
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SENGLANGUAGE, user_lang, ARRAY_SIZE(user_lang));
snprintfW(language_str, sizeof(language_str)/sizeof(WCHAR), languages_fmtW, system_lang, regional_setting_engW, user_lang);
swprintf(language_str, languages_fmtW, system_lang,
regional_setting_engW, user_lang);
hr = add_bstr_property(node, szLanguagesEnglish, language_str);
if (FAILED(hr))
@ -556,21 +561,21 @@ static HRESULT fill_datetime_information(IDxDiagContainerImpl_Container *node)
GetLocalTime(&curtime);
GetTimeFormatW(LOCALE_NEUTRAL, 0, &curtime, time_fmtW, time_str, sizeof(time_str)/sizeof(WCHAR));
GetTimeFormatW(LOCALE_NEUTRAL, 0, &curtime, time_fmtW, time_str, ARRAY_SIZE(time_str));
/* szTimeLocalized */
GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &curtime, NULL, date_str, sizeof(date_str)/sizeof(WCHAR));
GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &curtime, NULL, date_str, ARRAY_SIZE(date_str));
snprintfW(datetime_str, sizeof(datetime_str)/sizeof(WCHAR), datetime_fmtW, date_str, time_str);
swprintf(datetime_str, datetime_fmtW, date_str, time_str);
hr = add_bstr_property(node, szTimeLocalized, datetime_str);
if (FAILED(hr))
return hr;
/* szTimeEnglish */
GetDateFormatW(LOCALE_NEUTRAL, 0, &curtime, date_fmtW, date_str, sizeof(date_str)/sizeof(WCHAR));
GetDateFormatW(LOCALE_NEUTRAL, 0, &curtime, date_fmtW, date_str, ARRAY_SIZE(date_str));
snprintfW(datetime_str, sizeof(datetime_str)/sizeof(WCHAR), datetime_fmtW, date_str, time_str);
swprintf(datetime_str, datetime_fmtW, date_str, time_str);
hr = add_bstr_property(node, szTimeEnglish, datetime_str);
if (FAILED(hr))
@ -597,7 +602,7 @@ static HRESULT fill_os_string_information(IDxDiagContainerImpl_Container *node,
/* FIXME: OS detection should be performed, and localized OS strings
* should contain translated versions of the "build" phrase. */
for (i = 0; i < sizeof(prop_list)/sizeof(prop_list[0]); i++)
for (i = 0; i < ARRAY_SIZE(prop_list); i++)
{
hr = add_bstr_property(node, prop_list[i], winxpW);
if (FAILED(hr))
@ -675,7 +680,8 @@ static HRESULT fill_processor_information(IDxDiagContainerImpl_Container *node)
if(FAILED(hr))
return hr;
sprintfW(print_buf, processor_fmtW, V_BSTR(&cpu_name), V_I4(&cpu_no), V_I4(&clock_speed));
swprintf(print_buf, processor_fmtW,
V_BSTR(&cpu_name), V_I4(&cpu_no), V_I4(&clock_speed));
VariantClear(&cpu_name);
VariantClear(&cpu_no);
VariantClear(&clock_speed);
@ -799,25 +805,26 @@ static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node)
return hr;
/* FIXME: Roundoff should not be done with truncated division. */
snprintfW(print_buf, sizeof(print_buf)/sizeof(WCHAR), physmem_fmtW, (DWORD)(msex.ullTotalPhys / (1024 * 1024)));
swprintf(print_buf, physmem_fmtW,
(DWORD)(msex.ullTotalPhys / (1024 * 1024)));
hr = add_bstr_property(node, szPhysicalMemoryEnglish, print_buf);
if (FAILED(hr))
return hr;
usedpage_mb = (DWORD)((msex.ullTotalPageFile - msex.ullAvailPageFile) / (1024 * 1024));
availpage_mb = (DWORD)(msex.ullAvailPageFile / (1024 * 1024));
LoadStringW(dxdiagn_instance, IDS_PAGE_FILE_FORMAT, localized_pagefile_fmt, sizeof(localized_pagefile_fmt)/sizeof(WCHAR));
LoadStringW(dxdiagn_instance, IDS_PAGE_FILE_FORMAT, localized_pagefile_fmt,
ARRAY_SIZE(localized_pagefile_fmt));
args[0] = usedpage_mb;
args[1] = availpage_mb;
FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY,
localized_pagefile_fmt, 0, 0, print_buf,
sizeof(print_buf)/sizeof(*print_buf), (__ms_va_list*)args);
FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY, localized_pagefile_fmt,
0, 0, print_buf, ARRAY_SIZE(print_buf), (__ms_va_list*)args);
hr = add_bstr_property(node, szPageFileLocalized, print_buf);
if (FAILED(hr))
return hr;
snprintfW(print_buf, sizeof(print_buf)/sizeof(WCHAR), pagefile_fmtW, usedpage_mb, availpage_mb);
swprintf(print_buf, pagefile_fmtW, usedpage_mb, availpage_mb);
hr = add_bstr_property(node, szPageFileEnglish, print_buf);
if (FAILED(hr))
@ -829,7 +836,7 @@ static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node)
if (FAILED(hr))
return hr;
count = sizeof(computer_name)/sizeof(WCHAR);
count = ARRAY_SIZE(computer_name);
if (!GetComputerNameW(computer_name, &count))
return E_FAIL;
@ -918,31 +925,37 @@ static BOOL get_texture_memory(GUID *adapter, DWORD *available_mem)
static const WCHAR *vendor_id_to_manufacturer_string(DWORD vendor_id)
{
unsigned int i;
static const WCHAR atiW[] = {'A','T','I',' ','T','e','c','h','n','o','l','o','g','i','e','s',' ','I','n','c','.',0};
static const WCHAR nvidiaW[] = {'N','V','I','D','I','A',0};
static const WCHAR intelW[] = {'I','n','t','e','l',' ','C','o','r','p','o','r','a','t','i','o','n',0};
static const WCHAR vmwareW[] = {'V','M','w','a','r','e',0};
static const WCHAR redhatW[] = {'R','e','d',' ','H','a','t',0};
static const WCHAR unknownW[] = {'U','n','k','n','o','w','n',0};
/* Enumeration copied from dlls/wined3d/wined3d_private.h and slightly modified. */
enum pci_vendor
static const struct
{
HW_VENDOR_AMD = 0x1002,
HW_VENDOR_NVIDIA = 0x10de,
HW_VENDOR_INTEL = 0x8086,
DWORD id;
const WCHAR *name;
}
vendors[] =
{
{0x1002, atiW},
{0x10de, nvidiaW},
{0x15ad, vmwareW},
{0x1af4, redhatW},
{0x8086, intelW},
};
switch (vendor_id)
for (i = 0; i < ARRAY_SIZE(vendors); ++i)
{
case HW_VENDOR_AMD:
return atiW;
case HW_VENDOR_NVIDIA:
return nvidiaW;
case HW_VENDOR_INTEL:
return intelW;
default:
FIXME("Unknown PCI vendor ID 0x%04x\n", vendor_id);
return unknownW;
if (vendors[i].id == vendor_id)
return vendors[i].name;
}
FIXME("Unknown PCI vendor ID 0x%04x.\n", vendor_id);
return unknownW;
}
static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node)
@ -985,7 +998,7 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
DWORD available_mem = 0;
BOOL hardware_accel;
snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), adapterid_fmtW, index);
swprintf(buffer, adapterid_fmtW, index);
display_adapter = allocate_information_node(buffer);
if (!display_adapter)
{
@ -1002,9 +1015,11 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
WCHAR descriptionW[sizeof(adapter_info.Description)];
WCHAR devicenameW[sizeof(adapter_info.DeviceName)];
MultiByteToWideChar(CP_ACP, 0, adapter_info.Driver, -1, driverW, sizeof(driverW)/sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, adapter_info.Description, -1, descriptionW, sizeof(descriptionW)/sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, adapter_info.DeviceName, -1, devicenameW, sizeof(devicenameW)/sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, adapter_info.Driver, -1, driverW, ARRAY_SIZE(driverW));
MultiByteToWideChar(CP_ACP, 0, adapter_info.Description, -1, descriptionW,
ARRAY_SIZE(descriptionW));
MultiByteToWideChar(CP_ACP, 0, adapter_info.DeviceName, -1, devicenameW,
ARRAY_SIZE(devicenameW));
hr = add_bstr_property(display_adapter, szDriverName, driverW);
if (FAILED(hr))
@ -1018,7 +1033,7 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
if (FAILED(hr))
goto cleanup;
snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), driverversion_fmtW,
swprintf(buffer, driverversion_fmtW,
HIWORD(adapter_info.DriverVersion.u.HighPart), LOWORD(adapter_info.DriverVersion.u.HighPart),
HIWORD(adapter_info.DriverVersion.u.LowPart), LOWORD(adapter_info.DriverVersion.u.LowPart));
@ -1026,22 +1041,22 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
if (FAILED(hr))
goto cleanup;
snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), id_fmtW, adapter_info.VendorId);
swprintf(buffer, id_fmtW, adapter_info.VendorId);
hr = add_bstr_property(display_adapter, szVendorId, buffer);
if (FAILED(hr))
goto cleanup;
snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), id_fmtW, adapter_info.DeviceId);
swprintf(buffer, id_fmtW, adapter_info.DeviceId);
hr = add_bstr_property(display_adapter, szDeviceId, buffer);
if (FAILED(hr))
goto cleanup;
snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), subsysid_fmtW, adapter_info.SubSysId);
swprintf(buffer, subsysid_fmtW, adapter_info.SubSysId);
hr = add_bstr_property(display_adapter, szSubSysId, buffer);
if (FAILED(hr))
goto cleanup;
snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), id_fmtW, adapter_info.Revision);
swprintf(buffer, id_fmtW, adapter_info.Revision);
hr = add_bstr_property(display_adapter, szRevisionId, buffer);
if (FAILED(hr))
goto cleanup;
@ -1075,7 +1090,7 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
if (FAILED(hr))
goto cleanup;
snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), mode_fmtW, adapter_mode.Width, adapter_mode.Height,
swprintf(buffer, mode_fmtW, adapter_mode.Width, adapter_mode.Height,
depth_for_pixelformat(adapter_mode.Format), adapter_mode.RefreshRate);
hr = add_bstr_property(display_adapter, szDisplayModeLocalized, buffer);
@ -1110,7 +1125,7 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
if (!get_texture_memory(&adapter_info.DeviceIdentifier, &available_mem))
WARN("get_texture_memory helper failed\n");
snprintfW(buffer, sizeof(buffer)/sizeof(buffer[0]), mem_fmt, available_mem / 1000000.0f);
swprintf(buffer, mem_fmt, available_mem / 1000000.0f);
hr = add_bstr_property(display_adapter, szDisplayMemoryLocalized, buffer);
if (FAILED(hr))
@ -1289,7 +1304,7 @@ static HRESULT fill_display_information_fallback(IDxDiagContainerImpl_Container
{
static const WCHAR mem_fmt[] = {'%','.','1','f',' ','M','B',0};
snprintfW(buffer, sizeof(buffer)/sizeof(buffer[0]), mem_fmt, tmp / 1000000.0f);
swprintf(buffer, mem_fmt, tmp / 1000000.0f);
hr = add_bstr_property(display_adapter, szDisplayMemoryLocalized, buffer);
if (FAILED(hr))
@ -1330,7 +1345,7 @@ static HRESULT fill_display_information_fallback(IDxDiagContainerImpl_Container
if (FAILED(hr))
goto cleanup;
for (tmp = 0; tmp < sizeof(empty_properties)/sizeof(empty_properties[0]); tmp++)
for (tmp = 0; tmp < ARRAY_SIZE(empty_properties); tmp++)
{
hr = add_bstr_property(display_adapter, empty_properties[tmp], szEmpty);
if (FAILED(hr))
@ -1393,7 +1408,7 @@ BOOL CALLBACK dsound_enum(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID cont
/* the default device is enumerated twice, one time without GUID */
if (!guid) return TRUE;
snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), deviceid_fmtW, enum_ctx->index);
_snwprintf(buffer, sizeof(buffer)/sizeof(WCHAR), deviceid_fmtW, enum_ctx->index);
device = allocate_information_node(buffer);
if (!device)
{
@ -1417,8 +1432,8 @@ BOOL CALLBACK dsound_enum(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID cont
return FALSE;
name = module;
if ((p = strrchrW(name, '\\'))) name = p + 1;
if ((p = strrchrW(name, '/'))) name = p + 1;
if ((p = wcsrchr(name, '\\'))) name = p + 1;
if ((p = wcsrchr(name, '/'))) name = p + 1;
enum_ctx->hr = add_bstr_property(device, szDriverName, name);
if (FAILED(enum_ctx->hr))
@ -1556,12 +1571,9 @@ static HRESULT fill_file_description(IDxDiagContainerImpl_Container *node, const
if (boolret)
{
snprintfW(szVersion_v, sizeof(szVersion_v)/sizeof(szVersion_v[0]),
szVersionFormat,
HIWORD(pFileInfo->dwFileVersionMS),
LOWORD(pFileInfo->dwFileVersionMS),
HIWORD(pFileInfo->dwFileVersionLS),
LOWORD(pFileInfo->dwFileVersionLS));
swprintf(szVersion_v, szVersionFormat,
HIWORD(pFileInfo->dwFileVersionMS), LOWORD(pFileInfo->dwFileVersionMS),
HIWORD(pFileInfo->dwFileVersionLS), LOWORD(pFileInfo->dwFileVersionLS));
TRACE("Found version as (%s)\n", debugstr_w(szVersion_v));
@ -1633,14 +1645,14 @@ static HRESULT build_directxfiles_tree(IDxDiagContainerImpl_Container *node)
GetSystemDirectoryW(szFilePath, MAX_PATH);
for (i = 0; i < sizeof(dlls) / sizeof(dlls[0]); i++)
for (i = 0; i < ARRAY_SIZE(dlls); i++)
{
static const WCHAR szFormat[] = {'%','d',0};
WCHAR szFileID[5];
IDxDiagContainerImpl_Container *file_container;
snprintfW(szFileID, sizeof(szFileID)/sizeof(szFileID[0]), szFormat, i);
swprintf(szFileID, szFormat, i);
file_container = allocate_information_node(szFileID);
if (!file_container)
@ -1710,12 +1722,12 @@ static HRESULT fill_filter_data_information(IDxDiagContainerImpl_Container *subc
if (FAILED(hr))
goto cleanup;
hr = IAMFilterData_ParseFilterData(pFilterData, pData, cb, (BYTE **)&ppRF);
hr = IAMFilterData_ParseFilterData(pFilterData, pData, cb, &ppRF);
if (FAILED(hr))
goto cleanup;
pRF = ((REGFILTER2**)ppRF)[0];
snprintfW(bufferW, sizeof(bufferW)/sizeof(bufferW[0]), szVersionFormat, pRF->dwVersion);
swprintf(bufferW, szVersionFormat, pRF->dwVersion);
hr = add_bstr_property(subcont, szVersionW, bufferW);
if (FAILED(hr))
goto cleanup;
@ -1887,7 +1899,7 @@ static HRESULT build_directshowfilters_tree(IDxDiagContainerImpl_Container *node
WCHAR bufferW[10];
IDxDiagContainerImpl_Container *subcont;
snprintfW(bufferW, sizeof(bufferW)/sizeof(bufferW[0]), szIdFormat, i);
swprintf(bufferW, szIdFormat, i);
subcont = allocate_information_node(bufferW);
if (!subcont)
{
@ -1984,7 +1996,7 @@ static HRESULT build_information_tree(IDxDiagContainerImpl_Container **pinfo_roo
if (!info_root)
return E_OUTOFMEMORY;
for (index = 0; index < sizeof(root_children)/sizeof(root_children[0]); index++)
for (index = 0; index < ARRAY_SIZE(root_children); index++)
{
IDxDiagContainerImpl_Container *node;
HRESULT hr;

View file

@ -37,7 +37,7 @@ dll/directx/wine/dplay # Synced to WineStaging-3.3
dll/directx/wine/dplayx # Synced to WineStaging-4.18
dll/directx/wine/dpnhpast # Synced to WineStaging-4.18
dll/directx/wine/dsound # Synced to Wine-1.3.29
dll/directx/wine/dxdiagn # Synced to WineStaging-3.3
dll/directx/wine/dxdiagn # Synced to WineStaging-4.18
dll/directx/wine/msdmo # Synced to WineStaging-3.17
dll/directx/wine/qedit # Synced to WineStaging-3.17
dll/directx/wine/quartz # Synced to WineStaging-3.9