EmulateFindHandles -app compatibility issue
Hello!I believe I've found an issue in Application Compatibility Layer on Windows 2008.There is a compatibility fix called "EmulateFindHandles", it is set for example for any InstallShield programs (pre-12).This fix actually sets hooks for FindFirstFileA, FindClose and RemoveDirectory kernel32 functions in aclayer.dll.It ensures that all find handles closed when you call RemoveDirectory.But!!!Microsoft forgot about FindFirstFileW function. I have custom dll which I load in InstallShield ikernel.exe and I use unicode version of FindFirstFile. The problem is that find handle is not getting closed when I call FindClose. Looks like this EmulateFindHandles fix internally creates map of handles opened by FindFirstFileA and simply makes lookup in FindClose.Of course, find handle opened by FindFirstFileW is not in this map and I'm having handle leak in my program.The only workaround that I found now is to get real pointer for FindClose in kernel32.dll (using ntdll.LdrGetProcedureAddress, standard GetProcAddress is also hooked in app compatibility layer and returns pointer to FindClose in aclayer.dll).
October 4th, 2008 9:20am

Hello, I did some research on this but didn't find any related information. I would suggest that you post this in our MSDN forum. All codes in the application may need to be checked to narrow down the root cause, whether any codes are not proper and lock the handle or the problem is caused by the function. I am sorry to say that I have little knowledge on codes and we may not be the best resource to check these codes in this forum. http://forums.microsoft.com/msdn If the problem is related to the function, you can contact our Microsoft Customer Service and Support (CSS) to confirm if this is a bug. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, please go to the following address on the World Wide Web: http://support.microsoft.com/directory/overview.asp We are very appreciate for your effort and thank you for your cooperation. Best regards, Chang Yin
Free Windows Admin Tool Kit Click here and download it now
October 7th, 2008 1:38pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics