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
a16e5151
Commit
a16e5151
authored
Feb 06, 2007
by
Mike McCormack
Committed by
Alexandre Julliard
Feb 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Factor out code to calculate column offsets.
parent
824b8998
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
table.c
dlls/msi/table.c
+21
-14
No files found.
dlls/msi/table.c
View file @
a16e5151
...
...
@@ -873,6 +873,24 @@ static const MSICOLUMNINFO _Tables_cols[1] = {
{
szTables
,
1
,
szName
,
MSITYPE_VALID
|
MSITYPE_STRING
|
64
,
0
},
};
static
void
table_calc_column_offsets
(
MSICOLUMNINFO
*
colinfo
,
DWORD
count
)
{
DWORD
i
;
for
(
i
=
0
;
colinfo
&&
(
i
<
count
);
i
++
)
{
assert
(
(
i
+
1
)
==
colinfo
[
i
].
number
);
if
(
i
)
colinfo
[
i
].
offset
=
colinfo
[
i
-
1
].
offset
+
bytes_per_column
(
&
colinfo
[
i
-
1
]
);
else
colinfo
[
i
].
offset
=
0
;
TRACE
(
"column %d is [%s] with type %08x ofs %d
\n
"
,
colinfo
[
i
].
number
,
debugstr_w
(
colinfo
[
i
].
colname
),
colinfo
[
i
].
type
,
colinfo
[
i
].
offset
);
}
}
static
UINT
get_defaulttablecolumns
(
LPCWSTR
name
,
MSICOLUMNINFO
*
colinfo
,
UINT
*
sz
)
{
const
MSICOLUMNINFO
*
p
;
...
...
@@ -905,6 +923,7 @@ static UINT get_defaulttablecolumns( LPCWSTR name, MSICOLUMNINFO *colinfo, UINT
if
(
colinfo
&&
(
i
>=
*
sz
)
)
break
;
}
table_calc_column_offsets
(
colinfo
,
n
);
*
sz
=
n
;
return
ERROR_SUCCESS
;
}
...
...
@@ -994,26 +1013,14 @@ static UINT get_tablecolumns( MSIDATABASE *db,
TRACE
(
"%s has %d columns
\n
"
,
debugstr_w
(
szTableName
),
n
);
if
(
maxcount
&&
n
!=
maxcount
)
if
(
colinfo
&&
n
!=
maxcount
)
{
ERR
(
"missing column in table %s
\n
"
,
debugstr_w
(
szTableName
));
msi_free_colinfo
(
colinfo
,
maxcount
);
return
ERROR_FUNCTION_FAILED
;
}
/* calculate the offsets */
for
(
i
=
0
;
maxcount
&&
(
i
<
maxcount
);
i
++
)
{
assert
(
(
i
+
1
)
==
colinfo
[
i
].
number
);
if
(
i
)
colinfo
[
i
].
offset
=
colinfo
[
i
-
1
].
offset
+
bytes_per_column
(
&
colinfo
[
i
-
1
]
);
else
colinfo
[
i
].
offset
=
0
;
TRACE
(
"column %d is [%s] with type %08x ofs %d
\n
"
,
colinfo
[
i
].
number
,
debugstr_w
(
colinfo
[
i
].
colname
),
colinfo
[
i
].
type
,
colinfo
[
i
].
offset
);
}
table_calc_column_offsets
(
colinfo
,
n
);
*
sz
=
n
;
return
ERROR_SUCCESS
;
...
...
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