It could be a "firewall" problem. When connected in Infrastructure mode, the WiFi adapters will be getting their IP addresses by DHCP from the router, probably in a 192.168.x.x subnet. However, when you change to Ad Hoc mode, the adapters will communicate directly with one another and there will be no DHCP server to allocate their IP addresses. Normally, Windows would default to allocating APIPA (Automatic Private IP Addressing) addresses in the 169.254.x.x range. If your firewall software has been configured to allow local network traffic with APIPA range addresses, but not 192.168.x.x ranges, this could cause the situation you describe.