aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.Native/Msi/MsiInterop.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core.Native/Msi/MsiInterop.cs')
-rw-r--r--src/WixToolset.Core.Native/Msi/MsiInterop.cs397
1 files changed, 397 insertions, 0 deletions
diff --git a/src/WixToolset.Core.Native/Msi/MsiInterop.cs b/src/WixToolset.Core.Native/Msi/MsiInterop.cs
new file mode 100644
index 00000000..0d16fcb2
--- /dev/null
+++ b/src/WixToolset.Core.Native/Msi/MsiInterop.cs
@@ -0,0 +1,397 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Core.Native.Msi
4{
5 using System;
6 using System.Text;
7 using System.Runtime.InteropServices;
8
9 /// <summary>
10 /// Class exposing static functions and structs from MSI API.
11 /// </summary>
12 internal static class MsiInterop
13 {
14 // Patching constants
15 internal const int MsiMaxStreamNameLength = 62; // http://msdn2.microsoft.com/library/aa370551.aspx
16
17 internal const int MSICONDITIONFALSE = 0; // The table is temporary.
18 internal const int MSICONDITIONTRUE = 1; // The table is persistent.
19 internal const int MSICONDITIONNONE = 2; // The table is unknown.
20 internal const int MSICONDITIONERROR = 3; // An invalid handle or invalid parameter was passed to the function.
21
22 /*
23 internal const int MSIDBOPENREADONLY = 0;
24 internal const int MSIDBOPENTRANSACT = 1;
25 internal const int MSIDBOPENDIRECT = 2;
26 internal const int MSIDBOPENCREATE = 3;
27 internal const int MSIDBOPENCREATEDIRECT = 4;
28 internal const int MSIDBOPENPATCHFILE = 32;
29
30 internal const int MSIMODIFYSEEK = -1; // Refreshes the information in the supplied record without changing the position in the result set and without affecting subsequent fetch operations. The record may then be used for subsequent Update, Delete, and Refresh. All primary key columns of the table must be in the query and the record must have at least as many fields as the query. Seek cannot be used with multi-table queries. This mode cannot be used with a view containing joins. See also the remarks.
31 internal const int MSIMODIFYREFRESH = 0; // Refreshes the information in the record. Must first call MsiViewFetch with the same record. Fails for a deleted row. Works with read-write and read-only records.
32 internal const int MSIMODIFYINSERT = 1; // Inserts a record. Fails if a row with the same primary keys exists. Fails with a read-only database. This mode cannot be used with a view containing joins.
33 internal const int MSIMODIFYUPDATE = 2; // Updates an existing record. Nonprimary keys only. Must first call MsiViewFetch. Fails with a deleted record. Works only with read-write records.
34 internal const int MSIMODIFYASSIGN = 3; // Writes current data in the cursor to a table row. Updates record if the primary keys match an existing row and inserts if they do not match. Fails with a read-only database. This mode cannot be used with a view containing joins.
35 internal const int MSIMODIFYREPLACE = 4; // Updates or deletes and inserts a record into a table. Must first call MsiViewFetch with the same record. Updates record if the primary keys are unchanged. Deletes old row and inserts new if primary keys have changed. Fails with a read-only database. This mode cannot be used with a view containing joins.
36 internal const int MSIMODIFYMERGE = 5; // Inserts or validates a record in a table. Inserts if primary keys do not match any row and validates if there is a match. Fails if the record does not match the data in the table. Fails if there is a record with a duplicate key that is not identical. Works only with read-write records. This mode cannot be used with a view containing joins.
37 internal const int MSIMODIFYDELETE = 6; // Remove a row from the table. You must first call the MsiViewFetch function with the same record. Fails if the row has been deleted. Works only with read-write records. This mode cannot be used with a view containing joins.
38 internal const int MSIMODIFYINSERTTEMPORARY = 7; // Inserts a temporary record. The information is not persistent. Fails if a row with the same primary key exists. Works only with read-write records. This mode cannot be used with a view containing joins.
39 internal const int MSIMODIFYVALIDATE = 8; // Validates a record. Does not validate across joins. You must first call the MsiViewFetch function with the same record. Obtain validation errors with MsiViewGetError. Works with read-write and read-only records. This mode cannot be used with a view containing joins.
40 internal const int MSIMODIFYVALIDATENEW = 9; // Validate a new record. Does not validate across joins. Checks for duplicate keys. Obtain validation errors by calling MsiViewGetError. Works with read-write and read-only records. This mode cannot be used with a view containing joins.
41 internal const int MSIMODIFYVALIDATEFIELD = 10; // Validates fields of a fetched or new record. Can validate one or more fields of an incomplete record. Obtain validation errors by calling MsiViewGetError. Works with read-write and read-only records. This mode cannot be used with a view containing joins.
42 internal const int MSIMODIFYVALIDATEDELETE = 11; // Validates a record that will be deleted later. You must first call MsiViewFetch. Fails if another row refers to the primary keys of this row. Validation does not check for the existence of the primary keys of this row in properties or strings. Does not check if a column is a foreign key to multiple tables. Obtain validation errors by calling MsiViewGetError. Works with read-write and read-only records. This mode cannot be used with a view containing joins.
43
44 internal const uint VTI2 = 2;
45 internal const uint VTI4 = 3;
46 internal const uint VTLPWSTR = 30;
47 internal const uint VTFILETIME = 64;
48 */
49
50 internal const int MSICOLINFONAMES = 0; // return column names
51 internal const int MSICOLINFOTYPES = 1; // return column definitions, datatype code followed by width
52
53 /// <summary>
54 /// PInvoke of MsiCloseHandle.
55 /// </summary>
56 /// <param name="database">Handle to a database.</param>
57 /// <returns>Error code.</returns>
58 [DllImport("msi.dll", EntryPoint = "MsiCloseHandle", CharSet = CharSet.Unicode, ExactSpelling = true)]
59 internal static extern int MsiCloseHandle(uint database);
60
61 /// <summary>
62 /// PInvoke of MsiCreateRecord
63 /// </summary>
64 /// <param name="parameters">Count of columns in the record.</param>
65 /// <returns>Handle referencing the record.</returns>
66 [DllImport("msi.dll", EntryPoint = "MsiCreateRecord", CharSet = CharSet.Unicode, ExactSpelling = true)]
67 internal static extern uint MsiCreateRecord(int parameters);
68
69 /// <summary>
70 /// Creates summary information of an existing transform to include validation and error conditions.
71 /// </summary>
72 /// <param name="database">The handle to the database that contains the new database summary information.</param>
73 /// <param name="referenceDatabase">The handle to the database that contains the original summary information.</param>
74 /// <param name="transformFile">The name of the transform to which the summary information is added.</param>
75 /// <param name="errorConditions">The error conditions that should be suppressed when the transform is applied.</param>
76 /// <param name="validations">Specifies the properties to be validated to verify that the transform can be applied to the database.</param>
77 /// <returns>Error code.</returns>
78 [DllImport("msi.dll", EntryPoint = "MsiCreateTransformSummaryInfoW", CharSet = CharSet.Unicode, ExactSpelling = true)]
79 internal static extern int MsiCreateTransformSummaryInfo(uint database, uint referenceDatabase, string transformFile, TransformErrorConditions errorConditions, TransformValidations validations);
80
81 /// <summary>
82 /// Applies a transform to a database.
83 /// </summary>
84 /// <param name="database">Handle to the database obtained from MsiOpenDatabase to transform.</param>
85 /// <param name="transformFile">Specifies the name of the transform file to apply.</param>
86 /// <param name="errorConditions">Error conditions that should be suppressed.</param>
87 /// <returns>Error code.</returns>
88 [DllImport("msi.dll", EntryPoint = "MsiDatabaseApplyTransformW", CharSet = CharSet.Unicode, ExactSpelling = true)]
89 internal static extern int MsiDatabaseApplyTransform(uint database, string transformFile, TransformErrorConditions errorConditions);
90
91 /// <summary>
92 /// PInvoke of MsiDatabaseCommit.
93 /// </summary>
94 /// <param name="database">Handle to a databse.</param>
95 /// <returns>Error code.</returns>
96 [DllImport("msi.dll", EntryPoint = "MsiDatabaseCommit", CharSet = CharSet.Unicode, ExactSpelling = true)]
97 internal static extern int MsiDatabaseCommit(uint database);
98
99 /// <summary>
100 /// PInvoke of MsiDatabaseExportW.
101 /// </summary>
102 /// <param name="database">Handle to a database.</param>
103 /// <param name="tableName">Table name.</param>
104 /// <param name="folderPath">Folder path.</param>
105 /// <param name="fileName">File name.</param>
106 /// <returns>Error code.</returns>
107 [DllImport("msi.dll", EntryPoint = "MsiDatabaseExportW", CharSet = CharSet.Unicode, ExactSpelling = true)]
108 internal static extern int MsiDatabaseExport(uint database, string tableName, string folderPath, string fileName);
109
110 /// <summary>
111 /// Generates a transform file of differences between two databases.
112 /// </summary>
113 /// <param name="database">Handle to the database obtained from MsiOpenDatabase that includes the changes.</param>
114 /// <param name="databaseReference">Handle to the database obtained from MsiOpenDatabase that does not include the changes.</param>
115 /// <param name="transformFile">A null-terminated string that specifies the name of the transform file being generated.
116 /// This parameter can be null. If szTransformFile is null, you can use MsiDatabaseGenerateTransform to test whether two
117 /// databases are identical without creating a transform. If the databases are identical, the function returns ERROR_NO_DATA.
118 /// If the databases are different the function returns NOERROR.</param>
119 /// <param name="reserved1">This is a reserved argument and must be set to 0.</param>
120 /// <param name="reserved2">This is a reserved argument and must be set to 0.</param>
121 /// <returns>Error code.</returns>
122 [DllImport("msi.dll", EntryPoint = "MsiDatabaseGenerateTransformW", CharSet = CharSet.Unicode, ExactSpelling = true)]
123 internal static extern int MsiDatabaseGenerateTransform(uint database, uint databaseReference, string transformFile, int reserved1, int reserved2);
124
125 /// <summary>
126 /// PInvoke of MsiDatabaseImportW.
127 /// </summary>
128 /// <param name="database">Handle to a database.</param>
129 /// <param name="folderPath">Folder path.</param>
130 /// <param name="fileName">File name.</param>
131 /// <returns>Error code.</returns>
132 [DllImport("msi.dll", EntryPoint = "MsiDatabaseImportW", CharSet = CharSet.Unicode, ExactSpelling = true)]
133 internal static extern int MsiDatabaseImport(uint database, string folderPath, string fileName);
134
135 /// <summary>
136 /// PInvoke of MsiDatabaseMergeW.
137 /// </summary>
138 /// <param name="database">The handle to the database obtained from MsiOpenDatabase.</param>
139 /// <param name="databaseMerge">The handle to the database obtained from MsiOpenDatabase to merge into the base database.</param>
140 /// <param name="tableName">The name of the table to receive merge conflict information.</param>
141 /// <returns>Error code.</returns>
142 [DllImport("msi.dll", EntryPoint = "MsiDatabaseMergeW", CharSet = CharSet.Unicode, ExactSpelling = true)]
143 internal static extern int MsiDatabaseMerge(uint database, uint databaseMerge, string tableName);
144
145 /// <summary>
146 /// PInvoke of MsiDatabaseOpenViewW.
147 /// </summary>
148 /// <param name="database">Handle to a database.</param>
149 /// <param name="query">SQL query.</param>
150 /// <param name="view">View handle.</param>
151 /// <returns>Error code.</returns>
152 [DllImport("msi.dll", EntryPoint = "MsiDatabaseOpenViewW", CharSet = CharSet.Unicode, ExactSpelling = true)]
153 internal static extern int MsiDatabaseOpenView(uint database, string query, out uint view);
154
155 /// <summary>
156 /// PInvoke of MsiGetFileHashW.
157 /// </summary>
158 /// <param name="filePath">File path.</param>
159 /// <param name="options">Hash options (must be 0).</param>
160 /// <param name="hash">Buffer to recieve hash.</param>
161 /// <returns>Error code.</returns>
162 [DllImport("msi.dll", EntryPoint = "MsiGetFileHashW", CharSet = CharSet.Unicode, ExactSpelling = true)]
163 internal static extern int MsiGetFileHash(string filePath, uint options, MSIFILEHASHINFO hash);
164
165 /// <summary>
166 /// PInvoke of MsiGetFileVersionW.
167 /// </summary>
168 /// <param name="filePath">File path.</param>
169 /// <param name="versionBuf">Buffer to receive version info.</param>
170 /// <param name="versionBufSize">Size of version buffer.</param>
171 /// <param name="langBuf">Buffer to recieve lang info.</param>
172 /// <param name="langBufSize">Size of lang buffer.</param>
173 /// <returns>Error code.</returns>
174 [DllImport("msi.dll", EntryPoint = "MsiGetFileVersionW", CharSet = CharSet.Unicode, ExactSpelling = true)]
175 internal static extern int MsiGetFileVersion(string filePath, StringBuilder versionBuf, ref int versionBufSize, StringBuilder langBuf, ref int langBufSize);
176
177 /// <summary>
178 /// PInvoke of MsiGetLastErrorRecord.
179 /// </summary>
180 /// <returns>Handle to error record if one exists.</returns>
181 [DllImport("msi.dll", EntryPoint = "MsiGetLastErrorRecord", CharSet = CharSet.Unicode, ExactSpelling = true)]
182 internal static extern uint MsiGetLastErrorRecord();
183
184 /// <summary>
185 /// PInvoke of MsiDatabaseGetPrimaryKeysW.
186 /// </summary>
187 /// <param name="database">Handle to a database.</param>
188 /// <param name="tableName">Table name.</param>
189 /// <param name="record">Handle to receive resulting record.</param>
190 /// <returns>Error code.</returns>
191 [DllImport("msi.dll", EntryPoint = "MsiDatabaseGetPrimaryKeysW", CharSet = CharSet.Unicode, ExactSpelling = true)]
192 internal static extern int MsiDatabaseGetPrimaryKeys(uint database, string tableName, out uint record);
193
194 /// <summary>
195 /// PInvoke of MsiDoActionW.
196 /// </summary>
197 /// <param name="product">Handle to the installation provided to a DLL custom action or
198 /// obtained through MsiOpenPackage, MsiOpenPackageEx, or MsiOpenProduct.</param>
199 /// <param name="action">Specifies the action to execute.</param>
200 /// <returns>Error code.</returns>
201 [DllImport("msi.dll", EntryPoint = "MsiDoActionW", CharSet = CharSet.Unicode, ExactSpelling = true)]
202 internal static extern int MsiDoAction(uint product, string action);
203
204 /// <summary>
205 /// PInvoke of MsiGetSummaryInformationW. Can use either database handle or database path as input.
206 /// </summary>
207 /// <param name="database">Handle to a database.</param>
208 /// <param name="databasePath">Path to a database.</param>
209 /// <param name="updateCount">Max number of updated values.</param>
210 /// <param name="summaryInfo">Handle to summary information.</param>
211 /// <returns>Error code.</returns>
212 [DllImport("msi.dll", EntryPoint = "MsiGetSummaryInformationW", CharSet = CharSet.Unicode, ExactSpelling = true)]
213 internal static extern int MsiGetSummaryInformation(uint database, string databasePath, uint updateCount, ref uint summaryInfo);
214
215 /// <summary>
216 /// PInvoke of MsiDatabaseIsTablePersitentW.
217 /// </summary>
218 /// <param name="database">Handle to a database.</param>
219 /// <param name="tableName">Table name.</param>
220 /// <returns>MSICONDITION</returns>
221 [DllImport("msi.dll", EntryPoint = "MsiDatabaseIsTablePersistentW", CharSet = CharSet.Unicode, ExactSpelling = true)]
222 internal static extern int MsiDatabaseIsTablePersistent(uint database, string tableName);
223
224 /// <summary>
225 /// PInvoke of MsiOpenDatabaseW.
226 /// </summary>
227 /// <param name="databasePath">Path to database.</param>
228 /// <param name="persist">Persist mode.</param>
229 /// <param name="database">Handle to database.</param>
230 /// <returns>Error code.</returns>
231 [DllImport("msi.dll", EntryPoint = "MsiOpenDatabaseW", CharSet = CharSet.Unicode, ExactSpelling = true)]
232 internal static extern int MsiOpenDatabase(string databasePath, IntPtr persist, out uint database);
233
234 /// <summary>
235 /// PInvoke of MsiOpenPackageW.
236 /// </summary>
237 /// <param name="packagePath">The path to the package.</param>
238 /// <param name="product">A pointer to a variable that receives the product handle.</param>
239 /// <returns>Error code.</returns>
240 [DllImport("msi.dll", EntryPoint = "MsiOpenPackageW", CharSet = CharSet.Unicode, ExactSpelling = true)]
241 internal static extern int MsiOpenPackage(string packagePath, out uint product);
242
243 /// <summary>
244 /// PInvoke of MsiRecordIsNull.
245 /// </summary>
246 /// <param name="record">MSI Record handle.</param>
247 /// <param name="field">Index of field to check for null value.</param>
248 /// <returns>true if the field is null, false if not, and an error code for any error.</returns>
249 [DllImport("msi.dll", EntryPoint = "MsiRecordIsNull", CharSet = CharSet.Unicode, ExactSpelling = true)]
250 internal static extern int MsiRecordIsNull(uint record, int field);
251
252 /// <summary>
253 /// PInvoke of MsiRecordGetInteger.
254 /// </summary>
255 /// <param name="record">MSI Record handle.</param>
256 /// <param name="field">Index of field to retrieve integer from.</param>
257 /// <returns>Integer value.</returns>
258 [DllImport("msi.dll", EntryPoint = "MsiRecordGetInteger", CharSet = CharSet.Unicode, ExactSpelling = true)]
259 internal static extern int MsiRecordGetInteger(uint record, int field);
260
261 /// <summary>
262 /// PInvoke of MsiRectordSetInteger.
263 /// </summary>
264 /// <param name="record">MSI Record handle.</param>
265 /// <param name="field">Index of field to set integer value in.</param>
266 /// <param name="value">Value to set field to.</param>
267 /// <returns>Error code.</returns>
268 [DllImport("msi.dll", EntryPoint = "MsiRecordSetInteger", CharSet = CharSet.Unicode, ExactSpelling = true)]
269 internal static extern int MsiRecordSetInteger(uint record, int field, int value);
270
271 /// <summary>
272 /// PInvoke of MsiRecordGetStringW.
273 /// </summary>
274 /// <param name="record">MSI Record handle.</param>
275 /// <param name="field">Index of field to get string value from.</param>
276 /// <param name="valueBuf">Buffer to recieve value.</param>
277 /// <param name="valueBufSize">Size of buffer.</param>
278 /// <returns>Error code.</returns>
279 [DllImport("msi.dll", EntryPoint = "MsiRecordGetStringW", CharSet = CharSet.Unicode, ExactSpelling = true)]
280 internal static extern int MsiRecordGetString(uint record, int field, StringBuilder valueBuf, ref int valueBufSize);
281
282 /// <summary>
283 /// PInvoke of MsiRecordSetStringW.
284 /// </summary>
285 /// <param name="record">MSI Record handle.</param>
286 /// <param name="field">Index of field to set string value in.</param>
287 /// <param name="value">String value.</param>
288 /// <returns>Error code.</returns>
289 [DllImport("msi.dll", EntryPoint = "MsiRecordSetStringW", CharSet = CharSet.Unicode, ExactSpelling = true)]
290 internal static extern int MsiRecordSetString(uint record, int field, string value);
291
292 /// <summary>
293 /// PInvoke of MsiRecordSetStreamW.
294 /// </summary>
295 /// <param name="record">MSI Record handle.</param>
296 /// <param name="field">Index of field to set stream value in.</param>
297 /// <param name="filePath">Path to file to set stream value to.</param>
298 /// <returns>Error code.</returns>
299 [DllImport("msi.dll", EntryPoint = "MsiRecordSetStreamW", CharSet = CharSet.Unicode, ExactSpelling = true)]
300 internal static extern int MsiRecordSetStream(uint record, int field, string filePath);
301
302 /// <summary>
303 /// PInvoke of MsiRecordReadStreamW.
304 /// </summary>
305 /// <param name="record">MSI Record handle.</param>
306 /// <param name="field">Index of field to read stream from.</param>
307 /// <param name="dataBuf">Data buffer to recieve stream value.</param>
308 /// <param name="dataBufSize">Size of data buffer.</param>
309 /// <returns>Error code.</returns>
310 [DllImport("msi.dll", EntryPoint = "MsiRecordReadStream", CharSet = CharSet.Unicode, ExactSpelling = true)]
311 internal static extern int MsiRecordReadStream(uint record, int field, byte[] dataBuf, ref int dataBufSize);
312
313 /// <summary>
314 /// PInvoke of MsiRecordGetFieldCount.
315 /// </summary>
316 /// <param name="record">MSI Record handle.</param>
317 /// <returns>Count of fields in the record.</returns>
318 [DllImport("msi.dll", EntryPoint = "MsiRecordGetFieldCount", CharSet = CharSet.Unicode, ExactSpelling = true)]
319 internal static extern int MsiRecordGetFieldCount(uint record);
320
321 /// <summary>
322 /// PInvoke of MsiSetExternalUIW.
323 /// </summary>
324 /// <param name="installUIHandler">Specifies a callback function that conforms to the INSTALLUI_HANDLER specification.</param>
325 /// <param name="installLogMode">Specifies which messages to handle using the external message handler. If the external
326 /// handler returns a non-zero result, then that message will not be sent to the UI, instead the message will be logged
327 /// if logging has been enabled.</param>
328 /// <param name="context">Pointer to an application context that is passed to the callback function.
329 /// This parameter can be used for error checking.</param>
330 /// <returns>The return value is the previously set external handler, or zero (0) if there was no previously set handler.</returns>
331 [DllImport("msi.dll", EntryPoint = "MsiSetExternalUIW", CharSet = CharSet.Unicode, ExactSpelling = true)]
332 internal static extern InstallUIHandler MsiSetExternalUI(InstallUIHandler installUIHandler, int installLogMode, IntPtr context);
333
334 /// <summary>
335 /// PInvoke of MsiSetInternalUI.
336 /// </summary>
337 /// <param name="uiLevel">Specifies the level of complexity of the user interface.</param>
338 /// <param name="hwnd">Pointer to a window. This window becomes the owner of any user interface created.
339 /// A pointer to the previous owner of the user interface is returned.
340 /// If this parameter is null, the owner of the user interface does not change.</param>
341 /// <returns>The previous user interface level is returned. If an invalid dwUILevel is passed, then INSTALLUILEVEL_NOCHANGE is returned.</returns>
342 [DllImport("msi.dll", EntryPoint = "MsiSetInternalUI", CharSet = CharSet.Unicode, ExactSpelling = true)]
343 internal static extern int MsiSetInternalUI(int uiLevel, ref IntPtr hwnd);
344
345 /// <summary>
346 /// PInvoke of MsiSummaryInfoGetPropertyW.
347 /// </summary>
348 /// <param name="summaryInfo">Handle to summary info.</param>
349 /// <param name="property">Property to get value from.</param>
350 /// <param name="dataType">Data type of property.</param>
351 /// <param name="integerValue">Integer to receive integer value.</param>
352 /// <param name="fileTimeValue">File time to receive file time value.</param>
353 /// <param name="stringValueBuf">String buffer to receive string value.</param>
354 /// <param name="stringValueBufSize">Size of string buffer.</param>
355 /// <returns>Error code.</returns>
356 [DllImport("msi.dll", EntryPoint = "MsiSummaryInfoGetPropertyW", CharSet = CharSet.Unicode, ExactSpelling = true)]
357 internal static extern int MsiSummaryInfoGetProperty(uint summaryInfo, int property, out uint dataType, out int integerValue, ref System.Runtime.InteropServices.ComTypes.FILETIME fileTimeValue, StringBuilder stringValueBuf, ref int stringValueBufSize);
358
359 /// <summary>
360 /// PInvoke of MsiViewGetColumnInfo.
361 /// </summary>
362 /// <param name="view">Handle to view.</param>
363 /// <param name="columnInfo">Column info.</param>
364 /// <param name="record">Handle for returned record.</param>
365 /// <returns>Error code.</returns>
366 [DllImport("msi.dll", EntryPoint = "MsiViewGetColumnInfo", CharSet = CharSet.Unicode, ExactSpelling = true)]
367 internal static extern int MsiViewGetColumnInfo(uint view, int columnInfo, out uint record);
368
369 /// <summary>
370 /// PInvoke of MsiViewExecute.
371 /// </summary>
372 /// <param name="view">Handle of view to execute.</param>
373 /// <param name="record">Handle to a record that supplies the parameters for the view.</param>
374 /// <returns>Error code.</returns>
375 [DllImport("msi.dll", EntryPoint = "MsiViewExecute", CharSet = CharSet.Unicode, ExactSpelling = true)]
376 internal static extern int MsiViewExecute(uint view, uint record);
377
378 /// <summary>
379 /// PInvoke of MsiViewFetch.
380 /// </summary>
381 /// <param name="view">Handle of view to fetch a row from.</param>
382 /// <param name="record">Handle to receive record info.</param>
383 /// <returns>Error code.</returns>
384 [DllImport("msi.dll", EntryPoint = "MsiViewFetch", CharSet = CharSet.Unicode, ExactSpelling = true)]
385 internal static extern int MsiViewFetch(uint view, out uint record);
386
387 /// <summary>
388 /// PInvoke of MsiViewModify.
389 /// </summary>
390 /// <param name="view">Handle of view to modify.</param>
391 /// <param name="modifyMode">Modify mode.</param>
392 /// <param name="record">Handle of record.</param>
393 /// <returns>Error code.</returns>
394 [DllImport("msi.dll", EntryPoint = "MsiViewModify", CharSet = CharSet.Unicode, ExactSpelling = true)]
395 internal static extern int MsiViewModify(uint view, int modifyMode, uint record);
396 }
397}