Prev: INF Warings
Next: Unloading NDIS IM Filter driver
From: hasyed on 5 Aug 2010 16:26 From my windows user-mode environment, I would like to read the temperature of the thermal zones. I don't want to use WMI since those values are not updated on most systems. I would like to use IOCTL_ACPI_EVAL_METHOD. Using device manager, I see that the thermal zones don't really have a driver associated with them. Nevertheless, I tried the following code below. I am able to get a handle to the thermal zone using CreateFile hDevice = CreateFile(szDevicePath, (DWORD)(GENERIC_READ | GENERIC_WRITE), 0, NULL,OPEN_EXISTING,0,NULL); if (hDevice == INVALID_HANDLE_VALUE) { return 0; } InBuf.Signature = ACPI_EVAL_INPUT_BUFFER_SIGNATURE; InBuf.MethodName[0] = '_'; InBuf.MethodName[1] = 'T'; InBuf.MethodName[2] = 'M'; InBuf.MethodName[3] = 'P'; // Verify Driver version from driver IoctlResult = DeviceIoControl(hDevice, IOCTL_ACPI_EVAL_METHOD, &InBuf, (DWORD) sizeof(InBuf), // Input &OutBuff, (DWORD) sizeof(OutBuff), // Output &ReturnedLength, NULL); The IoctlResult in Vista returns a 1 and the OutBuff contains junk data. In XP, IoctlResult is a 0 (fail). To get the handle to the thermal zone, I used functions SetupDiGetClassDevs, SetupDiEnumDeviceInterfaces, SetupDiGetDeviceInterfaceDetail with the thermalzone guid. Am I on the right path? What am I missing? Thanks for any guidance.
From: Maxim S. Shatskih on 6 Aug 2010 02:29 > From my windows user-mode environment, I would like to read the temperature > of the thermal zones. I don't want to use WMI since those values are not > updated on most systems. I would like to use IOCTL_ACPI_EVAL_METHOD. Well, if WMI is not implemented, then probably the ACPI thermal zones are also non-working. -- Maxim S. Shatskih Windows DDK MVP maxim(a)storagecraft.com http://www.storagecraft.com
From: hasyed on 6 Aug 2010 10:00 WMI is implemented. On a number of systems, if you use WMI to read the thermal zone temperature, you will see the temperature does not change. Or it won't change as regularly as you would like. Perhaps, the BIOS team decided to only update through WMI once every 3 minutes. So, if one want to read the thermal zone temperature every 5 seconds, one can't go through WMI. One has to somehow evaluate the ACPI method (_TMP) that is associated with a particular thermal zone.
From: hasyed on 6 Aug 2010 11:10 I don't know what happened to another reply that I made. Below is what I tried to ask in that. Part of my question is, "Do I need to build a driver for a particular thermal zone" and then issue an IOCTL call (IOCTL_ACPI_EVAL_METHOD) to that particular driver? In the msdn, it mentions, "To enhance the functionality of an ACPI device, the vendor can supply a WDM function driver, which communicates with the ACPI BIOS through an operation region supplied by the driver" Since I don't want to enhance the ACPI device, I assume that I don't need to build a driver. I can just use CreateFile to get a handle to that device and issue an IOCTL call. Please correct me if I am wrong on this. Thanks
From: Doron Holan [MSFT] on 6 Aug 2010 13:24
you cannot send this IOCTL from user mode, the driver will not process it "hasyed" wrote in message news:B0870B4E-51EA-4310-95DA-C2081761F270(a)microsoft.com... I don't know what happened to another reply that I made. Below is what I tried to ask in that. Part of my question is, "Do I need to build a driver for a particular thermal zone" and then issue an IOCTL call (IOCTL_ACPI_EVAL_METHOD) to that particular driver? In the msdn, it mentions, "To enhance the functionality of an ACPI device, the vendor can supply a WDM function driver, which communicates with the ACPI BIOS through an operation region supplied by the driver" Since I don't want to enhance the ACPI device, I assume that I don't need to build a driver. I can just use CreateFile to get a handle to that device and issue an IOCTL call. Please correct me if I am wrong on this. Thanks |