Hello, tbdev.
Until Stefan didn't send here the official TBP API I want to add something to
API written by Mark Wieder.
Unfortunately this API is written basing on TBPtest sent by Stefan twice before.
Because of it, it includes only functions which were in TBPtest and this is not
enough.
I think that this task not useless, because I expect that the TBP API will be
prepared as BAV API - as RTF describing the functions. So, the working headers
for C/C++ will be still necessary even after this API will be published here.
So, the header file will be actual anyway - and it just will need some
corrections. This is surely better then write it "from zero".
In tbplugin.h must be included the peace:
,-----
| int WINAPI TBP_GetCfgData(void* ABuf, int ABufSize);
| int WINAPI TBP_SetCfgData(void* ABuf, int ABufSize);
| int WINAPI TBP_GetInfo(char* B, int BSize);
`-----
(also it is necessary to add these exports to .def file, if any)
The description of these functions is here (just remake of some BAV sections):
-----------------------------------
TBP_SetCfgData
Syntax:
C++: int WINAPI TBP_SetCfgData(void* ABuf, int ABufSize);
Object Pascal: function TBP_SetCfgData(const ABuf; ABufSize: Integer):
Integer; stdcall;
Description:
This function is used for passing Plug-in configuration data stored in the
Plug-in configuration file.
There are no any special requirements about the configuration data format; it is
treated as a binary buffer that may contain any characters.
The TBP_SetCfgData is called when the Plug-in is loaded and initialised at the
program's start-up.
Parameters:
ABuf
[in] Pointer to a buffer that contains Plug-in configuration data.
ABufSize
[in] Size of the buffer identified by ABuf, in bytes.
Return values:
TBP_OK (=0) function completed successfully
TBP_Error (=-3) a failure occurred during execution of the function
TBP_NotSupported (=-1) function is not supported
-----------------------------------
TBP_GetCfgData
Syntax:
C++: int WINAPI TBP_GetCfgData(void* ABuf, int* ABufSize);
Object Pascal: function TBP_GetCfgData(var ABuf; var ABufSize: Integer):
Integer; stdcall;
Description:
This function is used for retrieving Plug-in configuration data after the
Plug-in is configured using the TBP_Setup function in order to store the data in
the Plug-in configuration file.
There are no any special requirements about the configuration data format; it is
treated as a binary buffer that may contain any characters.
The TBP_GetCfgData is called when the TBP_Setup function returns TBP_OK.
Parameters:
ABuf
[out] Pointer to a buffer that contains Plug-in configuration data. If ABuf is a
null pointer, the function must return the configuration data buffer size in
bytes in ABufSize. This parameter must be ignored if ABufSize does not point to
a positive value or the value is less than required buffer size.
ABufSize
[in, out] Pointer to the integer value with the size of the buffer identified by
ABuf, in bytes. The BAV_GetCfgData must replace the value with the required
buffer size in bytes.
Return values:
TBP_OK (=0) function completed successfully
AVC_Error (=-3) a failure occurred during execution of the function
AVC_NotSupported (=-1) function is not supported
-----------------------------------
TBP_GetInfo
Syntax:
C++: int WINAPI TBP_GetInfo(char* ABuf, int ABufSize);
Object Pascal: function TBP_GetInfo(ABuf: PChar; ABufSize: Integer): Integer;
stdcall;
Description:
This function is called in order to retrieve the text information about the
Plug-in. It usually called when user click "Information" on Plug-in page of
The Bat! preferences.
Parameters:
ABuf
[out] Pointer to a string buffer that receives the null-terminated string
containing the text information about the Plug-in. If ABuf is a null pointer,
the function must return value is the required buffer size in bytes.
ABufSize
[in] Size of the string buffer identified by ABuf, in bytes. If the ABufSize is
not a positive value, the function must return value is the required buffer size
in bytes.
Return values:
Any positive value the number of bytes written in the ABuf or the required
buffer size, the function completed successfully
TBP_Error (=-3) a failure occurred during execution of the function
TBP_NotSupported (=-1) function is not supported
I hope that Stefan will publish the full official API shortly. I am going to
make a section on my homepage with russian version of API, when it will be
ready.
And, again, I want to say that the data above is _unofficial_. There functions
work (I've checked it already), but may be some extra tricks exist which is not
covered yet.
--
Sincerely,
Alexey.
Using TB 2.00 on WinXP Pro SP1 (2600), spelling by ORFO2002 (CSAPI)
..with Kaspersky Antivirus Plugin (ver 3.5 Gold) & antispam filter BayesIt! 0.4dm
mailto:[EMAIL PROTECTED]
________________________________________________
http://www.silverstones.com/thebat/TBUDLInfo.html