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.

80 lines
2.2 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_SSCOPE {
  7. DWORD SScopeId;
  8. DWORD Policy;
  9. LPWSTR Name;
  10. M_OPTCLASS Options;
  11. } M_SSCOPE, *PM_SSCOPE, *LPM_SSCOPE;
  12. extern ULONG ScopeIdCount;
  13. DWORD _inline
  14. MemSScopeInit(
  15. OUT PM_SSCOPE *SScope,
  16. IN DWORD Policy,
  17. IN LPWSTR Name
  18. ) {
  19. PM_SSCOPE RetVal;
  20. DWORD Size;
  21. DWORD Error;
  22. AssertRet(SScope, ERROR_INVALID_PARAMETER);
  23. Size = ROUND_UP_COUNT(sizeof(M_SSCOPE), ALIGN_WORST);
  24. Size += (1+wcslen(Name))*sizeof(WCHAR);
  25. RetVal = MemAlloc(Size);
  26. if( NULL == RetVal ) return ERROR_NOT_ENOUGH_MEMORY;
  27. RetVal->SScopeId = InterlockedIncrement(&ScopeIdCount);
  28. RetVal->Policy = Policy;
  29. RetVal->Name = (LPWSTR)(ROUND_UP_COUNT(sizeof(M_SSCOPE),ALIGN_WORST) + (LPBYTE)RetVal);
  30. wcscpy(RetVal->Name, Name);
  31. Error = MemOptClassInit(&RetVal->Options);
  32. if( ERROR_SUCCESS != Error ) {
  33. MemFree(RetVal);
  34. RetVal = NULL;
  35. }
  36. *SScope = RetVal;
  37. return Error;
  38. }
  39. DWORD _inline
  40. MemSScopeCleanup(
  41. IN OUT PM_SSCOPE SScope
  42. ) {
  43. DWORD Error;
  44. AssertRet(SScope, ERROR_INVALID_PARAMETER);
  45. Error = MemOptClassCleanup(&SScope->Options);
  46. MemFree(SScope);
  47. return Error;
  48. }
  49. DWORD _inline
  50. MemSubnetSetSuperScope(
  51. IN OUT PM_SUBNET Subnet,
  52. IN PM_SSCOPE SScope
  53. ) {
  54. AssertRet(Subnet && SScope, ERROR_INVALID_PARAMETER);
  55. Subnet->SuperScopeId = SScope->SScopeId;
  56. return ERROR_SUCCESS;
  57. }
  58. //========================================================================
  59. // end of file
  60. //========================================================================