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

# RtlUnicodeStringToAnsiString(3w)

## NAME

**RtlUnicodeStringToAnsiString** (NTDLL.@)

## SYNOPSIS

NTSTATUS RtlUnicodeStringToAnsiString\
  (\
   STRING\*               *ansi*,\
   const UNICODE\_STRING\* *uni*,\
   BOOLEAN               *doalloc*\
  )

## PARAMS

*ansi* **\[In/Out\]**  Destination for the *ansi* string.

*uni* **\[In\]**  Unicode string to be converted.

*doalloc* **\[In\]**  **TRUE**=Allocate new buffer for *ansi*,**FALSE**=Use existing buffer.

## DESCRIPTION

Converts a unicode string to an *ansi* string.

## RETURNS

**Success:** **STATUS\_SUCCESS**. *ansi* contains the converted string

**Failure:** **STATUS\_BUFFER\_OVERFLOW**, if *doalloc* is **FALSE** and *ansi* is too small. **STATUS\_NO\_MEMORY**, if *doalloc* is **TRUE** and the allocation fails.

## NOTES

This function always writes a terminating **' '**. It performs a partial copy if *ansi* is too small.

## IMPLEMENTATION

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

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

Debug channel **"ntdll"**.
