From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GMtin-0000Nx-VO for qemu-devel@nongnu.org; Mon, 11 Sep 2006 17:53:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GMtim-0000MI-8K for qemu-devel@nongnu.org; Mon, 11 Sep 2006 17:53:41 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMtim-0000MD-3W for qemu-devel@nongnu.org; Mon, 11 Sep 2006 17:53:40 -0400 Received: from [81.29.64.88] (helo=mail.shareable.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GMtk7-0008PL-Sm for qemu-devel@nongnu.org; Mon, 11 Sep 2006 17:55:04 -0400 Received: from mail.shareable.org (localhost [127.0.0.1]) by mail.shareable.org (8.12.11.20060308/8.12.11) with ESMTP id k8BLrZO5008937 for ; Mon, 11 Sep 2006 22:53:35 +0100 Received: (from jamie@localhost) by mail.shareable.org (8.12.11.20060308/8.12.8/Submit) id k8BLrZGP008935 for qemu-devel@nongnu.org; Mon, 11 Sep 2006 22:53:35 +0100 Date: Mon, 11 Sep 2006 22:53:35 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] QCOW/QCOW2 for win32 Message-ID: <20060911215335.GA8409@mail.shareable.org> References: <000601c6d244$b9eddb20$0464a8c0@athlon> <20060911002819.GA6378@mail.shareable.org> <000a01c6d563$b8fffaa0$0464a8c0@athlon> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000a01c6d563$b8fffaa0$0464a8c0@athlon> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Kazu wrote: > > Kazu wrote: > >> Patch. > >> http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20060906-qcow.patch > > > >>> #ifdef QEMU_TOOL > >>> - overlapped = 0; > >>> + overlapped = FILE_ATTRIBUTE_NORMAL; > >>> #else > >>> overlapped = FILE_FLAG_OVERLAPPED; > >>> #endif > > > > I suspect the second value should be (FILE_ATTRIBUTE_NORMAL | > > FILE_FLAG_OVERLAPPED). But I'm no Win32 expert. > > I think FILE_ATTRIBUTE_NORMAL is only used without other options. I think that is true only for "attribute" options, i.e. those beginning with FILE_ATTRIBUTE_* and not those beginning with FILE_FLAG_*. The Microsoft CreateFile documentation is not very clear: "FILE_ATTRIBUTE_NORMAL: A file does not have other attributes set. This attribute is valid only if used alone.". But it does distinguish between attributes and flags. It also explains that the attributes are only used when creating a file, not when opening an existing one. Whereas the flags affect the operation of open file handles, even if the file already exists. But as I say, I'm no win32 expert. -- Jamie