Пример #1
0
 internal static void CheckHandle(this AMSIHandleContext handleContext)
 {
     if (handleContext.IsInvalid)
     {
         throw AMSIException.FailedToInitialize();
     }
 }
Пример #2
0
 internal static void CheckHandle(this AMSIHandleSession handleSession)
 {
     if (handleSession.IsInvalid)
     {
         throw AMSIException.FailedToInitializeSession();
     }
 }
Пример #3
0
 internal static void CheckResult(this int amsiMethodResult, string methodName)
 {
     if (amsiMethodResult == -2147019873)
     {
         throw AMSIException.AMSIInvalidState;
     }
     if (amsiMethodResult != 0)
     {
         throw AMSIException.AMSIFailedToExecute(methodName, new Win32Exception(amsiMethodResult));
     }
 }