home *** CD-ROM | disk | FTP | other *** search
- //*************************************************************************
- // (C)Copyright 1995-1999 Microsoft Corporation, All rights reserved.
- //
- // Note: This document is an early release of the final specification. It is
- // meant to specify and accompany software that is still in development. Some
- // of the information in this documentation may be inaccurate or may not be an
- // accurate representation of the functionality of the final specification
- // or software. Microsoft assumes no responsibility for any damages that might
- // occur either directly or indirectly from these inaccuracies. Microsoft may
- // have trademarks, copyrights, patents or pending patent applications, or
- // other intellectual property rights covering subject matter in this document.
- // The furnishing of this document does not give you a license to these
- // trademarks, copyrights, patents, or other intellectual property rights
- //
- // This header file describes the _Java Class File Attributes_ that allows
- // Java code to link directly to native libraries.
- //
- // Data type sizes:
- //
- // BYTE - 8 bits
- // WORD - 16 bits
- //
- // BYTEs and WORDs are all unsigned and stored in the .class in _Big-Endian_
- // format.
- //
- //
- // Alignment:
- // There is no implicit padding between the fields of the structures,
- // or any padding after the last field of any structure.
- //
- //
- // Attribute List:
- // ---------------
- //
- // Level Name Description
- // ----- ---- -----------
- // Class or Method NAT_L Stores information about a native method.
- //
- //
- //
- // All unused bits in Flag fields must be zero.
- //
- //*************************************************************************
-
- #ifndef NTVATTR_H
- #define NTVATTR_H
-
- #pragma pack(push)
- #pragma pack(1)
-
-
- //========================================================================
- // Attribute Name: NAT_L
- // Attribute Level: Class or Method
- //
- // This attribute can appear either on a class or a method. If it appears
- // on a class, it defines default values for all methods defined locally
- // to the class.
- //
- // Elements:
- // m_LinkType is one of the following:
- // NLT_RAW - Link using Raw Native Interface (RNI)
- // NLT_INHERIT - If at method level, use the link type of the
- // class-level NAT_L. If class-level NAT_L
- // specifies NLT_INHERIT, or if class-level NAT_L
- // is missing, use "ansi".
- // NLT_ANSI - Convert all characters and strings to Ansi.
- // Link to the Ansi entrypoint (suffixed by "A")
- // when available.
- // NLT_UNICODE - Convert all characters and strings to Unicode.
- // Link to the Unicode entrypoint (suffixed by "W")
- // when available.
- // NLT_DUAL - Choose between NLT_ANSI and NLT_UNICODE at runtime.
- // NLT_OLE - Ole calling conventions
- //
- //
- // m_Flags
- //
- // NLF_USESLASTWIN32ERRORMASK
- // If the NLF_LASTWIN32ERRORSAVE bit is set, the VM will call
- // the Win32 method GetLastError() after calling the native
- // method. The value retrieved will be stored and made available
- // to the client via the Java method
- // com.ms.dll.DllLib.getLastWin32Error().
- //
- // m_LibName_CPIndex
- // Index of Utf8 constant-pool index naming the library.
- // If the attribute appears on a method, this value can be 0
- // to indicate that the class NAT_L attribute is to be used.
- //
- // m_EntryName_CPIndex
- // Index of Utf8 constant-pool index naming the entrypoint.
- // This value can be 0 to indicate that the entrypoint name is
- // to be derived from the Java method name. If this attribute
- // appears on a class, the entryname must be 0.
- //
- //
- //========================================================================
-
- typedef struct {
- BYTE m_LinkType; //See NLT_* constants
- BYTE m_Flags; //Flag bits
- WORD m_LibName_CPIndex; //Utf8 CP-item naming library
- WORD m_EntryName_CPIndex; //Utf8 CP-item naming entry point
- } NativeLink;
-
-
- // Valid values for NativeLink.m_LinkType
-
- #define NLT_RAW 0
- #define NLT_INHERIT 1
- #define NLT_ANSI 2
- #define NLT_UNICODE 3
- #define NLT_DUAL 4 // Choose NLT_ANSI on Win9x, NLT_UNICODE on NT-based.
- #define NLT_OLE 5 // OLE calling conventions
- #define NLT_RESERVEDLIMIT 0x70 // Runtimes can use values higher than this for internal use.
-
- // Valid values for NativeLink.m_Flags
- #define NLF_LASTWIN32ERRORUNDECL 0x00
- #define NLF_LASTWIN32ERRORSAVE 0x01
- #define NLF_LASTWIN32ERRORIGNORE 0x02
- #define NLF_USESLASTWIN32ERRORMASK 0x03
-
- #define NLF_ALL (NLF_USESLASTWIN32ERRORMASK) // mask of all legal flags
-
-
- #pragma pack(pop)
-
- #endif // NTVATTR_H
-