Corrected a translation error in CxbxObjectAttributesToNT, native paths are now correct
This commit is contained in:
parent
788a0c645d
commit
1277ef9e50
|
@ -170,6 +170,7 @@ NTSTATUS CxbxObjectAttributesToNT(xboxkrnl::POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
|
|
||||||
// ObjectAttributes are given, so make sure the pointer we're going to pass to Windows is assigned :
|
// ObjectAttributes are given, so make sure the pointer we're going to pass to Windows is assigned :
|
||||||
nativeObjectAttributes.NtObjAttrPtr = &nativeObjectAttributes.NtObjAttr;
|
nativeObjectAttributes.NtObjAttrPtr = &nativeObjectAttributes.NtObjAttr;
|
||||||
|
|
||||||
RelativePath = std::string(ObjectAttributes->ObjectName->Buffer, ObjectAttributes->ObjectName->Length);
|
RelativePath = std::string(ObjectAttributes->ObjectName->Buffer, ObjectAttributes->ObjectName->Length);
|
||||||
OriginalPath = RelativePath;
|
OriginalPath = RelativePath;
|
||||||
|
|
||||||
|
@ -215,15 +216,23 @@ NTSTATUS CxbxObjectAttributesToNT(xboxkrnl::POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
// Fixup RelativePath path here
|
// Fixup RelativePath path here
|
||||||
if ((NtSymbolicLinkObject != NULL))
|
if ((NtSymbolicLinkObject != NULL))
|
||||||
RelativePath.erase(0, NtSymbolicLinkObject->XboxFullPath.length()); // Remove '\Device\Harddisk0\Partition2'
|
RelativePath.erase(0, NtSymbolicLinkObject->XboxFullPath.length()); // Remove '\Device\Harddisk0\Partition2'
|
||||||
|
// else TODO : Turok requests 'gamedata.dat' without a preceding path, we probably need 'CurrentDir'-functionality
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((NtSymbolicLinkObject != NULL))
|
if ((NtSymbolicLinkObject != NULL))
|
||||||
{
|
{
|
||||||
|
NativePath = NtSymbolicLinkObject->NativePath;
|
||||||
|
|
||||||
// If the remaining path starts with a '\', remove it (to prevent working in a native root) :
|
// If the remaining path starts with a '\', remove it (to prevent working in a native root) :
|
||||||
if ((RelativePath.length() > 0) && (RelativePath[0] == '\\'))
|
if ((RelativePath.length() > 0) && (RelativePath[0] == '\\'))
|
||||||
|
{
|
||||||
RelativePath.erase(0, 1);
|
RelativePath.erase(0, 1);
|
||||||
|
// And if needed, add it to the Native path instead :
|
||||||
|
if (NativePath.back() != '\\')
|
||||||
|
NativePath.append(1, '\\');
|
||||||
|
}
|
||||||
|
|
||||||
XboxFullPath = NtSymbolicLinkObject->XboxFullPath;
|
XboxFullPath = NtSymbolicLinkObject->XboxFullPath;
|
||||||
NativePath = NtSymbolicLinkObject->NativePath;
|
|
||||||
ObjectAttributes->RootDirectory = NtSymbolicLinkObject->RootDirectoryHandle;
|
ObjectAttributes->RootDirectory = NtSymbolicLinkObject->RootDirectoryHandle;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue