#Include once "window9.bi"

Function Read_DataS (ByVal H As HANDLE, ByVal Lenght As Integer) As Byte Ptr Export
  Dim As Byte ptr pMemory = CAllocate(Lenght+1)
  Dim SizeReadWrite As integer
  ReadFile(H ,pMemory,Lenght,Cast(LPDWORD,@SizeReadWrite),0)
  Return pMemory
End Function

Function Read_DataA ( ByVal H As HANDLE, ByVal Lenght As Integer) As Byte ptr Export
  Dim As Byte ptr pMemory = Allocate(Lenght)
  Dim SizeReadWrite As integer
  ReadFile(H ,pMemory,Lenght,Cast(LPDWORD,@SizeReadWrite),0)
  Return pMemory
End Function

Function Read_Data ( ByVal H As HANDLE,ByRef pMemory As Byte ptr ,ByVal Lenght As Integer) As BOOL Export
  Dim SizeReadWrite As integer
  Return ReadFile(H ,pMemory,Lenght,Cast(LPDWORD,@SizeReadWrite),0)  
End Function
