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
efc32d13
Commit
efc32d13
authored
Jan 12, 2001
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added flag to differentiate file mappings and VirtualAlloc() blocks,
and reject VirtualFree() calls on file mappings.
parent
a5ed3b19
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
virtual.c
memory/virtual.c
+13
-7
No files found.
memory/virtual.c
View file @
efc32d13
...
...
@@ -56,6 +56,7 @@ typedef struct _FV
/* Per-view flags */
#define VFLAG_SYSTEM 0x01
#define VFLAG_VALLOC 0x02
/* allocated by VirtualAlloc */
/* Conversion from VPROT_* to Win32 flags */
static
const
BYTE
VIRTUAL_Win32Flags
[
16
]
=
...
...
@@ -139,10 +140,13 @@ static void VIRTUAL_DumpView( FILE_VIEW *view )
UINT
addr
=
view
->
base
;
BYTE
prot
=
view
->
prot
[
0
];
DPRINTF
(
"View: %08x - %08x%s"
,
view
->
base
,
view
->
base
+
view
->
size
-
1
,
(
view
->
flags
&
VFLAG_SYSTEM
)
?
" (system)"
:
""
);
if
(
view
->
mapping
)
DPRINTF
(
"View: %08x - %08x"
,
view
->
base
,
view
->
base
+
view
->
size
-
1
);
if
(
view
->
flags
&
VFLAG_SYSTEM
)
DPRINTF
(
" (system)
\n
"
);
else
if
(
view
->
flags
&
VFLAG_VALLOC
)
DPRINTF
(
" (valloc)
\n
"
);
else
if
(
view
->
mapping
)
DPRINTF
(
" %d
\n
"
,
view
->
mapping
);
else
DPRINTF
(
" (anonymous)
\n
"
);
...
...
@@ -791,8 +795,9 @@ LPVOID WINAPI VirtualAlloc(
SetLastError
(
ERROR_INVALID_ADDRESS
);
return
NULL
;
}
if
(
!
(
view
=
VIRTUAL_CreateView
(
ptr
,
size
,
(
type
&
MEM_SYSTEM
)
?
VFLAG_SYSTEM
:
0
,
vprot
,
0
)))
if
(
!
(
view
=
VIRTUAL_CreateView
(
ptr
,
size
,
VFLAG_VALLOC
|
((
type
&
MEM_SYSTEM
)
?
VFLAG_SYSTEM
:
0
),
vprot
,
0
)))
{
munmap
(
(
void
*
)
ptr
,
size
);
SetLastError
(
ERROR_OUTOFMEMORY
);
...
...
@@ -859,7 +864,8 @@ BOOL WINAPI VirtualFree(
base
=
ROUND_ADDR
(
addr
);
if
(
!
(
view
=
VIRTUAL_FindView
(
base
))
||
(
base
+
size
>
view
->
base
+
view
->
size
))
(
base
+
size
>
view
->
base
+
view
->
size
)
||
!
(
view
->
flags
&
VFLAG_VALLOC
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
...
...
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