Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

57 lines
1.2 KiB

//+---------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1993 - 1994.
//
// File: cspytbl.hxx
//
// Contents: Definitions for cspytbl.cxx
//
// Classes: CSpyTable
//
// Functions:
//
// History: 27-Oct-94 BruceMa Created
//
//----------------------------------------------------------------------
// A useful macro
#define until_(x) while(!(x))
// An entry in the hash table
typedef struct
{
ULONG dwCollision;
void *pAllocation;
} AENTRY, *LPAENTRY;
// The initial number of entries
const ULONG INITIALENTRIES = 256;
// The wrap constant when colliding
const ULONG PRIME = 19; // This MUST! be relatively prime to
// m_cEntries
// Managing class for the hash table
class CSpyTable
{
public:
CSpyTable(BOOL *pfOk);
~CSpyTable();
BOOL Add(void *allocation);
BOOL Remove(void *allocation);
BOOL Find(void *allocation, ULONG *pulIndex);
ULONG m_cAllocations;
private:
BOOL Expand(void);
LPAENTRY m_table;
ULONG m_cEntries;
};
typedef CSpyTable *LPSPYTABLE;