<?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[Problem: Mit NamedPipe, Help!]]></title><description><![CDATA[<p>Jojo ich schon wieder,<br />
Ich hab hier gerade irgendwie ein Problem mit named pipes.</p>
<p>Ich hab hier einen parent process, der lädt eine DLL in einen anderen Process, anschließend startet der parent process noch einen Thraed der eine Server-Pipe erstellen soll:</p>
<pre><code class="language-cpp">DWORD WINAPI Starter( LPVOID pParam ) {

	SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Create Server-Pipi ...&quot; );

	hPipe = CreateNamedPipe( szPipename, PIPE_ACCESS_INBOUND, PIPE_TYPE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 0, 0, 200, 0 );
	if( hPipe ) {

		SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Create Server-Pipi success!&quot; );

		// ***** Wait of client *****
		SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Waiting for client connection ...&quot; );
		if( ConnectNamedPipe( hPipe, 0 ) ) {

			SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Client-Pipi-Connection success!&quot; );

			SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Start server thread ...&quot; );
			hThread = CreateThread( 0, 0, ThreadProc, (LPVOID)hPipe, 0, &amp;dwThreadId ); 
			if( hThread == 0 ) {

				SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Start server thread fails!&quot; );
			}
			else {

				SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Start server thread success!&quot; );
			}
		}
		else {

			SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Client-Pipi-Connection failed!&quot; );
		}
	}
	else {

		SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Create Server-Pipi failed!&quot; );
	}

	return( (DWORD)pParam );
}
</code></pre>
<p>Nach dem der Thread gestartet wurde soll die DLL in den fremden Prozess geladen werden und dort werden geheime Dinge getan <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> unteranderem soll dort auch aus der DLL heraus eine Verbindung mit der vom parent process erstellten pipe aufgenommen werden:</p>
<pre><code class="language-cpp">bool ConnectToPipe( ) {

	hPipe = CreateFile( szPipename, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );         

	if( hPipe == INVALID_HANDLE_VALUE )
		return false;

	return true;
}
</code></pre>
<p>Hm, allerding bleibt der parent process immer bei:</p>
<pre><code class="language-cpp">SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Waiting for client connection ...&quot; );
</code></pre>
<p>hängen, wasmir sagt das es anscheint nicht geklappt hat, was mir auch ein false von der ConnectToPipe( ) bestätigt.</p>
<p>Was läuft hier schief?</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/208790/problem-mit-namedpipe-help</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 01:03:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/208790.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 22 Mar 2008 18:06:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem: Mit NamedPipe, Help! on Sat, 22 Mar 2008 18:06:54 GMT]]></title><description><![CDATA[<p>Jojo ich schon wieder,<br />
Ich hab hier gerade irgendwie ein Problem mit named pipes.</p>
<p>Ich hab hier einen parent process, der lädt eine DLL in einen anderen Process, anschließend startet der parent process noch einen Thraed der eine Server-Pipe erstellen soll:</p>
<pre><code class="language-cpp">DWORD WINAPI Starter( LPVOID pParam ) {

	SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Create Server-Pipi ...&quot; );

	hPipe = CreateNamedPipe( szPipename, PIPE_ACCESS_INBOUND, PIPE_TYPE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 0, 0, 200, 0 );
	if( hPipe ) {

		SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Create Server-Pipi success!&quot; );

		// ***** Wait of client *****
		SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Waiting for client connection ...&quot; );
		if( ConnectNamedPipe( hPipe, 0 ) ) {

			SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Client-Pipi-Connection success!&quot; );

			SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Start server thread ...&quot; );
			hThread = CreateThread( 0, 0, ThreadProc, (LPVOID)hPipe, 0, &amp;dwThreadId ); 
			if( hThread == 0 ) {

				SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Start server thread fails!&quot; );
			}
			else {

				SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Start server thread success!&quot; );
			}
		}
		else {

			SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Client-Pipi-Connection failed!&quot; );
		}
	}
	else {

		SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Create Server-Pipi failed!&quot; );
	}

	return( (DWORD)pParam );
}
</code></pre>
<p>Nach dem der Thread gestartet wurde soll die DLL in den fremden Prozess geladen werden und dort werden geheime Dinge getan <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> unteranderem soll dort auch aus der DLL heraus eine Verbindung mit der vom parent process erstellten pipe aufgenommen werden:</p>
<pre><code class="language-cpp">bool ConnectToPipe( ) {

	hPipe = CreateFile( szPipename, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );         

	if( hPipe == INVALID_HANDLE_VALUE )
		return false;

	return true;
}
</code></pre>
<p>Hm, allerding bleibt der parent process immer bei:</p>
<pre><code class="language-cpp">SendMessage( hList, LB_ADDSTRING, 0, (long)&quot;Waiting for client connection ...&quot; );
</code></pre>
<p>hängen, wasmir sagt das es anscheint nicht geklappt hat, was mir auch ein false von der ConnectToPipe( ) bestätigt.</p>
<p>Was läuft hier schief?</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1478862</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1478862</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sat, 22 Mar 2008 18:06:54 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: Mit NamedPipe, Help! on Sat, 22 Mar 2008 18:56:19 GMT]]></title><description><![CDATA[<p>Reine Vermutung : PIPE_WAIT -&gt; &quot;Blocking mode is enabled&quot;</p>
<p>Ruf mal ConnectNamedPipe <em>nach</em> CreateThread auf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1478884</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1478884</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 22 Mar 2008 18:56:19 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: Mit NamedPipe, Help! on Sat, 22 Mar 2008 19:00:29 GMT]]></title><description><![CDATA[<p>Wieso, das Createthreade dort, ist ein Thread der auf Nachrichten vom Client wartet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1478885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1478885</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sat, 22 Mar 2008 19:00:29 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: Mit NamedPipe, Help! on Sat, 22 Mar 2008 19:19:25 GMT]]></title><description><![CDATA[<p>Aber der Server wartet erst einmal bis ein Client &quot;angebissen&quot; hat.</p>
<p><em>Danach erst</em> soll ein Thread erzeugt werden, der auf Clienten wartet ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1478889</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1478889</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 22 Mar 2008 19:19:25 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: Mit NamedPipe, Help! on Sat, 22 Mar 2008 19:21:52 GMT]]></title><description><![CDATA[<p>merker schrieb:</p>
<blockquote>
<p>Aber der Server wartet erst einmal bis ein Client &quot;angebissen&quot; hat.</p>
<p><em>Danach erst</em> soll ein Thread erzeugt werden, der auf Clienten wartet ?</p>
</blockquote>
<p>Hö? ConnectNamedPipe ist doch die stelle wo gewartet wird das ein Client die Verbindung auf nimmt oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1478891</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1478891</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sat, 22 Mar 2008 19:21:52 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: Mit NamedPipe, Help! on Sat, 22 Mar 2008 19:28:23 GMT]]></title><description><![CDATA[<p>Ja, schon. Aber das kann der Server auch im Thread machen. Nur CreateNamedPipe und CreateThread müssten reichen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1478892</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1478892</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 22 Mar 2008 19:28:23 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: Mit NamedPipe, Help! on Sat, 22 Mar 2008 19:38:37 GMT]]></title><description><![CDATA[<p>Pass auf hier mal die stelle im Code wo das alles so passieren soll:</p>
<pre><code class="language-cpp">// Parent process
case WM_CREATE: {

			EnableDebugPrivilege( );

			// ***** Log list *****
			hList = CreateWindowEx( WS_EX_CLIENTEDGE, &quot;LISTBOX&quot;, 0, WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL, 0, 0, 0, 0, hWnd, (HMENU)5000, GetModuleHandle( 0 ), 0 );		

			// ***** Initial pipe connection *****
			hStarter = CreateThread( 0, 0, Starter, 0, 0, &amp;dwStarterID );

// ***** Inject DLL *****
		InjectDLL( &quot;KickIT.dll&quot;, GetWc3PID( ) );			
            return 0;
}
</code></pre>
<p>Ich hab auch mal die InjectDLL hinter CreateNamedPipe aufgerufen, dann bekomm ich ich aber nur ein false zurueck.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1478895</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1478895</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sat, 22 Mar 2008 19:38:37 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: Mit NamedPipe, Help! on Sat, 22 Mar 2008 20:17:38 GMT]]></title><description><![CDATA[<p>ich hab mir jetzt noch nen extra client pipe Konsolenprogramm geschrieben, die die Connect-Funktion aus der DLL ausführt und hier funktioniert es. Kann es sein das man gar keine named pipe connection aus einer DLL herraus aufbauen kann?</p>
<p>EDIT:<br />
Die connect-Funktion aus der DLL gibt jedenfalls schon mal true zurück.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1478901</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1478901</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sat, 22 Mar 2008 20:17:38 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: Mit NamedPipe, Help! on Sat, 22 Mar 2008 20:29:43 GMT]]></title><description><![CDATA[<p>Oweh, das was in der &quot;case WM_CREATE&quot; alles gemacht wird, sieht eher nach einem Synchronisationsproblem aus.</p>
<p>Die Pipe muß funktionsfähig sein bevor &quot;InjectDLL&quot; aufgerufen wird. Das ist aber nach CreateThread noch lange nicht der Fall.</p>
<p>Probier mal &quot;InjectDLL&quot; gesondert, also in einem anderen &quot;case WM_xxxx&quot; aufzurufen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1478906</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1478906</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 22 Mar 2008 20:29:43 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: Mit NamedPipe, Help! on Sat, 22 Mar 2008 20:38:38 GMT]]></title><description><![CDATA[<p>ne das wird auch nichts, ich hab die DLLInject mal in die WM_SIZE gesteckt, dann bekomm ich aber wieder ein false von der Connect-Funktion aus der dll.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1478912</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1478912</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sat, 22 Mar 2008 20:38:38 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: Mit NamedPipe, Help! on Sat, 22 Mar 2008 20:42:01 GMT]]></title><description><![CDATA[<p>WM_SIZE ist ungeeignet. U.U. kommt der sogar noch vor WM_CREATE. Probier mal irgendein Button-Klick oder so.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1478913</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1478913</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 22 Mar 2008 20:42:01 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: Mit NamedPipe, Help! on Sat, 22 Mar 2008 20:54:46 GMT]]></title><description><![CDATA[<p>in der tat es ist ein Syncronisationsproblem, denn ich habs auch mal andersherum probiert, sprich einen Server application geschrieben und dann mit der DLL connected und das ging. Und ja es geht jetzt auch mit dem Button, aber ich find das doof, gibts nicht doch nen Weg das es alle sautomatisch geht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1478917</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1478917</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sat, 22 Mar 2008 20:54:46 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: Mit NamedPipe, Help! on Sat, 22 Mar 2008 21:18:14 GMT]]></title><description><![CDATA[<p>Vielleicht reicht es schon wenn &quot;Starter&quot; direkt, d.h. nicht via CreateThread in der &quot;case WM_CREATE&quot; aufgerufen wird.</p>
<p>Dann würde die Pipe auch schon sicher vorhanden sein bevor &quot;InjectDLL&quot; aufgerufen wird.</p>
<p>Aber dann darf ConnectNamedPipe in &quot;Starter&quot; nicht aufgeruufen werden sondern erst im dem Thread, der in &quot;Starter&quot; erzeugt wird.</p>
<p>Zumindest ist das Hauptproblem erkannt. Viel Glück noch bei den &quot;geheimen Dingen&quot;. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1478929</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1478929</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 22 Mar 2008 21:18:14 GMT</pubDate></item></channel></rss>