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.

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