[API]
RtlMoveMemory

[INCLUDE]
Winsock_HTTPReceiver
UIntAddUInt

[CODE]
Public Function Winsock_HTTPReceiver_GetCompleteData(ByRef hReceiver As Long, ByRef xData As String) As Boolean
  Dim xLong1 As Long
  Dim xType1 As Winsock_HTTPReceiverBuffer

  If Not hReceiver = 0& Then
    Call RtlMoveMemory(xType1, ByVal hReceiver, Winsock_HTTPReceiverBufferLen)
    If xType1.hSocket = 0& Then
      If Not xType1.ptrBuffer = 0& Then
        If Not xType1.KnownNextData = 0& Then
          xType1.UsedBuffer = xType1.KnownNextData
          End If
        'xType1.KnownHSize = 0&
        xData = String(xType1.UsedBuffer - xType1.KnownHSize, vbNullChar)
        xLong1 = xType1.ptrBuffer
        UIntAddUInt xLong1, xType1.KnownHSize
        Call RtlMoveMemory(ByVal xData, ByVal xLong1, xType1.UsedBuffer - xType1.KnownHSize)
        Winsock_HTTPReceiver_GetCompleteData = True
        End If
      End If
    End If
  End Function