Hi All,
I traced the problem to imscan.pas where TWParams.LastError is never reset to zero before rc := DSM_Entry(@AppId, @SourceId, dg, dat, msg, pd); is called.
Please provide a supported fix.
Thanks
Ron
function IETW_DS(var grec: tgrec; dg: TW_UINT32; dat: TW_UINT16; msg: TW_UINT16; pd: TW_MEMREF): boolean;
var
fpExpDisabler: TIEFPExceptionsDisabler;
begin
with grec do
begin
rc := TWRC_FAILURE;
if (@DSM_Entry <> nil) then
begin
try
fpExpDisabler := TIEFPExceptionsDisabler.Create();
try
rc := DSM_Entry(@AppId, @SourceId, dg, dat, msg, pd);
finally
fpExpDisabler.Free();
end;
if (rc <> TWRC_SUCCESS) and (rc <> TWRC_XFERDONE) and (dat <> DAT_EVENT) and assigned(TWParams) then
begin
TWParams.LastError := rc;
TWParams.LastErrorStr := ResultToStr(rc);
LogWrite(Format('IETW_DS : %s', [TWParams.LastErrorStr]));
end;
except
on E:Exception do
begin
LogWrite(Format('IETW_DS : Exception -> %s', [E.Message]));
driverException := true;
end;
end;
end;
result := (rc = TWRC_SUCCESS);
end;
end;