Page 1 of 1

PCI Cards

Posted: Tue Jul 31, 2012 2:28 pm
by Ampli
Is it possible to activate(enable) and deactivate(disable) pci cards like soundblaster cards by code?

what i want to do is to have up to 6 Soundblaster PCI cards installed but only use 2 at the time. 4 must be deactivated. but i want to be able to choose what card to be enabled.

/Ampli

Re: PCI Cards

Posted: Tue Jul 31, 2012 7:07 pm
by luis
I don't know the answer, but I would probably start looking at the SetaAPI set of functions, maybe you can do something with those:

http://msdn.microsoft.com/en-us/library ... v=vs.85%29

Re: PCI Cards

Posted: Wed Aug 01, 2012 11:24 am
by marroh
Perhaps the following example helps / works:

Code: Select all

EnableExplicit

Define *F1, *F2, *F3
Define devhandle.l, id.s

OpenLibrary(1,"setupapi.dll")
*F1 = GetFunction(1, "CM_Locate_DevNodeA")
*F2 = GetFunction(1, "CM_Disable_DevNode")
*F3 = GetFunction(1, "CM_Enable_DevNode")

;look in registry HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum
;to find Identifiers for PCI/USB ... Devices
id.s = "PCI\VEN_1022&DEV_9609&SUBSYS_00000000&REV_00\3&267a616a&0&50" ;sample usb wlan

CallFunctionFast(*F1, @devhandle, @id, 0)

;Debug CallFunctionFast(*F2 ,devhandle, 0) ;disable device
;Debug CallFunctionFast(*F3 ,devhandle, 0) ;enable device

CloseLibrary(1)

Re: PCI Cards

Posted: Wed Aug 01, 2012 7:35 pm
by Ampli
Thanks , all i need todo is to find registry keys for my pci cards then try that code.

Re: PCI Cards

Posted: Sat Aug 04, 2012 6:02 pm
by Ampli
I don't find right ID String to use.

id.s = "PCI\VEN_1022&DEV_9609&SUBSYS_00000000&REV_00\3&267a616a&0&50"
in my registry i don't have \3&267a616a&0&50 or smiliar to this.

Only PCI\VEN... 4-5 lines and i tryed all combinations but nothing helps.



/Ampli

Re: PCI Cards

Posted: Sat Aug 04, 2012 6:22 pm
by eJan
I have:

Code: Select all

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\VEN_1102&DEV_0002&SUBSYS_80641102&REV_07\4&20e0ff6a&0&10F0
where subkey 4&20e0ff6a&0&10F0 contain names\values:
DeviceDesc REG_SZ Creative EMU10K1 Audio Processor (WDM)
FrinendlyName REG_SZ Creative SB Live! series
this is old Creative SB Live 5.1 i have installed, try searching for similar names.

Re: PCI Cards

Posted: Sat Aug 04, 2012 6:56 pm
by Ampli
THANKS, I see it now. It works great. Thanks for your help. :D

Re: PCI Cards

Posted: Mon Aug 06, 2012 10:49 am
by marroh
Ampli wrote:I don't find right ID String to use.

id.s = "PCI\VEN_1022&DEV_9609&SUBSYS_00000000&REV_00\3&267a616a&0&50"
in my registry i don't have \3&267a616a&0&50 or smiliar to this.

Only PCI\VEN... 4-5 lines and i tryed all combinations but nothing helps.
/Ampli
OK. I thought it was clear that you are looking for "Sound Blaster" or similar in the branch "PCI". ;) Main point it works now. :)