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
cb7aa030
Commit
cb7aa030
authored
Jan 10, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jan 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Return an error when unlocking a global with a zero lock count.
Rename GLOBAL_LOCK_MAX to the public GMEM_LOCKCOUNT.
parent
ab113d7e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
heap.c
dlls/kernel/heap.c
+10
-4
No files found.
dlls/kernel/heap.c
View file @
cb7aa030
...
@@ -299,7 +299,6 @@ SIZE_T WINAPI HeapSize( HANDLE heap, DWORD flags, LPVOID ptr )
...
@@ -299,7 +299,6 @@ SIZE_T WINAPI HeapSize( HANDLE heap, DWORD flags, LPVOID ptr )
*/
*/
#define MAGIC_GLOBAL_USED 0x5342
#define MAGIC_GLOBAL_USED 0x5342
#define GLOBAL_LOCK_MAX 0xFF
#define HANDLE_TO_INTERN(h) ((PGLOBAL32_INTERN)(((char *)(h))-2))
#define HANDLE_TO_INTERN(h) ((PGLOBAL32_INTERN)(((char *)(h))-2))
#define INTERN_TO_HANDLE(i) ((HGLOBAL) &((i)->Pointer))
#define INTERN_TO_HANDLE(i) ((HGLOBAL) &((i)->Pointer))
#define POINTER_TO_HANDLE(p) (*(((HGLOBAL *)(p))-2))
#define POINTER_TO_HANDLE(p) (*(((HGLOBAL *)(p))-2))
...
@@ -416,7 +415,7 @@ LPVOID WINAPI GlobalLock(
...
@@ -416,7 +415,7 @@ LPVOID WINAPI GlobalLock(
palloc
=
pintern
->
Pointer
;
palloc
=
pintern
->
Pointer
;
if
(
!
pintern
->
Pointer
)
if
(
!
pintern
->
Pointer
)
SetLastError
(
ERROR_DISCARDED
);
SetLastError
(
ERROR_DISCARDED
);
else
if
(
pintern
->
LockCount
<
G
LOBAL_LOCK_MAX
)
else
if
(
pintern
->
LockCount
<
G
MEM_LOCKCOUNT
)
pintern
->
LockCount
++
;
pintern
->
LockCount
++
;
}
}
else
else
...
@@ -461,14 +460,21 @@ BOOL WINAPI GlobalUnlock(
...
@@ -461,14 +460,21 @@ BOOL WINAPI GlobalUnlock(
pintern
=
HANDLE_TO_INTERN
(
hmem
);
pintern
=
HANDLE_TO_INTERN
(
hmem
);
if
(
pintern
->
Magic
==
MAGIC_GLOBAL_USED
)
if
(
pintern
->
Magic
==
MAGIC_GLOBAL_USED
)
{
{
if
((
pintern
->
LockCount
<
GLOBAL_LOCK_MAX
)
&&
(
pintern
->
LockCount
>
0
))
if
(
pintern
->
LockCount
)
{
pintern
->
LockCount
--
;
pintern
->
LockCount
--
;
locked
=
(
pintern
->
LockCount
!=
0
);
locked
=
(
pintern
->
LockCount
!=
0
);
if
(
!
locked
)
SetLastError
(
NO_ERROR
);
if
(
!
locked
)
SetLastError
(
NO_ERROR
);
}
}
else
else
{
{
WARN
(
"%p not locked
\n
"
,
hmem
);
SetLastError
(
ERROR_NOT_LOCKED
);
locked
=
FALSE
;
}
}
else
{
WARN
(
"invalid handle
\n
"
);
WARN
(
"invalid handle
\n
"
);
SetLastError
(
ERROR_INVALID_HANDLE
);
SetLastError
(
ERROR_INVALID_HANDLE
);
locked
=
FALSE
;
locked
=
FALSE
;
...
...
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