oledb32: Check for DBSTATUS_S_ISNULL first.
[wine/wine-gecko.git] / dlls / msvcp100 / msvcp100.c
blob244c5d24eba28a3685b7cb700ab21f11288423c7
1 /*
2 * msvcp100 specific functions
4 * Copyright 2011 Austin English
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "config.h"
23 #include <stdarg.h>
25 #include "msvcp.h"
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
33 #ifdef __i386__
35 #define DEFINE_VTBL_WRAPPER(off) \
36 __ASM_GLOBAL_FUNC(vtbl_wrapper_ ## off, \
37 "popl %eax\n\t" \
38 "popl %ecx\n\t" \
39 "pushl %eax\n\t" \
40 "movl 0(%ecx), %eax\n\t" \
41 "jmp *" #off "(%eax)\n\t")
43 DEFINE_VTBL_WRAPPER(0);
44 DEFINE_VTBL_WRAPPER(4);
45 DEFINE_VTBL_WRAPPER(8);
46 DEFINE_VTBL_WRAPPER(12);
47 DEFINE_VTBL_WRAPPER(16);
48 DEFINE_VTBL_WRAPPER(20);
49 DEFINE_VTBL_WRAPPER(24);
50 DEFINE_VTBL_WRAPPER(28);
51 DEFINE_VTBL_WRAPPER(32);
52 DEFINE_VTBL_WRAPPER(36);
53 DEFINE_VTBL_WRAPPER(40);
54 DEFINE_VTBL_WRAPPER(44);
55 DEFINE_VTBL_WRAPPER(48);
56 DEFINE_VTBL_WRAPPER(52);
57 DEFINE_VTBL_WRAPPER(56);
59 #endif
61 void* (__cdecl *MSVCRT_operator_new)(MSVCP_size_t);
62 void (__cdecl *MSVCRT_operator_delete)(void*);
63 void* (__cdecl *MSVCRT_set_new_handler)(void*);
65 static void init_cxx_funcs(void)
67 HMODULE hmod = GetModuleHandleA("msvcrt.dll");
69 if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */
71 MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z");
72 MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z");
73 MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z");
75 else
77 MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z");
78 MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z");
79 MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z");
83 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
85 TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
87 switch (fdwReason)
89 case DLL_WINE_PREATTACH:
90 return FALSE; /* prefer native version */
91 case DLL_PROCESS_ATTACH:
92 init_cxx_funcs();
93 init_lockit();
94 init_exception(hinstDLL);
95 init_locale(hinstDLL);
96 init_io(hinstDLL);
97 break;
98 case DLL_PROCESS_DETACH:
99 if (lpvReserved) break;
100 free_io();
101 free_locale();
102 free_lockit();
103 break;
106 return TRUE;
109 /* ?_BADOFF@std@@3JB -> long const std::_BADOFF */
110 /* ?_BADOFF@std@@3_JB -> __int64 const std::_BADOFF */
111 const streamoff std_BADOFF = -1;