2.2.4.1.4.1 Initialize

The Initialize packet is transmitted from a TAPI client to a TAPI server in a remote procedure call. Sending this packet initializes the application's use of TAPI for the subsequent use of the phone functions in the TAPI. It registers the application's specified notification mechanism and returns the number of phone devices that are available to the application.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Req_Func

Reserved1

hPhoneApp

hInstance

InitContext

dwFriendlyNameOffset

dwNumDevs

dwModuleNameOffset

dwAPIVersion

Reserved2

Reserved3

Reserved4

Reserved5

Reserved6

Reserved7

VarData (variable)

...

Req_Func (4 bytes): The identifier of the function that will be invoked on the remote server. This value MUST be set to 106.

Return Values

On completion of ClientRequest, this field MUST contain the result of the encapsulated telephony request. A value of 0 indicates success and a PHONEERR_Constants value indicates failure. The remote server MUST complete this call synchronously.

Returns zero if the request succeeds or a negative error number if an error occurs. Common return values are:

Name

Value

PHONEERR_INVALAPPNAME

0x00000008

PHONEERR_INIFILECORRUPT

0x00000005

PHONEERR_INVALPOINTER

0x00000015

PHONEERR_NOMEM

0x0000001A

PHONEERR_OPERATIONFAILED

0x0000001C

PHONEERR_REINIT

0x00000023

PHONEERR_RESOURCEUNAVAIL

0x0000001F

PHONEERR_NODEVICE

0x00000018

PHONEERR_NODRIVER

0x00000019

PHONEERR_INVALPARAM

0x00000012

Reserved1 (4 bytes): An unsigned 32-bit integer. MUST be set to zero when sent and MUST be ignored on receipt.

hPhoneApp (4 bytes): An HPHONEAPP. Upon successful completion of the request, this field contains the client usage handle for TAPI phone requests.

hInstance (4 bytes): An unsigned 32-bit integer. Unused and MUST be ignored by the server.

InitContext (4 bytes): An unsigned 32-bit integer. The instance handle of the client application.

dwFriendlyNameOffset (4 bytes): An unsigned 32-bit integer. The offset, in bytes, from the beginning of the variable data area to a null-terminated Unicode string that contains the display name of the client. For remote clients, this name is the remote computer name.

dwNumDevs (4 bytes): An unsigned 32-bit integer. Upon successful completion of the request, this field MUST contain the number of phone devices that are available to the client.

dwModuleNameOffset (4 bytes): An unsigned 32-bit integer. The offset, in bytes, from the beginning of the variable data area to a null-terminated Unicode string that contains the display name of the client. For remote clients, this name MUST be the remote computer name.

dwAPIVersion (4 bytes): An unsigned 32-bit integer. The highest TAPI version that is supported by the client.

Reserved2 (4 bytes): An unsigned 32-bit integer. This field is used for padding and MUST be ignored on receipt. It can be any value.

Reserved3 (4 bytes): An unsigned 32-bit integer. This field is used for padding and MUST be ignored on receipt. It can be any value.

Reserved4 (4 bytes): An unsigned 32-bit integer. This field is used for padding and MUST be ignored on receipt. It can be any value.

Reserved5 (4 bytes): An unsigned 32-bit integer. This field is used for padding and MUST be ignored on receipt. It can be any value.

Reserved6 (4 bytes): An unsigned 32-bit integer. This field is used for padding and MUST be ignored on receipt. It can be any value.

Reserved7 (4 bytes): An unsigned 32-bit integer. This field is used for padding and MUST be ignored on receipt. It can be any value.

VarData (variable): Contains the null-terminated Unicode strings that are indicated by the dwFriendlyNameOffset and dwModuleNameOffset fields.

The contents of this field are DWORD-aligned.