<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Map Port to Process oder Process to Port - Welche WINAPI Befehle sind hierbei hilfreich ?]]></title><description><![CDATA[<p>Hi,</p>
<p>ich möchte gerne eine application alias fport ( foundstone ) oder MS PortQry ( <a href="http://www.microsoft.com/downloads/thankyou.aspx?familyId=89811747-C74B-4638-A2D5-AC828BDC6983&amp;displayLang=en&amp;oRef=http%3a%2f%2fwww.microsoft.com%2fdownloads%2fdetails.aspx%3ffamilyid%3d69BA779B-BAE9-4243-B9D6-63E62B4BCD2E%26displaylang%3den" rel="nofollow">http://www.microsoft.com/downloads/thankyou.aspx?familyId=89811747-C74B-4638-A2D5-AC828BDC6983&amp;displayLang=en&amp;oRef=http%3A%2F%2Fwww.microsoft.com%2Fdownloads%2Fdetails.aspx%3Ffamilyid%3D69BA779B-BAE9-4243-B9D6-63E62B4BCD2E%26displaylang%3Den</a> ) schreiben.</p>
<p>Sie soll also angeben welche Ports im listening / connected ... Status sind und die Prozesse die den Port nutzen angeben.</p>
<p>Durchwühle jetzt schon seit Stunden die API aber finde nichts passendes bräuchte einen Anfangspunkt.</p>
<p>tia</p>
<p>MFG c°h°</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/139901/map-port-to-process-oder-process-to-port-welche-winapi-befehle-sind-hierbei-hilfreich</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Jul 2026 15:55:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/139901.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 10 Mar 2006 10:59:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Map Port to Process oder Process to Port - Welche WINAPI Befehle sind hierbei hilfreich ? on Fri, 10 Mar 2006 10:59:12 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich möchte gerne eine application alias fport ( foundstone ) oder MS PortQry ( <a href="http://www.microsoft.com/downloads/thankyou.aspx?familyId=89811747-C74B-4638-A2D5-AC828BDC6983&amp;displayLang=en&amp;oRef=http%3a%2f%2fwww.microsoft.com%2fdownloads%2fdetails.aspx%3ffamilyid%3d69BA779B-BAE9-4243-B9D6-63E62B4BCD2E%26displaylang%3den" rel="nofollow">http://www.microsoft.com/downloads/thankyou.aspx?familyId=89811747-C74B-4638-A2D5-AC828BDC6983&amp;displayLang=en&amp;oRef=http%3A%2F%2Fwww.microsoft.com%2Fdownloads%2Fdetails.aspx%3Ffamilyid%3D69BA779B-BAE9-4243-B9D6-63E62B4BCD2E%26displaylang%3Den</a> ) schreiben.</p>
<p>Sie soll also angeben welche Ports im listening / connected ... Status sind und die Prozesse die den Port nutzen angeben.</p>
<p>Durchwühle jetzt schon seit Stunden die API aber finde nichts passendes bräuchte einen Anfangspunkt.</p>
<p>tia</p>
<p>MFG c°h°</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1013160</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1013160</guid><dc:creator><![CDATA[c°h°]]></dc:creator><pubDate>Fri, 10 Mar 2006 10:59:12 GMT</pubDate></item><item><title><![CDATA[Reply to Map Port to Process oder Process to Port - Welche WINAPI Befehle sind hierbei hilfreich ? on Fri, 10 Mar 2006 11:28:09 GMT]]></title><description><![CDATA[<p>vielleicht hift das: <a href="http://www.sysinternals.com/Files/NetstatpSource.zip" rel="nofollow">http://www.sysinternals.com/Files/NetstatpSource.zip</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1013181</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1013181</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Fri, 10 Mar 2006 11:28:09 GMT</pubDate></item><item><title><![CDATA[Reply to Map Port to Process oder Process to Port - Welche WINAPI Befehle sind hierbei hilfreich ? on Fri, 10 Mar 2006 11:57:18 GMT]]></title><description><![CDATA[<p>das sieht ja shconmal grossartig aus danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1013212</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1013212</guid><dc:creator><![CDATA[c°h°]]></dc:creator><pubDate>Fri, 10 Mar 2006 11:57:18 GMT</pubDate></item><item><title><![CDATA[Reply to Map Port to Process oder Process to Port - Welche WINAPI Befehle sind hierbei hilfreich ? on Fri, 10 Mar 2006 14:27:55 GMT]]></title><description><![CDATA[<p>bekomme das nur leider nicht zum laufen</p>
<p>lässt sich zwar compilieren macht aber speicherprobleme der Fehler wird anscheinend durch folgende codezeile verursacht:</p>
<pre><code>[...]
DWORD (WINAPI *pAllocateAndGetTcpExTableFromStack)(
  PMIB_TCPEXTABLE *pTcpTable,  // buffer for the connection table
  BOOL bOrder,               // sort the table?
  HANDLE heap,
  DWORD zero,
  DWORD flags
);
[...]
PMIB_TCPEXTABLE tcpExTable;
[...]
error = pAllocateAndGetTcpExTableFromStack( &amp;tcpExTable, TRUE, GetProcessHeap(), 2, 2 );
</code></pre>
<p>Fehler: &quot;Die Anweisung in &quot;0x00000000&quot; verweist auf Speicher in &quot;0x00000000&quot; Der Vorgang read konnte nicht auf dem Speicher durchgeführt werden.&quot;</p>
<p>dachte es liegt an GetProcessHeap aber über diese Codezeile läuft er einfach drüber :</p>
<pre><code>if( GetProcessHeap() == NULL ){ 
			printf(&quot;error %d&quot;,GetLastError());
			return;
		}
</code></pre>
<p>ich kann leider nicht debuggen bzw weiss nicht wie mir das bei der Fehlerfindung helfen könnte.</p>
<p>Danke für jede Hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1013359</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1013359</guid><dc:creator><![CDATA[c°h°]]></dc:creator><pubDate>Fri, 10 Mar 2006 14:27:55 GMT</pubDate></item><item><title><![CDATA[Reply to Map Port to Process oder Process to Port - Welche WINAPI Befehle sind hierbei hilfreich ? on Fri, 10 Mar 2006 15:26:06 GMT]]></title><description><![CDATA[<p>Du hast aber mittels &quot;ExApisArePresent&quot; geprüft ob die Funktionen da sind, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1013410</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1013410</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Fri, 10 Mar 2006 15:26:06 GMT</pubDate></item><item><title><![CDATA[Reply to Map Port to Process oder Process to Port - Welche WINAPI Befehle sind hierbei hilfreich ? on Fri, 10 Mar 2006 16:17:04 GMT]]></title><description><![CDATA[<p>ja</p>
<pre><code>[...]
	exPresent = ExApisArePresent();

	if( exPresent ) {
[...]
</code></pre>
<p>leider ists das nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1013459</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1013459</guid><dc:creator><![CDATA[c°h°]]></dc:creator><pubDate>Fri, 10 Mar 2006 16:17:04 GMT</pubDate></item><item><title><![CDATA[Reply to Map Port to Process oder Process to Port - Welche WINAPI Befehle sind hierbei hilfreich ? on Fri, 10 Mar 2006 17:10:56 GMT]]></title><description><![CDATA[<p>Da fällt mir ein ich hatte die Prozedur abgeändert</p>
<p>mein code</p>
<pre><code>BOOLEAN
ExApisArePresent(
	VOID
	)
{
	if(GetProcAddress( LoadLibrary( &quot;iphlpapi.dll&quot;), &quot;AllocateAndGetTcpExTableFromStack&quot; )== NULL) return FALSE;

	if(GetProcAddress( LoadLibrary( &quot;iphlpapi.dll&quot;), &quot;AllocateAndGetUdpExTableFromStack&quot; )== NULL ) return FALSE;

	if(GetProcAddress( GetModuleHandle( &quot;kernel32.dll&quot; ),&quot;CreateToolhelp32Snapshot&quot; )== NULL ) return FALSE;

	if(GetProcAddress( GetModuleHandle( &quot;kernel32.dll&quot; ),&quot;Process32First&quot; ) == NULL ) return FALSE;

	if(GetProcAddress( GetModuleHandle( &quot;kernel32.dll&quot; ), &quot;Process32Next&quot; ) == NULL ) return FALSE;
	return TRUE;
}
</code></pre>
<p>urspünglicher code</p>
<pre><code>BOOLEAN
ExApisArePresent(
	VOID
	)
{
	pAllocateAndGetTcpExTableFromStack = (PVOID) GetProcAddress( LoadLibrary( &quot;iphlpapi.dll&quot;), 
				&quot;AllocateAndGetTcpExTableFromStack&quot; );
	if( !pAllocateAndGetTcpExTableFromStack ) return FALSE;

	pAllocateAndGetUdpExTableFromStack = (PVOID) GetProcAddress( LoadLibrary( &quot;iphlpapi.dll&quot;), 
				&quot;AllocateAndGetUdpExTableFromStack&quot; );
	if( !pAllocateAndGetUdpExTableFromStack ) return FALSE;

	pCreateToolhelp32Snapshot = (PVOID) GetProcAddress( GetModuleHandle( &quot;kernel32.dll&quot; ),
				&quot;CreateToolhelp32Snapshot&quot; );
	if( !pCreateToolhelp32Snapshot ) return FALSE;

	pProcess32First = (PVOID) GetProcAddress( GetModuleHandle( &quot;kernel32.dll&quot; ),
				&quot;Process32First&quot; );
	if( !pProcess32First ) return FALSE;

	pProcess32Next = (PVOID) GetProcAddress( GetModuleHandle( &quot;kernel32.dll&quot; ),
				&quot;Process32Next&quot; );
	if( !pProcess32Next ) return FALSE;
	return TRUE;
}
</code></pre>
<p>Der ursprüngliche Code erzeugte Kovertierungsfehler:</p>
<pre><code>\MyProjects\netstatp\main.cpp(269) : error C2440: '=' : cannot convert from 'void *' to 'unsigned long (__stdcall *)(MIB_TCPEXTABLE ** ,int,void *,unsigned long,unsigned long)'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast
\MyProjects\netstatp\main.cpp(273) : error C2440: '=' : cannot convert from 'void *' to 'unsigned long (__stdcall *)(MIB_UDPEXTABLE ** ,int,void *,unsigned long,unsigned long)'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast
\MyProjects\netstatp\main.cpp(277) : error C2440: '=' : cannot convert from 'void *' to 'void *(__stdcall *)(unsigned long,unsigned long)'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast
\MyProjects\netstatp\main.cpp(281) : error C2440: '=' : cannot convert from 'void *' to 'int (__stdcall *)(void *,struct tagPROCESSENTRY32 *)'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast
\MyProjects\netstatp\main.cpp(285) : error C2440: '=' : cannot convert from 'void *' to 'int (__stdcall *)(void *,struct tagPROCESSENTRY32 *)'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast
</code></pre>
<p>Die (PVOID) Kovertierung mag mein Compiler irgendwie nicht</p>
<p>Return Werte von GetProcAddress:<br />
-If the function succeeds, the return value is the address of the exported function or variable.</p>
<p>-If the function fails, the return value is NULL. To get extended error information, call GetLastError.</p>
<p>also sollte meine Version doch auch gehen oder ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1013495</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1013495</guid><dc:creator><![CDATA[c°h°]]></dc:creator><pubDate>Fri, 10 Mar 2006 17:10:56 GMT</pubDate></item><item><title><![CDATA[Reply to Map Port to Process oder Process to Port - Welche WINAPI Befehle sind hierbei hilfreich ? on Fri, 10 Mar 2006 17:15:40 GMT]]></title><description><![CDATA[<p>Ach ich hab den Denkfehler in meinem Codes gefunden die Entrypoints der Befehle werden ja so garnicht gespeichert.</p>
<p>Nur das Konvertierungsproblem besteht leider immernoch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1013500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1013500</guid><dc:creator><![CDATA[c°h°]]></dc:creator><pubDate>Fri, 10 Mar 2006 17:15:40 GMT</pubDate></item><item><title><![CDATA[Reply to Map Port to Process oder Process to Port - Welche WINAPI Befehle sind hierbei hilfreich ? on Sat, 11 Mar 2006 13:10:10 GMT]]></title><description><![CDATA[<p>Habs endlich hinbekommen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
danke nochmal für eure Hilfe</p>
<pre><code>BOOLEAN
ExApisArePresent(
	VOID
	)
{
	pAllocateAndGetTcpExTableFromStack =  ( unsigned long (__stdcall*)(MIB_TCPEXTABLE ** ,int,void *,unsigned long,unsigned long)) GetProcAddress( LoadLibrary( &quot;iphlpapi.dll&quot;), &quot;AllocateAndGetTcpExTableFromStack&quot;);

	if( !pAllocateAndGetTcpExTableFromStack ) return FALSE;

	pAllocateAndGetUdpExTableFromStack = ( unsigned long (__stdcall *)(MIB_UDPEXTABLE ** ,int,void *,unsigned long,unsigned long)) GetProcAddress( LoadLibrary( &quot;iphlpapi.dll&quot;), &quot;AllocateAndGetUdpExTableFromStack&quot; );
	if( !pAllocateAndGetUdpExTableFromStack ) return FALSE;

	pCreateToolhelp32Snapshot = (void *(__stdcall *)(unsigned long,unsigned long)) GetProcAddress( GetModuleHandle( &quot;kernel32.dll&quot; ), &quot;CreateToolhelp32Snapshot&quot; );
	if( !pCreateToolhelp32Snapshot ) return FALSE;

	pProcess32First = (int (__stdcall *)(void *,struct tagPROCESSENTRY32 *)) GetProcAddress( GetModuleHandle( &quot;kernel32.dll&quot; ), &quot;Process32First&quot; );
	if( !pProcess32First ) return FALSE;

	pProcess32Next = (int (__stdcall *)(void *,struct tagPROCESSENTRY32 *)) GetProcAddress( GetModuleHandle( &quot;kernel32.dll&quot; ), &quot;Process32Next&quot; );
	if( !pProcess32Next ) return FALSE;
	return TRUE;
}
</code></pre>
<p>MFG ch</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1013951</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1013951</guid><dc:creator><![CDATA[c°h°]]></dc:creator><pubDate>Sat, 11 Mar 2006 13:10:10 GMT</pubDate></item></channel></rss>