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
c1f9d386
Commit
c1f9d386
authored
Jul 29, 2002
by
Juergen Schmied
Committed by
Alexandre Julliard
Jul 29, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Implemented IMallocSpy hooks in IMalloc.
- Moved memory related functions into ifs.c. - Implemented stubs for the MallocSpy.
parent
22780c81
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
99 deletions
+37
-99
compobj.c
dlls/ole32/compobj.c
+29
-95
ifs.c
dlls/ole32/ifs.c
+0
-0
ifs.h
dlls/ole32/ifs.h
+0
-1
ole32.spec
dlls/ole32/ole32.spec
+2
-2
ole32_main.c
dlls/ole32/ole32_main.c
+3
-0
obj_misc.h
include/wine/obj_misc.h
+3
-1
No files found.
dlls/ole32/compobj.c
View file @
c1f9d386
...
@@ -126,9 +126,6 @@ HINSTANCE16 COMPOBJ_hInstance = 0;
...
@@ -126,9 +126,6 @@ HINSTANCE16 COMPOBJ_hInstance = 0;
HINSTANCE
COMPOBJ_hInstance32
=
0
;
HINSTANCE
COMPOBJ_hInstance32
=
0
;
static
int
COMPOBJ_Attach
=
0
;
static
int
COMPOBJ_Attach
=
0
;
LPMALLOC16
currentMalloc16
=
NULL
;
LPMALLOC
currentMalloc32
=
NULL
;
HTASK16
hETask
=
0
;
HTASK16
hETask
=
0
;
WORD
Table_ETask
[
62
];
WORD
Table_ETask
[
62
];
...
@@ -212,6 +209,35 @@ DWORD WINAPI CoBuildVersion(void)
...
@@ -212,6 +209,35 @@ DWORD WINAPI CoBuildVersion(void)
return
(
rmm
<<
16
)
+
rup
;
return
(
rmm
<<
16
)
+
rup
;
}
}
LPMALLOC16
currentMalloc16
=
NULL
;
/***********************************************************************
* CoGetMalloc [COMPOBJ.4]
* RETURNS
* The current win16 IMalloc
*/
HRESULT
WINAPI
CoGetMalloc16
(
DWORD
dwMemContext
,
/* [in] unknown */
LPMALLOC16
*
lpMalloc
/* [out] current win16 malloc interface */
)
{
if
(
!
currentMalloc16
)
currentMalloc16
=
IMalloc16_Constructor
();
*
lpMalloc
=
currentMalloc16
;
return
S_OK
;
}
/***********************************************************************
* CoCreateStandardMalloc [COMPOBJ.71]
*/
HRESULT
WINAPI
CoCreateStandardMalloc16
(
DWORD
dwMemContext
,
LPMALLOC16
*
lpMalloc
)
{
/* FIXME: docu says we shouldn't return the same allocator as in
* CoGetMalloc16 */
*
lpMalloc
=
IMalloc16_Constructor
();
return
S_OK
;
}
/******************************************************************************
/******************************************************************************
* CoInitialize [COMPOBJ.2]
* CoInitialize [COMPOBJ.2]
* Set the win16 IMalloc used for memory management
* Set the win16 IMalloc used for memory management
...
@@ -367,49 +393,6 @@ void WINAPI CoUninitialize(void)
...
@@ -367,49 +393,6 @@ void WINAPI CoUninitialize(void)
}
}
}
}
/***********************************************************************
* CoGetMalloc [COMPOBJ.4]
* RETURNS
* The current win16 IMalloc
*/
HRESULT
WINAPI
CoGetMalloc16
(
DWORD
dwMemContext
,
/* [in] unknown */
LPMALLOC16
*
lpMalloc
/* [out] current win16 malloc interface */
)
{
if
(
!
currentMalloc16
)
currentMalloc16
=
IMalloc16_Constructor
();
*
lpMalloc
=
currentMalloc16
;
return
S_OK
;
}
/******************************************************************************
* CoGetMalloc [OLE32.20]
*
* RETURNS
* The current win32 IMalloc
*/
HRESULT
WINAPI
CoGetMalloc
(
DWORD
dwMemContext
,
/* [in] unknown */
LPMALLOC
*
lpMalloc
/* [out] current win32 malloc interface */
)
{
if
(
!
currentMalloc32
)
currentMalloc32
=
IMalloc_Constructor
();
*
lpMalloc
=
currentMalloc32
;
return
S_OK
;
}
/***********************************************************************
* CoCreateStandardMalloc [COMPOBJ.71]
*/
HRESULT
WINAPI
CoCreateStandardMalloc16
(
DWORD
dwMemContext
,
LPMALLOC16
*
lpMalloc
)
{
/* FIXME: docu says we shouldn't return the same allocator as in
* CoGetMalloc16 */
*
lpMalloc
=
IMalloc16_Constructor
();
return
S_OK
;
}
/******************************************************************************
/******************************************************************************
* CoDisconnectObject [COMPOBJ.15]
* CoDisconnectObject [COMPOBJ.15]
* CoDisconnectObject [OLE32.8]
* CoDisconnectObject [OLE32.8]
...
@@ -1782,55 +1765,6 @@ HRESULT WINAPI CoFileTimeNow( FILETIME *lpFileTime ) /* [out] the current time *
...
@@ -1782,55 +1765,6 @@ HRESULT WINAPI CoFileTimeNow( FILETIME *lpFileTime ) /* [out] the current time *
}
}
/***********************************************************************
/***********************************************************************
* CoTaskMemAlloc (OLE32.43)
* RETURNS
* pointer to newly allocated block
*/
LPVOID
WINAPI
CoTaskMemAlloc
(
ULONG
size
/* [in] size of memoryblock to be allocated */
)
{
LPMALLOC
lpmalloc
;
HRESULT
ret
=
CoGetMalloc
(
0
,
&
lpmalloc
);
if
(
FAILED
(
ret
))
return
NULL
;
return
IMalloc_Alloc
(
lpmalloc
,
size
);
}
/***********************************************************************
* CoTaskMemFree (OLE32.44)
*/
VOID
WINAPI
CoTaskMemFree
(
LPVOID
ptr
/* [in] pointer to be freed */
)
{
LPMALLOC
lpmalloc
;
HRESULT
ret
=
CoGetMalloc
(
0
,
&
lpmalloc
);
if
(
FAILED
(
ret
))
return
;
IMalloc_Free
(
lpmalloc
,
ptr
);
}
/***********************************************************************
* CoTaskMemRealloc (OLE32.45)
* RETURNS
* pointer to newly allocated block
*/
LPVOID
WINAPI
CoTaskMemRealloc
(
LPVOID
pvOld
,
ULONG
size
)
/* [in] size of memoryblock to be allocated */
{
LPMALLOC
lpmalloc
;
HRESULT
ret
=
CoGetMalloc
(
0
,
&
lpmalloc
);
if
(
FAILED
(
ret
))
return
NULL
;
return
IMalloc_Realloc
(
lpmalloc
,
pvOld
,
size
);
}
/***********************************************************************
* CoLoadLibrary (OLE32.30)
* CoLoadLibrary (OLE32.30)
*/
*/
HINSTANCE
WINAPI
CoLoadLibrary
(
LPOLESTR
lpszLibName
,
BOOL
bAutoFree
)
HINSTANCE
WINAPI
CoLoadLibrary
(
LPOLESTR
lpszLibName
,
BOOL
bAutoFree
)
...
...
dlls/ole32/ifs.c
View file @
c1f9d386
This diff is collapsed.
Click to expand it.
dlls/ole32/ifs.h
View file @
c1f9d386
...
@@ -56,6 +56,5 @@ ICOM_DEFINE(IMalloc16,IUnknown)
...
@@ -56,6 +56,5 @@ ICOM_DEFINE(IMalloc16,IUnknown)
/**********************************************************************/
/**********************************************************************/
extern
LPMALLOC16
IMalloc16_Constructor
();
extern
LPMALLOC16
IMalloc16_Constructor
();
extern
LPMALLOC
IMalloc_Constructor
();
#endif
/* __WINE_OLE_IFS_H */
#endif
/* __WINE_OLE_IFS_H */
dlls/ole32/ole32.spec
View file @
c1f9d386
...
@@ -36,11 +36,11 @@ init OLE32_DllEntryPoint
...
@@ -36,11 +36,11 @@ init OLE32_DllEntryPoint
34 stdcall CoMarshalInterface(ptr ptr ptr long ptr long) CoMarshalInterface
34 stdcall CoMarshalInterface(ptr ptr ptr long ptr long) CoMarshalInterface
35 stub CoQueryReleaseObject
35 stub CoQueryReleaseObject
36 stdcall CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject
36 stdcall CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject
37 st
ub CoRegisterMallocSpy # stdcall (ptr) return 0,ERR_NOTIMPLEMENTED
37 st
dcall CoRegisterMallocSpy (ptr) CoRegisterMallocSpy
38 stdcall CoRegisterMessageFilter(ptr ptr) CoRegisterMessageFilter
38 stdcall CoRegisterMessageFilter(ptr ptr) CoRegisterMessageFilter
39 stub CoReleaseMarshalData # stdcall (ptr) return 0,ERR_NOTIMPLEMENTED
39 stub CoReleaseMarshalData # stdcall (ptr) return 0,ERR_NOTIMPLEMENTED
40 stdcall CoRevokeClassObject(long) CoRevokeClassObject
40 stdcall CoRevokeClassObject(long) CoRevokeClassObject
41 st
ub CoRevokeMallocSpy # stdcall () return 0,ERR_NOTIMPLEMENTED
41 st
dcall CoRevokeMallocSpy() CoRevokeMallocSpy
42 stdcall CoSetState(ptr) CoSetState
42 stdcall CoSetState(ptr) CoSetState
43 stdcall CoTaskMemAlloc(long) CoTaskMemAlloc
43 stdcall CoTaskMemAlloc(long) CoTaskMemAlloc
44 stdcall CoTaskMemFree(ptr) CoTaskMemFree
44 stdcall CoTaskMemFree(ptr) CoTaskMemFree
...
...
dlls/ole32/ole32_main.c
View file @
c1f9d386
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include "winerror.h"
#include "winerror.h"
#include "ole32_main.h"
#include "ole32_main.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/obj_misc.h"
/* FIXME: CoRegisterMallocSpy */
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
...
@@ -39,9 +40,11 @@ BOOL WINAPI OLE32_DllEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImp
...
@@ -39,9 +40,11 @@ BOOL WINAPI OLE32_DllEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImp
case
DLL_PROCESS_ATTACH
:
case
DLL_PROCESS_ATTACH
:
OLE32_hInstance
=
hinstDLL
;
OLE32_hInstance
=
hinstDLL
;
COMPOBJ_InitProcess
();
COMPOBJ_InitProcess
();
if
(
TRACE_ON
(
ole
))
CoRegisterMallocSpy
((
LPVOID
)
-
1
);
break
;
break
;
case
DLL_PROCESS_DETACH
:
case
DLL_PROCESS_DETACH
:
if
(
TRACE_ON
(
ole
))
CoRevokeMallocSpy
();
COMPOBJ_UninitProcess
();
COMPOBJ_UninitProcess
();
OLE32_hInstance
=
0
;
OLE32_hInstance
=
0
;
break
;
break
;
...
...
include/wine/obj_misc.h
View file @
c1f9d386
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
#ifndef __WINE_WINE_OBJ_MISC_H
#ifndef __WINE_WINE_OBJ_MISC_H
#define __WINE_WINE_OBJ_MISC_H
#define __WINE_WINE_OBJ_MISC_H
#include "wine/obj_base.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
/* defined(__cplusplus) */
#endif
/* defined(__cplusplus) */
...
@@ -103,7 +105,7 @@ ICOM_DEFINE(IEnumUnknown,IUnknown)
...
@@ -103,7 +105,7 @@ ICOM_DEFINE(IEnumUnknown,IUnknown)
#define ICOM_INTERFACE IMallocSpy
#define ICOM_INTERFACE IMallocSpy
#define IMallocSpy_METHODS \
#define IMallocSpy_METHODS \
ICOM_METHOD1 (ULONG,PreAlloc, ULONG,cbRequest) \
ICOM_METHOD1 (ULONG,PreAlloc, ULONG,cbRequest) \
ICOM_
VMETHOD1(
PostAlloc, void*,pActual) \
ICOM_
METHOD1 (PVOID,
PostAlloc, void*,pActual) \
ICOM_METHOD2 (PVOID,PreFree, void*,pRequest, BOOL,fSpyed) \
ICOM_METHOD2 (PVOID,PreFree, void*,pRequest, BOOL,fSpyed) \
ICOM_VMETHOD1( PostFree, BOOL,fSpyed) \
ICOM_VMETHOD1( PostFree, BOOL,fSpyed) \
ICOM_METHOD4 (ULONG,PreRealloc, void*,pRequest, ULONG,cbRequest, void**,ppNewRequest, BOOL,fSpyed) \
ICOM_METHOD4 (ULONG,PreRealloc, void*,pRequest, ULONG,cbRequest, void**,ppNewRequest, BOOL,fSpyed) \
...
...
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