<?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[falsche ausgabe??]]></title><description><![CDATA[<p>Hi,</p>
<pre><code>int main(int argc, char *argv[])
{
  HANDLE hDevice;               // handle to the drive to be examined 
  BOOL bResult;                 // results flag 
  DWORD junk;                   // discard results 
  DWORD layout[10000];
  hDevice = CreateFile(&quot;\\\\.\\PhysicalDrive0&quot;,  // drive to open 
                    //|||||||||||||||||||||||||||||||||||||||||||||||||||| 
                    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
                    GENERIC_READ,                // no access to the drive &lt;-- ?????? 
                    //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
                    //|||||||||||||||||||||||||||||||||||||||||||||||||||| 
                    FILE_SHARE_READ | // share mode 
                    FILE_SHARE_WRITE, 
                    NULL,             // default security attributes 
                    OPEN_EXISTING,    // disposition 
                    0,                // file attributes 
                    NULL);            // do not copy file attributes 

  if (hDevice == INVALID_HANDLE_VALUE) // cannot open the drive 
  { 
   printf(&quot;%ld&quot;, GetLastError());
	  return (FALSE); 
  } 

  bResult = DeviceIoControl(hDevice,  // device to be queried 
        IOCTL_DISK_GET_DRIVE_LAYOUT,  // operation to perform 
                             NULL, 0, // no input buffer 
                             layout, sizeof(*layout),     // output buffer 
                            &amp;junk,                        // # bytes returned 
                            (LPOVERLAPPED) NULL);         // synchronous I/O 
   cout&lt;&lt;junk;

  return 0;
}
</code></pre>
<p>Er gibt mir immer einen unbrauchbaren Wert &quot;3435973836&quot; zurück! Was mach ich falsch? Ich möchte die harddisk signature id auslesen!</p>
<p>mfg,<br />
domian</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/129933/falsche-ausgabe</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 15:32:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/129933.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 18 Dec 2005 05:08:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to falsche ausgabe?? on Sun, 18 Dec 2005 05:08:44 GMT]]></title><description><![CDATA[<p>Hi,</p>
<pre><code>int main(int argc, char *argv[])
{
  HANDLE hDevice;               // handle to the drive to be examined 
  BOOL bResult;                 // results flag 
  DWORD junk;                   // discard results 
  DWORD layout[10000];
  hDevice = CreateFile(&quot;\\\\.\\PhysicalDrive0&quot;,  // drive to open 
                    //|||||||||||||||||||||||||||||||||||||||||||||||||||| 
                    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
                    GENERIC_READ,                // no access to the drive &lt;-- ?????? 
                    //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
                    //|||||||||||||||||||||||||||||||||||||||||||||||||||| 
                    FILE_SHARE_READ | // share mode 
                    FILE_SHARE_WRITE, 
                    NULL,             // default security attributes 
                    OPEN_EXISTING,    // disposition 
                    0,                // file attributes 
                    NULL);            // do not copy file attributes 

  if (hDevice == INVALID_HANDLE_VALUE) // cannot open the drive 
  { 
   printf(&quot;%ld&quot;, GetLastError());
	  return (FALSE); 
  } 

  bResult = DeviceIoControl(hDevice,  // device to be queried 
        IOCTL_DISK_GET_DRIVE_LAYOUT,  // operation to perform 
                             NULL, 0, // no input buffer 
                             layout, sizeof(*layout),     // output buffer 
                            &amp;junk,                        // # bytes returned 
                            (LPOVERLAPPED) NULL);         // synchronous I/O 
   cout&lt;&lt;junk;

  return 0;
}
</code></pre>
<p>Er gibt mir immer einen unbrauchbaren Wert &quot;3435973836&quot; zurück! Was mach ich falsch? Ich möchte die harddisk signature id auslesen!</p>
<p>mfg,<br />
domian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/944638</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/944638</guid><dc:creator><![CDATA[domian222]]></dc:creator><pubDate>Sun, 18 Dec 2005 05:08:44 GMT</pubDate></item><item><title><![CDATA[Reply to falsche ausgabe?? on Sun, 18 Dec 2005 06:35:56 GMT]]></title><description><![CDATA[<p>domian222 schrieb:</p>
<blockquote>
<p>Was mach ich falsch?</p>
</blockquote>
<p>Du sagst der Funktion DeviceIoControl, dass der Puffer sizeof(*layout) groß ist, das ist <strong>1 DWORD</strong>. Mach den Stern da weg.<br />
Darauf wärest du vermutlich selbst gekommen, wenn du bResult und GetLastError geprüft hättest.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/944640</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/944640</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Sun, 18 Dec 2005 06:35:56 GMT</pubDate></item><item><title><![CDATA[Reply to falsche ausgabe?? on Mon, 19 Dec 2005 01:24:33 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>Vielen dank, für die Antwort aber er gibt mir immer noch das gleiche aus:</p>
<p>Und zwar den Wert: 3435973836 (printf(&quot;%x&quot;, junk);) bringt leider nur falsche raus.</p>
<p>Ich möchte die Signature id der harddisk auslesen. Ich hab ein Programm gefunden, dass den selben Zweck macht. Jedoch hab ich nicht den source code von dem Programm sondern nur alles im debugger angeschaut. Ich hab die funktionen GENERIC_READ etc. angepasst und den dword buffer aber es gibt mir immer noch nen viel zu großen Wert aus und ich kenn meine signatureid!</p>
<p>mfg,<br />
domian22</p>
]]></description><link>https://www.c-plusplus.net/forum/post/945240</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/945240</guid><dc:creator><![CDATA[domian22]]></dc:creator><pubDate>Mon, 19 Dec 2005 01:24:33 GMT</pubDate></item><item><title><![CDATA[Reply to falsche ausgabe?? on Mon, 19 Dec 2005 05:40:12 GMT]]></title><description><![CDATA[<p>Wenn du dir den Eintrag in der MSDN-Library zu IOCTL_DISK_GET_DRIVE_LAYOUT anschaust, siehst du, dass die Signatur nicht in deiner Variablen junk landet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/945248</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/945248</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 19 Dec 2005 05:40:12 GMT</pubDate></item><item><title><![CDATA[Reply to falsche ausgabe?? on Mon, 19 Dec 2005 19:32:13 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>Mit GetOverlappedResult kann man laut msdn die id bekommen:</p>
<p>To retrieve the number of bytes returned, call GetOverlappedResult.<br />
bResult = GetOverlappedResult(hDevice, NULL, &amp;junk, FALSE);<br />
printf(&quot;%x&quot;, bResult);</p>
<p>Was ist daran Falsch?</p>
<p>2.)<br />
Kann man die signatureid mit IOCTL_DISK_SET_DRIVE_LAYOUT ändern?</p>
<p>mfg,<br />
domian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/945859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/945859</guid><dc:creator><![CDATA[domian222]]></dc:creator><pubDate>Mon, 19 Dec 2005 19:32:13 GMT</pubDate></item><item><title><![CDATA[Reply to falsche ausgabe?? on Mon, 19 Dec 2005 20:09:44 GMT]]></title><description><![CDATA[<p>domian222 schrieb:</p>
<blockquote>
<p>Mit GetOverlappedResult kann man laut msdn die id bekommen:</p>
</blockquote>
<p>Unsinn.</p>
<blockquote>
<p>To retrieve the number of bytes returned, call GetOverlappedResult.</p>
</blockquote>
<p>Was interessiert dich die Anzahl der zurückgegebenen Bytes?</p>
<p>lpOutBuffer<br />
[out] Pointer to a buffer that receives a DRIVE_LAYOUT_INFORMATION structure.</p>
<p>Da stehen die Informationen drin.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/945895</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/945895</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 19 Dec 2005 20:09:44 GMT</pubDate></item><item><title><![CDATA[Reply to falsche ausgabe?? on Mon, 19 Dec 2005 22:44:01 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>danke für die Antwort!</p>
<p>printf(&quot;%x&quot;, layout);</p>
<p>gibt wieder einen komplett falschen Wert aus.</p>
<p>Also muss ich auf die struktur zugreifen:</p>
<p>DRIVE_LAYOUT_INFORMATION *pdg;</p>
<p>printf(&quot;%x&quot;, pdg-&gt;Signature);</p>
<p>gibt nur ne 0 aus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/946020</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/946020</guid><dc:creator><![CDATA[domian22]]></dc:creator><pubDate>Mon, 19 Dec 2005 22:44:01 GMT</pubDate></item><item><title><![CDATA[Reply to falsche ausgabe?? on Tue, 20 Dec 2005 06:20:38 GMT]]></title><description><![CDATA[<p>domian22 schrieb:</p>
<blockquote>
<p>DRIVE_LAYOUT_INFORMATION *pdg;</p>
</blockquote>
<p>Wo zeigt dieser Zeiger denn hin? Bestimmt nicht auf den Puffer, den du an DeviceIoControl übergeben hast.</p>
<p>Kann das sein, dass du noch ein paar Lücken bei den Grundlagen hast?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/946065</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/946065</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Tue, 20 Dec 2005 06:20:38 GMT</pubDate></item><item><title><![CDATA[Reply to falsche ausgabe?? on Tue, 20 Dec 2005 12:53:11 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>Kannst du mir ein tipp geben?</p>
<p>mfg,<br />
domian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/946258</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/946258</guid><dc:creator><![CDATA[domian22]]></dc:creator><pubDate>Tue, 20 Dec 2005 12:53:11 GMT</pubDate></item><item><title><![CDATA[Reply to falsche ausgabe?? on Tue, 20 Dec 2005 13:04:05 GMT]]></title><description><![CDATA[<p>Kann das sein, dass du noch ein paar Lücken bei den Grundlagen hast?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/946271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/946271</guid><dc:creator><![CDATA[MKF]]></dc:creator><pubDate>Tue, 20 Dec 2005 13:04:05 GMT</pubDate></item><item><title><![CDATA[Reply to falsche ausgabe?? on Tue, 20 Dec 2005 13:04:50 GMT]]></title><description><![CDATA[<p>domian22 schrieb:</p>
<blockquote>
<pre><code class="language-cpp">printf(&quot;%x&quot;,  layout);
</code></pre>
<p>gibt wieder einen komplett falschen Wert aus.</p>
</blockquote>
<p>Ja, da mußt du auch auf einzelne Elemente des Arrays zugreifen (mit &quot;printf(&quot;%x&quot;,layout[i]);&quot;)</p>
<blockquote>
<p>Also muss ich auf die struktur zugreifen:</p>
<pre><code class="language-cpp">DRIVE_LAYOUT_INFORMATION *pdg;

printf(&quot;%x&quot;, pdg-&gt;Signature);
</code></pre>
<p>gibt nur ne 0 aus</p>
</blockquote>
<p>Ein guter Anfang - nun mußt du diesen Pointer noch auf eine exisiterende Struktur biegen (atm zeigt er ins Daten-Nirvana).</p>
<pre><code class="language-cpp">DeviceIOControl(hDevice,NULL,0,buffer,...);
DRIVE_LAYOUT_INFORMATION *pdg=buffer;
printf(&quot;%x&quot;,pdg-&gt;Signature);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/946273</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/946273</guid><dc:creator><![CDATA[CStoll (off)]]></dc:creator><pubDate>Tue, 20 Dec 2005 13:04:50 GMT</pubDate></item><item><title><![CDATA[Reply to falsche ausgabe?? on Tue, 20 Dec 2005 16:38:30 GMT]]></title><description><![CDATA[<p>MKF schrieb:</p>
<blockquote>
<p>Kann das sein, dass du noch ein paar Lücken bei den Grundlagen hast?</p>
</blockquote>
<p>Sorry das ich so unfreundlich war.<br />
Aber ich bin als kleines Kind auf den Kopf gefallen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/946439</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/946439</guid><dc:creator><![CDATA[MKF]]></dc:creator><pubDate>Tue, 20 Dec 2005 16:38:30 GMT</pubDate></item></channel></rss>