Changeset 5011 for trunk/src/kernel32/HandleManager.cpp
- Timestamp:
- Jan 22, 2001, 7:26:52 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/HandleManager.cpp
r4950 r5011 1 /* $Id: HandleManager.cpp,v 1. 59 2001-01-14 18:18:26sandervl Exp $ */1 /* $Id: HandleManager.cpp,v 1.60 2001-01-22 18:26:49 sandervl Exp $ */ 2 2 3 3 /* … … 253 253 /* free handle found ? */ 254 254 if (INVALID_HANDLE_VALUE == TabWin32Handles[ulLoop].hmHandleData.hHMHandle) { 255 //SvL: Mark handle as taken here. Doing it outside of this function 256 // isn't thread safe. (and not very smart) 257 TabWin32Handles[ulLoop].hmHandleData.hHMHandle = ulLoop; 255 258 TabWin32Handles[ulLoop].hmHandleData.dwUserData = 0; 256 259 TabWin32Handles[ulLoop].hmHandleData.dwInternalType = HMTYPE_UNKNOWN; … … 1891 1894 while (pfnPeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) 1892 1895 { 1893 if (msg.message == WM_QUIT) return 1; 1896 if (msg.message == WM_QUIT) { 1897 dprintf(("ERROR: WaitForSingleObject call abandoned because WM_QUIT msg was received!!")); 1898 // teb->o.odin.fIgnoreMsgs = FALSE; 1899 FreeLibrary(hUser32); 1900 return WAIT_ABANDONED; 1901 } 1894 1902 1895 1903 /* otherwise dispatch it */ … … 2637 2645 PHMHANDLEDATA pHMHandleData; 2638 2646 DWORD rc; /* API return code */ 2639 HANDLE hOldMemMap = -1;2640 2647 2641 2648 pDeviceHandler = HMGlobals.pHMFileMapping; /* device is predefined */ … … 2647 2654 return 0; /* signal error */ 2648 2655 } 2649 2650 2656 2651 2657 /* initialize the complete HMHANDLEDATA structure */ … … 2658 2664 pHMHandleData->lpHandlerData = NULL; 2659 2665 2660 2661 2666 /* we've got to mark the handle as occupied here, since another device */ 2662 2667 /* could be created within the device handler -> deadlock */ … … 2676 2681 dwMaximumSizeHigh, 2677 2682 dwMaximumSizeLow, 2678 lpName, &hOldMemMap); 2679 2680 if (rc != NO_ERROR) /* oops, creation failed within the device handler */ 2681 { 2682 TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE; 2683 SetLastError(rc); /* Hehe, OS/2 and NT are pretty compatible :) */ 2684 if(rc == ERROR_ALREADY_EXISTS) { 2685 return hOldMemMap; //return handle of existing file mapping 2686 } 2687 else return (NULL); /* signal error */ 2683 lpName); 2684 2685 if(rc != NO_ERROR) /* oops, creation failed within the device handler */ 2686 { 2687 if(rc != ERROR_ALREADY_EXISTS) { 2688 TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE; 2689 SetLastError(rc); /* Hehe, OS/2 and NT are pretty compatible :) */ 2690 return (NULL); /* signal error */ 2691 } 2692 SetLastError(ERROR_ALREADY_EXISTS); 2693 return iIndexNew; /* return valid handle */ 2688 2694 } 2689 2695 else … … 4458 4464 if (-1 == iIndexNewWrite) /* oops, no free handles ! */ 4459 4465 { 4466 //free handle 4467 TabWin32Handles[iIndexNewRead].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE; 4460 4468 SetLastError(ERROR_NOT_ENOUGH_MEMORY); /* use this as error message */ 4461 4469 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.