Re: Is IOUSBFamily/IOKit different for Mac OS X 10.4.7 vs 10.4.6?
Re: Is IOUSBFamily/IOKit different for Mac OS X 10.4.7 vs 10.4.6?
- Subject: Re: Is IOUSBFamily/IOKit different for Mac OS X 10.4.7 vs 10.4.6?
- From: Terry Lambert <email@hidden>
- Date: Fri, 21 Jul 2006 13:52:50 -0700
/*! @function isOpen
@abstract Determine whether a specific, or any, client has an
IOService open.
@discussion Returns the open state of an IOService with respect
to the specified client, or when it is open by any client.
@param forClient If non-zero, isOpen returns the open state for
that client. If zero is passed, isOpen returns the open state for
all clients.
@result Returns true if the specific, or any, client has the
IOService
open.
*/
virtual bool isOpen( const IOService * forClient = 0 ) const;
I expect that it worked before because there was another instance of
the IOService (IOUSBDevice) open, and so when you passed the 0, you
got something other than the one you were actually trying to ask
about. You will likely want to correct your code to use "this" on all
platforms, since if this is the case, it is only working on older
systems by luck (and if so, some customers might have luck while
others don't, and you'll get mysterious "doesn't work for me" vs.
"can't reproduce" type bug reports from the field).
-- Terry
On Jul 21, 2006, at 1:14 PM, rohit dhamija wrote:
Some time back , I developed the KEXT for my USB control type
transfer device which worked fine on Mac OS X 10.3.9 to Mac OS X
10.4.6 OS X but started failing on the upgraded version of Mac OS X
10.4.7ppc
Upon analyzing the code I found that attempting to open the
IOUSBDevice was failing for Mac OS X 10.4.7 ppc but the same peice
of code worked fine for previous versions of the Mac OS X . Below is
the peice of code
//////////////
IOUSBDevice * _device;
...
...
if ( _device && !_device->isOpen() )
{
// Let's attempt to open the device
if ( !_device->open(this) )
{
err = kIOReturnExclusiveAccess;
goto ErrorExit;
}
}
//////////////
The _device->isOpen() worked fine till Mac OS X 10.4.6 but started
failing on Mac OS X 10.4.7ppc. Changing _device->isOpen(this) made
the code work for Mac OS X 10.4.7 as well as previous versions
Is there any change in IOUSBFamily / IOKit for isOpen() function in
Mac OS X 10.4.7 darwin source? Or what may be the reason behind this ?
Please comment.
Thanks and Regards,
--
Rohit Dhamija(M) 9818446545
_______________________________________________
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
_______________________________________________
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