EgtLock :

- aggiunta lettura Serial Number anche per chiavi di rete.
This commit is contained in:
Dario Sassi
2026-02-06 10:24:36 +01:00
parent 049a453c2a
commit 5490eaa2dd
3 changed files with 22 additions and 3 deletions
+1 -2
View File
@@ -188,8 +188,7 @@ GetLockSN( int& nLockSN)
if ( ! s_bNetHwKey)
return GetDongleSN( nLockSN) ;
else {
nLockSN = 0 ;
return false ;
return GetNetDongleSN( nLockSN) ;
}
}
}
+20 -1
View File
@@ -137,7 +137,7 @@ NetDongleConnect( int nNetUserId, const string& sAddrPort)
strcpy_s( (char*)label, XLT_LABEL_SIZE, sLabel.c_str()) ;
memset( label + sLabel.size(), 0x00, sizeof( label) - sLabel.size()) ;
int nStatusND = 0 ;
if ( &sAddrPort == nullptr || sAddrPort.empty() ||
if ( sAddrPort.empty() ||
sAddrPort.find_first_not_of( " \t\r\n") == std::string::npos)
s_net_data = xnd_net_data_create_resolving_local_search( s_env, XND_DEFAULT_PORT, label, 10000, 0, 0, &nStatusND) ;
else {
@@ -255,6 +255,25 @@ NetDongleConnect( int nNetUserId, const string& sAddrPort)
return true ;
}
//----------------------------------------------------------------------------
bool
GetNetDongleSN( int& nDongleSN)
{
// default
nDongleSN = 0 ;
// verifico validità contesto
if ( s_dev_ctx == nullptr)
return false ;
// recupero informazioni sulla chiave
XND_INFO xInfo ;
int nStatIF = xnd_get_info( s_dev_ctx, &xInfo) ;
if ( nStatIF != 0)
return false ;
// ricavo il SN
nDongleSN = *((unsigned int*)&xInfo.sn[12]) ;
return true ;
}
//----------------------------------------------------------------------------
bool
NetDongleClose( void)
+1
View File
@@ -18,5 +18,6 @@
//-------------------------------------------------------------------------------
bool GetNetDongleId( int nNetUserId, const std::string& sAddrPort, std::string& sDongleId) ;
bool NetDongleConnect( int nNetUserId, const std::string& sAddrPort) ;
bool GetNetDongleSN( int& nDongleSN) ;
bool NetDongleClose( void) ;
bool NetDongleNotFound( void) ;