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.

30 lines
665 B

  1. //
  2. // an aribrary list of sized items
  3. //
  4. typedef struct LIST *PLIST;
  5. typedef struct LIST {
  6. PVOID pData;
  7. UINT nBytes;
  8. PLIST next;
  9. PLIST prev;
  10. } LIST;
  11. class CList {
  12. private:
  13. PLIST m_pListHead;
  14. PLIST m_pListCurr;
  15. PLIST m_pListTail;
  16. public:
  17. CList();
  18. ~CList();
  19. BOOL IsEmpty() { return (NULL == m_pListHead); }
  20. void RemoveAll();
  21. void RemoveHead(PVOID pData);
  22. void RemoveHead(PVOID pData, PUINT pnBytes);
  23. BOOL Add(PVOID pData, UINT nBytes);
  24. PVOID PeekHead() { return (IsEmpty() ? NULL : m_pListHead->pData); }
  25. };