Dave,
Thanks for the help - does this mean that you don’t agree with the
response that said - and I quote “GenPort is a PNP driver, so this will
not work. You are going to have to use the PNP API’s”
I have been trying to load the driver using the DevCon utility and
getting nowhere, so your news makes me hopeful. When I try to install
the driver with DevCon, it either loads with unknown device or loads as
the correct device and driver, but assigns a different address. I want
to use the same addresses that the ECP Printer Port is using (In my case
378,379 and 37A) I was able to do this a few weeks ago by installing the
driver through the Device Manager, but I need to be able to install,
start, stop and remove the driver from a DLL.
Thanks,
Stacy
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Wednesday, August 31, 2005 12:14 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Re:Loading a kernel-mode driver from a DLL
Stacy,
The driver path should be something like
“\SystemRoot\System32\Drivers\genport.sys” (or, in C notation)
“\SystemRoot\System32\Drivers\genport.sys” )
The “\” in the name is being interpreted as the start of a UNC path.
Clearly there is not machine named “Windows” from which you wish to load
the
driver from!
The error is exactly correct: What you have said is the path to the
image
file for the driver is a “bad network path” since it does not exist.
The
problem is that the image path should be a ‘local’ path.
Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Stacy
Sent: Wednesday, August 31, 2005 10:09 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Re:Loading a kernel-mode driver from a DLL
Yes, I am attempting to install the driver with OpenSCManager,
CreateService, OpenService, StartService and then CreateFile. The
driver is
the genport.sys sample driver from the Microsoft DDK. This sample
driver
comes with a setup file genport.inf (I am not at all sure how to use
that
file when loading a driver programmatically).
The OpenSCManager, CreateService and OpenService calls all return
successfully. My driver name is genport, the path is
\\windows\system32\drivers\genport.sys
The problem is with the StartService call, which returns error # 53
(ERROR_BAD_NETPATH)
Any help would be so greatly appreciated,
Stacy
“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
> Why not? Use CreateService to install.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
> ----- Original Message -----
> From: “Stacy”
> Newsgroups: ntdev
> To: “Windows System Software Devs Interest List”
> Sent: Wednesday, August 17, 2005 12:16 AM
> Subject: Re:[ntdev] Loading a kernel-mode driver from a DLL
>
>
>> OK - here’s is what I have discovered when trying to use the existing
>> parallel port driver, after sorting out my problem with header files
>> (learn
>> something new every day - I needed to add my header files to stdafx.h
>> which
>> was created by the .net wizard). Anyway, I can’t read/write the I/O
port
>> using the existing driver. What happens is that the console
application
>> I
>> wrote to try to quickly test this hangs, have to CTRL-C out of it. I
had
>> been wary of trying this approach since I have already called into
the
>> genport sample driver from my VB6 application and that works nicely.
>> Also,
>> I don’t know what ports the existing driver is actually writing and
>> reading
>> (the printer ports assigned to this driver are 378 to 37F and 778 to
77f)
>> So I am back to using the genport driver supplied by the DDK and my
>> original
>> problem of creating a DLL to install/uninstall and load/unload the
>> driver.
>> Is this possible?? Can I install and uninstall a driver from a DLL
>> written
>> under VS.net and further, can I access said DLL from a VB6
application?
>> I
>> should explain that the sole purpose for exploring this
driver/DLL/VB6
>> application approach is that we only want the driver to be installed
and
>> loaded if it is needed by the VB6 application.
>>
>> Thanks again,
>> Stacy
>> “Stacy Meszaros” wrote in message
>> news:xxxxx@ntdev…
>> I am trying at this time to use the existing parallel port driver by
>> ‘connecting’ to it with CreateFile and “LPT1:” as the filename. I
have
>> already tried this in my VB application and it did not work (always
read
>> 0 bytes and crashed when writing 1 byte). Assuming that I may have a
>> parameter wrong, I am trying with a C console app. My current
problem
>> is that the HANDLE, BYTE and DWORD types are not resolving (I must be
>> using the wrong .h) I’ve tried windows.h and winbase.h
>>
>> Any ideas??
>>
>> Stacy
>>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com
>> [mailto:xxxxx@lists.osr.com] On Behalf Of Philip D
Barila
>> Sent: Tuesday, August 16, 2005 2:39 PM
>> To: Windows System Software Devs Interest List
>> Subject: Re: [ntdev] Loading a kernel-mode driver from a DLL
>>
>> Max may be right, but are you sure the built-in parallel port driver
>> doesn’t expose everything you need? Then you only need add the
>> appropriate
>> code to your VB6 app and be done.
>>
>> Phil
>>
>> Philip D. Barila
>> Seagate Technology LLC
>> (720) 684-1842
>>
>>
>>
>>
>> “Maxim S.
>>
>> Shatskih”
>>
>> >> To
>> ft.com> “Windows System Software Devs
>>
>> Sent by: Interest List”
>>
>> bounce-217267-643
>>
>> xxxxx@lists.osr.com
>> cc
>> No Phone Info
>>
>> Available
>> Subject
>> Re: [ntdev] Loading a
kernel-mode
>>
>> driver from a DLL
>>
>> 08/16/2005 12:23
>>
>> PM
>>
>>
>>
>>
>>
>> Please respond to
>>
>> “Windows System
>>
>> Software Devs
>>
>> Interest List”
>>
>> >>
>> com>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Porting to VB.NET is maybe the easiest solution
>>
>> Maxim Shatskih, Windows DDK MVP
>> StorageCraft Corporation
>> xxxxx@storagecraft.com
>> http://www.storagecraft.com
>> ----- Original Message -----
>> From: Stacy Meszaros
>> To: Windows System Software Devs Interest List
>> Sent: Tuesday, August 16, 2005 6:59 PM
>> Subject: [ntdev] Loading a kernel-mode driver from a DLL
>>
>> Let me explain my problem first. I have a VB6 application that my
>> employer wants to modify to all blowing the fuse on the JTAG
interface.
>> The JTAG interface is connected to a PC via the parallel port. The
PCs
>> have either Windows NT or XP on them. To accomplish the I/O access,
I
>> have a kernel-mode driver from the sample drivers in the DDK
>> (genport/portio). We would like to load the driver from a DLL that
is
>> called from the VB6 application. This is because we would like the
>> driver
>> to load and unload rather than being a permanent service. Trouble
is,
>> I
>> have the full Visual Studio .NET suite and Visual Basic 6.0 at my
>> disposal. Can a DLL created with VS.net be incorporated into a VB6
>> application? OR, do I have to port the VB6 application to VB.net?
>>
>> Thanks for any help,
>> Stacy
>>
>>
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> You are currently subscribed to ntdev as: xxxxx@sensorswitch.com
>> To unsubscribe send a blank email to xxxxx@lists.osr.com
>>
>>
>>
>>
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>>
>> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
>> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@msn.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@sensorswitch.com
To unsubscribe send a blank email to xxxxx@lists.osr.com