Skip to content

TWinHTTP Thread safe issue in filling OSVersionInfo #442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
myonlylonely opened this issue Dec 15, 2022 · 1 comment
Closed

TWinHTTP Thread safe issue in filling OSVersionInfo #442

myonlylonely opened this issue Dec 15, 2022 · 1 comment

Comments

@myonlylonely
Copy link

Filling OSVersionInfo is not thread safe, it shoud be moved into the initialization part. It can cause the OpenType and the TWinHTTP.InternalGetProtocols check failed.

procedure TWinHTTP.InternalConnect(ConnectionTimeOut,SendTimeout,ReceiveTimeout: DWORD);
//...
begin
  if OSVersionInfo.dwOSVersionInfoSize=0 then begin // API call once
    OSVersionInfo.dwOSVersionInfoSize := sizeof(OSVersionInfo);
    GetVersionEx(OSVersionInfo);
  end;
//...
@synopse
Copy link
Owner

synopse commented Dec 15, 2022

BTW mORMot 2 is not affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants