MrMilney wrote:
Thanks for the find, it was interesting reading. However, it didn't really get to the heart of my particular problem.
Even though I used *.foo in my example above, that wasn't what I actually changed the extension to on the computer in my classroom (the file was named "directions to grandmas.doc" which I then changed to "directions to grandmas.house" trying to be clever.
As we all know, Word still opened the file. So I threw the file on my thumb drive and brought it home to examine. When I double-click it at home, it still opened in Word even though the creation and renaming happened on a computer miles away. Just to be safe,
I check the registry on my computer and there is no entry for *.house files (or *.foo for that matter) so it isn't the case that either Word or Windows installed a handler for the new file type when I changed the extension.
OK, I didn't look far enough into the trace - I stopped when I saw the FileExts registry lookup, and when I checked my registry, it had Word setup as the handler for it. I then searched MS and found the document that I linked.
Upon further examination (10 mins), I see that Explorer does open the file reading in the first 512 bytes. I'm certain .foo wasn't registered beforehand, in which case something set it, possibly the code that follows the file contents examination. Here's
an excerpt:
Process Process ID Win32 API Parameters Return Value Status GetLastError
explorer 0x5B0 GetFileAttributesW lpFileName:0xEBA1C "D:\My Documents\test.foo" 0x20 SUCCESS 0
explorer 0x5B0 HeapAlloc hHeap:0x90000, dwFlags:0x8, dwBytes:0x30 0x1B20518 SUCCESS 0
explorer 0x5B0 HeapFree hHeap:0x90000, dwFlags:0x0, lpMem:0x1B20518 0x17BF01 SUCCESS 0
explorer 0x5B0 CreateFileW lpFileName:0xEBA1C "D:\My Documents\test.foo",
dwDesiredAccess:0x80000100 = GENERIC_READ | SPECIFIC_RIGHTS_ALL,
dwShareMode:0x3 = FILE_SHARE_WRITE | FILE_SHARE_READ,
lpSecurityAttributes:0x0,
dwCreationDisposition:0x3 = OPEN_EXISTING,
dwFlagsAndAttributes:0x0,
hTemplateFile:0x0 0x4FC SUCCESS 0
explorer 0x5B0 HeapAlloc hHeap:0x90000, dwFlags:0x8, dwBytes:0x30 0x1B20518 SUCCESS 0
explorer 0x5B0 HeapFree hHeap:0x90000, dwFlags:0x0, lpMem:0x1B20518 0x17BF01 SUCCESS 0
explorer 0x5B0 SetFilePointer hFile:0x4FC,
lDistanceToMove:0x0,
lpDistanceToMoveHigh:0x0,
dwMoveMethod:0x0 0x0 SUCCESS 0
explorer 0x5B0 ReadFile hFile:0x4FC, lpBuffer:0x12CEB14 <D0CF11E0A1B11AE100000000000000>,
nNumberOfBytesToRead:0x200,
lpNumberOfBytesRead:0x12CEB08,
lpOverlapped:0x0 0x1 SUCCESS 0
Geez that was a PITA for try and format !!
If your interested, I can give a copy of the trace to you. You'll need to download [APIMON], though.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.