Changeset 21329 for trunk/src


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

Added functionality, required for Flash10 to kernel32

Location:
trunk/src/kernel32
Files:
8 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  );
  • trunk/src/kernel32/KERNEL32.DEF

    r21324 r21329  
    12241224    vsnprintfW                            @2030 NONAME
    12251225    snprintfW                             @2031 NONAME
     1226    sprintfW                              @2032 NONAME
    12261227
    12271228; custom dll hook installer
     
    12641265
    12651266    _ODIN_SetProcessDword@12                                      @3118 NONAME
     1267
     1268; required for Mozilla plugin
     1269
     1270    _ODIN_ThreadEnterOdinContext@8 = _ODIN_ThreadEnterOdinContext@8 @3119
     1271    _ODIN_ThreadLeaveOdinContext@8 = _ODIN_ThreadLeaveOdinContext@8 @3120
     1272    _ODIN_ThreadLeaveOdinContextNested@8 = _ODIN_ThreadLeaveOdinContextNested@8 @3121
     1273    _ODIN_ThreadEnterOdinContextNested@12 = _ODIN_ThreadEnterOdinContextNested@12 @3122
    12661274
    12671275; Char functions (forwarders from user32)
     
    12991307    _IsCharUpperW@4                                               @3160 NONAME
    13001308
    1301     SetFilePointerEx = _SetFilePointerEx@20                       @3161
    1302     SetWaitableTimer = _SetWaitableTimer@24                       @3162
     1309    SetFilePointerEx            = _SetFilePointerEx@20               @3161
     1310    SetWaitableTimer            = _SetWaitableTimer@24               @3162
    13031311
    13041312; RAS functions
     
    13321340    RasCountObjects             = _RasCountObjects@12                @3527
    13331341    RasGetTrackHandle           = _RasGetTrackHandle@4               @3528
    1334    
     1342
  • trunk/src/kernel32/exceptions.cpp

    r21302 r21329  
    352352
    353353  // walk the exception chain
    354   while( (pFrame != NULL) && (pFrame != ((void *)0xFFFFFFFF)) )
     354  while( (pFrame != NULL) && ((ULONG)((ULONG)pFrame & 0xFFFFF000) != 0xFFFFF000) )
    355355  {
    356356        dprintf(("KERNEL32: RtlDispatchException - pframe=%08X, pframe->Prev=%08X", pFrame, pFrame->Prev));
     
    492492  PrintWin32ExceptionChain(frame);
    493493
    494   while ((frame != (PWINEXCEPTION_FRAME)0xffffffff) && (frame != pEndFrame))
     494  while (((ULONG)((ULONG)frame & 0xFFFFF000) != 0xFFFFF000) && (frame != pEndFrame))
    495495  {
    496496        /* Check frame address */
     
    711711//               any local buffers also can be made static to save
    712712//               stack space and possibly avoid out of stack exception.
    713     if(pERepRec->ExceptionNum == XCPT_GUARD_PAGE_VIOLATION)   
     713    if(pERepRec->ExceptionNum == XCPT_GUARD_PAGE_VIOLATION)
    714714    {
    715715        strcpy(szTrapDump, "Guard Page Violation");
    716716        return;
    717717    }
    718    
     718
    719719    PSZ    pszExceptionName = "<unknown>";        /* points to name/type excpt */
    720720    APIRET rc               = XCPT_CONTINUE_SEARCH;        /* excpt-dep.  code */
     
    963963        static char szSYMInfo[260];
    964964        static char Name[260];
    965        
     965
    966966        DosQueryModuleName(ulModule, sizeof(Name), Name);
    967967
     
    12941294
    12951295            map = Win32MemMapNotify::findMapByView(pERepRec->ExceptionInfo[1], &offset, accessflag);
    1296             if(!map) 
     1296            if(!map)
    12971297                goto continueFail;
    12981298
     
    13091309    }
    13101310continueFail:
     1311
     1312    /*
     1313     * vladest: OK, try to implement write AUTOCOMMIT
     1314     * last chance after MMAP commit is failed
     1315     */
     1316    if (XCPT_ACCESS_VIOLATION == pERepRec->ExceptionNum &&
     1317        (/*pERepRec->ExceptionInfo[0] == XCPT_READ_ACCESS ||*/
     1318         pERepRec->ExceptionInfo[0] == XCPT_WRITE_ACCESS) &&
     1319        pERepRec->ExceptionInfo[1] != XCPT_DATA_UNKNOWN)
     1320    {
     1321        ULONG offset, accessflag;
     1322
     1323        DosQueryMem((PVOID) pERepRec->ExceptionInfo[1],
     1324                    &offset, &accessflag);
     1325        dprintf(("KERNEL32: OS2ExceptionHandler: failed address info 0x%X size 0x%X. flag %X\n",
     1326                 pERepRec->ExceptionInfo[1], offset, accessflag));
     1327        /* check for valid address */
     1328        if (!pERepRec->ExceptionInfo[1] ||
     1329            pERepRec->ExceptionInfo[1] == 0xAAAAAAAA ||
     1330            !offset || offset == 0xAAAAAAAA)
     1331            goto CrashAndBurn;
     1332        /* memory committed, but no write access */
     1333        if (accessflag & PAG_GUARD)
     1334            accessflag &=~PAG_GUARD;
     1335
     1336        DosSetMem((PVOID) pERepRec->ExceptionInfo[1], offset,
     1337                  accessflag | PAG_WRITE | PAG_COMMIT);
     1338        dprintf(("KERNEL32: OS2ExceptionHandler: commiting 0x%X size 0x%X\n",
     1339                 pERepRec->ExceptionInfo[1], offset));
     1340        goto continueexecution;
     1341    }
     1342
    13111343
    13121344////#define DEBUGSTACK
     
    13441376        USHORT *eip = (USHORT *)pCtxRec->ctx_RegEip;
    13451377
    1346         if(teb && eip && *eip == SETTHREADCONTEXT_INVALID_LOCKOPCODE) 
     1378        if(teb && eip && *eip == SETTHREADCONTEXT_INVALID_LOCKOPCODE)
    13471379        {
    13481380            //Is this a pending SetThreadContext exception?
    13491381            //(see detailed description in the HMDeviceThreadClass::SetThreadContext method)
    1350             if(teb->o.odin.context.ContextFlags) 
     1382            if(teb->o.odin.context.ContextFlags)
    13511383            {
    13521384                dprintfException(pERepRec, pERegRec, pCtxRec, p);
     
    14881520        //Make sure we detect a stack overflow condition before the system does
    14891521        if(!fIsOS2Image &&
    1490             pERepRec->ExceptionInfo[1]  >= stackbottom && 
     1522            pERepRec->ExceptionInfo[1]  >= stackbottom &&
    14911523            pERepRec->ExceptionInfo[1]  <  stacktop
    1492            ) 
     1524           )
    14931525        {//this is a guard page exception for the thread stack
    14941526            APIRET rc;
    14951527            ULONG ulAddress, cbSize, ulMemFlags;
    1496  
     1528
    14971529            //round down to page boundary
    14981530            ulAddress = pERepRec->ExceptionInfo[1] & ~0xFFF;
     
    15061538#endif
    15071539
    1508             if(ulAddress == stackbottom + PAGE_SIZE) 
     1540            if(ulAddress == stackbottom + PAGE_SIZE)
    15091541            {//we don't have any stack left, throw an XCPT_UNABLE_TO_GROW_STACK
    15101542             //exception
     
    15501582        if(ret == TRUE)
    15511583            goto continueexecution;
    1552             }           
     1584            }
    15531585        }
    15541586
     
    15651597//#ifdef DEBUG
    15661598//        dprintfException(pERepRec, pERegRec, pCtxRec, p);
    1567 //#endif     
     1599//#endif
    15681600        goto continuesearch;
    15691601    }
     
    16531685  PEXCEPTIONREGISTRATIONRECORD pExceptRec = (PEXCEPTIONREGISTRATIONRECORD)QueryExceptionChain();
    16541686
    1655   while(pExceptRec != 0 && (ULONG)pExceptRec != -1) 
     1687  while(pExceptRec != 0 && (ULONG)pExceptRec != -1)
    16561688  {
    1657         if(pExceptRec->ExceptionHandler == OS2ExceptionHandler) 
     1689        if(pExceptRec->ExceptionHandler == OS2ExceptionHandler)
    16581690        {
    16591691            fFound = TRUE;
     
    16621694        pExceptRec = pExceptRec->prev_structure;
    16631695  }
    1664   if(!fFound) 
     1696  if(!fFound)
    16651697  {
    16661698      OS2SetExceptionHandler(pExceptionRegRec);
     
    16701702//*****************************************************************************
    16711703// Remove exception handler if it was registered previously
    1672 // 
     1704//
    16731705//*****************************************************************************
    16741706void WIN32API ODIN_UnsetExceptionHandler(void *pExceptionRegRec)
     
    16781710  BOOL   fFound = FALSE;
    16791711
    1680   while(pExceptRec != 0 && (ULONG)pExceptRec != -1) 
     1712  while(pExceptRec != 0 && (ULONG)pExceptRec != -1)
    16811713  {
    1682         if(pExceptRec == pExceptionRegRec) 
     1714        if(pExceptRec == pExceptionRegRec)
    16831715        {
    16841716            fFound = TRUE;
     
    16911723  pExceptRec = (PEXCEPTIONREGISTRATIONRECORD)QueryExceptionChain();
    16921724
    1693   if(fFound && pExceptRec != (PEXCEPTIONREGISTRATIONRECORD)pExceptionRegRec) 
     1725  if(fFound && pExceptRec != (PEXCEPTIONREGISTRATIONRECORD)pExceptionRegRec)
    16941726  {
    16951727      dprintf(("ERROR: ODIN_UnsetExceptionHandler: INSIDE!!!: exc rec %p, head %p\n", pExceptionRegRec, pExceptRec));
  • trunk/src/kernel32/hmfile.cpp

    r21302 r21329  
    851851           dwMoveMethod));
    852852
    853   if(fileInfo && fileInfo->dwLXOffset) 
     853  if(fileInfo && fileInfo->dwLXOffset)
    854854  {
    855855      switch(dwMoveMethod)
     
    868868      }
    869869  }
     870
    870871  ret = OSLibDosSetFilePointer(pHMHandleData->hHMHandle,
    871872                               lDistanceToMove,
  • trunk/src/kernel32/kernel32dbg.def

    r21324 r21329  
    12251225    vsnprintfW                            @2030 NONAME
    12261226    snprintfW                             @2031 NONAME
     1227    sprintfW                              @2032 NONAME
    12271228
    12281229; custom dll hook installer
     
    12631264
    12641265    _ODIN_SetProcessDword@12                                      @3118 NONAME
     1266
     1267; required for Mozilla plugin
     1268
     1269    _ODIN_ThreadEnterOdinContext@8 = _ODIN_ThreadEnterOdinContext@8 @3119
     1270    _ODIN_ThreadLeaveOdinContext@8 = _ODIN_ThreadLeaveOdinContext@8 @3120
     1271    _ODIN_ThreadLeaveOdinContextNested@8 = _ODIN_ThreadLeaveOdinContextNested@8 @3121
     1272    _ODIN_ThreadEnterOdinContextNested@12 = _ODIN_ThreadEnterOdinContextNested@12 @3122
    12651273
    12661274; Char functions (forwarders from user32)
     
    12971305    _DbgIsCharUpperA@4                                               @3159 NONAME
    12981306    _DbgIsCharUpperW@4                                               @3160 NONAME
    1299 
    1300     SetFilePointerEx = _SetFilePointerEx@20                          @3161
    1301     SetWaitableTimer = _SetWaitableTimer@24                          @3162
     1307    SetFilePointerEx            = _SetFilePointerEx@20               @3161
     1308    SetWaitableTimer = _SetWaitableTimer@24                          @3162   
    13021309
    13031310; RAS functions
     
    13311338    RasCountObjects             = _RasCountObjects@12                @3527
    13321339    RasGetTrackHandle           = _RasGetTrackHandle@4               @3528
    1333    
     1340
  • trunk/src/kernel32/oslibdos.cpp

    r21302 r21329  
    1 /* $Id: oslibdos.cpp,v 1.120 2003-06-02 16:25:19 sandervl Exp $ */
     1/* $Id: oslibdos.cpp,v 1.120 2003/06/02 16:25:19 sandervl Exp $ */
    22/*
    33 * Wrappers for OS/2 Dos* API
     
    9595
    9696
    97 
     97char* ODINHelperStripUNC(char* strUNC)
     98{
     99    char *retStr = strUNC;
     100
     101    if (!strUNC) return NULL;
     102
     103    /* first possible case */
     104    if (strUNC[0] == '\\' &&
     105        (strUNC[1] == '?' || (strUNC[1] >= 'A' && strUNC[1] <= 'Z' )) &&
     106        strUNC[2] == '\\')
     107    {
     108
     109        retStr = &strUNC[3];
     110    }
     111    /* second possible case */
     112    if (strUNC[0] == '\\' && strUNC[1] == '\\' &&
     113        (strUNC[2] == '?' || (strUNC[2] >= 'A' && strUNC[2] <= 'Z' )) &&
     114        strUNC[3] == '\\')
     115    {
     116
     117        retStr = &strUNC[4];
     118    }
     119    return retStr;
     120}
    98121
    99122//******************************************************************************
     
    171194 USHORT sel = RestoreOS2FS();
    172195 char OemFileName[260];
    173  CharToOemA(pszFileName, OemFileName);
     196 CharToOemA(ODINHelperStripUNC((char*)pszFileName), OemFileName);
    174197
    175198    if(DosOpenLProc) {
     
    266289        return ERROR_WRONG_DISK_W;
    267290
     291    case ERROR_SHARING_BUFFER_EXCEEDED: //36
     292        return ERROR_SHARING_BUFFER_EXCEEDED_W;
     293
    268294    case ERROR_BAD_NETPATH: //53
    269295        return ERROR_BAD_NETPATH_W;
    270 
    271     case ERROR_SHARING_BUFFER_EXCEEDED: //36
    272         return ERROR_SHARING_BUFFER_EXCEEDED_W;
    273296
    274297    case ERROR_CANNOT_MAKE: //82
     
    439462 char lOemFileName[260];
    440463
    441   CharToOemA(lpszFileName, lOemFileName);
     464  CharToOemA(ODINHelperStripUNC(lpszFileName), lOemFileName);
    442465
    443466  if(flags & OSLIB_ACCESS_READONLY)
     
    508531 char lOemOldFile[260], lOemNewFile[260];
    509532
    510   CharToOemA(lpszOldFile, lOemOldFile);
    511   CharToOemA(lpszNewFile, lOemNewFile);
     533  CharToOemA(ODINHelperStripUNC((char*)lpszOldFile), lOemOldFile);
     534  CharToOemA(ODINHelperStripUNC((char*)lpszNewFile), lOemNewFile);
    512535
    513536  rc = DosCopy((PSZ)lOemOldFile, (PSZ)lOemNewFile, fFailIfExist ? 0: DCPY_EXISTING);
     
    522545 char lOemOldFile[260], lOemNewFile[260];
    523546
    524   CharToOemA(lpszOldFile, lOemOldFile);
    525   CharToOemA(lpszNewFile, lOemNewFile);
     547  CharToOemA(ODINHelperStripUNC((char*)lpszOldFile), lOemOldFile);
     548  CharToOemA(ODINHelperStripUNC((char*)lpszNewFile), lOemNewFile);
    526549
    527550  // we need to know the current drive for relative paths
     
    574597 char lOemDir[260];
    575598
    576   CharToOemA(lpszDir, lOemDir);
     599  CharToOemA(ODINHelperStripUNC((char*)lpszDir), lOemDir);
    577600
    578601  rc = DosDeleteDir((PSZ)lOemDir);
     
    587610 char lOemDir[260];
    588611
    589   CharToOemA(lpszDir, lOemDir);
     612  CharToOemA(ODINHelperStripUNC((char*)lpszDir), lOemDir);
    590613
    591614  rc = DosCreateDir((PSZ)lOemDir, NULL);
     
    697720    char lOemFileName[260];
    698721
    699     CharToOemA(lpszFileName, lOemFileName);
     722    CharToOemA(ODINHelperStripUNC(lpszFileName), lOemFileName);
    700723
    701724    rc = DosDelete(lOemFileName);
     
    775798
    776799  // Note: we only handle standard "GetFileExInfoStandard" requests
    777   rc = DosQueryPathInfo(pszName,               /* query the file information */
     800  rc = DosQueryPathInfo(ODINHelperStripUNC(pszName),               /* query the file information */
    778801                        FIL_STANDARD,
    779802                        &fs3,
     
    804827  switch(cmd) {
    805828  case OSLIB_SEARCHDIR:
    806         if(DosSearchPath(SEARCH_IGNORENETERRS, path,
     829        if(DosSearchPath(SEARCH_IGNORENETERRS, ODINHelperStripUNC(path),
    807830                         name, full_name, length_fullname) != 0) {
    808831                return 0;
     
    812835
    813836  case OSLIB_SEARCHCURDIR:
    814         if(DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_CUR_DIRECTORY, path,
     837        if(DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_CUR_DIRECTORY, ODINHelperStripUNC(path),
    815838                         name, full_name, length_fullname) != 0) {
    816839                return 0;
     
    822845    FILESTATUS3 fileinfo;
    823846
    824         if(DosQueryPathInfo(name, FIL_STANDARD, &fileinfo, sizeof(fileinfo)) != 0) {
     847        if(DosQueryPathInfo(ODINHelperStripUNC(name), FIL_STANDARD, &fileinfo, sizeof(fileinfo)) != 0) {
    825848                return 0;
    826849        }
     
    858881                            ULONG cbInfoBuf)
    859882{
    860    APIRET rc = DosQueryPathInfo( pszPathName, ulInfoLevel,
     883   APIRET rc = DosQueryPathInfo( ODINHelperStripUNC(pszPathName), ulInfoLevel,
    861884                                 pInfoBuf, cbInfoBuf );
    862885
     
    888911   ULONG   openFlag = 0;
    889912   ULONG   openMode = OPEN_FLAGS_NOINHERIT; //default is not inherited by child processes
    890    APIRET  rc = ERROR_NOT_ENOUGH_MEMORY;;
     913   APIRET  rc = ERROR_NOT_ENOUGH_MEMORY;
     914
     915   CHAR* lpszFileLoc = ODINHelperStripUNC(lpszFile);
    891916
    892917   //TODO: lpSecurityAttributes (inheritance)
     
    9801005#endif
    9811006
    982    if(strlen(lpszFile) == 2 && lpszFile[1] == ':') {
     1007   if(strlen(lpszFileLoc) == 2 && lpszFileLoc[1] == ':') {
    9831008        //app tries to open logical volume/partition
    9841009        openMode |= OPEN_FLAGS_DASD;
    9851010   }
     1011   
    9861012   int retry = 0;
    9871013   while (retry < 3)
    9881014   {
    989         dprintf(("DosOpen %s openFlag=%x openMode=%x", lpszFile, openFlag, openMode));
    990         rc = OdinDosOpenL((PSZ)lpszFile,
     1015        dprintf(("DosOpen %s openFlag=%x openMode=%x", lpszFileLoc, openFlag, openMode));
     1016        rc = OdinDosOpenL((PSZ)lpszFileLoc,
    9911017                           &hFile,
    9921018                           &actionTaken,
     
    10481074      // @@@AH 2001-06-02 Win2k SP2 returns error 2 in this case
    10491075      int winError = error2WinError(rc);
    1050       if (winError == ERROR_OPEN_FAILED_W)
     1076      if (winError == ERROR_OPEN_FAILED_W || winError == ERROR_PATH_NOT_FOUND_W)
    10511077      {
    10521078          //Windows returns ERROR_FILE_EXISTS if create new & file exists
     
    13031329      break;
    13041330  }
    1305 
     1331#if 0
    13061332  // PH Note: for a negative 32-bit seek, the OS/2 64-bit version
    13071333  // needs to be skipped.
    1308   if( (f64BitIO) && (OffsetHigh) )
     1334  if( (f64BitIO) && (OffsetHigh) &&
     1335     (*OffsetHigh != 0xAAAAAAAA) &&
     1336     (*OffsetHigh != 0)) //workaround for flash10 video
    13091337  {
    13101338        offsetL.ulLo = OffsetLow;
     
    13161344        newoffset = newoffsetL.ulLo;
    13171345  }
    1318   else  rc = DosSetFilePtr(hFile, OffsetLow, method, &newoffset);
     1346  else
     1347#endif
     1348      rc = DosSetFilePtr(hFile, OffsetLow, method, &newoffset);
    13191349
    13201350  if(rc)
     
    22352265  char    lOemFileName[260];
    22362266
    2237   CharToOemA(lpFileName, lOemFileName);
     2267  CharToOemA(ODINHelperStripUNC((char*)lpFileName), lOemFileName);
    22382268
    22392269  APIRET rc = DosFindFirst((PSZ)lOemFileName,&hDir,attrs,&result,sizeof(result),&searchCount,FIL_STANDARD);
     
    22412271  //check root: skip "." and ".." (HPFS, not on FAT)
    22422272  //check in OSLibDosFindNext not necessary: "." and ".." are the first two entries
    2243   if ((rc == 0) && isRoot((LPSTR)lpFileName))
     2273  if ((rc == 0) && isRoot((LPSTR)ODINHelperStripUNC((char*)lpFileName)))
    22442274  {
    22452275    while ((strcmp(result.achName,".") == 0) ||
     
    22942324  char  lOemFileName[260];
    22952325
    2296   CharToOemA(lpFileName, lOemFileName);
     2326  CharToOemA(ODINHelperStripUNC((char*)lpFileName), lOemFileName);
    22972327  APIRET rc = DosFindFirst((PSZ)lOemFileName,&hDir,attrs,result,searchCount*sizeof(FILEFINDBUF3),&searchCount,FIL_STANDARD);
    22982328  SetErrorMode(oldmode);
     
    23862416{
    23872417   FILESTATUS3 statusBuf;
    2388    char        *lOemFileName;
     2418   char        lOemFileName[CCHMAXPATH];
    23892419   char       *lpszBackslash, *lpszColon;
    23902420   APIRET      rc;
    23912421
    2392    lOemFileName = (char *)malloc(strlen(lpFileName)+64);
    2393    lOemFileName[0] = 0;
     2422//testestest
     2423   if(strlen(lpFileName) > CCHMAXPATH) DebugInt3();
     2424//testestset
    23942425
    23952426   //Convert file name from Windows to OS/2 codepage
    2396    CharToOemA(lpFileName, lOemFileName);
     2427   CharToOemA(ODINHelperStripUNC(lpFileName), lOemFileName);
    23972428   lpszBackslash = CharPrevA(lOemFileName, lOemFileName + strlen(lOemFileName));
    23982429   if(lpszBackslash)
     
    24012432       {
    24022433           lpszColon = CharPrevA(lOemFileName, lpszBackslash);
    2403            if(strlen(lOemFileName) > 1 && lpszColon && *lpszColon != ':')
     2434           if(lpszColon && *lpszColon != ':')
    24042435           {//only rootdir is allowed to have terminating backslash
    24052436               *lpszBackslash = 0;
     
    24222453           rc = DosQueryPathInfo(lOemFileName, FIL_STANDARD, &statusBuf, sizeof(statusBuf));
    24232454   }
    2424    free(lOemFileName);
    24252455
    24262456   if(rc == NO_ERROR)
  • trunk/src/kernel32/oslibdos.h

    r9945 r21329  
    1616extern "C" {
    1717#endif
     18
     19char* ODINHelperStripUNC(char* strUNC);
    1820
    1921#ifdef OS2_INCLUDED
  • trunk/src/kernel32/unicode/string.c

    r9963 r21329  
    404404    return retval;
    405405}
     406
     407int sprintfW( WCHAR *str, const WCHAR *format, ...)
     408{
     409    int retval;
     410    va_list valist;
     411    va_start(valist, format);
     412    retval = vsnprintfW(str, INT_MAX, format, valist);
     413    va_end(valist);
     414    return retval;
     415}
Note: See TracChangeset for help on using the changeset viewer.