Microsoft SDK for Java

IRemoteClassField::
GetConstantPoolItem

The GetConstantPoolItem method of the IRemoteClassField interface returns the raw contents of a constant pool item, typically for bytecode disassembly. Any indices contained within the constant pool item are converted from big-endian order to platform byte order.

Syntax

HRESULT GetConstantPoolItem(ULONG indexCP, BYTE **ppCPBytes, ULONG *plength)

Parameters

[in] indexCP Index in the constant pool of this class of the entry to be retrieved.
[out] ppCPBytes Returns the constant pool data of the requested entry.
[out] plength Returns the length of the returned constant pool entry, in bytes.

Return Value

S_OK Success. 

E_OUTOFMEMORY Insufficient memory.

Remarks

The constant pool items are defined by an initial tag byte that indicates the format of the item stored followed by the data for that constant pool entry.

CP_CONSTANT enum: CP_CONSTANT_UTF8

Value: 1

Description: A UCS Transformation Format (UTF-8) string used to represent a constant string value encoded in a structure with a 2-byte length preceding the string.

CP_CONSTANT enum: CP_CONSTANT_UNICODE

Value: 2

Description: A Unicode string with a two-byte length preceding the string.

CP_CONSTANT enum: CP_CONSTANT_INTEGER

Value: 3

Description: A 32-bit integer constant.

CP_CONSTANT enum: CP_CONSTANT_FLOAT

Value: 4

Description: A 32-bit single-precision floating point constant.

CP_CONSTANT enum: CP_CONSTANT_LONG

Value: 5

Description: A 64-bit long integer constant.

CP_CONSTANT enum: CP_CONSTANT_DOUBLE

Value: 6

Description: A 64-bit double precision floating-point constant.

CP_CONSTANT enum: CP_CONSTANT_CLASS

Value: 7

Description: A 16-bit index to a UTF-8 class name.

CP_CONSTANT enum: CP_CONSTANT_STRING

Value: 8

Description: A 16-bit index to a UTF-8 string.

CP_CONSTANT enum: CP_CONSTANT_FIELDREF

Value: 9

Description: A 16-bit index to a class, followed by a 16-bit index to a field name and type.

CP_CONSTANT enum: CP_CONSTANT_METHODREF

Value: 10

Description: A 16-bit index to a class, followed by a 16-bit index to a method name and type.

CP_CONSTANT enum: CP_CONSTANT_INTERFACEMETHODREF

Value: 11

Description: A 16-bit index to an interface, followed by a 16-bit index to a method name and type.

CP_CONSTANT enum: CP_CONSTANT_NAMEANDTYPE

Value: 12

Description: A 16-bit index to a UTF-8 name, followed by a 16-bit index to a UTF-8 field or method descriptor representing the type of the field or method. The field or method descriptor is a series of characters defined in The Java Virtual Machine Specification by Addison Wesley.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.