in ProjectedFSLib.Managed.API/VirtualizationInstance.cpp [853:910]
HResult VirtualizationInstance::WritePlaceholderInfo2(
String^ relativePath,
DateTime creationTime,
DateTime lastAccessTime,
DateTime lastWriteTime,
DateTime changeTime,
FileAttributes fileAttributes,
long long endOfFile,
bool isDirectory,
String^ symlinkTargetOrNull,
array<Byte>^ contentId,
array<Byte>^ providerId)
{
// This API is supported in Windows 10 version 2004 and above.
if (m_apiHelper->SupportedApi < ApiLevel::v2004)
{
throw gcnew NotImplementedException("PrjWritePlaceholderInfo2 is not supported in this version of Windows.");
}
if (relativePath == nullptr)
{
return HResult::InvalidArg;
}
std::shared_ptr<PRJ_PLACEHOLDER_INFO> placeholderInfo = CreatePlaceholderInfo(creationTime,
lastAccessTime,
lastWriteTime,
changeTime,
fileAttributes,
isDirectory ? 0 : endOfFile,
isDirectory,
contentId,
providerId);
pin_ptr<const WCHAR> path = PtrToStringChars(relativePath);
if (symlinkTargetOrNull != nullptr)
{
PRJ_EXTENDED_INFO extendedInfo = {};
extendedInfo.InfoType = PRJ_EXT_INFO_TYPE_SYMLINK;
pin_ptr<const WCHAR> targetPath = PtrToStringChars(symlinkTargetOrNull);
extendedInfo.Symlink.TargetName = targetPath;
return static_cast<HResult>(m_apiHelper->_PrjWritePlaceholderInfo2(m_virtualizationContext,
path,
placeholderInfo.get(),
sizeof(PRJ_PLACEHOLDER_INFO),
&extendedInfo));
}
else
{
return static_cast<HResult>(m_apiHelper->_PrjWritePlaceholderInfo(m_virtualizationContext,
path,
placeholderInfo.get(),
sizeof(PRJ_PLACEHOLDER_INFO)));
}
}