Share via


3.1.4.2.11 RpcPlayGdiScriptOnPrinterIC (Opnum 41)

RpcPlayGdiScriptOnPrinterIC returns font information for a printer connection. UNIVERSAL_FONT_ID (section 2.2.2.12) structures are used to identify the fonts.

 DWORD RpcPlayGdiScriptOnPrinterIC(
   [in] GDI_HANDLE hPrinterIC,
   [in, size_is(cIn)] BYTE* pIn,
   [in] DWORD cIn,
   [out, size_is(cOut)] BYTE* pOut,
   [in] DWORD cOut,
   [in] DWORD ul
 );

hPrinterIC: A printer information context handle (section 2.2.1.1.2) that was returned by RpcCreatePrinterIC (section 3.1.4.2.10).

pIn: A pointer that SHOULD be set to NULL when sent and MUST be ignored on receipt.

cIn: A value that SHOULD be set to zero when sent and MUST be ignored on receipt.

pOut: A pointer to a buffer, the size and contents of which are determined by the value of the cOut parameter.

cOut: The size, in bytes, of the buffer pointed to by pOut.

ul: A value that SHOULD be set to zero when sent and MUST be ignored on receipt.

Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful completion or a nonzero Windows error code to indicate failure [MS-ERREF].

Upon receiving this message, the server MUST validate the following:

  • Verify that hPrinterIC is a valid printer information context handle. This method SHOULD assume that this handle can be used without further access checks.<284>

  • Verify that the value of the pOut parameter is not NULL.<285>

  • Verify the value of the cOut parameter as follows:

    • If cOut is less than 0x00000004, ERROR_NOT_ENOUGH_MEMORY SHOULD be returned [MS-ERREF].

    • If cOut is equal to 0x00000004, proceed.

    • If cOut is greater than 0x00000004, it specifies the size of the buffer pointed to by the pOut parameter. In this case, the minimum value of cOut is computed as follows:

       ((*pOut) * (size of(UNIVERSAL_FONT_ID))) + 0x00000004
      

      The buffer pointed to by pOut MUST be large enough to contain all the font information plus a DWORD for the number of fonts. If the value of cOut is less than this minimum, ERROR_NOT_ENOUGH_MEMORY SHOULD be returned.

If parameter validation fails, the server MUST fail the operation immediately and return a nonzero error response to the client. Otherwise, the server MUST process the message and compose a response to the client as follows:

  • If cOut is equal to 0x00000004, the value of pOut is a pointer to a DWORD that specifies the number of UNIVERSAL_FONT_ID structures to be returned by the next call to this method.

  • If cOut is greater than 0x00000004, font information MUST be returned as follows:

    1. Query the fonts that are available on the server.

    2. Write the DWORD number of fonts to the buffer ___location that is pointed to by the value of the pOut parameter.

    3. Write UNIVERSAL_FONT_ID structures for the fonts to the buffer ___location that is pointed to by the value of pOut plus 0x00000004.

    A print client MAY assume that the fonts identified by the UNIVERSAL_FONT_ID structures are available on the print server for use in spooled print jobs.<286>

  • Return the status of the operation.

Except for diagnostic purposes, the server state, as visible to the client through this or any other protocol, MUST NOT change as a result of processing this call.