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
65ac2061
Commit
65ac2061
authored
Jun 21, 2009
by
Hib Eris
Committed by
Alexandre Julliard
Jun 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Insert new tables in correct _Tables location.
parent
19d783d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
9 deletions
+45
-9
table.c
dlls/msi/table.c
+38
-2
db.c
dlls/msi/tests/db.c
+7
-7
No files found.
dlls/msi/table.c
View file @
65ac2061
...
...
@@ -121,6 +121,7 @@ static void table_calc_column_offsets( MSIDATABASE *db, MSICOLUMNINFO *colinfo,
static
UINT
get_tablecolumns
(
MSIDATABASE
*
db
,
LPCWSTR
szTableName
,
MSICOLUMNINFO
*
colinfo
,
UINT
*
sz
);
static
void
msi_free_colinfo
(
MSICOLUMNINFO
*
colinfo
,
UINT
count
);
static
UINT
table_find_insert_idx
(
MSIVIEW
*
view
,
LPCWSTR
name
,
INT
*
pidx
);
static
inline
UINT
bytes_per_column
(
MSIDATABASE
*
db
,
const
MSICOLUMNINFO
*
col
)
{
...
...
@@ -620,6 +621,7 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
column_info
*
col
;
MSITABLE
*
table
;
UINT
i
;
INT
idx
;
/* only add tables that don't exist already */
if
(
TABLE_Exists
(
db
,
name
)
)
...
...
@@ -685,7 +687,11 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
if
(
r
)
goto
err
;
r
=
tv
->
ops
->
insert_row
(
tv
,
rec
,
-
1
,
persistent
==
MSICONDITION_FALSE
);
r
=
table_find_insert_idx
(
tv
,
name
,
&
idx
);
if
(
r
!=
ERROR_SUCCESS
)
idx
=
-
1
;
r
=
tv
->
ops
->
insert_row
(
tv
,
rec
,
idx
,
persistent
==
MSICONDITION_FALSE
);
TRACE
(
"insert_row returned %x
\n
"
,
r
);
if
(
r
)
goto
err
;
...
...
@@ -735,7 +741,11 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
if
(
r
)
goto
err
;
r
=
tv
->
ops
->
insert_row
(
tv
,
rec
,
-
1
,
FALSE
);
r
=
table_find_insert_idx
(
tv
,
name
,
&
idx
);
if
(
r
!=
ERROR_SUCCESS
)
idx
=
-
1
;
r
=
tv
->
ops
->
insert_row
(
tv
,
rec
,
idx
,
FALSE
);
if
(
r
)
goto
err
;
...
...
@@ -2923,3 +2933,29 @@ void msi_free_transforms( MSIDATABASE *db )
msi_free
(
t
);
}
}
static
UINT
table_find_insert_idx
(
MSIVIEW
*
view
,
LPCWSTR
name
,
INT
*
pidx
)
{
UINT
r
,
name_id
,
row_id
;
INT
idx
;
MSITABLEVIEW
*
tv
=
(
MSITABLEVIEW
*
)
view
;
TRACE
(
"%p %s
\n
"
,
view
,
debugstr_w
(
name
));
r
=
msi_string2idW
(
tv
->
db
->
strings
,
name
,
&
name_id
);
if
(
r
!=
ERROR_SUCCESS
)
{
*
pidx
=
-
1
;
return
r
;
}
for
(
idx
=
0
;
idx
<
tv
->
table
->
row_count
;
idx
++
)
{
r
=
TABLE_fetch_int
(
&
tv
->
view
,
idx
,
1
,
&
row_id
);
if
(
row_id
>
name_id
)
break
;
}
*
pidx
=
idx
;
return
ERROR_SUCCESS
;
}
dlls/msi/tests/db.c
View file @
65ac2061
...
...
@@ -4346,7 +4346,7 @@ static void test_tables_order(void)
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
1
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"baz"
),
"Expected baz, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"baz"
),
"Expected baz, got %s
\n
"
,
buffer
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
...
...
@@ -4355,7 +4355,7 @@ static void test_tables_order(void)
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
1
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"bar"
),
"Expected bar, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"bar"
),
"Expected bar, got %s
\n
"
,
buffer
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
...
...
@@ -4391,11 +4391,11 @@ static void test_tables_order(void)
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
1
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"baz"
),
"Expected baz, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"baz"
),
"Expected baz, got %s
\n
"
,
buffer
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
3
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"bar"
),
"Expected bar, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"bar"
),
"Expected bar, got %s
\n
"
,
buffer
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
...
...
@@ -4408,7 +4408,7 @@ static void test_tables_order(void)
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
3
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"baz"
),
"Expected baz, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"baz"
),
"Expected baz, got %s
\n
"
,
buffer
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
...
...
@@ -4421,7 +4421,7 @@ static void test_tables_order(void)
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
3
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"foo"
),
"Expected foo, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"foo"
),
"Expected foo, got %s
\n
"
,
buffer
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
...
...
@@ -4430,7 +4430,7 @@ static void test_tables_order(void)
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
1
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"bar"
),
"Expected bar, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"bar"
),
"Expected bar, got %s
\n
"
,
buffer
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
3
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\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