public CimSubscriptionDeliveryOptions(CimSubscriptionDeliveryOptions optionsToClone)
		{
			SubscriptionDeliveryOptionsHandle subscriptionDeliveryOptionsHandle = null;
			if (optionsToClone != null)
			{
				MiResult miResult = MiResult.OK; //TODO: SubscriptionDeliveryOptionsMethods.Clone(optionsToClone.SubscriptionDeliveryOptionsHandle, out subscriptionDeliveryOptionsHandle);
				CimException.ThrowIfMiResultFailure(miResult);
				this._subscriptionDeliveryOptionsHandle = subscriptionDeliveryOptionsHandle;
				return;
			}
			else
			{
				throw new ArgumentNullException("optionsToClone");
			}
		}
		protected virtual void Dispose(bool disposing)
		{
			if (!this._disposed)
			{
				if (disposing)
				{
					this._subscriptionDeliveryOptionsHandle.Dispose();
					this._subscriptionDeliveryOptionsHandle = null;
				}
				this._disposed = true;
				return;
			}
			else
			{
				return;
			}
		}
		private void Initialize(CimSubscriptionDeliveryType types)
		{
			SubscriptionDeliveryOptionsHandle subscriptionDeliveryOptionsHandle = null;
			MiResult miResult = ApplicationMethods.NewSubscriptionDeliveryOptions(CimApplication.Handle, (MiSubscriptionDeliveryType)types, out subscriptionDeliveryOptionsHandle);
			CimException.ThrowIfMiResultFailure(miResult);
			this._subscriptionDeliveryOptionsHandle = subscriptionDeliveryOptionsHandle;
		}
Exemple #4
0
		internal static MiResult NewSubscriptionDeliveryOptions (ApplicationHandle handle, MiSubscriptionDeliveryType miSubscriptionDeliveryType, out Microsoft.Management.Infrastructure.Native.SubscriptionDeliveryOptionsHandle subscriptionDeliveryOptionsHandle)
		{
			subscriptionDeliveryOptionsHandle = new SubscriptionDeliveryOptionsHandle(handle.DangerousGetHandle());
			return MiResult.OK;
		}
 internal static MiResult NewSubscriptionDeliveryOptions(ApplicationHandle handle, MiSubscriptionDeliveryType miSubscriptionDeliveryType, out Microsoft.Management.Infrastructure.Native.SubscriptionDeliveryOptionsHandle subscriptionDeliveryOptionsHandle)
 {
     subscriptionDeliveryOptionsHandle = new SubscriptionDeliveryOptionsHandle(handle.DangerousGetHandle());
     return(MiResult.OK);
 }
Exemple #6
0
		internal static unsafe void Subscribe(SessionHandle sessionHandle, MiOperationFlags operationFlags, OperationOptionsHandle operationOptionsHandle, string namespaceName, string queryDialect, string queryExpression, SubscriptionDeliveryOptionsHandle subscriptionDeliveryOptionsHandle, OperationCallbacks operationCallbacks, out OperationHandle operationHandle)
		{
			operationHandle = null;
			/*
			_MI_OperationCallbacks _MIOperationCallback;
			_MI_OperationCallbacks* _MIOperationCallbacksPointer;
			DangerousHandleAccessor dangerousHandleAccessor = null;
			DangerousHandleAccessor dangerousHandleAccessor1 = null;
			DangerousHandleAccessor dangerousHandleAccessor2 = null;
			operationHandle = null;
			DangerousHandleAccessor dangerousHandleAccessor = new DangerousHandleAccessor(sessionHandle);
			try
			{
				dangerousHandleAccessor = dangerousHandleAccessor;
				DangerousHandleAccessor dangerousHandleAccessor1 = new DangerousHandleAccessor(operationOptionsHandle);
				try
				{
					dangerousHandleAccessor1 = dangerousHandleAccessor1;
					_MI_OperationOptions* _MIOperationOptionsPointer = (_MI_OperationOptions*)((void*)dangerousHandleAccessor1.DangerousGetHandle());
					DangerousHandleAccessor dangerousHandleAccessor2 = new DangerousHandleAccessor(subscriptionDeliveryOptionsHandle);
					try
					{
						dangerousHandleAccessor2 = dangerousHandleAccessor2;
						_MI_SubscriptionDeliveryOptions* _MISubscriptionDeliveryOptionsPointer = (_MI_SubscriptionDeliveryOptions*)((void*)dangerousHandleAccessor2.DangerousGetHandle());
						&_MIOperationCallback;
						0;
						bool flag = operationCallbacks.SetMiOperationCallbacks(ref _MIOperationCallback);
						IntPtr hGlobalUni = Marshal.StringToHGlobalUni(namespaceName);
						IntPtr intPtr = hGlobalUni;
						try
						{
							IntPtr hGlobalUni1 = Marshal.StringToHGlobalUni(queryDialect);
							IntPtr intPtr1 = hGlobalUni1;
							try
							{
								IntPtr hGlobalUni2 = Marshal.StringToHGlobalUni(queryExpression);
								IntPtr intPtr2 = hGlobalUni2;
								try
								{
									_MI_Operation* _MIOperationPointer = (_MI_Operation*)<Module>.Microsoft.Management.Infrastructure.Native.MI_CLI_malloc_core((long)24);
									void* voidPointer = (void*)dangerousHandleAccessor.DangerousGetHandle();
									if (flag)
									{
										_MIOperationCallbacksPointer = &_MIOperationCallback;
									}
									else
									{
										_MIOperationCallbacksPointer = (_MI_OperationCallbacks*)((long)0);
									}
									_MI_OperationCallbacks* _MIOperationCallbacksPointer1 = _MIOperationCallbacksPointer;
									<Module>.?A0xf16864c4.MI_Session_Subscribe((_MI_Session*)voidPointer, operationFlags, _MIOperationOptionsPointer, (void*)hGlobalUni, (void*)hGlobalUni1, (void*)hGlobalUni2, _MISubscriptionDeliveryOptionsPointer, _MIOperationCallbacksPointer1, _MIOperationPointer);
									OperationHandle operationHandle = new OperationHandle((IntPtr)_MIOperationPointer, true);
									operationHandle = operationHandle;
									operationHandle.SetOperationCallback((long)_MIOperationCallback);
								}
								finally
								{
									if (intPtr2 != IntPtr.Zero)
									{
										Marshal.FreeHGlobal(intPtr2);
									}
								}
							}
							finally
							{
								if (intPtr1 != IntPtr.Zero)
								{
									Marshal.FreeHGlobal(intPtr1);
								}
							}
						}
						finally
						{
							if (intPtr != IntPtr.Zero)
							{
								Marshal.FreeHGlobal(intPtr);
							}
						}
					}
					dangerousHandleAccessor2.Dispose();
				}
				dangerousHandleAccessor1.Dispose();
			}
			dangerousHandleAccessor.Dispose();
			*/
		}