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.

111 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. suballoc.h
  5. Abstract:
  6. This is the public include file for the suballocation
  7. package.
  8. Author:
  9. Dave Hastings (daveh) creation-date 25-Jan-1994
  10. Revision History:
  11. --*/
  12. //
  13. // Constants
  14. //
  15. //
  16. // Minimum granularity for the commit routine
  17. // this is done as a constant rather than a parameter
  18. // to make defining data structures easier
  19. //
  20. #ifdef i386
  21. #define COMMIT_GRANULARITY 4096
  22. #else
  23. #define COMMIT_GRANULARITY 65536
  24. #endif
  25. //
  26. // Types
  27. //
  28. //
  29. // Routine for committing a specific region of of the address
  30. // space. Although the return type is NTSTATUS, the only value
  31. // that is checked is 0 (for STATUS_SUCCESS). If STATUS_SUCCESS
  32. // is returned, it is assumed that the function worked. If not,
  33. // it is assumed that it failed. No special meaning is attached to
  34. // particular non-zero values.
  35. //
  36. typedef
  37. NTSTATUS
  38. (*PSACOMMITROUTINE)(
  39. ULONG BaseAddress,
  40. ULONG Size
  41. );
  42. //
  43. // Routine for moving memory around in the address space.
  44. // Note: This routine MUST correctly handle overlapping
  45. // source and destination
  46. //
  47. typedef
  48. VOID
  49. (*PSAMEMORYMOVEROUTINE)(
  50. ULONG Destination,
  51. ULONG Source,
  52. ULONG Size
  53. );
  54. //
  55. // Public prototypes
  56. //
  57. PVOID
  58. SAInitialize(
  59. ULONG BaseAddress,
  60. ULONG Size,
  61. PSACOMMITROUTINE CommitRoutine,
  62. PSACOMMITROUTINE DecommitRoutine,
  63. PSAMEMORYMOVEROUTINE MemoryMoveRoutine
  64. );
  65. BOOL
  66. SAQueryFree(
  67. PVOID SubAllocation,
  68. PULONG FreeBytes,
  69. PULONG LargestFreeBlock
  70. );
  71. BOOL
  72. SAAllocate(
  73. PVOID SubAllocation,
  74. ULONG Size,
  75. PULONG Address
  76. );
  77. BOOL
  78. SAFree(
  79. PVOID SubAllocation,
  80. ULONG Size,
  81. ULONG Address
  82. );
  83. BOOL
  84. SAReallocate(
  85. PVOID SubAllocation,
  86. ULONG OriginalSize,
  87. ULONG OriginalAddress,
  88. ULONG NewSize,
  89. PULONG NewAddress
  90. );