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

# OpenAndMapFileForRead(3w)

## NAME

**OpenAndMapFileForRead** (SETUPAPI.@)

## SYNOPSIS

DWORD OpenAndMapFileForRead\
  (\
   LPCWSTR  *lpFileName*,\
   LPDWORD  *lpSize*,\
   LPHANDLE *lpFile*,\
   LPHANDLE *lpMapping*,\
   LPVOID\*  *lpBuffer*\
  )

## DESCRIPTION

Open and map a file to a buffer.

## PARAMS

*lpFileName* **\[In\]**  Name of the file to be opened.

*lpSize* **\[Out\]**  Pointer to the file size.

*lpFile* **\[0\]**  Pointer to the file handle

*lpMapping* **\[0\]**  Pointer to the mapping handle

*lpBuffer* **\[0\]**  Pointer to the file buffer.

## RETURNS

**Success:** **ERROR\_SUCCESS**

**Failure:** Other.

## NOTE

Call UnmapAndCloseFile to release the file.

## IMPLEMENTATION

Not declared in a Wine header. The function is either undocumented, or missing from Wine.

Implemented in **"dlls/setupapi/misc.c"**.

Debug channel **"setupapi"**.
