def to_large_integer(number): kwargs = {} if is_64bit(): kwargs['QuadPart'] = number else: kwargs['HighPart'] = (number & 0xFFFFFFFF00000000) >> 32 kwargs['LowPart'] = number & 0xFFFFFFFF instance = structures.LARGE_INTEGER(**kwargs) return instance
def from_large_integer(instance): return instance.QuadPart if is_64bit() else ((instance.HighPart << 32) + instance.LowPart)