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.

81 lines
3.3 KiB

  1. #ifndef FUSION_MSI_DB_H
  2. #define FUSION_MSI_DB_H
  3. #define WIN32_ASSEMBLY_MIGRATE_TABLE L"MsiAssemblyMigrate"
  4. #define USING_FILEID_IN_FILETABLE_AS_CALLBACK_FUNC_INPUT 1
  5. #define USING_FILENAME_IN_FILETABLE_AS_CALLBACK_FUNC_INPUT 2
  6. enum CA_MIGRATION_MSI_INSTALL_MODE
  7. {
  8. eInstallProduct,
  9. eRemoveProduct
  10. };
  11. typedef struct _ca_enm_assembly_callback_info
  12. {
  13. DWORD dwFlags;
  14. MSIHANDLE hInstall;
  15. MSIHANDLE hdb;
  16. PCWSTR pszComponentID;
  17. PCWSTR pszAssemblyUniqueDir;
  18. PCWSTR pszDestFolderID;
  19. PCWSTR pszManifestFileID;
  20. PCWSTR pszFileName;
  21. PCWSTR pszFileID;
  22. }CA_ENM_ASSEMBLY_CALLBACK_INFO;
  23. #define CA_ENM_ASSEMBLY_CALLBACK_INFO_FLAG_IGNORE_MIGRATE_DENY_CHECK 0x01
  24. typedef HRESULT (__stdcall * PCA_ENUM_COMPONENT_FILES_CALLBACK)(
  25. const CA_ENM_ASSEMBLY_CALLBACK_INFO * info
  26. );
  27. typedef HRESULT (__stdcall * PCA_ENUM_FUSION_WIN32_ASSEMBLY_CALLBACK)(
  28. CA_ENM_ASSEMBLY_CALLBACK_INFO * info
  29. );
  30. #define ENUM_ASSEMBLY_FLAG_CHECK_ASSEMBLY_ONLY 0x01
  31. #define ENUM_ASSEMBLY_FLAG_CHECK_POLICY_ONLY 0x02
  32. #define CA_SQL_QUERY_MSIASSEMBLYNAME 0
  33. #define CA_SQL_QUERY_MSIASSEMBLY 1
  34. #define CA_SQL_QUERY_COMPONENT 2
  35. #define CA_SQL_QUERY_FILENAME_USING_FILEID 3
  36. #define CA_SQL_QUERY_FILETABLE_USING_COMPONENTID 4
  37. #define CA_SQL_QUERY_COMPONENT_FOR_COMPONENTGUID 5
  38. #define CA_SQL_QUERY_DIRECTORY 6
  39. static PCWSTR ca_sqlQuery[]=
  40. {
  41. L"SELECT `Value` FROM `MsiAssemblyName` WHERE `Name`='type' AND `Component_`='%s'",
  42. L"SELECT `Attributes`, `File_Manifest`, `Component_` FROM `MsiAssembly` WHERE `File_Application`=''", // check whether it is a win32 assembly
  43. L"SELECT `Directory_` FROM `Component` WHERE `Component`='%s'",
  44. L"SELECT `FileName` FROM `File` WHERE `File`='%s' AND `Component_`='%s'",
  45. L"SELECT `File`, `FileName` FROM `File` WHERE `Component_`='%s'",
  46. L"SELECT `ComponentId` FROM `Component` WHERE `Component`='%s'",
  47. L"SELECT * FROM `Directory` WHERE `Directory`='%s'"
  48. };
  49. #define CA_FUSION_WIN32_POLICY_TYPE L"win32-policy"
  50. #define CA_FUSION_WIN32_ASSEMBLY_TYPE L"win32"
  51. #define MSI_FUSION_WIN32_ASSEMBLY 1
  52. #define MSI_FUSION_URT_ASSEMBLY 0
  53. #define CA_MAX_BUF 256
  54. #define CA_FILEFULLPATHNAME_FILENAME_IN_FILE_TABLE 1
  55. #define CA_FILEFULLPATHNAME_FILEID_IN_FILE_TABLE 2
  56. extern HRESULT MSI_GetSourceFileFullPathName(DWORD, const MSIHANDLE &, const MSIHANDLE &, PCWSTR, PCWSTR, CStringBuffer &, PCWSTR);
  57. extern HRESULT MSI_EnumWinFuseAssembly(DWORD, const MSIHANDLE &, PCA_ENUM_FUSION_WIN32_ASSEMBLY_CALLBACK);
  58. extern HRESULT MSI_GetInstallerState(const MSIHANDLE &, enum CA_MIGRATION_MSI_INSTALL_MODE &);
  59. extern HRESULT MSI_EnumComponentFiles(CA_ENM_ASSEMBLY_CALLBACK_INFO *, PCA_ENUM_COMPONENT_FILES_CALLBACK);
  60. extern HRESULT MSI_GetComponentSourceDirectory(const MSIHANDLE &, const MSIHANDLE &, PCWSTR, PWSTR, DWORD);
  61. extern HRESULT MSI_IsTableExist(const MSIHANDLE & hdb, PCWSTR pszTableName, BOOL & fExist);
  62. extern HRESULT Msi_CreateTableIfNotExist(const MSIHANDLE & hdb, PCWSTR pwszTableName, PCWSTR pwszTableSchema, BOOL & fExistAlready);
  63. extern BOOL IsDownlevel();
  64. #endif