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
68680e9c
Commit
68680e9c
authored
Sep 06, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 06, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for MsiGetSourcePath parameter handling.
parent
d3d5ad6b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
66 deletions
+88
-66
install.c
dlls/msi/install.c
+73
-50
msipriv.h
dlls/msi/msipriv.h
+15
-0
suminfo.c
dlls/msi/suminfo.c
+0
-16
No files found.
dlls/msi/install.c
View file @
68680e9c
...
...
@@ -150,76 +150,99 @@ UINT WINAPI MsiGetTargetPathW( MSIHANDLE hInstall, LPCWSTR szFolder, LPWSTR
return
rc
;
}
/***********************************************************************
* MsiGetSourcePathA (MSI.@
)
*/
UINT
WINAPI
MsiGetSourcePathA
(
MSIHANDLE
hInstall
,
LPCSTR
szFolder
,
LPSTR
szPathBuf
,
DWORD
*
pcchPathBuf
)
* MsiGetSourcePath (internal
)
*/
static
UINT
MSI_GetSourcePath
(
MSIHANDLE
hInstall
,
LPCWSTR
szFolder
,
awstring
*
szPathBuf
,
DWORD
*
pcchPathBuf
)
{
LPWSTR
szwFolder
;
LPWSTR
szwPathBuf
;
UINT
rc
;
LPWSTR
path
;
UINT
r
,
len
;
MSIPACKAGE
*
package
;
TRACE
(
"
getting source %s %p %li
\n
"
,
szFolder
,
szPathBuf
,
*
pcchPathBuf
);
TRACE
(
"
%s %p %p
\n
"
,
debugstr_w
(
szFolder
),
szPathBuf
,
pcchPathBuf
);
if
(
!
szFolder
)
return
ERROR_FUNCTION_FAILED
;
if
(
hInstall
==
0
)
return
ERROR_FUNCTION_FAILED
;
return
ERROR_INVALID_PARAMETER
;
szwFolder
=
strdupAtoW
(
szFolder
);
if
(
!
szwFolder
)
return
ERROR_
FUNCTION_FAILED
;
package
=
msihandle2msiinfo
(
hInstall
,
MSIHANDLETYPE_PACKAGE
);
if
(
!
package
)
return
ERROR_
INVALID_HANDLE
;
szwPathBuf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
*
pcchPathBuf
*
sizeof
(
WCHAR
));
if
(
szPathBuf
->
str
.
w
&&
!
pcchPathBuf
)
{
msiobj_release
(
&
package
->
hdr
);
return
ERROR_INVALID_PARAMETER
;
}
rc
=
MsiGetSourcePathW
(
hInstall
,
szwFolder
,
szwPathBuf
,
pcchPathBuf
);
path
=
resolve_folder
(
package
,
szFolder
,
TRUE
,
FALSE
,
NULL
);
msiobj_release
(
&
package
->
hdr
);
WideCharToMultiByte
(
CP_ACP
,
0
,
szwPathBuf
,
*
pcchPathBuf
,
szPathBuf
,
*
pcchPathBuf
,
NULL
,
NULL
);
TRACE
(
"path = %s
\n
"
,
debugstr_w
(
path
));
if
(
!
path
)
return
ERROR_DIRECTORY
;
HeapFree
(
GetProcessHeap
(),
0
,
szwFolder
);
HeapFree
(
GetProcessHeap
(),
0
,
szwPathBuf
);
r
=
ERROR_SUCCESS
;
if
(
pcchPathBuf
)
{
if
(
szPathBuf
->
unicode
)
{
len
=
lstrlenW
(
path
);
if
(
szPathBuf
->
str
.
w
)
lstrcpynW
(
szPathBuf
->
str
.
w
,
path
,
*
pcchPathBuf
);
}
else
{
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
path
,
-
1
,
szPathBuf
->
str
.
a
,
*
pcchPathBuf
,
NULL
,
NULL
);
len
--
;
}
return
rc
;
if
(
len
>=
*
pcchPathBuf
)
r
=
ERROR_MORE_DATA
;
*
pcchPathBuf
=
len
;
}
HeapFree
(
GetProcessHeap
(),
0
,
path
);
return
r
;
}
/***********************************************************************
* MsiGetSourcePathW
(MSI.@)
*/
UINT
WINAPI
MsiGetSourcePath
W
(
MSIHANDLE
hInstall
,
LPCWSTR
szFolder
,
LPWSTR
szPathBuf
,
DWORD
*
pcchPathBuf
)
* MsiGetSourcePathA
(MSI.@)
*/
UINT
WINAPI
MsiGetSourcePath
A
(
MSIHANDLE
hInstall
,
LPCSTR
szFolder
,
LPSTR
szPathBuf
,
DWORD
*
pcchPathBuf
)
{
LPWSTR
path
;
UINT
rc
=
ERROR_FUNCTION_FAILED
;
MSIPACKAGE
*
package
;
LPWSTR
folder
;
awstring
str
;
UINT
r
;
TRACE
(
"
(%s %p %li)
\n
"
,
debugstr_w
(
szFolder
),
szPathBuf
,
*
pcchPathBuf
);
TRACE
(
"
%s %p %p
\n
"
,
szFolder
,
debugstr_a
(
szPathBuf
),
pcchPathBuf
);
package
=
msihandle2msiinfo
(
hInstall
,
MSIHANDLETYPE_PACKAGE
);
if
(
!
package
)
return
ERROR_INVALID_HANDLE
;
path
=
resolve_folder
(
package
,
szFolder
,
TRUE
,
FALSE
,
NULL
);
msiobj_release
(
&
package
->
hdr
);
str
.
unicode
=
FALSE
;
str
.
str
.
a
=
szPathBuf
;
if
(
path
&&
strlenW
(
path
)
>
*
pcchPathBuf
)
{
*
pcchPathBuf
=
strlenW
(
path
)
+
1
;
rc
=
ERROR_MORE_DATA
;
}
else
if
(
path
)
{
*
pcchPathBuf
=
strlenW
(
path
)
+
1
;
strcpyW
(
szPathBuf
,
path
);
TRACE
(
"Returning Path %s
\n
"
,
debugstr_w
(
path
));
rc
=
ERROR_SUCCESS
;
}
HeapFree
(
GetProcessHeap
(),
0
,
path
);
return
rc
;
folder
=
strdupAtoW
(
szFolder
);
r
=
MSI_GetSourcePath
(
hInstall
,
folder
,
&
str
,
pcchPathBuf
);
HeapFree
(
GetProcessHeap
(),
0
,
folder
);
return
r
;
}
/***********************************************************************
* MsiGetSourcePathW (MSI.@)
*/
UINT
WINAPI
MsiGetSourcePathW
(
MSIHANDLE
hInstall
,
LPCWSTR
szFolder
,
LPWSTR
szPathBuf
,
DWORD
*
pcchPathBuf
)
{
awstring
str
;
TRACE
(
"%s %p %p
\n
"
,
debugstr_w
(
szFolder
),
szPathBuf
,
pcchPathBuf
);
str
.
unicode
=
TRUE
;
str
.
str
.
w
=
szPathBuf
;
return
MSI_GetSourcePath
(
hInstall
,
szFolder
,
&
str
,
pcchPathBuf
);
}
/***********************************************************************
* MsiSetTargetPathA (MSI.@)
...
...
dlls/msi/msipriv.h
View file @
68680e9c
...
...
@@ -247,6 +247,21 @@ DEFINE_GUID(CLSID_IMsiServerX3, 0x000C1094,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x0
DEFINE_GUID
(
CLSID_IMsiServerMessage
,
0x000C101D
,
0x0000
,
0x0000
,
0xC0
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x46
);
typedef
struct
{
BOOL
unicode
;
union
{
LPSTR
a
;
LPWSTR
w
;
}
str
;
}
awstring
;
typedef
struct
{
BOOL
unicode
;
union
{
LPCSTR
a
;
LPCWSTR
w
;
}
str
;
}
awcstring
;
/* handle functions */
extern
void
*
msihandle2msiinfo
(
MSIHANDLE
handle
,
UINT
type
);
...
...
dlls/msi/suminfo.c
View file @
68680e9c
...
...
@@ -81,22 +81,6 @@ typedef struct {
#define SECT_HDR_SIZE (sizeof(PROPERTYSECTIONHEADER))
typedef
struct
{
BOOL
unicode
;
union
{
LPSTR
a
;
LPWSTR
w
;
}
str
;
}
awstring
;
typedef
struct
{
BOOL
unicode
;
union
{
LPCSTR
a
;
LPCWSTR
w
;
}
str
;
}
awcstring
;
typedef
struct
tagMSISUMMARYINFO
{
MSIOBJECTHDR
hdr
;
...
...
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