QuickUsbReadData (quickusb)
Last changed: eggie5-149.63.77.160

.
Summary
Reads block from QuickUSB module (512 bytes).

C# Signature:

[DllImport("quickusb.dll", CharSet = CharSet.Ansi)]
    static extern int QuickUsbReadData(IntPtr Handle, byte[] outData, out int length);

User-Defined Types:

None.

Notes:

The functions in the QuickUsb library are really weird, or maybe I'm just not understanding something. But I don't understand how outData isn't out. Unless classes are refrence types and they are. I just don't understand, but this code works anyways...

Tips & Tricks:

Please add some!

Sample Code:

//data is a instianciated byte array of 512 length
public bool Read(out byte[] data, int length)
    {
        //Placeholder array
        byte[] readData = new byte[length];

        int len = readData.Length; //Should be 512

        int result = QuickUsbReadData(handle, readData, out len);

        if (result == 0) //0 Means error
        {
            return false;
        }

        data = readData;
        return true;

    }