Windows NT and Windows 95 Considerations

This section summarizes information for developing Win32® LUA applications for Microsoft® Windows NT® or Microsoft® Windows® 95.

Byte ordering
The values of constants defined in the WINLUA.H file are dependent on the byte ordering of the hardware used. Macros are used to set the constants to the correct value.

Currently, the include files in the Windows NT system use the i386, ALPHA, MIPS, and PPC macros to indicate the hardware. These same macros are used by Microsoft® SNA Server, along with the Win32 macro, to indicate the byte ordering needs. The macros must be defined in the application or on the command line when building the application.

For example, the primary return code of lua_parameter_check is defined to have a value of 0x0001. Depending on the environment, the constant LUA_PARAMETER_CHECK may or may not be 0x0001. Some formats define the value as it appears in memory; others define it as a 2-byte variable. Because it cannot be assumed that an application will always use provided constants rather than hardwired values, a macro can be defined to swap the bytes. The following example shows how the macro can be used:

#define LUA_PARAMETER_CHECK LUA_FLIPI (0X0001)
 
Events
To receive data asynchronously, an event handle is passed in the semaphore field of the VCB. This event must be in the nonsignaled state when passed to LUA, and the handle must have EVENT_MODIFY_STATE access to the event.
Library names
In preparation for the coexistence of Win16 and Win32 API libraries on the same computer, the Win32 DLL names have been changed. Win32 stub DLL libraries using the old names are supplied with SNA Server so that older applications are still supported.
Old DLL names New DLL names
WINRUI.DLL WINRUI32.DLL
WINSLI.DLL WINSLI32.DLL

The old DLL names should be used for Win32-based applications that are required to run on SNA Server version 2.0. The new DLL names should be used for Win32-based applications that are intended to run only on SNA Server version 2.1 or later.

If you intend your Win32-based application to be used with SNA Server version 2.0, you should link with the libraries included with SNA Server version 2.0. Otherwise, use the new libraries provided with SNA Server version 2.1 or later.

Load-time linking
To be dynamically linked to LUA at load time, you must do one of the following at link time:
Multiple threads
An LUA application can have multiple threads that issue verbs. LUA for the Win32 system makes provisions for multithreaded Windows NT and Windows 95 processes. A process contains one or more threads of execution. All references to threads refer to actual threads in a multithreaded Windows NT or Windows 95 environment.
Packing
For performance considerations, the VCBs are not packed. As a result, DWORDs are on DWORD boundaries, WORDs on WORDs, and BYTEs on BYTEs. This means, for example, that there is a 2-byte gap between the primary and secondary return codes. VCBs should be accessed using the structures provided.
Registering and deregistering applications
All LUA applications for the Windows NT or Windows 95 system must call the Windows SNA extension WinRUIStartup or WinSLIStartup at the beginning of the session to register the application and WinRUICleanup or WinSLICleanup at the end of the session to deregister the application.
Restrictions on 3270-style LUs
A Windows NT or Windows 95 process cannot access 3270-style LUs from both the Function Management Interface (FMI) and LUA APIs at the same time. However, the process can use the LUA APIs to access LUA LUs while using FMI APIs to access 3270-style LUs.
Run-time linking
For an application to be dynamically linked to LUA at run time, it must issue the following calls: