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.

280 lines
8.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows NT5.0
  4. // Copyright (C) Microsoft Corporation, 1997-1999.
  5. //
  6. // File: O E M U P G E X . H
  7. //
  8. // Contents: Function prototypes needed for OEM network upgrade
  9. //
  10. // Notes:
  11. //
  12. //----------------------------------------------------------------------------
  13. #ifndef __OEMUPGEX_H__
  14. #define __OEMUPGEX_H__
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #ifndef WINNT32P_H
  22. typedef enum {
  23. UNKNOWN,
  24. NT_WORKSTATION,
  25. NT_SERVER
  26. } PRODUCTTYPE;
  27. #endif
  28. typedef struct
  29. {
  30. PRODUCTTYPE ProductType;
  31. DWORD dwBuildNumber;
  32. } ProductInfo;
  33. typedef struct
  34. {
  35. ProductInfo From;
  36. ProductInfo To;
  37. } NetUpgradeInfo;
  38. typedef struct
  39. {
  40. WCHAR szCompanyName[256];
  41. WCHAR szSupportNumber[256];
  42. WCHAR szSupportUrl[256];
  43. WCHAR szInstructionsToUser[1024];
  44. } VENDORINFO;
  45. const DWORD c_dwMaxProductIdLen = 255;
  46. const DWORD NUA_LOAD_POST_UPGRADE = 0x0001;
  47. const DWORD NUA_REQUEST_ABORT_UPGRADE = 0x0002;
  48. const DWORD NUA_ABORT_UPGRADE = 0x0004;
  49. const DWORD NUA_SKIP_INSTALL_IN_GUI_MODE = 0x80000L;
  50. typedef struct
  51. {
  52. LPTSTR mszServicesNotToBeDeleted;
  53. } NetUpgradeData;
  54. // Names of functions exported from OEM DLL
  55. //
  56. #define c_szPreUpgradeInitialize "PreUpgradeInitialize"
  57. #define c_szDoPreUpgradeProcessing "DoPreUpgradeProcessing"
  58. #define c_szPostUpgradeInitialize "PostUpgradeInitialize"
  59. #define c_szDoPostUpgradeProcessing "DoPostUpgradeProcessing"
  60. // Names of functions exported from netupgrd.dll
  61. //
  62. #define c_szNetUpgradeAddSection "NetUpgradeAddSection"
  63. #define c_szNetUpgradeAddLineToSection "NetUpgradeAddLineToSection"
  64. // Keys in OemSection
  65. //
  66. #define c_szInfToRunBeforeInstall TEXT("InfToRunBeforeInstall")
  67. #define c_szInfToRunAfterInstall TEXT("InfToRunAfterInstall")
  68. //
  69. // Prototypes for functions exported from OEM DLL
  70. //
  71. LONG __stdcall
  72. GetListOfServicesNotToBeDeleted(OUT LPTSTR* pmszServices);
  73. typedef LONG
  74. (__stdcall *GetListOfServicesNotToBeDeletedPrototype)
  75. (OUT LPTSTR* pmszServices);
  76. //+---------------------------------------------------------------------------
  77. //
  78. // Function: PreUpgradeInitialize
  79. //
  80. // Purpose: Intialize OEM DLL
  81. //
  82. // Arguments:
  83. // szWorkingDir [in] name of temporary directory to be used
  84. // pNetUpgradeInfo [in] pointer to NetUpgradeInfo structure
  85. // pviVendorInfo [out] information about OEM
  86. // pdwFlags [out] pointer to flags
  87. // pNetUpgradeData [out] pointer to NetUpgradeData structure
  88. //
  89. // Returns: ERROR_SUCCESS in case of success, win32 error otherwise
  90. //
  91. // Notes:
  92. // This function is called before any other function in this dll.
  93. // The main purpose of calling this function is to obtain
  94. // identification information and to allow the DLL to initialize
  95. // its internal data
  96. //
  97. LONG __stdcall
  98. PreUpgradeInitialize(IN LPCTSTR szWorkingDir,
  99. IN NetUpgradeInfo* pNetUpgradeInfo,
  100. OUT VENDORINFO* pviVendorInfo,
  101. OUT DWORD* pdwFlags,
  102. OUT NetUpgradeData* pNetUpgradeData);
  103. typedef LONG
  104. (__stdcall *PreUpgradeInitializePrototype)
  105. (IN LPCTSTR szWorkingDir,
  106. IN NetUpgradeInfo* pNetUpgradeInfo,
  107. OUT VENDORINFO* pviVendorInfo,
  108. OUT DWORD* pdwFlags,
  109. OUT NetUpgradeData* pNetUpgradeData);
  110. //+---------------------------------------------------------------------------
  111. //
  112. // Function: DoPreUpgradeProcessing
  113. //
  114. // Purpose: Intialize OEM DLL
  115. //
  116. // Arguments:
  117. // hParentWindow [in] window handle for showing UI
  118. // hkeyParams [in] handle to parameters key in registry
  119. // szPreNT5InfId [in] pre-NT5 InfID
  120. // szPreNT5Instance [in] pre-NT5 instance name
  121. // szNT5InfId [in] NT5 InfId
  122. // szSectionName [in] section name to be used for writing info
  123. // pviVendorInfo [out] information about OEM
  124. // pdwFlags [out] pointer to flags
  125. // pvReserved [in] reserved
  126. //
  127. // Returns: ERROR_SUCCESS in case of success, win32 error otherwise
  128. //
  129. // Notes:
  130. // This function is called once per component to be upgraded.
  131. //
  132. LONG __stdcall
  133. DoPreUpgradeProcessing(IN HWND hParentWindow,
  134. IN HKEY hkeyParams,
  135. IN LPCTSTR szPreNT5InfId,
  136. IN LPCTSTR szPreNT5Instance,
  137. IN LPCTSTR szNT5InfId,
  138. IN LPCTSTR szSectionName,
  139. OUT VENDORINFO* pviVendorInfo,
  140. OUT DWORD* pdwFlags,
  141. IN LPVOID pvReserved);
  142. typedef LONG
  143. (__stdcall *DoPreUpgradeProcessingPrototype)
  144. (IN HWND hParentWindow,
  145. IN HKEY hkeyParams,
  146. IN LPCTSTR szPreNT5InfId,
  147. IN LPCTSTR szPreNT5Instance,
  148. IN LPCTSTR szNT5InfId,
  149. IN LPCTSTR szSectionName,
  150. OUT VENDORINFO* pviVendorInfo,
  151. OUT DWORD* pdwFlags,
  152. IN LPVOID pvReserved);
  153. //+---------------------------------------------------------------------------
  154. //
  155. // Function: PostUpgradeInitialize
  156. //
  157. // Purpose: Intialize OEM DLL during GUI mode setup
  158. //
  159. // Arguments:
  160. // szWorkingDir [in] name of temporary directory to be used
  161. // pNetUpgradeInfo [in] pointer to NetUpgradeInfo structure
  162. // pviVendorInfo [out] information about OEM
  163. // pvReserved [out] reserved
  164. //
  165. // Returns: ERROR_SUCCESS in case of success, win32 error otherwise
  166. //
  167. // Notes:
  168. // This function is called in GUI mode setup before
  169. // any other function in this dll .
  170. // The main purpose of calling this function is to obtain
  171. // identification information and to allow the DLL to initialize
  172. // its internal data
  173. //
  174. LONG __stdcall
  175. PostUpgradeInitialize(IN LPCTSTR szWorkingDir,
  176. IN NetUpgradeInfo* pNetUpgradeInfo,
  177. OUT VENDORINFO* pviVendorInfo,
  178. OUT LPVOID pvReserved);
  179. typedef LONG
  180. (__stdcall *PostUpgradeInitializePrototype)
  181. (IN LPCTSTR szWorkingDir,
  182. IN NetUpgradeInfo* pNetUpgradeInfo,
  183. OUT VENDORINFO* pviVendorInfo,
  184. OUT LPVOID pvReserved);
  185. //+---------------------------------------------------------------------------
  186. //
  187. // Function: DoPostUpgradeProcessing
  188. //
  189. // Purpose: Intialize OEM DLL
  190. //
  191. // Arguments:
  192. // hParentWindow [in] window handle for showing UI
  193. // hkeyParams [in] handle to parameters key in registry
  194. // szPreNT5Instance [in] pre-NT5 instance name
  195. // szNT5InfId [in] NT5 InfId
  196. // hinfAnswerFile [in] handle to answer-file
  197. // szSectionName [in] name of section having component parameters
  198. // pviVendorInfo [out] information about OEM
  199. // pvReserved [in] reserved
  200. //
  201. // Returns: ERROR_SUCCESS in case of success, win32 error otherwise
  202. //
  203. // Notes:
  204. // This function is called once per component upgraded.
  205. //
  206. LONG __stdcall
  207. DoPostUpgradeProcessing(IN HWND hParentWindow,
  208. IN HKEY hkeyParams,
  209. IN LPCTSTR szPreNT5Instance,
  210. IN LPCTSTR szNT5InfId,
  211. IN HINF hinfAnswerFile,
  212. IN LPCTSTR szSectionName,
  213. OUT VENDORINFO* pviVendorInfo,
  214. IN LPVOID pvReserved);
  215. typedef LONG
  216. (__stdcall *DoPostUpgradeProcessingPrototype)
  217. (IN HWND hParentWindow,
  218. IN HKEY hkeyParams,
  219. IN LPCTSTR szPreNT5Instance,
  220. IN LPCTSTR szNT5InfId,
  221. IN HINF hinfAnswerFile,
  222. IN LPCTSTR szSectionName,
  223. OUT VENDORINFO* pviVendorInfo,
  224. IN LPVOID pvReserved);
  225. //
  226. // Prototypes for functions exported by netupgrd.dll
  227. //
  228. LONG __stdcall
  229. NetUpgradeAddSection(IN LPCTSTR szSectionName);
  230. typedef LONG
  231. (__stdcall *NetUpgradeAddSectionPrototype) (IN LPCTSTR szSectionName);
  232. LONG __stdcall
  233. NetUpgradeAddLineToSection(IN LPCTSTR szSectionName,
  234. IN LPCTSTR szLine);
  235. typedef LONG
  236. (__stdcall *NetUpgradeAddLineToSectionPrototype) (IN LPCTSTR szSectionName,
  237. IN LPCTSTR szLine);
  238. #ifdef __cplusplus
  239. }
  240. #endif
  241. #endif // __OEMUPGEX_H__