Jun 6, 2010 at 7:43 AM

I'm trying to use GetNameByHook from my hooked WriteFile but I get this exception:

System.ApplicationException: Unknown error code (-1073741820):  (Code: 0)
   at EasyHook.NativeAPI.Force(Int32 InErrorCode)
   at EasyHook.NativeAPI.DbgHandleToObjectName(IntPtr InNamedHandle, IntPtr OutNameBuffer, Int32 InBufferSize, Int32& OutRequiredSize)
   at EasyHook.LocalHook.GetNameByHandle(IntPtr InHandle)
   at iomoninject.Main.WriteFile_Hooked(IntPtr hFile, IntPtr lpBuffer, UInt32 nNumberOfBytesToWrite, UInt32& lpNumberOfBytesWritten, IntPtr lpOverlapped)

I'm calling it like this in my hooked function:

String filename = LocalHook.GetNameByHandle(hFile);
The only info I can find about the function is in the docs, which doesn't explain much. Am I using it incorrectly? Is there a working example of how to use it?