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
9713d62e
Commit
9713d62e
authored
Aug 19, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: IMAGE_REL_BASED_HIGH, IMAGE_REL_BASED_LOW and IMAGE_REL_BASED_HIGHLOW…
ntdll: IMAGE_REL_BASED_HIGH, IMAGE_REL_BASED_LOW and IMAGE_REL_BASED_HIGHLOW should be supported on win64.
parent
20a42b4c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
+37
-2
loader.c
dlls/ntdll/loader.c
+1
-2
rtl.c
dlls/ntdll/tests/rtl.c
+36
-0
No files found.
dlls/ntdll/loader.c
View file @
9713d62e
...
...
@@ -2120,7 +2120,6 @@ IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock( void *page, UINT count
{
case
IMAGE_REL_BASED_ABSOLUTE
:
break
;
#ifdef __i386__
case
IMAGE_REL_BASED_HIGH
:
*
(
short
*
)((
char
*
)
page
+
offset
)
+=
HIWORD
(
delta
);
break
;
...
...
@@ -2130,7 +2129,7 @@ IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock( void *page, UINT count
case
IMAGE_REL_BASED_HIGHLOW
:
*
(
int
*
)((
char
*
)
page
+
offset
)
+=
delta
;
break
;
#
elif defined(__x86_64__)
#
ifdef __x86_64__
case
IMAGE_REL_BASED_DIR64
:
*
(
INT_PTR
*
)((
char
*
)
page
+
offset
)
+=
delta
;
break
;
...
...
dlls/ntdll/tests/rtl.c
View file @
9713d62e
...
...
@@ -72,6 +72,9 @@ static DWORD (WINAPI *pRtlGetThreadErrorMode)(void);
static
NTSTATUS
(
WINAPI
*
pRtlSetThreadErrorMode
)(
DWORD
,
LPDWORD
);
static
HMODULE
hkernel32
=
0
;
static
BOOL
(
WINAPI
*
pIsWow64Process
)(
HANDLE
,
PBOOL
);
static
IMAGE_BASE_RELOCATION
*
(
WINAPI
*
pLdrProcessRelocationBlock
)(
void
*
,
UINT
,
USHORT
*
,
INT_PTR
);
#define LEN 16
static
const
char
*
src_src
=
"This is a test!"
;
/* 16 bytes long, incl NUL */
static
ULONG
src_aligned_block
[
4
];
...
...
@@ -107,6 +110,7 @@ static void InitFunctionPtrs(void)
pNtCurrentTeb
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtCurrentTeb"
);
pRtlGetThreadErrorMode
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlGetThreadErrorMode"
);
pRtlSetThreadErrorMode
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlSetThreadErrorMode"
);
pLdrProcessRelocationBlock
=
(
void
*
)
GetProcAddress
(
hntdll
,
"LdrProcessRelocationBlock"
);
}
hkernel32
=
LoadLibraryA
(
"kernel32.dll"
);
ok
(
hkernel32
!=
0
,
"LoadLibrary failed
\n
"
);
...
...
@@ -1094,6 +1098,37 @@ static void test_RtlThreadErrorMode(void)
pRtlSetThreadErrorMode
(
oldmode
,
NULL
);
}
static
void
test_LdrProcessRelocationBlock
(
void
)
{
IMAGE_BASE_RELOCATION
*
ret
;
USHORT
reloc
;
DWORD
addr32
;
SHORT
addr16
;
if
(
!
pLdrProcessRelocationBlock
)
{
win_skip
(
"LdrProcessRelocationBlock not available
\n
"
);
return
;
}
addr32
=
0x50005
;
reloc
=
IMAGE_REL_BASED_HIGHLOW
<<
12
;
ret
=
pLdrProcessRelocationBlock
(
&
addr32
,
1
,
&
reloc
,
0x500050
);
ok
((
USHORT
*
)
ret
==
&
reloc
+
1
,
"ret = %p, expected %p
\n
"
,
ret
,
&
reloc
+
1
);
ok
(
addr32
==
0x550055
,
"addr32 = %x, expected 0x550055
\n
"
,
addr32
);
addr16
=
0x505
;
reloc
=
IMAGE_REL_BASED_HIGH
<<
12
;
ret
=
pLdrProcessRelocationBlock
(
&
addr16
,
1
,
&
reloc
,
0x500060
);
ok
((
USHORT
*
)
ret
==
&
reloc
+
1
,
"ret = %p, expected %p
\n
"
,
ret
,
&
reloc
+
1
);
ok
(
addr16
==
0x555
,
"addr16 = %x, expected 0x555
\n
"
,
addr16
);
addr16
=
0x505
;
reloc
=
IMAGE_REL_BASED_LOW
<<
12
;
ret
=
pLdrProcessRelocationBlock
(
&
addr16
,
1
,
&
reloc
,
0x500060
);
ok
((
USHORT
*
)
ret
==
&
reloc
+
1
,
"ret = %p, expected %p
\n
"
,
ret
,
&
reloc
+
1
);
ok
(
addr16
==
0x565
,
"addr16 = %x, expected 0x565
\n
"
,
addr16
);
}
START_TEST
(
rtl
)
{
InitFunctionPtrs
();
...
...
@@ -1114,4 +1149,5 @@ START_TEST(rtl)
test_RtlAllocateAndInitializeSid
();
test_RtlDeleteTimer
();
test_RtlThreadErrorMode
();
test_LdrProcessRelocationBlock
();
}
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