Mail Archives: cygwin/2009/11/03/10:44:57
On Nov 3 01:49, Jeffrey J. Kosowsky wrote:
> I know that there have been multiple threads about the pros/cons of
> being able to access XP/Vista style \\?\GLOBALROOT paths.
>
> However, not being able to access them limits one's abilities to use
> things like shadow copies since they create shadow devices that are only
> accessible by such a path. For example
> \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1
In Cygwin 1.7 you can do this for any subdir in your volume shadow copy:
$ ls -l //?/GLOBALROOT/Device/HarddiskVolumeShadowCopy1/subdir
It just doesn't work for the root directory of a drive due to internal
path handling restrictions. But there's a simple workaround. Use your
own tool as below.
> The only hack that I have found to get around this is to use an *old*,
> *unsupported* Microsoft routine called 'dosdev' which allows you to
> assign drive letters to devices, including using the GLOBALROOT
> format.
Try this:
$ cat > DefDosDevice.c << EOF
#include <stdio.h>
#include <windows.h>
int
main (int argc, char **argv)
{
DWORD flags = 0;
if (argc < 2)
{
fprintf (stderr, "usage: %s DosDevice [NTDevice]\n", argv[0]);
return 1;
}
if (argc == 2)
flags = DDD_REMOVE_DEFINITION;
else
flags = DDD_RAW_TARGET_PATH;
if (!DefineDosDevice (flags, argv[1], argc == 2 ? NULL : argv[2]))
{
fprintf (stderr, "Error %d\n", GetLastError ());
return 1;
}
return 0;
}
EOF
$ gcc DefDosDevice.c -o DefDosDevice
$ ./DefDosDevice X: '\??\GLOBALROOT\Device\HarddiskVolumeShadowCopy1
$ cd /mnt/x
$ ls
[...]
$ cd /mnt/c
$ ./DefDosDevice X: # this deletes drive X: again
Drive X: is not visible in Explorer, but you can access it from CMD and
any Cygwin process just fine. To make it visible in Explorer, assign
another drive letter using subst:
$ cmd /c subst W: X:\\
Afterwards you can access drive X: as drive W: from Explorer which,
for some reason, thinks it's accessing a "RAM Disk" on Windows 7.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -