Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6d799bfa
Commit
6d799bfa
authored
Dec 02, 2020
by
Piotr Caban
Committed by
Alexandre Julliard
Dec 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use heap structures and definitions from public header.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a2c6c313
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
32 deletions
+15
-32
heap.c
dlls/msvcrt/heap.c
+15
-14
msvcrt.h
dlls/msvcrt/msvcrt.h
+0
-18
No files found.
dlls/msvcrt/heap.c
View file @
6d799bfa
...
...
@@ -21,6 +21,7 @@
* handler and non atomic heap operations
*/
#include <malloc.h>
#include "msvcrt.h"
#include "mtdll.h"
#include "wine/debug.h"
...
...
@@ -246,9 +247,9 @@ int CDECL _heapchk(void)
(
sb_heap
&&
!
HeapValidate
(
sb_heap
,
0
,
NULL
)))
{
msvcrt_set_errno
(
GetLastError
());
return
MSVCRT_
_HEAPBADNODE
;
return
_HEAPBADNODE
;
}
return
MSVCRT_
_HEAPOK
;
return
_HEAPOK
;
}
/*********************************************************************
...
...
@@ -269,7 +270,7 @@ int CDECL _heapmin(void)
/*********************************************************************
* _heapwalk (MSVCRT.@)
*/
int
CDECL
_heapwalk
(
struct
MSVCRT__heapinfo
*
next
)
int
CDECL
_heapwalk
(
_HEAPINFO
*
next
)
{
PROCESS_HEAP_ENTRY
phe
;
...
...
@@ -279,14 +280,14 @@ int CDECL _heapwalk(struct MSVCRT__heapinfo* next)
LOCK_HEAP
;
phe
.
lpData
=
next
->
_pentry
;
phe
.
cbData
=
next
->
_size
;
phe
.
wFlags
=
next
->
_useflag
==
MSVCRT_
_USEDENTRY
?
PROCESS_HEAP_ENTRY_BUSY
:
0
;
phe
.
wFlags
=
next
->
_useflag
==
_USEDENTRY
?
PROCESS_HEAP_ENTRY_BUSY
:
0
;
if
(
phe
.
lpData
&&
phe
.
wFlags
&
PROCESS_HEAP_ENTRY_BUSY
&&
!
HeapValidate
(
heap
,
0
,
phe
.
lpData
))
{
UNLOCK_HEAP
;
msvcrt_set_errno
(
GetLastError
());
return
MSVCRT_
_HEAPBADNODE
;
return
_HEAPBADNODE
;
}
do
...
...
@@ -295,19 +296,19 @@ int CDECL _heapwalk(struct MSVCRT__heapinfo* next)
{
UNLOCK_HEAP
;
if
(
GetLastError
()
==
ERROR_NO_MORE_ITEMS
)
return
MSVCRT_
_HEAPEND
;
return
_HEAPEND
;
msvcrt_set_errno
(
GetLastError
());
if
(
!
phe
.
lpData
)
return
MSVCRT_
_HEAPBADBEGIN
;
return
MSVCRT_
_HEAPBADNODE
;
return
_HEAPBADBEGIN
;
return
_HEAPBADNODE
;
}
}
while
(
phe
.
wFlags
&
(
PROCESS_HEAP_REGION
|
PROCESS_HEAP_UNCOMMITTED_RANGE
));
UNLOCK_HEAP
;
next
->
_pentry
=
phe
.
lpData
;
next
->
_size
=
phe
.
cbData
;
next
->
_useflag
=
phe
.
wFlags
&
PROCESS_HEAP_ENTRY_BUSY
?
MSVCRT__USEDENTRY
:
MSVCRT_
_FREEENTRY
;
return
MSVCRT_
_HEAPOK
;
next
->
_useflag
=
phe
.
wFlags
&
PROCESS_HEAP_ENTRY_BUSY
?
_USEDENTRY
:
_FREEENTRY
;
return
_HEAPOK
;
}
/*********************************************************************
...
...
@@ -316,17 +317,17 @@ int CDECL _heapwalk(struct MSVCRT__heapinfo* next)
int
CDECL
_heapset
(
unsigned
int
value
)
{
int
retval
;
struct
MSVCRT__heapinfo
heap
;
_HEAPINFO
heap
;
memset
(
&
heap
,
0
,
sizeof
(
heap
)
);
LOCK_HEAP
;
while
((
retval
=
_heapwalk
(
&
heap
))
==
MSVCRT_
_HEAPOK
)
while
((
retval
=
_heapwalk
(
&
heap
))
==
_HEAPOK
)
{
if
(
heap
.
_useflag
==
MSVCRT_
_FREEENTRY
)
if
(
heap
.
_useflag
==
_FREEENTRY
)
memset
(
heap
.
_pentry
,
value
,
heap
.
_size
);
}
UNLOCK_HEAP
;
return
retval
==
MSVCRT__HEAPEND
?
MSVCRT_
_HEAPOK
:
retval
;
return
retval
==
_HEAPEND
?
_HEAPOK
:
retval
;
}
/*********************************************************************
...
...
dlls/msvcrt/msvcrt.h
View file @
6d799bfa
...
...
@@ -247,8 +247,6 @@ extern void msvcrt_free_scheduler_thread(void) DECLSPEC_HIDDEN;
extern
unsigned
msvcrt_create_io_inherit_block
(
WORD
*
,
BYTE
**
)
DECLSPEC_HIDDEN
;
extern
unsigned
int
__cdecl
_control87
(
unsigned
int
,
unsigned
int
);
/* run-time error codes */
#define _RT_STACK 0
#define _RT_NULLPTR 1
...
...
@@ -287,12 +285,6 @@ extern FILE MSVCRT__iob[];
typedef
struct
_complex
_Dcomplex
;
struct
MSVCRT__heapinfo
{
int
*
_pentry
;
size_t
_size
;
int
_useflag
;
};
#ifdef __i386__
struct
MSVCRT___JUMP_BUFFER
{
unsigned
long
Ebp
;
...
...
@@ -560,16 +552,6 @@ struct MSVCRT__stat64 {
#define MSVCRT__P_NOWAITO 3
#define MSVCRT__P_DETACH 4
#define MSVCRT__HEAPEMPTY -1
#define MSVCRT__HEAPOK -2
#define MSVCRT__HEAPBADBEGIN -3
#define MSVCRT__HEAPBADNODE -4
#define MSVCRT__HEAPEND -5
#define MSVCRT__HEAPBADPTR -6
#define MSVCRT__FREEENTRY 0
#define MSVCRT__USEDENTRY 1
#define MSVCRT__OUT_TO_DEFAULT 0
#define MSVCRT__OUT_TO_STDERR 1
#define MSVCRT__OUT_TO_MSGBOX 2
...
...
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