Top Description Inners Fields
com.sun.jna.platform.win32

public Interface Guid

Imports
java.security.SecureRandom, java.util.Arrays, com.sun.jna.Pointer, .PointerType, .Structure, .Structure.FieldOrder

Ported from Guid.h. Microsoft Windows SDK 6.0A.
Author
dblock[at]dblock.org

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Guid.CLSID

The Class CLSID.

public static class
Guid.GUID

The Class GUID.

public static class
Guid.IID

The Class IID.

public static class
Guid.REFIID

REFIID is a pointer to an IID.

Field Summary

Modifier and TypeField and Description
public static final Guid.IID
IID_NULL

The Constant IID_NULL.

Field Detail

IID_NULLback to summary
public static final Guid.IID IID_NULL

The Constant IID_NULL.

com.sun.jna.platform.win32 back to summary

public Class Guid.CLSID

extends GUID
Class Inheritance

The Class CLSID.
Author
Tobias Wolf, [email protected]

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Guid.CLSID.ByReference

The Class ByReference.

Field Summary

Inherited from com.sun.jna.platform.win32.Guid.GUID:
Data1Data2Data3Data4

Constructor Summary

AccessConstructor and Description
public
CLSID()

Instantiates a new clsid.

public
CLSID(String
the guid
guid
)

Instantiates a new clsid.

public
CLSID(Guid.GUID
the guid
guid
)

Instantiates a new clsid.

Method Summary

Inherited from com.sun.jna.platform.win32.Guid.GUID:
equalsfromBinaryfromStringhashCodenewGuidtoByteArraytoGuidStringwriteFieldsToMemory

Constructor Detail

CLSIDback to summary
public CLSID()

Instantiates a new clsid.

CLSIDback to summary
public CLSID(String guid)

Instantiates a new clsid.

Parameters
guid:String

the guid

CLSIDback to summary
public CLSID(Guid.GUID guid)

Instantiates a new clsid.

Parameters
guid:Guid.GUID

the guid

com.sun.jna.platform.win32 back to summary

public Class Guid.CLSID.ByReference

extends GUID
Class Inheritance

The Class ByReference.
Author
Tobias Wolf, [email protected]

Constructor Summary

AccessConstructor and Description
public
ByReference()

Instantiates a new by reference.

public
ByReference(Guid.GUID
the guid
guid
)

Instantiates a new by reference.

public
ByReference(Pointer
the memory
memory
)

Instantiates a new by reference.

Constructor Detail

ByReferenceback to summary
public ByReference()

Instantiates a new by reference.

ByReferenceback to summary
public ByReference(Guid.GUID guid)

Instantiates a new by reference.

Parameters
guid:Guid.GUID

the guid

ByReferenceback to summary
public ByReference(Pointer memory)

Instantiates a new by reference.

Parameters
memory:Pointer

the memory

com.sun.jna.platform.win32 back to summary

public Class Guid.GUID

extends Structure
Class Inheritance
Known Direct Subclasses
com.sun.jna.platform.win32.Guid.GUID.ByValue, com.sun.jna.platform.win32.Guid.GUID.ByReference, com.sun.jna.platform.win32.Guid.CLSID, com.sun.jna.platform.win32.Guid.CLSID.ByReference, com.sun.jna.platform.win32.Guid.IID
Annotations
@FieldOrder:Data1, Data2, Data3, Data4

The Class GUID.
Author
Tobias Wolf, [email protected]

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Guid.GUID.ByReference

The Class ByReference.

public static class

Field Summary

Modifier and TypeField and Description
public int
Data1

The Data1.

public short
Data2

The Data2.

public short
Data3

The Data3.

public byte[]
Data4

The Data4.

Inherited from com.sun.jna.Structure:
ALIGN_DEFAULTALIGN_GNUCALIGN_MSVCALIGN_NONECALCULATE_SIZE

Constructor Summary

AccessConstructor and Description
public
GUID()

Instantiates a new guid.

public
GUID(Guid.GUID
the guid
guid
)

Instantiates a new guid.

public
GUID(String
the guid
guid
)

Instantiates a new guid.

public
GUID(byte[]
the data
data
)

Instantiates a new guid.

public
GUID(Pointer
the memory
memory
)

Instantiates a new guid.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides com.sun.jna.Structure.equals.

Indicates whether some other object is "equal to" this one.
public static Guid.GUID

Returns:

the guid
fromBinary
(byte[]
the data
data
)

From binary.

public static Guid.GUID

Returns:

the guid
fromString
(String
the guid
guid
)

From string.

public int
hashCode()

Overrides com.sun.jna.Structure.hashCode.

Returns a hash code value for the object.
public static Guid.GUID

Returns:

the guid
newGuid
()

Generates a new guid.

public byte[]

Returns:

the byte[]
toByteArray
()

To byte array.

public String

Returns:

the string
toGuidString
()

The value of this Guid, formatted as follows: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

protected void
writeFieldsToMemory()

Write fields to backing memory.

Inherited from com.sun.jna.Structure:
allocateMemoryallocateMemoryautoAllocateautoReadautoReadautoWriteautoWritecacheTypeInfocalculateSizeclearcreateFieldsOrdercreateFieldsOrdercreateFieldsOrdercreateFieldsOrderdataEqualsdataEqualsensureAllocatedfieldOffsetgetAutoReadgetAutoWritegetFieldListgetFieldOrdergetFieldsgetNativeAlignmentgetNativeSizegetNativeSizegetPointergetStringEncodinggetStructAlignmentnewInstancenewInstancereadreadFieldreadFieldsetAlignTypesetAutoReadsetAutoSynchsetAutoWritesetStringEncodingsizesortFieldstoArraytoArraytoStringtoStringuseMemoryuseMemorywritewriteFieldwriteFieldwriteField

Field Detail

Data1back to summary
public int Data1

The Data1.

Data2back to summary
public short Data2

The Data2.

Data3back to summary
public short Data3

The Data3.

Data4back to summary
public byte[] Data4

The Data4.

Constructor Detail

GUIDback to summary
public GUID()

Instantiates a new guid.

GUIDback to summary
public GUID(Guid.GUID guid)

Instantiates a new guid.

Parameters
guid:Guid.GUID

the guid

GUIDback to summary
public GUID(String guid)

Instantiates a new guid.

Parameters
guid:String

the guid

GUIDback to summary
public GUID(byte[] data)

Instantiates a new guid.

Parameters
data:byte[]

the data

GUIDback to summary
public GUID(Pointer memory)

Instantiates a new guid.

Parameters
memory:Pointer

the memory

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides com.sun.jna.Structure.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

Doc from com.sun.jna.Structure.equals.

whether the given structure's type and pointer match.

Annotations
@Override
fromBinaryback to summary
public static Guid.GUID fromBinary(byte[] data)

From binary.

Parameters
data:byte[]

the data

Returns:Guid.GUID

the guid

fromStringback to summary
public static Guid.GUID fromString(String guid)

From string.

Parameters
guid:String

the guid

Returns:Guid.GUID

the guid

hashCodeback to summary
public int hashCode()

Overrides com.sun.jna.Structure.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

Doc from com.sun.jna.Structure.hashCode.

hash code for this structure's pointer.

Annotations
@Override
newGuidback to summary
public static Guid.GUID newGuid()

Generates a new guid. Code taken from the standard jdk implementation (see UUID class).

Returns:Guid.GUID

the guid

toByteArrayback to summary
public byte[] toByteArray()

To byte array.

Returns:byte[]

the byte[]

toGuidStringback to summary
public String toGuidString()

The value of this Guid, formatted as follows: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

Returns:String

the string

writeFieldsToMemoryback to summary
protected void writeFieldsToMemory()

Write fields to backing memory.

com.sun.jna.platform.win32 back to summary

public Class Guid.GUID.ByReference

extends GUID
implements ByReference
Class Inheritance
All Implemented Interfaces
com.sun.jna.Structure.ByReference

The Class ByReference.
Author
Tobias Wolf, [email protected]

Constructor Summary

AccessConstructor and Description
public
ByReference()

Instantiates a new by reference.

public
ByReference(Guid.GUID
the guid
guid
)

Instantiates a new by reference.

public
ByReference(Pointer
the memory
memory
)

Instantiates a new by reference.

Constructor Detail

ByReferenceback to summary
public ByReference()

Instantiates a new by reference.

ByReferenceback to summary
public ByReference(Guid.GUID guid)

Instantiates a new by reference.

Parameters
guid:Guid.GUID

the guid

ByReferenceback to summary
public ByReference(Pointer memory)

Instantiates a new by reference.

Parameters
memory:Pointer

the memory

com.sun.jna.platform.win32 back to summary

public Class Guid.GUID.ByValue

extends GUID
implements ByValue
Class Inheritance
All Implemented Interfaces
com.sun.jna.Structure.ByValue

Constructor Summary

AccessConstructor and Description
public
public
public
ByValue(Pointer memory)

Constructor Detail

ByValueback to summary
public ByValue()
ByValueback to summary
public ByValue(Guid.GUID guid)
ByValueback to summary
public ByValue(Pointer memory)
com.sun.jna.platform.win32 back to summary

public Class Guid.IID

extends GUID
Class Inheritance

The Class IID.
Author
Tobias Wolf, [email protected]

Field Summary

Inherited from com.sun.jna.platform.win32.Guid.GUID:
Data1Data2Data3Data4

Constructor Summary

AccessConstructor and Description
public
IID()

Instantiates a new iid.

public
IID(Pointer
the memory
memory
)

Instantiates a new iid.

public
IID(String
the iid
iid
)

Instantiates a new iid.

public
IID(byte[]
the data
data
)

Instantiates a new iid.

public
IID(Guid.GUID guid)

Method Summary

Inherited from com.sun.jna.platform.win32.Guid.GUID:
equalsfromBinaryfromStringhashCodenewGuidtoByteArraytoGuidStringwriteFieldsToMemory

Constructor Detail

IIDback to summary
public IID()

Instantiates a new iid.

IIDback to summary
public IID(Pointer memory)

Instantiates a new iid.

Parameters
memory:Pointer

the memory

IIDback to summary
public IID(String iid)

Instantiates a new iid.

Parameters
iid:String

the iid

IIDback to summary
public IID(byte[] data)

Instantiates a new iid.

Parameters
data:byte[]

the data

IIDback to summary
public IID(Guid.GUID guid)
com.sun.jna.platform.win32 back to summary

public Class Guid.REFIID

extends PointerType
Class Inheritance

REFIID is a pointer to an IID.

This type needs to be seperate from IID, as the REFIID can be passed in from external code, that does not allow writes to memory.

With the normal JNA behaviour a structure, that crosses the native<-%gt;Java border will be autowritten, which causes a fault when written. Observed was this behaviour in COM-Callbacks, which get the REFIID passed into Invoke-method.

So a IID can't be used directly, although the typedef of REFIID (from MSDN):

typedef IID* REFIID;

and the jna behaviour is described as:

"When a function requires a pointer to a struct, a Java Structure should be used."

Constructor Summary

AccessConstructor and Description
public
REFIID()

Instantiates a new refiid.

public
REFIID(Pointer
the memory
memory
)

Instantiates a new refiid.

public
REFIID(Guid.IID guid)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides com.sun.jna.PointerType.equals.

Instances of PointerType with identical pointers compare equal by default.
public Guid.IID
public int
hashCode()

Overrides com.sun.jna.PointerType.hashCode.

The hash code for a PointerType is the same as that for its pointer.
public void
setValue(Guid.IID value)

Inherited from com.sun.jna.PointerType:
fromNativegetPointernativeTypesetPointertoNativetoString

Constructor Detail

REFIIDback to summary
public REFIID()

Instantiates a new refiid.

REFIIDback to summary
public REFIID(Pointer memory)

Instantiates a new refiid.

Parameters
memory:Pointer

the memory

REFIIDback to summary
public REFIID(Guid.IID guid)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides com.sun.jna.PointerType.equals.

Doc from com.sun.jna.PointerType.equals.

Instances of PointerType with identical pointers compare equal by default.

Parameters
o:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getValueback to summary
public Guid.IID getValue()
hashCodeback to summary
public int hashCode()

Overrides com.sun.jna.PointerType.hashCode.

Doc from com.sun.jna.PointerType.hashCode.

The hash code for a PointerType is the same as that for its pointer.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
setValueback to summary
public void setValue(Guid.IID value)