I see what the problem is.There's a misunderstanding...These are the moves that have been done as you said:
white pawn - c7
black rook can then d6,d7,d8
d6+ then white king to c5
Then the black rook moves to D1 indeed and it's the white's turn to play.Whatever the play will be,the black rook will go on C1! ,not B1;;
So,if the pawn advances to queen there is a fork.If the king moves somewhere else,the pawn gets eaten.So,the white do not win...