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
09b7503f
Commit
09b7503f
authored
Jun 20, 2005
by
Aric Stewart
Committed by
Alexandre Julliard
Jun 20, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use MSI_IterateRecords for DuplicateFiles.
parent
2703d717
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
44 deletions
+28
-44
files.c
dlls/msi/files.c
+28
-44
No files found.
dlls/msi/files.c
View file @
09b7503f
...
@@ -562,46 +562,16 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
...
@@ -562,46 +562,16 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
return
rc
;
return
rc
;
}
}
UINT
ACTION_DuplicateFiles
(
MSIPACKAGE
*
package
)
static
UINT
ITERATE_DuplicateFiles
(
MSIRECORD
*
row
,
LPVOID
param
)
{
{
UINT
rc
;
MSIPACKAGE
*
package
=
(
MSIPACKAGE
*
)
param
;
MSIQUERY
*
view
;
MSIRECORD
*
row
=
0
;
static
const
WCHAR
ExecSeqQuery
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'D'
,
'u'
,
'p'
,
'l'
,
'i'
,
'c'
,
'a'
,
't'
,
'e'
,
'F'
,
'i'
,
'l'
,
'e'
,
'`'
,
0
};
if
(
!
package
)
return
ERROR_INVALID_HANDLE
;
rc
=
MSI_DatabaseOpenViewW
(
package
->
db
,
ExecSeqQuery
,
&
view
);
if
(
rc
!=
ERROR_SUCCESS
)
return
ERROR_SUCCESS
;
rc
=
MSI_ViewExecute
(
view
,
0
);
if
(
rc
!=
ERROR_SUCCESS
)
{
MSI_ViewClose
(
view
);
msiobj_release
(
&
view
->
hdr
);
return
rc
;
}
while
(
1
)
{
WCHAR
*
file_source
=
NULL
;
WCHAR
*
file_source
=
NULL
;
WCHAR
dest_name
[
0x100
];
WCHAR
dest_name
[
0x100
];
LPWSTR
dest_path
,
dest
;
LPWSTR
dest_path
,
dest
;
LPCWSTR
file_key
,
component
;
LPCWSTR
file_key
,
component
;
INT
component_index
;
INT
component_index
;
DWORD
sz
;
DWORD
sz
;
DWORD
rc
;
rc
=
MSI_ViewFetch
(
view
,
&
row
);
if
(
rc
!=
ERROR_SUCCESS
)
{
rc
=
ERROR_SUCCESS
;
break
;
}
component
=
MSI_RecordGetString
(
row
,
2
);
component
=
MSI_RecordGetString
(
row
,
2
);
component_index
=
get_loaded_component
(
package
,
component
);
component_index
=
get_loaded_component
(
package
,
component
);
...
@@ -616,8 +586,7 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
...
@@ -616,8 +586,7 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
package
->
components
[
component_index
].
Action
=
package
->
components
[
component_index
].
Action
=
package
->
components
[
component_index
].
Installed
;
package
->
components
[
component_index
].
Installed
;
msiobj_release
(
&
row
->
hdr
);
return
ERROR_SUCCESS
;
continue
;
}
}
package
->
components
[
component_index
].
Action
=
INSTALLSTATE_LOCAL
;
package
->
components
[
component_index
].
Action
=
INSTALLSTATE_LOCAL
;
...
@@ -626,8 +595,7 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
...
@@ -626,8 +595,7 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
if
(
!
file_key
)
if
(
!
file_key
)
{
{
ERR
(
"Unable to get file key
\n
"
);
ERR
(
"Unable to get file key
\n
"
);
msiobj_release
(
&
row
->
hdr
);
return
ERROR_FUNCTION_FAILED
;
break
;
}
}
rc
=
get_file_target
(
package
,
file_key
,
&
file_source
);
rc
=
get_file_target
(
package
,
file_key
,
&
file_source
);
...
@@ -635,9 +603,8 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
...
@@ -635,9 +603,8 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
!=
ERROR_SUCCESS
)
{
{
ERR
(
"Original file unknown %s
\n
"
,
debugstr_w
(
file_key
));
ERR
(
"Original file unknown %s
\n
"
,
debugstr_w
(
file_key
));
msiobj_release
(
&
row
->
hdr
);
HeapFree
(
GetProcessHeap
(),
0
,
file_source
);
HeapFree
(
GetProcessHeap
(),
0
,
file_source
);
continue
;
return
ERROR_SUCCESS
;
}
}
if
(
MSI_RecordIsNull
(
row
,
4
))
if
(
MSI_RecordIsNull
(
row
,
4
))
...
@@ -667,9 +634,8 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
...
@@ -667,9 +634,8 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
if
(
!
dest_path
)
if
(
!
dest_path
)
{
{
ERR
(
"Unable to get destination folder
\n
"
);
ERR
(
"Unable to get destination folder
\n
"
);
msiobj_release
(
&
row
->
hdr
);
HeapFree
(
GetProcessHeap
(),
0
,
file_source
);
HeapFree
(
GetProcessHeap
(),
0
,
file_source
);
break
;
return
ERROR_FUNCTION_FAILED
;
}
}
}
}
...
@@ -688,12 +654,30 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
...
@@ -688,12 +654,30 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
FIXME
(
"We should track these duplicate files as well
\n
"
);
FIXME
(
"We should track these duplicate files as well
\n
"
);
msiobj_release
(
&
row
->
hdr
);
HeapFree
(
GetProcessHeap
(),
0
,
dest_path
);
HeapFree
(
GetProcessHeap
(),
0
,
dest_path
);
HeapFree
(
GetProcessHeap
(),
0
,
dest
);
HeapFree
(
GetProcessHeap
(),
0
,
dest
);
HeapFree
(
GetProcessHeap
(),
0
,
file_source
);
HeapFree
(
GetProcessHeap
(),
0
,
file_source
);
}
MSI_ViewClose
(
view
);
return
ERROR_SUCCESS
;
}
UINT
ACTION_DuplicateFiles
(
MSIPACKAGE
*
package
)
{
UINT
rc
;
MSIQUERY
*
view
;
static
const
WCHAR
ExecSeqQuery
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'D'
,
'u'
,
'p'
,
'l'
,
'i'
,
'c'
,
'a'
,
't'
,
'e'
,
'F'
,
'i'
,
'l'
,
'e'
,
'`'
,
0
};
if
(
!
package
)
return
ERROR_INVALID_HANDLE
;
rc
=
MSI_DatabaseOpenViewW
(
package
->
db
,
ExecSeqQuery
,
&
view
);
if
(
rc
!=
ERROR_SUCCESS
)
return
ERROR_SUCCESS
;
rc
=
MSI_IterateRecords
(
view
,
NULL
,
ITERATE_DuplicateFiles
,
package
);
msiobj_release
(
&
view
->
hdr
);
msiobj_release
(
&
view
->
hdr
);
return
rc
;
return
rc
;
}
}
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