added extra flag detection (mainly not applicable in Windows ring3)
Fixed a minor logical error or two and added support for Size field