Ignore:
Timestamp:
Nov 8, 1999, 2:43:13 PM (26 years ago)
Author:
sandervl
Message:

thread, SearchPath + handlemanager fixes

File:
1 edited

Legend:

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

    r1570 r1628  
    1 /* $Id: Fileio.cpp,v 1.13 1999-11-03 17:12:20 phaller Exp $ */
     1/* $Id: Fileio.cpp,v 1.14 1999-11-08 13:43:11 sandervl Exp $ */
    22
    33/*
     
    3030#include "oslibdos.h"
    3131
    32 
    3332ODINDEBUGCHANNEL(KERNEL32-FILEIO)
    3433
     
    360359                      nrbyteswritten,
    361360                      lpOverlapped));
    362 }
    363 //******************************************************************************
    364 //******************************************************************************
    365 ODINFUNCTION6(DWORD,  SearchPathA,
    366               LPCSTR, lpszPath,
    367               LPCSTR, lpszFile,
    368               LPCSTR, lpszExtension,
    369               DWORD,  cchReturnBuffer,
    370               LPSTR,  lpszReturnBuffer,
    371               LPSTR *, plpszFilePart)
    372 {
    373   LPSTR lpszFilePart;
    374 
    375   // @@@PH 1999/11/03 ANV.EXE seems to pass in NULL here, looks like
    376   // windows ignores that behaviour altough it's undocumented.
    377   if (plpszFilePart == NULL)
    378     plpszFilePart = &lpszFilePart; // just provide a valid pointer
    379 
    380   return O32_SearchPath(lpszPath,
    381                         lpszFile,
    382                         lpszExtension,
    383                         cchReturnBuffer,
    384                         lpszReturnBuffer,
    385                         plpszFilePart);
    386 }
    387 //******************************************************************************
    388 //******************************************************************************
    389 ODINFUNCTION6(DWORD,    SearchPathW,
    390               LPCWSTR,  lpszPath,
    391               LPCWSTR,  lpszFileName,
    392               LPCWSTR,  lpszExtension,
    393               DWORD,    cchReturnBufferLength,
    394               LPWSTR,   lpszReturnBuffer,
    395               LPWSTR *, plpszFilePart)
    396 {
    397   char *asciipath,
    398        *asciifile,
    399        *asciiext,
    400        *asciibuffer,
    401        *asciipart;
    402   DWORD rc;
    403 
    404   asciibuffer = (char *)malloc(cchReturnBufferLength+1);
    405   asciipath = UnicodeToAsciiString((LPWSTR)lpszPath);
    406   asciifile = UnicodeToAsciiString((LPWSTR)lpszFileName);
    407   asciiext  = UnicodeToAsciiString((LPWSTR)lpszExtension);
    408   rc = ODIN_SearchPathA(asciipath,
    409                         asciifile,
    410                         asciiext,
    411                         cchReturnBufferLength,
    412                         asciibuffer,
    413                         &asciipart);
    414 
    415   if(rc)
    416   {
    417       AsciiToUnicode(asciibuffer, lpszReturnBuffer);
    418       *plpszFilePart = lpszReturnBuffer + ((int)asciipart - (int)asciibuffer);
    419   }
    420 
    421   FreeAsciiString(asciiext);
    422   FreeAsciiString(asciifile);
    423   FreeAsciiString(asciipath);
    424   free(asciibuffer);
    425   return(rc);
    426361}
    427362//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.