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.

162 lines
3.6 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. lsasrvmm.h
  5. Abstract:
  6. Local Security Authority - Main Include File for Lsa Server Memory
  7. Management Routines.
  8. Author:
  9. Scott Birrell (ScottBi) February 29, 1992
  10. Environment:
  11. Revision History:
  12. --*/
  13. /////////////////////////////////////////////////////////////////////////////
  14. // //
  15. // Free List Routines and Definitions //
  16. // //
  17. /////////////////////////////////////////////////////////////////////////////
  18. #define LSAP_MM_MIDL ((ULONG) 0x00000001L)
  19. #define LSAP_MM_HEAP ((ULONG) 0x00000002L)
  20. //
  21. // Options from LsapMmCleanupFreeList
  22. //
  23. #define LSAP_MM_FREE_BUFFERS ((ULONG) 0x00000001L)
  24. typedef struct _LSAP_MM_FREE_LIST_ENTRY {
  25. PVOID Buffer;
  26. ULONG Options;
  27. } LSAP_MM_FREE_LIST_ENTRY, *PLSAP_MM_FREE_LIST_ENTRY;
  28. typedef struct _LSAP_MM_FREE_LIST {
  29. ULONG UsedCount;
  30. ULONG MaxCount;
  31. PLSAP_MM_FREE_LIST_ENTRY Buffers;
  32. } LSAP_MM_FREE_LIST, *PLSAP_MM_FREE_LIST;
  33. #define LsapMmInitializeFreeListStatic( _list_, _buffer_ ) \
  34. (_list_)->UsedCount = 0; \
  35. (_list_)->MaxCount = sizeof( _buffer_ ) / sizeof( LSAP_MM_FREE_LIST_ENTRY );\
  36. (_list_)->Buffers = _buffer_;
  37. NTSTATUS
  38. LsapMmCreateFreeList(
  39. OUT PLSAP_MM_FREE_LIST FreeList,
  40. IN ULONG MaxEntries
  41. );
  42. NTSTATUS
  43. LsapMmAllocateMidl(
  44. IN PLSAP_MM_FREE_LIST FreeList,
  45. OUT PVOID *OutputBuffer,
  46. IN ULONG BufferLength
  47. );
  48. VOID
  49. LsapMmFreeLastEntry(
  50. IN PLSAP_MM_FREE_LIST FreeList
  51. );
  52. VOID
  53. LsapMmCleanupFreeList(
  54. IN PLSAP_MM_FREE_LIST FreeList,
  55. IN ULONG Options
  56. );
  57. NTSTATUS
  58. LsapRpcCopyUnicodeString(
  59. IN OPTIONAL PLSAP_MM_FREE_LIST FreeList,
  60. OUT PUNICODE_STRING DestinationString,
  61. IN PUNICODE_STRING SourceString
  62. );
  63. NTSTATUS
  64. LsapRpcCopyUnicodeStrings(
  65. IN OPTIONAL PLSAP_MM_FREE_LIST FreeList,
  66. IN ULONG Count,
  67. OUT PUNICODE_STRING *DestinationStrings,
  68. IN PUNICODE_STRING SourceStrings
  69. );
  70. NTSTATUS
  71. LsapRpcCopySid(
  72. IN OPTIONAL PLSAP_MM_FREE_LIST FreeList,
  73. OUT PSID *DestinationSid,
  74. IN PSID SourceSid
  75. );
  76. NTSTATUS
  77. LsapRpcCopyTrustInformation(
  78. IN OPTIONAL PLSAP_MM_FREE_LIST FreeList,
  79. OUT PLSAPR_TRUST_INFORMATION OutputTrustInformation,
  80. IN PLSAPR_TRUST_INFORMATION InputTrustInformation
  81. );
  82. NTSTATUS
  83. LsapRpcCopyTrustInformationEx(
  84. IN OPTIONAL PLSAP_MM_FREE_LIST FreeList,
  85. OUT PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX OutputTrustInformation,
  86. IN PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX InputTrustInformation
  87. );
  88. /////////////////////////////////////////////////////////////////////////////
  89. // //
  90. // Heap Routines //
  91. // //
  92. /////////////////////////////////////////////////////////////////////////////
  93. BOOLEAN
  94. LsapHeapInitialize(
  95. IN BOOLEAN Server
  96. );
  97. PVOID
  98. LsapAllocateLsaHeap (
  99. IN ULONG Length
  100. );
  101. VOID
  102. LsapFreeLsaHeap (
  103. IN PVOID Base
  104. );
  105. PVOID
  106. NTAPI
  107. LsapAllocatePrivateHeap (
  108. IN SIZE_T Length
  109. );
  110. PVOID
  111. NTAPI
  112. LsapAllocatePrivateHeapNoZero(
  113. IN SIZE_T cbMemory
  114. );
  115. VOID
  116. NTAPI
  117. LsapFreePrivateHeap (
  118. IN PVOID Base
  119. );
  120. #define LsapGetCurrentHeap() ((HANDLE) TlsGetValue( dwThreadHeap ))
  121. #define LsapSetCurrentHeap(x) TlsSetValue( dwThreadHeap, x )