KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q101414: BUG: OpenFile() Fails When UNC Name Longer Than 11 Characters

Article: Q101414
Product(s): Microsoft Windows Software Development Kit
Version(s): WINDOWS:3.1,3.11
Operating System(s): 
Keyword(s): kb16bitonlykbbuglist
Last Modified: 06-NOV-1999

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft Windows Software Development Kit (SDK) versions 3.1, 3.11 
-------------------------------------------------------------------------------

SYMPTOMS
========

OpenFile() successfully opens files with universal naming convention (UNC) names
when the server portion of the name is 11 characters or shorter, but fails to
open files when the server name is longer than 11 characters. Error code number
2, "File not found," is placed in the nErrCode member of the OFSTRUCT structure
passed to OpenFile.

CAUSE
=====

OpenFile() validates filenames before opening them, and in the case of UNC
names, allows server names that are 11 characters or shorter only. No attempt is
made to open a file with a UNC name longer than 11 characters.

RESOLUTION
==========

To open files with UNC names when the server name is longer than 11 characters,
use _lopen().

STATUS
======

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

This is not a problem under Windows NT WOW or under Windows 95.

MORE INFORMATION
================

This problem also affects the File Open common dialog box, because
GetOpenFileName() calls OpenFile().

Additional query words: no32bit 3.10

======================================================================
Keywords          : kb16bitonly kbbuglist
Technology        : kbAudDeveloper kbWin3xSearch kbSDKSearch kbWinSDKSearch kbWinSDK310 kbWinSDK311
Version           : WINDOWS:3.1,3.11

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

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.

Copyright Microsoft Corporation 1986-2002.