Symptoms

Consider the following scenario:

  • You create an application in Microsoft Visual C++ 2010.

  • You use the fopen() function in the application to open a file, and the function uses the r+, a, or a+ access mode.

  • You run the application, and the applicationtries to open a file that is equal to or larger than 4 gigabytes (GB).


In this scenario, the file does not open, or the following error is returned:  

EINVAL (Invalid argument)

Cause

This issue occurs because of the way that the fopen() function seeks to the ends of files after it opens the files for appending. The fopen() function internally uses the _lseek() function to perform this action. However, the _lseek() function cannot handle files that are equal to or larger than 4 GB.

Resolution

This hotfix changes the behavior of the fopen() family of functions. After you apply this hotfix, the fopen() function internally uses a function that can seek beyond the 4 GB limit without returning an error. Specifically, the fopen() function uses the _lseeki64() function instead of the _lseek() function.

Hotfix information

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

To resolve this problem, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft website:

http://support.microsoft.com/contactus/?ws=supportNote In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Prerequisites

To apply this hotfix, you must have Microsoft Visual Studio 2010 Service Pack 1 (SP1) installed.

Restart requirement

You may have to restart the computer after you install this hotfix if the affected files are being used.

Hotfix replacement information

This hotfix does not replace a previously released hotfix.

File information



The global version of this 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 versions of Microsoft Visual Studio 2010 SP1

File name

File version

File size

Date

Time

Platform

Mfcm100.dll

10.0.40219.362

82,696

15-Nov-2011

22:32

x86

Mfcm100d.dll

10.0.40219.362

104,720

16-Nov-2011

00:29

x86

Mfcm100u.dll

10.0.40219.362

82,704

15-Nov-2011

22:32

x86

Mfcm100ud.dll

10.0.40219.362

106,256

16-Nov-2011

00:29

x86

Mfcm100.dll

10.0.40219.362

93,960

15-Nov-2011

21:54

x64

Mfcm100d.dll

10.0.40219.362

120,592

15-Nov-2011

23:56

x64

Mfcm100u.dll

10.0.40219.362

93,968

15-Nov-2011

21:54

x64

Mfcm100ud.dll

10.0.40219.362

122,128

15-Nov-2011

23:56

x64

Mfcmifc80.dll

10.0.40219.362

14,096

16-Nov-2011

21:26

x86


More Information

For more information about another hotfix package that applies to Microsoft Visual C++ 2010 Service Pack 1 (SP1) Redistributable Package, click the following article number to view the article in the Microsoft Knowledge Base: 

2606060 FIX: You cannot open a file that is at least 4 GB to append or to write data by using an application that uses the Visual C++ 2010 Redistributable Package


For more information about the fopen() and _wfopen() functions, visit the following MSDN website:

General information about the fopen() and _wfopen() functions

Status

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

Need more help?

Expand your skills

EXPLORE TRAINING >

Get new features first

JOIN MICROSOFT INSIDERS >

Was this information helpful?

What affected your experience?

Thank you for your feedback!

×