Dear All,
I am working on a FileDisk program.
It creates a disk and assigns it a drive letter . Now i want to remove
drive letter from it. ie I
want to delete the symbolic link so as to delete the drive letter . For
this I am using following
code:
DEVICE_NAME_DEFINE \Device\Harddisk0\Partition1
UNICODE_STRING linkString;
RtlInitUnicodeString( &linkString, DEVICE_NAME_DEFINE);
IoDeleteSymbolicLink( &linkString );
The code is not throwing error and at same time is not working. Is there
any modifcation to be
done in above code ??
Alternatively please suggest any other method to achieve the same.
Thanks in advance.
Rohit
You must provide symbolic link name not symlink target name for
IoDeleteSymbolicLink. I.e. for your occasion the must look like this:
UNICODE_STRING SymbolicLinkName = RTL_CONSTANT_STRING(L"I:");
IoDeleteSymbolicLink(&SymbolicLinkName);
-htfv
----- Original Message -----
From: “Rohit”
To: “File Systems Developers”
Sent: Friday, June 06, 2003 12:11 PM
Subject: [ntfsd] Deleting Symbolic links
> Dear All,
>
> I am working on a FileDisk program.
> It creates a disk and assigns it a drive letter . Now i want to remove
> drive letter from it. ie I
>
> want to delete the symbolic link so as to delete the drive letter . For
> this I am using following
>
> code:
>
>
> DEVICE_NAME_DEFINE \Device\Harddisk0\Partition1
>
> UNICODE_STRING linkString;
> RtlInitUnicodeString( &linkString, DEVICE_NAME_DEFINE);
> IoDeleteSymbolicLink( &linkString );
>
>
> The code is not throwing error and at same time is not working. Is there
> any modifcation to be
>
> done in above code ??
> Alternatively please suggest any other method to achieve the same.
>
> Thanks in advance.
>
> Rohit
>
> —
> You are currently subscribed to ntfsd as: xxxxx@vba.com.by
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
There is another way to do the same, try it.
DefineDosDevice(DDD_REMOVE_DEFINITION, Drive_Letter, NULL);