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
2bfbac07
Commit
2bfbac07
authored
Aug 31, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 31, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxdiagn: Initialize ProcessorEnglish property.
parent
1711b99e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
2 deletions
+80
-2
provider.c
dlls/dxdiagn/provider.c
+78
-2
container.c
dlls/dxdiagn/tests/container.c
+2
-0
No files found.
dlls/dxdiagn/provider.c
View file @
2bfbac07
...
...
@@ -38,6 +38,7 @@
#include "initguid.h"
#include "fil_data.h"
#include "psapi.h"
#include "wbemcli.h"
#include "wine/debug.h"
...
...
@@ -554,6 +555,82 @@ static HRESULT fill_os_string_information(IDxDiagContainerImpl_Container *node,
return
S_OK
;
}
static
HRESULT
fill_processor_information
(
IDxDiagContainerImpl_Container
*
node
)
{
static
const
WCHAR
szProcessorEnglish
[]
=
{
's'
,
'z'
,
'P'
,
'r'
,
'o'
,
'c'
,
'e'
,
's'
,
's'
,
'o'
,
'r'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
static
const
WCHAR
cimv2W
[]
=
{
'\\'
,
'\\'
,
'.'
,
'\\'
,
'r'
,
'o'
,
'o'
,
't'
,
'\\'
,
'c'
,
'i'
,
'm'
,
'v'
,
'2'
,
0
};
static
const
WCHAR
proc_classW
[]
=
{
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
'_'
,
'P'
,
'r'
,
'o'
,
'c'
,
'e'
,
's'
,
's'
,
'o'
,
'r'
,
0
};
static
const
WCHAR
nameW
[]
=
{
'N'
,
'a'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
max_clock_speedW
[]
=
{
'M'
,
'a'
,
'x'
,
'C'
,
'l'
,
'o'
,
'c'
,
'k'
,
'S'
,
'p'
,
'e'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
cpu_noW
[]
=
{
'N'
,
'u'
,
'm'
,
'b'
,
'e'
,
'r'
,
'O'
,
'f'
,
'L'
,
'o'
,
'g'
,
'i'
,
'c'
,
'a'
,
'l'
,
'P'
,
'r'
,
'o'
,
'c'
,
'e'
,
's'
,
's'
,
'o'
,
'r'
,
's'
,
0
};
static
const
WCHAR
processor_fmtW
[]
=
{
'%'
,
's'
,
'('
,
'%'
,
'd'
,
' '
,
'C'
,
'P'
,
'U'
,
's'
,
')'
,
','
,
' '
,
'~'
,
'%'
,
'd'
,
'M'
,
'H'
,
'z'
,
0
};
IWbemLocator
*
wbem_locator
;
IWbemServices
*
wbem_service
;
IWbemClassObject
*
wbem_class
;
IEnumWbemClassObject
*
wbem_enum
;
VARIANT
cpu_name
,
cpu_no
,
clock_speed
;
WCHAR
print_buf
[
200
];
BSTR
bstr
;
ULONG
no
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_WbemLocator
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWbemLocator
,
(
void
**
)
&
wbem_locator
);
if
(
FAILED
(
hr
))
return
hr
;
bstr
=
SysAllocString
(
cimv2W
);
if
(
!
bstr
)
{
IWbemLocator_Release
(
wbem_locator
);
return
E_OUTOFMEMORY
;
}
hr
=
IWbemLocator_ConnectServer
(
wbem_locator
,
bstr
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
NULL
,
&
wbem_service
);
IWbemLocator_Release
(
wbem_locator
);
SysFreeString
(
bstr
);
if
(
FAILED
(
hr
))
return
hr
;
bstr
=
SysAllocString
(
proc_classW
);
if
(
!
bstr
)
{
IWbemServices_Release
(
wbem_service
);
return
E_OUTOFMEMORY
;
}
hr
=
IWbemServices_CreateInstanceEnum
(
wbem_service
,
bstr
,
WBEM_FLAG_SYSTEM_ONLY
,
NULL
,
&
wbem_enum
);
IWbemServices_Release
(
wbem_service
);
SysFreeString
(
bstr
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IEnumWbemClassObject_Next
(
wbem_enum
,
1000
,
1
,
&
wbem_class
,
&
no
);
IEnumWbemClassObject_Release
(
wbem_enum
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IWbemClassObject_Get
(
wbem_class
,
cpu_noW
,
0
,
&
cpu_no
,
NULL
,
NULL
);
if
(
FAILED
(
hr
))
{
IWbemClassObject_Release
(
wbem_class
);
return
hr
;
}
hr
=
IWbemClassObject_Get
(
wbem_class
,
max_clock_speedW
,
0
,
&
clock_speed
,
NULL
,
NULL
);
if
(
FAILED
(
hr
))
{
IWbemClassObject_Release
(
wbem_class
);
return
hr
;
}
hr
=
IWbemClassObject_Get
(
wbem_class
,
nameW
,
0
,
&
cpu_name
,
NULL
,
NULL
);
IWbemClassObject_Release
(
wbem_class
);
if
(
FAILED
(
hr
))
return
hr
;
sprintfW
(
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
);
return
add_bstr_property
(
node
,
szProcessorEnglish
,
print_buf
);
}
static
HRESULT
build_systeminfo_tree
(
IDxDiagContainerImpl_Container
*
node
)
{
static
const
WCHAR
dwDirectXVersionMajor
[]
=
{
'd'
,
'w'
,
'D'
,
'i'
,
'r'
,
'e'
,
'c'
,
't'
,
'X'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'M'
,
'a'
,
'j'
,
'o'
,
'r'
,
0
};
...
...
@@ -584,7 +661,6 @@ static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node)
static
const
WCHAR
szSystemManufacturerEnglish
[]
=
{
's'
,
'z'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'M'
,
'a'
,
'n'
,
'u'
,
'f'
,
'a'
,
'c'
,
't'
,
'u'
,
'r'
,
'e'
,
'r'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
static
const
WCHAR
szSystemModelEnglish
[]
=
{
's'
,
'z'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'M'
,
'o'
,
'd'
,
'e'
,
'l'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
static
const
WCHAR
szBIOSEnglish
[]
=
{
's'
,
'z'
,
'B'
,
'I'
,
'O'
,
'S'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
static
const
WCHAR
szProcessorEnglish
[]
=
{
's'
,
'z'
,
'P'
,
'r'
,
'o'
,
'c'
,
'e'
,
's'
,
's'
,
'o'
,
'r'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
static
const
WCHAR
szSetupParamEnglish
[]
=
{
's'
,
'z'
,
'S'
,
'e'
,
't'
,
'u'
,
'p'
,
'P'
,
'a'
,
'r'
,
'a'
,
'm'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
static
const
WCHAR
szDxDiagVersion
[]
=
{
's'
,
'z'
,
'D'
,
'x'
,
'D'
,
'i'
,
'a'
,
'g'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
0
};
...
...
@@ -725,7 +801,7 @@ static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node)
if
(
FAILED
(
hr
))
return
hr
;
hr
=
add_bstr_property
(
node
,
szProcessorEnglish
,
szEmpty
);
hr
=
fill_processor_information
(
node
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
dlls/dxdiagn/tests/container.c
View file @
2bfbac07
...
...
@@ -856,6 +856,7 @@ static void test_DxDiag_SystemInfo(void)
static
const
WCHAR
szOSEnglish
[]
=
{
's'
,
'z'
,
'O'
,
'S'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
static
const
WCHAR
szOSExEnglish
[]
=
{
's'
,
'z'
,
'O'
,
'S'
,
'E'
,
'x'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
static
const
WCHAR
szOSExLongEnglish
[]
=
{
's'
,
'z'
,
'O'
,
'S'
,
'E'
,
'x'
,
'L'
,
'o'
,
'n'
,
'g'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
static
const
WCHAR
szProcessorEnglish
[]
=
{
's'
,
'z'
,
'P'
,
'r'
,
'o'
,
'c'
,
'e'
,
's'
,
's'
,
'o'
,
'r'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
static
const
struct
property_test
property_tests
[]
=
{
...
...
@@ -891,6 +892,7 @@ static void test_DxDiag_SystemInfo(void)
{
szOSEnglish
,
VT_BSTR
},
{
szOSExEnglish
,
VT_BSTR
},
{
szOSExLongEnglish
,
VT_BSTR
},
{
szProcessorEnglish
,
VT_BSTR
},
};
IDxDiagContainer
*
container
;
...
...
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