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.

186 lines
3.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: N M B A S E . H
  7. //
  8. // Contents: Base include file for netman.exe. Defines globals.
  9. //
  10. // Notes:
  11. //
  12. // Author: shaunco 15 Sep 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include "netcon.h"
  17. #include "netconp.h"
  18. #include <atlbase.h>
  19. #include "ncstl.h"
  20. #include "stlmap.h"
  21. enum EVENT_MANAGER
  22. {
  23. INVALID_EVENTMGR = 0,
  24. EVENTMGR_CONMAN
  25. };
  26. #define PersistDataLead 0x14
  27. #define PersistDataTrail 0x05
  28. typedef struct tagRegEntry
  29. {
  30. LPWSTR strKeyName;
  31. LPWSTR strValueName;
  32. DWORD dwType;
  33. DWORD dwValue;
  34. LPWSTR strValue;
  35. BYTE* pbValue;
  36. DWORD dwBinLen;
  37. BOOL fMoreOnKey;
  38. } REGENTRY;
  39. typedef map<GUID, INetConnectionManager*> CLASSMANAGERMAP;
  40. bool operator < (const GUID& rguid1, const GUID& rguid2);
  41. enum RASREFTYPE
  42. {
  43. REF_INITIALIZE,
  44. REF_REFERENCE,
  45. REF_UNREFERENCE,
  46. };
  47. class CServiceModule : public CComModule
  48. {
  49. public:
  50. VOID DllProcessAttach (HINSTANCE hinst);
  51. VOID DllProcessDetach (VOID);
  52. VOID ServiceMain (DWORD argc, PWSTR argv[]);
  53. DWORD DwHandler (DWORD dwControl, DWORD dwEventType,
  54. PVOID pEventData, PVOID pContext);
  55. VOID Run ();
  56. VOID SetServiceStatus (DWORD dwState);
  57. VOID UpdateServiceStatus (BOOL fUpdateCheckpoint = TRUE);
  58. DWORD DwServiceStatus () { return m_status.dwCurrentState; }
  59. VOID ReferenceRasman (RASREFTYPE RefType);
  60. private:
  61. static
  62. DWORD
  63. WINAPI
  64. _DwHandler (
  65. DWORD dwControl,
  66. DWORD dwEventType,
  67. PVOID pEventData,
  68. PVOID pContext);
  69. public:
  70. HRESULT ServiceShutdown();
  71. HRESULT ServiceStartup();
  72. DWORD m_dwThreadID;
  73. SERVICE_STATUS_HANDLE m_hStatus;
  74. SERVICE_STATUS m_status;
  75. BOOL m_fRasmanReferenced;
  76. };
  77. extern CServiceModule _Module;
  78. #include <atlcom.h>
  79. #include "ncatl.h"
  80. #include "ncstring.h"
  81. #include "nmclsid.h"
  82. enum CONMAN_EVENTTYPE
  83. {
  84. INVALID_TYPE = 0,
  85. CONNECTION_ADDED,
  86. CONNECTION_BANDWIDTH_CHANGE,
  87. CONNECTION_DELETED,
  88. CONNECTION_MODIFIED,
  89. CONNECTION_RENAMED,
  90. CONNECTION_STATUS_CHANGE,
  91. REFRESH_ALL,
  92. CONNECTION_ADDRESS_CHANGE,
  93. CONNECTION_BALLOON_POPUP,
  94. DISABLE_EVENTS
  95. };
  96. BOOL IsValidEventType(EVENT_MANAGER EventMgr, int EventType);
  97. // This LONG is incremented every time we get a notification that
  98. // a RAS phonebook entry has been modified. It is reset to zero
  99. // when the service is started. Wrap-around does not matter. It's
  100. // purpose is to let a RAS connection object know if it's cache should
  101. // be re-populated with current information.
  102. //
  103. extern LONG g_lRasEntryModifiedVersionEra;
  104. VOID
  105. LanEventNotify (
  106. CONMAN_EVENTTYPE EventType,
  107. INetConnection* pConn,
  108. PCWSTR szwNewName,
  109. const GUID * pguidConn);
  110. VOID
  111. IncomingEventNotify (
  112. CONMAN_EVENTTYPE EventType,
  113. INetConnection* pConn,
  114. PCWSTR szwNewName,
  115. const GUID * pguidConn);
  116. STDAPI
  117. RegisterSvrHelper();
  118. STDAPI
  119. CreateEAPOLKeys();
  120. STDAPI
  121. SetKeySecurity(
  122. DWORD dwKeyIndex,
  123. PSID psidUserOrGroup,
  124. ACCESS_MASK dwAccessMask);
  125. VOID
  126. NTAPI
  127. DispatchEvents(
  128. IN LPVOID pContext,
  129. IN BOOLEAN TimerOrWaitFired);
  130. HRESULT
  131. HrEnsureEventHandlerInitialized();
  132. HRESULT
  133. UninitializeEventHandler();
  134. BOOL
  135. QueueUserWorkItemInThread(
  136. IN LPTHREAD_START_ROUTINE Function,
  137. IN PVOID Context,
  138. IN EVENT_MANAGER EventMgr);
  139. DWORD
  140. WINAPI
  141. GroupPolicyNLAEvents(
  142. IN LPVOID pContext,
  143. IN BOOLEAN TimerOrWaitFired);
  144. DWORD
  145. WINAPI
  146. ConmanEventWorkItem(PVOID);
  147. DWORD
  148. WINAPI
  149. RasEventWorkItem(PVOID);
  150. DWORD
  151. WINAPI
  152. LanEventWorkItem(PVOID);
  153. HRESULT
  154. WINAPI
  155. HrEnsureRegisteredWithNla();