diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-24 07:36:34 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-24 07:36:34 +0000 |
commit | ce236a1ca3574f230c150dff3a5bdd447e868ea5 (patch) | |
tree | fbc193a408459fa8484682cbfa63dd11d303ec61 /plugins/ShellExt | |
parent | 1009b191e21576836f4e759ce332a41ec0e077bf (diff) |
- correct COM expors
- various fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@5804 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ShellExt')
-rw-r--r-- | plugins/ShellExt/shellext_10.vcxproj | 10 | ||||
-rw-r--r-- | plugins/ShellExt/shellext_11.vcxproj | 24 | ||||
-rw-r--r-- | plugins/ShellExt/src/ShellExt.def | 7 | ||||
-rw-r--r-- | plugins/ShellExt/src/Version.h | 3 | ||||
-rw-r--r-- | plugins/ShellExt/src/main.cpp | 7 | ||||
-rw-r--r-- | plugins/ShellExt/src/options.cpp | 2 | ||||
-rw-r--r-- | plugins/ShellExt/src/shlcom.cpp | 7 |
7 files changed, 33 insertions, 27 deletions
diff --git a/plugins/ShellExt/shellext_10.vcxproj b/plugins/ShellExt/shellext_10.vcxproj index 830c94747e..fb5ad4ccb5 100644 --- a/plugins/ShellExt/shellext_10.vcxproj +++ b/plugins/ShellExt/shellext_10.vcxproj @@ -19,7 +19,7 @@ </ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
- <ProjectName>ShellExt</ProjectName>
+ <ProjectName>ShlExt</ProjectName>
<ProjectGuid>{B27B85B5-0EF1-496D-99D7-0702A98A342A}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -91,7 +91,6 @@ <LinkDLL>true</LinkDLL>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
- <BaseAddress>0x30040000</BaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -99,6 +98,7 @@ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
<DelayLoadDLLs>mir_core.dll</DelayLoadDLLs>
+ <ModuleDefinitionFile>src\ShellExt.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -123,11 +123,11 @@ <LinkDLL>true</LinkDLL>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
- <BaseAddress>0x30040000</BaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
<DelayLoadDLLs>mir_core.dll</DelayLoadDLLs>
+ <ModuleDefinitionFile>src\ShellExt.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -151,12 +151,12 @@ <LinkDLL>true</LinkDLL>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
- <BaseAddress>0x30040000</BaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
<DelayLoadDLLs>mir_core.dll</DelayLoadDLLs>
+ <ModuleDefinitionFile>src\ShellExt.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -179,11 +179,11 @@ <LinkDLL>true</LinkDLL>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
- <BaseAddress>0x30040000</BaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
<DelayLoadDLLs>mir_core.dll</DelayLoadDLLs>
+ <ModuleDefinitionFile>src\ShellExt.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
diff --git a/plugins/ShellExt/shellext_11.vcxproj b/plugins/ShellExt/shellext_11.vcxproj index f34657320e..8b133f32fc 100644 --- a/plugins/ShellExt/shellext_11.vcxproj +++ b/plugins/ShellExt/shellext_11.vcxproj @@ -95,13 +95,13 @@ <LinkDLL>true</LinkDLL>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
- <BaseAddress>0x30040000</BaseAddress>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
<DelayLoadDLLs>mir_core.dll</DelayLoadDLLs>
+ <ModuleDefinitionFile>src\ShellExt.def</ModuleDefinitionFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -126,12 +126,12 @@ <LinkDLL>true</LinkDLL>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
- <BaseAddress>0x30040000</BaseAddress>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<DelayLoadDLLs>mir_core.dll</DelayLoadDLLs>
+ <ModuleDefinitionFile>src\ShellExt.def</ModuleDefinitionFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -155,11 +155,11 @@ <LinkDLL>true</LinkDLL>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
- <BaseAddress>0x30040000</BaseAddress>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
<DelayLoadDLLs>mir_core.dll</DelayLoadDLLs>
+ <ModuleDefinitionFile>src\ShellExt.def</ModuleDefinitionFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -182,11 +182,11 @@ <LinkDLL>true</LinkDLL>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
- <BaseAddress>0x30040000</BaseAddress>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
<DelayLoadDLLs>mir_core.dll</DelayLoadDLLs>
+ <ModuleDefinitionFile>src\ShellExt.def</ModuleDefinitionFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
diff --git a/plugins/ShellExt/src/ShellExt.def b/plugins/ShellExt/src/ShellExt.def new file mode 100644 index 0000000000..e867b9b540 --- /dev/null +++ b/plugins/ShellExt/src/ShellExt.def @@ -0,0 +1,7 @@ +LIBRARY ShlExt
+
+EXPORTS
+DllCanUnloadNow PRIVATE
+DllGetClassObject PRIVATE
+DllRegisterServer PRIVATE
+DllUnregisterServer PRIVATE
diff --git a/plugins/ShellExt/src/Version.h b/plugins/ShellExt/src/Version.h index 89aa117923..c2f1323bba 100644 --- a/plugins/ShellExt/src/Version.h +++ b/plugins/ShellExt/src/Version.h @@ -6,9 +6,6 @@ #define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
-#define __STRINGIFY(x) #x
-#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS)
-
#define __PLUGIN_NAME "ShlExt"
#define __FILENAME "ShlExt.dll"
#define __DESCRIPTION "Windows Explorer extension for Miranda NG."
diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp index 1791fc99f8..2dea9412ed 100644 --- a/plugins/ShellExt/src/main.cpp +++ b/plugins/ShellExt/src/main.cpp @@ -48,15 +48,16 @@ private: HKEY m_key;
};
-char str1[] = "shlext " __VERSION_STRING " - shell context menu support for Miranda NG";
+char str1[100];
char str2[] = "{72013A26-A94C-11d6-8540-A5E62932711D}";
char str3[] = "miranda.shlext";
char str4[] = "Apartment";
TCHAR key1[] = _T("miranda.shlext\\{72013A26-A94C-11d6-8540-A5E62932711D}\\InprocServer32");
-HRESULT __stdcall DllRegisterServer()
+STDAPI DllRegisterServer()
{
+ sprintf_s(str1, sizeof(str1), "shlext %d.%d.%d.%d - shell context menu support for Miranda NG", __FILEVERSION_STRING);
if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext", REG_SZ, str1, sizeof(str1)))
return E_FAIL;
if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext\\CLSID", REG_SZ, str2, sizeof(str2)))
@@ -91,7 +92,7 @@ HRESULT __stdcall DllRegisterServer() return S_OK;
}
-HRESULT __stdcall DllUnregisterServer()
+STDAPI DllUnregisterServer()
{
return RemoveCOMRegistryEntries();
}
diff --git a/plugins/ShellExt/src/options.cpp b/plugins/ShellExt/src/options.cpp index 05f71ab039..1e92422fcb 100644 --- a/plugins/ShellExt/src/options.cpp +++ b/plugins/ShellExt/src/options.cpp @@ -25,7 +25,7 @@ static TCHAR* COM_OKSTR[2] = { LPGENT("Successfully created shell registration.") };
static TCHAR* COM_APPROVEDSTR[2] = { LPGENT("Not Approved"), LPGENT("Approved") };
-static LRESULT CALLBACK OptDialogProc(HWND hwndDlg, UINT wMsg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK OptDialogProc(HWND hwndDlg, UINT wMsg, WPARAM wParam, LPARAM lParam)
{
int comReg, iCheck;
TCHAR szBuf[MAX_PATH];
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index fbbf299894..11c6616116 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -1508,11 +1508,12 @@ void InvokeThreadServer() const IID CLSID_ISHLCOM = { 0x72013A26, 0xA94C, 0x11d6, {0x85, 0x40, 0xA5, 0xE6, 0x29, 0x32, 0x71, 0x1D }};
-HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
+STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
+ MessageBoxA(0, "Ding!", "Dong", MB_OK);
+
if (rclsid == CLSID_ISHLCOM && riid == IID_IClassFactory && FindWindowA(MIRANDANAME, NULL) != 0) {
*ppv = new TClassFactoryRec();
- MessageBoxA(0, "Ding!", "Dong", MB_OK);
return S_OK;
}
@@ -1520,7 +1521,7 @@ HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) return CLASS_E_CLASSNOTAVAILABLE;
}
-HRESULT DllCanUnloadNow()
+STDAPI DllCanUnloadNow()
{
if (dllobject.FactoryCount == 0 && dllobject.ObjectCount == 0)
return S_OK;
|