Well, winning tic tac toe is (obviously) a matter of getting 3 stones in either one vertical, horizontal or diagonal line, right? Supposing the tic tac toe field is 3x3 there should be exactly 8 possible ways of achieving this, 3 vertical, 3 horizontal, 2 diagonal. For the sake of simplicity and through sacrificing some efficiency you could simply save those 8 combinations, and compare it with the player's draws. If the pattern the player klicked contains such a row, he wins. Same for ai. If none, no-one wins.
Would be my first idea so far, haven't played it in a while yet, might think about something more later.