/// <summary>
        /// Gets a device capability represented as an array
        /// </summary>
        /// <param name="capability">Capability to retrieve</param>
        /// <returns>value of capability specified in capability argument</returns>
        private T[] GetArrayCapability <T>(DeviceCapability capability, ReadArray <T> readArray, int itemByteSize)
        {
            uint numOutputs = UnsafeNativeMethods.DeviceCapabilitiesW(this._deviceName, this._portName, capability, SafeMemoryHandle.Null, this._devMode);

            if (numOutputs < 1)
            {
                return(Array.Empty <T>());
            }

            HGlobalBuffer buffer = new HGlobalBuffer((int)(numOutputs * itemByteSize));

            try
            {
                numOutputs = UnsafeNativeMethods.DeviceCapabilitiesW(this._deviceName, this._portName, capability, buffer.Handle, this._devMode);
                if (numOutputs >= 0)
                {
                    return(readArray(buffer, itemByteSize));
                }
            }
            finally
            {
                buffer.Release();
            }

            return(null);
        }
 /// <summary>
 /// Gets a device capability represented as an integer
 /// </summary>
 /// <param name="capability">Capability to retrieve</param>
 /// <returns>value of capability specified in capability argument</returns>
 private uint GetIntCapability(DeviceCapability capability)
 {
     return(UnsafeNativeMethods.DeviceCapabilitiesW(this._deviceName, this._portName, capability, SafeMemoryHandle.Null, this._devMode));
 }