diff options
author | George Hazan <george.hazan@gmail.com> | 2014-11-30 16:19:57 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-11-30 16:19:57 +0000 |
commit | f485b5e4b683cc31168d440dc89574913e814852 (patch) | |
tree | 1d5e234805492a7e534d2edaddb2d4f3c75bdd77 /protocols/IcqOscarJ/src/icq_packet.h | |
parent | a30574fe4abb9065a8a67a6ce992ce11deef2564 (diff) |
all buffer lengths are of size_t now
git-svn-id: http://svn.miranda-ng.org/main/trunk@11173 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src/icq_packet.h')
-rw-r--r-- | protocols/IcqOscarJ/src/icq_packet.h | 64 |
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 */
|