Ignore:
Timestamp:
May 6, 2003, 2:06:11 PM (22 years ago)
Author:
sandervl
Message:

Fixed closing of parent file handle by duplicate memory map; Compare file names instead of handles when checking for duplicate file maps

File:
1 edited

Legend:

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

    r10071 r10073  
    1 /* $Id: hmfile.cpp,v 1.44 2003-05-06 10:12:00 sandervl Exp $ */
     1/* $Id: hmfile.cpp,v 1.45 2003-05-06 12:06:09 sandervl Exp $ */
    22
    33/*
     
    10831083//                                 arg4));
    10841084}
     1085/******************************************************************************
     1086 * Name      : DWORD HMDeviceFileClass::GetFileNameFromHandle
     1087 * Purpose   : the name of the file associated with the system handle (if any)
     1088 * Parameters: PHMHANDLEDATA pHMHandleData
     1089 * Variables :
     1090 * Result    : BOOLEAN
     1091 * Remark    :
     1092 * Status    :
     1093 *
     1094 * Author    : SvL
     1095 ******************************************************************************/
     1096BOOL HMDeviceFileClass::GetFileNameFromHandle(PHMHANDLEDATA pHMHandleData,
     1097                                              LPSTR lpszFileName, DWORD cbFileName)
     1098{
     1099  HMFileInfo *fileInfo = (HMFileInfo *)pHMHandleData->dwUserData;
     1100
     1101  if(fileInfo == NULL || strlen(fileInfo->lpszFileName) >= cbFileName) {
     1102      if(fileInfo) DebugInt3();
     1103      return FALSE;
     1104  }
     1105  strcpy(lpszFileName, fileInfo->lpszFileName);
     1106
     1107  return TRUE;
     1108}
    10851109
    10861110//******************************************************************************
     
    12611285}
    12621286/******************************************************************************
     1287 * Name      : DWORD HMDeviceFileClass::GetFileNameFromHandle
     1288 * Purpose   : the name of the file associated with the system handle (if any)
     1289 * Parameters: PHMHANDLEDATA pHMHandleData
     1290 * Variables :
     1291 * Result    : BOOLEAN
     1292 * Remark    :
     1293 * Status    :
     1294 *
     1295 * Author    : SvL
     1296 ******************************************************************************/
     1297BOOL HMDeviceInfoFileClass::GetFileNameFromHandle(PHMHANDLEDATA pHMHandleData,
     1298                                                  LPSTR lpszFileName, DWORD cbFileName)
     1299{
     1300  HMFileInfo *fileInfo = (HMFileInfo *)pHMHandleData->dwUserData;
     1301
     1302  if(fileInfo == NULL || strlen(fileInfo->lpszFileName) >= cbFileName) {
     1303      if(fileInfo) DebugInt3();
     1304      return FALSE;
     1305  }
     1306  strcpy(lpszFileName, fileInfo->lpszFileName);
     1307
     1308  return TRUE;
     1309}
     1310/******************************************************************************
    12631311 * Name      : DWORD HMDeviceFileClass::GetFileType
    12641312 * Purpose   : determine the handle type
Note: See TracChangeset for help on using the changeset viewer.