X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; q=dns; s=
	default; b=HRuNSMucwI9ifG5sYhFlyUofrYaOmQYk7+OJVAvzxkZLesdfU1/kR
	MLJWmunPmn6+206QnUfbsxAdBkX6uGjRK2YooL/VS5LxLL6u6OPjVeWNhEOxWXG2
	snZUz1GOCXwbj6MxJqI3VxWipm3RgXyKYE314H6aM2bvQjYNKTLofI=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; s=default;
	 bh=ZCscpns/AY1W4Gaz19yW494oATg=; b=y3qGy3GU0+EcUKYf/9zAd/irU1O0
	WAFA5KW1wERL9HIfkfPAUbnaxkulSilDbeC0OJG3ErLf1/j8m6LLQGK/pYEX83uO
	ctX2R/S0U6uHyD0Y4WBNA8QqUPhylzRh3saplfVV2PFug4rQZ3AVUvvzfTg3NVnN
	3s4yENm6Bx6mrug=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Thu, 28 May 2015 12:04:43 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: File operations on a Windows Driver (character device)
Message-ID: <20150528100443.GP16927@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <CACs=mWDRGh9KZBT45=8yy4J6h62v0RNYxczV91qRhhb8LcfY4Q@mail.gmail.com> <5559FB9E.3040200@cygwin.com> <CACs=mWCO8ejvsufP3C_HFAiKDrcsanGZ+J_EuQQGOm+u30T_zg@mail.gmail.com> <20150527120908.GE16927@calimero.vinschen.de> <CACs=mWCdm8HV_AUfEbsY97oSXKE=CTWNHbc1AySDkdydnHcPkg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;	protocol="application/pgp-signature"; boundary="w6U88vdWm8UqIXvc"
Content-Disposition: inline
In-Reply-To: <CACs=mWCdm8HV_AUfEbsY97oSXKE=CTWNHbc1AySDkdydnHcPkg@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)

--w6U88vdWm8UqIXvc
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On May 27 17:56, Alessio Faina wrote:
> Thanks Mark and Corinna.
> I'm sorry for the
> <https://cygwin.com/acronyms/#TOFU> and
> <https://cygwin.com/acronyms/#PCYMTNQREAIYR>.,
> I wont make those mistakes in the future, I promise.
>=20
> Returning on the issue, I've decided to open the device with the
> open() provided by Cygwin
> and then intercept the IOCTLs and change them with the Win32
> DeviceIoControl (using
> _get_osfhandle() for the handle of the device).
> At this point I can even implement the mmap with an IOCTL without
> problems as I explained
> in a previous mail.
> I cannot use the read/write calls because I need to access the kernel
> memory directly with
> the mmap; in this way I can get better performances.
>=20
> The last (and main) problem I'm facing is the poll()/select(); I've
> seen that doing a poll() on
> this kind of device always returns "1" because in
> select.cc->select_stuff::poll() the function
> pointer s->peek is NULL and in that way the counter "n" is always increas=
ed.
>=20
> What I need to do is something that can be compiled under VS2013 and
> under Cygwin
> for compatibility with applications already written for linux OS;

That's a problem.  For Cygwin to recognize a device it needs support in
CYgwin itself.  What you probably need to write is some kind of
userspace access library which translates the required POSIX calls to
Windows calls when accessing your device.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--w6U88vdWm8UqIXvc
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJVZug7AAoJEPU2Bp2uRE+gxLgP/ApE61iwcOyAtMHASJJh/E8I
+TejHW3ft3CDdxq79OqdGcqgyeUeeGcLEEdFmH3H8DTkoSxPpviULYjWUUWZAUCX
GEPXmAvSPum3ntiGwMFxCgGtzlpSaswR5WNIfvTlyVXTvNpaX2cyq/eZBQLbk09E
ZEdf1ukGdHpUKiheNHO+/+iPO8WjkFeRATv6BSrHKg+/yTyTUnuq+wrHtNXyMr+a
isatCLfKzxHyzb3W4uFNrWKn5shvsGJb58MPoOJVmRcj6UrUE4lBMndUVJkiwb07
DwF+objzXn8pcDROjgxDdplTm3badIUgU5blSJgw2DVClynTOsVReAPiPnGzZZQU
2qNRQk3dMee501+2VKpdJlEDsHla6OZ7/oQR6n9v0v9tTY7+RxmnAPTwVcByl97p
CCBaubkPigLEGsQ4ZID6hOyhTt/miMcPYe3kufcOLyVvWsb+id6hyDeBkBx9sBFP
hI0KUOXG2tBCZux2S8CLx3fYna3zAmiL6dMy1VUZS36CcnTjMh/Qp5m3FKjZ0IK4
8inHj4/z1zkXsjgFLcwXhT0eRHZUPji2AyJR8ApeMzBGQTeX9e3hWnnSyYC0tgGW
DKvNctbo6krfbdlU0LWUQti7RWntjXkhjuRWqUU+XNB+/AgrrCChwiaUrZWwrqOj
iBEz08PINFPVjHTprQN9
=ySdZ
-----END PGP SIGNATURE-----

--w6U88vdWm8UqIXvc--
