Prevent OOM

This commit is contained in:
2026-06-18 05:55:31 +10:00
parent ebba70b9d9
commit b3436a61ee
44 changed files with 1797 additions and 66 deletions
+11
View File
@@ -523,6 +523,10 @@ namespace ANSCENTER
[[nodiscard]] static bool isPathSafe(const std::string& pathStr);
public:
[[nodiscard]] static bool LicenseVerification(std::string licenseKey, int productId, std::string registrationName);
// Returns this machine's hardware id (same value as ANSLSHelper::GetCurrentHardwareId)
// but as a static call requiring no handle/instance — convenient for LabVIEW and other
// callers that just need the HWID. Returns "" on failure.
[[nodiscard]] static std::string GetHardwareId();
[[nodiscard]] static EngineType CheckHardwareInformation();
[[nodiscard]] static SystemHealthInfo GetSystemHealthInformation();
@@ -564,6 +568,13 @@ extern "C" __declspec(dllexport) void SetLicenseServiceURL(ANSCENTER::ANSLSHelpe
extern "C" __declspec(dllexport) int GetLicenseData(ANSCENTER::ANSLSHelper * *Handle, const char* licenseKey, LStrHandle licenseData);
extern "C" __declspec(dllexport) int LoadLicenseTemplate(ANSCENTER::ANSLSHelper * *Handle, const char* templateFilePath);
extern "C" __declspec(dllexport) int GetCurrentHardwareId(ANSCENTER::ANSLSHelper * *Handle, LStrHandle currentHwID);
// Handle-free static hardware id, two flavours:
// - GetHardwareId: LabVIEW native string handle (LStrHandle) output. Returns 1 on success, 0 on failure.
// - GetHardwareIdBuffer: caller-provided C buffer; works from plain C/C++ too (no LabVIEW manager).
// Writes a null-terminated string into 'buffer' (capacity 'bufferSize') and returns the number of
// characters written (excluding the null terminator), or 0 on failure / insufficient buffer.
extern "C" __declspec(dllexport) int GetHardwareId(LStrHandle currentHwID);
extern "C" __declspec(dllexport) int GetHardwareIdBuffer(char* buffer, int bufferSize);
extern "C" __declspec(dllexport) int GenerateKey(ANSCENTER::ANSLSHelper * *Handle, int productId, const char* registrationName, int productFeature, int trialLicense, LStrHandle generatedKey);
extern "C" __declspec(dllexport) int GenerateKeyWithExpiredDate(ANSCENTER::ANSLSHelper * *Handle, int productId, const char* registrationName, int productFeature, int expiredYear, int expiredMonth, int expiredDate, LStrHandle generatedKey);
extern "C" __declspec(dllexport) int CheckLicenseKey(ANSCENTER::ANSLSHelper * *Handle, const char* licenseKey, const char* registrationName, int productId);// , LStrHandle strEnableFeature); // Check if the license key is valid