potential (read: i didn't test) fix for #36

This commit is contained in:
Adam 2021-07-11 13:05:28 +10:00
parent 9decf26ab6
commit ae62f0666d

View file

@ -196,6 +196,11 @@ namespace Penumbra.Interop
private unsafe byte ReadSqpackHandler( IntPtr pFileHandler, SeFileDescriptor* pFileDesc, int priority, bool isSync ) private unsafe byte ReadSqpackHandler( IntPtr pFileHandler, SeFileDescriptor* pFileDesc, int priority, bool isSync )
{ {
if( ( IntPtr )pFileDesc == IntPtr.Zero || ( IntPtr )pFileDesc->FileDescriptor == IntPtr.Zero )
{
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 ); var isRooted = Path.IsPathRooted( gameFsPath );