API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

ISHELL_LOADRESDATAEX()

Brew Release
Brew MP 1.0.2
See Also
Description
This function attempts to load the resource specified by type and ID from the specified resource context. The function either allocates memory or loads into a pre-allocated buffer. If the function allocates memory, it must be freed with ISHELL_FreeResData() after it is no longer needed.
Params
pIShell
[]:
Pointer to the IShell object.
pszResFile
[]:
Resource file containing the data.
nResID
[]:
ID of the data in the resource file.
nType
[]:
The type of
pBuf
[]:
Buffer into which to load the resource data. If pBuf is NULL, a buffer is allocated to hold the loaded resource, and must be freed with ISHELL_FreeResData(). If pBuf is -1, no buffer is allocated, but size information is calculated and returned in pnBufSize.
pnBufSize
[]:
Cannot be NULL. [in] : if pBuf is not NULL or -1. INPUT points to the sizeof(pBuf) in bytes. If pBuf is NULL or -1, pnBufSize is ignored on INPUT. [out] : Contains the size of the resource data read. If pBuf was not NULL on INPUT and *pnBufSize was too small to hold the resource, the function returns NULL. If pBuf was -1, pnBufSize is filled with the actual resource size, and the function returns -1 (0xffffffff).
Interface
  • ISHELL
Prototype
  •     void *ISHELL_LoadResDataEx
        (
        IShell * pIShell,
        const char * pszResFile,
        uint16 nResID,
        ResType nType,
        void * pBuf,
        uint32 * pnBufSize
        );
    
Return
  • Void pointer to the resource data, if successful. NULL if loading the resource fails or if the buffer size is too small to hold the resource.
Side Effect
  • None
Comments
This function loads the *raw* contents of the resource. Any parsing or interpretation of the data is up to the application to perform. If loading a string resource, the contents of pBuf (and the returned void *) is the bytes of the string without NULL termination. If loading an image resource, the contents of pBuf is an AEEResBlob structure, whose raw data lies at RESBLOB_DATA(pBuf).