From: hasyed on
Trying to evaluate _TMP method for the thermal zone. My 1st attempt was from
user-mode.

"Doron Holan [MSFT]" wrote:

> you cannot send this IOCTL from user mode, the driver will not process it
>

I took one more crack at this from a device driver. The code fails in trying
to send IRP downstream. The device driver that I am doing this from is a
simple support driver that can do writes/reads to/from I/O ports.

NtStatus = IoGetDeviceInterfaces((LPGUID)&ThermalGuid , NULL, 0, &list);
if (NtStatus == STATUS_SUCCESS)
{
DbgPrint( "Succesful in getting thermal zone device interface\n");

if (list)
{
PWSTR pl = list;

if (*pl)
{
RtlInitUnicodeString( &sTemp, pl );
NtStatus = IoGetDeviceObjectPointer ( &sTemp, FILE_READ_DATA,
&pFileObjLower, &pThermalDevObj );
if (!NT_SUCCESS (NtStatus))
{
DbgPrint( "IoGetDeviceObjectPointer() failed returned %x\n");
}
else
{
DbgPrint( "IoGetDeviceObjectPointer() succeeded returned
%x\n");
}
ObDereferenceObject(pFileObjLower);
}

ExFreePool (list);
}
}
else
{
return NtStatus;
}

// Fill in the input data
inputBuffer.MethodNameAsUlong = (ULONG) ('_TMP');
inputBuffer.Signature = ACPI_EVAL_INPUT_BUFFER_SIGNATURE;

// Send the request along
NtStatus = SendDownStreamIrp(pThermalDevObj,
IOCTL_ACPI_EVAL_METHOD,
&inputBuffer,
sizeof(ACPI_EVAL_INPUT_BUFFER),
&outputBuffer,
sizeof(ACPI_EVAL_OUTPUT_BUFFER)
);

if (!NT_SUCCESS(NtStatus))
{
ObDereferenceObject(pThermalDevObj);
DbgPrint("Unsucessful in sending IRP down stream\n");
return NtStatus;
}

The error code is 0xc00000bb (STATUS_NOT_SUPPORTED)

One of the obvious things that could be wrong is that this is a support
driver. It is not associated with any device. It is loaded by the
application to do simple tasks such as IO read/write. Does that disqualify
this as a WDM driver which is a requirement for evaluating acpi methods?
Another requirement of using IOCTL_ACPI_EVAL_METHOD was that the driver has
to be in the same namespace as the device object. I am trying to evaluate an
ThermalZone method. Since I have a support driver, does that not meet the
requirement?

 | 
Pages: 1
Prev: Using IOCTL_ACPI_EVAL_METHOD
Next: Compiler Error