[vlc-devel] [PATCH 4/4] Determine psz_vlcpath in according to a location of DLL not the executable on OS/2
KO Myung-Hun
komh78 at gmail.com
Tue Jan 10 13:07:05 CET 2012
---
src/os2/specific.c | 20 +++++++-------------
1 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/os2/specific.c b/src/os2/specific.c
index 7cdb3a3..6d2e61c 100644
--- a/src/os2/specific.c
+++ b/src/os2/specific.c
@@ -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();
--
1.7.3.2
More information about the vlc-devel
mailing list