Driver help
Marcel Telka
marcel@telka.sk
Mon Aug 18 15:06:00 GMT 2003
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 |
+-------------------------------------------+
--
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/
More information about the Cygwin
mailing list