116 void CMscFileSession::SetupLogicalUnitL( const RMessage2& aMessage ) |
116 void CMscFileSession::SetupLogicalUnitL( const RMessage2& aMessage ) |
117 { |
117 { |
118 TRACE_FUNC_ENTRY |
118 TRACE_FUNC_ENTRY |
119 TInt protocol; |
119 TInt protocol; |
120 TInt lun; |
120 TInt lun; |
121 RBuf buf; |
121 RBuf fullImageFileName; |
122 TInt len = aMessage.GetDesLength( 0 ); |
122 TInt len = aMessage.GetDesLength( 0 ); |
123 buf.CreateL( len ); |
123 fullImageFileName.CreateL( len ); |
124 buf.CleanupClosePushL(); |
124 fullImageFileName.CleanupClosePushL(); |
125 aMessage.ReadL( 0, buf ); |
125 aMessage.ReadL( 0, fullImageFileName ); |
126 protocol = aMessage.Int1(); |
126 protocol = aMessage.Int1(); |
127 lun = aMessage.Int2(); |
127 lun = aMessage.Int2(); |
128 |
|
129 //get the directory and name of image file |
|
130 RFs fs; |
|
131 LEAVE_IF_ERROR(fs.Connect()); |
|
132 CleanupClosePushL(fs); |
|
133 |
128 |
134 TFileName fileName; |
129 iMscFileServer.Controller().SetupLogicalUnitL( fullImageFileName, protocol, lun ); |
135 const TDriveNumber KResourceDrive = EDriveZ; |
130 CleanupStack::PopAndDestroy( &fullImageFileName ); |
136 TDriveUnit driveUnit( KResourceDrive ); |
|
137 TDriveName drive = driveUnit.Name(); |
|
138 fileName.Insert( 0, drive ); |
|
139 // append private path |
|
140 TPath privatePath; |
|
141 fs.PrivatePath(privatePath); |
|
142 fileName.Append(privatePath); |
|
143 CleanupStack::PopAndDestroy(&fs); |
|
144 |
|
145 fileName.Append(buf); |
|
146 iMscFileServer.Controller().SetupLogicalUnitL( fileName, protocol, lun ); |
|
147 CleanupStack::PopAndDestroy( &buf ); |
|
148 TRACE_FUNC_EXIT |
131 TRACE_FUNC_EXIT |
149 } |
132 } |
150 /** |
133 /** |
151 Client request to start the device. |
134 Client request to start the device. |
152 |
135 |