do not FILE_FLAG_OVERLAPPED
This commit is contained in:
parent
937a3ba51c
commit
92c82f4572
1 changed files with 1 additions and 2 deletions
|
@ -20,8 +20,7 @@ int get_battery_level(const char *device_path, bool *is_charging) {
|
|||
HANDLE hDevice;
|
||||
if ((hDevice = CreateFile(device_path, GENERIC_READ | GENERIC_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
|
||||
OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL)) ==
|
||||
INVALID_HANDLE_VALUE) {
|
||||
OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE) {
|
||||
fprintf_s(stderr, "[%lu] Failed to open device.\n", GetLastError());
|
||||
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue