|
public class LockCheck { [DllImport("SentryDLL5.dll")] extern static int win_xread_nt95(UInt16[] rbuff, byte[] pass);
public static int LOCKCHECKFLAG = 1; // set to 1 if hardware lock to be imposed else 0 public string DisplayMessage = "Unauthorized Usage. Please Contact PALADION. Email : info@paladion.net"; public string PreviousSession = "userlogin";
public LockCheck() { // // TODO: Add constructor logic here // }
public int AuthenticateUser() { int i = 0; int stat =0; UInt16[] rbuff = new UInt16[12]; UInt16[] signature = new UInt16[12]; byte[] pasw = new byte[4];
pasw = (byte[])HttpContext.Current.Session["Pasw"]; rbuff = (UInt16[])HttpContext.Current.Session["Key"]; signature = (UInt16[])HttpContext.Current.Session["Signature"]; stat = win_xread_nt95(rbuff, pasw); switch (stat) { case 0: { //check whether signature is correct one or not for (i = 0; i <= 11; i++) { if (rbuff[i].CompareTo(signature[i]) != 0) { stat = -11; break; } } } break; } return stat; } }
Error stack --
Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source Error:
Line 66: signature = (UInt16[])HttpContext.Current.Session["Signature"]; Line 67: Line 68: stat = win_xread_nt95(rbuff, pasw); Line 69: switch (stat) Line 70: {
Source File: D:\Projects\vaod\trunk\code\BussinessLayer\LockCheck.cs Line: 68
Stack Trace:
[AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.] BussinessLayer.LockCheck.win_xread_nt95(UInt16[] rbuff, Byte[] pass) +0 BussinessLayer.LockCheck.AuthenticateUser() in D:\Projects\vaod\trunk\code\BussinessLayer\LockCheck.cs:68 _Default.Page_Load(Object sender, EventArgs e) +63 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
|