Toon posts:

[Win32] pci slot number

Pagina: 1
Acties:
  • 102 views sinds 30-01-2008
  • Reageer

Verwijderd

Topicstarter
Ik probeer via SetupDiGetDeviceRegistryProperty(...) het slotnummer van een pci kaart te achterhalen na wat googlen kwam ik erachter dat deze te vinden was met de property "SPDRP_UI_NUMBER" (zie http://msdn.microsoft.com.../install/di-rtns_4x2q.asp voor details)
Als ik deze functie echter aanroep met arg 3 SPDRP_UI_NUMBER returned hij false.
code:
1
SetupDiGetDeviceRegistryProperty(info, &devinfodata, SPDRP_UI_NUMBER , NULL, driverbuf, 64, NULL)
Als ik nu GetLastError() aanroep blijkt het om de melding "the data is invalid" te gaan(nuttig! :<).
Het lukt me met dezelfde functie wel om de device name te achterhalen, dus het lijkt me dat de andere args in de functie wel correct zijn...:
code:
1
2
        SetupDiGetDeviceRegistryProperty(info, &devinfodata, SPDRP_DEVICEDESC, NULL, driverbuf, 64, NULL);
        cout << "Device name: " << driverbuf << endl;

Hebben jullie enig idee wat er fout gaat ? :)

  • curry684
  • Registratie: Juni 2000
  • Laatst online: 12-05 22:23

curry684

left part of the evil twins

SPDRP_UI_NUMBER
The function retrieves a DWORD value set to the value of the UINumber member of the device's DEVICE_CAPABILITIES structure.
UINumber
Specifies a number associated with the device that can be displayed in the user interface.
This number is typically a user-perceived slot number, such as a number printed next to the slot on the board, or some other number that makes locating the physical device easier for the user. For buses with no such convention, or when the UINumber is unknown, the bus driver leaves this member at its default value of 0xFFFFFFFF.
Lijkt me duidelijk toch :Y)

Als ik trouwens verder lees lijken SPDRP_BUSNUMBER en SPDRP_LOCATION_INFORMATION me betere kandidaten...

[ Voor 8% gewijzigd door curry684 op 02-03-2004 19:06 ]

Professionele website nodig?


Verwijderd

Topicstarter
Hmm het is mij nog niet helemaal duidelijk hoor :P
als je die DWORD bedoelt... ik las eerst inderdaad alleen 1 DWORD uit, maar daarbij gaf hij dezelfde error...
En die euh SPDRP_BUSNUMBER is wat anders :) die kan ik ook al met succes uitlezen :P SPDRP_LOCATION_INFORMATION zal ik morgen ff naar kijken :)

toch nog lastig die win32 dingen :P

  • curry684
  • Registratie: Juni 2000
  • Laatst online: 12-05 22:23

curry684

left part of the evil twins

Het gaat me vooral om dit gedeelte:
For buses with no such convention, or when the UINumber is unknown, the bus driver leaves this member at its default value of 0xFFFFFFFF.
Die wrapper functie die jij gebruikt maakt daar waarschijnlijk die "Invalid data" error van, dat klopt namelijk :)

Professionele website nodig?