🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #1643

Re: Not working GlobalUnlock (Was Minizing Lock and Unlock Calls in

#1643
From: Martin Schloeter
Date: Mon, 12 Oct 1992 13:38
22 lines
1485 bytes
a > However, if I decided to replace...
a > 
a >   if (GlobalUnlock(hMem) != (HANDLE) NULL)
a >      GlobalFree(hMem);
a > 
a > simply with a call to GlobalFree, as in...
a > 
a >   GlobalFree(hMem);
a > 
a > then the memory object gets freed anyway without using the 'if'
a > condition and a call to GloabalUnlock. Although this works, I'd
a > like to understand why exactly why the article choses to call
a > GlobalUnlock before the the GlobalFree function. 
Not quite sure, but in a app of mine I got the problem, that GlobalUnlock on 
Windows 3.0 returned FALSE, but while running on Win 3.1 TRUE was returned. 
Ignoring the return value had no consequences, all worked fine.
a > Before I leave you to ponder, I'd like to also state my own
a > reasoning behind why the article's method doesn't work. If I am
a > correct, please tell me so (this will also save you some time and
a > writing).
a > 
Greetings Martin
Technical Details
Message-ID: <1aaa9250@p3.f67.n245.z2.fidonet.org>
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!Sirius.dfn.de!Urmel.Informatik.RWTH-Aachen.DE!dfv.rwth-aachen.de!sungate.fido.de!p1.hippo.fido.de!eurologic.fido.de!Martin_Schloeter

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!Sirius.dfn.de!Urmel.Informatik.RWTH-Aachen.DE!dfv.rwth-aachen.de!sungate.fido.de!p1.hippo.fido.de!eurologic.fido.de!Martin_Schloeter
Date: Mon, 12 Oct 92 14:38:17 +0100
From: Martin_Schloeter@eurologic.fido.de (Martin Schloeter)
Subject: Re: Not working GlobalUnlock (Was Minizing Lock and Unlock Calls in
Message-ID: <1aaa9250@p3.f67.n245.z2.fidonet.org>
Newsgroups: comp.os.ms-windows.programmer.misc
X-Comment-To: (Atif)
Organization: Die ersten 100.000 Jahre... 
Lines: 22