Controlling Targets

WDTF includes a set of interfaces that perform specific actions on targets. WDTF uses the Windows registry to map target-specific implementations of these interfaces to actual targets. There might be one implementation for all targets, or multiple class-specific implementations. Scenarios can use Action Interfaces to perform common activities without having to know the specifics of each target.

Your scenario can attempt to locate an implementation for one of these interfaces by calling the IWDTFTarget2::GetInterface method. Note that not all target objects support every action interface. The following VBScript code example retrieves an interface that can disable and enable (and more) the device that the target represents.

Set Action = Device.GetInterface("PNP")

The Action Interfaces are identified with a WDTF ProgId. You must specify the WDTF ProgId when you call the HasInterface, GetInterface, GetInterfaces, and GetInterfacesIfExist methods. For information about WDTF ProgId, see the Action Interfaces.

You can add interfaces and implementations of interfaces to WDTF through a plug-in model. For more information about this model, see Extending the Framework.

Extending the Framework
GetInterface
GetInterfaces
GetInterfacesIfExist
HasInterface