- Add a stub for GetOwnerModuleFromTcpEntry
authorCameron Gutman <aicommander@gmail.com>
Sat, 6 Mar 2010 18:30:55 +0000 (18:30 +0000)
committerCameron Gutman <aicommander@gmail.com>
Sat, 6 Mar 2010 18:30:55 +0000 (18:30 +0000)
 - Patch by Olaf Siejka

svn path=/trunk/; revision=45960

reactos/dll/win32/iphlpapi/iphlpapi.spec
reactos/dll/win32/iphlpapi/iphlpapi_main.c
reactos/include/psdk/iphlpapi.h
reactos/include/psdk/iprtrmib.h

index b07c464..f65673b 100644 (file)
@@ -61,7 +61,7 @@
 @ stdcall GetNetworkParams( ptr ptr )
 @ stdcall GetNumberOfInterfaces( ptr )
 @ stub GetOwnerModuleFromTcp6Entry
-@ stub GetOwnerModuleFromTcpEntry
+@ stdcall GetOwnerModuleFromTcpEntry ( ptr long ptr ptr )
 @ stub GetOwnerModuleFromUdp6Entry
 @ stub GetOwnerModuleFromUdpEntry
 @ stdcall GetPerAdapterInfo( long ptr ptr )
index 47146e6..0bc146b 100644 (file)
@@ -1505,6 +1505,33 @@ DWORD WINAPI GetNumberOfInterfaces(PDWORD pdwNumIf)
 }
 
 
+/******************************************************************
+ *    GetOwnerModuleFromTcpEntry (IPHLPAPI.@)
+ *
+ * Get data about the module that issued the context bind for a specific IPv4 TCP endpoint in a MIB table row
+ *
+ * PARAMS
+ *  pTcpEntry [in]    pointer to a MIB_TCPROW_OWNER_MODULE structure
+ *  Class [in]         TCPIP_OWNER_MODULE_INFO_CLASS enumeration value
+ *  Buffer [out]       pointer a buffer containing a TCPIP_OWNER_MODULE_BASIC_INFO structure with the owner module data. 
+ *  pdwSize [in, out]  estimated size of the structure returned in Buffer, in bytes
+ *
+ * RETURNS
+ *  Success: NO_ERROR
+ *  Failure: ERROR_INSUFFICIENT_BUFFER, ERROR_INVALID_PARAMETER, ERROR_NOT_ENOUGH_MEMORY
+ *            ERROR_NOT_FOUND or ERROR_PARTIAL_COPY
+ *
+ * NOTES
+ * The type of data returned in Buffer is indicated by the value of the Class parameter.
+ */
+DWORD WINAPI GetOwnerModuleFromTcpEntry( PMIB_TCPROW_OWNER_MODULE pTcpEntry, TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID Buffer, PDWORD pdwSize)
+{
+       DWORD ret = NO_ERROR;
+       UNIMPLEMENTED;
+       return ret;     
+}
+
+
 /******************************************************************
  *    GetPerAdapterInfo (IPHLPAPI.@)
  *
index 9637194..56c32fd 100644 (file)
@@ -35,6 +35,7 @@ DWORD WINAPI GetIpStatistics(PMIB_IPSTATS);
 DWORD WINAPI GetIpStatisticsEx(PMIB_IPSTATS,DWORD);
 DWORD WINAPI GetNetworkParams(PFIXED_INFO,PULONG);
 DWORD WINAPI GetNumberOfInterfaces(PDWORD);
+DWORD WINAPI GetOwnerModuleFromTcpEntry(PMIB_TCPROW_OWNER_MODULE,TCPIP_OWNER_MODULE_INFO_CLASS,PVOID,PDWORD);
 DWORD WINAPI GetPerAdapterInfo(ULONG,PIP_PER_ADAPTER_INFO, PULONG);
 BOOL WINAPI GetRTTAndHopCount(IPAddr,PULONG,ULONG,PULONG);
 DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS);
index 6f18294..179a793 100644 (file)
@@ -25,6 +25,9 @@
 #define MAXLEN_IFDESCR 256
 #define MAXLEN_PHYSADDR 8
 
+//It should be 16 according to Lei Shen blog (http://www.mychinaworks.com/blog/lshen/2008/04/16/220/
+#define TCPIP_OWNING_MODULE_SIZE 16
+
 typedef struct _MIB_IFROW
 {
     WCHAR wszName[MAX_INTERFACE_NAME_LEN];
@@ -286,6 +289,20 @@ typedef struct _MIB_IPNETTABLE
     MIB_IPNETROW table[1];
 } MIB_IPNETTABLE, *PMIB_IPNETTABLE;
 
+typedef struct _MIB_TCPROW_OWNER_MODULE {
+  DWORD         dwState;
+  DWORD         dwLocalAddr;
+  DWORD         dwLocalPort;
+  DWORD         dwRemoteAddr;
+  DWORD         dwRemotePort;
+  DWORD         dwOwningPid;
+  LARGE_INTEGER liCreateTimestamp;
+  ULONGLONG     OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE];
+} MIB_TCPROW_OWNER_MODULE, *PMIB_TCPROW_OWNER_MODULE;
+
+typedef enum  {
+  TCPIP_OWNER_MODULE_INFO_BASIC 
+} TCPIP_OWNER_MODULE_INFO_CLASS, *PTCPIP_OWNER_MODULE_INFO_CLASS;
 
 typedef enum {
     TCP_TABLE_BASIC_LISTENER,