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.

115 lines
3.3 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_OPTDEF {
  7. DWORD OptId;
  8. DWORD Type;
  9. LPWSTR OptName;
  10. LPWSTR OptComment;
  11. LPBYTE OptVal;
  12. DWORD OptValLen;
  13. } M_OPTDEF, *PM_OPTDEF, *LPM_OPTDEF;
  14. typedef struct _M_OPTDEFLIST {
  15. ARRAY OptDefArray;
  16. } M_OPTDEFLIST, *PM_OPTDEFLIST, *LPM_OPTDEFLIST;
  17. DWORD _inline
  18. MemOptDefListInit(
  19. IN OUT PM_OPTDEFLIST OptDefList
  20. ) {
  21. AssertRet(OptDefList, ERROR_INVALID_PARAMETER);
  22. return MemArrayInit(&OptDefList->OptDefArray);
  23. }
  24. DWORD _inline
  25. MemOptDefListCleanup(
  26. IN OUT PM_OPTDEFLIST OptDefList
  27. ) {
  28. return MemArrayCleanup(&OptDefList->OptDefArray);
  29. }
  30. DWORD
  31. MemOptDefListFindOptDefInternal( // Dont use this function out of optdefl.c
  32. IN PM_OPTDEFLIST OptDefList,
  33. IN DWORD OptId,
  34. IN LPWSTR OptName, // either OptId or OptName need only be specified..
  35. OUT PARRAY_LOCATION Location
  36. ) ;
  37. DWORD _inline
  38. MemOptDefListFindOptDef(
  39. IN PM_OPTDEFLIST OptDefList,
  40. IN DWORD OptId,
  41. IN LPWSTR OptName, // only either the name or the option id need be given..
  42. OUT PM_OPTDEF *OptDef
  43. ) {
  44. ARRAY_LOCATION Location;
  45. DWORD Error;
  46. Error = MemOptDefListFindOptDefInternal(
  47. OptDefList,
  48. OptId,
  49. OptName,
  50. &Location
  51. );
  52. if( ERROR_SUCCESS != Error ) return Error;
  53. return MemArrayGetElement(
  54. &OptDefList->OptDefArray,
  55. &Location,
  56. (LPVOID *)OptDef
  57. );
  58. }
  59. DWORD
  60. MemOptDefListAddOptDef( // Add or replace an option defintion for given Option Id
  61. IN OUT PM_OPTDEFLIST OptDefList,
  62. IN DWORD OptId,
  63. IN DWORD Type,
  64. IN LPWSTR OptName,
  65. IN LPWSTR OptComment,
  66. IN LPBYTE OptVal,
  67. IN DWORD OptValLen
  68. ) ;
  69. DWORD _inline
  70. MemOptDefListDelOptDef(
  71. IN OUT PM_OPTDEFLIST OptDefList,
  72. IN DWORD OptId
  73. ) {
  74. ARRAY_LOCATION Location;
  75. DWORD Error;
  76. PM_OPTDEF OptDef;
  77. Error = MemOptDefListFindOptDefInternal(
  78. OptDefList,
  79. OptId,
  80. NULL,
  81. &Location
  82. );
  83. if( ERROR_SUCCESS != Error ) return Error;
  84. Error = MemArrayDelElement(
  85. &OptDefList->OptDefArray,
  86. &Location,
  87. &OptDef
  88. );
  89. Require(ERROR_SUCCESS == Error && OptDef);
  90. MemFree(OptDef);
  91. return ERROR_SUCCESS;
  92. }
  93. //========================================================================
  94. // end of file
  95. //========================================================================