diff --git a/dlls/msvcp80/msvcp80.c b/dlls/msvcp80/msvcp80.c index e8c61c74bbc..5f6951ed28e 100644 --- a/dlls/msvcp80/msvcp80.c +++ b/dlls/msvcp80/msvcp80.c @@ -23,6 +23,57 @@ #include "windef.h" #include "winbase.h" +typedef SIZE_T MSVCP_size_t; +struct locale_facet; +struct locale; + +const struct locale* (CDECL *plocale_classic)(void); +MSVCP_size_t (CDECL *pcollate_char__Getcat)(const struct locale_facet**,const struct locale*); +MSVCP_size_t (CDECL *pcollate_wchar__Getcat)(const struct locale_facet**,const struct locale*); +MSVCP_size_t (CDECL *pcollate_short__Getcat)(const struct locale_facet**,const struct locale*); +MSVCP_size_t (CDECL *pctype_char__Getcat)(const struct locale_facet**,const struct locale*); +MSVCP_size_t (CDECL *pctype_wchar__Getcat)(const struct locale_facet**,const struct locale*); +MSVCP_size_t (CDECL *pctype_short__Getcat)(const struct locale_facet**,const struct locale*); +MSVCP_size_t (CDECL *pcodecvt_char__Getcat)(const struct locale_facet**,const struct locale*); +MSVCP_size_t (CDECL *pnumpunct_char__Getcat)(const struct locale_facet**,const struct locale*); +MSVCP_size_t (CDECL *pnumpunct_wchar__Getcat)(const struct locale_facet**,const struct locale*); +MSVCP_size_t (CDECL *pnumpunct_short__Getcat)(const struct locale_facet**,const struct locale*); + +static BOOL init_funcs(void) +{ + HMODULE hmod = GetModuleHandleA("msvcp90.dll"); + if(!hmod) + return FALSE; + + if(sizeof(void*) > sizeof(int)) { /* 64-bit has different names */ + plocale_classic = (void*)GetProcAddress(hmod, "?classic@locale@std@@SAAEBV12@XZ"); + pcollate_char__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$collate@D@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z"); + pcollate_wchar__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$collate@_W@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z"); + pcollate_short__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$collate@G@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z"); + pctype_char__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$ctype@D@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z"); + pctype_wchar__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$ctype@_W@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z"); + pctype_short__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$ctype@G@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z"); + pcodecvt_char__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$codecvt@DDH@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z"); + pnumpunct_char__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$numpunct@D@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z"); + pnumpunct_wchar__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$numpunct@_W@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z"); + pnumpunct_short__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$numpunct@G@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z"); + }else { + plocale_classic = (void*)GetProcAddress(hmod, "?classic@locale@std@@SAABV12@XZ"); + pcollate_char__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$collate@D@std@@SAIPAPBVfacet@locale@2@PBV42@@Z"); + pcollate_wchar__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$collate@_W@std@@SAIPAPBVfacet@locale@2@PBV42@@Z"); + pcollate_short__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$collate@G@std@@SAIPAPBVfacet@locale@2@PBV42@@Z"); + pctype_char__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@PBV42@@Z"); + pctype_wchar__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$ctype@_W@std@@SAIPAPBVfacet@locale@2@PBV42@@Z"); + pctype_short__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$ctype@G@std@@SAIPAPBVfacet@locale@2@PBV42@@Z(ptr"); + pcodecvt_char__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$codecvt@DDH@std@@SAIPAPBVfacet@locale@2@PBV42@@Z"); + pnumpunct_char__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$numpunct@D@std@@SAIPAPBVfacet@locale@2@PBV42@@Z"); + pnumpunct_wchar__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$numpunct@_W@std@@SAIPAPBVfacet@locale@2@PBV42@@Z"); + pnumpunct_short__Getcat = (void*)GetProcAddress(hmod, "?_Getcat@?$numpunct@G@std@@SAIPAPBVfacet@locale@2@PBV42@@Z"); + } + + return TRUE; +} + BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved) { switch (reason) @@ -32,6 +83,78 @@ BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved) case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hdll); + if(!init_funcs()) + return FALSE; } return TRUE; } + +/* ?_Getcat@?$collate@D@std@@SAIPAPBVfacet@locale@2@@Z */ +/* ?_Getcat@?$collate@D@std@@SA_KPEAPEBVfacet@locale@2@@Z */ +MSVCP_size_t __cdecl collate_char__Getcat(const struct locale_facet **facet) +{ + return pcollate_char__Getcat(facet, plocale_classic()); +} + +/* ?_Getcat@?$collate@_W@std@@SAIPAPBVfacet@locale@2@@Z */ +/* ?_Getcat@?$collate@_W@std@@SA_KPEAPEBVfacet@locale@2@@Z */ +MSVCP_size_t __cdecl collate_wchar__Getcat(const struct locale_facet **facet) +{ + return pcollate_wchar__Getcat(facet, plocale_classic()); +} + +/* ?_Getcat@?$collate@G@std@@SAIPAPBVfacet@locale@2@@Z */ +/* ?_Getcat@?$collate@G@std@@SA_KPEAPEBVfacet@locale@2@@Z */ +MSVCP_size_t __cdecl collate_short__Getcat(const struct locale_facet **facet) +{ + return pcollate_short__Getcat(facet, plocale_classic()); +} + +/* ?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@@Z */ +/* ?_Getcat@?$ctype@D@std@@SA_KPEAPEBVfacet@locale@2@@Z */ +MSVCP_size_t __cdecl ctype_char__Getcat(const struct locale_facet **facet) +{ + return pctype_char__Getcat(facet, plocale_classic()); +} + +/* ?_Getcat@?$ctype@_W@std@@SAIPAPBVfacet@locale@2@@Z */ +/* ?_Getcat@?$ctype@_W@std@@SA_KPEAPEBVfacet@locale@2@@Z */ +MSVCP_size_t __cdecl ctype_wchar__Getcat(const struct locale_facet **facet) +{ + return pctype_wchar__Getcat(facet, plocale_classic()); +} + +/* ?_Getcat@?$ctype@G@std@@SAIPAPBVfacet@locale@2@@Z */ +/* ?_Getcat@?$ctype@G@std@@SA_KPEAPEBVfacet@locale@2@@Z */ +MSVCP_size_t __cdecl ctype_short__Getcat(const struct locale_facet **facet) +{ + return pctype_short__Getcat(facet, plocale_classic()); +} + +/* ?_Getcat@?$codecvt@DDH@std@@SAIPAPBVfacet@locale@2@@Z */ +/* ?_Getcat@?$codecvt@DDH@std@@SA_KPEAPEBVfacet@locale@2@@Z */ +MSVCP_size_t __cdecl codecvt_char__Getcat(const struct locale_facet **facet) +{ + return pcodecvt_char__Getcat(facet, plocale_classic()); +} + +/* ?_Getcat@?$numpunct@D@std@@SAIPAPBVfacet@locale@2@@Z */ +/* ?_Getcat@?$numpunct@D@std@@SA_KPEAPEBVfacet@locale@2@@Z */ +MSVCP_size_t __cdecl numpunct_char__Getcat(const struct locale_facet **facet) +{ + return pnumpunct_char__Getcat(facet, plocale_classic()); +} + +/* ?_Getcat@?$numpunct@_W@std@@SAIPAPBVfacet@locale@2@@Z */ +/* ?_Getcat@?$numpunct@_W@std@@SA_KPEAPEBVfacet@locale@2@@Z */ +MSVCP_size_t __cdecl numpunct_wchar__Getcat(const struct locale_facet **facet) +{ + return pnumpunct_wchar__Getcat(facet, plocale_classic()); +} + +/* ?_Getcat@?$numpunct@G@std@@SAIPAPBVfacet@locale@2@@Z */ +/* ?_Getcat@?$numpunct@G@std@@SA_KPEAPEBVfacet@locale@2@@Z */ +MSVCP_size_t __cdecl numpunct_short__Getcat(const struct locale_facet **facet) +{ + return pnumpunct_short__Getcat(facet, plocale_classic()); +} diff --git a/dlls/msvcp80/msvcp80.spec b/dlls/msvcp80/msvcp80.spec index babfd3d1e7c..ee2eed28d4c 100644 --- a/dlls/msvcp80/msvcp80.spec +++ b/dlls/msvcp80/msvcp80.spec @@ -2218,24 +2218,24 @@ @ extern ?_Fpz@std@@3_JA msvcp90.?_Fpz@std@@3_JA @ cdecl -arch=win32 ?_Fpz_func@std@@YAAA_JXZ() msvcp90.?_Fpz_func@std@@YAAA_JXZ @ cdecl -arch=win64 ?_Fpz_func@std@@YAAEA_JXZ() msvcp90.?_Fpz_func@std@@YAAEA_JXZ -@ stub -arch=win32 ?_Getcat@?$codecvt@DDH@std@@SAIPAPBVfacet@locale@2@@Z -@ stub -arch=win64 ?_Getcat@?$codecvt@DDH@std@@SA_KPEAPEBVfacet@locale@2@@Z +@ cdecl -arch=win32 ?_Getcat@?$codecvt@DDH@std@@SAIPAPBVfacet@locale@2@@Z(ptr) codecvt_char__Getcat +@ cdecl -arch=win64 ?_Getcat@?$codecvt@DDH@std@@SA_KPEAPEBVfacet@locale@2@@Z(ptr) codecvt_char__Getcat @ stub -arch=win32 ?_Getcat@?$codecvt@GDH@std@@SAIPAPBVfacet@locale@2@@Z @ stub -arch=win64 ?_Getcat@?$codecvt@GDH@std@@SA_KPEAPEBVfacet@locale@2@@Z @ stub -arch=win32 ?_Getcat@?$codecvt@_WDH@std@@SAIPAPBVfacet@locale@2@@Z @ stub -arch=win64 ?_Getcat@?$codecvt@_WDH@std@@SA_KPEAPEBVfacet@locale@2@@Z -@ stub -arch=win32 ?_Getcat@?$collate@D@std@@SAIPAPBVfacet@locale@2@@Z -@ stub -arch=win64 ?_Getcat@?$collate@D@std@@SA_KPEAPEBVfacet@locale@2@@Z -@ stub -arch=win32 ?_Getcat@?$collate@G@std@@SAIPAPBVfacet@locale@2@@Z -@ stub -arch=win64 ?_Getcat@?$collate@G@std@@SA_KPEAPEBVfacet@locale@2@@Z -@ stub -arch=win32 ?_Getcat@?$collate@_W@std@@SAIPAPBVfacet@locale@2@@Z -@ stub -arch=win64 ?_Getcat@?$collate@_W@std@@SA_KPEAPEBVfacet@locale@2@@Z -@ stub -arch=win32 ?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@@Z -@ stub -arch=win64 ?_Getcat@?$ctype@D@std@@SA_KPEAPEBVfacet@locale@2@@Z -@ stub -arch=win32 ?_Getcat@?$ctype@G@std@@SAIPAPBVfacet@locale@2@@Z -@ stub -arch=win64 ?_Getcat@?$ctype@G@std@@SA_KPEAPEBVfacet@locale@2@@Z -@ stub -arch=win32 ?_Getcat@?$ctype@_W@std@@SAIPAPBVfacet@locale@2@@Z -@ stub -arch=win64 ?_Getcat@?$ctype@_W@std@@SA_KPEAPEBVfacet@locale@2@@Z +@ cdecl -arch=win32 ?_Getcat@?$collate@D@std@@SAIPAPBVfacet@locale@2@@Z(ptr) collate_char__Getcat +@ cdecl -arch=win64 ?_Getcat@?$collate@D@std@@SA_KPEAPEBVfacet@locale@2@@Z(ptr) collate_char__Getcat +@ cdecl -arch=win32 ?_Getcat@?$collate@G@std@@SAIPAPBVfacet@locale@2@@Z(ptr) collate_short__Getcat +@ cdecl -arch=win64 ?_Getcat@?$collate@G@std@@SA_KPEAPEBVfacet@locale@2@@Z(ptr) collate_short__Getcat +@ cdecl -arch=win32 ?_Getcat@?$collate@_W@std@@SAIPAPBVfacet@locale@2@@Z(ptr) collate_wchar__Getcat +@ cdecl -arch=win64 ?_Getcat@?$collate@_W@std@@SA_KPEAPEBVfacet@locale@2@@Z(ptr) collate_wchar__Getcat +@ cdecl -arch=win32 ?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@@Z(ptr) ctype_char__Getcat +@ cdecl -arch=win64 ?_Getcat@?$ctype@D@std@@SA_KPEAPEBVfacet@locale@2@@Z(ptr) ctype_char__Getcat +@ cdecl -arch=win32 ?_Getcat@?$ctype@G@std@@SAIPAPBVfacet@locale@2@@Z(ptr) ctype_short__Getcat +@ cdecl -arch=win64 ?_Getcat@?$ctype@G@std@@SA_KPEAPEBVfacet@locale@2@@Z(ptr) ctype_short__Getcat +@ cdecl -arch=win32 ?_Getcat@?$ctype@_W@std@@SAIPAPBVfacet@locale@2@@Z(ptr) ctype_wchar__Getcat +@ cdecl -arch=win64 ?_Getcat@?$ctype@_W@std@@SA_KPEAPEBVfacet@locale@2@@Z(ptr) ctype_wchar__Getcat @ stub -arch=win32 ?_Getcat@?$messages@D@std@@SAIPAPBVfacet@locale@2@@Z @ stub -arch=win64 ?_Getcat@?$messages@D@std@@SA_KPEAPEBVfacet@locale@2@@Z @ stub -arch=win32 ?_Getcat@?$messages@G@std@@SAIPAPBVfacet@locale@2@@Z @@ -2278,12 +2278,12 @@ @ stub -arch=win64 ?_Getcat@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@@Z @ stub -arch=win32 ?_Getcat@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SAIPAPBVfacet@locale@2@@Z @ stub -arch=win64 ?_Getcat@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@@Z -@ stub -arch=win32 ?_Getcat@?$numpunct@D@std@@SAIPAPBVfacet@locale@2@@Z -@ stub -arch=win64 ?_Getcat@?$numpunct@D@std@@SA_KPEAPEBVfacet@locale@2@@Z -@ stub -arch=win32 ?_Getcat@?$numpunct@G@std@@SAIPAPBVfacet@locale@2@@Z -@ stub -arch=win64 ?_Getcat@?$numpunct@G@std@@SA_KPEAPEBVfacet@locale@2@@Z -@ stub -arch=win32 ?_Getcat@?$numpunct@_W@std@@SAIPAPBVfacet@locale@2@@Z -@ stub -arch=win64 ?_Getcat@?$numpunct@_W@std@@SA_KPEAPEBVfacet@locale@2@@Z +@ cdecl -arch=win32 ?_Getcat@?$numpunct@D@std@@SAIPAPBVfacet@locale@2@@Z(ptr) numpunct_char__Getcat +@ cdecl -arch=win64 ?_Getcat@?$numpunct@D@std@@SA_KPEAPEBVfacet@locale@2@@Z(ptr) numpunct_char__Getcat +@ cdecl -arch=win32 ?_Getcat@?$numpunct@G@std@@SAIPAPBVfacet@locale@2@@Z(ptr) numpunct_short__Getcat +@ cdecl -arch=win64 ?_Getcat@?$numpunct@G@std@@SA_KPEAPEBVfacet@locale@2@@Z(ptr) numpunct_short__Getcat +@ cdecl -arch=win32 ?_Getcat@?$numpunct@_W@std@@SAIPAPBVfacet@locale@2@@Z(ptr) numpunct_wchar__Getcat +@ cdecl -arch=win64 ?_Getcat@?$numpunct@_W@std@@SA_KPEAPEBVfacet@locale@2@@Z(ptr) numpunct_wchar__Getcat @ stub -arch=win32 ?_Getcat@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SAIPAPBVfacet@locale@2@@Z @ stub -arch=win64 ?_Getcat@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@@Z @ stub -arch=win32 ?_Getcat@?$time_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SAIPAPBVfacet@locale@2@@Z