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
e8984787
Commit
e8984787
authored
Jul 22, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wow64: Add thunks for a few simple syscalls.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1b63875c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
153 additions
and
2 deletions
+153
-2
syscall.c
dlls/wow64/syscall.c
+108
-2
syscall.h
dlls/wow64/syscall.h
+35
-0
wow64_private.h
dlls/wow64/wow64_private.h
+10
-0
No files found.
dlls/wow64/syscall.c
View file @
e8984787
...
...
@@ -39,12 +39,16 @@ typedef NTSTATUS (WINAPI *syscall_thunk)( UINT *args );
static
const
syscall_thunk
syscall_thunks
[]
=
{
NULL
#define SYSCALL_ENTRY(func) wow64_ ## func,
ALL_SYSCALLS
#undef SYSCALL_ENTRY
};
static
const
char
*
syscall_names
[]
=
{
""
#define SYSCALL_ENTRY(func) #func,
ALL_SYSCALLS
#undef SYSCALL_ENTRY
};
static
unsigned
short
syscall_map
[
1024
];
...
...
@@ -75,6 +79,108 @@ void __cdecl __wine_spec_unimplemented_stub( const char *module, const char *fun
/**********************************************************************
* wow64_NtAllocateLocallyUniqueId
*/
NTSTATUS
WINAPI
wow64_NtAllocateLocallyUniqueId
(
UINT
*
args
)
{
LUID
*
luid
=
get_ptr
(
&
args
);
return
NtAllocateLocallyUniqueId
(
luid
);
}
/**********************************************************************
* wow64_NtAllocateUuids
*/
NTSTATUS
WINAPI
wow64_NtAllocateUuids
(
UINT
*
args
)
{
ULARGE_INTEGER
*
time
=
get_ptr
(
&
args
);
ULONG
*
delta
=
get_ptr
(
&
args
);
ULONG
*
sequence
=
get_ptr
(
&
args
);
UCHAR
*
seed
=
get_ptr
(
&
args
);
return
NtAllocateUuids
(
time
,
delta
,
sequence
,
seed
);
}
/**********************************************************************
* wow64_NtClose
*/
NTSTATUS
WINAPI
wow64_NtClose
(
UINT
*
args
)
{
HANDLE
handle
=
get_handle
(
&
args
);
return
NtClose
(
handle
);
}
/**********************************************************************
* wow64_NtGetCurrentProcessorNumber
*/
NTSTATUS
WINAPI
wow64_NtGetCurrentProcessorNumber
(
UINT
*
args
)
{
return
NtGetCurrentProcessorNumber
();
}
/**********************************************************************
* wow64_NtQueryDefaultLocale
*/
NTSTATUS
WINAPI
wow64_NtQueryDefaultLocale
(
UINT
*
args
)
{
BOOLEAN
user
=
get_ulong
(
&
args
);
LCID
*
lcid
=
get_ptr
(
&
args
);
return
NtQueryDefaultLocale
(
user
,
lcid
);
}
/**********************************************************************
* wow64_NtQueryDefaultUILanguage
*/
NTSTATUS
WINAPI
wow64_NtQueryDefaultUILanguage
(
UINT
*
args
)
{
LANGID
*
lang
=
get_ptr
(
&
args
);
return
NtQueryDefaultUILanguage
(
lang
);
}
/**********************************************************************
* wow64_NtQueryInstallUILanguage
*/
NTSTATUS
WINAPI
wow64_NtQueryInstallUILanguage
(
UINT
*
args
)
{
LANGID
*
lang
=
get_ptr
(
&
args
);
return
NtQueryInstallUILanguage
(
lang
);
}
/**********************************************************************
* wow64_NtSetDefaultLocale
*/
NTSTATUS
WINAPI
wow64_NtSetDefaultLocale
(
UINT
*
args
)
{
BOOLEAN
user
=
get_ulong
(
&
args
);
LCID
lcid
=
get_ulong
(
&
args
);
return
NtSetDefaultLocale
(
user
,
lcid
);
}
/**********************************************************************
* wow64_NtSetDefaultUILanguage
*/
NTSTATUS
WINAPI
wow64_NtSetDefaultUILanguage
(
UINT
*
args
)
{
LANGID
lang
=
get_ulong
(
&
args
);
return
NtSetDefaultUILanguage
(
lang
);
}
/**********************************************************************
* get_syscall_num
*/
static
DWORD
get_syscall_num
(
const
BYTE
*
syscall
)
...
...
dlls/wow64/syscall.h
0 → 100644
View file @
e8984787
/*
* WoW64 syscall definitions
*
* Copyright 2021 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WOW64_SYSCALL_H
#define __WOW64_SYSCALL_H
#define ALL_SYSCALLS \
SYSCALL_ENTRY( NtAllocateLocallyUniqueId ) \
SYSCALL_ENTRY( NtAllocateUuids ) \
SYSCALL_ENTRY( NtClose ) \
SYSCALL_ENTRY( NtGetCurrentProcessorNumber ) \
SYSCALL_ENTRY( NtQueryDefaultLocale ) \
SYSCALL_ENTRY( NtQueryDefaultUILanguage ) \
SYSCALL_ENTRY( NtQueryInstallUILanguage ) \
SYSCALL_ENTRY( NtSetDefaultLocale ) \
SYSCALL_ENTRY( NtSetDefaultUILanguage )
#endif
/* __WOW64_SYSCALL_H */
dlls/wow64/wow64_private.h
View file @
e8984787
...
...
@@ -21,6 +21,12 @@
#ifndef __WOW64_PRIVATE_H
#define __WOW64_PRIVATE_H
#include "syscall.h"
#define SYSCALL_ENTRY(func) extern NTSTATUS WINAPI wow64_ ## func( UINT *args ) DECLSPEC_HIDDEN;
ALL_SYSCALLS
#undef SYSCALL_ENTRY
extern
USHORT
native_machine
DECLSPEC_HIDDEN
;
extern
USHORT
current_machine
DECLSPEC_HIDDEN
;
...
...
@@ -43,4 +49,8 @@ static inline const WCHAR *get_machine_wow64_dir( USHORT machine )
}
}
static
inline
ULONG
get_ulong
(
UINT
**
args
)
{
return
*
(
*
args
)
++
;
}
static
inline
HANDLE
get_handle
(
UINT
**
args
)
{
return
LongToHandle
(
*
(
*
args
)
++
);
}
static
inline
void
*
get_ptr
(
UINT
**
args
)
{
return
ULongToPtr
(
*
(
*
args
)
++
);
}
#endif
/* __WOW64_PRIVATE_H */
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