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
55a14edd
Commit
55a14edd
authored
Nov 20, 2001
by
Andreas Mohr
Committed by
Alexandre Julliard
Nov 20, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use exception handler for GlobalUnlock, GlobalFree.
parent
ae1c12c4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
6 deletions
+25
-6
global.c
memory/global.c
+25
-6
No files found.
memory/global.c
View file @
55a14edd
...
...
@@ -1106,12 +1106,12 @@ BOOL WINAPI GlobalUnlock(
PGLOBAL32_INTERN
pintern
;
BOOL
locked
;
if
(
ISPOINTER
(
hmem
))
return
FALSE
;
if
(
ISPOINTER
(
hmem
))
return
FALSE
;
__TRY
{
/* HeapLock(GetProcessHeap()); */
pintern
=
HANDLE_TO_INTERN
(
hmem
);
if
(
pintern
->
Magic
==
MAGIC_GLOBAL_USED
)
{
if
((
pintern
->
LockCount
<
GLOBAL_LOCK_MAX
)
&&
(
pintern
->
LockCount
>
0
))
...
...
@@ -1127,6 +1127,14 @@ BOOL WINAPI GlobalUnlock(
locked
=
FALSE
;
}
/* HeapUnlock(GetProcessHeap()); */
}
__EXCEPT
(
page_fault
)
{
ERR
(
"page fault occurred ! Caused by bug ?
\n
"
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
__ENDTRY
return
locked
;
}
...
...
@@ -1306,8 +1314,11 @@ HGLOBAL WINAPI GlobalFree(
HGLOBAL
hmem
/* [in] Handle of global memory object */
)
{
PGLOBAL32_INTERN
pintern
;
HGLOBAL
hreturned
=
0
;
HGLOBAL
hreturned
;
__TRY
{
hreturned
=
0
;
if
(
ISPOINTER
(
hmem
))
/* POINTER */
{
if
(
!
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
hmem
))
hmem
=
0
;
...
...
@@ -1320,8 +1331,8 @@ HGLOBAL WINAPI GlobalFree(
if
(
pintern
->
Magic
==
MAGIC_GLOBAL_USED
)
{
/* WIN98 does not make this test. That is you can free a */
/* block you have not unlocked. Go figure!! */
/* WIN98 does not make this test. That is you can free a */
/* block you have not unlocked. Go figure!! */
/* if(pintern->LockCount!=0) */
/* SetLastError(ERROR_INVALID_HANDLE); */
...
...
@@ -1333,6 +1344,14 @@ HGLOBAL WINAPI GlobalFree(
}
/* HeapUnlock(heap); */
}
}
__EXCEPT
(
page_fault
)
{
ERR
(
"page fault occurred ! Caused by bug ?
\n
"
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
hmem
;
}
__ENDTRY
return
hreturned
;
}
...
...
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