使用SetupDiEnumDeviceInfo获取GPU时钟速度

发布于 2024-08-02 12:09:22 字数 351 浏览 8 评论 0原文

我之前发布了一个关于获取 GPU 时钟速度的问题,但我猜该线程似乎已经得到回答,因为有人已经回复了它。

你们的一位成员建议我尝试使用 SetupDiEnumDeviceInfo 提取 GPU 时钟速度。

但是,我查看了一些示例,例如: http://www.codeproject .com/KB/system/DevMgr.aspx

似乎没有显示有关时钟速度的信息。

如果可能的话,有人可以详细说明如何实现这一目标吗?

再次感谢

I posted a question earlier regarding obtaining GPU clock speeds, but I guess the thread appeared as already answered since someone had replied to it.

I'd been advised by one of your members to try extracting GPU clock speeds using SetupDiEnumDeviceInfo.

However, I looked around at some examples, like this one: http://www.codeproject.com/KB/system/DevMgr.aspx

and nothing seemed to be displayed about the clock speed.

Could someone please elaborate on how to achieve this, if at all possible?

Thanks again

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

开始看清了 2024-08-09 12:09:22

您需要查看这篇 msdn 文章:

http://msdn.microsoft。 com/en-us/library/bb742655.aspx

具体来说,请按照下列步骤操作:

Call SetupDiGetDeviceRegistryProperty to retrieve the size, in bytes, of the property  value. Supply the following parameter values:
Set DeviceInfoSet to a handle to a device information set that contains the device instance for which to retrieve the requested property value. 
Set DeviceInfoData to a pointer to an SP_DEVINFO_DATA structure that represents the  device instance for which to retrieve the requested property value. 
Set Property to an SPDRP_Xxx identifier. For a list of these identifiers and a description of the corresponding device properties, see the description of the Property parameter that is included with SetupDiSetDeviceRegistryProperty. 
   Set PropertyRegDataType to a pointer to a DWORD-typed variable. 
   Set PropertyBuffer to NULL. 
   Set PropertyBufferSize to zero. 
   Set RequiredSize to a pointer to a DWORD-typed variable that receives, the size, in bytes of the property value. 

In response to the call to SetupDiSetDeviceRegistryProperty, SetupDiGetDeviceRegistryProperty sets *RequiredSize to the size, in bytes, of the buffer that is required to retrieve the property value, logs the error code ERROR_INSUFFICIENT_BUFFER, and returns FALSE. A subsequent call to GetLastError will return the most recently logged error code.

Call SetupDiGetDeviceRegistryProperty again and supply the same parameter values that were supplied in the first call, except for the following changes:

将 PropertyBuffer 设置为指向接收请求的属性值的 BYTE 类型缓冲区的指针。
将 PropertyBufferSize 设置为 PropertyBuffer 缓冲区的大小(以字节为单位)。对SetupDiGetDeviceRegistryProperty 的第一次调用在*RequiredSize 中检索了PropertyBuffer 缓冲区所需的大小。

此链接显示了如何获得调用 SetupDiGetDeviceRegistryProperty 所需的结构。

http://www.pinvoke.net/default.aspx/setupapi/SetupDiEnumDeviceInfo。 html

You will want to check out this msdn article:

http://msdn.microsoft.com/en-us/library/bb742655.aspx

Specifically, follow these steps:

Call SetupDiGetDeviceRegistryProperty to retrieve the size, in bytes, of the property  value. Supply the following parameter values:
Set DeviceInfoSet to a handle to a device information set that contains the device instance for which to retrieve the requested property value. 
Set DeviceInfoData to a pointer to an SP_DEVINFO_DATA structure that represents the  device instance for which to retrieve the requested property value. 
Set Property to an SPDRP_Xxx identifier. For a list of these identifiers and a description of the corresponding device properties, see the description of the Property parameter that is included with SetupDiSetDeviceRegistryProperty. 
   Set PropertyRegDataType to a pointer to a DWORD-typed variable. 
   Set PropertyBuffer to NULL. 
   Set PropertyBufferSize to zero. 
   Set RequiredSize to a pointer to a DWORD-typed variable that receives, the size, in bytes of the property value. 

In response to the call to SetupDiSetDeviceRegistryProperty, SetupDiGetDeviceRegistryProperty sets *RequiredSize to the size, in bytes, of the buffer that is required to retrieve the property value, logs the error code ERROR_INSUFFICIENT_BUFFER, and returns FALSE. A subsequent call to GetLastError will return the most recently logged error code.

Call SetupDiGetDeviceRegistryProperty again and supply the same parameter values that were supplied in the first call, except for the following changes:

Set PropertyBuffer to a pointer to a BYTE-typed buffer that receives the requested property value.
Set PropertyBufferSize to the the size, in bytes, of the PropertyBuffer buffer. The first call to SetupDiGetDeviceRegistryProperty retrieved the required size of the PropertyBuffer buffer in *RequiredSize.

This link shows how to get to the point where you've got the required strucutres to call SetupDiGetDeviceRegistryProperty.

http://www.pinvoke.net/default.aspx/setupapi/SetupDiEnumDeviceInfo.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文