DEVPKEY_Device_SafeRemovalRequired
The DEVPKEY_Device_SafeRemovalRequired device property represents a Boolean value that indicates whether a hot-plug device instance requires safe removal from the computer.
Attribute | Value |
---|---|
Property key | DEVPKEY_Device_SafeRemovalRequired |
Property-data-type identifier | DEVPROP_TYPE_BOOLEAN |
Property access | Read-only access by installation applications and installers |
Localized? | No |
Remarks
If this property for a hot-plug device instance has a value of DEVPROP_TRUE, the device instance requires safe removal from the computer. In this case, Windows displays the Safely Remove Hardware icon in the notification area on the right side of the taskbar. When the user clicks this icon, the system starts the Safely Remove Hardware program. By using this program, the user can instruct the system to prepare the device instance for removal before it can be surprise-removed from the computer.
Note If the device instance is a removable media device, such as an optical disk drive, the device instance must have media inserted and must have the DEVPKEY_Device_SafeRemovalRequired property value of DEVPROP_TRUE. If both are true, the device instance is displayed in the Safely Remove Hardware program.
Windows Plug and Play (PnP) determines that the hot-plug device instance requires safe removal from the system if the following are true:
The device instance is currently connected to the system.
The device instance is either started or can be ejected automatically by the system.
The CM_DEVCAP_SURPRISEREMOVALOK device capability bit for the device instance is not set. For more information about device capabilities, see SetupDiGetDeviceRegistryProperty.
The device instance does not have the DEVPKEY_Device_SafeRemovalRequiredOverride device property set to DEVPROP_FALSE.
Note
PnP unconditionally determines that the hot-plug device requires safe removal if the DEVPKEY_Device_SafeRemovalRequiredOverride device property is set to DEVPROP_TRUE.
- The device instance is either directly removable from its parent device instance or has a removable ancestor in its device tree.
You can call CM_Get_DevNode_Property or SetupDiGetDeviceProperty to retrieve the value of DEVPKEY_Device_SafeRemovalRequired.
Requirements
Version: Windows 7 and later versions of Windows
Header: Devpkey.h (include Devpkey.h)
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for