I know this is an old post. But I stumbled across it while searching for the same problem. I noticed a post in here from a couple weeks ago.
Anyway ... none of the fixes posted in this thread worked for me. So I thought I would share what I found and what worked in my case!!
I was getting the same error as in the opening post. Tried all the fixes ... to no avail.
In the device manager, show hidden devices, the HTTP device under non-plug and play drivers, had an exclamation on it. And would not start. It had a code 24 as well.
After digging through the registry and comparing the device manager with a working windows computer, I found that the AFD service was missing. Ancillary Function Driver for Winsock was completely missing. This should also show up in the device manager, show
hidden devices, and look under non-plug and play drivers.
The afd.sys driver was also missing from the windows/system32/drivers folder.
So I copied the driver over from a working computer. I also exported the reg keys for the AFD service and imported them into the affected computer. Did a restart, and bam .... back to working internet!!
No idea if this might be your problem as well. But it was easier than a wipe and reinstall of the os. The AFD registry keys can be found under HKLM\SYSTEM\CurrentControlSet\services ... there should be an AFD listed. And also under HKLM\SYSTEM\CurrentControlSet\Enum\Root
... there should be a LEGACY_AFD key in there.
Copy those over, along with the driver file .... IF YOURS ARE MISSING. Otherwise, this isn't your problem. Also check to make sure HTTP is there. In my case, it was, it just wouldn't start.
Just wanted to share what fixed my issue .... :) I hope this helps others.