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
d9568722
Commit
d9568722
authored
May 24, 2009
by
Hib Eris
Committed by
Alexandre Julliard
May 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Support transforms with binary OBJECTS.
parent
f6dd90de
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
4 deletions
+85
-4
msipriv.h
dlls/msi/msipriv.h
+1
-0
record.c
dlls/msi/record.c
+1
-1
table.c
dlls/msi/table.c
+83
-3
No files found.
dlls/msi/msipriv.h
View file @
d9568722
...
...
@@ -701,6 +701,7 @@ extern UINT MSI_RecordGetStringW( MSIRECORD * , UINT, LPWSTR, LPDWORD);
extern
UINT
MSI_RecordGetStringA
(
MSIRECORD
*
,
UINT
,
LPSTR
,
LPDWORD
);
extern
int
MSI_RecordGetInteger
(
MSIRECORD
*
,
UINT
);
extern
UINT
MSI_RecordReadStream
(
MSIRECORD
*
,
UINT
,
char
*
,
LPDWORD
);
extern
UINT
MSI_RecordSetStream
(
MSIRECORD
*
,
UINT
,
IStream
*
);
extern
UINT
MSI_RecordGetFieldCount
(
const
MSIRECORD
*
rec
);
extern
UINT
MSI_RecordStreamToFile
(
MSIRECORD
*
,
UINT
,
LPCWSTR
);
extern
UINT
MSI_RecordCopyField
(
MSIRECORD
*
,
UINT
,
MSIRECORD
*
,
UINT
);
...
...
dlls/msi/record.c
View file @
d9568722
...
...
@@ -661,7 +661,7 @@ static UINT RECORD_StreamFromFile(LPCWSTR szFile, IStream **pstm)
return
ERROR_SUCCESS
;
}
static
UINT
MSI_RecordSetStream
(
MSIRECORD
*
rec
,
UINT
iField
,
IStream
*
stream
)
UINT
MSI_RecordSetStream
(
MSIRECORD
*
rec
,
UINT
iField
,
IStream
*
stream
)
{
if
(
(
iField
==
0
)
||
(
iField
>
rec
->
count
)
)
return
ERROR_INVALID_PARAMETER
;
...
...
dlls/msi/table.c
View file @
d9568722
...
...
@@ -2373,7 +2373,67 @@ static UINT read_raw_int(const BYTE *data, UINT col, UINT bytes)
return
ret
;
}
static
UINT
msi_record_encoded_stream_name
(
const
MSITABLEVIEW
*
tv
,
MSIRECORD
*
rec
,
LPWSTR
*
pstname
)
{
static
const
WCHAR
szDot
[]
=
{
'.'
,
0
};
LPWSTR
stname
=
NULL
,
sval
,
p
;
DWORD
len
;
UINT
i
,
r
;
TRACE
(
"%p %p
\n
"
,
tv
,
rec
);
len
=
lstrlenW
(
tv
->
name
)
+
1
;
stname
=
msi_alloc
(
len
*
sizeof
(
WCHAR
)
);
if
(
!
stname
)
{
r
=
ERROR_OUTOFMEMORY
;
goto
err
;
}
lstrcpyW
(
stname
,
tv
->
name
);
for
(
i
=
0
;
i
<
tv
->
num_cols
;
i
++
)
{
if
(
tv
->
columns
[
i
].
type
&
MSITYPE_KEY
)
{
sval
=
msi_dup_record_field
(
rec
,
i
+
1
);
if
(
!
sval
)
{
r
=
ERROR_OUTOFMEMORY
;
goto
err
;
}
len
+=
lstrlenW
(
szDot
)
+
lstrlenW
(
sval
);
p
=
msi_realloc
(
stname
,
len
*
sizeof
(
WCHAR
)
);
if
(
!
p
)
{
r
=
ERROR_OUTOFMEMORY
;
goto
err
;
}
stname
=
p
;
lstrcatW
(
stname
,
szDot
);
lstrcatW
(
stname
,
sval
);
msi_free
(
sval
);
}
else
continue
;
}
*
pstname
=
encode_streamname
(
FALSE
,
stname
);
msi_free
(
stname
);
return
ERROR_SUCCESS
;
err:
msi_free
(
stname
);
*
pstname
=
NULL
;
return
r
;
}
static
MSIRECORD
*
msi_get_transform_record
(
const
MSITABLEVIEW
*
tv
,
const
string_table
*
st
,
IStorage
*
stg
,
const
BYTE
*
rawdata
,
UINT
bytes_per_strref
)
{
UINT
i
,
val
,
ofs
=
0
;
...
...
@@ -2397,8 +2457,28 @@ static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string
if
(
(
~
mask
&
1
)
&&
(
~
columns
[
i
].
type
&
MSITYPE_KEY
)
&&
((
1
<<
i
)
&
~
mask
)
)
continue
;
if
(
(
columns
[
i
].
type
&
MSITYPE_STRING
)
&&
!
MSITYPE_IS_BINARY
(
tv
->
columns
[
i
].
type
)
)
if
(
MSITYPE_IS_BINARY
(
tv
->
columns
[
i
].
type
)
)
{
LPWSTR
encname
;
IStream
*
stm
=
NULL
;
UINT
r
;
ofs
+=
bytes_per_column
(
tv
->
db
,
&
columns
[
i
]
);
r
=
msi_record_encoded_stream_name
(
tv
,
rec
,
&
encname
);
if
(
r
!=
ERROR_SUCCESS
)
return
NULL
;
r
=
IStorage_OpenStream
(
stg
,
encname
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stm
);
msi_free
(
encname
);
if
(
r
!=
ERROR_SUCCESS
)
return
NULL
;
MSI_RecordSetStream
(
rec
,
i
+
1
,
stm
);
TRACE
(
" field %d [%s]
\n
"
,
i
+
1
,
debugstr_w
(
encname
));
}
else
if
(
columns
[
i
].
type
&
MSITYPE_STRING
)
{
LPCWSTR
sval
;
...
...
@@ -2659,7 +2739,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg,
break
;
}
rec
=
msi_get_transform_record
(
tv
,
st
,
&
rawdata
[
n
],
bytes_per_strref
);
rec
=
msi_get_transform_record
(
tv
,
st
,
stg
,
&
rawdata
[
n
],
bytes_per_strref
);
if
(
rec
)
{
if
(
mask
&
1
)
...
...
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