The documented public contract supports this conclusion: D. this exact interaction is not fully specified by the public Windows contract.
Supported facts from the documentation:
-
FILE_LINK_POSIX_SEMANTICSapplies only whenFILE_LINK_REPLACE_IF_EXISTSis also specified. - With both flags set, the documentation says the operation can replace an existing file even if there are existing handles to it.
- After such a replacement, existing handles to the replaced file continue to be valid for operations such as read and write, and subsequent opens of the target name open the new link, not the replaced file.
What the provided documentation does not say:
- It does not state that
FILE_LINK_POSIX_SEMANTICSoverrides or bypasses aFILE_SHARE_DELETErequirement on existing handles to the destination object. - It does not define a normative share-access check against the existing destination file object A during replacement.
What MS-FSA does specify in the provided material:
- For
FileLinkInformation, when opening the destination directory, the specifiedShareAccessisFILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE. - In product behavior notes, Windows 11 and earlier and Windows Server 2022 and earlier can fail the operation with
STATUS_SHARING_VIOLATIONbecause of how the destination directory is opened:- for
FileLinkInformation, if there is a pre-existing handle withFILE_SHARE_DELETEaccess on the destination directory; - for
FileRenameInformation, if there is a pre-existing handle withDELETEaccess on the destination directory.
- for
That is a directory-open behavior note, not a documented rule for the existing destination file object being replaced.
So, for the specific questions:
- Does
FILE_LINK_POSIX_SEMANTICSchange or overrideFILE_SHARE_DELETEcompatibility for the existing destination object?
No such override is stated in the provided documentation. - Is removal/replacement of A’s directory entry subject to the sharing mode of existing handles to A?
The provided documentation does not define that point. - Is handle survival after POSIX replacement independent from whether replacement was permitted in the first place?
Yes, as a specification reading. The docs state what happens if replacement occurs: old handles remain valid and new opens resolve to the new link. They do not state the permission/share conditions that guarantee replacement is allowed against an already-open destination file. - Does MS-FSA define a normative share-access or delete-sharing check for the existing destination during POSIX hard-link replacement?
Not in the provided material. The provided MS-FSA text specifies opening the destination directory and its share access, but not a normativeFILE_SHARE_DELETEcheck for the already-existing destination file object. - Which layer defines the relevant behavior?
In the provided material, the API/structure documentation defines the exposed flag semantics, while MS-FSA defines protocol/file-system algorithm details such as destination-directory opening. For the exact question about an already-open destination file denyingFILE_SHARE_DELETE, the provided public material does not define a complete contract. - Is the result guaranteed by the documented Windows/NTFS contract?
No. Based on the provided documentation, the guarantee is limited to the stated POSIX replacement effect once replacement is allowed. The exact interaction with an existing destination handle that does not allowFILE_SHARE_DELETEis not documented here as a guaranteed Windows/NTFS contract.
So the closest specification-level answer is:
- Not A: there is no provided documentation stating replacement must fail because the destination denies
FILE_SHARE_DELETE. - Not B: there is no provided documentation stating POSIX semantics override that sharing restriction.
- Not C: no other decisive documented condition for the existing destination file is provided here.
- Therefore D: this interaction is not specified in the provided public documentation.