Changeset 1083


Ignore:
Timestamp:
6/2/2009 1:50:20 AM (5 years ago)
Author:
lowjoel
Message:

Let the OpenHandle::Close function return a boolean indicating success for error verification.

Location:
trunk/eraser6/Eraser.Unlocker
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.Unlocker/Eraser.Unlocker.cpp

    r1065 r1083  
    115115    } 
    116116 
    117     void OpenHandle::Close() 
     117    bool OpenHandle::Close() 
    118118    { 
    119119        //Open a handle to the owning process 
     
    124124            NULL, 0, false, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); 
    125125 
     126        //Check if the handle is closed 
     127        bool result = true; 
     128        HANDLE duplicateHandle = NULL; 
     129        if (DuplicateHandle(processHandle, static_cast<void*>(Handle), GetCurrentProcess(), 
     130            &duplicateHandle, 0, false, DUPLICATE_SAME_ACCESS)) 
     131        { 
     132            result = false; 
     133            CloseHandle(duplicateHandle); 
     134        } 
     135 
    126136        //Close the process handle 
    127137        CloseHandle(processHandle); 
     138 
     139        //Return the result 
     140        return result; 
    128141    } 
    129142} 
  • trunk/eraser6/Eraser.Unlocker/Eraser.Unlocker.h

    r1065 r1083  
    5454 
    5555        /// Force the handle to close. 
    56         void Close(); 
     56        bool Close(); 
    5757 
    5858        /// The handle to the file, in the context of the owning process. 
Note: See TracChangeset for help on using the changeset viewer.