msvcr90: Implement _encode_pointer and _decode_pointer.

This commit is contained in:
Piotr Caban 2010-03-25 11:06:29 +01:00 committed by Alexandre Julliard
parent 9ff19d1d48
commit c452249e00
8 changed files with 55 additions and 12 deletions

4
configure vendored
View File

@ -14377,8 +14377,8 @@ wine_fn_config_test dlls/mstask/tests mstask_test
wine_fn_config_dll msvcirt enable_msvcirt
wine_fn_config_dll msvcr70 enable_msvcr70 msvcr70
wine_fn_config_dll msvcr71 enable_msvcr71 msvcr71
wine_fn_config_dll msvcr80 enable_msvcr80 msvcr80
wine_fn_config_dll msvcr90 enable_msvcr90 msvcr90
wine_fn_config_dll msvcr80 enable_msvcr80
wine_fn_config_dll msvcr90 enable_msvcr90
wine_fn_config_test dlls/msvcr90/tests msvcr90_test
wine_fn_config_dll msvcrt enable_msvcrt msvcrt
wine_fn_config_test dlls/msvcrt/tests msvcrt_test

View File

@ -2398,8 +2398,8 @@ WINE_CONFIG_TEST(dlls/mstask/tests)
WINE_CONFIG_DLL(msvcirt)
WINE_CONFIG_DLL(msvcr70,,[msvcr70])
WINE_CONFIG_DLL(msvcr71,,[msvcr71])
WINE_CONFIG_DLL(msvcr80,,[msvcr80])
WINE_CONFIG_DLL(msvcr90,,[msvcr90])
WINE_CONFIG_DLL(msvcr80)
WINE_CONFIG_DLL(msvcr90)
WINE_CONFIG_TEST(dlls/msvcr90/tests)
WINE_CONFIG_DLL(msvcrt,,[msvcrt])
WINE_CONFIG_TEST(dlls/msvcrt/tests)

View File

@ -3,8 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = msvcr80.dll
IMPORTLIB = msvcr80
IMPORTS = msvcrt msvcr90 kernel32
IMPORTS = msvcrt kernel32
C_SRCS = \
msvcr80.c

View File

@ -360,7 +360,7 @@
@ stub _cwscanf_s
@ stub _cwscanf_s_l
@ extern _daylight msvcrt._daylight
@ stub _decode_pointer
@ cdecl _decode_pointer(ptr) msvcr90._decode_pointer
@ cdecl _difftime32(long long) msvcrt._difftime32
@ cdecl _difftime64(long long) msvcrt._difftime64
@ stub _dosmaperr
@ -370,7 +370,7 @@
@ stub _dupenv_s
@ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt
@ stub _ecvt_s
@ stub _encode_pointer
@ cdecl _encode_pointer(ptr) msvcr90._encode_pointer
@ stub _encoded_null
@ cdecl _endthread() msvcrt._endthread
@ cdecl _endthreadex(long) msvcrt._endthreadex

View File

@ -3,7 +3,6 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = msvcr90.dll
IMPORTLIB = msvcr90
IMPORTS = msvcrt kernel32
C_SRCS = \

View File

@ -44,6 +44,27 @@ BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved)
return TRUE;
}
/*********************************************************************
* _decode_pointer (MSVCR90.@)
*
* cdecl version of DecodePointer
*
*/
void * CDECL MSVCR90_decode_pointer(void * ptr)
{
return DecodePointer(ptr);
}
/*********************************************************************
* _encode_pointer (MSVCR90.@)
*
* cdecl version of EncodePointer
*
*/
void * CDECL MSVCR90_encode_pointer(void * ptr)
{
return EncodePointer(ptr);
}
/*********************************************************************
* _initterm_e (MSVCR90.@)

View File

@ -352,7 +352,7 @@
@ stub _cwscanf_s
@ stub _cwscanf_s_l
@ extern _daylight msvcrt._daylight
@ stub _decode_pointer
@ cdecl _decode_pointer(ptr) MSVCR90_decode_pointer
@ cdecl _difftime32(long long) msvcrt._difftime32
@ cdecl _difftime64(long long) msvcrt._difftime64
@ stub _dosmaperr
@ -362,7 +362,7 @@
@ stub _dupenv_s
@ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt
@ stub _ecvt_s
@ stub _encode_pointer
@ cdecl _encode_pointer(ptr) MSVCR90_encode_pointer
@ stub _encoded_null
@ cdecl _endthread() msvcrt._endthread
@ cdecl _endthreadex(long) msvcrt._endthreadex

View File

@ -27,6 +27,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 *);
int cb_called[4];
/* ########## */
@ -130,6 +132,26 @@ static void test__initterm_e(void)
}
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");
return;
}
ptr = (void*)0xdeadbeef;
res = p_encode_pointer(ptr);
res = p_decode_pointer(res);
ok(res == ptr, "Pointers are different after encoding and decoding\n");
ptr = p_encode_pointer(p_encode_pointer);
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");
}
/* ########## */
START_TEST(msvcr90)
@ -144,7 +166,9 @@ 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");
test__initterm_e();
test__encode_pointer();
}