A limited subset of pywin32 re-implemented using ctypes