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
f6ca7522
Commit
f6ca7522
authored
Oct 06, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Oct 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Implement IcmpParseReplies().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
da81d63f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
15 deletions
+50
-15
iphlpapi.spec
dlls/iphlpapi/iphlpapi.spec
+1
-1
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+14
-0
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+35
-14
No files found.
dlls/iphlpapi/iphlpapi.spec
View file @
f6ca7522
...
...
@@ -157,7 +157,7 @@
@ stdcall Icmp6SendEcho2(ptr ptr ptr ptr ptr ptr ptr long ptr ptr long long)
@ stdcall IcmpCloseHandle(ptr)
@ stdcall IcmpCreateFile()
@ st
ub IcmpParseReplies
@ st
dcall IcmpParseReplies(ptr long)
@ stdcall IcmpSendEcho2Ex(ptr ptr ptr ptr long long ptr long ptr ptr long long)
@ stdcall IcmpSendEcho2(ptr ptr ptr ptr long ptr long ptr ptr long long)
@ stdcall IcmpSendEcho(ptr long ptr long ptr ptr long long)
...
...
dlls/iphlpapi/iphlpapi_main.c
View file @
f6ca7522
...
...
@@ -2,6 +2,7 @@
* iphlpapi dll implementation
*
* Copyright (C) 2003,2006 Juan Lang
* Copyright 2021 Huw Davies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -4541,3 +4542,16 @@ DWORD WINAPI ParseNetworkString(const WCHAR *str, DWORD type,
return
ERROR_INVALID_PARAMETER
;
}
/******************************************************************
* IcmpParseReplies (IPHLPAPI.@)
*/
DWORD
WINAPI
IcmpParseReplies
(
void
*
reply
,
DWORD
reply_size
)
{
ICMP_ECHO_REPLY
*
icmp_reply
=
reply
;
DWORD
num_pkts
=
icmp_reply
->
Reserved
;
icmp_reply
->
Reserved
=
0
;
if
(
!
num_pkts
)
SetLastError
(
icmp_reply
->
Status
);
return
num_pkts
;
}
dlls/iphlpapi/tests/iphlpapi.c
View file @
f6ca7522
...
...
@@ -1043,20 +1043,40 @@ static void testIcmpSendEcho(void)
IcmpCloseHandle
(
icmp
);
}
/*
still-to-be-tested NT4-onward functions:
CreateIpForwardEntry
DeleteIpForwardEntry
CreateIpNetEntry
DeleteIpNetEntry
GetFriendlyIfIndex
GetRTTAndHopCount
SetIfEntry
SetIpForwardEntry
SetIpNetEntry
SetIpStatistics
SetIpTTL
*/
static
void
testIcmpParseReplies
(
void
)
{
ICMP_ECHO_REPLY
reply
=
{
0
};
DWORD
ret
;
SetLastError
(
0xdeadbeef
);
ret
=
IcmpParseReplies
(
&
reply
,
sizeof
(
reply
)
);
ok
(
ret
==
0
,
"ret %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
0
,
"gle %d
\n
"
,
GetLastError
()
);
reply
.
Status
=
12345
;
SetLastError
(
0xdeadbeef
);
ret
=
IcmpParseReplies
(
&
reply
,
sizeof
(
reply
)
);
ok
(
ret
==
0
,
"ret %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
12345
,
"gle %d
\n
"
,
GetLastError
()
);
ok
(
reply
.
Status
==
12345
,
"status %d
\n
"
,
reply
.
Status
);
reply
.
Reserved
=
1
;
SetLastError
(
0xdeadbeef
);
ret
=
IcmpParseReplies
(
&
reply
,
sizeof
(
reply
)
);
ok
(
ret
==
1
,
"ret %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"gle %d
\n
"
,
GetLastError
()
);
ok
(
reply
.
Status
==
12345
,
"status %d
\n
"
,
reply
.
Status
);
ok
(
!
reply
.
Reserved
,
"reserved %d
\n
"
,
reply
.
Reserved
);
reply
.
Reserved
=
3
;
SetLastError
(
0xdeadbeef
);
ret
=
IcmpParseReplies
(
&
reply
,
sizeof
(
reply
)
);
ok
(
ret
==
3
,
"ret %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"gle %d
\n
"
,
GetLastError
()
);
ok
(
reply
.
Status
==
12345
,
"status %d
\n
"
,
reply
.
Status
);
ok
(
!
reply
.
Reserved
,
"reserved %d
\n
"
,
reply
.
Reserved
);
}
static
void
testWinNT4Functions
(
void
)
{
testGetNumberOfInterfaces
();
...
...
@@ -1076,6 +1096,7 @@ static void testWinNT4Functions(void)
testGetUdpTable
();
testSetTcpEntry
();
testIcmpSendEcho
();
testIcmpParseReplies
();
}
static
void
testGetInterfaceInfo
(
void
)
...
...
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