RE: File Rename failing with STATUS_OBJECT_NAME_INVALID

On the glance your code is seen well, but in your situation I would make a bit other:

  1. Make appropriate “ren X Y” operation and trace all IRP_MJ_SET_INFORMATION parameters (obviously including both FileObject(s)) and compare with yours.

  2. If would not help, add tracing flags on IRP_MJ_CREATE for source and target names.

Regards,
MG.