---
name: "NtCreateFile"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/NtCreateFile"
---

# NtCreateFile(3w)

## NAME

**NtCreateFile** (NTDLL.@)

## SYNOPSIS

NTSTATUS NtCreateFile\
  (\
   PHANDLE            *handle*,\
   ACCESS\_MASK        *access*,\
   POBJECT\_ATTRIBUTES *attr*,\
   PIO\_STATUS\_BLOCK   *io*,\
   PLARGE\_INTEGER     *alloc\_size*,\
   ULONG              *attributes*,\
   ULONG              *sharing*,\
   ULONG              *disposition*,\
   ULONG              *options*,\
   PVOID              *ea\_buffer*,\
   ULONG              *ea\_length*\
  )

## DESCRIPTION

Either create a new file or directory, or open an existing file, device, directory or volume.

## PARAMS

*handle* **\[Out\]**  Points to a variable which receives the file *handle* on return.

*access* **\[In\]**  Desired *access* to the file.

*attr* **\[In\]**  Structure describing the file.

*io* **\[Out\]**  Receives information about the operation on return.

*alloc\_size* **\[In\]**  Initial size of the file in bytes.

*attributes* **\[In\]**  Attributes to create the file with.

*sharing* **\[In\]**  Type of shared *access* the caller would like to the file.

*disposition* **\[In\]**  Specifies what to do, depending on whether the file already exists.

*options* **\[In\]**  Options for creating a new file.

*ea\_buffer* **\[In\]**  Pointer to an extended *attributes* buffer.

*ea\_length* **\[In\]**  Length of *ea\_buffer*.

## RETURNS

**Success:** **0.** *handle* and *io* are updated.

**Failure:** An **NTSTATUS** error code describing the error.

## IMPLEMENTATION

Declared in **"winternl.h"**.

Implemented in **"dlls/ntdll/file.c"**.

Debug channel **"ntdll"**.
