Ignore:
Timestamp:
Nov 14, 2001, 1:30:46 PM (24 years ago)
Author:
phaller
Message:

replaced heap alloc by stack alloc

File:
1 edited

Legend:

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

    r6613 r7334  
    1 /* $Id: Fileio.cpp,v 1.53 2001-08-31 19:53:11 phaller Exp $ */
     1/* $Id: Fileio.cpp,v 1.54 2001-11-14 12:30:35 phaller Exp $ */
    22
    33/*
     
    531531                           DWORD              dwCopyFlags)
    532532{
    533     LPSTR sourceA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpExistingFileName );
    534     LPSTR destA   = HEAP_strdupWtoA( GetProcessHeap(), 0, lpNewFileName );
    535 
    536     BOOL ret = CopyFileExA(sourceA,
    537                            destA,
    538                            lpProgressRoutine,
    539                            lpData,
    540                            pbCancel,
    541                            dwCopyFlags);
    542 
    543     HeapFree( GetProcessHeap(), 0, sourceA );
    544     HeapFree( GetProcessHeap(), 0, destA );
    545 
    546     return ret;
     533#ifdef __WIN32OS2__
     534  LPSTR sourceA;
     535  LPSTR destA;
     536  STACK_strdupWtoA(lpExistingFileName, sourceA)
     537  STACK_strdupWtoA(lpNewFileName, destA)
     538#else
     539  LPSTR sourceA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpExistingFileName );
     540  LPSTR destA   = HEAP_strdupWtoA( GetProcessHeap(), 0, lpNewFileName );
     541#endif
     542 
     543  BOOL ret = CopyFileExA(sourceA,
     544                         destA,
     545                         lpProgressRoutine,
     546                         lpData,
     547                         pbCancel,
     548                         dwCopyFlags);
     549 
     550#ifndef __WIN32OS2__
     551  HeapFree( GetProcessHeap(), 0, sourceA );
     552  HeapFree( GetProcessHeap(), 0, destA );
     553#endif
     554 
     555  return ret;
    547556}
    548557//******************************************************************************
     
    13831392              LPVOID, lpFileInformation)
    13841393{
     1394#ifdef __WIN32OS2__
     1395  LPSTR nameA;
     1396  STACK_strdupWtoA(lpFileName, nameA)
     1397#else
    13851398  LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpFileName );
     1399#endif
     1400 
    13861401  BOOL res = GetFileAttributesExA( nameA, fInfoLevelId, lpFileInformation);
     1402 
     1403#ifndef __WIN32OS2__
    13871404  HeapFree( GetProcessHeap(), 0, nameA );
     1405#endif
    13881406  return res;
    13891407}
Note: See TracChangeset for help on using the changeset viewer.