En #pragma once...
HANDLE WriteHandle = INVALID_HANDLE_VALUE; //Need to get a write "handle" to our device before we can write to it.
HANDLE ReadHandle = INVALID_HANDLE_VALUE; //Need to get a read "handle" to our device before we can read from it.
En la rutina en cuestión...
unsigned char OutputPacketBuffer[3]; //Allocate a memory buffer equal to our endpoint size + 1
unsigned char InputPacketBuffer[65]; //Allocate a memory buffer equal to our endpoint size + 1
InputPacketBuffer[0] = 0;
OutputPacketBuffer[0] = 0;
OutputPacketBuffer[1] = 0x1;
OutputPacketBuffer[2] = 0x1;
WriteFile(WriteHandle, &OutputPacketBuffer, 3, &BytesWritten, 0); //Blocking function, unless an "overlapped" structure is used
ReadFile(ReadHandle, &InputPacketBuffer, 65, &BytesRead, 0); //Blocking function, unless an "overlapped" structure is used