Microsoft KB Archive/64750

= Use DosQFSAttach API to Find Device's File System Type =

Article ID: 64750

Article Last Modified on 9/30/2003

-

APPLIES TO


 * Microsoft LAN Manager 2.0 Standard Edition
 * Microsoft LAN Manager 2.1 Standard Edition
 * Microsoft LAN Manager 2.1a
 * Microsoft LAN Manager 2.2 Standard Edition

-



This article was previously published under Q64750



SUMMARY
Use the DosQFSAttach API to programmatically determine the file system type for a specified device. The following code segment demonstrates how. If the specified device is redirected to a network device, the program returns the file system name of &quot;LAN.&quot;

You need to link and compile the program. Then, to run it, enter:

 

For example, enter the following if the program is named FS.EXE:

&quot;fs c:&quot;



Example

 * 1) define INCL_DOSPROCESS
 * 2) define INCL_DOSMEMMGR
 * 3) define INCL_DOSFILEMGR
 * 4) include
 * 5) include
 * 6) include
 * 7) include

main(int argc, char **argv) {

PSZ psz; PUSHORT pcb; USHORT cb; SEL sel;

DosAllocSeg(1024, &sel, SEG_NONSHARED); /* Allocates buffer. */

if (!DosQFSAttach(argv[1], 0, FSAIL_QUERYNAME, MAKEP(sel, 0), &cb, 0L)) { pcb = MAKEP(sel, 2); /* Points to length of device name. */    psz = MAKEP(sel, 4);  /* Points to device name. */    psz += *pcb + 3;      /* Points to file system name: Points to                             first character of device name, adds device name length, then adds three (1 null, plus 2 for file system name                             length variable). */

printf(&quot;Device %s file system is %Fs\n&quot;,argv[1],psz); } exit(0); } \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

Additional query words: O_OS2SDK HPFS FAT 2.00 2.10 2.10a 2.20

Keywords: KB64750

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.