Skip to content

Commit 2e804e0

Browse files
authored
Merge pull request #48 from cryptlex/huzaif/get-last-activation-error
feat: add GetLastActivationError
2 parents 110c587 + ecac024 commit 2e804e0

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/main/java/com/cryptlex/lexactivator/LexActivator.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,24 @@ public static int GetServerSyncGracePeriodExpiryDate() throws LexActivatorExcept
13781378
}
13791379
}
13801380

1381+
/**
1382+
* Gets the error code that caused the activation data to be cleared.
1383+
*
1384+
* @return Returns the error code that caused the activation data to be cleared.
1385+
* @throws LexActivatorException
1386+
*/
1387+
public static int GetLastActivationError() throws LexActivatorException {
1388+
int status;
1389+
IntByReference errorCode = new IntByReference(0);
1390+
status = LexActivatorNative.GetLastActivationError(errorCode);
1391+
switch (status) {
1392+
case LA_OK:
1393+
return errorCode.getValue();
1394+
default:
1395+
throw new LexActivatorException(status);
1396+
}
1397+
}
1398+
13811399
/**
13821400
* Gets the trial activation metadata.
13831401
*

src/main/java/com/cryptlex/lexactivator/LexActivatorNative.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ public interface ReleaseUpdateCallbackTypeA extends Callback {
221221

222222
public static native int GetServerSyncGracePeriodExpiryDate(IntByReference expiryDate);
223223

224+
public static native int GetLastActivationError(IntByReference errorCode);
225+
224226
public static native int GetTrialActivationMetadata(String key, ByteBuffer value, int length);
225227

226228
public static native int GetTrialActivationMetadata(WString key, CharBuffer value, int length);

0 commit comments

Comments
 (0)