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
0a66cfa9
Commit
0a66cfa9
authored
Oct 20, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Oct 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Don't use strdupW or heap_* functions in shelllink.c.
parent
e3a74a91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
77 deletions
+77
-77
shelllink.c
dlls/shell32/shelllink.c
+77
-77
No files found.
dlls/shell32/shelllink.c
View file @
0a66cfa9
...
...
@@ -208,7 +208,7 @@ static HRESULT ShellLink_UpdatePath(LPCWSTR sPathRel, LPCWSTR path, LPCWSTR sWor
static
inline
LPWSTR
heap_strdupAtoW
(
LPCSTR
str
)
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
LPWSTR
p
=
heap_alloc
(
len
*
sizeof
(
WCHAR
)
);
WCHAR
*
p
=
malloc
(
len
*
sizeof
(
WCHAR
)
);
if
(
!
p
)
return
p
;
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
p
,
len
);
...
...
@@ -286,8 +286,8 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFile
IStream_Release
(
stm
);
/* update file path */
heap_
free
(
This
->
filepath
);
This
->
filepath
=
strdupW
(
pszFileName
);
free
(
This
->
filepath
);
This
->
filepath
=
wcsdup
(
pszFileName
);
This
->
bDirty
=
FALSE
;
}
...
...
@@ -309,7 +309,7 @@ BOOL run_winemenubuilder( const WCHAR *args )
lstrcatW
(
app
,
L"
\\
winemenubuilder.exe"
);
len
=
(
lstrlenW
(
app
)
+
lstrlenW
(
args
)
+
1
)
*
sizeof
(
WCHAR
);
buffer
=
heap_
alloc
(
len
);
buffer
=
m
alloc
(
len
);
if
(
!
buffer
)
return
FALSE
;
...
...
@@ -325,7 +325,7 @@ BOOL run_winemenubuilder( const WCHAR *args )
ret
=
CreateProcessW
(
app
,
buffer
,
NULL
,
NULL
,
FALSE
,
DETACHED_PROCESS
,
NULL
,
NULL
,
&
si
,
&
pi
);
Wow64RevertWow64FsRedirection
(
redir
);
heap_
free
(
buffer
);
free
(
buffer
);
if
(
ret
)
{
...
...
@@ -343,13 +343,13 @@ static BOOL StartLinkProcessor( LPCOLESTR szLink )
BOOL
ret
;
len
=
(
lstrlenW
(
szLink
)
+
7
)
*
sizeof
(
WCHAR
);
buffer
=
heap_
alloc
(
len
);
buffer
=
m
alloc
(
len
);
if
(
!
buffer
)
return
FALSE
;
swprintf
(
buffer
,
len
,
L" -w
\"
%s
\"
"
,
szLink
);
ret
=
run_winemenubuilder
(
buffer
);
heap_
free
(
buffer
);
free
(
buffer
);
return
ret
;
}
...
...
@@ -383,8 +383,8 @@ static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFile
if
(
fRemember
)
{
/* update file path */
heap_
free
(
This
->
filepath
);
This
->
filepath
=
strdupW
(
pszFileName
);
free
(
This
->
filepath
);
This
->
filepath
=
wcsdup
(
pszFileName
);
}
This
->
bDirty
=
FALSE
;
...
...
@@ -516,14 +516,14 @@ static HRESULT Stream_LoadString( IStream* stm, BOOL unicode, LPWSTR *pstr )
len
*=
sizeof
(
WCHAR
);
TRACE
(
"reading %d
\n
"
,
len
);
temp
=
heap_
alloc
(
len
+
sizeof
(
WCHAR
));
temp
=
m
alloc
(
len
+
sizeof
(
WCHAR
));
if
(
!
temp
)
return
E_OUTOFMEMORY
;
count
=
0
;
r
=
IStream_Read
(
stm
,
temp
,
len
,
&
count
);
if
(
FAILED
(
r
)
||
(
count
!=
len
)
)
{
heap_
free
(
temp
);
free
(
temp
);
return
E_FAIL
;
}
...
...
@@ -533,14 +533,14 @@ static HRESULT Stream_LoadString( IStream* stm, BOOL unicode, LPWSTR *pstr )
if
(
!
unicode
)
{
count
=
MultiByteToWideChar
(
CP_ACP
,
0
,
temp
,
len
,
NULL
,
0
);
str
=
heap_alloc
(
(
count
+
1
)
*
sizeof
(
WCHAR
)
);
str
=
malloc
(
(
count
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
str
)
{
heap_
free
(
temp
);
free
(
temp
);
return
E_OUTOFMEMORY
;
}
MultiByteToWideChar
(
CP_ACP
,
0
,
temp
,
len
,
str
,
count
);
heap_
free
(
temp
);
free
(
temp
);
}
else
{
...
...
@@ -570,7 +570,7 @@ static HRESULT Stream_ReadChunk( IStream* stm, LPVOID *data )
if
(
FAILED
(
r
)
||
count
!=
sizeof
(
size
)
)
return
E_FAIL
;
chunk
=
heap_
alloc
(
size
);
chunk
=
m
alloc
(
size
);
if
(
!
chunk
)
return
E_OUTOFMEMORY
;
...
...
@@ -578,7 +578,7 @@ static HRESULT Stream_ReadChunk( IStream* stm, LPVOID *data )
r
=
IStream_Read
(
stm
,
chunk
->
data
,
size
-
sizeof
(
size
),
&
count
);
if
(
FAILED
(
r
)
||
count
!=
(
size
-
sizeof
(
size
))
)
{
heap_
free
(
chunk
);
free
(
chunk
);
return
E_FAIL
;
}
...
...
@@ -620,7 +620,7 @@ static LPWSTR Stream_LoadPath( LPCSTR p, DWORD maxlen )
len
++
;
wlen
=
MultiByteToWideChar
(
CP_ACP
,
0
,
p
,
len
,
NULL
,
0
);
path
=
heap_
alloc
((
wlen
+
1
)
*
sizeof
(
WCHAR
));
path
=
m
alloc
((
wlen
+
1
)
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
p
,
len
,
path
,
wlen
);
path
[
wlen
]
=
0
;
...
...
@@ -642,7 +642,7 @@ static HRESULT Stream_LoadLocation( IStream *stm,
loc
=
(
LOCATION_INFO
*
)
p
;
if
(
loc
->
dwTotalSize
<
sizeof
(
LOCATION_INFO
))
{
heap_
free
(
p
);
free
(
p
);
return
E_FAIL
;
}
...
...
@@ -664,7 +664,7 @@ static HRESULT Stream_LoadLocation( IStream *stm,
TRACE
(
"type %ld serial %08lx name %s path %s
\n
"
,
volume
->
type
,
volume
->
serial
,
debugstr_w
(
volume
->
label
),
debugstr_w
(
*
path
));
heap_
free
(
p
);
free
(
p
);
return
S_OK
;
}
...
...
@@ -718,7 +718,7 @@ static HRESULT Stream_LoadAdvertiseInfo( IStream* stm, LPWSTR *str )
return
E_FAIL
;
}
*
str
=
heap_alloc
(
(
lstrlenW
(
buffer
.
szwDarwinID
)
+
1
)
*
sizeof
(
WCHAR
)
);
*
str
=
malloc
(
(
lstrlenW
(
buffer
.
szwDarwinID
)
+
1
)
*
sizeof
(
WCHAR
)
);
lstrcpyW
(
*
str
,
buffer
.
szwDarwinID
);
return
S_OK
;
...
...
@@ -760,21 +760,21 @@ static HRESULT WINAPI IPersistStream_fnLoad(
ILFree
(
This
->
pPidl
);
This
->
pPidl
=
NULL
;
memset
(
&
This
->
volume
,
0
,
sizeof
This
->
volume
);
heap_
free
(
This
->
sPath
);
free
(
This
->
sPath
);
This
->
sPath
=
NULL
;
heap_
free
(
This
->
sDescription
);
free
(
This
->
sDescription
);
This
->
sDescription
=
NULL
;
heap_
free
(
This
->
sPathRel
);
free
(
This
->
sPathRel
);
This
->
sPathRel
=
NULL
;
heap_
free
(
This
->
sWorkDir
);
free
(
This
->
sWorkDir
);
This
->
sWorkDir
=
NULL
;
heap_
free
(
This
->
sArgs
);
free
(
This
->
sArgs
);
This
->
sArgs
=
NULL
;
heap_
free
(
This
->
sIcoPath
);
free
(
This
->
sIcoPath
);
This
->
sIcoPath
=
NULL
;
heap_
free
(
This
->
sProduct
);
free
(
This
->
sProduct
);
This
->
sProduct
=
NULL
;
heap_
free
(
This
->
sComponent
);
free
(
This
->
sComponent
);
This
->
sComponent
=
NULL
;
This
->
wHotKey
=
hdr
.
wHotKey
;
...
...
@@ -941,7 +941,7 @@ static HRESULT Stream_WriteLocationInfo( IStream* stm, LPCWSTR path,
total_size
=
sizeof
*
loc
+
volume_info_size
+
path_size
+
final_path_size
;
/* create pointers to everything */
loc
=
heap_alloc_zero
(
total_size
);
loc
=
calloc
(
1
,
total_size
);
vol
=
(
LOCAL_VOLUME_INFO
*
)
&
loc
[
1
];
szLabel
=
(
LPSTR
)
&
vol
[
1
];
szPath
=
&
szLabel
[
label_size
];
...
...
@@ -970,7 +970,7 @@ static HRESULT Stream_WriteLocationInfo( IStream* stm, LPCWSTR path,
szFinalPath
[
0
]
=
0
;
hr
=
IStream_Write
(
stm
,
loc
,
total_size
,
&
count
);
heap_
free
(
loc
);
free
(
loc
);
return
hr
;
}
...
...
@@ -1174,7 +1174,7 @@ static HRESULT ShellLink_UpdatePath(LPCWSTR sPathRel, LPCWSTR path, LPCWSTR sWor
if
(
!*
abs_path
)
lstrcpyW
(
abs_path
,
sPathRel
);
*
psPath
=
heap_
alloc
((
lstrlenW
(
abs_path
)
+
1
)
*
sizeof
(
WCHAR
));
*
psPath
=
m
alloc
((
lstrlenW
(
abs_path
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
!*
psPath
)
return
E_OUTOFMEMORY
;
...
...
@@ -1351,7 +1351,7 @@ static HRESULT WINAPI IShellLinkA_fnSetDescription(IShellLinkA *iface, LPCSTR ps
descrW
=
NULL
;
hr
=
IShellLinkW_SetDescription
(
&
This
->
IShellLinkW_iface
,
descrW
);
heap_
free
(
descrW
);
free
(
descrW
);
return
hr
;
}
...
...
@@ -1384,7 +1384,7 @@ static HRESULT WINAPI IShellLinkA_fnSetWorkingDirectory(IShellLinkA *iface, LPCS
if
(
!
dirW
)
return
E_OUTOFMEMORY
;
hr
=
IShellLinkW_SetWorkingDirectory
(
&
This
->
IShellLinkW_iface
,
dirW
);
heap_
free
(
dirW
);
free
(
dirW
);
return
hr
;
}
...
...
@@ -1421,7 +1421,7 @@ static HRESULT WINAPI IShellLinkA_fnSetArguments(IShellLinkA *iface, LPCSTR pszA
argsW
=
NULL
;
hr
=
IShellLinkW_SetArguments
(
&
This
->
IShellLinkW_iface
,
argsW
);
heap_
free
(
argsW
);
free
(
argsW
);
return
hr
;
}
...
...
@@ -1483,7 +1483,7 @@ static HRESULT WINAPI IShellLinkA_fnSetIconLocation(IShellLinkA *iface, LPCSTR p
}
hr
=
IShellLinkW_SetIconLocation
(
&
This
->
IShellLinkW_iface
,
path
?
pathW
:
NULL
,
icon
);
heap_
free
(
pathW
);
free
(
pathW
);
return
hr
;
}
...
...
@@ -1501,7 +1501,7 @@ static HRESULT WINAPI IShellLinkA_fnSetRelativePath(IShellLinkA *iface, LPCSTR p
if
(
!
pathW
)
return
E_OUTOFMEMORY
;
hr
=
IShellLinkW_SetRelativePath
(
&
This
->
IShellLinkW_iface
,
pathW
,
dwReserved
);
heap_
free
(
pathW
);
free
(
pathW
);
return
hr
;
}
...
...
@@ -1530,7 +1530,7 @@ static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA *iface, LPCSTR pszFile)
return
E_OUTOFMEMORY
;
r
=
IShellLinkW_SetPath
(
&
This
->
IShellLinkW_iface
,
str
);
heap_
free
(
str
);
free
(
str
);
return
r
;
}
...
...
@@ -1652,15 +1652,15 @@ static ULONG WINAPI IShellLinkW_fnRelease(IShellLinkW * iface)
TRACE
(
"-- destroying IShellLink(%p)
\n
"
,
This
);
heap_
free
(
This
->
sIcoPath
);
heap_
free
(
This
->
sArgs
);
heap_
free
(
This
->
sWorkDir
);
heap_
free
(
This
->
sDescription
);
heap_
free
(
This
->
sPath
);
heap_
free
(
This
->
sPathRel
);
heap_
free
(
This
->
sProduct
);
heap_
free
(
This
->
sComponent
);
heap_
free
(
This
->
filepath
);
free
(
This
->
sIcoPath
);
free
(
This
->
sArgs
);
free
(
This
->
sWorkDir
);
free
(
This
->
sDescription
);
free
(
This
->
sPath
);
free
(
This
->
sPathRel
);
free
(
This
->
sProduct
);
free
(
This
->
sComponent
);
free
(
This
->
filepath
);
if
(
This
->
site
)
IUnknown_Release
(
This
->
site
);
...
...
@@ -1754,12 +1754,12 @@ static HRESULT WINAPI IShellLinkW_fnSetIDList(IShellLinkW * iface, LPCITEMIDLIST
if
(
!
This
->
pPidl
)
return
E_FAIL
;
heap_
free
(
This
->
sPath
);
free
(
This
->
sPath
);
This
->
sPath
=
NULL
;
if
(
SHGetPathFromIDListW
(
pidl
,
path
)
)
{
This
->
sPath
=
heap_
alloc
((
lstrlenW
(
path
)
+
1
)
*
sizeof
(
WCHAR
));
This
->
sPath
=
m
alloc
((
lstrlenW
(
path
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
This
->
sPath
)
return
E_OUTOFMEMORY
;
...
...
@@ -1790,10 +1790,10 @@ static HRESULT WINAPI IShellLinkW_fnSetDescription(IShellLinkW * iface, LPCWSTR
TRACE
(
"(%p)->(desc=%s)
\n
"
,
This
,
debugstr_w
(
pszName
));
heap_
free
(
This
->
sDescription
);
free
(
This
->
sDescription
);
if
(
pszName
)
{
This
->
sDescription
=
heap_alloc
((
lstrlenW
(
pszName
)
+
1
)
*
sizeof
(
WCHAR
)
);
This
->
sDescription
=
malloc
(
(
lstrlenW
(
pszName
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
This
->
sDescription
)
return
E_OUTOFMEMORY
;
...
...
@@ -1826,8 +1826,8 @@ static HRESULT WINAPI IShellLinkW_fnSetWorkingDirectory(IShellLinkW * iface, LPC
TRACE
(
"(%p)->(dir=%s)
\n
"
,
This
,
debugstr_w
(
pszDir
));
heap_
free
(
This
->
sWorkDir
);
This
->
sWorkDir
=
heap_alloc
((
lstrlenW
(
pszDir
)
+
1
)
*
sizeof
(
WCHAR
)
);
free
(
This
->
sWorkDir
);
This
->
sWorkDir
=
malloc
(
(
lstrlenW
(
pszDir
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
This
->
sWorkDir
)
return
E_OUTOFMEMORY
;
lstrcpyW
(
This
->
sWorkDir
,
pszDir
);
...
...
@@ -1856,10 +1856,10 @@ static HRESULT WINAPI IShellLinkW_fnSetArguments(IShellLinkW * iface, LPCWSTR ps
TRACE
(
"(%p)->(args=%s)
\n
"
,
This
,
debugstr_w
(
pszArgs
));
heap_
free
(
This
->
sArgs
);
free
(
This
->
sArgs
);
if
(
pszArgs
)
{
This
->
sArgs
=
heap_alloc
((
lstrlenW
(
pszArgs
)
+
1
)
*
sizeof
(
WCHAR
)
);
This
->
sArgs
=
malloc
(
(
lstrlenW
(
pszArgs
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
This
->
sArgs
)
return
E_OUTOFMEMORY
;
lstrcpyW
(
This
->
sArgs
,
pszArgs
);
...
...
@@ -1939,11 +1939,11 @@ static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, const W
TRACE
(
"(%p)->(path=%s icon=%u)
\n
"
,
This
,
debugstr_w
(
path
),
icon
);
heap_
free
(
This
->
sIcoPath
);
free
(
This
->
sIcoPath
);
if
(
path
)
{
size_t
len
=
(
lstrlenW
(
path
)
+
1
)
*
sizeof
(
WCHAR
);
This
->
sIcoPath
=
heap_
alloc
(
len
);
This
->
sIcoPath
=
m
alloc
(
len
);
if
(
!
This
->
sIcoPath
)
return
E_OUTOFMEMORY
;
memcpy
(
This
->
sIcoPath
,
path
,
len
);
...
...
@@ -1962,8 +1962,8 @@ static HRESULT WINAPI IShellLinkW_fnSetRelativePath(IShellLinkW * iface, LPCWSTR
TRACE
(
"(%p)->(path=%s %lx)
\n
"
,
This
,
debugstr_w
(
pszPathRel
),
dwReserved
);
heap_
free
(
This
->
sPathRel
);
This
->
sPathRel
=
heap_alloc
((
lstrlenW
(
pszPathRel
)
+
1
)
*
sizeof
(
WCHAR
)
);
free
(
This
->
sPathRel
);
This
->
sPathRel
=
malloc
(
(
lstrlenW
(
pszPathRel
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
This
->
sPathRel
)
return
E_OUTOFMEMORY
;
lstrcpyW
(
This
->
sPathRel
,
pszPathRel
);
...
...
@@ -1989,7 +1989,7 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR
bSuccess
=
SHGetPathFromIDListW
(
This
->
pPidl
,
buffer
);
if
(
bSuccess
&&
*
buffer
)
{
This
->
sPath
=
heap_alloc
((
lstrlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
));
This
->
sPath
=
malloc
((
lstrlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
This
->
sPath
)
return
E_OUTOFMEMORY
;
...
...
@@ -2001,7 +2001,7 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR
}
if
(
!
This
->
sIcoPath
&&
This
->
sPath
)
{
This
->
sIcoPath
=
heap_alloc
((
lstrlenW
(
This
->
sPath
)
+
1
)
*
sizeof
(
WCHAR
));
This
->
sIcoPath
=
malloc
((
lstrlenW
(
This
->
sPath
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
This
->
sIcoPath
)
return
E_OUTOFMEMORY
;
...
...
@@ -2027,7 +2027,7 @@ static LPWSTR ShellLink_GetAdvertisedArg(LPCWSTR str)
if
(
!
p
)
return
NULL
;
len
=
p
-
str
;
ret
=
heap_alloc
(
sizeof
(
WCHAR
)
*
(
len
+
1
));
ret
=
malloc
(
sizeof
(
WCHAR
)
*
(
len
+
1
));
if
(
!
ret
)
return
ret
;
memcpy
(
ret
,
str
,
sizeof
(
WCHAR
)
*
len
);
...
...
@@ -2127,7 +2127,7 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
len
=
lstrlenW
(
pszFile
);
if
(
pszFile
[
0
]
==
'"'
&&
pszFile
[
len
-
1
]
==
'"'
)
{
unquoted
=
strdupW
(
pszFile
);
unquoted
=
wcsdup
(
pszFile
);
PathUnquoteSpacesW
(
unquoted
);
pszFile
=
unquoted
;
}
...
...
@@ -2135,14 +2135,14 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
/* any other quote marks are invalid */
if
(
wcschr
(
pszFile
,
'"'
))
{
heap_
free
(
unquoted
);
free
(
unquoted
);
return
S_FALSE
;
}
heap_
free
(
This
->
sPath
);
free
(
This
->
sPath
);
This
->
sPath
=
NULL
;
heap_
free
(
This
->
sComponent
);
free
(
This
->
sComponent
);
This
->
sComponent
=
NULL
;
if
(
This
->
pPidl
)
...
...
@@ -2155,7 +2155,7 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
*
buffer
=
'\0'
;
else
if
(
!
GetFullPathNameW
(
pszFile
,
MAX_PATH
,
buffer
,
&
fname
))
{
heap_
free
(
unquoted
);
free
(
unquoted
);
return
E_FAIL
;
}
else
if
(
!
PathFileExistsW
(
buffer
)
&&
...
...
@@ -2165,17 +2165,17 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
This
->
pPidl
=
SHSimpleIDListFromPathW
(
pszFile
);
ShellLink_GetVolumeInfo
(
buffer
,
&
This
->
volume
);
This
->
sPath
=
heap_alloc
(
(
lstrlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
)
);
This
->
sPath
=
malloc
(
(
lstrlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
This
->
sPath
)
{
heap_
free
(
unquoted
);
free
(
unquoted
);
return
E_OUTOFMEMORY
;
}
lstrcpyW
(
This
->
sPath
,
buffer
);
}
This
->
bDirty
=
TRUE
;
heap_
free
(
unquoted
);
free
(
unquoted
);
return
hr
;
}
...
...
@@ -2376,14 +2376,14 @@ ShellLink_ExtInit_Initialize( IShellExtInit* iface, LPCITEMIDLIST pidlFolder,
count
=
DragQueryFileW
(
stgm
.
u
.
hGlobal
,
0
,
NULL
,
0
);
count
++
;
path
=
heap_alloc
(
count
*
sizeof
(
WCHAR
)
);
path
=
malloc
(
count
*
sizeof
(
WCHAR
)
);
if
(
path
)
{
IPersistFile
*
pf
=
&
This
->
IPersistFile_iface
;
count
=
DragQueryFileW
(
stgm
.
u
.
hGlobal
,
0
,
path
,
count
);
r
=
IPersistFile_Load
(
pf
,
path
,
0
);
heap_
free
(
path
);
free
(
path
);
}
}
ReleaseStgMedium
(
&
stgm
);
...
...
@@ -2460,11 +2460,11 @@ shelllink_get_msi_component_path( LPWSTR component )
return
NULL
;
sz
++
;
path
=
heap_alloc
(
sz
*
sizeof
(
WCHAR
)
);
path
=
malloc
(
sz
*
sizeof
(
WCHAR
)
);
r
=
CommandLineFromMsiDescriptor
(
component
,
path
,
&
sz
);
if
(
r
!=
ERROR_SUCCESS
)
{
heap_
free
(
path
);
free
(
path
);
path
=
NULL
;
}
...
...
@@ -2505,7 +2505,7 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici )
return
E_FAIL
;
}
else
path
=
strdupW
(
This
->
sPath
);
path
=
wcsdup
(
This
->
sPath
);
if
(
lpici
->
cbSize
==
sizeof
(
CMINVOKECOMMANDINFOEX
)
&&
(
lpici
->
fMask
&
CMIC_MASK_UNICODE
)
)
...
...
@@ -2518,7 +2518,7 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici )
if
(
iciex
->
lpParametersW
)
len
+=
lstrlenW
(
iciex
->
lpParametersW
);
args
=
heap_alloc
(
len
*
sizeof
(
WCHAR
)
);
args
=
malloc
(
len
*
sizeof
(
WCHAR
)
);
args
[
0
]
=
0
;
if
(
This
->
sArgs
)
lstrcatW
(
args
,
This
->
sArgs
);
...
...
@@ -2544,8 +2544,8 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici )
else
r
=
E_FAIL
;
heap_
free
(
args
);
heap_
free
(
path
);
free
(
args
);
free
(
path
);
return
r
;
}
...
...
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