Re: Help!!!!
Re: Help!!!!
- Subject: Re: Help!!!!
- From: Rich Kubota <email@hidden>
- Date: Tue, 6 May 2003 10:41:20 -0700
At 6:56 AM +0000 5/6/03, sandeep krishnamurthy wrote:
hi
We have a Mac OS9 USB device driver for an modem and till now the Vendor
ID and product ID as part of the USBDriverDescription structure were
hardcoded. Now we want to provide the end-users with an option to be able
to change the VID/PID before installation. To do this we thought of the
following :
We planned to write the VID/PID provided by the end-user through an
application to be written into the resource file from where the driver
could pick up these values. But the problem is that, before the driver
matching is carried out by the USB manager there is no way we can invoke a
function from the driver to populate the USBDriverDescription structure,
which leaves us with no other option but to use an hardcoded
USBDriverDescription structure.
When we went through the USB DDK documentation, we could not find any
function which can be invoked in the driver before the matching phase is
over.
The same thing we are able to do in MacOSX in which the VID/PID
given by the end-user, through an application has been written into a plist
file, from where in the driver we are reading it from the init( ) routine.
In the start( ) routine, we are comparing the VID with the one we get from
the device descriptor and if they dont match, the driver is prevented from
being loaded.
hi sandeep
We want to know,
(i) if there is a way in which we can dynamically populate the
USBDriverDescription structure during the matching phase
no, the USBDriverDescription is a required export symbol which the
USB Manager reads using the FindSymbol call. Theoreticly, one could
patch the FindSymbol call, and manipulate the USBDriverDescription
record, before it gets returned to the system. I have no example of
this and don't know whether it's possible.
or
(ii) any function which can be invoked from the driver prior to the
matching phase that is carried out by the USB manager.
Before the driver is loaded, the cfrag library init entry point is
called if one has been defined for the library.
Another idea which occurs to me, you could figure out after
generating the driver, where in the data fork of the file, the vendor
and product id values are saved, then add a resource to the driver
file. You can then supply an application which the end-user can use
to enter these values, since the app will open the custom resource,
read the pid and vid offsets, open the data fork of the driver, and
make the necessary changes at the driver offset. The application
would then force a resrtart.
________________________________________________________________________
This letter has been delivered unencrypted. We'd like to remind you that
the full protection of e-mail correspondence is provided by S-mail
encryption mechanisms if only both, Sender and Recipient use S-mail.
Register at S-mail.com: http://www.s-mail.com
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
--
Sincerely,
Rich Kubota
email@hidden
(408) 974-6212
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
References: | |
| >Help!!!! (From: sandeep krishnamurthy <email@hidden>) |