Legacy driver which runs in NT4.0 locks up in Windows 2000 in HalAssignSlotResou

Discussion in 'Windows Vista Drivers' started by Scott Kooy, Jul 14, 2003.

  1. Scott Kooy

    Scott Kooy Guest

    I have a nonWDM driver which runs fine in NT 4.0, but I
    try to use it in Windows 2000, and in particular case, it
    locks up. In a PCI driver, I am calling
    HalAssignSlotResources for each of a particular card
    installed. The driver works fine with one card in both NT
    4.0 and Windows 2000. But when I try to install another
    card of the same type, the driver locks up in Windows 2000
    in the HalAssignSlotResources. Does anyone have any idea
    why this would happen? Here is the code which is called
    from the DriverEntry function:

    for (bus=0;nextbus!=0;bus++)
    {
    int pciInt=0; // next interrupt entry
    for (device=0;nextbus!=0 && device <
    PCI_MAX_DEVICES;device++)
    {
    SlotNumber.u.bits.Reserved=0;

    SlotNumber.u.bits.DeviceNumber=device;
    SlotNumber.u.bits.FunctionNumber=0;


    // read info
    length = HalGetBusData
    (PCIConfiguration,
    bus,SlotNumber.u.AsULONG,
    &PCI_Cfg,sizeof
    (PCI_COMMON_CONFIG) );


    // if length is 0 we reaced last
    bus
    if (length == 0)
    {
    nextbus=FALSE;
    break;
    }


    // is this our card?
    if (PCI_Cfg.VendorID ==
    DSP_PCI_VENDOR_ID &&
    PCI_Cfg.DeviceID ==
    DSP_PCI_DEVICE_ID &&

    PCI_Cfg.u.type0.SubVendorID == DSP_PCI_SUB_VENDOR
    &&
    (
    (PCI_Cfg.u.type0.SubSystemID == DSP_PCI_SUB_ID_5V ) ||

    (PCI_Cfg.u.type0.SubSystemID == DSP_PCI_SUB_ID_33V ) ) )
    {

    // init spin lock
    for isr
    NTSTATUS
    stat;

    ULONG vect;
    // skip any ISA cards
    // while (Extension->Win2k
    [ConfigNum]!=NULL
    // ConfigNum++;
    // we got one!

    sprintf(line_buff,"%s
    Found PCI DSP #%d card at bus %d device %
    d\n",myname,ConfigNum,bus,device);
    WriteLog();
    sprintf(
    line_buff, "Before HalAssignSlotResources:\n" );
    WriteLog();
    for
    (length=0;length<PCI_TYPE0_ADDRESSES;length++)
    {
    sprintf
    (line_buff,"%s Base address %d - %
    x\n",myname,length,PCI_Cfg.u.type0.BaseAddresses[length]);
    WriteLog();
    }
    sprintf(
    line_buff, "Device Number=%lx, ConfigNum=%d\n",
    SlotNumber.u.bits.DeviceNumber, ConfigNum );
    WriteLog();
    if ( ConfigNum != 0 )
    continue;
    status =
    HalAssignSlotResources(RegistryPath,NULL,

    DriverObject,deviceObject,PCIBus,bus,

    SlotNumber.u.AsULONG,&ResourceList);
     
    Scott Kooy, Jul 14, 2003
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.