EgtLock :
- aggiunta lettura Serial Number anche per chiavi di rete.
This commit is contained in:
+1
-2
@@ -188,8 +188,7 @@ GetLockSN( int& nLockSN)
|
||||
if ( ! s_bNetHwKey)
|
||||
return GetDongleSN( nLockSN) ;
|
||||
else {
|
||||
nLockSN = 0 ;
|
||||
return false ;
|
||||
return GetNetDongleSN( nLockSN) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+20
-1
@@ -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)
|
||||
|
||||
@@ -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) ;
|
||||
|
||||
Reference in New Issue
Block a user