Help Center

DWStrCryptBinaryToStringWfunction

String ManagementfunctionDWSTRProcs.incdocumented

Syntax

FUNCTION DWStrCryptBinaryToStringW ( BYVAL pbBinary AS CONST UBYTE PTR, BYVAL cbBinary AS DWORD, BYVAL dwFlags AS DWORD, BYVAL pszString AS LPWSTR, BYVAL pcchString AS DWORD PTR ) AS WINBOOL
Also documented as DWStrCryptBinaryToString — one description covers them all.

Parameters

NameDescription
pbBinaryA pointer to the array of bytes to be converted into a string.
cbBinaryThe number of elements in the pbBinary array.
dwFlagsSpecifies the format of the resulting formatted string.
pszStringA pointer to a buffer that receives the converted string. To calculate the number of characters that must be allocated to hold the returned string, set this parameter to NULL. The function will place the required number of characters, including the terminating NULL character, in the value pointed to by pcchString.
pcchStringA pointer to a DWORD variable that contains the size, in characters, of the pszString buffer. If pszString is NULL, the function calculates the length of the return string (including the terminating null character) in characters and returns it in this parameter. If pszString is not NULL and big enough, the function converts the binary data into a specified string format including the terminating null character, but pcchString receives the length in characters, not including the terminating null character.

Return value

If the function succeeds, the function returns nonzero (CTRUE). If the function fails, it returns zero (FALSE).

Description

Converts an array of bytes into a formatted string.

Values available for the dwFlags parameter:

In addition to the values above, one or more of the following values can be specified to modify the behavior of the function.

Remarks

With the exception of when CRYPT_STRING_BINARY encoding is used, all strings are appended with a new line sequence. By default, the new line sequence is a CR/LF pair (0x0D/0x0A). If the dwFlags parameter contains the CRYPT_STRING_NOCR flag, then the new line sequence is a LF character (0x0A). If the dwFlags parameter contains the CRYPT_STRING_NOCRLF flag, then no new line sequence is appended to the string.

Reference

  • Include file DWSTRProcs.inc
  • Defined in AfxNova/DWStrProcs.inc:1448
  • Documented in String Management/DWString Procedures.md
  • Topic: String Procedures