eErrorCode cScsiPassThrough::IssueCommand(const DeviceHandle& Handle, std::shared_ptr<const IBuffer> Essense, std::shared_ptr<IBuffer> DataBuffer)
{
    eErrorCode errorCode = eErrorCode::None;

    cBufferFormatter bufferFormatter = cBufferFormatter::Reader(Essense);

    switch (bufferFormatter.GetHeader().Format)
    {
    case 1:
    {
        cEssenseScsi1 essense = cEssenseScsi1::Reader(Essense);

        memset(&m_ScsiPassThrough, 0, sizeof(m_ScsiPassThrough));

        InitializePassThroughDirect(
                    essense.GetCommandCharacteristics(),
                    essense.GetCdbRegisters(),
                    DataBuffer,
                    60 //TODO: allow configurable timeout
                    );
        errorCode = IssuePassThroughDirectCommand(Handle.Handle);
    } break;

    default:
    {
        errorCode = eErrorCode::FormatNotSupported;
    } break;
    }

    return(errorCode);
}
    eErrorCode cAtaPassThrough::IssueCommand( std::shared_ptr<cBufferInterface> Essense, std::shared_ptr<cBufferInterface> DataBuffer )
    {
        eErrorCode errorCode = eErrorCode::None;

        cBufferFormatter bufferFormatter = cBufferFormatter::Reader(Essense);       
        
        switch (bufferFormatter.GetHeader().Format)
        {
            case 1:
            {
                cEssenseAta1 essense = cEssenseAta1::Reader(Essense);
                
                m_DeviceHandle = essense.GetDeviceHandle();

                InitializePassThroughDirect(
                    essense.GetCommandCharacteristics(),
                    essense.GetTaskFileExt(),
                    essense.GetTaskFile(),
                    DataBuffer,
                    60 //TODO: allow configurable timeout
                    );
                  
                U32 bytesReturned = 0;
                errorCode = IssuePassThroughDirectCommand(bytesReturned);
            } break;

            default:
                errorCode = eErrorCode::FormatNotSupported;
                break; 
        }        

        return(errorCode);
    }