Skip to content

Commit

Permalink
don't break and add default value for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSmoer committed Aug 22, 2023
1 parent e5e3235 commit dc823ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/windows/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ bool GetDetailData(DeviceDescriptor* device,

device->isReadOnly = !isWritable;

device->attachTimestamp = NULL;
const int64_t UNIX_TIME_START= 0x019DB1DED53E8000;
const int64_t TICKS_PER_SECOND = 10000000;
DWORD requiredSize;
Expand All @@ -685,9 +686,9 @@ bool GetDetailData(DeviceDescriptor* device,
errorCode = GetLastError();
device->error = "Couldn't SetupDiGetDeviceInterfaceDetailW: Error " +
std::to_string(errorCode);
result = false;
//result = false;
//TOOD is it right to break here?
break;
//break;
}
FILETIME filetime;
LARGE_INTEGER li;
Expand Down
4 changes: 4 additions & 0 deletions tests/drivelist.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ describe('Drivelist', () => {
device.isUAS === null || typeof device.isUAS === 'boolean',
`Invalid isUAS flag: ${device.isUAS}`,
);
ok(
device.attachTimestamp === null || Number.isFinite(device.attachTimestamp),
`Invalid attachTimestamp: ${device.attachTimestamp}`,
);
});
});

Expand Down

0 comments on commit dc823ae

Please sign in to comment.