sizeof(wchar_t) gives you the number of bytes of one wide character, thus sizeof(wchar_t) * (wcslen(string) + 1) gives you the size of "string" (including the terminating '\0') in bytes.

Bye,...