d3d10core: Implement d3d10_device_RSGetState().
[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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #include "wine/debug.h"
22
23 #include "winbase.h"
24
25 #define  _DEBUG
26 #include "crtdbg.h"
27
28 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
29
30 int _crtAssertBusy = -1;
31 int _crtBreakAlloc = -1;
32 int _crtDbgFlag = 0;
33
34 #ifdef _WIN64
35 typedef unsigned __int64 MSVCRT_size_t;
36 #else
37 typedef unsigned long MSVCRT_size_t;
38 #endif
39
40 extern int _callnewh(MSVCRT_size_t);
41
42 /*********************************************************************
43  *              ??2@YAPAXIHPBDH@Z (MSVCRTD.@)
44  */
45 void * CDECL MSVCRTD_operator_new_dbg(MSVCRT_size_t nSize, int nBlockUse,
46                                       const char *szFileName, int nLine)
47 {
48     void *retval = NULL;
49
50     TRACE("(%lu, %d, '%s', %d)\n", nSize, nBlockUse, szFileName, nLine);
51
52     switch(_BLOCK_TYPE(nBlockUse))
53     {
54     case _NORMAL_BLOCK:
55         break;
56     case _CLIENT_BLOCK:
57         FIXME("Unimplemented case for nBlockUse = _CLIENT_BLOCK\n");
58         return NULL;
59     case _FREE_BLOCK:
60         FIXME("Native code throws an exception here\n");
61     case _CRT_BLOCK:
62     case _IGNORE_BLOCK:
63         ERR("Not allowed nBlockUse value: %d\n", _BLOCK_TYPE(nBlockUse));
64         return NULL;
65     default:
66         ERR("Unknown nBlockUse value: %d\n", _BLOCK_TYPE(nBlockUse));
67         return NULL;
68     }
69
70     retval = HeapAlloc(GetProcessHeap(), 0, nSize);
71
72     if (!retval)
73         _callnewh(nSize);
74
75     return retval;
76 }
77
78 /*********************************************************************
79  *              _CrtSetDumpClient (MSVCRTD.@)
80  */
81 void * CDECL _CrtSetDumpClient(void *dumpClient)
82 {
83     return NULL;
84 }
85
86
87 /*********************************************************************
88  *              _CrtSetReportHook (MSVCRTD.@)
89  */
90 void * CDECL _CrtSetReportHook(void *reportHook)
91 {
92     return NULL;
93 }
94
95
96 /*********************************************************************
97  *              _CrtSetReportMode (MSVCRTD.@)
98  */
99 int CDECL _CrtSetReportMode(int reportType, int reportMode)
100 {
101     return 0;
102 }
103
104
105 /*********************************************************************
106  *              _CrtSetBreakAlloc (MSVCRTD.@)
107  */
108 int CDECL _CrtSetBreakAlloc(int new)
109 {
110     int old = _crtBreakAlloc;
111     _crtBreakAlloc = new;
112     return old;
113 }
114
115 /*********************************************************************
116  *              _CrtSetDbgFlag (MSVCRTD.@)
117  */
118 int CDECL _CrtSetDbgFlag(int new)
119 {
120     int old = _crtDbgFlag;
121     _crtDbgFlag = new;
122     return old;
123 }
124
125
126 /*********************************************************************
127  *              _CrtDbgReport (MSVCRTD.@)
128  */
129 int CDECL _CrtDbgReport(int reportType, const char *filename, int linenumber,
130                         const char *moduleName, const char *format, ...)
131 {
132     return 0;
133 }
134
135 /*********************************************************************
136  *              _CrtDumpMemoryLeaks (MSVCRTD.@)
137  */
138 int CDECL _CrtDumpMemoryLeaks(void)
139 {
140     return 0;
141 }
142
143 /*********************************************************************
144  *              _CrtCheckMemory (MSVCRTD.@)
145  */
146 int CDECL _CrtCheckMemory(void)
147 {
148     /* Note: maybe we could call here our heap validating functions ? */
149     return TRUE;
150 }
151
152
153 /*********************************************************************
154  *              __p__crtAssertBusy (MSVCRTD.@)
155  */
156 int * CDECL __p__crtAssertBusy(void)
157 {
158     return &_crtAssertBusy;
159 }
160
161 /*********************************************************************
162  *              __p__crtBreakAlloc (MSVCRTD.@)
163  */
164 int * CDECL __p__crtBreakAlloc(void)
165 {
166     return &_crtBreakAlloc;
167 }
168
169 /*********************************************************************
170  *              __p__crtDbgFlag (MSVCRTD.@)
171  */
172 int * CDECL __p__crtDbgFlag(void)
173 {
174     return &_crtDbgFlag;
175 }