public void Run(string WsdlUrl, string FileName, string PathName)
 {
     try
     {
         if ((WsdlUrl.Length > 0) && (FileName.Length > 0))
         {
             this.wsdlurl = WsdlUrl;
             this.filename = PathName + FileName;
             this.pathname = PathName;
             if (!System.EnterpriseServices.Internal.NativeMethods.OpenThreadToken(System.EnterpriseServices.Internal.NativeMethods.GetCurrentThread(), 4, true, ref this.threadtoken) && (Marshal.GetLastWin32Error() != 0x3f0))
             {
                 throw new COMException(Resource.FormatString("Err_OpenThreadToken"), Marshal.GetHRForLastWin32Error());
             }
             SafeUserTokenHandle handle = null;
             try
             {
                 handle = new SafeUserTokenHandle(Security.SuspendImpersonation(), true);
                 this.thisthread.Start();
             }
             finally
             {
                 if (handle != null)
                 {
                     Security.ResumeImpersonation(handle.DangerousGetHandle());
                     handle.Dispose();
                 }
             }
             this.thisthread.Join();
             if (this.ExceptionThrown)
             {
                 throw this.SavedException;
             }
         }
     }
     catch (Exception exception)
     {
         if ((exception is NullReferenceException) || (exception is SEHException))
         {
             throw;
         }
         ComSoapPublishError.Report(exception.ToString());
         throw;
     }
 }
Example #2
0
 public void Run(string WsdlUrl, string FileName, string PathName)
 {
     try
     {
         if ((WsdlUrl.Length > 0) && (FileName.Length > 0))
         {
             this.wsdlurl  = WsdlUrl;
             this.filename = PathName + FileName;
             this.pathname = PathName;
             if (!System.EnterpriseServices.Internal.NativeMethods.OpenThreadToken(System.EnterpriseServices.Internal.NativeMethods.GetCurrentThread(), 4, true, ref this.threadtoken) && (Marshal.GetLastWin32Error() != 0x3f0))
             {
                 throw new COMException(Resource.FormatString("Err_OpenThreadToken"), Marshal.GetHRForLastWin32Error());
             }
             SafeUserTokenHandle handle = null;
             try
             {
                 handle = new SafeUserTokenHandle(Security.SuspendImpersonation(), true);
                 this.thisthread.Start();
             }
             finally
             {
                 if (handle != null)
                 {
                     Security.ResumeImpersonation(handle.DangerousGetHandle());
                     handle.Dispose();
                 }
             }
             this.thisthread.Join();
             if (this.ExceptionThrown)
             {
                 throw this.SavedException;
             }
         }
     }
     catch (Exception exception)
     {
         if ((exception is NullReferenceException) || (exception is SEHException))
         {
             throw;
         }
         ComSoapPublishError.Report(exception.ToString());
         throw;
     }
 }
 public GenAssemblyFromWsdl()
 {
     this.thisthread = new Thread(new ThreadStart(this.Generate));
     this.threadtoken = new SafeUserTokenHandle();
 }
 internal static extern bool SetThreadToken(IntPtr Thread, SafeUserTokenHandle Token);
 internal static extern bool OpenThreadToken(IntPtr ThreadHandle, uint DesiredAccess, bool OpenAsSelf, ref SafeUserTokenHandle TokenHandle);
Example #6
0
 internal static extern bool SetThreadToken(IntPtr Thread, SafeUserTokenHandle Token);
Example #7
0
 internal static extern bool OpenThreadToken(IntPtr ThreadHandle, uint DesiredAccess, bool OpenAsSelf, ref SafeUserTokenHandle TokenHandle);
Example #8
0
 public GenAssemblyFromWsdl()
 {
     this.thisthread  = new Thread(new ThreadStart(this.Generate));
     this.threadtoken = new SafeUserTokenHandle();
 }