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.

221 lines
5.6 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. iml.h
  5. Abstract:
  6. Header for for creating, accessing and manipulating Installation Modification
  7. Log files (.IML extension) created by INSTALER.EXE
  8. Author:
  9. Steve Wood (stevewo) 23-Jan-1996
  10. --*/
  11. typedef ULONG POFFSET;
  12. #define MP(t,b,o) ((t)((o) ? (PVOID)((ULONG)(b) + (o)) : NULL))
  13. typedef struct _INSTALLATION_MODIFICATION_LOGFILE {
  14. ULONG Signature;
  15. USHORT HeaderSize;
  16. USHORT Flags;
  17. HANDLE FileHandle;
  18. ULONG FileOffset;
  19. ULONG NumberOfFileRecords;
  20. POFFSET FileRecords; // IML_FILE_RECORD
  21. ULONG NumberOfKeyRecords;
  22. POFFSET KeyRecords; // IML_KEY_RECORD
  23. ULONG NumberOfIniRecords;
  24. POFFSET IniRecords; // IML_INI_RECORD
  25. } INSTALLATION_MODIFICATION_LOGFILE, *PINSTALLATION_MODIFICATION_LOGFILE;
  26. #define IML_SIGNATURE 0xFF0AA0FF
  27. #define IML_FLAG_CONTAINS_NEWFILECONTENTS 0x0001
  28. #define IML_FLAG_ACTIONS_UNDONE 0x0002
  29. PWSTR
  30. FormatImlPath(
  31. PWSTR DirectoryPath,
  32. PWSTR InstallationName
  33. );
  34. PINSTALLATION_MODIFICATION_LOGFILE
  35. CreateIml(
  36. PWSTR ImlPath,
  37. BOOLEAN IncludeCreateFileContents
  38. );
  39. PINSTALLATION_MODIFICATION_LOGFILE
  40. LoadIml(
  41. PWSTR ImlPath
  42. );
  43. BOOLEAN
  44. CloseIml(
  45. PINSTALLATION_MODIFICATION_LOGFILE pIml
  46. );
  47. typedef enum _IML_FILE_ACTION {
  48. CreateNewFile,
  49. ModifyOldFile,
  50. DeleteOldFile,
  51. ModifyFileDateTime,
  52. ModifyFileAttributes
  53. } IML_FILE_ACTION;
  54. typedef struct _IML_FILE_RECORD_CONTENTS {
  55. FILETIME LastWriteTime;
  56. DWORD FileAttributes;
  57. DWORD FileSize;
  58. POFFSET Contents; // VOID
  59. } IML_FILE_RECORD_CONTENTS, *PIML_FILE_RECORD_CONTENTS;
  60. typedef struct _IML_FILE_RECORD {
  61. POFFSET Next; // IML_FILE_RECORD
  62. IML_FILE_ACTION Action;
  63. POFFSET Name; // WCHAR
  64. POFFSET OldFile; // IML_FILE_RECORD_CONTENTS
  65. POFFSET NewFile; // IML_FILE_RECORD_CONTENTS
  66. } IML_FILE_RECORD, *PIML_FILE_RECORD;
  67. BOOLEAN
  68. ImlAddFileRecord(
  69. PINSTALLATION_MODIFICATION_LOGFILE pIml,
  70. IML_FILE_ACTION Action,
  71. PWSTR Name,
  72. PWSTR BackupFileName,
  73. PFILETIME BackupLastWriteTime,
  74. DWORD BackupFileAttributes
  75. );
  76. typedef enum _IML_VALUE_ACTION {
  77. CreateNewValue,
  78. DeleteOldValue,
  79. ModifyOldValue
  80. } IML_VALUE_ACTION;
  81. typedef struct _IML_VALUE_RECORD_CONTENTS {
  82. DWORD Type;
  83. DWORD Length;
  84. POFFSET Data; // VOID
  85. } IML_VALUE_RECORD_CONTENTS, *PIML_VALUE_RECORD_CONTENTS;
  86. typedef struct _IML_VALUE_RECORD {
  87. POFFSET Next; // IML_VALUE_RECORD
  88. IML_VALUE_ACTION Action;
  89. POFFSET Name; // WCHAR
  90. POFFSET OldValue; // IML_VALUE_RECORD_CONTENTS
  91. POFFSET NewValue; // IML_VALUE_RECORD_CONTENTS
  92. } IML_VALUE_RECORD, *PIML_VALUE_RECORD;
  93. BOOLEAN
  94. ImlAddValueRecord(
  95. PINSTALLATION_MODIFICATION_LOGFILE pIml,
  96. IML_VALUE_ACTION Action,
  97. PWSTR Name,
  98. DWORD ValueType,
  99. ULONG ValueLength,
  100. PVOID ValueData,
  101. DWORD BackupValueType,
  102. ULONG BackupValueLength,
  103. PVOID BackupValueData,
  104. POFFSET *Values // IML_VALUE_RECORD
  105. );
  106. typedef enum _IML_KEY_ACTION {
  107. CreateNewKey,
  108. DeleteOldKey,
  109. ModifyKeyValues
  110. } IML_KEY_ACTION;
  111. typedef struct _IML_KEY_RECORD {
  112. POFFSET Next; // IML_KEY_RECORD
  113. IML_KEY_ACTION Action;
  114. POFFSET Name; // WCHAR
  115. POFFSET Values; // IML_VALUE_RECORD
  116. } IML_KEY_RECORD, *PIML_KEY_RECORD;
  117. BOOLEAN
  118. ImlAddKeyRecord(
  119. PINSTALLATION_MODIFICATION_LOGFILE pIml,
  120. IML_KEY_ACTION Action,
  121. PWSTR Name,
  122. POFFSET Values // IML_VALUE_RECORD
  123. );
  124. typedef enum _IML_INIVARIABLE_ACTION {
  125. CreateNewVariable,
  126. DeleteOldVariable,
  127. ModifyOldVariable
  128. } IML_INIVARIABLE_ACTION;
  129. typedef struct _IML_INIVARIABLE_RECORD {
  130. POFFSET Next; // IML_INIVARIABLE_RECORD
  131. IML_INIVARIABLE_ACTION Action;
  132. POFFSET Name; // WCHAR
  133. POFFSET OldValue; // WCHAR
  134. POFFSET NewValue; // WCHAR
  135. } IML_INIVARIABLE_RECORD, *PIML_INIVARIABLE_RECORD;
  136. BOOLEAN
  137. ImlAddIniVariableRecord(
  138. PINSTALLATION_MODIFICATION_LOGFILE pIml,
  139. IML_INIVARIABLE_ACTION Action,
  140. PWSTR Name,
  141. PWSTR OldValue,
  142. PWSTR NewValue,
  143. POFFSET *Variables // IML_INIVARIABLE_RECORD
  144. );
  145. typedef enum _IML_INISECTION_ACTION {
  146. CreateNewSection,
  147. DeleteOldSection,
  148. ModifySectionVariables
  149. } IML_INISECTION_ACTION;
  150. typedef struct _IML_INISECTION_RECORD {
  151. POFFSET Next; // IML_INISECTION_RECORD
  152. IML_INISECTION_ACTION Action;
  153. POFFSET Name; // WCHAR
  154. POFFSET Variables; // IML_INIVARIABLE_RECORD
  155. } IML_INISECTION_RECORD, *PIML_INISECTION_RECORD;
  156. BOOLEAN
  157. ImlAddIniSectionRecord(
  158. PINSTALLATION_MODIFICATION_LOGFILE pIml,
  159. IML_INISECTION_ACTION Action,
  160. PWSTR Name,
  161. POFFSET Variables, // IML_INIVARIABLE_RECORD
  162. POFFSET *Sections // IML_INISECTION_RECORD
  163. );
  164. typedef enum _IML_INI_ACTION {
  165. CreateNewIniFile,
  166. ModifyOldIniFile
  167. } IML_INI_ACTION;
  168. typedef struct _IML_INI_RECORD {
  169. POFFSET Next; // IML_INI_RECORD
  170. IML_INI_ACTION Action;
  171. POFFSET Name; // WCHAR
  172. POFFSET Sections; // IML_INISECTION_RECORD
  173. FILETIME LastWriteTime;
  174. } IML_INI_RECORD, *PIML_INI_RECORD;
  175. BOOLEAN
  176. ImlAddIniRecord(
  177. PINSTALLATION_MODIFICATION_LOGFILE pIml,
  178. IML_INI_ACTION Action,
  179. PWSTR Name,
  180. PFILETIME BackupLastWriteTime,
  181. POFFSET Sections // IML_INISECTION_RECORD
  182. );