Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
12342894
Commit
12342894
authored
Mar 04, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 04, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Support updating streams.
parent
af628170
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
15 deletions
+39
-15
table.c
dlls/msi/table.c
+39
-15
No files found.
dlls/msi/table.c
View file @
12342894
...
...
@@ -1054,7 +1054,7 @@ static UINT TABLE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *
return
ERROR_SUCCESS
;
}
static
UINT
msi_stream_name
(
const
MSITABLEVIEW
*
tv
,
UINT
row
,
LPWSTR
*
pstname
)
static
UINT
get_stream_name
(
const
MSITABLEVIEW
*
tv
,
UINT
row
,
WCHAR
*
*
pstname
)
{
LPWSTR
p
,
stname
=
NULL
;
UINT
i
,
r
,
type
,
ival
;
...
...
@@ -1154,7 +1154,7 @@ static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt
if
(
!
view
->
ops
->
fetch_int
)
return
ERROR_INVALID_PARAMETER
;
r
=
msi
_stream_name
(
tv
,
row
,
&
name
);
r
=
get
_stream_name
(
tv
,
row
,
&
name
);
if
(
r
!=
ERROR_SUCCESS
)
{
ERR
(
"fetching stream, error = %u
\n
"
,
r
);
...
...
@@ -1216,39 +1216,63 @@ static UINT TABLE_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec )
return
msi_view_get_row
(
tv
->
db
,
view
,
row
,
rec
);
}
static
UINT
msi_addstreamW
(
MSIDATABASE
*
db
,
LPCWSTR
name
,
IStream
*
data
)
static
UINT
add_stream
(
MSIDATABASE
*
db
,
const
WCHAR
*
name
,
IStream
*
data
)
{
static
const
WCHAR
insert
[]
=
{
'I'
,
'N'
,
'S'
,
'E'
,
'R'
,
'T'
,
' '
,
'I'
,
'N'
,
'T'
,
'O'
,
' '
,
'`'
,
'_'
,
'S'
,
't'
,
'r'
,
'e'
,
'a'
,
'm'
,
's'
,
'`'
,
' '
,
'('
,
'`'
,
'N'
,
'a'
,
'm'
,
'e'
,
'`'
,
','
,
'`'
,
'D'
,
'a'
,
't'
,
'a'
,
'`'
,
')'
,
' '
,
'V'
,
'A'
,
'L'
,
'U'
,
'E'
,
'S'
,
' '
,
'('
,
'?'
,
','
,
'?'
,
')'
,
0
};
MSIQUERY
*
query
=
NULL
;
static
const
WCHAR
update
[]
=
{
'U'
,
'P'
,
'D'
,
'A'
,
'T'
,
'E'
,
' '
,
'`'
,
'_'
,
'S'
,
't'
,
'r'
,
'e'
,
'a'
,
'm'
,
's'
,
'`'
,
' '
,
'S'
,
'E'
,
'T'
,
' '
,
'`'
,
'D'
,
'a'
,
't'
,
'a'
,
'`'
,
' '
,
'='
,
' '
,
'?'
,
' '
,
'W'
,
'H'
,
'E'
,
'R'
,
'E'
,
' '
,
'`'
,
'N'
,
'a'
,
'm'
,
'e'
,
'`'
,
' '
,
'='
,
' '
,
'?'
,
0
};
MSIQUERY
*
query
;
MSIRECORD
*
rec
;
UINT
r
;
TRACE
(
"%p %s %p
\n
"
,
db
,
debugstr_w
(
name
),
data
);
rec
=
MSI_CreateRecord
(
2
);
if
(
!
rec
)
if
(
!
(
rec
=
MSI_CreateRecord
(
2
)))
return
ERROR_OUTOFMEMORY
;
r
=
MSI_RecordSetStringW
(
rec
,
1
,
name
);
if
(
r
!=
ERROR_SUCCESS
)
goto
err
;
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
r
=
MSI_RecordSetIStream
(
rec
,
2
,
data
);
if
(
r
!=
ERROR_SUCCESS
)
goto
err
;
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
r
=
MSI_DatabaseOpenViewW
(
db
,
insert
,
&
query
);
if
(
r
!=
ERROR_SUCCESS
)
goto
err
;
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
r
=
MSI_ViewExecute
(
query
,
rec
);
msiobj_release
(
&
query
->
hdr
);
if
(
r
==
ERROR_SUCCESS
)
goto
done
;
err:
msiobj_release
(
&
rec
->
hdr
);
if
(
!
(
rec
=
MSI_CreateRecord
(
2
)))
return
ERROR_OUTOFMEMORY
;
r
=
MSI_RecordSetIStream
(
rec
,
1
,
data
);
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
r
=
MSI_RecordSetStringW
(
rec
,
2
,
name
);
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
r
=
MSI_DatabaseOpenViewW
(
db
,
update
,
&
query
);
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
r
=
MSI_ViewExecute
(
query
,
rec
);
msiobj_release
(
&
query
->
hdr
);
done:
msiobj_release
(
&
rec
->
hdr
);
return
r
;
}
...
...
@@ -1345,14 +1369,14 @@ static UINT TABLE_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UI
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
r
=
msi
_stream_name
(
tv
,
row
,
&
stname
);
r
=
get
_stream_name
(
tv
,
row
,
&
stname
);
if
(
r
!=
ERROR_SUCCESS
)
{
IStream_Release
(
stm
);
return
r
;
}
r
=
msi_addstreamW
(
tv
->
db
,
stname
,
stm
);
r
=
add_stream
(
tv
->
db
,
stname
,
stm
);
IStream_Release
(
stm
);
msi_free
(
stname
);
...
...
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