mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 13:03:41 +00:00
ntdll: Add a Wine-specific process info class for the LDT copy.
This commit is contained in:
parent
45053135ae
commit
a72c7bbc0c
|
@ -68,12 +68,10 @@ static LDT_ENTRY ldt_make_entry( const void *base, unsigned int limit, unsigned
|
||||||
*/
|
*/
|
||||||
void init_selectors(void)
|
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_gs() )) first_ldt_entry += 512;
|
||||||
if (!is_gdt_sel( get_fs() )) first_ldt_entry += 512;
|
if (!is_gdt_sel( get_fs() )) first_ldt_entry += 512;
|
||||||
RtlSetBits( &ldt_bitmap, 0, first_ldt_entry );
|
RtlSetBits( &ldt_bitmap, 0, first_ldt_entry );
|
||||||
ldt_copy_ptr = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "__wine_ldt_copy" );
|
NtQueryInformationProcess( GetCurrentProcess(), ProcessWineLdtCopy, &ldt_copy, sizeof(ldt_copy), NULL );
|
||||||
if (ldt_copy_ptr) ldt_copy = *ldt_copy_ptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -1694,7 +1694,6 @@
|
||||||
@ stdcall -syscall __wine_unix_spawnvp(long ptr)
|
@ stdcall -syscall __wine_unix_spawnvp(long ptr)
|
||||||
@ stdcall __wine_ctrl_routine(ptr)
|
@ stdcall __wine_ctrl_routine(ptr)
|
||||||
@ extern __wine_syscall_dispatcher
|
@ extern __wine_syscall_dispatcher
|
||||||
@ extern -arch=i386 __wine_ldt_copy
|
|
||||||
@ extern -arch=arm64 __wine_current_teb
|
@ extern -arch=arm64 __wine_current_teb
|
||||||
|
|
||||||
# Debugging
|
# Debugging
|
||||||
|
|
|
@ -59,8 +59,6 @@ static inline struct x86_thread_data *x86_thread_data(void)
|
||||||
return (struct x86_thread_data *)&NtCurrentTeb()->GdiTebBatch;
|
return (struct x86_thread_data *)&NtCurrentTeb()->GdiTebBatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ldt_copy *__wine_ldt_copy = NULL;
|
|
||||||
|
|
||||||
/* Exception record for handling exceptions happening inside exception handlers */
|
/* Exception record for handling exceptions happening inside exception handlers */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -1062,13 +1062,6 @@ static void load_ntdll_functions( HMODULE module )
|
||||||
GET_FUNC( RtlUserThreadStart );
|
GET_FUNC( RtlUserThreadStart );
|
||||||
GET_FUNC( __wine_ctrl_routine );
|
GET_FUNC( __wine_ctrl_routine );
|
||||||
GET_FUNC( __wine_syscall_dispatcher );
|
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__
|
#ifdef __aarch64__
|
||||||
{
|
{
|
||||||
void **p__wine_current_teb;
|
void **p__wine_current_teb;
|
||||||
|
|
|
@ -1500,6 +1500,20 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
|
||||||
else ret = STATUS_INFO_LENGTH_MISMATCH;
|
else ret = STATUS_INFO_LENGTH_MISMATCH;
|
||||||
break;
|
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:
|
default:
|
||||||
FIXME("(%p,info_class=%d,%p,0x%08x,%p) Unknown information class\n",
|
FIXME("(%p,info_class=%d,%p,0x%08x,%p) Unknown information class\n",
|
||||||
handle, class, info, size, ret_len );
|
handle, class, info, size, ret_len );
|
||||||
|
|
|
@ -846,6 +846,9 @@ NTSTATUS WINAPI wow64_NtQueryInformationProcess( UINT *args )
|
||||||
if (retlen) *retlen = sizeof(SECTION_IMAGE_INFORMATION32);
|
if (retlen) *retlen = sizeof(SECTION_IMAGE_INFORMATION32);
|
||||||
return STATUS_INFO_LENGTH_MISMATCH;
|
return STATUS_INFO_LENGTH_MISMATCH;
|
||||||
|
|
||||||
|
case ProcessWineLdtCopy:
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
FIXME( "unsupported class %u\n", class );
|
FIXME( "unsupported class %u\n", class );
|
||||||
return STATUS_INVALID_INFO_CLASS;
|
return STATUS_INVALID_INFO_CLASS;
|
||||||
|
|
|
@ -1577,6 +1577,7 @@ typedef enum _PROCESSINFOCLASS {
|
||||||
MaxProcessInfoClass,
|
MaxProcessInfoClass,
|
||||||
#ifdef __WINESRC__
|
#ifdef __WINESRC__
|
||||||
ProcessWineMakeProcessSystem = 1000,
|
ProcessWineMakeProcessSystem = 1000,
|
||||||
|
ProcessWineLdtCopy,
|
||||||
#endif
|
#endif
|
||||||
} PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS;
|
} PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue