(why) is FSCTL_SET_OBJECT_ID dangerous? (why) is FSCTL_SET_OBJECT_ID dangerous? windows windows

(why) is FSCTL_SET_OBJECT_ID dangerous?


I really don't think this can directly result in loss of data.

The only way I can imagine it being possible is if e.g. a backup program assumes that (1) every file has an Object Id, and (2) that the program is keeping track of all IDs at all times. In that case it might assume that an ID that is not in its database must refer to a file that should not exist, and it might delete the file.

Yeah, I know it sounds ridiculous, but that's the only way I can think of in which this might happen. I don't think you can lose data just by changing IDs.


They are used by distributed link tracking service which enables client applications to track link sources that have moved. The link tracking service maintains its link to an object only by using these object identifier (ID).

So coming back to your question,

Is it talking about potential object id collisions in the file system ?

I dont think so. Windows does provides us the option to set the object IDs using FSCTL_SET_OBJECT_ID but that doesnt bring the risk of ID collision.Attempting to set an object identifier on an object that already has an object identifier will fail.

.. and does NTFS rely on them in some way?

Yes. Object identifiers are used to track files and directories. An index of all object IDs is stored on the volume. Rename, backup, and restore operations preserve object IDs. However, copy operations do not preserve object IDs, because that would violate their uniqueness.

How can this result in loss of data?

You wont get into a serious problem if you change(or rather set) object ID of user-created files(as you did). However, if a user(knowingly/unknowingly) sets object ID used by a shared object file/library, change will not be reflected as is.

Since Windows doesnt want everyone(but developers) to play with crutial library files, it issues a generic warning:

Modifying an object identifier can result in the loss of data from portions of a file, up to and including entire volumes of data.

Bottom line: Change it if you know what you are doing.

There's another msn article on distributed link tracking and object identifiers.

Hope it helps!

EDIT:

Thanks to @Mehrdad for pointing out.I didnt mean object identifiers of DLLs themselves but ones which they use internally.

OLEACC(a dll), provides the Active Accessibility runtime and manages requests from Active Accessibility clients[source]. It use OBJID_QUERYCLASSNAMEIDX object identifier [ source ]