ReactOS  0.4.14-dev-599-g2d4d3f5
streams.c
Go to the documentation of this file.
1 /*
2  * Implementation of the Microsoft Installer (msi.dll)
3  *
4  * Copyright 2007 James Hawkins
5  * Copyright 2015 Hans Leidekker for CodeWeavers
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21 
22 #include <stdarg.h>
23 
24 #define COBJMACROS
25 
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winerror.h"
29 #include "msi.h"
30 #include "msiquery.h"
31 #include "objbase.h"
32 #include "msipriv.h"
33 #include "query.h"
34 
35 #include "wine/debug.h"
36 #include "wine/unicode.h"
37 
39 
40 #define NUM_STREAMS_COLS 2
41 
42 typedef struct tagMSISTREAMSVIEW
43 {
48 
50 {
51  if (!db->num_streams_allocated)
52  {
53  if (!(db->streams = msi_alloc_zero( size * sizeof(MSISTREAM) ))) return FALSE;
55  return TRUE;
56  }
57  while (size >= db->num_streams_allocated)
58  {
59  MSISTREAM *tmp;
60  UINT new_size = db->num_streams_allocated * 2;
61  if (!(tmp = msi_realloc_zero( db->streams, new_size * sizeof(MSISTREAM) ))) return FALSE;
62  db->streams = tmp;
63  db->num_streams_allocated = new_size;
64  }
65  return TRUE;
66 }
67 
69 {
71 
72  TRACE("(%p, %d, %d, %p)\n", view, row, col, val);
73 
74  if (col != 1)
76 
77  if (row >= sv->db->num_streams)
78  return ERROR_NO_MORE_ITEMS;
79 
80  *val = sv->db->streams[row].str_index;
81 
82  return ERROR_SUCCESS;
83 }
84 
86 {
89  HRESULT hr;
90 
91  TRACE("(%p, %d, %d, %p)\n", view, row, col, stm);
92 
93  if (row >= sv->db->num_streams)
94  return ERROR_FUNCTION_FAILED;
95 
96  pos.QuadPart = 0;
97  hr = IStream_Seek( sv->db->streams[row].stream, pos, STREAM_SEEK_SET, NULL );
98  if (FAILED( hr ))
99  return ERROR_FUNCTION_FAILED;
100 
101  *stm = sv->db->streams[row].stream;
102  IStream_AddRef( *stm );
103 
104  return ERROR_SUCCESS;
105 }
106 
108 {
110 
111  TRACE("%p %d %p\n", sv, row, rec);
112 
113  return msi_view_get_row( sv->db, view, row, rec );
114 }
115 
117 {
119 
120  TRACE("(%p, %d, %p, %08x)\n", view, row, rec, mask);
121 
122  if (row > sv->db->num_streams || mask >= (1 << sv->num_cols))
124 
125  if (mask & 1)
126  {
127  const WCHAR *name = MSI_RecordGetString( rec, 1 );
128 
129  if (!name) return ERROR_INVALID_PARAMETER;
131  }
132  if (mask & 2)
133  {
134  IStream *old, *new;
135  HRESULT hr;
136  UINT r;
137 
138  r = MSI_RecordGetIStream( rec, 2, &new );
139  if (r != ERROR_SUCCESS)
140  return r;
141 
142  old = sv->db->streams[row].stream;
143  hr = IStream_QueryInterface( new, &IID_IStream, (void **)&sv->db->streams[row].stream );
144  if (FAILED( hr ))
145  {
146  IStream_Release( new );
147  return ERROR_FUNCTION_FAILED;
148  }
149  if (old) IStream_Release( old );
150  }
151 
152  return ERROR_SUCCESS;
153 }
154 
156 {
157  const WCHAR *str;
158  UINT r, i, id, val;
159 
160  str = MSI_RecordGetString( rec, 1 );
161  r = msi_string2id( sv->db->strings, str, -1, &id );
162  if (r != ERROR_SUCCESS)
163  return r;
164 
165  for (i = 0; i < sv->db->num_streams; i++)
166  {
167  STREAMS_fetch_int( &sv->view, i, 1, &val );
168 
169  if (val == id)
170  {
171  if (row) *row = i;
172  return ERROR_SUCCESS;
173  }
174  }
175 
176  return ERROR_FUNCTION_FAILED;
177 }
178 
179 static UINT STREAMS_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary)
180 {
182  UINT i, r, num_rows = sv->db->num_streams + 1;
183 
184  TRACE("(%p, %p, %d, %d)\n", view, rec, row, temporary);
185 
186  r = streams_find_row( sv, rec, NULL );
187  if (r == ERROR_SUCCESS)
188  return ERROR_FUNCTION_FAILED;
189 
190  if (!streams_resize_table( sv->db, num_rows ))
191  return ERROR_FUNCTION_FAILED;
192 
193  if (row == -1)
194  row = num_rows - 1;
195 
196  /* shift the rows to make room for the new row */
197  for (i = num_rows - 1; i > row; i--)
198  {
199  sv->db->streams[i] = sv->db->streams[i - 1];
200  }
201 
202  r = STREAMS_set_row( view, row, rec, (1 << sv->num_cols) - 1 );
203  if (r == ERROR_SUCCESS)
204  sv->db->num_streams = num_rows;
205 
206  return r;
207 }
208 
210 {
211  MSIDATABASE *db = ((MSISTREAMSVIEW *)view)->db;
212  UINT i, num_rows = db->num_streams - 1;
213  const WCHAR *name;
214  WCHAR *encname;
215  HRESULT hr;
216 
217  TRACE("(%p %d)!\n", view, row);
218 
220  if (!(encname = encode_streamname( FALSE, name ))) return ERROR_OUTOFMEMORY;
221  hr = IStorage_DestroyElement( db->storage, encname );
222  msi_free( encname );
223  if (FAILED( hr ))
224  return ERROR_FUNCTION_FAILED;
225  hr = IStream_Release( db->streams[row].stream );
226  if (FAILED( hr ))
227  return ERROR_FUNCTION_FAILED;
228 
229  for (i = row; i < num_rows; i++)
230  db->streams[i] = db->streams[i + 1];
231  db->num_streams = num_rows;
232 
233  return ERROR_SUCCESS;
234 }
235 
237 {
238  TRACE("(%p, %p)\n", view, record);
239  return ERROR_SUCCESS;
240 }
241 
243 {
244  TRACE("(%p)\n", view);
245  return ERROR_SUCCESS;
246 }
247 
248 static UINT STREAMS_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
249 {
251 
252  TRACE("(%p, %p, %p)\n", view, rows, cols);
253 
254  if (cols) *cols = sv->num_cols;
255  if (rows) *rows = sv->db->num_streams;
256 
257  return ERROR_SUCCESS;
258 }
259 
261  UINT *type, BOOL *temporary, LPCWSTR *table_name )
262 {
264 
265  TRACE("(%p, %d, %p, %p, %p, %p)\n", view, n, name, type, temporary, table_name);
266 
267  if (!n || n > sv->num_cols)
269 
270  switch (n)
271  {
272  case 1:
273  if (name) *name = szName;
275  break;
276 
277  case 2:
278  if (name) *name = szData;
280  break;
281  }
282  if (table_name) *table_name = szStreams;
283  if (temporary) *temporary = FALSE;
284  return ERROR_SUCCESS;
285 }
286 
288 {
290  UINT r, row;
291 
292  r = streams_find_row(sv, rec, &row);
293  if (r != ERROR_SUCCESS)
294  return ERROR_FUNCTION_FAILED;
295 
296  return STREAMS_set_row( view, row, rec, (1 << sv->num_cols) - 1 );
297 }
298 
300 {
302  UINT r;
303 
304  r = streams_find_row( sv, rec, NULL );
305  if (r == ERROR_SUCCESS)
306  return streams_modify_update(view, rec);
307 
308  return STREAMS_insert_row(view, rec, -1, FALSE);
309 }
310 
311 static UINT STREAMS_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row)
312 {
313  UINT r;
314 
315  TRACE("%p %d %p\n", view, eModifyMode, rec);
316 
317  switch (eModifyMode)
318  {
319  case MSIMODIFY_ASSIGN:
320  r = streams_modify_assign(view, rec);
321  break;
322 
323  case MSIMODIFY_INSERT:
324  r = STREAMS_insert_row(view, rec, -1, FALSE);
325  break;
326 
327  case MSIMODIFY_UPDATE:
328  r = streams_modify_update(view, rec);
329  break;
330 
331  case MSIMODIFY_DELETE:
332  r = STREAMS_delete_row(view, row - 1);
333  break;
334 
337  case MSIMODIFY_REFRESH:
338  case MSIMODIFY_REPLACE:
339  case MSIMODIFY_MERGE:
340  case MSIMODIFY_VALIDATE:
343  FIXME("%p %d %p - mode not implemented\n", view, eModifyMode, rec );
345  break;
346 
347  default:
349  }
350 
351  return r;
352 }
353 
355 {
357 
358  TRACE("(%p)\n", view);
359 
360  msi_free(sv);
361  return ERROR_SUCCESS;
362 }
363 
366 {
369 
370  TRACE("(%p, %d, %d, %p, %p)\n", view, col, val, row, handle);
371 
372  if (!col || col > sv->num_cols)
374 
375  while (index < sv->db->num_streams)
376  {
377  if (sv->db->streams[index].str_index == val)
378  {
379  *row = index;
380  break;
381  }
382  index++;
383  }
384 
385  *handle = UlongToPtr(++index);
386 
387  if (index > sv->db->num_streams)
388  return ERROR_NO_MORE_ITEMS;
389 
390  return ERROR_SUCCESS;
391 }
392 
393 static const MSIVIEWOPS streams_ops =
394 {
408  NULL,
409  NULL,
410  NULL,
411  NULL,
412  NULL,
413  NULL,
414 };
415 
417 {
418  HRESULT hr;
419 
420  hr = IStorage_OpenStream( db->storage, name, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, stream );
421  if (FAILED( hr ))
422  {
424 
426  {
427  hr = IStorage_OpenStream( transform->stg, name, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, stream );
428  if (SUCCEEDED( hr ))
429  break;
430  }
431  }
432  return hr;
433 }
434 
436 {
437  UINT r, id, i;
438 
439  r = msi_string2id( db->strings, name, -1, &id );
440  if (r != ERROR_SUCCESS)
441  return NULL;
442 
443  for (i = 0; i < db->num_streams; i++)
444  {
445  if (db->streams[i].str_index == id) return &db->streams[i];
446  }
447  return NULL;
448 }
449 
451 {
452  UINT i = db->num_streams;
453 
454  if (!streams_resize_table( db, db->num_streams + 1 ))
455  return ERROR_OUTOFMEMORY;
456 
458  db->streams[i].stream = stream;
459  db->num_streams++;
460 
461  TRACE("added %s\n", debugstr_w( name ));
462  return ERROR_SUCCESS;
463 }
464 
466 {
467  WCHAR decoded[MAX_STREAM_NAME_LEN + 1];
468  IEnumSTATSTG *stgenum;
469  STATSTG stat;
470  HRESULT hr;
472  IStream *stream;
473 
474  hr = IStorage_EnumElements( db->storage, 0, NULL, 0, &stgenum );
475  if (FAILED( hr ))
476  return ERROR_FUNCTION_FAILED;
477 
478  for (;;)
479  {
480  count = 0;
481  hr = IEnumSTATSTG_Next( stgenum, 1, &stat, &count );
482  if (FAILED( hr ) || !count)
483  break;
484 
485  /* table streams are not in the _Streams table */
486  if (stat.type != STGTY_STREAM || *stat.pwcsName == 0x4840)
487  {
488  CoTaskMemFree( stat.pwcsName );
489  continue;
490  }
491  decode_streamname( stat.pwcsName, decoded );
492  if (find_stream( db, decoded ))
493  {
494  CoTaskMemFree( stat.pwcsName );
495  continue;
496  }
497  TRACE("found new stream %s\n", debugstr_w( decoded ));
498 
499  hr = open_stream( db, stat.pwcsName, &stream );
500  CoTaskMemFree( stat.pwcsName );
501  if (FAILED( hr ))
502  {
503  ERR("unable to open stream %08x\n", hr);
505  break;
506  }
507 
508  r = append_stream( db, decoded, stream );
509  if (r != ERROR_SUCCESS)
510  break;
511  }
512 
513  TRACE("loaded %u streams\n", db->num_streams);
514  IEnumSTATSTG_Release( stgenum );
515  return r;
516 }
517 
519 {
520  MSISTREAM *stream;
521  WCHAR *encname;
522  HRESULT hr;
523  UINT r;
524 
525  if ((stream = find_stream( db, name )))
526  {
528 
529  pos.QuadPart = 0;
530  hr = IStream_Seek( stream->stream, pos, STREAM_SEEK_SET, NULL );
531  if (FAILED( hr ))
532  return ERROR_FUNCTION_FAILED;
533 
534  *ret = stream->stream;
535  IStream_AddRef( *ret );
536  return ERROR_SUCCESS;
537  }
538 
539  if (!(encname = encode_streamname( FALSE, name )))
540  return ERROR_OUTOFMEMORY;
541 
542  hr = open_stream( db, encname, ret );
543  msi_free( encname );
544  if (FAILED( hr ))
545  return ERROR_FUNCTION_FAILED;
546 
547  r = append_stream( db, name, *ret );
548  if (r != ERROR_SUCCESS)
549  {
550  IStream_Release( *ret );
551  return r;
552  }
553 
554  IStream_AddRef( *ret );
555  return ERROR_SUCCESS;
556 }
557 
559 {
560  MSISTREAMSVIEW *sv;
561  UINT r;
562 
563  TRACE("(%p, %p)\n", db, view);
564 
565  r = load_streams( db );
566  if (r != ERROR_SUCCESS)
567  return r;
568 
569  if (!(sv = msi_alloc_zero( sizeof(MSISTREAMSVIEW) )))
570  return ERROR_OUTOFMEMORY;
571 
572  sv->view.ops = &streams_ops;
574  sv->db = db;
575 
576  *view = (MSIVIEW *)sv;
577 
578  return ERROR_SUCCESS;
579 }
580 
582 {
583  HRESULT hr;
584  char buf[4096];
585  STATSTG stat;
587  UINT count, size;
588 
589  hr = IStream_Stat( src, &stat, STATFLAG_NONAME );
590  if (FAILED( hr )) return hr;
591 
592  hr = IStream_SetSize( dst, stat.cbSize );
593  if (FAILED( hr )) return hr;
594 
595  pos.QuadPart = 0;
596  hr = IStream_Seek( dst, pos, STREAM_SEEK_SET, NULL );
597  if (FAILED( hr )) return hr;
598 
599  for (;;)
600  {
601  size = min( sizeof(buf), stat.cbSize.QuadPart );
602  hr = IStream_Read( src, buf, size, &count );
603  if (FAILED( hr ) || count != size)
604  {
605  WARN("failed to read stream: %08x\n", hr);
606  return E_INVALIDARG;
607  }
608  stat.cbSize.QuadPart -= count;
609  if (count)
610  {
611  size = count;
612  hr = IStream_Write( dst, buf, size, &count );
613  if (FAILED( hr ) || count != size)
614  {
615  WARN("failed to write stream: %08x\n", hr);
616  return E_INVALIDARG;
617  }
618  }
619  if (!stat.cbSize.QuadPart) break;
620  }
621 
622  return S_OK;
623 }
624 
626 {
627  UINT i;
628  const WCHAR *name;
629  WCHAR *encname;
630  IStream *stream;
631  HRESULT hr;
632 
633  TRACE("got %u streams\n", db->num_streams);
634 
635  for (i = 0; i < db->num_streams; i++)
636  {
638  if (!(encname = encode_streamname( FALSE, name ))) return ERROR_OUTOFMEMORY;
639 
640  hr = IStorage_CreateStream( db->storage, encname, STGM_WRITE|STGM_SHARE_EXCLUSIVE, 0, 0, &stream );
641  if (SUCCEEDED( hr ))
642  {
643  hr = write_stream( stream, db->streams[i].stream );
644  if (FAILED( hr ))
645  {
646  ERR("failed to write stream %s (hr = %08x)\n", debugstr_w(encname), hr);
647  msi_free( encname );
648  IStream_Release( stream );
649  return ERROR_FUNCTION_FAILED;
650  }
651  hr = IStream_Commit( stream, 0 );
652  IStream_Release( stream );
653  if (FAILED( hr ))
654  {
655  ERR("failed to commit stream %s (hr = %08x)\n", debugstr_w(encname), hr);
656  msi_free( encname );
657  return ERROR_FUNCTION_FAILED;
658  }
659  }
660  else if (hr != STG_E_FILEALREADYEXISTS)
661  {
662  ERR("failed to create stream %s (hr = %08x)\n", debugstr_w(encname), hr);
663  msi_free( encname );
664  return ERROR_FUNCTION_FAILED;
665  }
666  msi_free( encname );
667  }
668 
669  return ERROR_SUCCESS;
670 }
const WCHAR * msi_string_lookup(const string_table *st, UINT id, int *len) DECLSPEC_HIDDEN
Definition: string.c:347
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
MSISTREAM * streams
Definition: msipriv.h:109
#define TRUE
Definition: types.h:120
struct tagMSISTREAMSVIEW MSISTREAMSVIEW
MSIDATABASE * db
Definition: streams.c:45
UINT STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view)
Definition: streams.c:558
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:922
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static HRESULT write_stream(IStream *dst, IStream *src)
Definition: streams.c:581
static const MSIVIEWOPS streams_ops
Definition: streams.c:393
static MSISTREAM * find_stream(MSIDATABASE *db, const WCHAR *name)
Definition: streams.c:435
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static UINT STREAMS_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row)
Definition: streams.c:311
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:111
static const WCHAR szData[]
Definition: msipriv.h:1195
UINT MSI_RecordGetIStream(MSIRECORD *, UINT, IStream **) DECLSPEC_HIDDEN
Definition: record.c:905
GLdouble n
Definition: glext.h:7729
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
BOOL msi_add_string(string_table *st, const WCHAR *data, int len, enum StringPersistence persistence) DECLSPEC_HIDDEN
Definition: string.c:307
UINT num_streams_allocated
Definition: msipriv.h:111
#define MSITYPE_STRING
Definition: msipriv.h:47
static UINT STREAMS_find_matching_rows(struct tagMSIVIEW *view, UINT col, UINT val, UINT *row, MSIITERHANDLE *handle)
Definition: streams.c:364
static HRESULT open_stream(MSIDATABASE *db, const WCHAR *name, IStream **stream)
Definition: streams.c:416
static void * msi_alloc_zero(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1210
static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask)
Definition: streams.c:116
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
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
GLenum GLint GLuint mask
Definition: glext.h:6028
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
static UINT streams_find_row(MSISTREAMSVIEW *sv, MSIRECORD *rec, UINT *row)
Definition: streams.c:155
unsigned int BOOL
Definition: ntddk_ex.h:94
WINE_DEFAULT_DEBUG_CHANNEL(msidb)
string_table * strings
Definition: msipriv.h:99
#define NUM_STREAMS_COLS
Definition: streams.c:40
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define STGM_WRITE
Definition: objbase.h:917
#define MSITYPE_NULLABLE
Definition: msipriv.h:48
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:482
GLuint index
Definition: glext.h:6031
IStream * stream
Definition: msipriv.h:86
static UINT STREAMS_execute(struct tagMSIVIEW *view, MSIRECORD *record)
Definition: streams.c:236
#define UlongToPtr(u)
Definition: config.h:106
#define PtrToUlong(u)
Definition: config.h:107
GLuint GLfloat * val
Definition: glext.h:7180
static UINT STREAMS_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
Definition: streams.c:248
#define STGM_READ
Definition: objbase.h:916
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define MAX_STREAM_NAME_LEN
Definition: msipriv.h:53
__wchar_t WCHAR
Definition: xmlstorage.h:180
const MSIVIEWOPS * ops
Definition: msipriv.h:348
LONG HRESULT
Definition: typedefs.h:77
#define STG_E_FILEALREADYEXISTS
Definition: winerror.h:2579
UINT msi_string2id(const string_table *st, const WCHAR *data, int len, UINT *id) DECLSPEC_HIDDEN
Definition: string.c:404
LPWSTR encode_streamname(BOOL bTable, LPCWSTR in) DECLSPEC_HIDDEN
Definition: table.c:128
int JSAMPARRAY int int num_rows
Definition: jpegint.h:412
static UINT STREAMS_get_column_info(struct tagMSIVIEW *view, UINT n, LPCWSTR *name, UINT *type, BOOL *temporary, LPCWSTR *table_name)
Definition: streams.c:260
int ret
#define index(s, c)
Definition: various.h:29
Definition: parse.h:22
UINT msi_commit_streams(MSIDATABASE *db)
Definition: streams.c:625
GLuint GLuint stream
Definition: glext.h:7522
Definition: stat.h:55
uint32_t entry
Definition: isohybrid.c:63
GLenum src
Definition: glext.h:6340
#define ERROR_INVALID_DATA
Definition: winerror.h:116
#define ERR(fmt,...)
Definition: debug.h:109
static UINT streams_modify_assign(struct tagMSIVIEW *view, MSIRECORD *rec)
Definition: streams.c:299
static UINT STREAMS_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT *val)
Definition: streams.c:68
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
#define S_OK
Definition: intsafe.h:59
UINT str_index
Definition: msipriv.h:85
BOOL decode_streamname(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN
Definition: table.c:187
static UINT STREAMS_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
Definition: streams.c:85
GLenum GLenum dst
Definition: glext.h:6340
#define min(a, b)
Definition: monoChain.cc:55
enum tagMSIMODIFY MSIMODIFY
unsigned int UINT
Definition: ndis.h:50
#define MSITYPE_VALID
Definition: msipriv.h:45
static const WCHAR szStreams[]
Definition: msipriv.h:1178
static UINT append_stream(MSIDATABASE *db, const WCHAR *name, IStream *stream)
Definition: streams.c:450
UINT msi_view_get_row(MSIDATABASE *, MSIVIEW *, UINT, MSIRECORD **) DECLSPEC_HIDDEN
Definition: msiquery.c:287
static UINT STREAMS_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary)
Definition: streams.c:179
UINT msi_get_stream(MSIDATABASE *db, const WCHAR *name, IStream **ret)
Definition: streams.c:518
static UINT streams_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec)
Definition: streams.c:287
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
Definition: name.c:38
static const WCHAR szName[]
Definition: msipriv.h:1194
UINT num_streams
Definition: msipriv.h:110
GLenum GLuint id
Definition: glext.h:5579
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
static UINT STREAMS_delete_row(struct tagMSIVIEW *view, UINT row)
Definition: streams.c:209
GLuint GLenum GLenum transform
Definition: glext.h:9407
static UINT STREAMS_get_row(struct tagMSIVIEW *view, UINT row, MSIRECORD **rec)
Definition: streams.c:107
static void * msi_realloc_zero(void *mem, size_t len) __WINE_ALLOC_SIZE(2)
Definition: msipriv.h:1222
IStorage * storage
Definition: msipriv.h:98
static BOOL streams_resize_table(MSIDATABASE *db, UINT size)
Definition: streams.c:49
static UINT STREAMS_delete(struct tagMSIVIEW *view)
Definition: streams.c:354
struct list transforms
Definition: msipriv.h:108
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static UINT load_streams(MSIDATABASE *db)
Definition: streams.c:465
static UINT STREAMS_close(struct tagMSIVIEW *view)
Definition: streams.c:242
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
MSIVIEW view
Definition: streams.c:44
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
GLuint const GLchar * name
Definition: glext.h:6031