main
cs 408 lines 27 KB
Raw
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
3 namespace 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(IntPtr 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 IntPtr 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(IntPtr database, IntPtr 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(IntPtr 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(IntPtr 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(IntPtr 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(IntPtr database, IntPtr 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(IntPtr 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(IntPtr database, IntPtr 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(IntPtr database, string query, out IntPtr view);
154
155 /// <summary>
156 /// PInvoke of MsiExtractPatchXMLDataW.
157 /// </summary>
158 /// <param name="szPatchPath">Path to patch.</param>
159 /// <param name="dwReserved">Reserved for future use.</param>
160 /// <param name="szXMLData">Output XML data.</param>
161 /// <param name="pcchXMLData">Count of characters in XML.</param>
162 /// <returns></returns>
163 [DllImport("msi.dll", EntryPoint = "MsiExtractPatchXMLDataW", CharSet = CharSet.Unicode, ExactSpelling = true)]
164 internal static extern int MsiExtractPatchXMLData(string szPatchPath, int dwReserved, StringBuilder szXMLData, ref int pcchXMLData);
165
166 /// <summary>
167 /// PInvoke of MsiGetFileHashW.
168 /// </summary>
169 /// <param name="filePath">File path.</param>
170 /// <param name="options">Hash options (must be 0).</param>
171 /// <param name="hash">Buffer to recieve hash.</param>
172 /// <returns>Error code.</returns>
173 [DllImport("msi.dll", EntryPoint = "MsiGetFileHashW", CharSet = CharSet.Unicode, ExactSpelling = true)]
174 internal static extern int MsiGetFileHash(string filePath, uint options, MSIFILEHASHINFO hash);
175
176 /// <summary>
177 /// PInvoke of MsiGetFileVersionW.
178 /// </summary>
179 /// <param name="filePath">File path.</param>
180 /// <param name="versionBuf">Buffer to receive version info.</param>
181 /// <param name="versionBufSize">Size of version buffer.</param>
182 /// <param name="langBuf">Buffer to recieve lang info.</param>
183 /// <param name="langBufSize">Size of lang buffer.</param>
184 /// <returns>Error code.</returns>
185 [DllImport("msi.dll", EntryPoint = "MsiGetFileVersionW", CharSet = CharSet.Unicode, ExactSpelling = true)]
186 internal static extern int MsiGetFileVersion(string filePath, StringBuilder versionBuf, ref int versionBufSize, StringBuilder langBuf, ref int langBufSize);
187
188 /// <summary>
189 /// PInvoke of MsiGetLastErrorRecord.
190 /// </summary>
191 /// <returns>Handle to error record if one exists.</returns>
192 [DllImport("msi.dll", EntryPoint = "MsiGetLastErrorRecord", CharSet = CharSet.Unicode, ExactSpelling = true)]
193 internal static extern IntPtr MsiGetLastErrorRecord();
194
195 /// <summary>
196 /// PInvoke of MsiDatabaseGetPrimaryKeysW.
197 /// </summary>
198 /// <param name="database">Handle to a database.</param>
199 /// <param name="tableName">Table name.</param>
200 /// <param name="record">Handle to receive resulting record.</param>
201 /// <returns>Error code.</returns>
202 [DllImport("msi.dll", EntryPoint = "MsiDatabaseGetPrimaryKeysW", CharSet = CharSet.Unicode, ExactSpelling = true)]
203 internal static extern int MsiDatabaseGetPrimaryKeys(IntPtr database, string tableName, out IntPtr record);
204
205 /// <summary>
206 /// PInvoke of MsiDoActionW.
207 /// </summary>
208 /// <param name="product">Handle to the installation provided to a DLL custom action or
209 /// obtained through MsiOpenPackage, MsiOpenPackageEx, or MsiOpenProduct.</param>
210 /// <param name="action">Specifies the action to execute.</param>
211 /// <returns>Error code.</returns>
212 [DllImport("msi.dll", EntryPoint = "MsiDoActionW", CharSet = CharSet.Unicode, ExactSpelling = true)]
213 internal static extern int MsiDoAction(IntPtr product, string action);
214
215 /// <summary>
216 /// PInvoke of MsiGetSummaryInformationW. Can use either database handle or database path as input.
217 /// </summary>
218 /// <param name="database">Handle to a database.</param>
219 /// <param name="databasePath">Path to a database.</param>
220 /// <param name="updateCount">Max number of updated values.</param>
221 /// <param name="summaryInfo">Handle to summary information.</param>
222 /// <returns>Error code.</returns>
223 [DllImport("msi.dll", EntryPoint = "MsiGetSummaryInformationW", CharSet = CharSet.Unicode, ExactSpelling = true)]
224 internal static extern int MsiGetSummaryInformation(IntPtr database, string databasePath, uint updateCount, ref IntPtr summaryInfo);
225
226 /// <summary>
227 /// PInvoke of MsiDatabaseIsTablePersitentW.
228 /// </summary>
229 /// <param name="database">Handle to a database.</param>
230 /// <param name="tableName">Table name.</param>
231 /// <returns>MSICONDITION</returns>
232 [DllImport("msi.dll", EntryPoint = "MsiDatabaseIsTablePersistentW", CharSet = CharSet.Unicode, ExactSpelling = true)]
233 internal static extern int MsiDatabaseIsTablePersistent(IntPtr database, string tableName);
234
235 /// <summary>
236 /// PInvoke of MsiOpenDatabaseW.
237 /// </summary>
238 /// <param name="databasePath">Path to database.</param>
239 /// <param name="persist">Persist mode.</param>
240 /// <param name="database">Handle to database.</param>
241 /// <returns>Error code.</returns>
242 [DllImport("msi.dll", EntryPoint = "MsiOpenDatabaseW", CharSet = CharSet.Unicode, ExactSpelling = true)]
243 internal static extern int MsiOpenDatabase(string databasePath, IntPtr persist, out IntPtr database);
244
245 /// <summary>
246 /// PInvoke of MsiOpenPackageW.
247 /// </summary>
248 /// <param name="packagePath">The path to the package.</param>
249 /// <param name="product">A pointer to a variable that receives the product handle.</param>
250 /// <returns>Error code.</returns>
251 [DllImport("msi.dll", EntryPoint = "MsiOpenPackageW", CharSet = CharSet.Unicode, ExactSpelling = true)]
252 internal static extern int MsiOpenPackage(string packagePath, out IntPtr product);
253
254 /// <summary>
255 /// PInvoke of MsiRecordIsNull.
256 /// </summary>
257 /// <param name="record">MSI Record handle.</param>
258 /// <param name="field">Index of field to check for null value.</param>
259 /// <returns>true if the field is null, false if not, and an error code for any error.</returns>
260 [DllImport("msi.dll", EntryPoint = "MsiRecordIsNull", CharSet = CharSet.Unicode, ExactSpelling = true)]
261 internal static extern int MsiRecordIsNull(IntPtr record, int field);
262
263 /// <summary>
264 /// PInvoke of MsiRecordGetInteger.
265 /// </summary>
266 /// <param name="record">MSI Record handle.</param>
267 /// <param name="field">Index of field to retrieve integer from.</param>
268 /// <returns>Integer value.</returns>
269 [DllImport("msi.dll", EntryPoint = "MsiRecordGetInteger", CharSet = CharSet.Unicode, ExactSpelling = true)]
270 internal static extern int MsiRecordGetInteger(IntPtr record, int field);
271
272 /// <summary>
273 /// PInvoke of MsiRectordSetInteger.
274 /// </summary>
275 /// <param name="record">MSI Record handle.</param>
276 /// <param name="field">Index of field to set integer value in.</param>
277 /// <param name="value">Value to set field to.</param>
278 /// <returns>Error code.</returns>
279 [DllImport("msi.dll", EntryPoint = "MsiRecordSetInteger", CharSet = CharSet.Unicode, ExactSpelling = true)]
280 internal static extern int MsiRecordSetInteger(IntPtr record, int field, int value);
281
282 /// <summary>
283 /// PInvoke of MsiRecordGetStringW.
284 /// </summary>
285 /// <param name="record">MSI Record handle.</param>
286 /// <param name="field">Index of field to get string value from.</param>
287 /// <param name="valueBuf">Buffer to recieve value.</param>
288 /// <param name="valueBufSize">Size of buffer.</param>
289 /// <returns>Error code.</returns>
290 [DllImport("msi.dll", EntryPoint = "MsiRecordGetStringW", CharSet = CharSet.Unicode, ExactSpelling = true)]
291 internal static extern int MsiRecordGetString(IntPtr record, int field, StringBuilder valueBuf, ref int valueBufSize);
292
293 /// <summary>
294 /// PInvoke of MsiRecordSetStringW.
295 /// </summary>
296 /// <param name="record">MSI Record handle.</param>
297 /// <param name="field">Index of field to set string value in.</param>
298 /// <param name="value">String value.</param>
299 /// <returns>Error code.</returns>
300 [DllImport("msi.dll", EntryPoint = "MsiRecordSetStringW", CharSet = CharSet.Unicode, ExactSpelling = true)]
301 internal static extern int MsiRecordSetString(IntPtr record, int field, string value);
302
303 /// <summary>
304 /// PInvoke of MsiRecordSetStreamW.
305 /// </summary>
306 /// <param name="record">MSI Record handle.</param>
307 /// <param name="field">Index of field to set stream value in.</param>
308 /// <param name="filePath">Path to file to set stream value to.</param>
309 /// <returns>Error code.</returns>
310 [DllImport("msi.dll", EntryPoint = "MsiRecordSetStreamW", CharSet = CharSet.Unicode, ExactSpelling = true)]
311 internal static extern int MsiRecordSetStream(IntPtr record, int field, string filePath);
312
313 /// <summary>
314 /// PInvoke of MsiRecordReadStreamW.
315 /// </summary>
316 /// <param name="record">MSI Record handle.</param>
317 /// <param name="field">Index of field to read stream from.</param>
318 /// <param name="dataBuf">Data buffer to recieve stream value.</param>
319 /// <param name="dataBufSize">Size of data buffer.</param>
320 /// <returns>Error code.</returns>
321 [DllImport("msi.dll", EntryPoint = "MsiRecordReadStream", CharSet = CharSet.Unicode, ExactSpelling = true)]
322 internal static extern int MsiRecordReadStream(IntPtr record, int field, byte[] dataBuf, ref int dataBufSize);
323
324 /// <summary>
325 /// PInvoke of MsiRecordGetFieldCount.
326 /// </summary>
327 /// <param name="record">MSI Record handle.</param>
328 /// <returns>Count of fields in the record.</returns>
329 [DllImport("msi.dll", EntryPoint = "MsiRecordGetFieldCount", CharSet = CharSet.Unicode, ExactSpelling = true)]
330 internal static extern int MsiRecordGetFieldCount(IntPtr record);
331
332 /// <summary>
333 /// PInvoke of MsiSetExternalUIW.
334 /// </summary>
335 /// <param name="installUIHandler">Specifies a callback function that conforms to the INSTALLUI_HANDLER specification.</param>
336 /// <param name="installLogMode">Specifies which messages to handle using the external message handler. If the external
337 /// handler returns a non-zero result, then that message will not be sent to the UI, instead the message will be logged
338 /// if logging has been enabled.</param>
339 /// <param name="context">Pointer to an application context that is passed to the callback function.
340 /// This parameter can be used for error checking.</param>
341 /// <returns>The return value is the previously set external handler, or zero (0) if there was no previously set handler.</returns>
342 [DllImport("msi.dll", EntryPoint = "MsiSetExternalUIW", CharSet = CharSet.Unicode, ExactSpelling = true)]
343 internal static extern InstallUIHandler MsiSetExternalUI(InstallUIHandler installUIHandler, int installLogMode, IntPtr context);
344
345 /// <summary>
346 /// PInvoke of MsiSetInternalUI.
347 /// </summary>
348 /// <param name="uiLevel">Specifies the level of complexity of the user interface.</param>
349 /// <param name="hwnd">Pointer to a window. This window becomes the owner of any user interface created.
350 /// A pointer to the previous owner of the user interface is returned.
351 /// If this parameter is null, the owner of the user interface does not change.</param>
352 /// <returns>The previous user interface level is returned. If an invalid dwUILevel is passed, then INSTALLUILEVEL_NOCHANGE is returned.</returns>
353 [DllImport("msi.dll", EntryPoint = "MsiSetInternalUI", CharSet = CharSet.Unicode, ExactSpelling = true)]
354 internal static extern int MsiSetInternalUI(int uiLevel, ref IntPtr hwnd);
355
356 /// <summary>
357 /// PInvoke of MsiSummaryInfoGetPropertyW.
358 /// </summary>
359 /// <param name="summaryInfo">Handle to summary info.</param>
360 /// <param name="property">Property to get value from.</param>
361 /// <param name="dataType">Data type of property.</param>
362 /// <param name="integerValue">Integer to receive integer value.</param>
363 /// <param name="fileTimeValue">File time to receive file time value.</param>
364 /// <param name="stringValueBuf">String buffer to receive string value.</param>
365 /// <param name="stringValueBufSize">Size of string buffer.</param>
366 /// <returns>Error code.</returns>
367 [DllImport("msi.dll", EntryPoint = "MsiSummaryInfoGetPropertyW", CharSet = CharSet.Unicode, ExactSpelling = true)]
368 internal static extern int MsiSummaryInfoGetProperty(IntPtr summaryInfo, int property, out uint dataType, out int integerValue, ref System.Runtime.InteropServices.ComTypes.FILETIME fileTimeValue, StringBuilder stringValueBuf, ref int stringValueBufSize);
369
370 /// <summary>
371 /// PInvoke of MsiViewGetColumnInfo.
372 /// </summary>
373 /// <param name="view">Handle to view.</param>
374 /// <param name="columnInfo">Column info.</param>
375 /// <param name="record">Handle for returned record.</param>
376 /// <returns>Error code.</returns>
377 [DllImport("msi.dll", EntryPoint = "MsiViewGetColumnInfo", CharSet = CharSet.Unicode, ExactSpelling = true)]
378 internal static extern int MsiViewGetColumnInfo(IntPtr view, int columnInfo, out IntPtr record);
379
380 /// <summary>
381 /// PInvoke of MsiViewExecute.
382 /// </summary>
383 /// <param name="view">Handle of view to execute.</param>
384 /// <param name="record">Handle to a record that supplies the parameters for the view.</param>
385 /// <returns>Error code.</returns>
386 [DllImport("msi.dll", EntryPoint = "MsiViewExecute", CharSet = CharSet.Unicode, ExactSpelling = true)]
387 internal static extern int MsiViewExecute(IntPtr view, IntPtr record);
388
389 /// <summary>
390 /// PInvoke of MsiViewFetch.
391 /// </summary>
392 /// <param name="view">Handle of view to fetch a row from.</param>
393 /// <param name="record">Handle to receive record info.</param>
394 /// <returns>Error code.</returns>
395 [DllImport("msi.dll", EntryPoint = "MsiViewFetch", CharSet = CharSet.Unicode, ExactSpelling = true)]
396 internal static extern int MsiViewFetch(IntPtr view, out IntPtr record);
397
398 /// <summary>
399 /// PInvoke of MsiViewModify.
400 /// </summary>
401 /// <param name="view">Handle of view to modify.</param>
402 /// <param name="modifyMode">Modify mode.</param>
403 /// <param name="record">Handle of record.</param>
404 /// <returns>Error code.</returns>
405 [DllImport("msi.dll", EntryPoint = "MsiViewModify", CharSet = CharSet.Unicode, ExactSpelling = true)]
406 internal static extern int MsiViewModify(IntPtr view, int modifyMode, IntPtr record);
407 }
408 }