Class Cfgmgr32FFM


public final class Cfgmgr32FFM extends WindowsForeignFunctions
FFM bindings for CfgMgr32.dll (Configuration Manager) functions.
  • Field Details

  • Constructor Details

    • Cfgmgr32FFM

      public Cfgmgr32FFM()
  • Method Details

    • CM_Get_Child

      public static int CM_Get_Child(MemorySegment pdnDevInst, int dnDevInst, int ulFlags) throws Throwable
      Gets the first child of a device instance.
      Parameters:
      pdnDevInst - receives the child device instance handle
      dnDevInst - the parent device instance
      ulFlags - must be 0
      Returns:
      CR_SUCCESS or error code
      Throws:
      Throwable
    • CM_Get_Sibling

      public static int CM_Get_Sibling(MemorySegment pdnDevInst, int dnDevInst, int ulFlags) throws Throwable
      Gets the next sibling of a device instance.
      Parameters:
      pdnDevInst - receives the sibling device instance handle
      dnDevInst - the device instance
      ulFlags - must be 0
      Returns:
      CR_SUCCESS or error code
      Throws:
      Throwable
    • CM_Get_Device_ID

      public static int CM_Get_Device_ID(int dnDevInst, MemorySegment buffer, int bufferLen, int ulFlags) throws Throwable
      Gets the device instance ID string.
      Parameters:
      dnDevInst - the device instance
      buffer - receives the device ID string (wide chars)
      bufferLen - length of buffer in characters
      ulFlags - must be 0
      Returns:
      CR_SUCCESS or error code
      Throws:
      Throwable
    • CM_Get_DevNode_Registry_Property

      public static int CM_Get_DevNode_Registry_Property(int dnDevInst, int ulProperty, MemorySegment pulRegDataType, MemorySegment buffer, MemorySegment pulLength, int ulFlags) throws Throwable
      Gets a device instance registry property.
      Parameters:
      dnDevInst - the device instance
      ulProperty - the property to retrieve (CM_DRP_*)
      pulRegDataType - receives the registry data type (may be NULL)
      buffer - receives the property value
      pulLength - on input, buffer size in bytes; on output, bytes written
      ulFlags - must be 0
      Returns:
      CR_SUCCESS or error code
      Throws:
      Throwable
    • getDeviceId

      public static String getDeviceId(int dnDevInst, Arena arena)
      Convenience method to get a device ID as a String.
      Parameters:
      dnDevInst - the device instance
      arena - arena for allocation
      Returns:
      the device ID string, or empty string on failure
    • getDevNodeProperty

      public static String getDevNodeProperty(int dnDevInst, int ulProperty, MemorySegment buf, MemorySegment sizeSeg)
      Convenience method to get a device node registry property as a String.
      Parameters:
      dnDevInst - the device instance
      ulProperty - the property constant (CM_DRP_*)
      buf - pre-allocated buffer (at least MAX_PATH * 2 bytes)
      sizeSeg - pre-allocated int segment for size
      Returns:
      the property value string, or empty string on failure