[70321 Closed] TROHttpAPIContext x64 /bug/

Seems to me there is a bug in TROHttpAPIContext.SendResponse, compiled in 64bits.

Server can start, but before it can respond, the exception “The parameter is incorrect” raises on HttpCheck(HttpAPI.SendHttpResponse(fOwner.fReqQueueHandle,fRequestId,0,@lResponse,nil,pBytesSent)); line.

In this thread, http://technet.microsoft.com/eS-es/library/aa364499.aspx, there is some interesting post: “Even though the documentation doesn’t mention this, all of the pointers inside of both HTTP_RESPONSE and HTTP_LOG_FIELDS_DATA need to be pointer aligned - that is, aligned to 4 byte boundaries on 32bit machines and aligned to 8 byte boundaries on 64bit machines. Failure to due so will cause a return value of ERROR_INVALID_PARAMETER.”

Is this the point ?

Anyway, looking forward for quick fix!

Thank you.

Thanks, logged as bugs://70321: TROHttpAPIContext x64 /bug/

bugs://70321 got closed as unknown for release DA8.2

update declaration in uROHttpApi.pas as:

  {$IFDEF CPU64}
  THTTP_DATA_CHUNK = record
    case DataChunkType: THTTP_DATA_CHUNK_TYPE of
      HttpDataChunkFromMemory:(
        pBuffer: PVOID;
        BufferLength: ULONG;
      );
      HttpDataChunkFromFileHandle:(
        ByteRange: THTTP_BYTE_RANGE;
        FileHandle: THandle;
      );
      HttpDataChunkFromFragmentCache:(
        FragmentNameLength: USHORT;
        pFragmentName: PCWSTR;
      );
      HttpDataChunkFromFragmentCacheEx:(
        ByteRangeEx: THTTP_BYTE_RANGE;
        pFragmentNameEx: PCWSTR;
      );
  end;
  {$ELSE}
  THTTP_DATA_CHUNK = packed record //packed and extra members to correct alignment
    case DataChunkType: THTTP_DATA_CHUNK_TYPE of
      HttpDataChunkFromMemory:(
        xxAlign1: PVOID;
        pBuffer: PVOID;
        BufferLength: ULONG;
      );
      HttpDataChunkFromFileHandle:(
        xxAlign2: PVOID;
        ByteRange: THTTP_BYTE_RANGE;
        FileHandle: THandle;
        xxAlign3: PVOID;
      );
      HttpDataChunkFromFragmentCache:(
        xxAlign4: PVOID;
        FragmentNameLength: USHORT;
        xxAlign5: USHORT;
        pFragmentName: PCWSTR;
      );
      HttpDataChunkFromFragmentCacheEx:(
        xxAlign6: PVOID;
        ByteRangeEx: THTTP_BYTE_RANGE;
        pFragmentNameEx: PCWSTR;
      );
  end;
  {$ENDIF}

Excellent, it works!