/****************************************************************************** 
  Header: WinLicenseSDK.h
  Description: SDK header definition for the C/C++ language

  Author/s: Oreans Technologies  
  (c) 2010 Oreans Technologies
*****************************************************************************/ 

#pragma once

#ifdef _WIN64
 #pragma comment(lib, "CustomWinLicenseSDK64.lib")
#else
 #pragma comment(lib, "CustomWinLicenseSDK32.lib")
#endif


// ***********************************************
// WinLicense typedef definition
// ***********************************************

typedef struct _sLicenseFeatures 
{ 
    unsigned    cb;                     // size of struct
    unsigned    NumDays;                // expiration days
    unsigned    NumExec;                // expiration executions
    SYSTEMTIME  ExpDate;                // expiration date 
    unsigned    CountryId;              // country ID
    unsigned    Runtime;                // expiration runtime
    unsigned    GlobalMinutes;          // global time expiration
    SYSTEMTIME  InstallDate;            // Date to install the license since it was created
    unsigned    NetInstances;           // Network instances via shared file
    unsigned    EmbedLicenseInfoInKey;  // for Dynamic SmartKeys, it embeds Name+Company+Custom inside generated SmartKey
    unsigned    EmbedCreationDate;      // Embed the date that the key was created
} sLicenseFeatures;


// ***********************************************
// WinLicense functions prototype
// ***********************************************

#ifdef __cplusplus
extern "C" {
#endif

__declspec(dllimport) int __stdcall GenerateTrialExtensionKey(int Level, int NumDays, int NumExec, SYSTEMTIME* NewDate,\
                                                                     int NumMinutes, int TimeRuntime, char* BufferOut);
                                    

__declspec(dllimport) int __stdcall WLCustomGenTrialExtensionFileKey(int Level, int NumDays, int NumExec,\
                                                                                SYSTEMTIME* NewDate, int NumMinutes,\
                                                                                int TimeRuntime, char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenTrialExtensionRegistryKey(int Level, int NumDays, int NumExec,\
                                                                                     SYSTEMTIME* NewDate, int NumMinutes,\
                                                                                     int TimeRuntime, char* pKeyName, char* pKeyValueName,\
                                                                                     char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenPassword(char* Name, char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseFileKey(char* UserName, char* Organization, char* CustomData,\
                                                                        char* MachineID, int NumDays, int NumExec, SYSTEMTIME* NewDate,\
                                                                        int CountryId, int Runtime, int GlobalMinutes, char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseFileKeyW(const wchar_t* UserName, const wchar_t* Organization,\
                                                                          const wchar_t* CustomData, const wchar_t* MachineID, int NumDays,\
                                                                          int NumExec, SYSTEMTIME* NewDate, int CountryId, int Runtime,\
                                                                          int GlobalMinutes, char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseFileKeyEx(const char* UserName, const char* Organization,\
                                                                           const char* CustomData, const char* MachineID,\
                                                                           sLicenseFeatures* LicenseFeatures, char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseFileKeyExW(const wchar_t* UserName, const wchar_t* Organization,\
                                                                             const wchar_t* CustomData, const wchar_t* MachineID,\
                                                                             sLicenseFeatures* LicenseFeatures, char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseRegistryKey(char* UserName, char* Organization, char* CustomData,\
                                                                              char* MachineID, int NumDays, int NumExec, SYSTEMTIME* NewDate,\
                                                                              int CountryId, int Runtime, int GlobalMinutes, char* KeyName,\
                                                                              char* KeyValueName, char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseRegistryKeyW(const wchar_t* UserName, const wchar_t* Organization,\
                                                                                const wchar_t* CustomData, const wchar_t* MachineID, int NumDays,\
                                                                                int NumExec, SYSTEMTIME* NewDate, int CountryId, int Runtime,\
                                                                                int GlobalMinutes, const wchar_t* KeyName, const wchar_t* KeyValueName,\
                                                                                char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseRegistryKeyEx(const char* UserName, const char* Organization,\
                                                                                 const char* CustomData, const char* MachineID,\
                                                                                 sLicenseFeatures* LicenseFeatures, char* KeyName,\
                                                                                 char* KeyValueName, char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseRegistryKeyExW(const wchar_t* UserName, const wchar_t* Organization,\
                                                                                   const wchar_t* CustomData, const wchar_t* MachineID,\
                                                                                   sLicenseFeatures* LicenseFeatures, const wchar_t* KeyName,\
                                                                                   const wchar_t* KeyValueName, char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseTextKey(char* UserName, char* Organization, char* CustomData, char* MachineID,\
                                                                         int NumDays, int NumExec, SYSTEMTIME* NewDate, int CountryId, int Runtime,\
                                                                         int GlobalMinutes, char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseTextKeyW(const wchar_t* UserName, const wchar_t* Organization,\
                                                                           const wchar_t* CustomData, const wchar_t* MachineID, int NumDays,\
                                                                           int NumExec, SYSTEMTIME* NewDate, int CountryId, int Runtime,\
                                                                           int GlobalMinutes, wchar_t* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseTextKeyEx(const char* UserName, const char* Organization,\
                                                                            const char* CustomData, const char* MachineID,\
                                                                            sLicenseFeatures* LicenseFeatures, char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseTextKeyExW(const wchar_t* UserName, const wchar_t* Organization,\
                                                                              const wchar_t* CustomData, const wchar_t* MachineID,\
                                                                              sLicenseFeatures* LicenseFeatures, wchar_t* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseSmartKey(char* UserName, char* Organization, char* CustomData,\
                                                                           char* MachineID, int NumDays, int NumExec, SYSTEMTIME* NewDate,\
                                                                           char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseSmartKeyW(wchar_t* UserName, wchar_t* Organization, wchar_t* CustomData,\
                                                                             wchar_t* MachineID, int NumDays, int NumExec, SYSTEMTIME* NewDate,\
                                                                             wchar_t* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseDynSmartKey(const char* UserName, const char* Organization,\
                                                                               const char* CustomData, const char* MachineID,\
                                                                               sLicenseFeatures* LicenseFeatures, char* BufferOut);

__declspec(dllimport) int __stdcall WLCustomGenLicenseDynSmartKeyW(const wchar_t* UserName, const wchar_t* Organization,\
                                                                                  const wchar_t* CustomData, const wchar_t* MachineID,\
                                                                                  sLicenseFeatures* LicenseFeatures, wchar_t* BufferOut);

#ifdef __cplusplus
}
#endif

