Numeric values of WinHTTP constants (eg. WINHTTP_NO_CLIENT_CERT_CONTEXT)

218 Views Asked by At

I need to set this property for a WinHttp request...

BOOL fRet = WinHttpSetOption(hRequest,
                             WINHTTP_OPTION_CLIENT_CERT_CONTEXT,
                             WINHTTP_NO_CLIENT_CERT_CONTEXT,
                             0);

But from within an old VB application. I can access the method but can't use the constants.

I can use this to access the method from VB...

Declare Function WinHttpSetOption Lib "winhttp.dll" _ 
(ByVal hInternet As Variant, ByVal dwOption As Integer, ByVal lpBuffer As Byte, ByVal dwBufferLength As Integer) _ 
As Boolean

And then call it like so...

Call WinHttpSetOption(hRequest, WINHTTP_OPTION_CLIENT_CERT_CONTEXT, WINHTTP_NO_CLIENT_CERT_CONTEXT, 0);

But have to replace the constants WINHTTP_OPTION_CLIENT_CERT_CONTEXT and WINHTTP_NO_CLIENT_CERT_CONTEXT with the correct numbers, or figure out how to import them.

After I long google search, I think WINHTTP_OPTION_CLIENT_CERT_CONTEXT is 47 but can't find WINHTTP_NO_CLIENT_CERT_CONTEXT anywhere.

Many thanks

0

There are 0 best solutions below