Ejemplo n.º 1
0
//
//	Complement Windows 2000's IoGetDeviceProperty()
//
NTSTATUS
DrGetDeviceProperty(
	IN PDEVICE_OBJECT  DeviceObject,
    IN DEVICE_REGISTRY_PROPERTY  DeviceProperty,
    IN ULONG	BufferLength,
    OUT PVOID	PropertyBuffer,
    OUT PULONG  ResultLength,
	IN BOOLEAN	Win2K
) {
	NTSTATUS	status;

	ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL);

	if(!DeviceObject)
		return STATUS_INVALID_PARAMETER;
	if(Win2K) {
		status = DrGetDeviceProperty_ExtW2K(
							DeviceObject,
							DeviceProperty,
							BufferLength,
							PropertyBuffer,
							ResultLength
			);
	} else {

		__try {

			status = IoGetDeviceProperty(
							DeviceObject,
							DeviceProperty,
							BufferLength,
							PropertyBuffer,
							ResultLength
						);

		}  __except (EXCEPTION_EXECUTE_HANDLER) {

			status = GetExceptionCode();
			KDPrint(1, ("IoGetDeviceProperty() Exception: %08lx\n", status));

		}

	}


	return status;
}
Ejemplo n.º 2
0
//
//	Complement Windows 2000's IoGetDeviceProperty()
//
NTSTATUS
DrGetDeviceProperty(
	IN PDEVICE_OBJECT  DeviceObject,
    IN DEVICE_REGISTRY_PROPERTY  DeviceProperty,
    IN ULONG	BufferLength,
    OUT PVOID	PropertyBuffer,
    OUT PULONG  ResultLength,
	IN BOOLEAN	Win2K
) {
	NTSTATUS	status;

	ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL);

	if(!DeviceObject)
		return STATUS_INVALID_PARAMETER;
	if(Win2K) {
		status = DrGetDeviceProperty_ExtW2K(
							DeviceObject,
							DeviceProperty,
							BufferLength,
							PropertyBuffer,
							ResultLength
			);
	} else {
		status = IoGetDeviceProperty(
							DeviceObject,
							DeviceProperty,
							BufferLength,
							PropertyBuffer,
							ResultLength
						);
	}


	return status;
}