ntdll: Make the loader process relocations correctly for x86_64.
This commit is contained in:
parent
83ee191f7e
commit
72423f5f6d
|
@ -2101,7 +2101,7 @@ NTSTATUS WINAPI LdrAddRefDll( ULONG flags, HMODULE module )
|
||||||
* Apply relocations to a given page of a mapped PE image.
|
* Apply relocations to a given page of a mapped PE image.
|
||||||
*/
|
*/
|
||||||
IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock( void *page, UINT count,
|
IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock( void *page, UINT count,
|
||||||
USHORT *relocs, INT delta )
|
USHORT *relocs, INT_PTR delta )
|
||||||
{
|
{
|
||||||
while (count--)
|
while (count--)
|
||||||
{
|
{
|
||||||
|
@ -2111,6 +2111,7 @@ IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock( void *page, UINT count
|
||||||
{
|
{
|
||||||
case IMAGE_REL_BASED_ABSOLUTE:
|
case IMAGE_REL_BASED_ABSOLUTE:
|
||||||
break;
|
break;
|
||||||
|
#ifdef __i386__
|
||||||
case IMAGE_REL_BASED_HIGH:
|
case IMAGE_REL_BASED_HIGH:
|
||||||
*(short *)((char *)page + offset) += HIWORD(delta);
|
*(short *)((char *)page + offset) += HIWORD(delta);
|
||||||
break;
|
break;
|
||||||
|
@ -2120,6 +2121,11 @@ IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock( void *page, UINT count
|
||||||
case IMAGE_REL_BASED_HIGHLOW:
|
case IMAGE_REL_BASED_HIGHLOW:
|
||||||
*(int *)((char *)page + offset) += delta;
|
*(int *)((char *)page + offset) += delta;
|
||||||
break;
|
break;
|
||||||
|
#elif defined(__x86_64__)
|
||||||
|
case IMAGE_REL_BASED_DIR64:
|
||||||
|
*(INT_PTR *)((char *)page + offset) += delta;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
FIXME("Unknown/unsupported fixup type %x.\n", type);
|
FIXME("Unknown/unsupported fixup type %x.\n", type);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -993,7 +993,7 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz
|
||||||
struct stat st;
|
struct stat st;
|
||||||
struct file_view *view = NULL;
|
struct file_view *view = NULL;
|
||||||
char *ptr, *header_end;
|
char *ptr, *header_end;
|
||||||
int delta = 0;
|
INT_PTR delta = 0;
|
||||||
|
|
||||||
/* zero-map the whole range */
|
/* zero-map the whole range */
|
||||||
|
|
||||||
|
|
|
@ -1978,7 +1978,7 @@ NTSYSAPI NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, UL
|
||||||
NTSYSAPI void WINAPI LdrInitializeThunk(ULONG,ULONG,ULONG,ULONG);
|
NTSYSAPI void WINAPI LdrInitializeThunk(ULONG,ULONG,ULONG,ULONG);
|
||||||
NTSYSAPI NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
|
NTSYSAPI NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
|
||||||
NTSYSAPI NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG*);
|
NTSYSAPI NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG*);
|
||||||
IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock(void*,UINT,USHORT*,INT);
|
IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock(void*,UINT,USHORT*,INT_PTR);
|
||||||
NTSYSAPI NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
|
NTSYSAPI NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
|
||||||
NTSYSAPI void WINAPI LdrShutdownProcess(void);
|
NTSYSAPI void WINAPI LdrShutdownProcess(void);
|
||||||
NTSYSAPI void WINAPI LdrShutdownThread(void);
|
NTSYSAPI void WINAPI LdrShutdownThread(void);
|
||||||
|
|
Loading…
Reference in New Issue