Note that the szcookiename parameter is not very good for both functions. It is best to set it to null and then manually write it in the content when writing cookies:
"My_cookie_name = my_cookie_value; Path =/; expires = wed, 30-Mar-11 09:00:00 GMT; domain = .csdn.net"
Read the entire data and parse it by yourself.
In addition, internetgetcookieex's dwflag parameter, for IE8, it is best to add internet_cookie_httponly to read the Cookie field value with the HTTPOnly attribute. If the SDK is old and does not have this macro, you can directly extract the two functions from the DLL getprocaddress and define this value as 0x00002000. For IE6 and IE7, If You Want To obtain HTTPOnly cookies, you have to manually read the cookie file and parse it.
Cookie file format:
_ Ntes_nnid // field name
456f74e9863f8f4b1a1e37774b0c464d, 0 // Field Value
163. com // The domain to which the field belongs
3584 // flag
3205176064 // expiration time (low)
37425091 // expiration time (high)
2444768976 // creation time (low level)
30082544 // creation time (high)