Source code of Windows XP (NT5)
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.

100 lines
2.3 KiB

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 1993-2000 Microsoft Corporation
  3. Module Name:
  4. rpcssm.hxx
  5. Abstract:
  6. Private definitions for the rpcssm memory package
  7. Author:
  8. Ryszard K. Kott (ryszardk) created June 29, 1994.
  9. Revision History:
  10. -------------------------------------------------------------------*/
  11. #ifndef __RPCSSM_HXX__
  12. #define __RPCSSM_HXX__
  13. #define ALIGN_TO_8(x) (size_t)(((x)+7) & 0xfffffff8)
  14. #define DESCR_ARRAY_SIZE 1024
  15. #define DESCR_ARRAY_INCR 1024
  16. #define ENABLE_STACK_SIZE 16
  17. #define ENABLE_STACK_INCR 16
  18. // Enable stack keeps longs.
  19. // Descr block stack keeps descr blocks.
  20. typedef struct _ALLOC_BLOCK_DESCR
  21. {
  22. char * AllocationBlock;
  23. char * FirstFree;
  24. unsigned long SizeLeft;
  25. #if defined( DEBUGRPC )
  26. unsigned long Counter;
  27. #endif
  28. } ALLOC_BLOCK_DESCR, * PALLOC_BLOCK_DESCR;
  29. // Initial boundle of Win32 stacks: we save an allocation at the expense
  30. // of keeping initial block around.
  31. // Of course we hope that initial block is good enough for most apps.
  32. typedef struct _INIT_STACKS_BLOCK
  33. {
  34. unsigned long EnableStack[ ENABLE_STACK_SIZE ];
  35. ALLOC_BLOCK_DESCR DescrStack[ DESCR_ARRAY_SIZE ];
  36. } INIT_STACKS_BLOCK;
  37. typedef struct _ALLOCATION_CONTEXT
  38. {
  39. RPC_CLIENT_ALLOC * ClientAlloc;
  40. RPC_CLIENT_FREE * ClientFree;
  41. unsigned int EnableCount;
  42. CRITICAL_SECTION CriticalSection;
  43. unsigned long ThreadCount;
  44. INIT_STACKS_BLOCK * pInitialStacks;
  45. unsigned long * pEnableStack;
  46. unsigned long StackMax;
  47. unsigned long StackTop;
  48. PALLOC_BLOCK_DESCR pBlockDescr;
  49. unsigned long DescrSize;
  50. unsigned long FFIndex;
  51. DWORD PageSize;
  52. DWORD Granularity;
  53. } ALLOCATION_CONTEXT, * PALLOCATION_CONTEXT;
  54. #ifdef NEWNDR_INTERNAL
  55. #undef RequestGlobalMutex
  56. #undef ClearGlobalMutex
  57. #define RequestGlobalMutex()
  58. #define ClearGlobalMutex()
  59. #endif // NEWNDR_INTERNAL
  60. PALLOCATION_CONTEXT GetAllocContext ();
  61. void SetAllocContext ( IN PALLOCATION_CONTEXT AllocContext );
  62. #endif // __RPCSSM_HXX__