Is it possible to determine how a file HANDLE was opened after the fact? RRS feed

  • Question

  • I have a function in which I am given a Win32 HANDLE to an already-open disk file.  Is it possible for me to determine what desired access (i.e. GENERIC_READ, GENERIC_WRITE, etc) was used when the file was opened (in this case via CreateFile)?  Is there a function that will allow me to determine that? 

    The closest thing I can see is the function GetSecurityInfo() but I cannot tell if that will give me what I need nor what to ask for or how to check the result.

    Sorry if I have the wrong forum.  This appears to be the closest one to what I can find as what I am asking about appears to be related to the Security APIs.
    Friday, November 6, 2009 5:27 PM

All replies

  • If you want to check file operations in other processes, you need to write a file system filter driver.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    Friday, November 6, 2009 8:54 PM