Ignore:
Timestamp:
Jul 7, 2009, 7:40:22 PM (16 years ago)
Author:
vladest
Message:

Added functionality, required for Flash10 to kernel32

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/Fileio.cpp

    r21302 r21329  
    11791179  DWORD sp = 0, lp = 0,attr;
    11801180  LPSTR tmpshortpath,tmplongpath;
     1181  LPSTR lpszShortPath1, lpszLongPath1;
    11811182
    11821183   dprintf(("GetLongPathNameA %s %x %d", lpszShortPath, lpszLongPath, cchBuffer));
     
    11961197      return 0;
    11971198   }
    1198  
    1199    lstrcpyA(tmpshortpath,lpszShortPath);
     1199
     1200   lpszShortPath1 = ODINHelperStripUNC((char*)lpszShortPath);
     1201   lpszLongPath1 = ODINHelperStripUNC((char*)lpszLongPath);
     1202
     1203   lstrcpyA(tmpshortpath,lpszShortPath1);
    12001204
    12011205   /* check for drive letter */
    1202    if ( lpszShortPath[1] == ':' ) {
    1203       tmplongpath[0] = lpszShortPath[0];
     1206   if ( lpszShortPath1[1] == ':' ) {
     1207       tmplongpath[0] = lpszShortPath1[0];
     1208
    12041209      tmplongpath[1] = ':';
    12051210      sp = 2;
     
    12091214   //todo: check drive validity!
    12101215
    1211    while ( lpszShortPath[lp] ) {
     1216   while ( lpszShortPath1[lp] ) {
    12121217
    12131218      /* check for path delimiters and reproduce them */
    1214       if ( lpszShortPath[lp] == '\\' || lpszShortPath[lp] == '/' ) {
     1219      if ( lpszShortPath1[lp] == '\\' || lpszShortPath1[lp] == '/' ) {
    12151220        if (!sp || tmplongpath[sp-1]!= '\\')
    12161221        {
     
    12241229      }
    12251230
    1226       tmplen = strcspn ( lpszShortPath + lp, "\\/" );
    1227       lstrcpynA ( tmplongpath+sp, lpszShortPath + lp, tmplen+1 );
     1231      tmplen = strcspn ( lpszShortPath1 + lp, "\\/" );
     1232      lstrcpynA ( tmplongpath+sp, lpszShortPath1 + lp, tmplen+1 );
    12281233
    12291234      attr = GetFileAttributesA(tmplongpath);
     
    12661271             DOSFS_Hash(FindFileData.cFileName, short_name, FALSE, TRUE );         
    12671272             //this happens on files like [hello world]
    1268              if (!lstrncmpA(short_name, lpszShortPath+lp, (lpszShortPath+lp+tmplen)[-1] == '.' ? tmplen-1 : tmplen ))
     1273             if (!lstrncmpA(short_name, lpszShortPath1+lp, (lpszShortPath1+lp+tmplen)[-1] == '.' ? tmplen-1 : tmplen ))
    12691274             {
    12701275               strcpy( tmplongpath+sp, FindFileData.cFileName);
     
    12991304   tmplongpath[sp] = 0;
    13001305
    1301    lstrcpynA ( lpszLongPath, tmplongpath, cchBuffer );
     1306   lstrcpynA ( lpszLongPath1, tmplongpath, cchBuffer );
    13021307   dprintf(("returning %s\n", lpszLongPath));
    13031308   tmplen = strlen ( lpszLongPath  );
Note: See TracChangeset for help on using the changeset viewer.