ReactOS  0.4.15-dev-5112-g22d8c0f
msiquery.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "wine/debug.h"
#include "wine/exception.h"
#include "msi.h"
#include "msiquery.h"
#include "objbase.h"
#include "objidl.h"
#include "winnls.h"
#include "msipriv.h"
#include "query.h"
#include "winemsi_s.h"
#include "initguid.h"
Include dependency graph for msiquery.c:

Go to the source code of this file.

Classes

struct  msi_primary_key_record_info
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
static void MSI_CloseView (MSIOBJECTHDR *arg)
 
UINT VIEW_find_column (MSIVIEW *table, LPCWSTR name, LPCWSTR table_name, UINT *n)
 
UINT WINAPI MsiDatabaseOpenViewA (MSIHANDLE hdb, const char *szQuery, MSIHANDLE *phView)
 
UINT MSI_DatabaseOpenViewW (MSIDATABASE *db, const WCHAR *szQuery, MSIQUERY **pView)
 
UINT WINAPIV MSI_OpenQuery (MSIDATABASE *db, MSIQUERY **view, LPCWSTR fmt,...)
 
UINT MSI_IterateRecords (MSIQUERY *view, LPDWORD count, record_func func, LPVOID param)
 
MSIRECORD *WINAPIV MSI_QueryGetRecord (MSIDATABASE *db, LPCWSTR fmt,...)
 
UINT WINAPI MsiDatabaseOpenViewW (MSIHANDLE hdb, LPCWSTR szQuery, MSIHANDLE *phView)
 
UINT msi_view_refresh_row (MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD *rec)
 
UINT msi_view_get_row (MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec)
 
UINT MSI_ViewFetch (MSIQUERY *query, MSIRECORD **prec)
 
UINT WINAPI MsiViewFetch (MSIHANDLE hView, MSIHANDLE *record)
 
UINT MSI_ViewClose (MSIQUERY *query)
 
UINT WINAPI MsiViewClose (MSIHANDLE hView)
 
UINT MSI_ViewExecute (MSIQUERY *query, MSIRECORD *rec)
 
UINT WINAPI MsiViewExecute (MSIHANDLE hView, MSIHANDLE hRec)
 
static UINT msi_set_record_type_string (MSIRECORD *rec, UINT field, UINT type, BOOL temporary)
 
UINT MSI_ViewGetColumnInfo (MSIQUERY *query, MSICOLINFO info, MSIRECORD **prec)
 
UINT WINAPI MsiViewGetColumnInfo (MSIHANDLE hView, MSICOLINFO info, MSIHANDLE *hRec)
 
UINT MSI_ViewModify (MSIQUERY *query, MSIMODIFY mode, MSIRECORD *rec)
 
UINT WINAPI MsiViewModify (MSIHANDLE hView, MSIMODIFY eModifyMode, MSIHANDLE hRecord)
 
MSIDBERROR WINAPI MsiViewGetErrorW (MSIHANDLE handle, WCHAR *buffer, DWORD *buflen)
 
MSIDBERROR WINAPI MsiViewGetErrorA (MSIHANDLE handle, char *buffer, DWORD *buflen)
 
MSIHANDLE WINAPI MsiGetLastErrorRecord (void)
 
UINT MSI_DatabaseApplyTransformW (MSIDATABASE *db, const WCHAR *transform, int error_cond)
 
UINT WINAPI MsiDatabaseApplyTransformW (MSIHANDLE hdb, const WCHAR *transform, int error_cond)
 
UINT WINAPI MsiDatabaseApplyTransformA (MSIHANDLE hdb, const char *transform, int error_cond)
 
UINT WINAPI MsiDatabaseGenerateTransformA (MSIHANDLE hdb, MSIHANDLE hdbref, const char *szTransformFile, int iReserved1, int iReserved2)
 
UINT WINAPI MsiDatabaseGenerateTransformW (MSIHANDLE hdb, MSIHANDLE hdbref, const WCHAR *szTransformFile, int iReserved1, int iReserved2)
 
UINT WINAPI MsiDatabaseCommit (MSIHANDLE hdb)
 
static UINT msi_primary_key_iterator (MSIRECORD *rec, LPVOID param)
 
UINT MSI_DatabaseGetPrimaryKeys (MSIDATABASE *db, LPCWSTR table, MSIRECORD **prec)
 
UINT WINAPI MsiDatabaseGetPrimaryKeysW (MSIHANDLE hdb, const WCHAR *table, MSIHANDLE *phRec)
 
UINT WINAPI MsiDatabaseGetPrimaryKeysA (MSIHANDLE hdb, const char *table, MSIHANDLE *phRec)
 
MSICONDITION WINAPI MsiDatabaseIsTablePersistentA (MSIHANDLE hDatabase, const char *szTableName)
 
MSICONDITION WINAPI MsiDatabaseIsTablePersistentW (MSIHANDLE hDatabase, const WCHAR *szTableName)
 
UINT __cdecl s_remote_ViewClose (MSIHANDLE view)
 
UINT __cdecl s_remote_ViewExecute (MSIHANDLE view, struct wire_record *remote_rec)
 
UINT __cdecl s_remote_ViewFetch (MSIHANDLE view, struct wire_record **rec)
 
UINT __cdecl s_remote_ViewGetColumnInfo (MSIHANDLE view, MSICOLINFO info, struct wire_record **rec)
 
MSIDBERROR __cdecl s_remote_ViewGetError (MSIHANDLE view, LPWSTR *column)
 
UINT __cdecl s_remote_ViewModify (MSIHANDLE view, MSIMODIFY mode, struct wire_record *remote_rec, struct wire_record **remote_refreshed)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file msiquery.c.

Function Documentation

◆ MSI_CloseView()

static void MSI_CloseView ( MSIOBJECTHDR arg)
static

Definition at line 44 of file msiquery.c.

45 {
46  MSIQUERY *query = (MSIQUERY*) arg;
47  struct list *ptr, *t;
48 
49  if( query->view && query->view->ops->delete )
50  query->view->ops->delete( query->view );
51  msiobj_release( &query->db->hdr );
52 
54  {
55  msi_free( ptr );
56  }
57 }
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
GLdouble GLdouble t
Definition: gl.h:2047
static void msi_free(void *mem)
Definition: msipriv.h:1159
static PVOID ptr
Definition: dispmode.c:27
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
Definition: _list.h:228
struct list mem
struct view * view

Referenced by MSI_DatabaseOpenViewW().

◆ MSI_DatabaseApplyTransformW()

UINT MSI_DatabaseApplyTransformW ( MSIDATABASE db,
const WCHAR transform,
int  error_cond 
)

Definition at line 878 of file msiquery.c.

879 {
880  HRESULT hr;
882  IStorage *stg;
883  STATSTG stat;
884 
885  TRACE( "%p %s %08x\n", db, debugstr_w(transform), error_cond );
886 
887  if (*transform == ':')
888  {
889  hr = IStorage_OpenStorage( db->storage, transform + 1, NULL, STGM_SHARE_EXCLUSIVE, NULL, 0, &stg );
890  if (FAILED( hr ))
891  {
892  WARN( "failed to open substorage transform %#lx\n", hr );
893  return ERROR_FUNCTION_FAILED;
894  }
895  }
896  else
897  {
899  if (FAILED( hr ))
900  {
901  WARN( "failed to open file transform %#lx\n", hr );
902  return ERROR_FUNCTION_FAILED;
903  }
904  }
905 
906  hr = IStorage_Stat( stg, &stat, STATFLAG_NONAME );
907  if (FAILED( hr )) goto end;
908  if (!IsEqualGUID( &stat.clsid, &CLSID_MsiTransform )) goto end;
909  if (TRACE_ON( msi )) enum_stream_names( stg );
910 
911  ret = msi_table_apply_transform( db, stg, error_cond );
912 
913 end:
914  IStorage_Release( stg );
915  return ret;
916 }
HRESULT hr
Definition: shlfolder.c:183
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:923
#define WARN(fmt,...)
Definition: debug.h:112
void enum_stream_names(IStorage *stg) DECLSPEC_HIDDEN
Definition: table.c:204
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define debugstr_w
Definition: kernel32.h:32
#define STGM_READ
Definition: objbase.h:917
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
HRESULT WINAPI StgOpenStorage(const OLECHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8755
#define STGM_DIRECT
Definition: objbase.h:914
GLuint GLuint end
Definition: gl.h:1545
int ret
Definition: stat.h:55
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
UINT msi_table_apply_transform(MSIDATABASE *db, IStorage *stg, int err_cond) DECLSPEC_HIDDEN
Definition: table.c:3371
GLuint GLenum GLenum transform
Definition: glext.h:9407
IStorage * storage
Definition: msipriv.h:109
#define STGM_SHARE_DENY_WRITE
Definition: objbase.h:922
#define TRACE_ON(x)
Definition: compat.h:75

Referenced by MsiDatabaseApplyTransformW().

◆ MSI_DatabaseGetPrimaryKeys()

UINT MSI_DatabaseGetPrimaryKeys ( MSIDATABASE db,
LPCWSTR  table,
MSIRECORD **  prec 
)

Definition at line 1044 of file msiquery.c.

1046 {
1048  MSIQUERY *query = NULL;
1049  UINT r;
1050 
1051  if (!TABLE_Exists( db, table ))
1052  return ERROR_INVALID_TABLE;
1053 
1054  r = MSI_OpenQuery( db, &query, L"SELECT * FROM `_Columns` WHERE `Table` = '%s'", table );
1055  if( r != ERROR_SUCCESS )
1056  return r;
1057 
1058  /* count the number of primary key records */
1059  info.n = 0;
1060  info.rec = 0;
1062  if( r == ERROR_SUCCESS )
1063  {
1064  TRACE( "found %lu primary keys\n", info.n );
1065 
1066  /* allocate a record and fill in the names of the tables */
1067  info.rec = MSI_CreateRecord( info.n );
1068  info.n = 0;
1070  if( r == ERROR_SUCCESS )
1071  *prec = info.rec;
1072  else
1073  msiobj_release( &info.rec->hdr );
1074  }
1075  msiobj_release( &query->hdr );
1076 
1077  return r;
1078 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT MSI_IterateRecords(MSIQUERY *view, LPDWORD count, record_func func, LPVOID param)
Definition: msiquery.c:163
BOOL TABLE_Exists(MSIDATABASE *db, LPCWSTR name) DECLSPEC_HIDDEN
Definition: table.c:960
#define L(x)
Definition: ntvdm.h:50
static UINT msi_primary_key_iterator(MSIRECORD *rec, LPVOID param)
Definition: msiquery.c:1018
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:76
UINT WINAPIV MSI_OpenQuery(MSIDATABASE *db, MSIQUERY **view, LPCWSTR fmt,...)
Definition: msiquery.c:138
#define ERROR_INVALID_TABLE
Definition: winerror.h:986
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112

Referenced by create_diff_row_query(), merge_verify_primary_keys(), MSI_DatabaseExport(), msi_get_table_labels(), and MsiDatabaseGetPrimaryKeysW().

◆ MSI_DatabaseOpenViewW()

UINT MSI_DatabaseOpenViewW ( MSIDATABASE db,
const WCHAR szQuery,
MSIQUERY **  pView 
)

Definition at line 110 of file msiquery.c.

111 {
112  MSIQUERY *query;
113  UINT r;
114 
115  TRACE( "%s, %p\n", debugstr_w(szQuery), pView );
116 
117  /* pre allocate a handle to hold a pointer to the view */
119  MSI_CloseView );
120  if( !query )
121  return ERROR_FUNCTION_FAILED;
122 
123  msiobj_addref( &db->hdr );
124  query->db = db;
125  list_init( &query->mem );
126 
127  r = MSI_ParseSQL( db, szQuery, &query->view, &query->mem );
128  if( r == ERROR_SUCCESS )
129  {
130  msiobj_addref( &query->hdr );
131  *pView = query;
132  }
133 
134  msiobj_release( &query->hdr );
135  return r;
136 }
void msiobj_addref(MSIOBJECTHDR *info)
Definition: handle.c:217
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void MSI_CloseView(MSIOBJECTHDR *arg)
Definition: msiquery.c:44
void * alloc_msiobject(UINT type, UINT size, msihandledestructor destroy)
Definition: handle.c:201
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define MSIHANDLETYPE_VIEW
Definition: msipriv.h:724
struct list mem
UINT MSI_ParseSQL(MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview, struct list *mem) DECLSPEC_HIDDEN
struct view * view
unsigned int UINT
Definition: ndis.h:50
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
GLenum query
Definition: glext.h:7781
MSIOBJECTHDR hdr
Definition: msipriv.h:108

Referenced by MSI_OpenQuery(), MSI_QueryGetRecord(), and MsiDatabaseOpenViewW().

◆ MSI_IterateRecords()

UINT MSI_IterateRecords ( MSIQUERY view,
LPDWORD  count,
record_func  func,
LPVOID  param 
)

Definition at line 163 of file msiquery.c.

165 {
166  MSIRECORD *rec = NULL;
167  UINT r, n = 0, max = 0;
168 
169  r = MSI_ViewExecute( view, NULL );
170  if( r != ERROR_SUCCESS )
171  return r;
172 
173  if( count )
174  max = *count;
175 
176  /* iterate a query */
177  for( n = 0; (max == 0) || (n < max); n++ )
178  {
179  r = MSI_ViewFetch( view, &rec );
180  if( r != ERROR_SUCCESS )
181  break;
182  if (func)
183  r = func( rec, param );
184  msiobj_release( &rec->hdr );
185  if( r != ERROR_SUCCESS )
186  break;
187  }
188 
189  MSI_ViewClose( view );
190 
191  if( count )
192  *count = n;
193 
194  if( r == ERROR_NO_MORE_ITEMS )
195  r = ERROR_SUCCESS;
196 
197  return r;
198 }
GLenum func
Definition: glext.h:6028
#define max(a, b)
Definition: svc.c:63
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
MSIOBJECTHDR hdr
Definition: msipriv.h:151
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT MSI_ViewExecute(MSIQUERY *query, MSIRECORD *rec)
Definition: msiquery.c:502
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble n
Definition: glext.h:7729
GLfloat param
Definition: glext.h:5796
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
UINT MSI_ViewFetch(MSIQUERY *query, MSIRECORD **prec)
Definition: msiquery.c:377
UINT MSI_ViewClose(MSIQUERY *query)
Definition: msiquery.c:454

Referenced by ACTION_AppSearch(), ACTION_BindImage(), ACTION_CCPSearch(), ACTION_CostFinalize(), ACTION_CreateFolders(), ACTION_CreateShortcuts(), ACTION_DeleteServices(), ACTION_DuplicateFiles(), ACTION_ExecuteAction(), ACTION_FindRelatedProducts(), ACTION_InstallODBC(), ACTION_InstallServices(), ACTION_InstallValidate(), ACTION_LaunchConditions(), ACTION_MigrateFeatureStates(), ACTION_MoveFiles(), ACTION_ProcessExecSequence(), ACTION_ProcessUISequence(), ACTION_PublishComponents(), ACTION_RegisterFonts(), ACTION_RegisterTypeLibraries(), ACTION_RemoveDuplicateFiles(), ACTION_RemoveEnvironmentStrings(), ACTION_RemoveExistingProducts(), ACTION_RemoveFiles(), ACTION_RemoveFolders(), ACTION_RemoveIniValues(), ACTION_RemoveODBC(), ACTION_RemoveRegistryValues(), ACTION_RemoveShortcuts(), ACTION_SelfRegModules(), ACTION_SelfUnregModules(), ACTION_SetODBCFolders(), ACTION_StartServices(), ACTION_StopServices(), ACTION_UnpublishComponents(), ACTION_UnregisterFonts(), ACTION_UnregisterTypeLibraries(), ACTION_WriteEnvironmentStrings(), ACTION_WriteIniValues(), ACTION_WriteRegistryValues(), dialog_map_events(), gather_merge_data(), get_assembly_display_name(), load_all_classes(), load_all_extensions(), load_all_files(), load_all_folders(), load_all_media(), load_all_mimes(), load_all_patches(), load_all_progids(), load_all_verbs(), load_feature(), mark_patched_components(), merge_diff_tables(), msi_combobox_add_items(), MSI_DatabaseExport(), MSI_DatabaseGetPrimaryKeys(), msi_dialog_build_font_list(), msi_dialog_button_handler(), msi_dialog_evaluate_control_conditions(), msi_dialog_fill_controls(), msi_dialog_radiogroup_control(), msi_listbox_add_items(), msi_listview_add_items(), msi_load_all_components(), msi_load_all_features(), msi_publish_icons(), MSI_Sequence(), msi_unimplemented_action_stub(), msi_unpublish_icons(), and ui_sequence_exists().

◆ MSI_OpenQuery()

UINT WINAPIV MSI_OpenQuery ( MSIDATABASE db,
MSIQUERY **  view,
LPCWSTR  fmt,
  ... 
)

Definition at line 138 of file msiquery.c.

139 {
140  UINT r;
141  int size = 100, res;
142  LPWSTR query;
143 
144  /* construct the string */
145  for (;;)
146  {
147  va_list va;
148  query = msi_alloc( size*sizeof(WCHAR) );
149  va_start(va, fmt);
150  res = vswprintf(query, size, fmt, va);
151  va_end(va);
152  if (res == -1) size *= 2;
153  else if (res >= size) size = res + 1;
154  else break;
155  msi_free( query );
156  }
157  /* perform the query */
159  msi_free(query);
160  return r;
161 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
static _Check_return_opt_ int __cdecl vswprintf(_Out_writes_z_(_SizeInWords) wchar_t *_DstBuf, _In_ size_t _SizeInWords, _In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList)
Definition: stdio.h:977
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
va_start(ap, x)
unsigned int UINT
Definition: ndis.h:50
UINT MSI_DatabaseOpenViewW(MSIDATABASE *db, const WCHAR *szQuery, MSIQUERY **pView)
Definition: msiquery.c:110
GLuint res
Definition: glext.h:9613
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
WCHAR * LPWSTR
Definition: xmlstorage.h:184
GLenum query
Definition: glext.h:7781
Definition: dsound.c:943

Referenced by ACTION_AppSearch(), ACTION_CCPSearch(), ACTION_ExecuteAction(), ACTION_ProcessExecSequence(), dialog_map_events(), get_assembly_display_name(), get_assembly_record(), load_feature(), load_file_hash(), load_folder_persistence(), mark_patched_components(), merge_diff_tables(), msi_add_records_to_table(), msi_combobox_add_items(), MSI_DatabaseExport(), MSI_DatabaseGetPrimaryKeys(), msi_dialog_build_font_list(), msi_dialog_button_handler(), msi_dialog_evaluate_control_conditions(), msi_dialog_fill_controls(), msi_dialog_radiogroup_control(), msi_get_merge_table(), msi_listbox_add_items(), msi_listview_add_items(), MSI_Sequence(), msi_unimplemented_action_stub(), MsiGetProductPropertyW(), and update_merge_errors().

◆ msi_primary_key_iterator()

static UINT msi_primary_key_iterator ( MSIRECORD rec,
LPVOID  param 
)
static

Definition at line 1018 of file msiquery.c.

1019 {
1021  LPCWSTR name, table;
1022  DWORD type;
1023 
1024  type = MSI_RecordGetInteger( rec, 4 );
1025  if( type & MSITYPE_KEY )
1026  {
1027  info->n++;
1028  if( info->rec )
1029  {
1030  if ( info->n == 1 )
1031  {
1032  table = MSI_RecordGetString( rec, 1 );
1033  MSI_RecordSetStringW( info->rec, 0, table);
1034  }
1035 
1036  name = MSI_RecordGetString( rec, 3 );
1037  MSI_RecordSetStringW( info->rec, info->n, name );
1038  }
1039  }
1040 
1041  return ERROR_SUCCESS;
1042 }
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:597
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:433
GLfloat param
Definition: glext.h:5796
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MSITYPE_KEY
Definition: msipriv.h:52
int MSI_RecordGetInteger(MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:213
Definition: name.c:38
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by MSI_DatabaseGetPrimaryKeys().

◆ MSI_QueryGetRecord()

MSIRECORD* WINAPIV MSI_QueryGetRecord ( MSIDATABASE db,
LPCWSTR  fmt,
  ... 
)

Definition at line 201 of file msiquery.c.

202 {
203  MSIRECORD *rec = NULL;
204  MSIQUERY *view = NULL;
205  UINT r;
206  int size = 100, res;
207  LPWSTR query;
208 
209  /* construct the string */
210  for (;;)
211  {
212  va_list va;
213  query = msi_alloc( size*sizeof(WCHAR) );
214  va_start(va, fmt);
215  res = vswprintf(query, size, fmt, va);
216  va_end(va);
217  if (res == -1) size *= 2;
218  else if (res >= size) size = res + 1;
219  else break;
220  msi_free( query );
221  }
222  /* perform the query */
224  msi_free(query);
225 
226  if( r == ERROR_SUCCESS )
227  {
229  MSI_ViewFetch( view, &rec );
230  MSI_ViewClose( view );
231  msiobj_release( &view->hdr );
232  }
233  return rec;
234 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT MSI_ViewExecute(MSIQUERY *query, MSIRECORD *rec)
Definition: msiquery.c:502
static void msi_free(void *mem)
Definition: msipriv.h:1159
static _Check_return_opt_ int __cdecl vswprintf(_Out_writes_z_(_SizeInWords) wchar_t *_DstBuf, _In_ size_t _SizeInWords, _In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList)
Definition: stdio.h:977
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
va_start(ap, x)
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
UINT MSI_DatabaseOpenViewW(MSIDATABASE *db, const WCHAR *szQuery, MSIQUERY **pView)
Definition: msiquery.c:110
GLuint res
Definition: glext.h:9613
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
UINT MSI_ViewFetch(MSIQUERY *query, MSIRECORD **prec)
Definition: msiquery.c:377
WCHAR * LPWSTR
Definition: xmlstorage.h:184
GLenum query
Definition: glext.h:7781
Definition: dsound.c:943
UINT MSI_ViewClose(MSIQUERY *query)
Definition: msiquery.c:454

Referenced by ACTION_CustomAction(), ACTION_PerformActionSequence(), ACTION_ProcessComponents(), create_temp_binary(), get_signature(), HANDLE_CustomType19(), HANDLE_CustomType5_6(), ITERATE_InstallService(), load_file_disk_id(), load_given_appid(), load_given_class(), load_given_extension(), load_given_mime(), load_given_progid(), load_patch_disk_id(), msi_dialog_get_uitext(), msi_dialog_seltree_handler(), msi_get_checkbox_value(), msi_get_dialog_record(), msi_get_error_message(), msi_load_image(), msi_load_media_info(), msi_load_picture(), msi_media_get_disk_info(), resolve_keypath(), search_components(), search_dr(), search_ini(), search_reg(), and ui_actionstart().

◆ msi_set_record_type_string()

static UINT msi_set_record_type_string ( MSIRECORD rec,
UINT  field,
UINT  type,
BOOL  temporary 
)
static

Definition at line 567 of file msiquery.c.

569 {
570  WCHAR szType[0x10];
571 
572  if (MSITYPE_IS_BINARY(type))
573  szType[0] = 'v';
574  else if (type & MSITYPE_LOCALIZABLE)
575  szType[0] = 'l';
576  else if (type & MSITYPE_UNKNOWN)
577  szType[0] = 'f';
578  else if (type & MSITYPE_STRING)
579  {
580  if (temporary)
581  szType[0] = 'g';
582  else
583  szType[0] = 's';
584  }
585  else
586  {
587  if (temporary)
588  szType[0] = 'j';
589  else
590  szType[0] = 'i';
591  }
592 
593  if (type & MSITYPE_NULLABLE)
594  szType[0] &= ~0x20;
595 
596  swprintf( &szType[1], ARRAY_SIZE(szType) - 1, L"%d", (type&0xff) );
597 
598  TRACE("type %04x -> %s\n", type, debugstr_w(szType) );
599 
600  return MSI_RecordSetStringW( rec, field, szType );
601 }
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:597
#define MSITYPE_IS_BINARY(type)
Definition: msipriv.h:62
#define MSITYPE_STRING
Definition: msipriv.h:50
#define MSITYPE_UNKNOWN
Definition: msipriv.h:54
#define L(x)
Definition: ntvdm.h:50
#define debugstr_w
Definition: kernel32.h:32
#define MSITYPE_NULLABLE
Definition: msipriv.h:51
#define TRACE(s)
Definition: solgame.cpp:4
#define MSITYPE_LOCALIZABLE
Definition: msipriv.h:49
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: parser.c:43
int _cdecl swprintf(const WCHAR *,...)
#define ARRAY_SIZE(a)
Definition: main.h:24
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by MSI_ViewGetColumnInfo().

◆ msi_view_get_row()

UINT msi_view_get_row ( MSIDATABASE db,
MSIVIEW view,
UINT  row,
MSIRECORD **  rec 
)

Definition at line 353 of file msiquery.c.

354 {
355  UINT row_count = 0, col_count = 0, r;
356  MSIRECORD *object;
357 
358  TRACE("view %p, row %u, rec %p.\n", view, row, rec);
359 
360  if ((r = view->ops->get_dimensions(view, &row_count, &col_count)))
361  return r;
362 
363  if (row >= row_count)
364  return ERROR_NO_MORE_ITEMS;
365 
366  if (!(object = MSI_CreateRecord( col_count )))
367  return ERROR_OUTOFMEMORY;
368 
369  if ((r = msi_view_refresh_row(db, view, row, object)))
370  msiobj_release( &object->hdr );
371  else
372  *rec = object;
373 
374  return r;
375 }
coclass MSXML2::XSLTemplate40 object
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT msi_view_refresh_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD *rec)
Definition: msiquery.c:287
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:76
unsigned int UINT
Definition: ndis.h:50
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
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

Referenced by join_modify_update(), MSI_ViewFetch(), TABLE_get_row(), TransformView_delete_row(), and TransformView_set_row().

◆ msi_view_refresh_row()

UINT msi_view_refresh_row ( MSIDATABASE db,
MSIVIEW view,
UINT  row,
MSIRECORD rec 
)

Definition at line 287 of file msiquery.c.

288 {
289  UINT row_count = 0, col_count = 0, i, ival, ret, type;
290 
291  TRACE("%p %p %d %p\n", db, view, row, rec);
292 
293  ret = view->ops->get_dimensions(view, &row_count, &col_count);
294  if (ret)
295  return ret;
296 
297  if (!col_count)
299 
300  for (i = 1; i <= col_count; i++)
301  {
302  ret = view->ops->get_column_info(view, i, NULL, &type, NULL, NULL);
303  if (ret)
304  {
305  ERR("Error getting column type for %d\n", i);
306  continue;
307  }
308 
309  if (MSITYPE_IS_BINARY(type))
310  {
311  IStream *stm = NULL;
312 
313  ret = view->ops->fetch_stream(view, row, i, &stm);
314  if ((ret == ERROR_SUCCESS) && stm)
315  {
316  MSI_RecordSetIStream(rec, i, stm);
317  IStream_Release(stm);
318  }
319  else
320  WARN("failed to get stream\n");
321 
322  continue;
323  }
324 
325  ret = view->ops->fetch_int(view, row, i, &ival);
326  if (ret)
327  {
328  ERR("Error fetching data for %d\n", i);
329  continue;
330  }
331 
332  if (! (type & MSITYPE_VALID))
333  ERR("Invalid type!\n");
334 
335  if (type & MSITYPE_STRING)
336  {
337  int len;
338  const WCHAR *sval = msi_string_lookup(db->strings, ival, &len);
339  msi_record_set_string(rec, i, sval, len);
340  }
341  else
342  {
343  if ((type & MSI_DATASIZEMASK) == 2)
344  MSI_RecordSetInteger(rec, i, ival ? ival - (1<<15) : MSI_NULL_INTEGER);
345  else
346  MSI_RecordSetInteger(rec, i, ival - (1u<<31));
347  }
348  }
349 
350  return ERROR_SUCCESS;
351 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
const WCHAR * msi_string_lookup(const string_table *st, UINT id, int *len) DECLSPEC_HIDDEN
Definition: string.c:343
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WARN(fmt,...)
Definition: debug.h:112
#define MSITYPE_IS_BINARY(type)
Definition: msipriv.h:62
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
#define MSITYPE_STRING
Definition: msipriv.h:50
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int) DECLSPEC_HIDDEN
Definition: record.c:280
string_table * strings
Definition: msipriv.h:110
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
GLenum GLsizei len
Definition: glext.h:6722
UINT MSI_RecordSetIStream(MSIRECORD *, UINT, IStream *) DECLSPEC_HIDDEN
Definition: record.c:836
#define ERR(fmt,...)
Definition: debug.h:110
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
UINT msi_record_set_string(MSIRECORD *, UINT, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: record.c:573
#define NULL
Definition: types.h:112
#define MSITYPE_VALID
Definition: msipriv.h:48
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define MSI_DATASIZEMASK
Definition: msipriv.h:47
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

Referenced by msi_view_get_row(), and SELECT_modify().

◆ MSI_ViewClose()

UINT MSI_ViewClose ( MSIQUERY query)

Definition at line 454 of file msiquery.c.

455 {
456  MSIVIEW *view;
457 
458  TRACE("%p\n", query );
459 
460  view = query->view;
461  if( !view )
462  return ERROR_FUNCTION_FAILED;
463  if( !view->ops->close )
464  return ERROR_FUNCTION_FAILED;
465 
466  return view->ops->close( view );
467 }
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define TRACE(s)
Definition: solgame.cpp:4
struct view * view
static IOleDocumentView * view
Definition: activex.c:1749

Referenced by create_temp_property_table(), get_property(), msi_add_table_to_db(), msi_clone_properties(), msi_get_property_row(), MSI_IterateRecords(), MSI_QueryGetRecord(), msi_set_property(), msi_table_apply_transform(), MsiGetProductPropertyW(), MsiViewClose(), and TransformView_Create().

◆ MSI_ViewExecute()

UINT MSI_ViewExecute ( MSIQUERY query,
MSIRECORD rec 
)

Definition at line 502 of file msiquery.c.

503 {
504  MSIVIEW *view;
505 
506  TRACE("%p %p\n", query, rec);
507 
508  view = query->view;
509  if( !view )
510  return ERROR_FUNCTION_FAILED;
511  if( !view->ops->execute )
512  return ERROR_FUNCTION_FAILED;
513  query->row = 0;
514 
515  return view->ops->execute( view, rec );
516 }
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define TRACE(s)
Definition: solgame.cpp:4
struct view * view
static IOleDocumentView * view
Definition: activex.c:1749

Referenced by add_stream(), create_temp_property_table(), get_assembly_record(), get_property(), is_uninstallable(), load_file_hash(), load_folder_persistence(), mark_patched_components(), merge_diff_row(), msi_add_table_to_db(), msi_clone_properties(), msi_get_property_row(), MSI_IterateRecords(), MSI_QueryGetRecord(), msi_set_property(), msi_table_apply_transform(), MsiGetProductPropertyW(), MsiViewExecute(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), patch_set_media_source_prop(), patch_set_offsets(), patch_update_filepatch_sequence(), TransformView_add_column(), TransformView_Create(), TransformView_create_table(), TransformView_delete_row(), TransformView_drop_table(), TransformView_insert_row(), TransformView_set_row(), and update_merge_errors().

◆ MSI_ViewFetch()

UINT MSI_ViewFetch ( MSIQUERY query,
MSIRECORD **  prec 
)

Definition at line 377 of file msiquery.c.

378 {
379  MSIVIEW *view;
380  UINT r;
381 
382  TRACE("%p %p\n", query, prec );
383 
384  view = query->view;
385  if( !view )
386  return ERROR_FUNCTION_FAILED;
387 
388  r = msi_view_get_row(query->db, view, query->row, prec);
389  if (r == ERROR_SUCCESS)
390  {
391  query->row ++;
392  (*prec)->cookie = (UINT64)(ULONG_PTR)query;
393  MSI_RecordSetInteger(*prec, 0, 1);
394  }
395  else if (r == ERROR_NO_MORE_ITEMS)
396  {
397  /* end of view; reset cursor to first row */
398  query->row = 0;
399  }
400 
401  return r;
402 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec)
Definition: msiquery.c:353
uint32_t ULONG_PTR
Definition: typedefs.h:65
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int) DECLSPEC_HIDDEN
Definition: record.c:280
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define TRACE(s)
Definition: solgame.cpp:4
struct view * view
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
unsigned long long UINT64
GLenum query
Definition: glext.h:7781

Referenced by get_assembly_record(), get_property(), is_uninstallable(), load_file_hash(), load_folder_persistence(), merge_diff_row(), msi_add_records_to_table(), msi_clone_properties(), msi_get_property_row(), MSI_IterateRecords(), MSI_QueryGetRecord(), MsiGetProductPropertyW(), MsiViewFetch(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), patch_set_media_source_prop(), patch_set_offsets(), and TransformView_Create().

◆ MSI_ViewGetColumnInfo()

UINT MSI_ViewGetColumnInfo ( MSIQUERY query,
MSICOLINFO  info,
MSIRECORD **  prec 
)

Definition at line 603 of file msiquery.c.

604 {
606  MSIRECORD *rec;
607  MSIVIEW *view = query->view;
608  LPCWSTR name;
609  BOOL temporary;
610 
611  if( !view )
612  return ERROR_FUNCTION_FAILED;
613 
614  if( !view->ops->get_dimensions )
615  return ERROR_FUNCTION_FAILED;
616 
617  r = view->ops->get_dimensions( view, NULL, &count );
618  if( r != ERROR_SUCCESS )
619  return r;
620  if( !count )
622 
624  if( !rec )
625  return ERROR_FUNCTION_FAILED;
626 
627  for( i=0; i<count; i++ )
628  {
629  name = NULL;
630  r = view->ops->get_column_info( view, i+1, &name, &type, &temporary, NULL );
631  if( r != ERROR_SUCCESS )
632  continue;
633  if (info == MSICOLINFO_NAMES)
635  else
636  msi_set_record_type_string( rec, i+1, type, temporary );
637  }
638  *prec = rec;
639  return ERROR_SUCCESS;
640 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:597
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
unsigned int BOOL
Definition: ntddk_ex.h:94
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:76
static UINT msi_set_record_type_string(MSIRECORD *rec, UINT field, UINT type, BOOL temporary)
Definition: msiquery.c:567
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
struct view * view
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
Definition: name.c:38
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by get_key_value(), merge_verify_colnames(), MSI_DatabaseExport(), msi_get_query_columns(), msi_get_query_types(), and MsiViewGetColumnInfo().

◆ MSI_ViewModify()

UINT MSI_ViewModify ( MSIQUERY query,
MSIMODIFY  mode,
MSIRECORD rec 
)

Definition at line 698 of file msiquery.c.

699 {
700  MSIVIEW *view = NULL;
701  UINT r;
702 
703  if ( !query || !rec )
704  return ERROR_INVALID_HANDLE;
705 
706  view = query->view;
707  if ( !view || !view->ops->modify)
708  return ERROR_FUNCTION_FAILED;
709 
711  return ERROR_FUNCTION_FAILED;
712 
713  r = view->ops->modify( view, mode, rec, query->row - 1 );
714  if (mode == MSIMODIFY_DELETE && r == ERROR_SUCCESS)
715  query->row--;
716 
717  return r;
718 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
UINT64 cookie
Definition: msipriv.h:153
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
GLenum mode
Definition: glext.h:6217
struct view * view
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
unsigned long long UINT64

Referenced by msi_add_records_to_table(), MsiViewModify(), patch_set_offsets(), and patch_update_file_sequence().

◆ MsiDatabaseApplyTransformA()

UINT WINAPI MsiDatabaseApplyTransformA ( MSIHANDLE  hdb,
const char transform,
int  error_cond 
)

Definition at line 933 of file msiquery.c.

934 {
935  WCHAR *wstr;
936  UINT ret;
937 
938  TRACE( "%lu, %s, %#x\n", hdb, debugstr_a(transform), error_cond );
939 
940  wstr = strdupAtoW( transform );
941  if (transform && !wstr)
943 
944  ret = MsiDatabaseApplyTransformW( hdb, wstr, error_cond );
945  msi_free( wstr );
946  return ret;
947 }
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define TRACE(s)
Definition: solgame.cpp:4
UINT WINAPI MsiDatabaseApplyTransformW(MSIHANDLE hdb, const WCHAR *transform, int error_cond)
Definition: msiquery.c:918
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
int ret
unsigned int UINT
Definition: ndis.h:50
GLuint GLenum GLenum transform
Definition: glext.h:9407
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65

Referenced by test_invalid_functions(), and test_try_transform().

◆ MsiDatabaseApplyTransformW()

UINT WINAPI MsiDatabaseApplyTransformW ( MSIHANDLE  hdb,
const WCHAR transform,
int  error_cond 
)

Definition at line 918 of file msiquery.c.

919 {
920  MSIDATABASE *db;
921  UINT r;
922 
923  if (error_cond & ~MSITRANSFORM_ERROR_VIEWTRANSFORM) FIXME( "ignoring error conditions\n" );
924 
925  if (!(db = msihandle2msiinfo(hdb, MSIHANDLETYPE_DATABASE)))
926  return ERROR_INVALID_HANDLE;
927 
928  r = MSI_DatabaseApplyTransformW( db, transform, error_cond );
929  msiobj_release( &db->hdr );
930  return r;
931 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:722
#define FIXME(fmt,...)
Definition: debug.h:111
UINT MSI_DatabaseApplyTransformW(MSIDATABASE *db, const WCHAR *transform, int error_cond)
Definition: msiquery.c:878
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
unsigned int UINT
Definition: ndis.h:50
GLuint GLenum GLenum transform
Definition: glext.h:9407
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
MSIOBJECTHDR hdr
Definition: msipriv.h:108

Referenced by MsiDatabaseApplyTransformA().

◆ MsiDatabaseCommit()

UINT WINAPI MsiDatabaseCommit ( MSIHANDLE  hdb)

Definition at line 963 of file msiquery.c.

964 {
965  MSIDATABASE *db;
966  UINT r;
967 
968  TRACE( "%lu\n", hdb );
969 
971  if( !db )
972  {
973  MSIHANDLE remote;
974 
975  if (!(remote = msi_get_remote(hdb)))
976  return ERROR_INVALID_HANDLE;
977 
978  WARN("not allowed during a custom action!\n");
979 
980  return ERROR_SUCCESS;
981  }
982 
983  if (db->mode == MSI_OPEN_READONLY)
984  {
985  msiobj_release( &db->hdr );
986  return ERROR_SUCCESS;
987  }
988 
989  /* FIXME: lock the database */
990 
991  r = msi_commit_streams( db );
992  if (r != ERROR_SUCCESS) ERR("Failed to commit streams!\n");
993  else
994  {
995  r = MSI_CommitTables( db );
996  if (r != ERROR_SUCCESS) ERR("Failed to commit tables!\n");
997  }
998 
999  /* FIXME: unlock the database */
1000 
1001  msiobj_release( &db->hdr );
1002 
1003  if (r == ERROR_SUCCESS)
1004  {
1005  msi_free( db->deletefile );
1006  db->deletefile = NULL;
1007  }
1008 
1009  return r;
1010 }
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define WARN(fmt,...)
Definition: debug.h:112
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:722
unsigned long MSIHANDLE
Definition: winemsi.idl:24
#define MSI_OPEN_READONLY
Definition: msipriv.h:99
#define TRACE(s)
Definition: solgame.cpp:4
UINT msi_commit_streams(MSIDATABASE *db) DECLSPEC_HIDDEN
Definition: streams.c:607
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
UINT MSI_CommitTables(MSIDATABASE *db) DECLSPEC_HIDDEN
Definition: table.c:2887
#define ERR(fmt,...)
Definition: debug.h:110
LPWSTR deletefile
Definition: msipriv.h:113
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
MSIOBJECTHDR hdr
Definition: msipriv.h:108

Referenced by create_database(), create_database_wordcount(), create_db(), create_package_db(), generate_transform(), helper_createpackage(), set_admin_summary_info(), test_access(), test_binary(), test_costs(), test_createtable(), test_customaction1(), test_defaultdatabase(), test_deleterow(), test_emptypackage(), test_forcecodepage(), test_icon_table(), test_int_widths(), test_integers(), test_invalid_functions(), test_longstrings(), test_msibadqueries(), test_msidatabase(), test_MsiDatabaseCommit(), test_MsiGetProductProperty(), test_MsiGetSourcePath(), test_msiinsert(), test_MsiOpenDatabase(), test_shortlongsource(), test_states(), test_storages_table(), test_streamtable(), test_stringtable(), test_suminfo(), test_top_level_action(), test_try_transform(), and test_update().

◆ MsiDatabaseGenerateTransformA()

UINT WINAPI MsiDatabaseGenerateTransformA ( MSIHANDLE  hdb,
MSIHANDLE  hdbref,
const char szTransformFile,
int  iReserved1,
int  iReserved2 
)

Definition at line 949 of file msiquery.c.

951 {
952  FIXME( "%lu, %lu, %s, %d, %d\n", hdb, hdbref, debugstr_a(szTransformFile), iReserved1, iReserved2 );
954 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_a
Definition: kernel32.h:31
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

Referenced by generate_transform(), and test_invalid_functions().

◆ MsiDatabaseGenerateTransformW()

UINT WINAPI MsiDatabaseGenerateTransformW ( MSIHANDLE  hdb,
MSIHANDLE  hdbref,
const WCHAR szTransformFile,
int  iReserved1,
int  iReserved2 
)

Definition at line 956 of file msiquery.c.

958 {
959  FIXME( "%lu, %lu, %s, %d, %d\n", hdb, hdbref, debugstr_w(szTransformFile), iReserved1, iReserved2 );
961 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ MsiDatabaseGetPrimaryKeysA()

UINT WINAPI MsiDatabaseGetPrimaryKeysA ( MSIHANDLE  hdb,
const char table,
MSIHANDLE phRec 
)

Definition at line 1129 of file msiquery.c.

1130 {
1131  WCHAR *szwTable = NULL;
1132  UINT r;
1133 
1134  TRACE( "%lu, %s, %p\n", hdb, debugstr_a(table), phRec );
1135 
1136  if( table )
1137  {
1138  szwTable = strdupAtoW( table );
1139  if( !szwTable )
1140  return ERROR_OUTOFMEMORY;
1141  }
1142  r = MsiDatabaseGetPrimaryKeysW( hdb, szwTable, phRec );
1143  msi_free( szwTable );
1144 
1145  return r;
1146 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiDatabaseGetPrimaryKeysW(MSIHANDLE hdb, const WCHAR *table, MSIHANDLE *phRec)
Definition: msiquery.c:1080
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by test_db(), test_fieldzero(), and test_primary_keys().

◆ MsiDatabaseGetPrimaryKeysW()

UINT WINAPI MsiDatabaseGetPrimaryKeysW ( MSIHANDLE  hdb,
const WCHAR table,
MSIHANDLE phRec 
)

Definition at line 1080 of file msiquery.c.

1081 {
1082  MSIRECORD *rec = NULL;
1083  MSIDATABASE *db;
1084  UINT r;
1085 
1086  TRACE( "%lu, %s, %p\n", hdb, debugstr_w(table), phRec );
1087 
1089  if( !db )
1090  {
1091  struct wire_record *wire_rec = NULL;
1092  MSIHANDLE remote;
1093 
1094  if (!(remote = msi_get_remote(hdb)))
1095  return ERROR_INVALID_HANDLE;
1096 
1097  __TRY
1098  {
1099  r = remote_DatabaseGetPrimaryKeys(remote, table, &wire_rec);
1100  }
1102  {
1103  r = GetExceptionCode();
1104  }
1105  __ENDTRY
1106 
1107  if (!r)
1108  {
1109  r = unmarshal_record(wire_rec, phRec);
1110  free_remote_record(wire_rec);
1111  }
1112 
1113  return r;
1114  }
1115 
1116  r = MSI_DatabaseGetPrimaryKeys( db, table, &rec );
1117  if( r == ERROR_SUCCESS )
1118  {
1119  *phRec = alloc_msihandle( &rec->hdr );
1120  if (! *phRec)
1122  msiobj_release( &rec->hdr );
1123  }
1124  msiobj_release( &db->hdr );
1125 
1126  return r;
1127 }
#define __EXCEPT(func)
Definition: exception.h:84
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) DECLSPEC_HIDDEN
Definition: record.c:1095
MSIOBJECTHDR hdr
Definition: msipriv.h:151
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:722
UINT MSI_DatabaseGetPrimaryKeys(MSIDATABASE *db, LPCWSTR table, MSIRECORD **prec)
Definition: msiquery.c:1044
unsigned long MSIHANDLE
Definition: winemsi.idl:24
#define debugstr_w
Definition: kernel32.h:32
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
void free_remote_record(struct wire_record *rec) DECLSPEC_HIDDEN
Definition: record.c:1149
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define __ENDTRY
Definition: compat.h:82
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
MSIOBJECTHDR hdr
Definition: msipriv.h:108

Referenced by MsiDatabaseGetPrimaryKeysA(), and s_remote_DatabaseGetPrimaryKeys().

◆ MsiDatabaseIsTablePersistentA()

MSICONDITION WINAPI MsiDatabaseIsTablePersistentA ( MSIHANDLE  hDatabase,
const char szTableName 
)

Definition at line 1148 of file msiquery.c.

1149 {
1150  WCHAR *szwTableName = NULL;
1151  MSICONDITION r;
1152 
1153  TRACE( "%lu, %s\n", hDatabase, debugstr_a(szTableName) );
1154 
1155  if( szTableName )
1156  {
1157  szwTableName = strdupAtoW( szTableName );
1158  if( !szwTableName )
1159  return MSICONDITION_ERROR;
1160  }
1161  r = MsiDatabaseIsTablePersistentW( hDatabase, szwTableName );
1162  msi_free( szwTableName );
1163 
1164  return r;
1165 }
MSICONDITION WINAPI MsiDatabaseIsTablePersistentW(MSIHANDLE hDatabase, const WCHAR *szTableName)
Definition: msiquery.c:1167
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
int MSICONDITION
Definition: winemsi.idl:29
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
#define NULL
Definition: types.h:112
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65

Referenced by test_alter(), test_db(), test_emptypackage(), and test_temporary_table().

◆ MsiDatabaseIsTablePersistentW()

MSICONDITION WINAPI MsiDatabaseIsTablePersistentW ( MSIHANDLE  hDatabase,
const WCHAR szTableName 
)

Definition at line 1167 of file msiquery.c.

1168 {
1169  MSIDATABASE *db;
1170  MSICONDITION r;
1171 
1172  TRACE( "%lu, %s\n", hDatabase, debugstr_w(szTableName) );
1173 
1174  db = msihandle2msiinfo( hDatabase, MSIHANDLETYPE_DATABASE );
1175  if( !db )
1176  {
1177  MSIHANDLE remote;
1178 
1179  if (!(remote = msi_get_remote(hDatabase)))
1180  return MSICONDITION_ERROR;
1181 
1182  __TRY
1183  {
1184  r = remote_DatabaseIsTablePersistent(remote, szTableName);
1185  }
1187  {
1189  }
1190  __ENDTRY
1191 
1192  return r;
1193  }
1194 
1195  r = MSI_DatabaseIsTablePersistent( db, szTableName );
1196 
1197  msiobj_release( &db->hdr );
1198 
1199  return r;
1200 }
#define __EXCEPT(func)
Definition: exception.h:84
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
int MSICONDITION
Definition: winemsi.idl:29
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:722
unsigned long MSIHANDLE
Definition: winemsi.idl:24
#define debugstr_w
Definition: kernel32.h:32
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
MSICONDITION MSI_DatabaseIsTablePersistent(MSIDATABASE *db, LPCWSTR table) DECLSPEC_HIDDEN
Definition: table.c:2922
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define __ENDTRY
Definition: compat.h:82
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
MSIOBJECTHDR hdr
Definition: msipriv.h:108

Referenced by MsiDatabaseIsTablePersistentA(), and s_remote_DatabaseIsTablePersistent().

◆ MsiDatabaseOpenViewA()

UINT WINAPI MsiDatabaseOpenViewA ( MSIHANDLE  hdb,
const char szQuery,
MSIHANDLE phView 
)

Definition at line 88 of file msiquery.c.

89 {
90  UINT r;
91  WCHAR *szwQuery;
92 
93  TRACE( "%lu, %s, %p\n", hdb, debugstr_a(szQuery), phView );
94 
95  if( szQuery )
96  {
97  szwQuery = strdupAtoW( szQuery );
98  if( !szwQuery )
99  return ERROR_FUNCTION_FAILED;
100  }
101  else
102  szwQuery = NULL;
103 
104  r = MsiDatabaseOpenViewW( hdb, szwQuery, phView);
105 
106  msi_free( szwQuery );
107  return r;
108 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
UINT WINAPI MsiDatabaseOpenViewW(MSIHANDLE hdb, LPCWSTR szQuery, MSIHANDLE *phView)
Definition: msiquery.c:236
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65

Referenced by do_query(), find_entry(), find_prop_in_property(), get_column_info(), get_columns_table_type(), get_integer(), get_string(), run_query(), test_carriagereturn(), test_collation(), test_columnorder(), test_createtable(), test_db(), test_dbmerge(), test_deleterow(), test_droptable(), test_emptypackage(), test_fieldzero(), test_getcolinfo(), test_handle_limit(), test_insertorder(), test_integers(), test_join(), test_longstrings(), test_msiexport(), test_msiimport(), test_msiinsert(), test_noquotes(), test_order(), test_packagecoltypes(), test_quotes(), test_rows_order(), test_select_column_names(), test_select_markers(), test_select_with_tablenames(), test_simple_patch(), test_storages_table(), test_streamtable(), test_stringtable(), test_suminfo_import(), test_system_tables(), test_tables_order(), test_temporary_table(), test_try_transform(), test_update(), test_view_get_error(), test_viewfetch_wraparound(), test_viewmodify(), test_viewmodify_assign(), test_viewmodify_delete(), test_viewmodify_delete_temporary(), test_viewmodify_insert(), test_viewmodify_merge(), test_viewmodify_refresh(), test_viewmodify_update(), test_where(), test_where_not_in_selected(), test_where_viewmodify(), and try_query_param().

◆ MsiDatabaseOpenViewW()

UINT WINAPI MsiDatabaseOpenViewW ( MSIHANDLE  hdb,
LPCWSTR  szQuery,
MSIHANDLE phView 
)

Definition at line 236 of file msiquery.c.

238 {
239  MSIDATABASE *db;
240  MSIQUERY *query = NULL;
241  UINT ret;
242 
243  TRACE("%s %p\n", debugstr_w(szQuery), phView);
244 
245  if (!phView)
247 
248  if (!szQuery)
249  return ERROR_BAD_QUERY_SYNTAX;
250 
252  if( !db )
253  {
254  MSIHANDLE remote, remote_view;
255 
256  if (!(remote = msi_get_remote(hdb)))
257  return ERROR_INVALID_HANDLE;
258 
259  __TRY
260  {
261  ret = remote_DatabaseOpenView(remote, szQuery, &remote_view);
262  }
264  {
265  ret = GetExceptionCode();
266  }
267  __ENDTRY
268 
269  if (!ret)
270  *phView = alloc_msi_remote_handle(remote_view);
271  return ret;
272  }
273 
274  ret = MSI_DatabaseOpenViewW( db, szQuery, &query );
275  if( ret == ERROR_SUCCESS )
276  {
277  *phView = alloc_msihandle( &query->hdr );
278  if (! *phView)
280  msiobj_release( &query->hdr );
281  }
282  msiobj_release( &db->hdr );
283 
284  return ret;
285 }
#define __EXCEPT(func)
Definition: exception.h:84
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:722
unsigned long MSIHANDLE
Definition: winemsi.idl:24
#define debugstr_w
Definition: kernel32.h:32
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define __ENDTRY
Definition: compat.h:82
int ret
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
UINT MSI_DatabaseOpenViewW(MSIDATABASE *db, const WCHAR *szQuery, MSIQUERY **pView)
Definition: msiquery.c:110
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
MSIOBJECTHDR hdr
Definition: msipriv.h:108
#define ERROR_BAD_QUERY_SYNTAX
Definition: winerror.h:973
MSIHANDLE alloc_msi_remote_handle(MSIHANDLE remote)
Definition: handle.c:135

Referenced by database_invoke(), find_entryW(), MsiDatabaseOpenViewA(), run_queryW(), s_remote_DatabaseOpenView(), and test_collation().

◆ MsiGetLastErrorRecord()

MSIHANDLE WINAPI MsiGetLastErrorRecord ( void  )

Definition at line 872 of file msiquery.c.

873 {
874  FIXME("\n");
875  return 0;
876 }
#define FIXME(fmt,...)
Definition: debug.h:111

◆ MsiViewClose()

UINT WINAPI MsiViewClose ( MSIHANDLE  hView)

Definition at line 469 of file msiquery.c.

470 {
471  MSIQUERY *query;
472  UINT ret;
473 
474  TRACE( "%lu\n", hView );
475 
477  if (!query)
478  {
479  MSIHANDLE remote;
480 
481  if (!(remote = msi_get_remote(hView)))
482  return ERROR_INVALID_HANDLE;
483 
484  __TRY
485  {
486  ret = remote_ViewClose(remote);
487  }
489  {
490  ret = GetExceptionCode();
491  }
492  __ENDTRY
493 
494  return ret;
495  }
496 
497  ret = MSI_ViewClose( query );
498  msiobj_release( &query->hdr );
499  return ret;
500 }
#define __EXCEPT(func)
Definition: exception.h:84
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
unsigned long MSIHANDLE
Definition: winemsi.idl:24
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define MSIHANDLETYPE_VIEW
Definition: msipriv.h:724
#define __ENDTRY
Definition: compat.h:82
int ret
unsigned int UINT
Definition: ndis.h:50
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
GLenum query
Definition: glext.h:7781
UINT MSI_ViewClose(MSIQUERY *query)
Definition: msiquery.c:454

Referenced by do_query(), find_entry(), find_entryW(), find_prop_in_property(), get_column_info(), get_columns_table_type(), get_integer(), get_string(), run_query(), run_queryW(), s_remote_ViewClose(), test_carriagereturn(), test_collation(), test_columnorder(), test_createtable(), test_db(), test_dbmerge(), test_deleterow(), test_droptable(), test_emptypackage(), test_fieldzero(), test_getcolinfo(), test_handle_limit(), test_insertorder(), test_integers(), test_join(), test_longstrings(), test_msiexport(), test_msiimport(), test_msiinsert(), test_noquotes(), test_order(), test_quotes(), test_rows_order(), test_select_column_names(), test_select_markers(), test_select_with_tablenames(), test_simple_patch(), test_storages_table(), test_streamtable(), test_stringtable(), test_system_tables(), test_tables_order(), test_temporary_table(), test_try_transform(), test_update(), test_viewfetch_wraparound(), test_viewmodify(), test_viewmodify_assign(), test_viewmodify_delete(), test_viewmodify_delete_temporary(), test_viewmodify_refresh(), test_viewmodify_update(), test_where(), test_where_not_in_selected(), test_where_viewmodify(), try_query_param(), and view_invoke().

◆ MsiViewExecute()

UINT WINAPI MsiViewExecute ( MSIHANDLE  hView,
MSIHANDLE  hRec 
)

Definition at line 518 of file msiquery.c.

519 {
520  MSIQUERY *query;
521  MSIRECORD *rec = NULL;
522  UINT ret;
523 
524  TRACE( "%lu, %lu\n", hView, hRec );
525 
526  if( hRec )
527  {
529  if( !rec )
530  return ERROR_INVALID_HANDLE;
531  }
532 
534  if( !query )
535  {
536  MSIHANDLE remote;
537 
538  if (!(remote = msi_get_remote(hView)))
539  return ERROR_INVALID_HANDLE;
540 
541  __TRY
542  {
543  ret = remote_ViewExecute(remote, rec ? (struct wire_record *)&rec->count : NULL);
544  }
546  {
547  ret = GetExceptionCode();
548  }
549  __ENDTRY
550 
551  if (rec)
552  msiobj_release(&rec->hdr);
553  return ret;
554  }
555 
556  msiobj_lock( &rec->hdr );
557  ret = MSI_ViewExecute( query, rec );
558  msiobj_unlock( &rec->hdr );
559 
560  msiobj_release( &query->hdr );
561  if( rec )
562  msiobj_release( &rec->hdr );
563 
564  return ret;
565 }
#define __EXCEPT(func)
Definition: exception.h:84
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:231
MSIOBJECTHDR hdr
Definition: msipriv.h:151
UINT MSI_ViewExecute(MSIQUERY *query, MSIRECORD *rec)
Definition: msiquery.c:502
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:236
unsigned long MSIHANDLE
Definition: winemsi.idl:24
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:725
UINT count
Definition: msipriv.h:152
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define MSIHANDLETYPE_VIEW
Definition: msipriv.h:724
#define __ENDTRY
Definition: compat.h:82
int ret
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
GLenum query
Definition: glext.h:7781

Referenced by do_query(), find_entry(), find_entryW(), find_prop_in_property(), get_column_info(), get_columns_table_type(), get_integer(), get_string(), run_query(), run_queryW(), s_remote_ViewExecute(), test_carriagereturn(), test_collation(), test_columnorder(), test_createtable(), test_db(), test_dbmerge(), test_deleterow(), test_droptable(), test_emptypackage(), test_fieldzero(), test_getcolinfo(), test_insertorder(), test_integers(), test_join(), test_longstrings(), test_msiexport(), test_msiimport(), test_msiinsert(), test_noquotes(), test_order(), test_quotes(), test_rows_order(), test_select_column_names(), test_select_markers(), test_select_with_tablenames(), test_simple_patch(), test_storages_table(), test_streamtable(), test_stringtable(), test_system_tables(), test_tables_order(), test_try_transform(), test_update(), test_view_get_error(), test_viewfetch_wraparound(), test_viewmodify(), test_viewmodify_assign(), test_viewmodify_delete(), test_viewmodify_delete_temporary(), test_viewmodify_insert(), test_viewmodify_merge(), test_viewmodify_refresh(), test_viewmodify_update(), test_where(), test_where_not_in_selected(), test_where_viewmodify(), try_query_param(), and view_invoke().

◆ MsiViewFetch()

UINT WINAPI MsiViewFetch ( MSIHANDLE  hView,
MSIHANDLE record 
)

Definition at line 404 of file msiquery.c.

405 {
406  MSIQUERY *query;
407  MSIRECORD *rec = NULL;
408  UINT ret;
409 
410  TRACE( "%lu, %p\n", hView, record );
411 
412  if( !record )
414  *record = 0;
415 
417  if (!query)
418  {
419  struct wire_record *wire_rec = NULL;
420  MSIHANDLE remote;
421 
422  if (!(remote = msi_get_remote(hView)))
423  return ERROR_INVALID_HANDLE;
424 
425  __TRY
426  {
427  ret = remote_ViewFetch(remote, &wire_rec);
428  }
430  {
431  ret = GetExceptionCode();
432  }
433  __ENDTRY
434 
435  if (!ret)
436  {
437  ret = unmarshal_record(wire_rec, record);
438  free_remote_record(wire_rec);
439  }
440  return ret;
441  }
442  ret = MSI_ViewFetch( query, &rec );
443  if( ret == ERROR_SUCCESS )
444  {
445  *record = alloc_msihandle( &rec->hdr );
446  if (! *record)
448  msiobj_release( &rec->hdr );
449  }
450  msiobj_release( &query->hdr );
451  return ret;
452 }
#define __EXCEPT(func)
Definition: exception.h:84
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) DECLSPEC_HIDDEN
Definition: record.c:1095
MSIOBJECTHDR hdr
Definition: msipriv.h:151
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
unsigned long MSIHANDLE
Definition: winemsi.idl:24
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
void free_remote_record(struct wire_record *rec) DECLSPEC_HIDDEN
Definition: record.c:1149
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define MSIHANDLETYPE_VIEW
Definition: msipriv.h:724
#define __ENDTRY
Definition: compat.h:82
int ret
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
UINT MSI_ViewFetch(MSIQUERY *query, MSIRECORD **prec)
Definition: msiquery.c:377
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
GLenum query
Definition: glext.h:7781

Referenced by do_query(), find_entry(), find_entryW(), find_prop_in_property(), get_columns_table_type(), get_integer(), get_string(), s_remote_ViewFetch(), test_carriagereturn(), test_collation(), test_columnorder(), test_db(), test_dbmerge(), test_deleterow(), test_droptable(), test_emptypackage(), test_fieldzero(), test_insertorder(), test_join(), test_longstrings(), test_msiimport(), test_msiinsert(), test_noquotes(), test_order(), test_quotes(), test_rows_order(), test_select_column_names(), test_select_markers(), test_select_with_tablenames(), test_simple_patch(), test_storages_table(), test_streamtable(), test_stringtable(), test_system_tables(), test_tables_order(), test_try_transform(), test_update(), test_viewfetch_wraparound(), test_viewmodify(), test_viewmodify_assign(), test_viewmodify_delete(), test_viewmodify_delete_temporary(), test_viewmodify_insert(), test_viewmodify_merge(), test_viewmodify_refresh(), test_viewmodify_update(), test_where(), test_where_not_in_selected(), test_where_viewmodify(), and view_invoke().

◆ MsiViewGetColumnInfo()

UINT WINAPI MsiViewGetColumnInfo ( MSIHANDLE  hView,
MSICOLINFO  info,
MSIHANDLE hRec 
)

Definition at line 642 of file msiquery.c.

643 {
644  MSIQUERY *query = NULL;
645  MSIRECORD *rec = NULL;
646  UINT r;
647 
648  TRACE( "%lu, %d, %p\n", hView, info, hRec );
649 
650  if( !hRec )
652 
655 
657  if (!query)
658  {
659  struct wire_record *wire_rec = NULL;
660  MSIHANDLE remote;
661 
662  if (!(remote = msi_get_remote(hView)))
663  return ERROR_INVALID_HANDLE;
664 
665  __TRY
666  {
667  r = remote_ViewGetColumnInfo(remote, info, &wire_rec);
668  }
670  {
671  r = GetExceptionCode();
672  }
673  __ENDTRY
674 
675  if (!r)
676  {
677  r = unmarshal_record(wire_rec, hRec);
678  free_remote_record(wire_rec);
679  }
680 
681  return r;
682  }
683 
684  r = MSI_ViewGetColumnInfo( query, info, &rec );
685  if ( r == ERROR_SUCCESS )
686  {
687  *hRec = alloc_msihandle( &rec->hdr );
688  if ( !*hRec )
690  msiobj_release( &rec->hdr );
691  }
692 
693  msiobj_release( &query->hdr );
694 
695  return r;
696 }
#define __EXCEPT(func)
Definition: exception.h:84
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) DECLSPEC_HIDDEN
Definition: record.c:1095
MSIOBJECTHDR hdr
Definition: msipriv.h:151
UINT MSI_ViewGetColumnInfo(MSIQUERY *query, MSICOLINFO info, MSIRECORD **prec)
Definition: msiquery.c:603
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
unsigned long MSIHANDLE
Definition: winemsi.idl:24
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
void free_remote_record(struct wire_record *rec) DECLSPEC_HIDDEN
Definition: record.c:1149
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define MSIHANDLETYPE_VIEW
Definition: msipriv.h:724
#define __ENDTRY
Definition: compat.h:82
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158

Referenced by get_column_info(), s_remote_ViewGetColumnInfo(), test_columnorder(), test_createtable(), test_db(), test_dbmerge(), test_getcolinfo(), test_integers(), test_msiimport(), test_packagecoltypes(), test_select_column_names(), test_temporary_table(), and test_try_transform().

◆ MsiViewGetErrorA()

MSIDBERROR WINAPI MsiViewGetErrorA ( MSIHANDLE  handle,
char buffer,
DWORD buflen 
)

Definition at line 821 of file msiquery.c.

822 {
823  MSIQUERY *query;
824  const WCHAR *column;
825  MSIDBERROR r;
826 
827  TRACE( "%lu, %p, %p\n", handle, buffer, buflen );
828 
829  if (!buflen)
830  return MSIDBERROR_INVALIDARG;
831 
833  {
834  WCHAR *remote_column = NULL;
835  MSIHANDLE remote;
836 
837  if (!(remote = msi_get_remote(handle)))
838  return MSIDBERROR_INVALIDARG;
839 
840  if (!*buflen)
842 
843  __TRY
844  {
845  r = remote_ViewGetError(remote, &remote_column);
846  }
848  {
849  r = GetExceptionCode();
850  }
851  __ENDTRY;
852 
853  if (msi_strncpyWtoA(remote_column ? remote_column : L"", -1, buffer, buflen, FALSE) == ERROR_MORE_DATA)
855 
856  if (remote_column)
857  midl_user_free(remote_column);
858 
859  return r;
860  }
861 
862  if ((r = query->view->error)) column = query->view->error_column;
863  else column = L"";
864 
865  if (msi_strncpyWtoA(column, -1, buffer, buflen, FALSE) == ERROR_MORE_DATA)
867 
868  msiobj_release( &query->hdr );
869  return r;
870 }
#define __EXCEPT(func)
Definition: exception.h:84
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
#define midl_user_free
Definition: rpc.h:45
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint buffer
Definition: glext.h:5915
UINT msi_strncpyWtoA(const WCHAR *str, int lenW, char *buf, DWORD *sz, BOOL remote)
Definition: install.c:190
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
unsigned long MSIHANDLE
Definition: winemsi.idl:24
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define MSIHANDLETYPE_VIEW
Definition: msipriv.h:724
#define __ENDTRY
Definition: compat.h:82
int MSIDBERROR
Definition: winemsi.idl:35
#define ERROR_MORE_DATA
Definition: dderror.h:13
struct view * view
#define NULL
Definition: types.h:112
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
GLenum query
Definition: glext.h:7781

Referenced by test_view_get_error(), and test_viewmodify().

◆ MsiViewGetErrorW()

MSIDBERROR WINAPI MsiViewGetErrorW ( MSIHANDLE  handle,
WCHAR buffer,
DWORD buflen 
)

Definition at line 770 of file msiquery.c.

771 {
772  MSIQUERY *query;
773  const WCHAR *column;
774  MSIDBERROR r;
775 
776  TRACE( "%lu, %p, %p\n", handle, buffer, buflen );
777 
778  if (!buflen)
779  return MSIDBERROR_INVALIDARG;
780 
782  {
783  WCHAR *remote_column = NULL;
784  MSIHANDLE remote;
785 
786  if (!(remote = msi_get_remote(handle)))
787  return MSIDBERROR_INVALIDARG;
788 
789  if (!*buflen)
791 
792  __TRY
793  {
794  r = remote_ViewGetError(remote, &remote_column);
795  }
797  {
798  r = GetExceptionCode();
799  }
800  __ENDTRY;
801 
802  if (msi_strncpyW(remote_column ? remote_column : L"", -1, buffer, buflen) == ERROR_MORE_DATA)
804 
805  if (remote_column)
806  midl_user_free(remote_column);
807 
808  return r;
809  }
810 
811  if ((r = query->view->error)) column = query->view->error_column;
812  else column = L"";
813 
814  if (msi_strncpyW(column, -1, buffer, buflen) == ERROR_MORE_DATA)
816 
817  msiobj_release( &query->hdr );
818  return r;
819 }
#define __EXCEPT(func)
Definition: exception.h:84
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
#define midl_user_free
Definition: rpc.h:45
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint buffer
Definition: glext.h:5915
UINT msi_strncpyW(const WCHAR *str, int len, WCHAR *buf, DWORD *sz)
Definition: install.c:213
#define L(x)
Definition: ntvdm.h:50
unsigned long MSIHANDLE
Definition: winemsi.idl:24
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define MSIHANDLETYPE_VIEW
Definition: msipriv.h:724
#define __ENDTRY
Definition: compat.h:82
int MSIDBERROR
Definition: winemsi.idl:35
#define ERROR_MORE_DATA
Definition: dderror.h:13
struct view * view
#define NULL
Definition: types.h:112
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
GLenum query
Definition: glext.h:7781

Referenced by s_remote_ViewGetError().

◆ MsiViewModify()

UINT WINAPI MsiViewModify ( MSIHANDLE  hView,
MSIMODIFY  eModifyMode,
MSIHANDLE  hRecord 
)

Definition at line 720 of file msiquery.c.

721 {
722  MSIQUERY *query = NULL;
723  MSIRECORD *rec = NULL;
725 
726  TRACE( "%lu, %#x, %lu\n", hView, eModifyMode, hRecord );
727 
728  rec = msihandle2msiinfo( hRecord, MSIHANDLETYPE_RECORD );
729 
730  if (!rec)
731  return ERROR_INVALID_HANDLE;
732 
734  if (!query)
735  {
736  struct wire_record *wire_refreshed = NULL;
737  MSIHANDLE remote;
738 
739  if (!(remote = msi_get_remote(hView)))
740  return ERROR_INVALID_HANDLE;
741 
742  __TRY
743  {
744  r = remote_ViewModify(remote, eModifyMode,
745  (struct wire_record *)&rec->count, &wire_refreshed);
746  }
748  {
749  r = GetExceptionCode();
750  }
751  __ENDTRY
752 
753  if (!r && (eModifyMode == MSIMODIFY_REFRESH || eModifyMode == MSIMODIFY_SEEK))
754  {
755  r = copy_remote_record(wire_refreshed, hRecord);
756  free_remote_record(wire_refreshed);
757  }
758 
759  msiobj_release(&rec->hdr);
760  return r;
761  }
762 
763  r = MSI_ViewModify( query, eModifyMode, rec );
764 
765  msiobj_release( &query->hdr );
766  msiobj_release(&rec->hdr);
767  return r;
768 }
#define __EXCEPT(func)
Definition: exception.h:84
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
UINT copy_remote_record(const struct wire_record *rec, MSIHANDLE handle) DECLSPEC_HIDDEN
Definition: record.c:1052
MSIOBJECTHDR hdr
Definition: msipriv.h:151
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT MSI_ViewModify(MSIQUERY *query, MSIMODIFY mode, MSIRECORD *rec)
Definition: msiquery.c:698
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
unsigned long MSIHANDLE
Definition: winemsi.idl:24
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
void free_remote_record(struct wire_record *rec) DECLSPEC_HIDDEN
Definition: record.c:1149
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:725
UINT count
Definition: msipriv.h:152
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define MSIHANDLETYPE_VIEW
Definition: msipriv.h:724
#define __ENDTRY
Definition: compat.h:82
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158

Referenced by s_remote_ViewModify(), test_db(), test_join(), test_stringtable(), test_view_get_error(), test_viewmodify(), test_viewmodify_assign(), test_viewmodify_delete(), test_viewmodify_delete_temporary(), test_viewmodify_insert(), test_viewmodify_merge(), test_viewmodify_refresh(), test_viewmodify_update(), test_where_viewmodify(), and view_invoke().

◆ s_remote_ViewClose()

UINT __cdecl s_remote_ViewClose ( MSIHANDLE  view)

Definition at line 1202 of file msiquery.c.

1203 {
1204  return MsiViewClose(view);
1205 }
UINT WINAPI MsiViewClose(MSIHANDLE hView)
Definition: msiquery.c:469

◆ s_remote_ViewExecute()

UINT __cdecl s_remote_ViewExecute ( MSIHANDLE  view,
struct wire_record remote_rec 
)

Definition at line 1207 of file msiquery.c.

1208 {
1209  MSIHANDLE rec = 0;
1210  UINT r;
1211 
1212  if ((r = unmarshal_record(remote_rec, &rec)))
1213  return r;
1214 
1215  r = MsiViewExecute(view, rec);
1216 
1217  MsiCloseHandle(rec);
1218  return r;
1219 }
UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec)
Definition: msiquery.c:518
UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) DECLSPEC_HIDDEN
Definition: record.c:1095
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
unsigned long MSIHANDLE
Definition: winemsi.idl:24
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
unsigned int UINT
Definition: ndis.h:50

◆ s_remote_ViewFetch()

UINT __cdecl s_remote_ViewFetch ( MSIHANDLE  view,
struct wire_record **  rec 
)

Definition at line 1221 of file msiquery.c.

1222 {
1223  MSIHANDLE handle;
1224  UINT r = MsiViewFetch(view, &handle);
1225  *rec = NULL;
1226  if (!r)
1227  *rec = marshal_record(handle);
1229  return r;
1230 }
struct wire_record * marshal_record(MSIHANDLE handle) DECLSPEC_HIDDEN
Definition: record.c:1109
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
unsigned long MSIHANDLE
Definition: winemsi.idl:24
UINT WINAPI MsiViewFetch(MSIHANDLE hView, MSIHANDLE *record)
Definition: msiquery.c:404
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112

◆ s_remote_ViewGetColumnInfo()

UINT __cdecl s_remote_ViewGetColumnInfo ( MSIHANDLE  view,
MSICOLINFO  info,
struct wire_record **  rec 
)

Definition at line 1232 of file msiquery.c.

1233 {
1234  MSIHANDLE handle;
1236  *rec = NULL;
1237  if (!r)
1238  *rec = marshal_record(handle);
1240  return r;
1241 }
struct wire_record * marshal_record(MSIHANDLE handle) DECLSPEC_HIDDEN
Definition: record.c:1109
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
unsigned long MSIHANDLE
Definition: winemsi.idl:24
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
UINT WINAPI MsiViewGetColumnInfo(MSIHANDLE hView, MSICOLINFO info, MSIHANDLE *hRec)
Definition: msiquery.c:642

◆ s_remote_ViewGetError()

MSIDBERROR __cdecl s_remote_ViewGetError ( MSIHANDLE  view,
LPWSTR column 
)

Definition at line 1243 of file msiquery.c.

1244 {
1245  WCHAR empty[1];
1246  DWORD size = 1;
1247  UINT r;
1248 
1250  if (r == MSIDBERROR_MOREDATA)
1251  {
1252  if (!(*column = midl_user_allocate(++size * sizeof(WCHAR))))
1253  return MSIDBERROR_FUNCTIONERROR;
1255  }
1256  return r;
1257 }
#define midl_user_allocate
Definition: rpc.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned int UINT
Definition: ndis.h:50
BOOL empty
Definition: button.c:170
MSIDBERROR WINAPI MsiViewGetErrorW(MSIHANDLE handle, WCHAR *buffer, DWORD *buflen)
Definition: msiquery.c:770

◆ s_remote_ViewModify()

UINT __cdecl s_remote_ViewModify ( MSIHANDLE  view,
MSIMODIFY  mode,
struct wire_record remote_rec,
struct wire_record **  remote_refreshed 
)

Definition at line 1259 of file msiquery.c.

1261 {
1262  MSIHANDLE handle = 0;
1263  UINT r;
1264 
1265  if ((r = unmarshal_record(remote_rec, &handle)))
1266  return r;
1267 
1269  *remote_refreshed = NULL;
1270  if (!r && (mode == MSIMODIFY_REFRESH || mode == MSIMODIFY_SEEK))
1271  *remote_refreshed = marshal_record(handle);
1272 
1274  return r;
1275 }
struct wire_record * marshal_record(MSIHANDLE handle) DECLSPEC_HIDDEN
Definition: record.c:1109
UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) DECLSPEC_HIDDEN
Definition: record.c:1095
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiViewModify(MSIHANDLE hView, MSIMODIFY eModifyMode, MSIHANDLE hRecord)
Definition: msiquery.c:720
unsigned long MSIHANDLE
Definition: winemsi.idl:24
GLenum mode
Definition: glext.h:6217
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112

◆ VIEW_find_column()

UINT VIEW_find_column ( MSIVIEW table,
LPCWSTR  name,
LPCWSTR  table_name,
UINT n 
)

Definition at line 59 of file msiquery.c.

60 {
61  LPCWSTR col_name, haystack_table_name;
62  UINT i, count, r;
63 
64  r = table->ops->get_dimensions( table, NULL, &count );
65  if( r != ERROR_SUCCESS )
66  return r;
67 
68  for( i=1; i<=count; i++ )
69  {
70  INT x;
71 
72  r = table->ops->get_column_info( table, i, &col_name, NULL,
73  NULL, &haystack_table_name );
74  if( r != ERROR_SUCCESS )
75  return r;
76  x = wcscmp( name, col_name );
77  if( table_name )
78  x |= wcscmp( table_name, haystack_table_name );
79  if( !x )
80  {
81  *n = i;
82  return ERROR_SUCCESS;
83  }
84  }
86 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble n
Definition: glext.h:7729
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
int32_t INT
Definition: typedefs.h:58
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
Definition: name.c:38

Referenced by SELECT_AddColumn().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msi  )