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
b45b4048
Commit
b45b4048
authored
Aug 05, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Aug 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Add support for the EnableRouting member.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
13130774
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
45 deletions
+41
-45
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+41
-45
No files found.
dlls/iphlpapi/iphlpapi_main.c
View file @
b45b4048
...
...
@@ -2395,64 +2395,60 @@ err:
* Get the network parameters for the local computer.
*
* PARAMS
*
pFixedI
nfo [Out] buffer for network parameters
*
pOutBufLen
[In/Out] length of output buffer
*
i
nfo [Out] buffer for network parameters
*
size
[In/Out] length of output buffer
*
* RETURNS
* Success: NO_ERROR
* Failure: error code from winerror.h
*
* NOTES
* If
pOutBufLen
is less than required, the function will return
* ERROR_INSUFFICIENT_BUFFER, and
pOutBufLen
will be set to the required byte
* If
size
is less than required, the function will return
* ERROR_INSUFFICIENT_BUFFER, and
size
will be set to the required byte
* size.
*/
DWORD
WINAPI
GetNetworkParams
(
PFIXED_INFO
pFixedInfo
,
PULONG
pOutBufLen
)
DWORD
WINAPI
GetNetworkParams
(
FIXED_INFO
*
info
,
ULONG
*
size
)
{
DWORD
ret
,
size
,
serverListSize
;
LONG
regReturn
;
HKEY
hK
ey
;
DWORD
needed
=
sizeof
(
*
info
),
dns_size
,
err
;
MIB_IPSTATS
ip_stats
;
HKEY
k
ey
;
TRACE
(
"pFixedInfo %p, pOutBufLen %p
\n
"
,
pFixedInfo
,
pOutBufLen
);
if
(
!
pOutBufLen
)
return
ERROR_INVALID_PARAMETER
;
TRACE
(
"info %p, size %p
\n
"
,
info
,
size
);
if
(
!
size
)
return
ERROR_INVALID_PARAMETER
;
get_dns_server_list
(
NULL
,
NULL
,
NULL
,
&
serverListSize
);
size
=
sizeof
(
FIXED_INFO
)
+
serverListSize
-
sizeof
(
IP_ADDR_STRING
);
if
(
!
pFixedInfo
||
*
pOutBufLen
<
size
)
{
*
pOutBufLen
=
size
;
return
ERROR_BUFFER_OVERFLOW
;
}
if
(
get_dns_server_list
(
NULL
,
NULL
,
NULL
,
&
dns_size
)
==
ERROR_BUFFER_OVERFLOW
)
needed
+=
dns_size
-
sizeof
(
IP_ADDR_STRING
);
if
(
!
info
||
*
size
<
needed
)
{
*
size
=
needed
;
return
ERROR_BUFFER_OVERFLOW
;
}
memset
(
pFixedInfo
,
0
,
size
);
size
=
sizeof
(
pFixedInfo
->
HostName
);
GetComputerNameExA
(
ComputerNameDnsHostname
,
pFixedInfo
->
HostName
,
&
size
);
size
=
sizeof
(
pFixedInfo
->
DomainName
);
GetComputerNameExA
(
ComputerNameDnsDomain
,
pFixedInfo
->
DomainName
,
&
size
);
get_dns_server_list
(
NULL
,
&
pFixedInfo
->
DnsServerList
,
(
IP_ADDR_STRING
*
)(
pFixedInfo
+
1
),
&
serverListSize
);
/* Assume the first DNS server in the list is the "current" DNS server: */
pFixedInfo
->
CurrentDnsServer
=
&
pFixedInfo
->
DnsServerList
;
pFixedInfo
->
NodeType
=
HYBRID_NODETYPE
;
regReturn
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"SYSTEM
\\
CurrentControlSet
\\
Services
\\
VxD
\\
MSTCP"
,
0
,
KEY_READ
,
&
hKey
);
if
(
regReturn
!=
ERROR_SUCCESS
)
regReturn
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"SYSTEM
\\
CurrentControlSet
\\
Services
\\
NetBT
\\
Parameters"
,
0
,
KEY_READ
,
&
hKey
);
if
(
regReturn
==
ERROR_SUCCESS
)
{
DWORD
size
=
sizeof
(
pFixedInfo
->
ScopeId
);
RegQueryValueExA
(
hKey
,
"ScopeID"
,
NULL
,
NULL
,
(
LPBYTE
)
pFixedInfo
->
ScopeId
,
&
size
);
RegCloseKey
(
hKey
);
}
*
size
=
needed
;
memset
(
info
,
0
,
needed
);
needed
=
sizeof
(
info
->
HostName
);
GetComputerNameExA
(
ComputerNameDnsHostname
,
info
->
HostName
,
&
needed
);
needed
=
sizeof
(
info
->
DomainName
);
GetComputerNameExA
(
ComputerNameDnsDomain
,
info
->
DomainName
,
&
needed
);
get_dns_server_list
(
NULL
,
&
info
->
DnsServerList
,
(
IP_ADDR_STRING
*
)(
info
+
1
),
&
dns_size
);
info
->
CurrentDnsServer
=
&
info
->
DnsServerList
;
info
->
NodeType
=
HYBRID_NODETYPE
;
err
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"SYSTEM
\\
CurrentControlSet
\\
Services
\\
VxD
\\
MSTCP"
,
0
,
KEY_READ
,
&
key
);
if
(
err
)
err
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"SYSTEM
\\
CurrentControlSet
\\
Services
\\
NetBT
\\
Parameters"
,
0
,
KEY_READ
,
&
key
);
if
(
!
err
)
{
needed
=
sizeof
(
info
->
ScopeId
);
RegQueryValueExA
(
key
,
"ScopeID"
,
NULL
,
NULL
,
(
BYTE
*
)
info
->
ScopeId
,
&
needed
);
RegCloseKey
(
key
);
}
/* FIXME: can check whether routing's enabled in /proc/sys/net/ipv4/ip_forward
I suppose could also check for a listener on port 53 to set EnableDns */
ret
=
NO_ERROR
;
TRACE
(
"returning %d
\n
"
,
ret
);
return
ret
;
if
(
!
GetIpStatistics
(
&
ip_stats
))
info
->
EnableRouting
=
(
ip_stats
.
u
.
Forwarding
==
MIB_IP_FORWARDING
);
return
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