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
0ee1b888
Commit
0ee1b888
authored
Jan 02, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmiutils: Introduce memory allocation helpers.
parent
63a89f9b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
path.c
dlls/wmiutils/path.c
+4
-5
statuscode.c
dlls/wmiutils/statuscode.c
+2
-3
wmiutils_private.h
dlls/wmiutils/wmiutils_private.h
+11
-0
No files found.
dlls/wmiutils/path.c
View file @
0ee1b888
...
...
@@ -61,8 +61,8 @@ static ULONG WINAPI path_Release(
if
(
!
refs
)
{
TRACE
(
"destroying %p
\n
"
,
path
);
HeapFree
(
GetProcessHeap
(),
0
,
path
->
text
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
heap_free
(
path
->
text
);
heap_free
(
path
);
}
return
refs
;
}
...
...
@@ -103,8 +103,7 @@ static HRESULT WINAPI path_SetText(
if
(
uMode
)
FIXME
(
"igoring mode %u
\n
"
,
uMode
);
len
=
strlenW
(
pszPath
);
if
(
!
(
path
->
text
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
path
->
text
=
heap_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
E_OUTOFMEMORY
;
strcpyW
(
path
->
text
,
pszPath
);
path
->
len
=
len
;
...
...
@@ -382,7 +381,7 @@ HRESULT WbemPath_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE
(
"%p, %p
\n
"
,
pUnkOuter
,
ppObj
);
if
(
!
(
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
path
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
path
=
heap_alloc
(
sizeof
(
*
path
)
)))
return
E_OUTOFMEMORY
;
path
->
IWbemPath_iface
.
lpVtbl
=
&
path_vtbl
;
path
->
refs
=
1
;
...
...
dlls/wmiutils/statuscode.c
View file @
0ee1b888
...
...
@@ -59,7 +59,7 @@ static ULONG WINAPI status_code_Release(
if
(
!
refs
)
{
TRACE
(
"destroying %p
\n
"
,
status_code
);
HeapFree
(
GetProcessHeap
(),
0
,
status_code
);
heap_free
(
status_code
);
}
return
refs
;
}
...
...
@@ -138,8 +138,7 @@ HRESULT WbemStatusCodeText_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE
(
"(%p,%p)
\n
"
,
pUnkOuter
,
ppObj
);
sc
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
sc
)
);
if
(
!
sc
)
return
E_OUTOFMEMORY
;
if
(
!
(
sc
=
heap_alloc
(
sizeof
(
*
sc
)
)))
return
E_OUTOFMEMORY
;
sc
->
IWbemStatusCodeText_iface
.
lpVtbl
=
&
status_code_vtbl
;
sc
->
refs
=
1
;
...
...
dlls/wmiutils/wmiutils_private.h
View file @
0ee1b888
...
...
@@ -18,3 +18,14 @@
HRESULT
WbemPath_create
(
IUnknown
*
,
LPVOID
*
)
DECLSPEC_HIDDEN
;
HRESULT
WbemStatusCodeText_create
(
IUnknown
*
,
LPVOID
*
)
DECLSPEC_HIDDEN
;
static
void
*
heap_alloc
(
size_t
len
)
__WINE_ALLOC_SIZE
(
1
);
static
inline
void
*
heap_alloc
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
inline
BOOL
heap_free
(
void
*
mem
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
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