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
fe09e2db
Commit
fe09e2db
authored
Jan 30, 2018
by
Daniel Lehman
Committed by
Alexandre Julliard
Feb 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Change error return from GlobalFree.
Signed-off-by:
Daniel Lehman
<
dlehman@esri.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f9181daa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
heap.c
dlls/kernel32/heap.c
+2
-2
heap.c
dlls/kernel32/tests/heap.c
+13
-1
No files found.
dlls/kernel32/heap.c
View file @
fe09e2db
...
@@ -784,8 +784,8 @@ HGLOBAL WINAPI GlobalFree(HGLOBAL hmem)
...
@@ -784,8 +784,8 @@ HGLOBAL WINAPI GlobalFree(HGLOBAL hmem)
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
ERR
(
"
(%p): Page fault occurred ! Caused by bug ?
\n
"
,
hmem
);
ERR
(
"
invalid handle %p
\n
"
,
hmem
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
SetLastError
(
ERROR_INVALID_HANDLE
);
hreturned
=
hmem
;
hreturned
=
hmem
;
}
}
__ENDTRY
__ENDTRY
...
...
dlls/kernel32/tests/heap.c
View file @
fe09e2db
...
@@ -217,6 +217,18 @@ static void test_heap(void)
...
@@ -217,6 +217,18 @@ static void test_heap(void)
"returned %p with 0x%08x (expected %p with ERROR_INVALID_HANDLE)
\n
"
,
"returned %p with 0x%08x (expected %p with ERROR_INVALID_HANDLE)
\n
"
,
hsecond
,
GetLastError
(),
gbl
);
hsecond
,
GetLastError
(),
gbl
);
SetLastError
(
MAGIC_DEAD
);
SetLastError
(
MAGIC_DEAD
);
hsecond
=
GlobalFree
(
LongToHandle
(
0xdeadbeef
));
/* bogus handle */
ok
(
(
hsecond
==
LongToHandle
(
0xdeadbeef
))
&&
(
GetLastError
()
==
ERROR_INVALID_HANDLE
),
"returned %p with 0x%08x (expected %p with ERROR_INVALID_HANDLE)
\n
"
,
hsecond
,
GetLastError
(),
LongToHandle
(
0xdeadbeef
));
SetLastError
(
MAGIC_DEAD
);
hsecond
=
GlobalFree
(
LongToHandle
(
0xdeadbee0
));
/* bogus pointer */
ok
(
(
hsecond
==
LongToHandle
(
0xdeadbee0
))
&&
((
GetLastError
()
==
ERROR_INVALID_HANDLE
)
||
broken
(
GetLastError
()
==
ERROR_NOACCESS
)
/* wvista+ */
),
"returned %p with 0x%08x (expected %p with ERROR_NOACCESS)
\n
"
,
hsecond
,
GetLastError
(),
LongToHandle
(
0xdeadbee0
));
SetLastError
(
MAGIC_DEAD
);
flags
=
GlobalFlags
(
gbl
);
flags
=
GlobalFlags
(
gbl
);
ok
(
(
flags
==
GMEM_INVALID_HANDLE
)
&&
(
GetLastError
()
==
ERROR_INVALID_HANDLE
),
ok
(
(
flags
==
GMEM_INVALID_HANDLE
)
&&
(
GetLastError
()
==
ERROR_INVALID_HANDLE
),
"returned 0x%04x with 0x%08x (expected GMEM_INVALID_HANDLE with "
"returned 0x%04x with 0x%08x (expected GMEM_INVALID_HANDLE with "
...
@@ -250,7 +262,7 @@ static void test_heap(void)
...
@@ -250,7 +262,7 @@ static void test_heap(void)
ok
(
mem
==
NULL
,
"Expected NULL, got %p
\n
"
,
mem
);
ok
(
mem
==
NULL
,
"Expected NULL, got %p
\n
"
,
mem
);
/* invalid free */
/* invalid free */
if
(
sizeof
(
void
*
)
!=
8
)
/* crashes on 64-bit
Vista
*/
if
(
sizeof
(
void
*
)
!=
8
)
/* crashes on 64-bit */
{
{
SetLastError
(
MAGIC_DEAD
);
SetLastError
(
MAGIC_DEAD
);
mem
=
GlobalFree
(
gbl
);
mem
=
GlobalFree
(
gbl
);
...
...
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