<div class="content" name="PORT_DATA_2" uuid="2d256a4b-819c-4b84-8e8f-b1edb1dcf0c2"><p>The <b>PORT_DATA_2</b> structure specifies level 2 port
configuration data.<a id="Appendix_A_Target_137"></a><a aria-label="Product behavior note 137" href="e81cbc09-ab05-4a32-ae4a-8ec57b436c43#Appendix_A_137" data-linktype="relative-path">&lt;137&gt;</a></p><table>
 <tbody><tr>
  <th><p><br/>0</p></th>
  <th><p><br/>1</p></th>
  <th><p><br/>2</p></th>
  <th><p><br/>3</p></th>
  <th><p><br/>4</p></th>
  <th><p><br/>5</p></th>
  <th><p><br/>6</p></th>
  <th><p><br/>7</p></th>
  <th><p><br/>8</p></th>
  <th><p><br/>9</p></th>
  <th><p>1<br/>0</p></th>
  <th><p><br/>1</p></th>
  <th><p><br/>2</p></th>
  <th><p><br/>3</p></th>
  <th><p><br/>4</p></th>
  <th><p><br/>5</p></th>
  <th><p><br/>6</p></th>
  <th><p><br/>7</p></th>
  <th><p><br/>8</p></th>
  <th><p><br/>9</p></th>
  <th><p>2<br/>0</p></th>
  <th><p><br/>1</p></th>
  <th><p><br/>2</p></th>
  <th><p><br/>3</p></th>
  <th><p><br/>4</p></th>
  <th><p><br/>5</p></th>
  <th><p><br/>6</p></th>
  <th><p><br/>7</p></th>
  <th><p><br/>8</p></th>
  <th><p><br/>9</p></th>
  <th><p>3<br/>0</p></th>
  <th><p><br/>1</p></th>
 </tr>
 <tr>
  <td colspan="32">PortName (128 bytes)</td>
 </tr>
 <tr>
  <td colspan="32">...</td>
 </tr>
 <tr>
  <td colspan="32">...</td>
 </tr>
 <tr>
  <td colspan="32">...</td>
 </tr>
 <tr>
  <td colspan="32">Version</td>
 </tr>
 <tr>
  <td colspan="32">Protocol</td>
 </tr>
 <tr>
  <td colspan="32">Size</td>
 </tr>
 <tr>
  <td colspan="32">Reserved</td>
 </tr>
 <tr>
  <td colspan="32">HostAddress (256 bytes)</td>
 </tr>
 <tr>
  <td colspan="32">...</td>
 </tr>
 <tr>
  <td colspan="32">...</td>
 </tr>
 <tr>
  <td colspan="32">...</td>
 </tr>
 <tr>
  <td colspan="32">SNMPCommunity (66 bytes)</td>
 </tr>
 <tr>
  <td colspan="32">...</td>
 </tr>
 <tr>
  <td colspan="32">...</td>
 </tr>
 <tr>
  <td colspan="16">...</td>
  <td colspan="16">PaddingForAlignment</td>
 </tr>
 <tr>
  <td colspan="32">DoubleSpool</td>
 </tr>
 <tr>
  <td colspan="32">Queue (66 bytes)</td>
 </tr>
 <tr>
  <td colspan="32">...</td>
 </tr>
 <tr>
  <td colspan="32">...</td>
 </tr>
 <tr>
  <td colspan="16">...</td>
  <td colspan="16">DeviceType (514 bytes)</td>
 </tr>
 <tr>
  <td colspan="32">...</td>
 </tr>
 <tr>
  <td colspan="32">...</td>
 </tr>
 <tr>
  <td colspan="32">PortNumber</td>
 </tr>
 <tr>
  <td colspan="32">SNMPEnabled</td>
 </tr>
 <tr>
  <td colspan="32">SNMPDevIndex</td>
 </tr>
 <tr>
  <td colspan="32">PortMonitorMibIndex</td>
 </tr>
</tbody></table><p><b>PortName (128 bytes): </b>A null-terminated <span><a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_b069acb4-e364-453e-ac83-42d469bb339e" data-linktype="relative-path">Unicode
string</a></span>, which is the name of the <span><a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_ac027425-6043-4ad3-be27-56a381b75d38" data-linktype="relative-path">port</a></span>.</p><p><b>Version (4 bytes): </b>A 32-bit unsigned integer
that specifies the version number of the <b>PORT_DATA_2</b> structure. This
value MUST be 0x00000002.</p><p><b>Protocol (4 bytes): </b>A 32-bit unsigned integer
that specifies the protocol to use for the port. This value MUST be either <b>PROTOCOL_RAWTCP_TYPE</b>
(0x00000001), indicating that the port expects RAW print data, or <b>PROTOCOL_LPR_TYPE</b>
(0x00000002), indicating that the port expects to be driven as an LPR port.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Name/value</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>PROTOCOL_RAWTCP_TYPE 0x00000001</td>
  <td>The port expects RAW print data.</td>
 </tr><tr>
  <td>PROTOCOL_LPR_TYPE 0x00000002</td>
  <td>The port expects to be driven as an LPR port.</td>
 </tr></tbody></table>
</dd></dl><p><b>Size (4 bytes): </b>A 32-bit unsigned integer that
specifies the size, in bytes, of the <b>PORT_DATA_2</b> structure.</p><p><b>Reserved (4 bytes): </b>A 32-bit unsigned integer
that is set to zero.</p><p><b>HostAddress (256 bytes): </b>A null-terminated
Unicode string, which is the IP address or host name of the printer.</p><p><b>SNMPCommunity (66 bytes): </b>A null-terminated
Unicode string, which is the Simple Network Management Protocol (SNMP) <span><a href="https://go.microsoft.com/fwlink/?LinkId=121934" data-linktype="external">[RFC1157]</a></span>
community name of the printer.</p><p><b>PaddingForAlignment (2 bytes): </b>2 bytes of
padding to align the <b>DoubleSpool</b> field on a 4-byte boundary. The
contents of this field MUST be ignored.</p><p><b>DoubleSpool (4 bytes): </b>A 32-bit unsigned
integer that, if nonzero, indicates double spooling is enabled or, if zero,
indicates that double spooling is disabled.</p><p><b>Queue (66 bytes): </b>A null-terminated Unicode
string, which is the LPR queue name.</p><p><b>DeviceType (514 bytes): </b>A null-terminated
Unicode string, which is the generic SNMP system device description OID
1.3.6.1.2.1.1.1 (<a id="_Hlk147244718">for a network device object ID</a>).</p><p><b>PortNumber (4 bytes): </b>A 32-bit unsigned
integer that is the port number of the device.</p><p><b>SNMPEnabled (4 bytes): </b>A 32-bit unsigned
integer that, if nonzero, indicates that the device supports SNMP.</p><p><b>SNMPDevIndex (4 bytes): </b>A 32-bit unsigned
integer that is the SNMP device index.</p><p><b>PortMonitorMibIndex (4 bytes): </b>A 32-bit
unsigned integer that specifies the index in the network devices Printer
Working Group (PWG) <span><a href="https://go.microsoft.com/fwlink/?linkid=2133506" data-linktype="external">[IEEE-PWG]</a></span> <span><a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_1b5f368b-942b-40dd-84ea-fa9082916216" data-linktype="relative-path">port
Monitor</a></span> <span><a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_4a0fe673-f05d-4272-8702-f3f2b448fa82" data-linktype="relative-path">Management Information Base (MIB)</a></span>
for the current <span><a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_7e4cced1-30e5-4baf-8848-8a050df1be4e" data-linktype="relative-path">TCPMON</a></span> port. This
index is used to query the IEEE 1284 device ID for the attached printer. For
details, see <span><a href="https://go.microsoft.com/fwlink/?LinkId=89898" data-linktype="external">[IEEE1284]</a></span>.</p></div>