summaryrefslogtreecommitdiff
path: root/protocols/MRA/Sdk
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-09-11 19:28:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-09-11 19:28:53 +0000
commit274cffbbffa950ddf286092b52f03f76ec61a301 (patch)
tree5aeb062d27c79d1fbc15eaf033da943630bcbf84 /protocols/MRA/Sdk
parent482be69d327aef60a9a654b8cc6a5e6646d095de (diff)
slightly refactored MRA
git-svn-id: http://svn.miranda-ng.org/main/trunk@1564 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/Sdk')
-rw-r--r--protocols/MRA/Sdk/Base64.h22
-rw-r--r--protocols/MRA/Sdk/BuffToLowerCase.h4
-rw-r--r--protocols/MRA/Sdk/FIFOMT.h6
-rw-r--r--protocols/MRA/Sdk/InternetTime.h34
-rw-r--r--protocols/MRA/Sdk/ListMT.h10
-rw-r--r--protocols/MRA/Sdk/RC4.h4
-rw-r--r--protocols/MRA/Sdk/SHA1.h34
-rw-r--r--protocols/MRA/Sdk/SocketFunctions.h10
-rw-r--r--protocols/MRA/Sdk/StrHexToNum.h36
-rw-r--r--protocols/MRA/Sdk/StrToNum.h36
10 files changed, 98 insertions, 98 deletions
diff --git a/protocols/MRA/Sdk/Base64.h b/protocols/MRA/Sdk/Base64.h
index 24d7605c47..d3cce03e9a 100644
--- a/protocols/MRA/Sdk/Base64.h
+++ b/protocols/MRA/Sdk/Base64.h
@@ -55,7 +55,7 @@ static BYTE btDeCodingTableBASE64[256]={64,64,64,64,64,64,64,64,64,64,64,64,64,6
-__inline void BASE64CopyUnSafe(LPCVOID lpcSource,LPCVOID lpcDestination,SIZE_T dwSize,SIZE_T *pdwCopyedSize)
+__inline void BASE64CopyUnSafe(LPCVOID lpcSource,LPCVOID lpcDestination,size_t dwSize,size_t *pdwCopyedSize)
{// копируем только б64 символы
LPBYTE lpbSource,lpbDestination;
@@ -66,15 +66,15 @@ __inline void BASE64CopyUnSafe(LPCVOID lpcSource,LPCVOID lpcDestination,SIZE_T d
if ((*lpbSource)>32 && (*lpbSource)<128) (*lpbDestination++)=(*lpbSource);
lpbSource++;
}
- if (pdwCopyedSize) (*pdwCopyedSize)=((SIZE_T)lpbDestination-(SIZE_T)lpcDestination);
+ if (pdwCopyedSize) (*pdwCopyedSize)=((size_t)lpbDestination-(size_t)lpcDestination);
}
-__inline DWORD BASE64EncodeUnSafe(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwEncodedSize)
+__inline DWORD BASE64EncodeUnSafe(LPCVOID lpcSource,size_t dwSourceSize,LPCVOID lpcDestination,size_t dwDestinationSize,size_t *pdwEncodedSize)
{// BASE64 кодирование
DWORD dwRetErrorCode;
- SIZE_T dwEncodedSize=((dwSourceSize*4+11)/12*4+1);//(((dwSourceSize+2)/3)*4);
+ size_t dwEncodedSize=((dwSourceSize*4+11)/12*4+1);//(((dwSourceSize+2)/3)*4);
if ((dwDestinationSize<dwEncodedSize))
{// выходной буффер слишком мал
@@ -85,7 +85,7 @@ __inline DWORD BASE64EncodeUnSafe(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID
{
#ifdef _WIN64
LPBYTE lpbtSource=(LPBYTE)lpcSource,lpbtDestination=(LPBYTE)lpcDestination;
- SIZE_T i;
+ size_t i;
for (i=0;i<dwSourceSize;i+=3)
{
@@ -230,7 +230,7 @@ return(dwRetErrorCode);
}
-__inline DWORD BASE64Encode(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwEncodedSize)
+__inline DWORD BASE64Encode(LPCVOID lpcSource,size_t dwSourceSize,LPCVOID lpcDestination,size_t dwDestinationSize,size_t *pdwEncodedSize)
{// BASE64 кодирование
DWORD dwRetErrorCode;
@@ -245,10 +245,10 @@ return(dwRetErrorCode);
-__inline DWORD BASE64DecodeUnSafe(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwDecodedSize)
+__inline DWORD BASE64DecodeUnSafe(LPCVOID lpcSource,size_t dwSourceSize,LPCVOID lpcDestination,size_t dwDestinationSize,size_t *pdwDecodedSize)
{// BASE64 декодирование
DWORD dwRetErrorCode;
- SIZE_T dwDecodedSize=((dwSourceSize>>2)*3);// ((dwSourceSize/4)*3);
+ size_t dwDecodedSize=((dwSourceSize>>2)*3);// ((dwSourceSize/4)*3);
if ((dwDestinationSize<dwDecodedSize))
{// выходной буффер слишком мал
@@ -262,7 +262,7 @@ __inline DWORD BASE64DecodeUnSafe(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID
#ifdef _WIN64
LPBYTE lpbtSource=(LPBYTE)lpcSource,lpbtDestination=(LPBYTE)lpcDestination;
- for(SIZE_T i=0;i<dwSourceSize;i+=4)
+ for(size_t i=0;i<dwSourceSize;i+=4)
{
*(lpbtDestination++)=(unsigned char) (btDeCodingTableBASE64[(*lpbtSource)] << 2 | btDeCodingTableBASE64[lpbtSource[1]] >> 4);
*(lpbtDestination++)=(unsigned char) (btDeCodingTableBASE64[lpbtSource[1]] << 4 | btDeCodingTableBASE64[lpbtSource[2]] >> 2);
@@ -346,7 +346,7 @@ return(dwRetErrorCode);
}
-__inline DWORD BASE64Decode(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwDecodedSize)
+__inline DWORD BASE64Decode(LPCVOID lpcSource,size_t dwSourceSize,LPCVOID lpcDestination,size_t dwDestinationSize,size_t *pdwDecodedSize)
{// BASE64 декодирование
DWORD dwRetErrorCode;
@@ -360,7 +360,7 @@ return(dwRetErrorCode);
}
-__inline DWORD BASE64DecodeFormated(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwDecodedSize)
+__inline DWORD BASE64DecodeFormated(LPCVOID lpcSource,size_t dwSourceSize,LPCVOID lpcDestination,size_t dwDestinationSize,size_t *pdwDecodedSize)
{// BASE64 декодирование и игнорирование форматирования
DWORD dwRetErrorCode;
diff --git a/protocols/MRA/Sdk/BuffToLowerCase.h b/protocols/MRA/Sdk/BuffToLowerCase.h
index 0cb0eb3cc1..3d7909bf41 100644
--- a/protocols/MRA/Sdk/BuffToLowerCase.h
+++ b/protocols/MRA/Sdk/BuffToLowerCase.h
@@ -35,7 +35,7 @@
-__inline BOOL BuffToLowerCase(LPCVOID lpcOutBuff,LPCVOID lpcBuff,SIZE_T dwLen)
+__inline BOOL BuffToLowerCase(LPCVOID lpcOutBuff,LPCVOID lpcBuff,size_t dwLen)
{
BOOL bRet=TRUE;
@@ -45,7 +45,7 @@ __inline BOOL BuffToLowerCase(LPCVOID lpcOutBuff,LPCVOID lpcBuff,SIZE_T dwLen)
BYTE bt;
LPBYTE lpbtIn=(LPBYTE)lpcBuff,lpbtOut=(LPBYTE)lpcOutBuff;
- for(SIZE_T i=dwLen;i;i--)
+ for(size_t i=dwLen;i;i--)
{
bt=(*(lpbtIn++));
if (bt>='A' && bt<='Z') bt|=32;
diff --git a/protocols/MRA/Sdk/FIFOMT.h b/protocols/MRA/Sdk/FIFOMT.h
index f0776cba1e..d15ae3e596 100644
--- a/protocols/MRA/Sdk/FIFOMT.h
+++ b/protocols/MRA/Sdk/FIFOMT.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- */
+ */
@@ -60,9 +60,9 @@ typedef PCLIST_MT_ITERATOR PCFIFO_MT_ITERATOR, LPCFIFO_MT_ITERATOR;
#define FifoMTDestroy(pcpmtFifoMT) ListMTDestroy(pcpmtFifoMT)
-__inline SIZE_T FifoMTItemPush(PCFIFO_MT pcpmtFifoMT,PCFIFO_MT_ITEM pcffmtiFifoItem,LPVOID lpData)
+__inline size_t FifoMTItemPush(PCFIFO_MT pcpmtFifoMT,PCFIFO_MT_ITEM pcffmtiFifoItem,LPVOID lpData)
{
- SIZE_T dwRet;
+ size_t dwRet;
ListMTLock(pcpmtFifoMT);
dwRet=ListMTItemAdd(pcpmtFifoMT,pcffmtiFifoItem,lpData);
diff --git a/protocols/MRA/Sdk/InternetTime.h b/protocols/MRA/Sdk/InternetTime.h
index 9999119e6a..c6abf16786 100644
--- a/protocols/MRA/Sdk/InternetTime.h
+++ b/protocols/MRA/Sdk/InternetTime.h
@@ -67,15 +67,15 @@ static LPCSTR lpcszenmDayOfWeakEnum[7]= {"Sun","Mon","Tue","Wed","Thu","Fri","Sa
#define SEPARATOR "\r\n\r\n"
-//DWORD InternetTimeGetTime (LPCSTR lpszTime,SIZE_T dwTimeSize,INTERNET_TIME *pitTime);
-//BOOL SkeepSPWSP (LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR *plpszRetBuff,SIZE_T *pdwRetBuffSize);
-//BOOL WSP2SP (LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszRetBuff,SIZE_T *pdwRetBuffSize);
+//DWORD InternetTimeGetTime (LPCSTR lpszTime,size_t dwTimeSize,INTERNET_TIME *pitTime);
+//BOOL SkeepSPWSP (LPCSTR lpszBuff,size_t dwBuffSize,LPSTR *plpszRetBuff,size_t *pdwRetBuffSize);
+//BOOL WSP2SP (LPCSTR lpszBuff,size_t dwBuffSize,LPSTR lpszRetBuff,size_t *pdwRetBuffSize);
-__inline BOOL SkeepSPWSP(LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR *plpszRetBuff,SIZE_T *pdwRetBuffSize)
+__inline BOOL SkeepSPWSP(LPCSTR lpszBuff,size_t dwBuffSize,LPSTR *plpszRetBuff,size_t *pdwRetBuffSize)
{
BOOL bRet=TRUE;
@@ -96,14 +96,14 @@ return(bRet);
}
-__inline BOOL WSP2SP(LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszRetBuff,SIZE_T *pdwRetBuffSize)
+__inline BOOL WSP2SP(LPCSTR lpszBuff,size_t dwBuffSize,LPSTR lpszRetBuff,size_t *pdwRetBuffSize)
{// WSP->SP
BOOL bRet=TRUE;
if (lpszBuff && dwBuffSize && lpszRetBuff)
{
LPSTR lpszCurReadPos,pCRLF,lpszCurWritePos;
- SIZE_T dwToCopy,dwRetBuffSize;
+ size_t dwToCopy,dwRetBuffSize;
pCRLF=(LPSTR)lpszBuff;
lpszCurReadPos=(LPSTR)lpszBuff;
@@ -144,14 +144,14 @@ return(bRet);
-__inline BOOL HT2SP(LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszRetBuff,SIZE_T *pdwRetBuffSize)
+__inline BOOL HT2SP(LPCSTR lpszBuff,size_t dwBuffSize,LPSTR lpszRetBuff,size_t *pdwRetBuffSize)
{// HT->SP
BOOL bRet=TRUE;
if (lpszBuff && dwBuffSize && lpszRetBuff)
{
LPSTR lpszCurReadPos,pHT,lpszCurWritePos;
- SIZE_T dwToCopy,dwRetBuffSize;
+ size_t dwToCopy,dwRetBuffSize;
pHT=(LPSTR)lpszBuff;
lpszCurReadPos=(LPSTR)lpszBuff;
@@ -189,14 +189,14 @@ return(bRet);
-__inline BOOL CleanUnneededSP(LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszRetBuff,SIZE_T *pdwRetBuffSize)
+__inline BOOL CleanUnneededSP(LPCSTR lpszBuff,size_t dwBuffSize,LPSTR lpszRetBuff,size_t *pdwRetBuffSize)
{// nSP->SP, SPCRLF->CRLF, CRLFSP->CRLF
BOOL bRet=TRUE;
if (lpszBuff && dwBuffSize && lpszRetBuff)
{
LPSTR lpszCurReadPos,pSP,pSPStart,pSPEnd,lpszCurWritePos,pEnd;
- SIZE_T dwToCopy,dwRetBuffSize;
+ size_t dwToCopy,dwRetBuffSize;
pSP=(LPSTR)lpszBuff;
lpszCurReadPos=(LPSTR)lpszBuff;
@@ -252,16 +252,16 @@ return(bRet);
-__inline SIZE_T CopyText(LPVOID lpOutBuff,LPCVOID lpcBuff,SIZE_T dwLen)
+__inline size_t CopyText(LPVOID lpOutBuff,LPCVOID lpcBuff,size_t dwLen)
{
- SIZE_T dwRet=0;
+ size_t dwRet=0;
if (lpOutBuff && lpcBuff && dwLen)
{
BYTE bt;
LPBYTE lpbtIn=(LPBYTE)lpcBuff,lpbtOut=(LPBYTE)lpOutBuff;
- for(SIZE_T i=dwLen;i;i--)
+ for(size_t i=dwLen;i;i--)
{
bt=(*(lpbtIn++));
if (bt<127 && (bt>31 || bt==9 || bt==10 || bt==13))
@@ -284,14 +284,14 @@ __inline void InternetTimeGetCurrentTime(INTERNET_TIME *pitTime)
}
-__inline DWORD InternetTimeGetString(INTERNET_TIME *pitTime,LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet)
+__inline DWORD InternetTimeGetString(INTERNET_TIME *pitTime,LPSTR lpszBuff,size_t dwBuffSize,size_t *pdwBuffSizeRet)
{// Переводит время из MAILTIME в строковое
DWORD dwRet=NO_ERROR;
if (dwBuffSize>31)
{
LPSTR lpszCurPos=lpszBuff;
- SIZE_T dwTimeLen=0,dwtm;
+ size_t dwTimeLen=0,dwtm;
// day of weak// date of mounth// mounth name// year// hours // minutes// seconds
dwtm=wsprintfA(lpszCurPos,"%s, %02lu %s %04lu %02lu:%02lu:%02lu ",lpcszenmDayOfWeakEnum[pitTime->stTime.wDayOfWeek],pitTime->stTime.wDay,lpcszenmMonthEnum[pitTime->stTime.wMonth],pitTime->stTime.wYear,pitTime->stTime.wHour,pitTime->stTime.wMinute,pitTime->stTime.wSecond);
@@ -327,7 +327,7 @@ return(dwRet);
-__inline DWORD InternetTimeGetTime(LPCSTR lpszTime,SIZE_T dwTimeSize,INTERNET_TIME *pitTime)
+__inline DWORD InternetTimeGetTime(LPCSTR lpszTime,size_t dwTimeSize,INTERNET_TIME *pitTime)
{// Переводит время из строкового в INTERNET_TIME
DWORD dwRet=NO_ERROR;
@@ -335,7 +335,7 @@ __inline DWORD InternetTimeGetTime(LPCSTR lpszTime,SIZE_T dwTimeSize,INTERNET_TI
{// = Thu, 21 May 1998 05:33:29 -0700 =
char sztmBuff[4096];
LPSTR lpszCurPos=sztmBuff,lpszTemp;
- SIZE_T i,dwCurSize=4096,dwTemp;
+ size_t i,dwCurSize=4096,dwTemp;
memset(pitTime, 0, sizeof(INTERNET_TIME));
WSP2SP((LPSTR)lpszTime,dwTimeSize,lpszCurPos,&dwCurSize);
diff --git a/protocols/MRA/Sdk/ListMT.h b/protocols/MRA/Sdk/ListMT.h
index 66e118867d..d7ca6e0b12 100644
--- a/protocols/MRA/Sdk/ListMT.h
+++ b/protocols/MRA/Sdk/ListMT.h
@@ -66,7 +66,7 @@ typedef CONST PLIST_MT_ITEM PCLIST_MT_ITEM, LPCLIST_MT_ITEM;
// структура для работы со списком, заголовок списка
typedef struct _LIST_MT
{
- SIZE_T nCount; // *колличество элементов в списке
+ size_t nCount; // *колличество элементов в списке
PLIST_MT_ITEM plmtiFirst; // *указывает на первый элемент в списке
PLIST_MT_ITEM plmtiLast; // *указывает на последний элемент в списке
CRITICAL_SECTION cs; // *section for exclysive access to List
@@ -139,15 +139,15 @@ __inline void ListMTUnLock(PCLIST_MT pclmtListMT)
}
-__inline SIZE_T ListMTGetCount(PCLIST_MT pclmtListMT)
+__inline size_t ListMTGetCount(PCLIST_MT pclmtListMT)
{
- return((SIZE_T)InterlockedCompareExchangePointer((LPVOID*)&pclmtListMT->nCount,NULL,NULL));
+ return((size_t)InterlockedCompareExchangePointer((LPVOID*)&pclmtListMT->nCount,NULL,NULL));
}
-__inline SIZE_T ListMTItemAdd(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMTItem,LPVOID lpData)
+__inline size_t ListMTItemAdd(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMTItem,LPVOID lpData)
{
- SIZE_T dwRet=(SIZE_T)InterlockedIncrementPointer(&pclmtListMT->nCount);//pclmtListMT->nCount++;
+ size_t dwRet=(size_t)InterlockedIncrementPointer(&pclmtListMT->nCount);//pclmtListMT->nCount++;
pclmtListMTItem->lpData=lpData;
pclmtListMTItem->lpListMT=pclmtListMT;
diff --git a/protocols/MRA/Sdk/RC4.h b/protocols/MRA/Sdk/RC4.h
index 82e1da0de4..cb6331a183 100644
--- a/protocols/MRA/Sdk/RC4.h
+++ b/protocols/MRA/Sdk/RC4.h
@@ -36,7 +36,7 @@
-__inline void RC4(LPBYTE lpBuff,SIZE_T dwBuffSize,LPBYTE lpKey,SIZE_T dwKeySize)
+__inline void RC4(LPBYTE lpBuff,size_t dwBuffSize,LPBYTE lpKey,size_t dwKeySize)
{// RC4
// www.codeproject.com/cpp/crypt_routine.asp%3Fdf%3D100%26forumid%3D4418%26exp%3D0%26select%3D251879+RC4+c%2B%2B+source+DWORD&hl=ru&gl=ru&ct=clnk&cd=2
// http://www.thecodeproject.com/cpp/crypt_routine.asp
@@ -46,7 +46,7 @@ __inline void RC4(LPBYTE lpBuff,SIZE_T dwBuffSize,LPBYTE lpKey,SIZE_T dwKeySize)
//(extra byte are only to prevent any mishep just in case)
BYTE temp;
BYTE Sbox[260]={0},Sbox2[260]={0};
- SIZE_T i,j,t,x;
+ size_t i,j,t,x;
i=j=t=x=0;
temp=0;
diff --git a/protocols/MRA/Sdk/SHA1.h b/protocols/MRA/Sdk/SHA1.h
index 9a35d78c85..f7d4643d32 100644
--- a/protocols/MRA/Sdk/SHA1.h
+++ b/protocols/MRA/Sdk/SHA1.h
@@ -121,13 +121,13 @@ __inline DWORD BSWAP(DWORD dwIn)
return((((dwIn<<8) & 0x00ff0000) | (dwIn<<24) | ((dwIn>>8) & 0x0000ff00) | (dwIn>>24)));
}
-__inline void CopyMemoryReverseDWORD(LPCVOID lpcDestination,LPCVOID lpcSource,SIZE_T dwSize)
+__inline void CopyMemoryReverseDWORD(LPCVOID lpcDestination,LPCVOID lpcSource,size_t dwSize)
{
#ifdef _WIN64
BYTE *pDestination=(BYTE*)lpcDestination,*pSource=(BYTE*)lpcSource;
- //for(SIZE_T i=0;i<dwSize;i++) pDestination[i]=pSource[(i&~0x00000003)+(3-(i&0x00000003))];
- for(SIZE_T i=0;i<dwSize;i+=4) (*((DWORD*)(pDestination+i)))=BSWAP((*((DWORD*)(pSource+i))));
+ //for(size_t i=0;i<dwSize;i++) pDestination[i]=pSource[(i&~0x00000003)+(3-(i&0x00000003))];
+ for(size_t i=0;i<dwSize;i+=4) (*((DWORD*)(pDestination+i)))=BSWAP((*((DWORD*)(pSource+i))));
#else
__asm{
@@ -276,7 +276,7 @@ __inline void SHA1PadMessage(SHA1Context *context)
* block, process it, and then continue padding into a second
* block.
*/
- SIZE_T Message_Block_Index=(SIZE_T)((context->Length.LowPart>>3) & 0x3F);
+ size_t Message_Block_Index=(size_t)((context->Length.LowPart>>3) & 0x3F);
context->Message_Block[Message_Block_Index++]=0x80;
if (Message_Block_Index>56)
{
@@ -384,15 +384,15 @@ return(NO_ERROR);
* sha Error Code.
*
*/
-__inline DWORD SHA1Input(SHA1Context *context,const BYTE *message_array,SIZE_T length)
+__inline DWORD SHA1Input(SHA1Context *context,const BYTE *message_array,size_t length)
{
if (context->Computed==TRUE) return(ERROR_INVALID_HANDLE_STATE);
if ((context->Length.QuadPart+(length<<3))>=(length<<3))
{
- SIZE_T i,Message_Block_Index,partLen;
+ size_t i,Message_Block_Index,partLen;
/* Compute number of bytes mod 64 */
- Message_Block_Index=(SIZE_T)((context->Length.LowPart>>3) & 0x3F);
+ Message_Block_Index=(size_t)((context->Length.LowPart>>3) & 0x3F);
/* Update number of bits */
context->Length.QuadPart+=(((ULONGLONG)length)<<3);
partLen=(64-Message_Block_Index);
@@ -418,7 +418,7 @@ return(NO_ERROR);
//////////////////////////////RFC 2104//////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
-__inline void hmac_sha1(BYTE *text,SIZE_T text_len,BYTE *key,SIZE_T key_len,BYTE *digest)
+__inline void hmac_sha1(BYTE *text,size_t text_len,BYTE *key,size_t key_len,BYTE *digest)
{
//BYTE* text; /* pointer to data stream */
//int text_len; /* length of data stream */
@@ -460,7 +460,7 @@ __inline void hmac_sha1(BYTE *text,SIZE_T text_len,BYTE *key,SIZE_T key_len,BYTE
memset(&k_opad[key_len], 0 , (sizeof(k_opad)-key_len));
/* XOR key with ipad and opad values */
- for (SIZE_T i=0;i<(64/sizeof(ULONGLONG));i++)
+ for (size_t i=0;i<(64/sizeof(ULONGLONG));i++)
{
((ULONGLONG*)k_ipad)[i]^=0x3636363636363636;
((ULONGLONG*)k_opad)[i]^=0x5C5C5C5C5C5C5C5C;
@@ -489,7 +489,7 @@ __inline void SHA1CvtHex(BYTE *Bin,BYTE *Hex)
{
BYTE j;
- for (SIZE_T i=0;i<SHA1HashSize;i++)
+ for (size_t i=0;i<SHA1HashSize;i++)
{
j=(Bin[i]>>4)&0xf;
if(j<=9)
@@ -520,7 +520,7 @@ __inline void SHA1CvtStringA(BYTE *digest,LPSTR lpszDigest)
__inline void SHA1CvtStringW(BYTE *digest,LPWSTR lpszDigest)
{
- SIZE_T i,p=0;
+ size_t i,p=0;
for (i=0;i<SHA1HashSize;i++,p+=2)
{
wsprintfW((LPWSTR)(lpszDigest+p),L"%02x",digest[i]);
@@ -532,13 +532,13 @@ __inline void SHA1CvtStringW(BYTE *digest,LPWSTR lpszDigest)
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
-__inline void SHA1HMACGetDigest(LPVOID lpBuff,SIZE_T dwBuffSize,LPVOID lpKey,SIZE_T dwKeySize,BYTE *digest)
+__inline void SHA1HMACGetDigest(LPVOID lpBuff,size_t dwBuffSize,LPVOID lpKey,size_t dwKeySize,BYTE *digest)
{
hmac_sha1((BYTE*)lpBuff,dwBuffSize,(BYTE*)lpKey,dwKeySize,digest);
}
-__inline void SHA1HMACGetStringA(LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszKey,SIZE_T dwKeySize,LPSTR lpszDigest)
+__inline void SHA1HMACGetStringA(LPSTR lpszBuff,size_t dwBuffSize,LPSTR lpszKey,size_t dwKeySize,LPSTR lpszDigest)
{
BYTE digest[SHA1HashSize];
hmac_sha1((BYTE*)lpszBuff,dwBuffSize,(BYTE*)lpszKey,dwKeySize,digest);
@@ -546,7 +546,7 @@ __inline void SHA1HMACGetStringA(LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszKey,
}
-__inline void SHA1HMACGetStringW(LPWSTR lpszBuff,SIZE_T dwBuffSize,LPWSTR lpszKey,SIZE_T dwKeySize,LPWSTR lpszDigest)
+__inline void SHA1HMACGetStringW(LPWSTR lpszBuff,size_t dwBuffSize,LPWSTR lpszKey,size_t dwKeySize,LPWSTR lpszDigest)
{
BYTE digest[SHA1HashSize];
hmac_sha1((BYTE*)lpszBuff,dwBuffSize,(BYTE*)lpszKey,dwKeySize,digest);
@@ -555,7 +555,7 @@ __inline void SHA1HMACGetStringW(LPWSTR lpszBuff,SIZE_T dwBuffSize,LPWSTR lpszKe
-__inline void SHA1GetDigest(LPVOID lpBuff,SIZE_T dwBuffSize,BYTE *digest)
+__inline void SHA1GetDigest(LPVOID lpBuff,size_t dwBuffSize,BYTE *digest)
{
SHA1Context sha;
@@ -565,7 +565,7 @@ __inline void SHA1GetDigest(LPVOID lpBuff,SIZE_T dwBuffSize,BYTE *digest)
}
-__inline void SHA1GetStringDigestA(LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszDigest)
+__inline void SHA1GetStringDigestA(LPSTR lpszBuff,size_t dwBuffSize,LPSTR lpszDigest)
{
SHA1Context sha;
BYTE digest[SHA1HashSize];
@@ -578,7 +578,7 @@ __inline void SHA1GetStringDigestA(LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszDi
}
-__inline void SHA1GetStringDigestW(LPWSTR lpszBuff,SIZE_T dwBuffSize,LPWSTR lpszDigest)
+__inline void SHA1GetStringDigestW(LPWSTR lpszBuff,size_t dwBuffSize,LPWSTR lpszDigest)
{
SHA1Context sha;
BYTE digest[SHA1HashSize];
diff --git a/protocols/MRA/Sdk/SocketFunctions.h b/protocols/MRA/Sdk/SocketFunctions.h
index 480b5beccb..0d609d80f9 100644
--- a/protocols/MRA/Sdk/SocketFunctions.h
+++ b/protocols/MRA/Sdk/SocketFunctions.h
@@ -346,7 +346,7 @@ return(dwRetErrorCode);
////////////////////////////////////////////////////////////////////////
#if(_WIN32_WINNT >= 0x0501)
-__inline DWORD SockAddrInDataSet(LPCVOID lpcsasSockAddrStorage,DWORD dwPort,LPCVOID lpcAddress,SIZE_T dwAddressSize)
+__inline DWORD SockAddrInDataSet(LPCVOID lpcsasSockAddrStorage,DWORD dwPort,LPCVOID lpcAddress,size_t dwAddressSize)
{
DWORD dwRetErrorCode=NO_ERROR;
@@ -398,7 +398,7 @@ return(dwRetErrorCode);
}
-__inline DWORD SockAddrInAddressSet(LPCVOID lpcsasSockAddrStorage,LPCVOID lpcAddress,SIZE_T dwAddressSize)
+__inline DWORD SockAddrInAddressSet(LPCVOID lpcsasSockAddrStorage,LPCVOID lpcAddress,size_t dwAddressSize)
{
DWORD dwRetErrorCode=NO_ERROR;
@@ -424,7 +424,7 @@ return(dwRetErrorCode);
}
-__inline DWORD SockAddrAddressSet(LPCVOID lpcsasSockAddrStorage,LPCVOID lpcAddress,SIZE_T dwAddressSize)
+__inline DWORD SockAddrAddressSet(LPCVOID lpcsasSockAddrStorage,LPCVOID lpcAddress,size_t dwAddressSize)
{
DWORD dwRetErrorCode=NO_ERROR;
@@ -450,9 +450,9 @@ return(dwRetErrorCode);
}
-__inline SIZE_T SockAddrGetSize(LPCVOID lpcsasSockAddrStorage)
+__inline size_t SockAddrGetSize(LPCVOID lpcsasSockAddrStorage)
{
- SIZE_T dwRet;
+ size_t dwRet;
if (lpcsasSockAddrStorage)
{
diff --git a/protocols/MRA/Sdk/StrHexToNum.h b/protocols/MRA/Sdk/StrHexToNum.h
index 60b5801efb..e4a5cc98fa 100644
--- a/protocols/MRA/Sdk/StrHexToNum.h
+++ b/protocols/MRA/Sdk/StrHexToNum.h
@@ -39,9 +39,9 @@
-__inline SIZE_T StrHexToUNum(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline size_t StrHexToUNum(LPCSTR lpcszString,size_t dwStringLen)
{
- SIZE_T dwNum=0;
+ size_t dwNum=0;
BYTE bCurentFigure;
while(dwStringLen)
@@ -74,7 +74,7 @@ __inline SIZE_T StrHexToUNum(LPCSTR lpcszString,SIZE_T dwStringLen)
return(dwNum);
}
-__inline DWORD StrHexToUNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline DWORD StrHexToUNum32(LPCSTR lpcszString,size_t dwStringLen)
{
DWORD dwNum=0;
BYTE bCurentFigure;
@@ -110,7 +110,7 @@ __inline DWORD StrHexToUNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
return(dwNum);
}
-__inline DWORDLONG StrHexToUNum64(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline DWORDLONG StrHexToUNum64(LPCSTR lpcszString,size_t dwStringLen)
{
DWORDLONG dwlNum=0;
BYTE bCurentFigure;
@@ -148,10 +148,10 @@ return(dwlNum);
-__inline DWORD StrHexToUNumEx(LPCSTR lpcszString,SIZE_T dwStringLen,SIZE_T *pdwNum)
+__inline DWORD StrHexToUNumEx(LPCSTR lpcszString,size_t dwStringLen,size_t *pdwNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwNum=0,dwProcessed=0;
+ size_t dwNum=0,dwProcessed=0;
BYTE bCurentFigure;
@@ -199,7 +199,7 @@ return(dwRetErrorCode);
}
-__inline DWORD StrHexToUNumEx32(LPCSTR lpcszString,SIZE_T dwStringLen,DWORD *pdwNum)
+__inline DWORD StrHexToUNumEx32(LPCSTR lpcszString,size_t dwStringLen,DWORD *pdwNum)
{
DWORD dwRetErrorCode;
DWORD dwNum=0,dwProcessed=0;
@@ -250,11 +250,11 @@ return(dwRetErrorCode);
}
-__inline DWORD StrHexToUNumEx64(LPCSTR lpcszString,SIZE_T dwStringLen,DWORDLONG *pdwlNum)
+__inline DWORD StrHexToUNumEx64(LPCSTR lpcszString,size_t dwStringLen,DWORDLONG *pdwlNum)
{
DWORD dwRetErrorCode;
DWORDLONG dwlNum=0;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
BYTE bCurentFigure;
@@ -304,7 +304,7 @@ return(dwRetErrorCode);
-__inline SSIZE_T StrHexToNum(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline SSIZE_T StrHexToNum(LPCSTR lpcszString,size_t dwStringLen)
{
SSIZE_T lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -351,7 +351,7 @@ return(lNum);
}
-__inline LONG StrHexToNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline LONG StrHexToNum32(LPCSTR lpcszString,size_t dwStringLen)
{
LONG lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -398,7 +398,7 @@ return(lNum);
}
-__inline LONGLONG StrHexToNum64(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline LONGLONG StrHexToNum64(LPCSTR lpcszString,size_t dwStringLen)
{
LONGLONG llNum=0,llSingn=1;
BYTE bCurentFigure;
@@ -446,10 +446,10 @@ return(llNum);
-__inline DWORD StrHexToNumEx(LPCSTR lpcszString,SIZE_T dwStringLen,SSIZE_T *plNum)
+__inline DWORD StrHexToNumEx(LPCSTR lpcszString,size_t dwStringLen,SSIZE_T *plNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
SSIZE_T lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -507,10 +507,10 @@ return(dwRetErrorCode);
}
-__inline DWORD StrHexToNumEx32(LPCSTR lpcszString,SIZE_T dwStringLen,LONG *plNum)
+__inline DWORD StrHexToNumEx32(LPCSTR lpcszString,size_t dwStringLen,LONG *plNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
LONG lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -568,10 +568,10 @@ return(dwRetErrorCode);
}
-__inline DWORD StrHexToNumEx64(LPCSTR lpcszString,SIZE_T dwStringLen,LONGLONG *pllNum)
+__inline DWORD StrHexToNumEx64(LPCSTR lpcszString,size_t dwStringLen,LONGLONG *pllNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
LONGLONG llNum=0,llSingn=1;
BYTE bCurentFigure;
diff --git a/protocols/MRA/Sdk/StrToNum.h b/protocols/MRA/Sdk/StrToNum.h
index 888b940b7c..6e67ac6be1 100644
--- a/protocols/MRA/Sdk/StrToNum.h
+++ b/protocols/MRA/Sdk/StrToNum.h
@@ -40,9 +40,9 @@
-__inline SIZE_T StrToUNum(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline size_t StrToUNum(LPCSTR lpcszString,size_t dwStringLen)
{
- SIZE_T dwNum=0;
+ size_t dwNum=0;
BYTE bCurentFigure;
@@ -61,7 +61,7 @@ return(dwNum);
}
-__inline DWORD StrToUNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline DWORD StrToUNum32(LPCSTR lpcszString,size_t dwStringLen)
{
DWORD dwNum=0;
BYTE bCurentFigure;
@@ -82,7 +82,7 @@ return(dwNum);
}
-__inline DWORDLONG StrToUNum64(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline DWORDLONG StrToUNum64(LPCSTR lpcszString,size_t dwStringLen)
{
DWORDLONG dwlNum=0;
BYTE bCurentFigure;
@@ -105,10 +105,10 @@ return(dwlNum);
-__inline DWORD StrToUNumEx(LPCSTR lpcszString,SIZE_T dwStringLen,SIZE_T *pdwNum)
+__inline DWORD StrToUNumEx(LPCSTR lpcszString,size_t dwStringLen,size_t *pdwNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwNum=0,dwProcessed=0;
+ size_t dwNum=0,dwProcessed=0;
BYTE bCurentFigure;
@@ -140,7 +140,7 @@ return(dwRetErrorCode);
}
-__inline DWORD StrToUNumEx32(LPCSTR lpcszString,SIZE_T dwStringLen,DWORD *pdwNum)
+__inline DWORD StrToUNumEx32(LPCSTR lpcszString,size_t dwStringLen,DWORD *pdwNum)
{
DWORD dwRetErrorCode;
DWORD dwNum=0,dwProcessed=0;
@@ -175,11 +175,11 @@ return(dwRetErrorCode);
}
-__inline DWORD StrToUNumEx64(LPCSTR lpcszString,SIZE_T dwStringLen,DWORDLONG *pdwlNum)
+__inline DWORD StrToUNumEx64(LPCSTR lpcszString,size_t dwStringLen,DWORDLONG *pdwlNum)
{
DWORD dwRetErrorCode;
DWORDLONG dwlNum=0;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
BYTE bCurentFigure;
@@ -213,7 +213,7 @@ return(dwRetErrorCode);
-__inline SSIZE_T StrToNum(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline SSIZE_T StrToNum(LPCSTR lpcszString,size_t dwStringLen)
{
SSIZE_T lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -244,7 +244,7 @@ return(lNum);
}
-__inline LONG StrToNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline LONG StrToNum32(LPCSTR lpcszString,size_t dwStringLen)
{
LONG lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -275,7 +275,7 @@ return(lNum);
}
-__inline LONGLONG StrToNum64(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline LONGLONG StrToNum64(LPCSTR lpcszString,size_t dwStringLen)
{
LONGLONG llNum=0,llSingn=1;
BYTE bCurentFigure;
@@ -307,10 +307,10 @@ return(llNum);
-__inline DWORD StrToNumEx(LPCSTR lpcszString,SIZE_T dwStringLen,SSIZE_T *plNum)
+__inline DWORD StrToNumEx(LPCSTR lpcszString,size_t dwStringLen,SSIZE_T *plNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
SSIZE_T lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -352,10 +352,10 @@ return(dwRetErrorCode);
}
-__inline DWORD StrToNumEx32(LPCSTR lpcszString,SIZE_T dwStringLen,LONG *plNum)
+__inline DWORD StrToNumEx32(LPCSTR lpcszString,size_t dwStringLen,LONG *plNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
LONG lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -397,10 +397,10 @@ return(dwRetErrorCode);
}
-__inline DWORD StrToNumEx64(LPCSTR lpcszString,SIZE_T dwStringLen,LONGLONG *pllNum)
+__inline DWORD StrToNumEx64(LPCSTR lpcszString,size_t dwStringLen,LONGLONG *pllNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
LONGLONG llNum=0,llSingn=1;
BYTE bCurentFigure;