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.

170 lines
6.7 KiB

  1. #pragma once
  2. //-----------------------------------------------------------
  3. // registry related defines
  4. #define REG_LAYOUT_VERSION 0x00000004
  5. #define REG_LAYOUT_LEGACY_3 0x00000003
  6. #define REG_LAYOUT_LEGACY_2 0x00000002
  7. #define REG_LAYOUT_LEGACY_1 0x00000001
  8. #define REG_STSET_MAX 0xffff // sets a limit to a maximum of 0xffff static configurations
  9. // (should be more than reasonable)
  10. #define REG_STSET_DELIM L'-' // this is where the number of the static config is coded in the
  11. // registry value's name
  12. //-----------------------------------------------------------
  13. // Registry key names.
  14. // Naming: WZCREGK_* denotes a registry key name
  15. // WZCREGV_* denotes a registry value name
  16. // WZCREGK_ABS_* denotes an absolute registry path
  17. // WZCREGK_REL_* denotes a relative registry path
  18. #define WZCREGK_ABS_PARAMS L"Software\\Microsoft\\WZCSVC\\Parameters"
  19. #define WZCREGK_REL_INTF L"Interfaces" // relative to WZCREG_ABS_ROOT
  20. #define WZCREGV_VERSION L"LayoutVersion" // in [WZCREGK_REL_INTF] (REG_DWORD) registry layout version
  21. #define WZCREGV_CTLFLAGS L"ControlFlags" // in [WZCREGK_REL_INTF] (REG_DWORD) interface's control flags
  22. #define WZCREGV_INTFSETTINGS L"ActiveSettings" // in [WZCREGK_REL_INTF] (REG_BINARY=WZC_WLAN_CONFIG) last active settings
  23. #define WZCREGV_STSETTINGS L"Static#----" // in [WZCREGK_REL_INTF] (REG_BINARY=WZC_WLAN_CONFIG) static configuration#
  24. // (NOTE: the number of '-' in the string should at least match the number
  25. // of digits in the REG_MAX_STSETTINGS constant!!)
  26. #define WZCREGV_CONTEXT L"ContextSettings"// registry name for all service specific parameters (service's context)
  27. //-----------------------------------------------------------
  28. // Loads per interface configuration parameters to the persistent
  29. // storage.
  30. // Parameters:
  31. // hkRoot
  32. // [in] Opened registry key to the "...WZCSVC\Parameters" location
  33. // pIntf
  34. // [in] Interface context to load from the registry
  35. // Returned value:
  36. // Win32 error code
  37. DWORD
  38. StoLoadIntfConfig(
  39. HKEY hkRoot,
  40. PINTF_CONTEXT pIntfContext);
  41. //-----------------------------------------------------------
  42. // Loads the list of the static configurations from the registry
  43. // Parameters:
  44. // hkRoot
  45. // [in] Opened registry key to the "...WZCSVC\Parameters\Interfaces\{guid}" location
  46. // nEntries
  47. // [in] Number of registry entries in the above reg key
  48. // pIntf
  49. // [in] Interface context to load the static list into
  50. // dwRegLayoutVer
  51. // [in] the version of the registry layout
  52. // prdBuffer
  53. // [in] assumed large enough for getting any static config
  54. // Returned value:
  55. // Win32 error code
  56. DWORD
  57. StoLoadStaticConfigs(
  58. HKEY hkIntf,
  59. UINT nEntries,
  60. PINTF_CONTEXT pIntfContext,
  61. DWORD dwRegLayoutVer,
  62. PRAW_DATA prdBuffer);
  63. //-----------------------------------------------------------
  64. // Saves all the configuration parameters to the persistent
  65. // storage (registry in our case).
  66. // Uses the global external g_lstIntfHashes.
  67. // Returned value:
  68. // Win32 error code
  69. DWORD
  70. StoSaveConfig();
  71. //-----------------------------------------------------------
  72. // Saves the current configuration of the interface to the persistent
  73. // storage.
  74. // Parameters:
  75. // hkRoot
  76. // [in] Opened registry key to the "...WZCSVC\Parameters\Interfaces\{guid}" location
  77. // pIntf
  78. // [in] Interface context to save to the registry
  79. // Returned value:
  80. // Win32 error code
  81. DWORD
  82. StoSaveIntfConfig(
  83. HKEY hkIntf,
  84. PINTF_CONTEXT pIntfContext);
  85. //-----------------------------------------------------------
  86. // Updates the list of static configurations for the given interface in the
  87. // persistant storage. The new list is saved, whatever configuration was removed
  88. // is taken out of the persistant storage.
  89. // Parameters:
  90. // hkRoot
  91. // [in] Opened registry key to the "...WZCSVC\Parameters\Interfaces\{guid}" location
  92. // pIntf
  93. // [in] Interface context to take the static list from
  94. // prdBuffer
  95. // [in/out] buffer to be used for preparing the registry blobs
  96. // Returned value:
  97. // Win32 error code
  98. DWORD
  99. StoUpdateStaticConfigs(
  100. HKEY hkIntf,
  101. PINTF_CONTEXT pIntfContext,
  102. PRAW_DATA prdBuffer);
  103. //-----------------------------------------------------------
  104. // Loads from the registry a WZC Configuration, un-protects the WEP key field
  105. // and stores the result in the output param pWzcCfg.
  106. // Parameters:
  107. // hkCfg
  108. // [in] Opened registry key to load the WZC configuration from
  109. // dwRegLayoutVer,
  110. // [in] registry layout version
  111. // wszCfgName
  112. // [in] registry entry name for the WZC configuration
  113. // pWzcCfg
  114. // [out] pointer to a WZC_WLAN_CONFIG object that receives the registry data
  115. // prdBuffer
  116. // [in] allocated buffer, assumed large enough for getting the registry data!
  117. DWORD
  118. StoLoadWZCConfig(
  119. HKEY hkCfg,
  120. LPWSTR wszGuid,
  121. DWORD dwRegLayoutVer,
  122. LPWSTR wszCfgName,
  123. PWZC_WLAN_CONFIG pWzcCfg,
  124. PRAW_DATA prdBuffer);
  125. //-----------------------------------------------------------
  126. // Takes the input param pWzcCfg, protects the WEP key field and stores the
  127. // resulting BLOB into the registry.
  128. // Parameters:
  129. // hkCfg
  130. // [in] Opened registry key to load the WZC configuration from
  131. // wszCfgName
  132. // [in] registry entry name for the WZC configuration
  133. // pWzcCfg
  134. // [in] WZC_WLAN_CONFIG object that is written to the registry
  135. // prdBuffer
  136. // [in/out] allocated buffer, assumed large enough for getting the registry data!
  137. DWORD
  138. StoSaveWZCConfig(
  139. HKEY hkCfg,
  140. LPWSTR wszCfgName,
  141. PWZC_WLAN_CONFIG pWzcCfg,
  142. PRAW_DATA prdBuffer);
  143. // StoLoadWZCContext:
  144. // Description: Loads a context from the registry
  145. // Parameters:
  146. // [out] pwzvCtxt: pointer to a WZC_CONTEXT allocated by user, initialised
  147. // with WZCContextInit. On success, contains values from registry.
  148. // [in] hkRoot, a handle to "...WZCSVC\Parameters"
  149. // Returns: win32 error
  150. DWORD StoLoadWZCContext(HKEY hkRoot, PWZC_CONTEXT pwzcCtxt);
  151. // StoSaveWZCContext:
  152. // Description: Saves a context to the registry. Does not check values. If
  153. // the registry key dosent exist, it is created.
  154. // Parameters: [in] pwzcCtxt, pointer to a valid WZC_CONTEXT
  155. // [in] hkRoot,a handle to "...WZCSVC\Parameters"
  156. // Returns: win32 error
  157. DWORD StoSaveWZCContext(HKEY hkRoot, PWZC_CONTEXT pwzcCtxt);