diff options
Diffstat (limited to '')
-rw-r--r-- | private/ntos/tdi/acd/table.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/private/ntos/tdi/acd/table.h b/private/ntos/tdi/acd/table.h new file mode 100644 index 000000000..17a5ef1a0 --- /dev/null +++ b/private/ntos/tdi/acd/table.h @@ -0,0 +1,77 @@ +/*++ + +Copyright(c) 1995 Microsoft Corporation + +MODULE NAME + table.h + +ABSTRACT + Header file for generic hash table routines. + +AUTHOR + Anthony Discolo (adiscolo) 28-Jul-1995 + +REVISION HISTORY + +--*/ + +// +// Number of hash table buckets. +// +#define NBUCKETS 13 + +// +// Generic hash table structure. +// +typedef struct _HASH_TABLE { + LIST_ENTRY ListEntry[NBUCKETS]; + KSPIN_LOCK SpinLock; +} HASH_TABLE, *PHASH_TABLE; + +// +// Hash table enumerator procedure. +// Returns TRUE to continue enumeration, +// FALSE to terminate enumeration. +// +typedef BOOLEAN (*PHASH_TABLE_ENUM_PROC)(PVOID, PACD_ADDR, ULONG); + + +PHASH_TABLE +NewTable(); + +VOID +ClearTable( + IN PHASH_TABLE pTable + ); + +VOID +FreeTable( + IN PHASH_TABLE pTable + ); + +VOID +EnumTable( + IN PHASH_TABLE pTable, + IN PHASH_TABLE_ENUM_PROC pProc, + IN PVOID pArg + ); + +BOOLEAN +GetTableEntry( + IN PHASH_TABLE pTable, + IN PACD_ADDR pszKey, + OUT PULONG pulData + ); + +BOOLEAN +PutTableEntry( + IN PHASH_TABLE pTable, + IN PACD_ADDR pszKey, + IN ULONG ulData + ); + +BOOLEAN +DeleteTableEntry( + IN PHASH_TABLE pTable, + IN PACD_ADDR pszKey + ); |