The C windows API call was wrong. The lpBytesReturned parameter was set to
NULL. While the docmentation at:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363406(v=vs.85).aspx
states that it CANNOT be NULL if lpOverlapped is NULL. Overlapped is for
async operations. So the easiest way to fix this is to supply a proper
pointer.
I've also removed unused includes. And supplied the DeviceIoControl with
proper ctypes calling information to prevent other python->c problems.