From 7d8e2f768d10fbf9e82c8748e34380eec0dce366 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 20 Jun 2015 08:34:46 +0000 Subject: unified project for ShellExt git-svn-id: http://svn.miranda-ng.org/main/trunk@14281 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ShellExt/shellext.vcxproj | 35 +++++ plugins/ShellExt/shellext.vcxproj.filters | 4 + plugins/ShellExt/shellext_10.vcxproj | 216 -------------------------- plugins/ShellExt/shellext_10.vcxproj.filters | 71 --------- plugins/ShellExt/shellext_12.vcxproj | 219 --------------------------- plugins/ShellExt/shellext_12.vcxproj.filters | 71 --------- plugins/ShellExt/src/main.cpp | 4 +- plugins/ShellExt/src/shlcom.cpp | 9 +- plugins/ShellExt/src/shlcom.h | 7 +- plugins/ShellExt/src/shlext.cpp | 15 +- plugins/ShellExt/src/shlipc.cpp | 2 +- plugins/ShellExt/src/stdafx.cpp | 18 --- plugins/ShellExt/src/stdafx.cxx | 18 +++ plugins/ShellExt/src/stdafx.h | 1 - 14 files changed, 74 insertions(+), 616 deletions(-) create mode 100644 plugins/ShellExt/shellext.vcxproj create mode 100644 plugins/ShellExt/shellext.vcxproj.filters delete mode 100644 plugins/ShellExt/shellext_10.vcxproj delete mode 100644 plugins/ShellExt/shellext_10.vcxproj.filters delete mode 100644 plugins/ShellExt/shellext_12.vcxproj delete mode 100644 plugins/ShellExt/shellext_12.vcxproj.filters delete mode 100644 plugins/ShellExt/src/stdafx.cpp create mode 100644 plugins/ShellExt/src/stdafx.cxx (limited to 'plugins') diff --git a/plugins/ShellExt/shellext.vcxproj b/plugins/ShellExt/shellext.vcxproj new file mode 100644 index 0000000000..48ae786488 --- /dev/null +++ b/plugins/ShellExt/shellext.vcxproj @@ -0,0 +1,35 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + ShlExt + {B27B85B5-0EF1-496D-99D7-0702A98A342A} + + + + + + + delayimp.lib;%(AdditionalDependencies) + mir_core.mir + src/ShellExt.def + + + \ No newline at end of file diff --git a/plugins/ShellExt/shellext.vcxproj.filters b/plugins/ShellExt/shellext.vcxproj.filters new file mode 100644 index 0000000000..de5ad9f66c --- /dev/null +++ b/plugins/ShellExt/shellext.vcxproj.filters @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/plugins/ShellExt/shellext_10.vcxproj b/plugins/ShellExt/shellext_10.vcxproj deleted file mode 100644 index cdee58eb8c..0000000000 --- a/plugins/ShellExt/shellext_10.vcxproj +++ /dev/null @@ -1,216 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - ShlExt - {B27B85B5-0EF1-496D-99D7-0702A98A342A} - - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - false - Full - Level3 - true - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - OnlyExplicitInline - false - Size - stdafx.h - Use - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\include\msapi - - - true - true - Windows - true - true - $(ProfileDir)..\..\bin10\lib - /PDBALTPATH:%_PDB% - src\ShellExt.def - false - $(IntDir)$(TargetName).lib - mir_core.dll - - - - - MultiThreadedDebugDLL - false - Disabled - Level3 - true - EditAndContinue - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - EnableFastChecks - stdafx.h - Use - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include\msapi - - - true - true - Windows - $(ProfileDir)..\..\bin10\lib - src\ShellExt.def - false - $(IntDir)$(TargetName).lib - mir_core.dll - - - - - false - Full - Level3 - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - Default - OnlyExplicitInline - Size - stdafx.h - Use - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\include\msapi - - - true - true - Windows - $(ProfileDir)..\..\bin10\lib - /PDBALTPATH:%_PDB% - src\ShellExt.def - false - $(IntDir)$(TargetName).lib - mir_core.dll - - - - - MultiThreadedDebugDLL - false - Disabled - Level3 - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - EnableFastChecks - stdafx.h - Use - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include\msapi - - - true - true - Windows - $(ProfileDir)..\..\bin10\lib - src\ShellExt.def - false - $(IntDir)$(TargetName).lib - mir_core.dll - - - - - - - - - - - - - - - - - - - - - - - Create - - - - - - - \ No newline at end of file diff --git a/plugins/ShellExt/shellext_10.vcxproj.filters b/plugins/ShellExt/shellext_10.vcxproj.filters deleted file mode 100644 index e2d1e58a0c..0000000000 --- a/plugins/ShellExt/shellext_10.vcxproj.filters +++ /dev/null @@ -1,71 +0,0 @@ - - - - - {08a21636-368d-4feb-8d0d-0a27f237e1a2} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {9e6f20dc-3391-4299-9f74-e91d4f984ad3} - h;hpp;hxx;hm;inl - - - {18fd6180-ebb2-4558-b945-c4dac823f11b} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/plugins/ShellExt/shellext_12.vcxproj b/plugins/ShellExt/shellext_12.vcxproj deleted file mode 100644 index a1830aaed9..0000000000 --- a/plugins/ShellExt/shellext_12.vcxproj +++ /dev/null @@ -1,219 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - ShlExt - {B27B85B5-0EF1-496D-99D7-0702A98A342A} - - - - DynamicLibrary - Unicode - true - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - DynamicLibrary - Unicode - true - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - false - Full - Level3 - true - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - OnlyExplicitInline - false - Size - stdafx.h - Use - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\include\msapi - - - true - true - Windows - true - true - $(ProfileDir)..\..\bin12\lib - src\ShellExt.def - false - $(IntDir)$(TargetName).lib - mir_core.dll - - - - - MultiThreadedDebugDLL - false - Disabled - Level3 - true - EditAndContinue - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - EnableFastChecks - stdafx.h - Use - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include\msapi - - - true - true - Windows - $(ProfileDir)..\..\bin12\lib - false - src\ShellExt.def - false - $(IntDir)$(TargetName).lib - mir_core.dll - - - - - false - Full - Level3 - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - Default - OnlyExplicitInline - Size - stdafx.h - Use - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\include\msapi - - - true - true - Windows - $(ProfileDir)..\..\bin12\lib - src\ShellExt.def - false - $(IntDir)$(TargetName).lib - mir_core.dll - - - - - MultiThreadedDebugDLL - false - Disabled - Level3 - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - EnableFastChecks - stdafx.h - Use - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include\msapi - - - true - true - Windows - $(ProfileDir)..\..\bin12\lib - src\ShellExt.def - false - $(IntDir)$(TargetName).lib - mir_core.dll - - - - - - - - - - - - - - - - - - - - - - - Create - - - - - - - \ No newline at end of file diff --git a/plugins/ShellExt/shellext_12.vcxproj.filters b/plugins/ShellExt/shellext_12.vcxproj.filters deleted file mode 100644 index e2d1e58a0c..0000000000 --- a/plugins/ShellExt/shellext_12.vcxproj.filters +++ /dev/null @@ -1,71 +0,0 @@ - - - - - {08a21636-368d-4feb-8d0d-0a27f237e1a2} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {9e6f20dc-3391-4299-9f74-e91d4f984ad3} - h;hpp;hxx;hm;inl - - - {18fd6180-ebb2-4558-b945-c4dac823f11b} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp index 10e018ae3e..c71028a40d 100644 --- a/plugins/ShellExt/src/main.cpp +++ b/plugins/ShellExt/src/main.cpp @@ -21,7 +21,7 @@ PLUGININFOEX pluginInfoEx = { {0x7993ab24, 0x1fda, 0x428c, {0xa8, 0x9b, 0xbe, 0x37, 0x7a, 0x10, 0xbe, 0x3a}} }; -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID) { if (fdwReason == DLL_PROCESS_ATTACH) { bIsVistaPlus = GetProcAddress( GetModuleHandleA("kernel32.dll"), "GetProductInfo") != NULL; @@ -36,7 +36,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE; } -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfoEx; } diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index fe15398aee..0ace778b30 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -235,7 +235,6 @@ void ipcGetSkinIcons(THeaderIPC *ipch) bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode) { - bool Result = false; // hide offliners? bool bHideOffline = db_get_b(0, "CList", "HideOffline", 0) == 1; // do they wanna hide the offline people anyway? @@ -356,10 +355,9 @@ void __cdecl ClearMRUThread(void*) } // this function is called from an APC into the main thread -void __stdcall ipcService(ULONG_PTR dwParam) +void __stdcall ipcService(ULONG_PTR) { HANDLE hSignal; - TSlotIPC *pct; LPSTR szBuf; char szGroupStr[32]; DBVARIANT dbv; @@ -384,7 +382,7 @@ void __stdcall ipcService(ULONG_PTR dwParam) pMMT->pServerBaseAddress = pMMT->pClientBaseAddress; pMMT->pClientBaseAddress = cloned; memcpy(cloned, pMMT, IPC_PACKET_SIZE); - ipcFixupAddresses(true, cloned); + ipcFixupAddresses(cloned); DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &cloned->Param, THREAD_SET_CONTEXT, false, 0); mir_forkthread(&IssueTransferThread, cloned); goto Reply; @@ -402,7 +400,7 @@ void __stdcall ipcService(ULONG_PTR dwParam) pMMT->pServerBaseAddress = pMMT->pClientBaseAddress; pMMT->pClientBaseAddress = pMMT; // translate to the server space map - ipcFixupAddresses(true, pMMT); + ipcFixupAddresses(pMMT); // store the address map offset so the caller can retranslate pMMT->pServerBaseAddress = pMMT; // return some options to the client @@ -426,6 +424,7 @@ void __stdcall ipcService(ULONG_PTR dwParam) if (bGroupMode && BST_CHECKED == db_get_b(0, SHLExt_Name, SHLExt_UseCListSetting, BST_UNCHECKED)) bGroupMode = db_get_b(0, "CList", "UseGroups", true) != 0; + TSlotIPC *pct = NULL; int iSlot = 0; // return profile if set if (BST_UNCHECKED == db_get_b(0, SHLExt_Name, SHLExt_ShowNoProfile, BST_UNCHECKED)) { diff --git a/plugins/ShellExt/src/shlcom.h b/plugins/ShellExt/src/shlcom.h index c5adf538a2..1fc9b44f1e 100644 --- a/plugins/ShellExt/src/shlcom.h +++ b/plugins/ShellExt/src/shlcom.h @@ -198,14 +198,13 @@ typedef int TSlotDrawTypes; typedef int (__stdcall TMenuCommandCallback)( THeaderIPC *pipch, // IPC header info, already mapped HANDLE hWorkThreadEvent, // event object being waited on on miranda thread - HANDLE hAckEvent, // ack event object that has been created - struct TMenuDrawInfo *psd); // command/draw info + HANDLE hAckEvent); // ack event object that has been created struct TMenuDrawInfo { char *szText, *szProfile; int cch; - int wID; // should be the same as the menu item's ID + UINT wID; TSlotDrawTypes fTypes; MCONTACT hContact; HICON hStatusIcon; // HICON from Self->ProtoIcons[index].hIcons[status]; Do not DestroyIcon() @@ -219,7 +218,7 @@ struct TMenuDrawInfo void ipcPrepareRequests(int ipcPacketSize, THeaderIPC *pipch, DWORD fRequests); DWORD ipcSendRequest(HANDLE hSignal, HANDLE hWaitFor, THeaderIPC *pipch, DWORD dwTimeoutMsecs); TSlotIPC* ipcAlloc(THeaderIPC *pipch, int nSize); -void ipcFixupAddresses(BOOL FromServer, THeaderIPC *pipch); +void ipcFixupAddresses(THeaderIPC *pipch); TGroupNode* AllocGroupNode(TGroupNodeList *list, TGroupNode *Root, int Depth); TGroupNode* FindGroupNode(TGroupNode* p, const DWORD Hash, int Depth); diff --git a/plugins/ShellExt/src/shlext.cpp b/plugins/ShellExt/src/shlext.cpp index 977232ba19..780d7f86e3 100644 --- a/plugins/ShellExt/src/shlext.cpp +++ b/plugins/ShellExt/src/shlext.cpp @@ -110,7 +110,7 @@ ULONG TShellExt::Release() return ret; } -HRESULT TShellExt::Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID) +HRESULT TShellExt::Initialize(PCIDLIST_ABSOLUTE, IDataObject *pdtobj, HKEY) { // DObj is a pointer to an instance of IDataObject which is a pointer itself // it contains a pointer to a function table containing the function pointer @@ -129,7 +129,7 @@ HRESULT TShellExt::Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, return S_OK; } -HRESULT TShellExt::GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pReserved, LPSTR pszName, UINT cchMax) +HRESULT TShellExt::GetCommandString(UINT_PTR, UINT, UINT*, LPSTR, UINT) { return E_NOTIMPL; } @@ -226,8 +226,7 @@ void DecideMenuItemInfo(TSlotIPC *pct, TGroupNode *pg, MENUITEMINFOA &mii, TEnum int __stdcall ClearMRUIPC( THeaderIPC *pipch, // IPC header info, already mapped HANDLE hWorkThreadEvent, // event object being waited on on miranda thread - HANDLE hAckEvent, // ack event object that has been created - TMenuDrawInfo *psd) // command/draw info + HANDLE hAckEvent) // ack event object that has been created { ipcPrepareRequests(IPC_PACKET_SIZE, pipch, REQUEST_CLEARMRU); ipcSendRequest(hWorkThreadEvent, hAckEvent, pipch, 100); @@ -276,7 +275,7 @@ void BuildContactTree(TGroupNode *group, TEnumData *lParam) char *sz = strtok(LPSTR(UINT_PTR(pct) + sizeof(TSlotIPC) + UINT_PTR(pct->cbStrSection) + 1), "\\"); // restore the root TGroupNode *pg = group; - unsigned Depth = 0; + int Depth = 0; while (sz != NULL) { UINT Hash = murmur_hash(sz); // find this node within @@ -605,7 +604,7 @@ BOOL __stdcall ProcessRequest(HWND hwnd, LPARAM param) lParam->ipch->pClientBaseAddress = lParam->ipch; // fixup all the pointers to be relative to the memory map // the base pointer of the client side version of the mapped file - ipcFixupAddresses(false, lParam->ipch); + ipcFixupAddresses(lParam->ipch); // store the PID used to create the work event object // that got replied to -- this is needed since each contact // on the final menu maybe on a different instance and another OpenEvent() will be needed. @@ -653,7 +652,7 @@ HRESULT TShellExt::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT _idCmdFirs HANDLE hMap = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, IPC_PACKET_SIZE, IPC_PACKET_NAME); if (hMap != 0 && GetLastError() != ERROR_ALREADY_EXISTS) { - TEnumData ed; + TEnumData ed = { 0 }; // map the memory to this address space THeaderIPC *pipch = (THeaderIPC*)MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, 0); if (pipch != NULL) { @@ -771,7 +770,7 @@ HRESULT RequestTransfer(TShellExt *Self, int idxCmd) if (hReply != 0) { if (psd->fTypes & dtCommand) { if (psd->MenuCommandCallback) - hr = psd->MenuCommandCallback(pipch, hTransfer, hReply, psd); + hr = psd->MenuCommandCallback(pipch, hTransfer, hReply); } else { // prepare the buffer diff --git a/plugins/ShellExt/src/shlipc.cpp b/plugins/ShellExt/src/shlipc.cpp index eda0729a7a..41a195af77 100644 --- a/plugins/ShellExt/src/shlipc.cpp +++ b/plugins/ShellExt/src/shlipc.cpp @@ -107,7 +107,7 @@ TSlotIPC* ipcAlloc(THeaderIPC *pipch, int nSize) return p; } -void ipcFixupAddresses(BOOL FromServer, THeaderIPC *pipch) +void ipcFixupAddresses(THeaderIPC *pipch) { if (pipch->pServerBaseAddress == pipch->pClientBaseAddress) return; diff --git a/plugins/ShellExt/src/stdafx.cpp b/plugins/ShellExt/src/stdafx.cpp deleted file mode 100644 index 6fb37564b7..0000000000 --- a/plugins/ShellExt/src/stdafx.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright (C) 2012-15 Miranda NG project (http://miranda-ng.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation version 2 -of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdafx.h" \ No newline at end of file diff --git a/plugins/ShellExt/src/stdafx.cxx b/plugins/ShellExt/src/stdafx.cxx new file mode 100644 index 0000000000..6fb37564b7 --- /dev/null +++ b/plugins/ShellExt/src/stdafx.cxx @@ -0,0 +1,18 @@ +/* +Copyright (C) 2012-15 Miranda NG project (http://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "stdafx.h" \ No newline at end of file diff --git a/plugins/ShellExt/src/stdafx.h b/plugins/ShellExt/src/stdafx.h index 83fc655a65..743de5fee4 100644 --- a/plugins/ShellExt/src/stdafx.h +++ b/plugins/ShellExt/src/stdafx.h @@ -1,4 +1,3 @@ -#define _CRT_SECURE_NO_WARNINGS #include #include -- cgit v1.2.3