EnableExplicit

Procedure.s FormatMessage(dwFlags.i, lpSource.i, dwMessageId.i)
  Define.s xResult

  dwFlags = FormatMessage_(dwFlags, lpSource, dwMessageId, 0, *ptrTemp, #ptrTempSizeXAW, 0)
  If dwFlags
    xResult = PeekS(*ptrTemp, dwFlags)
    EndIf
  ProcedureReturn xResult
  EndProcedure

; IDE Options = PureBasic 5.21 LTS (Windows - x64)
; CursorPosition = 5
; Folding = -
; EnableUnicode
; EnableXP