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.

151 lines
4.4 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_CLASSDEFL_H_
  7. #define _MM_CLASSDEFL_H_
  8. #include <dhcp.h>
  9. typedef struct _M_CLASSDEF {
  10. DWORD RefCount;
  11. DWORD ClassId;
  12. BOOL IsVendor;
  13. DWORD Type;
  14. LPWSTR Name;
  15. LPWSTR Comment;
  16. DWORD nBytes;
  17. LPBYTE ActualBytes;
  18. ULONG UniqId;
  19. } M_CLASSDEF, *PM_CLASSDEF, *LPM_CLASSDEF;
  20. typedef struct _M_CLASSDEFLIST {
  21. ARRAY ClassDefArray;
  22. } M_CLASSDEFLIST, *PM_CLASSDEFLIST, *LPM_CLASSDEFLIST;
  23. DWORD _inline
  24. MemClassDefListInit(
  25. IN OUT PM_CLASSDEFLIST ClassDefList
  26. ) {
  27. return MemArrayInit(&ClassDefList->ClassDefArray);
  28. }
  29. DWORD _inline
  30. MemClassDefListCleanup(
  31. IN OUT PM_CLASSDEFLIST ClassDefList
  32. ) {
  33. return MemArrayCleanup(&ClassDefList->ClassDefArray);
  34. }
  35. DWORD
  36. MemClassDefListFindClassDefInternal( // dont use this fn outside of classdefl.c
  37. IN PM_CLASSDEFLIST ClassDefList,
  38. IN DWORD ClassId,
  39. IN LPWSTR Name,
  40. IN LPBYTE ActualBytes,
  41. IN DWORD nBytes,
  42. IN LPBOOL pIsVendor,
  43. OUT PARRAY_LOCATION Location
  44. ) ;
  45. DWORD _inline
  46. MemClassDefListFindOptDef( // search either by ClassId or by Actual bytes and fill matched stuff
  47. IN PM_CLASSDEFLIST ClassDefList,
  48. IN DWORD ClassId,
  49. IN LPWSTR Name,
  50. IN LPBYTE ActualBytes,
  51. IN DWORD nBytes,
  52. OUT PM_CLASSDEF *ClassDef // NULL or valid matching class def
  53. ) {
  54. ARRAY_LOCATION Location;
  55. DWORD Error;
  56. AssertRet(ClassDef, ERROR_INVALID_PARAMETER);
  57. Error = MemClassDefListFindClassDefInternal(
  58. ClassDefList,
  59. ClassId,
  60. Name,
  61. ActualBytes,
  62. nBytes,
  63. NULL,
  64. &Location
  65. );
  66. if( ERROR_SUCCESS != Error) return Error;
  67. Error = MemArrayGetElement(
  68. &ClassDefList->ClassDefArray,
  69. &Location,
  70. (LPVOID*)ClassDef
  71. );
  72. Require(ERROR_SUCCESS == Error);
  73. return Error;
  74. }
  75. //BeginExport(function)
  76. DWORD
  77. MemClassDefListAddClassDef( // Add or replace option
  78. IN OUT PM_CLASSDEFLIST ClassDefList,
  79. IN DWORD ClassId,
  80. IN BOOL IsVendor,
  81. IN DWORD Type,
  82. IN LPWSTR Name,
  83. IN LPWSTR Comment,
  84. IN LPBYTE ActualBytes,
  85. IN DWORD nBytes,
  86. IN ULONG UniqId
  87. ) ;
  88. DWORD
  89. MemClassDefListDelClassDef(
  90. IN OUT PM_CLASSDEFLIST ClassDefList,
  91. IN DWORD ClassId,
  92. IN LPWSTR Name,
  93. IN LPBYTE ActualBytes,
  94. IN DWORD nBytes
  95. );
  96. DWORD _inline
  97. MemClassDefListGetRefCount(
  98. IN PM_CLASSDEF ThisClassDef
  99. ) {
  100. return ThisClassDef->RefCount;
  101. }
  102. DWORD _inline
  103. MemClassDefListIncRefCount( // return increased by one value
  104. IN PM_CLASSDEF ThisClassDef
  105. ) {
  106. return ++ThisClassDef->RefCount;
  107. }
  108. DWORD _inline
  109. MemClassDefListDecRefCount( // return decreased by one value
  110. IN PM_CLASSDEF ThisClassDef
  111. ) {
  112. return --ThisClassDef->RefCount;
  113. }
  114. DWORD
  115. MemNewClassId(
  116. VOID
  117. ) ;
  118. #endif // _MM_CLASSDEFL_H_
  119. //========================================================================
  120. // end of file
  121. //========================================================================