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.

136 lines
5.1 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1997 **/
  4. /**********************************************************************/
  5. /*
  6. reg.h
  7. FILE HISTORY:
  8. */
  9. #ifndef _REG_H
  10. #define _REG_H
  11. //----------------------------------------------------------------------------
  12. // Function: ConnectRegistry
  13. //
  14. // Connects to HKEY_LOCAL_MACHINE on machine 'pszMachine', which is expected
  15. // to be of the form "\\MACHINE", and saves the key in 'phkeyMachine'.
  16. // If 'pszMachine' is NULL or empty, saves HKEY_LOCAL_MACHINE in 'phkeyMachine'
  17. //
  18. // If you are connecting to the server for the very FIRST time, use the
  19. // InitiateServerConnection() call instead. This does the exact same
  20. // thing as this call (except that it brings up UI and prompts for
  21. // username/password if needed).
  22. //
  23. //----------------------------------------------------------------------------
  24. TFSCORE_API(DWORD) ConnectRegistry(LPCTSTR pszMachine, HKEY *phkeyMachine);
  25. //----------------------------------------------------------------------------
  26. // Function: DisconnectRegistry
  27. //
  28. // Disconnects from the registry connected to be 'ConnectRegistry'.
  29. //----------------------------------------------------------------------------
  30. TFSCORE_API(VOID) DisconnectRegistry(HKEY hkeyMachine);
  31. //----------------------------------------------------------------------------
  32. // Function: QueryRouterType
  33. //
  34. // Retrieves the value of HKLM\Software\Microsoft\RAS\Protocols\RouterType
  35. // This is used by the individual UIConfigDlls to determine if they should
  36. // load or not.
  37. //
  38. // If the pVerInfo parameter is NULL, then the QueryRouterType() function
  39. // wil gather that information itself.
  40. //----------------------------------------------------------------------------
  41. enum {
  42. ROUTER_TYPE_RAS = 1,
  43. ROUTER_TYPE_LAN = 2,
  44. ROUTER_TYPE_WAN = 4
  45. };
  46. TFSCORE_API(HRESULT) QueryRouterType(HKEY hkMachine, DWORD *pdwRouterType,
  47. RouterVersionInfo *pVerInfo);
  48. TFSCORE_API(HRESULT) QueryRouterVersionInfo(HKEY hkeyMachine,
  49. RouterVersionInfo *pVerInfo);
  50. //----------------------------------------------------------------------------
  51. // Function: QueryLinkageList
  52. //
  53. // Loads a list of strings with the adapters to which 'pszService' is bound;
  54. // the list is built by examining the 'Linkage' and 'Disabled' subkeys
  55. // of the service under HKLM\System\CurrentControlSet\Services.
  56. //----------------------------------------------------------------------------
  57. HRESULT LoadLinkageList(LPCTSTR pszMachine,
  58. HKEY hkeyMachine,
  59. LPCTSTR pszService,
  60. CStringList* pLinkageList);
  61. TFSCORE_API(DWORD) GetNTVersion(HKEY hkeyMachine, DWORD *pdwMajor, DWORD *pdwMinor, DWORD* pdwCurrentBuildNumber);
  62. TFSCORE_API(DWORD) IsNT4Machine(HKEY hkeyMachine, BOOL *pfNt4);
  63. //----------------------------------------------------------------------------
  64. // Function: FindRmSoftwareKey
  65. //
  66. // Finds the key for a router-manager in the Software section of the registry.
  67. //----------------------------------------------------------------------------
  68. HRESULT FindRmSoftwareKey(
  69. HKEY hkeyMachine,
  70. DWORD dwTransportId,
  71. HKEY* phkrm,
  72. LPTSTR* lplpszRm
  73. );
  74. //----------------------------------------------------------------------------
  75. // Function: RegFindInterfaceTitle
  76. // RegFindRtrMgrTitle
  77. // RegFindRtrMgrProtocolTitle
  78. //
  79. // These functions read the key HKLM\Software\Router to load the title of
  80. // a given interface, RtrMgr, and RtrMgrProtocol respectively. The string
  81. // will be allocated using 'new' and returned as an out parameter. Free
  82. // up the memory using 'delete'.
  83. //
  84. // Function: SetupFindInterfaceTitle
  85. // This is similar to the RegFindInterfaceTitle, however this uses
  86. // the setup APIs.
  87. //----------------------------------------------------------------------------
  88. HRESULT RegFindInterfaceTitle(LPCTSTR pszMachine, LPCTSTR pszInterface,
  89. LPTSTR *ppszTitle);
  90. HRESULT SetupFindInterfaceTitle(LPCTSTR pszMachine, LPCTSTR pszInterface,
  91. LPTSTR *ppszTitle);
  92. HRESULT RegFindRtrMgrTitle(LPCTSTR pszMachine, DWORD dwProtocolId,
  93. LPTSTR *ppszTitle);
  94. HRESULT RegFindRtrMgrProtocolTitle(LPCTSTR pszMachine, DWORD dwTransportId,
  95. DWORD dwProtocolId, LPTSTR *ppszTitle);
  96. #ifdef _DEBUG
  97. #define CheckRegOpenError(d,p1,p2) CheckRegOpenErrorEx(d,p1,p2,_T(__FILE__), __LINE__)
  98. #define CheckRegQueryValueError(d,p1,p2,p3) CheckRegQueryValueErrorEx(d,p1,p2,p3,_T(__FILE__), __LINE__)
  99. void CheckRegOpenErrorEx(DWORD dwError, LPCTSTR pszSubKey,
  100. LPCTSTR pszDesc, LPCTSTR szFile, int iLineNo);
  101. void CheckRegQueryValueErrorEx(DWORD dwError, LPCTSTR pszSubKey,
  102. LPCTSTR pszValue, LPCTSTR pszDesc,
  103. LPCTSTR szFile, int iLineNo);
  104. #else
  105. #define CheckRegOpenError(d,p1,p2)
  106. #define CheckRegQueryValueError(d,p1,p2,p3)
  107. #endif
  108. #endif _REG_H