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.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: G P N L A . H
  7. //
  8. // Contents: Class for Handling NLA Changes that affect Group Policies
  9. //
  10. // Notes:
  11. //
  12. // Author: sjkhan 20 Feb 2001
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include "nmbase.h"
  17. #include <winsock2.h>
  18. #include "ncstl.h"
  19. #include "netcon.h"
  20. #include "gpbase.h"
  21. #include "cmevent.h"
  22. typedef struct tagGPNLAINFORMATION
  23. {
  24. tstring strNetworkName;
  25. NETCON_STATUS ncsStatus;
  26. } GPNLAINFORMATION;
  27. typedef pair<GUID, GPNLAINFORMATION> GPNLAPAIR;
  28. typedef list<GPNLAPAIR> GPNLALIST;
  29. typedef GPNLALIST::iterator GPNLAITER;
  30. class CGroupPolicyNetworkLocationAwareness : public CGroupPolicyBase
  31. {
  32. public:
  33. CGroupPolicyNetworkLocationAwareness() throw();
  34. ~CGroupPolicyNetworkLocationAwareness() throw();
  35. HRESULT Initialize();
  36. HRESULT Uninitialize();
  37. virtual BOOL IsSameNetworkAsGroupPolicies() throw();
  38. static VOID NTAPI EventHandler(IN LPVOID pContext, IN BOOLEAN TimerOrWaitFired) throw();
  39. static VOID NTAPI GroupPolicyChange(IN LPVOID pContext, IN BOOLEAN TimerOrWaitFired);
  40. static DWORD WINAPI ShutdownNlaHandler(IN PVOID pThis);
  41. protected:
  42. HRESULT LookupServiceBegin(IN DWORD dwControlFlags);
  43. HRESULT LookupServiceNext(IN DWORD dwControlFlags,
  44. IN OUT LPDWORD lpdwBufferLength,
  45. OUT LPWSAQUERYSET lpqsResults);
  46. HRESULT LookupServiceEnd();
  47. HRESULT QueueEvent(IN CONMAN_EVENTTYPE cmEventType,
  48. IN LPCGUID pguidAdapter,
  49. IN NETCON_STATUS ncsStatus);
  50. HRESULT RegisterWait();
  51. HRESULT DeregisterWait();
  52. HRESULT EnumChanges();
  53. LONG Reference() throw();
  54. LONG Unreference() throw();
  55. BOOL IsJoinedToDomain();
  56. static HRESULT ReconfigureHomeNet(IN BOOL fWaitUntilRunningOrStopped = FALSE);
  57. protected:
  58. WSADATA m_wsaData;
  59. WSACOMPLETION m_wsaCompletion;
  60. WSAOVERLAPPED m_wsaOverlapped;
  61. HANDLE m_hQuery;
  62. WSAQUERYSET m_wqsRestrictions;
  63. BOOL m_fSameNetwork;
  64. HANDLE m_hEventNLA;
  65. HANDLE m_hNLAWait;
  66. HANDLE m_hEventGP;
  67. HANDLE m_hGPWait;
  68. GPNLALIST m_listAdapters;
  69. CRITICAL_SECTION m_csList;
  70. LONG m_lRefCount;
  71. HANDLE m_hEventExit;
  72. BOOL m_fShutdown;
  73. BOOL m_fErrorShutdown;
  74. static LONG m_lBusyWithReconfigure;
  75. };