internal void Cancel() { if (null != stub) { lock (this) { if (null != stub) { int status = services.CancelAsyncCall_(stub); // Release prior to throwing an exception. ReleaseStub(); if (status < 0) { if ((status & 0xfffff000) == 0x80041000) { ManagementException.ThrowWithExtendedInfo((ManagementStatus)status); } else { Marshal.ThrowExceptionForHR(status); } } } } } }
internal void Cancel() { if (null != stub) { #pragma warning disable CA2002 lock (this) #pragma warning restore CA2002 { if (null != stub) { int status = services.CancelAsyncCall_(stub); // Release prior to throwing an exception. ReleaseStub(); if (status < 0) { if ((status & 0xfffff000) == 0x80041000) { ManagementException.ThrowWithExtendedInfo((ManagementStatus)status); } else { Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); } } } } } }
internal void Cancel() { int status = (int)ManagementStatus.NoError; try { status = services.CancelAsyncCall_(stub); } catch (Exception e) { ManagementException.ThrowWithExtendedInfo(e); } if ((status & 0xfffff000) == 0x80041000) { ManagementException.ThrowWithExtendedInfo((ManagementStatus)status); } else if ((status & 0x80000000) != 0) { Marshal.ThrowExceptionForHR(status); } }