Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0
content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="koi8-r"
Subject: RE: Driver help
Date: Tue, 19 Aug 2003 09:29:13 +0530
Message-ID: <DC91351678E31E4FB24B551221F507EC6D6C78@blr-itp-msg.wipro.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
From: "Kiran Bacche" <kiran.bacche@wipro.com>
To: "Marcel Telka" <marcel@telka.sk>, <cygwin@cygwin.com>
X-OriginalArrivalTime: 19 Aug 2003 03:59:14.0157 (UTC) FILETIME=[40EC49D0:01C36606]
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h7J40W017434


Thanks Marcel Telka,
I am now able to successfully do CreateFile(...)..with my loaded driver.

Cheers
  Kiran

-----Original Message-----
From: Marcel Telka [mailto:marcel@telka.sk] 
Sent: Monday, August 18, 2003 6:19 PM
To: cygwin@cygwin.com
Cc: Kiran Bacche
Subject: Re: Driver help


Hi Kiran.

On 2003.08.18 07:43, Kiran Bacche wrote:
> The ioperm package was very helpful. Thanks for that.
> U was now able to compile a sample driver into a .sys file.
> I used the SCOpenManager and CreateProcess to get it loaded.

Try use CreateService() to install the driver and StartService() to 
start it. And please see admin directory in ioperm sources.

> 
> So in effeect, when a write an application program
> hPort = CreateFile(
>                        "\\DosDevices\\mydevice",
>                        0,
>                        0,
>                        NULL,
>                        0,
>                        0,
>                        NULL);
> 
> if (hPort == (HANDLE)-1)
>     {
>     printf("Open failed :%lx\n",hCommPort);
>     return -1;
>     }
> 
> I thought it would succeed. But CreateFile failed!
> 
> What may be the reason? A snippet of the CYGWIN code for win driver is
> as follows:
> 
>  RtlInitUnicodeString( &DeviceName, L"\\Device\\mydevice" );
>  RtlInitUnicodeString( &SymbolicLinkName, L"\\DosDevices\
> \mydevice" );
>  IoCreateDevice( DriverObject, 0, &DeviceName, ...
>  IoCreateSymbolicLink( &SymbolicLinkName, &DeviceName...


Regards.

-- 
+-------------------------------------------+
| Marcel Telka   e-mail:   marcel@telka.sk  |
|                homepage: http://telka.sk/ |
|                jabber:   marcel@jabber.sk |
+-------------------------------------------+

**************************Disclaimer************************************

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***************************************************************************

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

