~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/msi/delete.c

Version: ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * Implementation of the Microsoft Installer (msi.dll)
  3  *
  4  * Copyright 2002-2005 Mike McCormack for CodeWeavers
  5  *
  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.
 10  *
 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.
 15  *
 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 19  */
 20 
 21 #include <stdarg.h>
 22 
 23 #include "windef.h"
 24 #include "winbase.h"
 25 #include "winerror.h"
 26 #include "wine/debug.h"
 27 #include "msi.h"
 28 #include "msiquery.h"
 29 #include "objbase.h"
 30 #include "objidl.h"
 31 #include "msipriv.h"
 32 #include "winnls.h"
 33 
 34 #include "query.h"
 35 
 36 WINE_DEFAULT_DEBUG_CHANNEL(msidb);
 37 
 38 
 39 /*
 40  * Code to delete rows from a table.
 41  *
 42  * We delete rows by blanking them out rather than trying to remove the row.
 43  * This appears to be what the native MSI does (or tries to do). For the query:
 44  *
 45  * delete from Property
 46  *
 47  * some non-zero entries are left in the table by native MSI.  I'm not sure if
 48  * that's a bug in the way I'm running the query, or a just a bug.
 49  */
 50 
 51 typedef struct tagMSIDELETEVIEW
 52 {
 53     MSIVIEW        view;
 54     MSIDATABASE   *db;
 55     MSIVIEW       *table;
 56 } MSIDELETEVIEW;
 57 
 58 static UINT DELETE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
 59 {
 60     MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
 61 
 62     TRACE("%p %d %d %p\n", dv, row, col, val );
 63 
 64     return ERROR_FUNCTION_FAILED;
 65 }
 66 
 67 static UINT DELETE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
 68 {
 69     MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
 70 
 71     TRACE("%p %d %d %p\n", dv, row, col, stm );
 72 
 73     return ERROR_FUNCTION_FAILED;
 74 }
 75 
 76 static UINT DELETE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
 77 {
 78     MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
 79     UINT r, i, rows = 0, cols = 0;
 80 
 81     TRACE("%p %p\n", dv, record);
 82 
 83     if( !dv->table )
 84          return ERROR_FUNCTION_FAILED;
 85 
 86     r = dv->table->ops->execute( dv->table, record );
 87     if( r != ERROR_SUCCESS )
 88         return r;
 89 
 90     r = dv->table->ops->get_dimensions( dv->table, &rows, &cols );
 91     if( r != ERROR_SUCCESS )
 92         return r;
 93 
 94     TRACE("deleting %d rows\n", rows);
 95 
 96     /* blank out all the rows that match */
 97     for ( i=0; i<rows; i++ )
 98         dv->table->ops->delete_row( dv->table, i );
 99 
100     return ERROR_SUCCESS;
101 }
102 
103 static UINT DELETE_close( struct tagMSIVIEW *view )
104 {
105     MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
106 
107     TRACE("%p\n", dv );
108 
109     if( !dv->table )
110          return ERROR_FUNCTION_FAILED;
111 
112     return dv->table->ops->close( dv->table );
113 }
114 
115 static UINT DELETE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
116 {
117     MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
118 
119     TRACE("%p %p %p\n", dv, rows, cols );
120 
121     if( !dv->table )
122          return ERROR_FUNCTION_FAILED;
123 
124     *rows = 0;
125 
126     return dv->table->ops->get_dimensions( dv->table, NULL, cols );
127 }
128 
129 static UINT DELETE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
130                                     UINT *type, BOOL *temporary, LPCWSTR *table_name )
131 {
132     MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
133 
134     TRACE("%p %d %p %p %p %p\n", dv, n, name, type, temporary, table_name );
135 
136     if( !dv->table )
137          return ERROR_FUNCTION_FAILED;
138 
139     return dv->table->ops->get_column_info( dv->table, n, name,
140                                             type, temporary, table_name);
141 }
142 
143 static UINT DELETE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
144                            MSIRECORD *rec, UINT row )
145 {
146     MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
147 
148     TRACE("%p %d %p\n", dv, eModifyMode, rec );
149 
150     return ERROR_FUNCTION_FAILED;
151 }
152 
153 static UINT DELETE_delete( struct tagMSIVIEW *view )
154 {
155     MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
156 
157     TRACE("%p\n", dv );
158 
159     if( dv->table )
160         dv->table->ops->delete( dv->table );
161 
162     msi_free( dv );
163 
164     return ERROR_SUCCESS;
165 }
166 
167 static UINT DELETE_find_matching_rows( struct tagMSIVIEW *view, UINT col,
168     UINT val, UINT *row, MSIITERHANDLE *handle )
169 {
170     TRACE("%p, %d, %u, %p\n", view, col, val, *handle);
171 
172     return ERROR_FUNCTION_FAILED;
173 }
174 
175 
176 static const MSIVIEWOPS delete_ops =
177 {
178     DELETE_fetch_int,
179     DELETE_fetch_stream,
180     NULL,
181     NULL,
182     NULL,
183     NULL,
184     DELETE_execute,
185     DELETE_close,
186     DELETE_get_dimensions,
187     DELETE_get_column_info,
188     DELETE_modify,
189     DELETE_delete,
190     DELETE_find_matching_rows,
191     NULL,
192     NULL,
193     NULL,
194     NULL,
195     NULL,
196     NULL,
197 };
198 
199 UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table )
200 {
201     MSIDELETEVIEW *dv = NULL;
202 
203     TRACE("%p\n", dv );
204 
205     dv = msi_alloc_zero( sizeof *dv );
206     if( !dv )
207         return ERROR_FUNCTION_FAILED;
208     
209     /* fill the structure */
210     dv->view.ops = &delete_ops;
211     dv->db = db;
212     dv->table = table;
213 
214     *view = &dv->view;
215 
216     return ERROR_SUCCESS;
217 }
218 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.