problem with a reparse point
Hi,
I'm getting crazy with this.
To create a reparse point I need to feel this structure according to the doc:
[StructLayout(LayoutKind.Sequential,Pack=4)]
public struct REPARSE_DATA_BUFFER
{
public uint ReparseTag;
public short ReparseDataLength;
public short Reserved;
public short SubstituteNameOffset;
public short SubstituteNameLength; // how many bytes the PathBuffer contains
public short PrintNameOffset;
public short PrintNameLength;
[MarshalAs(UnmanagedType.LPWStr)]
public string PathBuffer;
}
I marshall it withMarshal.StructureToPtr() into a buffer I pass to DeviceIoControl like this: For now I only get 4392 error. That means "The data present in the reparse point buffer is invalid" OK, but where I can find informations about the REPARSE_DATA_BUFFER. I made exactely what Mike Nordell did there in C++:
IntPtr pointer = Marshal.AllocHGlobal(16*1024);
Marshal.StructureToPtr(<my structure>,pointer,true);
But it does not work at all in my C# code. This is the snipped I'm using: DestDir = @" I don't know what is wrong, but where can I find the meaning of the REPARSE_DATA_BUFFER buffer fields? thank you
short DestDirSize = (short) (2 * DestDir.Length);
rdb = new REPARSE_DATA_BUFFER();
rdb.PathBuffer = DestDir;
rdb.ReparseDataLength = (short) (DestDirSize + 12);
rdb.ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
rdb.SubstituteNameLength = (short) (DestDirSize);
rdb.PrintNameOffset = (short) (DestDirSize + 2);

