QueryInformationJobObject和JobObjectBasicProcessIdList(包括Windows 10 CTP)的WOW64问题 [英] WOW64 Issue with QueryInformationJobObject and JobObjectBasicProcessIdList (Including Windows 10 CTP)

查看:355
本文介绍了QueryInformationJobObject和JobObjectBasicProcessIdList(包括Windows 10 CTP)的WOW64问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是至少存在于Windows 7(没有要测试的Vista系统)的错误,并且仍然存在于Windows 10 CTP上。  如果QueryInformationJobObject被称为具有尺寸不足的WOW64下一个缓冲区,错误ERROR_MORE_DATA将返回
如预期,但在JOBOBJECT_BASIC_PROCESS_ID_LIST结构NumberOfAssignedProcesses将不包含在任务中的进程数。  如果在32位系统或64位应用程序上从32位应用程序调用它,它将正常工作。  因此,您需要
来提供足够大的缓冲区,以容纳作业所需的最大可能进程数,以防止出现ERROR_MORE_DATA错误。  只要缓冲区足够大且未返回ERROR_MORE_DATA,您就会在WOW64下获得
NumberOfAssignedProcesses的值。

This is a bug that exists from at least Windows 7 (did not have a Vista system to test) and is still present on Windows 10 CTP.  If QueryInformationJobObject is called with a buffer of insufficient size under WOW64, error ERROR_MORE_DATA will be returned as expected but NumberOfAssignedProcesses in the JOBOBJECT_BASIC_PROCESS_ID_LIST structure will not contain the number of processes in the job.  If called from a 32-bit app on a 32-bit system or a 64-bit app it will work fine.  As such, you need to provide a buffer large enough to accommodate the largest possible number of processes expected for the job to prevent the ERROR_MORE_DATA error.  As long as the buffer is large enough and ERROR_MORE_DATA is not returned, you will then get a value for NumberOfAssignedProcesses under WOW64.

由于Windows 10仍然是一个工作 - 正在进行中,也许这个错误可以在发货前解决。

Since Windows 10 is still a work-in-progress, perhaps this bug can be addressed before shipment.

功能矩阵:

处理器架构:x64,平台:x64 = OKAY

Processor Architecture: x64, Platform: x64 = OKAY

推荐答案

您好,

如果API返回ERROR_MORE_DATA,结构中的信息无效。  API需要成功才能使结构中的信息有效。

If the API is returning ERROR_MORE_DATA, the information in the struct is not valid.  The API would need to succeed for the information in the structure to be valid.

以下情况下的行为似乎恰好起作用。

It seems like the behavior on the following scenarios just happens to work.

处理器架构:x64,平台:x64 = OKAY

Processor Architecture: x64, Platform: x64 = OKAY

处理器架构:x86,平台:x86 = OKAY

Processor Architecture: x86, Platform: x86 = OKAY

如果返回ERROR_MORE_DATA,我在文档中看不到任何表明结构中的值有效的内容。

I don't see anything in the docs which indicate that the values in the structure are valid if ERROR_MORE_DATA is returned.

Frank K [MSFT]

Frank K [MSFT]


这篇关于QueryInformationJobObject和JobObjectBasicProcessIdList(包括Windows 10 CTP)的WOW64问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆