|
37 | 37 | public interface Cfgmgr32 extends Library {
|
38 | 38 | Cfgmgr32 INSTANCE = Native.load("Cfgmgr32", Cfgmgr32.class, W32APIOptions.DEFAULT_OPTIONS);
|
39 | 39 |
|
40 |
| - public final static int CR_SUCCESS = 0; |
41 |
| - public final static int CR_BUFFER_SMALL = 0x0000001A; |
| 40 | + int CR_SUCCESS = 0; |
| 41 | + int CR_BUFFER_SMALL = 0x0000001A; |
| 42 | + int CR_NO_SUCH_VALUE = 0x00000025; |
42 | 43 |
|
43 |
| - public final static int CM_LOCATE_DEVNODE_NORMAL = 0; |
44 |
| - public final static int CM_LOCATE_DEVNODE_PHANTOM = 1; |
45 |
| - public final static int CM_LOCATE_DEVNODE_CANCELREMOVE = 2; |
46 |
| - public final static int CM_LOCATE_DEVNODE_NOVALIDATION = 4; |
47 |
| - public final static int CM_LOCATE_DEVNODE_BITS = 7; |
| 44 | + int CM_LOCATE_DEVNODE_NORMAL = 0; |
| 45 | + int CM_LOCATE_DEVNODE_PHANTOM = 1; |
| 46 | + int CM_LOCATE_DEVNODE_CANCELREMOVE = 2; |
| 47 | + int CM_LOCATE_DEVNODE_NOVALIDATION = 4; |
| 48 | + int CM_LOCATE_DEVNODE_BITS = 7; |
| 49 | + |
| 50 | + int CM_DRP_DEVICEDESC = 0x00000001; // DeviceDesc REG_SZ property (RW) |
| 51 | + int CM_DRP_HARDWAREID = 0x00000002; // HardwareID REG_MULTI_SZ property (RW) |
| 52 | + int CM_DRP_COMPATIBLEIDS = 0x00000003; // CompatibleIDs REG_MULTI_SZ property (RW) |
| 53 | + int CM_DRP_SERVICE = 0x00000005; // Service REG_SZ property (RW) |
| 54 | + int CM_DRP_CLASS = 0x00000008; // Class REG_SZ property (RW) |
| 55 | + int CM_DRP_CLASSGUID = 0x00000009; // ClassGUID REG_SZ property (RW) |
| 56 | + int CM_DRP_DRIVER = 0x0000000A; // Driver REG_SZ property (RW) |
| 57 | + int CM_DRP_CONFIGFLAGS = 0x0000000B; // ConfigFlags REG_DWORD property (RW) |
| 58 | + int CM_DRP_MFG = 0x0000000C; // Mfg REG_SZ property (RW) |
| 59 | + int CM_DRP_FRIENDLYNAME = 0x0000000D; // FriendlyName REG_SZ property (RW) |
| 60 | + int CM_DRP_LOCATION_INFORMATION = 0x0000000E; // LocationInformation REG_SZ property (RW) |
| 61 | + int CM_DRP_PHYSICAL_DEVICE_OBJECT_NAME = 0x0000000F; // PhysicalDeviceObjectName REG_SZ property (R) |
| 62 | + int CM_DRP_CAPABILITIES = 0x00000010; // Capabilities REG_DWORD property (R) |
| 63 | + int CM_DRP_UI_NUMBER = 0x00000011; // UiNumber REG_DWORD property (R) |
| 64 | + int CM_DRP_UPPERFILTERS = 0x00000012; // UpperFilters REG_MULTI_SZ property (RW) |
| 65 | + int CM_DRP_LOWERFILTERS = 0x00000013; // LowerFilters REG_MULTI_SZ property (RW) |
| 66 | + int CM_DRP_BUSTYPEGUID = 0x00000014; // Bus Type Guid, GUID, (R) |
| 67 | + int CM_DRP_LEGACYBUSTYPE = 0x00000015; // Legacy bus type, INTERFACE_TYPE, (R) |
| 68 | + int CM_DRP_BUSNUMBER = 0x00000016; // Bus Number, DWORD, (R) |
| 69 | + int CM_DRP_ENUMERATOR_NAME = 0x00000017; // Enumerator Name REG_SZ property (R) |
| 70 | + int CM_DRP_SECURITY = 0x00000018; // Security - Device override (RW) |
| 71 | + int CM_DRP_SECURITY_SDS = 0x00000019; // Security - Device override (RW) |
| 72 | + int CM_DRP_DEVTYPE = 0x0000001A; // Device Type - Device override (RW) |
| 73 | + int CM_DRP_EXCLUSIVE = 0x0000001B; // Exclusivity - Device override (RW) |
| 74 | + int CM_DRP_CHARACTERISTICS = 0x0000001C; // Characteristics - Device Override (RW) |
| 75 | + int CM_DRP_ADDRESS = 0x0000001D; // Device Address (R) |
| 76 | + int CM_DRP_UI_NUMBER_DESC_FORMAT = 0x0000001E; // UINumberDescFormat REG_SZ property (RW) |
| 77 | + int CM_DRP_DEVICE_POWER_DATA = 0x0000001F; // CM_POWER_DATA REG_BINARY property (R) |
| 78 | + int CM_DRP_REMOVAL_POLICY = 0x00000020; // CM_DEVICE_REMOVAL_POLICY REG_DWORD (R) |
| 79 | + int CM_DRP_REMOVAL_POLICY_HW_DEFAULT = 0x00000021; // CM_DRP_REMOVAL_POLICY_HW_DEFAULT REG_DWORD (R) |
| 80 | + int CM_DRP_REMOVAL_POLICY_OVERRIDE = 0x00000022; // CM_DRP_REMOVAL_POLICY_OVERRIDE REG_DWORD (RW) |
| 81 | + int CM_DRP_INSTALL_STATE = 0x00000023; // CM_DRP_INSTALL_STATE REG_DWORD (R) |
| 82 | + int CM_DRP_LOCATION_PATHS = 0x00000024; // CM_DRP_LOCATION_PATHS REG_MULTI_SZ (R) |
| 83 | + int CM_DRP_BASE_CONTAINERID = 0x00000025; // Base ContainerID REG_SZ property (R) |
48 | 84 |
|
49 | 85 | /**
|
50 | 86 | * The CM_Locate_DevNode function obtains a device instance handle to the
|
@@ -189,4 +225,43 @@ public interface Cfgmgr32 extends Library {
|
189 | 225 | * CM_Get_Device_ID_Size</A>
|
190 | 226 | */
|
191 | 227 | int CM_Get_Device_ID_Size(IntByReference pulLen, int dnDevInst, int ulFlags);
|
| 228 | + |
| 229 | + /** |
| 230 | + * The CM_Get_DevNode_Registry_Property function retrieves a specified device |
| 231 | + * property from the registry. |
| 232 | + * |
| 233 | + * @param dnDevInst |
| 234 | + * A caller-supplied device instance handle that is bound to the |
| 235 | + * local machine. |
| 236 | + * @param ulProperty |
| 237 | + * A {@code CM_DRP_}-prefixed constant value that identifies the |
| 238 | + * device property to be obtained from the registry. These constants |
| 239 | + * are defined in Cfgmgr32.h. |
| 240 | + * @param pulRegDataType |
| 241 | + * Optional, can be {@code null}. A pointer to a location that |
| 242 | + * receives the registry data type, specified as a |
| 243 | + * {@code REG_}-prefixed constant defined in Winnt.h. |
| 244 | + * @param buffer |
| 245 | + * Optional, can be {@code null}. A pointer to a caller-supplied |
| 246 | + * buffer that receives the requested device property. If this value |
| 247 | + * is {@code null}, the function supplies only the length of the |
| 248 | + * requested data in the address pointed to by {@code pulLength}. |
| 249 | + * @param pulLength |
| 250 | + * A pointer to a {@code ULONG} variable into which the function |
| 251 | + * stores the length, in bytes, of the requested device property. |
| 252 | + * <p> |
| 253 | + * If the Buffer parameter is set to {@code null}, the ULONG variable |
| 254 | + * must be set to zero. |
| 255 | + * <p> |
| 256 | + * If the Buffer parameter is not set to {@code null}, the |
| 257 | + * {@code ULONG} variable must be set to the length, in bytes, of the |
| 258 | + * caller-supplied buffer. |
| 259 | + * @param ulFlags |
| 260 | + * Not used, must be zero. |
| 261 | + * @return If the operation succeeds, the function returns {@code CR_SUCCESS}. |
| 262 | + * Otherwise, it returns one of the {@code CR_}-prefixed error codes |
| 263 | + * that are defined in Cfgmgr32.h. |
| 264 | + */ |
| 265 | + int CM_Get_DevNode_Registry_Property(int dnDevInst, int ulProperty, IntByReference pulRegDataType, Pointer buffer, |
| 266 | + IntByReference pulLength, int ulFlags); |
192 | 267 | }
|
0 commit comments