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
2a6acd3d
Commit
2a6acd3d
authored
Sep 24, 2000
by
Gerard Patel
Committed by
Alexandre Julliard
Sep 24, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Locks the virtual views linked list.
parent
ff7a61f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
6 deletions
+25
-6
virtual.c
memory/virtual.c
+25
-6
No files found.
memory/virtual.c
View file @
2a6acd3d
...
...
@@ -78,6 +78,7 @@ static const BYTE VIRTUAL_Win32Flags[16] =
static
FILE_VIEW
*
VIRTUAL_FirstView
;
static
CRITICAL_SECTION
csVirtual
=
CRITICAL_SECTION_INIT
;
#ifdef __i386__
/* These are always the same on an i386, and it will be faster this way */
...
...
@@ -163,13 +164,16 @@ static void VIRTUAL_DumpView( FILE_VIEW *view )
*/
void
VIRTUAL_Dump
(
void
)
{
FILE_VIEW
*
view
=
VIRTUAL_FirstView
;
FILE_VIEW
*
view
;
DPRINTF
(
"
\n
Dump of all virtual memory views:
\n\n
"
);
EnterCriticalSection
(
&
csVirtual
);
view
=
VIRTUAL_FirstView
;
while
(
view
)
{
VIRTUAL_DumpView
(
view
);
view
=
view
->
next
;
}
LeaveCriticalSection
(
&
csVirtual
);
}
...
...
@@ -185,14 +189,22 @@ void VIRTUAL_Dump(void)
static
FILE_VIEW
*
VIRTUAL_FindView
(
UINT
addr
/* [in] Address */
)
{
FILE_VIEW
*
view
=
VIRTUAL_FirstView
;
FILE_VIEW
*
view
;
EnterCriticalSection
(
&
csVirtual
);
view
=
VIRTUAL_FirstView
;
while
(
view
)
{
if
(
view
->
base
>
addr
)
return
NULL
;
if
(
view
->
base
+
view
->
size
>
addr
)
return
view
;
if
(
view
->
base
>
addr
)
{
view
=
NULL
;
break
;
}
if
(
view
->
base
+
view
->
size
>
addr
)
break
;
view
=
view
->
next
;
}
return
NULL
;
LeaveCriticalSection
(
&
csVirtual
);
return
view
;
}
...
...
@@ -233,6 +245,7 @@ static FILE_VIEW *VIRTUAL_CreateView( UINT base, UINT size, UINT flags,
/* Insert it in the linked list */
EnterCriticalSection
(
&
csVirtual
);
if
(
!
VIRTUAL_FirstView
||
(
VIRTUAL_FirstView
->
base
>
base
))
{
view
->
next
=
VIRTUAL_FirstView
;
...
...
@@ -249,6 +262,7 @@ static FILE_VIEW *VIRTUAL_CreateView( UINT base, UINT size, UINT flags,
if
(
view
->
next
)
view
->
next
->
prev
=
view
;
prev
->
next
=
view
;
}
LeaveCriticalSection
(
&
csVirtual
);
VIRTUAL_DEBUG_DUMP_VIEW
(
view
);
return
view
;
}
...
...
@@ -266,9 +280,11 @@ static void VIRTUAL_DeleteView(
)
{
if
(
!
(
view
->
flags
&
VFLAG_SYSTEM
))
munmap
(
(
void
*
)
view
->
base
,
view
->
size
);
EnterCriticalSection
(
&
csVirtual
);
if
(
view
->
next
)
view
->
next
->
prev
=
view
->
prev
;
if
(
view
->
prev
)
view
->
prev
->
next
=
view
->
next
;
else
VIRTUAL_FirstView
=
view
->
next
;
LeaveCriticalSection
(
&
csVirtual
);
if
(
view
->
mapping
)
CloseHandle
(
view
->
mapping
);
free
(
view
);
}
...
...
@@ -1055,13 +1071,15 @@ DWORD WINAPI VirtualQuery(
LPMEMORY_BASIC_INFORMATION
info
,
/* [out] Address of info buffer */
DWORD
len
/* [in] Size of buffer */
)
{
FILE_VIEW
*
view
=
VIRTUAL_FirstView
;
FILE_VIEW
*
view
;
UINT
base
=
ROUND_ADDR
(
addr
);
UINT
alloc_base
=
0
;
UINT
size
=
0
;
/* Find the view containing the address */
EnterCriticalSection
(
&
csVirtual
);
view
=
VIRTUAL_FirstView
;
for
(;;)
{
if
(
!
view
)
...
...
@@ -1084,6 +1102,7 @@ DWORD WINAPI VirtualQuery(
alloc_base
=
view
->
base
+
view
->
size
;
view
=
view
->
next
;
}
LeaveCriticalSection
(
&
csVirtual
);
/* Fill the info structure */
...
...
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