ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

drop.c
Go to the documentation of this file.
00001 /*
00002  * Implementation of the Microsoft Installer (msi.dll)
00003  *
00004  * Copyright 2008 James Hawkins
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00019  */
00020 
00021 #include <stdarg.h>
00022 
00023 #include "windef.h"
00024 #include "winbase.h"
00025 #include "winerror.h"
00026 #include "wine/debug.h"
00027 #include "msi.h"
00028 #include "msiquery.h"
00029 #include "objbase.h"
00030 #include "objidl.h"
00031 #include "msipriv.h"
00032 
00033 #include "query.h"
00034 
00035 WINE_DEFAULT_DEBUG_CHANNEL(msidb);
00036 
00037 typedef struct tagMSIDROPVIEW
00038 {
00039     MSIVIEW view;
00040     MSIDATABASE *db;
00041     MSIVIEW *table;
00042     column_info *colinfo;
00043     INT hold;
00044 } MSIDROPVIEW;
00045 
00046 static UINT DROP_execute(struct tagMSIVIEW *view, MSIRECORD *record)
00047 {
00048     MSIDROPVIEW *dv = (MSIDROPVIEW*)view;
00049     UINT r;
00050 
00051     TRACE("%p %p\n", dv, record);
00052 
00053     if( !dv->table )
00054          return ERROR_FUNCTION_FAILED;
00055 
00056     r = dv->table->ops->execute(dv->table, record);
00057     if (r != ERROR_SUCCESS)
00058         return r;
00059 
00060     return dv->table->ops->drop(dv->table);
00061 }
00062 
00063 static UINT DROP_close(struct tagMSIVIEW *view)
00064 {
00065     MSIDROPVIEW *dv = (MSIDROPVIEW*)view;
00066 
00067     TRACE("%p\n", dv);
00068 
00069     return ERROR_SUCCESS;
00070 }
00071 
00072 static UINT DROP_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
00073 {
00074     MSIDROPVIEW *dv = (MSIDROPVIEW*)view;
00075 
00076     TRACE("%p %p %p\n", dv, rows, cols);
00077 
00078     return ERROR_FUNCTION_FAILED;
00079 }
00080 
00081 static UINT DROP_delete( struct tagMSIVIEW *view )
00082 {
00083     MSIDROPVIEW *dv = (MSIDROPVIEW*)view;
00084 
00085     TRACE("%p\n", dv );
00086 
00087     if( dv->table )
00088         dv->table->ops->delete( dv->table );
00089 
00090     msi_free( dv );
00091 
00092     return ERROR_SUCCESS;
00093 }
00094 
00095 static const MSIVIEWOPS drop_ops =
00096 {
00097     NULL,
00098     NULL,
00099     NULL,
00100     NULL,
00101     NULL,
00102     NULL,
00103     DROP_execute,
00104     DROP_close,
00105     DROP_get_dimensions,
00106     NULL,
00107     NULL,
00108     DROP_delete,
00109     NULL,
00110     NULL,
00111     NULL,
00112     NULL,
00113     NULL,
00114     NULL,
00115     NULL,
00116 };
00117 
00118 UINT DROP_CreateView(MSIDATABASE *db, MSIVIEW **view, LPCWSTR name)
00119 {
00120     MSIDROPVIEW *dv;
00121     UINT r;
00122 
00123     TRACE("%p %s\n", view, debugstr_w(name));
00124 
00125     dv = msi_alloc_zero(sizeof *dv);
00126     if(!dv)
00127         return ERROR_FUNCTION_FAILED;
00128 
00129     r = TABLE_CreateView(db, name, &dv->table);
00130     if (r != ERROR_SUCCESS)
00131     {
00132         msi_free( dv );
00133         return r;
00134     }
00135 
00136     dv->view.ops = &drop_ops;
00137     dv->db = db;
00138 
00139     *view = (MSIVIEW *)dv;
00140 
00141     return ERROR_SUCCESS;
00142 }

Generated on Sat May 26 2012 04:23:48 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.