On Wed, Dec 2, 2020 at 6:56 AM Dmitry Timoshkov dmitry@baikal.ru wrote:
+static BOOL BinaryToHexRawW(const BYTE *bin, DWORD nbin, DWORD flags, LPWSTR str, DWORD *nstr) { static const WCHAR hex[] = L"0123456789abcdef"; DWORD needed; @@ -506,6 +506,79 @@ static BOOL BinaryToHexW(const BYTE *bin, DWORD nbin, DWORD flags, LPWSTR str, D return TRUE; }
+static BOOL binary_to_hexW(const BYTE *bin, DWORD nbin, DWORD flags, LPWSTR str, DWORD *nstr) +{
- static const WCHAR hex[] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
This can be an L-string now. In fact, you can just move the declaration from BinaryToHexRawW outside of the function and use it in both BinaryToHexRawW and binary_to_hexW.
-Alex