What exactly is being displayed when you use %hu?
Bill Wandel
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]
On Behalf Of xxxxx@yahoo.co.uk
Sent: Monday, November 17, 2008 4:55 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] UINT16 query
Wow, lots of cross fire.
As I said before, I am no further forward. I have swapped bytes around using
RtlUShortByteSwap and someone helpfully posted that DbgPrint and printf are
the same function (yawn). Still I NEED someone to go to the try line and
stop speaking in riddles.
I posted code
DbgPrint (āThe local port is %hi \nā,RtlUShortByteSwap(packet->localPort));
And someone pointed out that i is for signed integers. But noone actually
posted how to correctly DbgPrint a UINT16. That is really all Im asking. The
big endian to little endian byte swapping was a big steer Iām sure.
I remember 2ās complement from years ago, but do we really have to go bit
flipping? Surely to close this thread off someone just needs to dump some
code that will work.
I have recently tried
DbgPrint (āThe local port is %hu \nā,RtlUShortByteSwap(packet->localPort));
I am expecting to see port 80, as it is a browser I am using to generate the
packets.
Thanks
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer