1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 03:45:57 +00:00

ntdll: Add a Wine-specific process info class for the LDT copy.

This commit is contained in:
Alexandre Julliard 2022-11-11 11:56:45 +01:00
parent 45053135ae
commit a72c7bbc0c
7 changed files with 19 additions and 13 deletions

View File

@ -68,12 +68,10 @@ static LDT_ENTRY ldt_make_entry( const void *base, unsigned int limit, unsigned
*/
void init_selectors(void)
{
const struct ldt_copy **ldt_copy_ptr;
if (!is_gdt_sel( get_gs() )) first_ldt_entry += 512;
if (!is_gdt_sel( get_fs() )) first_ldt_entry += 512;
RtlSetBits( &ldt_bitmap, 0, first_ldt_entry );
ldt_copy_ptr = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "__wine_ldt_copy" );
if (ldt_copy_ptr) ldt_copy = *ldt_copy_ptr;
NtQueryInformationProcess( GetCurrentProcess(), ProcessWineLdtCopy, &ldt_copy, sizeof(ldt_copy), NULL );
}
/***********************************************************************

View File

@ -1694,7 +1694,6 @@
@ stdcall -syscall __wine_unix_spawnvp(long ptr)
@ stdcall __wine_ctrl_routine(ptr)
@ extern __wine_syscall_dispatcher
@ extern -arch=i386 __wine_ldt_copy
@ extern -arch=arm64 __wine_current_teb
# Debugging

View File

@ -59,8 +59,6 @@ static inline struct x86_thread_data *x86_thread_data(void)
return (struct x86_thread_data *)&NtCurrentTeb()->GdiTebBatch;
}
struct ldt_copy *__wine_ldt_copy = NULL;
/* Exception record for handling exceptions happening inside exception handlers */
typedef struct
{

View File

@ -1062,13 +1062,6 @@ static void load_ntdll_functions( HMODULE module )
GET_FUNC( RtlUserThreadStart );
GET_FUNC( __wine_ctrl_routine );
GET_FUNC( __wine_syscall_dispatcher );
#ifdef __i386__
{
void **p__wine_ldt_copy;
GET_FUNC( __wine_ldt_copy );
*p__wine_ldt_copy = &__wine_ldt_copy;
}
#endif
#ifdef __aarch64__
{
void **p__wine_current_teb;

View File

@ -1500,6 +1500,20 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
else ret = STATUS_INFO_LENGTH_MISMATCH;
break;
case ProcessWineLdtCopy:
if (handle == NtCurrentProcess())
{
#ifdef __i386__
len = sizeof(struct ldt_copy *);
if (size == len) *(struct ldt_copy **)info = &__wine_ldt_copy;
else ret = STATUS_INFO_LENGTH_MISMATCH;
#else
ret = STATUS_NOT_IMPLEMENTED;
#endif
}
else ret = STATUS_INVALID_PARAMETER;
break;
default:
FIXME("(%p,info_class=%d,%p,0x%08x,%p) Unknown information class\n",
handle, class, info, size, ret_len );

View File

@ -846,6 +846,9 @@ NTSTATUS WINAPI wow64_NtQueryInformationProcess( UINT *args )
if (retlen) *retlen = sizeof(SECTION_IMAGE_INFORMATION32);
return STATUS_INFO_LENGTH_MISMATCH;
case ProcessWineLdtCopy:
return STATUS_NOT_IMPLEMENTED;
default:
FIXME( "unsupported class %u\n", class );
return STATUS_INVALID_INFO_CLASS;

View File

@ -1577,6 +1577,7 @@ typedef enum _PROCESSINFOCLASS {
MaxProcessInfoClass,
#ifdef __WINESRC__
ProcessWineMakeProcessSystem = 1000,
ProcessWineLdtCopy,
#endif
} PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS;