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
9d588819
Commit
9d588819
authored
Apr 01, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Export the LDT copy from ntdll instead of libwine.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b5448369
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
9 deletions
+20
-9
selector.c
dlls/krnl386.exe16/selector.c
+1
-1
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
server.c
dlls/ntdll/server.c
+4
-1
signal_i386.c
dlls/ntdll/signal_i386.c
+14
-7
No files found.
dlls/krnl386.exe16/selector.c
View file @
9d588819
...
...
@@ -75,7 +75,7 @@ void init_selectors(void)
if
(
!
is_gdt_sel
(
wine_get_gs
()
))
first_ldt_entry
+=
512
;
if
(
!
is_gdt_sel
(
wine_get_fs
()
))
first_ldt_entry
+=
512
;
RtlSetBits
(
&
ldt_bitmap
,
0
,
first_ldt_entry
);
ldt_copy
=
(
struct
ldt_copy
*
)
&
wine_ldt_copy
;
ldt_copy
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"ntdll.dll"
),
"__wine_ldt_copy"
)
;
}
/***********************************************************************
...
...
dlls/ntdll/ntdll.spec
View file @
9d588819
...
...
@@ -1558,6 +1558,7 @@
@ cdecl wine_server_release_fd(long long)
@ cdecl wine_server_send_fd(long)
@ cdecl __wine_make_process_system()
@ extern -arch=i386 __wine_ldt_copy
# Debugging
@ cdecl -norelay __wine_dbg_get_channel_flags(ptr)
...
...
dlls/ntdll/server.c
View file @
9d588819
...
...
@@ -1448,6 +1448,9 @@ void server_init_process(void)
*/
void
server_init_process_done
(
void
)
{
#ifdef __i386__
extern
struct
ldt_copy
__wine_ldt_copy
;
#endif
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
IMAGE_NT_HEADERS
*
nt
=
RtlImageNtHeader
(
peb
->
ImageBaseAddress
);
void
*
entry
=
(
char
*
)
peb
->
ImageBaseAddress
+
nt
->
OptionalHeader
.
AddressOfEntryPoint
;
...
...
@@ -1471,7 +1474,7 @@ void server_init_process_done(void)
{
req
->
module
=
wine_server_client_ptr
(
peb
->
ImageBaseAddress
);
#ifdef __i386__
req
->
ldt_copy
=
wine_server_client_ptr
(
&
wine_ldt_copy
);
req
->
ldt_copy
=
wine_server_client_ptr
(
&
__
wine_ldt_copy
);
#endif
req
->
entry
=
wine_server_client_ptr
(
entry
);
req
->
gui
=
(
nt
->
OptionalHeader
.
Subsystem
!=
IMAGE_SUBSYSTEM_WINDOWS_CUI
);
...
...
dlls/ntdll/signal_i386.c
View file @
9d588819
...
...
@@ -2306,6 +2306,13 @@ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh)
#define LDT_FLAGS_32BIT 0x40
/* Segment is 32-bit (code or stack) */
#define LDT_FLAGS_ALLOCATED 0x80
/* Segment is allocated */
struct
ldt_copy
{
void
*
base
[
LDT_SIZE
];
unsigned
int
limit
[
LDT_SIZE
];
unsigned
char
flags
[
LDT_SIZE
];
}
__wine_ldt_copy
;
static
WORD
gdt_fs_sel
;
static
RTL_CRITICAL_SECTION
ldt_section
;
...
...
@@ -2417,11 +2424,11 @@ static void ldt_set_entry( WORD sel, LDT_ENTRY entry )
exit
(
1
);
#endif
wine_ldt_copy
.
base
[
index
]
=
ldt_get_base
(
entry
);
wine_ldt_copy
.
limit
[
index
]
=
ldt_get_limit
(
entry
);
wine_ldt_copy
.
flags
[
index
]
=
(
entry
.
HighWord
.
Bits
.
Type
|
(
entry
.
HighWord
.
Bits
.
Default_Big
?
LDT_FLAGS_32BIT
:
0
)
|
LDT_FLAGS_ALLOCATED
);
__
wine_ldt_copy
.
base
[
index
]
=
ldt_get_base
(
entry
);
__
wine_ldt_copy
.
limit
[
index
]
=
ldt_get_limit
(
entry
);
__
wine_ldt_copy
.
flags
[
index
]
=
(
entry
.
HighWord
.
Bits
.
Type
|
(
entry
.
HighWord
.
Bits
.
Default_Big
?
LDT_FLAGS_32BIT
:
0
)
|
LDT_FLAGS_ALLOCATED
);
}
static
void
ldt_init
(
void
)
...
...
@@ -2464,7 +2471,7 @@ WORD ldt_alloc_fs( TEB *teb, int first_thread )
ldt_lock
();
for
(
idx
=
first_ldt_entry
;
idx
<
LDT_SIZE
;
idx
++
)
{
if
(
wine_ldt_copy
.
flags
[
idx
])
continue
;
if
(
__
wine_ldt_copy
.
flags
[
idx
])
continue
;
ldt_set_entry
(
(
idx
<<
3
)
|
7
,
entry
);
break
;
}
...
...
@@ -2479,7 +2486,7 @@ static void ldt_free_fs( WORD sel )
if
(
sel
==
gdt_fs_sel
)
return
;
ldt_lock
();
wine_ldt_copy
.
flags
[
sel
>>
3
]
=
0
;
__
wine_ldt_copy
.
flags
[
sel
>>
3
]
=
0
;
ldt_unlock
();
}
...
...
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