/* Populates the given context buffer so it can be passed to a PRM handler. */
EFI_STATUS PopulateContextBuffer(IN PRM_DATA_BUFFER *StaticDataBuffer OPTIONAL, IN EFI_GUID *HandlerGuid, IN PRM_CONTEXT_BUFFER *ContextBuffer)
/* Populates the given context buffer so it can be passed to a PRM handler. */
EFI_STATUS PopulateContextBuffer(IN PRM_DATA_BUFFER *StaticDataBuffer OPTIONAL, IN EFI_GUID *HandlerGuid, IN PRM_CONTEXT_BUFFER *ContextBuffer)
{
  if ((HandlerGuid == NULL) || (ContextBuffer == NULL)) {
    return EFI_INVALID_PARAMETER;
  }
  ZeroMem (ContextBuffer, sizeof (*ContextBuffer));
  ContextBuffer->Signature = PRM_CONTEXT_BUFFER_SIGNATURE;
  ContextBuffer->Version   = PRM_CONTEXT_BUFFER_INTERFACE_VERSION;
  CopyGuid (&ContextBuffer->HandlerGuid, HandlerGuid);
  if (StaticDataBuffer != NULL) {
    ContextBuffer->StaticDataBuffer = StaticDataBuffer;
  }
  return EFI_SUCCESS;
}