delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/08/18/08:49:45

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Mon, 18 Aug 2003 14:49:19 +0200
From: Marcel Telka <marcel AT telka DOT sk>
To: cygwin AT cygwin DOT com
Cc: Kiran Bacche <kiran DOT bacche AT wipro DOT com>
Subject: Re: Driver help
Message-ID: <20030818124919.GA1051@aragorn.etc.sk>
References: <DC91351678E31E4FB24B551221F507EC6D6B8B AT blr-itp-msg DOT wipro DOT com>
Mime-Version: 1.0
In-Reply-To: <DC91351678E31E4FB24B551221F507EC6D6B8B@blr-itp-msg.wipro.com>; from kiran.bacche@wipro.com on Po, aug 18, 2003 at 07:43:27 +0200
Lines: 47

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 AT telka DOT sk  |
|                homepage: http://telka.sk/ |
|                jabber:   marcel AT jabber DOT sk |
+-------------------------------------------+

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019