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
a8bba784
Commit
a8bba784
authored
Feb 21, 2002
by
Guy L. Albertelli
Committed by
Alexandre Julliard
Feb 21, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix problems in DPA_Merge exposed by previous code cleanup.
parent
e3d9406f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
8 deletions
+30
-8
comctl32undoc.c
dlls/comctl32/comctl32undoc.c
+27
-7
commctrl.h
include/commctrl.h
+3
-1
No files found.
dlls/comctl32/comctl32undoc.c
View file @
a8bba784
...
...
@@ -198,7 +198,7 @@ DPA_Merge (const HDPA hdpa1, const HDPA hdpa2, DWORD dwFlags,
{
INT
nCount
;
LPVOID
*
pWork1
,
*
pWork2
;
INT
nResult
;
INT
nResult
,
i
;
INT
nIndex
;
TRACE
(
"%p %p %08lx %p %p %08lx)
\n
"
,
...
...
@@ -216,7 +216,7 @@ DPA_Merge (const HDPA hdpa1, const HDPA hdpa2, DWORD dwFlags,
if
(
IsBadCodePtr
((
FARPROC
)
pfnMerge
))
return
FALSE
;
if
(
dwFlags
&
DPAM_SORT
)
{
if
(
!
(
dwFlags
&
DPAM_NOSORT
)
)
{
TRACE
(
"sorting dpa's!
\n
"
);
if
(
hdpa1
->
nItemCount
>
0
)
DPA_Sort
(
hdpa1
,
pfnCompare
,
lParam
);
...
...
@@ -243,7 +243,23 @@ DPA_Merge (const HDPA hdpa1, const HDPA hdpa2, DWORD dwFlags,
do
{
if
(
nIndex
<
0
)
break
;
if
(
nIndex
<
0
)
{
if
((
nCount
>=
0
)
&&
(
dwFlags
&
DPAM_INSERT
))
{
/* Now insert the remaining new items into DPA 1 */
TRACE
(
"%d items to be inserted at start of DPA 1
\n
"
,
nCount
+
1
);
for
(
i
=
nCount
;
i
>=
0
;
i
--
)
{
PVOID
ptr
;
ptr
=
(
pfnMerge
)(
3
,
*
pWork2
,
NULL
,
lParam
);
if
(
!
ptr
)
return
FALSE
;
DPA_InsertPtr
(
hdpa1
,
0
,
ptr
);
pWork2
--
;
}
}
break
;
}
nResult
=
(
pfnCompare
)(
*
pWork1
,
*
pWork2
,
lParam
);
TRACE
(
"compare result=%d, dpa1.cnt=%d, dpa2.cnt=%d
\n
"
,
nResult
,
nIndex
,
nCount
);
...
...
@@ -262,10 +278,12 @@ DPA_Merge (const HDPA hdpa1, const HDPA hdpa2, DWORD dwFlags,
nIndex
--
;
pWork1
--
;
}
else
if
(
nResult
<
0
)
else
if
(
nResult
>
0
)
{
if
(
!
(
dwFlags
&
8
))
/* item in DPA 1 missing from DPA 2 */
if
(
dwFlags
&
DPAM_DELETE
)
{
/* Now delete the extra item in DPA1 */
PVOID
ptr
;
ptr
=
DPA_DeletePtr
(
hdpa1
,
hdpa1
->
nItemCount
-
1
);
...
...
@@ -277,14 +295,16 @@ DPA_Merge (const HDPA hdpa1, const HDPA hdpa2, DWORD dwFlags,
}
else
{
if
(
!
(
dwFlags
&
4
))
/* new item in DPA 2 */
if
(
dwFlags
&
DPAM_INSERT
)
{
/* Now insert the new item in DPA 1 */
PVOID
ptr
;
ptr
=
(
pfnMerge
)(
3
,
*
pWork2
,
NULL
,
lParam
);
if
(
!
ptr
)
return
FALSE
;
DPA_InsertPtr
(
hdpa1
,
nIndex
,
ptr
);
DPA_InsertPtr
(
hdpa1
,
nIndex
+
1
,
ptr
);
}
nCount
--
;
pWork2
--
;
...
...
include/commctrl.h
View file @
a8bba784
...
...
@@ -4057,7 +4057,9 @@ BOOL WINAPI DPA_Sort (const HDPA, PFNDPACOMPARE, LPARAM);
INT
WINAPI
DPA_Search
(
const
HDPA
,
LPVOID
,
INT
,
PFNDPACOMPARE
,
LPARAM
,
UINT
);
#define DPAM_SORT 0x0001
#define DPAM_NOSORT 0x0001
#define DPAM_INSERT 0x0004
#define DPAM_DELETE 0x0008
typedef
PVOID
(
CALLBACK
*
PFNDPAMERGE
)(
DWORD
,
PVOID
,
PVOID
,
LPARAM
);
BOOL
WINAPI
DPA_Merge
(
const
HDPA
,
const
HDPA
,
DWORD
,
PFNDPACOMPARE
,
PFNDPAMERGE
,
LPARAM
);
...
...
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