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
bb63a325
Commit
bb63a325
authored
Jul 13, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use the map_view() function to allocate TEBs, now that it supports an arbitrary granularity.
parent
8f47bd03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
21 deletions
+3
-21
virtual.c
dlls/ntdll/virtual.c
+3
-21
No files found.
dlls/ntdll/virtual.c
View file @
bb63a325
...
@@ -1156,11 +1156,9 @@ static inline void virtual_init(void)
...
@@ -1156,11 +1156,9 @@ static inline void virtual_init(void)
*/
*/
NTSTATUS
VIRTUAL_alloc_teb
(
void
**
ret
,
size_t
size
,
BOOL
first
)
NTSTATUS
VIRTUAL_alloc_teb
(
void
**
ret
,
size_t
size
,
BOOL
first
)
{
{
void
*
ptr
;
NTSTATUS
status
;
NTSTATUS
status
;
struct
file_view
*
view
;
struct
file_view
*
view
;
size_t
align_size
;
size_t
align_size
;
BYTE
vprot
=
VPROT_READ
|
VPROT_WRITE
|
VPROT_COMMITTED
;
if
(
first
)
virtual_init
();
if
(
first
)
virtual_init
();
...
@@ -1169,31 +1167,15 @@ NTSTATUS VIRTUAL_alloc_teb( void **ret, size_t size, BOOL first )
...
@@ -1169,31 +1167,15 @@ NTSTATUS VIRTUAL_alloc_teb( void **ret, size_t size, BOOL first )
align_size
=
page_size
;
align_size
=
page_size
;
while
(
align_size
<
size
)
align_size
*=
2
;
while
(
align_size
<
size
)
align_size
*=
2
;
for
(;;)
{
if
((
ptr
=
wine_anon_mmap
(
NULL
,
2
*
align_size
,
VIRTUAL_GetUnixProt
(
vprot
),
0
))
==
(
void
*
)
-
1
)
{
if
(
errno
==
ENOMEM
)
return
STATUS_NO_MEMORY
;
return
STATUS_INVALID_PARAMETER
;
}
if
(
!
is_beyond_limit
(
ptr
,
2
*
align_size
,
user_space_limit
))
{
ptr
=
unmap_extra_space
(
ptr
,
2
*
align_size
,
align_size
,
align_size
-
1
);
break
;
}
/* if we got something beyond the user limit, unmap it and retry */
add_reserved_area
(
ptr
,
2
*
align_size
);
}
if
(
!
first
)
RtlEnterCriticalSection
(
&
csVirtual
);
if
(
!
first
)
RtlEnterCriticalSection
(
&
csVirtual
);
status
=
create_view
(
&
view
,
ptr
,
size
,
vprot
);
status
=
map_view
(
&
view
,
NULL
,
align_size
,
align_size
-
1
,
VPROT_READ
|
VPROT_WRITE
|
VPROT_COMMITTED
);
if
(
status
==
STATUS_SUCCESS
)
if
(
status
==
STATUS_SUCCESS
)
{
{
view
->
flags
|=
VFLAG_VALLOC
;
view
->
flags
|=
VFLAG_VALLOC
;
*
ret
=
ptr
;
*
ret
=
view
->
base
;
}
}
else
unmap_area
(
ptr
,
size
);
if
(
!
first
)
RtlLeaveCriticalSection
(
&
csVirtual
);
if
(
!
first
)
RtlLeaveCriticalSection
(
&
csVirtual
);
...
...
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