🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

using QueryDosDevice()

#1339
From: Mike Collins
Date: Tue, 18 Sep 2007 21:36
24 lines
1849 bytes
Hi all, trying to use QueryDosDevice() to return a list of all Symbolic 
names and the Logical device that they correlate too.

DWORD QueryDosDevice(

    LPCTSTR lpDeviceName, // address of MS-DOS device name string
    LPTSTR lpTargetPath, // address of buffer for storing query results
    DWORD ucchMax  // maximum storage capacity of buffer
   );

I'm trying to do this, initially by passing a NULL value for the 
lpDeviceName.  However, i'm struggling to find a way to determine that 
required size of the lpTargetPath.  If i pass a buffer that is too small, 
the function returns a 0 and GetLastError reports "The data area passed to a 
system call is too small".  However there seems to be no way to bet the size 
of the required buffer.  Usually, in API's, the size parameter is modified 
if the buffer is too small, but in this case there seems to be no way to 
determine the required buffer size.

Any suggestions?

Thanks in advance,

Mike C 
Technical Details
Message-ID: <46f0344e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2fc1216e36a3f247,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mike Collins" <its@TheBottomOfThePost>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: using QueryDosDevice()
Date: Tue, 18 Sep 2007 21:36:52 -0000
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4073
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 89.242.165.148
Message-ID: <46f0344e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1190147150 89.242.165.148 (18 Sep 2007 13:25:50 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail