Loading of Mingw Provided .sys files

Alexander Morozov amorozov at etersoft.ru
Wed Apr 8 05:05:22 CDT 2009

> trying to use the supplied or the mingw (cross) compiled libusb0.sys from
> sourceforge with the USB enabled tree from
> http://git.etersoft.ru/people/lav/packages/wine.git
> loading libusb0.sys fails: 

Drivers built with WinDDK is not page-aligned and
(nt->OptionalHeader.SectionAlignment <= page_mask) is true for them.
But libusb0.sys is page-aligned:
$ winedump libusb0.sys | grep section
  section align                      0x1000         4096

See map_image() in dlls/ntdll/virtual.c:

    /* check for non page-aligned binary */

    if (nt->OptionalHeader.SectionAlignment <= page_mask)
        /* unaligned sections, this happens for native subsystem binaries */
        /* in that case Windows simply maps in the whole file */
        goto done;

More information about the wine-devel mailing list