Hurst,
I'm sorry that I'm going to have to disagree with you, but there is no
inconsistency between reporting this error in debug mode, and not in
release mode. This is because there are no pointer sanity checks
performed in release mode (for performance reasons). And it is precisely
these user protection checks that are being thrown off when you pass
the pointer to a 2-byte integer.
In one of the other threads for this issue, some of us had already posted a
way in which you can make the function call without throwing off the
user protection. Here it is:
LogEnetData (fp, Message.MsgSize, (unsigned char *)&Message + sizeof (Message.MsgSize));
If you pass the pointer this way, you don't have to worry about disabling user protection around this code.
Hope this helps
Luis