[NTOSKRNL]

- Set DN_DISABLEABLE if the device can be disabled
[NEWDEV]
- Remove a hack needed because DN_DISABLEABLE was never set

svn path=/trunk/; revision=56241
This commit is contained in:
Cameron Gutman 2012-03-26 23:33:49 +00:00
parent 05abf4495a
commit 573aa31c4b
2 changed files with 9 additions and 15 deletions

View file

@ -55,31 +55,22 @@ CanDisableDevice(
IN HMACHINE hMachine,
OUT BOOL *CanDisable)
{
#if 0
/* hpoussin, Dec 2005. I've disabled this code because
* ntoskrnl never sets the DN_DISABLEABLE flag.
*/
CONFIGRET cr;
ULONG Status, ProblemNumber;
BOOL Ret = FALSE;
cr = CM_Get_DevNode_Status_Ex(
&Status,
&ProblemNumber,
DevInst,
0,
hMachine);
cr = CM_Get_DevNode_Status_Ex(&Status,
&ProblemNumber,
DevInst,
0,
hMachine);
if (cr == CR_SUCCESS)
{
*CanDisable = ((Status & DN_DISABLEABLE) != 0);
Ret = TRUE;
Ret = TRUE;
}
return Ret;
#else
*CanDisable = TRUE;
return TRUE;
#endif
}
static BOOL

View file

@ -444,6 +444,9 @@ IopGetDeviceNodeStatus(PDEVICE_NODE DeviceNode)
if (DeviceNode->UserFlags & DNUF_DONT_SHOW_IN_UI)
Output |= DN_NO_SHOW_IN_DM;
if (!(DeviceNode->UserFlags & DNUF_NOT_DISABLEABLE))
Output |= DN_DISABLEABLE;
/* FIXME: Implement the rest */
Output |= DN_NT_ENUMERATOR | DN_NT_DRIVER;