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
5ac2f4b5
Commit
5ac2f4b5
authored
Nov 10, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineboot: Fall back to initial hostname if the name lookup fails.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50084
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
df0c5d23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
wineboot.c
programs/wineboot/wineboot.c
+6
-6
No files found.
programs/wineboot/wineboot.c
View file @
5ac2f4b5
...
@@ -820,18 +820,18 @@ static void create_environment_registry_keys( void )
...
@@ -820,18 +820,18 @@ static void create_environment_registry_keys( void )
static
void
create_computer_name_keys
(
void
)
static
void
create_computer_name_keys
(
void
)
{
{
struct
addrinfo
hints
=
{
0
},
*
res
;
struct
addrinfo
hints
=
{
0
},
*
res
;
char
*
dot
,
buffer
[
256
];
char
*
dot
,
buffer
[
256
]
,
*
name
=
buffer
;
HKEY
key
,
subkey
;
HKEY
key
,
subkey
;
if
(
gethostname
(
buffer
,
sizeof
(
buffer
)
))
return
;
if
(
gethostname
(
buffer
,
sizeof
(
buffer
)
))
return
;
hints
.
ai_flags
=
AI_CANONNAME
;
hints
.
ai_flags
=
AI_CANONNAME
;
if
(
getaddrinfo
(
buffer
,
NULL
,
&
hints
,
&
res
))
return
;
if
(
!
getaddrinfo
(
buffer
,
NULL
,
&
hints
,
&
res
))
name
=
res
->
ai_canonname
;
dot
=
strchr
(
res
->
ai_canon
name
,
'.'
);
dot
=
strchr
(
name
,
'.'
);
if
(
dot
)
*
dot
++
=
0
;
if
(
dot
)
*
dot
++
=
0
;
else
dot
=
res
->
ai_canonname
+
strlen
(
res
->
ai_canon
name
);
else
dot
=
name
+
strlen
(
name
);
SetComputerNameExA
(
ComputerNamePhysicalDnsDomain
,
dot
);
SetComputerNameExA
(
ComputerNamePhysicalDnsDomain
,
dot
);
SetComputerNameExA
(
ComputerNamePhysicalDnsHostname
,
res
->
ai_canon
name
);
SetComputerNameExA
(
ComputerNamePhysicalDnsHostname
,
name
);
freeaddrinfo
(
res
);
if
(
name
!=
buffer
)
freeaddrinfo
(
res
);
if
(
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
L"System
\\
CurrentControlSet
\\
Control
\\
ComputerName"
,
&
key
))
if
(
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
L"System
\\
CurrentControlSet
\\
Control
\\
ComputerName"
,
&
key
))
return
;
return
;
...
...
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