\r
**/\r
#define PatchPcdSetPtr(TokenName, Size, Buffer) \\r
- LibPatchPcdSetPtr ( \\r
- _gPcd_BinaryPatch_##TokenName, \\r
+ LibPatchPcdSetPtrAndSize ( \\r
+ (VOID *)_gPcd_BinaryPatch_##TokenName, \\r
+ &_gPcd_BinaryPatch_Size_##TokenName, \\r
(UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \\r
(Size), \\r
(Buffer) \\r
If SizeOfBuffer is NULL, then ASSERT().\r
If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
\r
- @param[in] PatchVariable A pointer to the global variable in a module that is \r
+ @param[out] PatchVariable A pointer to the global variable in a module that is \r
the target of the set operation.\r
@param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
@param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
VOID *\r
EFIAPI\r
LibPatchPcdSetPtr (\r
- IN VOID *PatchVariable,\r
+ OUT VOID *PatchVariable,\r
IN UINTN MaximumDatumSize,\r
IN OUT UINTN *SizeOfBuffer,\r
IN CONST VOID *Buffer\r
If SizeOfBuffer is NULL, then ASSERT().\r
If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
\r
- @param[in] PatchVariable A pointer to the global variable in a module that is\r
+ @param[out] PatchVariable A pointer to the global variable in a module that is\r
the target of the set operation.\r
@param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
@param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
RETURN_STATUS\r
EFIAPI\r
LibPatchPcdSetPtrS (\r
- IN VOID *PatchVariable,\r
+ OUT VOID *PatchVariable,\r
+ IN UINTN MaximumDatumSize,\r
+ IN OUT UINTN *SizeOfBuffer,\r
+ IN CONST VOID *Buffer\r
+ );\r
+\r
+/**\r
+ Sets a value and size of a patchable PCD entry that is type pointer.\r
+ \r
+ Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r
+ and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than \r
+ MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return \r
+ NULL to indicate that the set operation was not actually performed. \r
+ If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to \r
+ MaximumDatumSize and NULL must be returned.\r
+ \r
+ If PatchVariable is NULL, then ASSERT().\r
+ If SizeOfPatchVariable is NULL, then ASSERT().\r
+ If SizeOfBuffer is NULL, then ASSERT().\r
+ If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
+\r
+ @param[out] PatchVariable A pointer to the global variable in a module that is \r
+ the target of the set operation.\r
+ @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.\r
+ @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
+ @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
+ @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
+ \r
+ @return Return the pointer to the Buffer that was set.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+LibPatchPcdSetPtrAndSize (\r
+ OUT VOID *PatchVariable,\r
+ OUT UINTN *SizeOfPatchVariable,\r
+ IN UINTN MaximumDatumSize,\r
+ IN OUT UINTN *SizeOfBuffer,\r
+ IN CONST VOID *Buffer\r
+ );\r
+\r
+/**\r
+ Sets a value and size of a patchable PCD entry that is type pointer.\r
+\r
+ Sets the PCD entry specified by PatchVariable to the value specified\r
+ by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,\r
+ then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER\r
+ to indicate that the set operation was not actually performed.\r
+ If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to\r
+ MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.\r
+\r
+ If PatchVariable is NULL, then ASSERT().\r
+ If SizeOfPatchVariable is NULL, then ASSERT().\r
+ If SizeOfBuffer is NULL, then ASSERT().\r
+ If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
+\r
+ @param[out] PatchVariable A pointer to the global variable in a module that is\r
+ the target of the set operation.\r
+ @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.\r
+ @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
+ @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
+ @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
+ \r
+ @return The status of the set operation.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+LibPatchPcdSetPtrAndSizeS (\r
+ OUT VOID *PatchVariable,\r
+ OUT UINTN *SizeOfPatchVariable,\r
IN UINTN MaximumDatumSize,\r
IN OUT UINTN *SizeOfBuffer,\r
IN CONST VOID *Buffer\r
/** @file\r
A emptry template implementation of PCD Library.\r
\r
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
If SizeOfBuffer is NULL, then ASSERT().\r
If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
\r
- @param[in] PatchVariable A pointer to the global variable in a module that is \r
+ @param[out] PatchVariable A pointer to the global variable in a module that is \r
the target of the set operation.\r
@param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
@param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
VOID *\r
EFIAPI\r
LibPatchPcdSetPtr (\r
- IN VOID *PatchVariable,\r
+ OUT VOID *PatchVariable,\r
IN UINTN MaximumDatumSize,\r
IN OUT UINTN *SizeOfBuffer,\r
IN CONST VOID *Buffer\r
If SizeOfBuffer is NULL, then ASSERT().\r
If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
\r
- @param[in] PatchVariable A pointer to the global variable in a module that is\r
+ @param[out] PatchVariable A pointer to the global variable in a module that is\r
the target of the set operation.\r
@param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
@param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
RETURN_STATUS\r
EFIAPI\r
LibPatchPcdSetPtrS (\r
- IN VOID *PatchVariable,\r
+ OUT VOID *PatchVariable,\r
IN UINTN MaximumDatumSize,\r
IN OUT UINTN *SizeOfBuffer,\r
IN CONST VOID *Buffer\r
return RETURN_SUCCESS;\r
}\r
\r
+/**\r
+ Sets a value and size of a patchable PCD entry that is type pointer.\r
+ \r
+ Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r
+ and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than \r
+ MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return \r
+ NULL to indicate that the set operation was not actually performed. \r
+ If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to \r
+ MaximumDatumSize and NULL must be returned.\r
+ \r
+ If PatchVariable is NULL, then ASSERT().\r
+ If SizeOfPatchVariable is NULL, then ASSERT().\r
+ If SizeOfBuffer is NULL, then ASSERT().\r
+ If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
+\r
+ @param[out] PatchVariable A pointer to the global variable in a module that is \r
+ the target of the set operation.\r
+ @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.\r
+ @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
+ @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
+ @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
+ \r
+ @return Return the pointer to the buffer been set.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+LibPatchPcdSetPtrAndSize (\r
+ OUT VOID *PatchVariable,\r
+ OUT UINTN *SizeOfPatchVariable,\r
+ IN UINTN MaximumDatumSize,\r
+ IN OUT UINTN *SizeOfBuffer,\r
+ IN CONST VOID *Buffer\r
+ )\r
+{\r
+ ASSERT (PatchVariable != NULL);\r
+ ASSERT (SizeOfPatchVariable != NULL);\r
+ ASSERT (SizeOfBuffer != NULL);\r
+ \r
+ if (*SizeOfBuffer > 0) {\r
+ ASSERT (Buffer != NULL);\r
+ }\r
+\r
+ if ((*SizeOfBuffer > MaximumDatumSize) ||\r
+ (*SizeOfBuffer == MAX_ADDRESS)) {\r
+ *SizeOfBuffer = MaximumDatumSize;\r
+ return NULL;\r
+ }\r
+ \r
+ CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
+ *SizeOfPatchVariable = *SizeOfBuffer;\r
+ \r
+ return (VOID *) Buffer;\r
+}\r
+\r
+/**\r
+ Sets a value and size of a patchable PCD entry that is type pointer.\r
+\r
+ Sets the PCD entry specified by PatchVariable to the value specified\r
+ by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,\r
+ then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER\r
+ to indicate that the set operation was not actually performed.\r
+ If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to\r
+ MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.\r
+\r
+ If PatchVariable is NULL, then ASSERT().\r
+ If SizeOfPatchVariable is NULL, then ASSERT().\r
+ If SizeOfBuffer is NULL, then ASSERT().\r
+ If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
+\r
+ @param[out] PatchVariable A pointer to the global variable in a module that is\r
+ the target of the set operation.\r
+ @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.\r
+ @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
+ @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
+ @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
+ \r
+ @return The status of the set operation.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+LibPatchPcdSetPtrAndSizeS (\r
+ OUT VOID *PatchVariable,\r
+ OUT UINTN *SizeOfPatchVariable,\r
+ IN UINTN MaximumDatumSize,\r
+ IN OUT UINTN *SizeOfBuffer,\r
+ IN CONST VOID *Buffer\r
+ )\r
+{\r
+ ASSERT (PatchVariable != NULL);\r
+ ASSERT (SizeOfPatchVariable != NULL);\r
+ ASSERT (SizeOfBuffer != NULL);\r
+ \r
+ if (*SizeOfBuffer > 0) {\r
+ ASSERT (Buffer != NULL);\r
+ }\r
+\r
+ if ((*SizeOfBuffer > MaximumDatumSize) ||\r
+ (*SizeOfBuffer == MAX_ADDRESS)) {\r
+ *SizeOfBuffer = MaximumDatumSize;\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+\r
+ CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
+ *SizeOfPatchVariable = *SizeOfBuffer;\r
+\r
+ return RETURN_SUCCESS;\r
+}\r
+\r
/**\r
Retrieve additional information associated with a PCD token.\r
\r
If SizeOfBuffer is NULL, then ASSERT().\r
If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
\r
- @param[in] PatchVariable A pointer to the global variable in a module that is \r
+ @param[out] PatchVariable A pointer to the global variable in a module that is \r
the target of the set operation.\r
@param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
@param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
VOID *\r
EFIAPI\r
LibPatchPcdSetPtr (\r
- IN VOID *PatchVariable,\r
+ OUT VOID *PatchVariable,\r
IN UINTN MaximumDatumSize,\r
IN OUT UINTN *SizeOfBuffer,\r
IN CONST VOID *Buffer\r
If SizeOfBuffer is NULL, then ASSERT().\r
If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
\r
- @param[in] PatchVariable A pointer to the global variable in a module that is\r
+ @param[out] PatchVariable A pointer to the global variable in a module that is\r
the target of the set operation.\r
@param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
@param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
RETURN_STATUS\r
EFIAPI\r
LibPatchPcdSetPtrS (\r
- IN VOID *PatchVariable,\r
+ OUT VOID *PatchVariable,\r
IN UINTN MaximumDatumSize,\r
IN OUT UINTN *SizeOfBuffer,\r
IN CONST VOID *Buffer\r
return RETURN_SUCCESS;\r
}\r
\r
+\r
+/**\r
+ Sets a value and size of a patchable PCD entry that is type pointer.\r
+ \r
+ Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r
+ and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than \r
+ MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return \r
+ NULL to indicate that the set operation was not actually performed. \r
+ If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to \r
+ MaximumDatumSize and NULL must be returned.\r
+ \r
+ If PatchVariable is NULL, then ASSERT().\r
+ If SizeOfPatchVariable is NULL, then ASSERT().\r
+ If SizeOfBuffer is NULL, then ASSERT().\r
+ If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
+\r
+ @param[out] PatchVariable A pointer to the global variable in a module that is \r
+ the target of the set operation.\r
+ @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.\r
+ @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
+ @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
+ @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
+ \r
+ @return Return the pointer to the buffer been set.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+LibPatchPcdSetPtrAndSize (\r
+ OUT VOID *PatchVariable,\r
+ OUT UINTN *SizeOfPatchVariable,\r
+ IN UINTN MaximumDatumSize,\r
+ IN OUT UINTN *SizeOfBuffer,\r
+ IN CONST VOID *Buffer\r
+ )\r
+{\r
+ ASSERT (PatchVariable != NULL);\r
+ ASSERT (SizeOfPatchVariable != NULL);\r
+ ASSERT (SizeOfBuffer != NULL);\r
+ \r
+ if (*SizeOfBuffer > 0) {\r
+ ASSERT (Buffer != NULL);\r
+ }\r
+\r
+ if ((*SizeOfBuffer > MaximumDatumSize) ||\r
+ (*SizeOfBuffer == MAX_ADDRESS)) {\r
+ *SizeOfBuffer = MaximumDatumSize;\r
+ return NULL;\r
+ }\r
+ \r
+ CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
+ *SizeOfPatchVariable = *SizeOfBuffer;\r
+ \r
+ return (VOID *) Buffer;\r
+}\r
+\r
+/**\r
+ Sets a value and size of a patchable PCD entry that is type pointer.\r
+\r
+ Sets the PCD entry specified by PatchVariable to the value specified\r
+ by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,\r
+ then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER\r
+ to indicate that the set operation was not actually performed.\r
+ If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to\r
+ MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.\r
+\r
+ If PatchVariable is NULL, then ASSERT().\r
+ If SizeOfPatchVariable is NULL, then ASSERT().\r
+ If SizeOfBuffer is NULL, then ASSERT().\r
+ If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
+\r
+ @param[out] PatchVariable A pointer to the global variable in a module that is\r
+ the target of the set operation.\r
+ @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.\r
+ @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
+ @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
+ @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
+ \r
+ @return The status of the set operation.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+LibPatchPcdSetPtrAndSizeS (\r
+ OUT VOID *PatchVariable,\r
+ OUT UINTN *SizeOfPatchVariable,\r
+ IN UINTN MaximumDatumSize,\r
+ IN OUT UINTN *SizeOfBuffer,\r
+ IN CONST VOID *Buffer\r
+ )\r
+{\r
+ ASSERT (PatchVariable != NULL);\r
+ ASSERT (SizeOfPatchVariable != NULL);\r
+ ASSERT (SizeOfBuffer != NULL);\r
+ \r
+ if (*SizeOfBuffer > 0) {\r
+ ASSERT (Buffer != NULL);\r
+ }\r
+\r
+ if ((*SizeOfBuffer > MaximumDatumSize) ||\r
+ (*SizeOfBuffer == MAX_ADDRESS)) {\r
+ *SizeOfBuffer = MaximumDatumSize;\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+\r
+ CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
+ *SizeOfPatchVariable = *SizeOfBuffer;\r
+\r
+ return RETURN_SUCCESS;\r
+}\r
+\r
/**\r
Retrieve additional information associated with a PCD token.\r
\r
If SizeOfBuffer is NULL, then ASSERT().\r
If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
\r
- @param[in] PatchVariable A pointer to the global variable in a module that is \r
+ @param[out] PatchVariable A pointer to the global variable in a module that is \r
the target of the set operation.\r
@param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
@param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
VOID *\r
EFIAPI\r
LibPatchPcdSetPtr (\r
- IN VOID *PatchVariable,\r
+ OUT VOID *PatchVariable,\r
IN UINTN MaximumDatumSize,\r
IN OUT UINTN *SizeOfBuffer,\r
IN CONST VOID *Buffer\r
If SizeOfBuffer is NULL, then ASSERT().\r
If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
\r
- @param[in] PatchVariable A pointer to the global variable in a module that is\r
+ @param[out] PatchVariable A pointer to the global variable in a module that is\r
the target of the set operation.\r
@param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
@param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
RETURN_STATUS\r
EFIAPI\r
LibPatchPcdSetPtrS (\r
- IN VOID *PatchVariable,\r
+ OUT VOID *PatchVariable,\r
IN UINTN MaximumDatumSize,\r
IN OUT UINTN *SizeOfBuffer,\r
IN CONST VOID *Buffer\r
return RETURN_SUCCESS;\r
}\r
\r
+\r
+/**\r
+ Sets a value and size of a patchable PCD entry that is type pointer.\r
+ \r
+ Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r
+ and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than \r
+ MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return \r
+ NULL to indicate that the set operation was not actually performed. \r
+ If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to \r
+ MaximumDatumSize and NULL must be returned.\r
+ \r
+ If PatchVariable is NULL, then ASSERT().\r
+ If SizeOfPatchVariable is NULL, then ASSERT().\r
+ If SizeOfBuffer is NULL, then ASSERT().\r
+ If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
+\r
+ @param[out] PatchVariable A pointer to the global variable in a module that is \r
+ the target of the set operation.\r
+ @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.\r
+ @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
+ @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
+ @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
+ \r
+ @return Return the pointer to the buffer been set.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+LibPatchPcdSetPtrAndSize (\r
+ OUT VOID *PatchVariable,\r
+ OUT UINTN *SizeOfPatchVariable,\r
+ IN UINTN MaximumDatumSize,\r
+ IN OUT UINTN *SizeOfBuffer,\r
+ IN CONST VOID *Buffer\r
+ )\r
+{\r
+ ASSERT (PatchVariable != NULL);\r
+ ASSERT (SizeOfPatchVariable != NULL);\r
+ ASSERT (SizeOfBuffer != NULL);\r
+ \r
+ if (*SizeOfBuffer > 0) {\r
+ ASSERT (Buffer != NULL);\r
+ }\r
+\r
+ if ((*SizeOfBuffer > MaximumDatumSize) ||\r
+ (*SizeOfBuffer == MAX_ADDRESS)) {\r
+ *SizeOfBuffer = MaximumDatumSize;\r
+ return NULL;\r
+ }\r
+ \r
+ CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
+ *SizeOfPatchVariable = *SizeOfBuffer;\r
+ \r
+ return (VOID *) Buffer;\r
+}\r
+\r
+/**\r
+ Sets a value and size of a patchable PCD entry that is type pointer.\r
+\r
+ Sets the PCD entry specified by PatchVariable to the value specified\r
+ by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,\r
+ then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER\r
+ to indicate that the set operation was not actually performed.\r
+ If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to\r
+ MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.\r
+\r
+ If PatchVariable is NULL, then ASSERT().\r
+ If SizeOfPatchVariable is NULL, then ASSERT().\r
+ If SizeOfBuffer is NULL, then ASSERT().\r
+ If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
+\r
+ @param[out] PatchVariable A pointer to the global variable in a module that is\r
+ the target of the set operation.\r
+ @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.\r
+ @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
+ @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
+ @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
+ \r
+ @return The status of the set operation.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+LibPatchPcdSetPtrAndSizeS (\r
+ OUT VOID *PatchVariable,\r
+ OUT UINTN *SizeOfPatchVariable,\r
+ IN UINTN MaximumDatumSize,\r
+ IN OUT UINTN *SizeOfBuffer,\r
+ IN CONST VOID *Buffer\r
+ )\r
+{\r
+ ASSERT (PatchVariable != NULL);\r
+ ASSERT (SizeOfPatchVariable != NULL);\r
+ ASSERT (SizeOfBuffer != NULL);\r
+ \r
+ if (*SizeOfBuffer > 0) {\r
+ ASSERT (Buffer != NULL);\r
+ }\r
+\r
+ if ((*SizeOfBuffer > MaximumDatumSize) ||\r
+ (*SizeOfBuffer == MAX_ADDRESS)) {\r
+ *SizeOfBuffer = MaximumDatumSize;\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+\r
+ CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
+ *SizeOfPatchVariable = *SizeOfBuffer;\r
+\r
+ return RETURN_SUCCESS;\r
+}\r
+\r
/**\r
Retrieve additional information associated with a PCD token.\r
\r