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.

262 lines
10 KiB

  1. /*****************************************************************************\
  2. * *
  3. * msip.h - - Interface for internal access to Installer Service *
  4. * *
  5. * Version 2.0 *
  6. * *
  7. * NOTES: All buffers sizes are TCHAR count, null included only on input *
  8. * Return argument pointers may be null if not interested in value *
  9. * *
  10. * Copyright (c) 1996-2001, Microsoft Corp. All rights reserved. *
  11. * *
  12. \*****************************************************************************/
  13. #ifndef _MSIP_H_
  14. #define _MSIP_H_
  15. #ifndef _WIN32_MSI
  16. #if (_WIN32_WINNT >= 0x0501)
  17. #define _WIN32_MSI 200
  18. #elif (_WIN32_WINNT >= 0x0500)
  19. #define _WIN32_MSI 110
  20. #else
  21. #define _WIN32_MSI 100
  22. #endif //_WIN32_WINNT
  23. #endif // !_WIN32_MSI
  24. #if (_WIN32_MSI >= 150)
  25. #define INSTALLMODE_NODETECTION_ANY (INSTALLMODE)-4 // provide any, if available, supported internally for MsiProvideAssembly
  26. #endif
  27. #if (_WIN32_MSI >= 150)
  28. typedef enum tagMIGRATIONOPTIONS
  29. {
  30. migQuiet = 1 << 0,
  31. migMsiTrust10PackagePolicyOverride = 1 << 1,
  32. } MIGRATIONOPTIONS;
  33. #endif
  34. #define INSTALLPROPERTY_ADVTFLAGS __TEXT("AdvertiseFlags")
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38. // Return a product code for a product installed from an installer package
  39. UINT WINAPI MsiGetProductCodeFromPackageCodeA(
  40. LPCSTR szPackageCode, // package code
  41. LPSTR lpProductBuf39); // buffer for product code string GUID, 39 chars
  42. UINT WINAPI MsiGetProductCodeFromPackageCodeW(
  43. LPCWSTR szPackageCode, // package code
  44. LPWSTR lpProductBuf39); // buffer for product code string GUID, 39 chars
  45. #ifdef UNICODE
  46. #define MsiGetProductCodeFromPackageCode MsiGetProductCodeFromPackageCodeW
  47. #else
  48. #define MsiGetProductCodeFromPackageCode MsiGetProductCodeFromPackageCodeA
  49. #endif // !UNICODE
  50. // --------------------------------------------------------------------------
  51. // Functions accepting a component descriptor, consisting of
  52. // a product code concatenated with a feature ID and component ID.
  53. // For efficiency, feature and component may be omitted if unambiguous
  54. // --------------------------------------------------------------------------
  55. // Return full component path given a fully-qualified component descriptor
  56. // separates the tokens from the descriptor and calls MsiProvideComponent
  57. UINT WINAPI MsiProvideComponentFromDescriptorA(
  58. LPCSTR szDescriptor, // product,feature,component info
  59. LPSTR lpPathBuf, // returned path, NULL if not desired
  60. DWORD *pcchPathBuf, // in/out buffer character count
  61. DWORD *pcchArgsOffset); // returned offset of args in descriptor
  62. UINT WINAPI MsiProvideComponentFromDescriptorW(
  63. LPCWSTR szDescriptor, // product,feature,component info
  64. LPWSTR lpPathBuf, // returned path, NULL if not desired
  65. DWORD *pcchPathBuf, // in/out buffer character count
  66. DWORD *pcchArgsOffset); // returned offset of args in descriptor
  67. #ifdef UNICODE
  68. #define MsiProvideComponentFromDescriptor MsiProvideComponentFromDescriptorW
  69. #else
  70. #define MsiProvideComponentFromDescriptor MsiProvideComponentFromDescriptorA
  71. #endif // !UNICODE
  72. // Force the installed state for a product feature from a descriptor
  73. UINT WINAPI MsiConfigureFeatureFromDescriptorA(
  74. LPCSTR szDescriptor, // product and feature, component ignored
  75. INSTALLSTATE eInstallState); // local/source/default/absent
  76. UINT WINAPI MsiConfigureFeatureFromDescriptorW(
  77. LPCWSTR szDescriptor, // product and feature, component ignored
  78. INSTALLSTATE eInstallState); // local/source/default/absent
  79. #ifdef UNICODE
  80. #define MsiConfigureFeatureFromDescriptor MsiConfigureFeatureFromDescriptorW
  81. #else
  82. #define MsiConfigureFeatureFromDescriptor MsiConfigureFeatureFromDescriptorA
  83. #endif // !UNICODE
  84. // Reinstall product or feature using a descriptor as the specification
  85. UINT WINAPI MsiReinstallFeatureFromDescriptorA(
  86. LPCSTR szDescriptor, // product and feature, component ignored
  87. DWORD szReinstallMode); // one or more REINSTALLMODE modes
  88. UINT WINAPI MsiReinstallFeatureFromDescriptorW(
  89. LPCWSTR szDescriptor, // product and feature, component ignored
  90. DWORD szReinstallMode); // one or more REINSTALLMODE modes
  91. #ifdef UNICODE
  92. #define MsiReinstallFeatureFromDescriptor MsiReinstallFeatureFromDescriptorW
  93. #else
  94. #define MsiReinstallFeatureFromDescriptor MsiReinstallFeatureFromDescriptorA
  95. #endif // !UNICODE
  96. // Query a feature's state using a descriptor as the specification
  97. INSTALLSTATE WINAPI MsiQueryFeatureStateFromDescriptorA(
  98. LPCSTR szDescriptor); // product and feature, component ignored
  99. INSTALLSTATE WINAPI MsiQueryFeatureStateFromDescriptorW(
  100. LPCWSTR szDescriptor); // product and feature, component ignored
  101. #ifdef UNICODE
  102. #define MsiQueryFeatureStateFromDescriptor MsiQueryFeatureStateFromDescriptorW
  103. #else
  104. #define MsiQueryFeatureStateFromDescriptor MsiQueryFeatureStateFromDescriptorA
  105. #endif // !UNICODE
  106. UINT WINAPI MsiDecomposeDescriptorA(
  107. LPCSTR szDescriptor,
  108. LPSTR szProductCode,
  109. LPSTR szFeatureId,
  110. LPSTR szComponentCode,
  111. DWORD* pcchArgsOffset);
  112. UINT WINAPI MsiDecomposeDescriptorW(
  113. LPCWSTR szDescriptor,
  114. LPWSTR szProductCode,
  115. LPWSTR szFeatureId,
  116. LPWSTR szComponentCode,
  117. DWORD* pcchArgsOffset);
  118. #ifdef UNICODE
  119. #define MsiDecomposeDescriptor MsiDecomposeDescriptorW
  120. #else
  121. #define MsiDecomposeDescriptor MsiDecomposeDescriptorA
  122. #endif // !UNICODE
  123. // Load a string resource, preferring a specified language
  124. // Behaves like LoadString if 0 passed as language
  125. // Truncates string as necessary to fit into buffer (like LoadString)
  126. // Returns the codepage of the string, or 0 if string is not found
  127. UINT WINAPI MsiLoadStringA(
  128. HINSTANCE hInstance, // handle of module containing string resource
  129. UINT uID, // resource identifier
  130. LPSTR lpBuffer, // address of buffer for resource
  131. int nBufferMax, // size of buffer
  132. WORD wLanguage); // preferred resource language
  133. UINT WINAPI MsiLoadStringW(
  134. HINSTANCE hInstance, // handle of module containing string resource
  135. UINT uID, // resource identifier
  136. LPWSTR lpBuffer, // address of buffer for resource
  137. int nBufferMax, // size of buffer
  138. WORD wLanguage); // preferred resource language
  139. #ifdef UNICODE
  140. #define MsiLoadString MsiLoadStringW
  141. #else
  142. #define MsiLoadString MsiLoadStringA
  143. #endif // !UNICODE
  144. // MessageBox implementation that allows language information to be specified
  145. // MB_SYSTEMMODAL and MB_TASKMODAL are not supported, modality handled by parent hWnd
  146. // If no parent window is specified, the current context window will be used,
  147. // which is itself parented to the window set by SetInternalUI.
  148. int WINAPI MsiMessageBoxA(
  149. HWND hWnd, // parent window handle, 0 to use that of current context
  150. LPCSTR lpText, // message text
  151. LPCSTR lpCaption, // caption, must be neutral or in system codepage
  152. UINT uiType, // standard MB types, icons, and def buttons
  153. UINT uiCodepage, // codepage of message text, used to set font charset
  154. LANGID iLangId); // language to use for button text
  155. int WINAPI MsiMessageBoxW(
  156. HWND hWnd, // parent window handle, 0 to use that of current context
  157. LPCWSTR lpText, // message text
  158. LPCWSTR lpCaption, // caption, must be neutral or in system codepage
  159. UINT uiType, // standard MB types, icons, and def buttons
  160. UINT uiCodepage, // codepage of message text, used to set font charset
  161. LANGID iLangId); // language to use for button text
  162. #ifdef UNICODE
  163. #define MsiMessageBox MsiMessageBoxW
  164. #else
  165. #define MsiMessageBox MsiMessageBoxA
  166. #endif // !UNICODE
  167. #if (_WIN32_MSI >= 150)
  168. // Creates the %systemroot%\Installer directory with secure ACLs
  169. // Verifies the ownership of the %systemroot%\Installer directory if it exists
  170. // If ownership is not system or admin, the directory is deleted and recreated
  171. // dwReserved is for future use and must be 0
  172. UINT WINAPI MsiCreateAndVerifyInstallerDirectory(DWORD dwReserved);
  173. #endif //(_WIN32_MSI >= 150)
  174. #if (_WIN32_MSI >= 150)
  175. // Caller notifies us of a user who's been moved and results sid change. This
  176. // internal API is only called by LoadUserProfile.
  177. UINT WINAPI MsiNotifySidChangeA(LPCSTR pOldSid,
  178. LPCSTR pNewSid);
  179. UINT WINAPI MsiNotifySidChangeW(LPCWSTR pOldSid,
  180. LPCWSTR pNewSid);
  181. #ifdef UNICODE
  182. #define MsiNotifySidChange MsiNotifySidChangeW
  183. #else
  184. #define MsiNotifySidChange MsiNotifySidChangeA
  185. #endif // !UNICODE
  186. #endif //(_WIN32_MSI >= 150)
  187. #if (_WIN32_MSI >= 150)
  188. // Called by DeleteProfile to clean up MSI data when cleaning up a user's
  189. // profile.
  190. UINT WINAPI MsiDeleteUserDataA(LPCSTR pSid,
  191. LPCSTR pComputerName,
  192. LPVOID pReserved);
  193. UINT WINAPI MsiDeleteUserDataW(LPCWSTR pSid,
  194. LPCWSTR pComputerName,
  195. LPVOID pReserved);
  196. #ifdef UNICODE
  197. #define MsiDeleteUserData MsiDeleteUserDataW
  198. #else
  199. #define MsiDeleteUserData MsiDeleteUserDataA
  200. #endif // !UNICODE
  201. #endif //(_WIN32_MSI >= 150)
  202. #if (_WIN32_MSI >= 150)
  203. DWORD WINAPI Migrate10CachedPackagesA(
  204. LPCSTR szProductCode, // Product Code GUID to migrate
  205. LPCSTR szUser, // Domain\User to migrate packages for
  206. LPCSTR szAlternativePackage, // Package to cache if one can't be automatically found - recommended
  207. const MIGRATIONOPTIONS migOptions); // Options for re-caching.
  208. DWORD WINAPI Migrate10CachedPackagesW(
  209. LPCWSTR szProductCode, // Product Code GUID to migrate
  210. LPCWSTR szUser, // Domain\User to migrate packages for
  211. LPCWSTR szAlternativePackage, // Package to cache if one can't be automatically found - recommended
  212. const MIGRATIONOPTIONS migOptions); // Options for re-caching.
  213. #ifdef UNICODE
  214. #define Migrate10CachedPackages Migrate10CachedPackagesW
  215. #else
  216. #define Migrate10CachedPackages Migrate10CachedPackagesA
  217. #endif // !UNICODE
  218. #endif //(_WIN32_MSI >= 150)
  219. #ifdef __cplusplus
  220. }
  221. #endif
  222. #endif // _MSIP_H_