Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
704d0662
Commit
704d0662
authored
Jul 15, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix RtlSizeHeap() error value for 64-bit.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
82dc024a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
heap.c
dlls/kernel32/heap.c
+4
-4
heap.c
dlls/ntdll/heap.c
+3
-3
env.c
dlls/ntdll/tests/env.c
+4
-4
No files found.
dlls/kernel32/heap.c
View file @
704d0662
...
...
@@ -333,10 +333,10 @@ SIZE_T WINAPI GlobalSize(HGLOBAL hmem)
{
retval
=
HeapSize
(
GetProcessHeap
(),
0
,
hmem
);
if
(
retval
==
~
0ul
)
/* It might be a GMEM_MOVEABLE data pointer */
if
(
retval
==
~
(
SIZE_T
)
0
)
/* It might be a GMEM_MOVEABLE data pointer */
{
retval
=
HeapSize
(
GetProcessHeap
(),
0
,
(
char
*
)
hmem
-
HGLOBAL_STORAGE
);
if
(
retval
!=
~
0ul
)
retval
-=
HGLOBAL_STORAGE
;
if
(
retval
!=
~
(
SIZE_T
)
0
)
retval
-=
HGLOBAL_STORAGE
;
}
}
else
...
...
@@ -351,7 +351,7 @@ SIZE_T WINAPI GlobalSize(HGLOBAL hmem)
else
{
retval
=
HeapSize
(
GetProcessHeap
(),
0
,
(
char
*
)
pintern
->
Pointer
-
HGLOBAL_STORAGE
);
if
(
retval
!=
~
0ul
)
retval
-=
HGLOBAL_STORAGE
;
if
(
retval
!=
~
(
SIZE_T
)
0
)
retval
-=
HGLOBAL_STORAGE
;
}
}
else
...
...
@@ -362,7 +362,7 @@ SIZE_T WINAPI GlobalSize(HGLOBAL hmem)
}
RtlUnlockHeap
(
GetProcessHeap
());
}
if
(
retval
==
~
0ul
)
retval
=
0
;
if
(
retval
==
~
(
SIZE_T
)
0
)
retval
=
0
;
return
retval
;
}
...
...
dlls/ntdll/heap.c
View file @
704d0662
...
...
@@ -116,7 +116,7 @@ C_ASSERT( HEAP_MAX_SMALL_FREE_LIST % ALIGNMENT == 0 );
/* Max size of the blocks on the free lists above HEAP_MAX_SMALL_FREE_LIST */
static
const
SIZE_T
HEAP_freeListSizes
[]
=
{
0x200
,
0x400
,
0x1000
,
~
0UL
0x200
,
0x400
,
0x1000
,
~
(
SIZE_T
)
0
};
#define HEAP_NB_FREE_LISTS (ARRAY_SIZE( HEAP_freeListSizes ) + HEAP_NB_SMALL_FREE_LISTS)
...
...
@@ -2007,7 +2007,7 @@ SIZE_T WINAPI RtlSizeHeap( HANDLE heap, ULONG flags, const void *ptr )
if
(
!
heapPtr
)
{
RtlSetLastWin32ErrorAndNtStatusFromNtStatus
(
STATUS_INVALID_HANDLE
);
return
~
0UL
;
return
~
(
SIZE_T
)
0
;
}
flags
&=
HEAP_NO_SERIALIZE
;
flags
|=
heapPtr
->
flags
;
...
...
@@ -2017,7 +2017,7 @@ SIZE_T WINAPI RtlSizeHeap( HANDLE heap, ULONG flags, const void *ptr )
if
(
!
validate_block_pointer
(
heapPtr
,
&
subheap
,
pArena
))
{
RtlSetLastWin32ErrorAndNtStatusFromNtStatus
(
STATUS_INVALID_PARAMETER
);
ret
=
~
0UL
;
ret
=
~
(
SIZE_T
)
0
;
}
else
if
(
!
subheap
)
{
...
...
dlls/ntdll/tests/env.c
View file @
704d0662
...
...
@@ -386,7 +386,7 @@ static void test_process_params(void)
else
{
size
=
HeapSize
(
GetProcessHeap
(),
0
,
params
);
ok
(
size
!=
~
0UL
,
"not a heap block %p
\n
"
,
params
);
ok
(
size
!=
~
(
SIZE_T
)
0
,
"not a heap block %p
\n
"
,
params
);
ok
(
params
->
AllocationSize
==
params
->
Size
,
"wrong AllocationSize %x/%x
\n
"
,
params
->
AllocationSize
,
params
->
Size
);
}
...
...
@@ -456,7 +456,7 @@ static void test_process_params(void)
else
{
size
=
HeapSize
(
GetProcessHeap
(),
0
,
params
);
ok
(
size
!=
~
0UL
,
"not a heap block %p
\n
"
,
params
);
ok
(
size
!=
~
(
SIZE_T
)
0
,
"not a heap block %p
\n
"
,
params
);
ok
(
params
->
AllocationSize
==
params
->
Size
,
"wrong AllocationSize %x/%x
\n
"
,
params
->
AllocationSize
,
params
->
Size
);
}
...
...
@@ -509,7 +509,7 @@ static void test_process_params(void)
else
{
size
=
HeapSize
(
GetProcessHeap
(),
0
,
cur_params
);
ok
(
size
!=
~
0UL
,
"not a heap block %p
\n
"
,
cur_params
);
ok
(
size
!=
~
(
SIZE_T
)
0
,
"not a heap block %p
\n
"
,
cur_params
);
ok
(
cur_params
->
AllocationSize
==
cur_params
->
Size
,
"wrong AllocationSize %x/%x
\n
"
,
cur_params
->
AllocationSize
,
cur_params
->
Size
);
ok
(
cur_params
->
Size
==
size
,
"wrong Size %x/%lx
\n
"
,
cur_params
->
Size
,
size
);
...
...
@@ -548,7 +548,7 @@ static void test_process_params(void)
else
{
size
=
HeapSize
(
GetProcessHeap
(),
0
,
initial_env
);
ok
(
size
!=
~
0UL
,
"env is not a heap block %p / %p
\n
"
,
cur_params
,
initial_env
);
ok
(
size
!=
~
(
SIZE_T
)
0
,
"env is not a heap block %p / %p
\n
"
,
cur_params
,
initial_env
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment