Old 6th August 2014, 06:51   #281
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
Quote:
Originally Posted by stass View Post
This post is on page http://nsis.sourceforge.net/File:LockedList.zip
Page open the Opera browser. Antivirus is disabled !
Screenshot : http://www.mediafire.com/?waxa911a5pt74tr
Oh right... It says that for all files on the NSIS Wiki. It's a general warning and not specific to my plug-in.

Stu
Afrow UK is offline   Reply With Quote
Old 6th August 2014, 16:05   #282
Satara
Junior Member
 
Join Date: Nov 2013
Posts: 9
Wow, many thanks dude! Will test it in the next days.
Satara is offline   Reply With Quote
Old 6th August 2014, 17:24   #283
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
little diference with LockedList::Dialog behavior

I have found that at latest version "3.0.0.2 RC2" the behavior is a little different from "3.0.0.1"...

Occurs when you have the dialog as first dialog, when the process is found the dialog is not called, but on RC2 the dialog appears anyway, then leaves because there is no process running with the given name.

Here´s a piece of used code.

PHP Code:
 LockedList::AddModule \cmd.exe

  LockedList
::FindProcess "cmd.exe"
  
Pop $R0

  
${If} $R0 != ''
  
LockedList::Dialog /autonext \
          ....
  ${EndIf} 
Many thanks!
shadowpoa is offline   Reply With Quote
Old 7th August 2014, 07:56   #284
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
New version:
Quote:
3.0.0.3 - 7th August 2014
* FindProcess did not always push "no" (/yesno) or an empty string onto the stack when no processes were running.
shadowpoa your code can be improved:
code:
Function ...

!insertmacro MUI_HEADER_TEXT ... ...

LockedList::FindProcess /yesno cmd.exe
Pop $R0
${If} $R0 == no
Abort
${EndIf}

LockedList::AddModule \cmd.exe
LockedList::Dialog
Pop $R0

FunctionEnd

Using /yesno is more suitable here as otherwise, if the process is running, you will end up leaving two strings on the stack (which could have side-effects with other code.) I have also called Abort to skip the custom page (rather than jump over the plug-in calls).

Stu
Afrow UK is offline   Reply With Quote
Old 7th August 2014, 11:07   #285
Satara
Junior Member
 
Join Date: Nov 2013
Posts: 9
Just wanted to let you know, that the application name lookup now works perfect!
Satara is offline   Reply With Quote
Old 7th August 2014, 14:34   #286
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
Quote:
Originally Posted by Satara View Post
Just wanted to let you know, that the application name lookup now works perfect!
Excellent, thanks!

Stu
Afrow UK is offline   Reply With Quote
Old 12th August 2014, 17:31   #287
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
Quote:
Originally Posted by Afrow UK View Post
New version:shadowpoa your code can be improved:
code:
Function ...

!insertmacro MUI_HEADER_TEXT ... ...

LockedList::FindProcess /yesno cmd.exe
Pop $R0
${If} $R0 == no
Abort
${EndIf}

LockedList::AddModule \cmd.exe
LockedList:ialog
Pop $R0

FunctionEnd

Using /yesno is more suitable here as otherwise, if the process is running, you will end up leaving two strings on the stack (which could have side-effects with other code.) I have also called Abort to skip the custom page (rather than jump over the plug-in calls).

Stu
Wow! I did not think of that!
shadowpoa is offline   Reply With Quote
Old 21st September 2014, 08:25   #288
SubJunk
Junior Member
 
Join Date: Dec 2012
Posts: 3
Thanks so much for the 64-bit support and continued updates That makes it much more useful
SubJunk is offline   Reply With Quote
Old 2nd December 2014, 08:12   #289
stass
Senior Member
 
Join Date: Nov 2012
Posts: 144
It is known that My.dll used (busy) process - explorer.exe

Why, if :

Quote:
LockedList::AddModule "My.dll"
LockedList:: Dialog
LockedList shows nothing ? explorer.exe as if ignored plugin ...

And the second question : is it possible to make the plugin restart the explorer.exe ?
It is very necessary and useful feature !
From experience we know that 99% of ShelDll often busy or it is locked explorer.exe.
stass is offline   Reply With Quote
Old 3rd December 2014, 00:23   #290
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
Are you using the 64-bit support (LockedList64.dll)?

Attached a script which will restart Windows Explorer (based on http://stackoverflow.com/questions/5...plorer-process).

Stu
Attached Files
File Type: nsi RestartExplorer.nsi (733 Bytes, 140 views)
Afrow UK is offline   Reply With Quote
Old 3rd December 2014, 06:26   #291
stass
Senior Member
 
Join Date: Nov 2012
Posts: 144
Afrow UK
I, explorer.exe is not displayed on x32 ( LockedList.dll ) Tested on Windows XP SP3x32 Rus
and Windows 7 SP1x32 Rus .

Thanks for RestartExplorer !
stass is offline   Reply With Quote
Old 10th March 2015, 14:43   #292
nicorac
NSIS Dialog Designer Author
 
Join Date: Apr 2011
Posts: 69
Lightbulb LockedList64.dll not working on Unicode builds

I have an Unicode setup including LockedList.dll (unicode) and LockedList64.dll (there's only one).
Detection of x64 processes doesn't work; setup compiles and run, but no process is detected.

After some debug I landed to line 2751 of file LockedList.cpp:
code:
if (pcds->dwData == 1 && pcds->cbData == sizeof(FILE_INFORMATION64) && g_pEnumSystemProcesses64Options) {
...
}


Debugger show these values:
pcds->dwData = 1
pcds->cbData = 808
sizeof(FILE_INFORMATION64) = 1584
...and the if block is never executed.

The 808 length come from the x64 DLL, and it's wrong because the x86 version is compiled with Unicode so its TCHARs are longer.
code:
struct FILE_INFORMATION64 {
DWORD ProcessId;
TCHAR FullPath[MAX_PATH];
TCHAR ProcessDescription[MAX_PATH];
HWND__* POINTER_64 ProcessHWND;
TCHAR ProcessFullPath[MAX_PATH];
UINT FileNumber;
UINT TotalFiles;
};
#endif



Just recompiling the x64 version with Unicode enabled fixed the bug on my side, and x64 processes are now enumerated correctly.

I think you need to provide both the dll in both ANSI/Unicode versions and fix the documentation.

Cheers
Claudio
nicorac is offline   Reply With Quote
Old 19th March 2015, 15:00   #293
nicorac
NSIS Dialog Designer Author
 
Join Date: Apr 2011
Posts: 69
I've attached here the x64 Unicode build of the plugin, in case someone needs it...
Attached Files
File Type: zip LockedList_3.0.0.3_x64_unicode.zip (4.4 KB, 112 views)
nicorac is offline   Reply With Quote
Old 19th April 2015, 11:12   #294
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
I have fixed the issue. LockedList64.dll was meant to be built with Unicode but I must have included the ANSI build in the Zip file. Also the ANSI LockedList.dll will now convert the FILE_INFORMATION64 contents to ANSI (so again, no need for two LockedList64 builds).

Stu
Afrow UK is offline   Reply With Quote
Old 29th September 2015, 10:33   #295
vzevako
Junior Member
 
Join Date: Dec 2012
Posts: 4
LockedList::AddFolder "$INSTDIR"
LockedList:ialog

It shows me several processes as expected (they are really lock some files).

Question:
Is it possible to excluded some processes (probably by name) from list?

Thanks in advance
vzevako is offline   Reply With Quote
Old 5th October 2015, 07:00   #296
Mircea M
Junior Member
 
Join Date: Aug 2014
Posts: 44
Rename command fails although there's no lock

Hi,

I noticed a while ago that in case I am trying to rename a folder that is currently open in Windows Explorer, the operation sometimes fails. In order to try and figure out what is happening, I created a small script that uses the LockesList plugin (to see if anything is really locked):
code:

code:
Name `LockedList Test`

OutFile LockedListTest.exe
RequestExecutionLevel admin

!define origFolder "C:\Program Files (x86)\Original"
!define newFolder "C:\Program Files (x86)\Original_Renamed"

Page Custom LockedListShow
Page instfiles

Function LockedListShow
LockedList::AddFolder "${origFolder}"
LockedList:ialog /autonext /searching "Searching for locked files in ${origFolder}"
Pop $R0
MessageBox MB_OK "$R0"
FunctionEnd

Function renameFolder
ClearErrors
MessageBox MB_OK "Renaming ${origFolder} to ${newFolder}"
Rename "${origFolder}" "${newFolder}"
IfErrors 0 done
MessageBox MB_OK "Failed to rename"
done:
ClearErrors
FunctionEnd

Section
Call renameFolder
SectionEnd



I also have the following folder structure:
\Original
\config
\test.txt
I then execute LockedList.exe in different scenarios.
  1. All Windows Explorer windows closed
  2. Windows Explorer open with folder "Original" displayed
  3. Notepad open with Test.txt
  4. Windows Explorer open with folder Original\config displayed

Here are the results:
Case 1: LockedList returns "next" as no locks found, folder is renamed
Case 2: LockedList returns "next" as no locks found, folder is renamed
Case 3: LockedList displays Notepad.exe as a lock. I close it and it then returns "next". Rename failes (as folder Original\config displayed in Windows Explorer - since I opened the txt file)
Case 4: LockedList returns "next" as no locks found, rename failes.

Now I found this a bit "weird". Rename works ok if only the folder to be renamed is displayed in Windows Explorer but fails as soon as any subfolders thereof are displayed. Also, LockedList finds no locks and manual renaming also works.

Any idea why this might happen? Is this a problem with the plugin maybe (that it doesn't detect these locks)? Or with NSIS, since every other rename works when it reports that the files are locked?

Thanks,
Mircea
Mircea M is offline   Reply With Quote
Old 21st January 2016, 01:25   #297
fashtas
Junior Member
 
Join Date: Dec 2006
Posts: 9
I know this plug-in hasn't really been looked at for a while, but anyone gotten it working finding x64 processes on Windows 10?

From what I can tell, it is not detecting my 64bit DLL's

It detects the 64bit EXE and I can get it detect 32bit DLLs using AddModule

I have the code:
${If} ${RunningX64}
File /oname=$PLUGINSDIR\LockedList64.dll `${NSISDIR}\Plugins\LockedList64.dll`
${EndIf}

And I have the (latest) LockedList64.dll that supposedly fixed the ansi-unicode issue.

EDIT:
An addendum

It is *related* to 64 bit but not what I thought. Not sure what I think yet.

Looking for a windows module "bcrypt.dll" LockedList finds *all* applications using it, AS LONG as they are using :
C:\Windows\SysWOW64\bcrypt.dll

if they are using:
C:\windows\System32\bcrypt.dll

it does not detect the file as locked and does not detect any EXE's using it.

(I am searching for "\bcrypt.dll")

The problem program we have is a 64 bit Win32 program locking one of our 64 bit files.

LockedList does not detect a SINGLE file that program has locked (but can detect the program is running) - odd.

Addendum 2:
Hilarious side note:

LockedList::AddModule "C:\windows\System32\bcrypt.dll"
finds all program using : C:\Windows\SysWOW64\bcrypt.dll

LockedList::AddModule "C:\Windows\SysWOW64\bcrypt.dll"
finds no programs at all locking that file

I am using Process Explorer to determine what DLL's the programs have locked
fashtas is offline   Reply With Quote
Old 21st January 2016, 03:05   #298
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,558
The 32-bit layer translates system32 to syswow64. You can use a backdoor to get the real folder: $windir\sysnative\bcrypt.dll (Only works in 32-bit programs running on 64-bit Vista or higher)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 4th February 2016, 14:05   #299
kalverson
Senior Member
 
Join Date: May 2007
Location: Maple Grove, Minnesota
Posts: 124
Question silent install & locked list plug-in

Is there a way to tell the locked list plug-in to just force clear (kill) any blocking processes and continue with the silent install? i.e. when the "/S" option is used or perhaps adding a switch with the /S that a user can invoke to indicate that.
kalverson is offline   Reply With Quote
Old 6th April 2016, 10:24   #300
Beer_Baron
Junior Member
 
Join Date: Apr 2016
Posts: 1
Multiple Acrobat files show as one

Afrow, a very impressive piece of programing. I have a problem trying to close two pdf files.

Two pdf files are open that need to be closed before continuing, with different titles (ExampleA and ExampleB). Example B was the last one viewed so the title in the locked list window shows only Example B, not Example A even though both are open.

When testing your lock list, only one instance of Acrobat shows, and it shows only the title for ExampleB. If I close ExampleB but leave Example A open, the list does not update, it still shows ExampleB as being locked.

If I have an unrelated pdf fie also open, SomethingElse, if that is the last Acrobat file looked at then that title is the one displayed on the locked list. The two pdf files that are actually locked don't show at all in this case. If I close the two locked files then SomethingElse remains stubbornly in the Locked List window, even though it has nothing to do with the locked files that I am interested in.

I've tried AddFiles, AddFolder and AddCaption with no success.

Is it possible to:

(a) show two separate lines showing the two separate pdf files and
(b) have the correct title for each and
(c) ignore unrelated pdfs that might also be open

in the locked list window?
Beer_Baron is offline   Reply With Quote
Old 27th May 2016, 08:58   #301
AfzaL
Junior Member
 
Join Date: May 2016
Posts: 1
Does the current LockedList version (19 April 2015) supports the NSIS 2.51 version and Windows 2003 Server x64?

I have a problem when using LockedList which are let out after the version from 12 July 2012.
In the LockedList version from 12 July 2012 - everything is fine.

How to reproduce:
- compile the example of LockedListFolder.nsi
- start the received installer on Windows 2003 Server x64
- go to the page with locked files
- progress remains on 0%, and the CPU is used for 100%. It is possible to wait infinitely, but this process never comes to an end.

When using the same installer on the Windows XP (kernel is the same as on 2003 Server) - everything is fine.
We are also tested on all Windows after XP (x86 and x64) - everything is fine.
AfzaL is offline   Reply With Quote
Old 27th July 2017, 15:01   #302
sfx09
Junior Member
 
Join Date: Jul 2017
Posts: 6
I have a trouble with LockedList plugin in XP x64 (Professional). As well as AfzaL (27th May 2016 11:58) - processor 100%, plugin progress 0% and complete, but hourglass and freeze. Sorry for my english. Can developer help? I can send all information, what may help.
sfx09 is offline   Reply With Quote
Old 27th July 2017, 23:04   #303
sfx09
Junior Member
 
Join Date: Jul 2017
Posts: 6
With some expirement founded, where trouble in source code. Under WinXP 64-bit (and probably 64-bit Win2003) while-loop in function "static SYSTEM_HANDLE_INFORMATION* GetSystemHandleInformation()" not breaking. NtQuerySystemInformation, which used in this function return in variable "size" always value is 0.
sfx09 is offline   Reply With Quote
Old 28th July 2017, 00:15   #304
sfx09
Junior Member
 
Join Date: Jul 2017
Posts: 6
This articles help me very much!

https://www.remkoweijnen.nl/blog/201...eminformation/

http://hintdesk.com/c-get-all-handle...ss-in-64-bits/

Tommorow, I'll do some tests and post the solution here, but need to recompile LockedList plugin from "Contrib" dir (or maybe developer can release new version).

P.S. Thanks for this very good plugin!
sfx09 is offline   Reply With Quote
Old 28th July 2017, 21:49   #305
sfx09
Junior Member
 
Join Date: Jul 2017
Posts: 6
Ok. Mayby my solution is not beautiful, but it works.

In source function GetSystemHandleInformation() this:

PHP Code:
  NtQuerySystemInformation(SystemHandleInformationpSysHandleInformationsizeof(SYSTEM_HANDLE_INFORMATION), &size)
  
GlobalFree(pSysHandleInformation); 
need replace to something this:

PHP Code:
  int iSHI sizeof(SYSTEM_HANDLE_INFORMATION);
  while (
NtQuerySystemInformation(SystemHandleInformationpSysHandleInformationiSHI, &size)
      == 
STATUS_INFO_LENGTH_MISMATCH)
  {
    
iSHI iSHI 2;
    
GlobalFree(pSysHandleInformation);
      
pSysHandleInformation = (SYSTEM_HANDLE_INFORMATION*)GlobalAlloc(GPTRiSHI);
  } 
I don't have more time for re-check this solution. Sorry, but maybe somebody help it.
sfx09 is offline   Reply With Quote
Old 29th July 2017, 04:53   #306
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 847
Perhaps something more like this:
PHP Code:
size sizeof(SYSTEM_HANDLE_INFORMATION);
while (
NtQuerySystemInformation(SystemHandleInformationpSysHandleInformationsize, &size)
  == 
STATUS_INFO_LENGTH_MISMATCH)
{
  
GlobalFree(pSysHandleInformation);
  
pSysHandleInformation = (SYSTEM_HANDLE_INFORMATION*)GlobalAlloc(GPTRsize);

The function returns the length you need, so there is no point expanding the buffer over and over until it succeeds.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 29th July 2017, 23:12   #307
sfx09
Junior Member
 
Join Date: Jul 2017
Posts: 6
Quote:
The function returns the length you need, so there is no point expanding the buffer over and over until it succeeds.
Thanks! I'll try it on Monday and write the result.
sfx09 is offline   Reply With Quote
Old 31st July 2017, 10:22   #308
sfx09
Junior Member
 
Join Date: Jul 2017
Posts: 6
JasonFriday13 (29th July 2017, 07:53)

Unfortunately your solution don't work (also plugin go to an infinite loop only in XP 64 bit and 2003 64-bit). I don't know why it happens. =(
sfx09 is offline   Reply With Quote
Old 31st July 2017, 15:07   #309
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,558
Some of the NT info classes don't know the size, you just have to do something like: for (UINT s = 1024;; s *= 2) { p = alloc(s); if (!Ntxxx(..,p,s,..)) break; free(p); }

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Tags
handle, plug-in

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump