usb 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/package.json +1 -1
- package/prebuilds/android-arm/node.napi.armv7.node +0 -0
- package/prebuilds/android-arm64/node.napi.armv8.node +0 -0
- package/prebuilds/darwin-x64+arm64/node.napi.node +0 -0
- package/prebuilds/linux-arm/node.napi.armv6.node +0 -0
- package/prebuilds/linux-arm/node.napi.armv7.node +0 -0
- package/prebuilds/linux-arm64/node.napi.armv8.node +0 -0
- package/prebuilds/linux-ia32/node.napi.node +0 -0
- package/prebuilds/linux-x64/node.napi.glibc.node +0 -0
- package/prebuilds/linux-x64/node.napi.musl.node +0 -0
- package/prebuilds/win32-ia32/node.napi.node +0 -0
- package/prebuilds/win32-x64/node.napi.node +0 -0
- package/src/hotplug/windows.cc +2 -0
- package/src/node_usb.cc +5 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/hotplug/windows.cc
CHANGED
|
@@ -80,6 +80,7 @@ class HotPlugManagerWindows : public HotPlugManager
|
|
|
80
80
|
{
|
|
81
81
|
public:
|
|
82
82
|
HotPlugManagerWindows()
|
|
83
|
+
: hcm(nullptr)
|
|
83
84
|
{
|
|
84
85
|
cmNotifyFilter = { 0 };
|
|
85
86
|
cmNotifyFilter.cbSize = sizeof(cmNotifyFilter);
|
|
@@ -105,6 +106,7 @@ public:
|
|
|
105
106
|
auto res = CM_Register_Notification(&cmNotifyFilter, (PVOID)instanceData, (PCM_NOTIFY_CALLBACK)&MyCMInterfaceNotification, &hcm);
|
|
106
107
|
if (res != CR_SUCCESS)
|
|
107
108
|
{
|
|
109
|
+
isRunning = false;
|
|
108
110
|
THROW_ERROR("RegisterNotification failed")
|
|
109
111
|
}
|
|
110
112
|
}
|
package/src/node_usb.cc
CHANGED
|
@@ -141,9 +141,10 @@ Napi::Value EnableHotplugEvents(const Napi::CallbackInfo& info) {
|
|
|
141
141
|
if (!instanceData->hotplugEnabled) {
|
|
142
142
|
instanceData->hotplugThis.Reset(info.This().As<Napi::Object>(), 1);
|
|
143
143
|
|
|
144
|
+
// Start queue, then enable hotplug events
|
|
145
|
+
instanceData->hotplugQueue.start(env);
|
|
144
146
|
instanceData->hotplugManager->enableHotplug(env, instanceData);
|
|
145
147
|
|
|
146
|
-
instanceData->hotplugQueue.start(env);
|
|
147
148
|
instanceData->hotplugEnabled = true;
|
|
148
149
|
}
|
|
149
150
|
return env.Undefined();
|
|
@@ -155,9 +156,11 @@ Napi::Value DisableHotplugEvents(const Napi::CallbackInfo& info) {
|
|
|
155
156
|
ModuleData* instanceData = env.GetInstanceData<ModuleData>();
|
|
156
157
|
|
|
157
158
|
if (instanceData->hotplugEnabled) {
|
|
158
|
-
instanceData->hotplugManager->disableHotplug(env, instanceData);
|
|
159
159
|
|
|
160
|
+
// Disable events, then stop queue
|
|
161
|
+
instanceData->hotplugManager->disableHotplug(env, instanceData);
|
|
160
162
|
instanceData->hotplugQueue.stop();
|
|
163
|
+
|
|
161
164
|
instanceData->hotplugEnabled = false;
|
|
162
165
|
}
|
|
163
166
|
return env.Undefined();
|