Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

A handle leak occurs in Windows Server 2008 R2 and Windows 7 when you try to delete a folder containing an executable file


View products that this article applies to.

Symptoms

Consider the following scenario:
  • You have a computer that is running Windows Server 2008 R2 or Windows 7.
  • You have an executable (.EXE) file in a given folder and you launch that application (.EXE) and close it.
  • You attempt to perform a delete operation on the folder containing an executable (.EXE) file, the operation may fail with following error message:


After pressing Yes button on above warning, it would still fail to delete the folder and see following:

↑ Back to the top


Cause

  • This problem occurs because AeLookupSvc (Application Experience) service running in svchost.exe tries to check the compatibility of the given executable (.EXE) file did not close the handle.
  • Because of the leaked handle, the folder can't be deleted unless the system is rebooted.


↑ Back to the top


Workaround

To workaround this issue, reboot the system and post reboot the folder can be deleted without any errors or warnings.

↑ Back to the top


More Information

If procmon log is captured for the delete operation, following entries will be observed in the log:

3:14:38.2896465 AM explorer.exe 460 SetDispositionInformationFile D:\<FolderToDelete> NOT EMPTY Delete: True
3:14:38.2927823 AM explorer.exe 460 SetDispositionInformationFile D:\<FolderToDelete>\<application>.exe SUCCESS Delete: True
3:14:38.2946548 AM explorer.exe 460 SetDispositionInformationFile D:\<FolderToDelete> SUCCESS Delete: True
3:14:40.8315654 AM explorer.exe 460 CreateFile D:\<FolderToDelete> DELETE PENDING Desired Access: Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
3:14:40.8317324 AM explorer.exe 460 CreateFile D:\<FolderToDelete> DELETE PENDING Desired Access: Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a

↑ Back to the top


Keywords: kb, kbprowindows7, kbappcompatibility

↑ Back to the top

Article Info
Article ID : 2686260
Revision : 1
Created on : 1/7/2017
Published on : 3/8/2012
Exists online : False
Views : 407