Re: Wine device drivers proposal
Damjan Jovanovic wrote: Hi I've been trying to add STI (still image) support to Wine, and I've made some progress. However, I see a deep and unsurmountable need to add (at least user-space) device drivers to Wine, and I would like some feedback on these ideas. Basically, many Windows device drivers are really trivial, but required for many apps. A scanner driver typically just accepts commands from a user-space app, does minimal processing, and forwards that to Windows. I've already hacked up Wine to get the same functionality, and it works - partially. I propose adding a driver loading system to Wine that works as follows: -CreateFile() gets a device filename, like (in my case) \\.\MiiScan0 -Currently, Wine's behaviour for such a filename is to try load a VXD. -In the case of VXD loading failure, a search is performed in (Wine's) C:\Windows\System32\Drivers (or somewhere else?) for a matching driver. The driver is then loaded and used for (at least): ReadFile() WriteFile() DeviceIoControl() CloseHandle() The problem is, how is a handle mapped to the appropriate driver? I've thought about it, and come up with 3 solutions. The first 3 don't require changes to the wineserver but aren't pretty. 1. Make the driver a true Linux kernel mode driver, and the handle its device file handle. Since ReadFile() and WriteFile() just do read() and write() system calls, this can be done. The problem is, DeviceIoControl() has to be implemented using ioctl(), and that's dangerous (sending the right codes to the wrong device can be catastrophic). Also, it's not portable to other OS's, and requires writing a kernel module (which isn't fun). 2. The driver is a file giving a process to start and some IPC method to use. Wine starts the process and uses the IPC method to communicate with the driver. This is good as far as Wine's current ReadFile() and WriteFile() go, since they don't have to know they're not writing to an actual file. The problem here is, which IPC method supports both read() and write() on the same file descriptor, preserves message boundaries, and carries out-of-band data for DeviceIoControl()? I was thinking TCP sockets, but they don't preserve message boundaries. 3. KERNEL32.DLL and / or NTDLL.DLL keep their own handle table so they know which handles are driver handles and deal with those appropriately. Having to look up these tables for every call to ReadFile(), WriteFile() and DeviceIoControl() might be very inefficient, though. 4. Use an in-process solution, like a winelib DLL that has exports for dealing with ReadFile(), WriteFile() and DeviceIoControl(). This could be the most efficient, but then again, you need an efficient way to test a handle for being a driver handle, find the appropriate driver, and call the right exported function, which likely means the wineserver needs to have knowledge of these drivers and provide functionality for testing a handle for being a driver handle and have a way to find the driver. Let me know what you think. Bye Damjan I would like this but mainly for a different reason. I help reverse engineer hardware so that we can write linux drivers for it. This reverse engineering task would be easier if I could install the windows drivers on my linux box and run them, and then watch their activity with the hardware. For this to work, we would have to implement the HAL.DLL in wine, a small kernel module for it to communicate with and probably a few other bits. This would greatly help the hardware reverse engineering requirements in order to get hardware to interoperate with Linux. Currently, I have to installed special .DLLs on a windows box and perform the logging there. I would much prefer to do it all on Linux. The side effect of this would be that wine will support some hardware even before Linux gets support for it. This kernel module would only be run for the reverse engineering task, as it would most likely make the linux kernel very insecure. Any comments James
Re: Improve the HHCTRL.OCX stub
Hi. Two small suggestions. +static char *command_to_string(UINT command) It could be const char. +{ +#define X(x) case x: return #x + +switch (command) +{ +X( HH_DISPLAY_TOPIC ); +X( HH_DISPLAY_TOC ); +X( HH_DISPLAY_INDEX ); +X( HH_DISPLAY_SEARCH ); +X( HH_SET_WIN_TYPE ); +X( HH_GET_WIN_TYPE ); +X( HH_GET_WIN_HANDLE ); +X( HH_ENUM_INFO_TYPE ); +X( HH_SET_INFO_TYPE ); +X( HH_SYNC ); +X( HH_RESERVED1 ); +X( HH_RESERVED2 ); +X( HH_RESERVED3 ); +X( HH_KEYWORD_LOOKUP ); +X( HH_DISPLAY_TEXT_POPUP ); +X( HH_HELP_CONTEXT ); +X( HH_TP_HELP_CONTEXTMENU ); +X( HH_TP_HELP_WM_HELP ); +X( HH_CLOSE_ALL ); +X( HH_ALINK_LOOKUP ); +X( HH_GET_LAST_ERROR ); +X( HH_ENUM_CATEGORY ); +X( HH_ENUM_CATEGORY_IT ); +X( HH_RESET_IT_FILTER ); +X( HH_SET_INCLUSIVE_FILTER ); +X( HH_SET_EXCLUSIVE_FILTER ); +X( HH_INITIALIZE ); +X( HH_UNINITIALIZE ); +X( HH_PRETRANSLATEMESSAGE ); +X( HH_SET_GLOBAL_PROPERTY ); +} + +#undef X +} If command is not one of specificed in switch, function won't return a valid string. Thanks, Jacek
Wine and twain
Hi, I haven't seen recent information on wine and twain. I already sent a similar mail to wine-users two weeks ago without answer. I am trying to test a Finereader Office (version 5) with an USB scanner. Everything seems working. But I get scanner not ready when searching for scanner. Sane, gimp or whatever are working well with my scanner. Doing WINEDEBUG=+loaddll wine finereader.exe I get: ... trace:loaddll:load_dll Loaded module LC:\\program files\\abbyy finereader 5.0 office\\scan\\scanman0.dll : native trace:loaddll:load_dll Loaded module Lc:\\windows\\system\\msvcrt.dll : builtin trace:loaddll:MODULE_FlushModrefs Unloaded module Lc:\\windows\\system\\msvcrt.dll : builtin err:module:load_builtin_dll loaded .so for LTwain.dll but got Ltwain_32.dll instead - probably 16-bit dll trace:loaddll:MODULE_LoadModule16 Loaded module c:\\windows\\Twain.dll : builtin Scanning driver not ready. But the scanner is ready: # sane-find-scanner -v searching for USB scanners: checking /dev/usb/scanner... failed to open (Invalid argument) checking /dev/usb/scanner0... failed to open (Invalid argument) ... checking /dev/usbscanner15... failed to open (Invalid argument) found USB scanner (vendor=0x03f0 [hp], product=0xb402 [photosmart 7700 series]) at libusb:002:002 found USB scanner (vendor=0x04b8 [EPSON], product=0x010f [EPSON Scanner 010F], chip=LM9832/3) at libusb:001:003 # scanimage -L device `plustek:libusb:001:003' is a Epson Perfection 1250/Photo USB flatbed scanner device `net:localhost:plustek:libusb:001:003' is a Epson Perfection 1250/Photo USB flatbed scanner Thus the device is something like plustek:libusb:001:003 and # scanimage -d plustek:libusb:001:003 foo.pnm works. Is there any wine test (windows exe) in order to test twain? Regards, Nicolas -- Brouard Nicolas [EMAIL PROTECTED]
Hints needed for riched20/scroll bug solving
Hi, When starting the Zoo Tycoon 1 demo for the first time, the license agreement appears. I know that nobody reads this ;-) but hey. When I click in the scrollbar (page down) the page goes down 1 page and the scrollbar changes. When I however click the down-arrow in the scrollbar, the page goes down (2 lines) but the scrollbar doesn't change. Who/what is responsible for this scrollbar? I've tried (extra) tracing for riched20 and scroll but nothing so far. Cheers, Paul.
Re: Riched20: thanks + regression beta not shown
On Apr 1, 2005 11:37 AM, Phil Krylov [EMAIL PROTECTED] wrote: On Fri, 01 Apr 2005 18:04:32 +0200 Tobias Burnus [EMAIL PROTECTED] wrote: Hmm, I think the reason for my boxes was that I didn't install symbol.ttf from Windows (I had only a Symbol Set BT and bitmap fonts before). Yes, I also noticed some problems with font substitution... The problem I've noticed is if there is only one truetype font available, and thanks to the new Marlett replacement there is exactly one on a default install, then it gets chosen to display any truetype font. This is easily seen when using Word Viewer 2003, all fonts in the document will use Marlett. Steven - you mentioned there was a Tahoma ttf replacement on the way from ROS? Greenville? Has it been completed? With regard to making our own replacement fonts, I think there's already a sufficient amount of fonts out there we could potentially use. Of course we'd need to contact the authors, but I'm sure we could just import an existing one into fontforge. I sent this email a few months ago: The issue of fonts came up a while ago and I know some people are working on free replacements for some of the core fonts. Anyway, I stumbled on this resource tonight with a huge listing of fonts: http://cgm.cs.mcgill.ca/~luc/originalfonts.html Seems like there's got to be a few decent ones in there the authors would be willing to let us use and relicense. Another thing I just thought of is glyph tracing. Maybe this would be a good time to explore our OSDL legal resources. In theory, it's legal to take an existing font, trace the outlines of the glyphs, and use that to create a new font set. Fontforge has more info on how that works. It would be interesting to find out if there's a precedent for doing that. -Brian
wineps: rewriting in terms of 32-bit functions
Hi Huw, Currenty wineps.dll is one of the worse offenders in terms of using non-standard, 16-bit entry points. Namely, wineps makes use of the following 16-bit functions: CloseJob16() DrvGetPrinterData16() DrvSetPrinterData16() OpenJob16() SelectVisRgn16() WriteSpool16() I was wondering if there's anything that holds us back from using 32-bit APIs instead of the 16-bit ones like so: CloseJob16() -- ClosePrinter() DrvGetPrinterData16() -- GetPrinterDataEx() DrvSetPrinterData16() -- SetPrinterDataEx() OpenJob16() -- OpenPrinter() SelectVisRgn16() -- ? WriteSpool16()-- WritePrinter() I haven't looked too deeply into the problem, but given that you probably know the code inside out, maybe you can help me put this into perspective... -- Dimi.
Re: Hints needed for riched20/scroll bug solving
Paul Vriens wrote: agreement appears. I know that nobody reads this ;-) but hey. When I click in the scrollbar (page down) the page goes down 1 page and the scrollbar changes. My newest patch (released 5 minutes ago, not in CVS yet) attempts to fix that - at least, it works for me. Try it and tell me if it works for you. Krzysztof