IDeviceDepot::RootDevice property
The RootDevice property provides access to the root device that is exposed as an instance of the ITarget interface.
This property is read-only.
Syntax
HRESULT get_RootDevice(
[out, retval] ITarget **pVal
);
Property value
The address of the variable that will receive a copy of the RootDevice target.
Error codes
RootDevice returns a standard HRESULT value.
Remarks
The following code example demonstrates how to use the RootDevice property.
VBScript
'
' Get DeviceDepot
'
Set DeviceDepot = WDTF.DeviceDepot
If DeviceDepot Is Nothing Then
WScript.Echo "Error fetching DeviceDepot object. Error# " & Err.Number
WScript.Quit(1)
End If
'
' Get Root Device
'
Set RootDevice = DeviceDepot.RootDevice
If RootDevice Is Nothing Then
WScript.Echo "Error fetching RootDevice object. Error# " & Err.Number
End If
C++
ITarget* pRootDevice; // Root Device
//
// Get DeviceDepot for querying and retrieving the Target and Targets object
//
hr = pWDTF->get_DeviceDepot(&pDeviceDepot);
if(FAILED(hr))
{
_tprintf(_T("\nFailed to get DeviceDepot Object from WDTF. Error: 0x%x"), hr);
goto Cleanup;
}
//
// Get root devices (ITarget)
//
hr = pDeviceDepot->get_RootDevice(&pRootDevice);
if(FAILED(hr))
{
_tprintf(_T("\nFailed to get root device from DeviceDepot Object. Error: 0x%x"), hr);
goto Cleanup;
}
See also
Send comments about this topic to Microsoft
Build date: 1/12/2012