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.

61 lines
1.7 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_OPT_H
  7. #define _MM_OPT_H
  8. typedef struct _M_OPTION {
  9. DWORD OptId;
  10. DWORD Len;
  11. ULONG UniqId;
  12. BYTE Val[0];
  13. } M_OPTION, *PM_OPTION, *LP_MOPTION;
  14. DWORD _inline
  15. MemOptInit(
  16. OUT PM_OPTION *Opt,
  17. IN DWORD OptId,
  18. IN DWORD Len,
  19. IN LPBYTE Val
  20. ) {
  21. AssertRet(Opt, ERROR_INVALID_PARAMETER);
  22. AssertRet(Len || NULL==Val, ERROR_INVALID_PARAMETER);
  23. AssertRet(0 == Len|| Val, ERROR_INVALID_PARAMETER);
  24. (*Opt) = MemAlloc(sizeof(M_OPTION)+Len);
  25. if( NULL == (*Opt) ) return ERROR_NOT_ENOUGH_MEMORY;
  26. (*Opt)->OptId = OptId;
  27. (*Opt)->Len = Len;
  28. memcpy((*Opt)->Val, Val, Len);
  29. return ERROR_SUCCESS;
  30. } // MemOptInit()
  31. DWORD _inline
  32. MemOptCleanup(
  33. IN OUT PM_OPTION Opt
  34. ) {
  35. AssertRet(Opt, ERROR_INVALID_PARAMETER);
  36. MemFree(Opt);
  37. return ERROR_SUCCESS;
  38. }
  39. LPBYTE _inline
  40. MemOptVal(
  41. IN PM_OPTION Opt
  42. ) {
  43. return Opt->Val;
  44. }
  45. #endif // _MM_OPT_H_
  46. //========================================================================
  47. // end of file
  48. //========================================================================