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.

69 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. BUFMGR.H
  5. Abstract:
  6. Buffer Descriptor and Memory Manager for ARPD
  7. Author:
  8. Aaron Ogus (aarono)
  9. Environment:
  10. Win32/COM
  11. Revision History:
  12. Date Author Description
  13. ======= ====== ============================================================
  14. 1/13/97 aarono Original
  15. --*/
  16. #ifndef _BUFMGR_H_
  17. #define _BUFMGR_H_
  18. #include "buffer.h"
  19. #include "bufpool.h"
  20. typedef struct _DoubleBuffer{
  21. union {
  22. BUFFER Buffer;
  23. struct {
  24. struct _DoubleBuffer *pNext;
  25. PVOID PAD;
  26. PCHAR pData;
  27. UINT len; // length of data area used
  28. DWORD dwFlags; // Packet flags, ownership and type of packet.
  29. };
  30. };
  31. UINT totlen; // total length of data area
  32. UINT tLastUsed; // last tick count this was used
  33. CHAR data[1]; // variable length data
  34. } DOUBLEBUFFER, *PDOUBLEBUFFER;
  35. VOID InitBufferManager(VOID);
  36. VOID FiniBuffermanager(VOID);
  37. PBUFFER GetDoubleBufferAndCopy(PMEMDESC, UINT);
  38. VOID FreeDoubleBuffer(PBUFFER);
  39. PBUFFER BuildBufferChain(PMEMDESC, UINT);
  40. VOID FreeBufferChainAndMemory(PBUFFER); //works for either type
  41. UINT BufferChainTotalSize(PBUFFER);
  42. #define GBF_ALLOC_MEM 0x00000001
  43. // Don't pool more than 64K per channel.
  44. #define MAX_CHANNEL_DATA 65536
  45. // Don't hold more than 3 free buffers per channel.
  46. #define MAX_CHANNEL_BUFFERS 3
  47. #endif