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
94670d40
Commit
94670d40
authored
Nov 28, 2003
by
Juan Lang
Committed by
Alexandre Julliard
Nov 28, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement the TCP table query, netstat.exe now shows TCP listening and
connected sockets.
parent
2835ebee
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
4 deletions
+47
-4
socket.c
dlls/wsock32/socket.c
+46
-3
wscontrol.h
dlls/wsock32/wscontrol.h
+1
-1
No files found.
dlls/wsock32/socket.c
View file @
94670d40
...
...
@@ -421,9 +421,7 @@ DWORD WINAPI WsControl(DWORD protocol,
break
;
}
/* FIXME: not real name. Value is 0x101. Obviously it's a bad name,
* too, because it can be used to get the ARP table--see below. */
case
IP_MIB_ROUTETABLE_ENTRY_ID
:
case
IP_MIB_TABLE_ENTRY_ID
:
{
switch
(
pcommand
->
toi_entity
.
tei_entity
)
{
...
...
@@ -517,6 +515,51 @@ DWORD WINAPI WsControl(DWORD protocol,
}
break
;
case
CO_TL_ENTITY
:
{
DWORD
tcpTableSize
,
numEntries
,
ret
;
PMIB_TCPTABLE
table
;
DWORD
i
;
if
(
!
pcbResponseInfoLen
)
return
ERROR_BAD_ENVIRONMENT
;
GetTcpTable
(
NULL
,
&
tcpTableSize
,
FALSE
);
numEntries
=
min
(
tcpTableSize
-
sizeof
(
MIB_TCPTABLE
),
0
)
/
sizeof
(
MIB_TCPROW
)
+
1
;
if
(
*
pcbResponseInfoLen
<
sizeof
(
MIB_TCPROW
)
*
numEntries
)
return
(
ERROR_LOCK_VIOLATION
);
table
=
(
PMIB_TCPTABLE
)
calloc
(
1
,
tcpTableSize
);
if
(
!
table
)
return
ERROR_NOT_ENOUGH_MEMORY
;
ret
=
GetTcpTable
(
table
,
&
tcpTableSize
,
FALSE
);
if
(
ret
!=
NO_ERROR
)
return
ret
;
if
(
*
pcbResponseInfoLen
<
sizeof
(
MIB_TCPROW
)
*
table
->
dwNumEntries
)
{
free
(
table
);
return
ERROR_LOCK_VIOLATION
;
}
for
(
i
=
0
;
i
<
table
->
dwNumEntries
;
i
++
)
{
USHORT
sPort
;
sPort
=
ntohs
((
USHORT
)
table
->
table
[
i
].
dwLocalPort
);
table
->
table
[
i
].
dwLocalPort
=
(
DWORD
)
sPort
;
sPort
=
ntohs
((
USHORT
)
table
->
table
[
i
].
dwRemotePort
);
table
->
table
[
i
].
dwRemotePort
=
(
DWORD
)
sPort
;
}
memcpy
(
pResponseInfo
,
table
->
table
,
sizeof
(
MIB_TCPROW
)
*
table
->
dwNumEntries
);
/* calculate the length of the data in the output buffer */
*
pcbResponseInfoLen
=
sizeof
(
MIB_TCPROW
)
*
table
->
dwNumEntries
;
free
(
table
);
}
break
;
default:
{
FIXME
(
"Command ID Not Supported -> toi_id=0x%lx, toi_entity={tei_entity=0x%lx, tei_instance=0x%lx}, toi_class=0x%lx
\n
"
,
...
...
dlls/wsock32/wscontrol.h
View file @
94670d40
...
...
@@ -119,7 +119,7 @@ typedef struct IPRouteEntry {
/* Constants for use in the toi_id field */
#define ENTITY_LIST_ID 0
/* to get the list of entity IDs */
#define ENTITY_TYPE_ID 1
/* it's an interface; what type of interface is it? */
#define IP_MIB_
ROUTE
TABLE_ENTRY_ID 0x101
/* not real name */
#define IP_MIB_TABLE_ENTRY_ID 0x101
/* not real name */
#define IP_MIB_ADDRTABLE_ENTRY_ID 0x102
/* Constants for use in the toi_class field */
...
...
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