ReactOS 0.4.16-dev-122-g325d74c
alter.c
Go to the documentation of this file.
1/*
2 * Implementation of the Microsoft Installer (msi.dll)
3 *
4 * Copyright 2006 Mike McCormack
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
33#include "query.h"
34
36
38{
44};
45
47{
48 struct alter_view *av = (struct alter_view *)view;
49
50 TRACE("%p %d %d %p\n", av, row, col, val );
51
53}
54
56{
57 struct alter_view *av = (struct alter_view *)view;
58
59 TRACE("%p %d %d %p\n", av, row, col, stm );
60
62}
63
65{
66 struct alter_view *av = (struct alter_view *)view;
67 UINT ref;
68
69 TRACE("%p %p\n", av, record);
70
71 if (av->colinfo)
72 return av->table->ops->add_column(av->table, av->colinfo->column,
73 av->colinfo->type, av->hold == 1);
74
75 if (av->hold == 1)
76 av->table->ops->add_ref(av->table);
77 else if (av->hold == -1)
78 {
79 ref = av->table->ops->release(av->table);
80 if (ref == 0)
81 av->table = NULL;
82 }
83
84 return ERROR_SUCCESS;
85}
86
88{
89 struct alter_view *av = (struct alter_view *)view;
90
91 TRACE("%p\n", av );
92
93 return ERROR_SUCCESS;
94}
95
96static UINT ALTER_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
97{
98 struct alter_view *av = (struct alter_view *)view;
99
100 TRACE("%p %p %p\n", av, rows, cols );
101
103}
104
106 UINT *type, BOOL *temporary, LPCWSTR *table_name )
107{
108 struct alter_view *av = (struct alter_view *)view;
109
110 TRACE("%p %d %p %p %p %p\n", av, n, name, type, temporary, table_name );
111
113}
114
115static UINT ALTER_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
116 MSIRECORD *rec, UINT row )
117{
118 struct alter_view *av = (struct alter_view *)view;
119
120 TRACE("%p %d %p\n", av, eModifyMode, rec );
121
123}
124
126{
127 struct alter_view *av = (struct alter_view *)view;
128
129 TRACE("%p\n", av );
130 if (av->table)
131 av->table->ops->delete( av->table );
132 free( av );
133
134 return ERROR_SUCCESS;
135}
136
137static const MSIVIEWOPS alter_ops =
138{
141 NULL,
142 NULL,
143 NULL,
144 NULL,
145 NULL,
146 NULL,
153 NULL,
154 NULL,
155 NULL,
156 NULL,
157 NULL,
158};
159
161{
162 struct alter_view *av;
163 UINT r;
164
165 TRACE("%p %p %s %d\n", view, colinfo, debugstr_w(name), hold );
166
167 av = calloc( 1, sizeof *av );
168 if( !av )
170
171 r = TABLE_CreateView( db, name, &av->table );
172 if (r != ERROR_SUCCESS)
173 {
174 free( av );
175 return r;
176 }
177
178 if (colinfo)
179 colinfo->table = name;
180
181 /* fill the structure */
182 av->view.ops = &alter_ops;
183 av->db = db;
184 av->hold = hold;
185 av->colinfo = colinfo;
186
187 *view = &av->view;
188
189 return ERROR_SUCCESS;
190}
static UINT ALTER_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT *val)
Definition: alter.c:46
static UINT ALTER_get_column_info(struct tagMSIVIEW *view, UINT n, LPCWSTR *name, UINT *type, BOOL *temporary, LPCWSTR *table_name)
Definition: alter.c:105
static const MSIVIEWOPS alter_ops
Definition: alter.c:137
static UINT ALTER_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
Definition: alter.c:55
static UINT ALTER_close(struct tagMSIVIEW *view)
Definition: alter.c:87
static UINT ALTER_delete(struct tagMSIVIEW *view)
Definition: alter.c:125
UINT ALTER_CreateView(MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, column_info *colinfo, int hold)
Definition: alter.c:160
static UINT ALTER_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row)
Definition: alter.c:115
static UINT ALTER_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
Definition: alter.c:96
static UINT ALTER_execute(struct tagMSIVIEW *view, MSIRECORD *record)
Definition: alter.c:64
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define free
Definition: debug_ros.c:5
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble n
Definition: glext.h:7729
GLuint GLfloat * val
Definition: glext.h:7180
#define debugstr_w
Definition: kernel32.h:32
unsigned int UINT
Definition: ndis.h:50
UINT TABLE_CreateView(MSIDATABASE *db, LPCWSTR name, MSIVIEW **view)
Definition: table.c:2191
#define calloc
Definition: rosglue.h:14
#define TRACE(s)
Definition: solgame.cpp:4
MSIVIEW * table
Definition: alter.c:41
MSIDATABASE * db
Definition: alter.c:40
column_info * colinfo
Definition: alter.c:42
INT hold
Definition: alter.c:43
MSIVIEW view
Definition: alter.c:39
UINT type
Definition: table.c:55
Definition: name.c:39
Definition: send.c:48
UINT(* add_column)(struct tagMSIVIEW *view, LPCWSTR column, INT type, BOOL hold)
Definition: msipriv.h:339
UINT(* add_ref)(struct tagMSIVIEW *view)
Definition: msipriv.h:329
UINT(* release)(struct tagMSIVIEW *view)
Definition: msipriv.h:334
UINT(* delete)(struct tagMSIVIEW *)
Definition: msipriv.h:324
const MSIVIEWOPS * ops
Definition: msipriv.h:355
int32_t INT
Definition: typedefs.h:58
int MSIMODIFY
Definition: winemsi.idl:33
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185