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
57ed5bf3
Commit
57ed5bf3
authored
Sep 16, 2013
by
Huw Davies
Committed by
Alexandre Julliard
Sep 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Use proper multibyte to unicode conversion.
parent
b145f42b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
17 deletions
+7
-17
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+7
-17
No files found.
dlls/iphlpapi/iphlpapi_main.c
View file @
57ed5bf3
...
@@ -1027,13 +1027,11 @@ static BOOL is_ip_address_string(const char *str)
...
@@ -1027,13 +1027,11 @@ static BOOL is_ip_address_string(const char *str)
static
ULONG
get_dns_suffix
(
WCHAR
*
suffix
,
ULONG
*
len
)
static
ULONG
get_dns_suffix
(
WCHAR
*
suffix
,
ULONG
*
len
)
{
{
ULONG
size
,
i
;
ULONG
size
,
i
;
char
*
found_suffix
=
NULL
;
const
char
*
found_suffix
=
""
;
/* Always return a NULL-terminated string, even if it's empty. */
initialise_resolver
();
initialise_resolver
();
/* Always return a NULL-terminated string, even if it's empty. */
for
(
i
=
0
;
!*
found_suffix
&&
i
<
MAXDNSRCH
+
1
&&
_res
.
dnsrch
[
i
];
i
++
)
size
=
sizeof
(
WCHAR
);
for
(
i
=
0
,
found_suffix
=
NULL
;
!
found_suffix
&&
i
<
MAXDNSRCH
+
1
&&
_res
.
dnsrch
[
i
];
i
++
)
{
{
/* This uses a heuristic to select a DNS suffix:
/* This uses a heuristic to select a DNS suffix:
* the first, non-IP address string is selected.
* the first, non-IP address string is selected.
...
@@ -1041,22 +1039,14 @@ static ULONG get_dns_suffix(WCHAR *suffix, ULONG *len)
...
@@ -1041,22 +1039,14 @@ static ULONG get_dns_suffix(WCHAR *suffix, ULONG *len)
if
(
!
is_ip_address_string
(
_res
.
dnsrch
[
i
]))
if
(
!
is_ip_address_string
(
_res
.
dnsrch
[
i
]))
found_suffix
=
_res
.
dnsrch
[
i
];
found_suffix
=
_res
.
dnsrch
[
i
];
}
}
if
(
found_suffix
)
size
+=
strlen
(
found_suffix
)
*
sizeof
(
WCHAR
);
size
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
found_suffix
,
-
1
,
NULL
,
0
)
*
sizeof
(
WCHAR
);
if
(
!
suffix
||
*
len
<
size
)
if
(
!
suffix
||
*
len
<
size
)
{
{
*
len
=
size
;
*
len
=
size
;
return
ERROR_BUFFER_OVERFLOW
;
return
ERROR_BUFFER_OVERFLOW
;
}
}
*
len
=
size
;
*
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
found_suffix
,
-
1
,
suffix
,
*
len
/
sizeof
(
WCHAR
)
)
*
sizeof
(
WCHAR
);
if
(
found_suffix
)
{
char
*
p
;
for
(
p
=
found_suffix
;
*
p
;
p
++
)
*
suffix
++
=
*
p
;
}
*
suffix
=
0
;
return
ERROR_SUCCESS
;
return
ERROR_SUCCESS
;
}
}
...
@@ -1139,7 +1129,7 @@ ULONG WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG family, ULONG flags, P
...
@@ -1139,7 +1129,7 @@ ULONG WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG family, ULONG flags, P
if
(
aa
->
IfType
!=
IF_TYPE_SOFTWARE_LOOPBACK
&&
aa
->
OperStatus
==
IfOperStatusUp
)
if
(
aa
->
IfType
!=
IF_TYPE_SOFTWARE_LOOPBACK
&&
aa
->
OperStatus
==
IfOperStatusUp
)
aa
->
DnsSuffix
=
dnsSuffix
;
aa
->
DnsSuffix
=
dnsSuffix
;
else
else
aa
->
DnsSuffix
=
(
WCHAR
*
)((
BYTE
*
)
dnsSuffix
+
dns_suffix_size
-
2
)
;
aa
->
DnsSuffix
=
dnsSuffix
+
dns_suffix_size
/
sizeof
(
WCHAR
)
-
1
;
}
}
ret
=
ERROR_SUCCESS
;
ret
=
ERROR_SUCCESS
;
}
}
...
...
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