Discussion:
GlobalUnlock doesn't unlock Memory object
(too old to reply)
Bibo
2006-07-23 07:43:01 UTC
Permalink
I have a moveable allocated Memory object, I lock the Memory object but when
I try to unlock, I couldn't although the lock count is decremented but the
globaunlock returns zero, and when I try to find out this error using the
GetLastError, the code is NO_ERROR "0" .. Can anybody help me to know why
this happens
Heinz Ozwirk
2006-07-23 08:26:59 UTC
Permalink
Post by Bibo
I have a moveable allocated Memory object, I lock the Memory object but when
I try to unlock, I couldn't although the lock count is decremented but the
globaunlock returns zero, and when I try to find out this error using the
GetLastError, the code is NO_ERROR "0" .. Can anybody help me to know why
this happens
Read the manual, and read it completly:

"If the memory object is still locked after decrementing the lock count, the
return value is a nonzero value.
If the function fails, the return value is zero. To get extended error
information, call GetLastError. If GetLastError returns NO_ERROR, the memory
object is unlocked."

Heinz
Bibo
2006-07-23 09:34:01 UTC
Permalink
Post by Heinz Ozwirk
Post by Bibo
I have a moveable allocated Memory object, I lock the Memory object but when
I try to unlock, I couldn't although the lock count is decremented but the
globaunlock returns zero, and when I try to find out this error using the
GetLastError, the code is NO_ERROR "0" .. Can anybody help me to know why
this happens
"If the memory object is still locked after decrementing the lock count, the
return value is a nonzero value.
If the function fails, the return value is zero. To get extended error
information, call GetLastError. If GetLastError returns NO_ERROR, the memory
object is unlocked."
Heinz
Yeah I read that, what I wanted to ask about was, although the lock count is
decremented but the function fails for no reason, why ?
thanks
Heinz Ozwirk
2006-07-23 11:11:04 UTC
Permalink
Post by Bibo
Post by Heinz Ozwirk
Post by Bibo
I have a moveable allocated Memory object, I lock the Memory object but when
I try to unlock, I couldn't although the lock count is decremented but the
globaunlock returns zero, and when I try to find out this error using the
GetLastError, the code is NO_ERROR "0" .. Can anybody help me to know why
this happens
"If the memory object is still locked after decrementing the lock count, the
return value is a nonzero value.
If the function fails, the return value is zero. To get extended error
information, call GetLastError. If GetLastError returns NO_ERROR, the memory
object is unlocked."
Heinz
Yeah I read that, what I wanted to ask about was, although the lock count is
decremented but the function fails for no reason, why ?
IT DOES NOT FAIL. If the function returns 0 and GetLastError returns
NO_ERROR the function succeeded and did unlock the memory object.

Heinz

Loading...