Be ware of Microsoft Bug in the VirtualCE File System Driver for virtual storage card emulation
Dont know a way to notify M$, so post here :)
Here is the bug : Microsoft device driver for implementing emulator virtual sharer (vcsfsd.dll –VirtualCEFileSystemDriver) has the following bug for its implementation of
DWORDSetFilePointer( HANDLEhFile,
LONGlDistanceToMove,
PLONGlpDistanceToMoveHigh,
DWORDdwMoveMethod);
It is incorrect when lDistanceToMove is negative and dwMoveMethod isFILE_END. It will interpret the minus sign incorrectly. (you can verify it easily by using this API) . Further digging reveals thatit calculates current file pointer position by using code similar to:(for FILE_END case)
CurrentPosition = FileSize – lDistanceToMove.
You see,it is wrong !!!

