Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: AV when MADShi accessing UserSession


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Nov 6, 2017 12:29 AM Last Post By: Alexandre Machado
Zane Leo

Posts: 55
Registered: 12/29/09
AV when MADShi accessing UserSession  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 1, 2017 12:59 PM
ntraweb and MAD 4.xx

Code extract below causes an AV when accessing UserSession.

Can anyone please tell me how to access UserSession details with getting an AV

TIA

{$IFDEF madExcept}
 
procedure AddCommandLineHeaderInfo(const exceptIntf: IMEException; var handled: boolean);
begin
 
  exceptIntf.BugReportHeader['Product'] := 'Odyssey';
  exceptIntf.BugReportHeader['Practice Name'] := UserSession.gv_Site.PracticeName;
  exceptIntf.BugReportHeader['User #'] := UserSession.gv_User.UserNumberStr;
  exceptIntf.BugReportHeader['User ID'] := UserSession.gv_User.UserID;
  exceptIntf.BugReportHeader['IP Address'] := UserSession.WebApplication.IP;
end;
 
initialization
 
RegisterExceptionHandler(AddCommandLineHeaderInfo, stDontSync);
 
{$ENDIF}
Chad Hower

Posts: 613
Registered: 3/2/07
Re: AV when MADShi accessing UserSession [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 1, 2017 1:31 PM   in response to: Zane Leo in response to: Zane Leo
Make sure your Madshi version matches the IW version. They "hack" into
IW in a binary way and it breaks from time to time.

We have offered to work with them to put in official hooks for them, but
I've never heard back from them. Maybe its in their spam folder, or
maybe they arent interested. Not sure.

If you have contact with them, please alert them that our offer is still
open so they don't have to hack in in a brittle manner.

On 11/1/2017 4:00 PM, Zane Leo wrote:
ntraweb and MAD 4.xx

Code extract below causes an AV when accessing UserSession.

Can anyone please tell me how to access UserSession details with getting an AV

TIA

{$IFDEF madExcept}
 
procedure AddCommandLineHeaderInfo(const exceptIntf: IMEException; var handled: boolean);
begin
 
   exceptIntf.BugReportHeader['Product'] := 'Odyssey';
   exceptIntf.BugReportHeader['Practice Name'] := UserSession.gv_Site.PracticeName;
   exceptIntf.BugReportHeader['User #'] := UserSession.gv_User.UserNumberStr;
   exceptIntf.BugReportHeader['User ID'] := UserSession.gv_User.UserID;
   exceptIntf.BugReportHeader['IP Address'] := UserSession.WebApplication.IP;
end;
 
initialization
 
RegisterExceptionHandler(AddCommandLineHeaderInfo, stDontSync);
 
{$ENDIF}

Alexandre Machado

Posts: 1,754
Registered: 8/10/13
Re: AV when MADShi accessing UserSession  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 6, 2017 12:28 AM   in response to: Zane Leo in response to: Zane Leo
Zane Leo wrote:
ntraweb and MAD 4.xx

Code extract below causes an AV when accessing UserSession.

Can anyone please tell me how to access UserSession details with getting an AV

TIA

{$IFDEF madExcept}
 
procedure AddCommandLineHeaderInfo(const exceptIntf: IMEException; var handled: boolean);
begin
 
  exceptIntf.BugReportHeader['Product'] := 'Odyssey';
  exceptIntf.BugReportHeader['Practice Name'] := UserSession.gv_Site.PracticeName;
  exceptIntf.BugReportHeader['User #'] := UserSession.gv_User.UserNumberStr;
  exceptIntf.BugReportHeader['User ID'] := UserSession.gv_User.UserID;
  exceptIntf.BugReportHeader['IP Address'] := UserSession.WebApplication.IP;
end;
 
initialization
 
RegisterExceptionHandler(AddCommandLineHeaderInfo, stDontSync);
 
{$ENDIF}

Some exceptions occur before UserSession instance creation for that specific session. This means that, in some very frequent circumstances, you will get an exception but there is no active session for that thread. In that case, UserSession (and also WebApplication) would be both nil. Are you sure this is not the case?
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02