summaryrefslogtreecommitdiff
path: root/plugins/SMS
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-13 09:25:14 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-13 09:25:14 +0000
commitb5b57169c2833b9e70cc4cff7cae127c11f02683 (patch)
tree7785b60d2dbd94e4618f527716d8fe224cec15c2 /plugins/SMS
parenta85d3756ce4eb0257025b005deb795ba05fd4fda (diff)
CopyMemory -> memcpy
git-svn-id: http://svn.miranda-ng.org/main/trunk@11363 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SMS')
-rw-r--r--plugins/SMS/src/SMS_svc.cpp4
-rw-r--r--plugins/SMS/src/functions.cpp10
-rw-r--r--plugins/SMS/src/receive.cpp8
3 files changed, 11 insertions, 11 deletions
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp
index 12090b2ed2..05678d0046 100644
--- a/plugins/SMS/src/SMS_svc.cpp
+++ b/plugins/SMS/src/SMS_svc.cpp
@@ -4,13 +4,13 @@ int LoadServices(void)
{
char szServiceFunction[MAX_PATH],*pszServiceFunctionName;
- CopyMemory(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
+ memcpy(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
// Service creation
for (size_t i=0;i<SIZEOF(siPluginServices);i++)
{
- CopyMemory(pszServiceFunctionName,siPluginServices[i].lpszName,(mir_strlen(siPluginServices[i].lpszName)+1));
+ memcpy(pszServiceFunctionName,siPluginServices[i].lpszName,(mir_strlen(siPluginServices[i].lpszName)+1));
CreateServiceFunction(szServiceFunction,(MIRANDASERVICE)siPluginServices[i].lpFunc);
}
return 0;
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp
index b26d5fd4c9..a1fc8f68e4 100644
--- a/plugins/SMS/src/functions.cpp
+++ b/plugins/SMS/src/functions.cpp
@@ -10,7 +10,7 @@ BOOL DB_GetStaticStringW(MCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,
dwReadedStringLen=mir_wstrlen(dbv.pwszVal);
if (lpwszRetBuff && (dwRetBuffSize>dwReadedStringLen))
{
- CopyMemory(lpwszRetBuff,dbv.pszVal,(dwReadedStringLen*sizeof(WCHAR)));//include null terminated
+ memcpy(lpwszRetBuff,dbv.pszVal,(dwReadedStringLen*sizeof(WCHAR)));//include null terminated
(*((WCHAR*)(lpwszRetBuff+dwReadedStringLen)))=0;
bRet=TRUE;
}else{
@@ -310,7 +310,7 @@ BOOL GetXMLFieldExBuff(LPSTR lpszXML,size_t dwXMLSize,LPSTR lpszBuff,size_t dwBu
if (lpszDataStart)
{
size_t dwBuffSizeRet=min((dwBuffSize-2),(size_t)((lpszTagStart-1)-lpszDataStart));
- if (lpszBuff && dwBuffSize) CopyMemory(lpszBuff,lpszDataStart,dwBuffSizeRet);(*((WORD*)(lpszBuff+dwBuffSizeRet)))=0;
+ if (lpszBuff && dwBuffSize) memcpy(lpszBuff,lpszDataStart,dwBuffSizeRet);(*((WORD*)(lpszBuff+dwBuffSizeRet)))=0;
if (pdwBuffSizeRet) (*pdwBuffSizeRet)=dwBuffSizeRet;
bRet=TRUE;
}
@@ -373,8 +373,8 @@ DWORD ReplaceInBuff(LPVOID lpInBuff,size_t dwInBuffSize,size_t dwReplaceItemsCou
if (plpszFound[dwFirstFoundedIndex]) {
dwMemPartToCopy=(plpszFound[dwFirstFoundedIndex]-lpszMessageCurPrev);
if (lpszMessageConvertedMax > (lpszMessageConvertedCur+(dwMemPartToCopy+pdwInReplaceItemsCounts[dwFirstFoundedIndex]))) {
- CopyMemory(lpszMessageConvertedCur,lpszMessageCurPrev,dwMemPartToCopy);lpszMessageConvertedCur+=dwMemPartToCopy;
- CopyMemory(lpszMessageConvertedCur,plpOutReplaceItems[dwFirstFoundedIndex],pdwOutReplaceItemsCounts[dwFirstFoundedIndex]);lpszMessageConvertedCur+=pdwOutReplaceItemsCounts[dwFirstFoundedIndex];
+ memcpy(lpszMessageConvertedCur,lpszMessageCurPrev,dwMemPartToCopy);lpszMessageConvertedCur+=dwMemPartToCopy;
+ memcpy(lpszMessageConvertedCur,plpOutReplaceItems[dwFirstFoundedIndex],pdwOutReplaceItemsCounts[dwFirstFoundedIndex]);lpszMessageConvertedCur+=pdwOutReplaceItemsCounts[dwFirstFoundedIndex];
lpszMessageCurPrev=(plpszFound[dwFirstFoundedIndex]+pdwInReplaceItemsCounts[dwFirstFoundedIndex]);
for(i=0;i<dwReplaceItemsCount;i++)
@@ -397,7 +397,7 @@ DWORD ReplaceInBuff(LPVOID lpInBuff,size_t dwInBuffSize,size_t dwReplaceItemsCou
}
}
lpszMessageCur=(((LPBYTE)lpInBuff)+dwInBuffSize);
- CopyMemory(lpszMessageConvertedCur,lpszMessageCurPrev,(lpszMessageCur-lpszMessageCurPrev));lpszMessageConvertedCur+=(lpszMessageCur-lpszMessageCurPrev);
+ memcpy(lpszMessageConvertedCur,lpszMessageCurPrev,(lpszMessageCur-lpszMessageCurPrev));lpszMessageConvertedCur+=(lpszMessageCur-lpszMessageCurPrev);
(*((WORD*)lpszMessageConvertedCur))=0;
MEMFREE(plpszFound);
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp
index 49d0283e59..fa2d31764f 100644
--- a/plugins/SMS/src/receive.cpp
+++ b/plugins/SMS/src/receive.cpp
@@ -117,7 +117,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam)
if (dbei.pBlob)
{
dbei.cbBlob=mir_snprintf((LPSTR)dbei.pBlob,dbei.cbBlob,"SMS Confirmation From: +%s\r\nSMS was not sent succesfully: ",szPhone);
- CopyMemory((dbei.pBlob+dbei.cbBlob),lpszData,dwDataSize);
+ memcpy((dbei.pBlob+dbei.cbBlob),lpszData,dwDataSize);
dbei.cbBlob+=(dwDataSize+sizeof(DWORD));
(*((DWORD*)(dbei.pBlob+(dbei.cbBlob-sizeof(DWORD)))))=0;
}
@@ -225,7 +225,7 @@ int handleNewMessage(WPARAM hContact, LPARAM lParam)
dbei.pBlob = (PBYTE)MEMALLOC(dbei.cbBlob);
if ( !dbei.pBlob)
return 0;
- CopyMemory(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
+ memcpy(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
pszServiceFunctionName = szServiceFunction + PROTOCOL_NAME_LEN;
if (db_event_get(hDbEvent, &dbei) == 0)
@@ -238,7 +238,7 @@ int handleNewMessage(WPARAM hContact, LPARAM lParam)
db_event_markRead(hContact, hDbEvent);
}
else {
- CopyMemory(pszServiceFunctionName,SMS_READ,sizeof(SMS_READ));
+ memcpy(pszServiceFunctionName,SMS_READ,sizeof(SMS_READ));
mir_sntprintf(szToolTip,SIZEOF(szToolTip),TranslateT("SMS Message from %s"),GetContactNameW(hContact));
CLISTEVENT cle = { sizeof(cle) };
@@ -261,7 +261,7 @@ int handleNewMessage(WPARAM hContact, LPARAM lParam)
else {
UINT iIcon;
if (GetDataFromMessage((LPSTR)dbei.pBlob, dbei.cbBlob, NULL, NULL, 0, NULL, &iIcon)) {
- CopyMemory(pszServiceFunctionName,SMS_READ_ACK,sizeof(SMS_READ_ACK));
+ memcpy(pszServiceFunctionName,SMS_READ_ACK,sizeof(SMS_READ_ACK));
mir_sntprintf(szToolTip,SIZEOF(szToolTip),TranslateT("SMS Confirmation from %s"),GetContactNameW(hContact));
CLISTEVENT cle = { sizeof(cle) };