WinHttpCrackUrl function gets wrong nScheme
See the question and my original answer on StackOverflowINTERNET_SCHEME_HTTPS
value is in fact 2 as defined in winhttp.h.
Your code is probably using wininet.h value which is 4.
Make sure you don't mix both, both WinINet and WinHTTP serve the same purpose but are quite different: WinINet vs. WinHTTP