Renaming A Running Process' File Image On Windows

后端 未结 6 689
北荒
北荒 2020-12-21 15:15

I have a Windows service application on Vista SP1 and I\'ve found that users are renaming its executable file (while it\'s running) and then rebooting, thus causing it to fa

6条回答
  •  鱼传尺愫
    2020-12-21 16:09

    There are two aspects to the notion of file here:

    1. The data on the disk - that's the actual file.

    2. The file-name (could be several or none) which you can give that data - called directory entries.

    What you are renaming is the directory entry, which still references the same data. Windows doesn't care about your doing so, as it still can access the data when it needs to. The running process is mapped to the data, not the name.

提交回复
热议问题