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
bda3e662
Commit
bda3e662
authored
Apr 29, 2000
by
Ove Kaaven
Committed by
Alexandre Julliard
Apr 29, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Wine-internal allocation type MEM_SYSTEM for VirtualAlloc to
register external mappings (like video frame buffers).
parent
f61d7e0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
winbase.h
include/winbase.h
+3
-0
virtual.c
memory/virtual.c
+12
-7
No files found.
include/winbase.h
View file @
bda3e662
...
...
@@ -909,6 +909,9 @@ typedef DWORD (WINAPI *LPPROGRESS_ROUTINE)(LARGE_INTEGER, LARGE_INTEGER, LARGE_I
#define MEM_PRIVATE 0x00020000
#define MEM_MAPPED 0x00040000
#define MEM_TOP_DOWN 0x00100000
#ifdef __WINE__
#define MEM_SYSTEM 0x80000000
#endif
#define SEC_FILE 0x00800000
#define SEC_IMAGE 0x01000000
...
...
memory/virtual.c
View file @
bda3e662
...
...
@@ -256,7 +256,8 @@ static FILE_VIEW *VIRTUAL_CreateView( UINT base, UINT size, UINT offset,
static
void
VIRTUAL_DeleteView
(
FILE_VIEW
*
view
/* [in] View */
)
{
FILE_munmap
(
(
void
*
)
view
->
base
,
0
,
view
->
size
);
if
(
!
(
view
->
flags
&
VFLAG_SYSTEM
))
FILE_munmap
(
(
void
*
)
view
->
base
,
0
,
view
->
size
);
if
(
view
->
next
)
view
->
next
->
prev
=
view
->
prev
;
if
(
view
->
prev
)
view
->
prev
->
next
=
view
->
next
;
else
VIRTUAL_FirstView
=
view
->
next
;
...
...
@@ -598,13 +599,13 @@ LPVOID WINAPI VirtualAlloc(
}
/* Compute the protection flags */
if
(
!
(
type
&
(
MEM_COMMIT
|
MEM_RESERVE
))
||
(
type
&
~
(
MEM_COMMIT
|
MEM_RESERVE
)))
if
(
!
(
type
&
(
MEM_COMMIT
|
MEM_RESERVE
|
MEM_SYSTEM
))
||
(
type
&
~
(
MEM_COMMIT
|
MEM_RESERVE
|
MEM_SYSTEM
)))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
NULL
;
}
if
(
type
&
MEM_COMMIT
)
if
(
type
&
(
MEM_COMMIT
|
MEM_SYSTEM
)
)
vprot
=
VIRTUAL_GetProt
(
protect
)
|
VPROT_COMMITTED
;
else
vprot
=
0
;
...
...
@@ -613,8 +614,11 @@ LPVOID WINAPI VirtualAlloc(
if
((
type
&
MEM_RESERVE
)
||
!
base
)
{
view_size
=
size
+
(
base
?
0
:
granularity_mask
+
1
);
ptr
=
(
UINT
)
FILE_dommap
(
-
1
,
(
LPVOID
)
base
,
0
,
view_size
,
0
,
0
,
VIRTUAL_GetUnixProt
(
vprot
),
MAP_PRIVATE
);
if
(
type
&
MEM_SYSTEM
)
ptr
=
base
;
else
ptr
=
(
UINT
)
FILE_dommap
(
-
1
,
(
LPVOID
)
base
,
0
,
view_size
,
0
,
0
,
VIRTUAL_GetUnixProt
(
vprot
),
MAP_PRIVATE
);
if
(
ptr
==
(
UINT
)
-
1
)
{
SetLastError
(
ERROR_OUTOFMEMORY
);
...
...
@@ -642,7 +646,8 @@ LPVOID WINAPI VirtualAlloc(
SetLastError
(
ERROR_INVALID_ADDRESS
);
return
NULL
;
}
if
(
!
(
view
=
VIRTUAL_CreateView
(
ptr
,
size
,
0
,
0
,
vprot
,
-
1
)))
if
(
!
(
view
=
VIRTUAL_CreateView
(
ptr
,
size
,
0
,
(
type
&
MEM_SYSTEM
)
?
VFLAG_SYSTEM
:
0
,
vprot
,
-
1
)))
{
FILE_munmap
(
(
void
*
)
ptr
,
0
,
size
);
SetLastError
(
ERROR_OUTOFMEMORY
);
...
...
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