[API]
LocalAlloc
LocalFree
RtlMoveMemory

[CODE]
Public Function LocalAllocFromString(ByVal xChar1 As String) As Long ', Optional ByVal FixedPos As Boolean = True) As Long
  Dim xLong1 As Long
  
  xChar1 = xChar1 & vbNullChar
  xLong1 = Len(xChar1) * (1& - CLng(IsUnicode))
  
  LocalAllocFromString = LocalAlloc(0&, xLong1)
  If Not LocalAllocFromString = 0& Then
    If IsUnicode Then
      Call RtlMoveMemory(ByVal LocalAllocFromString, ByVal StrPtr(xChar1), xLong1)
      Else
      Call RtlMoveMemory(ByVal LocalAllocFromString, ByVal xChar1, xLong1)
      End If
    End If
  End Function
