MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / register_error

Function register_error

deps/SDL2/src/hidapi/windows/hid.c:203–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203static void register_error(hid_device *device, const char *op)
204{
205 WCHAR *ptr, *msg;
206
207 DWORD count = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
208 FORMAT_MESSAGE_FROM_SYSTEM |
209 FORMAT_MESSAGE_IGNORE_INSERTS,
210 NULL,
211 GetLastError(),
212 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
213 (LPWSTR)&msg, 0/*sz*/,
214 NULL);
215 if (!count)
216 return;
217
218 /* Get rid of the CR and LF that FormatMessage() sticks at the
219 end of the message. Thanks Microsoft! */
220 ptr = msg;
221 while (*ptr) {
222 if (*ptr == '\r') {
223 *ptr = 0x0000;
224 break;
225 }
226 ptr++;
227 }
228
229 /* Store the message off in the Device entry so that
230 the hid_error() function can pick it up. */
231 LocalFree(device->last_error_str);
232 device->last_error_str = msg;
233}
234
235#ifndef HIDAPI_USE_DDK
236static int lookup_functions()

Callers 9

hid.cFile · 0.70
hid_write_timeoutFunction · 0.70
hid_read_timeoutFunction · 0.70
hid_send_feature_reportFunction · 0.70
hid_get_feature_reportFunction · 0.70
hid_get_product_stringFunction · 0.70
hid_get_indexed_stringFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected