BIND 10 trac2117, updated. 76f1c23333f425a720560ec7b16631375a277836 upgrade up to asiodns

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Jul 6 07:39:57 UTC 2012


The branch, trac2117 has been updated
       via  76f1c23333f425a720560ec7b16631375a277836 (commit)
      from  e8786c8522ad40b8ecc47764abf74f2a05a12385 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 76f1c23333f425a720560ec7b16631375a277836
Author: Francis Dupont <fdupont at isc.org>
Date:   Fri Jul 6 09:39:30 2012 +0200

    upgrade up to asiodns

-----------------------------------------------------------------------

Summary of changes:
 WIN32-NOTES                                        |   71 ++++++++++++------
 ext/asio/asio/detail/impl/socket_ops.ipp           |   32 ++++++--
 ext/coroutine/coroutine.h                          |   23 ++++--
 src/lib/acl/acl.h                                  |    1 +
 src/lib/acl/check.h                                |    2 +
 src/lib/acl/dns.cc                                 |    4 +-
 src/lib/acl/dns.h                                  |   10 ++-
 src/lib/acl/dnsname_check.h                        |    1 +
 src/lib/acl/ip_check.cc                            |    8 +-
 src/lib/acl/ip_check.h                             |   13 ++--
 src/lib/{dns => acl}/lib.h                         |   14 ++--
 src/lib/acl/loader.cc                              |    5 +-
 src/lib/acl/loader.h                               |    9 ++-
 src/lib/acl/logic_check.h                          |   14 +++-
 src/lib/acl/tests/ip_check_unittest.cc             |    2 +
 src/lib/acl/tests/run_unittests.cc                 |   16 ++++
 src/lib/acl/tests/sockaddr.h                       |    4 +
 src/lib/asiodns/asiodns.h                          |    1 +
 src/lib/asiodns/dns_answer.h                       |    3 +-
 src/lib/asiodns/dns_lookup.h                       |    3 +-
 src/lib/asiodns/dns_server.h                       |    3 +-
 src/lib/asiodns/dns_service.cc                     |   32 ++++++--
 src/lib/asiodns/dns_service.h                      |   25 ++++++-
 src/lib/asiodns/io_fetch.cc                        |   18 ++++-
 src/lib/asiodns/io_fetch.h                         |    3 +-
 src/lib/{util/io => asiodns}/lib.h                 |   14 ++--
 src/lib/asiodns/logger.cc                          |    2 +
 src/lib/asiodns/logger.h                           |    1 +
 src/lib/asiodns/sync_udp_server.cc                 |   13 +++-
 src/lib/asiodns/sync_udp_server.h                  |   12 ++-
 src/lib/asiodns/tcp_server.cc                      |   15 +++-
 src/lib/asiodns/tcp_server.h                       |   12 ++-
 src/lib/asiodns/tests/dns_server_unittest.cc       |   77 +++++++++++++++++++-
 src/lib/asiodns/tests/dns_service_unittest.cc      |   44 ++++++++++-
 src/lib/asiodns/tests/io_fetch_unittest.cc         |   11 +++
 src/lib/asiodns/udp_server.cc                      |   30 ++++++--
 src/lib/asiodns/udp_server.h                       |   12 ++-
 src/lib/asiolink/asiolink.h                        |    2 +
 .../resolver.cc => asiolink/dummy_io_cb.cc}        |    8 +-
 src/lib/asiolink/dummy_io_cb.h                     |    3 +-
 src/lib/asiolink/interval_timer.cc                 |    2 +
 src/lib/asiolink/interval_timer.h                  |    3 +-
 src/lib/asiolink/io_address.cc                     |   16 +++-
 src/lib/asiolink/io_address.h                      |    5 +-
 src/lib/asiolink/io_asio_socket.h                  |   19 ++++-
 src/lib/asiolink/io_endpoint.cc                    |   15 +++-
 src/lib/asiolink/io_endpoint.h                     |   15 ++--
 .../io_error.cc}                                   |   16 ++--
 src/lib/asiolink/io_error.h                        |    3 +-
 .../resolver.cc => asiolink/io_message.cc}         |    8 +-
 src/lib/asiolink/io_message.h                      |    5 +-
 src/lib/asiolink/io_service.cc                     |    8 +-
 src/lib/asiolink/io_service.h                      |    4 +-
 src/lib/asiolink/io_socket.cc                      |    8 ++
 src/lib/asiolink/io_socket.h                       |   11 ++-
 src/lib/{dns => asiolink}/lib.h                    |   14 ++--
 .../resolver.cc => asiolink/simple_callback.cc}    |    8 +-
 src/lib/asiolink/simple_callback.h                 |    3 +-
 src/lib/asiolink/tcp_endpoint.h                    |    3 +-
 src/lib/asiolink/tcp_socket.h                      |   12 ++-
 src/lib/asiolink/tests/interval_timer_unittest.cc  |    3 +-
 src/lib/asiolink/tests/io_endpoint_unittest.cc     |    4 +
 src/lib/asiolink/tests/io_socket_unittest.cc       |    9 +++
 src/lib/asiolink/tests/tcp_socket_unittest.cc      |    6 ++
 src/lib/asiolink/tests/udp_socket_unittest.cc      |    6 ++
 src/lib/asiolink/udp_endpoint.h                    |    3 +-
 src/lib/asiolink/udp_socket.h                      |   10 ++-
 src/lib/bench/benchmark.h                          |    2 +
 src/lib/bench/benchmark_util.cc                    |    6 +-
 src/lib/bench/benchmark_util.h                     |   15 ++--
 src/lib/bench/example/search_bench.cc              |    9 +++
 src/lib/{log => bench}/lib.h                       |   14 ++--
 src/lib/bench/tests/benchmark_unittest.cc          |   18 +++++
 src/lib/cc/data.cc                                 |   26 +++++--
 src/lib/cc/data.h                                  |   49 ++++++++-----
 src/lib/{dns => cc}/lib.h                          |   14 ++--
 src/lib/cc/logger.cc                               |    2 +
 src/lib/cc/logger.h                                |    1 +
 src/lib/cc/session.cc                              |   48 +++++++++++-
 src/lib/cc/session.h                               |   13 +++-
 src/lib/cc/session_config.h.win32                  |    2 +
 src/lib/cc/tests/run_unittests.cc                  |   14 ++++
 src/lib/cc/tests/session_unittests.cc              |   57 ++++++++++++++-
 src/lib/cc/tests/session_unittests_config.h.win32  |    2 +
 src/lib/config/ccsession.cc                        |   25 ++++---
 src/lib/config/ccsession.h                         |   37 +++++-----
 src/lib/config/config_data.cc                      |    2 +
 src/lib/config/config_data.h                       |    5 +-
 src/lib/config/config_log.cc                       |    2 +
 src/lib/config/config_log.h                        |    1 +
 src/lib/{log => config}/lib.h                      |   14 ++--
 src/lib/config/module_spec.cc                      |   16 ++++
 src/lib/config/module_spec.h                       |   18 ++++-
 src/lib/config/tests/ccsession_unittests.cc        |    4 +
 ...nfig.h.in => data_def_unittests_config.h.win32} |    4 +-
 src/lib/config/tests/fake_session.cc               |   14 +++-
 src/lib/config/tests/fake_session.h                |   12 ++-
 NEWS => src/lib/xfr/NO_PORT_ON_WINDOWS             |    0
 src/lib/{log => xfr}/lib.h                         |   14 ++--
 src/lib/xfr/tests/run_unittests.cc                 |   15 ++++
 src/lib/xfr/xfrout_client.cc                       |   49 ++++++++++++-
 src/lib/xfr/xfrout_client.h                        |   23 ++++--
 win32build/VS2010/bind10.sln                       |   48 ++++++++++--
 win32build/VS2010/libacl/libacl.vcxproj            |   15 +++-
 win32build/VS2010/libacl/libacl.vcxproj.filters    |    6 ++
 .../VS2010/libacl_tests/libacl_tests.vcxproj       |   14 ++--
 win32build/VS2010/libasiodns/libasiodns.vcxproj    |   15 +++-
 .../VS2010/libasiodns/libasiodns.vcxproj.filters   |    6 ++
 .../libasiodns_tests/libasiodns_tests.vcxproj      |   12 +--
 win32build/VS2010/libasiolink/libasiolink.vcxproj  |   21 ++++--
 .../VS2010/libasiolink/libasiolink.vcxproj.filters |   18 +++++
 .../libasiolink_tests/libasiolink_tests.vcxproj    |   14 ++--
 win32build/VS2010/libbench/libbench.vcxproj        |   17 +++--
 .../VS2010/libbench/libbench.vcxproj.filters       |    6 ++
 .../libbench_example/libbench_example.vcxproj      |    8 +-
 .../VS2010/libbench_tests/libbench_tests.vcxproj   |   10 +--
 win32build/VS2010/libcc/libcc.vcxproj              |   17 +++--
 win32build/VS2010/libcc/libcc.vcxproj.filters      |    6 ++
 win32build/VS2010/libcc_tests/libcc_tests.vcxproj  |   14 ++--
 .../VS2010/libcfgclient/libcfgclient.vcxproj       |   17 +++--
 .../libcfgclient/libcfgclient.vcxproj.filters      |    6 ++
 .../libcfgclient_tests/libcfgclient_tests.vcxproj  |   12 +--
 win32build/VS2010/libdnsacl/libdnsacl.vcxproj      |   15 +++-
 .../VS2010/libdnsacl/libdnsacl.vcxproj.filters     |    6 ++
 .../VS2010/libfake_session/libfake_session.vcxproj |   14 +++-
 .../libfake_session.vcxproj.filters                |    3 +
 win32build/VS2010/libxfr/libxfr.vcxproj            |   17 +++--
 win32build/VS2010/libxfr/libxfr.vcxproj.filters    |    6 ++
 win32build/config.h                                |    4 +
 129 files changed, 1324 insertions(+), 362 deletions(-)
 copy src/lib/{dns => acl}/lib.h (81%)
 copy src/lib/{util/io => asiodns}/lib.h (79%)
 copy src/lib/{util/unittests/resolver.cc => asiolink/dummy_io_cb.cc} (86%)
 copy src/lib/{util/random/random_number_generator.cc => asiolink/io_error.cc} (75%)
 copy src/lib/{util/unittests/resolver.cc => asiolink/io_message.cc} (87%)
 copy src/lib/{dns => asiolink}/lib.h (79%)
 copy src/lib/{util/unittests/resolver.cc => asiolink/simple_callback.cc} (86%)
 copy src/lib/{log => bench}/lib.h (80%)
 copy src/lib/{dns => cc}/lib.h (81%)
 create mode 100644 src/lib/cc/session_config.h.win32
 create mode 100644 src/lib/cc/tests/session_unittests_config.h.win32
 copy src/lib/{log => config}/lib.h (80%)
 copy src/lib/config/tests/{data_def_unittests_config.h.in => data_def_unittests_config.h.win32} (86%)
 copy NEWS => src/lib/xfr/NO_PORT_ON_WINDOWS (100%)
 copy src/lib/{log => xfr}/lib.h (81%)

-----------------------------------------------------------------------
diff --git a/WIN32-NOTES b/WIN32-NOTES
index dc2db24..3b0f510 100644
--- a/WIN32-NOTES
+++ b/WIN32-NOTES
@@ -8,7 +8,8 @@ What is needed:
  - Visual Studio C++ (versions 2008 and 2010 were tested,
   (note older versions could fail to correctly compile,
   cf. C4373 warning), 2010 express and 64 bit support
-  from the 7.1 SDK work too)
+  from the 7.1 SDK work too. 2012 RC can't compile gtest
+  with its standard environment...)
 
  - python >= 3.1 (I got Cpython 3.2 MSI from python.org,
   note the pre-built python can give C++ runtime issue with
@@ -46,21 +47,32 @@ What is needed:
 
 Environment variables (with examples):
 
- - BOOST -> C:\Program Files\boost\boost_1_44
+ - BOOST -> C:\Program Files (x86)\boost\boost_1_47
 
  - BIND10HOME -> c:/cygwin/home/dupont/bind10
 
 How to compile google test:
 
  - remove the /MD -> /MT line in the CMakeLists.txt, use cmake
+  (in theory but it doesn't work for me)
 
- - *or* open the solution gtest-md in msvc (please note the rights
+ - *or* open the solution gtest[-md] in msvc (please note the rights
   of files in this directory must be fixed before)
 
+ - change the project to build a DLL, define GTEST_CREATE_SHARED_LIBRARY
+  to 1 (cf. the README), put /W4 for Debug, etc
+
  - please remember the same Visual Studio version must be used
   for gtest and bind10
 
- - msvc gives the gtestd.lib (in place of gtest.lib) for the debug version
+ - msvc gives the gtestd.dll (in place of gtest.dll) for the debug version
+  (a good thing when both Release and Debug are in path)
+
+How to compile botan:
+
+ - works well with a (second) Python in version 2.x installed
+
+ - modify the Debug (--enable-debug) Makefile to produce a botand.{dll,lib}
 
 How to recompile python:
 
@@ -91,19 +103,20 @@ How to recompile python:
 
 Where I put things (hardwired paths):
 
+ - previous versions use md10 or md9 for v100
+
  - <home>\bind10 for bind10 (BIND10HOME environment variable)
 
  - <home>\gtest\include
 
- - <home>\gtest\md10\{Debug,Release} gtest{d,}.lib and vc100.[ip]db, or,
-   <home>\gtest\md9\{Debug,Release} gtest{d,}.lib and vc90.[ip]db
+ - <home>\gtest\v100\{Debug,Release} gtest{d,}.{dll,lib} and vc100.*
 
- - <home>\botan\include and <home>\botan\md{9,10}\{Debug,Release}
+ - <home>\botan\include and <home>\botan\v100\{Debug,Release}
    (--disable-shared to get static libs, no DLL)
 
- - <home>\log4cplus\include and <home>\log4cplus\md{9,10}\{Debug,Release}
+ - <home>\log4cplus\include and <home>\log4cplus\v100\{Debug,Release}
 
- - "C:\Program Files\boost\boost_1_44" (the include and
+ - "C:\Program Files (x86)\boost\boost_1_47" (the include and
   sometimes the libraries (in lib, called by the auto_link) too,
   BOOST environment variable)
 
@@ -115,8 +128,8 @@ Where I put things (hardwired paths):
 
 How to compile:
 
- - open win32build\VS2010\bind10.sln file with Visual Studio 2010, or,
-   open win32build\VS2008\bind10.sln file with Visual Studio 2008
+ - open win32build\VS2010\bind10.sln file with Visual Studio 2010
+   (older win32build\VS2008\bind10.sln file with Visual Studio 2008)
 
  - fix the paths (\ becomes \\\ in grep/ed/etc)
 
@@ -131,33 +144,47 @@ Random notes (for porting new code):
  - cmake?
 
  - ifdefs: _WIN32 and _MSC_VER
- - for(int i; ... -very-often-> for(unsigned int i; ...
  - *no* <unistd.h> (or network includes)
- - <sys/time.h> -> <time.h>
+ - <sys/time.h> -> <time.h> alternative
  - missing general defines -> include <config.h> in front
  - missing less general defines -> conditionally include <winsock2.h>
  - missing TCP/IP defines -> conditionally include <ws2tcpip.h>
-  and perhaps <mswsock> too *before* asio
+  and perhaps <mswsock> too *before* asio (SIO_UDP_CONNRESET,
+  a Microsoft extension, is in mswsock for instance)
  - integer posix types -> include <stdint.h> (or <cstdint>)
- - "this" used too soon -> move to body
- - "=" with contants: standard private C4512 declaration
+ - assignment with contants: standard private C4512 declaration
+  (to be revised into derived from notassignable)
  - reuse_address is different in Windows
  - missing namespace:
   * error_code -> asio::error_code (both type and function)
   * shared_ptr -> boost::shared_ptr
+   (all should be fixed now)
  - *no* PF_UNIX (aka asio::local) sockets
  - *no* fork() (but can use threads)
  - unused variable in catch: simply remove it
  - sleep() or nanosleep() -> Sleep()
  - gettimeofday() -> GetSystemTimeAsFileTime() - SystemTimeToFileTime(epoch)
  - underscored function names: _getid, _read, _write (caution: convert
-  the handle before), 
- - defined misc names: min, max, IN, ERROR, NOERROR
+  the file handle before, for sockets WSAXxx calls), 
+ - defined misc names: IN, ERROR, NOERROR (done in config.h but used
+  in other system includes... undefining UNICODE can help too)
  - different names: close -> closesocket (and error is INVALID_SOCKET
   not < 0), errno -> WSAGetLastError()
- - different declarations: send, recv, 
+  (can use the asio socket_type too?)
+ - different declarations: send, recv, ...
  - WSAStartup/WSACleanup in main()
 
-Test status: (unittests failures)
- b10-dhcp6: can't work as Windows has no loopback interface...
-
+DLL specific:
+ - add dllmain.cc (it doesn't seem to be required anyway?)
+ - standard declaration trick in lib.h, included in all headers
+ - ISC_XXX_API for exported classes in headers, exported functions
+  and data (usually with extern for data) in headers and code files
+ - ISC_XXX_EXPORT at the top of all code files
+ - nothing for the templates, already done for Python modules
+ - can be required to instantiate classes (cf. util/buffer.cc)
+ - DLLs should go to .../win32build/VSxxxx/{Release,Debug}
+  (greatly simplify the PATH environment variable, BTW settable on the
+   Computer property, Advanced stuff)
+ - Release and Debug DLLs MUST get different names (put a final 'd' on
+  Debug) or the system runtime will select the wrong DLL!
+ - define GTEST_LINKED_AS_SHARED_LIBRARY=1 for gtest DLL users
diff --git a/ext/asio/asio/detail/impl/socket_ops.ipp b/ext/asio/asio/detail/impl/socket_ops.ipp
index a1b0ec6..c7d81ce 100644
--- a/ext/asio/asio/detail/impl/socket_ops.ipp
+++ b/ext/asio/asio/detail/impl/socket_ops.ipp
@@ -282,6 +282,9 @@ int close(socket_type s, state_type& state,
   int result = 0;
   if (s != invalid_socket)
   {
+    // We don't want the destructor to block, so set the socket to linger in
+    // the background. If the user doesn't like this behaviour then they need
+    // to explicitly close the socket.
     if (destruction && (state & user_set_linger))
     {
       ::linger opt;
@@ -303,21 +306,32 @@ int close(socket_type s, state_type& state,
         && (ec == asio::error::would_block
           || ec == asio::error::try_again))
     {
-#if defined(__SYMBIAN32__)
+      // According to UNIX Network Programming Vol. 1, it is possible for
+      // close() to fail with EWOULDBLOCK under certain circumstances. What
+      // isn't clear is the state of the descriptor after this error. The one
+      // current OS where this behaviour is seen, Windows, says that the socket
+      // remains open. Therefore we'll put the descriptor back into blocking
+      // mode and have another attempt at closing it.
+#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+      ioctl_arg_type arg = 0;
+      ::ioctlsocket(s, FIONBIO, &arg);
+#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# if defined(__SYMBIAN32__)
       int flags = ::fcntl(s, F_GETFL, 0);
       if (flags >= 0)
         ::fcntl(s, F_SETFL, flags & ~O_NONBLOCK);
-#else // defined(__SYMBIAN32__)
+# else // defined(__SYMBIAN32__)
       ioctl_arg_type arg = 0;
       ::ioctl(s, FIONBIO, &arg);
-#endif // defined(__SYMBIAN32__)
+# endif // defined(__SYMBIAN32__)
+#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
       state &= ~non_blocking;
 
-    clear_last_error();
+      clear_last_error();
 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
-    result = error_wrapper(::closesocket(s), ec);
+      result = error_wrapper(::closesocket(s), ec);
 #else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
-    result = error_wrapper(::close(s), ec);
+      result = error_wrapper(::close(s), ec);
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
     }
   }
@@ -1721,7 +1735,8 @@ const char* inet_ntop(int af, const void* src, char* dest, size_t length,
     using namespace std; // For strcat and sprintf.
     char if_name[IF_NAMESIZE + 1] = "%";
     const in6_addr_type* ipv6_address = static_cast<const in6_addr_type*>(src);
-    bool is_link_local = IN6_IS_ADDR_LINKLOCAL(ipv6_address);
+    bool is_link_local = ((ipv6_address->s6_addr[0] == 0xfe)
+        && ((ipv6_address->s6_addr[1] & 0xc0) == 0x80));
     if (!is_link_local || if_indextoname(scope_id, if_name + 1) == 0)
       sprintf(if_name + 1, "%lu", scope_id);
     strcat(dest, if_name);
@@ -1806,7 +1821,8 @@ int inet_pton(int af, const char* src, void* dest,
     if (const char* if_name = strchr(src, '%'))
     {
       in6_addr_type* ipv6_address = static_cast<in6_addr_type*>(dest);
-      bool is_link_local = IN6_IS_ADDR_LINKLOCAL(ipv6_address);
+      bool is_link_local = ((ipv6_address->s6_addr[0] == 0xfe)
+          && ((ipv6_address->s6_addr[1] & 0xc0) == 0x80));
       if (is_link_local)
         *scope_id = if_nametoindex(if_name + 1);
       if (*scope_id == 0)
diff --git a/ext/coroutine/coroutine.h b/ext/coroutine/coroutine.h
index 985888b..4ddda48 100644
--- a/ext/coroutine/coroutine.h
+++ b/ext/coroutine/coroutine.h
@@ -104,11 +104,11 @@ private:
     } \
     else case 0:
 
-#define CORO_YIELD \
-  for (_coro_value = __LINE__;;) \
+#define CORO_YIELD_IMPL(n)       \
+  for (_coro_value = (n);;) \
     if (_coro_value == 0) \
     { \
-      case __LINE__: ; \
+      case (n): ; \
       break; \
     } \
     else \
@@ -121,13 +121,22 @@ private:
               goto bail_out_of_coroutine; \
             else case 0:
 
-#define CORO_FORK \
-  for (_coro_value = -__LINE__;; _coro_value = __LINE__) \
-    if (_coro_value == __LINE__) \
+#define CORO_FORK_IMPL(n)                      \
+  for (_coro_value = -(n);; _coro_value = (n)) \
+    if (_coro_value == (n)) \
     { \
-      case -__LINE__: ; \
+      case -(n): ; \
       break; \
     } \
     else
+
+#if defined(_MSC_VER)
+# define CORO_YIELD CORO_YIELD_IMPL(__COUNTER__ + 1)
+# define CORO_FORK CORO_FORK_IMPL(__COUNTER__ + 1)
+#else // defined(_MSC_VER)
+# define CORO_YIELD CORO_YIELD_IMPL(__LINE__)
+# define CORO_FORK CORO_FORK_IMPL(__LINE__)
+#endif // defined(_MSC_VER)
+
 #endif // COROUTINE_HPP
 
diff --git a/src/lib/acl/acl.h b/src/lib/acl/acl.h
index 76039c9..0b0027e 100644
--- a/src/lib/acl/acl.h
+++ b/src/lib/acl/acl.h
@@ -15,6 +15,7 @@
 #ifndef ACL_ACL_H
 #define ACL_ACL_H
 
+#include <acl/lib.h>
 #include "check.h"
 #include <vector>
 
diff --git a/src/lib/acl/check.h b/src/lib/acl/check.h
index 3297d4b..47486e7 100644
--- a/src/lib/acl/check.h
+++ b/src/lib/acl/check.h
@@ -19,6 +19,8 @@
 #include <typeinfo>
 #include <sstream>
 
+#include <acl/lib.h>
+
 namespace isc {
 namespace acl {
 
diff --git a/src/lib/acl/dns.cc b/src/lib/acl/dns.cc
index d16ec65..d825de5 100644
--- a/src/lib/acl/dns.cc
+++ b/src/lib/acl/dns.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBACL_EXPORT
+
 #include <memory>
 #include <string>
 #include <vector>
@@ -104,7 +106,7 @@ internal::RequestCheckCreator::create(const string& name,
     }
 }
 
-RequestLoader&
+ISC_LIBACL_API RequestLoader&
 getRequestLoader() {
     static RequestLoader* loader(NULL);
     if (loader == NULL) {
diff --git a/src/lib/acl/dns.h b/src/lib/acl/dns.h
index d08fcf3..e697124 100644
--- a/src/lib/acl/dns.h
+++ b/src/lib/acl/dns.h
@@ -22,13 +22,14 @@
 
 #include <cc/data.h>
 
+#include <acl/lib.h>
 #include <acl/ip_check.h>
 #include <acl/dnsname_check.h>
 #include <acl/loader.h>
 
 namespace isc {
 namespace dns {
-class TSIGRecord;
+class ISC_LIBACL_API TSIGRecord;
 }
 namespace acl {
 namespace dns {
@@ -63,7 +64,7 @@ namespace dns {
  * are the local (destination) IP address, the remote and local port numbers,
  * various fields of the DNS request (e.g. a particular header flag value).
  */
-struct RequestContext {
+struct ISC_LIBACL_API RequestContext {
     /// The constructor
     ///
     /// This is a trivial constructor that perform straightforward
@@ -116,7 +117,7 @@ typedef acl::Loader<RequestContext> RequestLoader;
  * one is enough, this one will have registered default checks and it
  * is known one, so any plugins can registrer additional checks as well.
  */
-RequestLoader& getRequestLoader();
+ISC_LIBACL_API RequestLoader& getRequestLoader();
 
 // The following is essentially private to the implementation and could
 // be hidden in the implementation file.  But it's visible via this header
@@ -129,7 +130,8 @@ namespace internal {
 typedef isc::acl::IPCheck<RequestContext> RequestIPCheck;
 typedef isc::acl::dns::NameCheck<RequestContext> RequestKeyCheck;
 
-class RequestCheckCreator : public acl::Loader<RequestContext>::CheckCreator {
+class ISC_LIBACL_API RequestCheckCreator :
+ public acl::Loader<RequestContext>::CheckCreator {
 public:
     virtual std::vector<std::string> names() const;
 
diff --git a/src/lib/acl/dnsname_check.h b/src/lib/acl/dnsname_check.h
index 7498d99..0faee2a 100644
--- a/src/lib/acl/dnsname_check.h
+++ b/src/lib/acl/dnsname_check.h
@@ -17,6 +17,7 @@
 
 #include <dns/name.h>
 
+#include <acl/lib.h>
 #include <acl/check.h>
 
 namespace isc {
diff --git a/src/lib/acl/ip_check.cc b/src/lib/acl/ip_check.cc
index 7192064..cad9437 100644
--- a/src/lib/acl/ip_check.cc
+++ b/src/lib/acl/ip_check.cc
@@ -12,8 +12,12 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBACL_EXPORT
+
+#ifndef _WIN32
 #include <sys/types.h>
 #include <sys/socket.h>
+#endif
 
 #include <exceptions/exceptions.h>
 
@@ -28,7 +32,7 @@ namespace isc {
 namespace acl {
 namespace internal {
 
-uint8_t
+ISC_LIBACL_API uint8_t
 createMask(size_t prefixlen) {
 
     if (prefixlen == 0) {
@@ -63,7 +67,7 @@ createMask(size_t prefixlen) {
     isc_throw(isc::OutOfRange, "prefixlen argument must be between 0 and 8");
 }
 
-pair<string, int>
+ISC_LIBACL_API pair<string, int>
 splitIPAddress(const string& ipprefix) {
 
     // Split string into its components - an address and a prefix length.
diff --git a/src/lib/acl/ip_check.h b/src/lib/acl/ip_check.h
index 794b943..693c02f 100644
--- a/src/lib/acl/ip_check.h
+++ b/src/lib/acl/ip_check.h
@@ -15,8 +15,6 @@
 #ifndef __IP_CHECK_H
 #define __IP_CHECK_H
 
-#include <sys/socket.h>
-
 #include <algorithm>
 #include <cassert>
 #include <functional>
@@ -25,10 +23,15 @@
 #include <boost/static_assert.hpp>
 
 #include <stdint.h>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
 #include <sys/socket.h> // for AF_INET/AF_INET6
 #include <netinet/in.h>
+#endif
 
+#include <acl/lib.h>
 #include <acl/check.h>
 #include <exceptions/exceptions.h>
 #include <util/strutil.h>
@@ -57,7 +60,7 @@ namespace internal {
 ///
 /// \exception OutOfRange prefixlen is too large for the data type.
 
-uint8_t createMask(size_t prefixlen);
+ISC_LIBACL_API uint8_t createMask(size_t prefixlen);
 
 /// \brief Split IP Address Prefix
 ///
@@ -78,7 +81,7 @@ uint8_t createMask(size_t prefixlen);
 ///
 /// \exception InvalidParameter Address prefix not of the expected syntax
 
-std::pair<std::string, int>
+ISC_LIBACL_API std::pair<std::string, int>
 splitIPAddress(const std::string& ipprefix);
 
 } // namespace internal
@@ -108,7 +111,7 @@ splitIPAddress(const std::string& ipprefix);
 ///
 /// In future, we may introduce the default constructor to further improve
 /// reusability.
-struct IPAddress {
+struct ISC_LIBACL_API IPAddress {
     /// The constructor from socket address structure.
     ///
     /// This constructor set up the internal data based on the actual type
diff --git a/src/lib/acl/lib.h b/src/lib/acl/lib.h
new file mode 100644
index 0000000..994efba
--- /dev/null
+++ b/src/lib/acl/lib.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBACL_H
+#define __LIBACL_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBACL_API
+#else
+#ifdef ISC_LIBACL_EXPORT
+#define ISC_LIBACL_API __declspec(dllexport)
+#else
+#define ISC_LIBACL_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBACL_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/acl/loader.cc b/src/lib/acl/loader.cc
index 8ca7e28..3a6b6ff 100644
--- a/src/lib/acl/loader.cc
+++ b/src/lib/acl/loader.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBACL_EXPORT
+
 #include "loader.h"
 
 using namespace std;
@@ -19,7 +21,8 @@ using namespace std;
 namespace isc {
 namespace acl {
 
-BasicAction defaultActionLoader(data::ConstElementPtr actionEl) {
+ISC_LIBACL_API BasicAction
+defaultActionLoader(data::ConstElementPtr actionEl) {
     try {
         const string action(actionEl->stringValue());
         if (action == "ACCEPT") {
diff --git a/src/lib/acl/loader.h b/src/lib/acl/loader.h
index fc69b44..81ace07 100644
--- a/src/lib/acl/loader.h
+++ b/src/lib/acl/loader.h
@@ -16,6 +16,7 @@
 #define ACL_LOADER_H
 
 #include <exceptions/exceptions.h>
+#include <acl/lib.h>
 #include <acl/acl.h>
 #include <cc/data.h>
 #include <boost/function.hpp>
@@ -25,8 +26,8 @@
 namespace isc {
 namespace acl {
 
-class AnyOfSpec;
-class AllOfSpec;
+class ISC_LIBACL_API AnyOfSpec;
+class ISC_LIBACL_API AllOfSpec;
 template<typename Mode, typename Context> class LogicOperator;
 
 /**
@@ -40,7 +41,7 @@ template<typename Mode, typename Context> class LogicOperator;
  *
  * Checks may subclass this exception for similar errors if they see it fit.
  */
-class LoaderError : public BadValue {
+class ISC_LIBACL_API LoaderError : public BadValue {
 private:
     const data::ConstElementPtr element_;
 public:
@@ -85,7 +86,7 @@ public:
  *     and contain one of "ACCEPT", "REJECT" or "DROP.
  * \note We could define different names or add aliases if needed.
  */
-BasicAction defaultActionLoader(data::ConstElementPtr action);
+ISC_LIBACL_API BasicAction defaultActionLoader(data::ConstElementPtr action);
 
 /**
  * \brief Loader of ACLs.
diff --git a/src/lib/acl/logic_check.h b/src/lib/acl/logic_check.h
index 92441e8..099a10e 100644
--- a/src/lib/acl/logic_check.h
+++ b/src/lib/acl/logic_check.h
@@ -15,6 +15,12 @@
 #ifndef ACL_LOGIC_CHECK_H
 #define ACL_LOGIC_CHECK_H
 
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4512)
+#endif
+
+#include <acl/lib.h>
 #include "check.h"
 #include "loader.h"
 
@@ -22,7 +28,7 @@ namespace isc {
 namespace acl {
 
 /// \brief Constants for the AnyOf implementation
-class AnyOfSpec {
+class ISC_LIBACL_API AnyOfSpec {
 public:
     static bool start() { return (false); }
     static bool terminate(const bool another) {
@@ -31,7 +37,7 @@ public:
 };
 
 /// \brief Constants for the AllOf implementation
-class AllOfSpec {
+class ISC_LIBACL_API AllOfSpec {
 public:
     static bool start() { return (true); }
     static bool terminate(const bool another) {
@@ -283,4 +289,8 @@ public:
 }
 }
 
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
 #endif
diff --git a/src/lib/acl/tests/ip_check_unittest.cc b/src/lib/acl/tests/ip_check_unittest.cc
index 5f40baa..5a21524 100644
--- a/src/lib/acl/tests/ip_check_unittest.cc
+++ b/src/lib/acl/tests/ip_check_unittest.cc
@@ -12,8 +12,10 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#ifndef _WIN32
 #include <sys/types.h>
 #include <sys/socket.h>
+#endif
 #include <string.h>
 
 #include <gtest/gtest.h>
diff --git a/src/lib/acl/tests/run_unittests.cc b/src/lib/acl/tests/run_unittests.cc
index 8dc59a2..a26d782 100644
--- a/src/lib/acl/tests/run_unittests.cc
+++ b/src/lib/acl/tests/run_unittests.cc
@@ -12,6 +12,12 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
 #include <gtest/gtest.h>
 #include <log/logger_support.h>
 #include <util/unittests/run_all.h>
@@ -19,6 +25,16 @@
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
+
     isc::log::initLogger();
+
+#ifdef _WIN32
+    WSADATA wsaData;
+    WSAStartup(MAKEWORD(2,2), &wsaData);
+    int ret = isc::util::unittests::run_all();
+    WSACleanup();
+    return (ret);
+#else
     return (isc::util::unittests::run_all());
+#endif
 }
diff --git a/src/lib/acl/tests/sockaddr.h b/src/lib/acl/tests/sockaddr.h
index bd30451..a222f4f 100644
--- a/src/lib/acl/tests/sockaddr.h
+++ b/src/lib/acl/tests/sockaddr.h
@@ -15,9 +15,13 @@
 #ifndef __ACL_TEST_SOCKADDR_H
 #define __ACL_TEST_SOCKADDR_H 1
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netdb.h>
+#endif
 #include <string.h>
 
 #include <exceptions/exceptions.h>
diff --git a/src/lib/asiodns/asiodns.h b/src/lib/asiodns/asiodns.h
index 8791a72..ce9a552 100644
--- a/src/lib/asiodns/asiodns.h
+++ b/src/lib/asiodns/asiodns.h
@@ -15,6 +15,7 @@
 #ifndef __ASIODNS_H
 #define __ASIODNS_H 1
 
+#include <asiodns/lib.h>
 #include <asiodns/dns_service.h>
 #include <asiodns/dns_server.h>
 #include <asiodns/dns_lookup.h>
diff --git a/src/lib/asiodns/dns_answer.h b/src/lib/asiodns/dns_answer.h
index 3654369..757430e 100644
--- a/src/lib/asiodns/dns_answer.h
+++ b/src/lib/asiodns/dns_answer.h
@@ -18,6 +18,7 @@
 #include <asiolink/io_message.h>
 #include <util/buffer.h>
 #include <dns/message.h>
+#include <asiodns/lib.h>
 
 namespace isc {
 namespace asiodns {
@@ -35,7 +36,7 @@ namespace asiodns {
 /// from a DNS Lookup provider functon and readies it to be sent to the
 /// client.  After it has run, the OutputBuffer object passed to it should
 /// contain the answer to the query rendered into wire format.
-class DNSAnswer {
+class ISC_LIBASIODNS_API DNSAnswer {
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/asiodns/dns_lookup.h b/src/lib/asiodns/dns_lookup.h
index 5dc84ac..31d13e1 100644
--- a/src/lib/asiodns/dns_lookup.h
+++ b/src/lib/asiodns/dns_lookup.h
@@ -16,6 +16,7 @@
 #define __ASIOLINK_DNS_LOOKUP_H 1
 
 #include <asiolink/io_message.h>
+#include <asiodns/lib.h>
 #include <asiodns/dns_server.h>
 #include <dns/message.h>
 #include <util/buffer.h>
@@ -36,7 +37,7 @@ namespace asiodns {
 /// a DNS query (e.g., from authoritative data source, cache, or upstream
 /// query).  After it has run, the OutputBuffer object passed to it
 /// should contain the answer to the query, in an internal representation.
-class DNSLookup {
+class ISC_LIBASIODNS_API DNSLookup {
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/asiodns/dns_server.h b/src/lib/asiodns/dns_server.h
index 119aa66..4c41e9a 100644
--- a/src/lib/asiodns/dns_server.h
+++ b/src/lib/asiodns/dns_server.h
@@ -16,6 +16,7 @@
 #define __ASIOLINK_DNS_SERVER_H 1
 
 #include <asiolink/io_message.h>
+#include <asiodns/lib.h>
 
 namespace isc {
 namespace asiodns {
@@ -45,7 +46,7 @@ namespace asiodns {
 ///
 /// Because these objects are frequently copied, it is recommended
 /// that derived classes be kept small to reduce copy overhead.
-class DNSServer {
+class ISC_LIBASIODNS_API DNSServer {
 protected:
     ///
     /// \name Constructors and destructors
diff --git a/src/lib/asiodns/dns_service.cc b/src/lib/asiodns/dns_service.cc
index 2cfdea5..d5243d6 100644
--- a/src/lib/asiodns/dns_service.cc
+++ b/src/lib/asiodns/dns_service.cc
@@ -12,8 +12,15 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBASIODNS_EXPORT
+
 #include <config.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#endif
+
 #include <exceptions/exceptions.h>
 
 #include <dns_service.h>
@@ -32,8 +39,8 @@ using namespace isc::asiolink;
 namespace isc {
 namespace asiodns {
 
-class DNSLookup;
-class DNSAnswer;
+class ISC_LIBASIODNS_API DNSLookup;
+class ISC_LIBASIODNS_API DNSAnswer;
 
 class DNSServiceImpl {
 public:
@@ -54,7 +61,12 @@ public:
     DNSLookup* lookup_;
     DNSAnswer* answer_;
 
-    template<class Ptr, class Server> void addServerFromFD(int fd, int af) {
+#ifdef _WIN32
+    template<class Ptr, class Server> void addServerFromFD(SOCKET fd, int af)
+#else
+    template<class Ptr, class Server> void addServerFromFD(int fd, int af)
+#endif
+    {
         Ptr server(new Server(io_service_.get_io_service(), fd, af, checkin_,
                               lookup_, answer_));
         (*server)();
@@ -73,11 +85,21 @@ DNSService::~DNSService() {
     delete impl_;
 }
 
-void DNSService::addServerTCPFromFD(int fd, int af) {
+#ifdef _WIN32
+void DNSService::addServerTCPFromFD(SOCKET fd, int af)
+#else
+void DNSService::addServerTCPFromFD(int fd, int af)
+#endif
+{
     impl_->addServerFromFD<DNSServiceImpl::TCPServerPtr, TCPServer>(fd, af);
 }
 
-void DNSService::addServerUDPFromFD(int fd, int af, ServerFlag options) {
+#ifdef _WIN32
+void DNSService::addServerUDPFromFD(SOCKET fd, int af, ServerFlag options)
+#else
+void DNSService::addServerUDPFromFD(int fd, int af, ServerFlag options)
+#endif
+{
     if ((~SERVER_DEFINED_FLAGS & static_cast<unsigned int>(options)) != 0) {
         isc_throw(isc::InvalidParameter, "Invalid DNS/UDP server option: "
                   << options);
diff --git a/src/lib/asiodns/dns_service.h b/src/lib/asiodns/dns_service.h
index 8f2f6d7..1d948cf 100644
--- a/src/lib/asiodns/dns_service.h
+++ b/src/lib/asiodns/dns_service.h
@@ -20,11 +20,13 @@
 #include <asiolink/io_service.h>
 #include <asiolink/simple_callback.h>
 
+#include <asiodns/lib.h>
+
 namespace isc {
 namespace asiodns {
 
-class DNSLookup;
-class DNSAnswer;
+class ISC_LIBASIODNS_API DNSLookup;
+class ISC_LIBASIODNS_API DNSAnswer;
 class DNSServiceImpl;
 
 /// \brief A base class for common \c DNSService interfaces.
@@ -38,7 +40,7 @@ class DNSServiceImpl;
 /// For this reason most of the detailed description are given in the
 /// \c DNSService class.  See that for further details of specific methods
 /// and class behaviors.
-class DNSServiceBase {
+class ISC_LIBASIODNS_API DNSServiceBase {
 protected:
     /// \brief Default constructor.
     ///
@@ -79,9 +81,15 @@ public:
     /// \brief The destructor.
     virtual ~DNSServiceBase() {}
 
+#ifdef _WIN32
+    virtual void addServerTCPFromFD(SOCKET fd, int af) = 0;
+    virtual void addServerUDPFromFD(SOCKET fd, int af,
+                                    ServerFlag options = SERVER_DEFAULT) = 0;
+#else
     virtual void addServerTCPFromFD(int fd, int af) = 0;
     virtual void addServerUDPFromFD(int fd, int af,
                                     ServerFlag options = SERVER_DEFAULT) = 0;
+#endif
     virtual void clearServers() = 0;
 
     virtual asiolink::IOService& getIOService() = 0;
@@ -94,7 +102,7 @@ public:
 /// logic that is shared between the authoritative and the recursive
 /// server implementations. As such, it handles asio, including config
 /// updates (through the 'Checkinprovider'), and listening sockets.
-class DNSService : public DNSServiceBase {
+class ISC_LIBASIODNS_API DNSService : public DNSServiceBase {
     ///
     /// \name Constructors and Destructor
     ///
@@ -148,7 +156,11 @@ public:
     /// \throw isc::InvalidParameter if af is neither AF_INET nor AF_INET6.
     /// \throw isc::asiolink::IOError when a low-level error happens, like the
     ///     fd is not a valid descriptor or it can't be listened on.
+#ifdef _WIN32
+    virtual void addServerTCPFromFD(SOCKET fd, int af);
+#else
     virtual void addServerTCPFromFD(int fd, int af);
+#endif
 
     /// \brief Add another UDP server to the service from already opened
     ///    file descriptor
@@ -168,8 +180,13 @@ public:
     ///     or the given \c options include an unsupported or invalid value.
     /// \throw isc::asiolink::IOError when a low-level error happens, like the
     ///     fd is not a valid descriptor or it can't be listened on.
+#ifdef _WIN32
+    virtual void addServerUDPFromFD(SOCKET fd, int af,
+                                    ServerFlag options = SERVER_DEFAULT);
+#else
     virtual void addServerUDPFromFD(int fd, int af,
                                     ServerFlag options = SERVER_DEFAULT);
+#endif
 
     /// \brief Remove all servers from the service
     void clearServers();
diff --git a/src/lib/asiodns/io_fetch.cc b/src/lib/asiodns/io_fetch.cc
index eed5fdf..ed38003 100644
--- a/src/lib/asiodns/io_fetch.cc
+++ b/src/lib/asiodns/io_fetch.cc
@@ -12,12 +12,19 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBASIODNS_EXPORT
+
 #include <config.h>
+#include <stdint.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#else
 #include <unistd.h>             // for some IPC/network system calls
 #include <netinet/in.h>
-#include <stdint.h>
 #include <sys/socket.h>
+#endif
 
 #include <boost/bind.hpp>
 #include <boost/scoped_ptr.hpp>
@@ -46,6 +53,11 @@
 
 #include <asiodns/logger.h>
 
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4351)
+#endif
+
 using namespace asio;
 using namespace isc::asiolink;
 using namespace isc::dns;
@@ -420,3 +432,7 @@ void IOFetch::logIOFailure(asio::error_code ec) {
 
 } // namespace asiodns
 } // namespace isc {
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
diff --git a/src/lib/asiodns/io_fetch.h b/src/lib/asiodns/io_fetch.h
index 78c2da9..a8b615a 100644
--- a/src/lib/asiodns/io_fetch.h
+++ b/src/lib/asiodns/io_fetch.h
@@ -26,6 +26,7 @@
 #include <asio/error_code.hpp>
 #include <asiolink/io_address.h>
 #include <asiolink/io_service.h>
+#include <asiodns/lib.h>
 
 #include <util/buffer.h>
 #include <dns/question.h>
@@ -43,7 +44,7 @@ struct IOFetchData;
 ///
 /// \param E Endpoint type to use.
 
-class IOFetch : public coroutine {
+class ISC_LIBASIODNS_API IOFetch : public coroutine {
 public:
     /// \brief Protocol to use on the fetch
     enum Protocol {
diff --git a/src/lib/asiodns/lib.h b/src/lib/asiodns/lib.h
new file mode 100644
index 0000000..f0860c9
--- /dev/null
+++ b/src/lib/asiodns/lib.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBASIODNS_H
+#define __LIBASIODNS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBASIODNS_API
+#else
+#ifdef ISC_LIBASIODNS_EXPORT
+#define ISC_LIBASIODNS_API __declspec(dllexport)
+#else
+#define ISC_LIBASIODNS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBASIODNS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/asiodns/logger.cc b/src/lib/asiodns/logger.cc
index 5801a0b..f843f20 100644
--- a/src/lib/asiodns/logger.cc
+++ b/src/lib/asiodns/logger.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBASIODNS_EXPORT
+
 #include <asiodns/logger.h>
 
 namespace isc {
diff --git a/src/lib/asiodns/logger.h b/src/lib/asiodns/logger.h
index 306d463..db5d1bb 100644
--- a/src/lib/asiodns/logger.h
+++ b/src/lib/asiodns/logger.h
@@ -15,6 +15,7 @@
 #include <log/logger.h>
 #include <log/macros.h>
 #include <log/log_dbglevels.h>
+#include <asiodns/lib.h>
 #include <asiodns/asiodns_messages.h>
 
 namespace isc {
diff --git a/src/lib/asiodns/sync_udp_server.cc b/src/lib/asiodns/sync_udp_server.cc
index a31301d..1734a25 100644
--- a/src/lib/asiodns/sync_udp_server.cc
+++ b/src/lib/asiodns/sync_udp_server.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBASIODNS_EXPORT
+
 #include <config.h>
 
 #include <asio.hpp>
@@ -26,10 +28,14 @@
 
 #include <boost/bind.hpp>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <sys/types.h>
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <unistd.h>             // for some IPC/network system calls
+#endif
 #include <errno.h>
 
 using namespace std;
@@ -38,7 +44,12 @@ using namespace isc::asiolink;
 namespace isc {
 namespace asiodns {
 
-SyncUDPServer::SyncUDPServer(asio::io_service& io_service, const int fd,
+SyncUDPServer::SyncUDPServer(asio::io_service& io_service,
+#ifdef _WIN32
+                             const SOCKET fd,
+#else
+                             const int fd,
+#endif
                              const int af, asiolink::SimpleCallback* checkin,
                              DNSLookup* lookup, DNSAnswer* answer) :
     output_buffer_(new isc::util::OutputBuffer(0)),
diff --git a/src/lib/asiodns/sync_udp_server.h b/src/lib/asiodns/sync_udp_server.h
index 9718422..d42b962 100644
--- a/src/lib/asiodns/sync_udp_server.h
+++ b/src/lib/asiodns/sync_udp_server.h
@@ -19,6 +19,7 @@
 #error "asio.hpp must be included before including this, see asiolink.h as to why"
 #endif
 
+#include <asiodns/lib.h>
 #include "dns_answer.h"
 #include "dns_lookup.h"
 #include "dns_server.h"
@@ -40,7 +41,8 @@ namespace asiodns {
 /// That means, the lookup handler must provide the answer right away.
 /// This allows for implementation with less overhead, compared with
 /// the UDPClass.
-class SyncUDPServer : public DNSServer, public boost::noncopyable {
+class ISC_LIBASIODNS_API SyncUDPServer :
+ public DNSServer, public boost::noncopyable {
 public:
     /// \brief Constructor
     /// \param io_service the asio::io_service to work with
@@ -52,7 +54,13 @@ public:
     /// \throw isc::InvalidParameter if af is neither AF_INET nor AF_INET6
     /// \throw isc::asiolink::IOError when a low-level error happens, like the
     ///     fd is not a valid descriptor.
-    SyncUDPServer(asio::io_service& io_service, const int fd, const int af,
+    SyncUDPServer(asio::io_service& io_service,
+#ifdef _WIN32
+                  const SOCKET fd,
+#else
+                  const int fd,
+#endif
+                  const int af,
                   isc::asiolink::SimpleCallback* checkin = NULL,
                   DNSLookup* lookup = NULL, DNSAnswer* answer = NULL);
 
diff --git a/src/lib/asiodns/tcp_server.cc b/src/lib/asiodns/tcp_server.cc
index 8e4b4d6..cfcbde8 100644
--- a/src/lib/asiodns/tcp_server.cc
+++ b/src/lib/asiodns/tcp_server.cc
@@ -12,11 +12,18 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBASIODNS_EXPORT
+
 #include <config.h>
+#include <stdint.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <unistd.h>             // for some IPC/network system calls
 #include <netinet/in.h>
 #include <sys/socket.h>
+#endif
 #include <errno.h>
 
 #include <boost/shared_array.hpp>
@@ -47,7 +54,13 @@ namespace asiodns {
 /// The following functions implement the \c TCPServer class.
 ///
 /// The constructor
-TCPServer::TCPServer(io_service& io_service, int fd, int af,
+TCPServer::TCPServer(io_service& io_service,
+#ifdef _WIN32
+                     SOCKET fd,
+#else
+                     int fd,
+#endif
+                     int af,
                      const SimpleCallback* checkin,
                      const DNSLookup* lookup,
                      const DNSAnswer* answer) :
diff --git a/src/lib/asiodns/tcp_server.h b/src/lib/asiodns/tcp_server.h
index 01695e4..d53fb37 100644
--- a/src/lib/asiodns/tcp_server.h
+++ b/src/lib/asiodns/tcp_server.h
@@ -24,6 +24,7 @@
 
 #include <asiolink/asiolink.h>
 #include <coroutine.h>
+#include <asiodns/lib.h>
 #include "dns_server.h"
 #include "dns_lookup.h"
 #include "dns_answer.h"
@@ -35,7 +36,8 @@ namespace asiodns {
 ///
 /// This class inherits from both \c DNSServer and from \c coroutine,
 /// defined in coroutine.h. 
-class TCPServer : public virtual DNSServer, public virtual coroutine {
+class ISC_LIBASIODNS_API TCPServer :
+ public virtual DNSServer, public virtual coroutine {
 public:
     /// \brief Constructor
     /// \param io_service the asio::io_service to work with
@@ -47,7 +49,13 @@ public:
     /// \throw isc::InvalidParameter if af is neither AF_INET nor AF_INET6
     /// \throw isc::asiolink::IOError when a low-level error happens, like the
     ///     fd is not a valid descriptor or it can't be listened on.
-    TCPServer(asio::io_service& io_service, int fd, int af,
+    TCPServer(asio::io_service& io_service,
+#ifdef _WIN32
+              SOCKET fd,
+#else
+              int fd,
+#endif
+              int af,
               const isc::asiolink::SimpleCallback* checkin = NULL,
               const DNSLookup* lookup = NULL, const DNSAnswer* answer = NULL);
 
diff --git a/src/lib/asiodns/tests/dns_server_unittest.cc b/src/lib/asiodns/tests/dns_server_unittest.cc
index a5e83c7..04b6210 100644
--- a/src/lib/asiodns/tests/dns_server_unittest.cc
+++ b/src/lib/asiodns/tests/dns_server_unittest.cc
@@ -13,6 +13,7 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 #include <config.h>
+#include <stdint.h>
 #include <gtest/gtest.h>
 
 #include <asio.hpp>
@@ -27,14 +28,18 @@
 #include <cstring>
 #include <cerrno>
 #include <csignal>
+#ifndef _WIN32
 #include <unistd.h> //for alarm
+#endif
 
 #include <boost/shared_ptr.hpp>
 #include <boost/bind.hpp>
 #include <boost/function.hpp>
 
+#ifndef _WIN32
 #include <sys/types.h>
 #include <sys/socket.h>
+#endif
 
 /// The following tests focus on stop interface for udp and
 /// tcp server, there are lots of things can be shared to test
@@ -376,6 +381,16 @@ class DNSServerTestBase : public::testing::Test {
             // Since thread hasn't been introduced into the tool box, using
             // signal to make sure run function will eventually return even
             // server stop failed
+#ifdef _WIN32
+            UINT_PTR id = 1;
+            SetTimer(NULL, id, IO_SERVICE_TIME_OUT * 1000,
+                     DNSServerTestBase::stopIOService);
+            current_service = &service;
+            service.run();
+            service.reset();
+            //cancel scheduled alarm
+            KillTimer(NULL, id);
+#else
             void (*prev_handler)(int) =
                 std::signal(SIGALRM, DNSServerTestBase::stopIOService);
             current_service = &service;
@@ -385,9 +400,19 @@ class DNSServerTestBase : public::testing::Test {
             //cancel scheduled alarm
             alarm(0);
             std::signal(SIGALRM, prev_handler);
+#endif
         }
 
-        static void stopIOService(int _no_use_parameter) {
+#ifdef _WIN32
+        static void CALLBACK stopIOService(
+            HWND _no_use_hwnd,
+            UINT _no_use_umsg,
+            UINT_PTR _no_use_idevent,
+            DWORD _no_use_dwtime)
+#else
+        static void stopIOService(int _no_use_parameter)
+#endif
+        {
             io_service_is_time_out = true;
             if (current_service != NULL) {
                 current_service->stop();
@@ -422,7 +447,12 @@ private:
     // It uses the low-level C api, as it seems to be the easiest way to get
     // a raw file descriptor. It also is what the socket creator does and this
     // API is aimed to it.
-    int getFd(int type) {
+#ifdef _WIN32
+    SOCKET getFd(int type)
+#else
+    int getFd(int type)
+#endif
+        {
         struct addrinfo hints;
         memset(&hints, 0, sizeof(hints));
         hints.ai_family = AF_UNSPEC;
@@ -437,24 +467,41 @@ private:
             isc_throw(IOError, "getaddrinfo failed: " << gai_strerror(error));
         }
 
+#ifdef _WIN32
+        SOCKET sock;
+#else
         int sock;
-        const int on(1);
+#endif
         // Go as far as you can and stop on failure
         // Create the socket
         // set the options
         // and bind it
+#ifdef _WIN32
+        const bool failed((sock = socket(res->ai_family, res->ai_socktype,
+                                         res->ai_protocol)) == INVALID_SOCKET ||
+                          bind(sock, res->ai_addr, res->ai_addrlen) == -1);
+#else
+        const int on(1);
         const bool failed((sock = socket(res->ai_family, res->ai_socktype,
                                          res->ai_protocol)) == -1 ||
                           setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on,
                                      sizeof(on)) == -1 ||
                           bind(sock, res->ai_addr, res->ai_addrlen) == -1);
+#endif
         // No matter if it succeeded or not, free the address info
         freeaddrinfo(res);
         if (failed) {
+#ifdef _WIN32
+            if (sock != INVALID_SOCKET) {
+                closesocket(sock);
+            }
+            return (INVALID_SOCKET);
+#else
             if (sock != -1) {
                 close(sock);
             }
             return (-1);
+#endif
         } else {
             return (sock);
         }
@@ -462,13 +509,23 @@ private:
 protected:
     // Using SetUp here so we can ASSERT_*
     void SetUp() {
+#ifdef _WIN32
+        const SOCKET fdUDP(getFd(SOCK_DGRAM));
+        ASSERT_NE(INVALID_SOCKET, fdUDP) << strerror(errno);
+#else
         const int fdUDP(getFd(SOCK_DGRAM));
         ASSERT_NE(-1, fdUDP) << strerror(errno);
+#endif
         this->udp_server_ = new UDPServerClass(this->service, fdUDP, AF_INET6,
                                                this->checker_, this->lookup_,
                                                this->answer_);
+#ifdef _WIN32
+        const SOCKET fdTCP(getFd(SOCK_STREAM));
+        ASSERT_NE(INVALID_SOCKET, fdTCP) << strerror(errno);
+#else
         const int fdTCP(getFd(SOCK_STREAM));
         ASSERT_NE(-1, fdTCP) << strerror(errno);
+#endif
         this->tcp_server_ = new TCPServer(this->service, fdTCP, AF_INET6,
                                           this->checker_, this->lookup_,
                                           this->answer_);
@@ -641,9 +698,16 @@ TYPED_TEST(DNSServerTestBase, invalidTCPFD) {
     EXPECT_THROW(UDPServer(service, -1, AF_INET, checker_, lookup_,
                            answer_), isc::asiolink::IOError);
     */
+#ifdef _WIN32
+    EXPECT_THROW(TCPServer(this->service, INVALID_SOCKET,
+                           AF_INET, this->checker_,
+                           this->lookup_, this->answer_),
+                 isc::asiolink::IOError);
+#else
     EXPECT_THROW(TCPServer(this->service, -1, AF_INET, this->checker_,
                            this->lookup_, this->answer_),
                  isc::asiolink::IOError);
+#endif
 }
 
 TYPED_TEST(DNSServerTestBase, DISABLED_invalidUDPFD) {
@@ -654,9 +718,16 @@ TYPED_TEST(DNSServerTestBase, DISABLED_invalidUDPFD) {
      not the others, maybe we could make it run this at least on epoll-based
      systems).
     */
+#ifdef _WIN32
+    EXPECT_THROW(TypeParam(this->service, INVALID_SOCKET,
+                           AF_INET, this->checker_,
+                           this->lookup_, this->answer_),
+                 isc::asiolink::IOError);
+#else
     EXPECT_THROW(TypeParam(this->service, -1, AF_INET, this->checker_,
                            this->lookup_, this->answer_),
                  isc::asiolink::IOError);
+#endif
 }
 
 // A specialized test type for SyncUDPServer.
diff --git a/src/lib/asiodns/tests/dns_service_unittest.cc b/src/lib/asiodns/tests/dns_service_unittest.cc
index ce8eee9..7122874 100644
--- a/src/lib/asiodns/tests/dns_service_unittest.cc
+++ b/src/lib/asiodns/tests/dns_service_unittest.cc
@@ -26,11 +26,13 @@
 
 #include <csignal>
 
+#ifndef _WIN32
 #include <sys/types.h>
 #include <sys/socket.h>
 
 #include <unistd.h>
 #include <netdb.h>
+#endif
 
 using namespace isc::asiolink;
 using namespace isc::asiodns;
@@ -108,6 +110,16 @@ protected:
 
         // set a signal-based alarm to prevent the test from hanging up
         // due to a bug.
+#ifdef _WIN32
+        UINT_PTR id = 1;
+        SetTimer(NULL, id, IO_SERVICE_TIME_OUT * 1000,
+                 UDPDNSServiceTest::stopIOService);
+        current_service = &io_service;
+        io_service.run();
+        io_service.get_io_service().reset();
+        //cancel scheduled alarm
+        KillTimer(NULL, id);
+#else
         void (*prev_handler)(int) =
             std::signal(SIGALRM, UDPDNSServiceTest::stopIOService);
         current_service = &io_service;
@@ -117,10 +129,20 @@ protected:
         //cancel scheduled alarm
         alarm(0);
         std::signal(SIGALRM, prev_handler);
+#endif
     }
 
     // last resort service stopper by signal
-    static void stopIOService(int) {
+#ifdef _WIN32
+        static void CALLBACK stopIOService(
+            HWND _no_use_hwnd,
+            UINT _no_use_umsg,
+            UINT_PTR _no_use_idevent,
+            DWORD _no_use_dwtime)
+#else
+    static void stopIOService(int)
+#endif
+    {
         io_service_is_time_out = true;
         if (current_service != NULL) {
             current_service->stop();
@@ -157,7 +179,11 @@ bool UDPDNSServiceTest::io_service_is_time_out;
 // A helper socket FD creator for given address and port.  It's generally
 // expected to succeed; on failure it simply throws an exception to make
 // the test fail.
+#ifdef _WIN32
+SOCKET
+#else
 int
+#endif
 getSocketFD(int family, const char* const address, const char* const port) {
     struct addrinfo hints, *res = NULL;
     memset(&hints, 0, sizeof(hints));
@@ -165,7 +191,11 @@ getSocketFD(int family, const char* const address, const char* const port) {
     hints.ai_socktype = SOCK_DGRAM;
     hints.ai_protocol = IPPROTO_UDP;
     hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV;
+#ifdef _WIN32
+    SOCKET s = INVALID_SOCKET;
+#else
     int s = -1;
+#endif
     int error = getaddrinfo(address, port, &hints, &res);
     if (error == 0) {
         // If getaddrinfo returns 0, res should be set to a non NULL valid
@@ -173,16 +203,28 @@ getSocketFD(int family, const char* const address, const char* const port) {
         // it, so we satisfy them here.
         if (res != NULL) {
             s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+#ifdef _WIN32
+            if (s != INVALID_SOCKET) {
+                error = bind(s, res->ai_addr, res->ai_addrlen);
+            }
+#else
             if (s >= 0) {
                 error = bind(s, res->ai_addr, res->ai_addrlen);
             }
+#endif
             freeaddrinfo(res);
         }
     }
     if (error != 0) {
+#ifdef _WIN32
+        if (s != INVALID_SOCKET) {
+            closesocket(s);
+        }
+#else
         if (s >= 0) {
             close(s);
         }
+#endif
         isc_throw(isc::Unexpected, "failed to open test socket");
     }
     return (s);
diff --git a/src/lib/asiodns/tests/io_fetch_unittest.cc b/src/lib/asiodns/tests/io_fetch_unittest.cc
index acb184c..1d48b45 100644
--- a/src/lib/asiodns/tests/io_fetch_unittest.cc
+++ b/src/lib/asiodns/tests/io_fetch_unittest.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
 #include <algorithm>
 #include <cstdlib>
 #include <string>
@@ -41,6 +43,11 @@
 #include <asiolink/io_service.h>
 #include <asiodns/io_fetch.h>
 
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4351 4355)
+#endif
+
 using namespace asio;
 using namespace isc::dns;
 using namespace isc::util;
@@ -741,3 +748,7 @@ TEST_F(IOFetchTest, TcpSendReceive8192ShortSend) {
 
 } // namespace asiodns
 } // namespace isc
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
diff --git a/src/lib/asiodns/udp_server.cc b/src/lib/asiodns/udp_server.cc
index 0f5456b..d0dbdf9 100644
--- a/src/lib/asiodns/udp_server.cc
+++ b/src/lib/asiodns/udp_server.cc
@@ -12,15 +12,22 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBASIODNS_EXPORT
+
+#include <config.h>
+#include <stdint.h>
+
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <unistd.h>             // for some IPC/network system calls
 #include <netinet/in.h>
 #include <sys/socket.h>
+#endif
 #include <errno.h>
 
 #include <boost/shared_array.hpp>
 
-#include <config.h>
-
 #include <log/dummylog.h>
 
 #include <asio.hpp>
@@ -69,13 +76,21 @@ struct UDPServer::Data {
         // otherwise ASIO will bind to both
         udp proto = addr.is_v4() ? udp::v4() : udp::v6();
         socket_.reset(new udp::socket(io_service, proto));
+#ifndef _WIN32
         socket_->set_option(socket_base::reuse_address(true));
+#endif
         if (addr.is_v6()) {
             socket_->set_option(asio::ip::v6_only(true));
         }
         socket_->bind(udp::endpoint(addr, port));
     }
-    Data(io_service& io_service, int fd, int af, SimpleCallback* checkin,
+    Data(io_service& io_service,
+#ifdef _WIN32
+         SOCKET fd,
+#else
+         int fd,
+#endif
+         int af, SimpleCallback* checkin,
          DNSLookup* lookup, DNSAnswer* answer) :
          io_(io_service), done_(false),
          checkin_callback_(checkin),lookup_callback_(lookup),
@@ -182,8 +197,13 @@ struct UDPServer::Data {
 ///
 /// The constructor. It just creates new internal state object
 /// and lets it handle the initialization.
-UDPServer::UDPServer(io_service& io_service, int fd, int af,
-                     SimpleCallback* checkin, DNSLookup* lookup,
+UDPServer::UDPServer(io_service& io_service,
+#ifdef _WIN32
+                     SOCKET fd,
+#else
+                     int fd,
+#endif
+                     int af, SimpleCallback* checkin, DNSLookup* lookup,
                      DNSAnswer* answer) :
     data_(new Data(io_service, fd, af, checkin, lookup, answer))
 { }
diff --git a/src/lib/asiodns/udp_server.h b/src/lib/asiodns/udp_server.h
index b32c06c..d63abbc 100644
--- a/src/lib/asiodns/udp_server.h
+++ b/src/lib/asiodns/udp_server.h
@@ -20,6 +20,7 @@
 #endif
 
 #include <asiolink/simple_callback.h>
+#include <asiodns/lib.h>
 #include <asiodns/dns_answer.h>
 #include <asiodns/dns_lookup.h>
 #include <asiodns/dns_server.h>
@@ -37,7 +38,8 @@ namespace asiodns {
 ///        DNS query event. As such, it is both a \c DNSServer and
 ///        a \c coroutine
 ///
-class UDPServer : public virtual DNSServer, public virtual coroutine {
+class ISC_LIBASIODNS_API UDPServer :
+ public virtual DNSServer, public virtual coroutine {
 public:
     /// \brief Constructor
     /// \param io_service the asio::io_service to work with
@@ -49,7 +51,13 @@ public:
     /// \throw isc::InvalidParameter if af is neither AF_INET nor AF_INET6
     /// \throw isc::asiolink::IOError when a low-level error happens, like the
     ///     fd is not a valid descriptor.
-    UDPServer(asio::io_service& io_service, int fd, int af,
+    UDPServer(asio::io_service& io_service,
+#ifdef _WIN32
+              SOCKET fd,
+#else
+              int fd,
+#endif
+              int af,
               isc::asiolink::SimpleCallback* checkin = NULL,
               DNSLookup* lookup = NULL, DNSAnswer* answer = NULL);
 
diff --git a/src/lib/asiolink/asiolink.h b/src/lib/asiolink/asiolink.h
index 51d3a14..42ca2e8 100644
--- a/src/lib/asiolink/asiolink.h
+++ b/src/lib/asiolink/asiolink.h
@@ -19,6 +19,8 @@
 // this file.  In particular, asio.hpp should never be included here.
 // See the description of the namespace below.
 
+#include <asiolink/lib.h>
+
 #include <asiolink/io_service.h>
 #include <asiolink/simple_callback.h>
 #include <asiolink/interval_timer.h>
diff --git a/src/lib/asiolink/dummy_io_cb.cc b/src/lib/asiolink/dummy_io_cb.cc
new file mode 100644
index 0000000..062b0fe
--- /dev/null
+++ b/src/lib/asiolink/dummy_io_cb.cc
@@ -0,0 +1,27 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#define ISC_LIBASIOLINK_EXPORT
+
+#include <config.h>
+
+#include <asiolink/dummy_io_cb.h>
+
+// Instantiate class
+
+class ISC_LIBASIOLINK_API DummyIOCallback;
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/asiolink/dummy_io_cb.h b/src/lib/asiolink/dummy_io_cb.h
index bcaefe9..5f4866f 100644
--- a/src/lib/asiolink/dummy_io_cb.h
+++ b/src/lib/asiolink/dummy_io_cb.h
@@ -17,6 +17,7 @@
 
 #include <iostream>
 
+#include <asiolink/lib.h>
 #include <asio/error.hpp>
 #include <asio/error_code.hpp>
 
@@ -34,7 +35,7 @@ namespace asiolink {
 /// template parameter.  This is the reason for this class - it is the dummy
 /// template parameter.
 
-class DummyIOCallback {
+class ISC_LIBASIOLINK_API DummyIOCallback {
 public:
 
     /// \brief Asynchronous I/O callback method
diff --git a/src/lib/asiolink/interval_timer.cc b/src/lib/asiolink/interval_timer.cc
index 9873e9b..bba9819 100644
--- a/src/lib/asiolink/interval_timer.cc
+++ b/src/lib/asiolink/interval_timer.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBASIOLINK_EXPORT
+
 #include <config.h>
 
 #include <boost/bind.hpp>
diff --git a/src/lib/asiolink/interval_timer.h b/src/lib/asiolink/interval_timer.h
index 57ec1c3..478220b 100644
--- a/src/lib/asiolink/interval_timer.h
+++ b/src/lib/asiolink/interval_timer.h
@@ -18,6 +18,7 @@
 #include <boost/function.hpp>
 #include <boost/shared_ptr.hpp>
 
+#include <asiolink/lib.h>
 #include <asiolink/io_service.h>
 
 namespace isc {
@@ -55,7 +56,7 @@ class IntervalTimerImpl;
 ///  intervalTimer.setup(function_to_call_back, interval_in_milliseconds);
 ///  io_service.run();
 /// \endcode
-class IntervalTimer {
+class ISC_LIBASIOLINK_API IntervalTimer {
 public:
     /// \name The type of timer callback function
     typedef boost::function<void()> Callback;
diff --git a/src/lib/asiolink/io_address.cc b/src/lib/asiolink/io_address.cc
index 832452c..5382db7 100644
--- a/src/lib/asiolink/io_address.cc
+++ b/src/lib/asiolink/io_address.cc
@@ -12,12 +12,19 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBASIOLINK_EXPORT
+
 #include <config.h>
 
-#include <unistd.h>             // for some IPC/network system calls
 #include <stdint.h>
+
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
+#include <unistd.h>             // for some IPC/network system calls
 #include <sys/socket.h>
 #include <netinet/in.h>
+#endif
 
 #include <asio.hpp>
 
@@ -72,7 +79,12 @@ IOAddress::from_bytes(short family, const uint8_t* data) {
 
     BOOST_STATIC_ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
     char addr_str[INET6_ADDRSTRLEN];
-    inet_ntop(family, data, addr_str, INET6_ADDRSTRLEN);
+#ifdef _WIN32
+#define DECONST (void *)
+#else
+#define DECONST
+#endif
+    inet_ntop(family, DECONST data, addr_str, INET6_ADDRSTRLEN);
     return IOAddress(string(addr_str));
 }
 
diff --git a/src/lib/asiolink/io_address.h b/src/lib/asiolink/io_address.h
index c40e5b9..e3ffbe6 100644
--- a/src/lib/asiolink/io_address.h
+++ b/src/lib/asiolink/io_address.h
@@ -18,7 +18,9 @@
 // IMPORTANT NOTE: only very few ASIO headers files can be included in
 // this file.  In particular, asio.hpp should never be included here.
 // See the description of the namespace below.
+#ifndef _WIN32
 #include <unistd.h>             // for some network system calls
+#endif
 #include <stdint.h>             // for uint32_t
 #include <asio/ip/address.hpp>
 
@@ -26,6 +28,7 @@
 #include <string>
 
 #include <exceptions/exceptions.h>
+#include <asiolink/lib.h>
 
 namespace isc {
 namespace asiolink {
@@ -40,7 +43,7 @@ namespace asiolink {
 /// agnostic)
 ///
 /// This class is a wrapper for the ASIO \c ip::address class.
-class IOAddress {
+class ISC_LIBASIOLINK_API IOAddress {
 public:
     ///
     /// \name Constructors and Destructor
diff --git a/src/lib/asiolink/io_asio_socket.h b/src/lib/asiolink/io_asio_socket.h
index aeac63d..070ab9d 100644
--- a/src/lib/asiolink/io_asio_socket.h
+++ b/src/lib/asiolink/io_asio_socket.h
@@ -18,7 +18,9 @@
 // IMPORTANT NOTE: only very few ASIO headers files can be included in
 // this file.  In particular, asio.hpp should never be included here.
 // See the description of the namespace below.
+#ifndef _WIN32
 #include <unistd.h>             // for some network system calls
+#endif
 
 #include <functional>
 #include <string>
@@ -28,6 +30,7 @@
 
 #include <util/buffer.h>
 
+#include <asiolink/lib.h>
 #include <asiolink/io_error.h>
 #include <asiolink/io_socket.h>
 
@@ -37,7 +40,7 @@ namespace asiolink {
 /// \brief Socket not open
 ///
 /// Thrown on an attempt to do read/write to a socket that is not open.
-class SocketNotOpen : public IOError {
+class ISC_LIBASIOLINK_API SocketNotOpen : public IOError {
 public:
     SocketNotOpen(const char* file, size_t line, const char* what) :
         IOError(file, line, what) {}
@@ -46,7 +49,7 @@ public:
 /// \brief Error setting socket options
 ///
 /// Thrown if attempt to change socket options fails.
-class SocketSetError : public IOError {
+class ISC_LIBASIOLINK_API SocketSetError : public IOError {
 public:
     SocketSetError(const char* file, size_t line, const char* what) :
         IOError(file, line, what) {}
@@ -56,14 +59,14 @@ public:
 ///
 /// Thrown if an attempt is made to receive into an area beyond the end of
 /// the receive data buffer.
-class BufferOverflow : public IOError {
+class ISC_LIBASIOLINK_API BufferOverflow : public IOError {
 public:
     BufferOverflow(const char* file, size_t line, const char* what) :
         IOError(file, line, what) {}
 };
 
 /// Forward declaration of an IOEndpoint
-class IOEndpoint;
+class ISC_LIBASIOLINK_API IOEndpoint;
 
 
 /// \brief I/O Socket with asynchronous operations
@@ -125,7 +128,11 @@ public:
     ///
     /// \return The native representation of the socket.  This is the socket
     ///         file descriptor for UNIX-like systems.
+#ifdef _WIN32
+    virtual SOCKET getNative() const = 0;
+#else
     virtual int getNative() const = 0;
+#endif
 
     /// \brief Return the transport protocol of the socket.
     ///
@@ -307,7 +314,11 @@ public:
     ///
     /// \return Always returns -1 as the object is not associated with a real
     /// (native) socket.
+#ifdef _WIN32
+    virtual SOCKET getNative() const { return (INVALID_SOCKET); }
+#else
     virtual int getNative() const { return (-1); }
+#endif
 
     /// \brief A dummy derived method of \c IOAsioSocket::getProtocol().
     ///
diff --git a/src/lib/asiolink/io_endpoint.cc b/src/lib/asiolink/io_endpoint.cc
index 2354521..b81a7cd 100644
--- a/src/lib/asiolink/io_endpoint.cc
+++ b/src/lib/asiolink/io_endpoint.cc
@@ -12,8 +12,18 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBASIOLINK_EXPORT
+
 #include <config.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
+#include <unistd.h>             // for some IPC/network system calls
+#include <sys/socket.h>
+#include <netinet/in.h>
+#endif
+
 #include <asio.hpp>
 
 #include <asiolink/io_address.h>
@@ -25,9 +35,6 @@
 #include <boost/lexical_cast.hpp>
 
 #include <cassert>
-#include <unistd.h>             // for some IPC/network system calls
-#include <sys/socket.h>
-#include <netinet/in.h>
 
 using namespace std;
 
@@ -61,7 +68,7 @@ IOEndpoint::operator!=(const IOEndpoint& other) const {
     return (!operator==(other));
 }
 
-ostream&
+ISC_LIBASIOLINK_API ostream&
 operator<<(ostream& os, const IOEndpoint& endpoint) {
     if (endpoint.getFamily() == AF_INET6) {
         os << "[" << endpoint.getAddress().toText() << "]";
diff --git a/src/lib/asiolink/io_endpoint.h b/src/lib/asiolink/io_endpoint.h
index 973fc8b..6158f17 100644
--- a/src/lib/asiolink/io_endpoint.h
+++ b/src/lib/asiolink/io_endpoint.h
@@ -18,19 +18,21 @@
 // IMPORTANT NOTE: only very few ASIO headers files can be included in
 // this file.  In particular, asio.hpp should never be included here.
 // See the description of the namespace below.
+#ifndef _WIN32
+#include <unistd.h>             // for some network system calls
+
+#include <sys/socket.h>         // for sockaddr
+#endif
 
 #include <functional>
 #include <string>
 
 #include <exceptions/exceptions.h>
+#include <asiolink/lib.h>
 #include <asiolink/io_address.h>
 
 # include <ostream>
 
-#include <unistd.h>             // for some network system calls
-
-#include <sys/socket.h>         // for sockaddr
-
 namespace isc {
 namespace asiolink {
 
@@ -43,7 +45,7 @@ namespace asiolink {
 /// Derived class implementations are completely hidden within the
 /// implementation.  User applications only get access to concrete
 /// \c IOEndpoint objects via the abstract interfaces.
-class IOEndpoint {
+class ISC_LIBASIOLINK_API IOEndpoint {
     ///
     /// \name Constructors and Destructor
     ///
@@ -181,7 +183,8 @@ public:
 /// operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const IOEndpoint& endpoint);
+ISC_LIBASIOLINK_API std::ostream&
+operator<<(std::ostream& os, const IOEndpoint& endpoint);
 } // namespace asiolink
 } // namespace isc
 #endif // __IO_ENDPOINT_H
diff --git a/src/lib/asiolink/io_error.cc b/src/lib/asiolink/io_error.cc
new file mode 100644
index 0000000..41120d0
--- /dev/null
+++ b/src/lib/asiolink/io_error.cc
@@ -0,0 +1,33 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#define ISC_LIBASIOLINK_EXPORT
+
+#include <config.h>
+
+#include <asio.hpp>
+
+#include <asiolink/io_asio_socket.h>
+#include <asiolink/tcp_socket.h>
+
+// Instantiate classes
+
+class ISC_LIBASIOLINK_API SocketNotOpen;
+class ISC_LIBASIOLINK_API SocketSetError;
+class ISC_LIBASIOLINK_API BufferOverflow;
+class ISC_LIBASIOLINK_API BufferTooLarge;
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/asiolink/io_error.h b/src/lib/asiolink/io_error.h
index c19d91c..2961289 100644
--- a/src/lib/asiolink/io_error.h
+++ b/src/lib/asiolink/io_error.h
@@ -17,6 +17,7 @@
 #define __IO_ERROR_H
 
 #include <exceptions/exceptions.h>
+#include <asiolink/lib.h>
 
 namespace isc {
 namespace asiolink {
@@ -24,7 +25,7 @@ namespace asiolink {
 /// \brief An exception that is thrown if an error occurs within the IO
 /// module.  This is mainly intended to be a wrapper exception class for
 /// ASIO specific exceptions.
-class IOError : public isc::Exception {
+class ISC_LIBASIOLINK_API IOError : public isc::Exception {
 public:
     IOError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
diff --git a/src/lib/asiolink/io_message.cc b/src/lib/asiolink/io_message.cc
new file mode 100644
index 0000000..aad8642
--- /dev/null
+++ b/src/lib/asiolink/io_message.cc
@@ -0,0 +1,27 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#define ISC_LIBASIOLINK_EXPORT
+
+#include <config.h>
+
+#include <asiolink/io_message.h>
+
+// Instantiate class
+
+class ISC_LIBASIOLINK_API IOMessage;
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/asiolink/io_message.h b/src/lib/asiolink/io_message.h
index 81f6da1..3b197ad 100644
--- a/src/lib/asiolink/io_message.h
+++ b/src/lib/asiolink/io_message.h
@@ -18,13 +18,16 @@
 // IMPORTANT NOTE: only very few ASIO headers files can be included in
 // this file.  In particular, asio.hpp should never be included here.
 // See the description of the namespace below.
+#ifndef _WIN32
 #include <unistd.h>             // for some network system calls
+#endif
 
 #include <functional>
 #include <string>
 
 #include <exceptions/exceptions.h>
 
+#include <asiolink/lib.h>
 #include <asiolink/io_endpoint.h>
 #include <asiolink/io_socket.h>
 
@@ -43,7 +46,7 @@ namespace asiolink {
 /// It only provides a minimal level of support that is necessary for
 /// the current implementation of the authoritative server.
 /// A future version of this class will definitely support more.
-class IOMessage {
+class ISC_LIBASIOLINK_API IOMessage {
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/asiolink/io_service.cc b/src/lib/asiolink/io_service.cc
index 15fad0c..1c6bc23 100644
--- a/src/lib/asiolink/io_service.cc
+++ b/src/lib/asiolink/io_service.cc
@@ -12,11 +12,17 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBASIOLINK_EXPORT
+
 #include <config.h>
 
-#include <unistd.h>             // for some IPC/network system calls
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <netinet/in.h>
 #include <sys/socket.h>
+#include <unistd.h>             // for some IPC/network system calls
+#endif
 
 #include <asio.hpp>
 #include <asiolink/io_service.h>
diff --git a/src/lib/asiolink/io_service.h b/src/lib/asiolink/io_service.h
index 75aaee6..700aea1 100644
--- a/src/lib/asiolink/io_service.h
+++ b/src/lib/asiolink/io_service.h
@@ -15,6 +15,8 @@
 #ifndef __ASIOLINK_IO_SERVICE_H
 #define __ASIOLINK_IO_SERVICE_H 1
 
+#include <asiolink/lib.h>
+
 namespace asio {
     class io_service;
 }
@@ -27,7 +29,7 @@ class IOServiceImpl;
 /// \brief The \c IOService class is a wrapper for the ASIO \c io_service
 /// class.
 ///
-class IOService {
+class ISC_LIBASIOLINK_API IOService {
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/asiolink/io_socket.cc b/src/lib/asiolink/io_socket.cc
index e1498dc..5e699c0 100644
--- a/src/lib/asiolink/io_socket.cc
+++ b/src/lib/asiolink/io_socket.cc
@@ -12,6 +12,10 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBASIOLINK_EXPORT
+
+#include <config.h>
+
 #include "io_socket.h"
 
 #include <asio.hpp>
@@ -42,7 +46,11 @@ public:
     ///
     /// This version of method always returns -1 as the object is not
     /// associated with a real (native) socket.
+#ifdef _WIN32
+    virtual SOCKET getNative() const { return (INVALID_SOCKET); }
+#else
     virtual int getNative() const { return (-1); }
+#endif
 
     virtual int getProtocol() const { return (protocol_); }
 private:
diff --git a/src/lib/asiolink/io_socket.h b/src/lib/asiolink/io_socket.h
index ab6479c..b9a891c 100644
--- a/src/lib/asiolink/io_socket.h
+++ b/src/lib/asiolink/io_socket.h
@@ -18,12 +18,17 @@
 // IMPORTANT NOTE: only very few ASIO headers files can be included in
 // this file.  In particular, asio.hpp should never be included here.
 // See the description of the namespace below.
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <unistd.h>             // for some network system calls
+#endif
 
 #include <functional>
 #include <string>
 
 #include <exceptions/exceptions.h>
+#include <asiolink/lib.h>
 
 namespace isc {
 namespace asiolink {
@@ -42,7 +47,7 @@ namespace asiolink {
 /// modules use it.  Also, at that point we may define a separate (visible)
 /// derived class for testing purposes rather than providing factory methods
 /// (i.e., getDummy variants below).
-class IOSocket {
+class ISC_LIBASIOLINK_API IOSocket {
     ///
     /// \name Constructors and Destructor
     ///
@@ -83,7 +88,11 @@ public:
     ///
     /// \return The native representation of the socket.  This is the socket
     /// file descriptor for UNIX-like systems.
+#ifdef _WIN32
+    virtual SOCKET getNative() const = 0;
+#else
     virtual int getNative() const = 0;
+#endif
 
     /// \brief Return the transport protocol of the socket.
     ///
diff --git a/src/lib/asiolink/lib.h b/src/lib/asiolink/lib.h
new file mode 100644
index 0000000..2e8cab5
--- /dev/null
+++ b/src/lib/asiolink/lib.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBASIOLINK_H
+#define __LIBASIOLINK_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBASIOLINK_API
+#else
+#ifdef ISC_LIBASIOLINK_EXPORT
+#define ISC_LIBASIOLINK_API __declspec(dllexport)
+#else
+#define ISC_LIBASIOLINK_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBASIOLINK_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/asiolink/simple_callback.cc b/src/lib/asiolink/simple_callback.cc
new file mode 100644
index 0000000..51427de
--- /dev/null
+++ b/src/lib/asiolink/simple_callback.cc
@@ -0,0 +1,27 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#define ISC_LIBASIOLINK_EXPORT
+
+#include <config.h>
+
+#include <asiolink/simple_callback.h>
+
+// Instantiate class
+
+class ISC_LIBASIOLINK_API SimpleCallback;
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/asiolink/simple_callback.h b/src/lib/asiolink/simple_callback.h
index a297a1d..4762721 100644
--- a/src/lib/asiolink/simple_callback.h
+++ b/src/lib/asiolink/simple_callback.h
@@ -15,6 +15,7 @@
 #ifndef __ASIOLINK_SIMPLE_CALLBACK_H
 #define __ASIOLINK_SIMPLE_CALLBACK_H 1
 
+#include <asiolink/lib.h>
 #include <asiolink/io_message.h>
 
 namespace isc {
@@ -34,7 +35,7 @@ namespace asiolink {
 /// The \c SimpleCallback is expected to be used for basic, generic
 /// tasks such as checking for configuration changes.  It may also be
 /// used for testing purposes.
-class SimpleCallback {
+class ISC_LIBASIOLINK_API SimpleCallback {
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/asiolink/tcp_endpoint.h b/src/lib/asiolink/tcp_endpoint.h
index a54f6b2..54e86d0 100644
--- a/src/lib/asiolink/tcp_endpoint.h
+++ b/src/lib/asiolink/tcp_endpoint.h
@@ -19,6 +19,7 @@
 #error "asio.hpp must be included before including this, see asiolink.h as to why"
 #endif
 
+#include <asiolink/lib.h>
 #include <asiolink/io_endpoint.h>
 
 namespace isc {
@@ -28,7 +29,7 @@ namespace asiolink {
 /// \c IOEndpoint that represents an endpoint of a TCP packet.
 ///
 /// Other notes about \c TCPEndpoint applies to this class, too.
-class TCPEndpoint : public IOEndpoint {
+class ISC_LIBASIOLINK_API TCPEndpoint : public IOEndpoint {
 public:
     ///
     /// \name Constructors and Destructor.
diff --git a/src/lib/asiolink/tcp_socket.h b/src/lib/asiolink/tcp_socket.h
index 2505d7b..eacc21f 100644
--- a/src/lib/asiolink/tcp_socket.h
+++ b/src/lib/asiolink/tcp_socket.h
@@ -20,9 +20,11 @@
 #endif
 
 #include <log/dummylog.h>
+#ifndef _WIN32
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <unistd.h>             // for some IPC/network system calls
+#endif
 
 #include <algorithm>
 #include <cassert>
@@ -36,6 +38,7 @@
 #include <util/buffer.h>
 #include <util/io_utilities.h>
 
+#include <asiolink/lib.h>
 #include <asiolink/io_asio_socket.h>
 #include <asiolink/io_endpoint.h>
 #include <asiolink/io_service.h>
@@ -47,7 +50,7 @@ namespace asiolink {
 /// \brief Buffer Too Large
 ///
 /// Thrown on an attempt to send a buffer > 64k
-class BufferTooLarge : public IOError {
+class ISC_LIBASIOLINK_API BufferTooLarge : public IOError {
 public:
     BufferTooLarge(const char* file, size_t line, const char* what) :
         IOError(file, line, what) {}
@@ -85,7 +88,12 @@ public:
     virtual ~TCPSocket();
 
     /// \brief Return file descriptor of underlying socket
-    virtual int getNative() const {
+#ifdef _WIN32
+    virtual SOCKET getNative() const
+#else
+    virtual int getNative() const
+#endif
+    {
         return (socket_.native());
     }
 
diff --git a/src/lib/asiolink/tests/interval_timer_unittest.cc b/src/lib/asiolink/tests/interval_timer_unittest.cc
index 420cb90..6ae6528 100644
--- a/src/lib/asiolink/tests/interval_timer_unittest.cc
+++ b/src/lib/asiolink/tests/interval_timer_unittest.cc
@@ -177,7 +177,8 @@ TEST_F(IntervalTimerTest, startIntervalTimer) {
     // Expect TimerCallBack is called; timer_called_ is true
     EXPECT_TRUE(timer_called_);
     // Expect test_runtime is 100 milliseconds or longer.
-    EXPECT_TRUE(test_runtime > boost::posix_time::milliseconds(100)) <<
+    // FD: add 10 ms margin for VS 2008 on Win7 VM
+    EXPECT_TRUE(test_runtime > boost::posix_time::milliseconds(90)) <<
                 "test runtime " << test_runtime.total_milliseconds() <<
                 "msec " << ">= 100";
 }
diff --git a/src/lib/asiolink/tests/io_endpoint_unittest.cc b/src/lib/asiolink/tests/io_endpoint_unittest.cc
index 462a2fb..27f8d12 100644
--- a/src/lib/asiolink/tests/io_endpoint_unittest.cc
+++ b/src/lib/asiolink/tests/io_endpoint_unittest.cc
@@ -24,9 +24,13 @@
 #include <sstream>
 #include <string>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netdb.h>
+#endif
 #include <string.h>
 
 using namespace isc::asiolink;
diff --git a/src/lib/asiolink/tests/io_socket_unittest.cc b/src/lib/asiolink/tests/io_socket_unittest.cc
index 15afc17..1005dd2 100644
--- a/src/lib/asiolink/tests/io_socket_unittest.cc
+++ b/src/lib/asiolink/tests/io_socket_unittest.cc
@@ -15,7 +15,11 @@
 #include <config.h>
 #include <gtest/gtest.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <netinet/in.h>
+#endif
 
 #include <asio.hpp>
 #include <asiolink/io_socket.h>
@@ -25,8 +29,13 @@ using namespace isc::asiolink;
 TEST(IOSocketTest, dummySockets) {
     EXPECT_EQ(IPPROTO_UDP, IOSocket::getDummyUDPSocket().getProtocol());
     EXPECT_EQ(IPPROTO_TCP, IOSocket::getDummyTCPSocket().getProtocol());
+#ifdef _WIN32
+    EXPECT_EQ(INVALID_SOCKET, IOSocket::getDummyUDPSocket().getNative());
+    EXPECT_EQ(INVALID_SOCKET, IOSocket::getDummyTCPSocket().getNative());
+#else
     EXPECT_EQ(-1, IOSocket::getDummyUDPSocket().getNative());
     EXPECT_EQ(-1, IOSocket::getDummyTCPSocket().getNative());
+#endif
 }
 
 
diff --git a/src/lib/asiolink/tests/tcp_socket_unittest.cc b/src/lib/asiolink/tests/tcp_socket_unittest.cc
index 538cf48..fce4a22 100644
--- a/src/lib/asiolink/tests/tcp_socket_unittest.cc
+++ b/src/lib/asiolink/tests/tcp_socket_unittest.cc
@@ -18,12 +18,18 @@
 /// receive-close sequence and checking that the asynchronous notifications
 /// work.
 
+#include <config.h>
+
 #include <string>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
 #include <netinet/in.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#endif
 
 #include <algorithm>
 #include <cstdlib>
diff --git a/src/lib/asiolink/tests/udp_socket_unittest.cc b/src/lib/asiolink/tests/udp_socket_unittest.cc
index 1ab1a09..acf13de 100644
--- a/src/lib/asiolink/tests/udp_socket_unittest.cc
+++ b/src/lib/asiolink/tests/udp_socket_unittest.cc
@@ -18,12 +18,18 @@
 /// receive-close sequence and checking that the asynchronous notifications
 /// work.
 
+#include <config.h>
+
 #include <string>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
 #include <netinet/in.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#endif
 
 #include <algorithm>
 #include <cstdlib>
diff --git a/src/lib/asiolink/udp_endpoint.h b/src/lib/asiolink/udp_endpoint.h
index c5ba3bd..7dfe403 100644
--- a/src/lib/asiolink/udp_endpoint.h
+++ b/src/lib/asiolink/udp_endpoint.h
@@ -19,6 +19,7 @@
 #error "asio.hpp must be included before including this, see asiolink.h as to why"
 #endif
 
+#include <asiolink/lib.h>
 #include <asiolink/io_endpoint.h>
 
 namespace isc {
@@ -28,7 +29,7 @@ namespace asiolink {
 /// \c IOEndpoint that represents an endpoint of a UDP packet.
 ///
 /// Other notes about \c TCPEndpoint applies to this class, too.
-class UDPEndpoint : public IOEndpoint {
+class ISC_LIBASIOLINK_API UDPEndpoint : public IOEndpoint {
 public:
     ///
     /// \name Constructors and Destructor.
diff --git a/src/lib/asiolink/udp_socket.h b/src/lib/asiolink/udp_socket.h
index c061fba..2061e45 100644
--- a/src/lib/asiolink/udp_socket.h
+++ b/src/lib/asiolink/udp_socket.h
@@ -20,14 +20,17 @@
 #endif
 
 #include <log/dummylog.h>
+#ifndef _WIN32
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <unistd.h>             // for some IPC/network system calls
+#endif
 
 #include <cstddef>
 
 #include <config.h>
 
+#include <asiolink/lib.h>
 #include <asiolink/io_asio_socket.h>
 #include <asiolink/io_endpoint.h>
 #include <asiolink/io_service.h>
@@ -71,7 +74,12 @@ public:
     virtual ~UDPSocket();
 
     /// \brief Return file descriptor of underlying socket
-    virtual int getNative() const {
+#ifdef _WIN32
+    virtual SOCKET getNative() const
+#else
+    virtual int getNative() const
+#endif
+    {
         return (socket_.native());
     }
 
diff --git a/src/lib/bench/benchmark.h b/src/lib/bench/benchmark.h
index 34baa14..f9b9d47 100644
--- a/src/lib/bench/benchmark.h
+++ b/src/lib/bench/benchmark.h
@@ -26,6 +26,8 @@
 #include <iostream>
 #include <ios>
 
+#include <bench/lib.h>
+
 namespace isc {
 namespace bench {
 
diff --git a/src/lib/bench/benchmark_util.cc b/src/lib/bench/benchmark_util.cc
index 34356c8..54226ac 100644
--- a/src/lib/bench/benchmark_util.cc
+++ b/src/lib/bench/benchmark_util.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBBENCH_EXPORT
+
 #include <fstream>
 #include <iostream>
 #include <string>
@@ -39,7 +41,7 @@ using namespace isc::util;
 
 namespace isc {
 namespace bench {
-void
+ISC_LIBBENCH_API void
 loadQueryData(const char* const input_file, BenchQueries& queries,
               const RRClass& qclass, const bool strict)
 {
@@ -54,7 +56,7 @@ loadQueryData(const char* const input_file, BenchQueries& queries,
     ifs.close();
 }
 
-void
+ISC_LIBBENCH_API void
 loadQueryData(istream& input, BenchQueries& queries, const RRClass& qclass,
               const bool strict)
 {
diff --git a/src/lib/bench/benchmark_util.h b/src/lib/bench/benchmark_util.h
index 3a373f2..dbd340e 100644
--- a/src/lib/bench/benchmark_util.h
+++ b/src/lib/bench/benchmark_util.h
@@ -31,16 +31,17 @@
 #include <vector>
 
 #include <exceptions/exceptions.h>
+#include <bench/lib.h>
 
 namespace isc {
 namespace dns {
-class RRClass;
+class ISC_LIBBENCH_API RRClass;
 }
 
 namespace bench {
 /// \brief An exception that is thrown if an error occurs within the benchmark
 /// module.
-class BenchMarkError : public Exception {
+class ISC_LIBBENCH_API BenchMarkError : public Exception {
 public:
     BenchMarkError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -108,8 +109,9 @@ typedef std::vector<std::vector<unsigned char> > BenchQueries;
 /// is used for all queries.
 /// \param strict If \c true, apply stricter validation on the query name and
 /// query RR types; otherwise invalid inputs will be ignored.
-void loadQueryData(const char* const input_file, BenchQueries& queries,
-                   const isc::dns::RRClass& qclass, const bool strict = false);
+ISC_LIBBENCH_API void
+loadQueryData(const char* const input_file, BenchQueries& queries,
+              const isc::dns::RRClass& qclass, const bool strict = false);
 
 /// \brief Load query %data from an input stream into a vector.
 ///
@@ -136,8 +138,9 @@ void loadQueryData(const char* const input_file, BenchQueries& queries,
 /// is used for all queries.
 /// \param strict If \c true, apply stricter validation on the query name and
 /// query RR types; otherwise invalid inputs will be ignored.
-void loadQueryData(std::istream& input, BenchQueries& queries,
-                   const isc::dns::RRClass& qclass, const bool strict = false);
+ISC_LIBBENCH_API void
+loadQueryData(std::istream& input, BenchQueries& queries,
+              const isc::dns::RRClass& qclass, const bool strict = false);
 }
 }
 #endif  // __BENCHMARK_UTIL_H
diff --git a/src/lib/bench/example/search_bench.cc b/src/lib/bench/example/search_bench.cc
index 84f95d9..10d5fa8 100644
--- a/src/lib/bench/example/search_bench.cc
+++ b/src/lib/bench/example/search_bench.cc
@@ -12,7 +12,16 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
+#ifdef _WIN32
+#include <getopt.h>
+#include <winsock2.h>           // for timeval
+#include <process.h>            // for getpid
+#define getpid _getpid
+#else
 #include <unistd.h>             // for getpid
+#endif
 
 #include <cassert>
 #include <cstdlib>              // for rand
diff --git a/src/lib/bench/lib.h b/src/lib/bench/lib.h
new file mode 100644
index 0000000..cd8d183
--- /dev/null
+++ b/src/lib/bench/lib.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBBENCH_H
+#define __LIBBENCH_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBBENCH_API
+#else
+#ifdef ISC_LIBBENCH_EXPORT
+#define ISC_LIBBENCH_API __declspec(dllexport)
+#else
+#define ISC_LIBBENCH_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBBENCH_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/bench/tests/benchmark_unittest.cc b/src/lib/bench/tests/benchmark_unittest.cc
index dfe7df9..1497930 100644
--- a/src/lib/bench/tests/benchmark_unittest.cc
+++ b/src/lib/bench/tests/benchmark_unittest.cc
@@ -12,8 +12,18 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
 #include <time.h>               // for nanosleep
 
+#ifdef _WIN32
+#include <winsock2.h>
+
+struct timespec {
+    DWORD   tv_sec;    // seconds (was time_t)
+    long    tv_nsec;   // nanoseconds
+};
+#endif
+
 #include <bench/benchmark.h>
 
 #include <gtest/gtest.h>
@@ -32,7 +42,11 @@ public:
         setup_completed_(false), teardown_completed_(false)
     {}
     unsigned int run() {
+#ifdef _WIN32
+        Sleep((sleep_time_.tv_sec * 1000) + (sleep_time_.tv_nsec / 1000000));
+#else
         nanosleep(&sleep_time_, NULL);
+#endif
         return (sub_iterations_);
     }
     const int sub_iterations_;
@@ -84,7 +98,11 @@ TEST(BenchMarkTest, run) {
     const int duration_soft_margin = 12500; // 12.5ms
     struct timeval check_begin, check_end;
     gettimeofday(&check_begin, NULL);
+#ifdef _WIN32
+    Sleep((sleep_timespec.tv_sec * 1000) + (sleep_timespec.tv_nsec / 1000000));
+#else
     nanosleep(&sleep_timespec, 0);
+#endif
     gettimeofday(&check_end, NULL);
     check_end.tv_sec -= check_begin.tv_sec;
     if (check_end.tv_usec >= check_begin.tv_usec) {
diff --git a/src/lib/cc/data.cc b/src/lib/cc/data.cc
index 6ec243a..5b321f3 100644
--- a/src/lib/cc/data.cc
+++ b/src/lib/cc/data.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBCC_EXPORT
+
 #include <config.h>
 
 #include <cc/data.h>
@@ -28,6 +30,11 @@
 
 #include <cmath>
 
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4290)
+#endif
+
 using namespace std;
 
 namespace {
@@ -182,17 +189,18 @@ throwJSONError(const std::string& error, const std::string& file, int line,
 }
 }
 
-std::ostream&
+ISC_LIBCC_API std::ostream&
 operator<<(std::ostream &out, const Element& e) {
     return (out << e.str());
 }
 
-bool
+ISC_LIBCC_API bool
 operator==(const Element& a, const Element& b) {
     return (a.equals(b));
 }
 
-bool operator!=(const Element& a, const Element& b) {
+ISC_LIBCC_API bool
+operator!=(const Element& a, const Element& b) {
     return (!a.equals(b));
 };
 
@@ -906,12 +914,12 @@ MapElement::equals(const Element& other) const {
     }
 }
 
-bool
+ISC_LIBCC_API bool
 isNull(ConstElementPtr p) {
     return (!p);
 }
 
-void
+ISC_LIBCC_API void
 removeIdentical(ElementPtr a, ConstElementPtr b) {
     if (!b) {
         return;
@@ -935,7 +943,7 @@ removeIdentical(ElementPtr a, ConstElementPtr b) {
     }
 }
 
-ConstElementPtr
+ISC_LIBCC_API ConstElementPtr
 removeIdentical(ConstElementPtr a, ConstElementPtr b) {
     ElementPtr result = Element::createMap();
 
@@ -959,7 +967,7 @@ removeIdentical(ConstElementPtr a, ConstElementPtr b) {
     return (result);
 }
 
-void
+ISC_LIBCC_API void
 merge(ElementPtr element, ConstElementPtr other) {
     if (element->getType() != Element::map ||
         other->getType() != Element::map) {
@@ -979,3 +987,7 @@ merge(ElementPtr element, ConstElementPtr other) {
 
 }
 }
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
diff --git a/src/lib/cc/data.h b/src/lib/cc/data.h
index 5c731e6..b0f883d 100644
--- a/src/lib/cc/data.h
+++ b/src/lib/cc/data.h
@@ -21,10 +21,16 @@
 #include <boost/shared_ptr.hpp>
 #include <stdexcept>
 #include <exceptions/exceptions.h>
+#include <cc/lib.h>
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4290 4373)
+#endif
 
 namespace isc { namespace data {
 
-class Element;
+class ISC_LIBCC_API Element;
 // todo: describe the rationale behind ElementPtr?
 typedef boost::shared_ptr<Element> ElementPtr;
 typedef boost::shared_ptr<const Element> ConstElementPtr;
@@ -34,7 +40,7 @@ typedef boost::shared_ptr<const Element> ConstElementPtr;
 /// is called for an Element that has a wrong type (e.g. int_value on a
 /// ListElement)
 ///
-class TypeError : public isc::Exception {
+class ISC_LIBCC_API TypeError : public isc::Exception {
 public:
     TypeError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -47,7 +53,7 @@ public:
 // i'd like to use Exception here but we need one that is derived from
 // runtime_error (as this one is directly based on external data, and
 // i want to add some values to any static data string that is provided)
-class JSONError : public isc::Exception {
+class ISC_LIBCC_API JSONError : public isc::Exception {
 public:
     JSONError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -70,7 +76,7 @@ public:
 /// raising a \c TypeError for functions that are not supported for
 /// the type in question.
 ///
-class Element {
+class ISC_LIBCC_API Element {
     
 private:
     // technically the type could be omitted; is it useful?
@@ -371,7 +377,7 @@ public:
     //@}
 };
 
-class IntElement : public Element {
+class ISC_LIBCC_API IntElement : public Element {
     long int i;
 
 public:
@@ -385,7 +391,7 @@ public:
     bool equals(const Element& other) const;
 };
 
-class DoubleElement : public Element {
+class ISC_LIBCC_API DoubleElement : public Element {
     double d;
 
 public:
@@ -399,7 +405,7 @@ public:
     bool equals(const Element& other) const;
 };
 
-class BoolElement : public Element {
+class ISC_LIBCC_API BoolElement : public Element {
     bool b;
 
 public:
@@ -413,14 +419,14 @@ public:
     bool equals(const Element& other) const;
 };
 
-class NullElement : public Element {
+class ISC_LIBCC_API NullElement : public Element {
 public:
     NullElement() : Element(null) {};
     void toJSON(std::ostream& ss) const;
     bool equals(const Element& other) const;
 };
 
-class StringElement : public Element {
+class ISC_LIBCC_API StringElement : public Element {
     std::string s;
 
 public:
@@ -434,7 +440,7 @@ public:
     bool equals(const Element& other) const;
 };
 
-class ListElement : public Element {
+class ISC_LIBCC_API ListElement : public Element {
     std::vector<ConstElementPtr> l;
 
 public:
@@ -464,7 +470,7 @@ public:
     bool equals(const Element& other) const;
 };
 
-class MapElement : public Element {
+class ISC_LIBCC_API MapElement : public Element {
     std::map<std::string, ConstElementPtr> m;
 
 public:
@@ -515,7 +521,7 @@ public:
 /// Checks whether the given ElementPtr is a NULL pointer
 /// \param p The ElementPtr to check
 /// \return true if it is NULL, false if not.
-bool isNull(ConstElementPtr p);
+ISC_LIBCC_API bool isNull(ConstElementPtr p);
 
 ///
 /// \brief Remove all values from the first ElementPtr that are
@@ -524,14 +530,15 @@ bool isNull(ConstElementPtr p);
 /// only contains new and changed values (for ModuleCCSession and
 /// configuration update handlers)
 /// Raises a TypeError if a or b are not MapElements
-void removeIdentical(ElementPtr a, ConstElementPtr b);
+ISC_LIBCC_API void removeIdentical(ElementPtr a, ConstElementPtr b);
 
 /// \brief Create a new ElementPtr from the first ElementPtr, removing all
 /// values that are equal in the second. Both ElementPtrs MUST be MapElements.
 /// The returned ElementPtr will be a MapElement that only contains new and
 /// changed values (for ModuleCCSession and configuration update handlers).
 /// Raises a TypeError if a or b are not MapElements
-ConstElementPtr removeIdentical(ConstElementPtr a, ConstElementPtr b);
+ISC_LIBCC_API ConstElementPtr
+removeIdentical(ConstElementPtr a, ConstElementPtr b);
 
 /// \brief Merges the data from other into element.
 /// (on the first level). Both elements must be
@@ -545,7 +552,7 @@ ConstElementPtr removeIdentical(ConstElementPtr a, ConstElementPtr b);
 /// configuration data (which would then result in reverting back
 /// to the default).
 /// Raises a TypeError if either ElementPtr is not a MapElement
-void merge(ElementPtr element, ConstElementPtr other);
+ISC_LIBCC_API void merge(ElementPtr element, ConstElementPtr other);
 
 ///
 /// \brief Insert the Element as a string into stream.
@@ -562,11 +569,17 @@ void merge(ElementPtr element, ConstElementPtr other);
 /// \param e The \c ElementPtr object to insert.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c out after the insertion operation.
-std::ostream& operator<<(std::ostream& out, const Element& e);
+ISC_LIBCC_API std::ostream&
+operator<<(std::ostream& out, const Element& e);
 
-bool operator==(const Element& a, const Element& b);
-bool operator!=(const Element& a, const Element& b);
+ISC_LIBCC_API bool operator==(const Element& a, const Element& b);
+ISC_LIBCC_API bool operator!=(const Element& a, const Element& b);
 } }
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
 #endif // _ISC_DATA_H
 
 // Local Variables: 
diff --git a/src/lib/cc/lib.h b/src/lib/cc/lib.h
new file mode 100644
index 0000000..ee9bc31
--- /dev/null
+++ b/src/lib/cc/lib.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBCC_H
+#define __LIBCC_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBCC_API
+#else
+#ifdef ISC_LIBCC_EXPORT
+#define ISC_LIBCC_API __declspec(dllexport)
+#else
+#define ISC_LIBCC_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBCC_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/cc/logger.cc b/src/lib/cc/logger.cc
index 36db88d..0db7117 100644
--- a/src/lib/cc/logger.cc
+++ b/src/lib/cc/logger.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBCC_EXPORT
+
 #include <cc/logger.h>
 
 namespace isc {
diff --git a/src/lib/cc/logger.h b/src/lib/cc/logger.h
index d6253d0..8da6be0 100644
--- a/src/lib/cc/logger.h
+++ b/src/lib/cc/logger.h
@@ -15,6 +15,7 @@
 #ifndef CC_LOGGER_H
 #define CC_LOGGER_H
 
+#include <cc/lib.h>
 #include <cc/cc_messages.h>
 #include <log/macros.h>
 
diff --git a/src/lib/cc/session.cc b/src/lib/cc/session.cc
index 4455b68..ded9210 100644
--- a/src/lib/cc/session.cc
+++ b/src/lib/cc/session.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBCC_EXPORT
+
 #include <config.h>
 #include <cc/session_config.h>
 #include <cc/logger.h>
@@ -24,7 +26,9 @@
 // A middle term solution is to generalize our local wrapper interface
 // (currently only available for the auth server), where all such portability
 // issues are hidden, and to have other modules use the wrapper.
+#ifndef _WIN32
 #include <unistd.h>             // for some IPC/network system calls
+#endif
 #include <asio.hpp>
 #include <asio/error_code.hpp>
 #include <asio/deadline_timer.hpp>
@@ -35,9 +39,12 @@
 #include <iostream>
 #include <sstream>
 
+#ifndef _WIN32
 #include <sys/un.h>
+#endif
 
 #include <boost/bind.hpp>
+#include <boost/lexical_cast.hpp>
 #include <boost/optional.hpp>
 #include <boost/function.hpp>
 #include <boost/date_time/posix_time/posix_time_types.hpp>
@@ -88,7 +95,11 @@ public:
     void startRead(boost::function<void()> user_handler);
     void setTimeout(size_t seconds) { timeout_ = seconds; };
     size_t getTimeout() const { return timeout_; };
+#ifdef _WIN32
+    SOCKET getSocketDesc();
+#else
     int getSocketDesc();
+#endif
 
     long int sequence_; // the next sequence number to use
     std::string lname_;
@@ -100,7 +111,11 @@ private:
 
 private:
     io_service& io_service_;
+#ifndef _WIN32
     asio::local::stream_protocol::socket socket_;
+#else
+    asio::ip::tcp::socket socket_;
+#endif
     uint32_t data_length_;
     boost::function<void()> user_handler_;
     asio::error_code error_;
@@ -121,12 +136,30 @@ void
 SessionImpl::establish(const char& socket_file) {
     try {
         LOG_DEBUG(logger, DBG_TRACE_BASIC, CC_ESTABLISH).arg(&socket_file);
-        socket_.connect(asio::local::stream_protocol::endpoint(&socket_file),
-                        error_);
+#ifndef _WIN32
+        asio::local::stream_protocol::endpoint ep(&socket_file);
+#else
+        const std::string spec(&socket_file);
+        asio::ip::address addr;
+        if (spec.find("v4_") == 0)
+            addr = asio::ip::address_v4::loopback();
+        else if (spec.find("v6_") == 0)
+            addr = asio::ip::address_v6::loopback();
+        else {
+             isc_throw(SessionError, "bad endpoint: " << spec);
+        }
+        uint16_t port = boost::lexical_cast<uint16_t>(spec.substr(3));
+        asio::ip::tcp::endpoint ep(addr, port);
+#endif
+        socket_.connect(ep, error_);
         LOG_DEBUG(logger, DBG_TRACE_BASIC, CC_ESTABLISHED);
     } catch(const asio::system_error& se) {
         LOG_FATAL(logger, CC_CONN_ERROR).arg(se.what());
         isc_throw(SessionError, se.what());
+#ifdef _WIN32
+    } catch(const boost::bad_lexical_cast&) {
+        isc_throw(SessionError, "bad port");
+#endif
     }
     if (error_) {
         LOG_FATAL(logger, CC_NO_MSGQ).arg(error_.message());
@@ -255,12 +288,17 @@ SessionImpl::internalRead(const asio::error_code& error,
     }
 }
 
+#ifdef _WIN32
+SOCKET
+#else
 int
+#endif
 SessionImpl::getSocketDesc() {
     /// @todo boost 1.42 uses native() method, but it is deprecated
     /// in 1.49 and native_handle() is recommended instead
     if (!socket_.is_open()) {
-        isc_throw(InvalidOperation, "Can't return socket desciptor: no socket opened.");
+        isc_throw(InvalidOperation,
+                  "Can't return socket descriptor: no socket opened.");
     }
     return socket_.native();
 }
@@ -284,7 +322,11 @@ Session::startRead(boost::function<void()> read_callback) {
     impl_->startRead(read_callback);
 }
 
+#ifdef _WIN32
+SOCKET
+#else
 int
+#endif
 Session::getSocketDesc() const {
     return impl_->getSocketDesc();
 }
diff --git a/src/lib/cc/session.h b/src/lib/cc/session.h
index 9b08232..0e250a8 100644
--- a/src/lib/cc/session.h
+++ b/src/lib/cc/session.h
@@ -21,6 +21,7 @@
 
 #include <exceptions/exceptions.h>
 
+#include <cc/lib.h>
 #include <cc/data.h>
 #include <cc/session_config.h>
 
@@ -32,7 +33,7 @@ namespace isc {
     namespace cc {
         class SessionImpl;
 
-        class SessionError : public isc::Exception {
+        class ISC_LIBCC_API SessionError : public isc::Exception {
         public:
             SessionError(const char* file, size_t line, const char* what) :
                 isc::Exception(file, line, what) {}
@@ -41,7 +42,7 @@ namespace isc {
         /// \brief A standard Exception class that is thrown when a
         /// blocking readData call does not read the given number of
         /// bytes before the timeout expires
-        class SessionTimeout : public isc::Exception {
+        class ISC_LIBCC_API SessionTimeout : public isc::Exception {
         public:
             SessionTimeout(const char* file, size_t line, const char* what) :
                 isc::Exception(file, line, what) {}
@@ -55,7 +56,7 @@ namespace isc {
         /// For simplicity we only define the methods that are necessary for
         /// existing test cases that use this base class.  Eventually we'll
         /// probably have to extend them.
-        class AbstractSession {
+        class ISC_LIBCC_API AbstractSession {
             ///
             /// \name Constructors, Assignment Operator and Destructor.
             ///
@@ -108,7 +109,7 @@ namespace isc {
             virtual size_t getTimeout() const = 0;
         };
 
-    class Session : public AbstractSession {
+    class ISC_LIBCC_API Session : public AbstractSession {
         private:
             SessionImpl* impl_;
 
@@ -145,7 +146,11 @@ namespace isc {
             /// @brief returns socket descriptor from underlying socket connection
             ///
             /// @param returns socket descriptor used for session connection
+#ifdef _WIN32
+            virtual SOCKET getSocketDesc() const;
+#else
             virtual int getSocketDesc() const;
+#endif
     private:
             void sendmsg(isc::data::ConstElementPtr msg);
             void sendmsg(isc::data::ConstElementPtr env,
diff --git a/src/lib/cc/session_config.h.win32 b/src/lib/cc/session_config.h.win32
new file mode 100644
index 0000000..f7dff33
--- /dev/null
+++ b/src/lib/cc/session_config.h.win32
@@ -0,0 +1,2 @@
+#define BIND10_MSGQ_SOCKET_FILE "v4_1016"
+
diff --git a/src/lib/cc/tests/run_unittests.cc b/src/lib/cc/tests/run_unittests.cc
index 299bd96..e55e281 100644
--- a/src/lib/cc/tests/run_unittests.cc
+++ b/src/lib/cc/tests/run_unittests.cc
@@ -12,6 +12,12 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
 #include <gtest/gtest.h>
 #include <util/unittests/run_all.h>
 #include <log/logger_support.h>
@@ -22,5 +28,13 @@ main(int argc, char* argv[]) {
 
     isc::log::initLogger();
 
+#ifdef _WIN32
+    WSADATA wsaData;
+    WSAStartup(MAKEWORD(2,2), &wsaData);
+    int ret = isc::util::unittests::run_all();
+    WSACleanup();
+    return (ret);
+#else
     return (isc::util::unittests::run_all());
+#endif
 }
diff --git a/src/lib/cc/tests/session_unittests.cc b/src/lib/cc/tests/session_unittests.cc
index 528dda9..0705257 100644
--- a/src/lib/cc/tests/session_unittests.cc
+++ b/src/lib/cc/tests/session_unittests.cc
@@ -13,14 +13,18 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 #include <config.h>
+#include <stdint.h>
 
 // for some IPC/network system calls in asio/detail/pipe_select_interrupter.hpp 
+#ifndef _WIN32
 #include <unistd.h>
+#endif
 // XXX: the ASIO header must be included before others.  See session.cc.
 #include <asio.hpp>
 
 #include <gtest/gtest.h>
 #include <boost/bind.hpp>
+#include <boost/lexical_cast.hpp>
 
 #include <exceptions/exceptions.h>
 
@@ -62,22 +66,46 @@ class TestDomainSocket {
 public:
     TestDomainSocket(asio::io_service& io_service, const char* file) :
         io_service_(io_service),
+#ifndef _WIN32
         ep_(file),
         acceptor_(io_service_, ep_),
-        socket_(io_service_)
+#else
+        acceptor_(io_service_),
+#endif
+        socket_(io_service_),
+        ready_(false)
     {
+#ifdef _WIN32
+        std::string spec(file);
+        asio::ip::address addr;
+        if (spec.find("v4_") == 0)
+            addr = asio::ip::address_v4::loopback();
+        else if (spec.find("v6_") == 0)
+            addr = asio::ip::address_v6::loopback();
+        uint16_t port = boost::lexical_cast<uint16_t>(spec.substr(3));
+        ep_ = asio::ip::tcp::endpoint(addr, port);
+        acceptor_.open(ep_.protocol());
+        acceptor_.set_option(asio::socket_base::reuse_address(true));
+        acceptor_.bind(ep_);
+        acceptor_.listen(asio::socket_base::max_connections);
+#endif
         acceptor_.async_accept(socket_,
                                boost::bind(&TestDomainSocket::acceptHandler,
                                            this, _1));
     }
     
     ~TestDomainSocket() {
+        acceptor_.close();
         socket_.close();
+#ifndef _WIN32
         unlink(BIND10_TEST_SOCKET_FILE);
+#endif
     }
 
     void
-    acceptHandler(const asio::error_code&) const {
+    acceptHandler(const asio::error_code&) {
+      if (ready_)
+         waitSendLname();
     }
 
     void
@@ -107,26 +135,40 @@ public:
     }
 
     void
-    setSendLname() {
+    waitSendLname() {
         // ignore whatever data we get, send back an lname
         asio::async_read(socket_,  asio::buffer(data_buf, 0),
                          boost::bind(&TestDomainSocket::sendLname, this));
     }
     
+    void
+    setSendLname() {
+        ready_ = true;
+    }
+
 private:
     asio::io_service& io_service_;
+#ifndef _WIN32
     asio::local::stream_protocol::endpoint ep_;
     asio::local::stream_protocol::acceptor acceptor_;
     asio::local::stream_protocol::socket socket_;
+#else
+    asio::ip::tcp::endpoint ep_;
+    asio::ip::tcp::acceptor acceptor_;
+    asio::ip::tcp::socket socket_;
+#endif
     char data_buf[1024];
+    bool ready_;
 };
 
 class SessionTest : public ::testing::Test {
 protected:
     SessionTest() : sess(my_io_service), work(my_io_service) {
+#ifndef _WIN32
         // The TestDomainSocket is held as a 'new'-ed pointer,
         // so we can call unlink() first.
         unlink(BIND10_TEST_SOCKET_FILE);
+#endif
         tds = new TestDomainSocket(my_io_service, BIND10_TEST_SOCKET_FILE);
     }
 
@@ -242,10 +284,19 @@ TEST_F(SessionTest, get_socket_descr) {
     tds->setSendLname();
     sess.establish(BIND10_TEST_SOCKET_FILE);
 
+#ifdef _WIN32
+    SOCKET socket = INVALID_SOCKET;
+    // session is established, so getSocketDesc() should work
+    EXPECT_NO_THROW(socket = sess.getSocketDesc());
+
+    // expect actual socket handle to be returned, not INVALID_SOCKET
+    EXPECT_NE(INVALID_SOCKET, socket);
+#else
     int socket = 0;
     // session is established, so getSocketDesc() should work
     EXPECT_NO_THROW(socket = sess.getSocketDesc());
 
     // expect actual socket handle to be returned, not 0
     EXPECT_LT(0, socket);
+#endif
 }
diff --git a/src/lib/cc/tests/session_unittests_config.h.win32 b/src/lib/cc/tests/session_unittests_config.h.win32
new file mode 100644
index 0000000..9a659b9
--- /dev/null
+++ b/src/lib/cc/tests/session_unittests_config.h.win32
@@ -0,0 +1,2 @@
+#define BIND10_TEST_SOCKET_FILE "v6_12345"
+
diff --git a/src/lib/config/ccsession.cc b/src/lib/config/ccsession.cc
index d4c6653..5d65970 100644
--- a/src/lib/config/ccsession.cc
+++ b/src/lib/config/ccsession.cc
@@ -12,12 +12,19 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBCONFIG_EXPORT
+
 #include <config.h>
 
 #include <stdexcept>
 #include <stdlib.h>
 #include <string.h>
+#ifdef _WIN32
+#include <time.h>
+#include <ws2tcpip.h>
+#else
 #include <sys/time.h>
+#endif
 #include <ctype.h>
 
 #include <algorithm>
@@ -55,7 +62,7 @@ namespace isc {
 namespace config {
 
 /// Creates a standard config/command protocol answer message
-ConstElementPtr
+ISC_LIBCONFIG_API ConstElementPtr
 createAnswer() {
     ElementPtr answer = Element::fromJSON("{\"result\": [] }");
     ElementPtr answer_content = Element::createList();
@@ -65,7 +72,7 @@ createAnswer() {
     return (answer);
 }
 
-ConstElementPtr
+ISC_LIBCONFIG_API ConstElementPtr
 createAnswer(const int rcode, ConstElementPtr arg) {
     if (rcode != 0 && (!arg || arg->getType() != Element::string)) {
         isc_throw(CCSessionError, "Bad or no argument for rcode != 0");
@@ -79,7 +86,7 @@ createAnswer(const int rcode, ConstElementPtr arg) {
     return (answer);
 }
 
-ConstElementPtr
+ISC_LIBCONFIG_API ConstElementPtr
 createAnswer(const int rcode, const std::string& arg) {
     ElementPtr answer = Element::fromJSON("{\"result\": [] }");
     ElementPtr answer_content = Element::createList();
@@ -90,7 +97,7 @@ createAnswer(const int rcode, const std::string& arg) {
     return (answer);
 }
 
-ConstElementPtr
+ISC_LIBCONFIG_API ConstElementPtr
 parseAnswer(int &rcode, ConstElementPtr msg) {
     if (msg &&
         msg->getType() == Element::map &&
@@ -120,12 +127,12 @@ parseAnswer(int &rcode, ConstElementPtr msg) {
     }
 }
 
-ConstElementPtr
+ISC_LIBCONFIG_API ConstElementPtr
 createCommand(const std::string& command) {
     return (createCommand(command, ElementPtr()));
 }
 
-ConstElementPtr
+ISC_LIBCONFIG_API ConstElementPtr
 createCommand(const std::string& command, ConstElementPtr arg) {
     ElementPtr cmd = Element::createMap();
     ElementPtr cmd_parts = Element::createList();
@@ -137,7 +144,7 @@ createCommand(const std::string& command, ConstElementPtr arg) {
     return (cmd);
 }
 
-std::string
+ISC_LIBCONFIG_API std::string
 parseCommand(ConstElementPtr& arg, ConstElementPtr command) {
     if (command &&
         command->getType() == Element::map &&
@@ -305,7 +312,7 @@ copyLogger(ConstElementPtr& cur_logger, const std::string& new_name) {
 } // end anonymous namespace
 
 
-ConstElementPtr
+ISC_LIBCONFIG_API ConstElementPtr
 getRelatedLoggers(ConstElementPtr loggers) {
     // Keep a list of names for easier lookup later
     std::set<std::string> our_names;
@@ -370,7 +377,7 @@ getRelatedLoggers(ConstElementPtr loggers) {
     return (result);
 }
 
-void
+ISC_LIBCONFIG_API void
 default_logconfig_handler(const std::string& module_name,
                           ConstElementPtr new_config,
                           const ConfigData& config_data) {
diff --git a/src/lib/config/ccsession.h b/src/lib/config/ccsession.h
index e96a33d..a9466f4 100644
--- a/src/lib/config/ccsession.h
+++ b/src/lib/config/ccsession.h
@@ -15,6 +15,7 @@
 #ifndef __CCSESSION_H
 #define __CCSESSION_H 1
 
+#include <config/lib.h>
 #include <config/config_data.h>
 #include <config/module_spec.h>
 
@@ -32,7 +33,7 @@ namespace config {
 /// \brief Creates a standard config/command level success answer message
 ///        (i.e. of the form { "result": [ 0 ] }
 /// \return Standard command/config success answer message
-isc::data::ConstElementPtr createAnswer();
+ISC_LIBCONFIG_API isc::data::ConstElementPtr createAnswer();
 
 ///
 /// \brief Creates a standard config/command level answer message
@@ -44,8 +45,8 @@ isc::data::ConstElementPtr createAnswer();
 ///            Element type. For rcode == 1, this argument is mandatory,
 ///            and must be a StringElement containing an error description
 /// \return Standard command/config answer message
-isc::data::ConstElementPtr createAnswer(const int rcode,
-                                        isc::data::ConstElementPtr arg);
+ISC_LIBCONFIG_API isc::data::ConstElementPtr
+createAnswer(const int rcode, isc::data::ConstElementPtr arg);
 
 ///
 /// \brief Creates a standard config/command level answer message
@@ -54,8 +55,8 @@ isc::data::ConstElementPtr createAnswer(const int rcode,
 /// \param rcode The return code (0 for success)
 /// \param arg A string to put into the StringElement argument
 /// \return Standard command/config answer message
-isc::data::ConstElementPtr createAnswer(const int rcode,
-                                        const std::string& arg);
+ISC_LIBCONFIG_API isc::data::ConstElementPtr
+createAnswer(const int rcode, const std::string& arg);
 
 ///
 /// Parses a standard config/command level answer message
@@ -66,8 +67,8 @@ isc::data::ConstElementPtr createAnswer(const int rcode,
 /// \return The optional argument in the message, or an empty ElementPtr
 ///         if there was no argument. If rcode != 0, this contains a
 ///         StringElement with the error description.
-isc::data::ConstElementPtr parseAnswer(int &rcode,
-                                       isc::data::ConstElementPtr msg);
+ISC_LIBCONFIG_API isc::data::ConstElementPtr
+parseAnswer(int &rcode, isc::data::ConstElementPtr msg);
 
 ///
 /// \brief Creates a standard config/command command message with no
@@ -75,7 +76,8 @@ isc::data::ConstElementPtr parseAnswer(int &rcode,
 /// 
 /// \param command The command string
 /// \return The created message
-isc::data::ConstElementPtr createCommand(const std::string& command);
+ISC_LIBCONFIG_API isc::data::ConstElementPtr
+createCommand(const std::string& command);
 
 ///
 /// \brief Creates a standard config/command command message with the
@@ -85,8 +87,8 @@ isc::data::ConstElementPtr createCommand(const std::string& command);
 /// \param arg The optional argument for the command. This can be of 
 ///        any Element type, but it should conform to the .spec file.
 /// \return The created message
-isc::data::ConstElementPtr createCommand(const std::string& command,
-                                         isc::data::ConstElementPtr arg);
+ISC_LIBCONFIG_API isc::data::ConstElementPtr
+createCommand(const std::string& command, isc::data::ConstElementPtr arg);
 
 ///
 /// \brief Parses the given command into a string containing the actual
@@ -122,8 +124,9 @@ isc::data::ConstElementPtr createCommand(const std::string& command,
 /// \param command The command message containing the command (as made
 ///        by createCommand()
 /// \return The command name
-std::string parseCommand(isc::data::ConstElementPtr& arg,
-                         isc::data::ConstElementPtr command);
+ISC_LIBCONFIG_API std::string
+parseCommand(isc::data::ConstElementPtr& arg,
+             isc::data::ConstElementPtr command);
 
 
 ///
@@ -131,7 +134,7 @@ std::string parseCommand(isc::data::ConstElementPtr& arg,
 /// is there is a problem with one of the messages
 ///
 // todo: include types and called function in the exception
-class CCSessionError : public isc::Exception {
+class ISC_LIBCONFIG_API CCSessionError : public isc::Exception {
 public:
     CCSessionError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -140,7 +143,7 @@ public:
 ///
 /// \brief This exception is thrown if the constructor fails
 ///
-class CCSessionInitError : public isc::Exception {
+class ISC_LIBCONFIG_API CCSessionInitError : public isc::Exception {
 public:
     CCSessionInitError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -151,7 +154,7 @@ public:
 /// holds configuration information, and handles messages from
 /// the command channel
 ///
-class ModuleCCSession : public ConfigData {
+class ISC_LIBCONFIG_API ModuleCCSession : public ConfigData {
 public:
     /**
      * Initialize a config/command session
@@ -539,7 +542,7 @@ private:
 /// \param new_config The modified configuration values
 /// \param config_data The full config data for the (remote) logging
 ///                    module.
-void
+ISC_LIBCONFIG_API void
 default_logconfig_handler(const std::string& module_name,
                           isc::data::ConstElementPtr new_config,
                           const ConfigData& config_data);
@@ -573,7 +576,7 @@ default_logconfig_handler(const std::string& module_name,
 /// \param loggers the original 'loggers' config list
 /// \return ListElement containing only loggers relevant for this
 ///         module, where * is replaced by the root logger name
-isc::data::ConstElementPtr
+ISC_LIBCONFIG_API isc::data::ConstElementPtr
 getRelatedLoggers(isc::data::ConstElementPtr loggers);
 
 } // namespace config
diff --git a/src/lib/config/config_data.cc b/src/lib/config/config_data.cc
index ebe51cc..353620d 100644
--- a/src/lib/config/config_data.cc
+++ b/src/lib/config/config_data.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBCONFIG_EXPORT
+
 #include <config/config_data.h>
 
 #include <boost/foreach.hpp>
diff --git a/src/lib/config/config_data.h b/src/lib/config/config_data.h
index 3fdbc25..aea8c76 100644
--- a/src/lib/config/config_data.h
+++ b/src/lib/config/config_data.h
@@ -18,6 +18,7 @@
 #include <string>
 #include <vector>
 
+#include <config/lib.h>
 #include <config/module_spec.h>
 #include <exceptions/exceptions.h>
 
@@ -27,13 +28,13 @@ namespace config {
 /// This exception is thrown when the caller is trying to access
 /// data that doesn't exist (i.e. with an identifier that does not
 /// point to anything defined in the .spec file)
-class DataNotFoundError : public isc::Exception {
+class ISC_LIBCONFIG_API DataNotFoundError : public isc::Exception {
 public:
     DataNotFoundError(const char* file, size_t line, const std::string& what) :
         isc::Exception(file, line, what) {}
 };
 
-class ConfigData {
+class ISC_LIBCONFIG_API ConfigData {
 public:
     /// Constructs a ConfigData option with no specification and an
     /// empty configuration.
diff --git a/src/lib/config/config_log.cc b/src/lib/config/config_log.cc
index 672b9f1..1cd8663 100644
--- a/src/lib/config/config_log.cc
+++ b/src/lib/config/config_log.cc
@@ -14,6 +14,8 @@
 
 /// Defines the logger used by the config lib
 
+#define ISC_LIBCONFIG_EXPORT
+
 #include "config/config_log.h"
 
 namespace isc {
diff --git a/src/lib/config/config_log.h b/src/lib/config/config_log.h
index 21709fd..5a42680 100644
--- a/src/lib/config/config_log.h
+++ b/src/lib/config/config_log.h
@@ -16,6 +16,7 @@
 #define __CONFIG_LOG__H
 
 #include <log/macros.h>
+#include <config/lib.h>
 #include "config_messages.h"
 
 namespace isc {
diff --git a/src/lib/config/lib.h b/src/lib/config/lib.h
new file mode 100644
index 0000000..7178070
--- /dev/null
+++ b/src/lib/config/lib.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBCONFIG_H
+#define __LIBCONFIG_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBCONFIG_API
+#else
+#ifdef ISC_LIBCONFIG_EXPORT
+#define ISC_LIBCONFIG_API __declspec(dllexport)
+#else
+#define ISC_LIBCONFIG_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBCONFIG_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/config/module_spec.cc b/src/lib/config/module_spec.cc
index 98a991d..d94e86b 100644
--- a/src/lib/config/module_spec.cc
+++ b/src/lib/config/module_spec.cc
@@ -13,6 +13,8 @@
 // NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 // WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBCONFIG_EXPORT
+
 #include <config/module_spec.h>
 
 #include <sstream>
@@ -20,8 +22,18 @@
 #include <fstream>
 #include <cerrno>
 
+#ifdef _WIN32
+#include <time.h>
+#include <strptime.h>
+#endif
+
 #include <boost/foreach.hpp>
 
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4290)
+#endif
+
 // todo: add more context to thrown ModuleSpecErrors?
 
 using namespace isc::data;
@@ -498,3 +510,7 @@ ModuleSpec::validateSpecList(ConstElementPtr spec, ConstElementPtr data,
 
 }
 }
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
diff --git a/src/lib/config/module_spec.h b/src/lib/config/module_spec.h
index 27dcfe3..476bf95 100644
--- a/src/lib/config/module_spec.h
+++ b/src/lib/config/module_spec.h
@@ -17,16 +17,22 @@
 #define _MODULE_SPEC_H 1
 
 #include <cc/data.h>
+#include <config/lib.h>
 
 #include <sstream>
 
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4290)
+#endif
+
 namespace isc { namespace config {
 
     ///
     /// A standard ModuleSpec exception that is thrown when a
     /// specification is not in the correct form.
     ///
-    class ModuleSpecError : public isc::Exception {
+    class ISC_LIBCONFIG_API ModuleSpecError : public isc::Exception {
     public:
         ModuleSpecError(const char* file, size_t line,
                         const char* what = "Module specification is invalid") :
@@ -43,7 +49,7 @@ namespace isc { namespace config {
     ///
     /// The form of the specification is described in doc/ (TODO)
     ///
-    class ModuleSpec {
+    class ISC_LIBCONFIG_API ModuleSpec {
     public:
         ModuleSpec() {};
         /// Create a \c ModuleSpec instance with the given data as
@@ -184,7 +190,7 @@ namespace isc { namespace config {
     /// \param file_name The file to be opened and parsed
     /// \param check If true, the module specification in the file
     /// is checked to be of the correct form
-    ModuleSpec
+    ISC_LIBCONFIG_API ModuleSpec
     moduleSpecFromFile(const std::string& file_name, const bool check = true)
         throw(isc::data::JSONError, ModuleSpecError);
 
@@ -196,11 +202,15 @@ namespace isc { namespace config {
     /// \param in The std::istream containing the .spec file data
     /// \param check If true, the module specification is checked
     /// to be of the correct form
-    ModuleSpec
+    ISC_LIBCONFIG_API ModuleSpec
     moduleSpecFromFile(std::ifstream& in, const bool check = true)
                        throw(isc::data::JSONError, ModuleSpecError);
 } }
 
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
 #endif // _DATA_DEF_H
 
 // Local Variables: 
diff --git a/src/lib/config/tests/ccsession_unittests.cc b/src/lib/config/tests/ccsession_unittests.cc
index e07c5a3..b80b5a6 100644
--- a/src/lib/config/tests/ccsession_unittests.cc
+++ b/src/lib/config/tests/ccsession_unittests.cc
@@ -14,6 +14,10 @@
 
 #include <config.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#endif
+
 #include <gtest/gtest.h>
 
 #include <config/tests/fake_session.h>
diff --git a/src/lib/config/tests/data_def_unittests_config.h.win32 b/src/lib/config/tests/data_def_unittests_config.h.win32
new file mode 100644
index 0000000..04b41e7
--- /dev/null
+++ b/src/lib/config/tests/data_def_unittests_config.h.win32
@@ -0,0 +1,16 @@
+// Copyright (C) 2009  Internet Systems Consortium, Inc. ("ISC")   
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+// #define TEST_DATA_PATH "@abs_srcdir@/testdata"
+#define LOG_SPEC_FILE BIND10HOME "/src/bin/cfgmgr/plugins/logging.spec"
diff --git a/src/lib/config/tests/fake_session.cc b/src/lib/config/tests/fake_session.cc
index 157d4d6..6956086 100644
--- a/src/lib/config/tests/fake_session.cc
+++ b/src/lib/config/tests/fake_session.cc
@@ -12,10 +12,20 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_FAKE_SESSION_EXPORT
+
 #include <config.h>
 
 #include <stdint.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#endif
+
 #include <cstdio>
 #include <vector>
 #include <iostream>
@@ -32,10 +42,6 @@ using namespace std;
 using namespace isc::cc;
 using namespace isc::data;
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
 // ok i want these in cc/data 
 bool
 listContains(ConstElementPtr list, ConstElementPtr el) {
diff --git a/src/lib/config/tests/fake_session.h b/src/lib/config/tests/fake_session.h
index c91b519..4078deb 100644
--- a/src/lib/config/tests/fake_session.h
+++ b/src/lib/config/tests/fake_session.h
@@ -24,9 +24,19 @@
 #include <cc/data.h>
 #include <cc/session.h>
 
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_FAKE_SESSION_API
+#else
+#ifdef ISC_FAKE_SESSION_EXPORT
+#define ISC_FAKE_SESSION_API __declspec(dllexport)
+#else
+#define ISC_FAKE_SESSION_API __declspec(dllimport)
+#endif
+#endif
+
 namespace isc {
 namespace cc {
-class FakeSession : public AbstractSession {
+class ISC_FAKE_SESSION_API FakeSession : public AbstractSession {
 private:
     FakeSession(const Session& source);
     FakeSession& operator=(const Session& source);
diff --git a/src/lib/xfr/NO_PORT_ON_WINDOWS b/src/lib/xfr/NO_PORT_ON_WINDOWS
new file mode 100644
index 0000000..e69de29
diff --git a/src/lib/xfr/lib.h b/src/lib/xfr/lib.h
new file mode 100644
index 0000000..8bc2b01
--- /dev/null
+++ b/src/lib/xfr/lib.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBXFR_H
+#define __LIBXFR_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBXFR_API
+#else
+#ifdef ISC_LIBXFR_EXPORT
+#define ISC_LIBXFR_API __declspec(dllexport)
+#else
+#define ISC_LIBXFR_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBXFR_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/xfr/tests/run_unittests.cc b/src/lib/xfr/tests/run_unittests.cc
index 8dc59a2..650a251 100644
--- a/src/lib/xfr/tests/run_unittests.cc
+++ b/src/lib/xfr/tests/run_unittests.cc
@@ -12,6 +12,12 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
 #include <gtest/gtest.h>
 #include <log/logger_support.h>
 #include <util/unittests/run_all.h>
@@ -20,5 +26,14 @@ int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
+
+#ifdef _WIN32
+    WSADATA wsaData;
+    WSAStartup(MAKEWORD(2,2), &wsaData);
+    int ret = isc::util::unittests::run_all();
+    WSACleanup();
+    return (ret);
+#else
     return (isc::util::unittests::run_all());
+#endif
 }
diff --git a/src/lib/xfr/xfrout_client.cc b/src/lib/xfr/xfrout_client.cc
index af0c1b5..b51248f 100644
--- a/src/lib/xfr/xfrout_client.cc
+++ b/src/lib/xfr/xfrout_client.cc
@@ -12,12 +12,18 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBXFR_EXPORT
+
+#include <config.h>
+
 #include <cstdlib>
 #include <cstring>
 #include <iostream>
 
 // for some IPC/network system calls in asio/detail/pipe_select_interrupter.hpp
+#ifndef _WIN32
 #include <unistd.h>
+#endif
 #include <asio.hpp>
 
 #include <util/io/fd_share.h>
@@ -25,7 +31,13 @@
 
 using namespace std;
 using namespace isc::util::io;
+#ifndef _WIN32
 using asio::local::stream_protocol;
+#else
+#include <boost/lexical_cast.hpp>
+using asio::ip::tcp;
+#define stream_protocol tcp
+#endif
 
 namespace isc {
 namespace xfr {
@@ -53,7 +65,20 @@ XfroutClient::~XfroutClient() {
 void
 XfroutClient::connect() {
     try {
-        impl_->socket_.connect(stream_protocol::endpoint(impl_->file_path_));
+#ifndef _WIN32
+        stream_protocol::endpoint ep(impl_->file_path_);
+#else
+        asio::ip::address addr;
+        if (impl_->file_path_.find("v4_") == 0)
+            addr = asio::ip::address_v4::loopback();
+        else if (impl_->file_path_.find("v6_") == 0)
+            addr = asio::ip::address_v6::loopback();
+        else
+            isc_throw(XfroutError, "bad endpoint: " << impl_->file_path_);
+        uint16_t port = boost::lexical_cast<uint16_t>(impl_->file_path_.substr(3));
+        stream_protocol::endpoint ep(addr, port);
+#endif
+        impl_->socket_.connect(ep);
     } catch (const asio::system_error& err) {
         isc_throw(XfroutError, "socket connect failed for " <<
                   impl_->file_path_ << ": " << err.what());
@@ -70,7 +95,12 @@ XfroutClient::disconnect() {
 }
 
 int
-XfroutClient::sendXfroutRequestInfo(const int tcp_sock,
+XfroutClient::sendXfroutRequestInfo(
+#ifdef _WIN32
+                                    const SOCKET tcp_sock,
+#else
+                                    const int tcp_sock,
+#endif
                                     const void* const msg_data,
                                     const uint16_t msg_len)
 {
@@ -90,6 +120,7 @@ XfroutClient::sendXfroutRequestInfo(const int tcp_sock,
     // performed. For reference, see 8.5.4/6 of n3225.
     const uint8_t lenbuf[2] = { static_cast<uint8_t>(msg_len >> 8),
                                 static_cast<uint8_t>(msg_len & 0xff) };
+#ifndef _WIN32
     if (send(impl_->socket_.native(), lenbuf, sizeof(lenbuf), 0) !=
         sizeof(lenbuf)) {
         isc_throw(XfroutError,
@@ -99,6 +130,20 @@ XfroutClient::sendXfroutRequestInfo(const int tcp_sock,
         isc_throw(XfroutError,
                   "failed to send XFR request data to xfrout module");
     }
+#else
+    if (send(impl_->socket_.native(),
+             (const char *)lenbuf,
+             sizeof(lenbuf), 0) != sizeof(lenbuf)) {
+        isc_throw(XfroutError,
+                  "failed to send XFR request length to xfrout module");
+    }
+    if (send(impl_->socket_.native(),
+             (const char *)msg_data,
+             msg_len, 0) != msg_len) {
+        isc_throw(XfroutError,
+                  "failed to send XFR request data to xfrout module");
+    }
+#endif
 
     return (0);
 }
diff --git a/src/lib/xfr/xfrout_client.h b/src/lib/xfr/xfrout_client.h
index bad963c..0440235 100644
--- a/src/lib/xfr/xfrout_client.h
+++ b/src/lib/xfr/xfrout_client.h
@@ -20,13 +20,14 @@
 #include <string>
 
 #include <exceptions/exceptions.h>
+#include <xfr/lib.h>
 
 namespace isc {
 namespace xfr {
 
 struct XfroutClientImpl;
 
-class XfroutError: public Exception {
+class ISC_LIBXFR_API XfroutError: public Exception {
 public:
     XfroutError(const char *file, size_t line, const char *what):
         isc::Exception(file, line, what) {}
@@ -37,7 +38,7 @@ public:
 ///
 /// The intended primary usage of abstraction is to allow tests for the
 /// user class of XfroutClient without requiring actual communication.
-class AbstractXfroutClient {
+class ISC_LIBXFR_API AbstractXfroutClient {
     ///
     /// \name Constructors, Assignment Operator and Destructor.
     ///
@@ -60,11 +61,17 @@ public:
     //@}
     virtual void connect() = 0;
     virtual void disconnect() = 0;
-    virtual int sendXfroutRequestInfo(int tcp_sock, const void* msg_data,
+    virtual int sendXfroutRequestInfo(
+#ifdef _WIN32
+                                      SOCKET tcp_sock,
+#else
+                                      int tcp_sock,
+#endif
+                                      const void* msg_data,
                                       uint16_t msg_len) = 0;
 };
 
-class XfroutClient : public AbstractXfroutClient {
+class ISC_LIBXFR_API XfroutClient : public AbstractXfroutClient {
 public:
     XfroutClient(const std::string& file);
     ~XfroutClient();
@@ -75,7 +82,13 @@ private:
 public:
     virtual void connect();
     virtual void disconnect();
-    virtual int sendXfroutRequestInfo(int tcp_sock, const void* msg_data,
+    virtual int sendXfroutRequestInfo(
+#ifdef _WIN32
+                                      SOCKET tcp_sock,
+#else
+                                      int tcp_sock,
+#endif
+                                      const void* msg_data,
                                       uint16_t msg_len);
 private:
     XfroutClientImpl* impl_;
diff --git a/win32build/VS2010/bind10.sln b/win32build/VS2010/bind10.sln
index 4bc6b0c..f0b4d7a 100755
--- a/win32build/VS2010/bind10.sln
+++ b/win32build/VS2010/bind10.sln
@@ -3,28 +3,44 @@ Microsoft Visual Studio Solution File, Format Version 11.00
 # Visual C++ Express 2010
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BINDInstall", "BINDInstall\BINDInstall.vcxproj", "{41B1A417-2276-422A-A054-2691F6E40A54}"
 	ProjectSection(ProjectDependencies) = postProject
+		{69048307-9655-4AAA-B07E-B67345C1DEF9} = {69048307-9655-4AAA-B07E-B67345C1DEF9}
 		{9F69DE07-D285-4B5C-8528-DF975C59ED3B} = {9F69DE07-D285-4B5C-8528-DF975C59ED3B}
 		{1AB80214-A605-4453-8960-F618C72C4CF3} = {1AB80214-A605-4453-8960-F618C72C4CF3}
+		{5D857B14-7763-466C-9D4E-D7C2E57C0E7F} = {5D857B14-7763-466C-9D4E-D7C2E57C0E7F}
+		{33927325-C9B5-4FE6-B69F-318433AFF4BD} = {33927325-C9B5-4FE6-B69F-318433AFF4BD}
+		{D781E925-FE57-4C75-9E26-BBC102B6A24A} = {D781E925-FE57-4C75-9E26-BBC102B6A24A}
 		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
 		{DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2} = {DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}
 		{E7E6EC32-E109-4334-9BCD-BC8190489070} = {E7E6EC32-E109-4334-9BCD-BC8190489070}
+		{D728B037-F63F-4CB5-B840-9AC54BDFBED5} = {D728B037-F63F-4CB5-B840-9AC54BDFBED5}
+		{6D55503E-0B43-4273-B6A5-4CEB39E114AC} = {6D55503E-0B43-4273-B6A5-4CEB39E114AC}
 		{13215E3E-E75D-463D-A0EF-93A1C9A20896} = {13215E3E-E75D-463D-A0EF-93A1C9A20896}
 		{9FBAAE48-1543-41C9-80EA-A65E7C1D1A98} = {9FBAAE48-1543-41C9-80EA-A65E7C1D1A98}
+		{635B804D-1B52-433E-9ECD-84F507FDB1F1} = {635B804D-1B52-433E-9ECD-84F507FDB1F1}
 		{6A29BC58-CA6E-4196-8E88-C675FE944BBF} = {6A29BC58-CA6E-4196-8E88-C675FE944BBF}
 		{8F120666-1A69-4506-8546-0F665E80FFB7} = {8F120666-1A69-4506-8546-0F665E80FFB7}
 		{8412D26C-6C2B-4FCC-ABB4-E9509E833951} = {8412D26C-6C2B-4FCC-ABB4-E9509E833951}
+		{DC86E86E-BB80-4C93-8A1F-E409C1FA38D2} = {DC86E86E-BB80-4C93-8A1F-E409C1FA38D2}
 		{2C518972-FF5F-4D33-9D3E-5BCC6357EDD7} = {2C518972-FF5F-4D33-9D3E-5BCC6357EDD7}
+		{761E7D88-6CCB-4E41-9F1E-6C1FBBD062F5} = {761E7D88-6CCB-4E41-9F1E-6C1FBBD062F5}
+		{6280D58A-5E05-45D1-8B79-DF677C114CD4} = {6280D58A-5E05-45D1-8B79-DF677C114CD4}
 		{08075CA0-4E2C-451E-BAA6-E422353A5FC1} = {08075CA0-4E2C-451E-BAA6-E422353A5FC1}
+		{6AC4F7A4-9BDC-415F-81DB-6332CACA38B3} = {6AC4F7A4-9BDC-415F-81DB-6332CACA38B3}
 		{D85833AC-23A9-4710-9911-8AAEC4BF6E8F} = {D85833AC-23A9-4710-9911-8AAEC4BF6E8F}
 		{1CCFABAC-5A0B-499F-914E-AAD0371EEC4F} = {1CCFABAC-5A0B-499F-914E-AAD0371EEC4F}
+		{EB54F7B8-FAEF-4348-989C-D4E6B42CEFB1} = {EB54F7B8-FAEF-4348-989C-D4E6B42CEFB1}
 		{13D541BC-8365-42F7-840F-A117CA0413DD} = {13D541BC-8365-42F7-840F-A117CA0413DD}
+		{813BA1C9-8CD8-4B06-B1C0-FDAB576AC4B6} = {813BA1C9-8CD8-4B06-B1C0-FDAB576AC4B6}
+		{FEFFE0CB-CD6B-4E61-854C-39506D6DCD5D} = {FEFFE0CB-CD6B-4E61-854C-39506D6DCD5D}
 		{2E64F6CC-3AD9-4DA7-8E05-ABBB83F9AFC4} = {2E64F6CC-3AD9-4DA7-8E05-ABBB83F9AFC4}
 		{AC4806D1-C2CC-444B-8F0D-209851A969D2} = {AC4806D1-C2CC-444B-8F0D-209851A969D2}
 		{65B0B6D2-94CE-4A21-85E7-A047C79044F9} = {65B0B6D2-94CE-4A21-85E7-A047C79044F9}
 		{F6E728D3-A0B2-40F6-9B91-7D4474D778F3} = {F6E728D3-A0B2-40F6-9B91-7D4474D778F3}
 		{564B0ADE-76A4-4833-9610-8DEEA6A15423} = {564B0ADE-76A4-4833-9610-8DEEA6A15423}
+		{7EB244E7-D381-4CF4-A2D4-739B81F77588} = {7EB244E7-D381-4CF4-A2D4-739B81F77588}
 		{C90961EC-3DDF-432F-8E3D-BDA06E4859D9} = {C90961EC-3DDF-432F-8E3D-BDA06E4859D9}
 		{C7DEAFEC-423B-486D-BBD8-896B0DE69DDE} = {C7DEAFEC-423B-486D-BBD8-896B0DE69DDE}
+		{CC29C1F9-A77B-476C-803E-8830F8312571} = {CC29C1F9-A77B-476C-803E-8830F8312571}
 		{2844FDFB-A0A1-4FA4-A654-15D69CC717DD} = {2844FDFB-A0A1-4FA4-A654-15D69CC717DD}
 		{AEF3DFFE-B566-4E6A-B299-B59B81022C06} = {AEF3DFFE-B566-4E6A-B299-B59B81022C06}
 	EndProjectSection
@@ -39,6 +55,7 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcryptolink", "libcryptolink\libcryptolink.vcxproj", "{13215E3E-E75D-463D-A0EF-93A1C9A20896}"
 	ProjectSection(ProjectDependencies) = postProject
 		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
+		{8F120666-1A69-4506-8546-0F665E80FFB7} = {8F120666-1A69-4506-8546-0F665E80FFB7}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdns++", "libdns++\libdns++.vcxproj", "{F6E728D3-A0B2-40F6-9B91-7D4474D778F3}"
@@ -96,8 +113,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyddns++", "pyddns++\pyddns
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcc", "libcc\libcc.vcxproj", "{CC29C1F9-A77B-476C-803E-8830F8312571}"
 	ProjectSection(ProjectDependencies) = postProject
-		{1AB80214-A605-4453-8960-F618C72C4CF3} = {1AB80214-A605-4453-8960-F618C72C4CF3}
-		{13D541BC-8365-42F7-840F-A117CA0413DD} = {13D541BC-8365-42F7-840F-A117CA0413DD}
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
+		{2E64F6CC-3AD9-4DA7-8E05-ABBB83F9AFC4} = {2E64F6CC-3AD9-4DA7-8E05-ABBB83F9AFC4}
+		{AEF3DFFE-B566-4E6A-B299-B59B81022C06} = {AEF3DFFE-B566-4E6A-B299-B59B81022C06}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcc_tests", "libcc_tests\libcc_tests.vcxproj", "{D781E925-FE57-4C75-9E26-BBC102B6A24A}"
@@ -111,7 +129,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcc_tests", "libcc_tests\
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcfgclient", "libcfgclient\libcfgclient.vcxproj", "{813BA1C9-8CD8-4B06-B1C0-FDAB576AC4B6}"
 	ProjectSection(ProjectDependencies) = postProject
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
+		{2E64F6CC-3AD9-4DA7-8E05-ABBB83F9AFC4} = {2E64F6CC-3AD9-4DA7-8E05-ABBB83F9AFC4}
 		{CC29C1F9-A77B-476C-803E-8830F8312571} = {CC29C1F9-A77B-476C-803E-8830F8312571}
+		{AEF3DFFE-B566-4E6A-B299-B59B81022C06} = {AEF3DFFE-B566-4E6A-B299-B59B81022C06}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcfgclient_tests", "libcfgclient_tests\libcfgclient_tests.vcxproj", "{5D857B14-7763-466C-9D4E-D7C2E57C0E7F}"
@@ -149,7 +170,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblog_compiler", "liblog_c
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libasiolink", "libasiolink\libasiolink.vcxproj", "{69048307-9655-4AAA-B07E-B67345C1DEF9}"
 	ProjectSection(ProjectDependencies) = postProject
-		{DC86E86E-BB80-4C93-8A1F-E409C1FA38D2} = {DC86E86E-BB80-4C93-8A1F-E409C1FA38D2}
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
+		{AEF3DFFE-B566-4E6A-B299-B59B81022C06} = {AEF3DFFE-B566-4E6A-B299-B59B81022C06}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libasiolink_tests", "libasiolink_tests\libasiolink_tests.vcxproj", "{6AC4F7A4-9BDC-415F-81DB-6332CACA38B3}"
@@ -165,6 +187,11 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libasiodns", "libasiodns\libasiodns.vcxproj", "{7EB244E7-D381-4CF4-A2D4-739B81F77588}"
 	ProjectSection(ProjectDependencies) = postProject
 		{69048307-9655-4AAA-B07E-B67345C1DEF9} = {69048307-9655-4AAA-B07E-B67345C1DEF9}
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
+		{8F120666-1A69-4506-8546-0F665E80FFB7} = {8F120666-1A69-4506-8546-0F665E80FFB7}
+		{2E64F6CC-3AD9-4DA7-8E05-ABBB83F9AFC4} = {2E64F6CC-3AD9-4DA7-8E05-ABBB83F9AFC4}
+		{F6E728D3-A0B2-40F6-9B91-7D4474D778F3} = {F6E728D3-A0B2-40F6-9B91-7D4474D778F3}
+		{AEF3DFFE-B566-4E6A-B299-B59B81022C06} = {AEF3DFFE-B566-4E6A-B299-B59B81022C06}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libasiodns_tests", "libasiodns_tests\libasiodns_tests.vcxproj", "{6D55503E-0B43-4273-B6A5-4CEB39E114AC}"
@@ -275,7 +302,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libserver_common_tests", "l
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbench", "libbench\libbench.vcxproj", "{DC86E86E-BB80-4C93-8A1F-E409C1FA38D2}"
 	ProjectSection(ProjectDependencies) = postProject
-		{761E7D88-6CCB-4E41-9F1E-6C1FBBD062F5} = {761E7D88-6CCB-4E41-9F1E-6C1FBBD062F5}
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
+		{8F120666-1A69-4506-8546-0F665E80FFB7} = {8F120666-1A69-4506-8546-0F665E80FFB7}
+		{F6E728D3-A0B2-40F6-9B91-7D4474D778F3} = {F6E728D3-A0B2-40F6-9B91-7D4474D778F3}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbench_tests", "libbench_tests\libbench_tests.vcxproj", "{FEFFE0CB-CD6B-4E61-854C-39506D6DCD5D}"
@@ -312,7 +341,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pydutil_io", "pydutil_io\py
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxfr", "libxfr\libxfr.vcxproj", "{761E7D88-6CCB-4E41-9F1E-6C1FBBD062F5}"
 	ProjectSection(ProjectDependencies) = postProject
-		{EB54F7B8-FAEF-4348-989C-D4E6B42CEFB1} = {EB54F7B8-FAEF-4348-989C-D4E6B42CEFB1}
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
+		{AC4806D1-C2CC-444B-8F0D-209851A969D2} = {AC4806D1-C2CC-444B-8F0D-209851A969D2}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdhcp", "libdhcp\libdhcp.vcxproj", "{F27BC0D0-A334-4DC0-9DC9-880D5DA74524}"
@@ -350,12 +380,18 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "b10-dhcp6_tests", "b10-dhcp
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libacl", "libacl\libacl.vcxproj", "{635B804D-1B52-433E-9ECD-84F507FDB1F1}"
 	ProjectSection(ProjectDependencies) = postProject
-		{33927325-C9B5-4FE6-B69F-318433AFF4BD} = {33927325-C9B5-4FE6-B69F-318433AFF4BD}
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
+		{8F120666-1A69-4506-8546-0F665E80FFB7} = {8F120666-1A69-4506-8546-0F665E80FFB7}
+		{CC29C1F9-A77B-476C-803E-8830F8312571} = {CC29C1F9-A77B-476C-803E-8830F8312571}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdnsacl", "libdnsacl\libdnsacl.vcxproj", "{EB54F7B8-FAEF-4348-989C-D4E6B42CEFB1}"
 	ProjectSection(ProjectDependencies) = postProject
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
 		{635B804D-1B52-433E-9ECD-84F507FDB1F1} = {635B804D-1B52-433E-9ECD-84F507FDB1F1}
+		{8F120666-1A69-4506-8546-0F665E80FFB7} = {8F120666-1A69-4506-8546-0F665E80FFB7}
+		{F6E728D3-A0B2-40F6-9B91-7D4474D778F3} = {F6E728D3-A0B2-40F6-9B91-7D4474D778F3}
+		{CC29C1F9-A77B-476C-803E-8830F8312571} = {CC29C1F9-A77B-476C-803E-8830F8312571}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libacl_tests", "libacl_tests\libacl_tests.vcxproj", "{D728B037-F63F-4CB5-B840-9AC54BDFBED5}"
diff --git a/win32build/VS2010/libacl/libacl.vcxproj b/win32build/VS2010/libacl/libacl.vcxproj
index 9a2b8f3..fd71bba 100755
--- a/win32build/VS2010/libacl/libacl.vcxproj
+++ b/win32build/VS2010/libacl/libacl.vcxproj
@@ -14,12 +14,14 @@
     <ClInclude Include="..\..\..\src\lib\acl\acl.h" />
     <ClInclude Include="..\..\..\src\lib\acl\check.h" />
     <ClInclude Include="..\..\..\src\lib\acl\ip_check.h" />
+    <ClInclude Include="..\..\..\src\lib\acl\lib.h" />
     <ClInclude Include="..\..\..\src\lib\acl\loader.h" />
     <ClInclude Include="..\..\..\src\lib\acl\logic_check.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\acl\ip_check.cc" />
     <ClCompile Include="..\..\..\src\lib\acl\loader.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{635B804D-1B52-433E-9ECD-84F507FDB1F1}</ProjectGuid>
@@ -28,12 +30,12 @@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
@@ -49,10 +51,11 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
+    <TargetName>$(ProjectName)d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -66,6 +69,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libccd.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -84,6 +89,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;libcc.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/win32build/VS2010/libacl/libacl.vcxproj.filters b/win32build/VS2010/libacl/libacl.vcxproj.filters
index f7c2dd3..2dfe4da 100755
--- a/win32build/VS2010/libacl/libacl.vcxproj.filters
+++ b/win32build/VS2010/libacl/libacl.vcxproj.filters
@@ -30,6 +30,9 @@
     <ClInclude Include="..\..\..\src\lib\acl\logic_check.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\acl\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\acl\ip_check.cc">
@@ -38,5 +41,8 @@
     <ClCompile Include="..\..\..\src\lib\acl\loader.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\dllmain.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/win32build/VS2010/libacl_tests/libacl_tests.vcxproj b/win32build/VS2010/libacl_tests/libacl_tests.vcxproj
index ec38f18..91c8e7a 100755
--- a/win32build/VS2010/libacl_tests/libacl_tests.vcxproj
+++ b/win32build/VS2010/libacl_tests/libacl_tests.vcxproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -53,15 +53,15 @@
       </PrecompiledHeader>
       <WarningLevel>Level4</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\liblog\$(Configuration);..\libdns++\$(Configuration);..\libcc\$(Configuration);..\libacl\$(Configuration);..\libdnsacl\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libdns++.lib;libcc.lib;libacl.lib;libdnsacl.lib;log4cplusSD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\log4cplus\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libutil_unittestsd.lib;liblogd.lib;libdns++d.lib;libccd.lib;libacld.lib;libdnsacld.lib;log4cplusD.lib;gtestd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -72,7 +72,7 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
@@ -81,8 +81,8 @@
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\liblog\$(Configuration);..\libdns++\$(Configuration);..\libcc\$(Configuration);..\libacl\$(Configuration);..\libdnsacl\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libdns++.lib;libcc.lib;libacl.lib;libdnsacl.lib;log4cplusS.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\log4cplus\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libdns++.lib;libcc.lib;libacl.lib;libdnsacl.lib;log4cplus.lib;gtest.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
diff --git a/win32build/VS2010/libasiodns/libasiodns.vcxproj b/win32build/VS2010/libasiodns/libasiodns.vcxproj
index 5648847..3ffda30 100755
--- a/win32build/VS2010/libasiodns/libasiodns.vcxproj
+++ b/win32build/VS2010/libasiodns/libasiodns.vcxproj
@@ -18,6 +18,7 @@
     <ClInclude Include="..\..\..\src\lib\asiodns\dns_server.h" />
     <ClInclude Include="..\..\..\src\lib\asiodns\dns_service.h" />
     <ClInclude Include="..\..\..\src\lib\asiodns\io_fetch.h" />
+    <ClInclude Include="..\..\..\src\lib\asiodns\lib.h" />
     <ClInclude Include="..\..\..\src\lib\asiodns\logger.h" />
     <ClInclude Include="..\..\..\src\lib\asiodns\sync_udp_server.h" />
     <ClInclude Include="..\..\..\src\lib\asiodns\tcp_server.h" />
@@ -31,6 +32,7 @@
     <ClCompile Include="..\..\..\src\lib\asiodns\sync_udp_server.cc" />
     <ClCompile Include="..\..\..\src\lib\asiodns\tcp_server.cc" />
     <ClCompile Include="..\..\..\src\lib\asiodns\udp_server.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{7EB244E7-D381-4CF4-A2D4-739B81F77588}</ProjectGuid>
@@ -39,12 +41,12 @@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
@@ -60,10 +62,11 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
+    <TargetName>$(ProjectName)d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -77,6 +80,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;liblogd.lib;libdns++d.lib;libasiolinkd.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\asiodns
@@ -100,6 +105,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;liblog.lib;libdns++.lib;libasiolink.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\asiodns
diff --git a/win32build/VS2010/libasiodns/libasiodns.vcxproj.filters b/win32build/VS2010/libasiodns/libasiodns.vcxproj.filters
index c140df6..7434342 100755
--- a/win32build/VS2010/libasiodns/libasiodns.vcxproj.filters
+++ b/win32build/VS2010/libasiodns/libasiodns.vcxproj.filters
@@ -48,6 +48,9 @@
     <ClInclude Include="..\..\..\src\lib\asiodns\sync_udp_server.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\asiodns\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\asiodns\dns_service.cc">
@@ -71,5 +74,8 @@
     <ClCompile Include="..\..\..\src\lib\asiodns\sync_udp_server.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\dllmain.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/win32build/VS2010/libasiodns_tests/libasiodns_tests.vcxproj b/win32build/VS2010/libasiodns_tests/libasiodns_tests.vcxproj
index 3fc9ef7..efe852b 100755
--- a/win32build/VS2010/libasiodns_tests/libasiodns_tests.vcxproj
+++ b/win32build/VS2010/libasiodns_tests/libasiodns_tests.vcxproj
@@ -52,16 +52,16 @@
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
       <WarningLevel>Level4</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;TEST_DATA_DIR="testdata";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;TEST_DATA_DIR="testdata";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\ext\asio;..\..\..\ext\coroutine;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;libcryptolink.lib;libdns++.lib;liblog.lib;libasiolink.lib;libasiodns.lib;botan.lib;log4cplusSD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libutil_unittestsd.lib;libcryptolinkd.lib;libdns++d.lib;liblogd.lib;libasiolinkd.lib;libasiodnsd.lib;botand.lib;log4cplusD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\libcryptolink\$(Configuration);..\libdns++\$(Configuration);..\liblog\$(Configuration);..\libasiolink\$(Configuration);..\libasiodns\$(Configuration);..\..\..\..\botan\md10\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\botan\v100\$(Configuration);..\..\..\..\log4cplus\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -71,7 +71,7 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;TEST_DATA_DIR="testdata";NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;TEST_DATA_DIR="testdata";NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\ext\asio;..\..\..\ext\coroutine;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
@@ -81,8 +81,8 @@
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;libcryptolink.lib;libdns++.lib;liblog.lib;libasiolink.lib;libasiodns.lib;botan.lib;log4cplusS.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\libcryptolink\$(Configuration);..\libdns++\$(Configuration);..\liblog\$(Configuration);..\libasiolink\$(Configuration);..\libasiodns\$(Configuration);..\..\..\..\botan\md10\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;libcryptolink.lib;libdns++.lib;liblog.lib;libasiolink.lib;libasiodns.lib;botan.lib;log4cplus.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\botan\v100\$(Configuration);..\..\..\..\log4cplus\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
diff --git a/win32build/VS2010/libasiolink/libasiolink.vcxproj b/win32build/VS2010/libasiolink/libasiolink.vcxproj
index bda3408..e8a38a0 100755
--- a/win32build/VS2010/libasiolink/libasiolink.vcxproj
+++ b/win32build/VS2010/libasiolink/libasiolink.vcxproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -21,6 +21,7 @@
     <ClInclude Include="..\..\..\src\lib\asiolink\io_message.h" />
     <ClInclude Include="..\..\..\src\lib\asiolink\io_service.h" />
     <ClInclude Include="..\..\..\src\lib\asiolink\io_socket.h" />
+    <ClInclude Include="..\..\..\src\lib\asiolink\lib.h" />
     <ClInclude Include="..\..\..\src\lib\asiolink\simple_callback.h" />
     <ClInclude Include="..\..\..\src\lib\asiolink\tcp_endpoint.h" />
     <ClInclude Include="..\..\..\src\lib\asiolink\tcp_socket.h" />
@@ -28,11 +29,16 @@
     <ClInclude Include="..\..\..\src\lib\asiolink\udp_socket.h" />
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\..\src\lib\asiolink\dummy_io_cb.cc" />
     <ClCompile Include="..\..\..\src\lib\asiolink\interval_timer.cc" />
     <ClCompile Include="..\..\..\src\lib\asiolink\io_address.cc" />
     <ClCompile Include="..\..\..\src\lib\asiolink\io_endpoint.cc" />
+    <ClCompile Include="..\..\..\src\lib\asiolink\io_error.cc" />
+    <ClCompile Include="..\..\..\src\lib\asiolink\io_message.cc" />
     <ClCompile Include="..\..\..\src\lib\asiolink\io_service.cc" />
     <ClCompile Include="..\..\..\src\lib\asiolink\io_socket.cc" />
+    <ClCompile Include="..\..\..\src\lib\asiolink\simple_callback.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{69048307-9655-4AAA-B07E-B67345C1DEF9}</ProjectGuid>
@@ -41,12 +47,12 @@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
@@ -62,10 +68,11 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
+    <TargetName>$(ProjectName)d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -79,6 +86,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;liblogd.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -97,6 +106,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;liblog.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/win32build/VS2010/libasiolink/libasiolink.vcxproj.filters b/win32build/VS2010/libasiolink/libasiolink.vcxproj.filters
index 3daf254..1d661da 100755
--- a/win32build/VS2010/libasiolink/libasiolink.vcxproj.filters
+++ b/win32build/VS2010/libasiolink/libasiolink.vcxproj.filters
@@ -60,6 +60,9 @@
     <ClInclude Include="..\..\..\src\lib\asiolink\udp_socket.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\asiolink\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\asiolink\interval_timer.cc">
@@ -77,5 +80,20 @@
     <ClCompile Include="..\..\..\src\lib\asiolink\io_socket.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\dllmain.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\src\lib\asiolink\io_error.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\src\lib\asiolink\dummy_io_cb.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\src\lib\asiolink\io_message.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\src\lib\asiolink\simple_callback.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/win32build/VS2010/libasiolink_tests/libasiolink_tests.vcxproj b/win32build/VS2010/libasiolink_tests/libasiolink_tests.vcxproj
index 76032b6..0562b20 100755
--- a/win32build/VS2010/libasiolink_tests/libasiolink_tests.vcxproj
+++ b/win32build/VS2010/libasiolink_tests/libasiolink_tests.vcxproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -52,7 +52,7 @@
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
       <WarningLevel>Level4</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;TEST_DATA_DIR="testdata";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;TEST_DATA_DIR="testdata";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\src\lib\dns;..\..\..\ext\asio;..\..\..\ext\coroutine;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
@@ -60,8 +60,8 @@
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;libdns++.lib;liblog.lib;libasiolink.lib;log4cplusSD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\libdns++\$(Configuration);..\liblog\$(Configuration);..\libasiolink\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libutil_unittestsd.lib;libdns++d.lib;liblogd.lib;libasiolinkd.lib;log4cplusD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\log4cplus\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -71,7 +71,7 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;TEST_DATA_DIR="testdata";NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;TEST_DATA_DIR="testdata";NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\src\lib\dns;..\..\..\ext\asio;..\..\..\ext\coroutine;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
@@ -81,8 +81,8 @@
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;libdns++.lib;liblog.lib;libasiolink.lib;log4cplusS.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\libdns++\$(Configuration);..\liblog\$(Configuration);..\libasiolink\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;libdns++.lib;liblog.lib;libasiolink.lib;log4cplus.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\log4cplus\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
diff --git a/win32build/VS2010/libbench/libbench.vcxproj b/win32build/VS2010/libbench/libbench.vcxproj
index 39b2930..50e8196 100755
--- a/win32build/VS2010/libbench/libbench.vcxproj
+++ b/win32build/VS2010/libbench/libbench.vcxproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -13,9 +13,11 @@
   <ItemGroup>
     <ClInclude Include="..\..\..\src\lib\bench\benchmark.h" />
     <ClInclude Include="..\..\..\src\lib\bench\benchmark_util.h" />
+    <ClInclude Include="..\..\..\src\lib\bench\lib.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\bench\benchmark_util.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{DC86E86E-BB80-4C93-8A1F-E409C1FA38D2}</ProjectGuid>
@@ -24,12 +26,12 @@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
@@ -45,10 +47,11 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
+    <TargetName>$(ProjectName)d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -62,6 +65,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libdns++d.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -80,6 +85,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;libdns++.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/win32build/VS2010/libbench/libbench.vcxproj.filters b/win32build/VS2010/libbench/libbench.vcxproj.filters
index 67b195d..c8d4b05 100755
--- a/win32build/VS2010/libbench/libbench.vcxproj.filters
+++ b/win32build/VS2010/libbench/libbench.vcxproj.filters
@@ -21,10 +21,16 @@
     <ClInclude Include="..\..\..\src\lib\bench\benchmark_util.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\bench\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\bench\benchmark_util.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\dllmain.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/win32build/VS2010/libbench_example/libbench_example.vcxproj b/win32build/VS2010/libbench_example/libbench_example.vcxproj
index 2ef6c7d..6b11520 100755
--- a/win32build/VS2010/libbench_example/libbench_example.vcxproj
+++ b/win32build/VS2010/libbench_example/libbench_example.vcxproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -59,9 +59,9 @@
     <Link>
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>libexceptions.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>libexceptionsd.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)search_bench$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -82,7 +82,7 @@
       <OptimizeReferences>true</OptimizeReferences>
       <AdditionalDependencies>libexceptions.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)search_bench$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
diff --git a/win32build/VS2010/libbench_tests/libbench_tests.vcxproj b/win32build/VS2010/libbench_tests/libbench_tests.vcxproj
index 2cb54d9..7a54f5b 100755
--- a/win32build/VS2010/libbench_tests/libbench_tests.vcxproj
+++ b/win32build/VS2010/libbench_tests/libbench_tests.vcxproj
@@ -52,7 +52,7 @@
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
       <WarningLevel>Level4</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;TEST_DATA_DIR="%BIND10HOME%/src/lib/bench/tests/testdata";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;TEST_DATA_DIR="%BIND10HOME%/src/lib/bench/tests/testdata";_DEBUG;_CONSOLE;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
@@ -60,8 +60,8 @@
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;libcryptolink.lib;libdns++.lib;libbench.lib;botan.lib;gtestd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\libcryptolink\$(Configuration);..\libdns++\$(Configuration);..\libbench\$(Configuration);..\..\..\..\botan\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libutil_unittestsd.lib;libcryptolinkd.lib;libdns++d.lib;libbenchd.lib;botand.lib;gtestd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\botan\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -71,7 +71,7 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;TEST_DATA_DIR="%BIND10HOME%/src/lib/bench/tests/testdata";NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;TEST_DATA_DIR="%BIND10HOME%/src/lib/bench/tests/testdata";NDEBUG;_CONSOLE;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
@@ -82,7 +82,7 @@
       <OptimizeReferences>true</OptimizeReferences>
       <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
       <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;libcryptolink.lib;libdns++.lib;libbench.lib;botan.lib;gtest.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\libcryptolink\$(Configuration);..\libdns++\$(Configuration);..\libbench\$(Configuration);..\..\..\..\botan\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\botan\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
diff --git a/win32build/VS2010/libcc/libcc.vcxproj b/win32build/VS2010/libcc/libcc.vcxproj
index 44850f5..eb1280f 100755
--- a/win32build/VS2010/libcc/libcc.vcxproj
+++ b/win32build/VS2010/libcc/libcc.vcxproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -13,6 +13,7 @@
   <ItemGroup>
     <ClInclude Include="..\..\..\src\lib\cc\cc_messages.h" />
     <ClInclude Include="..\..\..\src\lib\cc\data.h" />
+    <ClInclude Include="..\..\..\src\lib\cc\lib.h" />
     <ClInclude Include="..\..\..\src\lib\cc\logger.h" />
     <ClInclude Include="..\..\..\src\lib\cc\session.h" />
     <ClInclude Include="..\..\..\src\lib\cc\session_config.h" />
@@ -22,6 +23,7 @@
     <ClCompile Include="..\..\..\src\lib\cc\data.cc" />
     <ClCompile Include="..\..\..\src\lib\cc\logger.cc" />
     <ClCompile Include="..\..\..\src\lib\cc\session.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{CC29C1F9-A77B-476C-803E-8830F8312571}</ProjectGuid>
@@ -30,12 +32,12 @@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
@@ -51,10 +53,11 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
+    <TargetName>$(ProjectName)d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -68,6 +71,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;liblogd.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\cc
@@ -93,6 +98,8 @@ copy session_config.h.win32 session_config.h
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;liblog.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\cc
diff --git a/win32build/VS2010/libcc/libcc.vcxproj.filters b/win32build/VS2010/libcc/libcc.vcxproj.filters
index 392031b..30fa3b8 100755
--- a/win32build/VS2010/libcc/libcc.vcxproj.filters
+++ b/win32build/VS2010/libcc/libcc.vcxproj.filters
@@ -30,6 +30,9 @@
     <ClInclude Include="..\..\..\src\lib\cc\cc_messages.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\cc\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\cc\data.cc">
@@ -44,5 +47,8 @@
     <ClCompile Include="..\..\..\src\lib\cc\logger.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\dllmain.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/win32build/VS2010/libcc_tests/libcc_tests.vcxproj b/win32build/VS2010/libcc_tests/libcc_tests.vcxproj
index b474f7b..b6aa1e1 100755
--- a/win32build/VS2010/libcc_tests/libcc_tests.vcxproj
+++ b/win32build/VS2010/libcc_tests/libcc_tests.vcxproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -52,7 +52,7 @@
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
       <WarningLevel>Level4</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\src\lib\dns;..\..\..\src\lib\cc\tests;..\..\..\ext\asio;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
@@ -60,8 +60,8 @@
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libcc.lib;log4cplusSD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\liblog\$(Configuration);..\libcc\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libutil_unittestsd.lib;liblogd.lib;libccd.lib;log4cplusD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\log4cplus\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\cc\tests
@@ -76,7 +76,7 @@ copy session_unittests_config.h.win32 session_unittests_config.h
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\src\lib\dns;..\..\..\src\lib\cc\tests;..\..\..\ext\asio;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
@@ -86,8 +86,8 @@ copy session_unittests_config.h.win32 session_unittests_config.h
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libcc.lib;log4cplusS.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\liblog\$(Configuration);..\libcc\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libcc.lib;log4cplus.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\log4cplus\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\cc\tests
diff --git a/win32build/VS2010/libcfgclient/libcfgclient.vcxproj b/win32build/VS2010/libcfgclient/libcfgclient.vcxproj
index 76289b0..269c393 100755
--- a/win32build/VS2010/libcfgclient/libcfgclient.vcxproj
+++ b/win32build/VS2010/libcfgclient/libcfgclient.vcxproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -15,6 +15,7 @@
     <ClInclude Include="..\..\..\src\lib\config\config_data.h" />
     <ClInclude Include="..\..\..\src\lib\config\config_log.h" />
     <ClInclude Include="..\..\..\src\lib\config\config_messages.h" />
+    <ClInclude Include="..\..\..\src\lib\config\lib.h" />
     <ClInclude Include="..\..\..\src\lib\config\module_spec.h" />
     <ClInclude Include="..\..\strptime.h" />
   </ItemGroup>
@@ -24,6 +25,7 @@
     <ClCompile Include="..\..\..\src\lib\config\config_log.cc" />
     <ClCompile Include="..\..\..\src\lib\config\config_messages.cc" />
     <ClCompile Include="..\..\..\src\lib\config\module_spec.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
     <ClCompile Include="..\..\strptime.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
@@ -33,12 +35,12 @@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
@@ -54,10 +56,11 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
+    <TargetName>$(ProjectName)d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -71,6 +74,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;liblogd.lib;libccd.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\config
@@ -94,6 +99,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;liblog.lib;libcc.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\config
diff --git a/win32build/VS2010/libcfgclient/libcfgclient.vcxproj.filters b/win32build/VS2010/libcfgclient/libcfgclient.vcxproj.filters
index 80e6fc8..32ead0c 100755
--- a/win32build/VS2010/libcfgclient/libcfgclient.vcxproj.filters
+++ b/win32build/VS2010/libcfgclient/libcfgclient.vcxproj.filters
@@ -33,6 +33,9 @@
     <ClInclude Include="..\..\strptime.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\config\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\config\ccsession.cc">
@@ -53,5 +56,8 @@
     <ClCompile Include="..\..\strptime.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\dllmain.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/win32build/VS2010/libcfgclient_tests/libcfgclient_tests.vcxproj b/win32build/VS2010/libcfgclient_tests/libcfgclient_tests.vcxproj
index 84aae51..2feec3e 100755
--- a/win32build/VS2010/libcfgclient_tests/libcfgclient_tests.vcxproj
+++ b/win32build/VS2010/libcfgclient_tests/libcfgclient_tests.vcxproj
@@ -52,7 +52,7 @@
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
       <WarningLevel>Level4</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;TEST_DATA_PATH="%BIND10HOME%/src/lib/config/tests/testdata";BIND10HOME="%BIND10HOME%";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;TEST_DATA_PATH="%BIND10HOME%/src/lib/config/tests/testdata";BIND10HOME="%BIND10HOME%";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
@@ -60,8 +60,8 @@
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libcc.lib;libcfgclient.lib;libfake_session.lib;log4cplusSD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\liblog\$(Configuration);..\libcc\$(Configuration);..\libcfgclient\$(Configuration);..\libfake_session\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libutil_unittestsd.lib;liblogd.lib;libccd.lib;libcfgclientd.lib;libfake_sessiond.lib;log4cplusD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\log4cplus\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\config\tests
@@ -76,7 +76,7 @@ copy data_def_unittests_config.h.win32 data_def_unittests_config.h
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;TEST_DATA_PATH="%BIND10HOME%/src/lib/config/tests/testdata";BIND10HOME="%BIND10HOME%";NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;TEST_DATA_PATH="%BIND10HOME%/src/lib/config/tests/testdata";BIND10HOME="%BIND10HOME%";NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
@@ -86,8 +86,8 @@ copy data_def_unittests_config.h.win32 data_def_unittests_config.h
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libcc.lib;libcfgclient.lib;libfake_session.lib;log4cplusS.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\liblog\$(Configuration);..\libcc\$(Configuration);..\libcfgclient\$(Configuration);..\libfake_session\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libcc.lib;libcfgclient.lib;libfake_session.lib;log4cplus.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\log4cplus\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\config\tests
diff --git a/win32build/VS2010/libdnsacl/libdnsacl.vcxproj b/win32build/VS2010/libdnsacl/libdnsacl.vcxproj
index 151d93b..14ef2ad 100755
--- a/win32build/VS2010/libdnsacl/libdnsacl.vcxproj
+++ b/win32build/VS2010/libdnsacl/libdnsacl.vcxproj
@@ -13,9 +13,11 @@
   <ItemGroup>
     <ClInclude Include="..\..\..\src\lib\acl\dns.h" />
     <ClInclude Include="..\..\..\src\lib\acl\dnsname_check.h" />
+    <ClInclude Include="..\..\..\src\lib\acl\lib.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\acl\dns.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{EB54F7B8-FAEF-4348-989C-D4E6B42CEFB1}</ProjectGuid>
@@ -24,12 +26,12 @@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
@@ -45,10 +47,11 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
+    <TargetName>$(ProjectName)d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -62,6 +65,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libdns++d.lib;libccd.lib;libacld.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -80,6 +85,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;libdns++.lib;libcc.lib;libacl.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/win32build/VS2010/libdnsacl/libdnsacl.vcxproj.filters b/win32build/VS2010/libdnsacl/libdnsacl.vcxproj.filters
index 72fc04d..e1ac735 100755
--- a/win32build/VS2010/libdnsacl/libdnsacl.vcxproj.filters
+++ b/win32build/VS2010/libdnsacl/libdnsacl.vcxproj.filters
@@ -21,10 +21,16 @@
     <ClInclude Include="..\..\..\src\lib\acl\dnsname_check.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\acl\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\acl\dns.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\dllmain.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/win32build/VS2010/libfake_session/libfake_session.vcxproj b/win32build/VS2010/libfake_session/libfake_session.vcxproj
index c1fa1d7..e02633c 100755
--- a/win32build/VS2010/libfake_session/libfake_session.vcxproj
+++ b/win32build/VS2010/libfake_session/libfake_session.vcxproj
@@ -15,6 +15,7 @@
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\config\tests\fake_session.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{33927325-C9B5-4FE6-B69F-318433AFF4BD}</ProjectGuid>
@@ -23,12 +24,12 @@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
@@ -44,10 +45,11 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
+    <TargetName>$(ProjectName)d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -61,6 +63,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libccd.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -79,6 +83,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libcc.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/win32build/VS2010/libfake_session/libfake_session.vcxproj.filters b/win32build/VS2010/libfake_session/libfake_session.vcxproj.filters
index a174cae..980f85b 100755
--- a/win32build/VS2010/libfake_session/libfake_session.vcxproj.filters
+++ b/win32build/VS2010/libfake_session/libfake_session.vcxproj.filters
@@ -23,5 +23,8 @@
     <ClCompile Include="..\..\..\src\lib\config\tests\fake_session.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\dllmain.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/win32build/VS2010/libxfr/libxfr.vcxproj b/win32build/VS2010/libxfr/libxfr.vcxproj
index f09776f..21cdbfe 100755
--- a/win32build/VS2010/libxfr/libxfr.vcxproj
+++ b/win32build/VS2010/libxfr/libxfr.vcxproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -11,10 +11,12 @@
     </ProjectConfiguration>
   </ItemGroup>
   <ItemGroup>
+    <ClInclude Include="..\..\..\src\lib\xfr\lib.h" />
     <ClInclude Include="..\..\..\src\lib\xfr\xfrout_client.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\xfr\xfrout_client.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{761E7D88-6CCB-4E41-9F1E-6C1FBBD062F5}</ProjectGuid>
@@ -23,12 +25,12 @@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
@@ -44,10 +46,11 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
+    <TargetName>$(ProjectName)d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -61,6 +64,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutil_iod.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -79,6 +84,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil_io.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/win32build/VS2010/libxfr/libxfr.vcxproj.filters b/win32build/VS2010/libxfr/libxfr.vcxproj.filters
index e703748..4b63aa2 100755
--- a/win32build/VS2010/libxfr/libxfr.vcxproj.filters
+++ b/win32build/VS2010/libxfr/libxfr.vcxproj.filters
@@ -18,10 +18,16 @@
     <ClInclude Include="..\..\..\src\lib\xfr\xfrout_client.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\xfr\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\xfr\xfrout_client.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\dllmain.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/win32build/config.h b/win32build/config.h
index ed401f4..5114f53 100644
--- a/win32build/config.h
+++ b/win32build/config.h
@@ -75,6 +75,10 @@ typedef int ssize_t;
 #undef ERROR
 #endif
 
+#ifdef NOERROR
+#undef NOERROR
+#endif
+
 #ifdef UNICODE
 #undef UNICODE
 #endif



More information about the bind10-changes mailing list