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
adc091b8
Commit
adc091b8
authored
Jan 06, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Use CoTaskMem* functions for safearrays.
parent
35a91741
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
safearray.c
dlls/oleaut32/safearray.c
+9
-11
No files found.
dlls/oleaut32/safearray.c
View file @
adc091b8
...
...
@@ -95,18 +95,18 @@ static const USHORT ignored_copy_features =
FADF_CREATEVECTOR
;
/* Allocate memory */
static
inline
LPVOID
SAFEARRAY_Malloc
(
ULONG
ulS
ize
)
static
inline
void
*
SAFEARRAY_Malloc
(
ULONG
s
ize
)
{
/* FIXME: Memory should be allocated and freed using a per-thread IMalloc
* instance returned from CoGetMalloc().
*/
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
ulSize
)
;
void
*
ret
=
CoTaskMemAlloc
(
size
);
if
(
ret
)
memset
(
ret
,
0
,
size
);
return
ret
;
}
/* Free memory */
static
inline
BOOL
SAFEARRAY_Free
(
LPVOID
lpData
)
static
inline
void
SAFEARRAY_Free
(
void
*
ptr
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
lpData
);
CoTaskMemFree
(
ptr
);
}
/* Get the size of a supported VT type (0 means unsupported) */
...
...
@@ -772,8 +772,7 @@ HRESULT WINAPI SafeArrayDestroyDescriptor(SAFEARRAY *psa)
!
(
psa
->
fFeatures
&
FADF_DATADELETED
))
SAFEARRAY_DestroyData
(
psa
,
0
);
/* Data not previously deleted */
if
(
!
SAFEARRAY_Free
(
lpv
))
return
E_UNEXPECTED
;
SAFEARRAY_Free
(
lpv
);
}
return
S_OK
;
}
...
...
@@ -1283,8 +1282,7 @@ HRESULT WINAPI SafeArrayDestroyData(SAFEARRAY *psa)
/* If this is not a vector, free the data memory block */
if
(
!
(
psa
->
fFeatures
&
FADF_CREATEVECTOR
))
{
if
(
!
SAFEARRAY_Free
(
psa
->
pvData
))
return
E_UNEXPECTED
;
SAFEARRAY_Free
(
psa
->
pvData
);
psa
->
pvData
=
NULL
;
}
else
...
...
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