home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 39 / IOPROG_39.ISO / SOFT / sdkjava40.exe / data1.cab / fg_Include / Include / ntvattr.h < prev   
Encoding:
C/C++ Source or Header  |  2000-05-04  |  4.9 KB  |  130 lines

  1. //*************************************************************************
  2. // (C)Copyright 1995-1999 Microsoft Corporation, All rights reserved.
  3. //
  4. // Note: This document is an early release of the final specification. It is
  5. // meant to specify and accompany software that is still in development. Some
  6. // of the information in this documentation may be inaccurate or may not be an
  7. // accurate representation of the functionality of the final specification
  8. // or software. Microsoft assumes no responsibility for any damages that might
  9. // occur either directly or indirectly from these inaccuracies. Microsoft may
  10. // have trademarks, copyrights, patents or pending patent applications, or
  11. // other intellectual property rights covering subject matter in this document.
  12. // The furnishing of this document does not give you a license to these
  13. // trademarks, copyrights, patents, or other intellectual property rights
  14. //
  15. // This header file describes the _Java Class File Attributes_ that allows
  16. // Java code to link directly to native libraries.
  17. //
  18. // Data type sizes:
  19. //
  20. //   BYTE       - 8 bits
  21. //   WORD       - 16 bits
  22. //
  23. // BYTEs and WORDs are all unsigned and stored in the .class in _Big-Endian_
  24. // format.
  25. //
  26. //
  27. // Alignment:
  28. //    There is no implicit padding between the fields of the structures,
  29. //    or any padding after the last field of any structure.
  30. //
  31. //
  32. // Attribute List:
  33. // ---------------
  34. //
  35. //   Level              Name        Description
  36. //   -----              ----        -----------
  37. //   Class or Method    NAT_L       Stores information about a native method.
  38. //
  39. //
  40. //
  41. // All unused bits in Flag fields must be zero.
  42. //
  43. //*************************************************************************
  44.  
  45. #ifndef NTVATTR_H
  46. #define NTVATTR_H
  47.  
  48. #pragma pack(push)
  49. #pragma pack(1)
  50.  
  51.  
  52. //========================================================================
  53. // Attribute Name:  NAT_L
  54. // Attribute Level: Class or Method
  55. //
  56. // This attribute can appear either on a class or a method. If it appears
  57. // on a class, it defines default values for all methods defined locally
  58. // to the class.  
  59. //
  60. // Elements:
  61. //    m_LinkType is one of the following:
  62. //        NLT_RAW       - Link using Raw Native Interface (RNI)
  63. //        NLT_INHERIT   - If at method level, use the link type of the
  64. //                        class-level NAT_L. If class-level NAT_L
  65. //                        specifies NLT_INHERIT, or if class-level NAT_L
  66. //                        is missing, use "ansi".
  67. //        NLT_ANSI      - Convert all characters and strings to Ansi.
  68. //                        Link to the Ansi entrypoint (suffixed by "A")
  69. //                        when available.
  70. //        NLT_UNICODE   - Convert all characters and strings to Unicode.
  71. //                        Link to the Unicode entrypoint (suffixed by "W")
  72. //                        when available.
  73. //        NLT_DUAL      - Choose between NLT_ANSI and NLT_UNICODE at runtime.
  74. //        NLT_OLE       - Ole calling conventions
  75. //
  76. //
  77. //    m_Flags
  78. //
  79. //        NLF_USESLASTWIN32ERRORMASK
  80. //            If the NLF_LASTWIN32ERRORSAVE bit is set, the VM will call
  81. //            the Win32 method GetLastError() after calling the native
  82. //            method.  The value retrieved will be stored and made available
  83. //            to the client via the Java method
  84. //            com.ms.dll.DllLib.getLastWin32Error().
  85. //
  86. //    m_LibName_CPIndex
  87. //        Index of Utf8 constant-pool index naming the library.
  88. //        If the attribute appears on a method, this value can be 0
  89. //        to indicate that the class NAT_L attribute is to be used.
  90. //
  91. //    m_EntryName_CPIndex
  92. //        Index of Utf8 constant-pool index naming the entrypoint.
  93. //        This value can be 0 to indicate that the entrypoint name is
  94. //        to be derived from the Java method name. If this attribute
  95. //        appears on a class, the entryname must be 0.
  96. //
  97. // 
  98. //========================================================================
  99.  
  100. typedef struct {
  101.     BYTE    m_LinkType;          //See NLT_* constants
  102.     BYTE    m_Flags;             //Flag bits
  103.     WORD    m_LibName_CPIndex;   //Utf8 CP-item naming library
  104.     WORD    m_EntryName_CPIndex; //Utf8 CP-item naming entry point
  105. } NativeLink;
  106.  
  107.  
  108. // Valid values for NativeLink.m_LinkType
  109.  
  110. #define NLT_RAW     0
  111. #define NLT_INHERIT 1
  112. #define NLT_ANSI    2
  113. #define NLT_UNICODE 3
  114. #define NLT_DUAL    4 // Choose NLT_ANSI on Win9x, NLT_UNICODE on NT-based.
  115. #define NLT_OLE     5 // OLE calling conventions
  116. #define NLT_RESERVEDLIMIT 0x70 // Runtimes can use values higher than this for internal use.
  117.  
  118. // Valid values for NativeLink.m_Flags
  119. #define NLF_LASTWIN32ERRORUNDECL    0x00
  120. #define NLF_LASTWIN32ERRORSAVE      0x01
  121. #define NLF_LASTWIN32ERRORIGNORE    0x02
  122. #define NLF_USESLASTWIN32ERRORMASK  0x03
  123.  
  124. #define NLF_ALL          (NLF_USESLASTWIN32ERRORMASK)  // mask of all legal flags
  125.  
  126.  
  127. #pragma pack(pop)
  128.  
  129. #endif // NTVATTR_H
  130.