def _check_bool(result, func, args):  
if not result:<EOL><INDENT>raise ctypes.WinError(ctypes.get_last_error())<EOL><DEDENT>return args<EOL>
Used as an error handler for Windows calls
Gets last error if call is not successful