Xceed Zip for COM/ActiveX on x86/x64 Documentation
Direct DLL API / DLL API function reference / XzAlloc function
In This Topic
    XzAlloc function
    In This Topic

    Description

    Allocates memory for sending data to an instance of XceedZip or XceedCompression object. You cannot use any other memory allocation function for for this purpose.

    When you want to specify a memory buffer to compress through the ZippingMemoryFile event, you must set the pbDataToCompress parameter to a buffer allocated with XzAlloc. The instance will free the buffer when it’s done compressing it.

    When you want to call the XcCompress, XcUncompress or XcCalculateCrc functions, you must allocate the source buffer with XzAlloc, or use a buffer that was previously returned by a previous call to one of those functions. A buffer created with XzAlloc must be freed with XzFree, except when the instance frees it.

    Declaration  
    BYTE* XzAlloc( DWORD dwDataSize )

    Parameters

    Parameter Description
    dwDataSize  Number of bytes to allocate.

    Return value

    Pointer to the allocated buffer, or NULL if there was not enough memory.