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
4f358198
Commit
4f358198
authored
Feb 25, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explorerframe/tests: Use global memory allocation helpers.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9e8f152d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
msg.h
dlls/explorerframe/tests/msg.h
+5
-7
nstc.c
dlls/explorerframe/tests/nstc.c
+4
-3
No files found.
dlls/explorerframe/tests/msg.h
View file @
4f358198
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include <assert.h>
#include <assert.h>
#include <windows.h>
#include <windows.h>
#include "wine/heap.h"
#include "wine/test.h"
#include "wine/test.h"
/* undocumented SWP flags - from SDK 3.1 */
/* undocumented SWP flags - from SDK 3.1 */
...
@@ -66,16 +67,13 @@ static void add_message(struct msg_sequence **seq, int sequence_index,
...
@@ -66,16 +67,13 @@ static void add_message(struct msg_sequence **seq, int sequence_index,
if
(
!
msg_seq
->
sequence
)
if
(
!
msg_seq
->
sequence
)
{
{
msg_seq
->
size
=
10
;
msg_seq
->
size
=
10
;
msg_seq
->
sequence
=
HeapAlloc
(
GetProcessHeap
(),
0
,
msg_seq
->
sequence
=
heap_alloc
(
msg_seq
->
size
*
sizeof
(
struct
message
));
msg_seq
->
size
*
sizeof
(
struct
message
));
}
}
if
(
msg_seq
->
count
==
msg_seq
->
size
)
if
(
msg_seq
->
count
==
msg_seq
->
size
)
{
{
msg_seq
->
size
*=
2
;
msg_seq
->
size
*=
2
;
msg_seq
->
sequence
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
msg_seq
->
sequence
=
heap_realloc
(
msg_seq
->
sequence
,
msg_seq
->
size
*
sizeof
(
struct
message
));
msg_seq
->
sequence
,
msg_seq
->
size
*
sizeof
(
struct
message
));
}
}
assert
(
msg_seq
->
sequence
);
assert
(
msg_seq
->
sequence
);
...
@@ -92,7 +90,7 @@ static void add_message(struct msg_sequence **seq, int sequence_index,
...
@@ -92,7 +90,7 @@ static void add_message(struct msg_sequence **seq, int sequence_index,
static
void
flush_sequence
(
struct
msg_sequence
**
seg
,
int
sequence_index
)
static
void
flush_sequence
(
struct
msg_sequence
**
seg
,
int
sequence_index
)
{
{
struct
msg_sequence
*
msg_seq
=
seg
[
sequence_index
];
struct
msg_sequence
*
msg_seq
=
seg
[
sequence_index
];
HeapFree
(
GetProcessHeap
(),
0
,
msg_seq
->
sequence
);
heap_free
(
msg_seq
->
sequence
);
msg_seq
->
sequence
=
NULL
;
msg_seq
->
sequence
=
NULL
;
msg_seq
->
count
=
msg_seq
->
size
=
0
;
msg_seq
->
count
=
msg_seq
->
size
=
0
;
}
}
...
@@ -112,5 +110,5 @@ static void init_msg_sequences(struct msg_sequence **seq, int n)
...
@@ -112,5 +110,5 @@ static void init_msg_sequences(struct msg_sequence **seq, int n)
int
i
;
int
i
;
for
(
i
=
0
;
i
<
n
;
i
++
)
for
(
i
=
0
;
i
<
n
;
i
++
)
seq
[
i
]
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
msg_sequence
));
seq
[
i
]
=
heap_alloc_zero
(
sizeof
(
struct
msg_sequence
));
}
}
dlls/explorerframe/tests/nstc.c
View file @
4f358198
...
@@ -363,7 +363,8 @@ static const INameSpaceTreeControlEventsVtbl vt_NSTCEvents = {
...
@@ -363,7 +363,8 @@ static const INameSpaceTreeControlEventsVtbl vt_NSTCEvents = {
static
INameSpaceTreeControlEventsImpl
*
create_nstc_events
(
void
)
static
INameSpaceTreeControlEventsImpl
*
create_nstc_events
(
void
)
{
{
INameSpaceTreeControlEventsImpl
*
This
;
INameSpaceTreeControlEventsImpl
*
This
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
INameSpaceTreeControlEventsImpl
));
This
=
heap_alloc
(
sizeof
(
*
This
));
This
->
INameSpaceTreeControlEvents_iface
.
lpVtbl
=
&
vt_NSTCEvents
;
This
->
INameSpaceTreeControlEvents_iface
.
lpVtbl
=
&
vt_NSTCEvents
;
This
->
ref
=
1
;
This
->
ref
=
1
;
...
@@ -2377,8 +2378,8 @@ static void test_events(void)
...
@@ -2377,8 +2378,8 @@ static void test_events(void)
if
(
!
res
)
if
(
!
res
)
{
{
/* Freeing these prematurely causes a crash. */
/* Freeing these prematurely causes a crash. */
HeapFree
(
GetProcessHeap
(),
0
,
pnstceimpl
);
heap_free
(
pnstceimpl
);
HeapFree
(
GetProcessHeap
(),
0
,
pnstceimpl2
);
heap_free
(
pnstceimpl2
);
}
}
IShellItem_Release
(
psi
);
IShellItem_Release
(
psi
);
...
...
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