[PATCH] include: Fix IsBad* prototypes
Nikolay Sivov
nsivov at codeweavers.com
Tue Mar 1 02:53:31 CST 2016
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/kernel32/virtual.c | 16 ++++++++--------
include/winbase.h | 12 ++++++------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/kernel32/virtual.c b/dlls/kernel32/virtual.c
index 4bfc6cc..cce707b 100644
--- a/dlls/kernel32/virtual.c
+++ b/dlls/kernel32/virtual.c
@@ -647,7 +647,7 @@ UINT WINAPI ResetWriteWatch( LPVOID base, SIZE_T size )
* Success: TRUE.
* Failure: FALSE. Process has read access to entire block.
*/
-BOOL WINAPI IsBadReadPtr( LPCVOID ptr, UINT size )
+BOOL WINAPI IsBadReadPtr( LPCVOID ptr, UINT_PTR size )
{
if (!size) return FALSE; /* handle 0 size case w/o reference */
if (!ptr) return TRUE;
@@ -655,7 +655,7 @@ BOOL WINAPI IsBadReadPtr( LPCVOID ptr, UINT size )
{
volatile const char *p = ptr;
char dummy __attribute__((unused));
- UINT count = size;
+ UINT_PTR count = size;
while (count > system_info.PageSize)
{
@@ -689,14 +689,14 @@ BOOL WINAPI IsBadReadPtr( LPCVOID ptr, UINT size )
* Success: TRUE.
* Failure: FALSE. Process has write access to entire block.
*/
-BOOL WINAPI IsBadWritePtr( LPVOID ptr, UINT size )
+BOOL WINAPI IsBadWritePtr( LPVOID ptr, UINT_PTR size )
{
if (!size) return FALSE; /* handle 0 size case w/o reference */
if (!ptr) return TRUE;
__TRY
{
volatile char *p = ptr;
- UINT count = size;
+ UINT_PTR count = size;
while (count > system_info.PageSize)
{
@@ -730,7 +730,7 @@ BOOL WINAPI IsBadWritePtr( LPVOID ptr, UINT size )
* Success: TRUE.
* Failure: FALSE. Process has read access to entire block.
*/
-BOOL WINAPI IsBadHugeReadPtr( LPCVOID ptr, UINT size )
+BOOL WINAPI IsBadHugeReadPtr( LPCVOID ptr, UINT_PTR size )
{
return IsBadReadPtr( ptr, size );
}
@@ -749,7 +749,7 @@ BOOL WINAPI IsBadHugeReadPtr( LPCVOID ptr, UINT size )
* Success: TRUE.
* Failure: FALSE. Process has write access to entire block.
*/
-BOOL WINAPI IsBadHugeWritePtr( LPVOID ptr, UINT size )
+BOOL WINAPI IsBadHugeWritePtr( LPVOID ptr, UINT_PTR size )
{
return IsBadWritePtr( ptr, size );
}
@@ -786,7 +786,7 @@ BOOL WINAPI IsBadCodePtr( FARPROC ptr )
* Success: TRUE.
* Failure: FALSE. Read access to all bytes in string.
*/
-BOOL WINAPI IsBadStringPtrA( LPCSTR str, UINT max )
+BOOL WINAPI IsBadStringPtrA( LPCSTR str, UINT_PTR max )
{
if (!str) return TRUE;
@@ -810,7 +810,7 @@ BOOL WINAPI IsBadStringPtrA( LPCSTR str, UINT max )
*
* See IsBadStringPtrA.
*/
-BOOL WINAPI IsBadStringPtrW( LPCWSTR str, UINT max )
+BOOL WINAPI IsBadStringPtrW( LPCWSTR str, UINT_PTR max )
{
if (!str) return TRUE;
diff --git a/include/winbase.h b/include/winbase.h
index 89f27c9..15edac3 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -2236,13 +2236,13 @@ WINBASEAPI PSLIST_ENTRY WINAPI InterlockedFlushSList(PSLIST_HEADER);
WINBASEAPI PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER);
WINBASEAPI PSLIST_ENTRY WINAPI InterlockedPushEntrySList(PSLIST_HEADER, PSLIST_ENTRY);
WINBASEAPI BOOL WINAPI IsBadCodePtr(FARPROC);
-WINBASEAPI BOOL WINAPI IsBadHugeReadPtr(LPCVOID,UINT);
-WINBASEAPI BOOL WINAPI IsBadHugeWritePtr(LPVOID,UINT);
-WINBASEAPI BOOL WINAPI IsBadReadPtr(LPCVOID,UINT);
-WINBASEAPI BOOL WINAPI IsBadStringPtrA(LPCSTR,UINT);
-WINBASEAPI BOOL WINAPI IsBadStringPtrW(LPCWSTR,UINT);
+WINBASEAPI BOOL WINAPI IsBadHugeReadPtr(LPCVOID,UINT_PTR);
+WINBASEAPI BOOL WINAPI IsBadHugeWritePtr(LPVOID,UINT_PTR);
+WINBASEAPI BOOL WINAPI IsBadReadPtr(LPCVOID,UINT_PTR);
+WINBASEAPI BOOL WINAPI IsBadStringPtrA(LPCSTR,UINT_PTR);
+WINBASEAPI BOOL WINAPI IsBadStringPtrW(LPCWSTR,UINT_PTR);
#define IsBadStringPtr WINELIB_NAME_AW(IsBadStringPtr)
-WINBASEAPI BOOL WINAPI IsBadWritePtr(LPVOID,UINT);
+WINBASEAPI BOOL WINAPI IsBadWritePtr(LPVOID,UINT_PTR);
WINBASEAPI BOOL WINAPI IsDebuggerPresent(void);
WINBASEAPI BOOL WINAPI IsSystemResumeAutomatic(void);
WINADVAPI BOOL WINAPI IsTextUnicode(LPCVOID,INT,LPINT);
--
2.7.0
More information about the wine-patches
mailing list