Implementing SYS-files for Wine

Damjan Jovanovic dj015 at
Mon Jan 9 09:20:37 CST 2006

--- "Anton Litvinov (wine_user)" <antony at>

> I want to run a proprietary program which does the
> following things:
>  ...
>  fh =
> ...);
>  ...
>  dh = CreateFileA("\\.\BIOSMAP", ...);
>  ...
>  r  = DeviceIoControl(dh, 0x10000000, ...);
>  ...
> On recieving 0x10000000 code BIOSMAP maps BIOS
> content 
> (brand, creation date, etc) to some area and returns
> address of one null-terminated string from it to
> main program.
> Is there a way to re-implement a SYS-file (so that
> main program 
> would run w/o any change) like it's done with some
> VXD's in Wine-tree?

I wish :~(.

> Can I get some examples?

You cannot use a VxD since they don't get considered
for ioctl codes above 0x0000FFFF.

I made an example that uses a Linux kernel module that
does the equivalent of USBSCAN.SYS. Basically you hack
away at CreateFile() in KERNEL32.DLL to get it to
open() /dev/... (a device node hooked up to the kernel
module) and then use wine_server_register_fd() (or
something like that) to register the file descriptor.
Then you need to change NtDeviceIoControl() in
NTDLL.DLL so that it actually does an ioctl() call to
the kernel module. You'll have to use
wine_server_handle_to_fd() to get the file descriptor
for the first parameter of the ioctl(), and then
wine_server_release_handle() after, and you'll have to
make a custom struct that gets passed around as the
third parameter in the ioctl(). Of course, the hardest
part is writing the kernel module...

I'll probably put up my example on the net in a week
or so.

There is also some people working on a user-space
device-driver system for wine (an out-of-process
server emulating NTOSKRNL.EXE), they've gotten some
results, but they've been quite mysterious and silent
about it...

> Hope to get your answer,
> Anton Litvinov

Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 

More information about the wine-devel mailing list