Top Description Inners Constructors Methods
com.sun.jna.platform.win32

public abstract Class Cfgmgr32Util

extends Object
Class Inheritance
Imports
com.sun.jna.Memory, .Native, com.sun.jna.ptr.IntByReference, com.sun.jna.win32.W32APITypeMapper

Cfgmgr32 utility API.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

The device instance ID string.
CM_Get_Device_ID
(int
Caller-supplied device instance handle that is bound to the local machine.
devInst
)

Utility method to call Cfgmgr32's CM_Get_Device_ID_Size, allocates the required memory for the Buffer parameter based on the type mapping used, calls to CM_Get_Device_ID, and returns the received string.

public static Object

Returns:

An Object containing the specified registry property for the device.

If the property is of type WinNT#REG_SZ, a java.lang.String is returned.

If the property is of type WinNT#REG_MULTI_SZ, an array of java.lang.String is returned.

If the property is of type WinNT#REG_DWORD, an java.lang.Integer is returned.

If the property is of type WinNT#REG_BINARY, an array of java.lang.Byte is returned.

If no value exists for this property (error Cfgmgr32#CR_NO_SUCH_VALUE), returns null.

CM_Get_DevNode_Registry_Property
(int
Caller-supplied device instance handle that is bound to the local machine.
devInst
,
int
A CM_DRP_-prefixed constant value that identifies the device property to be obtained from the registry. These constants are defined in Cfgmgr32.h.
ulProperty
)

Utility method to call Cfgmgr32's CM_Get_DevNode_Registry_Property that allocates the required memory for the Buffer parameter, and returns values of the appropriate type.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Cfgmgr32Utilback to summary
public Cfgmgr32Util()

Method Detail

CM_Get_Device_IDback to summary
public static String CM_Get_Device_ID(int devInst) throws Cfgmgr32Exception

Utility method to call Cfgmgr32's CM_Get_Device_ID_Size, allocates the required memory for the Buffer parameter based on the type mapping used, calls to CM_Get_Device_ID, and returns the received string.

Parameters
devInst:int

Caller-supplied device instance handle that is bound to the local machine.

Returns:String

The device instance ID string.

CM_Get_DevNode_Registry_Propertyback to summary
public static Object CM_Get_DevNode_Registry_Property(int devInst, int ulProperty) throws Cfgmgr32Exception

Utility method to call Cfgmgr32's CM_Get_DevNode_Registry_Property that allocates the required memory for the Buffer parameter, and returns values of the appropriate type.

Parameters
devInst:int

Caller-supplied device instance handle that is bound to the local machine.

ulProperty:int

A CM_DRP_-prefixed constant value that identifies the device property to be obtained from the registry. These constants are defined in Cfgmgr32.h.

Returns:Object

An Object containing the specified registry property for the device.

If the property is of type WinNT#REG_SZ, a java.lang.String is returned.

If the property is of type WinNT#REG_MULTI_SZ, an array of java.lang.String is returned.

If the property is of type WinNT#REG_DWORD, an java.lang.Integer is returned.

If the property is of type WinNT#REG_BINARY, an array of java.lang.Byte is returned.

If no value exists for this property (error Cfgmgr32#CR_NO_SUCH_VALUE), returns null.

Exceptions
Cfgmgr32Exception:
on any errors other than Cfgmgr32#CR_NO_SUCH_VALUE
com.sun.jna.platform.win32 back to summary

public Class Cfgmgr32Util.Cfgmgr32Exception

extends RuntimeException
Class Inheritance
Annotations
@SuppressWarnings:serial

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
public
Cfgmgr32Exception(int errorCode)

Method Summary

Modifier and TypeMethod and Description
public int
public String
toString()

Overrides java.lang.Throwable.toString.

Returns a short description of this throwable.

Field Detail

errorCodeback to summary
private final int errorCode

Constructor Detail

Cfgmgr32Exceptionback to summary
public Cfgmgr32Exception(int errorCode)

Method Detail

getErrorCodeback to summary
public int getErrorCode()
toStringback to summary
public String toString()

Overrides java.lang.Throwable.toString.

Doc from java.lang.Throwable.toString.

Returns a short description of this throwable. The result is the concatenation of:

  • the name of the class of this object
  • ": " (a colon and a space)
  • the result of invoking this object's getLocalizedMessage method
If getLocalizedMessage returns null, then just the class name is returned.
Returns:String

a string representation of this throwable.

Annotations
@Override