mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Updated ResourceLoader to possibly deal with SSO.
This commit is contained in:
parent
83cad76b62
commit
fa6516ac5d
2 changed files with 20 additions and 2 deletions
|
|
@ -201,7 +201,7 @@ namespace Penumbra.Interop
|
|||
return ReadSqpackHook?.OriginalFunction( pFileHandler, pFileDesc, priority, isSync ) ?? 0;
|
||||
}
|
||||
|
||||
var gameFsPath = Marshal.PtrToStringAnsi( new IntPtr( pFileDesc->ResourceHandle->FileName ) );
|
||||
var gameFsPath = Marshal.PtrToStringAnsi( new IntPtr( pFileDesc->ResourceHandle->FileName() ) );
|
||||
|
||||
var isRooted = Path.IsPathRooted( gameFsPath );
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,25 @@ namespace Penumbra.Structs
|
|||
[StructLayout( LayoutKind.Explicit )]
|
||||
public unsafe struct ResourceHandle
|
||||
{
|
||||
public const int SsoSize = 15;
|
||||
|
||||
public byte* FileName()
|
||||
{
|
||||
if( FileNameLength > SsoSize )
|
||||
{
|
||||
return _fileName;
|
||||
}
|
||||
|
||||
fixed( byte** name = &_fileName )
|
||||
{
|
||||
return ( byte* )name;
|
||||
}
|
||||
}
|
||||
|
||||
[FieldOffset( 0x48 )]
|
||||
public byte* FileName;
|
||||
private byte* _fileName;
|
||||
|
||||
[FieldOffset( 0x58 )]
|
||||
public int FileNameLength;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue