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.

136 lines
3.8 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. typedef struct _M_RESERVATION {
  7. LPVOID SubnetPtr;
  8. DWORD Address;
  9. DWORD Flags;
  10. DWORD nBytes;
  11. LPBYTE ClientUID;
  12. M_OPTCLASS Options;
  13. } M_RESERVATION , *PM_RESERVATION , *LPM_RESERVATION ;
  14. typedef ARRAY M_RESERVATIONS;
  15. typedef PARRAY PM_RESERVATIONS;
  16. typedef LPARRAY LPM_RESERVATIONS;
  17. DWORD _inline
  18. MemReserve1Init(
  19. OUT PM_RESERVATION *Reservation,
  20. IN DWORD Address,
  21. IN DWORD Flags,
  22. IN LPBYTE ClientUID,
  23. IN DWORD nBytesClientUID
  24. ) {
  25. PM_RESERVATION Res1;
  26. DWORD Size;
  27. DWORD Error;
  28. AssertRet(Reservation && ClientUID && nBytesClientUID, ERROR_INVALID_PARAMETER);
  29. Require(Address);
  30. *Reservation = NULL;
  31. Size = ROUND_UP_COUNT(sizeof(M_RESERVATION ), ALIGN_WORST);
  32. Size += nBytesClientUID;
  33. Res1 = MemAlloc(Size);
  34. if( NULL == Res1 ) return ERROR_NOT_ENOUGH_MEMORY;
  35. Res1->SubnetPtr = NULL;
  36. Res1->Address = Address;
  37. Res1->Flags = Flags;
  38. Res1->nBytes = nBytesClientUID;
  39. Res1->ClientUID = Size - nBytesClientUID + (LPBYTE)Res1;
  40. memcpy(Res1->ClientUID, ClientUID, nBytesClientUID);
  41. Error = MemOptClassInit(&(Res1->Options));
  42. Require(ERROR_SUCCESS == Error);
  43. *Reservation = Res1;
  44. return ERROR_SUCCESS;
  45. }
  46. DWORD _inline
  47. MemReserve1Cleanup(
  48. IN PM_RESERVATION Reservation
  49. ) {
  50. DWORD Error;
  51. AssertRet(Reservation, ERROR_INVALID_PARAMETER);
  52. Error = MemOptClassCleanup(&(Reservation->Options));
  53. Require(ERROR_SUCCESS == Error);
  54. MemFree(Reservation);
  55. return ERROR_SUCCESS;
  56. }
  57. DWORD _inline
  58. MemReserveInit(
  59. IN OUT PM_RESERVATIONS Reservation
  60. ) {
  61. return MemArrayInit(Reservation);
  62. }
  63. DWORD _inline
  64. MemReserveCleanup(
  65. IN PM_RESERVATIONS Reservation
  66. ) {
  67. return MemArrayCleanup(Reservation);
  68. }
  69. DWORD
  70. MemReserveAdd( // new client, should not exist before
  71. IN OUT PM_RESERVATIONS Reservation,
  72. IN DWORD Address,
  73. IN DWORD Flags,
  74. IN LPBYTE ClientUID,
  75. IN DWORD ClientUIDSize
  76. ) ;
  77. DWORD
  78. MemReserveReplace( // old client, should exist before
  79. IN OUT PM_RESERVATIONS Reservation,
  80. IN DWORD Address,
  81. IN DWORD Flags,
  82. IN LPBYTE ClientUID,
  83. IN DWORD ClientUIDSize
  84. ) ;
  85. DWORD
  86. MemReserveDel(
  87. IN OUT PM_RESERVATIONS Reservation,
  88. IN DWORD Address
  89. ) ;
  90. DWORD
  91. MemReserveFindByClientUID(
  92. IN PM_RESERVATIONS Reservation,
  93. IN LPBYTE ClientUID,
  94. IN DWORD ClientUIDSize,
  95. OUT PM_RESERVATION *Res
  96. ) ;
  97. DWORD
  98. MemReserveFindByAddress(
  99. IN PM_RESERVATIONS Reservation,
  100. IN DWORD Address,
  101. OUT PM_RESERVATION *Res
  102. ) ;
  103. //========================================================================
  104. // end of file
  105. //========================================================================