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
68baaea7
Commit
68baaea7
authored
Jan 31, 2022
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemdisp: Use CRT allocation functions.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a89db318
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
34 deletions
+29
-34
locator.c
dlls/wbemdisp/locator.c
+29
-33
main.c
dlls/wbemdisp/main.c
+0
-1
No files found.
dlls/wbemdisp/locator.c
View file @
68baaea7
...
...
@@ -29,7 +29,6 @@
#include "wbemdisp.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wbemdisp_private.h"
#include "wbemdisp_classes.h"
...
...
@@ -55,7 +54,7 @@ static WCHAR *heap_strdupW( const WCHAR *src )
{
WCHAR
*
dst
;
if
(
!
src
)
return
NULL
;
if
((
dst
=
heap_
alloc
(
(
lstrlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
)
)))
lstrcpyW
(
dst
,
src
);
if
((
dst
=
m
alloc
(
(
lstrlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
)
)))
lstrcpyW
(
dst
,
src
);
return
dst
;
}
...
...
@@ -162,7 +161,7 @@ static ULONG WINAPI property_Release( ISWbemProperty *iface )
TRACE
(
"destroying %p
\n
"
,
property
);
IWbemClassObject_Release
(
property
->
object
);
SysFreeString
(
property
->
name
);
heap_
free
(
property
);
free
(
property
);
}
return
refs
;
}
...
...
@@ -322,7 +321,7 @@ static HRESULT SWbemProperty_create( IWbemClassObject *wbem_object, BSTR name, I
TRACE
(
"%p, %p
\n
"
,
obj
,
wbem_object
);
if
(
!
(
property
=
heap_
alloc
(
sizeof
(
*
property
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
property
=
m
alloc
(
sizeof
(
*
property
)
)))
return
E_OUTOFMEMORY
;
property
->
ISWbemProperty_iface
.
lpVtbl
=
&
property_vtbl
;
property
->
refs
=
1
;
property
->
object
=
wbem_object
;
...
...
@@ -360,7 +359,7 @@ static ULONG WINAPI propertyset_Release( ISWbemPropertySet *iface )
{
TRACE
(
"destroying %p
\n
"
,
propertyset
);
IWbemClassObject_Release
(
propertyset
->
object
);
heap_
free
(
propertyset
);
free
(
propertyset
);
}
return
refs
;
}
...
...
@@ -520,7 +519,7 @@ static HRESULT SWbemPropertySet_create( IWbemClassObject *wbem_object, ISWbemPro
TRACE
(
"%p, %p
\n
"
,
obj
,
wbem_object
);
if
(
!
(
propertyset
=
heap_
alloc
(
sizeof
(
*
propertyset
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
propertyset
=
m
alloc
(
sizeof
(
*
propertyset
)
)))
return
E_OUTOFMEMORY
;
propertyset
->
ISWbemPropertySet_iface
.
lpVtbl
=
&
propertyset_vtbl
;
propertyset
->
refs
=
1
;
propertyset
->
object
=
wbem_object
;
...
...
@@ -613,8 +612,8 @@ static ULONG WINAPI method_Release( ISWbemMethod *iface )
{
TRACE
(
"destroying %p
\n
"
,
method
);
ISWbemMethodSet_Release
(
&
method
->
set
->
ISWbemMethodSet_iface
);
heap_
free
(
method
->
name
);
heap_
free
(
method
);
free
(
method
->
name
);
free
(
method
);
}
return
refs
;
}
...
...
@@ -779,8 +778,7 @@ static HRESULT SWbemMethod_create( struct methodset *set, const WCHAR *name, ISW
{
struct
method
*
method
;
if
(
!
(
method
=
heap_alloc
(
sizeof
(
*
method
))))
return
E_OUTOFMEMORY
;
if
(
!
(
method
=
malloc
(
sizeof
(
*
method
)
)))
return
E_OUTOFMEMORY
;
method
->
ISWbemMethod_iface
.
lpVtbl
=
&
methodvtbl
;
method
->
refs
=
1
;
...
...
@@ -837,7 +835,7 @@ static ULONG WINAPI methodset_Release( ISWbemMethodSet *iface )
{
TRACE
(
"destroying %p
\n
"
,
set
);
ISWbemObject_Release
(
&
set
->
object
->
ISWbemObject_iface
);
heap_
free
(
set
);
free
(
set
);
}
return
refs
;
}
...
...
@@ -982,8 +980,7 @@ static HRESULT SWbemMethodSet_create( struct object *object, ISWbemMethodSet **o
{
struct
methodset
*
set
;
if
(
!
(
set
=
heap_alloc
(
sizeof
(
*
set
))))
return
E_OUTOFMEMORY
;
if
(
!
(
set
=
malloc
(
sizeof
(
*
set
)
)))
return
E_OUTOFMEMORY
;
set
->
ISWbemMethodSet_iface
.
lpVtbl
=
&
methodsetvtbl
;
set
->
refs
=
1
;
...
...
@@ -1024,8 +1021,8 @@ static ULONG WINAPI object_Release(
IWbemClassObject_Release
(
object
->
object
);
ISWbemServices_Release
(
&
object
->
services
->
ISWbemServices_iface
);
for
(
i
=
0
;
i
<
object
->
nb_members
;
i
++
)
SysFreeString
(
object
->
members
[
i
].
name
);
heap_
free
(
object
->
members
);
heap_
free
(
object
);
free
(
object
->
members
);
free
(
object
);
}
return
refs
;
}
...
...
@@ -1094,7 +1091,7 @@ static BOOL object_reserve_member( struct object *object, unsigned int count, un
if
(
new_capacity
<
count
)
new_capacity
=
max_capacity
;
if
(
!
(
new_members
=
heap_
realloc
(
object
->
members
,
new_capacity
*
sizeof
(
*
new_members
)
)))
if
(
!
(
new_members
=
realloc
(
object
->
members
,
new_capacity
*
sizeof
(
*
new_members
)
)))
return
FALSE
;
object
->
members
=
new_members
;
...
...
@@ -1153,7 +1150,7 @@ static HRESULT init_members( struct object *object )
error:
for
(
i
=
0
;
i
<
count
;
++
i
)
SysFreeString
(
object
->
members
[
i
].
name
);
heap_
free
(
object
->
members
);
free
(
object
->
members
);
object
->
members
=
NULL
;
object
->
nb_members
=
0
;
return
E_FAIL
;
...
...
@@ -1677,7 +1674,7 @@ static HRESULT SWbemObject_create( struct services *services, IWbemClassObject *
TRACE
(
"%p, %p
\n
"
,
obj
,
wbem_object
);
if
(
!
(
object
=
heap_
alloc
(
sizeof
(
*
object
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
object
=
m
alloc
(
sizeof
(
*
object
)
)))
return
E_OUTOFMEMORY
;
object
->
ISWbemObject_iface
.
lpVtbl
=
&
object_vtbl
;
object
->
refs
=
1
;
object
->
object
=
wbem_object
;
...
...
@@ -1726,7 +1723,7 @@ static ULONG WINAPI objectset_Release(
TRACE
(
"destroying %p
\n
"
,
objectset
);
IEnumWbemClassObject_Release
(
objectset
->
objectenum
);
ISWbemServices_Release
(
&
objectset
->
services
->
ISWbemServices_iface
);
heap_
free
(
objectset
);
free
(
objectset
);
}
return
refs
;
}
...
...
@@ -1949,7 +1946,7 @@ static HRESULT SWbemObjectSet_create( struct services *services, IEnumWbemClassO
TRACE
(
"%p, %p
\n
"
,
obj
,
wbem_objectenum
);
if
(
!
(
objectset
=
heap_
alloc
(
sizeof
(
*
objectset
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
objectset
=
m
alloc
(
sizeof
(
*
objectset
)
)))
return
E_OUTOFMEMORY
;
objectset
->
ISWbemObjectSet_iface
.
lpVtbl
=
&
objectset_vtbl
;
objectset
->
refs
=
1
;
objectset
->
objectenum
=
wbem_objectenum
;
...
...
@@ -1994,7 +1991,7 @@ static ULONG WINAPI enumvar_Release(
TRACE
(
"destroying %p
\n
"
,
enumvar
);
IEnumWbemClassObject_Release
(
enumvar
->
objectenum
);
ISWbemServices_Release
(
&
enumvar
->
services
->
ISWbemServices_iface
);
heap_
free
(
enumvar
);
free
(
enumvar
);
}
return
refs
;
}
...
...
@@ -2087,7 +2084,7 @@ static HRESULT EnumVARIANT_create( struct services *services, IEnumWbemClassObje
{
struct
enumvar
*
enumvar
;
if
(
!
(
enumvar
=
heap_
alloc
(
sizeof
(
*
enumvar
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
enumvar
=
m
alloc
(
sizeof
(
*
enumvar
)
)))
return
E_OUTOFMEMORY
;
enumvar
->
IEnumVARIANT_iface
.
lpVtbl
=
&
enumvar_vtbl
;
enumvar
->
refs
=
1
;
enumvar
->
objectenum
=
objectenum
;
...
...
@@ -2122,7 +2119,7 @@ static ULONG WINAPI services_Release(
{
TRACE
(
"destroying %p
\n
"
,
services
);
IWbemServices_Release
(
services
->
services
);
heap_
free
(
services
);
free
(
services
);
}
return
refs
;
}
...
...
@@ -2587,7 +2584,7 @@ static HRESULT SWbemServices_create( IWbemServices *wbem_services, ISWbemService
TRACE
(
"%p, %p
\n
"
,
obj
,
wbem_services
);
if
(
!
(
services
=
heap_
alloc
(
sizeof
(
*
services
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
services
=
m
alloc
(
sizeof
(
*
services
)
)))
return
E_OUTOFMEMORY
;
services
->
ISWbemServices_iface
.
lpVtbl
=
&
services_vtbl
;
services
->
refs
=
1
;
services
->
services
=
wbem_services
;
...
...
@@ -2627,7 +2624,7 @@ static ULONG WINAPI locator_Release(
TRACE
(
"destroying %p
\n
"
,
locator
);
if
(
locator
->
locator
)
IWbemLocator_Release
(
locator
->
locator
);
heap_
free
(
locator
);
free
(
locator
);
}
return
refs
;
}
...
...
@@ -2829,7 +2826,7 @@ HRESULT SWbemLocator_create( void **obj )
TRACE
(
"%p
\n
"
,
obj
);
if
(
!
(
locator
=
heap_
alloc
(
sizeof
(
*
locator
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
locator
=
m
alloc
(
sizeof
(
*
locator
)
)))
return
E_OUTOFMEMORY
;
locator
->
ISWbemLocator_iface
.
lpVtbl
=
&
locator_vtbl
;
locator
->
refs
=
1
;
locator
->
locator
=
NULL
;
...
...
@@ -2867,7 +2864,7 @@ static ULONG WINAPI security_Release(
if
(
!
refs
)
{
TRACE
(
"destroying %p
\n
"
,
security
);
heap_
free
(
security
);
free
(
security
);
}
return
refs
;
}
...
...
@@ -3056,7 +3053,7 @@ static HRESULT ISWbemSecurity_create( ISWbemSecurity **obj )
TRACE
(
"%p
\n
"
,
obj
);
if
(
!
(
security
=
heap_
alloc
(
sizeof
(
*
security
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
security
=
m
alloc
(
sizeof
(
*
security
)
)))
return
E_OUTOFMEMORY
;
security
->
ISWbemSecurity_iface
.
lpVtbl
=
&
security_vtbl
;
security
->
refs
=
1
;
security
->
implevel
=
wbemImpersonationLevelImpersonate
;
...
...
@@ -3122,7 +3119,7 @@ static ULONG WINAPI namedvalue_Release(
if
(
!
refs
)
{
TRACE
(
"destroying %p
\n
"
,
value
);
heap_
free
(
value
);
free
(
value
);
}
return
refs
;
}
...
...
@@ -3249,8 +3246,7 @@ static HRESULT namedvalue_create( ISWbemNamedValue **value )
{
struct
namedvalue
*
object
;
if
(
!
(
object
=
heap_alloc
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
!
(
object
=
malloc
(
sizeof
(
*
object
)
)))
return
E_OUTOFMEMORY
;
object
->
ISWbemNamedValue_iface
.
lpVtbl
=
&
namedvaluevtbl
;
object
->
refs
=
1
;
...
...
@@ -3301,7 +3297,7 @@ static ULONG WINAPI namedvalueset_Release(
TRACE
(
"destroying %p
\n
"
,
set
);
if
(
set
->
context
)
IWbemContext_Release
(
set
->
context
);
heap_
free
(
set
);
free
(
set
);
}
return
refs
;
}
...
...
@@ -3513,7 +3509,7 @@ HRESULT SWbemNamedValueSet_create( void **obj )
TRACE
(
"%p
\n
"
,
obj
);
if
(
!
(
set
=
heap_alloc_zero
(
sizeof
(
*
set
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
set
=
calloc
(
1
,
sizeof
(
*
set
)
)))
return
E_OUTOFMEMORY
;
set
->
ISWbemNamedValueSet_iface
.
lpVtbl
=
&
namedvalueset_vtbl
;
set
->
refs
=
1
;
...
...
dlls/wbemdisp/main.c
View file @
68baaea7
...
...
@@ -28,7 +28,6 @@
#include "rpcproxy.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wbemdisp_private.h"
#include "wbemdisp_classes.h"
...
...
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