COM
Expand Minimize

CoTaskMemFree function

Frees a block of task memory previously allocated through a call to the CoTaskMemAlloc or CoTaskMemRealloc function.

Syntax


void CoTaskMemFree(
  _In_opt_  LPVOID pv
);

Parameters

pv [in, optional]

A pointer to the memory block to be freed. If this parameter is NULL, the function has no effect.

Return value

This function does not return a value.

Remarks

The CoTaskMemFree function uses the default OLE allocator.

The number of bytes freed equals the number of bytes that were originally allocated or reallocated. After the call, the memory block pointed to by pv is invalid and can no longer be used.

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Objbase.h

Library

Ole32.lib

DLL

Ole32.dll

See also

CoTaskMemAlloc
CoTaskMemRealloc
IMalloc::Free

 

 

Community Additions

ADD
Show:
© 2014 Microsoft