Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7664adb2
Commit
7664adb2
authored
Jun 15, 2011
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jun 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxdiagn: Add additional adapter identifier properties for DxDiag_DisplayDevices subcontainers.
parent
77c194ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
21 deletions
+97
-21
provider.c
dlls/dxdiagn/provider.c
+85
-21
container.c
dlls/dxdiagn/tests/container.c
+12
-0
No files found.
dlls/dxdiagn/provider.c
View file @
7664adb2
...
@@ -60,6 +60,12 @@ static const WCHAR dwHeight[] = {'d','w','H','e','i','g','h','t',0};
...
@@ -60,6 +60,12 @@ 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
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
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
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
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
};
/* IDxDiagProvider IUnknown parts follow: */
/* IDxDiagProvider IUnknown parts follow: */
static
HRESULT
WINAPI
IDxDiagProviderImpl_QueryInterface
(
PDXDIAGPROVIDER
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
static
HRESULT
WINAPI
IDxDiagProviderImpl_QueryInterface
(
PDXDIAGPROVIDER
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
...
@@ -756,6 +762,35 @@ static BOOL get_texture_memory(GUID *adapter, DWORD *available_mem)
...
@@ -756,6 +762,35 @@ static BOOL get_texture_memory(GUID *adapter, DWORD *available_mem)
return
FALSE
;
return
FALSE
;
}
}
static
const
WCHAR
*
vendor_id_to_manufacturer_string
(
DWORD
vendor_id
)
{
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
unknownW
[]
=
{
'U'
,
'n'
,
'k'
,
'n'
,
'o'
,
'w'
,
'n'
,
0
};
/* Enumeration copied from dlls/wined3d/wined3d_private.h and slightly modified. */
enum
pci_vendor
{
HW_VENDOR_AMD
=
0x1002
,
HW_VENDOR_NVIDIA
=
0x10de
,
HW_VENDOR_INTEL
=
0x8086
,
};
switch
(
vendor_id
)
{
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
;
}
}
static
HRESULT
fill_display_information_d3d
(
IDxDiagContainerImpl_Container
*
node
)
static
HRESULT
fill_display_information_d3d
(
IDxDiagContainerImpl_Container
*
node
)
{
{
IDxDiagContainerImpl_Container
*
display_adapter
;
IDxDiagContainerImpl_Container
*
display_adapter
;
...
@@ -772,7 +807,9 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
...
@@ -772,7 +807,9 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
for
(
index
=
0
;
index
<
count
;
index
++
)
for
(
index
=
0
;
index
<
count
;
index
++
)
{
{
static
const
WCHAR
adapterid_fmtW
[]
=
{
'%'
,
'u'
,
0
};
static
const
WCHAR
adapterid_fmtW
[]
=
{
'%'
,
'u'
,
0
};
static
const
WCHAR
driverversion_fmtW
[]
=
{
'%'
,
'u'
,
'.'
,
'%'
,
'u'
,
'.'
,
'%'
,
'0'
,
'4'
,
'u'
,
'.'
,
'%'
,
'0'
,
'4'
,
'u'
,
0
};
static
const
WCHAR
id_fmtW
[]
=
{
'0'
,
'x'
,
'%'
,
'0'
,
'4'
,
'x'
,
0
};
static
const
WCHAR
id_fmtW
[]
=
{
'0'
,
'x'
,
'%'
,
'0'
,
'4'
,
'x'
,
0
};
static
const
WCHAR
subsysid_fmtW
[]
=
{
'0'
,
'x'
,
'%'
,
'0'
,
'8'
,
'x'
,
0
};
static
const
WCHAR
mem_fmt
[]
=
{
'%'
,
'.'
,
'1'
,
'f'
,
' '
,
'M'
,
'B'
,
0
};
static
const
WCHAR
mem_fmt
[]
=
{
'%'
,
'.'
,
'1'
,
'f'
,
' '
,
'M'
,
'B'
,
0
};
D3DADAPTER_IDENTIFIER9
adapter_info
;
D3DADAPTER_IDENTIFIER9
adapter_info
;
...
@@ -792,13 +829,15 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
...
@@ -792,13 +829,15 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
hr
=
IDirect3D9_GetAdapterIdentifier
(
pDirect3D9
,
index
,
0
,
&
adapter_info
);
hr
=
IDirect3D9_GetAdapterIdentifier
(
pDirect3D9
,
index
,
0
,
&
adapter_info
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
{
WCHAR
d
evicenameW
[
sizeof
(
adapter_info
.
DeviceName
)];
WCHAR
d
riverW
[
sizeof
(
adapter_info
.
Driver
)];
WCHAR
descriptionW
[
sizeof
(
adapter_info
.
Description
)];
WCHAR
descriptionW
[
sizeof
(
adapter_info
.
Description
)];
WCHAR
devicenameW
[
sizeof
(
adapter_info
.
DeviceName
)];
MultiByteToWideChar
(
CP_ACP
,
0
,
adapter_info
.
D
eviceName
,
-
1
,
devicenameW
,
sizeof
(
devicename
W
)
/
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
adapter_info
.
D
river
,
-
1
,
driverW
,
sizeof
(
driver
W
)
/
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
adapter_info
.
Description
,
-
1
,
descriptionW
,
sizeof
(
descriptionW
)
/
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
));
hr
=
add_bstr_property
(
display_adapter
,
szD
eviceName
,
devicename
W
);
hr
=
add_bstr_property
(
display_adapter
,
szD
riverName
,
driver
W
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
goto
cleanup
;
goto
cleanup
;
...
@@ -806,8 +845,15 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
...
@@ -806,8 +845,15 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
goto
cleanup
;
goto
cleanup
;
StringFromGUID2
(
&
adapter_info
.
DeviceIdentifier
,
buffer
,
39
);
hr
=
add_bstr_property
(
display_adapter
,
szDeviceName
,
devicenameW
);
hr
=
add_bstr_property
(
display_adapter
,
szDeviceIdentifier
,
buffer
);
if
(
FAILED
(
hr
))
goto
cleanup
;
snprintfW
(
buffer
,
sizeof
(
buffer
)
/
sizeof
(
WCHAR
),
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
));
hr
=
add_bstr_property
(
display_adapter
,
szDriverVersion
,
buffer
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
goto
cleanup
;
goto
cleanup
;
...
@@ -820,6 +866,25 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
...
@@ -820,6 +866,25 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
hr
=
add_bstr_property
(
display_adapter
,
szDeviceId
,
buffer
);
hr
=
add_bstr_property
(
display_adapter
,
szDeviceId
,
buffer
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
goto
cleanup
;
goto
cleanup
;
snprintfW
(
buffer
,
sizeof
(
buffer
)
/
sizeof
(
WCHAR
),
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
);
hr
=
add_bstr_property
(
display_adapter
,
szRevisionId
,
buffer
);
if
(
FAILED
(
hr
))
goto
cleanup
;
StringFromGUID2
(
&
adapter_info
.
DeviceIdentifier
,
buffer
,
39
);
hr
=
add_bstr_property
(
display_adapter
,
szDeviceIdentifier
,
buffer
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
add_bstr_property
(
display_adapter
,
szManufacturer
,
vendor_id_to_manufacturer_string
(
adapter_info
.
VendorId
));
if
(
FAILED
(
hr
))
goto
cleanup
;
}
}
hr
=
IDirect3D9_GetAdapterDisplayMode
(
pDirect3D9
,
index
,
&
adapter_mode
);
hr
=
IDirect3D9_GetAdapterDisplayMode
(
pDirect3D9
,
index
,
&
adapter_mode
);
...
@@ -833,6 +898,10 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
...
@@ -833,6 +898,10 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
goto
cleanup
;
goto
cleanup
;
hr
=
add_ui4_property
(
display_adapter
,
dwRefreshRate
,
adapter_mode
.
RefreshRate
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
add_ui4_property
(
display_adapter
,
dwBpp
,
depth_for_pixelformat
(
adapter_mode
.
Format
));
hr
=
add_ui4_property
(
display_adapter
,
dwBpp
,
depth_for_pixelformat
(
adapter_mode
.
Format
));
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
goto
cleanup
;
goto
cleanup
;
...
@@ -869,6 +938,10 @@ cleanup:
...
@@ -869,6 +938,10 @@ cleanup:
static
HRESULT
fill_display_information_fallback
(
IDxDiagContainerImpl_Container
*
node
)
static
HRESULT
fill_display_information_fallback
(
IDxDiagContainerImpl_Container
*
node
)
{
{
static
const
WCHAR
szAdapterID
[]
=
{
'0'
,
0
};
static
const
WCHAR
szAdapterID
[]
=
{
'0'
,
0
};
static
const
WCHAR
*
empty_properties
[]
=
{
szDeviceIdentifier
,
szVendorId
,
szDeviceId
,
szKeyDeviceKey
,
szKeyDeviceID
,
szDriverName
,
szDriverVersion
,
szSubSysId
,
szRevisionId
,
szManufacturer
};
IDxDiagContainerImpl_Container
*
display_adapter
;
IDxDiagContainerImpl_Container
*
display_adapter
;
HRESULT
hr
;
HRESULT
hr
;
...
@@ -946,25 +1019,16 @@ static HRESULT fill_display_information_fallback(IDxDiagContainerImpl_Container
...
@@ -946,25 +1019,16 @@ static HRESULT fill_display_information_fallback(IDxDiagContainerImpl_Container
}
}
}
}
hr
=
add_
bstr_property
(
display_adapter
,
szDeviceIdentifier
,
szEmpty
);
hr
=
add_
ui4_property
(
display_adapter
,
dwRefreshRate
,
60
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
goto
cleanup
;
goto
cleanup
;
hr
=
add_bstr_property
(
display_adapter
,
szVendorId
,
szEmpty
);
for
(
tmp
=
0
;
tmp
<
sizeof
(
empty_properties
)
/
sizeof
(
empty_properties
[
0
]);
tmp
++
)
if
(
FAILED
(
hr
))
{
goto
cleanup
;
hr
=
add_bstr_property
(
display_adapter
,
empty_properties
[
tmp
],
szEmpty
);
if
(
FAILED
(
hr
))
hr
=
add_bstr_property
(
display_adapter
,
szDeviceId
,
szEmpty
);
goto
cleanup
;
if
(
FAILED
(
hr
))
}
goto
cleanup
;
hr
=
add_bstr_property
(
display_adapter
,
szKeyDeviceKey
,
szEmpty
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
add_bstr_property
(
display_adapter
,
szKeyDeviceID
,
szEmpty
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
S_OK
;
hr
=
S_OK
;
cleanup:
cleanup:
...
...
dlls/dxdiagn/tests/container.c
View file @
7664adb2
...
@@ -930,6 +930,12 @@ static void test_DxDiag_DisplayDevices(void)
...
@@ -930,6 +930,12 @@ static void test_DxDiag_DisplayDevices(void)
static
const
WCHAR
dwBpp
[]
=
{
'd'
,
'w'
,
'B'
,
'p'
,
'p'
,
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
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
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
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
struct
property_test
property_tests
[]
=
static
const
struct
property_test
property_tests
[]
=
{
{
...
@@ -945,6 +951,12 @@ static void test_DxDiag_DisplayDevices(void)
...
@@ -945,6 +951,12 @@ static void test_DxDiag_DisplayDevices(void)
{
dwBpp
,
VT_UI4
},
{
dwBpp
,
VT_UI4
},
{
szDisplayMemoryLocalized
,
VT_BSTR
},
{
szDisplayMemoryLocalized
,
VT_BSTR
},
{
szDisplayMemoryEnglish
,
VT_BSTR
},
{
szDisplayMemoryEnglish
,
VT_BSTR
},
{
szDriverName
,
VT_BSTR
},
{
szDriverVersion
,
VT_BSTR
},
{
szSubSysId
,
VT_BSTR
},
{
szRevisionId
,
VT_BSTR
},
{
dwRefreshRate
,
VT_UI4
},
{
szManufacturer
,
VT_BSTR
},
};
};
IDxDiagContainer
*
display_cont
=
NULL
;
IDxDiagContainer
*
display_cont
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment