🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8595

Re: How to check a HANDLE?

#8595
From: Azazello
Date: Thu, 07 Oct 2004 13:43
7 lines
1233 bytes
First thought, didn't check it:

DuplicateHandle(...) presumably will fail on invalid handle.
If not not, then you can try DuplicateHandle(...) and call CloseHandle(...) on the result. CloseHandle tends to through exception on closing invalid handles ( no exception for NULL though, but it's easy to check; and no exception on pseudohandles, like GetCurrentThread(...) result).

Azazello.
Technical Details
Message-ID: <41654815$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!stdio!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <416541a3@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d6f466f618c24d8b
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Azazello" <snimi_potniki@hotmail.com>
Sender: "Azazello" <snimi_potniki@hotmail.com>
Reply-To: "Azazello" <snimi_potniki@hotmail.com>
Subject: Re: How to check a HANDLE?
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 142.58.249.61     
References:  <416541a3@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <41654815$1@newsgroups.borland.com>
Date: 7 Oct 2004 06:43:49 -0700
X-Trace: newsgroups.borland.com 1097156629 207.105.83.66 (7 Oct 2004 06:43:49 -0700)
Lines: 7
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!stdio!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail