Commit a72c7bbc authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 45053135
......@@ -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 );
}
/***********************************************************************
......
......@@ -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
......
......@@ -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
{
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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;
......
......@@ -1577,6 +1577,7 @@ typedef enum _PROCESSINFOCLASS {
MaxProcessInfoClass,
#ifdef __WINESRC__
ProcessWineMakeProcessSystem = 1000,
ProcessWineLdtCopy,
#endif
} PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment