diff options
67 files changed, 147 insertions, 147 deletions
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index 73f39892c9..a81ca58e99 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -235,7 +235,7 @@ void PicLoader(LPVOID) QueueAdd(node->hContact);
AVATARCACHEENTRY ace_temp;
- CopyMemory(&ace_temp, node, sizeof(AVATARCACHEENTRY));
+ memcpy(&ace_temp, node, sizeof(AVATARCACHEENTRY));
ace_temp.hbmPic = 0;
int result = CreateAvatarInCache(node->hContact, &ace_temp, NULL);
@@ -251,7 +251,7 @@ void PicLoader(LPVOID) HBITMAP oldPic = node->hbmPic;
{
mir_cslock l(cachecs);
- CopyMemory(node, &ace_temp, sizeof(AVATARCACHEENTRY));
+ memcpy(node, &ace_temp, sizeof(AVATARCACHEENTRY));
node->loaded = TRUE;
}
if (oldPic)
@@ -262,7 +262,7 @@ void PicLoader(LPVOID) HBITMAP oldPic = node->hbmPic;
{
mir_cslock l(cachecs);
- CopyMemory(node, &ace_temp, sizeof(AVATARCACHEENTRY));
+ memcpy(node, &ace_temp, sizeof(AVATARCACHEENTRY));
node->loaded = FALSE;
}
if (oldPic)
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index 865349301c..254c71be7c 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -339,7 +339,7 @@ static void WriteDbBackupData(const char *pszSetting,DWORD dwType,BYTE *pData,DW PBYTE buf = (PBYTE)mir_alloc(cbLen);
if (buf) {
*(DWORD*)buf = dwType;
- CopyMemory(buf+sizeof(DWORD), pData, cbData);
+ memcpy(buf+sizeof(DWORD), pData, cbData);
db_set_blob(NULL, "AssocMgr", pszSetting, buf, (unsigned)cbLen);
mir_free(buf);
}
diff --git a/plugins/AutoShutdown/src/cpuusage.cpp b/plugins/AutoShutdown/src/cpuusage.cpp index 481e2ad2cc..cd30482e6d 100644 --- a/plugins/AutoShutdown/src/cpuusage.cpp +++ b/plugins/AutoShutdown/src/cpuusage.cpp @@ -160,8 +160,8 @@ static void WinNT_PollThread(void *vparam) }
else fIsFirst=FALSE;
/* store current sampling for next */
- CopyMemory(&liPrevCounterValue,&liCurrentCounterValue,sizeof(LARGE_INTEGER));
- CopyMemory(&liPrevPerfTime100nSec,&pPerfData->PerfTime100nSec,sizeof(LARGE_INTEGER));
+ memcpy(&liPrevCounterValue,&liCurrentCounterValue,sizeof(LARGE_INTEGER));
+ memcpy(&liPrevPerfTime100nSec,&pPerfData->PerfTime100nSec,sizeof(LARGE_INTEGER));
}
/* uninit */
diff --git a/plugins/Boltun/src/actionQueue.cpp b/plugins/Boltun/src/actionQueue.cpp index c32523b4af..fa0ebe63b9 100644 --- a/plugins/Boltun/src/actionQueue.cpp +++ b/plugins/Boltun/src/actionQueue.cpp @@ -93,7 +93,7 @@ static void TimerAnswer(MCONTACT hContact, const TalkBot::MessageInfo* info) if (!WideCharToMultiByte(CP_ACP, 0, info->Answer.c_str(), -1, msg, size,
NULL, NULL))
memset(msg, '-', (size - 1)); //In case of fault return "----" in ANSI part
- CopyMemory(msg + size, info->Answer.c_str(), size * 2);
+ memcpy(msg + size, info->Answer.c_str(), size * 2);
CallContactService(hContact, PSS_MESSAGE, PREF_TCHAR, (LPARAM)msg);
diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp index b535100331..75e44f15d4 100644 --- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp +++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp @@ -15,7 +15,7 @@ static DWORD CALLBACK EditStreamOutRtf(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG c EditStreamData *esd = (EditStreamData*)dwCookie;
esd->cbBuff += cb;
esd->pbBuff = (PBYTE)realloc(esd->pbBuff, esd->cbBuff + sizeof(TCHAR));
- CopyMemory(esd->pbBuff + esd->iCurrent, pbBuff, cb);
+ memcpy(esd->pbBuff + esd->iCurrent, pbBuff, cb);
esd->iCurrent += cb;
esd->pbBuff[esd->iCurrent] = 0;
esd->pbBuff[esd->iCurrent + 1] = 0;
diff --git a/plugins/Clist_modern/src/modern_docking.cpp b/plugins/Clist_modern/src/modern_docking.cpp index 5f61fb4cd4..02c59f3ddc 100644 --- a/plugins/Clist_modern/src/modern_docking.cpp +++ b/plugins/Clist_modern/src/modern_docking.cpp @@ -50,7 +50,7 @@ static void Docking_GetMonitorRectFromPoint(POINT pt,RECT *rc) if (GetMonitorInfo(hMonitor, &monitorInfo))
{
- CopyMemory(rc,&monitorInfo.rcMonitor,sizeof(RECT));
+ memcpy(rc,&monitorInfo.rcMonitor,sizeof(RECT));
return;
}
diff --git a/plugins/Clist_nicer/skineditor/src/main.cpp b/plugins/Clist_nicer/skineditor/src/main.cpp index a4d5593ab5..14dfea057e 100644 --- a/plugins/Clist_nicer/skineditor/src/main.cpp +++ b/plugins/Clist_nicer/skineditor/src/main.cpp @@ -651,7 +651,7 @@ static INT_PTR CALLBACK SkinEdit_ExtBkDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa if (psd == NULL) return FALSE; memset(psd, 0, sizeof(SKINDESCRIPTION)); - CopyMemory(psd, (void *)lParam, sizeof(SKINDESCRIPTION)); + memcpy(psd, (void *)lParam, sizeof(SKINDESCRIPTION)); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)psd); ID_EXTBK_FIRST = psd->firstItem; diff --git a/plugins/Clist_nicer/src/Docking.cpp b/plugins/Clist_nicer/src/Docking.cpp index 850620d63c..5e80a2e1c4 100644 --- a/plugins/Clist_nicer/src/Docking.cpp +++ b/plugins/Clist_nicer/src/Docking.cpp @@ -42,7 +42,7 @@ static void Docking_GetMonitorRectFromPoint(POINT pt, RECT *rc) monitorInfo.cbSize = sizeof(MONITORINFO);
if (GetMonitorInfo(hMonitor, &monitorInfo)) {
- CopyMemory(rc, &monitorInfo.rcMonitor, sizeof(RECT));
+ memcpy(rc, &monitorInfo.rcMonitor, sizeof(RECT));
return;
}
diff --git a/plugins/CountryFlags/src/ip2country.cpp b/plugins/CountryFlags/src/ip2country.cpp index a583129741..dad6b0b1d8 100644 --- a/plugins/CountryFlags/src/ip2country.cpp +++ b/plugins/CountryFlags/src/ip2country.cpp @@ -177,7 +177,7 @@ static void AppendToByteBuffer(struct ResizableByteBuffer *buffer,const void *ap buffer->cbAlloced+=ALLOC_STEP+cbAppendSize;
OutputDebugStringA("reallocating memory...\n"); /* all ascii */
}
- CopyMemory(&buffer->buf[buffer->cbLength],append,cbAppendSize);
+ memcpy(&buffer->buf[buffer->cbLength],append,cbAppendSize);
buffer->cbLength+=cbAppendSize;
}
diff --git a/plugins/Db3x_mmap/src/dbheaders.cpp b/plugins/Db3x_mmap/src/dbheaders.cpp index 86a384e9eb..f8df60e84d 100644 --- a/plugins/Db3x_mmap/src/dbheaders.cpp +++ b/plugins/Db3x_mmap/src/dbheaders.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. int CDb3Mmap::CreateDbHeaders(const DBSignature& _sign)
{
- CopyMemory(m_dbHeader.signature, &_sign, sizeof(m_dbHeader.signature));
+ memcpy(m_dbHeader.signature, &_sign, sizeof(m_dbHeader.signature));
m_dbHeader.version = DB_095_1_VERSION;
m_dbHeader.ofsFileEnd = sizeof(struct DBHeader);
diff --git a/plugins/Db3x_mmap/src/dbmodulechain.cpp b/plugins/Db3x_mmap/src/dbmodulechain.cpp index fbdb9d512a..603f55512b 100644 --- a/plugins/Db3x_mmap/src/dbmodulechain.cpp +++ b/plugins/Db3x_mmap/src/dbmodulechain.cpp @@ -49,7 +49,7 @@ int CDb3Mmap::InitModuleNames(void) int nameLen = dbmn->cbName;
char *mod = (char*)HeapAlloc(m_hModHeap,0,nameLen+1);
- CopyMemory(mod,DBRead(ofsThis + offsetof(struct DBModuleName,name),nameLen,NULL),nameLen);
+ memcpy(mod,DBRead(ofsThis + offsetof(struct DBModuleName,name),nameLen,NULL),nameLen);
mod[nameLen] = 0;
AddToList(mod, nameLen, ofsThis);
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index fe6e12b592..1aff61284b 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -98,7 +98,7 @@ LBL_Seek: dbv->pszVal = cbOrigPtr;
if (cbLen < cbOrigLen)
cbOrigLen = cbLen;
- CopyMemory(dbv->pszVal, pCachedValue->pszVal, cbOrigLen);
+ memcpy(dbv->pszVal, pCachedValue->pszVal, cbOrigLen);
dbv->pszVal[cbOrigLen] = 0;
dbv->cchVal = cbLen;
}
@@ -813,7 +813,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::EnumContactSettings(MCONTACT contactID, DBCONTACTE NeedBytes(1);
NeedBytes(1 + pBlob[0]);
char szSetting[256];
- CopyMemory(szSetting, pBlob + 1, pBlob[0]); szSetting[pBlob[0]] = 0;
+ memcpy(szSetting, pBlob + 1, pBlob[0]); szSetting[pBlob[0]] = 0;
result = (dbces->pfnEnumProc)(szSetting, dbces->lParam);
MoveAlong(1 + pBlob[0]);
NeedBytes(3);
diff --git a/plugins/Db3x_mmap/src/dbtool/disk.cpp b/plugins/Db3x_mmap/src/dbtool/disk.cpp index 109df7b03b..6299aa6184 100644 --- a/plugins/Db3x_mmap/src/dbtool/disk.cpp +++ b/plugins/Db3x_mmap/src/dbtool/disk.cpp @@ -48,7 +48,7 @@ int CDb3Mmap::PeekSegment(DWORD ofs, PVOID buf, int cbBytes) return ERROR_READ_FAULT;
}
- CopyMemory(buf, m_pDbCache + ofs, bytesRead);
+ memcpy(buf, m_pDbCache + ofs, bytesRead);
if ((int)bytesRead<cbBytes) return ERROR_HANDLE_EOF;
return ERROR_SUCCESS;
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index 02aec62fca..96f7c71493 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -180,7 +180,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
if (!db_get(NULL, "Contact", "NameOrder", &dbv)) {
- CopyMemory(nameOrder, dbv.pbVal, dbv.cpbVal);
+ memcpy(nameOrder, dbv.pbVal, dbv.cpbVal);
db_free(&dbv);
}
diff --git a/plugins/Exchange/src/MirandaExchange.cpp b/plugins/Exchange/src/MirandaExchange.cpp index fd9e7ed387..58c54d0d4c 100644 --- a/plugins/Exchange/src/MirandaExchange.cpp +++ b/plugins/Exchange/src/MirandaExchange.cpp @@ -91,7 +91,7 @@ HRESULT HrMAPIFindDefaultMsgStore( // RETURNS: return code lpeid = NULL; } else { // Copy entry ID of message store - CopyMemory(lpeid, lpRows->aRow[i].lpProps[1].Value.bin.lpb, cbeid); + memcpy(lpeid, lpRows->aRow[i].lpProps[1].Value.bin.lpb, cbeid); } break; } diff --git a/plugins/FloatingContacts/src/bitmap_funcs.cpp b/plugins/FloatingContacts/src/bitmap_funcs.cpp index d8709fed3b..df96bdcb51 100644 --- a/plugins/FloatingContacts/src/bitmap_funcs.cpp +++ b/plugins/FloatingContacts/src/bitmap_funcs.cpp @@ -298,7 +298,7 @@ void MyBitmap::Draw(MyBitmap *bmp, int x, int y, int w, int h) if (!x && !y && (w == width) && (h == height) && (w == bmp->width) && (h == bmp->height))
{
// fast bitmap copy is possible good for animated avatars
- CopyMemory(bits, bmp->bits, width*height*sizeof(COLOR32));
+ memcpy(bits, bmp->bits, width*height*sizeof(COLOR32));
return;
}
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp index 5e48513c0b..75f879271e 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp @@ -113,7 +113,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) case WM_MOUSEMOVE:
if (mouseEvent != 0x01)
break;
- CopyMemory(&DlgParam->chrg, &pENLink->chrg, sizeof(CHARRANGE));
+ memcpy(&DlgParam->chrg, &pENLink->chrg, sizeof(CHARRANGE));
SendDlgItemMessage(hDlg, IDC_MAIN, EM_EXSETSEL, 0, (LPARAM)&pENLink->chrg);
WriteMessage(hDlg, DlgParam->listStart, SendDlgItemMessage(hDlg, IDC_MAIN, EM_LINEFROMCHAR, -1, 0));
break;
diff --git a/plugins/Non-IM Contact/src/http.cpp b/plugins/Non-IM Contact/src/http.cpp index 92aacc0ec5..9ba9a80b6a 100644 --- a/plugins/Non-IM Contact/src/http.cpp +++ b/plugins/Non-IM Contact/src/http.cpp @@ -43,7 +43,7 @@ int InternetDownloadFile (char *szUrl) // change the header so the plugin is pretended to be IE 6 + WinXP
nlhr.headersCount++;
nlhr.headers=(NETLIBHTTPHEADER*)malloc(sizeof(NETLIBHTTPHEADER)*nlhr.headersCount);
- CopyMemory(nlhr.headers,nlhr.headers,sizeof(NETLIBHTTPHEADER)*nlhr.headersCount);
+ memcpy(nlhr.headers,nlhr.headers,sizeof(NETLIBHTTPHEADER)*nlhr.headersCount);
nlhr.headers[nlhr.headersCount-1].szName="User-Agent";
nlhr.headers[nlhr.headersCount-1].szValue="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp index cf81ab37a0..cd551905aa 100644 --- a/plugins/Popup/src/bitmap_funcs.cpp +++ b/plugins/Popup/src/bitmap_funcs.cpp @@ -260,7 +260,7 @@ void MyBitmap::Draw(MyBitmap *bmp, int x, int y, int w, int h) if (!x && !y && (w == width) && (h == height) && (w == bmp->width) && (h == bmp->height)) {
// fast bitmap copy is possible good for animated avatars
- CopyMemory(bits, bmp->bits, width*height*sizeof(COLOR32));
+ memcpy(bits, bmp->bits, width*height*sizeof(COLOR32));
return;
}
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index d4eec8539a..73c406a9b6 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -77,7 +77,7 @@ bool UpdatePopupPosition(PopupWnd2 *prev, PopupWnd2 *wnd) MONITORINFOEX mnti;
mnti.cbSize = sizeof(MONITORINFOEX);
if ( GetMonitorInfo(hMonitor, &mnti) == TRUE)
- CopyMemory(&rc, &(mnti.rcWork), sizeof(RECT));
+ memcpy(&rc, &(mnti.rcWork), sizeof(RECT));
else
SystemParametersInfo(SPI_GETWORKAREA,0,&rc,0);
}
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index 92b97f1b24..6e360ae165 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -107,7 +107,7 @@ INT_PTR Popup_AddPopup2(WPARAM wParam, LPARAM lParam) POPUPDATA2 ppdFixed = {0};
POPUPDATA2 *ppd = &ppdFixed;
- CopyMemory(ppd, ppdIn, min(ppdIn->cbSize, sizeof(POPUPDATA2)));
+ memcpy(ppd, ppdIn, min(ppdIn->cbSize, sizeof(POPUPDATA2)));
DWORD disableWhen;
FillNotificationData(ppd, &disableWhen);
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) };
diff --git a/plugins/Scriver/src/chat/log.cpp b/plugins/Scriver/src/chat/log.cpp index 3a616bff6e..e58c506e78 100644 --- a/plugins/Scriver/src/chat/log.cpp +++ b/plugins/Scriver/src/chat/log.cpp @@ -38,7 +38,7 @@ static DWORD CALLBACK Log_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG // give the RTF to the RE control
*pcb = min(cb, LONG(lstrdat->bufferLen - lstrdat->bufferOffset));
- CopyMemory(pbBuff, lstrdat->buffer + lstrdat->bufferOffset, *pcb);
+ memcpy(pbBuff, lstrdat->buffer + lstrdat->bufferOffset, *pcb);
lstrdat->bufferOffset += *pcb;
// free stuff if the streaming operation is complete
diff --git a/plugins/Scriver/src/chat/message.cpp b/plugins/Scriver/src/chat/message.cpp index fa228ab895..c01cb1f2ee 100644 --- a/plugins/Scriver/src/chat/message.cpp +++ b/plugins/Scriver/src/chat/message.cpp @@ -288,7 +288,7 @@ TCHAR* DoRtfToTags(char *pszText, SESSION_INFO *si) // move the memory and paste in new commands instead of the old RTF
if (InsertThis[0] || iRemoveChars) {
MoveMemory(p1 + mir_strlen(InsertThis), p1 + iRemoveChars, mir_strlen(p1) - iRemoveChars + 1);
- CopyMemory(p1, InsertThis, mir_strlen(InsertThis));
+ memcpy(p1, InsertThis, mir_strlen(InsertThis));
p1 += mir_strlen(InsertThis);
}
else p1++;
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index bfbacffcf0..04cfeacc0d 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -385,7 +385,7 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK * SendMessage(lParam->nmhdr.hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (_tcschr(tr.lpstrText, _T('@')) != NULL && _tcschr(tr.lpstrText, _T(':')) == NULL && _tcschr(tr.lpstrText, _T('/')) == NULL) {
MoveMemory(tr.lpstrText + 7, tr.lpstrText, sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 1));
- CopyMemory(tr.lpstrText, _T("mailto:"), sizeof(TCHAR) * 7);
+ memcpy(tr.lpstrText, _T("mailto:"), sizeof(TCHAR) * 7);
}
BOOL bOpenLink = TRUE;
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 21579c6c68..333e373db4 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -277,18 +277,18 @@ static int AppendUnicodeOrAnsiiToBufferL(char *&buffer, size_t &cbBufferEnd, siz for (; line < maxLine; line++, textCharsCount++) {
wasEOL = 0;
if (*line == '\r' && line[1] == '\n') {
- CopyMemory(d, "\\line ", 6);
+ memcpy(d, "\\line ", 6);
wasEOL = 1;
d += 6;
line++;
}
else if (*line == '\n') {
- CopyMemory(d, "\\line ", 6);
+ memcpy(d, "\\line ", 6);
wasEOL = 1;
d += 6;
}
else if (*line == '\t') {
- CopyMemory(d, "\\tab ", 5);
+ memcpy(d, "\\tab ", 5);
d += 5;
}
else if (*line == '\\' || *line == '{' || *line == '}') {
@@ -306,7 +306,7 @@ static int AppendUnicodeOrAnsiiToBufferL(char *&buffer, size_t &cbBufferEnd, siz }
}
if (wasEOL) {
- CopyMemory(d, " ", 1);
+ memcpy(d, " ", 1);
d++;
}
strcpy(d, "}");
@@ -618,7 +618,7 @@ static char* CreateRTFFromEvent(SrmmWindowData *dat, EventData *evt, GlobalMessa while (bufferAlloced - bufferEnd < logIconBmpSize[i])
bufferAlloced += 1024;
buffer = (char*)mir_realloc(buffer, bufferAlloced);
- CopyMemory(buffer + bufferEnd, pLogIconBmpBits[i], logIconBmpSize[i]);
+ memcpy(buffer + bufferEnd, pLogIconBmpBits[i], logIconBmpSize[i]);
bufferEnd += logIconBmpSize[i];
AppendToBuffer(buffer, bufferEnd, bufferAlloced, " ");
}
@@ -787,7 +787,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG dat->bufferLen = mir_strlen(dat->buffer);
}
*pcb = min(cb, LONG(dat->bufferLen - dat->bufferOffset));
- CopyMemory(pbBuff, dat->buffer + dat->bufferOffset, *pcb);
+ memcpy(pbBuff, dat->buffer + dat->bufferOffset, *pcb);
dat->bufferOffset += *pcb;
if (dat->bufferOffset == dat->bufferLen) {
mir_free(dat->buffer);
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index 9c0f0d1ce6..1e3985bdfc 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -253,14 +253,14 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA case WM_GETMINMAXINFO:
{
MINMAXINFO mmi;
- CopyMemory (&mmi, (LPMINMAXINFO) lparam, sizeof (MINMAXINFO));
+ memcpy (&mmi, (LPMINMAXINFO) lparam, sizeof (MINMAXINFO));
/* The minimum width in points*/
mmi.ptMinTrackSize.x = 200;
/* The minimum height in points*/
mmi.ptMinTrackSize.y = 190;
- CopyMemory ((LPMINMAXINFO) lparam, &mmi, sizeof (MINMAXINFO));
+ memcpy ((LPMINMAXINFO) lparam, &mmi, sizeof (MINMAXINFO));
}
break;
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index a5fcd575ce..a0e28b90e1 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -132,7 +132,7 @@ DWORD isSeen(MCONTACT hcontact, SYSTEMTIME *st) } } }
if (st)
- CopyMemory (st, &lst, sizeof (SYSTEMTIME));
+ memcpy (st, &lst, sizeof (SYSTEMTIME));
return res;
}
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index b6619a2472..76f937c7c6 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -387,7 +387,7 @@ void __stdcall ipcService(ULONG_PTR dwParam) // translate from client space to cloned heap memory
pMMT->pServerBaseAddress = pMMT->pClientBaseAddress;
pMMT->pClientBaseAddress = cloned;
- CopyMemory(cloned, pMMT, IPC_PACKET_SIZE);
+ memcpy(cloned, pMMT, IPC_PACKET_SIZE);
ipcFixupAddresses(true, cloned);
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &cloned->Param, THREAD_SET_CONTEXT, false, 0);
mir_forkthread(&IssueTransferThread, cloned);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 4871d80f72..5d0bf4b922 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -198,7 +198,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(ptszWinampTitle) - 12) * sizeof(TCHAR));
MoveMemory(msg + i + mir_tstrlen(ptszWinampTitle), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(TCHAR));
- CopyMemory(msg + i, ptszWinampTitle, mir_tstrlen(ptszWinampTitle) * sizeof(TCHAR));
+ memcpy(msg + i, ptszWinampTitle, mir_tstrlen(ptszWinampTitle) * sizeof(TCHAR));
mir_free(ptszWinampTitle);
}
@@ -233,7 +233,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR));
MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(TCHAR));
- CopyMemory(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
}
else if (!_tcsnicmp(msg + i, _T("%date%"), 6))
{
@@ -243,7 +243,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR));
MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(TCHAR));
- CopyMemory(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
}
else if (!_tcsnicmp(msg+i, _T("%rand("), 6))
{
@@ -265,7 +265,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - (k - i)) * sizeof(TCHAR));
MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + (k - i), (mir_tstrlen(msg) - i - (k - i - 1)) * sizeof(TCHAR));
- CopyMemory(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
}
mir_free(temp);
}
@@ -315,7 +315,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 9) * sizeof(TCHAR));
MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + 9, (mir_tstrlen(msg) - i - 8) * sizeof(TCHAR));
- CopyMemory(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
}
else if (!_tcsnicmp(msg+i, _T("%randdefmsg%"), 12))
{
@@ -363,7 +363,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg)+1+mir_tstrlen(substituteStr)-12) * sizeof(TCHAR));
MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(TCHAR));
- CopyMemory(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
}
}
diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp index 7020509cad..de543e17e4 100644 --- a/plugins/StatusPlugins/commonstatus.cpp +++ b/plugins/StatusPlugins/commonstatus.cpp @@ -186,7 +186,7 @@ static void SetStatusMsg(PROTOCOLSETTINGEX *ps, int newstatus) if (mir_tstrlen(substituteStr) > 6)
tszMsg = (TCHAR*)mir_realloc(tszMsg, sizeof(TCHAR)*(mir_tstrlen(tszMsg) + 1 + mir_tstrlen(substituteStr) - 6));
MoveMemory(tszMsg + j + mir_tstrlen(substituteStr), tszMsg + j + 6, sizeof(TCHAR)*(mir_tstrlen(tszMsg) - j - 5));
- CopyMemory(tszMsg + j, substituteStr, sizeof(TCHAR)*mir_tstrlen(substituteStr));
+ memcpy(tszMsg + j, substituteStr, sizeof(TCHAR)*mir_tstrlen(substituteStr));
}
TCHAR *szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL);
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 019a2ae6e1..f59c466ecb 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -515,11 +515,11 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff for (; *line; line++, textCharsCount++) {
if (*line == '\r' && line[1] == '\n') {
- CopyMemory(d, "\\par ", 5);
+ memcpy(d, "\\par ", 5);
line++;
d += 5;
} else if (*line == '\n') {
- CopyMemory(d, "\\line ", 6);
+ memcpy(d, "\\line ", 6);
d += 6;
} else if (*line == '%' && !simpleMode) {
char szTemp[200]; szTemp[0] = '\0';
@@ -586,7 +586,7 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff d += iLen;
}
} else if (*line == '\t' && !streamData->bStripFormat) {
- CopyMemory(d, "\\tab ", 5);
+ memcpy(d, "\\tab ", 5);
d += 5;
} else if ((*line == '\\' || *line == '{' || *line == '}') && !streamData->bStripFormat) {
*d++ = '\\';
@@ -837,7 +837,7 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) while (bufferAlloced - bufferEnd < (pci->logIconBmpSize[0] + 20))
bufferAlloced += 4096;
buffer = (char *) mir_realloc(buffer, bufferAlloced);
- CopyMemory(buffer + bufferEnd, pci->pLogIconBmpBits[iIndex], pci->logIconBmpSize[iIndex]);
+ memcpy(buffer + bufferEnd, pci->pLogIconBmpBits[iIndex], pci->logIconBmpSize[iIndex]);
bufferEnd += pci->logIconBmpSize[iIndex];
}
@@ -941,7 +941,7 @@ static DWORD CALLBACK Log_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG // give the RTF to the RE control
*pcb = min(cb, lstrdat->bufferLen - lstrdat->bufferOffset);
- CopyMemory(pbBuff, lstrdat->buffer + lstrdat->bufferOffset, *pcb);
+ memcpy(pbBuff, lstrdat->buffer + lstrdat->bufferOffset, *pcb);
lstrdat->bufferOffset += *pcb;
// mir_free stuff if the streaming operation is complete
diff --git a/plugins/TabSRMM/src/chat/message.cpp b/plugins/TabSRMM/src/chat/message.cpp index fdab8cc573..c108f97281 100644 --- a/plugins/TabSRMM/src/chat/message.cpp +++ b/plugins/TabSRMM/src/chat/message.cpp @@ -299,7 +299,7 @@ TCHAR* Chat_DoRtfToTags(char* pszText, SESSION_INFO *si) // move the memory and paste in new commands instead of the old RTF
if (InsertThis[0] || iRemoveChars) {
MoveMemory(p1 + mir_strlen(InsertThis) , p1 + iRemoveChars, mir_strlen(p1) - iRemoveChars + 1);
- CopyMemory(p1, InsertThis, mir_strlen(InsertThis));
+ memcpy(p1, InsertThis, mir_strlen(InsertThis));
p1 += mir_strlen(InsertThis);
}
else p1++;
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 1c027c954f..341a49df90 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -2798,7 +2798,7 @@ LABEL_SHOWWINDOW: pt.x = (short) LOWORD(((ENLINK *) lParam)->lParam); pt.y = (short) HIWORD(((ENLINK *) lParam)->lParam); ClientToScreen(((NMHDR*) lParam)->hwndFrom, &pt); - CopyMemory(&uiNew, ui, sizeof(USERINFO)); + memcpy(&uiNew, ui, sizeof(USERINFO)); UINT uID = CreateGCMenu(hwndDlg, &hMenu, 0, pt, si, uiNew.pszUID, uiNew.pszNick); switch (uID) { case 0: diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 650f3ceb7b..6e06dd7f50 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -312,7 +312,7 @@ void CContactCache::saveHistory(WPARAM wParam, LPARAM lParam) } } } - ::CopyMemory(m_history[m_iHistoryTop].szText, szFromStream, iStreamLength); + ::memcpy(m_history[m_iHistoryTop].szText, szFromStream, iStreamLength); if (!oldTop) { if (m_iHistoryTop < m_iHistorySize) { m_iHistoryTop++; diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index ea04f9eebd..6aa6bd4478 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -357,7 +357,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, GetCursorPos(&pt); GetWindowRect(hwndDlg, &rcWindow); - CopyMemory(&pContainer->oldbuttons[0], &pContainer->buttons[0], sizeof(TitleBtn) * 3); + memcpy(&pContainer->oldbuttons[0], &pContainer->buttons[0], sizeof(TitleBtn) * 3); memset(&pContainer->buttons[0], 0, (sizeof(TitleBtn) * 3)); isMin = isMax = isClose = FALSE; diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index a7b5900688..4435efb0e2 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -222,7 +222,7 @@ void CGlobals::reloadSettings(bool fReloadSkins) m_genericTxtColor = M.GetDword(FONTMODULE, "genericTxtClr", GetSysColor(COLOR_BTNTEXT));
m_cRichBorders = M.GetDword(FONTMODULE, "cRichBorders", 0);
- ::CopyMemory(&globalContainerSettings, &_cnt_default, sizeof(TContainerSettings));
+ ::memcpy(&globalContainerSettings, &_cnt_default, sizeof(TContainerSettings));
Utils::ReadContainerSettingsFromDB(0, &globalContainerSettings);
globalContainerSettings.fPrivate = false;
if (fReloadSkins)
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index a7218aa491..913f0a1f2a 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -2082,7 +2082,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr); if (_tcschr(tr.lpstrText, '@') != NULL && _tcschr(tr.lpstrText, ':') == NULL && _tcschr(tr.lpstrText, '/') == NULL) { MoveMemory(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1); - CopyMemory(tr.lpstrText, _T("mailto:"), 7); + memcpy(tr.lpstrText, _T("mailto:"), 7); } if (!IsStringValidLink(tr.lpstrText)) break; @@ -2783,13 +2783,13 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->iSendBufferSize = memRequired; } if (utfResult) { - CopyMemory(dat->sendBuffer, utfResult, memRequired); + memcpy(dat->sendBuffer, utfResult, memRequired); mir_free(utfResult); } else { WideCharToMultiByte(dat->codePage, 0, decoded, -1, dat->sendBuffer, bufSize, 0, 0); if (flags & PREF_UNICODE) - CopyMemory(&dat->sendBuffer[bufSize], decoded, (mir_wstrlen(decoded) + 1) * sizeof(WCHAR)); + memcpy(&dat->sendBuffer[bufSize], decoded, (mir_wstrlen(decoded) + 1) * sizeof(WCHAR)); } if (memRequired == 0 || dat->sendBuffer[0] == 0) diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 9712a49f0c..1b3f647bb4 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -807,14 +807,14 @@ static DWORD CALLBACK Message_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, if (*ppText == NULL) {
*ppText = (char *)mir_alloc(cb + 2);
- CopyMemory(*ppText, pbBuff, cb);
+ memcpy(*ppText, pbBuff, cb);
*pcb = cb;
dwRead = cb;
*(*ppText + cb) = '\0';
}
else {
char *p = (char *)mir_realloc(*ppText, dwRead + cb + 2);
- CopyMemory(p + dwRead, pbBuff, cb);
+ memcpy(p + dwRead, pbBuff, cb);
*ppText = p;
*pcb = cb;
dwRead += cb;
@@ -1076,7 +1076,7 @@ BOOL TSAPI DoRtfToTags(TCHAR *pszText, const TWindowData *dat) if (InsertThis[0] || iRemoveChars) {
size_t cbLen = _tcslen(InsertThis);
MoveMemory(p1 + cbLen, p1 + iRemoveChars, (mir_tstrlen(p1) - iRemoveChars + 1) * sizeof(TCHAR));
- CopyMemory(p1, InsertThis, cbLen * sizeof(TCHAR));
+ memcpy(p1, InsertThis, cbLen * sizeof(TCHAR));
p1 += cbLen;
}
else p1++;
@@ -1712,11 +1712,11 @@ void TSAPI LoadOverrideTheme(TContainerData *pContainer) }
if (pContainer->ltr_templates == NULL) {
pContainer->ltr_templates = (TTemplateSet *)mir_alloc(sizeof(TTemplateSet));
- CopyMemory(pContainer->ltr_templates, <R_Active, sizeof(TTemplateSet));
+ memcpy(pContainer->ltr_templates, <R_Active, sizeof(TTemplateSet));
}
if (pContainer->rtl_templates == NULL) {
pContainer->rtl_templates = (TTemplateSet *)mir_alloc(sizeof(TTemplateSet));
- CopyMemory(pContainer->rtl_templates, &RTL_Active, sizeof(TTemplateSet));
+ memcpy(pContainer->rtl_templates, &RTL_Active, sizeof(TTemplateSet));
}
pContainer->theme.logFonts = (LOGFONTA *)mir_alloc(sizeof(LOGFONTA) * (MSGDLGFONTCOUNT + 2));
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 91f580daf7..ea502d8c7e 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -236,28 +236,28 @@ static int AppendUnicodeToBuffer(char *&buffer, size_t &cbBufferEnd, size_t &cbB int begin = (code == '1');
switch (line[1]) {
case 'b':
- CopyMemory(d, begin ? "\\b " : "\\b0 ", begin ? 3 : 4);
+ memcpy(d, begin ? "\\b " : "\\b0 ", begin ? 3 : 4);
d += (begin ? 3 : 4);
line += 3;
continue;
case 'i':
- CopyMemory(d, begin ? "\\i " : "\\i0 ", begin ? 3 : 4);
+ memcpy(d, begin ? "\\i " : "\\i0 ", begin ? 3 : 4);
d += (begin ? 3 : 4);
line += 3;
continue;
case 'u':
- CopyMemory(d, begin ? "\\ul " : "\\ul0 ", begin ? 4 : 5);
+ memcpy(d, begin ? "\\ul " : "\\ul0 ", begin ? 4 : 5);
d += (begin ? 4 : 5);
line += 3;
continue;
case 's':
- CopyMemory(d, begin ? "\\strike " : "\\strike0 ", begin ? 8 : 9);
+ memcpy(d, begin ? "\\strike " : "\\strike0 ", begin ? 8 : 9);
d += (begin ? 8 : 9);
line += 3;
continue;
case 'c':
begin = (code == 'x');
- CopyMemory(d, "\\cf", 3);
+ memcpy(d, "\\cf", 3);
if (begin) {
d[3] = (char)line[3];
d[4] = (char)line[4];
@@ -278,16 +278,16 @@ static int AppendUnicodeToBuffer(char *&buffer, size_t &cbBufferEnd, size_t &cbB }
}
if (*line == '\r' && line[1] == '\n') {
- CopyMemory(d, "\\line ", 6);
+ memcpy(d, "\\line ", 6);
line++;
d += 6;
}
else if (*line == '\n') {
- CopyMemory(d, "\\line ", 6);
+ memcpy(d, "\\line ", 6);
d += 6;
}
else if (*line == '\t') {
- CopyMemory(d, "\\tab ", 5);
+ memcpy(d, "\\tab ", 5);
d += 5;
}
else if (*line == '\\' || *line == '{' || *line == '}') {
@@ -341,26 +341,26 @@ static int AppendToBufferWithRTF(int mode, char **buffer, int *cbBufferEnd, int }
switch (tag) {
case 'b':
- CopyMemory(*buffer + i, begin ? "\\b1 " : "\\b0 ", 4);
+ memcpy(*buffer + i, begin ? "\\b1 " : "\\b0 ", 4);
continue;
case 'i':
- CopyMemory(*buffer + i, begin ? "\\i1 " : "\\i0 ", 4);
+ memcpy(*buffer + i, begin ? "\\i1 " : "\\i0 ", 4);
continue;
case 'u':
MoveMemory(*buffer + i + 2, *buffer + i + 1, *cbBufferEnd - i);
- CopyMemory(*buffer + i, begin ? "\\ul1 " : "\\ul0 ", 5);
+ memcpy(*buffer + i, begin ? "\\ul1 " : "\\ul0 ", 5);
*cbBufferEnd += 1;
continue;
case 's':
*cbBufferAlloced += 20;
*buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced);
MoveMemory(*buffer + i + 6, *buffer + i + 1, (*cbBufferEnd - i) + 1);
- CopyMemory(*buffer + i, begin ? "\\strike1 " : "\\strike0 ", begin ? 9 : 9);
+ memcpy(*buffer + i, begin ? "\\strike1 " : "\\strike0 ", begin ? 9 : 9);
*cbBufferEnd += 5;
continue;
case 'c':
begin = (code == 'x');
- CopyMemory(*buffer + i, "\\cf", 3);
+ memcpy(*buffer + i, "\\cf", 3);
if (!begin) {
char szTemp[10];
int colindex = GetColorIndex(GetRTFFont(LOWORD(mode) ? (MSGFONTID_MYMSG + (HIWORD(mode) ? 8 : 0)) : (MSGFONTID_YOURMSG + (HIWORD(mode) ? 8 : 0))));
@@ -380,7 +380,7 @@ static int AppendToBufferWithRTF(int mode, char **buffer, int *cbBufferEnd, int *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced);
}
MoveMemory(*buffer + i + 6, *buffer + i + 2, *cbBufferEnd - i - 1);
- CopyMemory(*buffer + i, "\\line ", 6);
+ memcpy(*buffer + i, "\\line ", 6);
*cbBufferEnd += 4;
}
else if ((*buffer)[i] == '\n') {
@@ -389,7 +389,7 @@ static int AppendToBufferWithRTF(int mode, char **buffer, int *cbBufferEnd, int *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced);
}
MoveMemory(*buffer + i + 6, *buffer + i + 1, *cbBufferEnd - i);
- CopyMemory(*buffer + i, "\\line ", 6);
+ memcpy(*buffer + i, "\\line ", 6);
*cbBufferEnd += 5;
}
else if ((*buffer)[i] == '\t') {
@@ -398,7 +398,7 @@ static int AppendToBufferWithRTF(int mode, char **buffer, int *cbBufferEnd, int *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced);
}
MoveMemory(*buffer + i + 5, *buffer + i + 1, *cbBufferEnd - i);
- CopyMemory(*buffer + i, "\\tab ", 5);
+ memcpy(*buffer + i, "\\tab ", 5);
*cbBufferEnd += 4;
}
else if ((*buffer)[i] == '\\' || (*buffer)[i] == '{' || (*buffer)[i] == '}') {
@@ -1169,7 +1169,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG dat->bufferLen = (int)mir_strlen(dat->buffer);
}
*pcb = min(cb, dat->bufferLen - dat->bufferOffset);
- CopyMemory(pbBuff, dat->buffer + dat->bufferOffset, *pcb);
+ memcpy(pbBuff, dat->buffer + dat->bufferOffset, *pcb);
dat->bufferOffset += *pcb;
if (dat->bufferOffset == dat->bufferLen)
replaceStr(dat->buffer, NULL);
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index 3c2078f9c2..95d550d64f 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -96,7 +96,7 @@ entry_found: SendJob &job = m_jobs[iFound]; job.szSendBuffer = (char*)mir_alloc(iLen); - CopyMemory(job.szSendBuffer, dat->sendBuffer, iLen); + memcpy(job.szSendBuffer, dat->sendBuffer, iLen); job.dwFlags = dwFlags; job.dwTime = time(NULL); @@ -128,7 +128,7 @@ static int SendChunkW(WCHAR *chunk, MCONTACT hContact, DWORD dwFlags) ptrA pBuf((char*)mir_alloc(memRequired)); WideCharToMultiByte(codePage, 0, chunk, -1, pBuf, mbcsSize, 0, 0); - CopyMemory(&pBuf[mbcsSize], chunk, (wLen+1) * sizeof(WCHAR)); + memcpy(&pBuf[mbcsSize], chunk, (wLen+1) * sizeof(WCHAR)); return CallContactService(hContact, PSS_MESSAGE, dwFlags, (LPARAM)pBuf); } @@ -152,7 +152,7 @@ static void DoSplitSendW(LPVOID param) size_t iLen = mir_strlen(job->szSendBuffer); WCHAR *wszBegin = (WCHAR*) & job->szSendBuffer[iLen + 1]; WCHAR *wszTemp = (WCHAR*)mir_alloc(sizeof(WCHAR) * (mir_wstrlen(wszBegin) + 1)); - CopyMemory(wszTemp, wszBegin, sizeof(WCHAR) * (mir_wstrlen(wszBegin) + 1)); + memcpy(wszTemp, wszBegin, sizeof(WCHAR) * (mir_wstrlen(wszBegin) + 1)); wszBegin = wszTemp; do { @@ -222,7 +222,7 @@ static void DoSplitSendA(LPVOID param) size_t iLen = mir_strlen(job->szSendBuffer); szTemp = (char *)mir_alloc(iLen + 1); - CopyMemory(szTemp, job->szSendBuffer, iLen + 1); + memcpy(szTemp, job->szSendBuffer, iLen + 1); szBegin = szTemp; do { diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 34595e958e..571498fcd0 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -256,7 +256,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP TCHAR newTemplate[TEMPLATE_LENGTH + 2]; GetWindowText(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), newTemplate, SIZEOF(newTemplate)); - CopyMemory(tSet->szTemplates[teInfo->inEdit], newTemplate, sizeof(TCHAR) * TEMPLATE_LENGTH); + memcpy(tSet->szTemplates[teInfo->inEdit], newTemplate, sizeof(TCHAR) * TEMPLATE_LENGTH); teInfo->changed = FALSE; teInfo->updateInfo[teInfo->inEdit] = FALSE; Utils::enableDlgControl(hwndDlg, IDC_SAVETEMPLATE, FALSE); @@ -288,7 +288,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP teInfo->changed = FALSE; teInfo->updateInfo[teInfo->inEdit] = FALSE; teInfo->selchanging = TRUE; - CopyMemory(tSet->szTemplates[teInfo->inEdit], LTR_Default.szTemplates[teInfo->inEdit], sizeof(TCHAR) * TEMPLATE_LENGTH); + memcpy(tSet->szTemplates[teInfo->inEdit], LTR_Default.szTemplates[teInfo->inEdit], sizeof(TCHAR) * TEMPLATE_LENGTH); SetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, tSet->szTemplates[teInfo->inEdit]); db_unset(teInfo->hContact, teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[teInfo->inEdit]); SetFocus(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE)); @@ -342,7 +342,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP TCHAR szTemp[TEMPLATE_LENGTH + 2]; if (teInfo->changed) { - CopyMemory(szTemp, tSet->szTemplates[teInfo->inEdit], (TEMPLATE_LENGTH * sizeof(TCHAR))); + memcpy(szTemp, tSet->szTemplates[teInfo->inEdit], (TEMPLATE_LENGTH * sizeof(TCHAR))); GetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, tSet->szTemplates[teInfo->inEdit], TEMPLATE_LENGTH); } dbei.szModule = dat->szProto; @@ -366,7 +366,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP StreamInEvents(hwndDlg, 0, 1, 1, &dbei); SendDlgItemMessage(hwndDlg, IDC_PREVIEW, EM_SETSEL, -1, -1); if (teInfo->changed) - CopyMemory(tSet->szTemplates[teInfo->inEdit], szTemp, TEMPLATE_LENGTH * sizeof(TCHAR)); + memcpy(tSet->szTemplates[teInfo->inEdit], szTemp, TEMPLATE_LENGTH * sizeof(TCHAR)); break; } case WM_DESTROY: diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index cf5863ec1c..f7a3739098 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -532,7 +532,7 @@ void Utils::RTF_CTableInit() rtf_ctable = (TRTFColorTable *)mir_alloc(iSize);
memset(rtf_ctable, 0, iSize);
- CopyMemory(rtf_ctable, _rtf_ctable, iSize);
+ memcpy(rtf_ctable, _rtf_ctable, iSize);
rtf_ctable_size = RTF_CTABLE_DEFSIZE;
}
@@ -632,12 +632,12 @@ INT_PTR CALLBACK Utils::PopupDlgProcError(HWND hWnd, UINT message, WPARAM wParam int Utils::ReadContainerSettingsFromDB(const MCONTACT hContact, TContainerSettings *cs, const char *szKey)
{
- CopyMemory(cs, &PluginConfig.globalContainerSettings, sizeof(TContainerSettings));
+ memcpy(cs, &PluginConfig.globalContainerSettings, sizeof(TContainerSettings));
DBVARIANT dbv = { 0 };
if (0 == db_get(hContact, SRMSGMOD_T, szKey ? szKey : CNT_KEYNAME, &dbv)) {
if (dbv.type == DBVT_BLOB && dbv.cpbVal > 0 && dbv.cpbVal <= sizeof(TContainerSettings)) {
- ::CopyMemory((void*)cs, (void*)dbv.pbVal, dbv.cpbVal);
+ ::memcpy((void*)cs, (void*)dbv.pbVal, dbv.cpbVal);
::db_free(&dbv);
if (hContact == 0 && szKey == 0)
cs->fPrivate = false;
@@ -690,7 +690,7 @@ void Utils::ReadPrivateContainerSettings(TContainerData *pContainer, bool fForce if (csTemp.fPrivate || fForce) {
if (pContainer->settings == 0 || pContainer->settings == &PluginConfig.globalContainerSettings)
pContainer->settings = (TContainerSettings *)mir_alloc(sizeof(TContainerSettings));
- CopyMemory((void*)pContainer->settings, (void*)&csTemp, sizeof(TContainerSettings));
+ memcpy((void*)pContainer->settings, (void*)&csTemp, sizeof(TContainerSettings));
pContainer->settings->fPrivate = true;
}
else pContainer->settings = &PluginConfig.globalContainerSettings;
@@ -977,7 +977,7 @@ const wchar_t* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRi ::SendMessageW(hwndRich, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) {
::MoveMemory(tr.lpstrText + 7, tr.lpstrText, sizeof(wchar_t) * (tr.chrg.cpMax - tr.chrg.cpMin + 1));
- ::CopyMemory(tr.lpstrText, L"mailto:", 7 * sizeof(wchar_t));
+ ::memcpy(tr.lpstrText, L"mailto:", 7 * sizeof(wchar_t));
}
return(tr.lpstrText);
}
@@ -1082,7 +1082,7 @@ size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner) EmptyClipboard();
HGLOBAL hData = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, i);
- CopyMemory((void*)GlobalLock(hData), str, i);
+ memcpy((void*)GlobalLock(hData), str, i);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
CloseClipboard();
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index d9afc09f7a..2c22c0eef6 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -510,13 +510,13 @@ void LoadOptions() if (!db_get(NULL, MODULE, "IconOrder", &dbv))
{
- CopyMemory(opt.exIconsOrder,dbv.pbVal,dbv.cpbVal);
+ memcpy(opt.exIconsOrder,dbv.pbVal,dbv.cpbVal);
db_free(&dbv);
}
if (!db_get(NULL, MODULE, "icons_vis", &dbv))
{
- CopyMemory(opt.exIconsVis,dbv.pbVal,dbv.cpbVal);
+ memcpy(opt.exIconsVis,dbv.pbVal,dbv.cpbVal);
db_free(&dbv);
}
diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp index 837517c7ab..84c1402103 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.cpp +++ b/plugins/UserInfoEx/src/ctrl_edit.cpp @@ -350,7 +350,7 @@ LRESULT CEditCtrl::LinkNotificationHandler(ENLINK* lnk) if (_tcschr(tr.lpstrText, '@') != NULL && _tcschr(tr.lpstrText, ':') == NULL && _tcschr(tr.lpstrText, '/') == NULL) { MoveMemory(tr.lpstrText + (7*sizeof(TCHAR)), tr.lpstrText, (tr.chrg.cpMax - tr.chrg.cpMin + 1)*sizeof(TCHAR)); - CopyMemory(tr.lpstrText, _T("mailto:"), (7*sizeof(TCHAR))); + memcpy(tr.lpstrText, _T("mailto:"), (7*sizeof(TCHAR))); } LPSTR pszUrl = mir_t2a(tr.lpstrText); diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index 6730104dfd..f3704a0bf9 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -97,7 +97,7 @@ DWORD WhenAdded(DWORD dwUIN, LPCSTR pszProto) if (!DB::Event::GetInfoWithData(edbe, &dbei)) {
// extract UIN and compare with given one
DWORD dwEvtUIN;
- CopyMemory(&dwEvtUIN, dbei.pBlob, sizeof(DWORD));
+ memcpy(&dwEvtUIN, dbei.pBlob, sizeof(DWORD));
MIR_FREE(dbei.pBlob);
if (dwEvtUIN == dwUIN)
return dbei.timestamp;
diff --git a/plugins/Variables/src/parse_logic.cpp b/plugins/Variables/src/parse_logic.cpp index ea14e89660..42f0ced5c3 100644 --- a/plugins/Variables/src/parse_logic.cpp +++ b/plugins/Variables/src/parse_logic.cpp @@ -170,7 +170,7 @@ static TCHAR *parseFor(ARGUMENTSINFO *ai) TCHAR *res = mir_tstrdup(_T(""));
FORMATINFO fi;
- CopyMemory(&fi, ai->fi, sizeof(fi));
+ memcpy(&fi, ai->fi, sizeof(fi));
fi.eCount = fi.pCount = 0;
fi.tszFormat = ai->targv[1];
mir_free(formatString(&fi));
diff --git a/plugins/Variables/src/parse_str.cpp b/plugins/Variables/src/parse_str.cpp index 1d993f8b4c..36e2fab4f6 100644 --- a/plugins/Variables/src/parse_str.cpp +++ b/plugins/Variables/src/parse_str.cpp @@ -87,7 +87,7 @@ static TCHAR *parseEolToCrlf(ARGUMENTSINFO *ai) res = (TCHAR*)mir_realloc(res, (_tcslen(res) + 2)*sizeof(TCHAR));
cur = res + loc;
MoveMemory(cur + 2, cur + 1, (_tcslen(cur + 1) + 1)*sizeof(TCHAR));
- CopyMemory(cur, _T("\r\n"), 2 * sizeof(TCHAR));
+ memcpy(cur, _T("\r\n"), 2 * sizeof(TCHAR));
cur += 2;
}
while (cur != NULL);
@@ -148,7 +148,7 @@ static TCHAR *parseFixeol2(ARGUMENTSINFO *ai) cur = res + pos;
}
MoveMemory(cur + _tcslen(szReplacement), cur + _tcslen(szEol), (_tcslen(cur + _tcslen(szEol)) + 1)*sizeof(TCHAR));
- CopyMemory(cur, szReplacement, _tcslen(szReplacement)*sizeof(TCHAR));
+ memcpy(cur, szReplacement, _tcslen(szReplacement)*sizeof(TCHAR));
pos += _tcslen(szReplacement) - 1;
}
}
@@ -409,7 +409,7 @@ static TCHAR *parseReplace(ARGUMENTSINFO *ai) cur = res + pos;
}
MoveMemory(cur + _tcslen(ai->targv[i + 1]), cur + _tcslen(ai->targv[i]), (_tcslen(cur + _tcslen(ai->targv[i])) + 1)*sizeof(TCHAR));
- CopyMemory(cur, ai->targv[i + 1], _tcslen(ai->targv[i + 1])*sizeof(TCHAR));
+ memcpy(cur, ai->targv[i + 1], _tcslen(ai->targv[i + 1])*sizeof(TCHAR));
pos += _tcslen(ai->targv[i + 1]) - 1;
}
}
diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp index cc1818eca9..a378a87904 100644 --- a/plugins/Variables/src/variables.cpp +++ b/plugins/Variables/src/variables.cpp @@ -332,7 +332,7 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi) fi->err = EMEM; return NULL; } - CopyMemory(tcur+1, tcur, strlen(tcur)+1); + memcpy(tcur+1, tcur, strlen(tcur)+1); tcur++; } }*/ @@ -353,7 +353,7 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi) scur = string+scurPos; cur = string+curPos; MoveMemory(scur + parsedTokenLen, cur, (_tcslen(cur)+1)*sizeof(TCHAR)); - CopyMemory(scur, parsedToken, parsedTokenLen*sizeof(TCHAR)); + memcpy(scur, parsedToken, parsedTokenLen*sizeof(TCHAR)); { size_t len = _tcslen(string); string = (TCHAR*)mir_realloc(string, (len+1)*sizeof(TCHAR)); @@ -390,12 +390,12 @@ static INT_PTR formatStringService(WPARAM wParam, LPARAM lParam) if (((FORMATINFO *)wParam)->cbSize >= sizeof(FORMATINFO)) { memset(&tempFi, 0, sizeof(FORMATINFO)); - CopyMemory(&tempFi, (FORMATINFO *)wParam, sizeof(FORMATINFO)); + memcpy(&tempFi, (FORMATINFO *)wParam, sizeof(FORMATINFO)); fi = &tempFi; } else if (((FORMATINFO *)wParam)->cbSize == FORMATINFOV2_SIZE) { memset(&tempFi, 0, sizeof(FORMATINFO)); - CopyMemory(&tempFi, (FORMATINFO *)wParam, FORMATINFOV2_SIZE); + memcpy(&tempFi, (FORMATINFO *)wParam, FORMATINFOV2_SIZE); fi = &tempFi; } else { diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index 77d4a3d325..40e986fb0b 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -322,7 +322,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendDlgItemMessage(hwndDlg, IDC_DATA, EM_GETTEXTRANGE, 0, (LPARAM) & tr);
if (strchr(tr.lpstrText, '@') != NULL && strchr(tr.lpstrText, ':') == NULL && strchr(tr.lpstrText, '/') == NULL) {
MoveMemory(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1);
- CopyMemory(tr.lpstrText, "mailto:", 7);
+ memcpy(tr.lpstrText, "mailto:", 7);
}
CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW, (LPARAM) tr.lpstrText);
@@ -517,7 +517,7 @@ void ValidatePosition(HWND hwndDlg) MONITORINFO monitorInfo;
monitorInfo.cbSize = sizeof(MONITORINFO);
if (GetMonitorInfo(hMonitor, &monitorInfo))
- CopyMemory(&r, &monitorInfo.rcMonitor, sizeof(RECT));
+ memcpy(&r, &monitorInfo.rcMonitor, sizeof(RECT));
// /window going off right of screen*
if (Xposition + WindowWidth >= r.right)
diff --git a/plugins/mTextControl/src/FormattedTextDraw.cpp b/plugins/mTextControl/src/FormattedTextDraw.cpp index 6a9e2d2cdc..e63da72391 100644 --- a/plugins/mTextControl/src/FormattedTextDraw.cpp +++ b/plugins/mTextControl/src/FormattedTextDraw.cpp @@ -39,7 +39,7 @@ DWORD CALLBACK EditStreamInCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, *pcb = LONG(pCookie->cbSize - pCookie->cbCount)*sizeof(WCHAR);
else
*pcb = cb & ~1UL;
- CopyMemory(pbBuff, pCookie->unicode + pCookie->cbCount, *pcb);
+ memcpy(pbBuff, pCookie->unicode + pCookie->cbCount, *pcb);
pCookie->cbCount += *pcb / sizeof(WCHAR);
}
else {
@@ -47,7 +47,7 @@ DWORD CALLBACK EditStreamInCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, *pcb = LONG(pCookie->cbSize - pCookie->cbCount);
else
*pcb = cb;
- CopyMemory(pbBuff, pCookie->ansi + pCookie->cbCount, *pcb);
+ memcpy(pbBuff, pCookie->ansi + pCookie->cbCount, *pcb);
pCookie->cbCount += *pcb;
}
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index 2e170253ab..df0db3b074 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -298,7 +298,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) cont->m_status = ID_STATUS_OFFLINE; int nlen = (int)strlen(pak.strName); cont->m_nick = new char[nlen+1]; - CopyMemory(cont->m_nick, pak.strName, nlen+1); + memcpy(cont->m_nick, pak.strName, nlen+1); m_pRootContact = cont; } else @@ -308,7 +308,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) delete[] cont->m_nick; int nlen = (int)strlen(pak.strName); cont->m_nick = new char[nlen+1]; - CopyMemory(cont->m_nick, pak.strName, nlen+1); + memcpy(cont->m_nick, pak.strName, nlen+1); } } cont->m_time = MLAN_CHECK + MLAN_TIMEOUT; @@ -716,7 +716,7 @@ u_char* CMLan::CreatePacket(TPacket& pak, int* pBufLen) { *pb++ = 1+nameLen+1; *pb++ = MCODE_SND_NAME; - CopyMemory(pb, pak.strName, nameLen); + memcpy(pb, pak.strName, nameLen); pb += nameLen; *pb++ = 0; } @@ -739,7 +739,7 @@ u_char* CMLan::CreatePacket(TPacket& pak, int* pBufLen) *((u_int*)pb) = pak.idMessage; pb += sizeof(u_int); if (mesLen) - CopyMemory(pb, pak.strMessage, mesLen); + memcpy(pb, pak.strMessage, mesLen); pb += mesLen; *pb++ = 0; } @@ -772,7 +772,7 @@ u_char* CMLan::CreatePacket(TPacket& pak, int* pBufLen) *((u_int*)pb) = pak.idAckAwayMessage; pb += sizeof(u_int); if (awayLen) - CopyMemory(pb, pak.strAwayMessage, awayLen); + memcpy(pb, pak.strAwayMessage, awayLen); pb += awayLen; *pb++ = 0; } diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 085cc2b898..2738f3e919 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -485,7 +485,7 @@ static void DoChatFormatting(TCHAR* pszText) }
MoveMemory(p1 + mir_tstrlen(InsertThis), p1 + iRemoveChars, sizeof(TCHAR)*(mir_tstrlen(p1) - iRemoveChars + 1));
- CopyMemory(p1, InsertThis, sizeof(TCHAR)*mir_tstrlen(InsertThis));
+ memcpy(p1, InsertThis, sizeof(TCHAR)*mir_tstrlen(InsertThis));
if (iRemoveChars || mir_tstrlen(InsertThis))
p1 += mir_tstrlen(InsertThis);
else
diff --git a/protocols/Tlen/src/tlen_presence.cpp b/protocols/Tlen/src/tlen_presence.cpp index 60a77916a2..7f45b4547e 100644 --- a/protocols/Tlen/src/tlen_presence.cpp +++ b/protocols/Tlen/src/tlen_presence.cpp @@ -283,7 +283,7 @@ static void TlenSendPresenceTo(TlenProtocol *proto, int status, char *to) else continue; if (strlen(substituteStr)>6) ptr=(char*)mir_realloc(ptr,strlen(ptr)+1+strlen(substituteStr)-6); MoveMemory(ptr+i+strlen(substituteStr),ptr+i+6,strlen(ptr)-i-5); - CopyMemory(ptr+i,substituteStr,strlen(substituteStr)); + memcpy(ptr+i,substituteStr,strlen(substituteStr)); } } } diff --git a/protocols/Xfire/src/Xfire_base.cpp b/protocols/Xfire/src/Xfire_base.cpp index dd924bcff3..6cf65879c9 100644 --- a/protocols/Xfire/src/Xfire_base.cpp +++ b/protocols/Xfire/src/Xfire_base.cpp @@ -541,7 +541,7 @@ HICON Xfire_base::createHICONfromdata(LPVOID data, unsigned int size) { if (buffer) {
LPVOID data2 = GlobalLock(buffer);
if (data2) {
- CopyMemory(data2, data, size);
+ memcpy(data2, data, size);
IStream* stream = NULL;
if (CreateStreamOnHGlobal(data2, FALSE, &stream) == S_OK)
@@ -571,7 +571,7 @@ HBITMAP Xfire_base::createHBITMAPfromdata(LPVOID data, unsigned int size) { if (buffer) {
LPVOID data2 = GlobalLock(buffer);
if (data2) {
- CopyMemory(data2, data, size);
+ memcpy(data2, data, size);
IStream* stream = NULL;
if (CreateStreamOnHGlobal(data2, FALSE, &stream) == S_OK)
diff --git a/src/core/stdaway/sendmsg.cpp b/src/core/stdaway/sendmsg.cpp index 53273ab9a6..e9da826892 100644 --- a/src/core/stdaway/sendmsg.cpp +++ b/src/core/stdaway/sendmsg.cpp @@ -134,7 +134,7 @@ static TCHAR* GetAwayMessage(int statusMode, char *szProto) if (mir_tstrlen(substituteStr) > 6)
dbv.ptszVal = (TCHAR*)mir_realloc(dbv.ptszVal, (mir_tstrlen(dbv.ptszVal) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR));
MoveMemory(dbv.ptszVal + i + mir_tstrlen(substituteStr), dbv.ptszVal + i + 6, (mir_tstrlen(dbv.ptszVal) - i - 5) * sizeof(TCHAR));
- CopyMemory(dbv.ptszVal+i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memcpy(dbv.ptszVal+i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
}
}
return dbv.ptszVal;
diff --git a/src/core/stdchat/src/log.cpp b/src/core/stdchat/src/log.cpp index 2ba54448ac..b247fb9029 100644 --- a/src/core/stdchat/src/log.cpp +++ b/src/core/stdchat/src/log.cpp @@ -36,7 +36,7 @@ static DWORD CALLBACK Log_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG // give the RTF to the RE control
*pcb = min(cb, lstrdat->bufferLen - lstrdat->bufferOffset);
- CopyMemory(pbBuff, lstrdat->buffer + lstrdat->bufferOffset, *pcb);
+ memcpy(pbBuff, lstrdat->buffer + lstrdat->bufferOffset, *pcb);
lstrdat->bufferOffset += *pcb;
// free stuff if the streaming operation is complete
diff --git a/src/core/stdfile/fileexistsdlg.cpp b/src/core/stdfile/fileexistsdlg.cpp index bf44d2e70b..1c3e7dedef 100644 --- a/src/core/stdfile/fileexistsdlg.cpp +++ b/src/core/stdfile/fileexistsdlg.cpp @@ -63,7 +63,7 @@ static void DoAnnoyingShellCommand(HWND hwnd, const TCHAR *szFilename, int cmd, pidlNext = (ITEMIDLIST*)((PBYTE)pidl + pidl->mkid.cb);
if (pidlNext->mkid.cb == 0) {
pidlFilename = (ITEMIDLIST*)CoTaskMemAlloc(pidl->mkid.cb + sizeof(pidl->mkid.cb));
- CopyMemory(pidlFilename, pidl, pidl->mkid.cb + sizeof(pidl->mkid.cb));
+ memcpy(pidlFilename, pidl, pidl->mkid.cb + sizeof(pidl->mkid.cb));
pidl->mkid.cb = 0;
break;
}
@@ -312,7 +312,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
PROTOFILERESUME *pfrCopy = (PROTOFILERESUME*)mir_alloc(sizeof(pfr));
- CopyMemory(pfrCopy, &pfr, sizeof(pfr));
+ memcpy(pfrCopy, &pfr, sizeof(pfr));
PostMessage((HWND)GetPropA(hwndDlg, "Miranda.ParentWnd"), M_FILEEXISTSDLGREPLY, (WPARAM)mir_tstrdup(fts->tszCurrentFile), (LPARAM)pfrCopy);
DestroyWindow(hwndDlg);
}
diff --git a/src/core/stdfile/filesenddlg.cpp b/src/core/stdfile/filesenddlg.cpp index 9c98a4f108..5abc5221ff 100644 --- a/src/core/stdfile/filesenddlg.cpp +++ b/src/core/stdfile/filesenddlg.cpp @@ -109,7 +109,7 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf) dat->files[nTemp] = (TCHAR*)mir_alloc(sizeof(TCHAR)*(fileOffset + cbFileNameLen + 1));
// Add path to filename and copy into array
- CopyMemory(dat->files[nTemp], buf, (fileOffset - 1)*sizeof(TCHAR));
+ memcpy(dat->files[nTemp], buf, (fileOffset - 1)*sizeof(TCHAR));
dat->files[nTemp][fileOffset - 1] = '\\';
_tcscpy(dat->files[nTemp] + fileOffset - (buf[fileOffset - 2] == '\\' ? 1 : 0), pBuf);
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 647a067ba1..ef6c288bbf 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -280,7 +280,7 @@ static char *CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, HANDLE while (bufferAlloced - bufferEnd < logIconBmpSize[i])
bufferAlloced += 1024;
buffer = (char *)mir_realloc(buffer, bufferAlloced);
- CopyMemory(buffer + bufferEnd, pLogIconBmpBits[i], logIconBmpSize[i]);
+ memcpy(buffer + bufferEnd, pLogIconBmpBits[i], logIconBmpSize[i]);
bufferEnd += logIconBmpSize[i];
}
@@ -432,7 +432,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG dat->bufferLen = (int)strlen(dat->buffer);
}
*pcb = min(cb, dat->bufferLen - dat->bufferOffset);
- CopyMemory(pbBuff, dat->buffer + dat->bufferOffset, *pcb);
+ memcpy(pbBuff, dat->buffer + dat->bufferOffset, *pcb);
dat->bufferOffset += *pcb;
if (dat->bufferOffset == dat->bufferLen) {
mir_free(dat->buffer);
diff --git a/src/modules/chat/log.cpp b/src/modules/chat/log.cpp index 967de076de..44b0ac9248 100644 --- a/src/modules/chat/log.cpp +++ b/src/modules/chat/log.cpp @@ -126,12 +126,12 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff for (; *line; line++, textCharsCount++) {
if (*line == '\r' && line[1] == '\n') {
- CopyMemory(d, "\\par ", 5);
+ memcpy(d, "\\par ", 5);
line++;
d += 5;
}
else if (*line == '\n') {
- CopyMemory(d, "\\line ", 6);
+ memcpy(d, "\\line ", 6);
d += 6;
}
else if (*line == '%' && !simpleMode) {
@@ -203,7 +203,7 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff }
}
else if (*line == '\t' && !streamData->bStripFormat) {
- CopyMemory(d, "\\tab ", 5);
+ memcpy(d, "\\tab ", 5);
d += 5;
}
else if ((*line == '\\' || *line == '{' || *line == '}') && !streamData->bStripFormat) {
@@ -353,7 +353,7 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData) while (bufferAlloced - bufferEnd < logIconBmpSize[0])
bufferAlloced += 4096;
buffer = (char *)mir_realloc(buffer, bufferAlloced);
- CopyMemory(buffer + bufferEnd, pLogIconBmpBits[iIndex], logIconBmpSize[iIndex]);
+ memcpy(buffer + bufferEnd, pLogIconBmpBits[iIndex], logIconBmpSize[iIndex]);
bufferEnd += logIconBmpSize[iIndex];
}
diff --git a/src/modules/clist/contacts.cpp b/src/modules/clist/contacts.cpp index b07aa7e921..4ebe10d121 100644 --- a/src/modules/clist/contacts.cpp +++ b/src/modules/clist/contacts.cpp @@ -516,7 +516,7 @@ int LoadContactsModule(void) DBVARIANT dbv;
if (!db_get(NULL, "Contact", "NameOrder", &dbv)) {
- CopyMemory(nameOrder, dbv.pbVal, dbv.cpbVal);
+ memcpy(nameOrder, dbv.pbVal, dbv.cpbVal);
db_free(&dbv);
}
diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp index 67d0c46d9d..ef08f042be 100644 --- a/src/modules/findadd/findadd.cpp +++ b/src/modules/findadd/findadd.cpp @@ -919,7 +919,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->bFlexSearchResult = FALSE; - CopyMemory(&lsr->psr, psr, psr->cbSize); + memcpy(&lsr->psr, psr, psr->cbSize); lsr->psr.nick = psr->flags & PSR_UNICODE ? mir_u2t((wchar_t*)psr->nick) : mir_a2t((char*)psr->nick); lsr->psr.firstName = psr->flags & PSR_UNICODE ? mir_u2t((wchar_t*)psr->firstName) : mir_a2t((char*)psr->firstName); lsr->psr.lastName = psr->flags & PSR_UNICODE ? mir_u2t((wchar_t*)psr->lastName) : mir_a2t((char*)psr->lastName); diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp index 90c77aafe1..5f18385f14 100644 --- a/src/modules/netlib/netliblog.cpp +++ b/src/modules/netlib/netliblog.cpp @@ -437,8 +437,8 @@ void NetlibDumpData(NetlibConnection *nlc, PBYTE buf, int len, int sent, int fla int sz = titleLineLen + len + 1;
useStack = sz <= 8192;
szBuf = (char*)(useStack ? alloca(sz) : mir_alloc(sz));
- CopyMemory(szBuf, szTitleLine, titleLineLen);
- CopyMemory(szBuf + titleLineLen, (const char*)buf, len);
+ memcpy(szBuf, szTitleLine, titleLineLen);
+ memcpy(szBuf + titleLineLen, (const char*)buf, len);
szBuf[titleLineLen + len] = '\0';
}
// Binary data
@@ -448,7 +448,7 @@ void NetlibDumpData(NetlibConnection *nlc, PBYTE buf, int len, int sent, int fla useStack = sz <= 8192;
szBuf = (char*)(useStack ? alloca(sz) : mir_alloc(sz));
- CopyMemory(szBuf, szTitleLine, titleLineLen);
+ memcpy(szBuf, szTitleLine, titleLineLen);
char *pszBuf = szBuf + titleLineLen;
for (line = 0;; line += 16) {
colsInLine = min(16, len - line);
diff --git a/src/modules/netlib/netlibssl.cpp b/src/modules/netlib/netlibssl.cpp index 456670ae8f..fa9a77028d 100644 --- a/src/modules/netlib/netlibssl.cpp +++ b/src/modules/netlib/netlibssl.cpp @@ -896,7 +896,7 @@ int NetlibSslWrite(SslHandle *ssl, const char *buf, int num) while (sendOff < (DWORD)num)
{
cbMessage = min(Sizes.cbMaximumMessage, (DWORD)num - sendOff);
- CopyMemory(pbMessage, buf+sendOff, cbMessage);
+ memcpy(pbMessage, buf+sendOff, cbMessage);
Buffers[0].pvBuffer = pbDataBuffer;
Buffers[0].cbBuffer = Sizes.cbHeader;
|