diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 13a7fa17415..7294d89568e 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -371,7 +371,7 @@ @ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt @ stub _ecvt_s @ cdecl _encode_pointer(ptr) msvcr90._encode_pointer -@ stub _encoded_null +@ cdecl _encoded_null() msvcr90._encoded_null @ cdecl _endthread() msvcrt._endthread @ cdecl _endthreadex(long) msvcrt._endthreadex @ extern _environ msvcrt._environ diff --git a/dlls/msvcr90/msvcr90.c b/dlls/msvcr90/msvcr90.c index 97d09218beb..1bada8b1d84 100644 --- a/dlls/msvcr90/msvcr90.c +++ b/dlls/msvcr90/msvcr90.c @@ -66,6 +66,16 @@ void * CDECL MSVCR90_encode_pointer(void * ptr) return EncodePointer(ptr); } +/********************************************************************* + * _encoded_null (MSVCR90.@) + */ +void * CDECL _encoded_null(void) +{ + TRACE("\n"); + + return MSVCR90_encode_pointer(NULL); +} + /********************************************************************* * _initterm_e (MSVCR90.@) * diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 8c3138b2a4f..9feaa477eb5 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -363,7 +363,7 @@ @ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt @ stub _ecvt_s @ cdecl _encode_pointer(ptr) MSVCR90_encode_pointer -@ stub _encoded_null +@ cdecl _encoded_null() @ cdecl _endthread() msvcrt._endthread @ cdecl _endthreadex(long) msvcrt._endthreadex @ extern _environ msvcrt._environ diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c index d8b84079883..f332622baf3 100644 --- a/dlls/msvcr90/tests/msvcr90.c +++ b/dlls/msvcr90/tests/msvcr90.c @@ -29,6 +29,8 @@ typedef int (__cdecl *_INITTERM_E_FN)(void); static int (__cdecl *p_initterm_e)(_INITTERM_E_FN *table, _INITTERM_E_FN *end); static void* (__cdecl *p_encode_pointer)(void *); static void* (__cdecl *p_decode_pointer)(void *); +static void* (__cdecl *p_encoded_null)(void); + int cb_called[4]; /* ########## */ @@ -136,8 +138,8 @@ static void test__encode_pointer(void) { void *ptr, *res; - if(!p_encode_pointer || !p_decode_pointer) { - win_skip("_encode_pointer or _decode_pointer not found\n"); + if(!p_encode_pointer || !p_decode_pointer || !p_encoded_null) { + win_skip("_encode_pointer, _decode_pointer or _encoded_null not found\n"); return; } @@ -150,6 +152,8 @@ static void test__encode_pointer(void) res = EncodePointer(p_encode_pointer); ok(ptr == res, "_encode_pointer produced different result than EncodePointer\n"); ok(p_decode_pointer(ptr) == p_encode_pointer, "Error decoding pointer\n"); + + ok(p_encoded_null() == p_encode_pointer(NULL), "Error encoding null\n"); } /* ########## */ @@ -168,6 +172,7 @@ START_TEST(msvcr90) p_initterm_e = (void *) GetProcAddress(hcrt, "_initterm_e"); p_encode_pointer = (void *) GetProcAddress(hcrt, "_encode_pointer"); p_decode_pointer = (void *) GetProcAddress(hcrt, "_decode_pointer"); + p_encoded_null = (void *) GetProcAddress(hcrt, "_encoded_null"); test__initterm_e(); test__encode_pointer();