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
1ff99231
Commit
1ff99231
authored
Feb 19, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add summary information stream to the streams table.
parent
ddb20916
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
9 deletions
+58
-9
msipriv.h
dlls/msi/msipriv.h
+1
-0
streams.c
dlls/msi/streams.c
+16
-5
suminfo.c
dlls/msi/suminfo.c
+0
-3
db.c
dlls/msi/tests/db.c
+41
-1
No files found.
dlls/msi/msipriv.h
View file @
1ff99231
...
...
@@ -1074,6 +1074,7 @@ static const WCHAR szProductID[] = {'P','r','o','d','u','c','t','I','D',0};
static
const
WCHAR
szPIDTemplate
[]
=
{
'P'
,
'I'
,
'D'
,
'T'
,
'e'
,
'm'
,
'p'
,
'l'
,
'a'
,
't'
,
'e'
,
0
};
static
const
WCHAR
szPIDKEY
[]
=
{
'P'
,
'I'
,
'D'
,
'K'
,
'E'
,
'Y'
,
0
};
static
const
WCHAR
szTYPELIB
[]
=
{
'T'
,
'Y'
,
'P'
,
'E'
,
'L'
,
'I'
,
'B'
,
0
};
static
const
WCHAR
szSumInfo
[]
=
{
5
,
'S'
,
'u'
,
'm'
,
'm'
,
'a'
,
'r'
,
'y'
,
'I'
,
'n'
,
'f'
,
'o'
,
'r'
,
'm'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
/* memory allocation macro functions */
static
void
*
msi_alloc
(
size_t
len
)
__WINE_ALLOC_SIZE
(
1
);
...
...
dlls/msi/streams.c
View file @
1ff99231
...
...
@@ -32,6 +32,7 @@
#include "query.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msidb
);
...
...
@@ -486,7 +487,8 @@ static INT add_streams_to_table(MSISTREAMSVIEW *sv)
STATSTG
stat
;
STREAM
*
stream
=
NULL
;
HRESULT
hr
;
UINT
count
=
0
,
size
;
UINT
r
,
count
=
0
,
size
;
LPWSTR
encname
;
hr
=
IStorage_EnumElements
(
sv
->
db
->
storage
,
0
,
NULL
,
0
,
&
stgenum
);
if
(
FAILED
(
hr
))
...
...
@@ -525,13 +527,22 @@ static INT add_streams_to_table(MSISTREAMSVIEW *sv)
break
;
}
hr
=
IStorage_OpenStream
(
sv
->
db
->
storage
,
stat
.
pwcsName
,
0
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stream
->
stream
);
if
(
!
strcmpW
(
stat
.
pwcsName
,
szSumInfo
))
{
/* summary information stream is not encoded */
r
=
db_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
);
msi_free
(
encname
);
}
CoTaskMemFree
(
stat
.
pwcsName
);
if
(
FAILED
(
hr
)
)
if
(
r
!=
ERROR_SUCCESS
)
{
WARN
(
"
failed to open stream: %08x
\n
"
,
h
r
);
WARN
(
"
unable to get stream %u
\n
"
,
r
);
count
=
-
1
;
break
;
}
...
...
dlls/msi/suminfo.c
View file @
1ff99231
...
...
@@ -86,9 +86,6 @@ static HRESULT (WINAPI *pPropVariantChangeType)
#define SECT_HDR_SIZE (sizeof(PROPERTYSECTIONHEADER))
static
const
WCHAR
szSumInfo
[]
=
{
5
,
'S'
,
'u'
,
'm'
,
'm'
,
'a'
,
'r'
,
'y'
,
'I'
,
'n'
,
'f'
,
'o'
,
'r'
,
'm'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
void
free_prop
(
PROPVARIANT
*
prop
)
{
if
(
prop
->
vt
==
VT_LPSTR
)
...
...
dlls/msi/tests/db.c
View file @
1ff99231
...
...
@@ -1411,7 +1411,7 @@ static void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
static
void
test_streamtable
(
void
)
{
MSIHANDLE
hdb
=
0
,
rec
,
view
;
MSIHANDLE
hdb
=
0
,
rec
,
view
,
hsi
;
char
file
[
MAX_PATH
];
char
buf
[
MAX_PATH
];
DWORD
size
;
...
...
@@ -1456,6 +1456,46 @@ static void test_streamtable(void)
MsiCloseHandle
(
rec
);
r
=
MsiDatabaseOpenView
(
hdb
,
"SELECT * FROM `_Streams` WHERE `Name` = '
\5
SummaryInformation'"
,
&
view
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to open database view: %u
\n
"
,
r
);
r
=
MsiViewExecute
(
view
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to execute view: %u
\n
"
,
r
);
r
=
MsiViewFetch
(
view
,
&
rec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Unexpected result: %u
\n
"
,
r
);
MsiCloseHandle
(
rec
);
MsiViewClose
(
view
);
MsiCloseHandle
(
view
);
/* create a summary information stream */
r
=
MsiGetSummaryInformationA
(
hdb
,
NULL
,
1
,
&
hsi
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to get summary information handle: %u
\n
"
,
r
);
r
=
MsiSummaryInfoSetPropertyA
(
hsi
,
PID_SECURITY
,
VT_I4
,
2
,
NULL
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to set property: %u
\n
"
,
r
);
r
=
MsiSummaryInfoPersist
(
hsi
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to save summary information: %u
\n
"
,
r
);
MsiCloseHandle
(
hsi
);
r
=
MsiDatabaseOpenView
(
hdb
,
"SELECT * FROM `_Streams` WHERE `Name` = '
\5
SummaryInformation'"
,
&
view
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to open database view: %u
\n
"
,
r
);
r
=
MsiViewExecute
(
view
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to execute view: %u
\n
"
,
r
);
r
=
MsiViewFetch
(
view
,
&
rec
);
ok
(
r
==
ERROR_SUCCESS
,
"Unexpected result: %u
\n
"
,
r
);
MsiCloseHandle
(
rec
);
MsiViewClose
(
view
);
MsiCloseHandle
(
view
);
/* insert a file into the _Streams table */
create_file
(
"test.txt"
);
...
...
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