Migrating to ASPI for Win32
If you have written ASPI or ASPI for Windows applications in the past, here are some key points to keep in mind when you migrate the applications to ASPI for Win32:
- Although structure definitions have changed slightly to optimize alignment for 32-bit processors, structure names are consistent with those used in previous ASPI developer's kits. If you would like to use one source base for both 16-bit and 32-bit applications, make sure that you conditionally compile with the appropriate include files for each programming model. New 32-bit include files are available in the ASPI developer's kit. There are many #ifdef statements in the sample code.
- The CDB area has been fixed in length at 16. Therefore, the sense data area no longer shifts location depending on command length. If you are developing an application targeted only at Win32, you no longer need to account for the "floating" sense buffer.
- For requests requiring data transfers, the direction bits in the SRB Flags field must be set correctly. Direction bits are no longer optional for data transfers. For requests not requiring data transfers, the direction bits are ignored.
- If you are using dynamic DLL linking, use LoadLibrary (winaspi32.dll) instead of LoadLibrary(winaspi.dll) in order to access ASPI for Win32. If you are using static DLL linking, use the wnaspi32.lib.
- All pointers in Win32 are 32 bits (Flat model). Therefore, FAR references are not used.
- When allocating memory, page locking and global allocations are not necessary.