<?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[Wie HANDLE kopieren?]]></title><description><![CDATA[<p>Hi</p>
<p>In einer Funktion starte ich eine Prozess über CreateProzess. Ich möchte nun die STARTUPINFO global speichern, damit ich später diese nutzen kann (ProcessID usw.).<br />
Wie jedoch lege ich eine Kopie an, so dass die HANDLE's in der Kopie immer noch valid sind? STARTUPINFO muss lokal in der Funktion instanziert werden.</p>
<p>MfG Joe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/187438/wie-handle-kopieren</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Jul 2026 05:25:48 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/187438.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 Jul 2007 15:31:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wie HANDLE kopieren? on Thu, 19 Jul 2007 15:33:55 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>In einer Funktion starte ich eine Prozess über CreateProzess. Ich möchte nun die STARTUPINFO global speichern, damit ich später diese nutzen kann (ProcessID usw.).<br />
Wie jedoch lege ich eine Kopie an, so dass die HANDLE's in der Kopie immer noch valid sind? STARTUPINFO muss lokal in der Funktion instanziert werden.</p>
<p>MfG Joe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1328689</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1328689</guid><dc:creator><![CDATA[*JoE*]]></dc:creator><pubDate>Thu, 19 Jul 2007 15:33:55 GMT</pubDate></item><item><title><![CDATA[Reply to Wie HANDLE kopieren? on Thu, 19 Jul 2007 23:53:56 GMT]]></title><description><![CDATA[<p>Wo deine STARTUPINFO ist schonmal komplett egal, ich nehme an du meinst die PROCESS_INFORMATION.</p>
<p>Das Handle bleibt solange &quot;valid&quot; bis du es mit CloseHandle freigibst.<br />
Wo deine PROCESS_INFORMATION lebt ist dabei auch ganz egal, du musst in jedem Fall das Handle &quot;von Hand&quot; freigeben, sonst hast du ein Handle Leak.<br />
Und bevor du es nicht freigegeben hast kannst du es rumkopieren wie du willst, einfach mit &quot;=&quot;.</p>
<p>Dasselbe gilt im Übrigen für das Handle auf den &quot;primary Thread&quot; des neuen Prozesses, das musst du auch selbst freigeben.</p>
<p>BTW: bissi MSDN lesen schadet nicht:</p>
<p>MSDN schrieb:</p>
<blockquote>
<p>Handles in PROCESS_INFORMATION must be closed with CloseHandle when they are no longer needed.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1328926</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1328926</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Thu, 19 Jul 2007 23:53:56 GMT</pubDate></item><item><title><![CDATA[Reply to Wie HANDLE kopieren? on Fri, 20 Jul 2007 00:29:50 GMT]]></title><description><![CDATA[<p>Kopier dir doch die Weerte der Struktur einfach in andere Variablen. Wo ist das Problem?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1328932</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1328932</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Fri, 20 Jul 2007 00:29:50 GMT</pubDate></item></channel></rss>