Share via


DSF Object Model

DSF uses a device-independent object model for all simulated devices, including USB devices. The following diagram shows the DSF object model.

 

Diagram illustrating the DSF object model

 

The DSF object (IDSF) serves as the root of the hierarchy and provides access to the tree of simulated devices and to other services, such as logging and version information. The DSFDevice object (IDSFDevice) represents a simulated device, including a PCI device such as the EHCI controller simulator or a USB device such as a keyboard simulator. The DSFDevice object has a parameterized property called Object that device simulators use to expose secondary objects that are specific to the device. DSFDevice::Object is parameterized by a GUID and is read-write, so test applications can associate their own context-specific objects with a simulated device. In this release of DSF, the only object that a test application can store in DSFDevice::Object is a DSFPropertyBag object (IDSFPropertyBag). DSFPropertyBag is a collection of name-value pairs where the value is stored as a VARIANT value. This value enables the test application to store arbitrary information as needed. For example, the following VBScript code example shows code for a test application that needs to store the name of the currently running test in the DSFDevice object.

Const MyTestContextGUID = "{55302845-80EB-49DF-8832-3401E39569B8}"
Set PropBag = CreateObject("DSF.DSFPropertyBag")
PropBag.Write "CurrentTestName", "Test22"
Set DSFDevice.Object(MyTestContextGUID) = PropBag

CurrentTestName is a name that the test application chooses for the value that holds the name of the current test. The data for that value is set to "Test22" and then the property bag is stored in the DSFDevice object. For more information about the DSFPropertyBag object, see IDSFPropertyBag.

You can group DSFDevice objects in a collection called DSFDevices (IDSFDevices). The root of the simulated device tree is a DSFDevices collection that is referenced from the DSF::Devices property. If a device is a bus (such as the EHCI controller simulator), it will have child DSFDevice objects that represent the devices that attached to the bus. The child DSFDevices collection is referenced by the DSFDevice::Children property.

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010