From 74ca49020e2f382437337f166711ea87556865bd Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 19 Jan 2019 20:31:52 -0600 Subject: Integrate into latest v4. --- src/ca/custommsierrors.h | 4 +++ src/ca/dllmain.cpp | 26 ++++++++++++++++++ src/ca/mqexec.cpp | 38 ++++++-------------------- src/ca/mqqueueexec.cpp | 4 +-- src/ca/mqqueueexec.h | 4 +-- src/ca/mqqueuesched.cpp | 4 +-- src/ca/mqqueuesched.h | 4 +-- src/ca/mqsched.cpp | 31 +++------------------ src/ca/msmqca.def | 12 ++++++++ src/ca/msmqca.vcxproj | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ src/ca/packages.config | 5 ++++ src/ca/precomp.h | 23 ++++++++++++++++ 12 files changed, 161 insertions(+), 65 deletions(-) create mode 100644 src/ca/custommsierrors.h create mode 100644 src/ca/dllmain.cpp create mode 100644 src/ca/msmqca.def create mode 100644 src/ca/msmqca.vcxproj create mode 100644 src/ca/packages.config create mode 100644 src/ca/precomp.h (limited to 'src/ca') diff --git a/src/ca/custommsierrors.h b/src/ca/custommsierrors.h new file mode 100644 index 00000000..0c1b23b7 --- /dev/null +++ b/src/ca/custommsierrors.h @@ -0,0 +1,4 @@ +#pragma once +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#define msierrMsmqCannotConnect 28101 diff --git a/src/ca/dllmain.cpp b/src/ca/dllmain.cpp new file mode 100644 index 00000000..35ae6d1c --- /dev/null +++ b/src/ca/dllmain.cpp @@ -0,0 +1,26 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include "precomp.h" + +/******************************************************************** +DllMain - standard entry point for all WiX custom actions + +********************************************************************/ +extern "C" BOOL WINAPI DllMain( + IN HINSTANCE hInst, + IN ULONG ulReason, + IN LPVOID) +{ + switch(ulReason) + { + case DLL_PROCESS_ATTACH: + WcaGlobalInitialize(hInst); + break; + + case DLL_PROCESS_DETACH: + WcaGlobalFinalize(); + break; + } + + return TRUE; +} diff --git a/src/ca/mqexec.cpp b/src/ca/mqexec.cpp index bac54f31..ff7e9b14 100644 --- a/src/ca/mqexec.cpp +++ b/src/ca/mqexec.cpp @@ -2,28 +2,6 @@ #include "precomp.h" -/******************************************************************** - DllMain - standard entry point for all WiX CustomActions - -********************************************************************/ -extern "C" BOOL WINAPI DllMain( - IN HINSTANCE hInst, - IN ULONG ulReason, - IN LPVOID) -{ - switch(ulReason) - { - case DLL_PROCESS_ATTACH: - WcaGlobalInitialize(hInst); - break; - - case DLL_PROCESS_DETACH: - WcaGlobalFinalize(); - break; - } - - return TRUE; -} /******************************************************************** MessageQueuingExecuteInstall - CUSTOM ACTION ENTRY POINT @@ -42,7 +20,7 @@ extern "C" UINT __stdcall MessageQueuingExecuteInstall(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "MessageQueuingExecuteInstall"); ExitOnFailure(hr, "Failed to initialize MessageQueuingExecuteInstall"); - hr = MqiInitialize(); + hr = MqiExecInitialize(); ExitOnFailure(hr, "Failed to initialize"); // get custom action data @@ -67,7 +45,7 @@ LExit: ReleaseStr(pwzCustomActionData); // uninitialize - MqiUninitialize(); + MqiExecUninitialize(); er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; return WcaFinalize(er); @@ -90,7 +68,7 @@ extern "C" UINT __stdcall MessageQueuingRollbackInstall(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "MessageQueuingRollbackInstall"); ExitOnFailure(hr, "Failed to initialize MessageQueuingRollbackInstall"); - hr = MqiInitialize(); + hr = MqiExecInitialize(); ExitOnFailure(hr, "Failed to initialize"); // get custom action data @@ -113,7 +91,7 @@ LExit: ReleaseStr(pwzCustomActionData); // uninitialize - MqiUninitialize(); + MqiExecUninitialize(); er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; return WcaFinalize(er); @@ -136,7 +114,7 @@ extern "C" UINT __stdcall MessageQueuingExecuteUninstall(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "MessageQueuingExecuteUninstall"); ExitOnFailure(hr, "Failed to initialize MessageQueuingExecuteUninstall"); - hr = MqiInitialize(); + hr = MqiExecInitialize(); ExitOnFailure(hr, "Failed to initialize"); // get custom action data @@ -161,7 +139,7 @@ LExit: ReleaseStr(pwzCustomActionData); // uninitialize - MqiUninitialize(); + MqiExecUninitialize(); er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; return WcaFinalize(er); @@ -184,7 +162,7 @@ extern "C" UINT __stdcall MessageQueuingRollbackUninstall(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "MessageQueuingRollbackUninstall"); ExitOnFailure(hr, "Failed to initialize MessageQueuingRollbackUninstall"); - hr = MqiInitialize(); + hr = MqiExecInitialize(); ExitOnFailure(hr, "Failed to initialize"); // get custom action data @@ -207,7 +185,7 @@ LExit: ReleaseStr(pwzCustomActionData); // uninitialize - MqiUninitialize(); + MqiExecUninitialize(); er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; return WcaFinalize(er); diff --git a/src/ca/mqqueueexec.cpp b/src/ca/mqqueueexec.cpp index f5b99da7..e4304ab8 100644 --- a/src/ca/mqqueueexec.cpp +++ b/src/ca/mqqueueexec.cpp @@ -119,7 +119,7 @@ static MQSetQueueSecurityFunc gpfnMQSetQueueSecurity; // function definitions -HRESULT MqiInitialize() +HRESULT MqiExecInitialize() { HRESULT hr = S_OK; @@ -153,7 +153,7 @@ LExit: return hr; } -void MqiUninitialize() +void MqiExecUninitialize() { if (ghMQRT) ::FreeLibrary(ghMQRT); diff --git a/src/ca/mqqueueexec.h b/src/ca/mqqueueexec.h index 37ceea50..76bc2023 100644 --- a/src/ca/mqqueueexec.h +++ b/src/ca/mqqueueexec.h @@ -2,8 +2,8 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -HRESULT MqiInitialize(); -void MqiUninitialize(); +HRESULT MqiExecInitialize(); +void MqiExecUninitialize(); HRESULT MqiCreateMessageQueues( LPWSTR* ppwzData ); diff --git a/src/ca/mqqueuesched.cpp b/src/ca/mqqueuesched.cpp index 4f40a4aa..01777ea4 100644 --- a/src/ca/mqqueuesched.cpp +++ b/src/ca/mqqueuesched.cpp @@ -51,7 +51,7 @@ static MQPathNameToFormatNameFunc gpfnMQPathNameToFormatName; // function definitions -HRESULT MqiInitialize() +HRESULT MqiSchedInitialize() { HRESULT hr = S_OK; @@ -72,7 +72,7 @@ LExit: return hr; } -void MqiUninitialize() +void MqiSchedUninitialize() { if (ghMQRT) { diff --git a/src/ca/mqqueuesched.h b/src/ca/mqqueuesched.h index b063ca28..c9381e0a 100644 --- a/src/ca/mqqueuesched.h +++ b/src/ca/mqqueuesched.h @@ -54,8 +54,8 @@ struct MQI_MESSAGE_QUEUE_PERMISSION_LIST // function prototypes -HRESULT MqiInitialize(); -void MqiUninitialize(); +HRESULT MqiSchedInitialize(); +void MqiSchedUninitialize(); HRESULT MqiMessageQueueRead( MQI_MESSAGE_QUEUE_LIST* pList ); diff --git a/src/ca/mqsched.cpp b/src/ca/mqsched.cpp index cefce853..4c994901 100644 --- a/src/ca/mqsched.cpp +++ b/src/ca/mqsched.cpp @@ -3,29 +3,6 @@ #include "precomp.h" -/******************************************************************** - DllMain - standard entry point for all WiX CustomActions - -********************************************************************/ -extern "C" BOOL WINAPI DllMain( - IN HINSTANCE hInst, - IN ULONG ulReason, - IN LPVOID) -{ - switch(ulReason) - { - case DLL_PROCESS_ATTACH: - WcaGlobalInitialize(hInst); - break; - - case DLL_PROCESS_DETACH: - WcaGlobalFinalize(); - break; - } - - return TRUE; -} - /******************************************************************** MessageQueuingInstall - CUSTOM ACTION ENTRY POINT for installing MSMQ message queues @@ -51,7 +28,7 @@ extern "C" UINT __stdcall MessageQueuingInstall(MSIHANDLE hInstall) do { - hr = MqiInitialize(); + hr = MqiSchedInitialize(); if (S_FALSE == hr) { WcaLog(LOGMSG_STANDARD, "Failed to load mqrt.dll."); @@ -118,7 +95,7 @@ LExit: ReleaseStr(pwzExecuteActionData); // uninitialize - MqiUninitialize(); + MqiSchedUninitialize(); er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; return WcaFinalize(er); @@ -150,7 +127,7 @@ extern "C" UINT __stdcall MessageQueuingUninstall(MSIHANDLE hInstall) do { - hr = MqiInitialize(); + hr = MqiSchedInitialize(); if (S_FALSE == hr) { WcaLog(LOGMSG_STANDARD, "Failed to load mqrt.dll."); @@ -212,7 +189,7 @@ LExit: ReleaseStr(pwzExecuteActionData); // uninitialize - MqiUninitialize(); + MqiSchedUninitialize(); er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; return WcaFinalize(er); diff --git a/src/ca/msmqca.def b/src/ca/msmqca.def new file mode 100644 index 00000000..4902858f --- /dev/null +++ b/src/ca/msmqca.def @@ -0,0 +1,12 @@ +; Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + + +LIBRARY "msmqca" + +EXPORTS + MessageQueuingInstall + MessageQueuingUninstall + MessageQueuingExecuteInstall + MessageQueuingRollbackInstall + MessageQueuingExecuteUninstall + MessageQueuingRollbackUninstall diff --git a/src/ca/msmqca.vcxproj b/src/ca/msmqca.vcxproj new file mode 100644 index 00000000..507a2f93 --- /dev/null +++ b/src/ca/msmqca.vcxproj @@ -0,0 +1,71 @@ + + + + + + + + + + Debug + Win32 + + + Release + Win32 + + + + + {CAD56A7E-342B-4324-9DCB-BCEB8F3BC80D} + DynamicLibrary + msmqca + v141 + Unicode + msmqca.def + WiX Toolset MSMQ CustomAction + + + + + + + msi.lib + + + + + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + diff --git a/src/ca/packages.config b/src/ca/packages.config new file mode 100644 index 00000000..b87f9ab4 --- /dev/null +++ b/src/ca/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/ca/precomp.h b/src/ca/precomp.h new file mode 100644 index 00000000..cbbff6ea --- /dev/null +++ b/src/ca/precomp.h @@ -0,0 +1,23 @@ +#pragma once +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + + +#include +#include +#include +#include +#include +#include + +#include "wcautil.h" +#include "memutil.h" +#include "strutil.h" +#include "wiutil.h" + +#include "CustomMsiErrors.h" + +#include "mqcost.h" +#include "mqutilsched.h" +#include "mqqueuesched.h" +#include "mqutilexec.h" +#include "mqqueueexec.h" -- cgit v1.2.3-55-g6feb