View Issue Details

IDProjectCategoryView StatusLast Update
0005967JEDI VCL00 JVCL Componentspublic2013-06-15 15:30
ReporterKendall RogersAssigned ToAHUser 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.45 
Target VersionFixed in Version 
Summary0005967: Access Violation 00000000 using any function in SetupApi or HID
DescriptionWhen trying various function calls in SetupAPI or HID I immediately hit an access violation. Using code found in the following examples:

http://stackoverflow.com/questions/8049889/enumerating-usb-hid-devices-using-setupapi-in-64-bit-app?rq=1

http://stackoverflow.com/questions/10154878/delphi-hid-in-delphi7-and-delphi-xe2

I run into this error while running the code in either 2007 or XE. I can also reproduce this very simply with the following code in the additional information section.
Additional Informationunit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

uses
  SetupAPI, HID;

procedure TForm1.Button1Click(Sender: TObject);
var
  AGUID: TGUID;
begin
  HidD_GetHidGuid(AGUID);
end;

end.
TagsNo tags attached.

Activities

AHUser

2013-05-25 18:06

developer   ~0020519

You need to call "LoadHid" before using any HID function.

The SetupAPI unit was renamed to JvSetupAPI, so you may use an outdated SetupAPI.dcu if there is one on your library path (and you have a JVCL version where the renaming was done)

Issue History

Date Modified Username Field Change
2012-08-27 19:15 Kendall Rogers New Issue
2013-01-15 15:23 obones Status new => acknowledged
2013-05-25 18:06 AHUser Note Added: 0020519
2013-05-25 18:06 AHUser Assigned To => AHUser
2013-05-25 18:06 AHUser Status acknowledged => feedback
2013-06-15 15:30 AHUser Status feedback => resolved
2013-06-15 15:30 AHUser Resolution open => fixed