From c3fb14a4f7c5fd76cc3b73109b5cb5e0137350f4 Mon Sep 17 00:00:00 2001
From: the-Arioch <the_Arioch@nm.ru>
Date: Mon, 2 Sep 2013 16:35:14 +0400
Subject: [PATCH] #6160 fixed obtaining user name and SID

---
 jvcl/run/JvNTEventLog.pas | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/jvcl/run/JvNTEventLog.pas b/jvcl/run/JvNTEventLog.pas
index 8da1b7a..8b8cf0b 100644
--- a/jvcl/run/JvNTEventLog.pas
+++ b/jvcl/run/JvNTEventLog.pas
@@ -27,6 +27,12 @@ unit JvNTEventLog;
 
 {$I jvcl.inc}
 {$I windowsonly.inc}
+{$IfNDef CPU386} According to MSDN Win64 requires va_list usage in FormatMessage, so it would deny this component calls. {$EndIf}
+
+//TODO: Make Win64 compatible ( va_* arguments for FormatMessage(...), Pointers math (same datatypes in Delphi 7 and XE2/x64)
+//TODO: Make Vista+ compatible ( New GUID-based Events API, codename "Crimson", Evt**** WinAPI functions )
+//TODO: Make Win2000/XP compatible: ( Parameters Substitution files loading and parsing )
+// ...someone who cares is welcome to implement.
 
 interface
 
@@ -45,7 +51,7 @@ type
   TJvNTEventLogRecord = class;
 
   {$IFDEF RTL230_UP}
-  [ComponentPlatformsAttribute(pidWin32 or pidWin64)]
+  [ComponentPlatformsAttribute(pidWin32)]
   {$ENDIF RTL230_UP}
   TJvNTEventLog = class(TJvComponent)
   private
@@ -707,7 +713,7 @@ function TJvNTEventLogRecord.GetSID: PSID;
 begin
   Result := nil;
   if PEventLogRecord(FCurrentRecord)^.UserSidLength > 0 then
-    Result := PSID(PChar(FCurrentRecord) + PEventLogRecord(FCurrentRecord)^.UserSidOffset);
+     Cardinal(Result) := Cardinal(FCurrentRecord) + PEventLogRecord(FCurrentRecord)^.UserSidOffset;
 end;
 
 function TJvNTEventLogRecord.GetString(Index: Cardinal): string;
-- 
1.8.3.msysgit.0

