This problem I am having is odd, and I’m having a hell of a time figuring it out. I suspect my inexperience with WinDbg is partially to blame.
I have the following struct:
typedef struct _SERIAL_HANDFLOW {
ULONG ControlHandShake;
ULONG FlowReplace;
LONG XonLimit;
LONG XoffLimit;
} SERIAL_HANDFLOW, *PSERIAL_HANFLOW;
As you can probably tell by the name of the members these get set while changing flow control for a serial device.
I am trying to conditionally check ControlHandShake and FlowReplace and WinDbg is showing the value of ControlHandShake as a single integer as opposed to a HEX value. I don’t know the significance of this, but this is the scenario. WinDbg shows ControlHandShake=9, SERIAL_CTS_HANDSHAKE is defined as ((ULONG)0x08) and I have the following conditional:
if ( HandFlow->ControlHandShake & SERIAL_CTS_HANDSHAKE == SERIAL_CTS_HANDSHAKE )
I have tried casting the piss out of this and still haven’t been able to make the conditional TRUE.
In my world 0x09 & 0x08 has always resulted in 0x08. What in the world could be the issue here?