DOC: How to call CONFIGMG_Get(Set)_DevNode_PowerCapabilities (198664)



The information in this article applies to:

  • Microsoft Win32 Device Driver Kit (DDK) Windows 98

This article was previously published under Q198664

SUMMARY

Early versions of the Windows 98 DDK, including the July and October 1998 MSDN releases, incorrectly documented how to use the CONFIGMG_Get_DevNode_PowerCapabilities and CONFIGMG_Set_DevNode_PowerCapabilities services. For the correct documentation, please see the MORE INFORMATION section of this article.

MORE INFORMATION

You should call the CONFIGMG_Get_DevNode_PowerCapabilities and CONFIGMG_Set_DevNode_PowerCapabilities services as follows:
CONFIGRET CONFIGMG_Get_DevNode_PowerCapabilities(
  DEVNODE dnDevNode,
  PFARULONG pulPowerCapabilities,
  ULONG ulFlags
);

CONFIGRET CONFIGMG_Set_DevNode_PowerCapabilities(
  DEVNODE dnDevNode,
  ULONG ulPowerCapabilities,
  ULONG ulFlags
);
				

dnDevNode

The first parameter is a handle to the device node from or to which you are getting or setting the power capabilities.

pulPowerCapabilities/ulPowerCapabilities

The second parameter refers to a bitmap of power capabilities, which can include the following flags as defined in configmg.h:
  • CM_POWERSTATE_D0
  • CM_POWERSTATE_D1
  • CM_POWERSTATE_D2
  • CM_POWERSTATE_D3
When you call CONFIGMG_Get_DevNode_PowerCapabilities, this second parameter is a pointer to a ULONG that receives the device's capabilities.

When you call CONFIGMG_Set_DevNode_PowerCapabilities, this parameter is a ULONG containing a bitmap of capabilities to set. Note that new power capabilities are only accepted for a device the very first time CONFIGMG_Set_DevNode_PowerCapabilities is called for a given devnode. Subsequent calls result in a logical AND of ulPowerCapabilities with the device's prior power capabilities, meaning that subsequent calls can only remove power capabilities.

The Windows 98 DDK documentation for Get_DevNode_PowerCapabilities erroneously mentions the following capability flags, which are actually not implemented in Windows 98. Do not use these flags:
  • CM_POWERSTATE_WAKEUP_FROM_D1
  • CM_POWERSTATE_WAKEUP_FROM_D2
  • CM_POWERSTATE_WAKEUP_FROM_D3

ulFlags

The 3rd parameter to these functions, ulFlags, should be set to one of the following (depending upon whether you want to get or set the power capabilities for NORMAL or WAKEUP):
  • CM_CAPABILITIES_NORMAL
  • CM_CAPABILITIES_FOR_WAKEUP

REFERENCES

Windows 98 DDK documentation; topic: Configuration Manager; Power Management

Modification Type:MajorLast Reviewed:3/9/1999
Keywords:kbdocerr kbinfo KB198664