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.

47 lines
1.3 KiB

  1. // Copyright (c) 1992 Microsoft Corporation
  2. /* list.h */
  3. #define MAXLISTS 500
  4. // this means that total of all seqs and tracks <= 500
  5. #define NULLLIST ((DWORD)-1)
  6. typedef DWORD ListHandle;
  7. typedef struct Node
  8. {
  9. struct Node *next; // ptr to next element in list
  10. HLOCAL handle; // handle to self
  11. BYTE data[]; // where the data goes
  12. } Node;
  13. // below: size of stuff preceeding data in "Node" structure (for mem alloc)
  14. #define NODEHDRSIZE sizeof(Node)
  15. typedef struct l
  16. {
  17. DWORD nodeSize;
  18. BOOL fLocked;
  19. Node *firstNode;
  20. } List;
  21. PUBLIC ListHandle FAR PASCAL List_Create(DWORD nodeSize, DWORD flags);
  22. PUBLIC NPSTR FAR PASCAL List_Allocate(ListHandle lh);
  23. PUBLIC void FAR PASCAL List_Deallocate(ListHandle lh, NPSTR node);
  24. PUBLIC VOID FAR PASCAL List_Destroy(ListHandle lh);
  25. PUBLIC VOID FAR PASCAL List_Attach_Tail(ListHandle lh, NPSTR node);
  26. PUBLIC NPSTR FAR PASCAL List_Get_First(ListHandle lh);
  27. PUBLIC NPSTR FAR PASCAL List_Get_Next(ListHandle lh, VOID* node);
  28. #ifdef DEBUG
  29. PUBLIC VOID FAR PASCAL List_Lock(ListHandle lh);
  30. PUBLIC VOID FAR PASCAL List_Unlock(ListHandle lh);
  31. #else
  32. #define List_Lock(lh)
  33. #define List_Unlock(lh)
  34. #endif