david-maw / StreamSSL

The StreamSSL sample described in CodeProject
Other
48 stars 24 forks source link

Error in SSLClient.cpp when compiling StreamSSL-2.1.0 with Visual Studio 2019 16.8.0 Preview 5.0 #86

Closed Andreas-Schniertshauer closed 4 years ago

Andreas-Schniertshauer commented 4 years ago

I get the following error when compiling StreamSSL-2.1.0 with Visual Studio 2019 16.8.0 Preview 5.0: StreamSSL-2.1.0\SSLClient\SSLClient.cpp(454): error C2102: '&' requires l-value

because of &m_ClientCreds.get() in InitializeSecurityContext function call.

` scRet = g_pSSPI->InitializeSecurityContext(

pragma warning (suppress: 4238)

    &m_ClientCreds.get(),
    nullptr,
    ServerName,
    dwSSPIFlags,
    0,
    SECURITY_NATIVE_DREP,
    nullptr,
    0,
    m_hContext.set(),
    &OutBuffer,
    &dwSSPIFlags,
    &tsExpiry);`

This can be resolved: ` auto credhandle = m_ClientCreds.get(); scRet = g_pSSPI->InitializeSecurityContext(

pragma warning (suppress: 4238)

    &credhandle ,
            ...

`

david-maw commented 4 years ago

Thanks, I resolved it by using m_ClientCreds.getunsaferef() instead of &m_ClientCreds.get() which more clearly shows what's happening and eliminates the need to suppress the warning (probably should have been this all along). I pushed the change to the "master" branch.

Andreas-Schniertshauer commented 3 years ago

Is there a new release planned where this problem is fixed?

david-maw commented 3 years ago

It's sufficiently minor that I hadn't planned to, just checked the change into the master branch and left it at that. What aspect of a new release were you interested in, a new version number label, updates to CodeProject, something else. I don't particularly object to making a new release, just hadn't planned to until I had some more significant changes.

Andreas-Schniertshauer commented 3 years ago

I would be interested in a 2.1.1, but I saw on the Codeproject page https://www.codeproject.com/Articles/1000189/A-Working-TCP-Client-and-Server-With-SSL that there is already a 2.1.1 but this seems to be a mistake? See History, also the order of the last entry seems to be wrong.