No refresh on renaming, deleting etc

From the linked thread, it's to do with how Kaspersky is configured to treat each process. It's probably not blocking the information being sent to the others but needs configuring to treat Opus the same.

You may need to ask Kaspersky for help, since we don't know why it is breaking notifications from the OS. We can only say that the information simply isn't arriving, and point to that thread which saw the same issue until Kaspersky was configured to allow the process to do more. (It shouldn't need turning off entirely.)

Unfortunately I not only can't turn KAV off but also can't adjust it anyway. It's my office PC and security can't allow me to do anything.
To contact Kaspersky... You know, I have almost nothing to come with. A personal nobody confirmed opinion 4 years ago on Windows 7 (where Windows 8 resolved the issue) and old .NET Framework (is Dopus .NET app?). My Windows 10 and brand new KAV are not the same. I would believe Kaspersky even didn't open a ticket.
As I see the main problem is not in KAV (and the other side software) but in your app. If Total Commander and Adobe Bridge (a sort of file explorer) can do renaming etc with no issues but your app can't I'm sure it's something wrong inside...
Anyway If you can't help me I have to stay on Total Commander. So sad but I got nothing to do...

I've written a test app you can use to see if the same problem affects a simple, standalone piece of code:

It might be worth renaming ChangeTest_64.exe to dopus.exe when testing, in case the exe name is important (although it could be a lot of other things that trigger antivirus to treat one process differently to another, e.g. initialising Winsock or something).

Source code is included to verify how it works, and that it isn't doing anything complicated. It's just reporting the raw output from the Windows API.

If it's working correctly, you should see two lines for each rename, one with the old name and one with the new name:

If you see the same problems with that, then you can be 100% sure something on the system is broken, and have a very simple and verifiable case to send to Kaspersky's support.

If you get different results in that compared to Opus, that would be strange since Opus and this code are doing the exact same thing (other than all the other things Opus does, which should not affect things unless antivirus is triggered into a different behavior by something Opus does).

1 Like

Many thanks for your patience. Just tested. Despite the name of the app: original, Dopus, totalcmd etc... the app returns only FILE_ACTION_RENAMED_NEW_NAME and FILE_ACTION_MODIFIED confirmation. And don't return FILE_ACTION_RENAMED_OLD_NAME.
I may agree it's a not exactly ok. But:

  1. It don't affect the other apps. At least I can't see it.
  2. Nobody can confirm it's a Kaspersky fault. So it's a bit not smart to email them: "My OS don't send message FILE_ACTION_RENAMED_OLD_NAME. Please fix it"
  3. As I said the other file managers don't need this OS message and works ok without it. Being a coder a bit I may wonder why do you still need a message with an old name?
    a) When a user try to change a name in the lister you know this old name for sure and the new name as well.
    b) You send a request to OS with the old and the new name.
    c) You only need a confirmation from OS that this renaming is successfully done. So mesages FILE_ACTION_RENAMED_NEW_NAME and FILE_ACTION_MODIFIED are enough.
    b) You should tell the lister to show the new file name and hide the old file name and voila everything fixed.
    c) The same with a deletion I can't test with the app provided. You need only a confirmation from OS that a deletion is succeed. And then you tell a lister to hide the file removed.

As I think it's not so difficult to perform.

If you don't get the "old name" message there's no way to tell which file is being renamed. Should we just pick one at random?

Your operating system is broken, and we can't fix it. There's a post from someone confirming Kaspersky can cause this exact problem, and you're running Kaspersky. It's the best lead there is.

Note that I didn't go looking for Kaspersky issues here. I searched for possible causes of the rename old-name data being missing and found Kaspersky.

The post about Kaspersky says it affected both .Net's object for change notification and a custom C++ app the same person wrote as a test to check it wasn't specific to .Net or his original code. Similar to the C++ Change Test I wrote, which confirms the issue has nothing to do with Opus, at least, and is your OS not sending the right information, at least to some apps.

The post about Kaspersky also explains how he fixed things by changing the per-app settings in Kaspersky. So you can try doing the same thing for either the Change Test exe or Opus to confirm that the problem really is Kaspersky before contacting them. Then you'll have more proof.

And, to be blunt, you have more reason to contact them about this issue than us at this point, now it's proven the issue is not specific to Opus and that ReadDirectoryChangesW is being broken on your system for multiple applications (even if not all of them, which just points to antivirus even more, seeing as it has rules and exceptions for different apps) in a way which there's evidence can be due to Kaspersky.

Not at all. When you send a request to OS to rename a file you send: a) old name with a path and b) new full name. You may store this info temporarily. So when you get a response from os with a new name you easily get an old name. It’s easy.

Once more. If it were impossible the other file managers couldn’t do it. But they do.

If another program renames the file, what do we do then?

And there are a million places even in our own code which rename files, some in libraries or components we don't control. We can't depend on every single place that might rename a file replicating the notification system built into the OS (and causing duplicate notifications on working systems!) just to work around a broken operating system on one person's machine.

It works in SOME other software either because they use another mechanism or, more likely because Kaspersky is configured (probably out of the box) to treat them differently. If Kaspersky broke Explorer they'd notice and fix it. Maybe someone reported the problem with TC and they added to the default configuration to fix that as well, but no one has reported the Opus issue to them yet, or the issue with .Net apps, or other things.

  • Your OS is broken and Kaspersky looks like the likely cause. We cannot fix a broken OS and we are not going to redesign the program around it. You need to fix your OS.

  • This does and will affect other software, not just Opus. Ignoring it or wanting one program to add a workaround will just mean you run into problems in something else later.

  • Try configuring Kaspersky to be less restrictive to Opus (or the Change Test exe) as per the StackOverflow thread. That will confirm my theory.

Just nothing. The only issue I'm hurted is renaming and deleting files by myself from a Dopus lister. Nothing else. I think it's the one and only place in your code.
I realized it's not your problem and you're not going to do something with it. But if you one day when you got nothing to do would find a time to fix it I would be very happy.
As I said I can do nothing with KAV (and OS) on my PC. It's not my property. I may only adapt.