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
71e69dd8
Commit
71e69dd8
authored
Dec 25, 1999
by
Juergen Schmied
Committed by
Alexandre Julliard
Dec 25, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NT allocates one page as TEB. Some native NT-dlls are using this.
parent
2da48e3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
thread.c
scheduler/thread.c
+10
-3
No files found.
scheduler/thread.c
View file @
71e69dd8
...
...
@@ -163,7 +163,7 @@ void CALLBACK THREAD_FreeTEB( ULONG_PTR arg )
close
(
teb
->
socket
);
if
(
teb
->
buffer
)
munmap
(
teb
->
buffer
,
teb
->
buffer_size
);
VirtualFree
(
teb
->
stack_base
,
0
,
MEM_RELEASE
);
HeapFree
(
SystemHeap
,
0
,
teb
);
VirtualFree
(
teb
,
0
,
MEM_FREE
);
}
...
...
@@ -202,6 +202,12 @@ TEB *THREAD_CreateInitialThread( PDB *pdb, int server_fd )
/***********************************************************************
* THREAD_Create
*
* NOTES:
* Native NT dlls are using the space left on the allocated page
* the first allocated TEB on NT is at 0x7ffde000, since we can't
* allocate in this area and don't support a granularity of 4kb
* yet we leave it to VirtualAlloc to choose an address.
*/
TEB
*
THREAD_Create
(
PDB
*
pdb
,
DWORD
flags
,
DWORD
stack_size
,
BOOL
alloc_stack16
,
LPSECURITY_ATTRIBUTES
sa
,
int
*
server_handle
)
...
...
@@ -210,7 +216,7 @@ TEB *THREAD_Create( PDB *pdb, DWORD flags, DWORD stack_size, BOOL alloc_stack16,
int
fd
[
2
];
HANDLE
cleanup_object
;
TEB
*
teb
=
HeapAlloc
(
SystemHeap
,
HEAP_ZERO_MEMORY
,
sizeof
(
TEB
)
);
TEB
*
teb
=
VirtualAlloc
(
0
,
0x1000
,
MEM_COMMIT
,
PAGE_EXECUTE_READWRITE
);
if
(
!
teb
)
return
NULL
;
teb
->
except
=
(
void
*
)
-
1
;
teb
->
htask16
=
pdb
->
task
;
...
...
@@ -258,13 +264,14 @@ TEB *THREAD_Create( PDB *pdb, DWORD flags, DWORD stack_size, BOOL alloc_stack16,
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
)
)
goto
error
;
teb
->
cleanup
=
SERVICE_AddObject
(
cleanup_object
,
THREAD_FreeTEB
,
(
ULONG_PTR
)
teb
);
TRACE
(
"(%p) succeeded
\n
"
,
teb
);
return
teb
;
error:
if
(
*
server_handle
!=
-
1
)
CloseHandle
(
*
server_handle
);
if
(
teb
->
teb_sel
)
SELECTOR_FreeBlock
(
teb
->
teb_sel
,
1
);
if
(
teb
->
socket
!=
-
1
)
close
(
teb
->
socket
);
HeapFree
(
SystemHeap
,
0
,
teb
);
VirtualFree
(
teb
,
0
,
MEM_FREE
);
return
NULL
;
}
...
...
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