From c5d77bbf98e23fec98db55c9708525eafd447b0b Mon Sep 17 00:00:00 2001
From: George Hazan <george.hazan@gmail.com>
Date: Wed, 21 Jan 2015 19:57:24 +0000
Subject: ShellExt must not be linked with mir_core.dll

git-svn-id: http://svn.miranda-ng.org/main/trunk@11889 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
---
 plugins/ShellExt/src/main.cpp   |  2 +-
 plugins/ShellExt/src/shlcom.cpp | 32 ++++++++++++++++----------------
 plugins/ShellExt/src/shlext.cpp | 20 ++++++++++----------
 plugins/ShellExt/src/utils.cpp  |  2 +-
 4 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp
index c8e840cc48..24e1cdc736 100644
--- a/plugins/ShellExt/src/main.cpp
+++ b/plugins/ShellExt/src/main.cpp
@@ -128,7 +128,7 @@ STDAPI DllRegisterServer()
 
 	TCHAR tszFileName[MAX_PATH];
 	GetModuleFileName(hInst, tszFileName, SIZEOF(tszFileName));
-	if ( RegSetValueEx(kInprocServer, NULL, 0, REG_SZ, (LPBYTE)tszFileName, sizeof(TCHAR)*(mir_tstrlen(tszFileName)+1)))
+	if ( RegSetValueEx(kInprocServer, NULL, 0, REG_SZ, (LPBYTE)tszFileName, sizeof(TCHAR)*(lstrlen(tszFileName)+1)))
 		return E_FAIL;
 	if ( RegSetValueExA(kInprocServer, "ThreadingModel", 0, REG_SZ, (PBYTE)str4, sizeof(str4)))
 		return E_FAIL;
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp
index 76f937c7c6..45cd72b88c 100644
--- a/plugins/ShellExt/src/shlcom.cpp
+++ b/plugins/ShellExt/src/shlcom.cpp
@@ -79,21 +79,21 @@ BOOL AddToList(TAddArgList& args)
 
 		if (attr & FILE_ATTRIBUTE_DIRECTORY) {
 			// add the directory
-			mir_strcpy(szBuf, args.szFile);
+			lstrcpyA(szBuf, args.szFile);
 			args.files = (LPSTR*)mir_realloc(args.files, (args.count + 1) * sizeof(LPSTR));
 			char *p = mir_strdup(szBuf);
 			args.files[args.count] = p;
 			args.count++;
 			// tack on ending search token
-			mir_strcat(szBuf, "\\*");
+			lstrcatA(szBuf, "\\*");
 
 			WIN32_FIND_DATAA fd;
 			HANDLE hFind = FindFirstFileA(szBuf, &fd);
 			while (true) {
 				if (fd.cFileName[0] != '.') {
-					mir_strcpy(szBuf, args.szFile);
-					mir_strcat(szBuf, "\\");
-					mir_strcat(szBuf, fd.cFileName);
+					lstrcpyA(szBuf, args.szFile);
+					lstrcatA(szBuf, "\\");
+					lstrcatA(szBuf, fd.cFileName);
 					// keep a copy of the current thing being processed
 					szThis = args.szFile;
 					args.szFile = szBuf;
@@ -200,8 +200,8 @@ void ipcGetSkinIcons(THeaderIPC *ipch)
 		spi.pid = GetCurrentProcessId();
 		while (protoCount > 0) {
 			PROTOACCOUNT *pa = *pp;
-			mir_strcpy(szTmp, pa->szModuleName);
-			mir_strcat(szTmp, PS_GETCAPS);
+			lstrcpyA(szTmp, pa->szModuleName);
+			lstrcatA(szTmp, PS_GETCAPS);
 			DWORD dwCaps = CallService(szTmp, PFLAGNUM_1, 0);
 			if (dwCaps & PF1_FILESEND) {
 				TSlotIPC *pct = ipcAlloc(ipch, sizeof(TSlotProtoIcons));
@@ -315,9 +315,9 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode)
 			if (bGroupMode) {
 				rc = db_get_s(pContacts[i].hContact, "CList", "Group", &dbv);
 				if (!rc)
-					n = mir_strlen(dbv.pszVal) + 1;
+					n = lstrlenA(dbv.pszVal) + 1;
 			}
-			int cch = mir_strlen(szContact) + 1;
+			int cch = lstrlenA(szContact) + 1;
 			TSlotIPC *pct = ipcAlloc(ipch, cch + 1 + n);
 			if (pct == NULL) {
 				db_free(&dbv);
@@ -326,7 +326,7 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode)
 			// lie about the actual size of the TSlotIPC
 			pct->cbStrSection = cch;
 			LPSTR szSlot = LPSTR(pct) + sizeof(TSlotIPC);
-			mir_strcpy(szSlot, szContact);
+			lstrcpyA(szSlot, szContact);
 			pct->fType = REQUEST_CONTACTS;
 			pct->hContact = pContacts[i].hContact;
 			pct->Status = pContacts[i].dwStatus;
@@ -337,7 +337,7 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode)
 			szSlot += cch + 1;
 			if (rc == 0) {
 				pct->hGroup = murmur_hash(dbv.pszVal);
-				mir_strcpy(szSlot, dbv.pszVal);
+				lstrcpyA(szSlot, dbv.pszVal);
 				db_free(&dbv);
 			}
 			else {
@@ -415,15 +415,15 @@ void __stdcall ipcService(ULONG_PTR dwParam)
 
 		// see if we have a custom string for 'Miranda'
 		szMiranda = "Miranda";
-		mir_strncpy(pMMT->MirandaName, szMiranda, sizeof(pMMT->MirandaName) - 1);
+		lstrcpynA(pMMT->MirandaName, szMiranda, sizeof(pMMT->MirandaName) - 1);
 
 		// for the MRU menu
 		szBuf = Translate("Recently");
-		mir_strncpy(pMMT->MRUMenuName, szBuf, sizeof(pMMT->MRUMenuName) - 1);
+		lstrcpynA(pMMT->MRUMenuName, szBuf, sizeof(pMMT->MRUMenuName) - 1);
 
 		// and a custom string for "clear entries"
 		szBuf = Translate("Clear entries");
-		mir_strncpy(pMMT->ClearEntries, szBuf, sizeof(pMMT->ClearEntries) - 1);
+		lstrcpynA(pMMT->ClearEntries, szBuf, sizeof(pMMT->ClearEntries) - 1);
 
 		// if the group mode is on, check if they want the CList setting
 		bool bGroupMode = (BST_CHECKED == db_get_b(0, SHLExt_Name, SHLExt_UseGroups, BST_UNCHECKED));
@@ -449,7 +449,7 @@ void __stdcall ipcService(ULONG_PTR dwParam)
 				_itoa(iSlot, szGroupStr, 10);
 				if ( db_get_s(0, "CListGroups", szGroupStr, &dbv) != 0)
 					break;
-				pct = ipcAlloc(pMMT, mir_strlen(dbv.pszVal + 1) + 1);
+				pct = ipcAlloc(pMMT, lstrlenA(dbv.pszVal + 1) + 1);
 				// first byte has flags, need null term
 				if (pct != NULL) {
 					if (pMMT->GroupsBegin == NULL)
@@ -457,7 +457,7 @@ void __stdcall ipcService(ULONG_PTR dwParam)
 					pct->fType = REQUEST_GROUPS;
 					pct->hContact = 0;
 					szBuf = LPSTR(pct) + sizeof(TSlotIPC); // get the end of the slot
-					mir_strcpy(szBuf, dbv.pszVal + 1);
+					lstrcpyA(szBuf, dbv.pszVal + 1);
 					pct->hGroup = 0;
 					db_free(&dbv); // free the string
 				}
diff --git a/plugins/ShellExt/src/shlext.cpp b/plugins/ShellExt/src/shlext.cpp
index f0ed65c72c..ff8ba3d906 100644
--- a/plugins/ShellExt/src/shlext.cpp
+++ b/plugins/ShellExt/src/shlext.cpp
@@ -169,7 +169,7 @@ void DecideMenuItemInfo(TSlotIPC *pct, TGroupNode *pg, MENUITEMINFOA &mii, TEnum
 	if (pct != NULL) {
 		psd->cch = pct->cbStrSection - 1; // no null;
 		psd->szText = (char*)HeapAlloc(hDllHeap, 0, pct->cbStrSection);
-		mir_strcpy(psd->szText, (char*)pct + sizeof(TSlotIPC));
+		lstrcpyA(psd->szText, (char*)pct + sizeof(TSlotIPC));
 		psd->hContact = pct->hContact;
 		psd->fTypes = dtContact;
 		// find the protocol icon array to use && which status
@@ -375,9 +375,9 @@ static void BuildMenus(TEnumData *lParam)
 				// since it maybe Miranda\Blah\Blah and we have created the first node
 				// which maybe Miranda, thus giving the wrong hash
 				// since "Miranda" can be a group of it's own and a full path
-				q->cchGroup = mir_strlen(Token);
+				q->cchGroup = lstrlenA(Token);
 				q->szGroup = (LPSTR)HeapAlloc(hDllHeap, 0, q->cchGroup + 1);
-				mir_strcpy(q->szGroup, Token);
+				lstrcpyA(q->szGroup, Token);
 				q->dwItems = 0;
 			}
 			p = q;
@@ -449,7 +449,7 @@ static void BuildMenus(TEnumData *lParam)
 		// the IPC string pointer wont be around forever, must make a copy
 		psd->cch = (int)strlen(lParam->ipch->MRUMenuName);
 		psd->szText = (LPSTR)HeapAlloc(hDllHeap, 0, psd->cch + 1);
-		mir_strncpy(psd->szText, lParam->ipch->MRUMenuName, sizeof(lParam->ipch->MRUMenuName) - 1);
+		lstrcpynA(psd->szText, lParam->ipch->MRUMenuName, sizeof(lParam->ipch->MRUMenuName) - 1);
 
 		mii.dwItemData = (LPARAM)psd;
 		if (lParam->bOwnerDrawSupported && lParam->bShouldOwnerDraw) {
@@ -486,13 +486,13 @@ static void BuildMenus(TEnumData *lParam)
 	psd = (TMenuDrawInfo*)HeapAlloc(hDllHeap, 0, sizeof(TMenuDrawInfo));
 	psd->cch = (int)strlen(lParam->ipch->MirandaName);
 	psd->szText = (LPSTR)HeapAlloc(hDllHeap, 0, psd->cch + 1);
-	mir_strncpy(psd->szText, lParam->ipch->MirandaName, sizeof(lParam->ipch->MirandaName) - 1);
+	lstrcpynA(psd->szText, lParam->ipch->MirandaName, sizeof(lParam->ipch->MirandaName) - 1);
 	// there may not be a profile name
 	pg = lParam->ipch->DataPtr;
 	psd->szProfile = NULL;
 	if (pg != NULL && pg->Status == STATUS_PROFILENAME) {
 		psd->szProfile = (LPSTR)HeapAlloc(hDllHeap, 0, pg->cbStrSection);
-		mir_strcpy(psd->szProfile, LPSTR(UINT_PTR(pg) + sizeof(TSlotIPC)));
+		lstrcpyA(psd->szProfile, LPSTR(UINT_PTR(pg) + sizeof(TSlotIPC)));
 	}
 
 	// owner draw menus need ID's
@@ -585,7 +585,7 @@ BOOL __stdcall ProcessRequest(HWND hwnd, LPARAM param)
 		hMirandaWorkEvent = OpenEventA(EVENT_ALL_ACCESS, false, CreateProcessUID(pid, szBuf, sizeof(szBuf)));
 		if (hMirandaWorkEvent != 0) {
 			GetClassNameA(hwnd, szBuf, sizeof(szBuf));
-			if ( mir_strcmp(szBuf, MIRANDACLASS) != 0) {
+			if ( lstrcmpA(szBuf, MIRANDACLASS) != 0) {
 				// opened but not valid.
 				logA("ProcessRequest(%d, %p): class %s differs from %s\n", pid, hwnd, szBuf, MIRANDACLASS);
 				CloseHandle(hMirandaWorkEvent);
@@ -771,7 +771,7 @@ HRESULT RequestTransfer(TShellExt *Self, int idxCmd)
 				THeaderIPC *pipch = (THeaderIPC*)MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, 0);
 				if (pipch != NULL) {
 					// create the name of the object to be signalled by the ST
-					mir_strcpy(pipch->SignalEventName, CreateUID(szBuf, sizeof(szBuf)));
+					lstrcpyA(pipch->SignalEventName, CreateUID(szBuf, sizeof(szBuf)));
 					// create it
 					HANDLE hReply = CreateEventA(NULL, false, false, pipch->SignalEventName);
 					if (hReply != 0) {
@@ -868,7 +868,7 @@ HRESULT TShellExt::HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESU
 				GetTextExtentPoint32A(dwi->hDC, psd->szText, psd->cch, &tS);
 				dwi->rcItem.left += tS.cx + 8;
 				SetTextColor(dwi->hDC, GetSysColor(COLOR_GRAYTEXT));
-				DrawTextA(dwi->hDC, psd->szProfile, mir_strlen(psd->szProfile), &dwi->rcItem, DT_NOCLIP | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
+				DrawTextA(dwi->hDC, psd->szProfile, lstrlenA(psd->szProfile), &dwi->rcItem, DT_NOCLIP | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
 			}
 		}
 		else {
@@ -914,7 +914,7 @@ HRESULT TShellExt::HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESU
 		dx += tS.cx;
 		// main menu item?
 		if (psd->szProfile != NULL) {
-			GetTextExtentPoint32A(hMemDC, psd->szProfile, mir_strlen(psd->szProfile), &tS);
+			GetTextExtentPoint32A(hMemDC, psd->szProfile, lstrlenA(psd->szProfile), &tS);
 			dx += tS.cx;
 		}
 		// store it
diff --git a/plugins/ShellExt/src/utils.cpp b/plugins/ShellExt/src/utils.cpp
index 1a71ca3fe8..22e033fb42 100644
--- a/plugins/ShellExt/src/utils.cpp
+++ b/plugins/ShellExt/src/utils.cpp
@@ -20,7 +20,7 @@ void logA(const char *format, ...)
 
 UINT murmur_hash(const char *str)
 {
-	size_t len = mir_strlen(str);
+	size_t len = lstrlenA(str);
 
 	// 'm' and 'r' are mixing constants generated offline.
 	// They're not really 'magic', they just happen to work well.
-- 
cgit v1.2.3