Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correspondence between ProcMon and CreateFile disposition options

Process Monitor shows disposition option for CreateFile operation as "Open", "OpenIf", "Overwrite", "OverwriteIf" (may be something else). How does the options which contain "If" differ from those that do not? And to which CreateFile WinAPI function 'dwCreationDisposition' flags do they correspond?

like image 700
Ivan Ivanov Avatar asked Mar 21 '14 07:03

Ivan Ivanov


People also ask

What is Procmon used for?

Procmon is a downloadable utility for Microsoft Windows OS that captures and displays system and network activity. This includes file system activity, registry key activity, network, and threat activities.

How do you analyze Procmon?

To do this, open up File Explorer and paste in \\live.sysinternals.com\tools. You'll then see a folder like any ol' network share containing all of the Sysinternals files including procmon. Scroll down until you find procmon, double-click and voila, you're running procmon!

What is Procmon EXE?

Process Monitor, or ProcMon, is a Windows tool designed to help log application issues on your computer. With Process Monitor you can observe, view, and capture Windows file and system activity in real-time.


1 Answers

CreateFile() is the winapi function. Process Monitor however patches the native operating system, it only resembles the winapi in passing. It is pretty similar to VMS, the operating system that Dave Cutler designed when he still worked at DEC. Process Monitor hooks NtCreateFile, follow the link to see the CreateDisposition argument values documented. Copied:

  • FILE_SUPERSEDE. If the file already exists, replace it with the given file. If it does not, create the given file.
  • FILE_CREATE. If the file already exists, fail the request and do not create or open the given file. If it does not, create the given file.
  • FILE_OPEN. If the file already exists, open it instead of creating a new file. If it does not, fail the request and do not create a new file.
  • FILE_OPEN_IF. If the file already exists, open it. If it does not, create the given file.
  • FILE_OVERWRITE. If the file already exists, open it and overwrite it. If it does not, fail the request.
  • FILE_OVERWRITE_IF. If the file already exists, open it and overwrite it. If it does not, create the given file.
like image 60
Hans Passant Avatar answered Oct 10 '22 07:10

Hans Passant