BUG: GetDiskFreeSpace() Fails with a UNC Path to Network Share

Last reviewed: September 15, 1997
Article ID: Q137230
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with: - Windows 95

SYMPTOMS

The GetDiskFreeSpace() function fails with a universal naming convention (UNC) path to a network share. This failure causes problems for various applications. For example, WinHelp can neither load nor create a full-text index through a UNC path. The same operation works fine using a drive-relative path.

This problem does not occur under Microsoft Windows NT. However, you must include a trailing backslash, so that the UNC path looks like the following:

   \\server\share\

RESOLUTION

Use a drive letter instead. For example:

   GetDiskFreeSpace(<UNC name>)
   if <GetDiskFreeSpace fails>
      WNetAddConnection()    // Connect and get a drive letter.
      GetDiskFreeSpace(<drive letter>:)
      WNetCancelConnection() // Disconnect.

STATUS

Microsoft has confirmed this to be a bug in Microsoft Windows 95. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Keywords          : BseFileio
Issue type        : kbbug


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 15, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.