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
c7d9f75e
Commit
c7d9f75e
authored
Mar 27, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 27, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround a msvcrt.realloc bug under Win9x by using Win32 APIs instead.
Take into account that HeapRealloc may move the allocated memory block.
parent
02dd8c36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
msg.c
dlls/user/tests/msg.c
+7
-7
No files found.
dlls/user/tests/msg.c
View file @
c7d9f75e
...
...
@@ -21,9 +21,7 @@
*/
#include <assert.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
...
...
@@ -363,12 +361,12 @@ static void add_message(const struct message *msg)
if
(
!
sequence
)
{
sequence_size
=
10
;
sequence
=
malloc
(
sequence_size
*
sizeof
(
struct
message
)
);
sequence
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sequence_size
*
sizeof
(
struct
message
)
);
}
if
(
sequence_cnt
==
sequence_size
)
{
sequence_size
*=
2
;
sequence
=
realloc
(
sequence
,
sequence_size
*
sizeof
(
struct
message
)
);
sequence
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
sequence
,
sequence_size
*
sizeof
(
struct
message
)
);
}
assert
(
sequence
);
...
...
@@ -382,7 +380,7 @@ static void add_message(const struct message *msg)
static
void
flush_sequence
()
{
free
(
sequence
);
HeapFree
(
GetProcessHeap
(),
0
,
sequence
);
sequence
=
0
;
sequence_cnt
=
sequence_size
=
0
;
}
...
...
@@ -390,10 +388,12 @@ static void flush_sequence()
static
void
ok_sequence
(
const
struct
message
*
expected
,
const
char
*
context
)
{
static
const
struct
message
end_of_sequence
=
{
0
,
0
,
0
,
0
};
const
struct
message
*
actual
=
sequence
;
const
struct
message
*
actual
;
add_message
(
&
end_of_sequence
);
actual
=
sequence
;
while
(
expected
->
message
&&
actual
->
message
)
{
trace
(
"expected %04x - actual %04x
\n
"
,
expected
->
message
,
actual
->
message
);
...
...
@@ -416,7 +416,7 @@ static void ok_sequence(const struct message *expected, const char *context)
"%s: the msg 0x%04x was expected in %s
\n
"
,
context
,
expected
->
message
,
(
expected
->
flags
&
parent
)
?
"parent"
:
"child"
);
ok
((
expected
->
flags
&
hook
)
==
(
actual
->
flags
&
hook
),
"%s: the msg 0x%04x should have been
hooked
\n
"
,
"%s: the msg 0x%04x should have been
sent by a hook
\n
"
,
context
,
expected
->
message
);
expected
++
;
actual
++
;
...
...
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