+/**\r
+ Used to retrieve the list of available PCD token space GUIDs.\r
+ \r
+ Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces\r
+ in the platform.\r
+ If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.\r
+ If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.\r
+ \r
+ @param TokenSpaceGuid The pointer to the a PCD token space GUID.\r
+\r
+ @return The next valid token namespace.\r
+\r
+**/\r
+GUID *\r
+EFIAPI\r
+LibPcdGetNextTokenSpace (\r
+ IN CONST GUID *TokenSpaceGuid\r
+ )\r
+{\r
+ GetPiPcdProtocol()->GetNextTokenSpace (&TokenSpaceGuid);\r
+\r
+ return (GUID *)TokenSpaceGuid;\r
+}\r
+\r
+\r
+/**\r
+ Sets a value 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 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
+ 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
+ @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
+LibPatchPcdSetPtr (\r
+ IN VOID *PatchVariable,\r
+ IN UINTN MaximumDatumSize,\r
+ IN OUT UINTN *SizeOfBuffer,\r
+ IN CONST VOID *Buffer\r
+ )\r
+{\r
+ ASSERT (PatchVariable != 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
+ \r
+ return (VOID *) Buffer;\r