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
63 MSITABLE
*first_table
, *last_table
;
68 typedef struct tagMSIVIEWOPS
71 * fetch_int - reads one integer from {row,col} in the table
73 * This function should be called after the execute method.
74 * Data returned by the function should not change until
75 * close or delete is called.
76 * To get a string value, query the database's string table with
77 * the integer value returned from this function.
79 UINT (*fetch_int
)( struct tagMSIVIEW
*, UINT row
, UINT col
, UINT
*val
);
82 * execute - loads the underlying data into memory so it can be read
84 UINT (*execute
)( struct tagMSIVIEW
*, MSIHANDLE
);
87 * close - clears the data read by execute from memory
89 UINT (*close
)( struct tagMSIVIEW
* );
92 * get_dimensions - returns the number of rows or columns in a table.
94 * The number of rows can only be queried after the execute method
95 * is called. The number of columns can be queried at any time.
97 UINT (*get_dimensions
)( struct tagMSIVIEW
*, UINT
*rows
, UINT
*cols
);
100 * get_column_info - returns the name and type of a specific column
102 * The name is HeapAlloc'ed by this function and should be freed by
104 * The column information can be queried at any time.
106 UINT (*get_column_info
)( struct tagMSIVIEW
*, UINT n
, LPWSTR
*name
, UINT
*type
);
109 * modify - not yet implemented properly
111 UINT (*modify
)( struct tagMSIVIEW
*, MSIMODIFY
, MSIHANDLE
);
114 * delete - destroys the structure completely
116 UINT (*delete)( struct tagMSIVIEW
* );
120 typedef struct tagMSIVIEW
125 typedef struct tagMSISUMMARYINFO
127 IPropertyStorage
*propstg
;
130 typedef VOID (*msihandledestructor
)( VOID
* );
132 typedef struct tagMSIHANDLEINFO
136 msihandledestructor destructor
;
137 struct tagMSIHANDLEINFO
*next
;
138 struct tagMSIHANDLEINFO
*prev
;
141 #define MSIHANDLETYPE_ANY 0
142 #define MSIHANDLETYPE_DATABASE 1
143 #define MSIHANDLETYPE_SUMMARYINFO 2
144 #define MSIHANDLETYPE_VIEW 3
145 #define MSIHANDLETYPE_RECORD 4
147 #define MSI_MAJORVERSION 1
148 #define MSI_MINORVERSION 10
149 #define MSI_BUILDNUMBER 1029
153 #define MSIHANDLE_MAGIC 0x4d434923
154 #define MSIMAXHANDLES 0x80
156 #define MSISUMINFO_OFFSET 0x30LL
158 extern void *msihandle2msiinfo(MSIHANDLE handle
, UINT type
);
160 MSIHANDLE
alloc_msihandle(UINT type
, UINT extra
, msihandledestructor destroy
);
162 /* add this table to the list of cached tables in the database */
163 extern void add_table(MSIDATABASE
*db
, MSITABLE
*table
);
164 extern void remove_table( MSIDATABASE
*db
, MSITABLE
*table
);
165 extern void free_table( MSIDATABASE
*db
, MSITABLE
*table
);
166 extern void free_cached_tables( MSIDATABASE
*db
);
167 extern UINT
find_cached_table(MSIDATABASE
*db
, LPCWSTR name
, MSITABLE
**table
);
168 extern UINT
get_table(MSIDATABASE
*db
, LPCWSTR name
, MSITABLE
**table
);
169 extern UINT
dump_string_table(MSIDATABASE
*db
);
170 extern UINT
load_string_table( MSIDATABASE
*db
, string_table
*pst
);
171 extern UINT
msi_id2string( string_table
*st
, UINT string_no
, LPWSTR buffer
, UINT
*sz
);
172 extern LPWSTR
MSI_makestring( MSIDATABASE
*db
, UINT stringid
);
174 UINT
VIEW_find_column( MSIVIEW
*view
, LPWSTR name
, UINT
*n
);
176 #endif /* __WINE_MSI_PRIVATE__ */