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
597c5f9c
Commit
597c5f9c
authored
Jun 22, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Open database cabinet streams through the streams implementation.
parent
806ff30f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
10 deletions
+50
-10
action.c
dlls/msi/action.c
+3
-2
media.c
dlls/msi/media.c
+18
-7
patch.c
dlls/msi/tests/patch.c
+29
-1
No files found.
dlls/msi/action.c
View file @
597c5f9c
...
...
@@ -1313,9 +1313,10 @@ static UINT load_media( MSIRECORD *row, LPVOID param )
const
WCHAR
*
cabinet
=
MSI_RecordGetString
(
row
,
4
);
/* FIXME: load external cabinets and directory sources too */
if
(
!
cabinet
||
cabinet
[
0
]
!=
'#'
)
return
ERROR_SUCCESS
;
msi_add_cabinet_stream
(
package
,
disk_id
,
package
->
db
->
storage
,
cabinet
);
if
(
!
cabinet
||
cabinet
[
0
]
!=
'#'
||
disk_id
>=
MSI_INITIAL_MEDIA_TRANSFORM_DISKID
)
return
ERROR_SUCCESS
;
return
msi_add_cabinet_stream
(
package
,
disk_id
,
package
->
db
->
storage
,
cabinet
);
}
static
UINT
load_all_media
(
MSIPACKAGE
*
package
)
...
...
dlls/msi/media.c
View file @
597c5f9c
...
...
@@ -220,28 +220,39 @@ static INT_PTR CDECL cabinet_open_stream( char *pszFile, int oflag, int pmode )
{
MSICABINETSTREAM
*
cab
;
IStream
*
stream
;
WCHAR
*
encoded
;
HRESULT
hr
;
cab
=
msi_get_cabinet_stream
(
package_disk
.
package
,
package_disk
.
id
);
if
(
!
cab
)
if
(
!
(
cab
=
msi_get_cabinet_stream
(
package_disk
.
package
,
package_disk
.
id
)))
{
WARN
(
"failed to get cabinet stream
\n
"
);
return
-
1
;
}
if
(
!
cab
->
stream
[
0
]
||
!
(
encoded
=
encode_streamname
(
FALSE
,
cab
->
stream
+
1
)))
if
(
cab
->
storage
==
package_disk
.
package
->
db
->
storage
)
{
UINT
r
=
msi_get_stream
(
package_disk
.
package
->
db
,
cab
->
stream
+
1
,
&
stream
);
if
(
r
!=
ERROR_SUCCESS
)
{
WARN
(
"failed to get stream %u
\n
"
,
r
);
return
-
1
;
}
}
else
/* patch storage */
{
HRESULT
hr
;
WCHAR
*
encoded
;
if
(
!
(
encoded
=
encode_streamname
(
FALSE
,
cab
->
stream
+
1
)))
{
WARN
(
"failed to encode stream name
\n
"
);
return
-
1
;
}
hr
=
IStorage_OpenStream
(
cab
->
storage
,
encoded
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stream
);
msi_free
(
encoded
);
if
(
FAILED
(
hr
))
{
WARN
(
"failed to open stream 0x%08x
\n
"
,
hr
);
msi_free
(
encoded
);
return
-
1
;
}
msi_free
(
encoded
);
}
return
(
INT_PTR
)
stream
;
}
...
...
dlls/msi/tests/patch.c
View file @
597c5f9c
...
...
@@ -969,6 +969,29 @@ static UINT find_entry( MSIHANDLE hdb, const char *table, const char *entry )
return
r
;
}
static
UINT
find_entryW
(
MSIHANDLE
hdb
,
const
WCHAR
*
table
,
const
WCHAR
*
entry
)
{
static
const
WCHAR
fmt
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'%'
,
's'
,
'`'
,
' '
,
'W'
,
'H'
,
'E'
,
'R'
,
'E'
,
' '
,
'`'
,
'N'
,
'a'
,
'm'
,
'e'
,
'`'
,
' '
,
'='
,
' '
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
WCHAR
query
[
0x100
];
MSIHANDLE
hview
,
hrec
;
UINT
r
;
wsprintfW
(
query
,
fmt
,
table
,
entry
);
r
=
MsiDatabaseOpenViewW
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
MsiCloseHandle
(
hrec
);
return
r
;
}
static
INT
get_integer
(
MSIHANDLE
hdb
,
UINT
field
,
const
char
*
query
)
{
UINT
r
;
...
...
@@ -1032,11 +1055,13 @@ static char *get_string( MSIHANDLE hdb, UINT field, const char *query)
static
void
test_system_tables
(
void
)
{
static
const
char
patchsource
[]
=
"MSPSRC0F96CDC04CDF4304B2837B9264889EF7"
;
static
const
WCHAR
streamsW
[]
=
{
'_'
,
'S'
,
't'
,
'r'
,
'e'
,
'a'
,
'm'
,
's'
,
0
};
static
const
WCHAR
CAB_msitest_encodedW
[]
=
{
0x3a8c
,
0x47cb
,
0x45b0
,
0x45ec
,
0x45a8
,
0x4837
,
0
};
UINT
r
;
char
*
cr
;
const
char
*
query
;
MSIHANDLE
hproduct
,
hdb
,
hview
,
hrec
;
static
const
char
patchsource
[]
=
"MSPSRC0F96CDC04CDF4304B2837B9264889EF7"
;
if
(
!
pMsiApplyPatchA
)
{
...
...
@@ -1138,6 +1163,9 @@ static void test_system_tables( void )
r
=
find_entry
(
hdb
,
"_Streams"
,
"
\5
SummaryInformation"
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to find entry %u
\n
"
,
r
);
r
=
find_entryW
(
hdb
,
streamsW
,
CAB_msitest_encodedW
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"failed to find entry %u
\n
"
,
r
);
query
=
"SELECT * FROM `_Storages`"
;
r
=
MsiDatabaseOpenViewA
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
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