Changeset 3995 for trunk/src/kernel32


Ignore:
Timestamp:
Aug 11, 2000, 8:42:55 PM (25 years ago)
Author:
sandervl
Message:

misc fixes

Location:
trunk/src/kernel32
Files:
4 edited

Legend:

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

    r3948 r3995  
    1 /* $Id: HandleManager.cpp,v 1.45 2000-08-04 21:12:05 sandervl Exp $ */
     1/* $Id: HandleManager.cpp,v 1.46 2000-08-11 18:42:53 sandervl Exp $ */
    22
    33/*
     
    739739    pHMHandleData->dwAccess    = fdwAccess;
    740740
    741   if(fdwOdinOptions & DUPLICATE_ACCESS_READWRITE) {
     741  if((fdwOdinOptions & DUPLICATE_ACCESS_READWRITE) == DUPLICATE_ACCESS_READWRITE) {
    742742        pHMHandleData->dwAccess = GENERIC_READ | GENERIC_WRITE;
    743743  }
  • trunk/src/kernel32/hmfile.cpp

    r3948 r3995  
    1 /* $Id: hmfile.cpp,v 1.14 2000-08-04 21:12:07 sandervl Exp $ */
     1/* $Id: hmfile.cpp,v 1.15 2000-08-11 18:42:54 sandervl Exp $ */
    22
    33/*
     
    122122                             pHMHandleData->dwFlags,
    123123                             hTemplate);
     124#ifdef SHARE_WORKAROUND
     125  if (hFile == INVALID_HANDLE_ERROR) {
     126        //could be a read-only drive -> FILE_SHARE_WRITE is illegal
     127        pHMHandleData->dwShare = FILE_SHARE_READ;
     128        hFile = OSLibDosCreateFile((LPSTR)lpFileName,
     129                             pHMHandleData->dwAccess,
     130                             pHMHandleData->dwShare,
     131                             (LPSECURITY_ATTRIBUTES)lpSecurityAttributes,
     132                             pHMHandleData->dwCreation,
     133                             pHMHandleData->dwFlags,
     134                             hTemplate);
     135  }
     136#endif
     137
    124138  if (hFile != INVALID_HANDLE_ERROR)
    125139  {
  • trunk/src/kernel32/virtual.cpp

    r3948 r3995  
    1 /* $Id: virtual.cpp,v 1.31 2000-08-04 21:12:09 sandervl Exp $ */
     1/* $Id: virtual.cpp,v 1.32 2000-08-11 18:42:55 sandervl Exp $ */
    22
    33/*
     
    219219    HANDLE hFile, hMapping = -1;
    220220
    221     hFile = CreateFileW( name, GENERIC_READ, FILE_SHARE_READ, NULL,
     221    hFile = CreateFileW( name, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
    222222                           OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0);
    223223    if (hFile != INVALID_HANDLE_VALUE)
     
    225225        hMapping = CreateFileMappingA( hFile, NULL, PAGE_READONLY | ((fReadIntoMemory) ? SEC_COMMIT : 0), 0, 0, NULL );
    226226        CloseHandle( hFile );
    227         if (hMapping != INVALID_HANDLE_VALUE)
     227        if (hMapping)
    228228        {
    229229            *lpMapping = MapViewOfFile( hMapping, FILE_MAP_READ, 0, 0, 0 );
     
    244244    HANDLE hFile, hMapping = -1;
    245245
    246     hFile = CreateFileA(name, GENERIC_READ, FILE_SHARE_READ, NULL,
     246    hFile = CreateFileA(name, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
    247247                        OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0);
    248248    if (hFile != INVALID_HANDLE_VALUE)
     
    250250        hMapping = CreateFileMappingA( hFile, NULL, PAGE_READONLY | ((fReadIntoMemory) ? SEC_COMMIT : 0), 0, 0, NULL );
    251251        CloseHandle( hFile );
    252         if (hMapping != INVALID_HANDLE_VALUE)
     252        if (hMapping)
    253253        {
    254254            *lpMapping = MapViewOfFile( hMapping, FILE_MAP_READ, 0, 0, 0 );
  • trunk/src/kernel32/wprocess.cpp

    r3993 r3995  
    1 /* $Id: wprocess.cpp,v 1.86 2000-08-11 10:56:20 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.87 2000-08-11 18:42:55 sandervl Exp $ */
    22
    33/*
     
    431431 BOOL rc;
    432432
     433    //SvL: Ignore FreeLibary for executable
     434    if(WinExe && hinstance == WinExe->getInstanceHandle()) {
     435        return TRUE;
     436    }
     437
    433438    winmod = Win32DllBase::findModule(hinstance);
    434439    if(winmod) {
     
    698703     *  Endif
    699704     */
     705    if(WinExe) {
     706      char  szDllName[CCHMAXPATH];
     707      char *dot;
     708
     709        strcpy(szDllName, OSLibStripPath((char *)lpszLibFile));
     710        strupr(szDllName);
     711        dot = strstr(szDllName, ".");
     712        if(dot)
     713            *dot = 0;
     714
     715        if(!strcmp(szDllName, WinExe->getModuleName())) {
     716                return WinExe->getInstanceHandle();
     717        }
     718    }
    700719    pModule = Win32DllBase::findModule((LPSTR)lpszLibFile);
    701720    if (pModule)
     
    10521071    if(WinExe) {
    10531072        if(WinExe->getCommandLineW())
    1054         return WinExe->getCommandLineW();
     1073             return WinExe->getCommandLineW();
    10551074    }
    10561075    if(asciicmdline == NULL) //not used for converted exes
    1057       asciicmdline = O32_GetCommandLine();
     1076        asciicmdline = O32_GetCommandLine();
    10581077
    10591078    if(asciicmdline) {
Note: See TracChangeset for help on using the changeset viewer.