I've ported it to D as is, and that specific interface has issues when calling function `CreateRawDeviceReport`. Most other functions work so far.