HttpApi not work
Original Reporter info from Mantis: taufikrh @taufikrh
-
Reporter name: Taufik Rahmad Hidayanto
Original Reporter info from Mantis: taufikrh @taufikrh
- Reporter name: Taufik Rahmad Hidayanto
Description:
HttpApi.pp
VER3_0 no longer available in FPC 3.2.0
{$IFDEF VER3_0}
type
PWSTR = PWideChar;
{$MACRO ON}
{$DEFINE winapi:=stdcall}
{$ENDIF}
Steps to reproduce:
uses
Windows, Winsock2, HttpApi;
var
ret: ULONG;
begin
ret := HttpApi.HttpInitialize(HTTPAPI_VERSION_2, HTTP_INITIALIZE_SERVER, nil);
if ret <> NO_ERROR then
WriteLn('HttpInitialize Error ', ret); // error 87 (ERROR_INVALID_PARAMETER)
WriteLn('HttpApi.SOCKADDR_STORAGE: ', SizeOf(HttpApi.SOCKADDR_STORAGE)); // output 136
// SOCKADDR_STORAGE already defined in Winsock2 (the correct size)
WriteLn('Winsock2.SOCKADDR_STORAGE: ', SizeOf(Winsock2.SOCKADDR_STORAGE)); // output 128
Additional information:
Attachment contain the latest Http Api (Windows SDK 10.0.19041.0) and test size of record (win32 and win64)