## Printer Device Driver

[prev][next][parent][TOC]

### GplThreadStart

Description

This function starts or updates thread parameters. It creates semaphores and buffers, committing system resources.

Format

    BOOL APIENTRY GplThreadStart( HTHREAD  hThread,

                                  LHANDLE  hSpooler,

                                  HFILE    hDev,

                                  ULONG    ulBufferSize,

                                  USHORT   usMaxBuffers,

                                  UCHAR    ucAbortChar,

                                  ULONG    ulAbortCharCount,

                                  ULONG    ulAbortBufferSize,

                                  PBYTE    pbAbortBuffer,

                                  PSZ      pszAbortString,

                                  PSZ      pszLogAddress,

                                  PSZ      pszWriteError,

                                  PSZ      pszDeviceDescription,

                                  LONG     lDCType );

Parameters

hThread (HTHREAD) Instance handle of thread to start. Returned by GplThreadCreateInstance.

hSpooler (LHANDLE) Handle to Spooler (OD_QUEUED). Returned from SplQmOpen. May be zero (0) if hDev is supplied.

hDev (HFILE) Handle to Device (OD_DIRECT). Returned from PrtOpen. May be zero (0) if hSpooler is supplied.

ulBufferSize (ULONG) Size of buffer allocations. May be 0 to use default size.

usMaxBuffers (USHORT) Maximum number of buffers to create. May be 0 to use default # of buffers.

ucAbortChar (UCHAR) Character to send before the abort string. ucAbortChar can be used for devices that need to be sent a number of bytes before the abort string can be sent. ulAbortChar is sent first during the abort sequence.

ulAbortCharCount (ULONG) Number of ucAbortChars to send to the device.

ulAbortBufferSize (ULONG) Abort buffer size in bytes.

pbAbortBuffer (PBYTE) Pointer to buffer to send when aborting a job. Buffer must not be deleted until after GplThreadEnd. ulAbortBuffer is sent after ulAbortChar.

pszAbortString (PSZ) Abort job reset command for your specific printer language. May be NULL and no string will be sent. pszAbortString is sent last in the abort sequence.

pszLogAddress (PSZ) File or port name (for example, LPT1). Used for error reporting. May be NULL.

pszWriteError (PSZ) Error prompt string to display in a SplMsgBox (for example, "Unable to write to printer"). May be NULL.

pszDeviceDescription (PSZ) Device description to display in a SplMsgBox ( for example, "Laserprinter"). May be NULL.

lDCType (LONG) DC type (OD_QUEUED, OD_DIRECT).

Returns

Success TRUE
Failure FALSE

Notes

ulAbortChar is sent first during the abort sequence.
ulAbortBuffer is sent after ulAbortChar.
pszAbortString is sent last in the abort sequence.