views:

28

answers:

1

I'm reading in my program some files from system32 folder; and one of these files (C:\Windows\System32\gdi32.dll) demonstrates a very strange behavior. When I'm reading it from my program, it shows size of 310'784 bytes; and when I view it's size from Explorer, it shows size of 404'480 bytes. How could that be?

+3  A: 

The most likely explanation is that your program is 32-bit and Explorer is 64-bit. When a 32-bit program opens files in C:\Windows\System32 (which contains 64-bit DLLs), it's actually redirected to C:\Windows\SysWOW64 (which contains 32-bit DLLs). The size difference you're seeing is the difference between the C:\Windows\SysWOW64\gdi32.dll and C:\Windows\System32\gdi32.dll files.

For more information, see KB article 896456.

Bradley Grainger
Yeah, you're correct. However, my x32 file manager shows correct file size (the same as Explorer). How can it do that?
skevar7
Perhaps it calls Wow64DisableWow64FsRedirection (http://msdn.microsoft.com/en-us/library/aa365743.aspx).
Bradley Grainger