#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "msi.h"
#include "msiquery.h"
#include "objbase.h"
#include "msipriv.h"
#include "query.h"
#include "wine/debug.h"
Go to the source code of this file.
|
| WINE_DEFAULT_DEBUG_CHANNEL (msidb) |
|
static BOOL | streams_resize_table (MSIDATABASE *db, UINT size) |
|
static UINT | STREAMS_fetch_int (struct tagMSIVIEW *view, UINT row, UINT col, UINT *val) |
|
static UINT | STREAMS_fetch_stream (struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm) |
|
static UINT | STREAMS_set_string (struct tagMSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len) |
|
static UINT | STREAMS_set_stream (MSIVIEW *view, UINT row, UINT col, IStream *stream) |
|
static UINT | STREAMS_set_row (struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask) |
|
static UINT | streams_find_row (struct streams_view *sv, MSIRECORD *rec, UINT *row) |
|
static UINT | STREAMS_insert_row (struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary) |
|
static UINT | STREAMS_delete_row (struct tagMSIVIEW *view, UINT row) |
|
static UINT | STREAMS_execute (struct tagMSIVIEW *view, MSIRECORD *record) |
|
static UINT | STREAMS_close (struct tagMSIVIEW *view) |
|
static UINT | STREAMS_get_dimensions (struct tagMSIVIEW *view, UINT *rows, UINT *cols) |
|
static UINT | STREAMS_get_column_info (struct tagMSIVIEW *view, UINT n, LPCWSTR *name, UINT *type, BOOL *temporary, LPCWSTR *table_name) |
|
static UINT | streams_modify_update (struct tagMSIVIEW *view, MSIRECORD *rec) |
|
static UINT | streams_modify_assign (struct tagMSIVIEW *view, MSIRECORD *rec) |
|
static UINT | STREAMS_modify (struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row) |
|
static UINT | STREAMS_delete (struct tagMSIVIEW *view) |
|
static HRESULT | open_stream (MSIDATABASE *db, const WCHAR *name, IStream **stream) |
|
static MSISTREAM * | find_stream (MSIDATABASE *db, const WCHAR *name) |
|
static UINT | append_stream (MSIDATABASE *db, const WCHAR *name, IStream *stream) |
|
static UINT | load_streams (MSIDATABASE *db) |
|
UINT | msi_get_stream (MSIDATABASE *db, const WCHAR *name, IStream **ret) |
|
UINT | STREAMS_CreateView (MSIDATABASE *db, MSIVIEW **view) |
|
static HRESULT | write_stream (IStream *dst, IStream *src) |
|
UINT | msi_commit_streams (MSIDATABASE *db) |
|
◆ COBJMACROS
◆ NUM_STREAMS_COLS
◆ append_stream()
Definition at line 430 of file streams.c.
431{
433
436
440
443}
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
BOOL msi_add_string(string_table *st, const WCHAR *data, int len, BOOL persistent)
static BOOL streams_resize_table(MSIDATABASE *db, UINT size)
Referenced by load_streams(), and msi_get_stream().
◆ find_stream()
Definition at line 415 of file streams.c.
416{
418
422
424 {
426 }
428}
GLdouble GLdouble GLdouble r
UINT msi_string2id(const string_table *st, const WCHAR *data, int len, UINT *id)
Referenced by load_streams(), and msi_get_stream().
◆ load_streams()
Definition at line 445 of file streams.c.
446{
454
455 hr = IStorage_EnumElements( db->
storage, 0,
NULL, 0, &stgenum );
458
459 for (;;)
460 {
462 hr = IEnumSTATSTG_Next( stgenum, 1, &
stat, &
count );
464 break;
465
466
467 if (
stat.type != STGTY_STREAM || *
stat.pwcsName == 0x4840)
468 {
470 continue;
471 }
474 {
476 continue;
477 }
479
483 {
484 ERR(
"unable to open stream %#lx\n",
hr );
486 break;
487 }
488
491 break;
492 }
493
495 IEnumSTATSTG_Release( stgenum );
497}
GLuint GLuint GLsizei count
VOID WINAPI CoTaskMemFree(LPVOID ptr)
#define MAX_STREAM_NAME_LEN
BOOL decode_streamname(LPCWSTR in, LPWSTR out)
static UINT append_stream(MSIDATABASE *db, const WCHAR *name, IStream *stream)
static MSISTREAM * find_stream(MSIDATABASE *db, const WCHAR *name)
#define ERROR_FUNCTION_FAILED
Referenced by STREAMS_CreateView().
◆ msi_commit_streams()
Definition at line 607 of file streams.c.
608{
614
616
618 {
620 if (!
wcscmp(
name,
L"\5SummaryInformation" ))
continue;
621
624
627 {
630 {
631 ERR(
"failed to write stream %s (hr = %#lx)\n",
debugstr_w(encname),
hr );
633 IStream_Release(
stream );
635 }
637 IStream_Release(
stream );
639 {
640 ERR(
"failed to commit stream %s (hr = %#lx)\n",
debugstr_w(encname),
hr );
643 }
644 }
646 {
647 ERR(
"failed to create stream %s (hr = %#lx)\n",
debugstr_w(encname),
hr );
650 }
652 }
653
655}
WCHAR * encode_streamname(BOOL is_table, const WCHAR *in)
const WCHAR * msi_string_lookup(const string_table *st, UINT id, int *len)
#define STGM_SHARE_EXCLUSIVE
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
static HRESULT write_stream(IStream *dst, IStream *src)
#define STG_E_FILEALREADYEXISTS
Referenced by MsiDatabaseCommit().
◆ msi_get_stream()
◆ open_stream()
Definition at line 396 of file streams.c.
397{
399
402 {
404
406 {
409 break;
410 }
411 }
413}
GLuint GLenum GLenum transform
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
◆ STREAMS_close()
◆ STREAMS_CreateView()
Definition at line 539 of file streams.c.
540{
543
545
549
550 if (!(sv =
calloc( 1,
sizeof(*sv) )))
552
556
558
560}
static const MSIVIEWOPS streams_ops
static UINT load_streams(MSIDATABASE *db)
Referenced by TABLE_CreateView().
◆ STREAMS_delete()
◆ STREAMS_delete_row()
Definition at line 219 of file streams.c.
220{
226
228
231
235
239
240 hr = IStorage_DestroyElement(
db->
storage, encname );
243}
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
int JSAMPARRAY int int num_rows
Referenced by STREAMS_modify().
◆ STREAMS_execute()
◆ STREAMS_fetch_int()
Definition at line 68 of file streams.c.
69{
71
73
74 if (col != 1)
76
79
81
83}
#define ERROR_INVALID_PARAMETER
#define ERROR_NO_MORE_ITEMS
Referenced by streams_find_row().
◆ STREAMS_fetch_stream()
Definition at line 85 of file streams.c.
86{
90
92
95
100
102 IStream_AddRef( *stm );
103
105}
◆ streams_find_row()
◆ STREAMS_get_column_info()
Definition at line 269 of file streams.c.
271{
273
274 TRACE(
"(%p, %d, %p, %p, %p, %p)\n",
view,
n,
name,
type, temporary, table_name);
275
278
280 {
281 case 1:
284 break;
285
286 case 2:
289 break;
290 }
291 if (table_name) *table_name =
L"_Streams";
292 if (temporary) *temporary =
FALSE;
294}
GLuint GLuint GLsizei GLenum type
◆ STREAMS_get_dimensions()
Definition at line 257 of file streams.c.
258{
260
261 TRACE(
"(%p, %p, %p)\n",
view, rows, cols);
262
265
267}
◆ STREAMS_insert_row()
Definition at line 189 of file streams.c.
190{
193
195
199
202
205
206
208 {
210 }
211
215
217}
static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask)
static UINT streams_find_row(struct streams_view *sv, MSIRECORD *rec, UINT *row)
Referenced by STREAMS_modify(), and streams_modify_assign().
◆ STREAMS_modify()
Definition at line 320 of file streams.c.
321{
323
324 TRACE(
"%p %d %p\n",
view, eModifyMode, rec);
325
326 switch (eModifyMode)
327 {
330 break;
331
334 break;
335
338 break;
339
342 break;
343
352 FIXME(
"%p %d %p - mode not implemented\n",
view, eModifyMode, rec );
354 break;
355
356 default:
358 }
359
361}
#define ERROR_CALL_NOT_IMPLEMENTED
@ MSIMODIFY_INSERT_TEMPORARY
@ MSIMODIFY_VALIDATE_DELETE
@ MSIMODIFY_VALIDATE_FIELD
static UINT STREAMS_delete_row(struct tagMSIVIEW *view, UINT row)
static UINT STREAMS_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary)
static UINT streams_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec)
static UINT streams_modify_assign(struct tagMSIVIEW *view, MSIRECORD *rec)
#define ERROR_INVALID_DATA
◆ streams_modify_assign()
◆ streams_modify_update()
◆ streams_resize_table()
◆ STREAMS_set_row()
Definition at line 126 of file streams.c.
127{
129
131
134
136 {
138
141 }
143 {
147
151
154 IStream_Release( new );
156 {
158 }
159 if (old) IStream_Release( old );
160 }
161
163}
UINT MSI_RecordGetIStream(MSIRECORD *, UINT, IStream **)
Referenced by STREAMS_insert_row(), and streams_modify_update().
◆ STREAMS_set_stream()
Definition at line 113 of file streams.c.
114{
117
119
122 if (prev) IStream_Release(prev);
124}
◆ STREAMS_set_string()
Definition at line 107 of file streams.c.
108{
109 ERR(
"Cannot modify primary key.\n");
111}
◆ WINE_DEFAULT_DEBUG_CHANNEL()
WINE_DEFAULT_DEBUG_CHANNEL |
( |
msidb |
| ) |
|
◆ write_stream()
Definition at line 562 of file streams.c.
563{
570
571 hr = IStream_Stat(
src, &
stat, STATFLAG_NONAME );
573
574 hr = IStream_SetSize(
dst,
stat.cbSize );
576
580
581 for (;;)
582 {
586 {
587 WARN(
"failed to read stream: %#lx\n",
hr );
589 }
592 {
596 {
597 WARN(
"failed to write stream: %#lx\n",
hr );
599 }
600 }
601 if (!
stat.cbSize.QuadPart)
break;
602 }
603
605}
GLenum GLuint GLenum GLsizei const GLchar * buf
Referenced by msi_commit_streams().
◆ streams_ops
Initial value:=
{
}
static UINT STREAMS_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row)
static UINT STREAMS_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
static UINT STREAMS_close(struct tagMSIVIEW *view)
static UINT STREAMS_set_string(struct tagMSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len)
static UINT STREAMS_get_column_info(struct tagMSIVIEW *view, UINT n, LPCWSTR *name, UINT *type, BOOL *temporary, LPCWSTR *table_name)
static UINT STREAMS_set_stream(MSIVIEW *view, UINT row, UINT col, IStream *stream)
static UINT STREAMS_delete(struct tagMSIVIEW *view)
static UINT STREAMS_execute(struct tagMSIVIEW *view, MSIRECORD *record)
static UINT STREAMS_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
Definition at line 373 of file streams.c.
Referenced by STREAMS_CreateView().