через функции CfgMgr32: CM_Xxx_xxx...
вот пример с давних времен завалялся:
function SetIORanges(aDevInst : DEVINST;
qwAddresses : array of DWORDLONG): boolean;
var
ret : CONFIGRET;
conf : LOG_CONF;
iter : DWORD;
resDes,_ResDes : RES_DES;
res : PIO_RESOURCE;
siz : ULONG;
i,len : integer;
begin
Result:=false;
ret:=CM_Get_First_Log_Conf(@conf,aDevInst,ALLOC_LOG_CONF);
if(ret<>CR_SUCCESS)then begin
flogln('di.log','Get LogConf fail 0x'+HexDWord(ret));
exit;
end;
len:=High(qwAddresses) div 2;
i:=0;
iter := conf;
while((i<len)and
(CM_Get_Next_Res_Des(resDes,iter,ResType_IO,Nil,0)=CR_SUCCESS))do begin
if(qwAddresses[i*2]>qwAddresses[i*2])then begin
flogln('di.log','Invalid IO range #'+IntStr(i));
continue;inc(i);
end;
iter := resDes;
ret:=CM_Get_Res_Des_Data_Size(siz,resDes,0);
if(ret<>CR_SUCCESS)then begin
flogln('di.log','Get ResDes Data Size fail 0x'+HexDWord(ret));
continue;inc(i);
end;
GetMem(res,siz);
if(res=nil)then begin
flogln('di.log','Memory allocation Error');
exit;
end;
ret:=CM_Get_Res_Des_Data(resDes,res^,siz,0);
if(ret<>CR_SUCCESS)then begin
flogln('di.log','Get ResDes Data fail 0x'+HexDWord(ret));
continue;inc(i);
end;
flogln('di.log',' Original Range (0x'
+HexDword(res^.IO_Header.IOD_Alloc_Base)+
'-0x'+HexDword(res^.IO_Header.IOD_Alloc_End)+')');
res^.IO_Header.IOD_Alloc_Base:=qwAddresses[i*2];
res^.IO_Header.IOD_Alloc_End :=qwAddresses[i*2+1];
ret:=CM_Modify_Res_Des(_ResDes,resDes,ResType_IO,res^,siz,0);
if(ret<>CR_SUCCESS)then begin
flogln('di.log','Modify ResDes Data fail 0x'+HexDWord(ret));
end else iter := _ResDes;
inc(i);
FreeMem(res);
end;
Result:=true;
end;