Problem with CyberKnex Programmer program and direct LPT1 port access

Rob Shearman rob at codeweavers.com
Fri Apr 8 10:15:26 CDT 2005


Terry Barnaby wrote:

> Rob Shearman wrote:
>
>> Terry Barnaby wrote:
>>
>>> Hi,
>>>
>>> I am trying to get the K'nex CyberKnex Programmer Windows program
>>> working under wine on Fedora 3. It appears to be generally working but
>>> this program needs direct access to the LPT1 parallel port to drive an
>>> external "flash key" programmer.
>>>
>>> I have tried setting the "Windows" parameter to "winxp" and setting
>>> "export WINEDEBUG=+io,+int,+vxd;". This still does not
>>> work I get the error messages:
>>>
>>> fixme:setupapi:SetupDiClassGuidsFromNameExA
>>> trace:vxd:DeviceIoControl 
>>> (0xffffffff,222074,0x7e8e00b4,4,(nil),0,0x72c9f57c,(nil))
>>>
>>>
>>> I understand, from reading mailing lists and looking at the program, 
>>> that the
>>> program is using a DLL which has the capability of loading an 
>>> embedded VXD
>>> driver to access the LPT1 port.
>>>
>>> Some questions:
>>> 1. Should this VXD driver loaded when the window system is set to 
>>> "winxp" ?
>>
>>
>>
>>
>> No. NT doesn't support VXDs, just like we don't (although we fake a 
>> few).
>>
>>> 2. Is there any way I can get this program to communicate with the 
>>> LPT1 port ?
>>
>>
>>
>>
>> Possibly. I'd look at working at which IOCTL and see if you can 
>> handle it either by translating it into a Linux ioctl (preferable) or 
>> by faking the information returned to satisfy the program. It doesn't 
>> look as though the setupapi call is important as the program seems to 
>> carry on without it.
>>
>> Rob
>
>
> Hi Rob,
>
> Thanks for the feedback.
> I am new to wine development, could you give me a little extra pointers ?


Sure. I would start with looking at DEVELOPER-HINTS in the wine source.

>
> 1. What should the "setupapi" call do, should it load a standard NT 
> driver, how
>     would the program expect to access the LPT1 port under NT ?


Typically, programs use setupapi to enumerate devices to find one that 
matches their needs. The functions are documented on MSDN. Here is a 
link to the one called by your program:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install/hh/install/di-rtns_6b309545-3832-4802-9668-21a107f3c651.xml.asp

> 2. I assume the 
> vxd:DeviceIoControl(0xffffffff,222074,0x7e8e00b4,4,(nil),0,0x72c9f57c,(nil)) 
>
>     is an effective Windows IOCTL ?


Yes.

> 3. Is the first parameter to vxd:DeviceIoControl() a device handle, -1 
> indicating some
>     device opening routine actually failed ?


Good point, yes. This could be because of the setupapi stub.

> 4. Are you stating that I can change the wine code that handles the 
> vxd:DeviceIoControl()
>     to "do the right thing" ?


Yes. It might be cleaner to put the code in ntdll rather than kernel32, 
but we can cross that bridge when we come to it.

Rob



More information about the wine-devel mailing list