Re: Writing to disk using filter scheme driver
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Hi Parav, I get the error at compile time itself. But there is declaration and definition of the function in my driver class as follows: MyDriver.h includes- class com_MySoftwareCompany_driver_MyFilterScheme : public IOStorage { OSDeclareDefaultStructors(com_MySoftwareCompany_driver_MyFilterScheme) virtual void DoDriverWrite(IOMemoryDescriptor *inBuffer); }; MyDriver.cpp includes - // kMyScalarIStructImethod void com_MySoftwareCompany_driver_MyFilterScheme::DoDriverWrite(IOMemoryDescriptor * inBuffer) { IOStorageCompletion completion; // If the user client's 'open' method was never called, return kIOReturnNotOpen. if (!isOpen()) { return kIOReturnNotOpen; } IOByteCount readBytes; UInt64 byteStart = 512; IOByteCount bufLength = inBuffer->getLength(); char *myBuff = new char[bufLength]; readBytes = inBuffer->readBytes(0, myBuff, bufLength); IOLog("MyFilterScheme::read BEFORE **** readBytes = %lu byteStart = %lu \ bufLength = %lu buffer = %s \n", (long)readBytes, (long)byteStart, (long)bufLength, myBuff); getProvider()->write(this, byteStart, inBuffer, completion); IOLog("MyFilterScheme::read AFTER **** readBytes = %lu byteStart = %lu \ bufLength = %lu buffer = %s \n", (long)readBytes, (long)byteStart, (long)bufLength, myBuff); delete[] myBuff; } Its a strange thing that even when the function is declared and define in my driver class compiler gives me the compile time error that there is no matching function IOSerive::DoDriverWrite(). Is there that i am mistaking in mapping of calls from userclient to driver??? Thanks, Yogesh Pahilwan On Tue, 2005-04-05 at 02:06, Parav Pandit wrote:
Hi Yogesh,
ffProvider = OSDynamicCast(com_MySoftwareCompany_driver_MyFilterScheme, fProvider); // is this a correct way of casting???
Yes, but you don't need to type cast because fPRovider is already of type
com_MySoftwareCompany_driver_MyFilterScheme.
But i am still facing the same problem that "no matching function IOService::DoDriverWrite()"
//com_MySoftwareCompany_driver_MyFilterScheme* fProvider;
If this is compilation error, it looks to me that your driver class
com_MySoftwareCompany_driver_MyFilterScheme ( NOT com_MySoftwareCompany_MyUserClient) doesn't have declaration and definition of DoDriverWrite() function.
and the compiler asking to it's top base class IOServive whether it has the function or not.
Regards, Parav Pandit
________________________________________________________________________ Yahoo! India Matrimony: Find your life partner online Go to: http://yahoo.shaadi.com/india-matrimony _______________________________________________ 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/shirke.mekhala%40spsoft...
This email sent to shirke.mekhala@spsoftindia.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... This email sent to site_archiver@lists.apple.com
participants (1)
-
Yogesh P