├── xiaomi_Thunder_Cloud ├── version.data ├── README.md ├── download │ ├── id.dat │ ├── atl71.dll │ ├── zlib1.dll │ ├── minizip.dll │ ├── msvcp71.dll │ ├── msvcr71.dll │ ├── dl_peer_id.dll │ ├── XLBugHandler.dll │ ├── XLBugReport.exe │ ├── download_engine.dll │ └── MiniThunderPlatform.exe ├── xldl.h ├── xldl.dll ├── xldl.idb ├── changelog.txt ├── download-complete.wav └── LICENSE ├── 0.CurUseCommonLib ├── CurrentUseLib │ ├── version.data │ ├── download │ │ ├── dc.ini │ │ ├── id.dat │ │ ├── atl71.dll │ │ ├── minizip.dll │ │ ├── msvcp71.dll │ │ ├── msvcr71.dll │ │ ├── zlib1.dll │ │ ├── XLBugHandler.dll │ │ ├── XLBugReport.exe │ │ ├── dl_peer_id.dll │ │ ├── mini_unzip_dll.dll │ │ ├── download_engine.dll │ │ └── MiniThunderPlatform.exe │ ├── xldl.h │ ├── xldl.dll │ └── download-complete.wav ├── xldl.h ├── DownWrapper.h └── DownWrapper.cpp ├── 360Jisu_Thunder_Cloud ├── download │ ├── dc.ini │ ├── id.dat │ ├── atl71.dll │ ├── minizip.dll │ ├── msvcp71.dll │ ├── msvcr71.dll │ ├── zlib1.dll │ ├── XLBugHandler.dll │ ├── XLBugReport.exe │ ├── dl_peer_id.dll │ ├── mini_unzip_dll.dll │ ├── download_engine.dll │ └── MiniThunderPlatform.exe └── 360dl.dll ├── liebao_Thunder_Cloud ├── download │ ├── id.dat │ ├── atl71.dll │ ├── zlib1.dll │ ├── minizip.dll │ ├── msvcp71.dll │ ├── msvcr71.dll │ ├── dl_peer_id.dll │ ├── XLBugHandler.dll │ ├── XLBugReport.exe │ ├── download_engine.dll │ └── MiniThunderPlatform.exe ├── xldl.dll └── thunderWrapper.h ├── .gitattributes ├── XunleiDownload_Old ├── XLError.h ├── zlib1.dll ├── XLDownload.dll ├── XLDownload.lib └── XLDownload.h ├── LICENSE └── README.MD /xiaomi_Thunder_Cloud/version.data: -------------------------------------------------------------------------------- 1 | 1.2.141023.7z -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/version.data: -------------------------------------------------------------------------------- 1 | 1.2.141023.7z -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/download/dc.ini: -------------------------------------------------------------------------------- 1 | [op] 2 | ps=1 3 | pp=1 -------------------------------------------------------------------------------- /liebao_Thunder_Cloud/download/id.dat: -------------------------------------------------------------------------------- 1 | [partner] 2 | id=80000054 -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download/dc.ini: -------------------------------------------------------------------------------- 1 | [op] 2 | ps=1 3 | pp=1 -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/README.md: -------------------------------------------------------------------------------- 1 | # ThunderOpenSDK 2 | ThunderOpenSDK 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/download/id.dat: -------------------------------------------------------------------------------- 1 | [partner] 2 | id = 80000043 3 | ver = 3.2.1.46 4 | 5 | -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/download/id.dat: -------------------------------------------------------------------------------- 1 | [partner] 2 | id = 80000054 3 | ver = 3.2.1.48 4 | 5 | -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download/id.dat: -------------------------------------------------------------------------------- 1 | [partner] 2 | id = 80000043 3 | ver = 3.2.1.46 4 | 5 | -------------------------------------------------------------------------------- /0.CurUseCommonLib/xldl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/xldl.h -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/xldl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/xldl.h -------------------------------------------------------------------------------- /XunleiDownload_Old/XLError.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/XunleiDownload_Old/XLError.h -------------------------------------------------------------------------------- /XunleiDownload_Old/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/XunleiDownload_Old/zlib1.dll -------------------------------------------------------------------------------- /liebao_Thunder_Cloud/xldl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/liebao_Thunder_Cloud/xldl.dll -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/xldl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/xldl.dll -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/xldl.idb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/xldl.idb -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/360dl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/360Jisu_Thunder_Cloud/360dl.dll -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/changelog.txt: -------------------------------------------------------------------------------- 1 | 2014-05-15 2 | 更新日志: 3 | 1.调整原始资源废弃策略 4 | 2.增加对raw deflate压缩格式的支持 5 | 3.增加浏览器模式 6 | 7 | -------------------------------------------------------------------------------- /XunleiDownload_Old/XLDownload.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/XunleiDownload_Old/XLDownload.dll -------------------------------------------------------------------------------- /XunleiDownload_Old/XLDownload.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/XunleiDownload_Old/XLDownload.lib -------------------------------------------------------------------------------- /liebao_Thunder_Cloud/thunderWrapper.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/liebao_Thunder_Cloud/thunderWrapper.h -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/xldl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/xldl.h -------------------------------------------------------------------------------- /liebao_Thunder_Cloud/download/atl71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/liebao_Thunder_Cloud/download/atl71.dll -------------------------------------------------------------------------------- /liebao_Thunder_Cloud/download/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/liebao_Thunder_Cloud/download/zlib1.dll -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/download/atl71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/download/atl71.dll -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/download/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/download/zlib1.dll -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/xldl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/xldl.dll -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/download/atl71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/360Jisu_Thunder_Cloud/download/atl71.dll -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/download/minizip.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/360Jisu_Thunder_Cloud/download/minizip.dll -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/download/msvcp71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/360Jisu_Thunder_Cloud/download/msvcp71.dll -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/download/msvcr71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/360Jisu_Thunder_Cloud/download/msvcr71.dll -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/download/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/360Jisu_Thunder_Cloud/download/zlib1.dll -------------------------------------------------------------------------------- /liebao_Thunder_Cloud/download/minizip.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/liebao_Thunder_Cloud/download/minizip.dll -------------------------------------------------------------------------------- /liebao_Thunder_Cloud/download/msvcp71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/liebao_Thunder_Cloud/download/msvcp71.dll -------------------------------------------------------------------------------- /liebao_Thunder_Cloud/download/msvcr71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/liebao_Thunder_Cloud/download/msvcr71.dll -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/download-complete.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/download-complete.wav -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/download/minizip.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/download/minizip.dll -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/download/msvcp71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/download/msvcp71.dll -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/download/msvcr71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/download/msvcr71.dll -------------------------------------------------------------------------------- /liebao_Thunder_Cloud/download/dl_peer_id.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/liebao_Thunder_Cloud/download/dl_peer_id.dll -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/download/dl_peer_id.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/download/dl_peer_id.dll -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/download/XLBugHandler.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/360Jisu_Thunder_Cloud/download/XLBugHandler.dll -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/download/XLBugReport.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/360Jisu_Thunder_Cloud/download/XLBugReport.exe -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/download/dl_peer_id.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/360Jisu_Thunder_Cloud/download/dl_peer_id.dll -------------------------------------------------------------------------------- /liebao_Thunder_Cloud/download/XLBugHandler.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/liebao_Thunder_Cloud/download/XLBugHandler.dll -------------------------------------------------------------------------------- /liebao_Thunder_Cloud/download/XLBugReport.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/liebao_Thunder_Cloud/download/XLBugReport.exe -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/download/XLBugHandler.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/download/XLBugHandler.dll -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/download/XLBugReport.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/download/XLBugReport.exe -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/download/mini_unzip_dll.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/360Jisu_Thunder_Cloud/download/mini_unzip_dll.dll -------------------------------------------------------------------------------- /liebao_Thunder_Cloud/download/download_engine.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/liebao_Thunder_Cloud/download/download_engine.dll -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/download/download_engine.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/download/download_engine.dll -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download/atl71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/download/atl71.dll -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download/minizip.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/download/minizip.dll -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download/msvcp71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/download/msvcp71.dll -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download/msvcr71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/download/msvcr71.dll -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/download/zlib1.dll -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/download/download_engine.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/360Jisu_Thunder_Cloud/download/download_engine.dll -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download-complete.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/download-complete.wav -------------------------------------------------------------------------------- /360Jisu_Thunder_Cloud/download/MiniThunderPlatform.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/360Jisu_Thunder_Cloud/download/MiniThunderPlatform.exe -------------------------------------------------------------------------------- /liebao_Thunder_Cloud/download/MiniThunderPlatform.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/liebao_Thunder_Cloud/download/MiniThunderPlatform.exe -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/download/MiniThunderPlatform.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/xiaomi_Thunder_Cloud/download/MiniThunderPlatform.exe -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download/XLBugHandler.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/download/XLBugHandler.dll -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download/XLBugReport.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/download/XLBugReport.exe -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download/dl_peer_id.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/download/dl_peer_id.dll -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download/mini_unzip_dll.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/download/mini_unzip_dll.dll -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download/download_engine.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/download/download_engine.dll -------------------------------------------------------------------------------- /0.CurUseCommonLib/CurrentUseLib/download/MiniThunderPlatform.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cryzlasm/ThunderOpenSDK/HEAD/0.CurUseCommonLib/CurrentUseLib/download/MiniThunderPlatform.exe -------------------------------------------------------------------------------- /xiaomi_Thunder_Cloud/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Himmelt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /XunleiDownload_Old/XLDownload.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | ------------------导出函数-------------- 5 | */ 6 | #include 7 | 8 | BOOL __stdcall XLInitDownloadEngine(); 9 | 10 | DWORD __stdcall XLURLDownloadToFile(LPCTSTR pszFileName, LPCTSTR pszUrl, LPCTSTR pszRefUrl, LONG & lTaskId); 11 | 12 | DWORD __stdcall XLQueryTaskInfo(LONG lTaskId, LONG *plStatus, ULONGLONG *pullFileSize, ULONGLONG *pullRecvSize); 13 | 14 | DWORD __stdcall XLPauseTask(LONG lTaskId, LONG & lNewTaskId); 15 | 16 | DWORD __stdcall XLContinueTask(LONG lTaskId); 17 | 18 | DWORD __stdcall XLContinueTaskFromTdFile(LPCTSTR pszTdFileFullPath, LONG & lTaskId); 19 | 20 | VOID __stdcall XLStopTask(LONG lTaskId); 21 | 22 | BOOL __stdcall XLUninitDownloadEngine(); 23 | 24 | DWORD __stdcall XLGetErrorMsg(DWORD dwErrorId, LPTSTR pszBuffer, DWORD & dwSize); 25 | 26 | 27 | /* 28 | ----------------------类型定义----------------- 29 | */ 30 | enum enumTaskStatus{ 31 | enumTaskStatus_Connect = 0, // 已经建立连接 32 | enumTaskStatus_Download = 2, // 开始下载 33 | enumTaskStatus_Pause = 10, // 暂停 34 | enumTaskStatus_Success = 11, // 成功下载 35 | enumTaskStatus_Fail = 12, // 下载失败 36 | }; -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2018, cryzlasm 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /0.CurUseCommonLib/DownWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "./xldl.h" 3 | 4 | #define DEF_DETOUR_FUNC( func, returntype, ...) typedef returntype ( * fn_##func )(##__VA_ARGS__); fn_##func m_##func; 5 | 6 | #define CHECKFUNC(f, ret) if (f == NULL) return ret; 7 | #define CHECKFUNC_(f) if (f == NULL) return; 8 | namespace DownEngine 9 | { 10 | class CDownWrapper 11 | { 12 | public: 13 | CDownWrapper(LPCWSTR sPath); 14 | virtual ~CDownWrapper(); 15 | BOOL InitEngine() 16 | { 17 | CHECKFUNC(m_Init, FALSE); return m_Init(); 18 | } 19 | BOOL UnEngine() 20 | { 21 | CHECKFUNC(m_UnInit, FALSE); return m_UnInit(); 22 | } 23 | HANDLE TaskCreate(DownTaskParam ¶m); 24 | BOOL TaskDelete(HANDLE hTask); 25 | BOOL TaskStart(HANDLE hTask); 26 | BOOL TaskStop(HANDLE hTask); 27 | BOOL TaskForceStop(HANDLE hTask); 28 | BOOL TaskQueryInfo(HANDLE hTask, DownTaskInfo & stTaskInfo); 29 | BOOL TaskQueryInfoEx(HANDLE hTask, DownTaskInfo & stTaskInfo); 30 | BOOL DelTempFile(DownTaskParam &stParam); 31 | void SetSpeedLimit(INT32 nBps); 32 | void SetUploadSpeedLimit(INT32 nTcpBps, INT32 nOtherBps); 33 | BOOL SetProxy(DOWN_PROXY_INFO &stProxyInfo); 34 | void SetUserAgent(const wchar_t *pszUserAgent); 35 | BOOL ParseThunderPrivateUrl(const wchar_t *pszThunderUrl, wchar_t *normalUrlBuffer, INT32 bufferLen); 36 | BOOL GetFileSizeWithUrl(const wchar_t * lpURL, INT64& iFileSize); 37 | BOOL SetFileIdAndSize(HANDLE hTask, char szFileId[40], unsigned __int64 nFileSize); 38 | BOOL SetAdditionInfo(HANDLE task_id, WSAPROTOCOL_INFOW *sock_info, CHAR *http_resp_buf, LONG buf_len); 39 | HANDLE CreateTaskByURL(const wchar_t *url, const wchar_t *path, const wchar_t *fileName, BOOL IsResume); 40 | LONG CreateTaskByThunder(wchar_t *pszUrl, wchar_t *pszFileName, wchar_t *pszReferUrl, wchar_t *pszCharSet, wchar_t *pszCookie); 41 | LONG CreateBTTaskByThunder(const wchar_t *pszPath); 42 | DownTaskParam CreateDownTaskParam(const wchar_t TaskUrl[], const wchar_t Filename[], const wchar_t SavePath[], BOOL IsResume = TRUE, BOOL IsOnlyOriginal = FALSE, BOOL DisableAutoRename = FALSE); 43 | private: 44 | HMODULE m_hModule; 45 | DEF_DETOUR_FUNC(Init, BOOL, void); 46 | DEF_DETOUR_FUNC(UnInit, BOOL, void); 47 | DEF_DETOUR_FUNC(TaskCreate, HANDLE, DownTaskParam &stParam); 48 | DEF_DETOUR_FUNC(TaskDelete, BOOL, HANDLE hTask); 49 | DEF_DETOUR_FUNC(TaskStart, BOOL, HANDLE hTask); 50 | DEF_DETOUR_FUNC(TaskStop, BOOL, HANDLE hTask); 51 | DEF_DETOUR_FUNC(ForceStopTask, BOOL, HANDLE hTask); 52 | DEF_DETOUR_FUNC(QueryTaskInfo, BOOL, HANDLE hTask, DownTaskInfo & stTaskInfo); 53 | DEF_DETOUR_FUNC(QueryTaskInfoEx, BOOL, HANDLE hTask, DownTaskInfo & stTaskInfo); 54 | DEF_DETOUR_FUNC(DelTempFile, BOOL, DownTaskParam &stParam); 55 | DEF_DETOUR_FUNC(SetSpeedLimit, void, INT32 nKBps); 56 | DEF_DETOUR_FUNC(SetUploadSpeedLimit, void, INT32 nTcpKBps, INT32 nOtherKBps); 57 | DEF_DETOUR_FUNC(SetProxy, BOOL, DOWN_PROXY_INFO &stProxyInfo); 58 | DEF_DETOUR_FUNC(SetUserAgent, void, const wchar_t *pszUserAgent); 59 | DEF_DETOUR_FUNC(ParseThunderPrivateUrl, BOOL, const wchar_t *pszThunderUrl, wchar_t *normalUrlBuffer, INT32 bufferLen); 60 | DEF_DETOUR_FUNC(GetFileSizeWithUrl, BOOL, const wchar_t * lpURL, INT64& iFileSize); 61 | DEF_DETOUR_FUNC(SetFileIdAndSize, BOOL, HANDLE hTask, char szFileId[40], unsigned __int64 nFileSize); 62 | DEF_DETOUR_FUNC(SetAdditionInfo, BOOL, HANDLE task_id, WSAPROTOCOL_INFOW *sock_info, CHAR *http_resp_buf, LONG buf_len); 63 | DEF_DETOUR_FUNC(CreateTaskByURL, HANDLE, const wchar_t *url, const wchar_t *path, const wchar_t *fileName, BOOL IsResume); 64 | DEF_DETOUR_FUNC(CreateTaskByThunder, LONG, wchar_t *pszUrl, wchar_t *pszFileName, wchar_t *pszReferUrl, wchar_t *pszCharSet, wchar_t *pszCookie); 65 | DEF_DETOUR_FUNC(CreateBTTaskByThunder, LONG, const wchar_t *pszPath); 66 | }; 67 | }; -------------------------------------------------------------------------------- /0.CurUseCommonLib/DownWrapper.cpp: -------------------------------------------------------------------------------- 1 | #include "DownWrapper.h" 2 | 3 | namespace DownEngine 4 | { 5 | 6 | CDownWrapper::CDownWrapper(LPCWSTR sPath) 7 | { 8 | m_hModule = LoadLibraryW(sPath); 9 | if (m_hModule == NULL) 10 | { 11 | throw L"can not load xldl.dll"; 12 | } 13 | WCHAR szModulePath[MAX_PATH] = { 0 }; 14 | GetModuleFileNameW(NULL, szModulePath, MAX_PATH); 15 | PathRemoveFileSpecW(szModulePath); // 拆分路径 新版使用PathCchRemoveFileSpec 16 | 17 | WCHAR szDllpath[MAX_PATH] = { 0 }; 18 | PathCombineW(szDllpath, szModulePath, L"xldl.dll"); // 连接路径, 新版建议使用 PathCchCombine 19 | m_Init = (fn_Init) GetProcAddress(m_hModule, "XL_Init"); 20 | m_UnInit = (fn_UnInit) GetProcAddress(m_hModule, "XL_UnInit"); 21 | m_TaskCreate = (fn_TaskCreate) GetProcAddress(m_hModule, "XL_CreateTask"); 22 | m_TaskDelete = (fn_TaskDelete) GetProcAddress(m_hModule, "XL_DeleteTask"); 23 | m_TaskStart = (fn_TaskStart) GetProcAddress(m_hModule, "XL_StartTask"); 24 | m_TaskStop = (fn_TaskStop) GetProcAddress(m_hModule, "XL_StopTask"); 25 | m_ForceStopTask = (fn_ForceStopTask) GetProcAddress(m_hModule, "XL_ForceStopTask"); 26 | m_QueryTaskInfo = (fn_QueryTaskInfo) GetProcAddress(m_hModule, "XL_QueryTaskInfo"); 27 | m_QueryTaskInfoEx = (fn_QueryTaskInfoEx) GetProcAddress(m_hModule, "XL_QueryTaskInfoEx"); 28 | m_DelTempFile = (fn_DelTempFile) GetProcAddress(m_hModule, "XL_DelTempFile"); 29 | m_SetSpeedLimit = (fn_SetSpeedLimit) GetProcAddress(m_hModule, "XL_SetSpeedLimit"); 30 | m_SetUploadSpeedLimit = (fn_SetUploadSpeedLimit) GetProcAddress(m_hModule, "XL_SetUploadSpeedLimit"); 31 | m_SetProxy = (fn_SetProxy) GetProcAddress(m_hModule, "XL_SetProxy"); 32 | m_SetUserAgent = (fn_SetUserAgent) GetProcAddress(m_hModule, "XL_SetUserAgent"); 33 | m_ParseThunderPrivateUrl = (fn_ParseThunderPrivateUrl) GetProcAddress(m_hModule, "XL_ParseThunderPrivateUrl"); 34 | m_GetFileSizeWithUrl = (fn_GetFileSizeWithUrl) GetProcAddress(m_hModule, "XL_GetFileSizeWithUrl"); 35 | m_SetFileIdAndSize = (fn_SetFileIdAndSize) GetProcAddress(m_hModule, "XL_SetFileIdAndSize"); 36 | m_SetAdditionInfo = (fn_SetAdditionInfo) GetProcAddress(m_hModule, "XL_SetAdditionInfo"); 37 | m_CreateTaskByURL = (fn_CreateTaskByURL) GetProcAddress(m_hModule, "XL_CreateTaskByURL"); 38 | m_CreateTaskByThunder = (fn_CreateTaskByThunder) GetProcAddress(m_hModule, "XL_CreateTaskByThunder"); 39 | m_CreateBTTaskByThunder = (fn_CreateBTTaskByThunder) GetProcAddress(m_hModule, "XL_CreateBTTaskByThunder"); 40 | } 41 | 42 | CDownWrapper::~CDownWrapper() 43 | { 44 | if (m_hModule) 45 | { 46 | FreeLibrary(m_hModule); 47 | } 48 | } 49 | 50 | HANDLE CDownWrapper::TaskCreate(DownTaskParam ¶m) 51 | { 52 | CHECKFUNC(m_TaskCreate, NULL); return m_TaskCreate(param); 53 | } 54 | BOOL CDownWrapper::TaskDelete(HANDLE hTask) 55 | { 56 | CHECKFUNC(m_TaskDelete, FALSE); return m_TaskDelete(hTask); 57 | } 58 | BOOL CDownWrapper::TaskStart(HANDLE hTask) 59 | { 60 | CHECKFUNC(m_TaskStart, FALSE); return m_TaskStart(hTask); 61 | } 62 | BOOL CDownWrapper::TaskStop(HANDLE hTask) 63 | { 64 | CHECKFUNC(m_TaskStop, FALSE); return m_TaskStop(hTask); 65 | } 66 | BOOL CDownWrapper::TaskForceStop(HANDLE hTask) 67 | { 68 | CHECKFUNC(m_ForceStopTask, FALSE); return m_ForceStopTask(hTask); 69 | } 70 | BOOL CDownWrapper::TaskQueryInfo(HANDLE hTask, DownTaskInfo & stTaskInfo) 71 | { 72 | CHECKFUNC(m_QueryTaskInfo, FALSE); return m_QueryTaskInfo(hTask, stTaskInfo); 73 | } 74 | BOOL CDownWrapper::TaskQueryInfoEx(HANDLE hTask, DownTaskInfo & stTaskInfo) 75 | { 76 | CHECKFUNC(m_QueryTaskInfoEx, FALSE); return m_QueryTaskInfoEx(hTask, stTaskInfo); 77 | } 78 | BOOL CDownWrapper::DelTempFile(DownTaskParam &stParam) 79 | { 80 | CHECKFUNC(m_DelTempFile, FALSE); return m_DelTempFile(stParam); 81 | } 82 | void CDownWrapper::SetSpeedLimit(INT32 nBps) 83 | { 84 | CHECKFUNC_(m_SetSpeedLimit); m_SetSpeedLimit(nBps); 85 | } 86 | void CDownWrapper::SetUploadSpeedLimit(INT32 nTcpBps, INT32 nOtherBps) 87 | { 88 | CHECKFUNC_(m_SetUploadSpeedLimit); m_SetUploadSpeedLimit(nTcpBps, nOtherBps); 89 | } 90 | BOOL CDownWrapper::SetProxy(DOWN_PROXY_INFO &stProxyInfo) 91 | { 92 | CHECKFUNC(m_SetProxy, FALSE); return m_SetProxy(stProxyInfo); 93 | } 94 | void CDownWrapper::SetUserAgent(const wchar_t *pszUserAgent) 95 | { 96 | CHECKFUNC_(m_SetUserAgent); m_SetUserAgent(pszUserAgent); 97 | } 98 | BOOL CDownWrapper::ParseThunderPrivateUrl(const wchar_t *pszThunderUrl, wchar_t *normalUrlBuffer, INT32 bufferLen) 99 | { 100 | CHECKFUNC(m_ParseThunderPrivateUrl, FALSE); return m_ParseThunderPrivateUrl(pszThunderUrl, normalUrlBuffer, bufferLen); 101 | } 102 | BOOL CDownWrapper::GetFileSizeWithUrl(const wchar_t * lpURL, INT64& iFileSize) 103 | { 104 | CHECKFUNC(m_GetFileSizeWithUrl, FALSE); return m_GetFileSizeWithUrl(lpURL, iFileSize); 105 | } 106 | BOOL CDownWrapper::SetFileIdAndSize(HANDLE hTask, char szFileId[40], unsigned __int64 nFileSize) 107 | { 108 | CHECKFUNC(m_SetFileIdAndSize, FALSE); return m_SetFileIdAndSize(hTask, szFileId, nFileSize); 109 | } 110 | BOOL CDownWrapper::SetAdditionInfo(HANDLE task_id, WSAPROTOCOL_INFOW *sock_info, CHAR *http_resp_buf, LONG buf_len) 111 | { 112 | CHECKFUNC(m_SetAdditionInfo, FALSE); return m_SetAdditionInfo(task_id, sock_info, http_resp_buf, buf_len); 113 | } 114 | HANDLE CDownWrapper::CreateTaskByURL(const wchar_t *url, const wchar_t *path, const wchar_t *fileName, BOOL IsResume) 115 | { 116 | CHECKFUNC(m_CreateTaskByURL, FALSE); return m_CreateTaskByURL(url, path, fileName, IsResume); 117 | } 118 | LONG CDownWrapper::CreateTaskByThunder(wchar_t *pszUrl, wchar_t *pszFileName, wchar_t *pszReferUrl, wchar_t *pszCharSet, wchar_t *pszCookie) 119 | { 120 | CHECKFUNC(m_CreateTaskByThunder, FALSE); return m_CreateTaskByThunder(pszUrl, pszFileName, pszReferUrl, pszCharSet, pszCookie); 121 | } 122 | LONG CDownWrapper::CreateBTTaskByThunder(const wchar_t *pszPath) 123 | { 124 | CHECKFUNC(m_CreateBTTaskByThunder, FALSE); return m_CreateBTTaskByThunder(pszPath); 125 | } 126 | DownTaskParam CDownWrapper::CreateDownTaskParam(const wchar_t TaskUrl[], const wchar_t Filename[], const wchar_t SavePath[], BOOL IsResume, BOOL IsOnlyOriginal, BOOL DisableAutoRename) 127 | { 128 | DownTaskParam TaskParam; 129 | TaskParam.DisableAutoRename = FALSE; 130 | StrCpyW(TaskParam.szTaskUrl, TaskUrl); 131 | StrCpyW(TaskParam.szFilename, Filename); 132 | StrCpyW(TaskParam.szSavePath, SavePath); 133 | return TaskParam; 134 | } 135 | }; 136 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | # 版权 2 | **版权与最终解释权归迅雷公司所有** 3 | 4 | --- 5 | 6 | # 迅雷下载引擎 7 | 8 | 分别由 小米, 猎豹, 360极速浏览器等软件提取 9 | 10 | 不承担软件无毒, 均为网络搜集, 自行校验签名 11 | 12 | 13 | # 相关项目 14 | 15 | [MFC --- MiniThunder] : (https://github.com/intlinfo/MiniThunder) 16 | 此代码 编译之后, 扔给需要的动态库, 可直接下载使用, 看资源数, 来决定下载速度, 貌似无限速 17 | 18 | [C# --- ThunderDownloader] : (https://github.com/VTS2018/ThunderDownloader) 19 | 20 | 21 | python: 22 | https://github.com/deathbless/thunder 23 | https://github.com/liuwb/python-thunder-download_engine/blob/master/python_thunder_engine.py 24 | --- 25 | SDK 接口文档 26 | 27 | # 全局接口 28 | 29 | | 接口名称 | 功能说明 | 30 | | :--- | :--- | 31 | | [XL\_Init](http://open.xunlei.com/wiki/api_doc.html#1) | 初始化SDK,并使其为处理后续操作做好准备。 | 32 | | [XL\_UnInit](http://open.xunlei.com/wiki/api_doc.html#2) | 反初始化SDK,释放模块运行期间申请的资源。 | 33 | | [XL\_DelTempFile](http://open.xunlei.com/wiki/api_doc.html#3) | 删除临时文件 | 34 | | [XL\_SetSpeedLimit](http://open.xunlei.com/wiki/api_doc.html#4) | 设置最大下载速度 | 35 | | [XL\_SetProxy](http://open.xunlei.com/wiki/api_doc.html#5) | 设置全局代理 | 36 | | [XL\_SetUserAgent](http://open.xunlei.com/wiki/api_doc.html#6) | 设置HTTP请求时客户端信息 | 37 | | [XL\_ParseThunderPrivateUrl](http://open.xunlei.com/wiki/api_doc.html#g7) | 将迅雷专用链转成实际URL | 38 | | [XL\_SetUploadSpeedLimit](http://open.xunlei.com/wiki/api_doc.html#g8) | 限制上传速度 | 39 | | [XL\_CreateTaskByURL](http://open.xunlei.com/wiki/api_doc.html#g9) | 简单封装了XL\_CreateTask接口 | 40 | | [XL\_CreateTaskByThunder](http://open.xunlei.com/wiki/api_doc.html#g10) | 拉起迅雷7创建下载任务 | 41 | | [XL\_ForceStopTask](http://open.xunlei.com/wiki/api_doc.html#g11) | 强制暂停任务 | 42 | 43 | # 任务接口 44 | 45 | | 接口名称 | 功能说明 | 46 | | :--- | :--- | 47 | | [XL\_CreateTask](http://open.xunlei.com/wiki/api_doc.html#7) | 创建任务 | 48 | | [XL\_DeleteTask](http://open.xunlei.com/wiki/api_doc.html#8) | 销毁任务 | 49 | | [XL\_StartTask](http://open.xunlei.com/wiki/api_doc.html#9) | 开始任务 | 50 | | [XL\_StopTask](http://open.xunlei.com/wiki/api_doc.html#10) | 停止任务 | 51 | | [XL\_QueryTaskInfoEx](http://open.xunlei.com/wiki/api_doc.html#11) | 查询任务信息 | 52 | 53 | # 接口详细说明 54 | #### XL\_Init 55 | ##### BOOLXL\_Init(void)初始化下载引擎,并使其为处理后续操作做好准备。 56 | * *返回值:*TRUE表示成功,FALSE表示失败。一些特殊情况会导致初始化失败,如:二进制文件缺失。 57 | * *说明:*该接口必须与XL\_Unint(void)成对出现。调用该接口的时,xldl.dll会拉起MiniThunderPlatform.exe子进程。 58 | #### XL\_UnInit 59 | ##### BOOL XL\_UnInit(void)反初始化下载引擎,释放模块运行期间申请的资源。 60 | * *返回值:*TRUE表示成功,FALSE表示失败。 61 | * *说明:*调用该接口后,会通知MiniThunderPlatform.exe子进程退出。 62 | #### XL\_CreateTask 63 | ##### HANDLE XL\_CreateTask(DownTaskParam &stParam)创建任务。可以新建任务也可以续传任务,参数中IsResume用于表示任务是否是续传任务。其他信息请参考DownTaskParam的定义。 64 | * *参数:* [in] stParam,创建任务需要的参数。 65 | * *DownTaskParam参考:* 66 | ```cpp 67 | struct DownTaskParam 68 | { 69 | int nReserved1; 70 | TCHAR szTaskUrl[2084]; // 任务URL,支持http,https,ftp,ftps格式 71 | TCHAR szRefUrl[2084]; // 可空,HTTP下载所在的网页URL 72 | TCHAR szCookies[4096]; // 可空,浏览器cookie 73 | TCHAR szFilename[MAX_PATH]; // 下载保存文件名. 74 | TCHAR szReserved[MAX_PATH]; 75 | TCHAR szSavePath[MAX_PATH]; // 文件保存目录 76 | HWND hReserved; 77 | BOOL bReserved1; 78 | TCHAR szReserved1[64]; 79 | TCHAR szReserved2[64]; 80 | BOOL IsOnlyOriginal; //是否只从原始地址下载 81 | UINT nReserved2; 82 | BOOL bReserved2; 83 | BOOL IsResume; // 是否用续传 84 | DWORD reserved[2048]; 85 | } 86 | 87 | ``` 88 | * *返回值:*返回任务的句柄。 89 | * *说明:*任务创建后,是不会马上就下载的,需要调用XL\_StartTask。异步执行。 90 | #### XL\_DeleteTask 91 | ##### BOOL XL\_DeleteTask(HANDLE hTask)销毁任务,释放任务在运行期间申请的资源。 92 | * *参数:* [in]hTask,任务句柄 93 | * *返回值:*TRUE表示成功,FALSE表示失败。当任务不存在时,调用会失败。 94 | * *说明:*在任务暂停、成功以及删除任务的时候都需要调用该接口,保证资源尽快的释放。 异步执行,如果任务出于pending状态则不能调用该接口。 95 | #### XL\_StartTask 96 | ##### BOOL XL\_StartTask(HANDLE hTask);开始下载。任务创建成功后,不会马上开始下载,需调用此接口才会开始下载。 97 | * *参数:* [in]hTask,任务句柄 98 | * *返回值:*TRUE表示成功,FALSE表示失败。当任务不存在时,调用会失败。 99 | * *说明:*异步执行,如果任务出于pending状态则不能调用该接口。 100 | #### XL\_StopTask 101 | ##### BOOL XL\_StopTask(HANDLE hTask)停止下载 102 | * *参数:* [in]hTask,任务句柄 103 | * *返回值:*TRUE表示成功,FALSE表示失败。当任务不存在时,调用会失败。 104 | * *说明:*获取任务信息是使用轮询方式的,最终任务下载了多少数据在任务停止下载后查询才是正确的。调用后任务不会立即停止,需轮询到任务状态为PAUSE之后,才能获取到。 105 | #### XL\_QueryTaskInfoEx 106 | ##### BOOL XL\_QueryTaskInfoEx(HANDLE hTask, DownTaskInfo & stTaskInfo);查询任务当前信息。 107 | * *参数:* [in]hTask,任务句柄 [out] stTaskInfo, 任务信息。 108 | * *DownTaskInfo参考:* 109 | ```cpp 110 | struct DownTaskInfo 111 | { 112 | DOWN_TASK_STATUS stat; //任务状态 113 | TASK_ERROR_TYPE fail_code; //错误码 114 | TCHAR szFilename[MAX_PATH]; //文件名 115 | TCHAR szReserved[MAX_PATH]; 116 | __int64 nTotalSize; // 该任务总大小(字节) 117 | __int64 nTotalDownload; // 下载有效字节数(可能存在回退的情况) 118 | float fPercent; // 下载进度 119 | int nTotalTime; // 不提供该值 120 | int nSrcTotal; // 总资源数 121 | int nSrcUsing; // 可用资源数 122 | int nReserved1; 123 | int nReserved2; 124 | int nReserved3; 125 | int nReserved; 126 | __int64 nTotalUpload; // 现不提供该值 127 | __int64 nDonationP2P; // p2p资源贡献的数据长度 128 | __int64 nReserved4; 129 | __int64 nDonationOrgin; // 原始资源贡献的数据长度 130 | __int64 nDonationP2S; // 镜像资源贡献的数据长度 131 | __int64 nReserved5; 132 | __int64 nReserved6; 133 | int nSpeed; // 速度(字节/秒) 134 | int nSpeedP2S; // 加速服务器资源的下载速度 135 | int nSpeedP2P; // peer下载速度 136 | bool IsOriginUsable; // 原始资源是否可用 137 | float fReserved; 138 | int bReserved; 139 | DWORD reserved[64]; 140 | }; 141 | enum DOWN_TASK_STATUS 142 | { 143 | NOITEM = 0, 144 | TSC_ERROR, 145 | TSC_PAUSE, 146 | TSC_DOWNLOAD, 147 | TSC_COMPLETE, 148 | TSC_STARTPENDING, 149 | TSC_STOPPENDING 150 | }; 151 | enum TASK_ERROR_TYPE 152 | { 153 | TASK_ERROR_UNKNOWN = 0x00, // 未知错误 154 | TASK_ERROR_DISK_CREATE = 0x01, // 创建文件失败 155 | TASK_ERROR_DISK_WRITE = 0x02, // 写文件失败 156 | TASK_ERROR_DISK_READ = 0x03, // 读文件失败 157 | TASK_ERROR_DISK_RENAME = 0x04, // 重命名失败 158 | TASK_ERROR_DISK_PIECEHASH = 0x05, // 文件片校验失败 159 | TASK_ERROR_DISK_FILEHASH = 0x06, // 文件全文校验失败 160 | TASK_ERROR_DISK_DELETE = 0x07, // 删除文件失败失败 161 | TASK_ERROR_DOWN_INVALID = 0x10, // 无效的DOWN地址 162 | TASK_ERROR_PROXY_AUTH_TYPE_UNKOWN = 0x20, // 代理类型未知 163 | TASK_ERROR_PROXY_AUTH_TYPE_FAILED = 0x21, // 代理认证失败 164 | TASK_ERROR_HTTPMGR_NOT_IP = 0x30, // http下载中无ip可用 165 | TASK_ERROR_TIMEOUT = 0x40, // 任务超时 166 | TASK_ERROR_CANCEL = 0x41, // 任务取消 167 | TASK_ERROR_TP_CRASHED= 0x42, // MINITP崩溃 168 | TASK_ERROR_ID_INVALID = 0x43, // TaskId 非法 169 | }; 170 | 171 | ``` 172 | * *返回值:*TRUE表示成功,FALSE表示失败。 173 | * *说明:*IsOriginUsable,原始资源是否可用,是一个布尔型的参数,但是原始连接原始资源是一个耗时的操作,意味着中间有段时间原始资源是否有效是未知的。这个参数的初始态是false,所以就存在原始资源是有效,但在任务刚开始时这个参数是false的问题。上层在使用该值的时候需要根据业务逻辑再做处理。 174 | #### XL\_DelTempFile 175 | ##### BOOL XL\_DelTempFile(DownTaskParam &stParam)删除任务的临时文件。下载引擎会创建 .td 、 .td.cfg后缀的文件用来保存已下载的数据。 176 | * *参数:* [in]stParam,任务参数,参考创建任务中的参数。但是这里只有文件保存的目录和文件名是必须。 177 | * *返回值:*TRUE表示成功,FALSE表示失败。 178 | * *说明:*文件名是最后真正保存到磁盘的文件名,不带临时文件后缀名。最终保存的文件名会和创建任务不一样,所以这个文件名要以查询任务信息返回的文件名为准。在保存路径下已经存在相同文件名的文件时,最终保存的文件名就会自动改变文件名:filename.zip → filename(1).zip。 异步执行。 179 | #### XL\_SetSpeedLimit 180 | ##### void XL\_SetSpeedLimit(INT32 nKBps)设置最大下载速度。 181 | * *参数:* [in]nKBps, 速度上限值 182 | * *说明:*异步执行 183 | #### XL\_SetProxy 184 | ##### BOOL XL\_SetProxy(DOWN\_PROXY\_INFO &stProxyInfo)设置下载代理,全局任务代理信息。 185 | * *参数:* [in]stProxyIfno 代理信息 186 | * *DOWN\_PROXY\_INFO参考:* 187 | ```cpp 188 | enum DOWN_PROXY_TYPE 189 | { 190 | PROXY_TYPE_IE = 0, 191 | PROXY_TYPE_HTTP = 1, 192 | PROXY_TYPE_RESERVED= 2, //不支持该代理 193 | PROXY_TYPE_SOCK5 = 3, 194 | PROXY_TYPE_UNKOWN = 255, 195 | }; 196 | enum DOWN_PROXY_AUTH_TYPE 197 | { 198 | PROXY_AUTH_NONE =0, 199 | PROXY_AUTH_AUTO, 200 | PROXY_AUTH_BASE64, 201 | PROXY_AUTH_NTLM, 202 | PROXY_AUTH_DEGEST, 203 | PROXY_AUTH_UNKOWN, 204 | }; 205 | struct DOWN_PROXY_INFO 206 | { 207 | BOOL bIEProxy; 208 | BOOL bProxy; 209 | DOWN_PROXY_TYPE stPType; 210 | DOWN_PROXY_AUTH_TYPE stResverd; 211 | TCHAR szHost[2048]; 212 | INT32 nPort; 213 | TCHAR szUser[50]; 214 | TCHAR szPwd[50]; 215 | TCHAR szDomain[2048]; 216 | }; 217 | 218 | ``` 219 | * *返回值:*TRUE表示成功,FALSE表示失败。参数非法返回FALSE 220 | #### XL\_SetUserAgent 221 | ##### void XL\_SetUserAgent(const TCHAR \*pszUserAgent)设置向原始资源的Http任务请求的UserAgent。 222 | * *参数:* [in]pszUserAgent,客户端UserAgent字符串 223 | * *说明:*在调用该方法后创建的任务的才会使用新的UserAgent。 224 | #### XL\_ParseThunderPrivateUrl 225 | ##### BOOL XL\_ParseThunderPrivateUrl(const wchar\_t \*pszThunderUrl, wchar\_t \*normalUrlBuffer, INT32 bufferLen)迅雷专用链是根据一定逻辑从普通URL转成的。 226 | * *参数:* [in] pszThunderUrl,迅雷专用链URL [out] normalUrlBuffer,存储转化后的普通URL的缓冲区 [out] bufferLen,normalUrlBuffer的缓冲区大小,单位字符数 227 | * *返回值:*TRUE表示成功,FALSE表示失败 228 | * *说明:*此函数功能独立,和其他函数没有依赖关系,可随时单独使用 229 | #### XL\_SetUploadSpeedLimit 230 | ##### void XL\_SetUploadSpeedLimit(INT32 nTcpKBps, INT32 nOtherKBps)可根据实际情况设置外网和内网的上传速度。 231 | * *参数:* [in] nTcpKBps, 内网上传速度,单位为KB/s [in] nOtherKBps, 外网上传速度,单位为KB/s 232 | * *返回值:*无 233 | #### XL\_CreateTaskByURL 234 | ##### HANDLE XL\_CreateTaskByURL(const wchar\_t \*url, const wchar\_t \*path, const wchar\_t \*fileName, BOOL IsResume)通过任务URL、路径、文件名创建任务。 235 | * *参数:* [in] url, 任务URL,不能为空,包括空字符字符长度不能超过2084 [in] path, 任务路径,不能为空,包括空字符字符长度不能超过260 [in] fileName, 任务文件名,不能为空,包括空字符字符长度不能超过260 [in] IsResume, 是否是续传任务 236 | * *返回值:*返回任务的句柄 237 | #### XL\_CreateTaskByThunder 238 | ##### LONG XL\_CreateTaskByThunder(wchar\_t \*pszUrl, wchar\_t \*pszFileName, wchar\_t \*pszReferUrl, wchar\_t \*pszCharSet, wchar\_t \*pszCookie)通过传递URL和文件名等信息拉起迅雷7的新建面板创建下载任务。 239 | * *参数:* [in] pszUrl,任务URL [in] pszFileName,下载保存的文件名 [in] pszReferUrl,引用页URL [in] pszCharSet,当前网页的字符集 [in] pszCookie,下载数据所需的cookie 240 | * *返回值:*0成功,其他为失败 241 | #### XL\_ForceStopTask 242 | ##### BOOL XL\_ForceStopTask(HANDLE hTask)强制暂停任务 243 | * *参数:* [in] hTask,任务句柄 244 | * *返回值:*TRUE表示成功,FALSE表示失败。当任务不存在时,调用会失败 245 | * *说明:*在开启UAC下载大文件时,调用XL\_StopTask可能需要消耗比较长的时间。这种情况下如果需要快速暂停任务,可以调用XL\_ForceStopTask,不过有可能导致已经下载的还没写到磁盘的数据丢失。 246 | ## 注意事项 247 | 1. 全局接口是线程不安全的,且XL\_Init外的其他接口必须在该函数成功返回后才能调用; 248 | 2. 如果任务处于TSC\_STARTPENDING或TSC\_STOPPENDING,关于任务的操作只能调用查询任务信息的接口。 249 | # 接口逻辑说明 250 | ## 任务异步操作 251 | 任务的操作是异步执行的。调用接口有两个操作:   252 | 1. 操作上层xldl.dll中的虚任务 253 | 2. 在命令队列对push一条相关操作的命令 254 | 255 | 接口层可以操作的任务都是虚任务,真实任务是在MiniThunderPlatfom进程创建的。 256 | 257 | ## 任务创建的流程 258 | 1. Xldl创建虚任务; 259 | 2. 将操作与参数push到命令队列; 260 | 3. 命令处理线程负责执行队列中的命令,与MiniThunderPlatfom同步通信; 261 | 4. MiniThunderPlatfom创建任务成功后,虚任务就可以和实任务映射。 262 | 之后所有对virtual task 的操作都将映射到真正的task,并在MiniTP执行真正的操作。 任务信息查询,任务信息的更新需要调用者驱动,需要调用者每隔1s调用一次该接口。 263 | 264 | ## 任务信息查询和更新的流程 265 | 1. 调用接口查询信息时,先从虚任务查询任务信息,第一次调用的时候肯定没有信息 266 | 2. 将查询操作与参数push到命令队列; 267 | 3. 命令处理线程负责执行队列中的命令,与MiniThunderPlatfom同步通信; 268 | 4. 查询到真实任务信息后,将信息存储到虚任务中; 269 | 5. 第二次查询就可以直接查询到任务信息,这些信息是上一次查询到的。 270 | 这里就会出现这样的情况,第一次查询操作不能获取到任务信息,即任务处于pause/start\_pending状态中。更极端的情况,任务下载完成前一次查询没有调用过,在任务完成后再调用该接口会发现任务进度为0。 271 | 272 | ## 子进程异常退出 273 | 这种情况是不被欢迎的,但又不可避免。子进程异常退出后MiniThunderPlatfom创建的任务会销毁。这样,虚任务除了与真实任务的映射关系,其实并无意义。这时候,查询任务信息就会返回任务出错,错误码为TASK\_ERROR\_ID\_INVALID(任务id非法)。这时需要重新创建续传任务,接口为XL\_CreateTask,结构体中其他参数与创建普通任务相同,参数IsResume设为TRUE。 274 | # 其它 275 | ### SDK文件说明Sdk总共有10个二进制文件。二进制文件之间的依赖关系如下图所示: 276 | 各个文件功能介绍: 277 | 278 | | 文件名 | 功能 | 279 | | :--- | :--- | 280 | | xldl.dll | 导出MiniTP接口 | 281 | | MiniThunderPlatform.exe | 独立进程 | 282 | | download\_engine.dll | MiniTP核心库 | 283 | | zlib1.dll | 压缩通信数据 | 284 | | dl\_peer\_id.dll | 获取迅雷客户端标识 | 285 | | XLBugReport.exe | 负责上报捕获到的崩溃 | 286 | | XLBugHandler.dll | 负责拉起XLBugReport .exe | 287 | | minizip.dll、mini\_unzip.dll | 用于压缩文件崩溃堆栈 | 288 | | atl71.dll | 微软提供的程序库 | 289 | 290 | 291 | 292 | 293 | 294 | --------------------------------------------------------------------------------