HP-UX SNAplus2 R7 LUA Programmer's Guide
Designing and Writing LUA Applications
LUA Entry Points for Windows Applications
Note
The LUA VCB contains many parameters marked as “reserved”; some of these are
used internally by the SNAplus2 software, and others are not used in this version
but may be used in future versions. Your application must not attempt to access any
of these reserved parameters; instead, it must set the entire contents of the VCB to
zero to ensure that all of these parameters are zero, before it sets other parameters
that are used by the verb. This ensures that SNAplus2 will not misinterpret any of
its internally-used parameters, and also that your application will continue to work
with future SNAplus2 versions in which these parameters may be used to provide
new functions.
To set the VCB contents to zero, use
memset:
memset(vcb, 0, sizeof(vcb));
Returned Values
The entry point does not return a value. When the call returns, the application can examine the parameters in
the VCB to determine whether the verb has completed synchronously or will complete asynchronously. For more
information, see Section 2.2.1,
RUI.
Usage
Sometimes LUA is able to complete all the processing for a verb as soon as it is issued. When this happens,
the verb returns synchronously; the primary return code is set to a value other than
LUA_IN_PROGRESS, and the
lua_flag2.async bit is set to 0 (zero). (For information about these returned parameters, see Chapter 4, RUI Verbs.)
At other times, LUA must wait for information from the remote LU or from the node before it can complete the
verb. In this case, the verb returns asynchronously; the primary return code is set to
LUA_IN_PROGRESS, and the
lua_flag2.async bit is set to 1. The application can now perform other processing, or wait for notification from
LUA that the verb has completed. LUA issues this notification by setting the primary return code to its final value,
leaving the lua_flag2.async bit set to 1.
As part of the supplied VCB, the application supplies an event handle in the lua_post_handle parameter. The event
must be in the nonsignaled state and the handle must have EVENT_MODIFY_STATE access to the event. If the
verb completes synchronously, LUA does not signal this event handle. If the verb completes asynchronously, LUA
indicates the verb completion by signaling the event handle.
The application issues a WaitForSingleObject or WaitForMultipleObject call to wait on the event
handle. When the event is signaled, the application examines the primary return code and secondary return code to
check for errors.
It is not possible for an application to predict whether a particular verb will complete synchronously or asynchro-
nously.
2.2.2 WinRUIStartup
The application uses this function to register as a Windows RUI user, and to determine whether the LUA software
supports the Windows LUA version that it requires.
Function Call
int WINAPI WinRUIStartup (
WORD wVersionRequired;
LUADATA far * lpData;
)
typedef struct
{
29