public MessageHandler(IProfilerCommunication profilerCommunication, IMarshalWrapper marshalWrapper, IMemoryManager memoryManager, IModuleLocator moduleLocator)
 {
     _profilerCommunication = profilerCommunication;
     _marshalWrapper = marshalWrapper;
     _memoryManager = memoryManager;
     _moduleLocator = moduleLocator;
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestUsbDeviceWatcher"/> class.
 /// </summary>
 /// <param name="marshalWrapper">
 /// The marshal Wrapper.
 /// </param>
 /// <param name="usbDeviceNotificationFactory">
 /// The usb Device Notification Factory.
 /// </param>
 /// <param name="usbForm">
 /// The usb form.
 /// </param>
 /// <param name="guid">
 /// The guid.
 /// </param>
 public TestUsbDeviceWatcher(
     IMarshalWrapper marshalWrapper,
     IUsbDeviceNotificationFactory usbDeviceNotificationFactory,
     IUsbForm usbForm,
     Guid guid)
     : base(marshalWrapper, usbDeviceNotificationFactory, usbForm, guid)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UsbDeviceWatcher"/> class.
 /// </summary>
 /// <param name="marshalWrapper">
 /// The marshal Wrapper.
 /// </param>
 /// <param name="usbDeviceNotificationFactory">
 /// The usb device notification factory.
 /// </param>
 /// <param name="usbForm">
 /// The usb form.
 /// </param>
 /// <param name="guid">
 /// The guid.
 /// </param>
 public UsbDeviceWatcher(IMarshalWrapper marshalWrapper, IUsbDeviceNotificationFactory usbDeviceNotificationFactory, IUsbForm usbForm, Guid guid)
 {
     _marshalWrapper = marshalWrapper;
     _usbDeviceNotificationFactory = usbDeviceNotificationFactory;
     _usbForm   = usbForm;
     DeviceGuid = guid;
     RegisteredCreatedHandle = null;
     _observable             = ConnectableObservable().RefCount();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UsbDeviceWatcher"/> class.
 /// </summary>
 /// <param name="marshalWrapper">
 /// The marshal Wrapper.
 /// </param>
 /// <param name="usbDeviceNotificationFactory">
 /// The usb device notification factory.
 /// </param>
 /// <param name="usbForm">
 /// The usb form.
 /// </param>
 /// <param name="guid">
 /// The guid.
 /// </param>
 public UsbDeviceWatcher(IMarshalWrapper marshalWrapper, IUsbDeviceNotificationFactory usbDeviceNotificationFactory, IUsbForm usbForm, Guid guid)
 {
     _marshalWrapper = marshalWrapper;
     _usbDeviceNotificationFactory = usbDeviceNotificationFactory;
     _usbForm = usbForm;
     DeviceGuid = guid;
     RegisteredCreatedHandle = null;
     _observable = ConnectableObservable().RefCount();
 }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DeviceNotifications"/> class.
 /// </summary>
 /// <param name="broadcastDeviceInterfaceFactory">
 /// The broadcast Device Interface Factory.
 /// </param>
 /// <param name="marshallWrapper">
 /// The marshall wrapper.
 /// </param>
 /// <param name="unsafeNativeMethodsWrapper">
 /// The unsafe native methods wrapper.
 /// </param>
 /// <param name="processHandleResultFactory">
 /// The process handle result factory.
 /// </param>
 public DeviceNotifications(
     IBroadcastDeviceInterfaceFactory broadcastDeviceInterfaceFactory,
     IMarshalWrapper marshallWrapper,
     IUnsafeNativeMethodsWrapper unsafeNativeMethodsWrapper,
     IProcessHandleResultFactory processHandleResultFactory)
 {
     _broadcastDeviceInterfaceFactory = broadcastDeviceInterfaceFactory;
     _marshallWrapper            = marshallWrapper;
     _unsafeNativeMethodsWrapper = unsafeNativeMethodsWrapper;
     _processHandleResultFactory = processHandleResultFactory;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProcessHandleResult"/> class. 
        /// </summary>
        /// <param name="handle">
        /// The device notification handle.
        /// </param>
        /// <param name="marshalWrapper">
        /// The marshal static class wrapper.
        /// </param>
        public ProcessHandleResult(IntPtr handle, IMarshalWrapper marshalWrapper)
        {
            Handle = handle;
            Win32Error = new Win32ErrorWrapper(0);
            if (handle != IntPtr.Zero)
            {
                return;
            }

            Win32Error = marshalWrapper.GetLastWin32Error();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProcessHandleResult"/> class.
        /// </summary>
        /// <param name="handle">
        /// The device notification handle.
        /// </param>
        /// <param name="marshalWrapper">
        /// The marshal static class wrapper.
        /// </param>
        public ProcessHandleResult(IntPtr handle, IMarshalWrapper marshalWrapper)
        {
            Handle     = handle;
            Win32Error = new Win32ErrorWrapper(0);
            if (handle != IntPtr.Zero)
            {
                return;
            }

            Win32Error = marshalWrapper.GetLastWin32Error();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DeviceNotifications"/> class.
 /// </summary>
 /// <param name="broadcastDeviceInterfaceFactory">
 /// The broadcast Device Interface Factory.
 /// </param>
 /// <param name="marshallWrapper">
 /// The marshall wrapper.
 /// </param>
 /// <param name="unsafeNativeMethodsWrapper">
 /// The unsafe native methods wrapper.
 /// </param>
 /// <param name="processHandleResultFactory">
 /// The process handle result factory.
 /// </param>
 public DeviceNotifications(
     IBroadcastDeviceInterfaceFactory broadcastDeviceInterfaceFactory, 
     IMarshalWrapper marshallWrapper, 
     IUnsafeNativeMethodsWrapper unsafeNativeMethodsWrapper,
     IProcessHandleResultFactory processHandleResultFactory)
 {
     _broadcastDeviceInterfaceFactory = broadcastDeviceInterfaceFactory;
     _marshallWrapper = marshallWrapper;
     _unsafeNativeMethodsWrapper = unsafeNativeMethodsWrapper;
     _processHandleResultFactory = processHandleResultFactory;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DeviceInterfaceDetail"/> class.
 /// </summary>
 /// <param name="deviceInformationSetHandle">
 /// The device Information Set Handle.
 /// </param>
 /// <param name="size">
 /// The size.
 /// </param>
 /// <param name="marshalWrapper">
 /// The marshal Wrapper.
 /// </param>
 /// <param name="deviceInfoDataFactory">
 /// The device Info Data Factory.
 /// </param>
 /// <param name="unsafeNativeMethodsWrapper">
 /// The unsafe Native Methods Wrapper.
 /// </param>
 public DeviceInterfaceDetail(
     IntPtr deviceInformationSetHandle, 
     int size, 
     IMarshalWrapper marshalWrapper, 
     IDeviceInfoDataFactory deviceInfoDataFactory, 
     IUnsafeNativeMethodsWrapper unsafeNativeMethodsWrapper)
 {
     _deviceInformationSetHandle = deviceInformationSetHandle;
     DeviceInfoData = deviceInfoDataFactory.Create();
     _marshalWrapper = marshalWrapper;
     _unsafeNativeMethodsWrapper = unsafeNativeMethodsWrapper;
     DeviceInterfaceDetailBuffer = Marshal.AllocHGlobal(size);
     _marshalWrapper.WriteInteger32(DeviceInterfaceDetailBuffer, (IntPtr.Size == 4) ? (4 + Marshal.SystemDefaultCharSize) : 8);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DeviceInterfaceDetail"/> class.
 /// </summary>
 /// <param name="deviceInformationSetHandle">
 /// The device Information Set Handle.
 /// </param>
 /// <param name="size">
 /// The size.
 /// </param>
 /// <param name="marshalWrapper">
 /// The marshal Wrapper.
 /// </param>
 /// <param name="deviceInfoDataFactory">
 /// The device Info Data Factory.
 /// </param>
 /// <param name="unsafeNativeMethodsWrapper">
 /// The unsafe Native Methods Wrapper.
 /// </param>
 public DeviceInterfaceDetail(
     IntPtr deviceInformationSetHandle,
     int size,
     IMarshalWrapper marshalWrapper,
     IDeviceInfoDataFactory deviceInfoDataFactory,
     IUnsafeNativeMethodsWrapper unsafeNativeMethodsWrapper)
 {
     _deviceInformationSetHandle = deviceInformationSetHandle;
     DeviceInfoData              = deviceInfoDataFactory.Create();
     _marshalWrapper             = marshalWrapper;
     _unsafeNativeMethodsWrapper = unsafeNativeMethodsWrapper;
     DeviceInterfaceDetailBuffer = Marshal.AllocHGlobal(size);
     _marshalWrapper.WriteInteger32(DeviceInterfaceDetailBuffer, (IntPtr.Size == 4) ? (4 + Marshal.SystemDefaultCharSize) : 8);
 }
Exemple #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnsafeNativeMethodsWrapper"/> class.
 /// </summary>
 /// <param name="marshalWrapper">
 /// The marshal wrapper.
 /// </param>
 /// <param name="deviceInformationElementFactory">
 /// The device Information Element Factory.
 /// </param>
 /// <param name="deviceInfoDataFactory">
 /// The device Info Data Factory.
 /// </param>
 /// <param name="deviceInterfaceDataFactory">
 /// The device Interface Data Factory.
 /// </param>
 /// <param name="deviceInterfaceFactory">
 /// The device Interface Factory.
 /// </param>
 /// <param name="deviceInterfaceDetailFactory">
 /// The device Interface Detail Factory.
 /// </param>
 /// <param name="devicePropertyFactory">
 /// The device Property Factory.
 /// </param>
 public UnsafeNativeMethodsWrapper(
     IMarshalWrapper marshalWrapper,
     IDeviceInformationElementFactory deviceInformationElementFactory,
     IDeviceInfoDataFactory deviceInfoDataFactory,
     IDeviceInterfaceDataFactory deviceInterfaceDataFactory,
     IDeviceInterfaceFactory deviceInterfaceFactory,
     IDeviceInterfaceDetailFactory deviceInterfaceDetailFactory,
     IDevicePropertyFactory devicePropertyFactory)
 {
     _marshalWrapper = marshalWrapper;
     _deviceInformationElementFactory = deviceInformationElementFactory;
     _deviceInfoDataFactory           = deviceInfoDataFactory;
     _deviceInterfaceDataFactory      = deviceInterfaceDataFactory;
     _deviceInterfaceFactory          = deviceInterfaceFactory;
     _deviceInterfaceDetailFactory    = deviceInterfaceDetailFactory;
     _devicePropertyFactory           = devicePropertyFactory;
 }
 public MessageHandler(IProfilerCommunication profilerCommunication, IMarshalWrapper marshalWrapper)
 {
     _profilerCommunication = profilerCommunication;
     _marshalWrapper = marshalWrapper;
 }
Exemple #13
0
 /// <summary>
 /// Construct a Message Handler
 /// </summary>
 /// <param name="profilerCommunication"></param>
 /// <param name="marshalWrapper"></param>
 /// <param name="memoryManager"></param>
 public MessageHandler(IProfilerCommunication profilerCommunication, IMarshalWrapper marshalWrapper, IMemoryManager memoryManager)
 {
     _profilerCommunication = profilerCommunication;
     _marshalWrapper        = marshalWrapper;
     _memoryManager         = memoryManager;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UnsafeNativeMethodsWrapper"/> class.
 /// </summary>
 /// <param name="marshalWrapper">
 /// The marshal wrapper.
 /// </param>
 /// <param name="deviceInformationElementFactory">
 /// The device Information Element Factory.
 /// </param>
 /// <param name="deviceInfoDataFactory">
 /// The device Info Data Factory.
 /// </param>
 /// <param name="deviceInterfaceDataFactory">
 /// The device Interface Data Factory.
 /// </param>
 /// <param name="deviceInterfaceFactory">
 /// The device Interface Factory.
 /// </param>
 /// <param name="deviceInterfaceDetailFactory">
 /// The device Interface Detail Factory.
 /// </param>
 /// <param name="devicePropertyFactory">
 /// The device Property Factory.
 /// </param>
 public UnsafeNativeMethodsWrapper(
     IMarshalWrapper marshalWrapper,
     IDeviceInformationElementFactory deviceInformationElementFactory, 
     IDeviceInfoDataFactory deviceInfoDataFactory, 
     IDeviceInterfaceDataFactory deviceInterfaceDataFactory,
     IDeviceInterfaceFactory deviceInterfaceFactory,
     IDeviceInterfaceDetailFactory deviceInterfaceDetailFactory,
     IDevicePropertyFactory devicePropertyFactory)
 {
     _marshalWrapper = marshalWrapper;
     _deviceInformationElementFactory = deviceInformationElementFactory;
     _deviceInfoDataFactory = deviceInfoDataFactory;
     _deviceInterfaceDataFactory = deviceInterfaceDataFactory;
     _deviceInterfaceFactory = deviceInterfaceFactory;
     _deviceInterfaceDetailFactory = deviceInterfaceDetailFactory;
     _devicePropertyFactory = devicePropertyFactory;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TestUsbDeviceWatcher"/> class.
 /// </summary>
 /// <param name="marshalWrapper">
 /// The marshal Wrapper.
 /// </param>
 /// <param name="usbDeviceNotificationFactory">
 /// The usb Device Notification Factory.
 /// </param>
 /// <param name="usbForm">
 /// The usb form.
 /// </param>
 /// <param name="guid">
 /// The guid.
 /// </param>
 public TestUsbDeviceWatcher(
     IMarshalWrapper marshalWrapper,
     IUsbDeviceNotificationFactory usbDeviceNotificationFactory,
     IUsbForm usbForm,
     Guid guid)
     : base(marshalWrapper, usbDeviceNotificationFactory, usbForm, guid)
 {
 }