public override bool Decode(PduMarshaler marshaler) { try { base.Decode(marshaler); this.numCapabilities = marshaler.ReadUInt16(); this.Padding = marshaler.ReadUInt16(); this.CapabilityMessage = new CAPABILITY_SET[numCapabilities]; for (int i = 0; i < numCapabilities; i++ ) { CAPABILITY_HEADER header = new CAPABILITY_HEADER(); bool fsuccess = header.Decode(marshaler); if(fsuccess) { switch (header.CapabilityType) { case CapabilityType_Values.CAP_GENERAL_TYPE: CapabilityMessage[i] = new GENERAL_CAPS_SET(header); CapabilityMessage[i].Decode(marshaler); break; case CapabilityType_Values.CAP_PRINTER_TYPE: CapabilityMessage[i] = new PRINTER_CAPS_SET(header); break; case CapabilityType_Values.CAP_PORT_TYPE: CapabilityMessage[i] = new PORT_CAPS_SET(header); break; case CapabilityType_Values.CAP_DRIVE_TYPE: CapabilityMessage[i] = new DRIVE_CAPS_SET(header); break; case CapabilityType_Values.CAP_SMARTCARD_TYPE: CapabilityMessage[i] = new SMARTCARD_CAPS_SET(header); break; } } } return true; } catch { marshaler.Reset(); throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd()); } }
///// <summary> ///// A CAPABILITY_HEADER header. The CapabilityType field ///// of this header MUST be set to CAP_SMARTCARD_TYPE, and ///// the Version field MUST be set to 0x00000001. ///// </summary> public SMARTCARD_CAPS_SET(CAPABILITY_HEADER header) { this.Header = header; }
///// <summary> ///// A CAPABILITY_HEADER header. The CapabilityType field ///// of this header MUST be set to CAP_DRIVE_TYPE, and the ///// Version field MUST be set to 0x00000002. ///// </summary> public DRIVE_CAPS_SET(CAPABILITY_HEADER header) { this.Header = header; }
///// <summary> ///// A CAPABILITY_HEADER header. The CapabilityType field ///// of this header MUST be set to CAP_PRINTER_TYPE, and ///// the Version field MUST be set to 0x00000001. ///// </summary> public PRINTER_CAPS_SET(CAPABILITY_HEADER header) { this.Header = header; }
///// <summary> ///// A CAPABILITY_HEADER header. The CapabilityType field ///// of this header MUST be set to CAP_PORT_TYPE, and the ///// Version field MUST be set to 0x00000001. ///// </summary> public PORT_CAPS_SET(CAPABILITY_HEADER header) { this.Header = header; }
///// <summary> ///// A CAPABILITY_HEADER header. The CapabilityType ///// field of this header MUST be set to CAP_GENERAL_TYPE. ///// The Version field of this header MUST have one of ///// the following values: ///// GENERAL_CAPABILITY_VERSION_01 0x0001 Version1. The SpecialTypeDeviceCap field of GENERAL_CAP_SET is not present. ///// GENERAL_CAPABILITY_VERSION_02 0x0002 Version2. The SpecialTypeDeviceCap field of GENERAL_CAP_SET is present. ///// </summary> public GENERAL_CAPS_SET(CAPABILITY_HEADER header) { this.Header = header; }
public CAPABILITY_SET(CapabilityType_Values type) { this.Header = new CAPABILITY_HEADER(type); }
public CAPABILITY_SET(CapabilityType_Values type, CAPABILITY_VERSION ver) { this.Header = new CAPABILITY_HEADER(type, ver); }