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

# CreateFileW(3w)

## NAME

**CreateFileW** (KERNEL32.@)

## SYNOPSIS

HANDLE CreateFileW\
  (\
   LPCWSTR               *filename*,\
   DWORD                 *access*,\
   DWORD                 *sharing*,\
   LPSECURITY\_ATTRIBUTES *sa*,\
   DWORD                 *creation*,\
   DWORD                 *attributes*,\
   HANDLE                *template*\
  )

## DESCRIPTION

CreateFileW \[**KERNEL32**.@\] Creates or opens a file or other object.

Creates or opens an object, and returns a handle that can be used to *access* that object.

## PARAMS

*filename* **\[In\]**  pointer to *filename* to be accessed.

*access* **\[In\]**  *access* mode requested.

*sharing* **\[In\]**  share mode.

*sa* **\[In\]**  pointer to security *attributes*.

*creation* **\[In\]**  how to create the file.

*attributes* **\[In\]**  *attributes* for newly created file.

*template* **\[In\]**  handle to file with extended *attributes* to copy.

## RETURNS

**Success:** Open handle to specified file

**Failure:** **INVALID\_HANDLE\_VALUE**

## IMPLEMENTATION

Declared in **"winbase.h"**.

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

Debug channel **"file"**.
