ReactOS  0.4.14-dev-41-g31d7680
record.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "msi.h"
#include "msiquery.h"
#include "msipriv.h"
#include "objidl.h"
#include "winnls.h"
#include "ole2.h"
#include "winreg.h"
#include "shlwapi.h"
#include "query.h"
Include dependency graph for record.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define MSIFIELD_NULL   0
 
#define MSIFIELD_INT   1
 
#define MSIFIELD_WSTR   3
 
#define MSIFIELD_STREAM   4
 
#define MSIFIELD_INTPTR   5
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msidb)
 
static void MSI_FreeField (MSIFIELD *field)
 
void MSI_CloseRecord (MSIOBJECTHDR *arg)
 
MSIRECORDMSI_CreateRecord (UINT cParams)
 
MSIHANDLE WINAPI MsiCreateRecord (UINT cParams)
 
UINT MSI_RecordGetFieldCount (const MSIRECORD *rec)
 
UINT WINAPI MsiRecordGetFieldCount (MSIHANDLE handle)
 
static BOOL string2intW (LPCWSTR str, int *out)
 
WCHARmsi_strdupW (const WCHAR *value, int len)
 
UINT MSI_RecordCopyField (MSIRECORD *in_rec, UINT in_n, MSIRECORD *out_rec, UINT out_n)
 
INT_PTR MSI_RecordGetIntPtr (MSIRECORD *rec, UINT iField)
 
int MSI_RecordGetInteger (MSIRECORD *rec, UINT iField)
 
int WINAPI MsiRecordGetInteger (MSIHANDLE handle, UINT iField)
 
UINT WINAPI MsiRecordClearData (MSIHANDLE handle)
 
UINT MSI_RecordSetIntPtr (MSIRECORD *rec, UINT iField, INT_PTR pVal)
 
UINT MSI_RecordSetInteger (MSIRECORD *rec, UINT iField, int iVal)
 
UINT WINAPI MsiRecordSetInteger (MSIHANDLE handle, UINT iField, int iVal)
 
BOOL MSI_RecordIsNull (MSIRECORD *rec, UINT iField)
 
BOOL WINAPI MsiRecordIsNull (MSIHANDLE handle, UINT iField)
 
UINT MSI_RecordGetStringA (MSIRECORD *rec, UINT iField, LPSTR szValue, LPDWORD pcchValue)
 
UINT WINAPI MsiRecordGetStringA (MSIHANDLE handle, UINT iField, LPSTR szValue, LPDWORD pcchValue)
 
const WCHARmsi_record_get_string (const MSIRECORD *rec, UINT field, int *len)
 
const WCHARMSI_RecordGetString (const MSIRECORD *rec, UINT iField)
 
UINT MSI_RecordGetStringW (MSIRECORD *rec, UINT iField, LPWSTR szValue, LPDWORD pcchValue)
 
UINT WINAPI MsiRecordGetStringW (MSIHANDLE handle, UINT iField, LPWSTR szValue, LPDWORD pcchValue)
 
static UINT msi_get_stream_size (IStream *stm)
 
static UINT MSI_RecordDataSize (MSIRECORD *rec, UINT iField)
 
UINT WINAPI MsiRecordDataSize (MSIHANDLE handle, UINT iField)
 
UINT WINAPI MsiRecordSetStringA (MSIHANDLE handle, UINT iField, LPCSTR szValue)
 
UINT msi_record_set_string (MSIRECORD *rec, UINT field, const WCHAR *value, int len)
 
UINT MSI_RecordSetStringW (MSIRECORD *rec, UINT iField, LPCWSTR szValue)
 
UINT WINAPI MsiRecordSetStringW (MSIHANDLE handle, UINT iField, LPCWSTR szValue)
 
static UINT RECORD_StreamFromFile (LPCWSTR szFile, IStream **pstm)
 
UINT MSI_RecordSetStream (MSIRECORD *rec, UINT iField, IStream *stream)
 
UINT MSI_RecordSetStreamFromFileW (MSIRECORD *rec, UINT iField, LPCWSTR szFilename)
 
UINT WINAPI MsiRecordSetStreamA (MSIHANDLE hRecord, UINT iField, LPCSTR szFilename)
 
UINT WINAPI MsiRecordSetStreamW (MSIHANDLE handle, UINT iField, LPCWSTR szFilename)
 
UINT MSI_RecordReadStream (MSIRECORD *rec, UINT iField, char *buf, LPDWORD sz)
 
UINT WINAPI MsiRecordReadStream (MSIHANDLE handle, UINT iField, char *buf, LPDWORD sz)
 
UINT MSI_RecordSetIStream (MSIRECORD *rec, UINT iField, IStream *stm)
 
UINT MSI_RecordGetIStream (MSIRECORD *rec, UINT iField, IStream **pstm)
 
static UINT msi_dump_stream_to_file (IStream *stm, LPCWSTR name)
 
UINT MSI_RecordStreamToFile (MSIRECORD *rec, UINT iField, LPCWSTR name)
 
MSIRECORDMSI_CloneRecord (MSIRECORD *rec)
 
BOOL MSI_RecordsAreFieldsEqual (MSIRECORD *a, MSIRECORD *b, UINT field)
 
BOOL MSI_RecordsAreEqual (MSIRECORD *a, MSIRECORD *b)
 
WCHARmsi_dup_record_field (MSIRECORD *rec, INT field)
 
void dump_record (MSIRECORD *rec)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file record.c.

◆ MSIFIELD_INT

#define MSIFIELD_INT   1

Definition at line 46 of file record.c.

◆ MSIFIELD_INTPTR

#define MSIFIELD_INTPTR   5

Definition at line 49 of file record.c.

◆ MSIFIELD_NULL

#define MSIFIELD_NULL   0

Definition at line 45 of file record.c.

◆ MSIFIELD_STREAM

#define MSIFIELD_STREAM   4

Definition at line 48 of file record.c.

◆ MSIFIELD_WSTR

#define MSIFIELD_WSTR   3

Definition at line 47 of file record.c.

Function Documentation

◆ dump_record()

void dump_record ( MSIRECORD rec)

Definition at line 1081 of file record.c.

1082 {
1083  int i;
1084  if (!rec)
1085  {
1086  TRACE("(null)\n");
1087  return;
1088  }
1089 
1090  TRACE("[");
1091  for (i = 0; i <= rec->count; i++)
1092  {
1093  switch(rec->fields[i].type)
1094  {
1095  case MSIFIELD_NULL: TRACE("(null)"); break;
1096  case MSIFIELD_INT: TRACE("%d", rec->fields[i].u.iVal); break;
1097  case MSIFIELD_WSTR: TRACE("%s", debugstr_w(rec->fields[i].u.szwVal)); break;
1098  case MSIFIELD_INTPTR: TRACE("%ld", rec->fields[i].u.pVal); break;
1099  case MSIFIELD_STREAM: TRACE("%p", rec->fields[i].u.stream); break;
1100  }
1101  if (i < rec->count) TRACE(", ");
1102  }
1103  TRACE("]\n");
1104 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
INT_PTR pVal
Definition: msipriv.h:132
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
#define debugstr_w
Definition: kernel32.h:32
UINT count
Definition: msipriv.h:142
LPWSTR szwVal
Definition: msipriv.h:133
#define MSIFIELD_STREAM
Definition: record.c:48
#define TRACE(s)
Definition: solgame.cpp:4
#define MSIFIELD_INTPTR
Definition: record.c:49
#define MSIFIELD_WSTR
Definition: record.c:47
#define MSIFIELD_NULL
Definition: record.c:45
INT iVal
Definition: msipriv.h:131
IStream * stream
Definition: msipriv.h:134
#define MSIFIELD_INT
Definition: record.c:46
MSIFIELD fields[1]
Definition: msipriv.h:143
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by MSI_FormatRecordW(), MSI_ProcessMessageVerbatim(), and msi_table_load_transform().

◆ MSI_CloneRecord()

MSIRECORD* MSI_CloneRecord ( MSIRECORD rec)

Definition at line 974 of file record.c.

975 {
976  MSIRECORD *clone;
977  UINT r, i, count;
978 
980  clone = MSI_CreateRecord(count);
981  if (!clone)
982  return NULL;
983 
984  for (i = 0; i <= count; i++)
985  {
986  if (rec->fields[i].type == MSIFIELD_STREAM)
987  {
988  if (FAILED(IStream_Clone(rec->fields[i].u.stream,
989  &clone->fields[i].u.stream)))
990  {
991  msiobj_release(&clone->hdr);
992  return NULL;
993  }
994  clone->fields[i].type = MSIFIELD_STREAM;
995  }
996  else
997  {
998  r = MSI_RecordCopyField(rec, i, clone, i);
999  if (r != ERROR_SUCCESS)
1000  {
1001  msiobj_release(&clone->hdr);
1002  return NULL;
1003  }
1004  }
1005  }
1006 
1007  return clone;
1008 }
UINT MSI_RecordGetFieldCount(const MSIRECORD *rec)
Definition: record.c:111
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:141
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
UINT MSI_RecordCopyField(MSIRECORD *in_rec, UINT in_n, MSIRECORD *out_rec, UINT out_n)
Definition: record.c:169
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
MSIRECORD * MSI_CreateRecord(UINT cParams)
Definition: record.c:79
smooth NULL
Definition: ftsmooth.c:416
#define MSIFIELD_STREAM
Definition: record.c:48
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
IStream * stream
Definition: msipriv.h:134
MSIFIELD fields[1]
Definition: msipriv.h:143
unsigned int UINT
Definition: ndis.h:50
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by iterate_properties(), merge_diff_row(), and MSI_FormatRecordW().

◆ MSI_CloseRecord()

void MSI_CloseRecord ( MSIOBJECTHDR arg)

Definition at line 70 of file record.c.

71 {
72  MSIRECORD *rec = (MSIRECORD *) arg;
73  UINT i;
74 
75  for( i=0; i<=rec->count; i++ )
76  MSI_FreeField( &rec->fields[i] );
77 }
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
UINT count
Definition: msipriv.h:142
static void MSI_FreeField(MSIFIELD *field)
Definition: record.c:51
MSIFIELD fields[1]
Definition: msipriv.h:143
unsigned int UINT
Definition: ndis.h:50

Referenced by MSI_CreateRecord(), and msi_refresh_record().

◆ MSI_CreateRecord()

MSIRECORD* MSI_CreateRecord ( UINT  cParams)

Definition at line 79 of file record.c.

80 {
81  MSIRECORD *rec;
82 
83  TRACE("%d\n", cParams);
84 
85  if( cParams>65535 )
86  return NULL;
87 
88  rec = alloc_msiobject( MSIHANDLETYPE_RECORD, FIELD_OFFSET(MSIRECORD, fields[cParams + 1]),
90  if( rec )
91  rec->count = cParams;
92  return rec;
93 }
void MSI_CloseRecord(MSIOBJECTHDR *arg)
Definition: record.c:70
void * alloc_msiobject(UINT type, UINT size, msihandledestructor destroy)
Definition: handle.c:202
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:702
smooth NULL
Definition: ftsmooth.c:416
UINT count
Definition: msipriv.h:142
#define TRACE(s)
Definition: solgame.cpp:4
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Referenced by ACTION_AllocateRegistrySpace(), ACTION_ExecuteAction(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_ProcessComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterUser(), ACTION_RemoveFiles(), ACTION_ResolveSource(), ACTION_ShowDialog(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), add_stream(), construct_record(), deformat_string(), dialog_create(), event_set_target_path(), internal_ui_handler(), iterate_appsearch(), ITERATE_CreateFolders(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_MoveFiles(), ITERATE_PublishComponent(), ITERATE_RegisterFonts(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnregisterFonts(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), msi_arrange_record(), msi_change_media(), msi_clone_properties(), MSI_CloneRecord(), msi_create_table(), MSI_DatabaseGetPrimaryKeys(), msi_dialog_seltree_handler(), msi_file_update_ui(), msi_get_property_row(), msi_get_transform_record(), MSI_OpenPackageW(), msi_query_merge_record(), msi_set_property(), msi_ui_progress(), msi_unpublish_feature(), msi_view_get_row(), MSI_ViewGetColumnInfo(), MsiCreateRecord(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), patch_update_filepatch_sequence(), SELECT_insert_row(), SELECT_set_row(), TABLE_add_column(), TABLE_drop(), TABLE_remove_column(), ui_actioninfo(), ui_actionstart(), UPDATE_execute(), and WHERE_set_row().

◆ msi_dump_stream_to_file()

static UINT msi_dump_stream_to_file ( IStream stm,
LPCWSTR  name 
)
static

Definition at line 921 of file record.c.

922 {
925  IStream *out;
926  DWORD stgm;
927  HRESULT r;
928 
930  r = SHCreateStreamOnFileW( name, stgm, &out );
931  if( FAILED( r ) )
932  return ERROR_FUNCTION_FAILED;
933 
934  pos.QuadPart = 0;
935  r = IStream_Seek( stm, pos, STREAM_SEEK_END, &size );
936  if( FAILED( r ) )
937  goto end;
938 
939  pos.QuadPart = 0;
940  r = IStream_Seek( stm, pos, STREAM_SEEK_SET, NULL );
941  if( FAILED( r ) )
942  goto end;
943 
944  r = IStream_CopyTo( stm, out, size, NULL, NULL );
945 
946 end:
947  IStream_Release( out );
948  if( FAILED( r ) )
949  return ERROR_FUNCTION_FAILED;
950  return ERROR_SUCCESS;
951 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:922
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define STGM_FAILIFTHERE
Definition: objbase.h:927
GLuint GLuint end
Definition: gl.h:1545
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STGM_READWRITE
Definition: objbase.h:918
Definition: name.c:36
HRESULT WINAPI SHCreateStreamOnFileW(LPCWSTR lpszPath, DWORD dwMode, IStream **lppStream)
Definition: istream.c:484

Referenced by MSI_RecordStreamToFile().

◆ msi_dup_record_field()

WCHAR* msi_dup_record_field ( MSIRECORD rec,
INT  field 
)

Definition at line 1055 of file record.c.

1056 {
1057  DWORD sz = 0;
1058  WCHAR *str;
1059  UINT r;
1060 
1061  if (MSI_RecordIsNull( rec, field )) return NULL;
1062 
1063  r = MSI_RecordGetStringW( rec, field, NULL, &sz );
1064  if (r != ERROR_SUCCESS)
1065  return NULL;
1066 
1067  sz++;
1068  str = msi_alloc( sz * sizeof(WCHAR) );
1069  if (!str) return NULL;
1070  str[0] = 0;
1071  r = MSI_RecordGetStringW( rec, field, str, &sz );
1072  if (r != ERROR_SUCCESS)
1073  {
1074  ERR("failed to get string!\n");
1075  msi_free( str );
1076  return NULL;
1077  }
1078  return str;
1079 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: parser.c:43
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERR(fmt,...)
Definition: debug.h:109
BOOL MSI_RecordIsNull(MSIRECORD *rec, UINT iField)
Definition: record.c:369
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField, LPWSTR szValue, LPDWORD pcchValue)
Definition: record.c:487

Referenced by ACTION_AppSearchGetSignature(), ACTION_AppSearchIni(), get_ini_file_name(), get_key_value(), get_link_file(), internal_ui_handler(), iterate_load_verb(), ITERATE_RegisterFonts(), ITERATE_UnregisterFonts(), load_appid(), load_class(), load_component(), load_extension(), load_feature(), load_file(), load_folder(), load_mime(), load_progid(), MSI_FormatRecordW(), msi_get_error_message(), MSI_ProcessMessage(), msi_record_encoded_stream_name(), patch_add_media(), patch_offset_get_filepatches(), and patch_offset_get_files().

◆ MSI_FreeField()

static void MSI_FreeField ( MSIFIELD field)
static

Definition at line 51 of file record.c.

52 {
53  switch( field->type )
54  {
55  case MSIFIELD_NULL:
56  case MSIFIELD_INT:
57  case MSIFIELD_INTPTR:
58  break;
59  case MSIFIELD_WSTR:
60  msi_free( field->u.szwVal);
61  break;
62  case MSIFIELD_STREAM:
63  IStream_Release( field->u.stream );
64  break;
65  default:
66  ERR("Invalid field type %d\n", field->type);
67  }
68 }
union field::@560 u
#define MSIFIELD_STREAM
Definition: record.c:48
#define MSIFIELD_INTPTR
Definition: record.c:49
Definition: parser.c:43
#define MSIFIELD_WSTR
Definition: record.c:47
#define MSIFIELD_NULL
Definition: record.c:45
#define ERR(fmt,...)
Definition: debug.h:109
#define MSIFIELD_INT
Definition: record.c:46
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227

Referenced by MSI_CloseRecord(), msi_record_set_string(), MSI_RecordSetInteger(), MSI_RecordSetIntPtr(), MSI_RecordSetIStream(), MSI_RecordSetStream(), and MsiRecordClearData().

◆ msi_get_stream_size()

static UINT msi_get_stream_size ( IStream stm)
static

Definition at line 552 of file record.c.

553 {
554  STATSTG stat;
555  HRESULT r;
556 
557  r = IStream_Stat( stm, &stat, STATFLAG_NONAME );
558  if( FAILED(r) )
559  return 0;
560  return stat.cbSize.QuadPart;
561 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
LONG HRESULT
Definition: typedefs.h:77
Definition: stat.h:55
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345

Referenced by MSI_RecordDataSize().

◆ msi_record_get_string()

const WCHAR* msi_record_get_string ( const MSIRECORD rec,
UINT  field,
int len 
)

Definition at line 469 of file record.c.

470 {
471  if (field > rec->count)
472  return NULL;
473 
474  if (rec->fields[field].type != MSIFIELD_WSTR)
475  return NULL;
476 
477  if (len) *len = rec->fields[field].len;
478 
479  return rec->fields[field].u.szwVal;
480 }
smooth NULL
Definition: ftsmooth.c:416
UINT count
Definition: msipriv.h:142
LPWSTR szwVal
Definition: msipriv.h:133
Definition: parser.c:43
#define MSIFIELD_WSTR
Definition: record.c:47
GLenum GLsizei len
Definition: glext.h:6722
MSIFIELD fields[1]
Definition: msipriv.h:143
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by get_table_value_from_record(), ITERATE_WriteRegistryValues(), MSI_GetProperty(), msi_record_to_row(), MSI_RecordGetString(), msi_select_update(), TABLE_set_row(), and table_validate_new().

◆ msi_record_set_string()

UINT msi_record_set_string ( MSIRECORD rec,
UINT  field,
const WCHAR value,
int  len 
)

Definition at line 625 of file record.c.

626 {
627  if (field > rec->count)
628  return ERROR_INVALID_FIELD;
629 
630  MSI_FreeField( &rec->fields[field] );
631 
632  if (value && len < 0) len = strlenW( value );
633 
634  if (value && len)
635  {
636  rec->fields[field].type = MSIFIELD_WSTR;
637  rec->fields[field].u.szwVal = msi_strdupW( value, len );
638  rec->fields[field].len = len;
639  }
640  else
641  {
642  rec->fields[field].type = MSIFIELD_NULL;
643  rec->fields[field].u.szwVal = NULL;
644  rec->fields[field].len = 0;
645  }
646  return 0;
647 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
WCHAR * msi_strdupW(const WCHAR *value, int len)
Definition: record.c:158
#define ERROR_INVALID_FIELD
Definition: winerror.h:974
smooth NULL
Definition: ftsmooth.c:416
UINT count
Definition: msipriv.h:142
LPWSTR szwVal
Definition: msipriv.h:133
Definition: parser.c:43
#define MSIFIELD_WSTR
Definition: record.c:47
static void MSI_FreeField(MSIFIELD *field)
Definition: record.c:51
#define MSIFIELD_NULL
Definition: record.c:45
GLenum GLsizei len
Definition: glext.h:6722
MSIFIELD fields[1]
Definition: msipriv.h:143
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by msi_get_transform_record(), MSI_RecordSetStringW(), msi_select_update(), msi_set_property(), and msi_view_get_row().

◆ MSI_RecordCopyField()

UINT MSI_RecordCopyField ( MSIRECORD in_rec,
UINT  in_n,
MSIRECORD out_rec,
UINT  out_n 
)

Definition at line 169 of file record.c.

171 {
172  UINT r = ERROR_SUCCESS;
173 
174  msiobj_lock( &in_rec->hdr );
175 
176  if ( in_n > in_rec->count || out_n > out_rec->count )
178  else if ( in_rec != out_rec || in_n != out_n )
179  {
180  LPWSTR str;
181  MSIFIELD *in, *out;
182 
183  in = &in_rec->fields[in_n];
184  out = &out_rec->fields[out_n];
185 
186  switch ( in->type )
187  {
188  case MSIFIELD_NULL:
189  break;
190  case MSIFIELD_INT:
191  out->u.iVal = in->u.iVal;
192  break;
193  case MSIFIELD_INTPTR:
194  out->u.pVal = in->u.pVal;
195  break;
196  case MSIFIELD_WSTR:
197  if ((str = msi_strdupW( in->u.szwVal, in->len )))
198  {
199  out->u.szwVal = str;
200  out->len = in->len;
201  }
202  else r = ERROR_OUTOFMEMORY;
203  break;
204  case MSIFIELD_STREAM:
205  IStream_AddRef( in->u.stream );
206  out->u.stream = in->u.stream;
207  break;
208  default:
209  ERR("invalid field type %d\n", in->type);
210  }
211  if (r == ERROR_SUCCESS)
212  out->type = in->type;
213  }
214 
215  msiobj_unlock( &in_rec->hdr );
216  return r;
217 }
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:141
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
WCHAR * msi_strdupW(const WCHAR *value, int len)
Definition: record.c:158
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
const WCHAR * str
UINT count
Definition: msipriv.h:142
#define MSIFIELD_STREAM
Definition: record.c:48
#define MSIFIELD_INTPTR
Definition: record.c:49
#define MSIFIELD_WSTR
Definition: record.c:47
static FILE * out
Definition: regtests2xml.c:44
#define MSIFIELD_NULL
Definition: record.c:45
#define ERR(fmt,...)
Definition: debug.h:109
GLuint in
Definition: glext.h:9616
#define MSIFIELD_INT
Definition: record.c:46
MSIFIELD fields[1]
Definition: msipriv.h:143
unsigned int UINT
Definition: ndis.h:50
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by msi_arrange_record(), msi_clone_properties(), MSI_CloneRecord(), msi_query_merge_record(), msi_refresh_record(), SELECT_insert_row(), SELECT_set_row(), UPDATE_execute(), and WHERE_set_row().

◆ MSI_RecordDataSize()

static UINT MSI_RecordDataSize ( MSIRECORD rec,
UINT  iField 
)
static

Definition at line 563 of file record.c.

564 {
565  TRACE("%p %d\n", rec, iField);
566 
567  if( iField > rec->count )
568  return 0;
569 
570  switch( rec->fields[iField].type )
571  {
572  case MSIFIELD_INT:
573  return sizeof (INT);
574  case MSIFIELD_WSTR:
575  return rec->fields[iField].len;
576  case MSIFIELD_NULL:
577  break;
578  case MSIFIELD_STREAM:
579  return msi_get_stream_size( rec->fields[iField].u.stream );
580  }
581  return 0;
582 }
#define INT
Definition: polytest.cpp:20
static UINT msi_get_stream_size(IStream *stm)
Definition: record.c:552
UINT count
Definition: msipriv.h:142
#define MSIFIELD_STREAM
Definition: record.c:48
#define TRACE(s)
Definition: solgame.cpp:4
#define MSIFIELD_WSTR
Definition: record.c:47
#define MSIFIELD_NULL
Definition: record.c:45
IStream * stream
Definition: msipriv.h:134
#define MSIFIELD_INT
Definition: record.c:46
MSIFIELD fields[1]
Definition: msipriv.h:143
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by MsiRecordDataSize().

◆ MSI_RecordGetFieldCount()

◆ MSI_RecordGetInteger()

int MSI_RecordGetInteger ( MSIRECORD rec,
UINT  iField 
)

Definition at line 245 of file record.c.

246 {
247  int ret = 0;
248 
249  TRACE("%p %d\n", rec, iField );
250 
251  if( iField > rec->count )
252  return MSI_NULL_INTEGER;
253 
254  switch( rec->fields[iField].type )
255  {
256  case MSIFIELD_INT:
257  return rec->fields[iField].u.iVal;
258  case MSIFIELD_INTPTR:
259  return rec->fields[iField].u.pVal;
260  case MSIFIELD_WSTR:
261  if( string2intW( rec->fields[iField].u.szwVal, &ret ) )
262  return ret;
263  return MSI_NULL_INTEGER;
264  default:
265  break;
266  }
267 
268  return MSI_NULL_INTEGER;
269 }
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
INT_PTR pVal
Definition: msipriv.h:132
UINT count
Definition: msipriv.h:142
LPWSTR szwVal
Definition: msipriv.h:133
#define TRACE(s)
Definition: solgame.cpp:4
#define MSIFIELD_INTPTR
Definition: record.c:49
#define MSIFIELD_WSTR
Definition: record.c:47
int ret
INT iVal
Definition: msipriv.h:131
#define MSIFIELD_INT
Definition: record.c:46
MSIFIELD fields[1]
Definition: msipriv.h:143
static BOOL string2intW(LPCWSTR str, int *out)
Definition: record.c:135
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by ACTION_AppSearchComponents(), ACTION_AppSearchDr(), ACTION_AppSearchGetSignature(), ACTION_AppSearchIni(), ACTION_AppSearchReg(), ACTION_CustomAction(), ACTION_ProcessComponents(), dialog_create(), dialog_create_window(), dialog_handle_event(), get_table_value_from_record(), internal_ui_handler(), ITERATE_CostFinalizeConditions(), ITERATE_CreateShortcuts(), ITERATE_DeleteService(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallService(), iterate_load_verb(), ITERATE_MigrateFeatureStates(), ITERATE_MoveFiles(), ITERATE_RemoveExistingProducts(), ITERATE_RemoveFiles(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnregisterTypeLibraries(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), load_class(), load_component(), load_feature(), load_file(), load_file_disk_id(), load_file_hash(), load_media(), load_patch(), load_patch_disk_id(), load_progid(), msi_dialog_add_control(), msi_dialog_add_font(), msi_dialog_adjust_dialog_pos(), msi_dialog_bitmap_control(), msi_dialog_button_control(), msi_dialog_combo_control(), msi_dialog_directory_combo(), msi_dialog_directory_list(), msi_dialog_hyperlink(), msi_dialog_icon_control(), msi_dialog_line_control(), msi_dialog_list_box(), msi_dialog_oncreate(), msi_dialog_pathedit_control(), msi_dialog_progress_bar(), msi_dialog_radiogroup_control(), msi_dialog_selection_tree(), msi_dialog_text_control(), msi_dialog_volumeselect_combo(), msi_load_assembly(), msi_load_media_info(), msi_primary_key_iterator(), MSI_ProcessMessage(), msi_record_to_row(), msi_select_update(), msi_table_load_transform(), MsiRecordGetInteger(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_set_offsets(), patch_update_file_sequence(), patch_update_filepatch_sequence(), resolve_keypath(), table_validate_new(), and WHERE_evaluate().

◆ MSI_RecordGetIntPtr()

INT_PTR MSI_RecordGetIntPtr ( MSIRECORD rec,
UINT  iField 
)

Definition at line 219 of file record.c.

220 {
221  int ret;
222 
223  TRACE( "%p %d\n", rec, iField );
224 
225  if( iField > rec->count )
226  return MININT_PTR;
227 
228  switch( rec->fields[iField].type )
229  {
230  case MSIFIELD_INT:
231  return rec->fields[iField].u.iVal;
232  case MSIFIELD_INTPTR:
233  return rec->fields[iField].u.pVal;
234  case MSIFIELD_WSTR:
235  if( string2intW( rec->fields[iField].u.szwVal, &ret ) )
236  return ret;
237  return MININT_PTR;
238  default:
239  break;
240  }
241 
242  return MININT_PTR;
243 }
#define MININT_PTR
Definition: basetsd.h:102
INT_PTR pVal
Definition: msipriv.h:132
UINT count
Definition: msipriv.h:142
LPWSTR szwVal
Definition: msipriv.h:133
#define TRACE(s)
Definition: solgame.cpp:4
#define MSIFIELD_INTPTR
Definition: record.c:49
#define MSIFIELD_WSTR
Definition: record.c:47
int ret
INT iVal
Definition: msipriv.h:131
#define MSIFIELD_INT
Definition: record.c:46
MSIFIELD fields[1]
Definition: msipriv.h:143
static BOOL string2intW(LPCWSTR str, int *out)
Definition: record.c:135
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by MSI_ViewModify().

◆ MSI_RecordGetIStream()

UINT MSI_RecordGetIStream ( MSIRECORD rec,
UINT  iField,
IStream **  pstm 
)

Definition at line 905 of file record.c.

906 {
907  TRACE("%p %d %p\n", rec, iField, pstm);
908 
909  if( iField > rec->count )
910  return ERROR_INVALID_FIELD;
911 
912  if( rec->fields[iField].type != MSIFIELD_STREAM )
913  return ERROR_INVALID_FIELD;
914 
915  *pstm = rec->fields[iField].u.stream;
916  IStream_AddRef( *pstm );
917 
918  return ERROR_SUCCESS;
919 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_INVALID_FIELD
Definition: winerror.h:974
UINT count
Definition: msipriv.h:142
#define MSIFIELD_STREAM
Definition: record.c:48
#define TRACE(s)
Definition: solgame.cpp:4
IStream * stream
Definition: msipriv.h:134
MSIFIELD fields[1]
Definition: msipriv.h:143
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by msi_load_picture(), MSI_RecordStreamToFile(), STORAGES_set_row(), STREAMS_set_row(), and TABLE_set_row().

◆ MSI_RecordGetString()

const WCHAR* MSI_RecordGetString ( const MSIRECORD rec,
UINT  iField 
)

Definition at line 482 of file record.c.

483 {
484  return msi_record_get_string( rec, iField, NULL );
485 }
const WCHAR * msi_record_get_string(const MSIRECORD *rec, UINT field, int *len)
Definition: record.c:469
smooth NULL
Definition: ftsmooth.c:416

Referenced by ACTION_AppSearchComponents(), ACTION_AppSearchDr(), ACTION_AppSearchReg(), ACTION_CustomAction(), ACTION_PerformActionSequence(), create_diff_row_query(), dialog_create(), dialog_create_window(), dialog_handle_event(), find_feature_children(), find_folder_children(), get_assembly_name_attribute(), get_assembly_record(), get_duplicate_filename(), get_ini_file_name(), get_key_value(), get_link_file(), get_product_code(), HANDLE_CustomType19(), internal_ui_handler(), is_uninstallable(), ITERATE_Actions(), iterate_all_classes(), iterate_all_extensions(), iterate_all_mimes(), iterate_all_progids(), iterate_appsearch(), ITERATE_BindImage(), ITERATE_CCPSearch(), ITERATE_CostFinalizeConditions(), ITERATE_CreateFolders(), ITERATE_CreateShortcuts(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_InstallService(), ITERATE_LaunchConditions(), iterate_load_featurecomponents(), iterate_load_verb(), ITERATE_MigrateFeatureStates(), ITERATE_MoveFiles(), ITERATE_PublishComponent(), ITERATE_PublishIcon(), ITERATE_RegisterFonts(), ITERATE_RegisterTypeLibraries(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveExistingProducts(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_RemoveShortcuts(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnpublishIcon(), ITERATE_UnregisterFonts(), ITERATE_UnregisterTypeLibraries(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), join_find_row(), load_appid(), load_class(), load_extension(), load_file(), load_media(), load_mime(), load_patch(), load_progid(), map_event(), merge_diff_tables(), merge_verify_colnames(), merge_verify_primary_keys(), msi_combobox_add_item(), msi_dialog_add_control(), msi_dialog_add_font(), msi_dialog_checkbox_control(), msi_dialog_combo_control(), msi_dialog_control_event(), msi_dialog_create_controls(), msi_dialog_create_radiobutton(), msi_dialog_directory_combo(), msi_dialog_directory_list(), msi_dialog_edit_control(), msi_dialog_get_uitext(), msi_dialog_hyperlink(), msi_dialog_line_control(), msi_dialog_list_box(), msi_dialog_maskedit_control(), msi_dialog_oncreate(), msi_dialog_pathedit_control(), msi_dialog_radiogroup_control(), msi_dialog_scrolltext_control(), msi_dialog_selection_tree(), msi_dialog_seltree_handler(), msi_dialog_set_control_condition(), msi_dialog_text_control(), msi_dialog_vcl_add_columns(), msi_dialog_volumeselect_combo(), MSI_FormatRecordW(), msi_get_deformatted_field(), msi_get_query_columns(), msi_get_query_types(), msi_get_table_labels(), msi_listbox_add_item(), msi_load_assembly(), msi_load_media_info(), msi_media_get_disk_info(), msi_primary_key_iterator(), MsiGetProductPropertyW(), patch_set_media_source_prop(), patch_update_file_sequence(), patch_update_filepatch_sequence(), resolve_keypath(), storages_find_row(), STORAGES_set_row(), streams_find_row(), STREAMS_set_row(), STRING_evaluate(), and ui_actionstart().

◆ MSI_RecordGetStringA()

UINT MSI_RecordGetStringA ( MSIRECORD rec,
UINT  iField,
LPSTR  szValue,
LPDWORD  pcchValue 
)

Definition at line 399 of file record.c.

401 {
402  UINT len = 0, ret = ERROR_SUCCESS;
403  CHAR buffer[16];
404 
405  TRACE("%p %d %p %p\n", rec, iField, szValue, pcchValue);
406 
407  if( iField > rec->count )
408  {
409  if ( szValue && *pcchValue > 0 )
410  szValue[0] = 0;
411 
412  *pcchValue = 0;
413  return ERROR_SUCCESS;
414  }
415 
416  switch( rec->fields[iField].type )
417  {
418  case MSIFIELD_INT:
419  wsprintfA(buffer, "%d", rec->fields[iField].u.iVal);
420  len = lstrlenA( buffer );
421  if (szValue)
422  lstrcpynA(szValue, buffer, *pcchValue);
423  break;
424  case MSIFIELD_WSTR:
425  len = WideCharToMultiByte( CP_ACP, 0, rec->fields[iField].u.szwVal,
426  rec->fields[iField].len + 1, NULL, 0 , NULL, NULL );
427  if (szValue)
428  WideCharToMultiByte( CP_ACP, 0, rec->fields[iField].u.szwVal,
429  rec->fields[iField].len + 1, szValue, *pcchValue, NULL, NULL );
430  if( szValue && *pcchValue && len>*pcchValue )
431  szValue[*pcchValue-1] = 0;
432  if( len )
433  len--;
434  break;
435  case MSIFIELD_NULL:
436  if( szValue && *pcchValue > 0 )
437  szValue[0] = 0;
438  break;
439  default:
441  break;
442  }
443 
444  if( szValue && *pcchValue <= len )
446  *pcchValue = len;
447 
448  return ret;
449 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
char CHAR
Definition: xmlstorage.h:175
GLuint buffer
Definition: glext.h:5915
smooth NULL
Definition: ftsmooth.c:416
UINT count
Definition: msipriv.h:142
LPWSTR szwVal
Definition: msipriv.h:133
#define TRACE(s)
Definition: solgame.cpp:4
#define MSIFIELD_WSTR
Definition: record.c:47
#define MSIFIELD_NULL
Definition: record.c:45
int ret
GLenum GLsizei len
Definition: glext.h:6722
INT iVal
Definition: msipriv.h:131
#define ERROR_MORE_DATA
Definition: dderror.h:13
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
int WINAPIV wsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR,...)
#define MSIFIELD_INT
Definition: record.c:46
MSIFIELD fields[1]
Definition: msipriv.h:143
unsigned int UINT
Definition: ndis.h:50
#define lstrcpynA
Definition: compat.h:408
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by msi_export_field(), and MsiRecordGetStringA().

◆ MSI_RecordGetStringW()

UINT MSI_RecordGetStringW ( MSIRECORD rec,
UINT  iField,
LPWSTR  szValue,
LPDWORD  pcchValue 
)

Definition at line 487 of file record.c.

489 {
490  static const WCHAR szFormat[] = {'%','d',0};
491  UINT len = 0, ret = ERROR_SUCCESS;
492  WCHAR buffer[16];
493 
494  TRACE("%p %d %p %p\n", rec, iField, szValue, pcchValue);
495 
496  if( iField > rec->count )
497  {
498  if ( szValue && *pcchValue > 0 )
499  szValue[0] = 0;
500 
501  *pcchValue = 0;
502  return ERROR_SUCCESS;
503  }
504 
505  switch( rec->fields[iField].type )
506  {
507  case MSIFIELD_INT:
508  wsprintfW(buffer, szFormat, rec->fields[iField].u.iVal);
509  len = lstrlenW( buffer );
510  if (szValue)
511  lstrcpynW(szValue, buffer, *pcchValue);
512  break;
513  case MSIFIELD_WSTR:
514  len = rec->fields[iField].len;
515  if (szValue)
516  memcpy( szValue, rec->fields[iField].u.szwVal, min(len + 1, *pcchValue) * sizeof(WCHAR) );
517  break;
518  case MSIFIELD_NULL:
519  if( szValue && *pcchValue > 0 )
520  szValue[0] = 0;
521  break;
522  default:
523  break;
524  }
525 
526  if( szValue && *pcchValue <= len )
528  *pcchValue = len;
529 
530  return ret;
531 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define ERROR_SUCCESS
Definition: deptool.c:10
GLuint buffer
Definition: glext.h:5915
#define lstrlenW
Definition: compat.h:407
#define lstrcpynW
Definition: compat.h:397
UINT count
Definition: msipriv.h:142
LPWSTR szwVal
Definition: msipriv.h:133
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MSIFIELD_WSTR
Definition: record.c:47
#define MSIFIELD_NULL
Definition: record.c:45
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
INT iVal
Definition: msipriv.h:131
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define MSIFIELD_INT
Definition: record.c:46
MSIFIELD fields[1]
Definition: msipriv.h:143
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by ACTION_AppSearchDr(), deformat_index(), get_duplicate_filename(), get_key_value(), msi_dup_record_field(), msi_export_stream(), msi_get_property(), msi_table_load_transform(), and MsiRecordGetStringW().

◆ MSI_RecordIsNull()

BOOL MSI_RecordIsNull ( MSIRECORD rec,
UINT  iField 
)

Definition at line 369 of file record.c.

370 {
371  BOOL r = TRUE;
372 
373  TRACE("%p %d\n", rec, iField );
374 
375  r = ( iField > rec->count ) ||
376  ( rec->fields[iField].type == MSIFIELD_NULL );
377 
378  return r;
379 }
#define TRUE
Definition: types.h:120
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
unsigned int BOOL
Definition: ntddk_ex.h:94
UINT count
Definition: msipriv.h:142
#define TRACE(s)
Definition: solgame.cpp:4
#define MSIFIELD_NULL
Definition: record.c:45
MSIFIELD fields[1]
Definition: msipriv.h:143
UINT type
Definition: msipriv.h:128

Referenced by ACTION_AppSearchDr(), deformat_index(), get_duplicate_filename(), get_table_value_from_record(), ITERATE_CreateShortcuts(), ITERATE_MoveFiles(), ITERATE_RegisterFonts(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_UnregisterFonts(), ITERATE_WriteRegistryValues(), load_appid(), load_class(), load_feature(), load_progid(), msi_dup_record_field(), MSI_ProcessMessage(), MsiRecordIsNull(), row_has_null_primary_keys(), and TABLE_set_row().

◆ MSI_RecordReadStream()

UINT MSI_RecordReadStream ( MSIRECORD rec,
UINT  iField,
char buf,
LPDWORD  sz 
)

Definition at line 814 of file record.c.

815 {
816  ULONG count;
817  HRESULT r;
818  IStream *stm;
819 
820  TRACE("%p %d %p %p\n", rec, iField, buf, sz);
821 
822  if( !sz )
824 
825  if( iField > rec->count)
827 
828  if ( rec->fields[iField].type == MSIFIELD_NULL )
829  {
830  *sz = 0;
831  return ERROR_INVALID_DATA;
832  }
833 
834  if( rec->fields[iField].type != MSIFIELD_STREAM )
835  return ERROR_INVALID_DATATYPE;
836 
837  stm = rec->fields[iField].u.stream;
838  if( !stm )
840 
841  /* if there's no buffer pointer, calculate the length to the end */
842  if( !buf )
843  {
844  LARGE_INTEGER ofs;
845  ULARGE_INTEGER end, cur;
846 
847  ofs.QuadPart = cur.QuadPart = 0;
848  end.QuadPart = 0;
849  IStream_Seek( stm, ofs, STREAM_SEEK_SET, &cur );
850  IStream_Seek( stm, ofs, STREAM_SEEK_END, &end );
851  ofs.QuadPart = cur.QuadPart;
852  IStream_Seek( stm, ofs, STREAM_SEEK_SET, &cur );
853  *sz = end.QuadPart - cur.QuadPart;
854 
855  return ERROR_SUCCESS;
856  }
857 
858  /* read the data */
859  count = 0;
860  r = IStream_Read( stm, buf, *sz, &count );
861  if( FAILED( r ) )
862  {
863  *sz = 0;
864  return ERROR_FUNCTION_FAILED;
865  }
866 
867  *sz = count;
868 
869  return ERROR_SUCCESS;
870 }
#define ERROR_INVALID_DATATYPE
Definition: winerror.h:1111
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SUCCESS
Definition: deptool.c:10
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
UINT count
Definition: msipriv.h:142
#define MSIFIELD_STREAM
Definition: record.c:48
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define MSIFIELD_NULL
Definition: record.c:45
#define ERROR_INVALID_DATA
Definition: winerror.h:116
IStream * stream
Definition: msipriv.h:134
MSIFIELD fields[1]
Definition: msipriv.h:143
unsigned int ULONG
Definition: retypes.h:1
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128
LONGLONG QuadPart
Definition: typedefs.h:112

Referenced by create_temp_binary(), HANDLE_CustomType5_6(), ITERATE_PublishIcon(), msi_export_stream(), and MsiRecordReadStream().

◆ MSI_RecordsAreEqual()

BOOL MSI_RecordsAreEqual ( MSIRECORD a,
MSIRECORD b 
)

Definition at line 1039 of file record.c.

1040 {
1041  UINT i;
1042 
1043  if (a->count != b->count)
1044  return FALSE;
1045 
1046  for (i = 0; i <= a->count; i++)
1047  {
1048  if (!MSI_RecordsAreFieldsEqual( a, b, i ))
1049  return FALSE;
1050  }
1051 
1052  return TRUE;
1053 }
#define TRUE
Definition: types.h:120
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
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
unsigned int UINT
Definition: ndis.h:50
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, UINT field)
Definition: record.c:1010

Referenced by merge_diff_row().

◆ MSI_RecordsAreFieldsEqual()

BOOL MSI_RecordsAreFieldsEqual ( MSIRECORD a,
MSIRECORD b,
UINT  field 
)

Definition at line 1010 of file record.c.

1011 {
1012  if (a->fields[field].type != b->fields[field].type)
1013  return FALSE;
1014 
1015  switch (a->fields[field].type)
1016  {
1017  case MSIFIELD_NULL:
1018  break;
1019 
1020  case MSIFIELD_INT:
1021  if (a->fields[field].u.iVal != b->fields[field].u.iVal)
1022  return FALSE;
1023  break;
1024 
1025  case MSIFIELD_WSTR:
1026  if (a->fields[field].len != b->fields[field].len) return FALSE;
1027  if (memcmp( a->fields[field].u.szwVal, b->fields[field].u.szwVal,
1028  a->fields[field].len * sizeof(WCHAR) )) return FALSE;
1029  break;
1030 
1031  case MSIFIELD_STREAM:
1032  default:
1033  return FALSE;
1034  }
1035  return TRUE;
1036 }
#define TRUE
Definition: types.h:120
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define MSIFIELD_STREAM
Definition: record.c:48
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: parser.c:43
#define MSIFIELD_WSTR
Definition: record.c:47
#define MSIFIELD_NULL
Definition: record.c:45
#define MSIFIELD_INT
Definition: record.c:46
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by join_modify_update(), and MSI_RecordsAreEqual().

◆ MSI_RecordSetInteger()

UINT MSI_RecordSetInteger ( MSIRECORD rec,
UINT  iField,
int  iVal 
)

Definition at line 328 of file record.c.

329 {
330  TRACE("%p %u %d\n", rec, iField, iVal);
331 
332  if( iField > rec->count )
334 
335  MSI_FreeField( &rec->fields[iField] );
336 
337  if (iVal == MSI_NULL_INTEGER)
338  {
339  rec->fields[iField].type = MSIFIELD_NULL;
340  rec->fields[iField].u.szwVal = NULL;
341  }
342  else
343  {
344  rec->fields[iField].type = MSIFIELD_INT;
345  rec->fields[iField].u.iVal = iVal;
346  }
347 
348  return ERROR_SUCCESS;
349 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
smooth NULL
Definition: ftsmooth.c:416
UINT count
Definition: msipriv.h:142
LPWSTR szwVal
Definition: msipriv.h:133
#define TRACE(s)
Definition: solgame.cpp:4
static void MSI_FreeField(MSIFIELD *field)
Definition: record.c:51
#define MSIFIELD_NULL
Definition: record.c:45
INT iVal
Definition: msipriv.h:131
#define MSIFIELD_INT
Definition: record.c:46
MSIFIELD fields[1]
Definition: msipriv.h:143
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by ACTION_AllocateRegistrySpace(), ACTION_ExecuteAction(), ACTION_ResolveSource(), ACTION_ShowDialog(), construct_record(), internal_ui_handler(), ITERATE_DuplicateFiles(), ITERATE_InstallODBCDataSource(), ITERATE_MoveFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveODBCDataSource(), ITERATE_WriteEnvironmentString(), msi_change_media(), msi_create_table(), msi_file_update_ui(), msi_get_transform_record(), MSI_OpenPackageW(), msi_query_merge_record(), msi_select_update(), msi_table_load_transform(), msi_ui_progress(), msi_view_get_row(), MsiRecordSetInteger(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), patch_set_offsets(), patch_update_file_sequence(), patch_update_filepatch_sequence(), TABLE_add_column(), TABLE_remove_column(), and ui_actioninfo().

◆ MSI_RecordSetIntPtr()

UINT MSI_RecordSetIntPtr ( MSIRECORD rec,
UINT  iField,
INT_PTR  pVal 
)

Definition at line 314 of file record.c.

315 {
316  TRACE("%p %u %ld\n", rec, iField, pVal);
317 
318  if( iField > rec->count )
320 
321  MSI_FreeField( &rec->fields[iField] );
322  rec->fields[iField].type = MSIFIELD_INTPTR;
323  rec->fields[iField].u.pVal = pVal;
324 
325  return ERROR_SUCCESS;
326 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SUCCESS
Definition: deptool.c:10
INT_PTR pVal
Definition: msipriv.h:132
UINT count
Definition: msipriv.h:142
#define TRACE(s)
Definition: solgame.cpp:4
#define MSIFIELD_INTPTR
Definition: record.c:49
static void MSI_FreeField(MSIFIELD *field)
Definition: record.c:51
MSIFIELD fields[1]
Definition: msipriv.h:143
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by MSI_ViewFetch().

◆ MSI_RecordSetIStream()

UINT MSI_RecordSetIStream ( MSIRECORD rec,
UINT  iField,
IStream stm 
)

Definition at line 889 of file record.c.

890 {
891  TRACE("%p %d %p\n", rec, iField, stm);
892 
893  if( iField > rec->count )
894  return ERROR_INVALID_FIELD;
895 
896  MSI_FreeField( &rec->fields[iField] );
897 
898  rec->fields[iField].type = MSIFIELD_STREAM;
899  rec->fields[iField].u.stream = stm;
900  IStream_AddRef( stm );
901 
902  return ERROR_SUCCESS;
903 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_INVALID_FIELD
Definition: winerror.h:974
UINT count
Definition: msipriv.h:142
#define MSIFIELD_STREAM
Definition: record.c:48
#define TRACE(s)
Definition: solgame.cpp:4
static void MSI_FreeField(MSIFIELD *field)
Definition: record.c:51
IStream * stream
Definition: msipriv.h:134
MSIFIELD fields[1]
Definition: msipriv.h:143
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by add_stream(), and msi_view_get_row().

◆ MSI_RecordSetStream()

UINT MSI_RecordSetStream ( MSIRECORD rec,
UINT  iField,
IStream stream 
)

Definition at line 724 of file record.c.

725 {
726  if ( (iField == 0) || (iField > rec->count) )
728 
729  MSI_FreeField( &rec->fields[iField] );
730  rec->fields[iField].type = MSIFIELD_STREAM;
731  rec->fields[iField].u.stream = stream;
732 
733  return ERROR_SUCCESS;
734 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT count
Definition: msipriv.h:142
#define MSIFIELD_STREAM
Definition: record.c:48
static void MSI_FreeField(MSIFIELD *field)
Definition: record.c:51
GLuint GLuint stream
Definition: glext.h:7522
IStream * stream
Definition: msipriv.h:134
MSIFIELD fields[1]
Definition: msipriv.h:143
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128

Referenced by msi_get_transform_record(), and MSI_RecordSetStreamFromFileW().

◆ MSI_RecordSetStreamFromFileW()

UINT MSI_RecordSetStreamFromFileW ( MSIRECORD rec,
UINT  iField,
LPCWSTR  szFilename 
)

Definition at line 736 of file record.c.

737 {
738  IStream *stm = NULL;
739  HRESULT hr;
740  UINT ret;
741 
742  if( (iField == 0) || (iField > rec->count) )
744 
745  /* no filename means we should seek back to the start of the stream */
746  if( !szFilename )
747  {
748  LARGE_INTEGER ofs;
749  ULARGE_INTEGER cur;
750 
751  if( rec->fields[iField].type != MSIFIELD_STREAM )
752  return ERROR_INVALID_FIELD;
753 
754  stm = rec->fields[iField].u.stream;
755  if( !stm )
756  return ERROR_INVALID_FIELD;
757 
758  ofs.QuadPart = 0;
759  hr = IStream_Seek( stm, ofs, STREAM_SEEK_SET, &cur );
760  if (FAILED( hr ))
761  return ERROR_FUNCTION_FAILED;
762  }
763  else
764  {
765  /* read the file into a stream and save the stream in the record */
766  ret = RECORD_StreamFromFile(szFilename, &stm);
767  if (ret != ERROR_SUCCESS)
768  return ret;
769 
770  /* if all's good, store it in the record */
771  MSI_RecordSetStream(rec, iField, stm);
772  }
773 
774  return ERROR_SUCCESS;
775 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define ERROR_INVALID_FIELD
Definition: winerror.h:974
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
smooth NULL
Definition: ftsmooth.c:416
UINT count
Definition: msipriv.h:142
static UINT RECORD_StreamFromFile(LPCWSTR szFile, IStream **pstm)
Definition: record.c:675
#define MSIFIELD_STREAM
Definition: record.c:48
LONG HRESULT
Definition: typedefs.h:77
int ret
IStream * stream
Definition: msipriv.h:134
MSIFIELD fields[1]
Definition: msipriv.h:143
unsigned int UINT
Definition: ndis.h:50
union tagMSIFIELD::@479 u
UINT type
Definition: msipriv.h:128
UINT MSI_RecordSetStream(MSIRECORD *rec, UINT iField, IStream *stream)
Definition: record.c:724
LONGLONG QuadPart
Definition: typedefs.h:112

Referenced by construct_record(), and MsiRecordSetStreamW().

◆ MSI_RecordSetStringW()

UINT MSI_RecordSetStringW ( MSIRECORD rec,
UINT  iField,
LPCWSTR  szValue 
)

Definition at line 649 of file record.c.

650 {
651  TRACE("%p %d %s\n", rec, iField, debugstr_w(szValue));
652 
653  return msi_record_set_string( rec, iField, szValue, -1 );
654 }
UINT msi_record_set_string(MSIRECORD *rec, UINT field, const WCHAR *value, int len)
Definition: record.c:625
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by ACTION_ExecuteAction(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_ProcessComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterUser(), ACTION_RemoveFiles(), ACTION_ResolveSource(), ACTION_ShowDialog(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), add_stream(), construct_record(), deformat_string(), dialog_create(), event_set_target_path(), internal_ui_handler(), iterate_appsearch(), ITERATE_CreateFolders(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_MoveFiles(), iterate_properties(), ITERATE_PublishComponent(), ITERATE_RegisterFonts(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnregisterFonts(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), msi_change_media(), msi_create_table(), MSI_DatabaseExport(), msi_dialog_seltree_handler(), msi_file_update_ui(), MSI_FormatRecordW(), msi_get_property_row(), MSI_OpenPackageW(), msi_primary_key_iterator(), MSI_ProcessMessage(), msi_query_merge_record(), msi_set_record_type_string(), msi_unpublish_feature(), MSI_ViewGetColumnInfo(), MsiRecordSetStringA(), MsiRecordSetStringW(), patch_add_media(), patch_update_filepatch_sequence(), TABLE_add_column(), TABLE_drop(), TABLE_remove_column(), ui_actioninfo(), and ui_actionstart().

◆ MSI_RecordStreamToFile()

UINT MSI_RecordStreamToFile ( MSIRECORD rec,
UINT  iField,
LPCWSTR  name 
)

Definition at line 953 of file record.c.

954 {
955  IStream *stm = NULL;
956  UINT r;
957 
958  TRACE("%p %u %s\n", rec, iField, debugstr_w(name));
959 
960  msiobj_lock( &rec->hdr );
961 
962  r = MSI_RecordGetIStream( rec, iField, &stm );
963  if( r == ERROR_SUCCESS )
964  {
965  r = msi_dump_stream_to_file( stm, name );
966  IStream_Release( stm );
967  }
968 
969  msiobj_unlock( &rec->hdr );
970 
971  return r;
972 }
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:141
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static UINT msi_dump_stream_to_file(IStream *stm, LPCWSTR name)
Definition: record.c:921
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
UINT MSI_RecordGetIStream(MSIRECORD *rec, UINT iField, IStream **pstm)
Definition: record.c:905
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:36

Referenced by msi_load_image().

◆ msi_strdupW()

WCHAR* msi_strdupW ( const WCHAR value,
int  len 
)

Definition at line 158 of file record.c.

159 {
160  WCHAR *ret;
161 
162  if (!value) return NULL;
163  if (!(ret = msi_alloc( (len + 1) * sizeof(WCHAR) ))) return NULL;
164  memcpy( ret, value, len * sizeof(WCHAR) );
165  ret[len] = 0;
166  return ret;
167 }
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204

Referenced by ACTION_ExecuteAction(), msi_record_set_string(), MSI_RecordCopyField(), and parse_value().

◆ MsiCreateRecord()

MSIHANDLE WINAPI MsiCreateRecord ( UINT  cParams)

◆ MsiRecordClearData()

UINT WINAPI MsiRecordClearData ( MSIHANDLE  handle)

Definition at line 290 of file record.c.

291 {
292  MSIRECORD *rec;
293  UINT i;
294 
295  TRACE("%d\n", handle );
296 
298  if( !rec )
299  return ERROR_INVALID_HANDLE;
300 
301  msiobj_lock( &rec->hdr );
302  for( i=0; i<=rec->count; i++)
303  {
304  MSI_FreeField( &rec->fields[i] );
305  rec->fields[i].type = MSIFIELD_NULL;
306  rec->fields[i].u.iVal = 0;
307  }
308  msiobj_unlock( &rec->hdr );
309  msiobj_release( &rec->hdr );
310 
311  return ERROR_SUCCESS;
312 }
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:141
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
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
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:702
UINT count
Definition: msipriv.h:142
#define TRACE(s)
Definition: solgame.cpp:4
static void MSI_FreeField(MSIFIELD *field)
Definition: record.c:51
#define MSIFIELD_NULL
Definition: record.c:45
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
INT iVal
Definition: msipriv.h:131
MSIFIELD fields[1]
Definition: msipriv.h:143
unsigned int UINT
Definition: ndis.h:50
union tagMSIFIELD::@479 u
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157
UINT type
Definition: msipriv.h:128

Referenced by test_msirecord().

◆ MsiRecordDataSize()

UINT WINAPI MsiRecordDataSize ( MSIHANDLE  handle,
UINT  iField 
)

Definition at line 584 of file record.c.

585 {
586  MSIRECORD *rec;
587  UINT ret;
588 
589  TRACE("%d %d\n", handle, iField);
590 
592  if( !rec )
593  return 0;
594  msiobj_lock( &rec->hdr );
595  ret = MSI_RecordDataSize( rec, iField);
596  msiobj_unlock( &rec->hdr );
597  msiobj_release( &rec->hdr );
598  return ret;
599 }
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
MSIOBJECTHDR hdr
Definition: msipriv.h:141
static UINT MSI_RecordDataSize(MSIRECORD *rec, UINT iField)
Definition: record.c:563
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:702
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157

Referenced by test_msirecord().

◆ MsiRecordGetFieldCount()

UINT WINAPI MsiRecordGetFieldCount ( MSIHANDLE  handle)

Definition at line 116 of file record.c.

117 {
118  MSIRECORD *rec;
119  UINT ret;
120 
121  TRACE("%d\n", handle );
122 
124  if( !rec )
125  return -1;
126 
127  msiobj_lock( &rec->hdr );
128  ret = MSI_RecordGetFieldCount( rec );
129  msiobj_unlock( &rec->hdr );
130  msiobj_release( &rec->hdr );
131 
132  return ret;
133 }
UINT MSI_RecordGetFieldCount(const MSIRECORD *rec)
Definition: record.c:111
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
MSIOBJECTHDR hdr
Definition: msipriv.h:141
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:702
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157

Referenced by externalui_message_callback(), externalui_record_callback(), record_invoke(), test_integers(), test_join(), test_msiimport(), test_msiinsert(), test_msirecord(), test_packagecoltypes(), test_select_column_names(), test_stringtable(), and test_where().

◆ MsiRecordGetInteger()

int WINAPI MsiRecordGetInteger ( MSIHANDLE  handle,
UINT  iField 
)

Definition at line 271 of file record.c.

272 {
273  MSIRECORD *rec;
274  UINT ret;
275 
276  TRACE("%d %d\n", handle, iField );
277 
279  if( !rec )
280  return MSI_NULL_INTEGER;
281 
282  msiobj_lock( &rec->hdr );
283  ret = MSI_RecordGetInteger( rec, iField );
284  msiobj_unlock( &rec->hdr );
285  msiobj_release( &rec->hdr );
286 
287  return ret;
288 }
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
int MSI_RecordGetInteger(MSIRECORD *rec, UINT iField)
Definition: record.c:245
MSIOBJECTHDR hdr
Definition: msipriv.h:141
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:702
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157

Referenced by externalui_record_callback(), get_columns_table_type(), get_integer(), MsiProcessMessage(), ok_callback(), record_invoke(), test_columnorder(), test_dbmerge(), test_droptable(), test_fieldzero(), test_insertorder(), test_integers(), test_join(), test_msiimport(), test_msiinsert(), test_msirecord(), test_MsiRecordGetInteger(), test_noquotes(), test_order(), test_select_markers(), test_select_with_tablenames(), test_stringtable(), test_try_transform(), test_update(), test_viewmodify(), test_viewmodify_assign(), test_viewmodify_delete(), test_viewmodify_delete_temporary(), test_viewmodify_refresh(), test_viewmodify_update(), test_where(), and test_where_viewmodify().

◆ MsiRecordGetStringA()

UINT WINAPI MsiRecordGetStringA ( MSIHANDLE  handle,
UINT  iField,
LPSTR  szValue,
LPDWORD  pcchValue 
)

Definition at line 451 of file record.c.

453 {
454  MSIRECORD *rec;
455  UINT ret;
456 
457  TRACE("%d %d %p %p\n", handle, iField, szValue, pcchValue);
458 
460  if( !rec )
461  return ERROR_INVALID_HANDLE;
462  msiobj_lock( &rec->hdr );
463  ret = MSI_RecordGetStringA( rec, iField, szValue, pcchValue);
464  msiobj_unlock( &rec->hdr );
465  msiobj_release( &rec->hdr );
466  return ret;
467 }
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
MSIOBJECTHDR hdr
Definition: msipriv.h:141
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
UINT MSI_RecordGetStringA(MSIRECORD *rec, UINT iField, LPSTR szValue, LPDWORD pcchValue)
Definition: record.c:399
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:702
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157

Referenced by check_record(), externalui_message_callback(), find_prop_in_property(), get_string(), ok_callback(), test_binary(), test_binary_import(), test_carriagereturn(), test_collation(), test_columnorder(), test_createtable(), test_dbmerge(), test_deleterow(), test_droptable(), test_embedded_nulls(), test_emptypackage(), test_fieldzero(), test_getcolinfo(), test_join(), test_longstrings(), test_msiinsert(), test_msirecord(), test_MsiRecordGetString(), test_noquotes(), test_order(), test_quotes(), test_rows_order(), test_select_column_names(), test_select_markers(), test_storages_table(), test_streamtable(), test_stringtable(), test_tables_order(), test_temporary_table(), test_try_transform(), test_update(), test_viewmodify(), test_viewmodify_delete(), test_viewmodify_refresh(), and test_where().

◆ MsiRecordGetStringW()

UINT WINAPI MsiRecordGetStringW ( MSIHANDLE  handle,
UINT  iField,
LPWSTR  szValue,
LPDWORD  pcchValue 
)

Definition at line 533 of file record.c.

535 {
536  MSIRECORD *rec;
537  UINT ret;
538 
539  TRACE("%d %d %p %p\n", handle, iField, szValue, pcchValue);
540 
542  if( !rec )
543  return ERROR_INVALID_HANDLE;
544 
545  msiobj_lock( &rec->hdr );
546  ret = MSI_RecordGetStringW( rec, iField, szValue, pcchValue );
547  msiobj_unlock( &rec->hdr );
548  msiobj_release( &rec->hdr );
549  return ret;
550 }
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
MSIOBJECTHDR hdr
Definition: msipriv.h:141
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:702
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157
UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField, LPWSTR szValue, LPDWORD pcchValue)
Definition: record.c:487

Referenced by record_invoke(), test_collation(), and test_msirecord().

◆ MsiRecordIsNull()

BOOL WINAPI MsiRecordIsNull ( MSIHANDLE  handle,
UINT  iField 
)

Definition at line 381 of file record.c.

382 {
383  MSIRECORD *rec;
384  UINT ret;
385 
386  TRACE("%d %d\n", handle, iField );
387 
389  if( !rec )
390  return FALSE;
391  msiobj_lock( &rec->hdr );
392  ret = MSI_RecordIsNull( rec, iField );
393  msiobj_unlock( &rec->hdr );
394  msiobj_release( &rec->hdr );
395  return ret;
396 
397 }
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
MSIOBJECTHDR hdr
Definition: msipriv.h:141
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:702
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
BOOL MSI_RecordIsNull(MSIRECORD *rec, UINT iField)
Definition: record.c:369
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157

Referenced by test_fieldzero(), test_msiinsert(), and test_msirecord().

◆ MsiRecordReadStream()

UINT WINAPI MsiRecordReadStream ( MSIHANDLE  handle,
UINT  iField,
char buf,
LPDWORD  sz 
)

Definition at line 872 of file record.c.

873 {
874  MSIRECORD *rec;
875  UINT ret;
876 
877  TRACE("%d %d %p %p\n", handle, iField, buf, sz);
878 
880  if( !rec )
881  return ERROR_INVALID_HANDLE;
882  msiobj_lock( &rec->hdr );
883  ret = MSI_RecordReadStream( rec, iField, buf, sz );
884  msiobj_unlock( &rec->hdr );
885  msiobj_release( &rec->hdr );
886  return ret;
887 }
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
MSIOBJECTHDR hdr
Definition: msipriv.h:141
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:702
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
UINT MSI_RecordReadStream(MSIRECORD *rec, UINT iField, char *buf, LPDWORD sz)
Definition: record.c:814
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157

Referenced by test_binary(), test_binary_import(), test_dbmerge(), test_msirecord(), test_storages_table(), test_streamtable(), and test_try_transform().

◆ MsiRecordSetInteger()

UINT WINAPI MsiRecordSetInteger ( MSIHANDLE  handle,
UINT  iField,
int  iVal 
)

Definition at line 351 of file record.c.

352 {
353  MSIRECORD *rec;
354  UINT ret;
355 
356  TRACE("%d %u %d\n", handle, iField, iVal);
357 
359  if( !rec )
360  return ERROR_INVALID_HANDLE;
361 
362  msiobj_lock( &rec->hdr );
363  ret = MSI_RecordSetInteger( rec, iField, iVal );
364  msiobj_unlock( &rec->hdr );
365  msiobj_release( &rec->hdr );
366  return ret;
367 }
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
MSIOBJECTHDR hdr
Definition: msipriv.h:141
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:702
UINT MSI_RecordSetInteger(MSIRECORD *rec, UINT iField, int iVal)
Definition: record.c:328
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157

Referenced by generate_transform(), ok_(), record_invoke(), test_externalui(), test_externalui_message(), test_fieldzero(), test_formatrecord(), test_markers(), test_msiinsert(), test_msirecord(), test_MsiRecordGetString(), test_select_markers(), test_stringtable(), test_try_transform(), test_update(), test_viewmodify(), test_viewmodify_assign(), test_viewmodify_delete_temporary(), test_viewmodify_update(), and test_where_viewmodify().

◆ MsiRecordSetStreamA()

UINT WINAPI MsiRecordSetStreamA ( MSIHANDLE  hRecord,
UINT  iField,
LPCSTR  szFilename 
)

Definition at line 777 of file record.c.

778 {
779  LPWSTR wstr = NULL;
780  UINT ret;
781 
782  TRACE("%d %d %s\n", hRecord, iField, debugstr_a(szFilename));
783 
784  if( szFilename )
785  {
786  wstr = strdupAtoW( szFilename );
787  if( !wstr )
788  return ERROR_OUTOFMEMORY;
789  }
790  ret = MsiRecordSetStreamW(hRecord, iField, wstr);
791  msi_free(wstr);
792 
793  return ret;
794 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
int ret
UINT WINAPI MsiRecordSetStreamW(MSIHANDLE handle, UINT iField, LPCWSTR szFilename)
Definition: record.c:796
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by add_custom_dll(), generate_transform(), test_binary(), test_dbmerge(), test_icon_table(), test_msirecord(), test_storages_table(), test_streamtable(), and test_try_transform().

◆ MsiRecordSetStreamW()

UINT WINAPI MsiRecordSetStreamW ( MSIHANDLE  handle,
UINT  iField,
LPCWSTR  szFilename 
)

Definition at line 796 of file record.c.

797 {
798  MSIRECORD *rec;
799  UINT ret;
800 
801  TRACE("%d %d %s\n", handle, iField, debugstr_w(szFilename));
802 
804  if( !rec )
805  return ERROR_INVALID_HANDLE;
806 
807  msiobj_lock( &rec->hdr );
808  ret = MSI_RecordSetStreamFromFileW( rec, iField, szFilename );
809  msiobj_unlock( &rec->hdr );
810  msiobj_release( &rec->hdr );
811  return ret;
812 }
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
MSIOBJECTHDR hdr
Definition: msipriv.h:141
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
#define debugstr_w
Definition: kernel32.h:32
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:702
#define TRACE(s)
Definition: solgame.cpp:4
UINT MSI_RecordSetStreamFromFileW(MSIRECORD *rec, UINT iField, LPCWSTR szFilename)
Definition: record.c:736
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157

Referenced by MsiRecordSetStreamA().

◆ MsiRecordSetStringA()

UINT WINAPI MsiRecordSetStringA ( MSIHANDLE  handle,
UINT  iField,
LPCSTR  szValue 
)

Definition at line 601 of file record.c.

602 {
603  WCHAR *valueW = NULL;
604  MSIRECORD *rec;
605  UINT ret;
606 
607  TRACE("%d %d %s\n", handle, iField, debugstr_a(szValue));
608 
609  if (szValue && !(valueW = strdupAtoW( szValue ))) return ERROR_OUTOFMEMORY;
610 
612  if( !rec )
613  {
614  msi_free( valueW );
615  return ERROR_INVALID_HANDLE;
616  }
617  msiobj_lock( &rec->hdr );
618  ret = MSI_RecordSetStringW( rec, iField, valueW );
619  msiobj_unlock( &rec->hdr );
620  msiobj_release( &rec->hdr );
621  msi_free( valueW );
622  return ret;
623 }
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
MSIOBJECTHDR hdr
Definition: msipriv.h:141
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:702
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR valueW[]
Definition: object.c:45
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
UINT MSI_RecordSetStringW(MSIRECORD *rec, UINT iField, LPCWSTR szValue)
Definition: record.c:649
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by ok_(), query_file_path(), test_externalui(), test_externalui_message(), test_fieldzero(), test_formatrecord(), test_formatrecord2(), test_formatrecord_tables(), test_join(), test_markers(), test_msiinsert(), test_msirecord(), test_MsiRecordGetInteger(), test_select_markers(), test_storages_table(), test_streamtable(), test_stringtable(), test_update(), test_viewmodify(), test_where(), and try_insert_query().

◆ MsiRecordSetStringW()

UINT WINAPI MsiRecordSetStringW ( MSIHANDLE  handle,
UINT  iField,
LPCWSTR  szValue 
)

Definition at line 656 of file record.c.

657 {
658  MSIRECORD *rec;
659  UINT ret;
660 
661  TRACE("%d %d %s\n", handle, iField, debugstr_w(szValue));
662 
664  if( !rec )
665  return ERROR_INVALID_HANDLE;
666 
667  msiobj_lock( &rec->hdr );
668  ret = MSI_RecordSetStringW( rec, iField, szValue );
669  msiobj_unlock( &rec->hdr );
670  msiobj_release( &rec->hdr );
671  return ret;
672 }
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:232
MSIOBJECTHDR hdr
Definition: msipriv.h:141
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:237
#define debugstr_w
Definition: kernel32.h:32
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:702
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
UINT MSI_RecordSetStringW(MSIRECORD *rec, UINT iField, LPCWSTR szValue)
Definition: record.c:649
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157

Referenced by record_invoke().

◆ RECORD_StreamFromFile()

static UINT RECORD_StreamFromFile ( LPCWSTR  szFile,
IStream **  pstm 
)
static

Definition at line 675 of file record.c.

676 {
677  DWORD sz, szHighWord = 0, read;
678  HANDLE handle;
679  HGLOBAL hGlob = 0;
680  HRESULT hr;
681  ULARGE_INTEGER ulSize;
682 
683  TRACE("reading %s\n", debugstr_w(szFile));
684 
685  /* read the file into memory */
688  return GetLastError();
689  sz = GetFileSize(handle, &szHighWord);
690  if( sz != INVALID_FILE_SIZE && szHighWord == 0 )
691  {
692  hGlob = GlobalAlloc(GMEM_FIXED, sz);
693  if( hGlob )
694  {
695  BOOL r = ReadFile(handle, hGlob, sz, &read, NULL) && read == sz;
696  if( !r )
697  {
698  GlobalFree(hGlob);
699  hGlob = 0;
700  }
701  }
702  }
704  if( !hGlob )
705  return ERROR_FUNCTION_FAILED;
706 
707  /* make a stream out of it, and set the correct file size */
708  hr = CreateStreamOnHGlobal(hGlob, TRUE, pstm);
709  if( FAILED( hr ) )
710  {
711  GlobalFree(hGlob);
712  return ERROR_FUNCTION_FAILED;
713  }
714 
715  /* set the correct size - CreateStreamOnHGlobal screws it up */
716  ulSize.QuadPart = sz;
717  IStream_SetSize(*pstm, ulSize);
718 
719  TRACE("read %s, %d bytes into IStream %p\n", debugstr_w(szFile), sz, *pstm);
720 
721  return ERROR_SUCCESS;
722 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define TRUE
Definition: types.h:120
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define CloseHandle
Definition: compat.h:398
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
#define INVALID_FILE_SIZE
Definition: winbase.h:529
#define FILE_SHARE_READ
Definition: compat.h:125
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define OPEN_EXISTING
Definition: compat.h:426
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:481
#define GMEM_FIXED
Definition: winbase.h:290
#define GENERIC_READ
Definition: compat.h:124
#define CreateFileW
Definition: compat.h:400
BOOL WINAPI ReadFile(IN HANDLE hFile, IN LPVOID lpBuffer, IN DWORD nNumberOfBytesToRead, OUT LPDWORD lpNumberOfBytesRead OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:123
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)

Referenced by MSI_RecordSetStreamFromFileW().

◆ string2intW()

static BOOL string2intW ( LPCWSTR  str,
int out 
)
static

Definition at line 135 of file record.c.

136 {
137  int x = 0;
138  LPCWSTR p = str;
139 
140  if( *p == '-' ) /* skip the minus sign */
141  p++;
142  while ( *p )
143  {
144  if( (*p < '0') || (*p > '9') )
145  return FALSE;
146  x *= 10;
147  x += (*p - '0');
148  p++;
149  }
150 
151  if( str[0] == '-' ) /* check if it's negative */
152  x = -x;
153  *out = x;
154 
155  return TRUE;
156 }
#define TRUE
Definition: types.h:120
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
const WCHAR * str
static FILE * out
Definition: regtests2xml.c:44
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by MSI_RecordGetInteger(), and MSI_RecordGetIntPtr().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msidb  )