mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
This should probably check for the ResourceHandle instead of the FileDescriptor if it crashed when trying to read the string in that, no?
This commit is contained in:
parent
ae62f0666d
commit
e41dedf9dd
1 changed files with 2 additions and 2 deletions
|
|
@ -196,7 +196,7 @@ 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 )
|
if( ReadFile == null || pFileDesc == null || pFileDesc->ResourceHandle == null )
|
||||||
{
|
{
|
||||||
return ReadSqpackHook?.OriginalFunction( pFileHandler, pFileDesc, priority, isSync ) ?? 0;
|
return ReadSqpackHook?.OriginalFunction( pFileHandler, pFileDesc, priority, isSync ) ?? 0;
|
||||||
}
|
}
|
||||||
|
|
@ -205,7 +205,7 @@ namespace Penumbra.Interop
|
||||||
|
|
||||||
var isRooted = Path.IsPathRooted( gameFsPath );
|
var isRooted = Path.IsPathRooted( gameFsPath );
|
||||||
|
|
||||||
if( gameFsPath == null || gameFsPath.Length >= 260 || !isRooted || ReadFile == null )
|
if( gameFsPath == null || gameFsPath.Length >= 260 || !isRooted )
|
||||||
{
|
{
|
||||||
return ReadSqpackHook?.OriginalFunction( pFileHandler, pFileDesc, priority, isSync ) ?? 0;
|
return ReadSqpackHook?.OriginalFunction( pFileHandler, pFileDesc, priority, isSync ) ?? 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue