Bug 3275 - XP64 Printdriver won't work because PE_HEADER_MACHINE_I386 check fails
XP64 Printdriver won't work because PE_HEADER_MACHINE_I386 check fails
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: Printing
3.0.21
x64 Linux
: P3 normal
: none
Assigned To: Gerald (Jerry) Carter
Samba QA Contact
ftp://ftp.dlr.de/robotic/outgoing/mau...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-22 00:11 UTC by maurer
Modified: 2007-03-19 12:43 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description maurer 2005-11-22 00:11:55 UTC
I know seem to have found the problem, why the 64 bit psdriver is not working correctly under samba
(see below).

A level 5 debug shows

  Admin opened file x64/3/pscript5.dll read=Yes write=No (numopen=1)
[2005/11/22 07:39:35, 3] printing/nt_printing.c:get_file_version(1055)
  get_file_version: PE file [x64/3/pscript5.dll] wrong machine = 0x8664
[2005/11/22 07:39:35, 2] smbd/close.c:close_normal_file(279)

in the source code I found
        if (SVAL(buf,PE_HEADER_MACHINE_OFFSET) != PE_HEADER_MACHINE_I386) {
            DEBUG(3,("get_file_version: PE file [%s] wrong machine = 0x%x\n",
                    fname, SVAL(buf,PE_HEADER_MACHINE_OFFSET)));
            /* At this point, we assume the file is in error. It still could be somthing
             * else besides a PE file, but it unlikely at this point.
             */
            goto error_exit;
        }

which seems to be not correct for 64-bit drivers

I am not familiar with binary files :-)
so my own possibility to solve the problem would be to comment out the source from above.

But maybe some could add PE_HEADER_MACHINE_X64 check ore someting else...

I put the driver files under
ftp://ftp.dlr.de/robotic/outgoing/maurer/64-Bit.zip
if someone want to try to solve the problem

Greetings

Hansjörg



Hansjörg Maurer schrieb:

>Hi
>
>I have finally managed to install one 64 bit driver with rpcclient
>command on samba 3.0.21-rc1
>
>I put the files to /var/lib/samba/printers/x64
>and installed them with
>rpcclient  -U Admin -c 'adddriver "Windows x64"
>"PDFprinter:pscript5.dll:PDFprinter.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:pscript.ntf"' 
>localhost
>
>rpcclient -U Admin -c 'enumdrivers 3' localhost
>shows the driver
>
>[Windows x64]
>Printer Driver Info 3:
>        Version: [3]
>        Driver Name: [PDFprinter]
>        Architecture: [Windows x64]
>        Driver Path: [\\\\LOCALHOST\print$\x64\3\pscript5.dll]
>        Datafile: [\\\\LOCALHOST\print$\x64\3\PDFprinter.ppd]
>        Configfile: [\\\\LOCALHOST\print$\x64\3\ps5ui.dll]
>        Helpfile: [\\\\LOCALHOST\print$\x64\3\pscript.hlp]
>
>        Dependentfiles: [\\\\LOCALHOST\print$\x64\3\pscript.ntf]
>
>        Monitorname: []
>        Defaultdatatype: [RAW]
>
> rpcclient -U Admin -c 'setdriver PDFprinter PDFprinter' localhost
>
>works fine to.
>
>But it I want to install a second printer, or this one again, entering
>the same command I get:
>
> rpcclient  -U Admin -c 'adddriver "Windows x64"
>"PDFprinter:pscript5.dll:PDFprinter.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:pscript.ntf"' 
>localhost
>Password:
>result was WERR_UNKNOWN_PRINTER_DRIVER
>
>I am able to remove the printer with
>rpcclient -U Admin -c 'deldriverex PDFprinter "Windows x64"' localhost
>
>and the installation works fine again.
>
>But I am unable to install more then one printers.
>
>If you need some debug information or the 64 bit ps driver files in
>order to test it, let me know.
>
>Greetings
>
>Hansjörg
>
Comment 1 Gerald (Jerry) Carter 2005-11-22 08:06:42 UTC
OK.  I see the problem.  It's an issue of determining
which file is mor recent.  This will take some work.
However, you do not need to upload the print driver again
for a second printer.  Just create the printer and bind 
the previously installed driver to the new object.
Comment 2 maurer 2005-12-02 00:53:58 UTC
> Just create the printer and bind 
> the previously installed driver to the new object.

Hi

unfortunatley that does nor work.

It seems that I have to run the addriver command
in order to make it working, and that fails, 
if the driver is in 64 bit format.
Even if I copy the new ppd file dierectly to the x64/3 subdirectory
(the driverfiles are allready there) a setdriver command does
not help.
I will try to comment out the failing get_file_version test.
Don't you think it might be possible to add a
second check for
SVAL(buf,PE_HEADER_MACHINE_OFFSET) != PE_HEADER_MACHINE_X64
or something like this as a simple workarround.

Greetings

Hansjörg


 
Comment 3 Gerald (Jerry) Carter 2006-04-24 03:48:06 UTC
I'll try to look at this before 3.0.23.  But maybe I 
can get someone to work on it for Google's SoC.
Comment 4 Gerald (Jerry) Carter 2006-05-19 09:57:28 UTC
not going to be fixed for 3.0.23
Comment 5 Gerald (Jerry) Carter 2007-03-19 12:43:44 UTC
Fixed for 3.0.25pre2.