drive masking

This is a discussion on drive masking within the Windows Programming forums, part of the Platform Specific Boards category; If we were to obtain permission to utilize drive masking as mentioned in the earlier thread, ie, permission from the ...

  1. #1
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401

    drive masking

    If we were to obtain permission to utilize drive masking as mentioned in the earlier thread, ie, permission from the software producer, would the programming discussion be allowed to continue? I ask merely out of curiosity in the rules of this forum.
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Hammer and I talked via the board PM. Basically the problem wasn't the drive masking, but the assumtion that "tracking disks" don't use standard file formats and as such what I was asking would be considered trying to bypass the security protcools (spelling?) of the program.

    In my case that assumtion was wrong, but since the questions had been answered before it got locked there was no reason to reopen it.

  3. #3
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    When I was browsing another topic I came accross this which may help you.
    http://msdn.microsoft.com/library/en...ssignments.asp

    http://msdn.microsoft.com/library/en...evice_name.asp

    By the way, when I originally posted I thought a tracking disk was something totally different. What sort of sotware uses one of these tracking discs. Why?

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Yep, the following code gets rid of A: drive so it can be used with subst. Now I've got to figure out how to get it back! I'll post back when I figure it out.
    EDIT : The code required admin privliges and Win2000/XP/2003
    Code:
    // define the _WIN32_WINNT macro as 0x0500 or later.
    int main() {
       BOOL bFlag;
    
       bFlag = DeleteVolumeMountPoint(
                  "A:\\" // Path of the volume mount point
               );
    
       printf ("%s %s in unmounting the volume at %s.\n",
               "A:\\", bFlag ? "succeeded" : "failed", "A:\\");
    
    	printf("Error: %d", GetLastError());
    
    	getchar();
       return (bFlag);
    }

  5. #5
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Whew, 20 minutes of panic! My floppy drive is back. Hopefully it won't dissapear at the next reboot. The code to fix something is always a lot more complex than the code to break it.

    Code:
    int main() {
    
    	BOOL bFlag;
    	char szUniqueVolumeName[MAX_PATH];
    
    	bFlag = DefineDosDevice (DDD_RAW_TARGET_PATH, "A:",
                                     "\\device\\floppy0");
    
    	if (!bFlag) printf("definedosdevice failed: %d\n", GetLastError());
    
    
    	if (!GetVolumeNameForVolumeMountPoint ("A:\\",
                      szUniqueVolumeName,
                      MAX_PATH)) {
    		printf("Failed to get volume name: %d", GetLastError());
    	}
    
    
    	bFlag = DefineDosDevice ( 
                          DDD_RAW_TARGET_PATH|DDD_REMOVE_DEFINITION|
                          DDD_EXACT_MATCH_ON_REMOVE, "A:",
                          "\\device\\floppy0");
    
    	if (!bFlag) printf("definedosdevice remove failed: %d", GetLastError());
    
    	bFlag = SetVolumeMountPoint ("A:\\", szUniqueVolumeName);
    	printf("Result: %d, %d", bFlag, GetLastError());
    
    	getchar();
    	return 0;
    }

  6. #6
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    All the tracking disk (for the program I brought up) does is keep track of your scores for the interactive lab, bookmarks from the electronic book, and a few other things.

    Thanks for the code. Will look at it when I have time (which isn't in abudence anymore)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SATA HDD failure
    By PING in forum Tech Board
    Replies: 4
    Last Post: 12-23-2008, 12:25 AM
  2. Detect SCSI Hard Drive Serial Number
    By mercury529 in forum Windows Programming
    Replies: 3
    Last Post: 10-17-2006, 07:23 PM
  3. Replies: 2
    Last Post: 07-06-2005, 08:11 PM
  4. Spin A Drive and such
    By Seph_31 in forum C Programming
    Replies: 15
    Last Post: 11-20-2003, 06:04 PM
  5. drive masking
    By Thantos in forum Windows Programming
    Replies: 4
    Last Post: 09-17-2003, 04:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21