C# Class Mirror.UsbLibrary.Win32Usb

Class that wraps USB API calls and structures.
Afficher le fichier Open project: suan/mirlite

Méthodes publiques

Свойство Type Description
NullHandle System.IntPtr

Protected Properties

Свойство Type Description
InvalidHandleValue System.IntPtr

Méthodes publiques

Méthode Description
RegisterForUsbEvents ( IntPtr hWnd, System.Guid gClass ) : IntPtr

Registers a window to receive windows messages when a device is inserted/removed. Need to call this from a form when its handle has been created, not in the form constructor. Use form's OnHandleCreated override.

UnregisterForUsbEvents ( IntPtr hHandle ) : bool

Unregisters notifications. Can be used in form dispose

Private Methods

Méthode Description
CloseHandle ( IntPtr hFile ) : int
CreateFile ( [ strName, uint nAccess, uint nShareMode, IntPtr lpSecurity, uint nCreationFlags, uint nAttributes, IntPtr lpTemplate ) : IntPtr
HidD_FreePreparsedData ( IntPtr &pData ) : bool
HidD_GetHidGuid ( System.Guid &gHid ) : void
HidD_GetPreparsedData ( IntPtr hFile, IntPtr &lpData ) : bool
HidP_GetCaps ( IntPtr lpData, HidCaps &oCaps ) : int
RegisterDeviceNotification ( IntPtr hwnd, DeviceBroadcastInterface oInterface, uint nFlags ) : IntPtr
SetupDiDestroyDeviceInfoList ( IntPtr lpInfoSet ) : int
SetupDiEnumDeviceInterfaces ( IntPtr lpDeviceInfoSet, uint nDeviceInfoData, System.Guid &gClass, uint nIndex, DeviceInterfaceData &oInterfaceData ) : bool
SetupDiGetClassDevs ( System.Guid &gClass, [ strEnumerator, IntPtr hParent, uint nFlags ) : IntPtr
SetupDiGetDeviceInterfaceDetail ( IntPtr lpDeviceInfoSet, DeviceInterfaceData &oInterfaceData, DeviceInterfaceDetailData &oDetailData, uint nDeviceInterfaceDetailDataSize, uint &nRequiredSize, IntPtr lpDeviceInfoData ) : bool
SetupDiGetDeviceInterfaceDetail ( IntPtr lpDeviceInfoSet, DeviceInterfaceData &oInterfaceData, IntPtr lpDeviceInterfaceDetailData, uint nDeviceInterfaceDetailDataSize, uint &nRequiredSize, IntPtr lpDeviceInfoData ) : bool
UnregisterDeviceNotification ( IntPtr hHandle ) : bool

Method Details

RegisterForUsbEvents() public static méthode

Registers a window to receive windows messages when a device is inserted/removed. Need to call this from a form when its handle has been created, not in the form constructor. Use form's OnHandleCreated override.
public static RegisterForUsbEvents ( IntPtr hWnd, System.Guid gClass ) : IntPtr
hWnd System.IntPtr Handle to window that will receive messages
gClass System.Guid Class of devices to get messages for
Résultat System.IntPtr

UnregisterForUsbEvents() public static méthode

Unregisters notifications. Can be used in form dispose
public static UnregisterForUsbEvents ( IntPtr hHandle ) : bool
hHandle System.IntPtr Handle returned from RegisterForUSBEvents
Résultat bool

Property Details

InvalidHandleValue protected_oe static_oe property

Simple representation of the handle returned when CreateFile fails.
protected static IntPtr,System InvalidHandleValue
Résultat System.IntPtr

NullHandle public_oe static_oe property

Simple representation of a null handle : a closed stream will get this handle. Note it is public for comparison by higher level classes.
public static IntPtr,System NullHandle
Résultat System.IntPtr