WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Win7

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

WIL DLL Open File Issue

 Keywords:  Opportunistic Locking OpLocks Network Share WIL WBD DLL Open File Problem Issue Windows 7 Server 2003 SP2 

Question:

I've compiled a winbatch on my Windows XP 32b laptop. The executable is located on a W2003SP2 share. When I run the executable from my XP-laptop (32b) everthing works fine. When I run the executable on my new future Laptop with Windows 7 Enterprise 64bits, the program seems to work fine. It starts and it ends. But when I check the 'Open Files' on the W2003SP2 server, I see the following:
\WBDKA44I.DLL   Test1  Windows  0  READ
\WWWNT44I.DLL   Test1  Windows  0  READ
Why is this? Can it be undone through the Winbatch?

Answer:

Difficult to say what is going on. There isn't enough information provided to make a determination.

Could you provide some further details ( please answer ALL of the questions ):

  1. Specify the version of WinBatch you are running.
  2. Which compiler did you use to create your exe: 32-bit or 64-bit?
  3. Could you please download and run this Handle tool: http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx.
    • Run your exe and confirm that it has terminated completely in Task Manager on win 2003.
    • You must have administrative privilege to run Handle. Open cmd.exe using ‘Run as administrator’.
    • You run Handle by typing: "handle.exe" -a >"C:\handles.txt"
    • This will pipe all of the results out to a file. email us the resulting handles.txt file.
  4. Which antivirus tool is installed on your Windows 7 system. I've seen client side AV cause seriously nasty locking behavior on shares. Does disabling this AV tool have any effect?
  5. What is the name of your compiled EXE?
If the WinBatch EXE has actually shut down (i.e., it is no longer listed in Taskmanager) then there isn't much we can do about it. The Windows kernel handles unloading dlls once a process terminates. It may be that Windows 7 caches dlls accessed from shares to improve performance or something but that is out of the control of WinBatch.

One possible theory is that it is an SMB issue. SMB 2.1 (Windows 7) has a performance 'enhancement' that does opportunistic locking (oplocks) of files. However, since the user dlls are on a Windows 2003 system the client/server connection should be using SMB 1.whatever which, I think, may have some but different oplock support. Maybe Windows 7 is trying to use opportunistic locking even with the old protocol or maybe it is something entirely different. There is supposed to be a way to disable oplocks. No guarantee this will help but it would be helpful to know even if it doesn't. Check out: http://support.microsoft.com/kb/296264

We conducted a quick test using Windows 7 and Windows 2003 by running a compiled exe launched from a Win2k3 share on my Win7 machine. The dll file handles hung around for less than a minute after the exe terminated.

UPDATE

The user responded with answers to all of the above questions and also included a handles.exe output. It looks like his antivirus tool (Symantec Endpoint Protection) may be the cause, because temporarily disabling it reolved the issue. We inspected the handles.txt file and were unable to locate any reference to any WIL dlls.
Article ID:   W18442
Filename:   WIL DLL Open File Issue.txt
File Created: 2013:04:03:12:04:02
Last Updated: 2013:04:03:12:04:02