Share via


IDSFDevice::StopFaultInjection Method

The StopFaultInjection method requests that the device stop injecting faults into the hardware interface.

Syntax

HRESULT StopFaultInjection(
  [in]  DSFResourceType ResType,
  [in]  VARIANT Context
);

Parameters

  • ResType [in]
    The resource for which fault injection is being stopped.

  • Context [in]
    The context that is returned from the proceeding call to IDSFDevice::StartFaultInjection.

Return Value

StopFaultInjection always returns S_OK.

Remarks

The StopFaultInjection method is reserved for future use and is included here for completeness.

The call to StopFaultInjection follows a call to the IDSFDevice::StartFaultInjection method.

Examples

The following C++ code example shows how to turn fault injection on and off for a DSFDevice object while a test case is been executed.

HRESULT CMyDevice::RunPortTest()
{
HRESULT              hr = S_OK;
 IDSFDevice         *piDSFDevice = NULL;
 DSFResourceType DSFRes = DSFResourceTypePort;
VARIANT              varParam; ::VariantInit(&varParam);
VARIANT              varContext; ::VariantInit(&varContext);

// Get the underlying DSFDevice interface 
 hr = get_DSFDevice(reinterpret_cast<DSFDevice*>(piDSFDevice));
 if(!FAILED(hr))
{
  // Set the parameters so that the top bit is always set
 varParam.vt = VT_BYTE;
 varParam.bVal  =0x08;

 hr = piDSFDevice->StartFaultInjection(DSFRes, varParam, &varContext);
 if(FAILED(hr);
 goto Exit;
 
  // Run the port input test case
 hr = TestPortInput();
 if(FAILED(hr))
 goto Exit;
 
  // Stop fault injection
 hr = piDSFDevice->StopFaultInjection(DSFRes, varContext)
 if (FAILED(hr))
 goto Exit;
}
Exit:
 if (NULL != piDSFDevice)
{
 piDSFDevice->Release();
 piDSFDevice = NULL;
}
 return hr;
}

See Also

IDSFDevice

IDSFDevice::StartFaultInjection

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010