difference in createfile()

This is a discussion on difference in createfile() within the Windows Programming forums, part of the Platform Specific Boards category; hi any one know what is the difference between NtCreateFile() and CreateFile() ?? thanks...

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

    difference in createfile()

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

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    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
    Posts
    50
    why can't use the CreateFile() in drivers???

  4. #4
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    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.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Difference Equations / Recurrence Relations
    By DavidP in forum A Brief History of Cprogramming.com
    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, 06:24 PM
  5. Difference between macro and pass by reference?
    By converge in forum C++ Programming
    Replies: 2
    Last Post: 02-26-2002, 04:20 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21