Since I had successfully replaced the two v9.20 files "7z.dll" and "7zFM.exe" with their v9.20.04 updates on a pc running Windows XP (recall "steps" 1-6 at " https://sourceforge.net/projects/sevenzip/forums/forum/45797/topic/4027169 "), I decided to do the same update on a couple of pc's running Windows 2000. However, both of these will not run 7-zip v9.20.04 and give the following dialog box error:
7zFM.exe Entry Point Not Found
(X) The procedure entry point GetProcessId could not be located in the dynamic link library KERNEL32.dll.
If possible, could you please modify 7-zip v9.20.04 (and/or subsequent versions) to also run on pc's with the Windows 2000 operating system? Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-12-27
The same error (when tested on Windows 2000 pc's) appears when trying to run 7-zip v9.20.03 also.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I second that. Windows 2000 is not so popular nowadays, but it isn't dead yet.
However, GetProcessId() cannot be legally emulated in Win32 API. It can be implemented either in NT API (as it is done in KERNEL32), via ReadProcessMemory() (PID is stored in PEB which is located at a fixed address) or via CreateRemoteThread() (which should executeGetCurrentProcessId()). All these methods are too complex to realize in a widely used project.
There may be a way to avoid using PIDs. The simplest idea I see is to create a separate thread for each opened file, which waits for a process (identified by a handle) to terminate and then clean up and exit. Another way, perfect for single files, is to pre-open a file with FILE_FLAG_DELETE_ON_CLOSE, then call ShellExecuteEx() and close the handle: OS will delete the file itself.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When all processes are closed, 7-zip checks file's modified timestamp and if it was changed, 7-zip suggests to update archive.
Can somebody confirm that new version works better than 9.20?
Maybe there is some problem with admin rights again?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-12-27
I'm not sure if I understood your last question correctly (or even if it was addressed to me), but (for what it's worth) I was logged in as an administrator on both of the Windows 2000 computers when I tried testing the latest version of 7-zip I could find (v9.20.04) and received the "Entry Point Not Found" error message. I was specifically trying to use the following two 32bit files (MD5 hashes for both given below):
# MD5 hashes generated by MD5summer v1.2.0.5 (http://www.md5summer.org)
# Generated 12/27/2010 9:24:50 AM
That code uses NT API which is undocumented and unimplemented in Windows 9x. It may be a good solution, and may be not. By the way, Igor, is it possible to ignore child processes and thus simply wait for a single handle?
If NT API is to be used, then it is possible to use NtQueryObject() to determine whether the extracted file is still opened. According to MSDN, it is possible to get NULL instead a valid handle in a call to ShellExecuteEx(), so the process to wait for may be undetermined. The disadvantage of NtQueryObject() is that it should be called periodically instead of waiting for some event.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Since I had successfully replaced the two v9.20 files "7z.dll" and "7zFM.exe" with their v9.20.04 updates on a pc running Windows XP (recall "steps" 1-6 at " https://sourceforge.net/projects/sevenzip/forums/forum/45797/topic/4027169 "), I decided to do the same update on a couple of pc's running Windows 2000. However, both of these will not run 7-zip v9.20.04 and give the following dialog box error:
7zFM.exe Entry Point Not Found
(X) The procedure entry point GetProcessId could not be located in the dynamic link library KERNEL32.dll.
If possible, could you please modify 7-zip v9.20.04 (and/or subsequent versions) to also run on pc's with the Windows 2000 operating system? Thanks.
The same error (when tested on Windows 2000 pc's) appears when trying to run 7-zip v9.20.03 also.
OK, l'll fix it in next version.
I second that. Windows 2000 is not so popular nowadays, but it isn't dead yet.
However, GetProcessId() cannot be legally emulated in Win32 API. It can be implemented either in NT API (as it is done in KERNEL32), via ReadProcessMemory() (PID is stored in PEB which is located at a fixed address) or via CreateRemoteThread() (which should executeGetCurrentProcessId()). All these methods are too complex to realize in a widely used project.
There may be a way to avoid using PIDs. The simplest idea I see is to create a separate thread for each opened file, which waits for a process (identified by a handle) to terminate and then clean up and exit. Another way, perfect for single files, is to pre-open a file with FILE_FLAG_DELETE_ON_CLOSE, then call ShellExecuteEx() and close the handle: OS will delete the file itself.
Ah, sorry, Igor, I haven't noticed your post, preparing mine for a long time. I hope you'll find my above suggestions useful.
I try to track all child processes of process that was returned in ShellExecuteEx().
So I use:
GetProcessId()
CreateToolhelp32Snapshot()
Process32First()
Process32Next()
PROCESSENTRY32::th32ParentProcessID
PROCESSENTRY32::th32ProcessID
When all processes are closed, 7-zip checks file's modified timestamp and if it was changed, 7-zip suggests to update archive.
Can somebody confirm that new version works better than 9.20?
Maybe there is some problem with admin rights again?
I'm not sure if I understood your last question correctly (or even if it was addressed to me), but (for what it's worth) I was logged in as an administrator on both of the Windows 2000 computers when I tried testing the latest version of 7-zip I could find (v9.20.04) and received the "Entry Point Not Found" error message. I was specifically trying to use the following two 32bit files (MD5 hashes for both given below):
# MD5 hashes generated by MD5summer v1.2.0.5 (http://www.md5summer.org)
# Generated 12/27/2010 9:24:50 AM
50e8d33344761241c8b31a0359866212 *7z.dll
378fcb422a790e23b688950bd69dfa26 *7zFM.exe
Thanks for your diligence. It must be a pain at times coding successfully for so many different platforms.
No, my question is:
Does new version work better under XP/Vista/7?
KERNEL32.GetProcessId() can be copied from an open source implementation here (at line 324).
That code uses NT API which is undocumented and unimplemented in Windows 9x. It may be a good solution, and may be not. By the way, Igor, is it possible to ignore child processes and thus simply wait for a single handle?
If NT API is to be used, then it is possible to use NtQueryObject() to determine whether the extracted file is still opened. According to MSDN, it is possible to get NULL instead a valid handle in a call to ShellExecuteEx(), so the process to wait for may be undetermined. The disadvantage of NtQueryObject() is that it should be called periodically instead of waiting for some event.