Added and cleaned API docs.
[wine] / dlls / msvcrtd / debug.c
1 /*
2  * msvcrtd.dll debugging code
3  *
4  * Copyright (C) 2003 Adam Gundy
5  *
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.
10  *
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.
15  *
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "wine/debug.h"
22
23 #include "winbase.h"
24
25 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
26
27 int _crtAssertBusy = -1;
28 int _crtBreakAlloc = -1;
29 int _crtDbgFlag = 0;
30
31 extern int _callnewh(unsigned long);
32
33 /*********************************************************************
34  *              ??2@YAPAXIHPBDH@Z (MSVCRTD.@)
35  */
36 void *MSVCRTD_operator_new_dbg(
37         unsigned long nSize,
38         int nBlockUse,
39         const char *szFileName,
40         int nLine)
41 {
42     void *retval = HeapAlloc(GetProcessHeap(), 0, nSize);
43
44     TRACE("(%lu, %d, '%s', %d) returning %p\n", nSize, nBlockUse, szFileName, nLine, retval);
45
46     if (!retval)
47         _callnewh(nSize);
48
49     return retval;
50 }
51
52 /*********************************************************************
53  *              _CrtSetDumpClient (MSVCRTD.@)
54  */
55 void *_CrtSetDumpClient(void *dumpClient)
56 {
57     return NULL;
58 }
59
60
61 /*********************************************************************
62  *              _CrtSetReportHook (MSVCRTD.@)
63  */
64 void *_CrtSetReportHook(void *reportHook)
65 {
66     return NULL;
67 }
68
69
70 /*********************************************************************
71  *              _CrtSetReportMode (MSVCRTD.@)
72  */
73 int _CrtSetReportMode(int reportType, int reportMode)
74 {
75     return 0;
76 }
77
78
79 /*********************************************************************
80  *              _CrtSetBreakAlloc (MSVCRTD.@)
81  */
82 int _CrtSetBreakAlloc(int new)
83 {
84     int old = _crtBreakAlloc;
85     _crtBreakAlloc = new;
86     return old;
87 }
88
89 /*********************************************************************
90  *              _CrtSetDbgFlag (MSVCRTD.@)
91  */
92 int _CrtSetDbgFlag(int new)
93 {
94     int old = _crtDbgFlag;
95     _crtDbgFlag = new;
96     return old;
97 }
98
99
100 /*********************************************************************
101  *              _CrtDbgReport (MSVCRTD.@)
102  */
103 int _CrtDbgReport(int reportType, const char *filename, int linenumber,
104                   const char *moduleName, const char *format, ...)
105 {
106     return 0;
107 }
108
109 /*********************************************************************
110  *              _CrtDumpMemoryLeaks (MSVCRTD.@)
111  */
112 int _CrtDumpMemoryLeaks()
113 {
114     return 0;
115 }
116
117 /*********************************************************************
118  *              _CrtCheckMemory (MSVCRTD.@)
119  */
120 int _CrtCheckMemory()
121 {
122     /* Note: maybe we could call here our heap validating functions ? */
123     return TRUE;
124 }
125
126
127 /*********************************************************************
128  *              __p__crtAssertBusy (MSVCRTD.@)
129  */
130 int *__p__crtAssertBusy(void)
131 {
132     return &_crtAssertBusy;
133 }
134
135 /*********************************************************************
136  *              __p__crtBreakAlloc (MSVCRTD.@)
137  */
138 int *__p__crtBreakAlloc(void)
139 {
140     return &_crtBreakAlloc;
141 }
142
143 /*********************************************************************
144  *              __p__crtDbgFlag (MSVCRTD.@)
145  */
146 int *__p__crtDbgFlag(void)
147 {
148     return &_crtDbgFlag;
149 }