ntdll/tests: Fix exception test for CPUs that do segment limit checks differently.
[wine] / dlls / msi / alter.c
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
35 WINE_DEFAULT_DEBUG_CHANNEL(msidb);
36
37 typedef struct tagMSIALTERVIEW
38 {
39     MSIVIEW        view;
40     MSIDATABASE   *db;
41 } MSIALTERVIEW;
42
43 static UINT ALTER_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
44 {
45     MSIALTERVIEW *av = (MSIALTERVIEW*)view;
46
47     TRACE("%p %d %d %p\n", av, row, col, val );
48
49     return ERROR_FUNCTION_FAILED;
50 }
51
52 static UINT ALTER_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
53 {
54     MSIALTERVIEW *av = (MSIALTERVIEW*)view;
55
56     TRACE("%p %d %d %p\n", av, row, col, stm );
57
58     return ERROR_FUNCTION_FAILED;
59 }
60
61 static UINT ALTER_execute( struct tagMSIVIEW *view, MSIRECORD *record )
62 {
63     MSIALTERVIEW *av = (MSIALTERVIEW*)view;
64
65     FIXME("%p %p\n", av, record);
66
67     return ERROR_SUCCESS;
68 }
69
70 static UINT ALTER_close( struct tagMSIVIEW *view )
71 {
72     MSIALTERVIEW *av = (MSIALTERVIEW*)view;
73
74     TRACE("%p\n", av );
75
76     return ERROR_SUCCESS;
77 }
78
79 static UINT ALTER_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
80 {
81     MSIALTERVIEW *av = (MSIALTERVIEW*)view;
82
83     TRACE("%p %p %p\n", av, rows, cols );
84
85     return ERROR_FUNCTION_FAILED;
86 }
87
88 static UINT ALTER_get_column_info( struct tagMSIVIEW *view,
89                 UINT n, LPWSTR *name, UINT *type )
90 {
91     MSIALTERVIEW *av = (MSIALTERVIEW*)view;
92
93     TRACE("%p %d %p %p\n", av, n, name, type );
94
95     return ERROR_FUNCTION_FAILED;
96 }
97
98 static UINT ALTER_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
99                 MSIRECORD *rec )
100 {
101     MSIALTERVIEW *av = (MSIALTERVIEW*)view;
102
103     TRACE("%p %d %p\n", av, eModifyMode, rec );
104
105     return ERROR_FUNCTION_FAILED;
106 }
107
108 static UINT ALTER_delete( struct tagMSIVIEW *view )
109 {
110     MSIALTERVIEW *av = (MSIALTERVIEW*)view;
111
112     TRACE("%p\n", av );
113     msi_free( av );
114
115     return ERROR_SUCCESS;
116 }
117
118 static UINT ALTER_find_matching_rows( struct tagMSIVIEW *view, UINT col,
119     UINT val, UINT *row, MSIITERHANDLE *handle )
120 {
121     TRACE("%p, %d, %u, %p\n", view, col, val, *handle);
122
123     return ERROR_FUNCTION_FAILED;
124 }
125
126
127 static const MSIVIEWOPS alter_ops =
128 {
129     ALTER_fetch_int,
130     ALTER_fetch_stream,
131     NULL,
132     NULL,
133     ALTER_execute,
134     ALTER_close,
135     ALTER_get_dimensions,
136     ALTER_get_column_info,
137     ALTER_modify,
138     ALTER_delete,
139     ALTER_find_matching_rows
140 };
141
142 UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, int hold )
143 {
144     MSIALTERVIEW *av;
145
146     TRACE("%p\n", view );
147
148     av = msi_alloc_zero( sizeof *av );
149     if( !av )
150         return ERROR_FUNCTION_FAILED;
151
152     /* fill the structure */
153     av->view.ops = &alter_ops;
154     av->db = db;
155
156     *view = &av->view;
157
158     return ERROR_SUCCESS;
159 }