Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
085e95cd
Commit
085e95cd
authored
Sep 19, 2023
by
Jactry Zeng
Committed by
Alexandre Julliard
Sep 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Use CreateFileW() for handling path from cabinet_open() instead.
parent
9ef92747
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
4 deletions
+34
-4
media.c
dlls/msi/media.c
+8
-4
msipriv.h
dlls/msi/msipriv.h
+26
-0
No files found.
dlls/msi/media.c
View file @
085e95cd
...
...
@@ -109,6 +109,8 @@ static INT_PTR CDECL cabinet_open(char *pszFile, int oflag, int pmode)
DWORD
dwAccess
=
0
;
DWORD
dwShareMode
=
0
;
DWORD
dwCreateDisposition
=
OPEN_EXISTING
;
HANDLE
handle
;
WCHAR
*
path
;
switch
(
oflag
&
_O_ACCMODE
)
{
...
...
@@ -131,8 +133,10 @@ static INT_PTR CDECL cabinet_open(char *pszFile, int oflag, int pmode)
else
if
(
oflag
&
_O_CREAT
)
dwCreateDisposition
=
CREATE_ALWAYS
;
return
(
INT_PTR
)
CreateFileA
(
pszFile
,
dwAccess
,
dwShareMode
,
NULL
,
dwCreateDisposition
,
0
,
NULL
);
path
=
strdupUtoW
(
pszFile
);
handle
=
CreateFileW
(
path
,
dwAccess
,
dwShareMode
,
NULL
,
dwCreateDisposition
,
0
,
NULL
);
free
(
path
);
return
(
INT_PTR
)
handle
;
}
static
UINT
CDECL
cabinet_read
(
INT_PTR
hf
,
void
*
pv
,
UINT
cb
)
...
...
@@ -577,11 +581,11 @@ static BOOL extract_cabinet( MSIPACKAGE* package, MSIMEDIAINFO *mi, LPVOID data
return
FALSE
;
}
cabinet
=
strdupWto
A
(
mi
->
cabinet
);
cabinet
=
strdupWto
U
(
mi
->
cabinet
);
if
(
!
cabinet
)
goto
done
;
cab_path
=
strdupWto
A
(
mi
->
sourcedir
);
cab_path
=
strdupWto
U
(
mi
->
sourcedir
);
if
(
!
cab_path
)
goto
done
;
...
...
dlls/msi/msipriv.h
View file @
085e95cd
...
...
@@ -1168,4 +1168,30 @@ static inline LPWSTR strdupAtoW( LPCSTR str )
return
ret
;
}
static
inline
char
*
strdupWtoU
(
LPCWSTR
str
)
{
LPSTR
ret
=
NULL
;
DWORD
len
;
if
(
!
str
)
return
ret
;
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
ret
=
malloc
(
len
);
if
(
ret
)
WideCharToMultiByte
(
CP_UTF8
,
0
,
str
,
-
1
,
ret
,
len
,
NULL
,
NULL
);
return
ret
;
}
static
inline
LPWSTR
strdupUtoW
(
LPCSTR
str
)
{
LPWSTR
ret
=
NULL
;
DWORD
len
;
if
(
!
str
)
return
ret
;
len
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
str
,
-
1
,
NULL
,
0
);
ret
=
malloc
(
len
*
sizeof
(
WCHAR
)
);
if
(
ret
)
MultiByteToWideChar
(
CP_UTF8
,
0
,
str
,
-
1
,
ret
,
len
);
return
ret
;
}
#endif
/* __WINE_MSI_PRIVATE__ */
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