ReactOS 0.4.15-dev-5669-g09dde2c
alter.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "wine/debug.h"
#include "msi.h"
#include "msiquery.h"
#include "objbase.h"
#include "objidl.h"
#include "msipriv.h"
#include "query.h"
Include dependency graph for alter.c:

Go to the source code of this file.

Classes

struct  tagMSIALTERVIEW
 

Typedefs

typedef struct tagMSIALTERVIEW MSIALTERVIEW
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msidb)
 
static UINT ALTER_fetch_int (struct tagMSIVIEW *view, UINT row, UINT col, UINT *val)
 
static UINT ALTER_fetch_stream (struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
 
static UINT ALTER_execute (struct tagMSIVIEW *view, MSIRECORD *record)
 
static UINT ALTER_close (struct tagMSIVIEW *view)
 
static UINT ALTER_get_dimensions (struct tagMSIVIEW *view, UINT *rows, UINT *cols)
 
static UINT ALTER_get_column_info (struct tagMSIVIEW *view, UINT n, LPCWSTR *name, UINT *type, BOOL *temporary, LPCWSTR *table_name)
 
static UINT ALTER_modify (struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row)
 
static UINT ALTER_delete (struct tagMSIVIEW *view)
 
UINT ALTER_CreateView (MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, column_info *colinfo, int hold)
 

Variables

static const MSIVIEWOPS alter_ops
 

Typedef Documentation

◆ MSIALTERVIEW

Function Documentation

◆ ALTER_close()

static UINT ALTER_close ( struct tagMSIVIEW view)
static

Definition at line 87 of file alter.c.

88{
90
91 TRACE("%p\n", av );
92
93 return ERROR_SUCCESS;
94}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRACE(s)
Definition: solgame.cpp:4

◆ ALTER_CreateView()

UINT ALTER_CreateView ( MSIDATABASE db,
MSIVIEW **  view,
LPCWSTR  name,
column_info colinfo,
int  hold 
)

Definition at line 160 of file alter.c.

161{
162 MSIALTERVIEW *av;
163 UINT r;
164
165 TRACE("%p %p %s %d\n", view, colinfo, debugstr_w(name), hold );
166
167 av = msi_alloc_zero( sizeof *av );
168 if( !av )
170
171 r = TABLE_CreateView( db, name, &av->table );
172 if (r != ERROR_SUCCESS)
173 {
174 msi_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 const MSIVIEWOPS alter_ops
Definition: alter.c:137
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define debugstr_w
Definition: kernel32.h:32
static void * msi_alloc_zero(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1148
static void msi_free(void *mem)
Definition: msipriv.h:1159
unsigned int UINT
Definition: ndis.h:50
UINT TABLE_CreateView(MSIDATABASE *db, LPCWSTR name, MSIVIEW **view) DECLSPEC_HIDDEN
Definition: table.c:2189
LPCWSTR table
Definition: msipriv.h:222
Definition: name.c:39
MSIDATABASE * db
Definition: alter.c:40
MSIVIEW view
Definition: alter.c:39
MSIVIEW * table
Definition: alter.c:41
column_info * colinfo
Definition: alter.c:42
const MSIVIEWOPS * ops
Definition: msipriv.h:355
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985

◆ ALTER_delete()

static UINT ALTER_delete ( struct tagMSIVIEW view)
static

Definition at line 125 of file alter.c.

126{
128
129 TRACE("%p\n", av );
130 if (av->table)
131 av->table->ops->delete( av->table );
132 msi_free( av );
133
134 return ERROR_SUCCESS;
135}
UINT(* delete)(struct tagMSIVIEW *)
Definition: msipriv.h:324

◆ ALTER_execute()

static UINT ALTER_execute ( struct tagMSIVIEW view,
MSIRECORD record 
)
static

Definition at line 64 of file alter.c.

65{
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}
#define NULL
Definition: types.h:112
LPCWSTR column
Definition: msipriv.h:223
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

◆ ALTER_fetch_int()

static UINT ALTER_fetch_int ( struct tagMSIVIEW view,
UINT  row,
UINT  col,
UINT val 
)
static

Definition at line 46 of file alter.c.

47{
49
50 TRACE("%p %d %d %p\n", av, row, col, val );
51
53}
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
GLuint GLfloat * val
Definition: glext.h:7180

◆ ALTER_fetch_stream()

static UINT ALTER_fetch_stream ( struct tagMSIVIEW view,
UINT  row,
UINT  col,
IStream **  stm 
)
static

Definition at line 55 of file alter.c.

56{
58
59 TRACE("%p %d %d %p\n", av, row, col, stm );
60
62}

◆ ALTER_get_column_info()

static UINT ALTER_get_column_info ( struct tagMSIVIEW view,
UINT  n,
LPCWSTR name,
UINT type,
BOOL temporary,
LPCWSTR table_name 
)
static

Definition at line 105 of file alter.c.

107{
109
110 TRACE("%p %d %p %p %p %p\n", av, n, name, type, temporary, table_name );
111
113}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble n
Definition: glext.h:7729

◆ ALTER_get_dimensions()

static UINT ALTER_get_dimensions ( struct tagMSIVIEW view,
UINT rows,
UINT cols 
)
static

Definition at line 96 of file alter.c.

97{
99
100 TRACE("%p %p %p\n", av, rows, cols );
101
103}

◆ ALTER_modify()

static UINT ALTER_modify ( struct tagMSIVIEW view,
MSIMODIFY  eModifyMode,
MSIRECORD rec,
UINT  row 
)
static

Definition at line 115 of file alter.c.

117{
119
120 TRACE("%p %d %p\n", av, eModifyMode, rec );
121
123}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msidb  )

Variable Documentation

◆ alter_ops

const MSIVIEWOPS alter_ops
static
Initial value:
=
{
}
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 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
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

Definition at line 137 of file alter.c.

Referenced by ALTER_CreateView().