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
4f9971f5
Commit
4f9971f5
authored
May 06, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
May 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Keep track of a stream's storage.
parent
6b8a8d75
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
19 deletions
+28
-19
database.c
dlls/msi/database.c
+21
-13
msipriv.h
dlls/msi/msipriv.h
+3
-2
streams.c
dlls/msi/streams.c
+3
-3
table.c
dlls/msi/table.c
+1
-1
No files found.
dlls/msi/database.c
View file @
4f9971f5
...
...
@@ -61,10 +61,11 @@ typedef struct tagMSITRANSFORM {
typedef
struct
tagMSISTREAM
{
struct
list
entry
;
IStorage
*
stg
;
IStream
*
stm
;
}
MSISTREAM
;
static
UINT
find_open_stream
(
MSIDATABASE
*
db
,
LPCWSTR
name
,
IStream
**
stm
)
static
UINT
find_open_stream
(
MSIDATABASE
*
db
,
IStorage
*
stg
,
LPCWSTR
name
,
IStream
**
stm
)
{
MSISTREAM
*
stream
;
...
...
@@ -73,6 +74,8 @@ static UINT find_open_stream( MSIDATABASE *db, LPCWSTR name, IStream **stm )
HRESULT
r
;
STATSTG
stat
;
if
(
stream
->
stg
!=
stg
)
continue
;
r
=
IStream_Stat
(
stream
->
stm
,
&
stat
,
0
);
if
(
FAILED
(
r
)
)
{
...
...
@@ -94,11 +97,11 @@ static UINT find_open_stream( MSIDATABASE *db, LPCWSTR name, IStream **stm )
return
ERROR_FUNCTION_FAILED
;
}
static
UINT
clone_open_stream
(
MSIDATABASE
*
db
,
LPCWSTR
name
,
IStream
**
stm
)
UINT
msi_clone_open_stream
(
MSIDATABASE
*
db
,
IStorage
*
stg
,
LPCWSTR
name
,
IStream
**
stm
)
{
IStream
*
stream
;
if
(
find_open_stream
(
db
,
name
,
&
stream
)
==
ERROR_SUCCESS
)
if
(
find_open_stream
(
db
,
stg
,
name
,
&
stream
)
==
ERROR_SUCCESS
)
{
HRESULT
r
;
LARGE_INTEGER
pos
;
...
...
@@ -124,15 +127,16 @@ static UINT clone_open_stream( MSIDATABASE *db, LPCWSTR name, IStream **stm )
return
ERROR_FUNCTION_FAILED
;
}
UINT
db
_get_raw_stream
(
MSIDATABASE
*
db
,
LPCWSTR
stname
,
IStream
**
stm
)
UINT
msi
_get_raw_stream
(
MSIDATABASE
*
db
,
LPCWSTR
stname
,
IStream
**
stm
)
{
HRESULT
r
;
IStorage
*
stg
;
WCHAR
decoded
[
MAX_STREAM_NAME_LEN
];
decode_streamname
(
stname
,
decoded
);
TRACE
(
"%s -> %s
\n
"
,
debugstr_w
(
stname
),
debugstr_w
(
decoded
));
if
(
clone_open_stream
(
db
,
stname
,
stm
)
==
ERROR_SUCCESS
)
if
(
msi_clone_open_stream
(
db
,
db
->
storage
,
stname
,
stm
)
==
ERROR_SUCCESS
)
return
ERROR_SUCCESS
;
r
=
IStorage_OpenStream
(
db
->
storage
,
stname
,
NULL
,
...
...
@@ -146,18 +150,21 @@ UINT db_get_raw_stream( MSIDATABASE *db, LPCWSTR stname, IStream **stm )
r
=
IStorage_OpenStream
(
transform
->
stg
,
stname
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
stm
);
if
(
SUCCEEDED
(
r
))
{
stg
=
transform
->
stg
;
break
;
}
}
}
else
stg
=
db
->
storage
;
if
(
SUCCEEDED
(
r
)
)
{
MSISTREAM
*
stream
;
stream
=
msi_alloc
(
sizeof
(
MSISTREAM
)
);
if
(
!
stream
)
return
ERROR_NOT_ENOUGH_MEMORY
;
if
(
!
(
stream
=
msi_alloc
(
sizeof
(
MSISTREAM
)
)))
return
ERROR_NOT_ENOUGH_MEMORY
;
stream
->
stg
=
stg
;
IStream_AddRef
(
stg
);
stream
->
stm
=
*
stm
;
IStream_AddRef
(
*
stm
);
list_add_tail
(
&
db
->
streams
,
&
stream
->
entry
);
...
...
@@ -178,7 +185,7 @@ static void free_transforms( MSIDATABASE *db )
}
}
void
db_destroy_stream
(
MSIDATABASE
*
db
,
LPCWSTR
stname
)
void
msi_destroy_stream
(
MSIDATABASE
*
db
,
const
WCHAR
*
stname
)
{
MSISTREAM
*
stream
,
*
stream2
;
...
...
@@ -200,8 +207,9 @@ void db_destroy_stream( MSIDATABASE *db, LPCWSTR stname )
list_remove
(
&
stream
->
entry
);
IStream_Release
(
stream
->
stm
);
IStream_Release
(
stream
->
stg
);
IStorage_DestroyElement
(
stream
->
stg
,
stname
);
msi_free
(
stream
);
IStorage_DestroyElement
(
db
->
storage
,
stname
);
CoTaskMemFree
(
stat
.
pwcsName
);
break
;
}
...
...
@@ -213,10 +221,10 @@ static void free_streams( MSIDATABASE *db )
{
while
(
!
list_empty
(
&
db
->
streams
)
)
{
MSISTREAM
*
s
=
LIST_ENTRY
(
list_head
(
&
db
->
streams
),
MSISTREAM
,
entry
);
MSISTREAM
*
s
=
LIST_ENTRY
(
list_head
(
&
db
->
streams
),
MSISTREAM
,
entry
);
list_remove
(
&
s
->
entry
);
IStream_Release
(
s
->
stm
);
IStream_Release
(
s
->
stg
);
msi_free
(
s
);
}
}
...
...
dlls/msi/msipriv.h
View file @
4f9971f5
...
...
@@ -799,8 +799,9 @@ extern LPWSTR encode_streamname(BOOL bTable, LPCWSTR in) DECLSPEC_HIDDEN;
extern
BOOL
decode_streamname
(
LPCWSTR
in
,
LPWSTR
out
)
DECLSPEC_HIDDEN
;
/* database internals */
extern
UINT
db_get_raw_stream
(
MSIDATABASE
*
,
LPCWSTR
,
IStream
**
)
DECLSPEC_HIDDEN
;
void
db_destroy_stream
(
MSIDATABASE
*
,
LPCWSTR
)
DECLSPEC_HIDDEN
;
extern
UINT
msi_get_raw_stream
(
MSIDATABASE
*
,
LPCWSTR
,
IStream
**
)
DECLSPEC_HIDDEN
;
extern
UINT
msi_clone_open_stream
(
MSIDATABASE
*
,
IStorage
*
,
const
WCHAR
*
,
IStream
**
)
DECLSPEC_HIDDEN
;
void
msi_destroy_stream
(
MSIDATABASE
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
extern
UINT
MSI_OpenDatabaseW
(
LPCWSTR
,
LPCWSTR
,
MSIDATABASE
**
)
DECLSPEC_HIDDEN
;
extern
UINT
MSI_DatabaseOpenViewW
(
MSIDATABASE
*
,
LPCWSTR
,
MSIQUERY
**
)
DECLSPEC_HIDDEN
;
extern
UINT
MSI_OpenQuery
(
MSIDATABASE
*
,
MSIQUERY
**
,
LPCWSTR
,
...
)
DECLSPEC_HIDDEN
;
...
...
dlls/msi/streams.c
View file @
4f9971f5
...
...
@@ -182,7 +182,7 @@ static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, U
}
encname
=
encode_streamname
(
FALSE
,
name
);
db
_destroy_stream
(
sv
->
db
,
encname
);
msi
_destroy_stream
(
sv
->
db
,
encname
);
r
=
write_stream_data
(
sv
->
db
->
storage
,
name
,
data
,
count
,
FALSE
);
if
(
r
!=
ERROR_SUCCESS
)
...
...
@@ -529,12 +529,12 @@ static INT add_streams_to_table(MSISTREAMSVIEW *sv)
/* these streams appear to be unencoded */
if
(
*
stat
.
pwcsName
==
0x0005
)
{
r
=
db
_get_raw_stream
(
sv
->
db
,
stat
.
pwcsName
,
&
stream
->
stream
);
r
=
msi
_get_raw_stream
(
sv
->
db
,
stat
.
pwcsName
,
&
stream
->
stream
);
}
else
{
encname
=
encode_streamname
(
FALSE
,
stat
.
pwcsName
);
r
=
db
_get_raw_stream
(
sv
->
db
,
encname
,
&
stream
->
stream
);
r
=
msi
_get_raw_stream
(
sv
->
db
,
encname
,
&
stream
->
stream
);
msi_free
(
encname
);
}
CoTaskMemFree
(
stat
.
pwcsName
);
...
...
dlls/msi/table.c
View file @
4f9971f5
...
...
@@ -1221,7 +1221,7 @@ static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt
}
encname
=
encode_streamname
(
FALSE
,
full_name
);
r
=
db
_get_raw_stream
(
tv
->
db
,
encname
,
stm
);
r
=
msi
_get_raw_stream
(
tv
->
db
,
encname
,
stm
);
if
(
r
)
ERR
(
"fetching stream %s, error = %d
\n
"
,
debugstr_w
(
full_name
),
r
);
...
...
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