2 * Implementation of the Microsoft Installer (msi.dll)
4 * Copyright 2002 Mike McCormack for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_MSI_PRIVATE__
22 #define __WINE_MSI_PRIVATE__
32 #define MSI_DATASIZEMASK 0x00ff
33 #define MSITYPE_VALID 0x0100
34 #define MSITYPE_STRING 0x0800
35 #define MSITYPE_NULLABLE 0x1000
36 #define MSITYPE_KEY 0x2000
39 typedef struct tagMSITABLE MSITABLE;
41 typedef struct pool_data_tag
47 typedef struct string_data_tag
53 typedef struct string_table_tag
59 typedef struct tagMSIDATABASE
64 MSITABLE *first_table, *last_table;
69 typedef struct tagMSIVIEWOPS
72 * fetch_int - reads one integer from {row,col} in the table
74 * This function should be called after the execute method.
75 * Data returned by the function should not change until
76 * close or delete is called.
77 * To get a string value, query the database's string table with
78 * the integer value returned from this function.
80 UINT (*fetch_int)( struct tagMSIVIEW *, UINT row, UINT col, UINT *val );
83 * execute - loads the underlying data into memory so it can be read
85 UINT (*execute)( struct tagMSIVIEW *, MSIHANDLE );
88 * close - clears the data read by execute from memory
90 UINT (*close)( struct tagMSIVIEW * );
93 * get_dimensions - returns the number of rows or columns in a table.
95 * The number of rows can only be queried after the execute method
96 * is called. The number of columns can be queried at any time.
98 UINT (*get_dimensions)( struct tagMSIVIEW *, UINT *rows, UINT *cols );
101 * get_column_info - returns the name and type of a specific column
103 * The name is HeapAlloc'ed by this function and should be freed by
105 * The column information can be queried at any time.
107 UINT (*get_column_info)( struct tagMSIVIEW *, UINT n, LPWSTR *name, UINT *type );
110 * modify - not yet implemented properly
112 UINT (*modify)( struct tagMSIVIEW *, MSIMODIFY, MSIHANDLE );
115 * delete - destroys the structure completely
117 UINT (*delete)( struct tagMSIVIEW * );
121 typedef struct tagMSIVIEW
126 typedef struct tagMSISUMMARYINFO
128 IPropertyStorage *propstg;
131 typedef VOID (*msihandledestructor)( VOID * );
133 typedef struct tagMSIHANDLEINFO
137 msihandledestructor destructor;
138 struct tagMSIHANDLEINFO *next;
139 struct tagMSIHANDLEINFO *prev;
142 #define MSIHANDLETYPE_ANY 0
143 #define MSIHANDLETYPE_DATABASE 1
144 #define MSIHANDLETYPE_SUMMARYINFO 2
145 #define MSIHANDLETYPE_VIEW 3
146 #define MSIHANDLETYPE_RECORD 4
148 #define MSI_MAJORVERSION 1
149 #define MSI_MINORVERSION 10
150 #define MSI_BUILDNUMBER 1029
154 #define MSIHANDLE_MAGIC 0x4d434923
155 #define MSIMAXHANDLES 0x80
157 #define MSISUMINFO_OFFSET 0x30LL
159 extern void *msihandle2msiinfo(MSIHANDLE handle, UINT type);
161 MSIHANDLE alloc_msihandle(UINT type, UINT extra, msihandledestructor destroy);
163 /* add this table to the list of cached tables in the database */
164 extern void add_table(MSIDATABASE *db, MSITABLE *table);
165 extern void remove_table( MSIDATABASE *db, MSITABLE *table );
166 extern void free_table( MSIDATABASE *db, MSITABLE *table );
167 extern void free_cached_tables( MSIDATABASE *db );
168 extern UINT find_cached_table(MSIDATABASE *db, LPCWSTR name, MSITABLE **table);
169 extern UINT get_table(MSIDATABASE *db, LPCWSTR name, MSITABLE **table);
170 extern UINT dump_string_table(MSIDATABASE *db);
171 extern UINT load_string_table( MSIDATABASE *db, string_table *pst);
172 extern UINT msi_id2string( string_table *st, UINT string_no, LPWSTR buffer, UINT *sz );
173 extern LPWSTR MSI_makestring( MSIDATABASE *db, UINT stringid);
175 UINT VIEW_find_column( MSIVIEW *view, LPWSTR name, UINT *n );
177 #endif /* __WINE_MSI_PRIVATE__ */