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.

100 lines
3.0 KiB

  1. //========================================================================
  2. // Copyright (C) 1997 Microsoft Corporation
  3. //========================================================================
  4. #ifndef _MM_OPTDEFL_H_
  5. #define _MM_OPTDEFL_H_
  6. #include <dhcp.h>
  7. typedef struct _M_OPTDEF {
  8. DWORD OptId;
  9. DWORD Type;
  10. LPWSTR OptName;
  11. LPWSTR OptComment;
  12. LPBYTE OptVal;
  13. DWORD OptValLen;
  14. ULONG UniqId;
  15. } M_OPTDEF, *PM_OPTDEF, *LPM_OPTDEF;
  16. typedef struct _M_OPTDEFLIST {
  17. ARRAY OptDefArray;
  18. } M_OPTDEFLIST, *PM_OPTDEFLIST, *LPM_OPTDEFLIST;
  19. DWORD _inline
  20. MemOptDefListInit(
  21. IN OUT PM_OPTDEFLIST OptDefList
  22. ) {
  23. AssertRet(OptDefList, ERROR_INVALID_PARAMETER);
  24. return MemArrayInit(&OptDefList->OptDefArray);
  25. }
  26. DWORD _inline
  27. MemOptDefListCleanup(
  28. IN OUT PM_OPTDEFLIST OptDefList
  29. ) {
  30. return MemArrayCleanup(&OptDefList->OptDefArray);
  31. }
  32. DWORD
  33. MemOptDefListFindOptDefInternal( // Dont use this function out of optdefl.c
  34. IN PM_OPTDEFLIST OptDefList,
  35. IN DWORD OptId,
  36. IN LPWSTR OptName, // either OptId or OptName need only be specified..
  37. OUT PARRAY_LOCATION Location
  38. ) ;
  39. DWORD _inline
  40. MemOptDefListFindOptDef(
  41. IN PM_OPTDEFLIST OptDefList,
  42. IN DWORD OptId,
  43. IN LPWSTR OptName, // only either the name or the option id need be given..
  44. OUT PM_OPTDEF *OptDef
  45. ) {
  46. ARRAY_LOCATION Location;
  47. DWORD Error;
  48. Error = MemOptDefListFindOptDefInternal(
  49. OptDefList,
  50. OptId,
  51. OptName,
  52. &Location
  53. );
  54. if( ERROR_SUCCESS != Error ) return Error;
  55. return MemArrayGetElement(
  56. &OptDefList->OptDefArray,
  57. &Location,
  58. (LPVOID *)OptDef
  59. );
  60. }
  61. DWORD
  62. MemOptDefListAddOptDef( // Add or replace an option defintion for given Option Id
  63. IN OUT PM_OPTDEFLIST OptDefList,
  64. IN DWORD OptId,
  65. IN DWORD Type,
  66. IN LPWSTR OptName,
  67. IN LPWSTR OptComment,
  68. IN LPBYTE OptVal,
  69. IN DWORD OptValLen,
  70. IN ULONG UniqId
  71. ) ;
  72. DWORD
  73. MemOptDefListDelOptDef(
  74. IN OUT PM_OPTDEFLIST OptDefList,
  75. IN DWORD OptId
  76. );
  77. #endif // _MM_OPTDEFL_H_
  78. //========================================================================
  79. // end of file
  80. //========================================================================