Commit 87bfb306 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcr80: Add __AdjustPointer implementation.

parent 6c4b075d
...@@ -538,7 +538,7 @@ ...@@ -538,7 +538,7 @@
@ stub -arch=win64 _SetThrowImageBase @ stub -arch=win64 _SetThrowImageBase
@ cdecl _Strftime(str long str ptr ptr) @ cdecl _Strftime(str long str ptr ptr)
@ cdecl _XcptFilter(long ptr) @ cdecl _XcptFilter(long ptr)
@ stub __AdjustPointer @ cdecl __AdjustPointer(ptr ptr)
@ stub __BuildCatchObject @ stub __BuildCatchObject
@ stub __BuildCatchObjectHelper @ stub __BuildCatchObjectHelper
@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler
......
...@@ -869,7 +869,7 @@ ...@@ -869,7 +869,7 @@
@ stub _W_Gettnames @ stub _W_Gettnames
@ stub _Wcsftime @ stub _Wcsftime
@ cdecl _XcptFilter(long ptr) @ cdecl _XcptFilter(long ptr)
@ stub __AdjustPointer @ cdecl __AdjustPointer(ptr ptr)
@ stub __BuildCatchObject @ stub __BuildCatchObject
@ stub __BuildCatchObjectHelper @ stub __BuildCatchObjectHelper
@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler
......
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
@ stub -arch=win64 _SetThrowImageBase @ stub -arch=win64 _SetThrowImageBase
@ cdecl _Strftime(str long str ptr ptr) @ cdecl _Strftime(str long str ptr ptr)
@ cdecl _XcptFilter(long ptr) @ cdecl _XcptFilter(long ptr)
@ stub __AdjustPointer @ cdecl __AdjustPointer(ptr ptr)
@ stub __BuildCatchObject @ stub __BuildCatchObject
@ stub __BuildCatchObjectHelper @ stub __BuildCatchObjectHelper
@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler
......
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
@ stub _NLG_Return2 @ stub _NLG_Return2
@ cdecl _Strftime(str long str ptr ptr) @ cdecl _Strftime(str long str ptr ptr)
@ cdecl _XcptFilter(long ptr) @ cdecl _XcptFilter(long ptr)
@ stub __AdjustPointer @ cdecl __AdjustPointer(ptr ptr)
@ stub __BuildCatchObject @ stub __BuildCatchObject
@ stub __BuildCatchObjectHelper @ stub __BuildCatchObjectHelper
@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler
......
...@@ -120,6 +120,7 @@ static int (__cdecl *p_ferror)(FILE*); ...@@ -120,6 +120,7 @@ static int (__cdecl *p_ferror)(FILE*);
static int (__cdecl *p_flsbuf)(int, FILE*); static int (__cdecl *p_flsbuf)(int, FILE*);
static unsigned long (__cdecl *p_byteswap_ulong)(unsigned long); static unsigned long (__cdecl *p_byteswap_ulong)(unsigned long);
static void** (__cdecl *p__pxcptinfoptrs)(void); static void** (__cdecl *p__pxcptinfoptrs)(void);
static void* (__cdecl *p__AdjustPointer)(void*, const void*);
/* make sure we use the correct errno */ /* make sure we use the correct errno */
#undef errno #undef errno
...@@ -377,6 +378,7 @@ static BOOL init(void) ...@@ -377,6 +378,7 @@ static BOOL init(void)
SET(p_flsbuf, "_flsbuf"); SET(p_flsbuf, "_flsbuf");
SET(p_byteswap_ulong, "_byteswap_ulong"); SET(p_byteswap_ulong, "_byteswap_ulong");
SET(p__pxcptinfoptrs, "__pxcptinfoptrs"); SET(p__pxcptinfoptrs, "__pxcptinfoptrs");
SET(p__AdjustPointer, "__AdjustPointer");
if (sizeof(void *) == 8) if (sizeof(void *) == 8)
{ {
SET(p_type_info_name_internal_method, "?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z"); SET(p_type_info_name_internal_method, "?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z");
...@@ -1419,6 +1421,37 @@ static void test_is_exception_typeof(void) ...@@ -1419,6 +1421,37 @@ static void test_is_exception_typeof(void)
ok(ret == 0, "_is_exception_typeof returned %d\n", ret); ok(ret == 0, "_is_exception_typeof returned %d\n", ret);
} }
static void test__AdjustPointer(void)
{
int off = 0xf0;
void *obj1 = &off;
void *obj2 = (char*)&off - 2;
struct test_data {
void *ptr;
void *ret;
struct {
int this_offset;
int vbase_descr;
int vbase_offset;
} this_ptr_offsets;
} data[] = {
{NULL, NULL, {0, -1, 0}},
{(void*)0xbeef, (void*)0xbef0, {1, -1, 1}},
{(void*)0xbeef, (void*)0xbeee, {-1, -1, 0}},
{&obj1, (char*)&obj1 + off, {0, 0, 0}},
{(char*)&obj1 - 5, (char*)&obj1 + off, {0, 5, 0}},
{(char*)&obj1 - 3, (char*)&obj1 + off + 24, {24, 3, 0}},
{(char*)&obj2 - 17, (char*)&obj2 + off + 4, {4, 17, 2}}
};
void *ret;
int i;
for(i=0; i<sizeof(data)/sizeof(data[0]); i++) {
ret = p__AdjustPointer(data[i].ptr, &data[i].this_ptr_offsets);
ok(ret == data[i].ret, "%d) __AdjustPointer returned %p, expected %p\n", i, ret, data[i].ret);
}
}
START_TEST(msvcr90) START_TEST(msvcr90)
{ {
if(!init()) if(!init())
...@@ -1446,4 +1479,5 @@ START_TEST(msvcr90) ...@@ -1446,4 +1479,5 @@ START_TEST(msvcr90)
test_byteswap(); test_byteswap();
test_access_s(); test_access_s();
test_is_exception_typeof(); test_is_exception_typeof();
test__AdjustPointer();
} }
...@@ -1431,3 +1431,8 @@ void __cdecl __ExceptionPtrCurrentException(exception_ptr *ep) ...@@ -1431,3 +1431,8 @@ void __cdecl __ExceptionPtrCurrentException(exception_ptr *ep)
return; return;
} }
#endif #endif
void* __cdecl __AdjustPointer(void *obj, const this_ptr_offsets *off)
{
return get_this_pointer(off, obj);
}
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