none
PTMergeAndValidatePrintTicket() doesn't do what it promises? RRS feed

  • Question

  • I am developing XpsDrv printer driver for Windows 7 and trying to merge print tickets in my filter module. For this purpose I use PTMergeAndValidatePrintTicket() function.

    The problem is: PTMergeAndValidatePrintTicket() seems to validate PrintCapabilities and both PrintTickets Ok, but always returns BasePrintTicket without merge settings with those from DeltaPrintTicket and always return OLE_S_STATIC (error?).

    Could someone help me, please?

    Here is my parameter, which is always set to 200 in the resulting PrintTicket, regardless the value in the page-scope DeltaPrintTicket:

    PrintCapabilities for my device:

    <psf:PrintCapabilities

    ... <psf:ParameterDef name="ns0000:PagePilotlaserSpeed"> <psf:Property name="psf:DataType"> <psf:Value xsi:type="xsd:QName">xsd:integer</psf:Value> </psf:Property> <psf:Property name="psf:DefaultValue"> <psf:Value xsi:type="xsd:integer">200</psf:Value> </psf:Property> <psf:Property name="psf:MaxValue"> <psf:Value xsi:type="xsd:integer">1000</psf:Value> </psf:Property> <psf:Property name="psf:MinValue"> <psf:Value xsi:type="xsd:integer">0</psf:Value> </psf:Property> <psf:Property name="psf:Mandatory"> <psf:Value xsi:type="xsd:QName">psk:Unconditional</psf:Value> </psf:Property> <psf:Property name="psf:UnitType"> <psf:Value xsi:type="xsd:string">points</psf:Value> </psf:Property> <psf:Property name="psf:Multiple"> <psf:Value xsi:type="xsd:integer">1</psf:Value> </psf:Property> <psf:Property name="psf:DisplayName"> <psf:Value xsi:type="xsd:string">PilotlaserSpeed</psf:Value> </psf:Property> </psf:ParameterDef> </psf:PrintCapabilities>

    BasePrintTicket for page scope:

    <?xml version="1.0" encoding="UTF-8"?>
    <psf:PrintTicket 
    ...
    <psf:ParameterInit name="ns0000:PagePilotlaserSpeed">
    <psf:Value xsi:type="xsd:integer">200</psf:Value> 
    </psf:ParameterInit>
    </psf:PrintTicket>
    

    and the DeltaPrintTicket for page scope:

    <?xml version="1.0" encoding="UTF-8"?>
    <psf:PrintTicket 
    ...
    <psf:ParameterInit name="ns0000:PagePilotlaserSpeed">
    <psf:Value xsi:type="xsd:integer">350</psf:Value> 
    </psf:ParameterInit>
    </psf:PrintTicket>

    The result in merged PrintTicket is 200!

    Does anyone have an idea? Thanx in advance for any advice!

    Tuesday, January 13, 2015 2:45 PM

Answers

  • Hey Malkin,

    You've stumbled upon two separate issues.

    1) HRESULT is OLE_S_STATIC - This is the result of a colliding HRESULT. The actual constant is defined in prntvpt.h and is S_PT_NO_CONFLICT, so that part is ok, albeit confusing. I'll file a bug for the next version of Windows to see if we can untangle that conflict.

    2) ParameterInit values are not merged appropriately. This is a bug in our PrintTicket implementation and there is no workaround. I would encourage you to open a case with Microsoft Support if this is blocking you and seek a fix that way. In parallel, I will file an issue on our internal bug database for the next version of Windows.

    I cannot guarantee that we will address either issue, but we will investigate both.

    Thanks!

    Justin

    Thursday, January 15, 2015 12:57 AM

All replies

  • Hey Malkin,

    You've stumbled upon two separate issues.

    1) HRESULT is OLE_S_STATIC - This is the result of a colliding HRESULT. The actual constant is defined in prntvpt.h and is S_PT_NO_CONFLICT, so that part is ok, albeit confusing. I'll file a bug for the next version of Windows to see if we can untangle that conflict.

    2) ParameterInit values are not merged appropriately. This is a bug in our PrintTicket implementation and there is no workaround. I would encourage you to open a case with Microsoft Support if this is blocking you and seek a fix that way. In parallel, I will file an issue on our internal bug database for the next version of Windows.

    I cannot guarantee that we will address either issue, but we will investigate both.

    Thanks!

    Justin

    Thursday, January 15, 2015 12:57 AM
  • Thank you very much, Justin!

    I built in a workaround by just copying ParameterInit values from page-scope PrintTicket to resulting PrintTicket, so it works for now. But I am a little bit concerned whether such a patch could be a problem to pass HCK tests?

    Wednesday, January 21, 2015 2:56 PM