Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
6de20f33
Commit
6de20f33
authored
Jul 21, 2005
by
Saulius Krasuckas
Committed by
Alexandre Julliard
Jul 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Declare implemented functions inside #ifndef _DEBUG block.
- Make MSVCRTD_operator_new_dbg recognize types of memory blocks.
parent
84bb3722
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
9 deletions
+51
-9
Makefile.in
dlls/msvcrtd/Makefile.in
+1
-0
debug.c
dlls/msvcrtd/debug.c
+24
-1
debug.c
dlls/msvcrtd/tests/debug.c
+3
-1
crtdbg.h
include/msvcrt/crtdbg.h
+23
-7
No files found.
dlls/msvcrtd/Makefile.in
View file @
6de20f33
...
...
@@ -5,6 +5,7 @@ VPATH = @srcdir@
MODULE
=
msvcrtd.dll
IMPORTLIB
=
libmsvcrtd.
$(IMPLIBEXT)
IMPORTS
=
msvcrt kernel32
EXTRAINCL
=
-I
$(TOPSRCDIR)
/include/msvcrt
C_SRCS
=
\
debug.c
...
...
dlls/msvcrtd/debug.c
View file @
6de20f33
...
...
@@ -22,6 +22,9 @@
#include "winbase.h"
#define _DEBUG
#include "crtdbg.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msvcrt
);
int
_crtAssertBusy
=
-
1
;
...
...
@@ -39,10 +42,30 @@ void *MSVCRTD_operator_new_dbg(
const
char
*
szFileName
,
int
nLine
)
{
void
*
retval
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nSize
)
;
void
*
retval
=
NULL
;
TRACE
(
"(%lu, %d, '%s', %d) returning %p
\n
"
,
nSize
,
nBlockUse
,
szFileName
,
nLine
,
retval
);
switch
(
_BLOCK_TYPE
(
nBlockUse
))
{
case
_NORMAL_BLOCK
:
break
;
case
_CLIENT_BLOCK
:
FIXME
(
"Unimplemented case for nBlockUse = _CLIENT_BLOCK
\n
"
);
return
NULL
;
case
_FREE_BLOCK
:
FIXME
(
"Native code throws an exception here
\n
"
);
case
_CRT_BLOCK
:
case
_IGNORE_BLOCK
:
ERR
(
"Not allowed nBlockUse value: %d
\n
"
,
_BLOCK_TYPE
(
nBlockUse
));
return
NULL
;
default:
ERR
(
"Unknown nBlockUse value: %d
\n
"
,
_BLOCK_TYPE
(
nBlockUse
));
return
NULL
;
}
retval
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nSize
);
if
(
!
retval
)
_callnewh
(
nSize
);
...
...
dlls/msvcrtd/tests/debug.c
View file @
6de20f33
...
...
@@ -24,6 +24,8 @@
#include "winbase.h"
#include "winnt.h"
#include "crtdbg.h"
#include "wine/test.h"
/**********************************************************************/
...
...
@@ -55,7 +57,7 @@ static void test_new(void)
{
void
*
mem
;
mem
=
pMSVCRTD_operator_new_dbg
(
42
,
0
,
__FILE__
,
__LINE__
);
mem
=
pMSVCRTD_operator_new_dbg
(
42
,
_NORMAL_BLOCK
,
__FILE__
,
__LINE__
);
ok
(
mem
!=
NULL
,
"memory not allocated
\n
"
);
}
...
...
include/msvcrt/crtdbg.h
View file @
6de20f33
...
...
@@ -39,6 +39,8 @@
#define _CLIENT_BLOCK 4
#define _MAX_BLOCKS 5
#define _BLOCK_TYPE(block) (block & 0xFFFF)
#define _BLOCK_SUBTYPE(block) (block >> 16 & 0xFFFF)
typedef
struct
_CrtMemState
{
...
...
@@ -56,6 +58,14 @@ typedef struct _CrtMemState
#define _ASSERTE(expr) ((void)0)
#define _CrtDbgBreak() ((void)0)
#define _CrtCheckMemory() ((int)1)
#define _CrtDbgReport(...) ((int)0)
#define _CrtDumpMemoryLeaks() ((int)0)
#define _CrtSetBreakAlloc(a) ((long)0)
#define _CrtSetDbgFlag(f) ((int)0)
#define _CrtSetDumpClient(f) ((void)0)
#define _CrtSetReportMode(t,m) ((int)0)
#else
/* _DEBUG */
#include <assert.h>
...
...
@@ -67,12 +77,22 @@ typedef struct _CrtMemState
#define _CrtDbgBreak() ((void)0)
#endif
extern
int
_crtAssertBusy
;
extern
int
_crtBreakAlloc
;
extern
int
_crtDbgFlag
;
int
_CrtCheckMemory
();
int
_CrtDbgReport
(
int
reportType
,
const
char
*
filename
,
int
linenumber
,
const
char
*
moduleName
,
const
char
*
format
,
...);
int
_CrtDumpMemoryLeaks
();
int
_CrtSetBreakAlloc
(
int
new
);
int
_CrtSetDbgFlag
(
int
new
);
void
*
_CrtSetDumpClient
(
void
*
dumpClient
);
int
_CrtSetReportMode
(
int
reportType
,
int
reportMode
);
#endif
/* _DEBUG */
#define _CrtCheckMemory() ((int)1)
#define _CrtDbgReport(...) ((int)0)
#define _CrtDoForAllClientObjects(f,c) ((void)0)
#define _CrtDumpMemoryLeaks() ((int)0)
#define _CrtIsMemoryBlock(p,s,r,f,l) ((int)1)
#define _CrtIsValidHeapPointer(p) ((int)1)
#define _CrtIsValidPointer(p,s,a) ((int)1)
...
...
@@ -81,10 +101,6 @@ typedef struct _CrtMemState
#define _CrtMemDumpAllObjectsSince(s) ((void)0)
#define _CrtMemDumpStatistics(s) ((void)0)
#define _CrtSetAllocHook(f) ((void)0)
#define _CrtSetBreakAlloc(a) ((long)0)
#define _CrtSetDbgFlag(f) ((int)0)
#define _CrtSetDumpClient(f) ((void)0)
#define _CrtSetReportMode(t,m) ((int)0)
#define _RPT0(t,m)
#define _RPT1(t,m,p1)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment