|
-
July 17th, 2008, 04:37 AM
#16
Re: Regarding assigning a drive letter to a partition
 Originally Posted by fransn
I already told you you are on the right track with DefineDosDevice.
There are 4 other functions that you will need that are part of the same API as DefineDosDevice. Writefile is not one of them.
Fransn - are these 4 functions a secret? Why can't you just tell him what they are?
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
July 17th, 2008, 07:24 AM
#17
Re: Regarding assigning a drive letter to a partition
Well I very well know those 4 functions. But those doesnt solve my problem. coz those 4 functions are in regarding to the drive letters only. And I am looking for somthing that can move my partitions fast as well as efectively.
And the problem is with the drive letters is that I am mentioning here:
Suppose I am having 4 drives in my system naming "C,D,E,F,G"
Now suppose I am moving (E drive to other location and after updating the partition table, windows generate a new drive letter and assign that in place of (E say suppose (L .
Now programmatically How will I identify Which new drive letter is assigned to my recently moved partition? so that I can change back that to the previous Letter. I have the previous drive letter with me, but not the new one!!!
This deleting and assigning the old drive letter can be done with "SetVolumeMountPoint","DeleteVolumeMountPoint". But for this I need to identify the new Drive letter.
Hope you all must have understood my problem!!!!
Thanks
-
July 17th, 2008, 07:36 AM
#18
Re: Regarding assigning a drive letter to a partition
You could use QueryDosDevice and GetVolumeNameForVolumeMountPoint to iterate through your partitions until you find the new one and change that back to the old letter.
-
July 17th, 2008, 11:31 PM
#19
Re: Regarding assigning a drive letter to a partition
could you please elaborate your suggestion.
See what happens that whenever I moves a partition, a new GUID as well as a new drive letter is generated at : "HKLM\SYSTEM\MountedDevices" . Now how can I find a new GUID with "QueryDosDevice" and "GetVolumeNameForVolumeMountPoint"?
Should I keep all the guids with me before moving the partition so that to compare after moving the partition?
-
July 18th, 2008, 05:33 AM
#20
Re: Regarding assigning a drive letter to a partition
Well I know to get the list of current drive letters by using a function"GetLogicalDrives()"
But it returns the value in the Dword.
In my case the value its returning is 34780
This also I know that to identify the drive letters first convert this digit to binary, then starting from the least significant bit towards its left i start reading the values. least significant bit is drive letter A,next to it is B: and so on. 0 represents non existing and 1 represents existing.
Can anyone can show me how to convery this DWORD value to the assigned drive letters PROGRAMMATICALLY. I am not able to write code for this.
Thanks
-
July 19th, 2008, 06:45 AM
#21
Re: Regarding assigning a drive letter to a partition
what my problem is suppose I have 2 hard disk connected in my PC
They both having 4 partitions each.
by using the function "GetLogicalDrives" I can get the drive letters of all the partitions. Say suppose C:,D:,E:,F:,G:,H:,I:,J:.
Now the problem is how I am going to identify which drive letters belongs to which Hard drive?
If I just want to have the drive letters of the "PhysicalDrive0" how I am going to differentiate. Is there any function through which I can get the Disk number from drive letters???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|