There are lots of ways to deal with these situations, and everyone is going to pick what they are most comfortable with. I prefer dealing with situation A by pinning their grabbing arm to my chest with one hand and slamming my other forearm/hammerfist in to their neck/jaw. That keeps my arm between their punch and my head, and basically puts me in a cross-face position. Situation B is more chaotic, but usually the windmilling punches aren't all that fast, and they are pretty committed, so you can almost pick one arm to deal with. If they're coming more at a downward angle, like somebody swimming, it's easiest just to slip to the outside and counter strike. If they're coming in more like haymakers, I usually go for throws.