<html>
<head>
<style>
<!--
body { background-color:#ffffff }
.file { border:1px solid #eeeeee; margin-top:1em; margin-bottom:1em }
.pathname { font-family:monospace; float:right }
.fileheader { margin-bottom:.5em }
.diff { margin:0 }
.tasklist { padding:4px; border:1px dashed #000000; margin-top:1em }
.tasklist ul { margin-top:0; margin-bottom:0 }
tr.alt { background-color:#eeeeee }
#added { background-color:#ddffdd }
#addedchars { background-color:#99ff99; font-weight:bolder }
tr.alt #added { background-color:#ccf7cc }
#removed { background-color:#ffdddd }
#removedchars { background-color:#ff9999; font-weight:bolder }
tr.alt #removed { background-color:#f7cccc }
#info { color:#888888 }
#context { background-color:#eeeeee }
td {padding-left:.3em; padding-right:.3em }
tr.head { border-bottom-width:1px; border-bottom-style:solid }
tr.head td { padding:0; padding-top:.2em }
.task { background-color:#ffff00 }
.comment { padding:4px; border:1px dashed #000000; background-color:#ffffdd }
.error { color:red }
hr { border-width:0px; height:2px; background:black }
-->
</style>
</head>
<body>
<pre class="comment">Implement SetupDiGetDeviceInstanceIdW
Fix debug message</pre><pre class="diff" id="context">Modified: trunk/reactos/lib/devmgr/hwpage.c
Modified: trunk/reactos/lib/setupapi/devinst.c
Modified: trunk/reactos/lib/setupapi/stubs.c
</pre><hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/lib/devmgr/hwpage.c</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/lib/devmgr/hwpage.c        2005-11-26 04:29:40 UTC (rev 19612)
+++ trunk/reactos/lib/devmgr/hwpage.c        2005-11-26 08:13:04 UTC (rev 19613)
@@ -143,7 +143,7 @@
</small></pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;DeviceInstanceIdLen))
 &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DPRINT1(&quot;SetupDiGetDeviceIn<span id="removedchars">terfaceDetail</span> unexpectedly returned TRUE!\n&quot;);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DPRINT1(&quot;SetupDiGetDeviceIn<span id="addedchars">stanceId</span> unexpectedly returned TRUE!\n&quot;);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; goto Cleanup;
 &nbsp; &nbsp; &nbsp; &nbsp; }
 
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/lib/setupapi/devinst.c</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/lib/setupapi/devinst.c        2005-11-26 04:29:40 UTC (rev 19612)
+++ trunk/reactos/lib/setupapi/devinst.c        2005-11-26 08:13:04 UTC (rev 19613)
@@ -3004,7 +3004,7 @@
</small></pre><pre class="diff" id="context"> {
 &nbsp; &nbsp; BOOL ret = FALSE;
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;TRACE(&quot;%<span id="removedchars">ld</span> %p %p\n&quot;, InstallFunction, DeviceInfoSet, DeviceInfoData);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;TRACE(&quot;%<span id="addedchars">u</span> %p %p\n&quot;, InstallFunction, DeviceInfoSet, DeviceInfoData);
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; if (!DeviceInfoSet)
 &nbsp; &nbsp; &nbsp; &nbsp; SetLastError(ERROR_INVALID_PARAMETER);
@@ -3063,7 +3063,7 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DefaultHandler = SetupDiSelectBestCompatDrv;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default:
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ERR(&quot;Install function %<span id="removedchars">l</span>u not supported\n&quot;, InstallFunction);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ERR(&quot;Install function %u not supported\n&quot;, InstallFunction);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetLastError(ERROR_NOT_SUPPORTED);
 &nbsp; &nbsp; &nbsp; &nbsp; }
 
@@ -3463,6 +3463,71 @@
</pre><pre class="diff" id="context"> }
 
 /***********************************************************************
</pre><pre class="diff" id="added">+ *                SetupDiGetDeviceInstanceIdA(SETUPAPI.@)
+ */
+BOOL WINAPI SetupDiGetDeviceInstanceIdA(
+ &nbsp; &nbsp; &nbsp; &nbsp;IN HDEVINFO DeviceInfoSet,
+ &nbsp; &nbsp; &nbsp; &nbsp;IN PSP_DEVINFO_DATA DeviceInfoData,
+ &nbsp; &nbsp; &nbsp; &nbsp;OUT PSTR DeviceInstanceId,
+ &nbsp; &nbsp; &nbsp; &nbsp;IN DWORD DeviceInstanceIdSize,
+ &nbsp; &nbsp; &nbsp; &nbsp;OUT PDWORD RequiredSize)
+{
+ &nbsp; &nbsp;FIXME (&quot;Stub %p %p %p %d %p\n&quot;,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DeviceInfoSet, DeviceInfoData, DeviceInstanceId, DeviceInstanceIdSize, RequiredSize);
+ &nbsp; &nbsp;SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ &nbsp; &nbsp;return FALSE;
+}
+
+/***********************************************************************
+ *                SetupDiGetDeviceInstanceIdW(SETUPAPI.@)
+ */
+BOOL WINAPI SetupDiGetDeviceInstanceIdW(
+ &nbsp; &nbsp; &nbsp; &nbsp;IN HDEVINFO DeviceInfoSet,
+ &nbsp; &nbsp; &nbsp; &nbsp;IN PSP_DEVINFO_DATA DeviceInfoData,
+ &nbsp; &nbsp; &nbsp; &nbsp;OUT PWSTR DeviceInstanceId,
+ &nbsp; &nbsp; &nbsp; &nbsp;IN DWORD DeviceInstanceIdSize,
+ &nbsp; &nbsp; &nbsp; &nbsp;OUT PDWORD RequiredSize)
+{
+ &nbsp; &nbsp;BOOL ret = FALSE;
+
+ &nbsp; &nbsp;TRACE(&quot;%p %p %p %lu %p\n&quot;, DeviceInfoSet, DeviceInfoData,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DeviceInstanceId, DeviceInstanceIdSize, RequiredSize);
+
+ &nbsp; &nbsp;if (!DeviceInfoSet)
+ &nbsp; &nbsp; &nbsp; &nbsp;SetLastError(ERROR_INVALID_HANDLE);
+ &nbsp; &nbsp;else if (((struct DeviceInfoSet *)DeviceInfoSet)-&gt;magic != SETUP_DEV_INFO_SET_MAGIC)
+ &nbsp; &nbsp; &nbsp; &nbsp;SetLastError(ERROR_INVALID_HANDLE);
+ &nbsp; &nbsp;else if (!DeviceInfoData)
+ &nbsp; &nbsp; &nbsp; &nbsp;SetLastError(ERROR_INVALID_PARAMETER);
+ &nbsp; &nbsp;else if (DeviceInfoData-&gt;cbSize != sizeof(SP_DEVINFO_DATA))
+ &nbsp; &nbsp; &nbsp; &nbsp;SetLastError(ERROR_INVALID_USER_BUFFER);
+ &nbsp; &nbsp;else if (!DeviceInstanceId &amp;&amp; DeviceInstanceIdSize &gt; 0)
+ &nbsp; &nbsp; &nbsp; &nbsp;SetLastError(ERROR_INVALID_PARAMETER);
+ &nbsp; &nbsp;else if (DeviceInstanceId &amp;&amp; DeviceInstanceIdSize == 0)
+ &nbsp; &nbsp; &nbsp; &nbsp;SetLastError(ERROR_INVALID_PARAMETER);
+ &nbsp; &nbsp;else
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;struct DeviceInfoElement *DevInfo = (struct DeviceInfoElement *)DeviceInfoData-&gt;Reserved;
+ &nbsp; &nbsp; &nbsp; &nbsp;DWORD required;
+
+ &nbsp; &nbsp; &nbsp; &nbsp;required = (wcslen(DevInfo-&gt;DeviceName) + 1) * sizeof(WCHAR);
+ &nbsp; &nbsp; &nbsp; &nbsp;if (RequiredSize)
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*RequiredSize = required;
+
+ &nbsp; &nbsp; &nbsp; &nbsp;if (required &lt;= DeviceInstanceIdSize)
+ &nbsp; &nbsp; &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wcscpy(DeviceInstanceId, DevInfo-&gt;DeviceName);
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ret = TRUE;
+ &nbsp; &nbsp; &nbsp; &nbsp;}
+ &nbsp; &nbsp; &nbsp; &nbsp;else
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SetLastError(ERROR_INSUFFICIENT_BUFFER);
+ &nbsp; &nbsp;}
+
+ &nbsp; &nbsp;TRACE(&quot;Returning 0x%p\n&quot;, ret);
+ &nbsp; &nbsp;return ret;
+}
+
+/***********************************************************************
</pre><pre class="diff" id="context"> &nbsp;*                SetupDiCreateDevRegKeyA (SETUPAPI.@)
 &nbsp;*/
 HKEY WINAPI SetupDiCreateDevRegKeyA(
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/lib/setupapi/stubs.c</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/lib/setupapi/stubs.c        2005-11-26 04:29:40 UTC (rev 19612)
+++ trunk/reactos/lib/setupapi/stubs.c        2005-11-26 08:13:04 UTC (rev 19613)
@@ -225,33 +225,8 @@
</small></pre><pre class="diff" id="context"> &nbsp; &nbsp; return TRUE;
 }
 
</pre><pre class="diff" id="removed">-/***********************************************************************
- *                SetupDiGetDeviceInstanceIdA(SETUPAPI.@)
- */
-BOOL WINAPI SetupDiGetDeviceInstanceIdA(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PSTR DeviceInstanceId, DWORD DeviceInstanceIdSize,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PDWORD RequiredSize)
-{
- &nbsp; &nbsp;FIXME (&quot;Stub %p %p %p %d %p\n&quot;,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DeviceInfoSet, DeviceInfoData, DeviceInstanceId, DeviceInstanceIdSize, RequiredSize);
- &nbsp; &nbsp;SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- &nbsp; &nbsp;return FALSE;
-}
</pre><pre class="diff" id="context"> 
 /***********************************************************************
</pre><pre class="diff" id="removed">- *                SetupDiGetDeviceInstanceIdW(SETUPAPI.@)
- */
-BOOL WINAPI SetupDiGetDeviceInstanceIdW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PWSTR DeviceInstanceId, DWORD DeviceInstanceIdSize,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PDWORD RequiredSize)
-{
- &nbsp; &nbsp;FIXME (&quot;Stub %p %p %p %d %p\n&quot;,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DeviceInfoSet, DeviceInfoData, DeviceInstanceId, DeviceInstanceIdSize, RequiredSize);
- &nbsp; &nbsp;SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- &nbsp; &nbsp;return FALSE;
-}
-
-/***********************************************************************
</pre><pre class="diff" id="context"> &nbsp;*                SetupDiGetClassDevPropertySheetsA(SETUPAPI.@)
 &nbsp;*/
 BOOL WINAPI SetupDiGetClassDevPropertySheetsA(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData,
</pre>
</div>

</body>
</html>