网站首页  词典首页

请输入您要查询的函数:

 

术语 virtualqueryex
释义 VirtualQueryEx
语法:
C++
SIZE_T WINAPI VirtualQueryEx(
__in HANDLE hProcess,
__in_opt LPCVOID lpAddress,
__out PMEMORY_BASIC_INFORMATION lpBuffer,
__in SIZE_T dwLength
);
VirtualQueryEx功能
信息检索的网页在一个特定进程的虚拟地址空间范围。
参数
hProcess [in]
一个句柄,的内存信息被查询的过程。句柄必须已与PROCESS_QUERY_INFORMATION访问权限,使利用处理读取的过程中对象的信息开放。有关更多信息,请参见过程的安全性和访问权限。
lpAddress [中,可选]
是对地区的页面基址指针质疑。此值向下舍入到下一个页面边界。要确定在主机上的一个页面的大小,使用的GetSystemInfo函数。
lpBuffer [out]
如果一MEMORY_BASIC_INFORMATION结构,使有关指定页面范围的信息返回的指针。
dwLength [in]
缓冲区的大小指向的lpBuffer参数,以字节为单位。
返回值
返回值是在返回的信息缓冲区的实际字节数。
传递一个内核模式指向这个功能可能会导致没有信息被返回,由于安全问题。在这种情况下,返回值是零。
备注
VirtualQueryEx提供了一个在指定的地址开始连续的网页区域信息共享以下属性:
在所有网页的状态是相同的(MEM_COMMIT,MEM_RESERVE,MEM_FREE,MEM_PRIVATE,MEM_MAPPED,或MEM_IMAGE)。
如果最初的页面不是免费的,在该地区的所有的网页是相同的网页初始分配的一部分。
给予所有网页的访问是一样的(PAGE_READONLY,PAGE_READWRITE,PAGE_NOACCESS,PAGE_WRITECOPY,PAGE_EXECUTE,PAGE_EXECUTE_READ,PAGE_EXECUTE_READWRITE,PAGE_EXECUTE_WRITECOPY,PAGE_GUARD,或PAGE_NOCACHE)。
该VirtualQueryEx函数确定在该区域的第一页的属性,然后扫描后续页,直到它会扫描整个范围的页面,或直至它遇到了不匹配的属性设置页面。该函数返回的属性,以及与匹配的属性页区域大小,以字节。例如,如果有一个40兆字节(MB)的可用内存区域,并VirtualQueryEx上的页面是进入该地区10 MB的要求,该函数将获取MEM_FREE状态和30 MB的大小。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
的GetSystemInfo
MapViewOfFileEx
内存管理功能
MEMORY_BASIC_INFORMATION
虚拟内存函数
VirtualAllocEx
VirtualProtectEx
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==VirtualQueryEx Function
Retrieves information about a range of pages within the virtual address space of a specified process.
Syntax
C++
SIZE_T WINAPI VirtualQueryEx(
__in HANDLE hProcess,
__in_opt LPCVOID lpAddress,
__out PMEMORY_BASIC_INFORMATION lpBuffer,
__in SIZE_T dwLength
);
Parameters
hProcess [in]
A handle to the process whose memory information is queried. The handle must have been opened with the PROCESS_QUERY_INFORMATION access right, which enables using the handle to read information from the process object. For more information, see Process Security and Access Rights .
lpAddress [in, optional]
A pointer to the base address of the region of pages to be queried. This value is rounded down to the next page boundary. To determine the size of a page on the host computer, use the GetSystemInfo function.
lpBuffer [out]
A pointer to a MEMORY_BASIC_INFORMATION structure in which information about the specified page range is returned.
dwLength [in]
The size of the buffer pointed to by the lpBuffer parameter, in bytes.
Return Value
The return value is the actual number of bytes returned in the information buffer.
Passing a kernel-mode pointer to this function can result in no information being returned, due to security issues. In this case, the return value is zero.
Remarks
VirtualQueryEx provides information about a region of consecutive pages beginning at a specified address that share the following attributes:
The state of all pages is the same (MEM_COMMIT, MEM_RESERVE, MEM_FREE, MEM_PRIVATE, MEM_MAPPED, or MEM_IMAGE).
If the initial page is not free, all pages in the region are part of the same initial allocation of pages.
The access granted to all pages is the same (PAGE_READONLY, PAGE_READWRITE, PAGE_NOACCESS, PAGE_WRITECOPY, PAGE_EXECUTE, PAGE_EXECUTE_READ, PAGE_EXECUTE_READWRITE, PAGE_EXECUTE_WRITECOPY, PAGE_GUARD, or PAGE_NOCACHE).
The VirtualQueryEx function determines the attributes of the first page in the region and then scans subsequent pages until it scans the entire range of pages, or until it encounters a page with a nonmatching set of attributes. The function returns the attributes and the size of the region of pages with matching attributes, in bytes. For example, if there is a 40 megabyte (MB) region of free memory, and VirtualQueryEx is called on a page that is 10 MB into the region, the function will obtain a state of MEM_FREE and a size of 30 MB.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
GetSystemInfo
MapViewOfFileEx
Memory Management Functions
MEMORY_BASIC_INFORMATION
Virtual Memory Functions
VirtualAllocEx
VirtualProtectEx
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa366907(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:29:53