LUA Considerations on Windows Server 2003 or Windows 2000

This topic summarizes information for developing Win32 logical unit application (LUA) applications for Microsoft Windows Server 2003 or Windows 2000 Server.

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 Windows Server 2003 or Windows 2000 to indicate the hardware. These same macros are used by Host Integration Server 2009, 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:



To receive data asynchronously, an event handle is passed in the semaphore field of the verb control block (VCB). This event must be in the non-signaled state when passed to LUA, and the handle must have EVENT_MODIFY_STATE access to the event.

Library names

To support the coexistence of Win16 and Win32 API libraries on the same computer, the Win32 dynamic-link library (DLL) names were changed from the names used by Win16 API libraries. Win32 stub DLL libraries using the old names are supplied with Host Integration Server 2009 so that older applications will still run, although these platforms are no longer supported.

Old DLL names New DLL names





The new DLL names should be used for all new applications intended to run on Host Integration Server.

To be dynamically linked to LUA at load time, you must do one of the following at link time:

  • Insert the following IMPORTS statements in the definition (.def) file used to link the application:

    (For RUI)

    (For SLI)

  • Link the application to WINRUI.LIB (for RUI) or WINSLI.LIB (for SLI), which contain the entry-point linkage information.

An LUA application can have multiple threads that issue verbs. LUA for the Win32 system makes provisions for multithreading processes on Windows Server 2003 or Windows 2000. A process contains one or more threads of execution. All references to threads refer to actual threads in a multithreaded Windows Server 2003 or Windows 2000.

For performance considerations, the VCBs are not packed. VCB structure member elements after the first element are aligned on either the size of the member type or DWORD boundaries, whichever is smaller. As a result, DWORDs are aligned on DWORD boundaries, WORDs are aligned on WORD boundaries, and BYTEs are aligned on BYTE boundaries. This means, for example, that there is a 2-byte gap between the primary and secondary return codes. Therefore, the elements in a VCB should only be accessed using the structures provided.

This option for structure and union member alignment is the default behavior for Microsoft C/C++ compilers. For compatibility with the supplied LUA libraries, make sure to use an equivalent structure and union member packing option when using other C/C++ compilers or when explicitly specifying a structure alignment option when using Microsoft compilers.

All LUA applications for the Windows Server 2003 or Windows 2000 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.

A Windows Server 2003 or Windows 2000 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.

For an application to be dynamically linked to LUA at run time, it must issue the following calls:

  • LoadLibrary to load the specified library module for Windows LUA. That is, WINRUI32.DLL (for RUI), and WINSLI32.DLL (for SLI).

  • GetProcAddress to retrieve the address of the LUA function entry points exported by the DLL. For RUI, the function entry points are RUI, WinRUI, WinRUIStartup, and WinRUICleanup. For SLI, the function entry points are SLI, WinSLI, WinSLIStartup, and WinSLICleanup.

Community Additions