The LMX_ClientStoreSave function saves data to the local client store.

Prototype

LMX_STATUS LMX_ClientStoreSave
(
   LMX_HANDLE LmxHandle,
   const char *szVirtualFilename,
   const char *szString
);

Parameters

LmxHandle
[in/out] LM-X handle.

szVirtualFilename
[in] Filename under which data should be stored in the virtual filesystem.

szString
[in] The content to store in the client store.

Return values

On success, this function returns the status code LMX_SUCCESS.

On failure, this function returns an error code in the format described in Return codes.

Remarks

The LMX_ClientStoreSave function and the LMX_ClientStoreLoad function work together to store sensitive license information in an encrypted manner into the client store.

The length of the content should be limited to LMX_MAX_LONG_STRING_LENGTH to avoid buffer overflows.

When the length is zero, the content is deleted from the client store.

See Secure store and Client store for more information about secure store and client store.

Example

The following is a basic example of using LMX_ClientStoreSave, which saves the "DataToBeStored" string to "myFile".

#include <lmx.h>
#include <stdio.h>

LMX_HANDLE h;

int main() 
{
  char m[LMX_MAX_LONG_STRING_LENGTH];

  exit_on_error(LMX_Init(&h));
  exit_on_error(LMX_ClientStoreSave(h, "myFile", "DataToBeStored"));

  exit_on_error(LMX_ClientStoreLoad(h, "myFile", m));
  printf("Loaded: %s\n", m);

  return 0;
}