Article View: borland.public.cppbuilder.nativeapi
Article #308CreateFile/CloseHandle increases win32 Handle Count
From: Christian Lotze
Date: Thu, 05 Jun 2008 07:25
Date: Thu, 05 Jun 2008 07:25
27 lines
1725 bytes
1725 bytes
Hi all,
I'm reading an external harddisk directly with:
DeviceString = "\\\\.\\PHYSICALDRIVE"+IntToStr( HardDisk );
hDevice = CreateFile( DeviceString.c_str(),
GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
0);
..... (SetFilePointer/ReadFile)
CloseHandle(hDevice);
This increases count of win32 handles every time
Createfile creates two handles
CloseHandle closes only one of theses handles
(You can monitor this behaviour with processexplorer.)
Any hints?
Thanks, Christian
Technical Details
Message-ID:
<484794e5@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,93e619dfbda10652,start X-Google-Attributes: gid10cc67,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 05 Jun 2008 09:25:26 +0200 From: Christian Lotze <Chrissi099@hotmail.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.14) Gecko/20080421 Thunderbird/2.0.0.14 Mnenhy/0.7.5.0 MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: CreateFile/CloseHandle increases win32 Handle Count Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 217.86.155.108 Message-ID: <484794e5@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1212650725 217.86.155.108 (5 Jun 2008 00:25:25 -0700) Lines: 27 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail X-Original-Bytes: 1526