Hi,
I need to call HidD_GetHidGuid as defined below.
How is LPGUID HidGuid defined in JNA?
Is the code in the attached file correct?
Thanks,
Dave
The HidD_GetHidGuid routine returns the device interface GUID for HIDClass
devices.
http://msdn.microsoft.com/en-us/library/ms790927.aspx
VOID
HidD_GetHidGuid(
OUT LPGUID HidGuid
);
Parameters
HidGuid
Pointer to a caller-allocated GUID buffer that the routine uses to
return the device interface GUID for HIDClass devices.
GUID
Globally unique identifier. A 16-byte quantity that is unique, having
been generated from the unique identifier on a network card, the current
date and time, and a sequence number. This combination of variables is used
to allow any party to create identifiers that will be guaranteed not to
match another GUID. For more information see the topic, Using GUIDs in
Drivers.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package win32;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Structure;
import com.sun.jna.Platform;
import com.sun.jna.ptr.PointerByReference;
public interface HIDLibrary extends W32API {
// GUID data type
// Type GUID
// Data1 As Long
// Data2 As Integer
// Data3 As Integer
// Data4(7) As Byte
// End Type
public static class GUID extends Structure {
public long data1;
public int data2;
public int data3;
public byte[] date4;
public GUID(int bufferSize) {
date4 = new byte[bufferSize];
allocateMemory(bufferSize);
}
}
HIDLibrary INSTANCE = (HIDLibrary)
Native.loadLibrary((Platform.isWindows() ? "hid" : "c"),
HIDLibrary.class);
// Obtain the GUID for the HID class
void HidD_GetHidGuid(GUID hidGuid);
// Retrieves the HID's Vendor ID, Product ID, and Version Number.
boolean HidD_GetAttributes(HANDLEByReference HidDeviceObject,
PointerByReference Attributes);
}