def GetTokenInformation(token, information_class):
data_size = ctypes.wintypes.DWORD()<EOL>ctypes.windll.advapi32.GetTokenInformation(<EOL>token, information_class.num, <NUM_LIT:0>, <NUM_LIT:0>, ctypes.byref(data_size)<EOL>)<EOL>data = ctypes.create_string_buffer(data_size.value)<EOL>handle_nonzero_success(<EOL>ctypes.windll.advapi32.GetTokenInformation(<EOL>token,<EOL>information_class.num,<EOL>ctypes.byref(data),<EOL>ctypes.sizeof(data),<EOL>ctypes.byref(data_size),<EOL>)<EOL>)<EOL>return ctypes.cast(data, ctypes.POINTER(TOKEN_USER)).contents<EOL>
Given a token, get the token information for it.