Platform SDK: Fax Services

Allocating Memory

All fax service providers must use a private heap for memory allocations. The fax service creates a private heap for each fax service provider when it loads the fax service provider's DLL, and it passes the heap handle on a call to the FaxDevInitialize function. The fax service deallocates the heap when it unloads the DLL.

The fax service provider should wrap all memory allocations and deallocations inside the DLL with private functions. The private functions should call the HeapAlloc and HeapFree functions with the heap handle passed to FaxDevInitialize.

This method achieves a robust server with the extensibility of the service provider model, and it isolates memory problems specific to the fax service provider. For more information about allocating memory, see Operating in a Multithreaded Environment.