Follow these steps:
1 ) set up your ad-hoc network (both machines... make sure that everything is the same for both machines, except the ip address, which of course needs to be different)
Code:
iwconfig *thX mode ad-hoc
iwconfig *thX essid MyNetwork
iwconfig *thX enc aabbc-aabbc
ifconfig *thX 192.168.1.X
2 ) enable ip forwarding
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
3 ) establish ip masquerading (this is on the desktop)
Code:
iptables -t nat -A POSTROUTING -j MASQUERADE
4 ) setup the default gateway (this is on the laptop, X.X.X.X is the ip of the desktop on your ad-hoc network)
Code:
route add default gw X.X.X.X
Hope this helps!
[edit] I just re-read your post and realized you have windows hosting linux, not the other way around. That last line about route add gw is wrong now -- and the first line also no longer applies to the laptop... Set up the windows wireless with the same settings as the desktop for ad-hoc, and then fire up cmd.exe:
Code:
route add 0.0.0.0 mask 0.0.0.0 X.X.X.X
Subbing in the desktop's ip, of course. This line I haven't tested, but it follows microsoft's documentation for their route command setting up a default gateway, and should work.