Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f6ae2507
Commit
f6ae2507
authored
Oct 20, 2009
by
Hib Eris
Committed by
Alexandre Julliard
Oct 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix table rows order.
parent
efacff81
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
8 deletions
+50
-8
table.c
dlls/msi/table.c
+42
-0
db.c
dlls/msi/tests/db.c
+8
-8
No files found.
dlls/msi/table.c
View file @
f6ae2507
...
...
@@ -1657,6 +1657,41 @@ static UINT table_validate_new( MSITABLEVIEW *tv, MSIRECORD *rec )
return
ERROR_SUCCESS
;
}
static
UINT
find_insert_index
(
MSITABLEVIEW
*
tv
,
MSIRECORD
*
rec
,
UINT
*
pidx
)
{
UINT
r
,
idx
,
j
,
ivalue
,
x
;
TRACE
(
"%p %p %p
\n
"
,
tv
,
rec
,
pidx
);
for
(
idx
=
0
;
idx
<
tv
->
table
->
row_count
;
idx
++
)
{
for
(
j
=
0
;
j
<
tv
->
num_cols
;
j
++
)
{
r
=
get_table_value_from_record
(
tv
,
rec
,
j
+
1
,
&
ivalue
);
if
(
r
!=
ERROR_SUCCESS
)
break
;
r
=
TABLE_fetch_int
(
&
tv
->
view
,
idx
,
j
+
1
,
&
x
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
if
(
ivalue
>
x
)
break
;
else
if
(
ivalue
==
x
)
continue
;
else
{
TRACE
(
"Found %d.
\n
"
,
idx
);
*
pidx
=
idx
;
return
ERROR_SUCCESS
;
}
}
}
TRACE
(
"Found %d.
\n
"
,
idx
);
*
pidx
=
idx
;
return
ERROR_SUCCESS
;
}
static
UINT
TABLE_insert_row
(
struct
tagMSIVIEW
*
view
,
MSIRECORD
*
rec
,
UINT
row
,
BOOL
temporary
)
{
MSITABLEVIEW
*
tv
=
(
MSITABLEVIEW
*
)
view
;
...
...
@@ -1669,6 +1704,13 @@ static UINT TABLE_insert_row( struct tagMSIVIEW *view, MSIRECORD *rec, UINT row,
if
(
r
!=
ERROR_SUCCESS
)
return
ERROR_FUNCTION_FAILED
;
if
(
row
==
-
1
)
{
r
=
find_insert_index
(
tv
,
rec
,
&
row
);
if
(
r
!=
ERROR_SUCCESS
)
return
ERROR_FUNCTION_FAILED
;
}
r
=
table_create_new_row
(
view
,
&
row
,
temporary
);
TRACE
(
"insert_row returned %08x
\n
"
,
r
);
if
(
r
!=
ERROR_SUCCESS
)
...
...
dlls/msi/tests/db.c
View file @
f6ae2507
...
...
@@ -4527,11 +4527,11 @@ static void test_rows_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
,
"A"
),
"Expected A, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"A"
),
"Expected A, got %s
\n
"
,
buffer
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
2
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"B"
),
"Expected B, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"B"
),
"Expected B, got %s
\n
"
,
buffer
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
...
...
@@ -4540,11 +4540,11 @@ static void test_rows_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
,
"C"
),
"Expected E, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"C"
),
"Expected E, got %s
\n
"
,
buffer
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
2
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"E"
),
"Expected E, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"E"
),
"Expected E, got %s
\n
"
,
buffer
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
...
...
@@ -4553,11 +4553,11 @@ static void test_rows_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
,
"D"
),
"Expected D, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"D"
),
"Expected D, got %s
\n
"
,
buffer
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
2
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"E"
),
"Expected E, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"E"
),
"Expected E, got %s
\n
"
,
buffer
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
...
...
@@ -4566,11 +4566,11 @@ static void test_rows_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
,
"F"
),
"Expected F, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"F"
),
"Expected F, got %s
\n
"
,
buffer
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
2
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"A"
),
"Expected A, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"A"
),
"Expected A, got %s
\n
"
,
buffer
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
...
...
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