Thread: difference in createfile()

  1. #1
    Just a Human Anuradh_a's Avatar
    Join Date
    Jan 2008

    difference in createfile()

    any one know what is the difference between NtCreateFile() and CreateFile() ??

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Toronto, ON
    Since the MSDN talks about the DDK in the documentation for NtCreateFile() I'm guessing you use NtCreateFile() when you're writing a driver and CreateFile() for normal programs. I didn't have time to read the whole documentation though.

  3. #3
    Just a Human Anuradh_a's Avatar
    Join Date
    Jan 2008
    why can't use the CreateFile() in drivers???

  4. #4
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Quote Originally Posted by Anuradh_a View Post
    why can't use the CreateFile() in drivers???
    Probably because it can create infinite loops. CreateFile() might call your driver, which then calls CreateFile() which calls your driver etc etc etc.

    Quote Originally Posted by Dictionary of Programming Terms

    Infinite Loop - see Loop, Infinite

    Loop, Infinite - see Infinite Loop
    NtCreateFile() directly creates the file.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Difference Equations / Recurrence Relations
    By DavidP in forum A Brief History of
    Replies: 4
    Last Post: 10-05-2007, 10:26 AM
  2. What's the difference between var++ and ++var
    By ulillillia in forum C Programming
    Replies: 6
    Last Post: 05-31-2007, 02:27 AM
  3. Replies: 6
    Last Post: 08-26-2006, 11:09 PM
  4. fopen and CreateFile
    By Bajanine in forum Windows Programming
    Replies: 3
    Last Post: 04-03-2003, 07:24 PM
  5. Difference between macro and pass by reference?
    By converge in forum C++ Programming
    Replies: 2
    Last Post: 02-26-2002, 05:20 AM