2 * msvcrtd.dll debugging code
4 * Copyright (C) 2003 Adam Gundy
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 "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
30 int _crtAssertBusy = -1;
31 int _crtBreakAlloc = -1;
34 extern int _callnewh(unsigned long);
36 /*********************************************************************
37 * ??2@YAPAXIHPBDH@Z (MSVCRTD.@)
39 void * CDECL MSVCRTD_operator_new_dbg(
42 const char *szFileName,
47 TRACE("(%lu, %d, '%s', %d) returning %p\n", nSize, nBlockUse, szFileName, nLine, retval);
49 switch(_BLOCK_TYPE(nBlockUse))
54 FIXME("Unimplemented case for nBlockUse = _CLIENT_BLOCK\n");
57 FIXME("Native code throws an exception here\n");
60 ERR("Not allowed nBlockUse value: %d\n", _BLOCK_TYPE(nBlockUse));
63 ERR("Unknown nBlockUse value: %d\n", _BLOCK_TYPE(nBlockUse));
67 retval = HeapAlloc(GetProcessHeap(), 0, nSize);
75 /*********************************************************************
76 * _CrtSetDumpClient (MSVCRTD.@)
78 void * CDECL _CrtSetDumpClient(void *dumpClient)
84 /*********************************************************************
85 * _CrtSetReportHook (MSVCRTD.@)
87 void * CDECL _CrtSetReportHook(void *reportHook)
93 /*********************************************************************
94 * _CrtSetReportMode (MSVCRTD.@)
96 int CDECL _CrtSetReportMode(int reportType, int reportMode)
102 /*********************************************************************
103 * _CrtSetBreakAlloc (MSVCRTD.@)
105 int CDECL _CrtSetBreakAlloc(int new)
107 int old = _crtBreakAlloc;
108 _crtBreakAlloc = new;
112 /*********************************************************************
113 * _CrtSetDbgFlag (MSVCRTD.@)
115 int CDECL _CrtSetDbgFlag(int new)
117 int old = _crtDbgFlag;
123 /*********************************************************************
124 * _CrtDbgReport (MSVCRTD.@)
126 int CDECL _CrtDbgReport(int reportType, const char *filename, int linenumber,
127 const char *moduleName, const char *format, ...)
132 /*********************************************************************
133 * _CrtDumpMemoryLeaks (MSVCRTD.@)
135 int CDECL _CrtDumpMemoryLeaks(void)
140 /*********************************************************************
141 * _CrtCheckMemory (MSVCRTD.@)
143 int CDECL _CrtCheckMemory(void)
145 /* Note: maybe we could call here our heap validating functions ? */
150 /*********************************************************************
151 * __p__crtAssertBusy (MSVCRTD.@)
153 int * CDECL __p__crtAssertBusy(void)
155 return &_crtAssertBusy;
158 /*********************************************************************
159 * __p__crtBreakAlloc (MSVCRTD.@)
161 int * CDECL __p__crtBreakAlloc(void)
163 return &_crtBreakAlloc;
166 /*********************************************************************
167 * __p__crtDbgFlag (MSVCRTD.@)
169 int * CDECL __p__crtDbgFlag(void)