The data type RPC_WSTR represents a platform-specific wide character string.
#if defined(RPC_USE_NATIVE_WCHAR) && defined(_NATIVE_WCHAR_T_DEFINED)
typedef _Null_terminated_ wchar_t __RPC_FAR * RPC_WSTR;
typedef _Null_terminated_ const wchar_t * RPC_CWSTR;
#else
typedef _Null_terminated_ unsigned short __RPC_FAR * RPC_WSTR;
typedef _Null_terminated_ const unsigned short * RPC_CWSTR;
#endif
Remarks
By default, the RPC_WSTR type is a pointer to a null-terminated UTF-16 Unicode string represented as a sequence of unsigned short values, and the RPC_CWSTR type is a pointer to a non-modifiable string in the same format.
When compiling for C++ where wchar_t
is a native type
(by using the /Zc:wchar_t
compiler option),
you can define the preprocessor macro RPC_USE_NATIVE_WCHAR
to change the definitions of RPC_WSTR and RPC_CWSTR to use the native wchar_t type
instead of unsigned short.
Requirements
| Requirement | Value |
|---|---|
| Minimum supported client | Windows 2000 Professional [desktop apps only] |
| Minimum supported server | Windows 2000 Server [desktop apps only] |
| Header | Rpcdce.h (include Rpc.h) |
See also
Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
