Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
146e34e6
Commit
146e34e6
authored
Feb 04, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Feb 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Implement the MSIMODIFY_ASSIGN action of MsiViewModify for the streams table.
parent
56574c7c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
15 deletions
+74
-15
streams.c
dlls/msi/streams.c
+74
-15
No files found.
dlls/msi/streams.c
View file @
146e34e6
...
...
@@ -54,9 +54,9 @@ typedef struct tagMSISTREAMSVIEW
UINT
row_size
;
}
MSISTREAMSVIEW
;
static
BOOL
add_stream_to_table
(
MSISTREAMSVIEW
*
sv
,
STREAM
*
stream
,
int
index
)
static
BOOL
streams_set_table_size
(
MSISTREAMSVIEW
*
sv
,
int
size
)
{
if
(
index
>=
sv
->
max_streams
)
if
(
size
>=
sv
->
max_streams
)
{
sv
->
max_streams
*=
2
;
sv
->
streams
=
msi_realloc
(
sv
->
streams
,
sv
->
max_streams
*
sizeof
(
STREAM
*
));
...
...
@@ -64,7 +64,6 @@ static BOOL add_stream_to_table(MSISTREAMSVIEW *sv, STREAM *stream, int index)
return
FALSE
;
}
sv
->
streams
[
index
]
=
stream
;
return
TRUE
;
}
...
...
@@ -140,12 +139,6 @@ static UINT STREAMS_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec
static
UINT
STREAMS_set_row
(
struct
tagMSIVIEW
*
view
,
UINT
row
,
MSIRECORD
*
rec
,
UINT
mask
)
{
FIXME
(
"(%p, %d, %p, %d): stub!
\n
"
,
view
,
row
,
rec
,
mask
);
return
ERROR_SUCCESS
;
}
static
UINT
STREAMS_insert_row
(
struct
tagMSIVIEW
*
view
,
MSIRECORD
*
rec
,
BOOL
temporary
)
{
MSISTREAMSVIEW
*
sv
=
(
MSISTREAMSVIEW
*
)
view
;
STREAM
*
stream
;
IStream
*
stm
;
...
...
@@ -156,7 +149,10 @@ static UINT STREAMS_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, BOOL tem
ULONG
count
;
UINT
r
=
ERROR_FUNCTION_FAILED
;
TRACE
(
"(%p, %p, %d)
\n
"
,
view
,
rec
,
temporary
);
TRACE
(
"(%p, %p)
\n
"
,
view
,
rec
);
if
(
row
>
sv
->
num_rows
)
return
ERROR_FUNCTION_FAILED
;
r
=
MSI_RecordGetIStream
(
rec
,
2
,
&
stm
);
if
(
r
!=
ERROR_SUCCESS
)
...
...
@@ -201,8 +197,7 @@ static UINT STREAMS_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, BOOL tem
IStorage_OpenStream
(
sv
->
db
->
storage
,
name
,
0
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stream
->
stream
);
if
(
!
add_stream_to_table
(
sv
,
stream
,
sv
->
num_rows
++
))
goto
done
;
sv
->
streams
[
row
]
=
stream
;
done:
msi_free
(
name
);
...
...
@@ -213,6 +208,16 @@ done:
return
r
;
}
static
UINT
STREAMS_insert_row
(
struct
tagMSIVIEW
*
view
,
MSIRECORD
*
rec
,
BOOL
temporary
)
{
MSISTREAMSVIEW
*
sv
=
(
MSISTREAMSVIEW
*
)
view
;
if
(
!
streams_set_table_size
(
sv
,
++
sv
->
num_rows
))
return
ERROR_FUNCTION_FAILED
;
return
STREAMS_set_row
(
view
,
sv
->
num_rows
-
1
,
rec
,
0
);
}
static
UINT
STREAMS_delete_row
(
struct
tagMSIVIEW
*
view
,
UINT
row
)
{
FIXME
(
"(%p %d): stub!
\n
"
,
view
,
row
);
...
...
@@ -278,6 +283,52 @@ static UINT STREAMS_get_column_info(struct tagMSIVIEW *view,
return
ERROR_SUCCESS
;
}
static
UINT
streams_find_row
(
MSISTREAMSVIEW
*
sv
,
MSIRECORD
*
rec
,
UINT
*
row
)
{
LPCWSTR
str
;
UINT
i
,
id
,
data
;
str
=
MSI_RecordGetString
(
rec
,
1
);
msi_string2idW
(
sv
->
db
->
strings
,
str
,
&
id
);
for
(
i
=
0
;
i
<
sv
->
num_rows
;
i
++
)
{
STREAMS_fetch_int
(
&
sv
->
view
,
i
,
1
,
&
data
);
if
(
data
==
id
)
{
*
row
=
i
;
return
ERROR_SUCCESS
;
}
}
return
ERROR_FUNCTION_FAILED
;
}
static
UINT
streams_modify_update
(
struct
tagMSIVIEW
*
view
,
MSIRECORD
*
rec
)
{
MSISTREAMSVIEW
*
sv
=
(
MSISTREAMSVIEW
*
)
view
;
UINT
r
,
row
;
r
=
streams_find_row
(
sv
,
rec
,
&
row
);
if
(
r
!=
ERROR_SUCCESS
)
return
ERROR_FUNCTION_FAILED
;
return
STREAMS_set_row
(
view
,
row
,
rec
,
0
);
}
static
UINT
streams_modify_assign
(
struct
tagMSIVIEW
*
view
,
MSIRECORD
*
rec
)
{
MSISTREAMSVIEW
*
sv
=
(
MSISTREAMSVIEW
*
)
view
;
UINT
r
,
row
;
r
=
streams_find_row
(
sv
,
rec
,
&
row
);
if
(
r
==
ERROR_SUCCESS
)
return
streams_modify_update
(
view
,
rec
);
return
STREAMS_insert_row
(
view
,
rec
,
FALSE
);
}
static
UINT
STREAMS_modify
(
struct
tagMSIVIEW
*
view
,
MSIMODIFY
eModifyMode
,
MSIRECORD
*
rec
,
UINT
row
)
{
UINT
r
;
...
...
@@ -286,15 +337,21 @@ static UINT STREAMS_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRE
switch
(
eModifyMode
)
{
case
MSIMODIFY_ASSIGN
:
r
=
streams_modify_assign
(
view
,
rec
);
break
;
case
MSIMODIFY_INSERT
:
r
=
STREAMS_insert_row
(
view
,
rec
,
FALSE
);
break
;
case
MSIMODIFY_UPDATE
:
r
=
streams_modify_update
(
view
,
rec
);
break
;
case
MSIMODIFY_VALIDATE_NEW
:
case
MSIMODIFY_INSERT_TEMPORARY
:
case
MSIMODIFY_UPDATE
:
case
MSIMODIFY_REFRESH
:
case
MSIMODIFY_ASSIGN
:
case
MSIMODIFY_REPLACE
:
case
MSIMODIFY_MERGE
:
case
MSIMODIFY_DELETE
:
...
...
@@ -425,11 +482,13 @@ static UINT add_streams_to_table(MSISTREAMSVIEW *sv)
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stream
->
stream
);
CoTaskMemFree
(
stat
.
pwcsName
);
if
(
!
add_stream_to_table
(
sv
,
stream
,
count
++
))
if
(
!
streams_set_table_size
(
sv
,
++
count
))
{
count
=
-
1
;
break
;
}
sv
->
streams
[
count
-
1
]
=
stream
;
}
IEnumSTATSTG_Release
(
stgenum
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment