网站首页  词典首页

请输入您要查询的函数:

 

术语 virtualquery
释义 VirtualQuery
语法:
C++
SIZE_T WINAPI VirtualQuery(
__in_opt LPCVOID lpAddress,
__out PMEMORY_BASIC_INFORMATION lpBuffer,
__in SIZE_T dwLength
);
VirtualQuery函数
检索了有关资料在调用进程的虚拟地址空间的页面范围。
要检索有关在另一个进程的地址空间页的资料显示,使用VirtualQueryEx功能。
参数
lpAddress [中,可选]
是对地区的页面基址指针质疑。此值向下舍入到下一个页面边界。要确定在主机上的一个页面的大小,使用的GetSystemInfo函数。
lpBuffer [out]
如果一MEMORY_BASIC_INFORMATION结构,使有关指定页面范围的信息返回的指针。
dwLength [in]
缓冲区的大小指向的lpBuffer参数,以字节为单位。
返回值
返回值是在返回的信息缓冲区的实际字节数。
传递一个内核模式指向这个功能可能会导致没有信息被返回,由于安全问题。在这种情况下,返回值是零。
备注
VirtualQuery提供了一个在指定的地址开始连续的网页区域信息共享以下属性:
在所有网页的状态是相同的(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)。
该函数确定在该区域的第一页的属性,然后扫描后续页,直到它会扫描整个范围的页面,或直至它遇到了不匹配的属性设置页面。该函数返回的属性,以及与匹配的属性页区域大小,以字节。例如,如果有一个40兆字节(MB)的可用内存区域,并VirtualQuery上的页面是进入该地区10 MB的要求,该函数将获取MEM_FREE状态和30 MB的大小。
就在调用进程的内存页地区这一职能的报告,并就在一个指定进程的内存页地区VirtualQueryEx功能的报告。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
的GetSystemInfo
MapViewOfFile
内存管理功能
MEMORY_BASIC_INFORMATION
虚拟内存函数
VirtualQueryEx
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==VirtualQuery Function
Retrieves information about a range of pages in the virtual address space of the calling process.
To retrieve information about a range of pages in the address space of another process, use the VirtualQueryEx function.
Syntax
C++
SIZE_T WINAPI VirtualQuery(
__in_opt LPCVOID lpAddress,
__out PMEMORY_BASIC_INFORMATION lpBuffer,
__in SIZE_T dwLength
);
Parameters
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
VirtualQuery 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 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 VirtualQuery 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.
This function reports on a region of pages in the memory of the calling process, and the VirtualQueryEx function reports on a region of pages in the memory of a specified process.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
GetSystemInfo
MapViewOfFile
Memory Management Functions
MEMORY_BASIC_INFORMATION
Virtual Memory Functions
VirtualQueryEx
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa366902(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:27:48