summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/icq_packet.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/IcqOscarJ/src/icq_packet.h')
-rw-r--r--protocols/IcqOscarJ/src/icq_packet.h64
1 files changed, 34 insertions, 30 deletions
diff --git a/protocols/IcqOscarJ/src/icq_packet.h b/protocols/IcqOscarJ/src/icq_packet.h
index fde2b8551a..90c8bcff30 100644
--- a/protocols/IcqOscarJ/src/icq_packet.h
+++ b/protocols/IcqOscarJ/src/icq_packet.h
@@ -47,22 +47,22 @@ WORD generate_flap_sequence();
void __fastcall init_generic_packet(icq_packet *pPacket, WORD wHeaderLen);
void write_httphdr(icq_packet *pPacket, WORD wType, DWORD dwSeq);
void __fastcall write_flap(icq_packet *pPacket, BYTE byFlapChannel);
-void __fastcall serverPacketInit(icq_packet *pPacket, WORD wSize);
-void __fastcall directPacketInit(icq_packet *pPacket, DWORD dwSize);
+void __fastcall serverPacketInit(icq_packet *pPacket, size_t cbSize);
+void __fastcall directPacketInit(icq_packet *pPacket, size_t cbSize);
-void __fastcall serverCookieInit(icq_packet *pPacket, BYTE *pCookie, WORD wCookieSize);
+void __fastcall serverCookieInit(icq_packet *pPacket, BYTE *pCookie, size_t wCookieSize);
void __fastcall packByte(icq_packet *pPacket, BYTE byValue);
void __fastcall packWord(icq_packet *pPacket, WORD wValue);
void __fastcall packDWord(icq_packet *pPacket, DWORD dwValue);
void __fastcall packQWord(icq_packet *pPacket, DWORD64 qwValue);
-void packTLV(icq_packet *pPacket, WORD wType, WORD wLength, const BYTE *pbyValue);
+void packTLV(icq_packet *pPacket, WORD wType, size_t wLength, const BYTE *pbyValue);
void packTLVWord(icq_packet *pPacket, WORD wType, WORD wData);
void packTLVDWord(icq_packet *pPacket, WORD wType, DWORD dwData);
void packTLVUID(icq_packet *pPacket, WORD wType, DWORD dwUin, const char *szUid);
-void packBuffer(icq_packet *pPacket, const BYTE *pbyBuffer, WORD wLength);
-//void packLEWordSizedBuffer(icq_packet* pPacket, const BYTE* pbyBuffer, WORD wLength);
+void packBuffer(icq_packet *pPacket, const BYTE *pbyBuffer, size_t wLength);
+
int __fastcall getUINLen(DWORD dwUin);
int __fastcall getUIDLen(DWORD dwUin, const char *szUid);
void __fastcall packUIN(icq_packet *pPacket, DWORD dwUin);
@@ -75,42 +75,46 @@ void packFNACHeader(icq_packet *pPacket, WORD wFamily, WORD wSubtype, WORD wFlag
void __fastcall packLEWord(icq_packet *pPacket, WORD wValue);
void __fastcall packLEDWord(icq_packet *pPacket, DWORD dwValue);
-void packLETLVLNTS(PBYTE *buf, int *bufpos, const char *str, WORD wType);
+void packLETLVLNTS(PBYTE *buf, size_t *bufpos, const char *str, WORD wType);
-void ppackByte(PBYTE *buf, int *buflen, BYTE byValue);
-void ppackWord(PBYTE *buf, int *buflen, WORD wValue);
-void ppackLEWord(PBYTE *buf, int *buflen, WORD wValue);
-void ppackLEDWord(PBYTE *buf, int *buflen, DWORD dwValue);
-void ppackLELNTS(PBYTE *buf, int *buflen, const char *str);
-void ppackBuffer(PBYTE *buf, int *buflen, WORD wLength, const BYTE *pbyValue);
+void ppackByte(PBYTE *buf, size_t *buflen, BYTE byValue);
+void ppackWord(PBYTE *buf, size_t *buflen, WORD wValue);
+void ppackLEWord(PBYTE *buf, size_t *buflen, WORD wValue);
+void ppackLEDWord(PBYTE *buf, size_t *buflen, DWORD dwValue);
+void ppackLELNTS(PBYTE *buf, size_t *buflen, const char *str);
+void ppackBuffer(PBYTE *buf, size_t *buflen, size_t wLength, const BYTE *pbyValue);
-void ppackTLV(PBYTE *buf, int *buflen, WORD wType, WORD wLength, const BYTE *pbyValue);
-void ppackTLVByte(PBYTE *buf, int *buflen, WORD wType, BYTE byValue);
-void ppackTLVWord(PBYTE *buf, int *buflen, WORD wType, WORD wValue);
-void ppackTLVDWord(PBYTE *buf, int *buflen, WORD wType, DWORD dwValue);
-void ppackTLVDouble(PBYTE *buf, int *buflen, WORD wType, double dValue);
-void ppackTLVUID(PBYTE *buf, int *buflen, WORD wType, DWORD dwUin, const char *szUid);
+void ppackTLV(PBYTE *buf, size_t *buflen, WORD wType, size_t wLength, const BYTE *pbyValue);
+void ppackTLVByte(PBYTE *buf, size_t *buflen, WORD wType, BYTE byValue);
+void ppackTLVWord(PBYTE *buf, size_t *buflen, WORD wType, WORD wValue);
+void ppackTLVDWord(PBYTE *buf, size_t *buflen, WORD wType, DWORD dwValue);
+void ppackTLVDouble(PBYTE *buf, size_t *buflen, WORD wType, double dValue);
+void ppackTLVUID(PBYTE *buf, size_t *buflen, WORD wType, DWORD dwUin, const char *szUid);
-void ppackLETLVByte(PBYTE *buf, int *buflen, BYTE byValue, WORD wType, BYTE always);
-void ppackLETLVWord(PBYTE *buf, int *buflen, WORD wValue, WORD wType, BYTE always);
-void ppackLETLVDWord(PBYTE *buf, int *buflen, DWORD dwValue, WORD wType, BYTE always);
-void ppackLETLVLNTS(PBYTE *buf, int *buflen, const char *str, WORD wType, BYTE always);
-void ppackLETLVWordLNTS(PBYTE *buf, int *buflen, WORD w, const char *str, WORD wType, BYTE always);
-void ppackLETLVLNTSByte(PBYTE *buf, int *buflen, const char *str, BYTE b, WORD wType);
+void ppackLETLVByte(PBYTE *buf, size_t *buflen, BYTE byValue, WORD wType, BYTE always);
+void ppackLETLVWord(PBYTE *buf, size_t *buflen, WORD wValue, WORD wType, BYTE always);
+void ppackLETLVDWord(PBYTE *buf, size_t *buflen, DWORD dwValue, WORD wType, BYTE always);
+void ppackLETLVLNTS(PBYTE *buf, size_t *buflen, const char *str, WORD wType, BYTE always);
+void ppackLETLVWordLNTS(PBYTE *buf, size_t *buflen, WORD w, const char *str, WORD wType, BYTE always);
+void ppackLETLVLNTSByte(PBYTE *buf, size_t *buflen, const char *str, BYTE b, WORD wType);
-void ppackTLVBlockItems(PBYTE *buf, int *buflen, WORD wType, int *nItems, PBYTE *pBlock, WORD *wLength, BOOL bSingleItem);
-void ppackTLVBlockItem(PBYTE *buf, int *buflen, WORD wType, PBYTE *pItem, WORD *wLength);
+void ppackTLVBlockItems(PBYTE *buf, size_t *buflen, WORD wType, int *nItems, PBYTE *pBlock, WORD *wLength, BOOL bSingleItem);
+void ppackTLVBlockItem(PBYTE *buf, size_t *buflen, WORD wType, PBYTE *pItem, WORD *wLength);
void __fastcall unpackByte(BYTE **pSource, BYTE *byDestination);
void __fastcall unpackWord(BYTE **pSource, WORD *wDestination);
+void __fastcall unpackWord(BYTE **pSource, size_t *wDestination);
void __fastcall unpackDWord(BYTE **pSource, DWORD *dwDestination);
void __fastcall unpackQWord(BYTE **pSource, DWORD64 *qwDestination);
-void unpackString(BYTE **buf, char *string, WORD len);
-void unpackWideString(BYTE **buf, WCHAR *string, WORD len);
-void unpackTypedTLV(BYTE *buf, int buflen, WORD type, WORD *ttype, WORD *tlen, BYTE **ttlv);
+void unpackString(BYTE **buf, char *string, size_t len);
+void unpackWideString(BYTE **buf, WCHAR *string, size_t len);
+void unpackTypedTLV(BYTE *buf, size_t buflen, WORD type, WORD *ttype, size_t *tlen, BYTE **ttlv);
BOOL unpackUID(BYTE **ppBuf, WORD *pwLen, DWORD *pdwUIN, uid_str *ppszUID);
void __fastcall unpackLEWord(BYTE **buf, WORD *w);
+void __fastcall unpackLEWord(BYTE **buf, size_t *w);
+
void __fastcall unpackLEDWord(BYTE **buf, DWORD *dw);
+void __fastcall unpackLEDWord(BYTE **buf, size_t *dw);
#endif /* __ICQ_PACKET_H */