Microsoft KB Archive/897661

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

Article ID: 897661

Article Last Modified on 8/29/2007

-

APPLIES TO

 Microsoft Windows XP Service Pack 2, when used with:  Microsoft Windows XP Professional  Microsoft Windows XP Service Pack 1, when used with:  Microsoft Windows XP for Itanium-based Systems Version 2003

 Microsoft Windows XP Professional </li></ul>

-

<div class="notice_section">

<div class="symptoms_section">

SYMPTOMS
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.

<div class="cause_section">

CAUSE
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.

<div class="resolution_section">

Hotfix information
A supported hotfix is now 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 service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or 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. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

Prerequisites
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 with Service Pack 1, Itanium-based versions
<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

<div class="moreinformation_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:

http://msdn2.microsoft.com/en-us/library/aa379238.aspx

For more information about the STGM flags, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/library/aa380337.aspx

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

Keywords: kbqfe kbhotfixserver kbwinxpsp2fix kbwinxpsp1fix kbbug kbfix kbpubtypekc KB897661

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.