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

# NtOpenFile(3w)

## NAME

**NtOpenFile** (NTDLL.@)

## SYNOPSIS

NTSTATUS NtOpenFile\
  (\
   PHANDLE            *handle*,\
   ACCESS\_MASK        *access*,\
   POBJECT\_ATTRIBUTES *attr*,\
   PIO\_STATUS\_BLOCK   *io*,\
   ULONG              *sharing*,\
   ULONG              *options*\
  )

## DESCRIPTION

Open a file.

## PARAMS

*handle* **\[Out\]**  Variable that receives the file *handle* on return.

*access* **\[In\]**  Access desired by the caller to the file.

*attr* **\[In\]**  Structure describing the file to be opened.

*io* **\[Out\]**  Receives details about the result of the operation.

*sharing* **\[In\]**  Type of shared *access* the caller requires.

*options* **\[In\]**  Options for the file open.

## RETURNS

**Success:** **0.** FileHandle and IoStatusBlock are updated.

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

## IMPLEMENTATION

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

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

Debug channel **"ntdll"**.
