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.

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