]> git.sesse.net Git - vlc/commitdiff
Determine psz_vlcpath in according to a location of DLL not the executable on OS/2
authorKO Myung-Hun <komh78@gmail.com>
Tue, 10 Jan 2012 12:07:05 +0000 (21:07 +0900)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 11 Jan 2012 09:04:33 +0000 (10:04 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
src/os2/specific.c

index 7cdb3a3ede90e3d63a9e86bb134f795f66dd385a..6d2e61cf7df13ebeb5f9d40f44e6b9f658393b14 100644 (file)
@@ -32,28 +32,22 @@ extern int _fmode_bin;
 
 void system_Init( void )
 {
-    PPIB ppib;
-    CHAR psz_path[ CCHMAXPATH ];
-    PSZ  psz_dirsep;
+    HMODULE hmod;
+    CHAR    psz_path[ CCHMAXPATH ];
+    PSZ     psz_dirsep;
 
-    DosGetInfoBlocks( NULL, &ppib );
+    DosQueryModFromEIP( &hmod, NULL, 0, NULL, NULL, ( ULONG )system_Init );
+    DosQueryModuleName( hmod, sizeof( psz_path ), psz_path );
 
-    DosQueryModuleName( ppib->pib_hmte, sizeof( psz_path ), psz_path );
-
-    /* remove the executable name */
+    /* remove the DLL name */
     psz_dirsep = strrchr( psz_path, '\\');
     if( psz_dirsep )
         *psz_dirsep = '\0';
 
-    /* remove the last directory, i.e, \\bin */
-    psz_dirsep = strrchr( psz_path, '\\' );
-    if( psz_dirsep )
-        *psz_dirsep = '\0';
-
     DosEnterCritSec();
 
     if( !psz_vlcpath )
-        asprintf( &psz_vlcpath, "%s\\lib\\vlc", psz_path );
+        asprintf( &psz_vlcpath, "%s\\vlc", psz_path );
 
     DosExitCritSec();