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
85b3f37d
Commit
85b3f37d
authored
Nov 04, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Nov 04, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use advapi32.CommandLineFromMsiDescriptor to get msi component paths.
parent
febe90b2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
37 deletions
+13
-37
shelllink.c
dlls/shell32/shelllink.c
+13
-37
No files found.
dlls/shell32/shelllink.c
View file @
85b3f37d
...
@@ -52,6 +52,7 @@
...
@@ -52,6 +52,7 @@
#include "shlguid.h"
#include "shlguid.h"
#include "shlwapi.h"
#include "shlwapi.h"
#include "msi.h"
#include "msi.h"
#include "appmgmt.h"
#include "initguid.h"
#include "initguid.h"
...
@@ -2413,50 +2414,25 @@ ShellLink_QueryContextMenu( IContextMenu* iface, HMENU hmenu, UINT indexMenu,
...
@@ -2413,50 +2414,25 @@ ShellLink_QueryContextMenu( IContextMenu* iface, HMENU hmenu, UINT indexMenu,
return
MAKE_HRESULT
(
SEVERITY_SUCCESS
,
0
,
id
);
return
MAKE_HRESULT
(
SEVERITY_SUCCESS
,
0
,
id
);
}
}
static
LPWSTR
shelllink_get_msi_component_path
(
LPCWSTR
component
)
static
LPWSTR
shelllink_get_msi_component_path
(
LPWSTR
component
)
{
{
UINT
(
WINAPI
*
pMsiDecomposeDescriptorW
)(
LPCWSTR
,
LPWSTR
,
LPWSTR
,
LPWSTR
,
DWORD
*
);
INSTALLSTATE
(
WINAPI
*
pMsiGetComponentPathW
)(
LPCWSTR
,
LPCWSTR
,
LPWSTR
,
DWORD
*
);
WCHAR
szProd
[
MAX_FEATURE_CHARS
+
1
],
szFeat
[
MAX_FEATURE_CHARS
+
1
],
szComp
[
MAX_FEATURE_CHARS
+
1
],
szCompPath
[
MAX_PATH
];
INSTALLSTATE
state
;
LPWSTR
path
=
NULL
;
LPWSTR
path
=
NULL
;
HMODULE
hmsi
=
NULL
;
DWORD
r
,
sz
=
0
;
DWORD
sz
=
0
;
UINT
ret
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
component
)
);
r
=
CommandLineFromMsiDescriptor
(
component
,
NULL
,
&
sz
);
if
(
r
!=
ERROR_SUCCESS
)
hmsi
=
LoadLibraryA
(
"msi"
);
return
path
;
if
(
!
hmsi
)
goto
end
;
pMsiDecomposeDescriptorW
=
(
LPVOID
)
GetProcAddress
(
hmsi
,
"MsiDecomposeDescriptorW"
);
pMsiGetComponentPathW
=
(
LPVOID
)
GetProcAddress
(
hmsi
,
"MsiGetComponentPathW"
);
if
(
!
pMsiDecomposeDescriptorW
||
!
pMsiGetComponentPathW
)
goto
end
;
ret
=
pMsiDecomposeDescriptorW
(
component
,
szProd
,
szFeat
,
szComp
,
&
sz
);
if
(
ret
!=
ERROR_SUCCESS
)
{
ERR
(
"failed to decompose descriptor %s
\n
"
,
debugstr_w
(
component
)
);
goto
end
;
}
sz
=
MAX_PATH
;
sz
++
;
state
=
pMsiGetComponentPathW
(
szProd
,
szComp
,
szCompPath
,
&
sz
);
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
*
sizeof
(
WCHAR
)
);
if
(
state
!=
INSTALLSTATE_LOCAL
)
r
=
CommandLineFromMsiDescriptor
(
component
,
path
,
&
sz
);
if
(
r
!=
ERROR_SUCCESS
)
{
{
ERR
(
"MsiGetComponentPathW failed with error %d
\n
"
,
ret
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
goto
end
;
path
=
NULL
;
}
}
path
=
strdupW
(
szCompPath
);
end:
if
(
hmsi
)
FreeLibrary
(
hmsi
);
TRACE
(
"returning %s
\n
"
,
debugstr_w
(
path
)
);
TRACE
(
"returning %s
\n
"
,
debugstr_w
(
path
)
);
return
path
;
return
path
;
...
...
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