Hi, friend, Thanks very much for your reply, However I still in mess.
1.The follow is attached sourcecode:
- yes I followed your advice and checked the setting of vc6.0 vompiler.
IN THE /TOOLS/OPTIONS/directorses
I have added the c:\nt4ddk\nt4.ddk\ddk\inc
and c:\nt4ddk\nt4.ddk\ddk\lib
However I have not modified any settings of NT4.0DDK
because my installation is very smooth.
So if I should change some settings to make sure I can successfully
compile.
- I have stupid questions In my case if I first compile using vc compiler,
then to use build command, so the compile errors are doesn’t matter?
Please NOTE: I treat our program as application program
because there isn’t driverentry subroutine.
Thanks very much in advance.
best regards
yours sincerely
/* THIS FUNCTION IS CALLED BY THE DRIVER TO FIND THE NEXT
PCI device and initialize the adapter’s configuration*/
/*
#include <ntddk.h>
BOOLEAN pciUtilIteratePCI(IN BOOLEAN First,
IN unsigned int pciVendorId,
IN unsigned int pciDeviceId,
IN OUT PCI_SLOT_NUMBER *returnSlotData,
IN OUT PCI_COMMON_CONFIG *returnPciData,
IN OUT unsigned int *returnBusNumber)
{ PUCHAR ioSpace;
ULONG i,j;
ULONG irq;
ULONG portBase
ULONG retryCount;
PCI_SLOT_NUMBER slotData;
PCI_COMMON_CONFIG pciData;
UCHAR statusByte;
BOOLEAN preConfig=FALSE;
BOOLEAN Found = FALSE;
unsigned int busNumber=1;
kdPrint((“pciUtil:FindPCI\n”));
/ITERATE OVER ALL PCI SLOTS/
slotData.u.AsULONG=0;
for(busNumber=First?0:*returnBusNumber;
busNumber<256; busNumber++)
{
for(slotData.u.bits.DeviceNumber=First?0:returnSlotData->u.bits.DeviceNumber;
slotData.u.bits.DeviceNumber<pci_max_devices-1> slotData.u.bits.DeviceNumber++)
{//Device enumeration
for(slotData.u.bits.FunctionNumber=First?0:(returnSlotData->u.bits.FunctionNumber++);
slotData.u.bits.FunctionNumber<pci_max_function-1> slotData.u.bits.FunctionNumber++)
{/function enumeration/
kdPrint((“pciUtil: FindPCI- call HalGetBusData DeviceNumber=%x,”
“function=%x, busNumber=%x %x”,
slotData.u.bits.DeviceNumber, slotData.u.bits.FunctionNumber,
busNumber,slotData.u.AsULONG));
if(HalGetBusData(PCIConfiguration,busNumber,
slotData.u.AsULONG,&pciData,sizeof(PCI_COMMON_CONFIG)))
{/FUNCTION EXISTS/
if(((0xFFFF==pciVendorId) || (pciData.VendorID==pciVendorId))
&&((0xFFFF==pciDeviceID)||(pciData.DeviceID==pciDeviceId))
)
{
*returnSlotData=slotData;
*returnPciData=pciData;
*returnBusNumber=busNumber;
Found=TRUE;
break;
}else
{
kdPrint(“\n incorrect\n”);
}
}
else
{
kdPrint(" HalGetBusData failed \n");
}
}
if(Found)
{
break;
}
}
if(!Found)
{
return(FALSE);
}
return(TRUE)
}
main()
{
IN BOOLEAN First;
IN unsigned int pciVendorId;
IN unsigned int pciDeviceId;
IN OUT PCI_SLOT_NUMBER *returnSlotData;
IN OUT PCI_COMMON_CONFIG *returnPciData;
IN OUT unsigned int *returnBusNumber;
BOOLEAN Last;
First=FALSE;
pciVendorId=103C;
pciDeviceId=102A;
returnSlotData=NULL;
returnPciData=NULL;
returnBusNumber=NULL;
Last=pciUtilIteratePCI( First,pciVendorId,
pciDeviceId,returnSlotData,returnPciData,
returnBusNumber);
return(Last);
}
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</pci_max_function-1></pci_max_devices-1></ntddk.h>