Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
bd7ad13b
Commit
bd7ad13b
authored
Apr 03, 2011
by
Andrew Nguyen
Committed by
Alexandre Julliard
Apr 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxdiagn: Add date and time properties to the DxDiag_SystemInfo container.
parent
35d313c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
provider.c
dlls/dxdiagn/provider.c
+41
-0
container.c
dlls/dxdiagn/tests/container.c
+4
-0
No files found.
dlls/dxdiagn/provider.c
View file @
bd7ad13b
...
...
@@ -474,6 +474,43 @@ static HRESULT fill_language_information(IDxDiagContainerImpl_Container *node)
return
S_OK
;
}
static
HRESULT
fill_datetime_information
(
IDxDiagContainerImpl_Container
*
node
)
{
static
const
WCHAR
date_fmtW
[]
=
{
'M'
,
'\''
,
'/'
,
'\''
,
'd'
,
'\''
,
'/'
,
'\''
,
'y'
,
'y'
,
'y'
,
'y'
,
0
};
static
const
WCHAR
time_fmtW
[]
=
{
'H'
,
'H'
,
'\''
,
':'
,
'\''
,
'm'
,
'm'
,
'\''
,
':'
,
'\''
,
's'
,
's'
,
0
};
static
const
WCHAR
datetime_fmtW
[]
=
{
'%'
,
's'
,
','
,
' '
,
'%'
,
's'
,
0
};
static
const
WCHAR
szTimeLocalized
[]
=
{
's'
,
'z'
,
'T'
,
'i'
,
'm'
,
'e'
,
'L'
,
'o'
,
'c'
,
'a'
,
'l'
,
'i'
,
'z'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
szTimeEnglish
[]
=
{
's'
,
'z'
,
'T'
,
'i'
,
'm'
,
'e'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
SYSTEMTIME
curtime
;
WCHAR
date_str
[
80
],
time_str
[
80
],
datetime_str
[
200
];
HRESULT
hr
;
GetLocalTime
(
&
curtime
);
GetTimeFormatW
(
LOCALE_NEUTRAL
,
0
,
&
curtime
,
time_fmtW
,
time_str
,
sizeof
(
time_str
)
/
sizeof
(
WCHAR
));
/* szTimeLocalized */
GetDateFormatW
(
LOCALE_USER_DEFAULT
,
DATE_LONGDATE
,
&
curtime
,
NULL
,
date_str
,
sizeof
(
date_str
)
/
sizeof
(
WCHAR
));
snprintfW
(
datetime_str
,
sizeof
(
datetime_str
)
/
sizeof
(
WCHAR
),
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
));
snprintfW
(
datetime_str
,
sizeof
(
datetime_str
)
/
sizeof
(
WCHAR
),
datetime_fmtW
,
date_str
,
time_str
);
hr
=
add_bstr_property
(
node
,
szTimeEnglish
,
datetime_str
);
if
(
FAILED
(
hr
))
return
hr
;
return
S_OK
;
}
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
};
...
...
@@ -597,6 +634,10 @@ static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node)
if
(
FAILED
(
hr
))
return
hr
;
hr
=
fill_datetime_information
(
node
);
if
(
FAILED
(
hr
))
return
hr
;
return
S_OK
;
}
...
...
dlls/dxdiagn/tests/container.c
View file @
bd7ad13b
...
...
@@ -786,6 +786,8 @@ static void test_DxDiag_SystemInfo(void)
static
const
WCHAR
szMachineNameEnglish
[]
=
{
's'
,
'z'
,
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'N'
,
'a'
,
'm'
,
'e'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
static
const
WCHAR
szLanguagesLocalized
[]
=
{
's'
,
'z'
,
'L'
,
'a'
,
'n'
,
'g'
,
'u'
,
'a'
,
'g'
,
'e'
,
's'
,
'L'
,
'o'
,
'c'
,
'a'
,
'l'
,
'i'
,
'z'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
szLanguagesEnglish
[]
=
{
's'
,
'z'
,
'L'
,
'a'
,
'n'
,
'g'
,
'u'
,
'a'
,
'g'
,
'e'
,
's'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
static
const
WCHAR
szTimeLocalized
[]
=
{
's'
,
'z'
,
'T'
,
'i'
,
'm'
,
'e'
,
'L'
,
'o'
,
'c'
,
'a'
,
'l'
,
'i'
,
'z'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
szTimeEnglish
[]
=
{
's'
,
'z'
,
'T'
,
'i'
,
'm'
,
'e'
,
'E'
,
'n'
,
'g'
,
'l'
,
'i'
,
's'
,
'h'
,
0
};
static
const
struct
{
...
...
@@ -814,6 +816,8 @@ static void test_DxDiag_SystemInfo(void)
{
szMachineNameEnglish
,
VT_BSTR
},
{
szLanguagesLocalized
,
VT_BSTR
},
{
szLanguagesEnglish
,
VT_BSTR
},
{
szTimeLocalized
,
VT_BSTR
},
{
szTimeEnglish
,
VT_BSTR
},
};
HRESULT
hr
;
...
...
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