コード例 #1
0
        private unsafe void *CallOriginalHandler(
            bool isSync,
            IntPtr pFileManager,
            uint *pCategoryId,
            char *pResourceType,
            uint *pResourceHash,
            char *pPath,
            void *pUnknown,
            bool isUnknown
            )
        {
            if (isSync)
            {
                if (GetResourceSyncHook == null)
                {
                    PluginLog.Error("[GetResourceHandler] GetResourceSync is null.");
                    return(null);
                }

                return(GetResourceSyncHook.OriginalFunction(pFileManager, pCategoryId, pResourceType, pResourceHash, pPath, pUnknown));
            }

            if (GetResourceAsyncHook == null)
            {
                PluginLog.Error("[GetResourceHandler] GetResourceAsync is null.");
                return(null);
            }

            return(GetResourceAsyncHook.OriginalFunction(pFileManager, pCategoryId, pResourceType, pResourceHash, pPath, pUnknown, isUnknown));
        }
コード例 #2
0
ファイル: ResourceLoader.cs プロジェクト: goaaats/Penumbra
 private unsafe void *CallOriginalHandler(
     bool isSync,
     IntPtr pFileManager,
     uint *pCategoryId,
     char *pResourceType,
     uint *pResourceHash,
     char *pPath,
     void *pUnknown,
     bool isUnknown
     ) => isSync
     ? GetResourceSyncHook.OriginalFunction(pFileManager, pCategoryId, pResourceType, pResourceHash, pPath, pUnknown)
     : GetResourceAsyncHook.OriginalFunction(pFileManager, pCategoryId, pResourceType, pResourceHash, pPath, pUnknown, isUnknown);