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
f6bf2690
Commit
f6bf2690
authored
Feb 28, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wshom: Use global memory allocation helpers.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1db5170f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
shell.c
dlls/wshom.ocx/shell.c
+18
-17
No files found.
dlls/wshom.ocx/shell.c
View file @
f6bf2690
...
...
@@ -24,6 +24,7 @@
#include "dispex.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wshom
);
...
...
@@ -130,7 +131,7 @@ static ULONG WINAPI WshExec_Release(IWshExec *iface)
if
(
!
ref
)
{
CloseHandle
(
This
->
info
.
hThread
);
CloseHandle
(
This
->
info
.
hProcess
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
heap_free
(
This
);
}
return
ref
;
...
...
@@ -325,7 +326,7 @@ static HRESULT WshExec_create(BSTR command, IWshExec **ret)
*
ret
=
NULL
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
));
This
=
heap_alloc
(
sizeof
(
*
This
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
...
...
@@ -333,7 +334,7 @@ static HRESULT WshExec_create(BSTR command, IWshExec **ret)
This
->
ref
=
1
;
if
(
!
CreateProcessW
(
NULL
,
command
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
This
->
info
))
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
heap_free
(
This
);
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
...
...
@@ -383,7 +384,7 @@ static ULONG WINAPI WshEnvironment_Release(IWshEnvironment *iface)
TRACE
(
"(%p) ref = %d
\n
"
,
This
,
ref
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
heap_free
(
This
);
return
ref
;
}
...
...
@@ -519,7 +520,7 @@ static HRESULT WshEnvironment_Create(IWshEnvironment **env)
{
WshEnvironment
*
This
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
));
This
=
heap_alloc
(
sizeof
(
*
This
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IWshEnvironment_iface
.
lpVtbl
=
&
WshEnvironmentVtbl
;
...
...
@@ -572,7 +573,7 @@ static ULONG WINAPI WshCollection_Release(IWshCollection *iface)
TRACE
(
"(%p) ref = %d
\n
"
,
This
,
ref
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
heap_free
(
This
);
return
ref
;
}
...
...
@@ -721,7 +722,7 @@ static HRESULT WshCollection_Create(IWshCollection **collection)
{
WshCollection
*
This
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
));
This
=
heap_alloc
(
sizeof
(
*
This
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IWshCollection_iface
.
lpVtbl
=
&
WshCollectionVtbl
;
...
...
@@ -778,7 +779,7 @@ static ULONG WINAPI WshShortcut_Release(IWshShortcut *iface)
{
SysFreeString
(
This
->
path_link
);
IShellLinkW_Release
(
This
->
link
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
heap_free
(
This
);
}
return
ref
;
...
...
@@ -1077,7 +1078,7 @@ static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch **shortcut)
*
shortcut
=
NULL
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
));
This
=
heap_alloc
(
sizeof
(
*
This
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IWshShortcut_iface
.
lpVtbl
=
&
WshShortcutVtbl
;
...
...
@@ -1087,7 +1088,7 @@ static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch **shortcut)
&
IID_IShellLinkW
,
(
void
**
)
&
This
->
link
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
heap_free
(
This
);
return
hr
;
}
...
...
@@ -1095,7 +1096,7 @@ static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch **shortcut)
if
(
!
This
->
path_link
)
{
IShellLinkW_Release
(
This
->
link
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
heap_free
(
This
);
return
E_OUTOFMEMORY
;
}
...
...
@@ -1426,7 +1427,7 @@ static HRESULT split_reg_path(const WCHAR *path, WCHAR **subkey, WCHAR **value)
unsigned
int
len
=
*
value
-
*
subkey
-
1
;
WCHAR
*
ret
;
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
ret
=
heap_alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
ret
)
return
E_OUTOFMEMORY
;
...
...
@@ -1466,7 +1467,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *v
if
(
ret
==
ERROR_SUCCESS
)
{
void
*
data
;
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
datalen
);
data
=
heap_alloc
(
datalen
);
if
(
!
data
)
{
hr
=
E_OUTOFMEMORY
;
goto
fail
;
...
...
@@ -1474,7 +1475,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *v
ret
=
RegGetValueW
(
root
,
subkey
,
val
,
RRF_RT_ANY
,
&
type
,
data
,
&
datalen
);
if
(
ret
)
{
HeapFree
(
GetProcessHeap
(),
0
,
data
);
heap_free
(
data
);
hr
=
HRESULT_FROM_WIN32
(
ret
);
goto
fail
;
}
...
...
@@ -1564,7 +1565,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *v
hr
=
E_FAIL
;
};
HeapFree
(
GetProcessHeap
(),
0
,
data
);
heap_free
(
data
);
if
(
FAILED
(
hr
))
VariantInit
(
value
);
}
...
...
@@ -1573,7 +1574,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *v
fail:
if
(
val
)
HeapFree
(
GetProcessHeap
(),
0
,
subkey
);
heap_free
(
subkey
);
return
hr
;
}
...
...
@@ -1661,7 +1662,7 @@ static HRESULT WINAPI WshShell3_RegWrite(IWshShell3 *iface, BSTR name, VARIANT *
fail:
VariantClear
(
&
v
);
if
(
val
)
HeapFree
(
GetProcessHeap
(),
0
,
subkey
);
heap_free
(
subkey
);
return
hr
;
}
...
...
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