Platform SDK: DirectX

IDirectMusicPerformance::AllocPMsg

The IDirectMusicPerformance::AllocPMsg method allocates a performance message.

HRESULT AllocPMsg(
  ULONG cb,
  DMUS_PMSG** ppPMSG
);

Parameters

cb
Size of the message structure. For the various types, see Messages.
ppPMSG
Address of a variable to receive the pointer to the allocated message structure.

Return Values

If the method succeeds, the return value is S_OK.

If it fails, the method can return one of the following error values:

E_INVALIDARG
E_OUTOFMEMORY
E_POINTER

Remarks

The memory returned is not initialized to any particular state, with the exception of the pTool member of the DMUS_PMSG structure, which is initialized to 0, and the dwSize member, which is set to the value of cb.

Once the message is sent by IDirectMusicPerformance::SendPMsg, the application no longer owns the memory and is not responsible for freeing the message. However, a tool can free a message within its IDirectMusicTool::Flush or its IDirectMusicTool::ProcessPMsg method. Applications are also responsible for freeing notification messages.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dmusici.h.

See Also

IDirectMusicPerformance::FreePMsg, IDirectMusicPerformance::SendPMsg, DirectMusic Messages