3.3.4.2 RemoteSPEventProc (Opnum 1)

The RemoteSPEventProc method is called by the server to "push" completion notifications and unsolicited events to the client. The server MUST call this method of the remotesp interface with the endpoint and protocol sequence as specified by the connection-oriented client in the ClientAttach RPC packet.

 void RemoteSPEventProc(
   [in] PCONTEXT_HANDLE_TYPE2 phContext,
   [in, length_is(lSize), size_is(lSize)] 
     unsigned char pBuffer[],
   [in] long lSize
 );

phContext: Client handle of type PCONTEXT_HANDLE_TYPE2.

pBuffer: Packet MUST contain a list of ASYNCEVENTMSG structures, each of which MUST be ASYNCEVENTMSG.TotalSize bytes in size.

lSize: Size of the pBuffer.

Return Values: This method has no return values.

Exceptions Thrown:

No exceptions are thrown beyond those thrown by the underlying RPC protocol, as specified in [MS-RPCE].

The opnum field value for this method is 1.

When processing a notification, remotesp MUST do the following:

  • Fail if the lsize is a negative value, not DWORD-aligned, or less than the size of the fixed portion of the ASYNCEVENTMSG structure.

  • Fail if any of ASYNCEVENTMSG structure present in the buffer does not have a valid TotalSize. TotalSize is invalid if it is less than the size of the fixed portion of the ASYNCEVENTMSG packet, it is not DWORD-aligned, or it overflows the pBuffer.

  • Fail if the size of pBuffer has data other than a list of ASYNCEVENTMSG structures.

  • Fail if ASYNCEVENTMSG.InitContext is an invalid value.

Depending on the value of ASYNCEVENTMSG.Msg, remotesp performs additional checks described as follows:

For Msg = 0x00000008(LINE_LINEDEVSTATE), 0x00000003(LINE_CLOSE), 0x00000000(LINE_ADDRESSSTATE), 0x00000016 (LINE_AGENTSTATUS), 0x0000001B (LINE_AGENTSESSIONSTATUS), 0x0000001C (LINE_QUEUESTATUS) , 0x0000001D (LINE_AGENTSTATUSEX), 0x0000001E (LINE_GROUPSTATUS), 0x0000001F (LINE_PROXYSTATUS), 0x00000001 (LINE_CALLINFO), 0x00000002 (LINE_CALLSTATE), 0x00000007 (LINE_GENERATE), 0x00000009 (LINE_MONITORDIGITS), 0x0000000A (LINE_MONITORMEDIA), 0x0000000B  (LINE_MONITORTONE), 0x00000017 (LINE_APPNEWCALL):

  • Ignore the response if hRemoteLine is set and is an invalid handle.

For Msg = 0x0000000C (LINE_REPLY), 0x00000011 (PHONE_REPLY):

  • Ignore the response if dwRemoteRequestID is invalid.

For Msg = 0x00000012 (PHONE_STATE), 0x0000000F (PHONE_CLOSE), 0x00000010 (PHONE_DEVSPECIFIC):

  • Ignore the response if hRemotePhone is set and is an invalid handle.

For Msg= 0x00000013 (LINE_CREATE), 0x00000014 (PHONE_CREATE):

  • Ignore the response if the device identifier passed in Param1 is invalid.

For Msg = 0x00000019 (LINE_REMOVE), 0x0000001A (PHONE_REMOVE):

  • Ignore the response if Param1 is an invalid handle.

For Msg = 0x0000000E (PHONE_BUTTON):

  • Ignore the response if hDevice is invalid.

For Msg = 0x00000015 (LINE_AGENTSPECIFIC), 0x00000004 (LINE_DEVSPECIFIC), 0x00000005 (LINE_DEVSPECIFICFEATURE):

  • Ignore the response if param4 is set and is invalid.

  • Ignore the response if param4 is not set and hDevice is invalid.