let us use a,b,c,d,e,f,g,h and i be numbers as the following configuration:
a----b----c
d----e----f
g----h----i
we know that S=a+c+g+h=d+b+h+f=a+b+d+e=b+c+e+f=d+e+g+h=e+f+h+i.
45=e+ (a+c+g+i) + (b+d+h+f) =>45=e+2S; ----(1)
2S=(a+d+b+e) + (e+h+i+f) = 2e + (a+i) + (d+b+h+f)=(a+i) + 2e + S =>a+i+2e=S;
similarly c+g + 2e=S; a+i + 2e = S; => (c+g+a+i) +4e= 2S => 4e=S; ---(2)
from (1) and (2), we have e=5 and S =20.
Now 5+9=14, in the remaining numbers only 2+4=6, so 9 must be on the corner and surrounded by 2 and 4. Due to the symmetry, we can have:
a----b----c
d----5----4
g----2----9
in the remaining numbers, only 3+8 =11, and only 6+7=13, so 5, 4, 3, and 8 are in the same small square. And 6, 7, 2, and 5 are in another small square. It is easy to see we must have a=1 across the diagnal from 9. Only 6+8=14, so 6, 8, 1,and 5 are in the same small square.
The only solution would be the following:
1----8----3
6----5----4
7----2----9