---
name: "CoRegisterMallocSpy"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/CoRegisterMallocSpy"
---

# CoRegisterMallocSpy(3w)

## NAME

**CoRegisterMallocSpy** (OLE32.@)

## SYNOPSIS

HRESULT CoRegisterMallocSpy\
  (\
   LPMALLOCSPY *pMallocSpy*\
  )

## DESCRIPTION

Registers an object that receives notifications on memory allocations and frees.

## PARAMS

*pMallocSpy* **\[In\]**  New spy object.

## RETURNS

**Success:** **S\_OK**.

**Failure:** **HRESULT** code.

## NOTES

if a mallocspy is already registered, we can't do it again since only the spy knows, how to free a memory block

## IMPLEMENTATION

Declared in **"objbase.h"**.

Implemented in **"dlls/ole32/ifs.c"**.

Debug channel **"olemalloc"**.
