def _check_result(val, func, args):
    if (val == 0):
        raise ValueError
    else:
        return ctypes.c_void_p(val)
def _check_result(val, func, args):
    if (val == 0):
        raise ValueError
    else:
        return ctypes.c_void_p(val)