\r
#include "index_list.h"\r
\r
+INDEX_ENTRY EmptyList;\r
+\r
static BOOLEAN IndexListGrow(INDEX_LIST *pIndexList)\r
{\r
INDEX_ENTRY *array;\r
pIndexList->FreeList = i;\r
}\r
\r
- if (pIndexList->pArray != NULL) {\r
+ if (pIndexList->pArray != &EmptyList) {\r
RtlCopyMemory(array, pIndexList->pArray, pIndexList->Size * sizeof(INDEX_ENTRY));\r
ExFreePool(pIndexList->pArray);\r
} else {\r
\r
} INDEX_ENTRY;\r
\r
+extern INDEX_ENTRY EmptyList;\r
+\r
// Synchronization must be provided by the caller.\r
typedef struct _INDEX_LIST\r
{\r
\r
static void IndexListInit(INDEX_LIST *pIndexList)\r
{\r
- RtlZeroMemory(pIndexList, sizeof(INDEX_LIST));\r
+ pIndexList->pArray = &EmptyList;\r
+ pIndexList->FreeList = 0;\r
+ pIndexList->Size = 0;\r
}\r
\r
static void IndexListDestroy(INDEX_LIST *pIndexList)\r
{\r
- if (pIndexList->pArray != NULL) {\r
+ if (pIndexList->pArray != &EmptyList) {\r
ExFreePool(pIndexList->pArray);\r
}\r
}\r