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
381d30ac
Commit
381d30ac
authored
Sep 18, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Add helpers to retrieve the system directory and OS architecture.
parent
d8d6821c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
18 deletions
+24
-18
builtin.c
dlls/wbemprox/builtin.c
+24
-18
No files found.
dlls/wbemprox/builtin.c
View file @
381d30ac
...
...
@@ -831,31 +831,37 @@ static void fill_processor( struct table *table )
table
->
num_rows
=
count
;
}
static
void
fill_os
(
struct
table
*
table
)
static
const
WCHAR
*
get_osarchitecture
(
void
)
{
struct
record_operatingsystem
*
rec
;
WCHAR
path
[
MAX_PATH
];
SYSTEM_INFO
info
;
GetNativeSystemInfo
(
&
info
);
if
(
info
.
u
.
s
.
wProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_AMD64
)
return
os_64bitW
;
return
os_32bitW
;
}
static
WCHAR
*
get_systemdirectory
(
void
)
{
void
*
redir
;
WCHAR
*
ret
;
if
(
!
(
table
->
data
=
heap_alloc
(
sizeof
(
*
rec
)
)))
return
;
rec
=
(
struct
record_operatingsystem
*
)
table
->
data
;
rec
->
caption
=
os_captionW
;
rec
->
csdversion
=
os_csdversionW
;
if
(
!
(
ret
=
heap_alloc
(
MAX_PATH
*
sizeof
(
WCHAR
)
)))
return
NULL
;
Wow64DisableWow64FsRedirection
(
&
redir
);
GetSystemDirectoryW
(
ret
,
MAX_PATH
);
Wow64RevertWow64FsRedirection
(
redir
);
return
ret
;
}
GetNativeSystemInfo
(
&
info
);
if
(
info
.
u
.
s
.
wProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_AMD64
)
rec
->
osarchitecture
=
os_64bitW
;
else
rec
->
osarchitecture
=
os_32bitW
;
static
void
fill_os
(
struct
table
*
table
)
{
struct
record_operatingsystem
*
rec
;
rec
->
oslanguage
=
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
)
;
if
(
!
(
table
->
data
=
heap_alloc
(
sizeof
(
*
rec
)
)))
return
;
Wow64DisableWow64FsRedirection
(
&
redir
);
GetSystemDirectoryW
(
path
,
MAX_PATH
);
Wow64RevertWow64FsRedirection
(
redir
);
rec
->
systemdirectory
=
heap_strdupW
(
path
);
rec
=
(
struct
record_operatingsystem
*
)
table
->
data
;
rec
->
caption
=
os_captionW
;
rec
->
csdversion
=
os_csdversionW
;
rec
->
osarchitecture
=
get_osarchitecture
();
rec
->
oslanguage
=
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
);
rec
->
systemdirectory
=
get_systemdirectory
();
TRACE
(
"created 1 row
\n
"
);
table
->
num_rows
=
1
;
...
...
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