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
234dc4b2
Commit
234dc4b2
authored
Jun 22, 2005
by
Aric Stewart
Committed by
Alexandre Julliard
Jun 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework RegisterTypeLibraries to use MSI_IterateRecords.
parent
dcad0864
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
105 deletions
+84
-105
action.c
dlls/msi/action.c
+84
-105
No files found.
dlls/msi/action.c
View file @
234dc4b2
...
...
@@ -2704,134 +2704,113 @@ static BOOL CALLBACK Typelib_EnumResNameProc( HMODULE hModule, LPCWSTR lpszType,
return
TRUE
;
}
static
UINT
ACTION_RegisterTypeLibraries
(
MSIPACKAGE
*
package
)
static
UINT
ITERATE_RegisterTypeLibraries
(
MSIRECORD
*
row
,
LPVOID
param
)
{
/*
* OK this is a bit confusing.. I am given a _Component key and I believe
* that the file that is being registered as a type library is the "key file
* of that component" which I interpret to mean "The file in the KeyPath of
* that component".
*/
UINT
rc
;
MSIQUERY
*
view
;
MSIRECORD
*
row
=
0
;
static
const
WCHAR
Query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'T'
,
'y'
,
'p'
,
'e'
,
'L'
,
'i'
,
'b'
,
'`'
,
0
};
if
(
!
package
)
return
ERROR_INVALID_HANDLE
;
MSIPACKAGE
*
package
=
(
MSIPACKAGE
*
)
param
;
LPCWSTR
component
;
INT
index
;
typelib_struct
tl_struct
;
HMODULE
module
;
static
const
WCHAR
szTYPELIB
[]
=
{
'T'
,
'Y'
,
'P'
,
'E'
,
'L'
,
'I'
,
'B'
,
0
};
rc
=
MSI_DatabaseOpenViewW
(
package
->
db
,
Query
,
&
view
);
if
(
rc
!=
ERROR_SUCCESS
)
component
=
MSI_RecordGetString
(
row
,
3
);
index
=
get_loaded_component
(
package
,
component
);
if
(
index
<
0
)
return
ERROR_SUCCESS
;
rc
=
MSI_ViewExecute
(
view
,
0
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
!
ACTION_VerifyComponentForAction
(
package
,
index
,
INSTALLSTATE_LOCAL
))
{
MSI_ViewClose
(
view
);
msiobj_release
(
&
view
->
hdr
);
return
rc
;
}
TRACE
(
"Skipping typelib reg due to disabled component
\n
"
);
while
(
1
)
{
LPCWSTR
component
;
INT
index
;
typelib_struct
tl_struct
;
HMODULE
module
;
static
const
WCHAR
szTYPELIB
[]
=
{
'T'
,
'Y'
,
'P'
,
'E'
,
'L'
,
'I'
,
'B'
,
0
};
package
->
components
[
index
].
Action
=
package
->
components
[
index
].
Installed
;
rc
=
MSI_ViewFetch
(
view
,
&
row
);
if
(
rc
!=
ERROR_SUCCESS
)
{
rc
=
ERROR_SUCCESS
;
break
;
}
return
ERROR_SUCCESS
;
}
component
=
MSI_RecordGetString
(
row
,
3
);
index
=
get_loaded_component
(
package
,
component
);
if
(
index
<
0
)
{
msiobj_release
(
&
row
->
hdr
);
continue
;
}
package
->
components
[
index
].
Action
=
INSTALLSTATE_LOCAL
;
if
(
!
ACTION_VerifyComponentForAction
(
package
,
index
,
INSTALLSTATE_LOCAL
))
{
TRACE
(
"Skipping typelib reg due to disabled component
\n
"
);
msiobj_release
(
&
row
->
hdr
);
index
=
get_loaded_file
(
package
,
package
->
components
[
index
].
KeyPath
);
package
->
components
[
index
].
Action
=
package
->
components
[
index
].
Installed
;
if
(
index
<
0
)
return
ERROR_SUCCESS
;
continue
;
}
module
=
LoadLibraryExW
(
package
->
files
[
index
].
TargetPath
,
NULL
,
LOAD_LIBRARY_AS_DATAFILE
);
if
(
module
!=
NULL
)
{
LPWSTR
guid
;
guid
=
load_dynamic_stringW
(
row
,
1
);
CLSIDFromString
(
guid
,
&
tl_struct
.
clsid
);
HeapFree
(
GetProcessHeap
(),
0
,
guid
);
tl_struct
.
source
=
strdupW
(
package
->
files
[
index
].
TargetPath
);
tl_struct
.
path
=
NULL
;
package
->
components
[
index
].
Action
=
INSTALLSTATE_LOCAL
;
EnumResourceNamesW
(
module
,
szTYPELIB
,
Typelib_EnumResNameProc
,
(
LONG_PTR
)
&
tl_struct
);
index
=
get_loaded_file
(
package
,
package
->
components
[
index
].
KeyPath
);
if
(
index
<
0
)
if
(
tl_struct
.
path
!=
NULL
)
{
msiobj_release
(
&
row
->
hdr
)
;
continue
;
}
LPWSTR
help
=
NULL
;
LPCWSTR
helpid
;
HRESULT
res
;
module
=
LoadLibraryExW
(
package
->
files
[
index
].
TargetPath
,
NULL
,
LOAD_LIBRARY_AS_DATAFILE
);
if
(
module
!=
NULL
)
{
LPWSTR
guid
;
guid
=
load_dynamic_stringW
(
row
,
1
);
CLSIDFromString
(
guid
,
&
tl_struct
.
clsid
);
HeapFree
(
GetProcessHeap
(),
0
,
guid
);
tl_struct
.
source
=
strdupW
(
package
->
files
[
index
].
TargetPath
);
tl_struct
.
path
=
NULL
;
helpid
=
MSI_RecordGetString
(
row
,
6
);
EnumResourceNamesW
(
module
,
szTYPELIB
,
Typelib_EnumResNameProc
,
(
LONG_PTR
)
&
tl_struct
);
if
(
helpid
)
help
=
resolve_folder
(
package
,
helpid
,
FALSE
,
FALSE
,
NULL
);
res
=
RegisterTypeLib
(
tl_struct
.
ptLib
,
tl_struct
.
path
,
help
);
HeapFree
(
GetProcessHeap
(),
0
,
help
);
if
(
tl_struct
.
path
!=
NULL
)
if
(
!
SUCCEEDED
(
res
))
ERR
(
"Failed to register type library %s
\n
"
,
debugstr_w
(
tl_struct
.
path
));
else
{
LPWSTR
help
=
NULL
;
LPCWSTR
helpid
;
HRESULT
res
;
ui_actiondata
(
package
,
szRegisterTypeLibraries
,
row
);
helpid
=
MSI_RecordGetString
(
row
,
6
);
if
(
helpid
)
help
=
resolve_folder
(
package
,
helpid
,
FALSE
,
FALSE
,
NULL
);
res
=
RegisterTypeLib
(
tl_struct
.
ptLib
,
tl_struct
.
path
,
help
);
HeapFree
(
GetProcessHeap
(),
0
,
help
);
if
(
!
SUCCEEDED
(
res
))
ERR
(
"Failed to register type library %s
\n
"
,
debugstr_w
(
tl_struct
.
path
));
else
{
ui_actiondata
(
package
,
szRegisterTypeLibraries
,
row
);
TRACE
(
"Registered %s
\n
"
,
debugstr_w
(
tl_struct
.
path
));
}
ITypeLib_Release
(
tl_struct
.
ptLib
);
HeapFree
(
GetProcessHeap
(),
0
,
tl_struct
.
path
);
TRACE
(
"Registered %s
\n
"
,
debugstr_w
(
tl_struct
.
path
));
}
else
ERR
(
"Failed to load type library %s
\n
"
,
debugstr_w
(
tl_struct
.
source
));
FreeLibrary
(
module
);
HeapFree
(
GetProcessHeap
(),
0
,
tl_struct
.
source
);
ITypeLib_Release
(
tl_struct
.
ptLib
);
HeapFree
(
GetProcessHeap
(),
0
,
tl_struct
.
path
);
}
else
ERR
(
"Could not load file! %s
\n
"
,
debugstr_w
(
package
->
files
[
index
].
TargetPath
));
msiobj_release
(
&
row
->
hdr
);
ERR
(
"Failed to load type library %s
\n
"
,
debugstr_w
(
tl_struct
.
source
));
FreeLibrary
(
module
);
HeapFree
(
GetProcessHeap
(),
0
,
tl_struct
.
source
);
}
MSI_ViewClose
(
view
);
else
ERR
(
"Could not load file! %s
\n
"
,
debugstr_w
(
package
->
files
[
index
].
TargetPath
));
return
ERROR_SUCCESS
;
}
static
UINT
ACTION_RegisterTypeLibraries
(
MSIPACKAGE
*
package
)
{
/*
* OK this is a bit confusing.. I am given a _Component key and I believe
* that the file that is being registered as a type library is the "key file
* of that component" which I interpret to mean "The file in the KeyPath of
* that component".
*/
UINT
rc
;
MSIQUERY
*
view
;
static
const
WCHAR
Query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'T'
,
'y'
,
'p'
,
'e'
,
'L'
,
'i'
,
'b'
,
'`'
,
0
};
if
(
!
package
)
return
ERROR_INVALID_HANDLE
;
rc
=
MSI_DatabaseOpenViewW
(
package
->
db
,
Query
,
&
view
);
if
(
rc
!=
ERROR_SUCCESS
)
return
ERROR_SUCCESS
;
rc
=
MSI_IterateRecords
(
view
,
NULL
,
ITERATE_RegisterTypeLibraries
,
package
);
msiobj_release
(
&
view
->
hdr
);
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