Article View: borland.public.cppbuilder.nativeapi
Article #6844Re: ReadDirectoryChangesW - Access Violation
From: Bob Gonder
Date: Tue, 05 Apr 2005 23:43
Date: Tue, 05 Apr 2005 23:43
17 lines
1516 bytes
1516 bytes
Zoetjuh wrote:
>Violation error; now I'm not sure what buffersize to use, but this one seems to
>suffice:
No, too small. Way too small.
> FILE_NOTIFY_INFORMATION *ChangesBuffer = new FILE_NOTIFY_INFORMATION();
> DWORD ChangesMaxBuffer = sizeof(FILE_NOTIFY_INFORMATION) + MAX_PATH;
Should be MAX_PATH*2 because the path is WCHARs
Also, ChangesBuffer is too small. It only has room for ONE char of the
returned path!Should be more like
FILE_NOTIFY_INFORMATION *ChangesBuffer =
(FILE_NOTIFY_INFORMATION*)GlobalAlloc(GMEM_FIXED,ChangesMaxBuffer);
Technical Details
Message-ID:
<l88651l95ujrrc182cfcfvtmgl7ns5rst5@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<42530459$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,251d042661b6c50d X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: ReadDirectoryChangesW - Access Violation Date: Tue, 05 Apr 2005 16:43:31 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <l88651l95ujrrc182cfcfvtmgl7ns5rst5@4ax.com> References: <42530459$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.77.200.140 X-Trace: newsgroups.borland.com 1112744607 67.77.200.140 (5 Apr 2005 16:43:27 -0800) Lines: 19 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail