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
f516a230
Commit
f516a230
authored
May 18, 2020
by
Hans Leidekker
Committed by
Alexandre Julliard
May 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Get the operating system serial number from the registry.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
37cb6cc7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
builtin.c
dlls/wbemprox/builtin.c
+23
-2
No files found.
dlls/wbemprox/builtin.c
View file @
f516a230
...
...
@@ -243,7 +243,7 @@ static const struct column col_operatingsystem[] =
{
L"OSProductSuite"
,
CIM_UINT32
},
{
L"OSType"
,
CIM_UINT16
},
{
L"Primary"
,
CIM_BOOLEAN
},
{
L"SerialNumber"
,
CIM_STRING
},
{
L"SerialNumber"
,
CIM_STRING
|
COL_FLAG_DYNAMIC
},
{
L"ServicePackMajorVersion"
,
CIM_UINT16
},
{
L"ServicePackMinorVersion"
,
CIM_UINT16
},
{
L"SuiteMask"
,
CIM_UINT32
},
...
...
@@ -3360,6 +3360,27 @@ static WCHAR *get_osname( const WCHAR *caption )
memcpy
(
ret
+
len
,
partitionW
,
sizeof
(
partitionW
)
);
return
ret
;
}
static
WCHAR
*
get_osserialnumber
(
void
)
{
HKEY
hkey
=
0
;
DWORD
size
,
type
;
WCHAR
*
ret
=
NULL
;
if
(
!
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
L"Software
\\
Microsoft
\\
Windows NT
\\
CurrentVersion"
,
0
,
KEY_READ
,
&
hkey
)
&&
!
RegQueryValueExW
(
hkey
,
L"ProductId"
,
NULL
,
&
type
,
NULL
,
&
size
)
&&
type
==
REG_SZ
&&
(
ret
=
heap_alloc
(
size
+
sizeof
(
WCHAR
)
)))
{
size
+=
sizeof
(
WCHAR
);
if
(
RegQueryValueExW
(
hkey
,
L"ProductId"
,
NULL
,
NULL
,
(
BYTE
*
)
ret
,
&
size
))
{
heap_free
(
ret
);
ret
=
NULL
;
}
}
if
(
hkey
)
RegCloseKey
(
hkey
);
if
(
!
ret
)
return
heap_strdupW
(
L"12345-OEM-1234567-12345"
);
return
ret
;
}
static
WCHAR
*
get_osversion
(
OSVERSIONINFOEXW
*
ver
)
{
WCHAR
*
ret
=
heap_alloc
(
33
*
sizeof
(
WCHAR
)
);
...
...
@@ -3414,7 +3435,7 @@ static enum fill_status fill_operatingsystem( struct table *table, const struct
rec
->
osproductsuite
=
2461140
;
/* Windows XP Professional */
rec
->
ostype
=
18
;
/* WINNT */
rec
->
primary
=
-
1
;
rec
->
serialnumber
=
L"12345-OEM-1234567-12345"
;
rec
->
serialnumber
=
get_osserialnumber
()
;
rec
->
servicepackmajor
=
ver
.
wServicePackMajor
;
rec
->
servicepackminor
=
ver
.
wServicePackMinor
;
rec
->
suitemask
=
272
;
/* Single User + Terminal */
...
...
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