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.

166 lines
4.0 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 <map>
  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 (IN HINSTANCE hinst) throw();
  51. VOID DllProcessDetach (IN VOID) throw();
  52. VOID ServiceMain (IN DWORD argc, IN LPCWSTR argv[]) throw();
  53. DWORD DwHandler (IN DWORD dwControl,
  54. IN DWORD dwEventType,
  55. IN LPCVOID pEventData,
  56. IN LPCVOID pContext);
  57. VOID Run () throw();
  58. VOID SetServiceStatus (IN DWORD dwState) throw();
  59. VOID UpdateServiceStatus (IN BOOL fUpdateCheckpoint = TRUE) throw();
  60. DWORD DwServiceStatus () throw() { return m_status.dwCurrentState; }
  61. VOID ReferenceRasman (IN RASREFTYPE RefType) throw();
  62. private:
  63. static
  64. DWORD
  65. WINAPI TAKEOWNERSHIP
  66. _DwHandler (
  67. IN DWORD dwControl,
  68. IN DWORD dwEventType,
  69. IN WACKYAPI LPVOID pEventData,
  70. IN WACKYAPI LPVOID pContext);
  71. public:
  72. HRESULT ServiceShutdown();
  73. HRESULT ServiceStartup();
  74. DWORD m_dwThreadID;
  75. SERVICE_STATUS_HANDLE m_hStatus;
  76. SERVICE_STATUS m_status;
  77. BOOL m_fRasmanReferenced;
  78. };
  79. extern CServiceModule _Module;
  80. #include <atlcom.h>
  81. #include "ncatl.h"
  82. #include "ncstring.h"
  83. #include "nmclsid.h"
  84. typedef LPCVOID PCSID;
  85. enum CONMAN_EVENTTYPE
  86. {
  87. INVALID_TYPE = 0,
  88. CONNECTION_ADDED,
  89. CONNECTION_BANDWIDTH_CHANGE,
  90. CONNECTION_DELETED,
  91. CONNECTION_MODIFIED,
  92. CONNECTION_RENAMED,
  93. CONNECTION_STATUS_CHANGE,
  94. REFRESH_ALL,
  95. CONNECTION_ADDRESS_CHANGE,
  96. CONNECTION_BALLOON_POPUP,
  97. DISABLE_EVENTS
  98. };
  99. BOOL IsValidEventType(IN EVENT_MANAGER EventMgr, IN int EventType) throw();
  100. // This LONG is incremented every time we get a notification that
  101. // a RAS phonebook entry has been modified. It is reset to zero
  102. // when the service is started. Wrap-around does not matter. It's
  103. // purpose is to let a RAS connection object know if it's cache should
  104. // be re-populated with current information.
  105. //
  106. extern LONG g_lRasEntryModifiedVersionEra;
  107. VOID
  108. LanEventNotify (
  109. IN CONMAN_EVENTTYPE EventType,
  110. IN INetConnection* pConn,
  111. IN PCWSTR szwNewName,
  112. IN const GUID * pguidConn) throw();
  113. VOID
  114. IncomingEventNotify (
  115. IN CONMAN_EVENTTYPE EventType,
  116. IN INetConnection* pConn,
  117. IN PCWSTR szwNewName,
  118. IN const GUID * pguidConn) throw();
  119. STDAPI
  120. RegisterSvrHelper();
  121. STDAPI
  122. CreateEAPOLKeys();
  123. STDAPI
  124. SetKeySecurity(
  125. IN DWORD dwKeyIndex,
  126. IN PCSID psidUserOrGroup,
  127. IN ACCESS_MASK dwAccessMask);
  128. VOID
  129. NTAPI
  130. DispatchEvents(
  131. IN OUT LPVOID pUnused,
  132. IN BOOLEAN TimerOrWaitFired) throw();
  133. HRESULT
  134. HrEnsureEventHandlerInitialized();
  135. HRESULT
  136. UninitializeEventHandler();
  137. HRESULT
  138. WINAPI
  139. HrEnsureRegisteredWithNla();