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.

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