Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9e47c594
Commit
9e47c594
authored
Jan 29, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Actually grow the array in DPA_Grow.
parent
6bc1a359
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
dpa.c
dlls/comctl32/dpa.c
+16
-1
dpa.c
dlls/comctl32/tests/dpa.c
+1
-1
No files found.
dlls/comctl32/dpa.c
View file @
9e47c594
...
...
@@ -426,12 +426,27 @@ BOOL WINAPI DPA_Destroy (const HDPA hdpa)
*/
BOOL
WINAPI
DPA_Grow
(
HDPA
hdpa
,
INT
nGrow
)
{
INT
items
;
TRACE
(
"(%p %d)
\n
"
,
hdpa
,
nGrow
);
if
(
!
hdpa
)
return
FALSE
;
hdpa
->
nGrow
=
max
(
8
,
nGrow
);
nGrow
=
max
(
8
,
nGrow
);
items
=
nGrow
*
(((
hdpa
->
nMaxCount
-
1
)
/
nGrow
)
+
1
);
if
(
items
>
hdpa
->
nMaxCount
)
{
void
*
ptr
;
if
(
hdpa
->
ptrs
)
ptr
=
HeapReAlloc
(
hdpa
->
hHeap
,
HEAP_ZERO_MEMORY
,
hdpa
->
ptrs
,
items
*
sizeof
(
LPVOID
)
);
else
ptr
=
HeapAlloc
(
hdpa
->
hHeap
,
HEAP_ZERO_MEMORY
,
items
*
sizeof
(
LPVOID
)
);
if
(
!
ptr
)
return
FALSE
;
hdpa
->
nMaxCount
=
items
;
hdpa
->
ptrs
=
ptr
;
}
hdpa
->
nGrow
=
nGrow
;
return
TRUE
;
}
...
...
dlls/comctl32/tests/dpa.c
View file @
9e47c594
...
...
@@ -213,7 +213,7 @@ static void test_dpa(void)
dpa3
=
pDPA_CreateEx
(
0
,
hHeap
);
ok
(
dpa3
!=
NULL
,
"
\n
"
);
ret
=
pDPA_Grow
(
dpa3
,
si
.
dwPageSize
+
1
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_NOT_ENOUGH_MEMORY
,
ok
(
!
ret
&&
GetLastError
()
==
ERROR_NOT_ENOUGH_MEMORY
,
"ret=%d error=%d
\n
"
,
ret
,
GetLastError
());
dpa
=
pDPA_Create
(
0
);
...
...
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