MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / hid_internal_UTF8toUTF16

Function hid_internal_UTF8toUTF16

lib/hidapi/windows/hid.c:681–694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679}
680
681static wchar_t *hid_internal_UTF8toUTF16(const char *src)
682{
683 wchar_t *dst = NULL;
684 int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, src, -1, NULL, 0);
685 if (len) {
686 dst = (wchar_t*)calloc(len, sizeof(wchar_t));
687 if (dst == NULL) {
688 return NULL;
689 }
690 MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, src, -1, dst, len);
691 }
692
693 return dst;
694}
695
696static struct hid_device_info *hid_internal_get_device_info(const wchar_t *path, HANDLE handle)
697{

Callers 2

hid.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected