Q:

(here) Do these two sentences mean the same? 

It's six o'clock.  I was expecting him here at five forty-five. 
It's six o'clock.  I was expecting him to be here at five forty-five. 

What I'm confused is the no.1 sentence that it could mean：

I was here expecting him at five forty-five. 

A:

Your are correct that the first sentence is ambiguous.  Both interpretations are valid. 
In practice, though, both interpretations mean the same thing: if you were here expecting him, it's because you expected him to be here, and you knew whether he was here where you expected him to be because you were here.  Youcould have been elsewhere, expecting him to be here, but that's unusual enough that you'd be relying on context to make it plain

