site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=AeCVy3N3TpDBERTl2Dc6/UPVrEgyCRVAXcP7NoVIcHYQrGGoxA5Xc6ztCbBOqmqFg+Q0GO6WrVhp0mVc5u7VzV2g94wxOqFWhFM/0hjGPnrBsA+zjXkmVo0gQs4vggW6aUae9dCthQ7lrRpZ4Ide20ZqMsEm0lHAihR1PtWidMY= ; Hi, I have written a kernel driver.Now want to talk to it through a userclient.My user space application is a cocoa application which calls IOServiceOpen() to establish a connection with the userclient.The call too IOServiceOpen fails and returning a value of hex value of 0xe00002c7 (-536870201 in decimal).But the API's IOMasterPort(),IOServiceMatching() & IOServiceGetMatchingServices() are returning success.Can anybody help me out in this matter. I have attached the sample code.. int sample() { kern_return_t kernResult; mach_port_t masterPort; io_service_t serviceObject; io_connect_t dataPort; io_iterator_t iterator; CFDictionaryRef classToMatch; kernResult = IOMasterPort(MACH_PORT_NULL,&masterPort); if (kernResult != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return 0; } classToMatch=IOServiceMatching(kMyDriversIOKitClassName); if (classToMatch == NULL) { printf( "IOServiceMatching returned a NULL dictionary.\n"); return 0; } kernResult = IOServiceGetMatchingServices(masterPort, classToMatch, &iterator); if (kernResult != KERN_SUCCESS) { printf("IOServiceGetMatchingServices returned %d\n\n", kernResult); return 0; } // Get the first item in the iterator. serviceObject = IOIteratorNext(iterator); // Release the io_iterator_t now that we're done with it. IOObjectRelease(iterator); if (!serviceObject) { printf("Couldn't find any matches.\n"); return 0; } // This call will cause the user client to be instantiated. kernResult = IOServiceOpen(serviceObject, mach_task_self(), 0, &dataPort); if (kernResult != KERN_SUCCESS) { printf("IOServiceOpen returned %d\n", kernResult); return 0; } Regards, Sanjay __________________________________________________________ Yahoo! India Answers: Share what you know. Learn something new http://in.answers.yahoo.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