Jump to content

UsbQueryNumberDevices: Difference between revisions

From EDM2
Created page with "==Description== Obtains the total number of USB devices currently attached. ==Syntax== <pre> ulrc=UsbQueryNumberDevices(*pulNumDev) </pre> ==Parameters== ; pulNumDev : ==R..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
==Description==
Obtains the total number of USB devices currently attached.
Obtains the total number of currently attached USB devices.


==Syntax==
==Syntax==
<pre>
ulrc = UsbQueryNumberDevices(pulNumDev)
ulrc=UsbQueryNumberDevices(*pulNumDev)
</pre>


==Parameters==
==Parameters==
; pulNumDev :  
; pulNumDev : the address of the variable to receive the Total Number.


==Return Code==
==Return Code==
0x0000 - NO_ERROR


===Errors===
===Errors===
 
<pre>
  [0000] - NO_ERROR
0x0057 - ERROR_INVALID_PARAMETER
  [0057] - ERROR_INVALID_PARAMETER
0x1B58 - USB_NOT_INIT
  [1B58] - USB_NOT_INIT (7000)
0xFF13 - ERROR_I24_INVALID_PARAMETER
  [FF13] - ERROR_I24_INVALID_PARAMETER
0xFF1F - ERROR_GEN_FAILURE
  [FF1F] - ERROR_GEN_FAILURE
0xFF57 - ERROR_INVALID_PARAMETER
  [FF57] - ERROR_INVALID_PARAMETER
</pre>


==Remarks==
==Remarks==
Line 25: Line 24:
==Example Code==
==Example Code==
<pre>
<pre>
//Code Snippet - UsbQueryNumberDevices
{
  APIRET ulrc;
  PULONG pulNumDev;
  ULONG ulNumDev;
  pulNumDev = &ulNumDev;
  ulrc = UsbQueryNumberDevices(pulNumDev);
  printf("\nUsbQueryNumberDevices - ulrc: 0x%04X (%hu)",ulrc,ulrc);
  if (!ulrc) //success
  {
    printf(" - NumberDevices: %hu",ulNumDev);
  }
}
</pre>
</pre>


==Related Functions==
==Related Functions==
* [[UsbQueryDeviceReport]]
* [[UsbQueryDeviceInfo]]
* [[UsbOpen]]


[[Category:USBCalls]]
[[Category:USBCalls]]

Latest revision as of 20:47, 13 September 2021

Description

Obtains the total number of currently attached USB devices.

Syntax

ulrc = UsbQueryNumberDevices(pulNumDev)

Parameters

pulNumDev
the address of the variable to receive the Total Number.

Return Code

0x0000 - NO_ERROR

Errors

0x0057 - ERROR_INVALID_PARAMETER
0x1B58 - USB_NOT_INIT
0xFF13 - ERROR_I24_INVALID_PARAMETER
0xFF1F - ERROR_GEN_FAILURE
0xFF57 - ERROR_INVALID_PARAMETER

Remarks

Example Code

//Code Snippet - UsbQueryNumberDevices
{
  APIRET ulrc;
  PULONG pulNumDev;
  ULONG ulNumDev;

  pulNumDev = &ulNumDev;
  ulrc = UsbQueryNumberDevices(pulNumDev);
  printf("\nUsbQueryNumberDevices - ulrc: 0x%04X (%hu)",ulrc,ulrc);
  if (!ulrc) //success
  {
    printf(" - NumberDevices: %hu",ulNumDev);
  }
}

Related Functions