Microsoft KB Archive/126285

{|
 * width="100%"|

FIX: PortIO.exe Fixes GENPORT.C: PortAddress Not Initialized

 * }

Q126285

-

The information in this article applies to:


 * Microsoft Win32 Device Driver Kit (DDK) for Windows NT, version 3.5

-

SYMPTOMS
PortIO.exe is a 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. The version of PortIO.exe available for download from the Microsoft Software Library corrects this problem.

CAUSE
The variable PortAddress is not initialized.

RESOLUTION
Do one of the following to resolve this problem:

 Download the corrected version of PortIO.exe from the Microsoft Software Library (see the MORE INFORMATION section of this article).  Fix the file yourself by adding two lines to DriverEntry as follows: 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 is not a conflict between this driver and // a previously loaded driver or a driver that is loaded in the // future.



STATUS
The PORTIO sample is corrected in the July 1995 MSDN.

MORE INFORMATION
The following file is available for download from the Microsoft Software Library:

~ PortIO.exe

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

"Q119591 How to Obtain Microsoft Support Files from Online Services" Keywords : kbfile kbsample kbDDK kbKMode kbOSWinNT351fix

Issue type : kbbug

Technology : kbAudDeveloper kbWinDDKSearch kbWin32sSearch kbWin32DDKSearch kbWin32DDKNT350 kbWin32DDKNTSearch