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
08941174
Commit
08941174
authored
Aug 24, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Aug 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix strings with lengths that are exact multiples of 2^16.
parent
f667c06a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
16 deletions
+29
-16
table.c
dlls/msi/table.c
+29
-16
No files found.
dlls/msi/table.c
View file @
08941174
...
...
@@ -686,7 +686,7 @@ string_table *load_string_table( IStorage *stg )
CHAR
*
data
=
NULL
;
USHORT
*
pool
=
NULL
;
UINT
r
,
datasize
=
0
,
poolsize
=
0
,
codepage
;
DWORD
i
,
count
,
offset
,
len
,
n
;
DWORD
i
,
count
,
offset
,
len
,
n
,
refs
;
static
const
WCHAR
szStringData
[]
=
{
'_'
,
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
'D'
,
'a'
,
't'
,
'a'
,
0
};
static
const
WCHAR
szStringPool
[]
=
{
...
...
@@ -708,38 +708,51 @@ string_table *load_string_table( IStorage *stg )
offset
=
0
;
n
=
1
;
for
(
i
=
1
;
i
<
count
;
i
++
)
i
=
1
;
while
(
i
<
count
)
{
len
=
pool
[
i
*
2
];
/* the string reference count is always the second word */
refs
=
pool
[
i
*
2
+
1
];
/* empty entries have two zeros, still have a string id */
if
(
pool
[
i
*
2
]
==
0
&&
refs
==
0
)
{
i
++
;
n
++
;
continue
;
}
/*
* If a string is over 64k, the previous string entry is made null
* and its the high word of the length is inserted in the null string's
* reference count field.
*/
if
(
pool
[
i
*
2
-
2
]
==
0
&&
pool
[
i
*
2
-
1
]
)
len
+=
pool
[
i
*
2
+
1
]
*
0x10000
;
if
(
(
offset
+
len
)
>
datasize
)
if
(
pool
[
i
*
2
]
==
0
)
{
ERR
(
"string table corrupt?
\n
"
);
break
;
len
=
(
pool
[
i
*
2
+
3
]
<<
16
)
+
pool
[
i
*
2
+
2
];
i
+=
2
;
}
else
{
len
=
pool
[
i
*
2
];
i
+=
1
;
}
/* don't add the high word of a string's length as a string */
if
(
len
||
!
pool
[
i
*
2
+
1
]
)
if
(
(
offset
+
len
)
>
datasize
)
{
r
=
msi_addstring
(
st
,
n
,
data
+
offset
,
len
,
pool
[
i
*
2
+
1
]
);
if
(
r
!=
n
)
ERR
(
"Failed to add string %ld
\n
"
,
n
);
n
++
;
ERR
(
"string table corrupt?
\n
"
);
break
;
}
r
=
msi_addstring
(
st
,
n
,
data
+
offset
,
len
,
refs
);
if
(
r
!=
n
)
ERR
(
"Failed to add string %ld
\n
"
,
n
);
n
++
;
offset
+=
len
;
}
if
(
datasize
!=
offset
)
ERR
(
"string table load failed! (%08x != %08lx)
\n
"
,
datasize
,
offset
);
ERR
(
"string table load failed! (%08x != %08lx)
, please report
\n
"
,
datasize
,
offset
);
TRACE
(
"Loaded %ld strings
\n
"
,
count
);
...
...
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