Memory usage is more when you use a custom implementation of the ILockBytes interface to perform file operations in Windows XP Professional

This article has been archived. It is offered "as is" and will no longer be updated.
To open files so that you can perform file operations, you use a custom implementation of the ILockBytes interface in a program that runs in Microsoft Windows XP Professional. After you do this, memory usage is more for files that are opened in read-only mode than for the files that are opened in read-and-write mode. Additionally, you may be able to open more files in read-and-write mode than in read-only mode.

Note If the STGM_NOSNAPSHOT flag is used in read-only mode, memory usage may be the same for both read-only mode operations and read-and-write mode operations.
This problem occurs because a temporary scratch file is created to save modifications that are made to the file. This temporary file is mapped to memory until changes are saved in the original file.

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. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

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, contact 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 Web site: 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.


There are no prerequisites.

Restart requirement

You do not have to restart the computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace any other hotfixes.

File information

The English 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 tool in Control Panel.
Windows XP Professional, x86-based versions
File nameFile versionFile sizeDateTimePlatformSP requirementService branch
Windows XP Professional with Service Pack 1, Itanium-based versions
File nameFile versionFile sizeDateTimePlatformSP requirementService branch

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
More information
The custom ILockBytes interface turns off memory mapping of the original file and of the snapshot file. But the scratch file is always mapped to memory unless there is insufficient memory. You cannot turn off this option except by using the STGM_NOSCRATCH flag. This flag puts the temporary changes in the free space of the snapshot file and does not create a scratch file.

When you use the STGM_READ flag, changes are not committed to the file. The scratch changes are thrown away when a file operation is finished.

For more information about the ILockBytes interface, visit the following Microsoft Web site: For more information about the STGM flags, visit the following Microsoft Web site: For more information, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

Article ID: 897661 - Last Review: 01/15/2015 14:54:41 - Revision: 4.0

  • kbnosurvey kbarchive kbautohotfix kbqfe kbhotfixserver kbwinxpsp2fix kbwinxpsp1fix kbbug kbfix KB897661