T << TraceInfo << "VideoCaptureDriver::OnCreateAdapter -- Start\n";
// -- since our test driver DOESN'T have hardware, this BETTER be 0! --
if (pConfigInfo->NumberOfAccessRanges != 0)
{
T << TraceError << "VideoCaptureDriver::OnCreateAdapter -- Illegal port configuration info\n";
return (pSrb->Status = STATUS_NO_SUCH_DEVICE);
}
// -- construct the adapter using the AdapterStorage memory allocated
// by the Class Driver --
m_pAdapter = new (AdapterStorage) VideoCaptureAdapter(this, pConfigInfo);
// -- initialize the adapter object and its member streams! --
if (NULL != m_pAdapter)
m_pAdapter->Initialize();
else
{
T << TraceError << "VideoCaptureDriver::OnCreateAdapter -- Adapter constructor failed!\n";
ReturnValue = STATUS_IO_DEVICE_ERROR;
}
T << TraceInfo << TraceHex << "VideoCaptureDriver::OnCreateAdapter -- End. Status is " << (ULONG)ReturnValue << "\n";
if (ReturnValue!=STATUS_SUCCESS) return ReturnValue;
UsbTransferDevice * pDevice = new (
NULL,
FILE_DEVICE_UNKNOWN,
NULL,
0,
DO_DIRECT_IO
)
UsbTransferDevice(Pdo, m_Unit);
if (pDevice == NULL)
{
T << "Error creating device UsbTransferDevice" << (ULONG) m_Unit << EOL;
return STATUS_INSUFFICIENT_RESOURCES;
}
NTSTATUS status = pDevice->ConstructorStatus();
if ( !NT_SUCCESS(status) )
{
T << "Error constructing device UsbTransferDevice" << (ULONG) m_Unit << " status " << (ULONG) status << EOL;
delete pDevice;
}
else
{
m_Unit++;
}