Re: Is IOUSBFamily/IOKit different for Mac OS X 10.4.7 vs 10.4.6?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com virtual bool isOpen( const IOService * forClient = 0 ) const; -- Terry ////////////// IOUSBDevice * _device; ... ... if ( _device && !_device->isOpen() ) { // Let's attempt to open the device if ( !_device->open(this) ) { err = kIOReturnExclusiveAccess; goto ErrorExit; } } 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/tlambert%40apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... /*! @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. */ 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). 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 ////////////// 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 ? This email sent to tlambert@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert