Jump to content

I have an idea for pausing downloads


Alterego
 Share

Recommended Posts

We would have to first enable SeRestorePriviledge for the process, then identify the thread performing the download, then invoke SuspendThread, and finally ResumeThread

Something like the following..but I have no idea how to actually use DllCall...just reading documentation

DllCall("kernel32.dll","int","SuspendThread","str",$thread)

I used SysInternals Process Explorer to suspend my download program, and on resume it also resumed the download. I can also kill threads individually with it. For example, I can kill the thread producing the GUI (see the Scripts and Scraps forum) and the process will stay alive and continue downloading the file in the background. They must be using the methods mentioned above. I was able to get the following information about the thread. maybe it will help.

ntdll.dll!KiFastSystemCallRet

WS2_32.dll!WSARecv+0x61

WSOCK32.dll!recv+0x33

wininet.dll!HttpSendRequestA+0x51a

wininet.dll!HttpSendRequestA+0x484

wininet.dll!HttpSendRequestA+0x423

wininet.dll!Ordinal101+0x142

wininet.dll!Ordinal101+0xf0

wininet.dll!HttpSendRequestA+0x325

wininet.dll!InternetReadFile+0x87f

wininet.dll!InternetReadFile+0x1a5b

wininet.dll!Ordinal101+0x142

wininet.dll!Ordinal101+0xf0

wininet.dll!InternetReadFile+0x19d9

wininet.dll!InternetReadFile+0x1492

wininet.dll!InternetReadFile+0x144b

wininet.dll!Ordinal101+0x142

wininet.dll!Ordinal101+0xf0

wininet.dll!InternetReadFile+0x13da

wininet.dll!InternetReadFile+0x1351

wininet.dll!InternetReadFile+0x131b

wininet.dll!Ordinal101+0x142

wininet.dll!Ordinal101+0xf0

wininet.dll!InternetReadFile+0x1b8

downloader.exe+0xdcb4

downloader.exe+0x29b70

kernel32.dll!GetModuleFileNameA+0x1b4

It looks like coding InetGet must have been fun.

Link to comment
Share on other sites

It might work, but I think the odds are better that the connection will die resulting in an incomplete transfer. I also think that it's almost totally useless. Even if it did work, pausing a thread and resuming during the same session doesn't seem all that useful. Pausing/Resuming across sessions is something that would be uesful, but that's not possible with the current implementation.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...