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

# OpenStreamOnFile(3w)

## NAME

**OpenStreamOnFile** (MAPI32.147)

## SYNOPSIS

HRESULT OpenStreamOnFile\
  (\
   LPALLOCATEBUFFER *lpAlloc*,\
   LPFREEBUFFER     *lpFree*,\
   ULONG            *ulFlags*,\
   LPWSTR           *lpszPath*,\
   LPWSTR           *lpszPrefix*,\
   LPSTREAM\*        *lppStream*\
  )

## DESCRIPTION

Create a stream on a file.

## PARAMS

*lpAlloc* **\[In\]**  Memory allocation function.

*lpFree* **\[In\]**  Memory free function.

*ulFlags* **\[In\]**  Flags controlling the opening process.

*lpszPath* **\[In\]**  Path of file to create stream on.

*lpszPrefix* **\[In\]**  Prefix of the temporary file name (if *ulFlags* includes **SOF\_UNIQUEFILENAME**).

*lppStream* **\[Out\]**  Destination for created stream.

## RETURNS

**Success:** **S\_OK**. *lppStream* contains the new stream object

**Failure:** **E\_INVALIDARG** if any parameter is invalid, or an **HRESULT** error code describing the error.

## IMPLEMENTATION

Declared in **"util.h"**.

Implemented in **"dlls/mapi32/util.c"**.

Debug channel **"mapi"**.
