Problem with enumprinterdataex

Martin Zielinski mz at seh.de
Tue Aug 22 14:00:53 GMT 2006


Gerald (Jerry) Carter wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Martin,
> 
>> The client system is Windows XP SP2.
>> When calling "enumprinterdataex" and receiving a response 
>> with a length that is not 4-byte aligned, I receive
>> an error 1783 (RPC_X_BAD_STUB_DATA)
> 

It's a bit difficult to see the error in a trace, because it is not 
visible in the trace.
You can only see, that the required buffer size differs from the offered.
Nonetheless I send you a trace and (mini) output of my test program).
I'm working on a method to enforce the situation that leads to that error.

> Can you send me the trace and details on how to reproduce this?
> I'm pretty hesitant to to change things unless I have some more
> proof.  Not that I don't believe you.  This is just really
> fiddly code.  What driver are you using?

I'm using the HP LaserJet 2820 PS driver.
And yes. Looks fiddly to me, too ;-)

> 
>> BTW the EnumPrinterDataEx call returns an aligned 
>> size for the required buffer (when asking for the buffer size)
>> although samba reports a different size.
> 
> I'd have to go back in time to remember whether or not
> that is intentional or not.
> 
> 
> cheers, jerry

One more thing (once I have the attention at this spot):

If there are registry values with more than 1 subkey:

HPPresetRoot\WatermarkPoolData\WatermarkPool:1

EnumPrinterDataEx (HPPresetRoot) would also return the complete string.

That's no problem, when reading the value.
But if you try to copy it to a Windows system you will create a key 
"HPPresetRoot" with the value name "WatermarkPoolData\WatermarkPool:1".

Not with the subkey ""WatermarkPoolData" and the value name 
"WatermarkPool:1".


Bye,

Martin
-- 
Martin Zielinski             mz at seh.de
Software Development
SEH Computertechnik GmbH     www.seh.de


More information about the samba-technical mailing list