![]() Source control plug-ins may also be at fault. Symantec AV is something I've seen doing this before, and I wouldn't be surprised if other AV programs were also to blame. Now, if Explorer seems to be the culprit here, it may be the case that that's just on the surface, and that the true culprit is something that installs a shell extension that opens all files in a folder for it's own purposes but is either too gung-ho in doing so, or that doesn't clean up properly after itself. If you don't specify the flag, the program takes exclusive access of the file. Perhaps it's a consequence of the design of CreateFile, but done is done and we can't go back.īasically when opening a file in a Windows program you have the option to specify a flag that allows shared access. Just to clarify, this is more likely to be a result of misbehaving 3rd party apps not using the CreateFile API call correctly than it is to be anything in Windows itself. ![]() Source of the corruption is that you forced a handle closed. ![]() Service corrupts its indexes and configuration files, unaware that the Poor technician is assigned the hopeless task of figuring out why the Logging, and the configuration file was overwritten with garbage. The index has been corrupted, the log file has mysteriously stopped Longer the service runs, the more corrupted its indexes become.Įventually, somebody notices the index is returning incorrect results.Īnd when you try to restart the service, it fails because itsĬompany that makes the search index service and they determine that Is closed and the protections against data corruption are lost. When the original file handle is closed, the mutex handle Meanwhile, another handle you forced closed was reusedĪs a mutex handle, which is used to help prevent data from beingĬorrupted. ![]() The logged information goes into the configuration file, Log file handle was closed and the handle reused for its configurationįile. Log some information, so it writes to its log file. The handle for the log file gets recycled as the Operation finally completes, and the search index service finally getsĪround to closing that handle it had open, but it ends up unwittinglyįile, say a configuration file for writing so it can update some Log file in order to record some information, and the handle to theĭeleted file is recycled as the handle to the log file. Gotten stuck temporarily and you want to delete the file, so you Suppose a search index service has a file open for indexing but has So, this "invalid handle" thing is happening after the cred is passed.Just be very careful with closing handles it's even more dangerous than you'd think, because of handle recycling - if you close the file handle, and the program opens something else, that original file handle you closed may be reused for that "something else." And now guess what happens if the program continues, thinking it is working on the file (whose handle you closed), when in fact that file handle is now pointing to something else. It isn't that the user/psw isn't matching, because when I provide a bad psw, for example, it catches it. ![]() Si.WorkingDirectory = txtWorkingDir.Text ProcessStartInfo si = new ProcessStartInfo(buildApp, buildArgs) Ĭhar psw = () Here's the code that fills the start info: Process p = new Process() When I allow the credentials to default to current user I get no such error, and the process I start works to the extent that it doesn't need to use credentials (the creds are necessary for mapping a drive in an MSBuild script). 32Exception: The handle is invalidĪt (ProcessStartInfo startInfo) I have an Windows Form application that supplies the User Name, Domain, and Password to the StartInfo, and it throws this: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |