SavePluginData function
The SaveData function will save data for plugin. This data can be restored by GetPluginData function.Syntax
int __stdcall SavePluginData(
__in ProtocolSession *psess,
__in ListenSession *lsess,
__in ClientSession *sess,
__in char *name,
__in char *data,
__in int len,
__in int flags
);
Parameters
psess [in] A pointer to a ProtocolSession structure. This is a session assigned to a protocol at the moment it's loaded into the memory.
lsess [in] A pointer to a ListenSession structure. This is a session assigned to a plugin at the moment a user defines a new connection.
sess [in] A pointer to a ClientSession structure. This is a session assigned to a new connection. This connection has been created by a type PT_RECEIVER protocol.
name [in] A pointer to a null-terminated string conaining a name or an integer if flag GDPD_NAME_IS_INTEGER is set to identify the data.
data [in] A pointer to a buffer with the data to be saved.
len [in] The length, in bytes, of the buffer pointed to by the data parameter.
flags [in] This parameter can be zero or a combination of the following values.
Value | Meaning |
GDPD_IS_LIST 0x1 | The name paramter identifies a MultiColumnList initialized by the SetControlPanelOptions. The data parameter should hold a pointer to a list or have enough space to receive a pointer to a list. See the Remark section for more information.
|
GDPD_NO_COPY_LIST 0x2 | GetPluginData should not make a copy of the list if it doesn't exist in the memory space of the Listensession or ClientSession. Setting this flag will cause the function GetPluginData to return the same pointer that exists in the ListenSession (from where the ClientSession was created) or ProtocolSession. This means that all changes made to the list will also have effect on the ListenSession or ProtocolSession from where the pointer originaly came from. This flag should be combinated with the GDPD_IS_LIST flag.
|
GDPD_MEMORY_ONLY 0x4 | The data should be saved in memory only, set this flag will cause the SavePluginData function not to store the data on disk. This flag has no effect on the function GetPluginData.
|
GDPD_NAME_IS_INTEGER 0x80 | The name paramter is not a pointer to a null-terminated string but an integer to identify the data.
|
GDPD_RESET_DATA 0x8 | The data, identified by name, should be deleted for the selected session. This will not delete the identified data for other sessions, nor will it delete the default data set by SetControlPanelOptions. This flag has no effect on the function GetPluginData.
|
Return value
If no error occurs the function returns True (one). If the function fails it will return False (zero).
Remarks
If flag GDPD_IS_LIST is set and the
name parameter points to a list, initialized by the
SetControlPanelOptions function, the SavePluginData function will save the changes made to a list to the harddrive. The
data parameter should point to the pointer holding the list pointer returned by the
GetPluginData function.
If parameter
sess and
lsess are both
zero, the data will be saved on protocol level.
If parameter
sess is
zero lsess is
not zero the data will be saved for the listen session and automatic applied on new client sessions.
If parameter
sess is
not zero lsess is
zero the data will be saved for the client session.
If parameter
sess and
lsess are both
not zero, the function result in an error.
Requirements
Should be exported by | -
|
Minimum supported API | 1.00
|
Header | tvsserver_base.h
|