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
3066397b
Commit
3066397b
authored
Jan 09, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Jan 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: Trying to lock an empty global memory block gives an ERROR_DISCARDED.
parent
c83a5930
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
heap.c
dlls/kernel/heap.c
+4
-2
heap.c
dlls/kernel/tests/heap.c
+8
-0
No files found.
dlls/kernel/heap.c
View file @
3066397b
...
...
@@ -413,9 +413,11 @@ LPVOID WINAPI GlobalLock(
pintern
=
HANDLE_TO_INTERN
(
hmem
);
if
(
pintern
->
Magic
==
MAGIC_GLOBAL_USED
)
{
if
(
pintern
->
LockCount
<
GLOBAL_LOCK_MAX
)
pintern
->
LockCount
++
;
palloc
=
pintern
->
Pointer
;
if
(
!
pintern
->
Pointer
)
SetLastError
(
ERROR_DISCARDED
);
else
if
(
pintern
->
LockCount
<
GLOBAL_LOCK_MAX
)
pintern
->
LockCount
++
;
}
else
{
...
...
dlls/kernel/tests/heap.c
View file @
3066397b
...
...
@@ -102,4 +102,12 @@ START_TEST(heap)
gbl
=
LocalReAlloc
(
0
,
10
,
LMEM_MOVEABLE
);
ok
(
gbl
==
NULL
,
"local realloc allocated memory
\n
"
);
/* trying to lock empty memory should give an error */
gbl
=
GlobalAlloc
(
GMEM_MOVEABLE
|
GMEM_ZEROINIT
,
0
);
ok
(
gbl
!=
NULL
,
"returned NULL
\n
"
);
SetLastError
(
0xdeadbeef
);
mem
=
GlobalLock
(
gbl
);
ok
(
GetLastError
()
==
ERROR_DISCARDED
,
"should return an error
\n
"
);
ok
(
mem
==
NULL
,
"should return NULL
\n
"
);
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