Pastebin

Paste #2420: createfile

< previous paste - next paste>

Pasted by tdn

Download View as text


// From http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx

{$PACKRECORDS C}
type SECURITY_ATTRIBUTES =
  record                             {length = 12}
    nLength : LongWord;              {offset 0}
    lpSecurityDescriptor : Pointer;  {offset 4}
    bInheritHandle : LongBool        {offset 8}
  end;
{}
type LPSECURITY_ATTRIBUTES = ^SECURITY_ATTRIBUTES;
{}
function CreateFile
  (
    lpFileName : PChar;
    dwDesiredAccess : LongWord;
    dwShareMode : LongWord;
    lpSecurityAttributes : LPSECURITY_ATTRIBUTES;
    dwCreationDisposition : LongWord;
    dwFlagsAndAttributes : LongWord;
    hTemplateFile : LongWord
  )
  : LongWord;
  stdcall;
{}
const GENERIC_READ = LongWord ($80000000);
const GENERIC_WRITE = LongInt ($40000000);
const CREATE_NEW = ShortInt ($01);
const OPEN_EXISTING = ShortInt ($03);
const FILE_ATTRIBUTE_NORMAL = Byte ($80);
const INVALID_HANDLE_VALUE = LongWord ($FFFFFFFF);

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.