haze: fix directory renames on windows

This commit is contained in:
Liam 2023-04-16 15:42:20 -04:00
parent 0b5b63b9d8
commit 46e2e92371
2 changed files with 11 additions and 1 deletions

View file

@ -216,7 +216,7 @@ namespace haze {
PtpObjectPropertyCode_AllowedFolderContents = 0xdc0c,
PtpObjectPropertyCode_Hidden = 0xdc0d,
PtpObjectPropertyCode_SystemObject = 0xdc0e,
PtpObjectPropertyCode_PersistantUniqueObjectIdentifier = 0xdc41,
PtpObjectPropertyCode_PersistentUniqueObjectIdentifier = 0xdc41,
PtpObjectPropertyCode_SyncId = 0xdc42,
PtpObjectPropertyCode_PropertyBag = 0xdc43,
PtpObjectPropertyCode_Name = 0xdc44,

View file

@ -77,6 +77,7 @@ namespace haze {
PtpObjectPropertyCode_ObjectFormat,
PtpObjectPropertyCode_ObjectSize,
PtpObjectPropertyCode_ObjectFileName,
PtpObjectPropertyCode_PersistentUniqueObjectIdentifier,
};
constexpr bool IsSupportedObjectPropertyCode(PtpObjectPropertyCode c) {
@ -779,6 +780,12 @@ namespace haze {
/* Each property code corresponds to a different pattern, which contains the data type, */
/* whether the property can be set for an object, and the default value of the property. */
switch (property_code) {
case PtpObjectPropertyCode_PersistentUniqueObjectIdentifier:
{
R_TRY(db.Add(PtpDataTypeCode_U128));
R_TRY(db.Add(PtpPropertyGetSetFlag_Get));
R_TRY(db.Add<u128>(0));
}
case PtpObjectPropertyCode_ObjectSize:
{
R_TRY(db.Add(PtpDataTypeCode_U64));
@ -862,6 +869,9 @@ namespace haze {
R_TRY(db.WriteVariableLengthData(m_request_header, [&] {
switch (property_code) {
case PtpObjectPropertyCode_PersistentUniqueObjectIdentifier:
R_TRY(db.Add<u128>(object_id));
break;
case PtpObjectPropertyCode_ObjectSize:
R_TRY(db.Add<u64>(size));
break;