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
6a19b999
Commit
6a19b999
authored
Sep 28, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineboot: Set the computer name keys.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9fff80d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
Makefile.in
programs/wineboot/Makefile.in
+1
-1
wineboot.c
programs/wineboot/wineboot.c
+38
-0
No files found.
programs/wineboot/Makefile.in
View file @
6a19b999
MODULE
=
wineboot.exe
APPMODE
=
-mconsole
IMPORTS
=
uuid advapi32
IMPORTS
=
uuid advapi32
ws2_32
DELAYIMPORTS
=
shell32 shlwapi version user32 setupapi newdev
EXTRADLLFLAGS
=
-mno-cygwin
...
...
programs/wineboot/wineboot.c
View file @
6a19b999
...
...
@@ -64,6 +64,7 @@
#include <ntstatus.h>
#define WIN32_NO_STATUS
#include <windows.h>
#include <ws2tcpip.h>
#include <winternl.h>
#include <ddk/wdm.h>
#include <sddl.h>
...
...
@@ -815,6 +816,42 @@ static void create_environment_registry_keys( void )
RegCloseKey
(
env_key
);
}
/* create the ComputerName registry keys */
static
void
create_computer_name_keys
(
void
)
{
struct
addrinfo
hints
=
{
0
},
*
res
;
char
*
dot
,
buffer
[
256
];
HKEY
key
,
subkey
;
if
(
gethostname
(
buffer
,
sizeof
(
buffer
)
))
return
;
hints
.
ai_flags
=
AI_CANONNAME
;
if
(
getaddrinfo
(
buffer
,
NULL
,
&
hints
,
&
res
))
return
;
dot
=
strchr
(
res
->
ai_canonname
,
'.'
);
if
(
dot
)
*
dot
++
=
0
;
else
dot
=
res
->
ai_canonname
+
strlen
(
res
->
ai_canonname
);
SetComputerNameExA
(
ComputerNamePhysicalDnsDomain
,
dot
);
SetComputerNameExA
(
ComputerNamePhysicalDnsHostname
,
res
->
ai_canonname
);
freeaddrinfo
(
res
);
if
(
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
L"System
\\
CurrentControlSet
\\
Control
\\
ComputerName"
,
&
key
))
return
;
if
(
!
RegOpenKeyW
(
key
,
L"ComputerName"
,
&
subkey
))
{
DWORD
type
,
size
=
sizeof
(
buffer
);
if
(
RegQueryValueExW
(
subkey
,
L"ComputerName"
,
NULL
,
&
type
,
(
BYTE
*
)
buffer
,
&
size
))
size
=
0
;
RegCloseKey
(
subkey
);
if
(
size
&&
!
RegCreateKeyExW
(
key
,
L"ActiveComputerName"
,
0
,
NULL
,
REG_OPTION_VOLATILE
,
KEY_ALL_ACCESS
,
NULL
,
&
subkey
,
NULL
))
{
RegSetValueExW
(
subkey
,
L"ComputerName"
,
0
,
type
,
(
const
BYTE
*
)
buffer
,
size
);
RegCloseKey
(
subkey
);
}
}
RegCloseKey
(
key
);
}
static
void
create_volatile_environment_registry_key
(
void
)
{
WCHAR
path
[
MAX_PATH
];
...
...
@@ -1657,6 +1694,7 @@ int __cdecl main( int argc, char *argv[] )
create_hardware_registry_keys
();
create_dynamic_registry_keys
();
create_environment_registry_keys
();
create_computer_name_keys
();
wininit
();
pendingRename
();
...
...
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