windows-nt/Source/XPSP1/NT/net/rras/ras/autodial/rasacd/table.h
2020-09-26 16:20:57 +08:00

78 lines
1.1 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
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
);