handletable.h revision c8dfb9c4df92b82e92a48d90d984cfd7b6339111
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * IPRT - Handle Tables.
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * Copyright (C) 2008 Oracle Corporation
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * available from http://www.virtualbox.org. This file is free software;
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * you can redistribute it and/or modify it under the terms of the GNU
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * General Public License (GPL) as published by the Free Software
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * The contents of this file may alternatively be used under the terms
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * of the Common Development and Distribution License Version 1.0
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * VirtualBox OSE distribution, in which case the provisions of the
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * CDDL are applicable instead of those of the GPL.
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * You may elect to license modified versions of this file under the
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * terms and conditions of either the GPL or the CDDL or both.
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync/** @defgroup grp_rt_handletable RTHandleTable - Handle Tables
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * @ingroup grp_rt
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * Callback for retaining an object during the lookup and free calls.
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * This callback is executed when a handle is being looked up in one
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * way or another from behind the handle table lock. This allows you
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync * to increase the reference (or some equivalent thing) during the
typedef DECLCALLBACK(int) FNRTHANDLETABLERETAIN(RTHANDLETABLE hHandleTable, void *pvObj, void *pvCtx, void *pvUser);
typedef DECLCALLBACK(void) FNRTHANDLETABLEDELETE(RTHANDLETABLE hHandleTable, uint32_t h, void *pvObj, void *pvCtx, void *pvUser);
RTDECL(int) RTHandleTableCreateEx(PRTHANDLETABLE phHandleTable, uint32_t fFlags, uint32_t uBase, uint32_t cMax,
RTDECL(int) RTHandleTableDestroy(RTHANDLETABLE hHandleTable, PFNRTHANDLETABLEDELETE pfnDelete, void *pvUser);
RTDECL(int) RTHandleTableAllocWithCtx(RTHANDLETABLE hHandleTable, void *pvObj, void *pvCtx, uint32_t *ph);