[API]
lstrcpynW
lstrlenW

[CODE]
Public Function PeekS_Wide(ByVal ptrChar As Long, Optional ByVal MaxLength As Long = -1&) As String
  Dim xLong1 As Long

  If Not ptrChar = 0& Then
    If MaxLength = -1& Then MaxLength = &HFFFF&
    xLong1 = lstrlenW(ptrChar)
    If xLong1 > MaxLength Then xLong1 = MaxLength
    If IsUnicode Then
      PeekS_Wide = String(xLong1 + 1&, vbNullChar)
      Call lstrcpynW(StrPtr(PeekS_Wide), ptrChar, xLong1 + 1&)
      PeekS_Wide = Left(PeekS_Wide, xLong1)
      Else
      PeekS_Wide = String(xLong1, vbNullChar)
      Call RtlMoveMemory(ByVal StrPtr(PeekS_Wide), ByVal ptrChar, xLong1 * 2&)
      Endif
    End If
  End Function
