---
name: "zip_source_win32handle"
section: "3"
platform: "linux"
package: "libzip"
version: "1.11.4-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/zip_source_win32handle"
---

# zip\_source\_win32handle(3)

create data source from a Windows file handle

## NAME

**zip\_source\_win32handle**, **zip\_source\_win32handle\_create** – create data source from a Windows file handle

## LIBRARY

libzip (-lzip)

## SYNOPSIS

**#include \<zip.h\>**

*zip\_source\_t* *\**\

**zip\_source\_win32handle**(*zip\_t \*archive*, *HANDLE h*, *zip\_uint64\_t start*, *zip\_int64\_t len*);

*zip\_source\_t* *\**\

**zip\_source\_win32handle\_create**(*HANDLE h*, *zip\_uint64\_t start*, *zip\_int64\_t len*, *zip\_error\_t \*error*);

## DESCRIPTION

The functions **zip\_source\_win32handle**() and **zip\_source\_win32handle\_create**() create a zip source from a Windows file handle. They read *len* bytes from offset *start* from it. If *len* is 0 or -1, the whole file (starting from *start*) is used.

If the file supports seek, the source can be used to open a zip archive from.

The file is opened and read when the data from the source is used, usually by **zip\_close**() or **zip\_open\_from\_source**().

## RETURN VALUES

Upon successful completion, the created source is returned. Otherwise, NULL is returned and the error code in *archive* or *error* is set to indicate the error.

## ERRORS

**zip\_source\_w32handle**() and **zip\_source\_w32handle\_create**() fail if:

- \[ZIP\_ER\_INVAL\]

  *h*, *start*, or *len* are invalid.

- \[ZIP\_ER\_MEMORY\]

  Required memory could not be allocated.

## SEE ALSO

[libzip(3)](/libzip/3.md), [zip\_file\_add(3)](/zip_file_add/3.md), [zip\_file\_replace(3)](/zip_file_replace/3.md), [zip\_source(5)](/zip_source/5.md), [zip\_source\_win32a(3)](/zip_source_win32a/3.md), [zip\_source\_win32w(3)](/zip_source_win32w/3.md)

## HISTORY

**zip\_source\_win32handle**() and **zip\_source\_win32handle\_create**() were added in libzip 1.0.

## AUTHORS

Dieter Baron ⟨*dillo@nih.at*⟩ and Thomas Klausner ⟨*wiz@gatalith.at*⟩
