diff -r 4b0c6ed43234 -r 8e837d1bf446 gstreamer_core/gst/helpfile.cpp --- a/gstreamer_core/gst/helpfile.cpp Wed Mar 24 17:58:42 2010 -0500 +++ b/gstreamer_core/gst/helpfile.cpp Wed Mar 24 18:04:17 2010 -0500 @@ -25,50 +25,32 @@ #include #include // For emulator WSD API #include +#include +#include extern "C" char* libgstreamer_get_dll_path(char* dllName) { - TUint ch = TUint('A'); - char* fullPath = dllName; - #ifdef __WINSCW__ - char* dllPath = "z:\\sys\\bin\\plugins"; - fullPath = g_strjoin ("\\", dllPath,dllName, NULL); - #else - char* dllPath = "sys\\bin"; - - char* filename; - TInt i; + char* dllFullPath = NULL; RFs fs; - TDriveList driveList; - //err = fs.Connect(); + CDir* directory=NULL; if( !(fs.Connect()) ) { - //err = fs.DriveList(driveList); - if( !(fs.DriveList(driveList)) ) + TFindFile findFile(fs); + TFileName file; + TPtrC8 filename; + filename.Set( reinterpret_cast( dllName ) ); + file.Copy( filename ); + if( ! findFile.FindWildByDir(file,KResFileNamePath,directory) ) { - for( i = 0; i< KMaxDrives; i++ ) - { - - if( driveList[i] != 0 ) - { - char temp[3]; - temp[0]= char(ch); - temp[1]= ':'; - temp[2]= '\0'; - - filename = g_strjoin ("\\", temp,dllPath,dllName, NULL); - if (g_file_test (filename, G_FILE_TEST_EXISTS)) - { - fullPath = filename; - break; - } - } - ch++; - } + TBuf8 fileName; + fileName.Copy( findFile.File() ); + TInt length = fileName.Size() + 1; + dllFullPath = (char*)malloc( length ); + memcpy( dllFullPath, fileName.PtrZ(), length ); + delete directory; } fs.Close(); } - #endif - return fullPath; + return dllFullPath; }