Hi,
I keep getting the link error “unresolved external symbol
_GUID_BUS_INTERFACE_STANDARD” when I try to use GetPCIBusInterfaceStandard
function copied from the “HOWTO: Get Configuration and Location Information
of PCI Device” article. Is the GUID_BUS_INTERFACE_STANDARD already defined
in wdmguid.h ? Any idea ? I’m using Win2000 DDK. Thanks!
#include “mydriver.h”
#include <wdm.h>
#include <wdmguid.h>
NTSTATUS
GetPCIBusInterfaceStandard( IN PDEVICE_OBJECT DeviceObject, OUT
PBUS_INTERFACE_STANDARD BusInterfaceStandard )
{
KEVENT event;
NTSTATUS status;
PIRP irp;
IO_STATUS_BLOCK ioStatusBlock;
PIO_STACK_LOCATION irpStack;
PDEVICE_OBJECT targetObject;
DbgPrint(“GetPciBusInterfaceStandard entered.\n”);
KeInitializeEvent( &event, NotificationEvent, FALSE );
targetObject = IoGetAttachedDeviceReference( DeviceObject );
irp = IoBuildSynchronousFsdRequest( IRP_MJ_PNP, targetObject, NULL, 0,
NULL, &event, &ioStatusBlock );
if (irp == NULL) { status = STATUS_INSUFFICIENT_RESOURCES; goto End; }
irpStack = IoGetNextIrpStackLocation( irp );
irpStack->MinorFunction = IRP_MN_QUERY_INTERFACE;
irpStack->Parameters.QueryInterface.InterfaceType = (LPGUID)
&GUID_BUS_INTERFACE_STANDARD ;
irpStack->Parameters.QueryInterface.Size = sizeof(BUS_INTERFACE_STANDARD);
irpStack->Parameters.QueryInterface.Version = 1;
irpStack->Parameters.QueryInterface.Interface = (PINTERFACE)
BusInterfaceStandard;
irpStack->Parameters.QueryInterface.InterfaceSpecificData = NULL;
// Initialize the status to error in case the bus driver does not set it
correctly.
irp->IoStatus.Status = STATUS_NOT_SUPPORTED ;
status = IoCallDriver( targetObject, irp );
if (status == STATUS_PENDING) {
KeWaitForSingleObject( &event, Executive, KernelMode, FALSE, NULL );
status = ioStatusBlock.Status;
}
End:
// Done with reference
ObDereferenceObject( targetObject );
return status;
}
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
—
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</wdmguid.h></wdm.h>