summaryrefslogtreecommitdiff
path: root/ace/Sock_Connect.cpp
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-11-13 01:05:00 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-11-13 01:05:00 +0000
commit0d6cdd6e619135e8c5c74756b9cf10fd6e393957 (patch)
tree2b2cf78902a7c6a418a1408221eeb2c0857f79d1 /ace/Sock_Connect.cpp
parent275a918fe4a76efc1d816c0ba98653dc335f777b (diff)
downloadATCD-0d6cdd6e619135e8c5c74756b9cf10fd6e393957.tar.gz
ChangeLogTag:Sun Nov 12 17:00:42 2000 Darrell Brunsch <brunsch@uci.edu>
Diffstat (limited to 'ace/Sock_Connect.cpp')
-rw-r--r--ace/Sock_Connect.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/ace/Sock_Connect.cpp b/ace/Sock_Connect.cpp
index 94fa96ca963..4c285ddbebf 100644
--- a/ace/Sock_Connect.cpp
+++ b/ace/Sock_Connect.cpp
@@ -5,6 +5,7 @@
#include "ace/Log_Msg.h"
#include "ace/Handle_Set.h"
#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
#if defined (ACE_LACKS_INLINE_FUNCTIONS)
#include "ace/Sock_Connect.i"
@@ -12,6 +13,45 @@
ACE_RCSID(ace, Sock_Connect, "$Id$")
+#if defined (ACE_WIN32)
+// Return value in buffer for a key/name pair from the Windows
+// Registry up to buf_len size.
+
+static int
+get_reg_value (const ACE_TCHAR *key,
+ const ACE_TCHAR *name,
+ ACE_TCHAR *buffer,
+ DWORD &buf_len)
+{
+ HKEY hk;
+ DWORD buf_type;
+ LONG rc = ACE_TEXT_RegOpenKeyEx (HKEY_LOCAL_MACHINE,
+ key,
+ 0,
+ KEY_READ,
+ &hk);
+ // 1. open key that defines the interfaces used for TCP/IP?
+ if (rc != ERROR_SUCCESS)
+ // print_error_string(ACE_LIB_TEXT ("RegOpenKeyEx"), rc);
+ return -1;
+
+ rc = ACE_TEXT_RegQueryValueEx (hk,
+ name,
+ 0,
+ &buf_type,
+ (u_char *) buffer,
+ &buf_len);
+ if (rc != ERROR_SUCCESS)
+ {
+ // print_error_string(ACE_LIB_TEXT ("RegEnumKeyEx"), rc);
+ RegCloseKey (hk);
+ return -2;
+ }
+
+ ::RegCloseKey (hk);
+ return 0;
+}
+#endif /* ACE_WIN32 */
// Bind socket to an unused port.