Leaked source code of windows server 2003
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.

61 lines
1.0 KiB

  1. #ifndef __LISTBASE_H__
  2. #define __LISTBASE_H__
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <sha.h>
  7. // minimal elt data structure
  8. typedef struct _ELT
  9. {
  10. struct _ELT* pNext;
  11. } ELT;
  12. typedef
  13. BOOL FISMATCH(ELT* pCandidate, ELT* pTemplate);
  14. typedef
  15. void FREEELT(ELT* pElt);
  16. class CLinkedList
  17. {
  18. public:
  19. CLinkedList();
  20. ~CLinkedList();
  21. BOOL Initialize();
  22. BOOL Reset();
  23. private:
  24. ELT* m_pHead;
  25. public:
  26. BOOL m_fInitialized;
  27. CRITICAL_SECTION m_critsecListBusy;
  28. FISMATCH* m_pfnIsMatch;
  29. FREEELT* m_pfnFreeElt;
  30. public:
  31. BOOL AddToList(ELT*);
  32. BOOL DelFromList(ELT*);
  33. ELT* SearchList(ELT*);
  34. BOOL LockList();
  35. BOOL UnlockList();
  36. ELT* GetHead()
  37. { return m_pHead; }
  38. };
  39. #ifdef __cplusplus
  40. } // extern "C" {
  41. #endif
  42. #endif // __LISTBASE_H__