def METHOD_NAME(ql: Qiling, address: int, params):
    addr = params["lpTopLevelExceptionFilter"]
    handle = ql.os.handle_manager.search("TopLevelExceptionHandler")
    if handle is None:
        handle = Handle(name="TopLevelExceptionHandler", obj=addr)
        ql.os.handle_manager.append(handle)
        prev_filter = 0
    else:
        prev_filter = handle.obj
        handle.obj = addr
    return prev_filter