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
7ee9c196
Commit
7ee9c196
authored
Aug 25, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Also store syscall id and names following the syscall dispatcher pointer.
parent
5bc6ab56
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
10 deletions
+20
-10
loader.c
dlls/ntdll/unix/loader.c
+13
-6
syscall.c
dlls/win32u/syscall.c
+1
-1
unixlib.h
include/wine/unixlib.h
+1
-1
import.c
tools/winebuild/import.c
+5
-2
No files found.
dlls/ntdll/unix/loader.c
View file @
7ee9c196
...
...
@@ -1233,24 +1233,31 @@ static NTSTATUS dlopen_dll( const char *so_name, UNICODE_STRING *nt_name, void *
/***********************************************************************
* ntdll_init_syscalls
*/
NTSTATUS
ntdll_init_syscalls
(
ULONG
id
,
SYSTEM_SERVICE_TABLE
*
table
,
void
**
dispatcher
)
NTSTATUS
ntdll_init_syscalls
(
SYSTEM_SERVICE_TABLE
*
table
,
void
**
dispatcher
)
{
struct
syscall_info
{
void
*
dispatcher
;
UINT
version
;
USHORT
id
;
USHORT
limit
;
BYTE
args
[
1
];
/* USHORT names[limit]; */
/* BYTE args[limit]; */
}
*
info
=
(
struct
syscall_info
*
)
dispatcher
;
if
(
id
>
3
)
return
STATUS_INVALID_PARAMETER
;
if
(
info
->
version
!=
0xca110001
)
{
ERR
(
"invalid syscall table version %x
\n
"
,
info
->
version
);
NtTerminateProcess
(
GetCurrentProcess
(),
STATUS_INVALID_PARAMETER
);
}
if
(
info
->
limit
!=
table
->
ServiceLimit
)
{
ERR
(
"syscall count mismatch %u / %lu
\n
"
,
info
->
limit
,
table
->
ServiceLimit
);
NtTerminateProcess
(
GetCurrentProcess
(),
STATUS_INVALID_PARAMETER
);
}
info
->
dispatcher
=
__wine_syscall_dispatcher
;
memcpy
(
table
->
ArgumentTable
,
info
->
args
,
table
->
ServiceLimit
);
KeServiceDescriptorTable
[
id
]
=
*
table
;
memcpy
(
table
->
ArgumentTable
,
(
USHORT
*
)(
info
+
1
)
+
info
->
limit
,
table
->
ServiceLimit
);
KeServiceDescriptorTable
[
i
nfo
->
i
d
]
=
*
table
;
return
STATUS_SUCCESS
;
}
...
...
@@ -2093,7 +2100,7 @@ static void start_main_thread(void)
load_ntdll
();
if
(
main_image_info
.
Machine
!=
current_machine
)
load_wow64_ntdll
(
main_image_info
.
Machine
);
load_apiset_dll
();
ntdll_init_syscalls
(
0
,
&
syscall_table
,
p__wine_syscall_dispatcher
);
ntdll_init_syscalls
(
&
syscall_table
,
p__wine_syscall_dispatcher
);
server_init_process_done
();
}
...
...
dlls/win32u/syscall.c
View file @
7ee9c196
...
...
@@ -461,7 +461,7 @@ static NTSTATUS init( void *dispatcher )
}
#endif
return
ntdll_init_syscalls
(
1
,
&
syscall_table
,
dispatcher
);
return
ntdll_init_syscalls
(
&
syscall_table
,
dispatcher
);
}
unixlib_entry_t
__wine_unix_call_funcs
[]
=
...
...
include/wine/unixlib.h
View file @
7ee9c196
...
...
@@ -36,7 +36,7 @@ extern DWORD ntdll_umbstowcs( const char *src, DWORD srclen, WCHAR *dst, DWORD d
extern
int
ntdll_wcstoumbs
(
const
WCHAR
*
src
,
DWORD
srclen
,
char
*
dst
,
DWORD
dstlen
,
BOOL
strict
);
extern
int
ntdll_wcsicmp
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
);
extern
int
ntdll_wcsnicmp
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
,
int
n
);
extern
NTSTATUS
ntdll_init_syscalls
(
ULONG
id
,
SYSTEM_SERVICE_TABLE
*
table
,
void
**
dispatcher
);
extern
NTSTATUS
ntdll_init_syscalls
(
SYSTEM_SERVICE_TABLE
*
table
,
void
**
dispatcher
);
/* exception handling */
...
...
tools/winebuild/import.c
View file @
7ee9c196
...
...
@@ -1529,8 +1529,11 @@ void output_syscalls( DLLSPEC *spec )
output
(
"
\t
.data
\n
"
);
output
(
"
\t
.align %d
\n
"
,
get_alignment
(
get_ptr_size
()
)
);
output
(
"%s
\n
"
,
asm_globl
(
"__wine_syscall_dispatcher"
)
);
output
(
"
\t
%s 0
\n
"
,
get_asm_ptr_keyword
()
);
output
(
"
\t
.short %u
\n
"
,
count
);
output
(
"
\t
%s 0
\n
"
,
get_asm_ptr_keyword
()
);
/* dispatcher */
output
(
"
\t
.long 0xca110001
\n
"
);
/* version */
output
(
"
\t
.short %u
\n
"
,
spec
->
syscall_table
);
/* id */
output
(
"
\t
.short %u
\n
"
,
count
);
/* limit */
for
(
i
=
0
;
i
<
count
;
i
++
)
output
(
"
\t
.short %u
\n
"
,
syscalls
[
i
]
->
hint
);
for
(
i
=
0
;
i
<
count
;
i
++
)
output
(
"
\t
.byte %u
\n
"
,
get_args_size
(
syscalls
[
i
]
));
}
...
...
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