.......... [ZBXNEXT-1343] restored some of the changes lost during merge
...G...... [ZBX-8031] changed all occurrences of LPBYTE to the proper C type to avoid confusion