Home

LPWSTR

LPWSTR stands for Long Pointer to Wide String. It is a Windows API data type that denotes a pointer to a null-terminated wide character string, typically encoded in UTF-16 on Windows. In the Windows headers, LPWSTR is defined as a typedef for wchar_t*, or equivalently for WCHAR*, making it a pointer to a mutable wide string.

LPWSTR is part of the Windows API's distinction between writable and read-only strings. When a string should

Usage: Many Win32 functions accept LPWSTR to supply input strings or receive written output. For example, GetModuleFileNameW

Relationship to other types: PWSTR is a synonym for LPWSTR; LPCWSTR denotes a pointer to a constant

Summary: LPWSTR is a core Windows type used for mutable wide-character strings in Unicode-aware APIs, reflecting

not
be
modified
by
the
callee,
LPCWSTR
(const
wchar_t*)
is
used.
In
many
builds,
LPTSTR
maps
to
LPWSTR
when
UNICODE
is
defined,
and
to
LPSTR
when
not.
takes
an
HMODULE,
an
LPWSTR
buffer,
and
its
size,
and
writes
the
module's
path
to
the
buffer.
If
a
function
returns
a
string
that
the
caller
must
free,
the
required
deallocation
method
is
defined
by
the
API
(for
example,
CoTaskMemFree
for
COM-allocated
strings).
wide
string.
LPSTR
is
the
narrow-character
counterpart
for
char-based
strings.
Windows’
use
of
UTF-16
encoding
for
wide
strings
and
its
distinction
between
writable
and
read-only
string
parameters.