2.2.4.1.1.1 Initialize

The Initialize packet is transmitted from a TAPI client to a TAPI server in a remote procedure call. Sending this packet initializes application use of TAPI for subsequent use of the line abstraction. It registers the specified notification mechanism of the application and returns the number of line devices that are available to the application. A line device is any device that provides an implementation for the line-prefixed functions in TAPI.


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

hLineApp

hInstance

InitContext

dwFriendlyNameOffset

dwNumDevs

dwModuleNameOffset

dwAPIVersion

Reserved2

Reserved3

Reserved4

Reserved5

Reserved6

Reserved7

VarData (variable)

...

Req_Func (4 bytes): An unsigned 32-bit integer. The identifier of the function that is invoked on the remote server. This value MUST be set to 47.

Return Values

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

Zero indicates success. A negative error number indicates that an error occurred. The following table shows the return values for this function.

Value

Meaning

LINEERR_INVALAPPNAME

0x80000015

An invalid application name.

LINEERR_OPERATIONFAILED

0x80000048

The operation failed.

LINEERR_INIFILECORRUPT

0x8000000E

The INI file is corrupted.

LINEERR_INVALPOINTER

0x80000035

An invalid pointer.

LINEERR_REINIT

0x80000052

The application attempted to initialize TAPI twice.

LINEERR_NOMEM

0x80000044

No memory available.

LINEERR_INVALPARAM

0x80000032

An invalid parameter.

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

hLineApp (4 bytes): An HLINEAPP. Upon successful completion of the request, this field contains the client's usage handle for TAPI line requests.

hInstance (4 bytes): An unsigned 32-bit integer. This field is an instance handle of the client application. The application can pass NULL for this parameter, in which case, TAPI uses the module handle of the root executable of the process (for purposes of identifying call handoff targets and media mode priorities).

InitContext (4 bytes): An unsigned 32-bit integer. This field is an opaque value that the server uses for ASYNCEVENTMSG.InitContext for all line packets that are intended for this client within the scope of the hLineApp.

dwFriendlyNameOffset (4 bytes): An unsigned 32-bit integer. This field is 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 MUST be 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 line devices that are available to the client.

dwModuleNameOffset (4 bytes): An unsigned 32-bit integer. This field is 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 MUST be the remote computer name.

dwAPIVersion (4 bytes): An unsigned 32-bit integer. This field is 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 MUST be DWORD-aligned, as specified in [MS-DTYP] section 2.2.9.