[prev in list] [next in list] [prev in thread] [next in thread]
List: ros-diffs
Subject: [ros-diffs] [weiden] 19782: fixed call to
From: <weiden () svn ! reactos ! com>
Date: 2005-11-30 18:26:56
Message-ID: 000001c5f5db$a4e15180$6b01a8c0 () PENELOPE
[Download RAW message or body]
fixed call to SetupDiGetClassDevPropertySheets
Modified: trunk/reactos/lib/devmgr/advprop.c
_____
Modified: trunk/reactos/lib/devmgr/advprop.c
--- trunk/reactos/lib/devmgr/advprop.c 2005-11-30 17:28:42 UTC (rev
19781)
+++ trunk/reactos/lib/devmgr/advprop.c 2005-11-30 18:26:43 UTC (rev
19782)
@@ -169,23 +169,12 @@
PROPSHEETHEADER psh = {0};
PROPSHEETPAGE pspGeneral = {0};
DWORD nPropSheets = 0;
- DWORD nDevSheetsStart = 0;
PPROPERTYSHEETW pPropertySheetW;
PCREATEPROPERTYSHEETPAGEW pCreatePropertySheetPageW;
PDESTROYPROPERTYSHEETPAGE pDestroyPropertySheetPage;
PDEVADVPROP_INFO DevAdvPropInfo;
DWORD PropertySheetType;
HANDLE hMachine = NULL;
- UINT nPages = 0;
- union
- {
- ULONG Mask;
- struct
- {
- ULONG General : 1;
- ULONG Device : 1;
- } Page;
- } DelPropSheets = {0};
INT_PTR Ret = -1;
/* we don't want to statically link against comctl32, so find the
@@ -283,60 +272,44 @@
psh.phpage[0] = pCreatePropertySheetPageW(&pspGeneral);
if (psh.phpage[0] != NULL)
{
- DelPropSheets.Page.General = TRUE;
- nDevSheetsStart++;
- nPages++;
+ psh.nPages++;
}
if (nPropSheets != 0)
{
- /* create the device property sheets but don't overwrite
- the "General" property sheet handle */
- psh.phpage += nDevSheetsStart;
+ /* create the device property sheets */
if (!SetupDiGetClassDevPropertySheets(DeviceInfoSet,
DeviceInfoData,
&psh,
- nPropSheets,
+ nPropSheets +
psh.nPages,
NULL,
PropertySheetType))
{
goto Cleanup;
}
- psh.phpage -= nDevSheetsStart;
-
- DelPropSheets.Page.Device = TRUE;
- nPages += nPropSheets;
}
- psh.nPages = nPages;
-
/* FIXME - add the "Driver" property sheet if necessary */
- Ret = pPropertySheetW(&psh);
+ if (psh.nPages != 0)
+ {
+ Ret = pPropertySheetW(&psh);
- /* no need to destroy the property sheets anymore */
- DelPropSheets.Mask = 0;
+ /* NOTE: no need to destroy the property sheets anymore! */
+ }
+ else
+ {
+ UINT i;
Cleanup:
- /* in case of failure the property sheets must be destroyed */
- if (DelPropSheets.Mask != 0)
- {
- if (DelPropSheets.Page.General && psh.phpage[0] != NULL)
+ /* in case of failure the property sheets must be destroyed
*/
+ for (i = 0;
+ i < psh.nPages;
+ i++)
{
- pDestroyPropertySheetPage(psh.phpage[0]);
- }
-
- if (DelPropSheets.Page.Device)
- {
- UINT i;
- for (i = 0;
- i < nPropSheets;
- i++)
+ if (psh.phpage[i] != NULL)
{
- if (psh.phpage[i + 1] != NULL)
- {
- pDestroyPropertySheetPage(psh.phpage[i + 1]);
- }
+ pDestroyPropertySheetPage(psh.phpage[i]);
}
}
}
[Attachment #3 (text/html)]
<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">fixed call to SetupDiGetClassDevPropertySheets</pre><pre \
class="diff" id="context">Modified: trunk/reactos/lib/devmgr/advprop.c </pre><hr \
/><div class="file"> <div class="fileheader"><big><b>Modified: \
trunk/reactos/lib/devmgr/advprop.c</b></big></div> <pre class="diff"><small \
id="info">--- trunk/reactos/lib/devmgr/advprop.c 2005-11-30 17:28:42 \
UTC (rev 19781)
+++ trunk/reactos/lib/devmgr/advprop.c 2005-11-30 18:26:43 UTC (rev 19782)
@@ -169,23 +169,12 @@
</small></pre><pre class="diff" id="context"> PROPSHEETHEADER psh = \
{0}; PROPSHEETPAGE pspGeneral = {0};
DWORD nPropSheets = 0;
</pre><pre class="diff" id="removed">- DWORD nDevSheetsStart = 0;
</pre><pre class="diff" id="context"> PPROPERTYSHEETW pPropertySheetW;
PCREATEPROPERTYSHEETPAGEW pCreatePropertySheetPageW;
PDESTROYPROPERTYSHEETPAGE pDestroyPropertySheetPage;
PDEVADVPROP_INFO DevAdvPropInfo;
DWORD PropertySheetType;
HANDLE hMachine = NULL;
</pre><pre class="diff" id="removed">- UINT nPages = 0;
- union
- {
- ULONG Mask;
- struct
- {
- ULONG General : 1;
- ULONG Device : 1;
- } Page;
- } DelPropSheets = {0};
</pre><pre class="diff" id="context"> INT_PTR Ret = -1;
/* we don't want to statically link against comctl32, so find the
@@ -283,60 +272,44 @@
</pre><pre class="diff" id="context"> psh.phpage[0] = \
pCreatePropertySheetPageW(&pspGeneral); if \
(psh.phpage[0] != NULL) {
</pre><pre class="diff" id="removed">- \
DelPropSheets.Page.General = TRUE;
- nDevSheetsStart++;
- nPages++;
</pre><pre class="diff" id="added">+ <span \
id="addedchars">psh.</span>nPages++; </pre><pre class="diff" id="context"> \
}
if (nPropSheets != 0)
{
</pre><pre class="diff" id="removed">- /* \
create the device property sheets but don't overwrite
- the "General" property \
sheet handle */
- <span id="removedchars">psh.phpage += \
nDevSheetsStart;</span> </pre><pre class="diff" id="added">+ \
<span id="addedchars">/* create the device property sheets \
*/</span> </pre><pre class="diff" id="context"> \
if (!SetupDiGetClassDevPropertySheets(DeviceInfoSet, \
\
DeviceInfoData, \
\
\
&psh, </pre><pre class="diff" id="removed">- \
\
nPropSheets, </pre><pre \
class="diff" id="added">+ \
\
nPropSheets<span id="addedchars"> + \
psh.nPages</span>, </pre><pre class="diff" id="context"> \
\
NULL, \
\
\
PropertySheetType)) {
goto Cleanup;
}
</pre><pre class="diff" id="removed">- \
psh.phpage -= nDevSheetsStart;
-
- DelPropSheets.Page.Device = TRUE;
- nPages += nPropSheets;
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">- psh.nPages = \
nPages;
-
</pre><pre class="diff" id="context"> /* FIXME - add the \
"Driver" property sheet if necessary */
</pre><pre class="diff" id="removed">- <span \
id="removedchars">Ret = pPropertySheetW(&psh);</span> </pre><pre class="diff" \
id="added">+ <span id="addedchars">if (psh.nPages != \
0)</span> + {
+ Ret = pPropertySheetW(&psh);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- /* no need to \
destroy the property sheets anymore */
- <span id="removedchars">DelPropSheets.Mask = 0;</span>
</pre><pre class="diff" id="added">+ <span \
id="addedchars"> /* NOTE: no need to destroy the property sheets \
anymore! */</span> + }
+ else
+ {
+ UINT i;
</pre><pre class="diff" id="context">
Cleanup:
</pre><pre class="diff" id="removed">- /* in case of \
failure the property sheets must be destroyed */
- if (DelPropSheets.Mask != 0)
- {
- <span id="removedchars">if \
(DelPropSheets.Page.General && psh.phpage[0] != NULL)</span> </pre><pre \
class="diff" id="added">+ <span \
id="addedchars">/* in case of failure the property sheets must be destroyed */</span> \
+ for (i = 0; + \
i < psh.nPages; + \
i++) </pre><pre class="diff" id="context"> \
{ </pre><pre class="diff" id="removed">- \
\
pDestroyPropertySheetPage(psh.phpage[0]);
- }
-
- if (DelPropSheets.Page.Device)
- {
- UINT i;
- for (i = 0;
- i < \
nPropSheets;
- <span id="removedchars"> \
i++</span>) </pre><pre class="diff" id="added">+ \
<span id="addedchars">if (psh.phpage[i] != \
NULL</span>) </pre><pre class="diff" id="context"> \
{ </pre><pre class="diff" id="removed">- \
if (psh.phpage[i + 1] \
!= NULL)
- {
- \
pDestroyPropertySheetPage(psh.phpage[i + 1]);
- <span \
id="removedchars">}</span> </pre><pre class="diff" id="added">+ \
<span \
id="addedchars">pDestroyPropertySheetPage(psh.phpage[i]);</span> </pre><pre \
class="diff" id="context"> } \
} }
</pre>
</div>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic