FIX: "_stat" or "_wstat" function fails together with ENOENT error when a directory symbolic link path is passed to it in a Visual C++ 2010 application

Applies To
Visual C++ 2010 Express

This hotfix applies to Microsoft Visual C++ 2010 Service Pack 1 (SP1) Redistributable Package.

Symptoms

Consider the following scenario:

  • You have a folder named "folder1" on drive D. For example, you have the following folder: d:\folder1.

  • You run the mklink command to create a directory symbolic link to the folder. For example, you run the following command to create a directory symbolic link folder on drive C:

    mklink /d c:\linkfolder d:\folder1  
    
  • You run a Microsoft Visual C++ 2010 application.

  • The application calls the _stat or _wstat function, and then it passes the path of the directory symbolic link "c:\linkfolder" to the path parameter.

In this scenario, the called function does not work, and it returns an ERROR_FILE_NOT_FOUND error.

Note The returned value of the _stat or _wstat function is -1. The error code is "2," which stands for "ENOENT: No such file or directory."

Resolution

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.

If the hotfix is available for download, there is a "Hotfix Download Available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website:

http:⁠//support.microsoft.com/contactus/?ws=support Note The "Hotfix Download Available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Prerequisites

To apply this hotfix, you must have Microsoft Visual C++ 2010 SP1 Redistributable Package installed.

Restart requirement

You may have to restart the computer after you install the hotfix if the affected files are not being used at the time of installation. We recommend that you close all Visual C++ 2010-related components before you install the hotfix.

File information

The global version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

For all supported x86-based versions of Microsoft Visual C++ 2010 SP1 Redistributable Package

File name File version File size Date Time Platform
Atl100.dll 10.0.40219.455 138,896 08-Oct-2013 13:34 x86
Mfc100.dll 10.0.40219.455 4,400,784 08-Oct-2013 14:59 x86
Mfc100chs.dll 10.0.40219.455 37,016 08-Oct-2013 14:59 x86
Mfc100cht.dll 10.0.40219.455 37,016 08-Oct-2013 14:59 x86
Mfc100deu.dll 10.0.40219.455 65,176 08-Oct-2013 14:59 x86
Mfc100enu.dll 10.0.40219.455 55,960 08-Oct-2013 14:59 x86
Mfc100esn.dll 10.0.40219.455 64,664 08-Oct-2013 14:59 x86
Mfc100fra.dll 10.0.40219.455 65,176 08-Oct-2013 14:59 x86
Mfc100ita.dll 10.0.40219.455 63,128 08-Oct-2013 14:59 x86
Mfc100jpn.dll 10.0.40219.455 44,696 08-Oct-2013 14:59 x86
Mfc100kor.dll 10.0.40219.455 44,184 08-Oct-2013 14:59 x86
Mfc100rus.dll 10.0.40219.455 61,592 08-Oct-2013 14:59 x86
Mfc100u.dll 10.0.40219.455 4,425,872 08-Oct-2013 14:59 x86
Mfcm100.dll 10.0.40219.455 82,576 08-Oct-2013 14:59 x86
Mfcm100u.dll 10.0.40219.455 82,584 08-Oct-2013 14:59 x86
Msvcp100.dll 10.0.40219.455 422,040 08-Oct-2013 13:34 x86
Msvcr100.dll 10.0.40219.455 774,808 08-Oct-2013 13:34 x86
Vcomp100.dll 10.0.40219.455 52,376 08-Oct-2013 14:59 x86

For all supported x64-based versions of Microsoft Visual C++ 2010 SP1 Redistributable Package

File name File version File size Date Time Platform
Atl100.dll 10.0.40219.455 159,376 08-Oct-2013 14:27 x64
Mfc100.dll 10.0.40219.455 5,579,920 08-Oct-2013 14:27 x64
Mfc100chs.dll 10.0.40219.455 37,016 08-Oct-2013 14:27 x64
Mfc100cht.dll 10.0.40219.455 37,016 08-Oct-2013 14:27 x64
Mfc100deu.dll 10.0.40219.455 65,176 08-Oct-2013 14:27 x64
Mfc100enu.dll 10.0.40219.455 55,960 08-Oct-2013 14:27 x64
Mfc100esn.dll 10.0.40219.455 64,664 08-Oct-2013 14:27 x64
Mfc100fra.dll 10.0.40219.455 65,176 08-Oct-2013 14:27 x64
Mfc100ita.dll 10.0.40219.455 63,128 08-Oct-2013 14:27 x64
Mfc100jpn.dll 10.0.40219.455 44,696 08-Oct-2013 14:27 x64
Mfc100kor.dll 10.0.40219.455 44,184 08-Oct-2013 14:27 x64
Mfc100rus.dll 10.0.40219.455 61,592 08-Oct-2013 14:27 x64
Mfc100u.dll 10.0.40219.455 5,606,032 08-Oct-2013 14:27 x64
Mfcm100.dll 10.0.40219.455 93,840 08-Oct-2013 14:27 x64
Mfcm100u.dll 10.0.40219.455 93,848 08-Oct-2013 14:27 x64
Msvcp100.dll 10.0.40219.455 608,920 08-Oct-2013 14:27 x64
Msvcr100.dll 10.0.40219.455 830,616 08-Oct-2013 14:27 x64
Vcomp100.dll 10.0.40219.455 59,032 08-Oct-2013 14:27 x64

For all supported IA-64–based versions of Visual C++ 2010 SP1 Redistributable Package

File name File version File size Date Time Platform
Atl100.dll 10.0.40219.455 386,192 08-Oct-2013 13:44 IA-64
Msvcp100.dll 10.0.40219.455 967,320 08-Oct-2013 13:44 IA-64
Msvcr100.dll 10.0.40219.455 1,500,824 08-Oct-2013 13:44 IA-64
Vcomp100.dll 10.0.40219.455 144,536 08-Oct-2013 13:44 IA-64

      

      

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.