diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 77ba21d1946..07d50fc91c4 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -538,7 +538,7 @@ @ stub -arch=win64 _SetThrowImageBase @ cdecl _Strftime(str long str ptr ptr) @ cdecl _XcptFilter(long ptr) -@ stub __AdjustPointer +@ cdecl __AdjustPointer(ptr ptr) @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 1afb3f274d8..e6576e00e25 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -869,7 +869,7 @@ @ stub _W_Gettnames @ stub _Wcsftime @ cdecl _XcptFilter(long ptr) -@ stub __AdjustPointer +@ cdecl __AdjustPointer(ptr ptr) @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 2aee5200cb4..9c7f85b38fe 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -172,7 +172,7 @@ @ stub -arch=win64 _SetThrowImageBase @ cdecl _Strftime(str long str ptr ptr) @ cdecl _XcptFilter(long ptr) -@ stub __AdjustPointer +@ cdecl __AdjustPointer(ptr ptr) @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 766d62e07ae..e86541c0373 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -163,7 +163,7 @@ @ stub _NLG_Return2 @ cdecl _Strftime(str long str ptr ptr) @ cdecl _XcptFilter(long ptr) -@ stub __AdjustPointer +@ cdecl __AdjustPointer(ptr ptr) @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c index 1c8da4ef3fe..0a81edc992f 100644 --- a/dlls/msvcr90/tests/msvcr90.c +++ b/dlls/msvcr90/tests/msvcr90.c @@ -120,6 +120,7 @@ static int (__cdecl *p_ferror)(FILE*); static int (__cdecl *p_flsbuf)(int, FILE*); static unsigned long (__cdecl *p_byteswap_ulong)(unsigned long); static void** (__cdecl *p__pxcptinfoptrs)(void); +static void* (__cdecl *p__AdjustPointer)(void*, const void*); /* make sure we use the correct errno */ #undef errno @@ -377,6 +378,7 @@ static BOOL init(void) SET(p_flsbuf, "_flsbuf"); SET(p_byteswap_ulong, "_byteswap_ulong"); SET(p__pxcptinfoptrs, "__pxcptinfoptrs"); + SET(p__AdjustPointer, "__AdjustPointer"); if (sizeof(void *) == 8) { 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) 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