diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2000-03-11 00:04:49 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2000-03-11 00:04:49 +0000 |
commit | 44ff21532af07106c07712b2a7da51faef1abf81 (patch) | |
tree | e6d18c94d656aa3b5aa7940b81be8db6cbc534d2 | |
parent | ced1e5b9626ea8524715b817a312ec24c502906c (diff) | |
download | ATCD-44ff21532af07106c07712b2a7da51faef1abf81.tar.gz |
ChangeLogTag:Fri Mar 10 00:17:37 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 20 | ||||
-rw-r--r-- | TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp | 80 | ||||
-rw-r--r-- | TAO/orbsvcs/Naming_Service/NT_Naming_Service.h | 7 | ||||
-rw-r--r-- | THANKS | 1 |
4 files changed, 94 insertions, 14 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index b1d9ce2bb4d..0d0b598b3fd 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,12 +1,18 @@ +Fri Mar 10 12:50:37 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + + * orbsvcs/Naming_Service/NT_Naming_Service.cpp: Added the capability + to extract the Naming Service options from the NT Registry. + Thanks to Tim Sim <tim_sim@optusnet.com.au> for contributing + this. + Fri Mar 10 17:44:39 2000 Jeff Parsons <parsons@cs.wustl.edu> - * TAO_IDL/ast/ast_interface.cpp: - When a forward declared interface is defined, the forward - declaration must be looked up for redefinition. If this - happened in a module that was reopened from one included - from another IDL file, the lookup was failing. Thanks to - Brian Wright <bwright@paladyne.com> for sending in the IDL - file that uncovered this bug. + * TAO_IDL/ast/ast_interface.cpp: When a forward declared interface + is defined, the forward declaration must be looked up for + redefinition. If this happened in a module that was reopened + from one included from another IDL file, the lookup was + failing. Thanks to Brian Wright <bwright@paladyne.com> for + sending in the IDL file that uncovered this bug. Fri Mar 10 12:50:37 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> diff --git a/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp index ef3f0d23906..afb16d1bae7 100644 --- a/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp +++ b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp @@ -4,14 +4,27 @@ #include /**/ "Naming_Service.h" #include /**/ "NT_Naming_Service.h" +#define REGISTRY_KEY_ROOT HKEY_LOCAL_MACHINE +#define TAO_REGISTRY_SUBKEY "SOFTWARE\\ACE\\TAO" +#define TAO_NAMING_SERVICE_OPTS_NAME "TaoNamingServiceOptions" + TAO_NT_Naming_Service::TAO_NT_Naming_Service (void) - : argc_(0), - argv_(0) + : argc_ (0), + argc_save_ (0), + argv_ (0), + argv_save_ (0) { } TAO_NT_Naming_Service::~TAO_NT_Naming_Service (void) { + if (argv_save_) + { + for (int i = 0; i < argc_save_; i++) + ACE_OS::free (argv_save_[i]); + + ACE_OS::free (argv_save_); + } } void @@ -21,7 +34,7 @@ TAO_NT_Naming_Service::handle_control (DWORD control_code) || control_code == SERVICE_CONTROL_STOP) { report_status (SERVICE_STOP_PENDING); - TAO_ORB_Core_instance ()->reactor ()->end_event_loop (); + TAO_ORB_Core_instance ()->reactor ()->end_reactor_event_loop (); TAO_ORB_Core_instance ()->orb ()->shutdown (1); report_status (SERVICE_STOPPED); } @@ -39,8 +52,64 @@ int TAO_NT_Naming_Service::init (int argc, ASYS_TCHAR *argv[]) { - argc_ = argc; - argv_ = argv; + HKEY hkey = 0; + BYTE buf[ACE_DEFAULT_ARGV_BUFSIZ]; + + *buf = '\0'; + + // This solution is very kludgy. It looks in the NT Registry under + // \\HKEY_LOCAL_MACHINE\SOFTWARE\ACE\TAO for the value of + // "TaoNamingServiceOptions" for any Naming Service options such as + // "-ORBEndpoint". + + // Get Naming Service options from the NT Registry. + + RegOpenKeyEx (REGISTRY_KEY_ROOT, + TAO_REGISTRY_SUBKEY, + 0, + KEY_READ|KEY_WRITE, + &hkey); + + DWORD type; + DWORD bufSize = sizeof (buf); + + RegQueryValueEx (hkey, + TAO_NAMING_SERVICE_OPTS_NAME, + NULL, + &type, + buf, + &bufSize); + + RegCloseKey (hkey); + + // Add options to the args list (if any). + + if (ACE_OS::strlen ((char *) buf) > 0) + { + // Allocate the internal args list to be one bigger than the + // args list passed into the function. We use a 'save' list in + // case we use a 'destructive' args list processor - this way we + // maintain the correct argv and argc for memory freeing + // operations in the destructor. + argv_save_ = (char **) malloc (sizeof (char *) *(argc + 1)); + + // Copy the values into the internal args buffer. + for (int i = 0; i < argc; i++) + argv_save_[i] = ACE_OS::strdup (argv[i]); + + // Add the configured option to the argument list. + argv_save_[argc] = ACE_OS::strdup ((char *) buf); + + // Set the arg counter. + argc_save_ = argc + 1; + argc_ = argc_save_; + argv_ = argv_save_; + } + else + { + argc_ = argc; + argv_ = argv; + } return 0; } @@ -72,4 +141,3 @@ TAO_NT_Naming_Service::svc (void) return 0; } - diff --git a/TAO/orbsvcs/Naming_Service/NT_Naming_Service.h b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.h index a0440c9de80..e3e18698e2f 100644 --- a/TAO/orbsvcs/Naming_Service/NT_Naming_Service.h +++ b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.h @@ -54,9 +54,14 @@ public: // Initialize the objects argc_ and argv_ attributes values. private: - // Keep track of the "command-line" arguments. + // = Keep track of the "command-line" arguments. int argc_; + int argc_save_; + // Argument count. + char **argv_; + char **argv_save_; + // Argument list. friend class ACE_Singleton<TAO_NT_Naming_Service, MUTEX>; }; @@ -920,6 +920,7 @@ Adrian Miranda <ade@psg.com> Cody Dean <cody.dean@mindspring.com> Hans Scharkowitz <hanssch@my-deja.com> Charles Meier <cmeier@concentus-tech.com> +Tim Sim <tim_sim@optusnet.com.au> I would particularly like to thank Paul Stephenson, who worked with me at Ericsson. Paul devised the recursive Makefile scheme that |