Exemplo n.º 1
0
 public void GetStatus(out IntPtr ppServerStatus)
 {
     lock (this)
     {
         try
         {
             OPCSERVERSTATUS serverStatus = Interop.GetServerStatus(m_server.GetStatus(), m_groups.Count);
             ppServerStatus = Marshal.AllocCoTaskMem(Marshal.SizeOf(serverStatus.GetType()));
             Marshal.StructureToPtr((object)serverStatus, ppServerStatus, fDeleteOld: false);
         }
         catch (Exception e)
         {
             throw CreateException(e);
         }
     }
 }
Exemplo n.º 2
0
 public void GetStatus(out IntPtr ppServerStatus)
 {
     OpcCom.Da.Wrapper.Server server;
     Monitor.Enter(server = this);
     try
     {
         OPCSERVERSTATUS serverStatus = OpcCom.Da.Interop.GetServerStatus(this.m_server.GetStatus(), this.m_groups.Count);
         ppServerStatus = Marshal.AllocCoTaskMem(Marshal.SizeOf(serverStatus.GetType()));
         Marshal.StructureToPtr(serverStatus, ppServerStatus, false);
     }
     catch (Exception exception)
     {
         throw CreateException(exception);
     }
     finally
     {
         Monitor.Exit(server);
     }
 }