* fhandler.h (MAX_PARTITIONS): New definition.

(class fhandler_dev_floppy): Add partitions array member.  Add close
	method.
	* fhandler_floppy.cc (fhandler_dev_floppy::fhandler_dev_floppy): Zero
	out partitions array.
	(fhandler_dev_floppy::open): Fix "entire disk" condition for call to
	DeviceIoControl (FSCTL_ALLOW_EXTENDED_DASD_IO).
	When opening disks for writing, call DeviceIoControl (FSCTL_LOCK_VOLUME)
	on all affected disk partitions starting with Vista.
	(fhandler_dev_floppy::close): New method.
	(fhandler_dev_floppy::dup): Duplicate handles in partitions, if any.
	* wincap.h (wincaps::has_restricted_raw_disk_access): New element.
	* wincap.cc: Implement above element throughout.
This commit is contained in:
Corinna Vinschen
2011-01-11 14:50:45 +00:00
parent 5837aa428f
commit 95a5c969ab
5 changed files with 112 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
/* wincap.h: Header for OS capability class.
Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
2009, 2010 Red Hat, Inc.
2009, 2010, 2011 Red Hat, Inc.
This file is part of Cygwin.
@@ -51,6 +51,7 @@ struct wincaps
unsigned has_mwmo_inputavailable : 1;
unsigned has_buggy_thread_startup : 1;
unsigned has_fast_cwd : 1;
unsigned has_restricted_raw_disk_access : 1;
};
class wincapc
@@ -107,6 +108,7 @@ public:
bool IMPLEMENT (has_mwmo_inputavailable)
bool IMPLEMENT (has_buggy_thread_startup)
bool IMPLEMENT (has_fast_cwd)
bool IMPLEMENT (has_restricted_raw_disk_access)
#undef IMPLEMENT
};