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
PCI Cards
Re: PCI Cards
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
http://msdn.microsoft.com/en-us/library ... v=vs.85%29
"Have you tried turning it off and on again ?"
Re: PCI Cards
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)
PureBASIC v5.41 LTS , Windows v8.1 x64
Forget UNICODE - Keep it BASIC !
Forget UNICODE - Keep it BASIC !
Re: PCI Cards
Thanks , all i need todo is to find registry keys for my pci cards then try that code.
Re: PCI Cards
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
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
I have: 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.
Code: Select all
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\VEN_1102&DEV_0002&SUBSYS_80641102&REV_07\4&20e0ff6a&0&10F0DeviceDesc 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
THANKS, I see it now. It works great. Thanks for your help. 
Re: PCI Cards
OK. I thought it was clear that you are looking for "Sound Blaster" or similar in the branch "PCI".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
PureBASIC v5.41 LTS , Windows v8.1 x64
Forget UNICODE - Keep it BASIC !
Forget UNICODE - Keep it BASIC !


