网站首页  词典首页

请输入您要查询的函数:

 

术语 isbadreadptr
释义 IsBadReadPtr
语法:
C++
BOOL WINAPI IsBadReadPtr(
__in const VOID *lp,
__in UINT_PTR ucb
);
IsBadReadPtr功能
验证调用进程具有读取访问指定范围的内存。
重要此功能已经过时,不应使用。尽管它的名字,它并不能保证有效的指针,或指向的内存可以安全使用。有关更多信息,看到注释。
参数
脂蛋白 [in]
一个内存块的第一个字节的指针。
联合银行 [in]
该内存块的大小,以字节。如果此参数为0,返回值是零。
返回值
如果调用进程有读访问权,在指定的内存范围内的所有字节,返回值是零。
如果调用进程没有读地进入指定的内存范围内的所有字节,则返回值为非零。
如果应用程序被编译为调试版本,这个过程不具有读取权限在指定范围内的所有字节内存的功能会导致断言,到调试器中断。离开调试器,功能如常,并返回一个非零值。此行为是设计,作为一个调试援助。
备注
此功能通常用于从第三时返回指针,党库,工作,您不能确定的第三方DLL内存管理的行为。
进程中的线程,预计这种方式进行合作,一个不会释放内存,其他的需要。使用此函数不否认需要这样做。如果不这样做,应用程序可能会失败,不可预知的方式。
提领潜在的无效指针可以禁用其他线程堆栈扩展。一个线程的堆栈耗尽时,堆叠的扩展已被禁用,结果在父进程没有立即终止了错误的诊断信息窗口或弹出。
如果调用进程读取访问一些,但并非所有在指定的内存范围的字节,则返回值为非零。
在抢占式多任务环境中,可能有其他线程改变进程的存取存储器被测试。即使函数表明,这一进程具有读取访问指定的内存,您应该使用结构化异常处理时,试图访问内存。结构化异常处理使用使系统通知进程,如果访问冲突异常时,推动这一进程的机会来处理异常。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
IsBadCodePtr
IsBadStringPtr
IsBadWritePtr
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==IsBadReadPtr Function
Verifies that the calling process has read access to the specified range of memory.
Important This function is obsolete and should not be used. Despite its name, it does not guarantee that the pointer is valid or that the memory pointed to is safe to use. For more information, see Remarks on this page.
Syntax
C++
BOOL WINAPI IsBadReadPtr(
__in const VOID *lp,
__in UINT_PTR ucb
);
Parameters
lp [in]
A pointer to the first byte of the memory block.
ucb [in]
The size of the memory block, in bytes. If this parameter is zero, the return value is zero.
Return Value
If the calling process has read access to all bytes in the specified memory range, the return value is zero.
If the calling process does not have read access to all bytes in the specified memory range, the return value is nonzero.
If the application is compiled as a debugging version, and the process does not have read access to all bytes in the specified memory range, the function causes an assertion and breaks into the debugger. Leaving the debugger, the function continues as usual, and returns a nonzero value. This behavior is by design, as a debugging aid.
Remarks
This function is typically used when working with pointers returned from third-party libraries, where you cannot determine the memory management behavior in the third-party DLL.
Threads in a process are expected to cooperate in such a way that one will not free memory that the other needs. Use of this function does not negate the need to do this. If this is not done, the application may fail in an unpredictable manner.
Dereferencing potentially invalid pointers can disable stack expansion in other threads. A thread exhausting its stack, when stack expansion has been disabled, results in the immediate termination of the parent process, with no pop-up error window or diagnostic information.
If the calling process has read access to some, but not all, of the bytes in the specified memory range, the return value is nonzero.
In a preemptive multitasking environment, it is possible for some other thread to change the process's access to the memory being tested. Even when the function indicates that the process has read access to the specified memory, you should use structured exception handling when attempting to access the memory. Use of structured exception handling enables the system to notify the process if an access violation exception occurs, giving the process an opportunity to handle the exception.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
IsBadCodePtr
IsBadStringPtr
IsBadWritePtr
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa366713(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 13:24:48