ReactOS  0.4.15-dev-5146-g069b08d
suminfo.c File Reference
#include <stdarg.h>
#include "stdio.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winnls.h"
#include "shlwapi.h"
#include "wine/debug.h"
#include "wine/exception.h"
#include "msi.h"
#include "msiquery.h"
#include "msidefs.h"
#include "objidl.h"
#include "propvarutil.h"
#include "msipriv.h"
#include "winemsi_s.h"
#include "pshpack1.h"
#include "poppack.h"
Include dependency graph for suminfo.c:

Go to the source code of this file.

Classes

struct  PROPERTYSETHEADER
 
struct  FORMATIDOFFSET
 
struct  PROPERTYSECTIONHEADER
 
struct  PROPERTYIDOFFSET
 
struct  PROPERTY_DATA
 

Macros

#define COBJMACROS
 
#define SECT_HDR_SIZE   (sizeof(PROPERTYSECTIONHEADER))
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
static HRESULT (WINAPI *pPropVariantChangeType)(PROPVARIANT *ppropvarDest
 
static void free_prop (PROPVARIANT *prop)
 
static void MSI_CloseSummaryInfo (MSIOBJECTHDR *arg)
 
static UINT get_type (UINT uiProperty)
 
static UINT get_property_count (const PROPVARIANT *property)
 
static UINT propvar_changetype (PROPVARIANT *changed, PROPVARIANT *property, VARTYPE vt)
 
static void read_properties_from_data (PROPVARIANT *prop, LPBYTE data, DWORD sz)
 
static UINT load_summary_info (MSISUMMARYINFO *si, IStream *stm)
 
static DWORD write_dword (LPBYTE data, DWORD ofs, DWORD val)
 
static DWORD write_filetime (LPBYTE data, DWORD ofs, const FILETIME *ft)
 
static DWORD write_string (LPBYTE data, DWORD ofs, LPCSTR str)
 
static UINT write_property_to_data (const PROPVARIANT *prop, LPBYTE data)
 
static UINT save_summary_info (const MSISUMMARYINFO *si, IStream *stm)
 
static MSISUMMARYINFOcreate_suminfo (IStorage *stg, UINT update_count)
 
UINT msi_get_suminfo (IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **ret)
 
UINT msi_get_db_suminfo (MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **ret)
 
UINT WINAPI MsiGetSummaryInformationW (MSIHANDLE hDatabase, const WCHAR *szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
 
UINT WINAPI MsiGetSummaryInformationA (MSIHANDLE hDatabase, const char *szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
 
UINT WINAPI MsiSummaryInfoGetPropertyCount (MSIHANDLE hSummaryInfo, UINT *pCount)
 
static UINT get_prop (MSISUMMARYINFO *si, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, awstring *str, DWORD *pcchValueBuf)
 
LPWSTR msi_suminfo_dup_string (MSISUMMARYINFO *si, UINT uiProperty)
 
INT msi_suminfo_get_int32 (MSISUMMARYINFO *si, UINT uiProperty)
 
LPWSTR msi_get_suminfo_product (IStorage *stg)
 
UINT WINAPI MsiSummaryInfoGetPropertyA (MSIHANDLE handle, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, char *szValueBuf, DWORD *pcchValueBuf)
 
UINT WINAPI MsiSummaryInfoGetPropertyW (MSIHANDLE handle, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, WCHAR *szValueBuf, DWORD *pcchValueBuf)
 
static UINT set_prop (MSISUMMARYINFO *si, UINT uiProperty, UINT type, INT iValue, FILETIME *pftValue, awcstring *str)
 
static UINT msi_set_prop (MSISUMMARYINFO *si, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue, awcstring *str)
 
UINT WINAPI MsiSummaryInfoSetPropertyW (MSIHANDLE handle, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue, const WCHAR *szValue)
 
UINT WINAPI MsiSummaryInfoSetPropertyA (MSIHANDLE handle, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue, const char *szValue)
 
static UINT suminfo_persist (MSISUMMARYINFO *si)
 
static void parse_filetime (LPCWSTR str, FILETIME *ft)
 
static UINT parse_prop (LPCWSTR prop, LPCWSTR value, UINT *pid, INT *int_value, FILETIME *ft_value, awcstring *str_value)
 
UINT msi_add_suminfo (MSIDATABASE *db, LPWSTR **records, int num_records, int num_columns)
 
static UINT save_prop (MSISUMMARYINFO *si, HANDLE handle, UINT row)
 
UINT msi_export_suminfo (MSIDATABASE *db, HANDLE handle)
 
UINT WINAPI MsiSummaryInfoPersist (MSIHANDLE handle)
 
UINT WINAPI MsiCreateTransformSummaryInfoA (MSIHANDLE db, MSIHANDLE db_ref, const char *transform, int error, int validation)
 
UINT WINAPI MsiCreateTransformSummaryInfoW (MSIHANDLE db, MSIHANDLE db_ref, const WCHAR *transform, int error, int validation)
 
UINT msi_load_suminfo_properties (MSIPACKAGE *package)
 
UINT __cdecl s_remote_SummaryInfoGetPropertyCount (MSIHANDLE suminfo, UINT *count)
 
UINT __cdecl s_remote_SummaryInfoGetProperty (MSIHANDLE suminfo, UINT property, UINT *type, INT *value, FILETIME *ft, LPWSTR *buf)
 

Variables

static REFPROPVARIANT propvarSrc
 
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS flags
 
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file suminfo.c.

◆ SECT_HDR_SIZE

#define SECT_HDR_SIZE   (sizeof(PROPERTYSECTIONHEADER))

Definition at line 88 of file suminfo.c.

Function Documentation

◆ create_suminfo()

static MSISUMMARYINFO* create_suminfo ( IStorage stg,
UINT  update_count 
)
static

Definition at line 443 of file suminfo.c.

444 {
445  MSISUMMARYINFO *si;
446 
448  return NULL;
449 
450  si->update_count = update_count;
451  IStorage_AddRef( stg );
452  si->storage = stg;
453 
454  return si;
455 }
IStorage * storage
Definition: msipriv.h:487
#define MSIHANDLETYPE_SUMMARYINFO
Definition: msipriv.h:723
void * alloc_msiobject(UINT type, UINT size, msihandledestructor destroy)
Definition: handle.c:201
static void MSI_CloseSummaryInfo(MSIOBJECTHDR *arg)
Definition: suminfo.c:97
#define NULL
Definition: types.h:112
DWORD update_count
Definition: msipriv.h:488

Referenced by msi_add_suminfo(), msi_get_db_suminfo(), msi_get_suminfo(), and MsiGetSummaryInformationW().

◆ free_prop()

static void free_prop ( PROPVARIANT *  prop)
static

Definition at line 90 of file suminfo.c.

91 {
92  if (prop->vt == VT_LPSTR )
93  msi_free( prop->pszVal );
94  prop->vt = VT_EMPTY;
95 }
static void msi_free(void *mem)
Definition: msipriv.h:1159

Referenced by MSI_CloseSummaryInfo(), and set_prop().

◆ get_prop()

static UINT get_prop ( MSISUMMARYINFO si,
UINT  uiProperty,
UINT puiDataType,
INT piValue,
FILETIME pftValue,
awstring str,
DWORD pcchValueBuf 
)
static

Definition at line 641 of file suminfo.c.

643 {
644  PROPVARIANT *prop;
646 
647  prop = &si->property[uiProperty];
648 
649  if( puiDataType )
650  *puiDataType = prop->vt;
651 
652  switch( prop->vt )
653  {
654  case VT_I2:
655  if( piValue )
656  *piValue = prop->iVal;
657  break;
658  case VT_I4:
659  if( piValue )
660  *piValue = prop->lVal;
661  break;
662  case VT_LPSTR:
663  if( pcchValueBuf )
664  {
665  DWORD len = 0;
666 
667  if( str->unicode )
668  {
669  len = MultiByteToWideChar( CP_ACP, 0, prop->pszVal, -1, NULL, 0 ) - 1;
670  MultiByteToWideChar( CP_ACP, 0, prop->pszVal, -1, str->str.w, *pcchValueBuf );
671  }
672  else
673  {
674  len = lstrlenA( prop->pszVal );
675  if( str->str.a )
676  lstrcpynA(str->str.a, prop->pszVal, *pcchValueBuf );
677  }
678  if (len >= *pcchValueBuf)
680  *pcchValueBuf = len;
681  }
682  break;
683  case VT_FILETIME:
684  if( pftValue )
685  *pftValue = prop->filetime;
686  break;
687  case VT_EMPTY:
688  break;
689  default:
690  FIXME("Unknown property variant type\n");
691  break;
692  }
693  return ret;
694 }
Definition: compat.h:2157
#define ERROR_SUCCESS
Definition: deptool.c:10
#define CP_ACP
Definition: compat.h:109
#define FIXME(fmt,...)
Definition: debug.h:111
const WCHAR * str
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
PROPVARIANT property[MSI_MAX_PROPS]
Definition: msipriv.h:489
#define ERROR_MORE_DATA
Definition: dderror.h:13
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define lstrcpynA
Definition: compat.h:610
#define MultiByteToWideChar
Definition: compat.h:110
Definition: compat.h:2156

Referenced by msi_load_suminfo_properties(), MsiSummaryInfoGetPropertyA(), MsiSummaryInfoGetPropertyW(), and save_prop().

◆ get_property_count()

static UINT get_property_count ( const PROPVARIANT *  property)
static

Definition at line 153 of file suminfo.c.

154 {
155  UINT i, n = 0;
156 
157  if( !property )
158  return n;
159  for( i = 0; i < MSI_MAX_PROPS; i++ )
160  if( property[i].vt != VT_EMPTY )
161  n++;
162  return n;
163 }
GLdouble n
Definition: glext.h:7729
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
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 MSI_MAX_PROPS
Definition: msipriv.h:482

Referenced by msi_export_suminfo(), MsiSummaryInfoGetPropertyCount(), and save_summary_info().

◆ get_type()

static UINT get_type ( UINT  uiProperty)
static

Definition at line 113 of file suminfo.c.

114 {
115  switch( uiProperty )
116  {
117 #ifdef __REACTOS__
118  case PID_CODEPAGE_MSI:
119 #else
120  case PID_CODEPAGE:
121 #endif
122  return VT_I2;
123 
124  case PID_SUBJECT:
125  case PID_AUTHOR:
126  case PID_KEYWORDS:
127  case PID_COMMENTS:
128  case PID_TEMPLATE:
129  case PID_LASTAUTHOR:
130  case PID_REVNUMBER:
131  case PID_APPNAME:
132  case PID_TITLE:
133  return VT_LPSTR;
134 
135  case PID_LASTPRINTED:
136  case PID_CREATE_DTM:
137  case PID_LASTSAVE_DTM:
138  return VT_FILETIME;
139 
140  case PID_WORDCOUNT:
141  case PID_CHARCOUNT:
142 #ifdef __REACTOS__
143  case PID_SECURITY_MSI:
144 #else
145  case PID_SECURITY:
146 #endif
147  case PID_PAGECOUNT:
148  return VT_I4;
149  }
150  return VT_EMPTY;
151 }
#define PID_TEMPLATE
Definition: suminfo.c:49
Definition: compat.h:2157
#define PID_CHARCOUNT
Definition: suminfo.c:58
#define PID_COMMENTS
Definition: suminfo.c:48
#define PID_REVNUMBER
Definition: suminfo.c:51
#define PID_CODEPAGE
Definition: suminfo.c:43
#define PID_LASTPRINTED
Definition: suminfo.c:53
#define PID_LASTAUTHOR
Definition: suminfo.c:50
#define PID_LASTSAVE_DTM
Definition: suminfo.c:55
#define PID_AUTHOR
Definition: suminfo.c:46
#define PID_PAGECOUNT
Definition: suminfo.c:56
#define PID_APPNAME
Definition: suminfo.c:60
#define PID_TITLE
Definition: suminfo.c:44
#define PID_SUBJECT
Definition: suminfo.c:45
#define PID_KEYWORDS
Definition: suminfo.c:47
#define PID_CREATE_DTM
Definition: suminfo.c:54
#define PID_SECURITY
Definition: suminfo.c:61
#define PID_WORDCOUNT
Definition: suminfo.c:57
Definition: compat.h:2156

Referenced by msi_add_suminfo(), msi_set_prop(), and read_properties_from_data().

◆ HRESULT()

static HRESULT ( WINAPI pPropVariantChangeType)
static

◆ load_summary_info()

static UINT load_summary_info ( MSISUMMARYINFO si,
IStream stm 
)
static

Definition at line 251 of file suminfo.c.

252 {
253  PROPERTYSETHEADER set_hdr;
254  FORMATIDOFFSET format_hdr;
255  PROPERTYSECTIONHEADER section_hdr;
256  LPBYTE data = NULL;
257  LARGE_INTEGER ofs;
258  ULONG count, sz;
259  HRESULT r;
260 
261  TRACE("%p %p\n", si, stm);
262 
263  /* read the header */
264  sz = sizeof set_hdr;
265  r = IStream_Read( stm, &set_hdr, sz, &count );
266  if( FAILED(r) || count != sz )
267  return ERROR_FUNCTION_FAILED;
268 
269  if( set_hdr.wByteOrder != 0xfffe )
270  {
271  ERR("property set not big-endian %04X\n", set_hdr.wByteOrder);
272  return ERROR_FUNCTION_FAILED;
273  }
274 
275  sz = sizeof format_hdr;
276  r = IStream_Read( stm, &format_hdr, sz, &count );
277  if( FAILED(r) || count != sz )
278  return ERROR_FUNCTION_FAILED;
279 
280  /* check the format id is correct */
281  if( !IsEqualGUID( &FMTID_SummaryInformation, &format_hdr.fmtid ) )
282  return ERROR_FUNCTION_FAILED;
283 
284  /* seek to the location of the section */
285  ofs.QuadPart = format_hdr.dwOffset;
286  r = IStream_Seek( stm, ofs, STREAM_SEEK_SET, NULL );
287  if( FAILED(r) )
288  return ERROR_FUNCTION_FAILED;
289 
290  /* read the section itself */
291  sz = SECT_HDR_SIZE;
292  r = IStream_Read( stm, &section_hdr, sz, &count );
293  if( FAILED(r) || count != sz )
294  return ERROR_FUNCTION_FAILED;
295 
296  if( section_hdr.cProperties > MSI_MAX_PROPS )
297  {
298  ERR( "too many properties %lu\n", section_hdr.cProperties );
299  return ERROR_FUNCTION_FAILED;
300  }
301 
302  data = msi_alloc( section_hdr.cbSection);
303  if( !data )
304  return ERROR_FUNCTION_FAILED;
305 
306  memcpy( data, &section_hdr, SECT_HDR_SIZE );
307 
308  /* read all the data in one go */
309  sz = section_hdr.cbSection - SECT_HDR_SIZE;
310  r = IStream_Read( stm, &data[ SECT_HDR_SIZE ], sz, &count );
311  if( SUCCEEDED(r) && count == sz )
313  else
314  ERR( "failed to read properties %lu %lu\n", count, sz );
315 
316  msi_free( data );
317  return ERROR_SUCCESS;
318 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
FMTID fmtid
Definition: suminfo.c:55
static void msi_free(void *mem)
Definition: msipriv.h:1159
const FMTID FMTID_SummaryInformation
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
unsigned char * LPBYTE
Definition: typedefs.h:53
if SUCCEEDED(hr)
DWORD dwOffset
Definition: suminfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
PROPVARIANT property[MSI_MAX_PROPS]
Definition: msipriv.h:489
#define ERR(fmt,...)
Definition: debug.h:110
#define NULL
Definition: types.h:112
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
unsigned int ULONG
Definition: retypes.h:1
#define MSI_MAX_PROPS
Definition: msipriv.h:482
static void read_properties_from_data(PROPVARIANT *prop, LPBYTE data, DWORD sz)
Definition: suminfo.c:182
#define SECT_HDR_SIZE
Definition: suminfo.c:88
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by msi_get_db_suminfo(), and msi_get_suminfo().

◆ msi_add_suminfo()

UINT msi_add_suminfo ( MSIDATABASE db,
LPWSTR **  records,
int  num_records,
int  num_columns 
)

Definition at line 1073 of file suminfo.c.

1074 {
1075  UINT r;
1076  int i, j;
1077  MSISUMMARYINFO *si;
1078 
1079  r = msi_get_suminfo( db->storage, num_records * (num_columns / 2), &si );
1080  if (r != ERROR_SUCCESS)
1081  {
1082  if (!(si = create_suminfo( db->storage, num_records * (num_columns / 2) )))
1083  return ERROR_OUTOFMEMORY;
1084  r = ERROR_SUCCESS;
1085  }
1086 
1087  for (i = 0; i < num_records; i++)
1088  {
1089  for (j = 0; j < num_columns; j += 2)
1090  {
1091  UINT pid;
1092  INT int_value = 0;
1093  FILETIME ft_value;
1094  awcstring str_value;
1095 
1096  r = parse_prop( records[i][j], records[i][j + 1], &pid, &int_value, &ft_value, &str_value );
1097  if (r != ERROR_SUCCESS)
1098  goto end;
1099 
1100  r = set_prop( si, pid, get_type(pid), int_value, &ft_value, &str_value );
1101  if (r != ERROR_SUCCESS)
1102  goto end;
1103  }
1104  }
1105 
1106 end:
1107  if (r == ERROR_SUCCESS)
1108  r = suminfo_persist( si );
1109 
1110  msiobj_release( &si->hdr );
1111  return r;
1112 }
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
int32_t INT
Definition: typedefs.h:58
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 GLint GLint j
Definition: glfuncs.h:250
static UINT get_type(UINT uiProperty)
Definition: suminfo.c:113
static UINT suminfo_persist(MSISUMMARYINFO *si)
Definition: suminfo.c:967
static MSISUMMARYINFO * create_suminfo(IStorage *stg, UINT update_count)
Definition: suminfo.c:443
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
GLuint GLuint end
Definition: gl.h:1545
static UINT set_prop(MSISUMMARYINFO *si, UINT uiProperty, UINT type, INT iValue, FILETIME *pftValue, awcstring *str)
Definition: suminfo.c:837
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_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **ret)
Definition: suminfo.c:457
static UINT parse_prop(LPCWSTR prop, LPCWSTR value, UINT *pid, INT *int_value, FILETIME *ft_value, awcstring *str_value)
Definition: suminfo.c:1024
IStorage * storage
Definition: msipriv.h:109
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by MSI_DatabaseImport().

◆ MSI_CloseSummaryInfo()

static void MSI_CloseSummaryInfo ( MSIOBJECTHDR arg)
static

Definition at line 97 of file suminfo.c.

98 {
100  DWORD i;
101 
102  for( i = 0; i < MSI_MAX_PROPS; i++ )
103  free_prop( &si->property[i] );
104  IStorage_Release( si->storage );
105 }
IStorage * storage
Definition: msipriv.h:487
static void free_prop(PROPVARIANT *prop)
Definition: suminfo.c:90
unsigned long DWORD
Definition: ntddk_ex.h:95
PROPVARIANT property[MSI_MAX_PROPS]
Definition: msipriv.h:489
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 MSI_MAX_PROPS
Definition: msipriv.h:482

Referenced by create_suminfo().

◆ msi_export_suminfo()

UINT msi_export_suminfo ( MSIDATABASE db,
HANDLE  handle 
)

Definition at line 1190 of file suminfo.c.

1191 {
1192  UINT i, r, num_rows;
1193  MSISUMMARYINFO *si;
1194 
1195  r = msi_get_suminfo( db->storage, 0, &si );
1196  if (r != ERROR_SUCCESS)
1197  r = msi_get_db_suminfo( db, 0, &si );
1198  if (r != ERROR_SUCCESS)
1199  return r;
1200 
1202  if (!num_rows)
1203  {
1204  msiobj_release( &si->hdr );
1205  return ERROR_FUNCTION_FAILED;
1206  }
1207 
1208  for (i = 0; i < num_rows; i++)
1209  {
1210  r = save_prop( si, handle, i );
1211  if (r != ERROR_SUCCESS)
1212  {
1213  msiobj_release( &si->hdr );
1214  return r;
1215  }
1216  }
1217 
1218  msiobj_release( &si->hdr );
1219  return ERROR_SUCCESS;
1220 }
static UINT save_prop(MSISUMMARYINFO *si, HANDLE handle, UINT row)
Definition: suminfo.c:1114
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT get_property_count(const PROPVARIANT *property)
Definition: suminfo.c:153
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT msi_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **ret)
Definition: suminfo.c:487
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
int JSAMPARRAY int int num_rows
Definition: jpegint.h:419
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
PROPVARIANT property[MSI_MAX_PROPS]
Definition: msipriv.h:489
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_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **ret)
Definition: suminfo.c:457
IStorage * storage
Definition: msipriv.h:109

Referenced by msi_export_summaryinformation().

◆ msi_get_db_suminfo()

UINT msi_get_db_suminfo ( MSIDATABASE db,
UINT  uiUpdateCount,
MSISUMMARYINFO **  ret 
)

Definition at line 487 of file suminfo.c.

488 {
489  IStream *stm;
490  MSISUMMARYINFO *si;
491  UINT r;
492 
493  if (!(si = create_suminfo( db->storage, uiUpdateCount ))) return ERROR_OUTOFMEMORY;
494 
495  r = msi_get_stream( db, L"\5SummaryInformation", &stm );
496  if (r != ERROR_SUCCESS)
497  {
498  msiobj_release( &si->hdr );
499  return r;
500  }
501 
502  r = load_summary_info( si, stm );
503  IStream_Release( stm );
504  if (r != ERROR_SUCCESS)
505  {
506  msiobj_release( &si->hdr );
507  return r;
508  }
509 
510  *ret = si;
511  return ERROR_SUCCESS;
512 }
UINT msi_get_stream(MSIDATABASE *, const WCHAR *, IStream **) DECLSPEC_HIDDEN
Definition: streams.c:499
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define L(x)
Definition: ntvdm.h:50
static UINT load_summary_info(MSISUMMARYINFO *si, IStream *stm)
Definition: suminfo.c:251
static MSISUMMARYINFO * create_suminfo(IStorage *stg, UINT update_count)
Definition: suminfo.c:443
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
int ret
unsigned int UINT
Definition: ndis.h:50
IStorage * storage
Definition: msipriv.h:109
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by msi_export_suminfo(), msi_get_package_code(), msi_load_suminfo_properties(), MSI_OpenPackageW(), and MsiGetSummaryInformationW().

◆ msi_get_suminfo()

UINT msi_get_suminfo ( IStorage stg,
UINT  uiUpdateCount,
MSISUMMARYINFO **  ret 
)

Definition at line 457 of file suminfo.c.

458 {
459  IStream *stm;
460  MSISUMMARYINFO *si;
461  HRESULT hr;
462  UINT r;
463 
464  TRACE("%p, %u\n", stg, uiUpdateCount);
465 
466  if (!(si = create_suminfo( stg, uiUpdateCount ))) return ERROR_OUTOFMEMORY;
467 
468  hr = IStorage_OpenStream( si->storage, L"\5SummaryInformation", 0, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stm );
469  if (FAILED( hr ))
470  {
471  msiobj_release( &si->hdr );
472  return ERROR_FUNCTION_FAILED;
473  }
474 
475  r = load_summary_info( si, stm );
476  IStream_Release( stm );
477  if (r != ERROR_SUCCESS)
478  {
479  msiobj_release( &si->hdr );
480  return r;
481  }
482 
483  *ret = si;
484  return ERROR_SUCCESS;
485 }
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:923
IStorage * storage
Definition: msipriv.h:487
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define L(x)
Definition: ntvdm.h:50
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
static UINT load_summary_info(MSISUMMARYINFO *si, IStream *stm)
Definition: suminfo.c:251
#define STGM_READ
Definition: objbase.h:917
#define TRACE(s)
Definition: solgame.cpp:4
static MSISUMMARYINFO * create_suminfo(IStorage *stg, UINT update_count)
Definition: suminfo.c:443
LONG HRESULT
Definition: typedefs.h:79
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
int ret
unsigned int UINT
Definition: ndis.h:50
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by check_transform_applicable(), msi_add_suminfo(), MSI_ApplicablePatchW(), msi_apply_patch_package(), msi_apply_registered_patch(), msi_export_suminfo(), msi_get_package_code(), msi_get_suminfo_product(), msi_load_suminfo_properties(), MSI_OpenPackageW(), and MsiGetSummaryInformationW().

◆ msi_get_suminfo_product()

LPWSTR msi_get_suminfo_product ( IStorage stg)

Definition at line 720 of file suminfo.c.

721 {
722  MSISUMMARYINFO *si;
723  LPWSTR prod;
724  UINT r;
725 
726  r = msi_get_suminfo( stg, 0, &si );
727  if (r != ERROR_SUCCESS)
728  {
729  ERR("no summary information!\n");
730  return NULL;
731  }
733  msiobj_release( &si->hdr );
734  return prod;
735 }
LPWSTR msi_suminfo_dup_string(MSISUMMARYINFO *si, UINT uiProperty)
Definition: suminfo.c:696
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define PID_REVNUMBER
Definition: suminfo.c:51
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define ERR(fmt,...)
Definition: debug.h:110
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **ret)
Definition: suminfo.c:457
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by check_transform_applicable().

◆ msi_load_suminfo_properties()

UINT msi_load_suminfo_properties ( MSIPACKAGE package)

Definition at line 1262 of file suminfo.c.

1263 {
1264  MSISUMMARYINFO *si;
1265  WCHAR *package_code;
1266  UINT r;
1267  DWORD len;
1268  awstring str;
1269  INT count;
1270 
1271  r = msi_get_suminfo( package->db->storage, 0, &si );
1272  if (r != ERROR_SUCCESS)
1273  {
1274  r = msi_get_db_suminfo( package->db, 0, &si );
1275  if (r != ERROR_SUCCESS)
1276  {
1277  ERR("Unable to open summary information stream %u\n", r);
1278  return r;
1279  }
1280  }
1281 
1282  str.unicode = TRUE;
1283  str.str.w = NULL;
1284  len = 0;
1285  r = get_prop( si, PID_REVNUMBER, NULL, NULL, NULL, &str, &len );
1286  if (r != ERROR_MORE_DATA)
1287  {
1288  WARN("Unable to query revision number %u\n", r);
1289  msiobj_release( &si->hdr );
1290  return ERROR_FUNCTION_FAILED;
1291  }
1292 
1293  len++;
1294  if (!(package_code = msi_alloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
1295  str.str.w = package_code;
1296 
1297  r = get_prop( si, PID_REVNUMBER, NULL, NULL, NULL, &str, &len );
1298  if (r != ERROR_SUCCESS)
1299  {
1300  msi_free( package_code );
1301  msiobj_release( &si->hdr );
1302  return r;
1303  }
1304 
1305  r = msi_set_property( package->db, L"PackageCode", package_code, len );
1306  msi_free( package_code );
1307 
1308  count = 0;
1309  get_prop( si, PID_WORDCOUNT, NULL, &count, NULL, NULL, NULL );
1310  package->WordCount = count;
1311 
1312  msiobj_release( &si->hdr );
1313  return r;
1314 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:112
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define PID_REVNUMBER
Definition: suminfo.c:51
int32_t INT
Definition: typedefs.h:58
UINT msi_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **ret)
Definition: suminfo.c:487
#define L(x)
Definition: ntvdm.h:50
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
const WCHAR * str
UINT WordCount
Definition: msipriv.h:458
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
MSIDATABASE * db
Definition: msipriv.h:394
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
GLenum GLsizei len
Definition: glext.h:6722
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERR(fmt,...)
Definition: debug.h:110
static UINT get_prop(MSISUMMARYINFO *si, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, awstring *str, DWORD *pcchValueBuf)
Definition: suminfo.c:641
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: package.c:2100
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **ret)
Definition: suminfo.c:457
#define PID_WORDCOUNT
Definition: suminfo.c:57
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
IStorage * storage
Definition: msipriv.h:109
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by MSI_CreatePackage().

◆ msi_set_prop()

static UINT msi_set_prop ( MSISUMMARYINFO si,
UINT  uiProperty,
UINT  uiDataType,
INT  iValue,
FILETIME pftValue,
awcstring str 
)
static

Definition at line 891 of file suminfo.c.

893 {
894  UINT type = get_type( uiProperty );
895  if( type == VT_EMPTY || type != uiDataType )
897 
898  if( uiDataType == VT_LPSTR && !str->str.a )
900 
901  if( uiDataType == VT_FILETIME && !pftValue )
903 
904  return set_prop( si, uiProperty, type, iValue, pftValue, str );
905 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_DATATYPE_MISMATCH
Definition: winerror.h:987
const WCHAR * str
static UINT get_type(UINT uiProperty)
Definition: suminfo.c:113
static UINT set_prop(MSISUMMARYINFO *si, UINT uiProperty, UINT type, INT iValue, FILETIME *pftValue, awcstring *str)
Definition: suminfo.c:837
unsigned int UINT
Definition: ndis.h:50
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by MsiSummaryInfoSetPropertyA(), and MsiSummaryInfoSetPropertyW().

◆ msi_suminfo_dup_string()

LPWSTR msi_suminfo_dup_string ( MSISUMMARYINFO si,
UINT  uiProperty 
)

Definition at line 696 of file suminfo.c.

697 {
698  PROPVARIANT *prop;
699 
700  if ( uiProperty >= MSI_MAX_PROPS )
701  return NULL;
702  prop = &si->property[uiProperty];
703  if( prop->vt != VT_LPSTR )
704  return NULL;
705  return strdupAtoW( prop->pszVal );
706 }
PROPVARIANT property[MSI_MAX_PROPS]
Definition: msipriv.h:489
#define NULL
Definition: types.h:112
#define MSI_MAX_PROPS
Definition: msipriv.h:482
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65

Referenced by check_transform_applicable(), msi_check_patch_applicable(), msi_get_package_code(), msi_get_suminfo_product(), msi_parse_patch_summary(), and parse_suminfo().

◆ msi_suminfo_get_int32()

INT msi_suminfo_get_int32 ( MSISUMMARYINFO si,
UINT  uiProperty 
)

Definition at line 708 of file suminfo.c.

709 {
710  PROPVARIANT *prop;
711 
712  if ( uiProperty >= MSI_MAX_PROPS )
713  return -1;
714  prop = &si->property[uiProperty];
715  if( prop->vt != VT_I4 )
716  return -1;
717  return prop->lVal;
718 }
Definition: compat.h:2157
PROPVARIANT property[MSI_MAX_PROPS]
Definition: msipriv.h:489
#define MSI_MAX_PROPS
Definition: msipriv.h:482

Referenced by check_transform_applicable(), and parse_suminfo().

◆ MsiCreateTransformSummaryInfoA()

UINT WINAPI MsiCreateTransformSummaryInfoA ( MSIHANDLE  db,
MSIHANDLE  db_ref,
const char transform,
int  error,
int  validation 
)

Definition at line 1239 of file suminfo.c.

1241 {
1242  UINT r;
1243  WCHAR *transformW = NULL;
1244 
1245  TRACE( "%lu, %lu, %s, %d, %d\n", db, db_ref, debugstr_a(transform), error, validation );
1246 
1247  if (transform && !(transformW = strdupAtoW( transform )))
1248  return ERROR_OUTOFMEMORY;
1249 
1250  r = MsiCreateTransformSummaryInfoW( db, db_ref, transformW, error, validation );
1251  msi_free( transformW );
1252  return r;
1253 }
#define error(str)
Definition: mkdosfs.c:1605
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
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
UINT WINAPI MsiCreateTransformSummaryInfoW(MSIHANDLE db, MSIHANDLE db_ref, const WCHAR *transform, int error, int validation)
Definition: suminfo.c:1255
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
GLuint GLenum GLenum transform
Definition: glext.h:9407
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by generate_transform(), and test_invalid_functions().

◆ MsiCreateTransformSummaryInfoW()

UINT WINAPI MsiCreateTransformSummaryInfoW ( MSIHANDLE  db,
MSIHANDLE  db_ref,
const WCHAR transform,
int  error,
int  validation 
)

Definition at line 1255 of file suminfo.c.

1257 {
1258  FIXME( "%lu, %lu, %s, %d, %d\n", db, db_ref, debugstr_w(transform), error, validation );
1259  return ERROR_FUNCTION_FAILED;
1260 }
#define error(str)
Definition: mkdosfs.c:1605
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
GLuint GLenum GLenum transform
Definition: glext.h:9407

Referenced by MsiCreateTransformSummaryInfoA().

◆ MsiGetSummaryInformationA()

UINT WINAPI MsiGetSummaryInformationA ( MSIHANDLE  hDatabase,
const char szDatabase,
UINT  uiUpdateCount,
MSIHANDLE pHandle 
)

Definition at line 584 of file suminfo.c.

586 {
587  WCHAR *szwDatabase = NULL;
588  UINT ret;
589 
590  TRACE( "%lu, %s, %u, %p\n", hDatabase, debugstr_a(szDatabase), uiUpdateCount, pHandle );
591 
592  if( szDatabase )
593  {
594  szwDatabase = strdupAtoW( szDatabase );
595  if( !szwDatabase )
596  return ERROR_FUNCTION_FAILED;
597  }
598 
599  ret = MsiGetSummaryInformationW(hDatabase, szwDatabase, uiUpdateCount, pHandle);
600 
601  msi_free( szwDatabase );
602 
603  return ret;
604 }
UINT WINAPI MsiGetSummaryInformationW(MSIHANDLE hDatabase, const WCHAR *szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
Definition: suminfo.c:514
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
int ret
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65

Referenced by helper_createpackage(), set_admin_summary_info(), set_suminfo(), set_suminfo_prop(), set_summary_dword(), set_summary_info(), set_summary_str(), set_transform_summary_info(), test_db(), test_emptypackage(), test_streamtable(), test_suminfo(), test_suminfo_import(), test_summary_binary(), and write_msi_summary_info().

◆ MsiGetSummaryInformationW()

UINT WINAPI MsiGetSummaryInformationW ( MSIHANDLE  hDatabase,
const WCHAR szDatabase,
UINT  uiUpdateCount,
MSIHANDLE pHandle 
)

Definition at line 514 of file suminfo.c.

516 {
517  MSISUMMARYINFO *si;
518  MSIDATABASE *db;
519  UINT ret;
520 
521  TRACE( "%lu, %s, %u, %p\n", hDatabase, debugstr_w(szDatabase), uiUpdateCount, pHandle );
522 
523  if( !pHandle )
525 
526  if( szDatabase && szDatabase[0] )
527  {
528  LPCWSTR persist = uiUpdateCount ? MSIDBOPEN_TRANSACT : MSIDBOPEN_READONLY;
529 
530  ret = MSI_OpenDatabaseW( szDatabase, persist, &db );
531  if( ret != ERROR_SUCCESS )
532  return ret;
533  }
534  else
535  {
536  db = msihandle2msiinfo( hDatabase, MSIHANDLETYPE_DATABASE );
537  if( !db )
538  {
539  MSIHANDLE remote, remote_suminfo;
540 
541  if (!(remote = msi_get_remote(hDatabase)))
542  return ERROR_INVALID_HANDLE;
543 
544  __TRY
545  {
546  ret = remote_DatabaseGetSummaryInformation(remote, uiUpdateCount, &remote_suminfo);
547  }
549  {
550  ret = GetExceptionCode();
551  }
552  __ENDTRY
553 
554  if (!ret)
555  *pHandle = alloc_msi_remote_handle(remote_suminfo);
556 
557  return ret;
558  }
559  }
560 
561  ret = msi_get_suminfo( db->storage, uiUpdateCount, &si );
562  if (ret != ERROR_SUCCESS)
563  ret = msi_get_db_suminfo( db, uiUpdateCount, &si );
564  if (ret != ERROR_SUCCESS)
565  {
566  if ((si = create_suminfo( db->storage, uiUpdateCount )))
567  ret = ERROR_SUCCESS;
568  }
569 
570  if (ret == ERROR_SUCCESS)
571  {
572  *pHandle = alloc_msihandle( &si->hdr );
573  if( *pHandle )
574  ret = ERROR_SUCCESS;
575  else
577  msiobj_release( &si->hdr );
578  }
579 
580  msiobj_release( &db->hdr );
581  return ret;
582 }
#define __EXCEPT(func)
Definition: exception.h:84
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
Definition: database.c:140
#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_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **ret)
Definition: suminfo.c:487
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
static MSISUMMARYINFO * create_suminfo(IStorage *stg, UINT update_count)
Definition: suminfo.c:443
#define MSIDBOPEN_TRANSACT
Definition: msiquery.h:67
MSIOBJECTHDR hdr
Definition: msipriv.h:486
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
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **ret)
Definition: suminfo.c:457
IStorage * storage
Definition: msipriv.h:109
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
MSIOBJECTHDR hdr
Definition: msipriv.h:108
MSIHANDLE alloc_msi_remote_handle(MSIHANDLE remote)
Definition: handle.c:135

Referenced by database_invoke(), get_patch_product_codes(), InstallerImpl_SummaryInformation(), MsiGetSummaryInformationA(), and s_remote_DatabaseGetSummaryInformation().

◆ MsiSummaryInfoGetPropertyA()

UINT WINAPI MsiSummaryInfoGetPropertyA ( MSIHANDLE  handle,
UINT  uiProperty,
UINT puiDataType,
INT piValue,
FILETIME pftValue,
char szValueBuf,
DWORD pcchValueBuf 
)

Definition at line 737 of file suminfo.c.

739 {
740  MSISUMMARYINFO *si;
741  awstring str;
742  UINT r;
743 
744  TRACE( "%lu, %u, %p, %p, %p, %p, %p\n", handle, uiProperty, puiDataType, piValue, pftValue, szValueBuf,
745  pcchValueBuf );
746 
747  if (uiProperty >= MSI_MAX_PROPS)
748  {
749  if (puiDataType) *puiDataType = VT_EMPTY;
750  return ERROR_UNKNOWN_PROPERTY;
751  }
752 
754  {
755  MSIHANDLE remote;
756  WCHAR *buf = NULL;
757 
758  if (!(remote = msi_get_remote( handle )))
759  return ERROR_INVALID_HANDLE;
760 
761  __TRY
762  {
763  r = remote_SummaryInfoGetProperty( remote, uiProperty, puiDataType, piValue, pftValue, &buf );
764  }
766  {
767  r = GetExceptionCode();
768  }
769  __ENDTRY
770 
771  if (!r && buf)
772  {
773  r = msi_strncpyWtoA( buf, -1, szValueBuf, pcchValueBuf, TRUE );
774  }
775 
776  midl_user_free( buf );
777  return r;
778  }
779 
780  str.unicode = FALSE;
781  str.str.a = szValueBuf;
782 
783  r = get_prop( si, uiProperty, puiDataType, piValue, pftValue, &str, pcchValueBuf );
784  msiobj_release( &si->hdr );
785  return r;
786 }
#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
#define ERROR_UNKNOWN_PROPERTY
Definition: winerror.h:966
#define TRUE
Definition: types.h:120
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define MSIHANDLETYPE_SUMMARYINFO
Definition: msipriv.h:723
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
UINT msi_strncpyWtoA(const WCHAR *str, int lenW, char *buf, DWORD *sz, BOOL remote)
Definition: install.c:190
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define FALSE
Definition: types.h:117
unsigned long MSIHANDLE
Definition: winemsi.idl:24
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
const WCHAR * str
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define __ENDTRY
Definition: compat.h:82
static UINT get_prop(MSISUMMARYINFO *si, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, awstring *str, DWORD *pcchValueBuf)
Definition: suminfo.c:641
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MSI_MAX_PROPS
Definition: msipriv.h:482
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158

Referenced by test_db(), test_suminfo(), test_suminfo_import(), and test_summary_binary().

◆ MsiSummaryInfoGetPropertyCount()

UINT WINAPI MsiSummaryInfoGetPropertyCount ( MSIHANDLE  hSummaryInfo,
UINT pCount 
)

Definition at line 606 of file suminfo.c.

607 {
608  MSISUMMARYINFO *si;
609 
610  TRACE( "%lu, %p\n", hSummaryInfo, pCount );
611 
612  si = msihandle2msiinfo( hSummaryInfo, MSIHANDLETYPE_SUMMARYINFO );
613  if( !si )
614  {
615  MSIHANDLE remote;
616  UINT ret;
617 
618  if (!(remote = msi_get_remote( hSummaryInfo )))
619  return ERROR_INVALID_HANDLE;
620 
621  __TRY
622  {
623  ret = remote_SummaryInfoGetPropertyCount( remote, pCount );
624  }
626  {
627  ret = GetExceptionCode();
628  }
629  __ENDTRY
630 
631  return ret;
632  }
633 
634  if( pCount )
635  *pCount = get_property_count( si->property );
636  msiobj_release( &si->hdr );
637 
638  return ERROR_SUCCESS;
639 }
#define __EXCEPT(func)
Definition: exception.h:84
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT get_property_count(const PROPVARIANT *property)
Definition: suminfo.c:153
#define MSIHANDLETYPE_SUMMARYINFO
Definition: msipriv.h:723
#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
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define __ENDTRY
Definition: compat.h:82
int ret
PROPVARIANT property[MSI_MAX_PROPS]
Definition: msipriv.h:489
unsigned int UINT
Definition: ndis.h:50
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158

Referenced by s_remote_SummaryInfoGetPropertyCount(), summaryinfo_invoke(), test_db(), test_suminfo(), test_suminfo_import(), and test_summary_binary().

◆ MsiSummaryInfoGetPropertyW()

UINT WINAPI MsiSummaryInfoGetPropertyW ( MSIHANDLE  handle,
UINT  uiProperty,
UINT puiDataType,
INT piValue,
FILETIME pftValue,
WCHAR szValueBuf,
DWORD pcchValueBuf 
)

Definition at line 788 of file suminfo.c.

790 {
791  MSISUMMARYINFO *si;
792  awstring str;
793  UINT r;
794 
795  TRACE( "%lu, %u, %p, %p, %p, %p, %p\n", handle, uiProperty, puiDataType, piValue, pftValue, szValueBuf,
796  pcchValueBuf );
797 
798  if (uiProperty >= MSI_MAX_PROPS)
799  {
800  if (puiDataType) *puiDataType = VT_EMPTY;
801  return ERROR_UNKNOWN_PROPERTY;
802  }
803 
805  {
806  MSIHANDLE remote;
807  WCHAR *buf = NULL;
808 
809  if (!(remote = msi_get_remote( handle )))
810  return ERROR_INVALID_HANDLE;
811 
812  __TRY
813  {
814  r = remote_SummaryInfoGetProperty( remote, uiProperty, puiDataType, piValue, pftValue, &buf );
815  }
817  {
818  r = GetExceptionCode();
819  }
820  __ENDTRY
821 
822  if (!r && buf)
823  r = msi_strncpyW( buf, -1, szValueBuf, pcchValueBuf );
824 
825  midl_user_free( buf );
826  return r;
827  }
828 
829  str.unicode = TRUE;
830  str.str.w = szValueBuf;
831 
832  r = get_prop( si, uiProperty, puiDataType, piValue, pftValue, &str, pcchValueBuf );
833  msiobj_release( &si->hdr );
834  return r;
835 }
#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
#define ERROR_UNKNOWN_PROPERTY
Definition: winerror.h:966
#define TRUE
Definition: types.h:120
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define MSIHANDLETYPE_SUMMARYINFO
Definition: msipriv.h:723
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
UINT msi_strncpyW(const WCHAR *str, int len, WCHAR *buf, DWORD *sz)
Definition: install.c:213
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
unsigned long MSIHANDLE
Definition: winemsi.idl:24
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
const WCHAR * str
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define __ENDTRY
Definition: compat.h:82
static UINT get_prop(MSISUMMARYINFO *si, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, awstring *str, DWORD *pcchValueBuf)
Definition: suminfo.c:641
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MSI_MAX_PROPS
Definition: msipriv.h:482
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158

Referenced by get_patch_product_codes(), s_remote_SummaryInfoGetProperty(), and summaryinfo_invoke().

◆ MsiSummaryInfoPersist()

UINT WINAPI MsiSummaryInfoPersist ( MSIHANDLE  handle)

Definition at line 1222 of file suminfo.c.

1223 {
1224  MSISUMMARYINFO *si;
1225  UINT ret;
1226 
1227  TRACE( "%lu\n", handle );
1228 
1230  if( !si )
1231  return ERROR_INVALID_HANDLE;
1232 
1233  ret = suminfo_persist( si );
1234 
1235  msiobj_release( &si->hdr );
1236  return ret;
1237 }
#define MSIHANDLETYPE_SUMMARYINFO
Definition: msipriv.h:723
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static UINT suminfo_persist(MSISUMMARYINFO *si)
Definition: suminfo.c:967
#define TRACE(s)
Definition: solgame.cpp:4
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
int ret
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158

Referenced by helper_createpackage(), set_admin_summary_info(), set_suminfo(), set_suminfo_prop(), set_summary_dword(), set_summary_info(), set_summary_str(), set_transform_summary_info(), test_streamtable(), test_suminfo(), test_summary_binary(), and write_msi_summary_info().

◆ MsiSummaryInfoSetPropertyA()

UINT WINAPI MsiSummaryInfoSetPropertyA ( MSIHANDLE  handle,
UINT  uiProperty,
UINT  uiDataType,
INT  iValue,
FILETIME pftValue,
const char szValue 
)

Definition at line 937 of file suminfo.c.

939 {
940  awcstring str;
941  MSISUMMARYINFO *si;
942  UINT ret;
943 
944  TRACE( "%lu, %u, %u, %d, %p, %s\n", handle, uiProperty, uiDataType, iValue, pftValue, debugstr_a(szValue) );
945 
947  {
948  MSIHANDLE remote;
949 
950  if ((remote = msi_get_remote( handle )))
951  {
952  WARN("MsiSummaryInfoSetProperty not allowed during a custom action!\n");
953  return ERROR_FUNCTION_FAILED;
954  }
955 
956  return ERROR_INVALID_HANDLE;
957  }
958 
959  str.unicode = FALSE;
960  str.str.a = szValue;
961 
962  ret = msi_set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str );
963  msiobj_release( &si->hdr );
964  return ret;
965 }
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
static UINT msi_set_prop(MSISUMMARYINFO *si, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue, awcstring *str)
Definition: suminfo.c:891
#define MSIHANDLETYPE_SUMMARYINFO
Definition: msipriv.h:723
#define WARN(fmt,...)
Definition: debug.h:112
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define FALSE
Definition: types.h:117
unsigned long MSIHANDLE
Definition: winemsi.idl:24
const WCHAR * str
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
int ret
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158

Referenced by helper_createpackage(), set_admin_summary_info(), set_suminfo(), set_suminfo_prop(), set_summary_dword(), set_summary_info(), set_summary_str(), set_transform_summary_info(), test_db(), test_streamtable(), test_suminfo(), test_summary_binary(), and write_msi_summary_info().

◆ MsiSummaryInfoSetPropertyW()

UINT WINAPI MsiSummaryInfoSetPropertyW ( MSIHANDLE  handle,
UINT  uiProperty,
UINT  uiDataType,
INT  iValue,
FILETIME pftValue,
const WCHAR szValue 
)

Definition at line 907 of file suminfo.c.

909 {
910  awcstring str;
911  MSISUMMARYINFO *si;
912  UINT ret;
913 
914  TRACE( "%lu, %u, %u, %d, %p, %s\n", handle, uiProperty, uiDataType, iValue, pftValue, debugstr_w(szValue) );
915 
917  {
918  MSIHANDLE remote;
919 
920  if ((remote = msi_get_remote( handle )))
921  {
922  WARN("MsiSummaryInfoSetProperty not allowed during a custom action!\n");
923  return ERROR_FUNCTION_FAILED;
924  }
925 
926  return ERROR_INVALID_HANDLE;
927  }
928 
929  str.unicode = TRUE;
930  str.str.w = szValue;
931 
932  ret = msi_set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str );
933  msiobj_release( &si->hdr );
934  return ret;
935 }
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
static UINT msi_set_prop(MSISUMMARYINFO *si, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue, awcstring *str)
Definition: suminfo.c:891
#define TRUE
Definition: types.h:120
#define MSIHANDLETYPE_SUMMARYINFO
Definition: msipriv.h:723
#define WARN(fmt,...)
Definition: debug.h:112
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
unsigned long MSIHANDLE
Definition: winemsi.idl:24
#define debugstr_w
Definition: kernel32.h:32
const WCHAR * str
#define TRACE(s)
Definition: solgame.cpp:4
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
int ret
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158

Referenced by summaryinfo_invoke(), and test_db().

◆ parse_filetime()

static void parse_filetime ( LPCWSTR  str,
FILETIME ft 
)
static

Definition at line 984 of file suminfo.c.

985 {
986  SYSTEMTIME lt, utc;
987  const WCHAR *p = str;
988  WCHAR *end;
989 
990  memset( &lt, 0, sizeof(lt) );
991 
992  /* YYYY/MM/DD hh:mm:ss */
993 
994  while (iswspace( *p )) p++;
995 
996  lt.wYear = wcstol( p, &end, 10 );
997  if (*end != '/') return;
998  p = end + 1;
999 
1000  lt.wMonth = wcstol( p, &end, 10 );
1001  if (*end != '/') return;
1002  p = end + 1;
1003 
1004  lt.wDay = wcstol( p, &end, 10 );
1005  if (*end != ' ') return;
1006  p = end + 1;
1007 
1008  while (iswspace( *p )) p++;
1009 
1010  lt.wHour = wcstol( p, &end, 10 );
1011  if (*end != ':') return;
1012  p = end + 1;
1013 
1014  lt.wMinute = wcstol( p, &end, 10 );
1015  if (*end != ':') return;
1016  p = end + 1;
1017 
1018  lt.wSecond = wcstol( p, &end, 10 );
1019 
1021  SystemTimeToFileTime( &utc, ft );
1022 }
WORD wMonth
Definition: winbase.h:903
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
WORD wYear
Definition: winbase.h:902
const WCHAR * str
WORD wMinute
Definition: winbase.h:907
__wchar_t WCHAR
Definition: xmlstorage.h:180
WORD wSecond
Definition: winbase.h:908
GLuint GLuint end
Definition: gl.h:1545
#define iswspace(_c)
Definition: ctype.h:669
WORD wDay
Definition: winbase.h:905
BOOL WINAPI SystemTimeToFileTime(IN CONST SYSTEMTIME *lpSystemTime, OUT LPFILETIME lpFileTime)
Definition: time.c:158
static DOUBLE utc(DOUBLE time, DateInstance *date)
Definition: date.c:357
WORD wHour
Definition: winbase.h:906
#define NULL
Definition: types.h:112
BOOL WINAPI TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION lpTimeZoneInformation, LPSYSTEMTIME lpLocalTime, LPSYSTEMTIME lpUniversalTime)
Definition: timezone.c:421
GLfloat GLfloat p
Definition: glext.h:8902
#define memset(x, y, z)
Definition: compat.h:39

Referenced by parse_prop().

◆ parse_prop()

static UINT parse_prop ( LPCWSTR  prop,
LPCWSTR  value,
UINT pid,
INT int_value,
FILETIME ft_value,
awcstring str_value 
)
static

Definition at line 1024 of file suminfo.c.

1026 {
1027  *pid = wcstol( prop, NULL, 10);
1028  switch (*pid)
1029  {
1030 #ifdef __REACTOS__
1031  case PID_CODEPAGE_MSI:
1032 #else
1033  case PID_CODEPAGE:
1034 #endif
1035  case PID_WORDCOUNT:
1036  case PID_CHARCOUNT:
1037 #ifdef __REACTOS__
1038  case PID_SECURITY_MSI:
1039 #else
1040  case PID_SECURITY:
1041 #endif
1042  case PID_PAGECOUNT:
1043  *int_value = wcstol( value, NULL, 10);
1044  break;
1045 
1046  case PID_LASTPRINTED:
1047  case PID_CREATE_DTM:
1048  case PID_LASTSAVE_DTM:
1049  parse_filetime( value, ft_value );
1050  break;
1051 
1052  case PID_SUBJECT:
1053  case PID_AUTHOR:
1054  case PID_KEYWORDS:
1055  case PID_COMMENTS:
1056  case PID_TEMPLATE:
1057  case PID_LASTAUTHOR:
1058  case PID_REVNUMBER:
1059  case PID_APPNAME:
1060  case PID_TITLE:
1061  str_value->str.w = value;
1062  str_value->unicode = TRUE;
1063  break;
1064 
1065  default:
1066  WARN("unhandled prop id %u\n", *pid);
1067  return ERROR_FUNCTION_FAILED;
1068  }
1069 
1070  return ERROR_SUCCESS;
1071 }
#define PID_TEMPLATE
Definition: suminfo.c:49
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
Definition: pdh_main.c:93
LPCWSTR w
Definition: msipriv.h:751
#define PID_CHARCOUNT
Definition: suminfo.c:58
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
#define PID_COMMENTS
Definition: suminfo.c:48
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define PID_REVNUMBER
Definition: suminfo.c:51
#define PID_CODEPAGE
Definition: suminfo.c:43
#define PID_LASTPRINTED
Definition: suminfo.c:53
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define PID_LASTAUTHOR
Definition: suminfo.c:50
#define PID_LASTSAVE_DTM
Definition: suminfo.c:55
#define PID_AUTHOR
Definition: suminfo.c:46
#define PID_PAGECOUNT
Definition: suminfo.c:56
BOOL unicode
Definition: msipriv.h:748
#define PID_APPNAME
Definition: suminfo.c:60
#define PID_TITLE
Definition: suminfo.c:44
#define PID_SUBJECT
Definition: suminfo.c:45
GLsizei const GLfloat * value
Definition: glext.h:6069
#define PID_KEYWORDS
Definition: suminfo.c:47
#define PID_CREATE_DTM
Definition: suminfo.c:54
union awcstring::@488 str
#define NULL
Definition: types.h:112
#define PID_SECURITY
Definition: suminfo.c:61
#define PID_WORDCOUNT
Definition: suminfo.c:57
static void parse_filetime(LPCWSTR str, FILETIME *ft)
Definition: suminfo.c:984

Referenced by msi_add_suminfo().

◆ propvar_changetype()

static UINT propvar_changetype ( PROPVARIANT *  changed,
PROPVARIANT *  property,
VARTYPE  vt 
)
static

Definition at line 165 of file suminfo.c.

166 {
167  HRESULT hr;
168  HMODULE propsys = LoadLibraryA("propsys.dll");
169  pPropVariantChangeType = (void *)GetProcAddress(propsys, "PropVariantChangeType");
170 
171  if (!pPropVariantChangeType)
172  {
173  ERR("PropVariantChangeType function missing!\n");
174  return ERROR_FUNCTION_FAILED;
175  }
176 
177  hr = pPropVariantChangeType(changed, property, 0, vt);
178  return (hr == S_OK) ? ERROR_SUCCESS : ERROR_FUNCTION_FAILED;
179 }
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
LONG HRESULT
Definition: typedefs.h:79
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:52
static IPropertySystem propsys
Definition: propsys_main.c:239
#define GetProcAddress(x, y)
Definition: compat.h:612

Referenced by read_properties_from_data().

◆ read_properties_from_data()

static void read_properties_from_data ( PROPVARIANT *  prop,
LPBYTE  data,
DWORD  sz 
)
static

Definition at line 182 of file suminfo.c.

183 {
184  UINT type;
185  DWORD i, size;
186  PROPERTY_DATA *propdata;
187  PROPVARIANT property, *ptr;
188  PROPVARIANT changed;
189  PROPERTYIDOFFSET *idofs;
190  PROPERTYSECTIONHEADER *section_hdr;
191 
192  section_hdr = (PROPERTYSECTIONHEADER*) &data[0];
193  idofs = (PROPERTYIDOFFSET*) &data[SECT_HDR_SIZE];
194 
195  /* now set all the properties */
196  for( i = 0; i < section_hdr->cProperties; i++ )
197  {
198  if( idofs[i].propid >= MSI_MAX_PROPS )
199  {
200  ERR( "unknown property ID %lu\n", idofs[i].propid );
201  break;
202  }
203 
204  type = get_type( idofs[i].propid );
205  if( type == VT_EMPTY )
206  {
207  ERR( "propid %lu has unknown type\n", idofs[i].propid );
208  break;
209  }
210 
211  propdata = (PROPERTY_DATA*) &data[ idofs[i].dwOffset ];
212 
213  /* check we don't run off the end of the data */
214  size = sz - idofs[i].dwOffset - sizeof(DWORD);
215  if( sizeof(DWORD) > size ||
216  ( propdata->type == VT_FILETIME && sizeof(FILETIME) > size ) ||
217  ( propdata->type == VT_LPSTR && (propdata->u.str.len + sizeof(DWORD)) > size ) )
218  {
219  ERR("not enough data\n");
220  break;
221  }
222 
223  property.vt = propdata->type;
224  if( propdata->type == VT_LPSTR )
225  {
226  LPSTR str = msi_alloc( propdata->u.str.len );
227  memcpy( str, propdata->u.str.str, propdata->u.str.len );
228  str[ propdata->u.str.len - 1 ] = 0;
229  property.pszVal = str;
230  }
231  else if( propdata->type == VT_FILETIME )
232  property.filetime = propdata->u.ft;
233  else if( propdata->type == VT_I2 )
234  property.iVal = propdata->u.i2;
235  else if( propdata->type == VT_I4 )
236  property.lVal = propdata->u.i4;
237 
238  /* check the type is the same as we expect */
239  if( type != propdata->type )
240  {
241  propvar_changetype(&changed, &property, type);
242  ptr = &changed;
243  }
244  else
245  ptr = &property;
246 
247  prop[ idofs[i].propid ] = *ptr;
248  }
249 }
DWORD type
Definition: suminfo.c:70
union PROPERTY_DATA::@493 u
Definition: compat.h:2157
SHORT i2
Definition: suminfo.c:73
char * LPSTR
Definition: xmlstorage.h:182
#define DWORD
Definition: nt_native.h:44
BYTE str[1]
Definition: suminfo.c:77
_In_ DWORD _In_ DWORD dwOffset
Definition: ntgdi.h:2032
static PVOID ptr
Definition: dispmode.c:27
const WCHAR * str
static UINT propvar_changetype(PROPVARIANT *changed, PROPVARIANT *property, VARTYPE vt)
Definition: suminfo.c:165
struct _FILETIME FILETIME
static UINT get_type(UINT uiProperty)
Definition: suminfo.c:113
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERR(fmt,...)
Definition: debug.h:110
FILETIME ft
Definition: suminfo.c:74
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
DWORD dwOffset
Definition: suminfo.c:66
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define MSI_MAX_PROPS
Definition: msipriv.h:482
DWORD propid
Definition: suminfo.c:65
#define SECT_HDR_SIZE
Definition: suminfo.c:88
Definition: compat.h:2156

Referenced by load_summary_info().

◆ s_remote_SummaryInfoGetProperty()

UINT __cdecl s_remote_SummaryInfoGetProperty ( MSIHANDLE  suminfo,
UINT  property,
UINT type,
INT value,
FILETIME ft,
LPWSTR buf 
)

Definition at line 1321 of file suminfo.c.

1323 {
1324  WCHAR empty[1];
1325  DWORD size = 0;
1326  UINT r;
1327 
1329  if (r == ERROR_MORE_DATA)
1330  {
1331  size++;
1332  *buf = midl_user_allocate( size * sizeof(WCHAR) );
1333  if (!*buf) return ERROR_OUTOFMEMORY;
1335  }
1336  return r;
1337 }
Definition: pdh_main.c:93
#define midl_user_allocate
Definition: rpc.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiSummaryInfoGetPropertyW(MSIHANDLE handle, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, WCHAR *szValueBuf, DWORD *pcchValueBuf)
Definition: suminfo.c:788
static const CHAR suminfo[]
Definition: db.c:2206
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERROR_MORE_DATA
Definition: dderror.h:13
unsigned int UINT
Definition: ndis.h:50
BOOL empty
Definition: button.c:170
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

◆ s_remote_SummaryInfoGetPropertyCount()

UINT __cdecl s_remote_SummaryInfoGetPropertyCount ( MSIHANDLE  suminfo,
UINT count 
)

Definition at line 1316 of file suminfo.c.

1317 {
1319 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
static const CHAR suminfo[]
Definition: db.c:2206
UINT WINAPI MsiSummaryInfoGetPropertyCount(MSIHANDLE hSummaryInfo, UINT *pCount)
Definition: suminfo.c:606

◆ save_prop()

static UINT save_prop ( MSISUMMARYINFO si,
HANDLE  handle,
UINT  row 
)
static

Definition at line 1114 of file suminfo.c.

1115 {
1116  static const char fmt_systemtime[] = "%04u/%02u/%02u %02u:%02u:%02u";
1117  char data[36]; /* largest string: YYYY/MM/DD hh:mm:ss */
1118  static const char fmt_begin[] = "%u\t";
1119  static const char data_end[] = "\r\n";
1120  static const char fmt_int[] = "%u";
1121  UINT r, data_type;
1122  SYSTEMTIME system_time;
1123  FILETIME file_time;
1124  INT int_value;
1125  awstring str;
1126  DWORD len, sz;
1127 
1128  str.unicode = FALSE;
1129  str.str.a = NULL;
1130  len = 0;
1131  r = get_prop( si, row, &data_type, &int_value, &file_time, &str, &len );
1132  if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA)
1133  return r;
1134  if (data_type == VT_EMPTY)
1135  return ERROR_SUCCESS; /* property not set */
1136  sz = sprintf( data, fmt_begin, row );
1137  if (!WriteFile( handle, data, sz, &sz, NULL ))
1138  return ERROR_WRITE_FAULT;
1139 
1140  switch( data_type )
1141  {
1142  case VT_I2:
1143  case VT_I4:
1144  sz = sprintf( data, fmt_int, int_value );
1145  if (!WriteFile( handle, data, sz, &sz, NULL ))
1146  return ERROR_WRITE_FAULT;
1147  break;
1148  case VT_LPSTR:
1149  len++;
1150  if (!(str.str.a = msi_alloc( len )))
1151  return ERROR_OUTOFMEMORY;
1152  r = get_prop( si, row, NULL, NULL, NULL, &str, &len );
1153  if (r != ERROR_SUCCESS)
1154  {
1155  msi_free( str.str.a );
1156  return r;
1157  }
1158  sz = len;
1159  if (!WriteFile( handle, str.str.a, sz, &sz, NULL ))
1160  {
1161  msi_free( str.str.a );
1162  return ERROR_WRITE_FAULT;
1163  }
1164  msi_free( str.str.a );
1165  break;
1166  case VT_FILETIME:
1167  if (!FileTimeToSystemTime( &file_time, &system_time ))
1168  return ERROR_FUNCTION_FAILED;
1169  sz = sprintf( data, fmt_systemtime, system_time.wYear, system_time.wMonth,
1170  system_time.wDay, system_time.wHour, system_time.wMinute,
1171  system_time.wSecond );
1172  if (!WriteFile( handle, data, sz, &sz, NULL ))
1173  return ERROR_WRITE_FAULT;
1174  break;
1175  case VT_EMPTY:
1176  /* cannot reach here, property not set */
1177  break;
1178  default:
1179  FIXME( "Unknown property variant type\n" );
1180  return ERROR_FUNCTION_FAILED;
1181  }
1182 
1183  sz = ARRAY_SIZE(data_end) - 1;
1184  if (!WriteFile( handle, data_end, sz, &sz, NULL ))
1185  return ERROR_WRITE_FAULT;
1186 
1187  return ERROR_SUCCESS;
1188 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
Definition: compat.h:2157
#define ERROR_SUCCESS
Definition: deptool.c:10
WORD wMonth
Definition: winbase.h:903
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
int32_t INT
Definition: typedefs.h:58
#define sprintf(buf, format,...)
Definition: sprintf.c:55
WORD wYear
Definition: winbase.h:902
#define ERROR_WRITE_FAULT
Definition: winerror.h:132
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
const WCHAR * str
WORD wMinute
Definition: winbase.h:907
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:188
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
WORD wSecond
Definition: winbase.h:908
GLenum GLsizei len
Definition: glext.h:6722
#define ERROR_MORE_DATA
Definition: dderror.h:13
WORD wDay
Definition: winbase.h:905
#define ARRAY_SIZE(a)
Definition: main.h:24
WORD wHour
Definition: winbase.h:906
static UINT get_prop(MSISUMMARYINFO *si, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, awstring *str, DWORD *pcchValueBuf)
Definition: suminfo.c:641
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
Definition: compat.h:2156
#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 msi_export_suminfo().

◆ save_summary_info()

static UINT save_summary_info ( const MSISUMMARYINFO si,
IStream stm 
)
static

Definition at line 375 of file suminfo.c.

376 {
378  PROPERTYSETHEADER set_hdr;
379  FORMATIDOFFSET format_hdr;
380  PROPERTYSECTIONHEADER section_hdr;
382  LPBYTE data = NULL;
383  ULONG count, sz;
384  HRESULT r;
385  int i;
386 
387  /* write the header */
388  sz = sizeof set_hdr;
389  memset( &set_hdr, 0, sz );
390  set_hdr.wByteOrder = 0xfffe;
391  set_hdr.wFormat = 0;
392  set_hdr.dwOSVer = 0x00020005; /* build 5, platform id 2 */
393  /* set_hdr.clsID is {00000000-0000-0000-0000-000000000000} */
394  set_hdr.reserved = 1;
395  r = IStream_Write( stm, &set_hdr, sz, &count );
396  if( FAILED(r) || count != sz )
397  return ret;
398 
399  /* write the format header */
400  sz = sizeof format_hdr;
401  format_hdr.fmtid = FMTID_SummaryInformation;
402  format_hdr.dwOffset = sizeof format_hdr + sizeof set_hdr;
403  r = IStream_Write( stm, &format_hdr, sz, &count );
404  if( FAILED(r) || count != sz )
405  return ret;
406 
407  /* add up how much space the data will take and calculate the offsets */
408  section_hdr.cbSection = sizeof section_hdr;
409  section_hdr.cbSection += (get_property_count( si->property ) * sizeof idofs[0]);
410  section_hdr.cProperties = 0;
411  for( i = 0; i < MSI_MAX_PROPS; i++ )
412  {
413  sz = write_property_to_data( &si->property[i], NULL );
414  if( !sz )
415  continue;
416  idofs[ section_hdr.cProperties ].propid = i;
417  idofs[ section_hdr.cProperties ].dwOffset = section_hdr.cbSection;
418  section_hdr.cProperties++;
419  section_hdr.cbSection += sz;
420  }
421 
422  data = msi_alloc_zero( section_hdr.cbSection );
423 
424  sz = 0;
425  memcpy( &data[sz], &section_hdr, sizeof section_hdr );
426  sz += sizeof section_hdr;
427 
428  memcpy( &data[sz], idofs, section_hdr.cProperties * sizeof idofs[0] );
429  sz += section_hdr.cProperties * sizeof idofs[0];
430 
431  /* write out the data */
432  for( i = 0; i < MSI_MAX_PROPS; i++ )
433  sz += write_property_to_data( &si->property[i], &data[sz] );
434 
435  r = IStream_Write( stm, data, sz, &count );
436  msi_free( data );
437  if( FAILED(r) || count != sz )
438  return ret;
439 
440  return ERROR_SUCCESS;
441 }
static UINT write_property_to_data(const PROPVARIANT *prop, LPBYTE data)
Definition: suminfo.c:348
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT get_property_count(const PROPVARIANT *property)
Definition: suminfo.c:153
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
FMTID fmtid
Definition: suminfo.c:55
static void msi_free(void *mem)
Definition: msipriv.h:1159
static void * msi_alloc_zero(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1148
const FMTID FMTID_SummaryInformation
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
unsigned char * LPBYTE
Definition: typedefs.h:53
DWORD dwOffset
Definition: suminfo.c:56
LONG HRESULT
Definition: typedefs.h:79
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
PROPVARIANT property[MSI_MAX_PROPS]
Definition: msipriv.h:489
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
DWORD dwOffset
Definition: suminfo.c:66
unsigned int ULONG
Definition: retypes.h:1
#define MSI_MAX_PROPS
Definition: msipriv.h:482
DWORD propid
Definition: suminfo.c:65
#define memset(x, y, z)
Definition: compat.h:39
DWORD reserved
Definition: suminfo.c:51

Referenced by suminfo_persist().

◆ set_prop()

static UINT set_prop ( MSISUMMARYINFO si,
UINT  uiProperty,
UINT  type,
INT  iValue,
FILETIME pftValue,
awcstring str 
)
static

Definition at line 837 of file suminfo.c.

839 {
840  PROPVARIANT *prop;
841  UINT len;
842 
843  TRACE("%p, %u, %u, %d, %p, %p\n", si, uiProperty, type, iValue, pftValue, str );
844 
845  prop = &si->property[uiProperty];
846 
847  if( prop->vt == VT_EMPTY )
848  {
849  if( !si->update_count )
850  return ERROR_FUNCTION_FAILED;
851 
852  si->update_count--;
853  }
854  else if( prop->vt != type )
855  return ERROR_SUCCESS;
856 
857  free_prop( prop );
858  prop->vt = type;
859  switch( type )
860  {
861  case VT_I4:
862  prop->lVal = iValue;
863  break;
864  case VT_I2:
865  prop->iVal = iValue;
866  break;
867  case VT_FILETIME:
868  prop->filetime = *pftValue;
869  break;
870  case VT_LPSTR:
871  if( str->unicode )
872  {
873  len = WideCharToMultiByte( CP_ACP, 0, str->str.w, -1,
874  NULL, 0, NULL, NULL );
875  prop->pszVal = msi_alloc( len );
876  WideCharToMultiByte( CP_ACP, 0, str->str.w, -1,
877  prop->pszVal, len, NULL, NULL );
878  }
879  else
880  {
881  len = lstrlenA( str->str.a ) + 1;
882  prop->pszVal = msi_alloc( len );
883  lstrcpyA( prop->pszVal, str->str.a );
884  }
885  break;
886  }
887 
888  return ERROR_SUCCESS;
889 }
Definition: compat.h:2157
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WideCharToMultiByte
Definition: compat.h:111
static void free_prop(PROPVARIANT *prop)
Definition: suminfo.c:90
#define CP_ACP
Definition: compat.h:109
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
const WCHAR * str
#define TRACE(s)
Definition: solgame.cpp:4
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
GLenum GLsizei len
Definition: glext.h:6722
PROPVARIANT property[MSI_MAX_PROPS]
Definition: msipriv.h:489
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
DWORD update_count
Definition: msipriv.h:488
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
Definition: compat.h:2156

Referenced by msi_add_suminfo(), and msi_set_prop().

◆ suminfo_persist()

static UINT suminfo_persist ( MSISUMMARYINFO si)
static

Definition at line 967 of file suminfo.c.

968 {
970  IStream *stm = NULL;
971  DWORD grfMode;
972  HRESULT r;
973 
975  r = IStorage_CreateStream( si->storage, L"\5SummaryInformation", grfMode, 0, 0, &stm );
976  if( SUCCEEDED(r) )
977  {
978  ret = save_summary_info( si, stm );
979  IStream_Release( stm );
980  }
981  return ret;
982 }
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:923
IStorage * storage
Definition: msipriv.h:487
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define STGM_CREATE
Definition: objbase.h:926
#define L(x)
Definition: ntvdm.h:50
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
if SUCCEEDED(hr)
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define STGM_READWRITE
Definition: objbase.h:919
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static UINT save_summary_info(const MSISUMMARYINFO *si, IStream *stm)
Definition: suminfo.c:375

Referenced by msi_add_suminfo(), and MsiSummaryInfoPersist().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msi  )

◆ write_dword()

static DWORD write_dword ( LPBYTE  data,
DWORD  ofs,
DWORD  val 
)
static

Definition at line 320 of file suminfo.c.

321 {
322  if( data )
323  {
324  data[ofs++] = val&0xff;
325  data[ofs++] = (val>>8)&0xff;
326  data[ofs++] = (val>>16)&0xff;
327  data[ofs++] = (val>>24)&0xff;
328  }
329  return 4;
330 }
GLuint GLfloat * val
Definition: glext.h:7180
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by write_filetime(), write_property_to_data(), and write_string().

◆ write_filetime()

static DWORD write_filetime ( LPBYTE  data,
DWORD  ofs,
const FILETIME ft 
)
static

Definition at line 332 of file suminfo.c.

333 {
334  write_dword( data, ofs, ft->dwLowDateTime );
335  write_dword( data, ofs + 4, ft->dwHighDateTime );
336  return 8;
337 }
DWORD dwHighDateTime
Definition: mapidefs.h:66
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static DWORD write_dword(LPBYTE data, DWORD ofs, DWORD val)
Definition: suminfo.c:320
DWORD dwLowDateTime
Definition: mapidefs.h:65

Referenced by write_property_to_data().

◆ write_property_to_data()

static UINT write_property_to_data ( const PROPVARIANT *  prop,
LPBYTE  data 
)
static

Definition at line 348 of file suminfo.c.

349 {
350  DWORD sz = 0;
351 
352  if( prop->vt == VT_EMPTY )
353  return sz;
354 
355  /* add the type */
356  sz += write_dword( data, sz, prop->vt );
357  switch( prop->vt )
358  {
359  case VT_I2:
360  sz += write_dword( data, sz, prop->iVal );
361  break;
362  case VT_I4:
363  sz += write_dword( data, sz, prop->lVal );
364  break;
365  case VT_FILETIME:
366  sz += write_filetime( data, sz, &prop->filetime );
367  break;
368  case VT_LPSTR:
369  sz += write_string( data, sz, prop->pszVal );
370  break;
371  }
372  return sz;
373 }
Definition: compat.h:2157
static DWORD write_filetime(LPBYTE data, DWORD ofs, const FILETIME *ft)
Definition: suminfo.c:332
static DWORD write_string(LPBYTE data, DWORD ofs, LPCSTR str)
Definition: suminfo.c:339
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static DWORD write_dword(LPBYTE data, DWORD ofs, DWORD val)
Definition: suminfo.c:320
Definition: compat.h:2156

Referenced by save_summary_info().

◆ write_string()

static DWORD write_string ( LPBYTE  data,
DWORD  ofs,
LPCSTR  str 
)
static

Definition at line 339 of file suminfo.c.

340 {
341  DWORD len = lstrlenA( str ) + 1;
342  write_dword( data, ofs, len );
343  if( data )
344  memcpy( &data[ofs + 4], str, len );
345  return (7 + len) & ~3;
346 }
const WCHAR * str
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
static DWORD write_dword(LPBYTE data, DWORD ofs, DWORD val)
Definition: suminfo.c:320
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145

Referenced by write_property_to_data().

Variable Documentation

◆ flags

REFPROPVARIANT PROPVAR_CHANGE_FLAGS flags

Definition at line 85 of file suminfo.c.

◆ propvarSrc

REFPROPVARIANT propvarSrc

Definition at line 85 of file suminfo.c.

Referenced by PropVariantChangeType(), and test_copy().

◆ vt

REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt

Definition at line 85 of file suminfo.c.

Referenced by _call_change_type(), _change_type_fail(), _get_attr_node_value(), _VarChangeTypeExWrap(), add_func_info(), Builtin_Invoke(), change_type(), check_safearray(), compare_metadata(), copy_from_variant(), copy_to_variant(), encode_type(), encode_var(), expect(), GdipGetAllPropertyItems(), GdipGetPropertyIdList(), get_element_size(), get_property_count(), get_type_alignment(), get_type_size(), get_ulong_val(), get_union_type(), Global_VarType(), iewnd_OnNotify(), init_test_dispatch(), is_arg_type_supported(), IsValidVariantClearVT(), IsValidVariantCopyIndVT(), LPSAFEARRAY_UserMarshal(), LPSAFEARRAY_UserUnmarshal(), PropertyStorage_ReadMultiple(), PropertyStorage_ReadProperty(), propvar_changetype(), PROPVAR_ConvertFILETIME(), PROPVARIANT_ValidateType(), PropVariantChangeType(), SAFEARRAY_GetUnionType(), set_custdata(), test_container_properties(), test_EmptyChangeTypeEx(), test_ErrorChangeTypeEx(), test_GdiGradientFill(), test_IUnknownChangeTypeEx(), test_marshal_LPSAFEARRAY(), test_marshal_VARIANT(), test_metadata_cHRM(), test_metadata_gAMA(), test_metadata_gif(), test_metadata_IFD(), test_metadata_tEXt(), test_metadata_unknown(), test_NullChangeTypeEx(), test_propertybag_getpropertyinfo(), test_queryreader(), test_specific_encoder_properties(), test_SummaryInfo(), test_validtypes(), test_VarAbs(), test_VarFix(), test_VariantClear(), test_VariantCopy(), test_VariantCopyInd(), test_VarInt(), test_VarNeg(), test_VarNot(), VarCmp(), variant_change_type(), VARIANT_Coerce(), VARIANT_CoerceArray(), VARIANT_CopyData(), VARIANT_FromDisp(), VARIANT_NumberFromBstr(), VARIANT_UserFree(), VARIANT_ValidateType(), VariantChangeType(), VariantChangeType_ChangeType(), VariantChangeTypeEx(), VariantCopyInd(), VarOr(), VarXor(), vt_to_itemtype(), write_default_value(), write_int_value(), write_oleaut_tfs(), and write_var_desc().