Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
EvtFormatMessage uses wide charcters
Browse files Browse the repository at this point in the history
  • Loading branch information
BinaryFissionGames committed Oct 1, 2021
1 parent 37660a0 commit 6fc089f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions operator/builtin/input/windows/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ func (e *Event) RenderFormatted(buffer Buffer, publisher Publisher) (EventXML, e
}

var bufferUsed uint32
err := evtFormatMessage(publisher.handle, e.handle, 0, 0, 0, EvtFormatMessageXML, buffer.SizeBytes(), buffer.FirstByte(), &bufferUsed)
err := evtFormatMessage(publisher.handle, e.handle, 0, 0, 0, EvtFormatMessageXML, buffer.SizeWide(), buffer.FirstByte(), &bufferUsed)
if err == ErrorInsufficientBuffer {
buffer.UpdateSizeBytes(bufferUsed)
buffer.UpdateSizeWide(bufferUsed)
return e.RenderFormatted(buffer, publisher)
}

if err != nil {
return EventXML{}, fmt.Errorf("syscall to 'EvtFormatMessage' failed: %s", err)
}

bytes, err := buffer.ReadBytes(bufferUsed)
bytes, err := buffer.ReadWideChars(bufferUsed)
if err != nil {
return EventXML{}, fmt.Errorf("failed to read bytes from buffer: %s", err)
}
Expand Down

0 comments on commit 6fc089f

Please sign in to comment.