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.

147 lines
4.2 KiB

  1. //========================================================================
  2. // Copyright (C) 1997 Microsoft Corporation
  3. // Author: RameshV
  4. // Description: This file has been generated. Pl look at the .c file
  5. //========================================================================
  6. #ifndef _MM_RESERVE_H_
  7. #define _MM_RESERVE_H_
  8. #include "server\uniqid.h"
  9. typedef struct _M_RESERVATION {
  10. LPVOID SubnetPtr;
  11. DWORD Address;
  12. DWORD Flags;
  13. DWORD nBytes;
  14. LPBYTE ClientUID;
  15. M_OPTCLASS Options;
  16. ULONG UniqId;
  17. } M_RESERVATION , *PM_RESERVATION , *LPM_RESERVATION ;
  18. typedef ARRAY M_RESERVATIONS;
  19. typedef PARRAY PM_RESERVATIONS;
  20. typedef LPARRAY LPM_RESERVATIONS;
  21. DWORD _inline
  22. MemReserve1Init(
  23. OUT PM_RESERVATION *Reservation,
  24. IN DWORD Address,
  25. IN DWORD Flags,
  26. IN LPBYTE ClientUID,
  27. IN DWORD nBytesClientUID
  28. ) {
  29. PM_RESERVATION Res1;
  30. DWORD Size;
  31. DWORD Error;
  32. AssertRet(Reservation && ClientUID && nBytesClientUID, ERROR_INVALID_PARAMETER);
  33. Require(Address);
  34. *Reservation = NULL;
  35. Size = ROUND_UP_COUNT(sizeof(M_RESERVATION ), ALIGN_WORST);
  36. Size += nBytesClientUID;
  37. Res1 = MemAlloc(Size);
  38. if( NULL == Res1 ) return ERROR_NOT_ENOUGH_MEMORY;
  39. Res1->SubnetPtr = NULL;
  40. Res1->Address = Address;
  41. Res1->Flags = Flags;
  42. Res1->nBytes = nBytesClientUID;
  43. Res1->ClientUID = Size - nBytesClientUID + (LPBYTE)Res1;
  44. memcpy(Res1->ClientUID, ClientUID, nBytesClientUID);
  45. Error = MemOptClassInit(&(Res1->Options));
  46. Require(ERROR_SUCCESS == Error);
  47. Res1->UniqId = INVALID_UNIQ_ID;
  48. *Reservation = Res1;
  49. return ERROR_SUCCESS;
  50. }
  51. DWORD _inline
  52. MemReserve1Cleanup(
  53. IN PM_RESERVATION Reservation
  54. ) {
  55. DWORD Error;
  56. AssertRet(Reservation, ERROR_INVALID_PARAMETER);
  57. Error = MemOptClassCleanup(&(Reservation->Options));
  58. Require(ERROR_SUCCESS == Error);
  59. MemFree(Reservation);
  60. return ERROR_SUCCESS;
  61. }
  62. DWORD _inline
  63. MemReserveInit(
  64. IN OUT PM_RESERVATIONS Reservation
  65. ) {
  66. return MemArrayInit(Reservation);
  67. }
  68. DWORD _inline
  69. MemReserveCleanup(
  70. IN PM_RESERVATIONS Reservation
  71. ) {
  72. return MemArrayCleanup(Reservation);
  73. }
  74. DWORD
  75. MemReserveAdd( // new client, should not exist before
  76. IN OUT PM_RESERVATIONS Reservation,
  77. IN DWORD Address,
  78. IN DWORD Flags,
  79. IN LPBYTE ClientUID,
  80. IN DWORD ClientUIDSize,
  81. IN ULONG UniqId
  82. ) ;
  83. DWORD
  84. MemReserveReplace( // old client, should exist before
  85. IN OUT PM_RESERVATIONS Reservation,
  86. IN DWORD Address,
  87. IN DWORD Flags,
  88. IN LPBYTE ClientUID,
  89. IN DWORD ClientUIDSize
  90. ) ;
  91. DWORD
  92. MemReserveDel(
  93. IN OUT PM_RESERVATIONS Reservation,
  94. IN DWORD Address
  95. ) ;
  96. DWORD
  97. MemReserveFindByClientUID(
  98. IN PM_RESERVATIONS Reservation,
  99. IN LPBYTE ClientUID,
  100. IN DWORD ClientUIDSize,
  101. OUT PM_RESERVATION *Res
  102. ) ;
  103. DWORD
  104. MemReserveFindByAddress(
  105. IN PM_RESERVATIONS Reservation,
  106. IN DWORD Address,
  107. OUT PM_RESERVATION *Res
  108. ) ;
  109. #endif // _MM_RESERVE_H_
  110. //========================================================================
  111. // end of file
  112. //========================================================================