mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
Merge pull request #187 from zuzkins/sp-list-win-fix
FIX: Some windows 7 displays error when listing com ports lgtm, nice work.
This commit is contained in:
commit
be5bbee4bc
1 changed files with 2 additions and 2 deletions
|
|
@ -354,7 +354,7 @@ void EIO_List(uv_work_t* req) {
|
|||
DISPATCH_OBJ(colDevices);
|
||||
|
||||
dhInitialize(TRUE);
|
||||
dhToggleExceptions(TRUE);
|
||||
dhToggleExceptions(FALSE);
|
||||
|
||||
dhGetObject(L"winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2", NULL, &wmiSvc);
|
||||
dhGetValue(L"%o", &colDevices, wmiSvc, L".ExecQuery(%S)", L"Select * from Win32_PnPEntity");
|
||||
|
|
@ -369,7 +369,7 @@ void EIO_List(uv_work_t* req) {
|
|||
dhGetValue(L"%s", &name, objDevice, L".Name");
|
||||
dhGetValue(L"%s", &pnpid, objDevice, L".PnPDeviceID");
|
||||
|
||||
if( (match = strstr( name, "(COM" )) != NULL ) { // look for "(COM23)"
|
||||
if( name != NULL && ((match = strstr( name, "(COM" )) != NULL) ) { // look for "(COM23)"
|
||||
// 'Manufacturuer' can be null, so only get it if we need it
|
||||
dhGetValue(L"%s", &manu, objDevice, L".Manufacturer");
|
||||
port_count++;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue