SSubmitJobEx4 and SSubmitJobEx5

The SSubmitJobEx4 and SSubmitJobEx5 functions submit a request to ITP/Server using TCP/IP sockets as communication mechanism. Compared to the SSubmitJob function, these functions add support for the ExchangeData and ValidateFileName callback APIs, and for specifying ITP/Server session IDs. The two functions provide the same functionality, except that the callback functions for SSubmitJobEx4 use the cdecl calling convention, while the callback functions for SSubmitJobEx5 use the stdcall calling convention.

These functions replace the older SSubmitJobEx, SSubmitJobEx2 and SSubmitJobEx3 functions. The older functions are still available, but we advise to use the new functions. For descriptions of the older functions, please refer to earlier manuals of ITP/Server. The function SSubmitJobEx is described in manuals prior to ITP/Server 3.1.8. The function SSubmitJobEx3 is described in manuals between ITP/Server 3.1.9 and ITP/Server 3.2.19. The function SSubmitJobEx2 has never been publicly documented.

BOOL WINAPI SSubmitJobEx4 (
TCHAR *Host, // pointer to host
TCHAR *Port, // pointer to port
TCHAR *JobID, // pointer to Job Identifier
BOOL Sync, // wait for request to finish
TCHAR **Parameters, // parameter list, starting with
// the name of the requested Service
TCHAR *Result, // buffer for result text
int Length, // size of buffer
SUBMITJOB4 *Extended // extended parameters
);
BOOL WINAPI SSubmitJobEx5 (
TCHAR *Host, // pointer to host
TCHAR *Port, // pointer to port
TCHAR *JobID, // pointer to Job Identifier
BOOL Sync, // wait for request to finish
TCHAR **Parameters, // parameter list, starting with
// the name of the requested Service
TCHAR *Result, // buffer for result text
int Length, // size of buffer
SUBMITJOB5 *Extended // extended parameters
);
Parameters
Host

Pointer to a null-terminated string that contains the name of the server running ITP/Server. The name can be specified either in (IPv4) Internet Protocol dotted address notation (a.b.c.d) or as a resolvable host name.

Port

Pointer to a null-terminated string that contains the name of the port to connect to. The port can be specified either in numerical format or as a resolvable port name.

JobID

Pointer to a null-terminated string that contains the Job Identifier for the job.

Sync

Specifies whether or not the function should will until the job has been serviced. This parameter can have one of the following values:

Value

Meaning

FALSE

The function will return as soon as the request has been queued for processing.

TRUE

The function will wait until the request has been processed by ITP/Server.

Parameters

Pointer to a null-terminated list of string pointers. Every string pointer in this list points to a parameter that is passed with the job to ITP/Server. The first parameter should be the name of the requested Service. For all parameters, the meaning of the empty string ("") is that the parameter is not passed at all, and ITP/Server will substitute the default value (or generate an error if no default value has been specified).

If Parameters is NULL no parameters are passed with the job.

Result

Pointer to a buffer that receives an error message if the submission of the job or the processing of the job failed.

Length

Size of the buffer indicated by Result in characters.

Extended

Pointer to a SUBMITJOB4 (for SSubmitJobEx4) or SUBMITJOB5 (for SSubmitJobEx5) data-structure that holds additional parameters to the function. Refer to below for a definition of these data structures.

This parameter can be NULL if none of the extended parameters is used.

Return values

If the Sync parameter is FALSE, the SSubmitJobEx4 and SSubmitJobEx5 functions return when ITP/Server has queued the request. If the Sync parameter is TRUE, the SSubmitJobEx4 and SSubmitJobEx5 functions return when ITP/Server has finished servicing the request.

If the functions succeed, the return value is non-zero.

If the functions fail, the return value is zero. The buffer indicated by Result contains an error message explaining the cause of the failure.

Remarks

The Length parameter contains the size of the Result buffer in characters, not bytes.

The error message that is placed in the Result buffer on failure will be truncated if the buffer is too small. A size of at least 1024 characters is advised.

The string passed to the Progress function is a static buffer and will be released by the SSubmitJobEx4/SSubmitJobEx5 function after the Progress function returns.

The SSubmitJobEx4 and SSubmitJobEx5 functions will send the name of the user logged on at the workstation as the User of the job.

QuickInfo

Header: Declared in s_api.h.

Import Library: Use sock_api.lib.

Unicode: Implemented as both Unicode and ASCII.