EXPORT_C TInt RFTokenClient::OpenFileForToken(RFile& aHandle, const TDesC8& aToken) const { TInt serverhandle = 0; TPckg<TInt> buf(serverhandle); TInt rfsHandle = SendReceive(EOpenHandleForToken, TIpcArgs(&buf, &aToken)); return aHandle.AdoptFromServer(rfsHandle, serverhandle); }
EXPORT_C TInt RTestUtilSession::GetFileHandle(const TDesC& aFileName, RFile &aRFile) { TPckgBuf<TInt> fh; TInt fsh = SendReceive(EGetFileHandle, TIpcArgs(&aFileName, &fh)); if(fsh < 0) { return fsh; } return aRFile.AdoptFromServer(fsh, fh()); }
void RScrHelper::GetFileHandleL(Usif::TScrHelperServerMessages aFunction, RFile& aFile) { // Retrieve the RFs and RFile handles from the server TInt fsh; // File server handle (RFs - session) TPckgBuf<TInt> fh; // File handle (RFile - subsession) fsh = CallSessionFunction(aFunction, TIpcArgs(&fh)); // pointer to fh in slot 0 User::LeaveIfError(fsh); // Adopt the file using the returned handles User::LeaveIfError(aFile.AdoptFromServer(fsh, fh())); }