From 21ee7d08ffa59bccd1d5d56b3c66836f74afacb4 Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Thu, 30 Oct 2008 22:45:58 +0000 Subject: Add Windows pieces for building the broker; resolves QPID-1338 git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@709271 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 89 ++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 qpid/cpp/src/windows/QpiddBroker.cpp (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp new file mode 100644 index 0000000000..6714ac2e01 --- /dev/null +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -0,0 +1,89 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +#include "qpidd.h" +#include "qpid/Exception.h" +#include "qpid/Options.h" +#include "qpid/Plugin.h" +#include "qpid/sys/IntegerTypes.h" +#include "qpid/sys/windows/check.h" +#include "qpid/broker/Broker.h" + +#include + +// These need to be made something sensible, like reading a value from +// the registry. But for now, get things going with a local definition. +namespace { +const char *CONF_FILE = "qpid_broker.conf"; +const char *MODULE_DIR = "."; +} + +using namespace qpid::broker; + +BootstrapOptions::BootstrapOptions(const char* argv0) + : qpid::Options("Options"), + common("", CONF_FILE), + module(MODULE_DIR), + log(argv0) +{ + add(common); + add(module); + add(log); +} + +struct QpiddWindowsOptions : public QpiddOptionsPrivate { + QpiddWindowsOptions(QpiddOptions *parent) : QpiddOptionsPrivate(parent) { + } +}; + +QpiddOptions::QpiddOptions(const char* argv0) + : qpid::Options("Options"), + common("", CONF_FILE), + module(MODULE_DIR), + log(argv0) +{ + add(common); + add(module); + add(broker); + add(log); + + platform.reset(new QpiddWindowsOptions(this)); + qpid::Plugin::addOptions(*this); +} + +void QpiddOptions::usage() const { + std::cout << "Usage: qpidd [OPTIONS]" << std::endl << std::endl + << *this << std::endl; +} + +int QpiddBroker::execute (QpiddOptions *options) { + // Options that affect a running daemon. + QpiddWindowsOptions *myOptions = + reinterpret_cast(options->platform.get()); + if (myOptions == 0) + throw qpid::Exception("Internal error obtaining platform options"); + + boost::intrusive_ptr brokerPtr(new Broker(options->broker)); + if (options->broker.port == 0) + std::cout << (uint16_t)(brokerPtr->getPort("")) << std::endl; + brokerPtr->run(); + return 0; +} -- cgit v1.2.1 From 6579fef308adbd67eba30811abb4da7478031575 Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Thu, 23 Apr 2009 22:59:12 +0000 Subject: Merge in initial changes to allow building with CMake; rubygen and managementgen can now generate either .mk files or .cmake files as needed; CONF_FILE and MODULE_DIR macros now have broker/client counterparts QPIDD_CONF_FILE, QPIDD_MODULE_DIR, QPIDC_CONF_FILE, QPIDC_MODULE_DIR configurable by cmake git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@768085 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp index 6714ac2e01..8694cefb04 100644 --- a/qpid/cpp/src/windows/QpiddBroker.cpp +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -19,6 +19,16 @@ * */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#else +// These need to be made something sensible, like reading a value from +// the registry. But for now, get things going with a local definition. +namespace { +const char *QPIDD_CONF_FILE = "qpid_broker.conf"; +const char *QPIDD_MODULE_DIR = "."; +} +#endif #include "qpidd.h" #include "qpid/Exception.h" #include "qpid/Options.h" @@ -29,19 +39,12 @@ #include -// These need to be made something sensible, like reading a value from -// the registry. But for now, get things going with a local definition. -namespace { -const char *CONF_FILE = "qpid_broker.conf"; -const char *MODULE_DIR = "."; -} - using namespace qpid::broker; BootstrapOptions::BootstrapOptions(const char* argv0) : qpid::Options("Options"), - common("", CONF_FILE), - module(MODULE_DIR), + common("", QPIDD_CONF_FILE), + module(QPIDD_MODULE_DIR), log(argv0) { add(common); @@ -56,8 +59,8 @@ struct QpiddWindowsOptions : public QpiddOptionsPrivate { QpiddOptions::QpiddOptions(const char* argv0) : qpid::Options("Options"), - common("", CONF_FILE), - module(MODULE_DIR), + common("", QPIDD_CONF_FILE), + module(QPIDD_MODULE_DIR), log(argv0) { add(common); -- cgit v1.2.1 From f1a10508996a1082abcff51cdf4722f8443d2dbc Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Mon, 11 May 2009 22:26:49 +0000 Subject: Add --quit, --check for Windows; required fixing LockFile for Windows git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@773712 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 68 +++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp index 8694cefb04..ffc5f700af 100644 --- a/qpid/cpp/src/windows/QpiddBroker.cpp +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -34,6 +34,7 @@ const char *QPIDD_MODULE_DIR = "."; #include "qpid/Options.h" #include "qpid/Plugin.h" #include "qpid/sys/IntegerTypes.h" +#include "qpid/sys/LockFile.h" #include "qpid/sys/windows/check.h" #include "qpid/broker/Broker.h" @@ -52,8 +53,52 @@ BootstrapOptions::BootstrapOptions(const char* argv0) add(log); } +// Local functions to set and get the pid via a LockFile. +namespace { + +const std::string TCP = "tcp"; + +std::string brokerPidFile(std::string piddir, uint16_t port) +{ + std::ostringstream path; + path << piddir << "\\broker_" << port << ".pid"; + return path.str(); +} + +} + +struct ProcessControlOptions : public qpid::Options { + bool quit; + bool check; + std::string piddir; + //std::string transport; No transport options yet - TCP is it. + + ProcessControlOptions() + : qpid::Options("Process control options"), + quit(false), + check(false) //, transport(TCP) + { + char *tempDir = ::getenv("TEMP"); + + if (tempDir == 0) + piddir = "C:\\WINDOWS\\TEMP"; + else + piddir = tempDir; + piddir += "\\qpidd"; + + // Only have TCP for now, so don't need this... + // ("transport", optValue(transport, "TRANSPORT"), "The transport for which to return the port") + addOptions() + ("pid-dir", qpid::optValue(piddir, "DIR"), "Directory where port-specific PID file is stored") + ("check,c", qpid::optValue(check), "Prints the broker's process ID to stdout and returns 0 if the broker is running, otherwise returns 1") + ("quit,q", qpid::optValue(quit), "Tells the broker to shut down"); + } +}; + struct QpiddWindowsOptions : public QpiddOptionsPrivate { + ProcessControlOptions control; QpiddWindowsOptions(QpiddOptions *parent) : QpiddOptionsPrivate(parent) { + parent->add(control); } }; @@ -84,9 +129,30 @@ int QpiddBroker::execute (QpiddOptions *options) { if (myOptions == 0) throw qpid::Exception("Internal error obtaining platform options"); + if (myOptions->control.check || myOptions->control.quit) { + // Relies on port number being set via --port or QPID_PORT env variable. + qpid::sys::LockFile getPid (brokerPidFile(myOptions->control.piddir, + options->broker.port), + false); + pid_t pid = getPid.readPid(); + if (pid < 0) + return 1; + if (myOptions->control.check) + std::cout << pid << std::endl; + if (myOptions->control.quit) + std::cout << "Need to stop pid " << pid << std::endl; + return 0; + } + boost::intrusive_ptr brokerPtr(new Broker(options->broker)); if (options->broker.port == 0) - std::cout << (uint16_t)(brokerPtr->getPort("")) << std::endl; + options->broker.port = brokerPtr->getPort(""); + std::cout << options->broker.port << std::endl; + + qpid::sys::LockFile myPid(brokerPidFile(myOptions->control.piddir, + options->broker.port), + true); + myPid.writePid(); brokerPtr->run(); return 0; } -- cgit v1.2.1 From f70dff24efea53e11abcc977b970360670adbf3d Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Mon, 18 May 2009 22:21:29 +0000 Subject: Add --quit, --check, --pid-dir options to allow shutting down a broker from command line. Needed to run test suite. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@776116 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 86 +++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 2 deletions(-) (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp index ffc5f700af..ed38475811 100644 --- a/qpid/cpp/src/windows/QpiddBroker.cpp +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -65,6 +65,73 @@ std::string brokerPidFile(std::string piddir, uint16_t port) return path.str(); } +// ShutdownEvent maintains an event that can be used to ask the broker +// to stop. Analogous to sending SIGTERM/SIGINT to the posix broker. +// The signal() method signals the event. +class ShutdownEvent { + public: + ShutdownEvent(pid_t other = 0); + ~ShutdownEvent(); + + void signal(); + + protected: + std::string eventName(pid_t pid); + HANDLE event; +}; + +class ShutdownHandler : public ShutdownEvent, public qpid::sys::Runnable { + public: + ShutdownHandler(const boost::intrusive_ptr& b) + : ShutdownEvent() { broker = b; } + + private: + virtual void run(); // Inherited from Runnable + boost::intrusive_ptr broker; +}; + +ShutdownEvent::ShutdownEvent(pid_t other) : event(NULL) { + // If given a pid, open an event assumedly created by that pid. If there's + // no pid, create a new event using the current process id. + if (other == 0) { + std::string name = eventName(GetCurrentProcessId()); + // Auto-reset event in case multiple processes try to signal a + // broker that doesn't respond for some reason. Initially not signaled. + event = CreateEvent(NULL, false, false, name.c_str()); + } + else { + std::string name = eventName(other); + event = OpenEvent(EVENT_MODIFY_STATE, false, name.c_str()); + } + QPID_WINDOWS_CHECK_NULL(event); +} + +ShutdownEvent::~ShutdownEvent() { + CloseHandle(event); + event = NULL; +} + +void ShutdownEvent::signal() { + QPID_WINDOWS_CHECK_NOT(SetEvent(event), 0); +} + +std::string ShutdownEvent::eventName(pid_t pid) { + std::ostringstream name; + name << "qpidd_" << pid << std::ends; + return name.str(); +} + + +void ShutdownHandler::run() { + if (event == NULL) + return; + WaitForSingleObject(event, INFINITE); + if (broker.get()) { + broker->shutdown(); + broker = 0; // Release the broker reference + } +} + } struct ProcessControlOptions : public qpid::Options { @@ -139,8 +206,14 @@ int QpiddBroker::execute (QpiddOptions *options) { return 1; if (myOptions->control.check) std::cout << pid << std::endl; - if (myOptions->control.quit) - std::cout << "Need to stop pid " << pid << std::endl; + if (myOptions->control.quit) { + ShutdownEvent shutter(pid); + HANDLE brokerHandle = OpenProcess(SYNCHRONIZE, false, pid); + QPID_WINDOWS_CHECK_NULL(brokerHandle); + shutter.signal(); + WaitForSingleObject(brokerHandle, INFINITE); + CloseHandle(brokerHandle); + } return 0; } @@ -153,6 +226,15 @@ int QpiddBroker::execute (QpiddOptions *options) { options->broker.port), true); myPid.writePid(); + + // Allow the broker to receive a shutdown request via a qpidd --quit + // command. Note that when the broker is run as a service this operation + // should not be allowed. + + ShutdownHandler waitShut(brokerPtr); + qpid::sys::Thread waitThr(waitShut); // Wait for shutdown event brokerPtr->run(); + waitShut.signal(); // In case we shut down some other way + waitThr.join(); return 0; } -- cgit v1.2.1 From f05c689c4e638078bdd47d3b890b3db53db8dec4 Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Mon, 13 Jul 2009 21:27:14 +0000 Subject: Replace getenv usage with more secure Windows calls - silences compile diagnostics. This involved adding a new method Broker::Options::getHome() implemented separately for Windows and posix BrokerDefaults.cpp git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@793716 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp index ed38475811..a22ccba63f 100644 --- a/qpid/cpp/src/windows/QpiddBroker.cpp +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -39,6 +39,7 @@ const char *QPIDD_MODULE_DIR = "."; #include "qpid/broker/Broker.h" #include +#include using namespace qpid::broker; @@ -145,16 +146,16 @@ struct ProcessControlOptions : public qpid::Options { quit(false), check(false) //, transport(TCP) { - char *tempDir = ::getenv("TEMP"); - - if (tempDir == 0) - piddir = "C:\\WINDOWS\\TEMP"; + const DWORD pathLen = MAX_PATH + 1; + char tempDir[pathLen]; + if (GetTempPath(pathLen, tempDir) == 0) + piddir = "C:\\WINDOWS\\TEMP\\"; else piddir = tempDir; - piddir += "\\qpidd"; + piddir += "qpidd"; // Only have TCP for now, so don't need this... - // ("transport", optValue(transport, "TRANSPORT"), "The transport for which to return the port") + // ("transport", optValue(transport, "TRANSPORT"), "The transport for which to return the port") addOptions() ("pid-dir", qpid::optValue(piddir, "DIR"), "Directory where port-specific PID file is stored") ("check,c", qpid::optValue(check), "Prints the broker's process ID to stdout and returns 0 if the broker is running, otherwise returns 1") -- cgit v1.2.1 From ffd20ee19a5fd027e0007c27a12dd402dbeca4f8 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 14 Jul 2009 14:32:39 +0000 Subject: Add directory to #include git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@793909 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp index a22ccba63f..e80319146b 100644 --- a/qpid/cpp/src/windows/QpiddBroker.cpp +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -29,7 +29,7 @@ const char *QPIDD_CONF_FILE = "qpid_broker.conf"; const char *QPIDD_MODULE_DIR = "."; } #endif -#include "qpidd.h" +#include "windows/qpidd.h" #include "qpid/Exception.h" #include "qpid/Options.h" #include "qpid/Plugin.h" -- cgit v1.2.1 From 5ca8c0d404e85cbf9445b57ab155b5e16b034971 Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Thu, 16 Jul 2009 19:40:49 +0000 Subject: Correct qpidd.h header path git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@794806 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp index e80319146b..a22ccba63f 100644 --- a/qpid/cpp/src/windows/QpiddBroker.cpp +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -29,7 +29,7 @@ const char *QPIDD_CONF_FILE = "qpid_broker.conf"; const char *QPIDD_MODULE_DIR = "."; } #endif -#include "windows/qpidd.h" +#include "qpidd.h" #include "qpid/Exception.h" #include "qpid/Options.h" #include "qpid/Plugin.h" -- cgit v1.2.1 From 1da8e5a2a25e371d801b3cf10821a392695dea78 Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Wed, 5 Aug 2009 17:17:30 +0000 Subject: Try to create piddir if needed; on error throw a useful message. Fixes QPID-2030 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@801315 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp index a22ccba63f..5c6eef48f8 100644 --- a/qpid/cpp/src/windows/QpiddBroker.cpp +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -223,6 +223,17 @@ int QpiddBroker::execute (QpiddOptions *options) { options->broker.port = brokerPtr->getPort(""); std::cout << options->broker.port << std::endl; + // Make sure the pid directory exists, creating if needed. LockFile + // will throw an exception that makes little sense if it can't create + // the file. + if (!CreateDirectory(myOptions->control.piddir.c_str(), 0)) { + DWORD err = GetLastError(); + if (err != ERROR_ALREADY_EXISTS) + throw qpid::Exception(QPID_MSG("Can't create pid-dir " + + myOptions->control.piddir + + ": " + + qpid::sys::strError(err))); + } qpid::sys::LockFile myPid(brokerPidFile(myOptions->control.piddir, options->broker.port), true); -- cgit v1.2.1 From 50ab0b7208b7863230a6e1cbbeb7393e365e4dc5 Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Thu, 17 Sep 2009 19:37:35 +0000 Subject: Add console control handler to properly shut down broker on ^C et al; fixes QPID-2109 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@816348 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp index 5c6eef48f8..5bf9477e6a 100644 --- a/qpid/cpp/src/windows/QpiddBroker.cpp +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -133,6 +133,14 @@ void ShutdownHandler::run() { } } +// Console control handler to properly handle ctl-c. +BOOL CtrlHandler(DWORD ctl) +{ + ShutdownEvent shutter; // no pid specified == shut me down + shutter.signal(); + return ((ctl == CTRL_C_EVENT || ctl == CTRL_CLOSE_EVENT) ? TRUE : FALSE); +} + } struct ProcessControlOptions : public qpid::Options { @@ -245,6 +253,7 @@ int QpiddBroker::execute (QpiddOptions *options) { ShutdownHandler waitShut(brokerPtr); qpid::sys::Thread waitThr(waitShut); // Wait for shutdown event + SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE); brokerPtr->run(); waitShut.signal(); // In case we shut down some other way waitThr.join(); -- cgit v1.2.1 From 965b958161f4480a3626f5d50c3f6cc0d8517c27 Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Wed, 21 Oct 2009 20:43:46 +0000 Subject: Add missing accept() call to start listening on broker port git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@828202 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp index 5bf9477e6a..05df32397a 100644 --- a/qpid/cpp/src/windows/QpiddBroker.cpp +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -227,9 +227,6 @@ int QpiddBroker::execute (QpiddOptions *options) { } boost::intrusive_ptr brokerPtr(new Broker(options->broker)); - if (options->broker.port == 0) - options->broker.port = brokerPtr->getPort(""); - std::cout << options->broker.port << std::endl; // Make sure the pid directory exists, creating if needed. LockFile // will throw an exception that makes little sense if it can't create @@ -254,6 +251,10 @@ int QpiddBroker::execute (QpiddOptions *options) { ShutdownHandler waitShut(brokerPtr); qpid::sys::Thread waitThr(waitShut); // Wait for shutdown event SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE); + if (options->broker.port == 0) + options->broker.port = brokerPtr->getPort(""); + brokerPtr->accept(); + std::cout << options->broker.port << std::endl; brokerPtr->run(); waitShut.signal(); // In case we shut down some other way waitThr.join(); -- cgit v1.2.1 From 0f470cb8bf9b349d180f18af2c3f85ec1aa1143a Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Fri, 23 Oct 2009 00:23:30 +0000 Subject: Get selected TCP listen port before building the pid file name; fixes regression introduced yesterday. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@828898 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp index 05df32397a..fc4f9f8a92 100644 --- a/qpid/cpp/src/windows/QpiddBroker.cpp +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -239,6 +239,9 @@ int QpiddBroker::execute (QpiddOptions *options) { ": " + qpid::sys::strError(err))); } + // Need the correct port number to use in the pid file name. + if (options->broker.port == 0) + options->broker.port = brokerPtr->getPort(""); qpid::sys::LockFile myPid(brokerPidFile(myOptions->control.piddir, options->broker.port), true); @@ -251,8 +254,6 @@ int QpiddBroker::execute (QpiddOptions *options) { ShutdownHandler waitShut(brokerPtr); qpid::sys::Thread waitThr(waitShut); // Wait for shutdown event SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE); - if (options->broker.port == 0) - options->broker.port = brokerPtr->getPort(""); brokerPtr->accept(); std::cout << options->broker.port << std::endl; brokerPtr->run(); -- cgit v1.2.1 From 6ef9706fc3d447768b4d0d2b0cee8bea828677bd Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Tue, 15 Dec 2009 18:24:02 +0000 Subject: QPID-1951: Removed need for Windows versions of ssize_t and pid_t - Trivially removed Windows uses of ssize_t - Rearchitected how the Windows port finds an existing qpidd to stop it - Split Posix Lockfile functionality using pids into a new PidFile class git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@890929 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 191 ++++++++++++++++++++++------------- 1 file changed, 119 insertions(+), 72 deletions(-) (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp index fc4f9f8a92..15380dda0b 100644 --- a/qpid/cpp/src/windows/QpiddBroker.cpp +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -34,7 +34,6 @@ const char *QPIDD_MODULE_DIR = "."; #include "qpid/Options.h" #include "qpid/Plugin.h" #include "qpid/sys/IntegerTypes.h" -#include "qpid/sys/LockFile.h" #include "qpid/sys/windows/check.h" #include "qpid/broker/Broker.h" @@ -59,74 +58,68 @@ namespace { const std::string TCP = "tcp"; -std::string brokerPidFile(std::string piddir, uint16_t port) -{ - std::ostringstream path; - path << piddir << "\\broker_" << port << ".pid"; - return path.str(); -} - // ShutdownEvent maintains an event that can be used to ask the broker // to stop. Analogous to sending SIGTERM/SIGINT to the posix broker. // The signal() method signals the event. class ShutdownEvent { public: - ShutdownEvent(pid_t other = 0); + ShutdownEvent(int port); ~ShutdownEvent(); + void create(); + void open(); void signal(); + private: + std::string eventName; + protected: - std::string eventName(pid_t pid); HANDLE event; }; class ShutdownHandler : public ShutdownEvent, public qpid::sys::Runnable { public: - ShutdownHandler(const boost::intrusive_ptr& b) - : ShutdownEvent() { broker = b; } + ShutdownHandler(int port, const boost::intrusive_ptr& b) + : ShutdownEvent(port) { broker = b; } private: virtual void run(); // Inherited from Runnable boost::intrusive_ptr broker; }; -ShutdownEvent::ShutdownEvent(pid_t other) : event(NULL) { - // If given a pid, open an event assumedly created by that pid. If there's - // no pid, create a new event using the current process id. - if (other == 0) { - std::string name = eventName(GetCurrentProcessId()); - // Auto-reset event in case multiple processes try to signal a - // broker that doesn't respond for some reason. Initially not signaled. - event = CreateEvent(NULL, false, false, name.c_str()); - } - else { - std::string name = eventName(other); - event = OpenEvent(EVENT_MODIFY_STATE, false, name.c_str()); - } +ShutdownEvent::ShutdownEvent(int port) : event(NULL) { + std::ostringstream name; + name << "qpidd_" << port << std::ends; + eventName = name.str(); +} + +void ShutdownEvent::create() { + // Auto-reset event in case multiple processes try to signal a + // broker that doesn't respond for some reason. Initially not signaled. + event = ::CreateEvent(NULL, false, false, eventName.c_str()); + QPID_WINDOWS_CHECK_NULL(event); +} + +void ShutdownEvent::open() { + // TODO: Might need to search Global\\ name if unadorned name fails + event = ::OpenEvent(EVENT_MODIFY_STATE, false, eventName.c_str()); QPID_WINDOWS_CHECK_NULL(event); } ShutdownEvent::~ShutdownEvent() { - CloseHandle(event); + ::CloseHandle(event); event = NULL; } void ShutdownEvent::signal() { - QPID_WINDOWS_CHECK_NOT(SetEvent(event), 0); -} - -std::string ShutdownEvent::eventName(pid_t pid) { - std::ostringstream name; - name << "qpidd_" << pid << std::ends; - return name.str(); + QPID_WINDOWS_CHECK_NOT(::SetEvent(event), 0); } void ShutdownHandler::run() { if (event == NULL) return; - WaitForSingleObject(event, INFINITE); + ::WaitForSingleObject(event, INFINITE); if (broker.get()) { broker->shutdown(); broker = 0; // Release the broker reference @@ -134,19 +127,89 @@ void ShutdownHandler::run() { } // Console control handler to properly handle ctl-c. +int ourPort; BOOL CtrlHandler(DWORD ctl) { - ShutdownEvent shutter; // no pid specified == shut me down + ShutdownEvent shutter(ourPort); // We have to have set up the port before interrupting + shutter.open(); shutter.signal(); return ((ctl == CTRL_C_EVENT || ctl == CTRL_CLOSE_EVENT) ? TRUE : FALSE); } +template +class NamedSharedMemory { + std::string name; + HANDLE memory; + T* data; + +public: + NamedSharedMemory(const std::string&); + ~NamedSharedMemory(); + + T& create(); + T& get(); +}; + +template +NamedSharedMemory::NamedSharedMemory(const std::string& n) : + name(n), + memory(NULL), + data(0) +{}; + +template +NamedSharedMemory::~NamedSharedMemory() { + if (data) + ::UnmapViewOfFile(data); + if (memory != NULL) + ::CloseHandle(memory); +}; + +template +T& NamedSharedMemory::create() { + assert(memory == NULL); + + // Create named shared memory file + memory = ::CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(T), name.c_str()); + QPID_WINDOWS_CHECK_NULL(memory); + + // Map file into memory + data = static_cast(::MapViewOfFile(memory, FILE_MAP_WRITE, 0, 0, 0)); + QPID_WINDOWS_CHECK_NULL(data); + + return *data; +} + +template +T& NamedSharedMemory::get() { + if (memory == NULL) { + // TODO: Might need to search Global\\ name if unadorned name fails + memory = ::OpenFileMapping(FILE_MAP_WRITE, FALSE, name.c_str()); + QPID_WINDOWS_CHECK_NULL(memory); + + data = static_cast(::MapViewOfFile(memory, FILE_MAP_WRITE, 0, 0, 0)); + QPID_WINDOWS_CHECK_NULL(data); + } + + return *data; +} + +std::string brokerInfoName(uint16_t port) +{ + std::ostringstream path; + path << "qpidd_info_" << port; + return path.str(); +} + +struct BrokerInfo { + DWORD pid; +}; + } struct ProcessControlOptions : public qpid::Options { bool quit; bool check; - std::string piddir; //std::string transport; No transport options yet - TCP is it. ProcessControlOptions() @@ -154,18 +217,9 @@ struct ProcessControlOptions : public qpid::Options { quit(false), check(false) //, transport(TCP) { - const DWORD pathLen = MAX_PATH + 1; - char tempDir[pathLen]; - if (GetTempPath(pathLen, tempDir) == 0) - piddir = "C:\\WINDOWS\\TEMP\\"; - else - piddir = tempDir; - piddir += "qpidd"; - // Only have TCP for now, so don't need this... // ("transport", optValue(transport, "TRANSPORT"), "The transport for which to return the port") addOptions() - ("pid-dir", qpid::optValue(piddir, "DIR"), "Directory where port-specific PID file is stored") ("check,c", qpid::optValue(check), "Prints the broker's process ID to stdout and returns 0 if the broker is running, otherwise returns 1") ("quit,q", qpid::optValue(quit), "Tells the broker to shut down"); } @@ -207,57 +261,50 @@ int QpiddBroker::execute (QpiddOptions *options) { if (myOptions->control.check || myOptions->control.quit) { // Relies on port number being set via --port or QPID_PORT env variable. - qpid::sys::LockFile getPid (brokerPidFile(myOptions->control.piddir, - options->broker.port), - false); - pid_t pid = getPid.readPid(); + NamedSharedMemory info(brokerInfoName(options->broker.port)); + int pid = info.get().pid; if (pid < 0) return 1; if (myOptions->control.check) std::cout << pid << std::endl; if (myOptions->control.quit) { - ShutdownEvent shutter(pid); - HANDLE brokerHandle = OpenProcess(SYNCHRONIZE, false, pid); - QPID_WINDOWS_CHECK_NULL(brokerHandle); + ShutdownEvent shutter(options->broker.port); + shutter.open(); shutter.signal(); - WaitForSingleObject(brokerHandle, INFINITE); - CloseHandle(brokerHandle); + HANDLE brokerHandle = ::OpenProcess(SYNCHRONIZE, false, pid); + QPID_WINDOWS_CHECK_NULL(brokerHandle); + ::WaitForSingleObject(brokerHandle, INFINITE); + ::CloseHandle(brokerHandle); } return 0; } boost::intrusive_ptr brokerPtr(new Broker(options->broker)); - // Make sure the pid directory exists, creating if needed. LockFile - // will throw an exception that makes little sense if it can't create - // the file. - if (!CreateDirectory(myOptions->control.piddir.c_str(), 0)) { - DWORD err = GetLastError(); - if (err != ERROR_ALREADY_EXISTS) - throw qpid::Exception(QPID_MSG("Can't create pid-dir " + - myOptions->control.piddir + - ": " + - qpid::sys::strError(err))); - } // Need the correct port number to use in the pid file name. if (options->broker.port == 0) options->broker.port = brokerPtr->getPort(""); - qpid::sys::LockFile myPid(brokerPidFile(myOptions->control.piddir, - options->broker.port), - true); - myPid.writePid(); + + BrokerInfo info; + info.pid = ::GetCurrentProcessId(); + + NamedSharedMemory sharedInfo(brokerInfoName(options->broker.port)); + sharedInfo.create() = info; // Allow the broker to receive a shutdown request via a qpidd --quit // command. Note that when the broker is run as a service this operation // should not be allowed. - - ShutdownHandler waitShut(brokerPtr); + ourPort = options->broker.port; + ShutdownHandler waitShut(ourPort, brokerPtr); + waitShut.create(); qpid::sys::Thread waitThr(waitShut); // Wait for shutdown event - SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE); + ::SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE); brokerPtr->accept(); std::cout << options->broker.port << std::endl; brokerPtr->run(); waitShut.signal(); // In case we shut down some other way waitThr.join(); + + // CloseHandle(h); return 0; } -- cgit v1.2.1 From 2c8142f6b92f10f3bdbff3ea1d9e946aabb2618a Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Wed, 27 Jan 2010 22:06:52 +0000 Subject: Write the correct port number to stdout when starting up. Resolves QPID-2366. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@903862 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp index 15380dda0b..e221551575 100644 --- a/qpid/cpp/src/windows/QpiddBroker.cpp +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -210,17 +210,17 @@ struct BrokerInfo { struct ProcessControlOptions : public qpid::Options { bool quit; bool check; - //std::string transport; No transport options yet - TCP is it. + std::string transport; ProcessControlOptions() : qpid::Options("Process control options"), quit(false), - check(false) //, transport(TCP) + check(false), + transport(TCP) { - // Only have TCP for now, so don't need this... - // ("transport", optValue(transport, "TRANSPORT"), "The transport for which to return the port") addOptions() ("check,c", qpid::optValue(check), "Prints the broker's process ID to stdout and returns 0 if the broker is running, otherwise returns 1") + ("transport", qpid::optValue(transport, "TRANSPORT"), "The transport for which to return the port") ("quit,q", qpid::optValue(quit), "Tells the broker to shut down"); } }; @@ -283,7 +283,7 @@ int QpiddBroker::execute (QpiddOptions *options) { // Need the correct port number to use in the pid file name. if (options->broker.port == 0) - options->broker.port = brokerPtr->getPort(""); + options->broker.port = brokerPtr->getPort(myOptions->control.transport); BrokerInfo info; info.pid = ::GetCurrentProcessId(); -- cgit v1.2.1 From 18005c4ebb833597f52de911d2baddde3ddf9d03 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Thu, 8 Jul 2010 22:14:54 +0000 Subject: QPID-2711 - Patch from Chuck Rolke Add version and icon resources to Windows C++ exe/dll files git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@961962 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/resources/qpid-icon.ico | Bin 0 -> 52972 bytes .../cpp/src/windows/resources/template-resource.rc | 122 +++++++++++++++++++++ qpid/cpp/src/windows/resources/version-resource.h | 35 ++++++ 3 files changed, 157 insertions(+) create mode 100644 qpid/cpp/src/windows/resources/qpid-icon.ico create mode 100644 qpid/cpp/src/windows/resources/template-resource.rc create mode 100644 qpid/cpp/src/windows/resources/version-resource.h (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/resources/qpid-icon.ico b/qpid/cpp/src/windows/resources/qpid-icon.ico new file mode 100644 index 0000000000..112f5d8f1f Binary files /dev/null and b/qpid/cpp/src/windows/resources/qpid-icon.ico differ diff --git a/qpid/cpp/src/windows/resources/template-resource.rc b/qpid/cpp/src/windows/resources/template-resource.rc new file mode 100644 index 0000000000..725d1c9391 --- /dev/null +++ b/qpid/cpp/src/windows/resources/template-resource.rc @@ -0,0 +1,122 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// + +#include "version-resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "version-resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION ${winverFileVersionBinary} + PRODUCTVERSION ${winverProductVersionBinary} + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "${winverFileDescription}" + VALUE "FileVersion", "${winverFileVersionString}" + VALUE "LegalCopyright", "${winverLegalCopyright}" + VALUE "InternalName", "${winverInternalName}" + VALUE "OriginalFilename", "${winverOriginalFilename}" + VALUE "ProductName", "${winverProductName}" + VALUE "ProductVersion", "${winverProductVersionString}" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON "qpid-icon.ico" + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/qpid/cpp/src/windows/resources/version-resource.h b/qpid/cpp/src/windows/resources/version-resource.h new file mode 100644 index 0000000000..bf942abbaf --- /dev/null +++ b/qpid/cpp/src/windows/resources/version-resource.h @@ -0,0 +1,35 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// + +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Preserved for common usage by any Qpid exe/dll. + +#define IDI_ICON1 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 104 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif -- cgit v1.2.1 From e4c9251a9bbad0a1d88861924434eaa719565ee2 Mon Sep 17 00:00:00 2001 From: "Charles E. Rolke" Date: Thu, 14 Oct 2010 19:22:46 +0000 Subject: QPID-2906 Qpid WinSDK .NET Binding does not support Release configuration This patch adds Release mode build support for the .NET Binding to C++ Messaging. 1. SessionReceiver project was putting its x64 output into the wrong directory and was not picked up by the WinSDK. 2. winsdk_dotnet_examples.sln had the projects in a hierarchy. This spoils the experience for users of VS Express where the solution failed to load. 3. README-winsdk.txt provides an ascii-art picture of the components in the SDK. Also adds a description of how to switch the .NET example projects from debug to release. 4. New files added in cpp/src/windows/winsdk: LICENSE-MSVC is windows-only text to be appended to the root LICENSE file. MS-LICENSE.HTM is the Microsoft Runtime Redistributable license for VS2008 and .NET Framework 3.5. 5. bld-winsdk.ps1: Builds full Debug and Release (RelWithDebInfo) .NET binding DLLs. Augments the licenses in the kit root with information about the Microsoft Redistributable Runtime. Enforces DOS line endings on all the kit root info files. Installs the Debug version of .NET Binding in the /bin directory. Places zipped Debug and Release versions of .NET Binding in the /bin directory that users may select. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1022667 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/winsdk/LICENSE-MSVC | 15 + qpid/cpp/src/windows/winsdk/MS-LICENSE.HTM | 806 +++++++++++++++++++++++++++++ 2 files changed, 821 insertions(+) create mode 100644 qpid/cpp/src/windows/winsdk/LICENSE-MSVC create mode 100644 qpid/cpp/src/windows/winsdk/MS-LICENSE.HTM (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/winsdk/LICENSE-MSVC b/qpid/cpp/src/windows/winsdk/LICENSE-MSVC new file mode 100644 index 0000000000..8f6d953278 --- /dev/null +++ b/qpid/cpp/src/windows/winsdk/LICENSE-MSVC @@ -0,0 +1,15 @@ +========================================================================= +== Microsoft Distributable Code == +========================================================================= + +This product includes files derived from the Microsoft Windows +Software Development Kit for Windows Server 2008 and .NET Framework +3.5 ("MSW SDK"). A copy of the Microsoft Software License Terms for +the MSW SDK ("MS License") accompanies this product. The +aforementioned files are "Distributable Code" listed in MS-LICENSE.HTM, +under the terms of the MS License. With respect to those files, by +using this product, you agree to be bound by the relevant provisions +of the MS License to the same extent as though you had developed the +product using the MSW SDK. If you do not agree to be bound by those +provisions, do not use this product. + diff --git a/qpid/cpp/src/windows/winsdk/MS-LICENSE.HTM b/qpid/cpp/src/windows/winsdk/MS-LICENSE.HTM new file mode 100644 index 0000000000..7e060932ff --- /dev/null +++ b/qpid/cpp/src/windows/winsdk/MS-LICENSE.HTM @@ -0,0 +1,806 @@ + + + + + + + + + + + +
+ +

MICROSOFT SOFTWARE LICENSE TERMS

+ +

MICROSOFT WINDOWS SOFTWARE DEVELOPMENT KIT

+ +

for Windows Server 2008 and .NET Framework +3.5

+ +

These license terms are an agreement between Microsoft +Corporation (or based on where you live, one of its affiliates) and you.  Please +read them.  They apply to the software named above, which includes the +media on which you received it, if any.  The terms also apply to any +Microsoft

+ +

·         +updates,

+ +

·         +supplements,

+ +

·         +Internet-based +services, and

+ +

·         +support +services

+ +

for this software, unless other terms accompany those +items.  If so, those terms apply.

+ +

BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS.  IF +YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.

+ +

If you comply with these license terms, you have the +rights below.

+ +

1.      +INSTALLATION +AND USE RIGHTS. 

+ +

a.      +Installation +and Use.  +One user may install and use any number of copies of the software on your +devices to design, develop and test your programs that run on a Microsoft +Windows operating system.

+ +

b.      +Included +Microsoft Programs.  +The software contains other Microsoft programs.  These license terms apply +to your use of those programs.

+ +

2.      +ADDITIONAL +LICENSING REQUIREMENTS AND/OR USE RIGHTS.

+ +

a.      +Distributable +Code.  +The software contains code that you are permitted to distribute in programs you +develop if you comply with the terms below.

+ +

i.         +Right +to Use and Distribute.  +The code and text files listed below are “Distributable Code.”

+ +

·         +REDIST.TXT +Files.  +You may copy and distribute the object code form of code listed in REDIST.TXT +files.

+ +

·         +Sample +Code.  +You may modify, copy, and distribute the source and object code form of code +marked as “sample.”

+ +

·         +Microsoft +Merge Modules.  +You may copy and distribute the unmodified output of Microsoft Merge Modules.

+ +

·         +Third +Party Distribution.  +You may permit distributors of your programs to copy and distribute the +Distributable Code as part of those programs.

+ +

ii.       +Distribution +Requirements.  +For any Distributable Code you distribute, you must

+ +

·         +add +significant primary functionality to it in your programs;

+ +

·         +for any +Distributable Code having a filename extension of .lib, distribute only the +results of running such Distributable Code through a linker with your +application;

+ +

·         +distribute +Distributable Code included in a setup program only as part of that setup +program without modification;

+ +

·         +require +distributors and external end users to agree to terms that protect it at least +as much as this agreement;

+ +

·         +display +your valid copyright notice on your programs;

+ +

·         +for +Distributable Code from the Windows Media Services SDK portions of the +software, include in your program’s Help-About box (or in another obvious place +if there is no box) the following copyright notice:  “Portions utilize +Microsoft Windows Media Technologies.  Copyright (c) 2006 Microsoft +Corporation.  All Rights Reserved”; and

+ +

·         +indemnify, +defend, and hold harmless Microsoft from any claims, including attorneys’ fees, +related to the distribution or use of your programs.

+ +

iii.      +Distribution +Restrictions.  You +may not

+ +

·         +alter +any copyright, trademark or patent notice in the Distributable Code;

+ +

·         +use +Microsoft’s trademarks in your programs’ names or in a way that suggests your +programs come from or are endorsed by Microsoft;

+ +

·         +include +Distributable Code in malicious, deceptive or unlawful programs; or

+ +

·         +modify +or distribute the source code of any Distributable Code so that any part of it +becomes subject to an Excluded License.  An Excluded License is one that +requires, as a condition of use, modification or distribution, that

+ +

·         +the code +be disclosed or distributed in source code form; or

+ +

·         +others +have the right to modify it.

+ +

b.      +Additional +Functionality.  Microsoft +may provide additional functionality for the software.  Other license +terms and fees may apply.

+ +

3.      +INTERNET-BASED +SERVICES.  Microsoft +provides Internet-based services with the software.  It may change or +cancel them at any time. You may not use this service in any way that could +harm it or impair anyone else’s use of it.  You may not use the service to +try to gain unauthorized access to any service, data, account or network by any +means.

+ +

4.      +MICROSOFT +.NET BENCHMARK TESTING. + The software includes one or more components of the .NET Framework 3.5 +(“.NET Components”).  You may conduct internal benchmark testing of those +components.  You may disclose the results of any benchmark test of those +components, provided that you comply with the conditions set forth at +http://go.microsoft.com/fwlink/?LinkID=66406.  Notwithstanding any other +agreement you may have with Microsoft, if you disclose such benchmark test +results, Microsoft shall have the right to disclose the results of benchmark +tests it conducts of your products that compete with the applicable .NET +Component, provided it complies with the same conditions set forth at +http://go.microsoft.com/fwlink/?LinkID=66406.

+ +

5.      +Scope of License.  The software is licensed, not +sold. This agreement only gives you some rights to use the software.  +Microsoft reserves all other rights.  Unless applicable law gives you more +rights despite this limitation, you may use the software only as expressly +permitted in this agreement.  In doing so, you must comply with any +technical limitations in the software that only allow you to use it in certain +ways.  For more information, see www.microsoft.com/licensing/userights.  You may not

+ +

·         +work +around any technical limitations in the software;

+ +

·         +reverse +engineer, decompile or disassemble the software, except and only to the extent +that applicable law expressly permits, despite this limitation;

+ +

·         +make +more copies of the software than specified in this agreement or allowed by +applicable law, despite this limitation;

+ +

·         +publish +the software for others to copy;

+ +

·         +rent, +lease or lend the software; or

+ +

·         +use the +software for commercial software hosting services.

+ +

6.      +CODE GENERATION +AND OPTIMIZATION TOOLS.  You may not use the code generation or +optimization tools in the software (such as compilers, linkers, assemblers, +runtime code generators, and code generating design and modeling tools) to +create programs, object code, libraries, assemblies, or executables to run on a +platform other than Microsoft operating systems, run-time technologies, or +application platforms.

+ +

7.      +BACKUP +COPY.  +You may make one backup copy of the software.  You may use it only to +reinstall the software.

+ +

8.      +DOCUMENTATION.  Any person +that has valid access to your computer or internal network may copy and use the +documentation for your internal, reference purposes.

+ +

9.      +TRANSFER +TO A THIRD PARTY.  The first user of the software may transfer it, and this +agreement, directly to a third party.  Before the transfer, that party +must agree that this agreement applies to the transfer and use of the +software.  The first user must uninstall the software before transferring +it separately from the device.  The first user may not retain any copies.

+ +

10. +Export Restrictions.  The software +is subject to United States export laws and regulations.  You must comply +with all domestic and international export laws and regulations that apply to +the software.  These laws include restrictions on destinations, end users +and end use.  For additional information, see www.microsoft.com/exporting.

+ +

11.  SUPPORT +SERVICES. +Because +this software is “as is,” we may not provide support services for it.

+ +

12.  Entire +Agreement.  +This agreement, and the terms for supplements, updates, Internet-based services +and support services that you use, are the entire agreement for the software +and support services.

+ +

13.  +Applicable Law.

+ +

a.      +United +States.  +If you acquired the software in the United States, Washington state law governs +the interpretation of this agreement and applies to claims for breach of it, +regardless of conflict of laws principles.  The laws of the state where +you live govern all other claims, including claims under state consumer +protection laws, unfair competition laws, and in tort.

+ +

b.      +Outside +the United States.  +If you acquired the software in any other country, the laws of that country +apply.

+ +

14.  Legal Effect.  This agreement +describes certain legal rights.  You may have other rights under the laws +of your country.  You may also have rights with respect to the party from +whom you acquired the software.  This agreement does not change your +rights under the laws of your country if the laws of your country do not permit +it to do so.

+ +

15.  Disclaimer of +Warranty.   +The software is licensed “as-is.”  +You bear the risk of using it.  Microsoft gives no express warranties, +guarantees or conditions.  You may have additional consumer rights under +your local laws which this agreement cannot change.  To the extent +permitted under your local laws, Microsoft excludes the implied warranties of +merchantability, fitness for a particular purpose and non-infringement.

+ +

16.  Limitation on and +Exclusion of Remedies and Damages.  You can recover from Microsoft and its +suppliers only direct damages up to U.S. $5.00.  You cannot recover any +other damages, including consequential, lost profits, special, indirect or +incidental damages.

+ +

This limitation applies to

+ +

·         +anything +related to the software, services, content (including code) on third party +Internet sites, or third party programs; and

+ +

·         +claims +for breach of contract, breach of warranty, guarantee or condition, strict liability, +negligence, or other tort to the extent permitted by applicable law.

+ +

It also applies even if Microsoft knew or should have +known about the possibility of the damages.  The above limitation or +exclusion may not apply to you because your country may not allow the exclusion +or limitation of incidental, consequential or other damages.

+ +

Please +note: As this software is distributed in Quebec, Canada, some of the clauses in +this agreement are provided below in French.

+ +

Remarque : Ce +logiciel étant distribué au Québec, Canada, certaines des clauses dans ce +contrat sont fournies ci-dessous en français.

+ +

EXONÉRATION DE GARANTIE. Le logiciel +visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel +est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie +expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local +sur la protection dues consommateurs, que ce contrat ne peut modifier. La ou +elles sont permises par le droit locale, les garanties implicites de qualité +marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont +exclues.

+ +

LIMITATION DES DOMMAGES-INTÉRÊTS ET +EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES.  Vous pouvez +obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de +dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à +aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, +indirects ou accessoires et pertes de bénéfices.

+ +

Cette limitation concerne :

+ +

·         +tout  +ce qui est relié au logiciel, aux services ou au contenu (y compris le code) +figurant sur des sites Internet tiers ou dans des programmes tiers ; et

+ +

·         +les +réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité +stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi +en vigueur.

+ +

Elle s’applique également, même si Microsoft +connaissait ou devrait connaître l’éventualité d’un tel dommage.  Si votre +pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les +dommages indirects, accessoires ou de quelque nature que ce soit, il se peut +que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard.

+ +

EFFET JURIDIQUE.  Le présent +contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits +prévus par les lois de votre pays.  Le présent contrat ne modifie pas les +droits que vous confèrent les lois de votre pays si celles ci ne le permettent +pas.

+ +

 

+ +
+ + + + + -- cgit v1.2.1 From 3f9a5914c781e5a59e86f8ea789bd46c4c7ccdbd Mon Sep 17 00:00:00 2001 From: "Charles E. Rolke" Date: Thu, 28 Oct 2010 17:17:29 +0000 Subject: QPID-2906 Delete vendor-specific licenses. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1028391 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/winsdk/LICENSE-MSVC | 15 - qpid/cpp/src/windows/winsdk/MS-LICENSE.HTM | 806 ----------------------------- 2 files changed, 821 deletions(-) delete mode 100644 qpid/cpp/src/windows/winsdk/LICENSE-MSVC delete mode 100644 qpid/cpp/src/windows/winsdk/MS-LICENSE.HTM (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/winsdk/LICENSE-MSVC b/qpid/cpp/src/windows/winsdk/LICENSE-MSVC deleted file mode 100644 index 8f6d953278..0000000000 --- a/qpid/cpp/src/windows/winsdk/LICENSE-MSVC +++ /dev/null @@ -1,15 +0,0 @@ -========================================================================= -== Microsoft Distributable Code == -========================================================================= - -This product includes files derived from the Microsoft Windows -Software Development Kit for Windows Server 2008 and .NET Framework -3.5 ("MSW SDK"). A copy of the Microsoft Software License Terms for -the MSW SDK ("MS License") accompanies this product. The -aforementioned files are "Distributable Code" listed in MS-LICENSE.HTM, -under the terms of the MS License. With respect to those files, by -using this product, you agree to be bound by the relevant provisions -of the MS License to the same extent as though you had developed the -product using the MSW SDK. If you do not agree to be bound by those -provisions, do not use this product. - diff --git a/qpid/cpp/src/windows/winsdk/MS-LICENSE.HTM b/qpid/cpp/src/windows/winsdk/MS-LICENSE.HTM deleted file mode 100644 index 7e060932ff..0000000000 --- a/qpid/cpp/src/windows/winsdk/MS-LICENSE.HTM +++ /dev/null @@ -1,806 +0,0 @@ - - - - - - - - - - - -
- -

MICROSOFT SOFTWARE LICENSE TERMS

- -

MICROSOFT WINDOWS SOFTWARE DEVELOPMENT KIT

- -

for Windows Server 2008 and .NET Framework -3.5

- -

These license terms are an agreement between Microsoft -Corporation (or based on where you live, one of its affiliates) and you.  Please -read them.  They apply to the software named above, which includes the -media on which you received it, if any.  The terms also apply to any -Microsoft

- -

·         -updates,

- -

·         -supplements,

- -

·         -Internet-based -services, and

- -

·         -support -services

- -

for this software, unless other terms accompany those -items.  If so, those terms apply.

- -

BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS.  IF -YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.

- -

If you comply with these license terms, you have the -rights below.

- -

1.      -INSTALLATION -AND USE RIGHTS. 

- -

a.      -Installation -and Use.  -One user may install and use any number of copies of the software on your -devices to design, develop and test your programs that run on a Microsoft -Windows operating system.

- -

b.      -Included -Microsoft Programs.  -The software contains other Microsoft programs.  These license terms apply -to your use of those programs.

- -

2.      -ADDITIONAL -LICENSING REQUIREMENTS AND/OR USE RIGHTS.

- -

a.      -Distributable -Code.  -The software contains code that you are permitted to distribute in programs you -develop if you comply with the terms below.

- -

i.         -Right -to Use and Distribute.  -The code and text files listed below are “Distributable Code.”

- -

·         -REDIST.TXT -Files.  -You may copy and distribute the object code form of code listed in REDIST.TXT -files.

- -

·         -Sample -Code.  -You may modify, copy, and distribute the source and object code form of code -marked as “sample.”

- -

·         -Microsoft -Merge Modules.  -You may copy and distribute the unmodified output of Microsoft Merge Modules.

- -

·         -Third -Party Distribution.  -You may permit distributors of your programs to copy and distribute the -Distributable Code as part of those programs.

- -

ii.       -Distribution -Requirements.  -For any Distributable Code you distribute, you must

- -

·         -add -significant primary functionality to it in your programs;

- -

·         -for any -Distributable Code having a filename extension of .lib, distribute only the -results of running such Distributable Code through a linker with your -application;

- -

·         -distribute -Distributable Code included in a setup program only as part of that setup -program without modification;

- -

·         -require -distributors and external end users to agree to terms that protect it at least -as much as this agreement;

- -

·         -display -your valid copyright notice on your programs;

- -

·         -for -Distributable Code from the Windows Media Services SDK portions of the -software, include in your program’s Help-About box (or in another obvious place -if there is no box) the following copyright notice:  “Portions utilize -Microsoft Windows Media Technologies.  Copyright (c) 2006 Microsoft -Corporation.  All Rights Reserved”; and

- -

·         -indemnify, -defend, and hold harmless Microsoft from any claims, including attorneys’ fees, -related to the distribution or use of your programs.

- -

iii.      -Distribution -Restrictions.  You -may not

- -

·         -alter -any copyright, trademark or patent notice in the Distributable Code;

- -

·         -use -Microsoft’s trademarks in your programs’ names or in a way that suggests your -programs come from or are endorsed by Microsoft;

- -

·         -include -Distributable Code in malicious, deceptive or unlawful programs; or

- -

·         -modify -or distribute the source code of any Distributable Code so that any part of it -becomes subject to an Excluded License.  An Excluded License is one that -requires, as a condition of use, modification or distribution, that

- -

·         -the code -be disclosed or distributed in source code form; or

- -

·         -others -have the right to modify it.

- -

b.      -Additional -Functionality.  Microsoft -may provide additional functionality for the software.  Other license -terms and fees may apply.

- -

3.      -INTERNET-BASED -SERVICES.  Microsoft -provides Internet-based services with the software.  It may change or -cancel them at any time. You may not use this service in any way that could -harm it or impair anyone else’s use of it.  You may not use the service to -try to gain unauthorized access to any service, data, account or network by any -means.

- -

4.      -MICROSOFT -.NET BENCHMARK TESTING. - The software includes one or more components of the .NET Framework 3.5 -(“.NET Components”).  You may conduct internal benchmark testing of those -components.  You may disclose the results of any benchmark test of those -components, provided that you comply with the conditions set forth at -http://go.microsoft.com/fwlink/?LinkID=66406.  Notwithstanding any other -agreement you may have with Microsoft, if you disclose such benchmark test -results, Microsoft shall have the right to disclose the results of benchmark -tests it conducts of your products that compete with the applicable .NET -Component, provided it complies with the same conditions set forth at -http://go.microsoft.com/fwlink/?LinkID=66406.

- -

5.      -Scope of License.  The software is licensed, not -sold. This agreement only gives you some rights to use the software.  -Microsoft reserves all other rights.  Unless applicable law gives you more -rights despite this limitation, you may use the software only as expressly -permitted in this agreement.  In doing so, you must comply with any -technical limitations in the software that only allow you to use it in certain -ways.  For more information, see www.microsoft.com/licensing/userights.  You may not

- -

·         -work -around any technical limitations in the software;

- -

·         -reverse -engineer, decompile or disassemble the software, except and only to the extent -that applicable law expressly permits, despite this limitation;

- -

·         -make -more copies of the software than specified in this agreement or allowed by -applicable law, despite this limitation;

- -

·         -publish -the software for others to copy;

- -

·         -rent, -lease or lend the software; or

- -

·         -use the -software for commercial software hosting services.

- -

6.      -CODE GENERATION -AND OPTIMIZATION TOOLS.  You may not use the code generation or -optimization tools in the software (such as compilers, linkers, assemblers, -runtime code generators, and code generating design and modeling tools) to -create programs, object code, libraries, assemblies, or executables to run on a -platform other than Microsoft operating systems, run-time technologies, or -application platforms.

- -

7.      -BACKUP -COPY.  -You may make one backup copy of the software.  You may use it only to -reinstall the software.

- -

8.      -DOCUMENTATION.  Any person -that has valid access to your computer or internal network may copy and use the -documentation for your internal, reference purposes.

- -

9.      -TRANSFER -TO A THIRD PARTY.  The first user of the software may transfer it, and this -agreement, directly to a third party.  Before the transfer, that party -must agree that this agreement applies to the transfer and use of the -software.  The first user must uninstall the software before transferring -it separately from the device.  The first user may not retain any copies.

- -

10. -Export Restrictions.  The software -is subject to United States export laws and regulations.  You must comply -with all domestic and international export laws and regulations that apply to -the software.  These laws include restrictions on destinations, end users -and end use.  For additional information, see www.microsoft.com/exporting.

- -

11.  SUPPORT -SERVICES. -Because -this software is “as is,” we may not provide support services for it.

- -

12.  Entire -Agreement.  -This agreement, and the terms for supplements, updates, Internet-based services -and support services that you use, are the entire agreement for the software -and support services.

- -

13.  -Applicable Law.

- -

a.      -United -States.  -If you acquired the software in the United States, Washington state law governs -the interpretation of this agreement and applies to claims for breach of it, -regardless of conflict of laws principles.  The laws of the state where -you live govern all other claims, including claims under state consumer -protection laws, unfair competition laws, and in tort.

- -

b.      -Outside -the United States.  -If you acquired the software in any other country, the laws of that country -apply.

- -

14.  Legal Effect.  This agreement -describes certain legal rights.  You may have other rights under the laws -of your country.  You may also have rights with respect to the party from -whom you acquired the software.  This agreement does not change your -rights under the laws of your country if the laws of your country do not permit -it to do so.

- -

15.  Disclaimer of -Warranty.   -The software is licensed “as-is.”  -You bear the risk of using it.  Microsoft gives no express warranties, -guarantees or conditions.  You may have additional consumer rights under -your local laws which this agreement cannot change.  To the extent -permitted under your local laws, Microsoft excludes the implied warranties of -merchantability, fitness for a particular purpose and non-infringement.

- -

16.  Limitation on and -Exclusion of Remedies and Damages.  You can recover from Microsoft and its -suppliers only direct damages up to U.S. $5.00.  You cannot recover any -other damages, including consequential, lost profits, special, indirect or -incidental damages.

- -

This limitation applies to

- -

·         -anything -related to the software, services, content (including code) on third party -Internet sites, or third party programs; and

- -

·         -claims -for breach of contract, breach of warranty, guarantee or condition, strict liability, -negligence, or other tort to the extent permitted by applicable law.

- -

It also applies even if Microsoft knew or should have -known about the possibility of the damages.  The above limitation or -exclusion may not apply to you because your country may not allow the exclusion -or limitation of incidental, consequential or other damages.

- -

Please -note: As this software is distributed in Quebec, Canada, some of the clauses in -this agreement are provided below in French.

- -

Remarque : Ce -logiciel étant distribué au Québec, Canada, certaines des clauses dans ce -contrat sont fournies ci-dessous en français.

- -

EXONÉRATION DE GARANTIE. Le logiciel -visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel -est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie -expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local -sur la protection dues consommateurs, que ce contrat ne peut modifier. La ou -elles sont permises par le droit locale, les garanties implicites de qualité -marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont -exclues.

- -

LIMITATION DES DOMMAGES-INTÉRÊTS ET -EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES.  Vous pouvez -obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de -dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à -aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, -indirects ou accessoires et pertes de bénéfices.

- -

Cette limitation concerne :

- -

·         -tout  -ce qui est relié au logiciel, aux services ou au contenu (y compris le code) -figurant sur des sites Internet tiers ou dans des programmes tiers ; et

- -

·         -les -réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité -stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi -en vigueur.

- -

Elle s’applique également, même si Microsoft -connaissait ou devrait connaître l’éventualité d’un tel dommage.  Si votre -pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les -dommages indirects, accessoires ou de quelque nature que ce soit, il se peut -que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard.

- -

EFFET JURIDIQUE.  Le présent -contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits -prévus par les lois de votre pays.  Le présent contrat ne modifie pas les -droits que vous confèrent les lois de votre pays si celles ci ne le permettent -pas.

- -

 

- -
- - - - - -- cgit v1.2.1 From 017ff4c3c785c4ad9432c6f4bc1b9281ca18d5e9 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Tue, 17 May 2011 21:05:49 +0000 Subject: QPID-2905 - Misc. code cleanup to allow compilation on a wider set of compilers. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1104560 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/windows/QpiddBroker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qpid/cpp/src/windows') diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp index e221551575..50bb45979c 100644 --- a/qpid/cpp/src/windows/QpiddBroker.cpp +++ b/qpid/cpp/src/windows/QpiddBroker.cpp @@ -155,7 +155,7 @@ NamedSharedMemory::NamedSharedMemory(const std::string& n) : name(n), memory(NULL), data(0) -{}; +{} template NamedSharedMemory::~NamedSharedMemory() { @@ -163,7 +163,7 @@ NamedSharedMemory::~NamedSharedMemory() { ::UnmapViewOfFile(data); if (memory != NULL) ::CloseHandle(memory); -}; +} template T& NamedSharedMemory::create() { -- cgit v1.2.1