FIX: Problem with GENPORT.C: PortAddress Not Initialized

Last reviewed: October 29, 1997
Article ID: Q126285
3.50 WINDOWS NT kbprg kbbuglist kbfixlist kbfile

The information in this article applies to:

  • Microsoft Win32 Device Development Kit (DDK) for Windows NT version 3.5

SYMPTOMS

PORTIO is a code sample for a generic port I/O driver. The sample driver (GENPORT.SYS), which is part of the PORTIO sample, is found on the Windows NT DDK CD in \Q_A\SAMPLES\DDK\PORTIO.

There is a problem with this version of the sample in that it does not claim the correct I/O ports during the call to IoReportResourceUsage.

CAUSE

The variable, PortAddress, is not initialized.

RESOLUTION

You can obtain a corrected version of PORTIO sample from the Microsoft Software Library, from the July 1995 MSDN CD, or you can fix it yourself as instructed below.

Downloading a New Copy

Download PORTIO.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:

  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download PORTIO.EXE (size: 29133 bytes) 
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the SOFTLIB\MSLFILES directory
          Get PORTIO.EXE (size: 29133 bytes) 
    

Fix It Yourself

Instead of downloading it, you can fix it yourself by adding two lines to DriverEntry.

Change this:

               PortBase = DefaultBase;
               PortCount = DefaultCount;
           }
           ExFreePool(paramPath.Buffer);
       }
   }

   // Register resource usage (ports)
   //
   // This ensures that there isn't a conflict between this driver and
   // a previously loaded one or a future loaded one.

to this:

               PortBase = DefaultBase;
               PortCount = DefaultCount;
           }
           ExFreePool(paramPath.Buffer);
       }
   }

   PortAddress.LowPart  = PortBase;
   PortAddress.HighPart = 0;

   // Register resource usage (ports)
   //
   // This ensures that there isn't a conflict between this driver and
   // a previously loaded one or a future loaded one.

STATUS

The PORTIO sample is corrected in the July 1995 MSDN.


Additional reference words: 3.50
KBCategory: kbprg kbbuglist kbfixlist kbfile
KBSubcategory:
Keywords : NTDDKKMode kbprg kbbuglist kbfile kbfixlist kbprg
Version : 3.50
Platform : NT WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.