title: How to port NDIS 6.2 to NDIS 6.3 using NDIS_SUPPORT_NDIS630?
body: <p>I have NDIS 6.2 Supporting Miniport Driver . Now I want to port NDIS 6.2 to NDIS 6.3 . </p>
  
  <p><a href="https://msdn.microsoft.com/en-us/library/windows/hardware/dn232191(v=vs.85).aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/windows/hardware/dn232191(v=vs.85).aspx</a></p>
  
  <p>Using this link I changed some general requirements and Power Management for Enhancements in NDIS 6.30 .</p>
  
  <p>i put all changes are in same NDIS 6.2 file .</p>
  
  <p>The chnages are (miniport.cpp)</p>
  
  <pre><code>ndisMiniportDriverCharacteristics.MajorNdisVersion                = 6;
  ndisMiniportDriverCharacteristics.MinorNdisVersion                = 30;
  
  ndisMiniportDriverCharacteristics.MajorDriverVersion              = VERSION_MAJOR_NUM;
  ndisMiniportDriverCharacteristics.MinorDriverVersion              = VERSION_MINOR_NUM;
  
  ndisMiniportDriverCharacteristics.SetOptionsHandler               = CMiniport::SetOptions;
  ndisMiniportDriverCharacteristics.InitializeHandlerEx             = CMiniport::InitializeEx;
  </code></pre>
  
  <p>...... ....etc</p>
  
  <p>then inside InitializeEx() funcion the changes for <code>NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES</code> are : </p>
  
  <pre><code>NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES ndisMiniportAdapterRegistrationAttributes;
  NdisZeroMemory(&amp;ndisMiniportAdapterRegistrationAttributes, sizeof(NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES));
  
  #if (NDIS_SUPPORT_NDIS630)
  
  C_ASSERT(sizeof(NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES) &gt;= NDIS_SIZEOF_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_2);
  ndisMiniportAdapterRegistrationAttributes.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES;
  ndisMiniportAdapterRegistrationAttributes.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_2;
  ndisMiniportAdapterRegistrationAttributes.Header.Revision = NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_2;
  
  #else
  
  C_ASSERT(sizeof(NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES) &gt;= NDIS_SIZEOF_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1);
  ndisMiniportAdapterRegistrationAttributes.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES;
  ndisMiniportAdapterRegistrationAttributes.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1;
  ndisMiniportAdapterRegistrationAttributes.Header.Revision = NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1;
  
  #endif // NDIS MINIPORT VERSION
  
  ndisMiniportAdapterRegistrationAttributes.MiniportAdapterContext = CMiniport::m_pMiniport;
  
  
  #if (NDIS_SUPPORT_NDIS630)
  
      ndisMiniportAdapterRegistrationAttributes.AttributeFlags |= NDIS_MINIPORT_ATTRIBUTES_NO_PAUSE_ON_SUSPEND;
  
  #else
  
     ndisMiniportAdapterRegistrationAttributes.AttributeFlags = NDIS_MINIPORT_ATTRIBUTES_SURPRISE_REMOVE_OK | NDIS_MINIPORT_ATTRIBUTES_NDIS_WDM;
  
  #endif  
  
  ndisMiniportAdapterRegistrationAttributes.CheckForHangTimeInSeconds = 5;
  </code></pre>
  
  <p>and for the chnage NDIS_PM_CAPABILITIES i wrote like this : </p>
  
  <pre><code> NDIS_PM_CAPABILITIES ndisPmCapabilities;
   NdisZeroMemory(&amp;ndisPmCapabilities, sizeof(NDIS_PM_CAPABILITIES));
  
  
  #if (NDIS_SUPPORT_NDIS630)
  
      C_ASSERT(sizeof(NDIS_PM_CAPABILITIES) &gt;= NDIS_SIZEOF_NDIS_PM_CAPABILITIES_REVISION_2);
      ndisPmCapabilities.Header.Type = NDIS_OBJECT_TYPE_DEFAULT;
      ndisPmCapabilities.Header.Size = NDIS_SIZEOF_NDIS_PM_CAPABILITIES_REVISION_2;
      ndisPmCapabilities.Header.Revision = NDIS_PM_CAPABILITIES_REVISION_2;
  
      ndisPmCapabilities.MinMagicPacketWakeUp = NdisDeviceStateUnspecified;
      ndisPmCapabilities.MinPatternWakeUp = NdisDeviceStateUnspecified;
      ndisPmCapabilities.MinLinkChangeWakeUp = NdisDeviceStateUnspecified;
  
  #else
  
      C_ASSERT(sizeof(NDIS_PM_CAPABILITIES) &gt;= NDIS_SIZEOF_NDIS_PM_CAPABILITIES_REVISION_1);
      ndisPmCapabilities.Header.Type = NDIS_OBJECT_TYPE_DEFAULT;
      ndisPmCapabilities.Header.Size = NDIS_SIZEOF_NDIS_PM_CAPABILITIES_REVISION_1;
      ndisPmCapabilities.Header.Revision = NDIS_PM_CAPABILITIES_REVISION_1;
  
      ndisPmCapabilities.MinMagicPacketWakeUp = NdisDeviceStateUnspecified;
      ndisPmCapabilities.MinPatternWakeUp = NdisDeviceStateUnspecified;
      ndisPmCapabilities.MinLinkChangeWakeUp = NdisDeviceStateUnspecified;
  
  #endif // NDIS MINIPORT VERSION
  </code></pre>
  
  <p>So my doubts are :</p>
  
  <ol>
  <li>can i use this NDIS 6.30 for windows 7 NDIS 6.2 ?</li>
  <li>how to activate <code>NDIS_SUPPORT_NDIS630</code> macro ? </li>
  </ol>
  
  <p>in ndis.h WDK file the macros are like this :</p>
  
  <pre><code>#if !defined(NDIS_SUPPORT_NDIS630)
  #if  (((defined (NDIS_MINIPORT_MAJOR_VERSION) &amp;&amp; (NDIS_MINIPORT_MAJOR_VERSION &gt;= 6)) &amp;&amp; \
         (defined (NDIS_MINIPORT_MINOR_VERSION) &amp;&amp; (NDIS_MINIPORT_MINOR_VERSION &gt;= 30))) || \
        (defined (NDIS630)) || NDIS_WRAPPER)
  #define NDIS_SUPPORT_NDIS630      1
  #else
  #define NDIS_SUPPORT_NDIS630      0
  #endif
  #endif // !defined(NDIS_SUPPORT_NDIS630)
  </code></pre>
  
  <p>but when i use  <code>ndisPmCapabilities.Header.Revision = NDIS_PM_CAPABILITIES_REVISION_2;</code> directly i got error like 
   <code>NDIS_PM_CAPABILITIES_REVISION_2 is not defined</code> .</p>
  
  <p>How to use this  <code>NDIS_SUPPORT_NDIS630</code> macro ? </p>