/// <summary> /// Decode this PDU from the PduMarshaler. /// </summary> /// <param name="marshaler">This is used to decode the fields of this PDU.</param> public override bool Decode(PduMarshaler marshaler) { try { base.Decode(marshaler); cchDeviceDescription = marshaler.ReadUInt32(); DeviceDescription = marshaler.ReadUnicodeString((int)cchDeviceDescription); HResult = marshaler.ReadUInt32(); } catch (Exception) { return false; } return true; }
/// <summary> /// Decode this PDU from the PduMarshaler. /// </summary> /// <param name="marshaler">This is used to decode the fields of this PDU.</param> public override bool Decode(PduMarshaler marshaler) { try { base.Decode(marshaler); NumUsbDevice = marshaler.ReadUInt32(); UsbDevice = marshaler.ReadUInt32(); cchDeviceInstanceId = marshaler.ReadUInt32(); DeviceInstanceId = marshaler.ReadUnicodeString((int)cchDeviceInstanceId); cchHwIds = marshaler.ReadUInt32(); if (cchHwIds == 0) { HardwareIds = null; } else { HardwareIds = marshaler.ReadUnicodeString((int)cchHwIds); } cchCompatIds = marshaler.ReadUInt32(); if (cchCompatIds == 0) { CompatibilityIds = null; } else { CompatibilityIds = marshaler.ReadUnicodeString((int)cchCompatIds); } cchContainerId = marshaler.ReadUInt32(); ContainerId = marshaler.ReadUnicodeString((int)cchContainerId); UsbDeviceCapabilities = marshaler.ReadBytes(USB_DEVICE_CAPABILITIES.USB_DEVICE_CAPABILITIES_SIZE); } catch (Exception) { return false; } return true; }
/// <summary> /// Decode this PDU from the PduMarshaler. /// </summary> /// <param name="marshaler">This is used to decode the fields of this PDU.</param> public override bool Decode(PduMarshaler marshaler) { base.Decode(marshaler); // TODO: Need to refine marshaler interfaces. if (marshaler.RawData.Length > 2) { bString = marshaler.ReadUnicodeString(); } return true; }