Re: How to compare IOMedia->getName() return string with user input string in start () routine of driver
Re: How to compare IOMedia->getName() return string with user input string in start () routine of driver
- Subject: Re: How to compare IOMedia->getName() return string with user input string in start () routine of driver
- From: Michael Smith <email@hidden>
- Date: Fri, 16 Feb 2007 10:43:47 -0800
On Feb 15, 2007, at 9:38 PM, Yogesh Pahilwan wrote:
I am working on the IOKit driver.
When I load my driver it will successfully expose new IOMedia object.
Now I want to compare this media object Name with the user
specified name in
the start () routine of my driver.
Why would you do it in ::start()? Are you deciding which IOMedia to
attach to? If so, you should do this in ::probe()
If my IOMedia object returns me say "MyDriver" string after calling
getName
() routine.
And if User specifies the same string "MyDriver", then how should I
compare
these string in start () routine of my driver.
You should not.
I am writing some specific logic which only gets executed if this
comparision is made successful.
Please give me some pointers, to solve this issue.
Typically you would use setProperty/getProperty and specific
properties to guide your decisions, rather than attempting to make a
string comparison on a name by name basis. Note that at ::start()
time, the user has no way of identifying the specific instance of
your driver. I think you are still confused by your Windows
experience - remember that I/O Kit creates an instance of your driver
for every successful matching operation based on your plist; you
don't get called just once and search for it yourself.
However, I think I don't understand your original question. getName
returns (char *). Are you telling me you don't know how to compare
NUL-terminated strings?
= Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden