<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=iso-8859-1" http-equiv="Content-Type">
  <style>
     pre { 
  white-space: pre-wrap;       /* css-3 */
  white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
  white-space: -pre-wrap;      /* Opera 4-6 */
  white-space: -o-pre-wrap;    /* Opera 7 */
  word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

  </style>
</head>
<body bgcolor="#ffffff" text="#000000">

<div>
OK. The &quot;bad handle&quot; is tested by the &quot;deadbeef&quot; handle.<br />Where is the best place to get a really good &quot;wrong class&quot; handle?<br /><br />Thanks,<br /><br />/pedro <br /><br />----- Original meddelelse -----<br /><blockquote class="webmail-quote" style="padding-right: 0px; padding-left: 5px; margin-left: 5px; border-left: #000000 2px solid; margin-right: 0px"><b>Fra:</b> Alexandre Julliard &lt;julliard@winehq.org&gt;<br /><b>Til:</b> Peter Dons Tychsen &lt;donpedro@tdcadsl.dk&gt;<br /><b>Cc:</b> wine-devel@winehq.org<br /><b>Dato:</b> Tor, 10. sep 2009 22:20<br /><b>Emne:</b> Re: ntdll: Do not accept device control requests with invalid and/or incompa tible handles<br /><br /> Peter Dons Tychsen &lt;donpedro@tdcadsl.dk&gt; writes:<br /><br />&gt; Thanks for the comments.<br />&gt; Not sure i understand them though.<br />&gt;<br />&gt; The whole point of the test was to test what happens when you use a wrong<br />&gt; handle. The actual bug i fixed was that it was possible to for programs<br />&gt; to send invalid handles to IoControl. Cygwin was infact sending handles<br />&gt; to ntdll.dll which originated from GetStdHandle().<br />&gt;<br />&gt; So i think using this API for testing is relevant, as the point of the<br />&gt; test is to verify that handles of the completely wrong class are<br />&gt; rejected, and not just &quot;bad handles&quot;.<br /><br />Yes, but then you should explicitly construct and test both kinds of<br />handles. Using GetStdHandle will either be a wrong class or a bad handle<br />depending on whether stdio is to a file or to a console, so you don&#39;t<br />really know which case you are testing. The remapping of console handles<br />happens in kernel32, not in ntdll, so it doesn&#39;t really make sense to<br />pass the result of GetStdHandle straight to ntdll.<br /><br />-- <br />Alexandre Julliard<br />julliard@winehq.org<br /></blockquote>
</div>




</body>
</html>