SSubmitJobMsg function

The function SSubmitJobMsg submits a job to KCM Core using TCP/IP sockets as the communication mechanism. The job submission process is handled in a separate thread. After the job has been processed, a message is sent to the controlling window.

BOOL WINAPI SSubmitJobMsg (
TCHAR  *Host,	// pointer to host
TCHAR  *Port,	// pointer to port
TCHAR  *JobID,	// pointer to Job Identifier
TCHAR **Parameters,	// parameter list, starting with
                    // the name of the requested Service
TCHAR  *Result,	// buffer for result text
int     Length,	// size of buffer
HANDLE  hWindow	// handle of the controlling window
);

The SSubmitJobMsg function has the following parameters:

  • Host

    Pointer to a null-terminated string that contains the name of the server running KCM Core. You can specify the name 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. You can specify the port either in a numerical format or as a Service name resolved through any available service databases.

  • JobID

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

  • Parameters

    Pointer to a null-terminated list of string pointers. Every string pointer in this list points to a parameter passed with the request to KCM Core. 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 KCM Core 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. The error message placed in the Result buffer on failure is truncated if the buffer is too small. A size of at least 1024 characters is advised.

  • Length

    Size of the buffer indicated by Result in characters, not bytes.

  • hWindow

    Handle of the controlling window. SSubmitJobMsg sends this window a message after the job has been processed.

The SSubmitJobMsg function creates a thread to wait for the synchronous processing of the request. The SSubmitJobMsg returns TRUE if this thread has been created successfully, and FALSE if the creation of the thread failed. In case SSubmitJobMsg returns FALSE, the buffer indicated by Result contains an error message explaining why the thread could not be started.

The SSubmitJobMsg function sends an ITPDS_RESULT message to the hWindow window after the request has been processed. The wParam parameter of this message is TRUE if the request succeeded; otherwise, it returns FALSE. If the request failed, the lParam parameter points to a NULL-terminated string indicating the cause of the failure.

Use the RegisterWindowMessage function from the Microsoft Windows API to retrieve the identifier for the ITPDS_RESULT message.

The parameters passed to the function SSubmitJobMsg should not be freed until the reply message has been received.

The SSubmitJobMsg function sends 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.