mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-12 17:50:34 +05:00
Debug under Windows + some minor corrections.
This commit is contained in:
parent
db3a0bbde4
commit
096a139769
@ -152,12 +152,16 @@ namespace
|
|||||||
0,
|
0,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
if ( msgLen > 0 )
|
if ( msgLen > 0 ) {
|
||||||
error = (char*) cstr;
|
#if defined( WIN32 ) && defined( UNICODE )
|
||||||
|
error = Kernel_Utils::encode((wchar_t*)cstr);
|
||||||
|
#else
|
||||||
|
error = (char*)cstr;
|
||||||
|
#endif
|
||||||
LocalFree(cstr);
|
LocalFree(cstr);
|
||||||
|
}
|
||||||
|
|
||||||
return msgLen;
|
return (bool)msgLen;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -244,11 +248,11 @@ namespace
|
|||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|
||||||
std::string outFile = tmpDir + "libMeshGemsKeyGenerator.dll";
|
std::string outFile = tmpDir + "MeshGemsKeyGenerator.dll";
|
||||||
|
|
||||||
// use wget (== Invoke-WebRequest) PowerShell command available since Windows 7
|
// use wget (== Invoke-WebRequest) PowerShell command available since Windows 7
|
||||||
std::string psCmd = "wget -Uri " + url + " -OutFile " + outFile;
|
std::string psCmd = "wget -Uri " + url + " -OutFile " + outFile;
|
||||||
std::string cmd = "start powershell.exe " + psCmd;
|
std::string cmd = "powershell.exe " + psCmd;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@ -273,8 +277,10 @@ namespace
|
|||||||
SMESH_File resultFile( outFile, /*open=*/false );
|
SMESH_File resultFile( outFile, /*open=*/false );
|
||||||
bool ok = ( resultFile.exists() && resultFile.size() > 0 );
|
bool ok = ( resultFile.exists() && resultFile.size() > 0 );
|
||||||
|
|
||||||
if ( ok )
|
if (ok)
|
||||||
libraryFile._name = outFile;
|
libraryFile._name = outFile;
|
||||||
|
else
|
||||||
|
error = "Can't download file " + url;
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
@ -357,6 +363,7 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
|
|||||||
if ( !loadLibrary( error, libraryFile ))
|
if ( !loadLibrary( error, libraryFile ))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
bool ok = false;
|
||||||
typedef bool (*SignFun)(void* );
|
typedef bool (*SignFun)(void* );
|
||||||
SignFun signFun = (SignFun) GetProc( theLibraryHandle, "SignCAD" );
|
SignFun signFun = (SignFun) GetProc( theLibraryHandle, "SignCAD" );
|
||||||
if ( !signFun )
|
if ( !signFun )
|
||||||
@ -364,8 +371,8 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
|
|||||||
if ( ! getLastError( error ))
|
if ( ! getLastError( error ))
|
||||||
error = SMESH_Comment( "Can't find symbol 'SignCAD' in '") << getenv( theEnvVar ) << "'";
|
error = SMESH_Comment( "Can't find symbol 'SignCAD' in '") << getenv( theEnvVar ) << "'";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
bool ok;
|
{
|
||||||
|
|
||||||
SMESH_TRY;
|
SMESH_TRY;
|
||||||
|
|
||||||
@ -377,7 +384,7 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
|
|||||||
ok = false;
|
ok = false;
|
||||||
else if ( !ok )
|
else if ( !ok )
|
||||||
error = "SignCAD() failed (located in '" + libraryFile._name + "')";
|
error = "SignCAD() failed (located in '" + libraryFile._name + "')";
|
||||||
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user