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
882e4fb2
Commit
882e4fb2
authored
Jan 22, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add support for updating rows in join tables.
parent
a3528a76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
109 additions
and
3 deletions
+109
-3
join.c
dlls/msi/join.c
+109
-3
No files found.
dlls/msi/join.c
View file @
882e4fb2
...
...
@@ -222,13 +222,119 @@ static UINT JOIN_get_column_info( struct tagMSIVIEW *view,
return
ERROR_FUNCTION_FAILED
;
}
static
UINT
JOIN_modify
(
struct
tagMSIVIEW
*
view
,
MSIMODIFY
eModifyMode
,
MSIRECORD
*
rec
,
UINT
row
)
static
UINT
join_find_row
(
MSIJOINVIEW
*
jv
,
MSIRECORD
*
rec
,
UINT
*
row
)
{
TRACE
(
"%p %d %p
\n
"
,
view
,
eModifyMode
,
rec
);
LPCWSTR
str
;
UINT
i
,
id
,
data
;
str
=
MSI_RecordGetString
(
rec
,
1
);
msi_string2idW
(
jv
->
db
->
strings
,
str
,
&
id
);
for
(
i
=
0
;
i
<
jv
->
rows
;
i
++
)
{
JOIN_fetch_int
(
&
jv
->
view
,
i
,
1
,
&
data
);
if
(
data
==
id
)
{
*
row
=
i
;
return
ERROR_SUCCESS
;
}
}
return
ERROR_FUNCTION_FAILED
;
}
static
UINT
JOIN_set_row
(
struct
tagMSIVIEW
*
view
,
UINT
row
,
MSIRECORD
*
rec
,
UINT
mask
)
{
MSIJOINVIEW
*
jv
=
(
MSIJOINVIEW
*
)
view
;
JOINTABLE
*
table
;
UINT
i
,
reduced_mask
=
0
,
r
=
ERROR_SUCCESS
,
offset
=
0
,
col_count
;
MSIRECORD
*
reduced
;
TRACE
(
"%p %d %p %u %08x
\n
"
,
jv
,
row
,
rec
,
rec
->
count
,
mask
);
if
(
mask
>=
1
<<
jv
->
columns
)
return
ERROR_INVALID_PARAMETER
;
LIST_FOR_EACH_ENTRY
(
table
,
&
jv
->
tables
,
JOINTABLE
,
entry
)
{
r
=
table
->
view
->
ops
->
get_dimensions
(
table
->
view
,
NULL
,
&
col_count
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
reduced
=
MSI_CreateRecord
(
col_count
);
if
(
!
reduced
)
return
ERROR_FUNCTION_FAILED
;
for
(
i
=
0
;
i
<
col_count
;
i
++
)
{
r
=
MSI_RecordCopyField
(
rec
,
i
+
offset
+
1
,
reduced
,
i
+
1
);
if
(
r
!=
ERROR_SUCCESS
)
break
;
}
offset
+=
col_count
;
reduced_mask
=
mask
>>
(
jv
->
columns
-
offset
)
&
((
1
<<
col_count
)
-
1
);
if
(
r
==
ERROR_SUCCESS
)
r
=
table
->
view
->
ops
->
set_row
(
table
->
view
,
row
,
reduced
,
reduced_mask
);
msiobj_release
(
&
reduced
->
hdr
);
}
return
r
;
}
static
UINT
join_modify_update
(
struct
tagMSIVIEW
*
view
,
MSIRECORD
*
rec
)
{
MSIJOINVIEW
*
jv
=
(
MSIJOINVIEW
*
)
view
;
UINT
r
,
row
;
r
=
join_find_row
(
jv
,
rec
,
&
row
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
return
JOIN_set_row
(
view
,
row
,
rec
,
(
1
<<
jv
->
columns
)
-
1
);
}
static
UINT
JOIN_modify
(
struct
tagMSIVIEW
*
view
,
MSIMODIFY
mode
,
MSIRECORD
*
rec
,
UINT
row
)
{
UINT
r
;
TRACE
(
"%p %d %p %u
\n
"
,
view
,
mode
,
rec
,
row
);
switch
(
mode
)
{
case
MSIMODIFY_UPDATE
:
return
join_modify_update
(
view
,
rec
);
case
MSIMODIFY_ASSIGN
:
case
MSIMODIFY_DELETE
:
case
MSIMODIFY_INSERT
:
case
MSIMODIFY_INSERT_TEMPORARY
:
case
MSIMODIFY_MERGE
:
case
MSIMODIFY_REPLACE
:
case
MSIMODIFY_SEEK
:
case
MSIMODIFY_VALIDATE
:
case
MSIMODIFY_VALIDATE_DELETE
:
case
MSIMODIFY_VALIDATE_FIELD
:
case
MSIMODIFY_VALIDATE_NEW
:
r
=
ERROR_FUNCTION_FAILED
;
break
;
case
MSIMODIFY_REFRESH
:
r
=
ERROR_CALL_NOT_IMPLEMENTED
;
break
;
default:
WARN
(
"%p %d %p %u - unknown mode
\n
"
,
view
,
mode
,
rec
,
row
);
r
=
ERROR_INVALID_PARAMETER
;
break
;
}
return
r
;
}
static
UINT
JOIN_delete
(
struct
tagMSIVIEW
*
view
)
{
MSIJOINVIEW
*
jv
=
(
MSIJOINVIEW
*
)
view
;
...
...
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