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
917d6afa
Commit
917d6afa
authored
Sep 21, 2023
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Implement Win32_OperatingSystem.InstallDate.
parent
ef14808c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
builtin.c
dlls/wbemprox/builtin.c
+25
-2
No files found.
dlls/wbemprox/builtin.c
View file @
917d6afa
...
...
@@ -241,7 +241,7 @@ static const struct column col_operatingsystem[] =
{
L"CurrentTimeZone"
,
CIM_SINT16
},
{
L"FreePhysicalMemory"
,
CIM_UINT64
},
{
L"FreeVirtualMemory"
,
CIM_UINT64
},
{
L"InstallDate"
,
CIM_DATETIME
},
{
L"InstallDate"
,
CIM_DATETIME
|
COL_FLAG_DYNAMIC
},
{
L"LastBootUpTime"
,
CIM_DATETIME
|
COL_FLAG_DYNAMIC
},
{
L"LocalDateTime"
,
CIM_DATETIME
|
COL_FLAG_DYNAMIC
},
{
L"Locale"
,
CIM_STRING
|
COL_FLAG_DYNAMIC
},
...
...
@@ -3749,6 +3749,29 @@ static WCHAR *get_windowsdirectory(void)
return
wcsdup
(
dir
);
}
static
WCHAR
*
get_osinstalldate
(
void
)
{
HANDLE
handle
=
CreateFileW
(
L"c:
\\
"
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_BACKUP_SEMANTICS
,
NULL
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
FILETIME
ft
=
{
0
};
WCHAR
*
ret
;
GetFileTime
(
handle
,
&
ft
,
NULL
,
NULL
);
CloseHandle
(
handle
);
if
((
ret
=
malloc
(
26
*
sizeof
(
WCHAR
)
)))
{
SYSTEMTIME
st
=
{
0
};
FileTimeToSystemTime
(
&
ft
,
&
st
);
swprintf
(
ret
,
26
,
L"%04u%02u%02u%02u%02u%02u.%06u+000"
,
st
.
wYear
,
st
.
wMonth
,
st
.
wDay
,
st
.
wHour
,
st
.
wMinute
,
st
.
wSecond
,
st
.
wMilliseconds
*
1000
);
return
ret
;
}
}
return
wcsdup
(
L"20230101000000.000000+000"
);
}
static
enum
fill_status
fill_operatingsystem
(
struct
table
*
table
,
const
struct
expr
*
cond
)
{
struct
record_operatingsystem
*
rec
;
...
...
@@ -3773,7 +3796,7 @@ static enum fill_status fill_operatingsystem( struct table *table, const struct
rec
->
currenttimezone
=
get_currenttimezone
();
rec
->
freephysicalmemory
=
get_available_physical_memory
()
/
1024
;
rec
->
freevirtualmemory
=
get_available_virtual_memory
()
/
1024
;
rec
->
installdate
=
L"20140101000000.000000+000"
;
rec
->
installdate
=
get_osinstalldate
()
;
rec
->
lastbootuptime
=
get_lastbootuptime
();
rec
->
localdatetime
=
get_localdatetime
();
rec
->
locale
=
get_locale
();
...
...
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