Usage description
This API is not an official document intended for general use. The API can help users in edge cases but should not be used as a standard way of using ESET PROTECT On-Prem. The declared set of API functions only covers part of the feature. ESET does not provide support or guarantee backward compatibility for the ESET PROTECT On-Prem API. |
ServerAPI Tutorial in C Language
1 Usage
1.Load library
2.Get pointer to function, which can initialize library
3.Initialize library
4.Get pointer to function, which can send request and receive response
5.Get pointer to function, which can free response
6.Send request and receive response + free response
7.Get pointer to function, which can deinitialize library
8.Deinitialize library
9.Free library
1.1 Load library
HMODULE hMod = LoadLibrary(L"ServerApi.dll"); |
1.2 Get pointer to function, which can initialize library
typedef int (*era_init_lib)(); |
1.3 Initialize library
int res = init_lib();
Return value:
ERA_SUCCESS 0
ERA_INVALID_ARGUMENT 1
ERA_NOT_INITIALIZED 3
1.4 Get pointer to function, which can deinitialize library
typedef void (*era_deinit_lib)(); |
1.5 Get pointer to function, which can send request and receive response
typedef int (*era_process_request)(const char* request, char** response); |
1.6 Get pointer to function, which can free response
typedef void (*era_free)(char* s); |
1.7 Send request and receive response
std::string request; |
Return value:
ERA_SUCCESS 0
ERA_UNSATISFIED_DEPENDENCY 2
Free response:
free_response(szRes);
szRes—[in] const char*
1.8 Deinitialize library
deinit_lib();