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
72a84fbf
Commit
72a84fbf
authored
Dec 27, 2006
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 28, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: SafeArrayAllocData should succeed when cbElements is 0.
parent
3e8adc3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
15 deletions
+9
-15
safearray.c
dlls/oleaut32/safearray.c
+8
-11
safearray.c
dlls/oleaut32/tests/safearray.c
+1
-4
No files found.
dlls/oleaut32/safearray.c
View file @
72a84fbf
...
...
@@ -228,7 +228,7 @@ static SAFEARRAY* SAFEARRAY_Create(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsab
if
(
ulSize
)
psa
->
cbElements
=
ulSize
;
if
(
FAILED
(
SafeArrayAllocData
(
psa
)))
if
(
!
psa
->
cbElements
||
FAILED
(
SafeArrayAllocData
(
psa
)))
{
SafeArrayDestroyDescriptor
(
psa
);
psa
=
NULL
;
...
...
@@ -533,19 +533,16 @@ HRESULT WINAPI SafeArrayAllocData(SAFEARRAY *psa)
{
ULONG
ulSize
=
SAFEARRAY_GetCellCount
(
psa
);
hRet
=
E_OUTOFMEMORY
;
psa
->
pvData
=
SAFEARRAY_Malloc
(
ulSize
*
psa
->
cbElements
)
;
if
(
psa
->
cbElements
)
if
(
psa
->
pvData
)
{
psa
->
pvData
=
SAFEARRAY_Malloc
(
ulSize
*
psa
->
cbElements
);
if
(
psa
->
pvData
)
{
hRet
=
S_OK
;
TRACE
(
"%u bytes allocated for data at %p (%u objects).
\n
"
,
ulSize
*
psa
->
cbElements
,
psa
->
pvData
,
ulSize
);
}
hRet
=
S_OK
;
TRACE
(
"%u bytes allocated for data at %p (%u objects).
\n
"
,
ulSize
*
psa
->
cbElements
,
psa
->
pvData
,
ulSize
);
}
else
hRet
=
E_OUTOFMEMORY
;
}
return
hRet
;
}
...
...
dlls/oleaut32/tests/safearray.c
View file @
72a84fbf
...
...
@@ -690,10 +690,7 @@ static void test_SafeArrayAllocDestroyDescriptor(void)
sa
->
rgsabound
[
0
].
lLbound
=
1
;
hres
=
SafeArrayAllocData
(
sa
);
todo_wine
{
ok
(
hres
==
S_OK
,
"SafeArrayAllocData gave hres 0x%x
\n
"
,
hres
);
}
ok
(
hres
==
S_OK
,
"SafeArrayAllocData gave hres 0x%x
\n
"
,
hres
);
}
static
void
test_SafeArrayCreateLockDestroy
(
void
)
...
...
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