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
5252d760
Commit
5252d760
authored
Jul 02, 2019
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use the machine ID for the system UUID on Linux.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
16e5c78b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
nt.c
dlls/ntdll/nt.c
+41
-0
No files found.
dlls/ntdll/nt.c
View file @
5252d760
...
...
@@ -101,6 +101,7 @@ struct smbios_system {
BYTE
product
;
BYTE
version
;
BYTE
serial
;
BYTE
uuid
[
16
];
};
struct
smbios_board
{
...
...
@@ -2064,6 +2065,45 @@ static size_t get_smbios_string(const char *path, char *str, size_t size)
return
len
;
}
static
void
get_system_uuid
(
GUID
*
uuid
)
{
static
const
unsigned
char
hex
[]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 0x00 */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 0x10 */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 0x20 */
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 0x30 */
0
,
10
,
11
,
12
,
13
,
14
,
15
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 0x40 */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 0x50 */
0
,
10
,
11
,
12
,
13
,
14
,
15
/* 0x60 */
};
int
fd
;
memset
(
uuid
,
0xff
,
sizeof
(
*
uuid
)
);
if
((
fd
=
open
(
"/var/lib/dbus/machine-id"
,
O_RDONLY
))
!=
-
1
)
{
unsigned
char
buf
[
32
],
*
p
=
buf
;
if
(
read
(
fd
,
buf
,
sizeof
(
buf
)
)
==
sizeof
(
buf
))
{
uuid
->
Data1
=
hex
[
p
[
6
]]
<<
28
|
hex
[
p
[
7
]]
<<
24
|
hex
[
p
[
4
]]
<<
20
|
hex
[
p
[
5
]]
<<
16
|
hex
[
p
[
2
]]
<<
12
|
hex
[
p
[
3
]]
<<
8
|
hex
[
p
[
0
]]
<<
4
|
hex
[
p
[
1
]];
uuid
->
Data2
=
hex
[
p
[
10
]]
<<
12
|
hex
[
p
[
11
]]
<<
8
|
hex
[
p
[
8
]]
<<
4
|
hex
[
p
[
9
]];
uuid
->
Data3
=
hex
[
p
[
14
]]
<<
12
|
hex
[
p
[
15
]]
<<
8
|
hex
[
p
[
12
]]
<<
4
|
hex
[
p
[
13
]];
uuid
->
Data4
[
0
]
=
hex
[
p
[
16
]]
<<
4
|
hex
[
p
[
17
]];
uuid
->
Data4
[
1
]
=
hex
[
p
[
18
]]
<<
4
|
hex
[
p
[
19
]];
uuid
->
Data4
[
2
]
=
hex
[
p
[
20
]]
<<
4
|
hex
[
p
[
21
]];
uuid
->
Data4
[
3
]
=
hex
[
p
[
22
]]
<<
4
|
hex
[
p
[
23
]];
uuid
->
Data4
[
4
]
=
hex
[
p
[
24
]]
<<
4
|
hex
[
p
[
25
]];
uuid
->
Data4
[
5
]
=
hex
[
p
[
26
]]
<<
4
|
hex
[
p
[
27
]];
uuid
->
Data4
[
6
]
=
hex
[
p
[
28
]]
<<
4
|
hex
[
p
[
29
]];
uuid
->
Data4
[
7
]
=
hex
[
p
[
30
]]
<<
4
|
hex
[
p
[
31
]];
}
close
(
fd
);
}
}
static
NTSTATUS
get_firmware_info
(
SYSTEM_FIRMWARE_TABLE_INFORMATION
*
sfti
,
ULONG
available_len
,
ULONG
*
required_len
)
{
switch
(
sfti
->
ProviderSignature
)
...
...
@@ -2163,6 +2203,7 @@ static NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULONG
system
->
product
=
system_product_len
?
++
string_count
:
0
;
system
->
version
=
system_version_len
?
++
string_count
:
0
;
system
->
serial
=
system_serial_len
?
++
string_count
:
0
;
get_system_uuid
(
(
GUID
*
)
system
->
uuid
);
buffer
+=
sizeof
(
struct
smbios_system
);
copy_smbios_string
(
&
buffer
,
system_vendor
,
system_vendor_len
);
...
...
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