In MPBSWorkloadQuery there are a couple of if (IsExiting == TRUE) IsExiting |= (1 << mjfIsExiting); Shouldn't they really be J->Flags |= (1 << mjfIsExiting); As far as i can see J has been set succesfully in all three cases.