BIND 10 trac2117, updated. 122656007db8b5f2c3f5b74451adbda46b8ea78f rename lib.h in dll.h

BIND 10 source code commits bind10-changes at lists.isc.org
Sat Jul 7 02:44:40 UTC 2012


The branch, trac2117 has been updated
       via  122656007db8b5f2c3f5b74451adbda46b8ea78f (commit)
       via  001aac520c78ab5e21cd33699a0adf456311f413 (commit)
      from  76f1c23333f425a720560ec7b16631375a277836 (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 122656007db8b5f2c3f5b74451adbda46b8ea78f
Author: Francis Dupont <fdupont at isc.org>
Date:   Sat Jul 7 04:44:04 2012 +0200

    rename lib.h in dll.h

commit 001aac520c78ab5e21cd33699a0adf456311f413
Author: Francis Dupont <fdupont at isc.org>
Date:   Sat Jul 7 04:06:16 2012 +0200

    other updates

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

Summary of changes:
 WIN32-NOTES                                        |    4 +-
 src/lib/acl/acl.h                                  |    2 +-
 src/lib/acl/check.h                                |    2 +-
 src/lib/acl/{lib.h => dll.h}                       |    0
 src/lib/acl/dns.h                                  |    2 +-
 src/lib/acl/dnsname_check.h                        |    2 +-
 src/lib/acl/ip_check.h                             |    2 +-
 src/lib/acl/loader.h                               |    2 +-
 src/lib/acl/logic_check.h                          |    2 +-
 src/lib/asiodns/asiodns.h                          |    2 +-
 src/lib/asiodns/{lib.h => dll.h}                   |    0
 src/lib/asiodns/dns_answer.h                       |    2 +-
 src/lib/asiodns/dns_lookup.h                       |    2 +-
 src/lib/asiodns/dns_server.h                       |    2 +-
 src/lib/asiodns/dns_service.h                      |    2 +-
 src/lib/asiodns/io_fetch.h                         |    2 +-
 src/lib/asiodns/logger.h                           |    2 +-
 src/lib/asiodns/sync_udp_server.h                  |    2 +-
 src/lib/asiodns/tcp_server.h                       |    2 +-
 src/lib/asiodns/udp_server.h                       |    2 +-
 src/lib/asiolink/asiolink.h                        |    2 +-
 src/lib/asiolink/{lib.h => dll.h}                  |    0
 src/lib/asiolink/dummy_io_cb.h                     |    2 +-
 src/lib/asiolink/interval_timer.h                  |    2 +-
 src/lib/asiolink/io_address.h                      |    2 +-
 src/lib/asiolink/io_asio_socket.h                  |    2 +-
 src/lib/asiolink/io_endpoint.h                     |    2 +-
 src/lib/asiolink/io_error.h                        |    2 +-
 src/lib/asiolink/io_message.h                      |    2 +-
 src/lib/asiolink/io_service.h                      |    2 +-
 src/lib/asiolink/io_socket.h                       |    2 +-
 src/lib/asiolink/simple_callback.h                 |    2 +-
 src/lib/asiolink/tcp_endpoint.h                    |    2 +-
 src/lib/asiolink/tcp_socket.h                      |    2 +-
 src/lib/asiolink/udp_endpoint.h                    |    2 +-
 src/lib/asiolink/udp_socket.h                      |    2 +-
 src/lib/bench/benchmark.h                          |    2 +-
 src/lib/bench/benchmark_util.h                     |    2 +-
 src/lib/bench/{lib.h => dll.h}                     |    0
 src/lib/cache/cache_entry_key.cc                   |    6 +-
 src/lib/cache/cache_entry_key.h                    |    5 +-
 src/lib/{cc => cache}/lib.h                        |   14 +-
 src/lib/cache/local_zone_data.cc                   |    2 +
 src/lib/cache/local_zone_data.h                    |    3 +-
 src/lib/cache/logger.cc                            |    2 +
 src/lib/cache/logger.h                             |    1 +
 src/lib/cache/message_cache.cc                     |    2 +
 src/lib/cache/message_cache.h                      |    3 +-
 src/lib/cache/message_entry.cc                     |    5 +-
 src/lib/cache/message_entry.h                      |    5 +-
 src/lib/cache/message_utility.cc                   |    2 +
 src/lib/cache/message_utility.h                    |    1 +
 src/lib/cache/resolver_cache.cc                    |    2 +
 src/lib/cache/resolver_cache.h                     |    9 +-
 src/lib/cache/rrset_cache.cc                       |    2 +
 src/lib/cache/rrset_cache.h                        |    6 +-
 src/lib/cache/rrset_copy.cc                        |    4 +-
 src/lib/cache/rrset_copy.h                         |    3 +-
 src/lib/cache/rrset_entry.cc                       |    4 +
 src/lib/cache/rrset_entry.h                        |    3 +-
 src/lib/cache/tests/message_entry_unittest.cc      |    3 +
 src/lib/cache/tests/negative_cache_unittest.cc     |    8 +
 src/lib/cache/tests/rrset_entry_unittest.cc        |   15 +
 src/lib/cc/data.h                                  |    2 +-
 src/lib/cc/{lib.h => dll.h}                        |    0
 src/lib/cc/logger.h                                |    2 +-
 src/lib/cc/session.h                               |    2 +-
 src/lib/config/ccsession.h                         |    2 +-
 src/lib/config/config_data.h                       |    2 +-
 src/lib/config/config_log.h                        |    2 +-
 src/lib/config/module_spec.h                       |    2 +-
 src/lib/cryptolink/crypto_hmac.h                   |    2 +-
 src/lib/cryptolink/cryptolink.h                    |    2 +-
 src/lib/{cc/lib.h => dhcp/dll.h}                   |   14 +-
 src/lib/dhcp/iface_mgr.cc                          |  329 ++++++++++++++++++--
 src/lib/dhcp/iface_mgr.h                           |   97 +++++-
 src/lib/dhcp/iface_mgr_bsd.cc                      |    2 +
 src/lib/dhcp/iface_mgr_linux.cc                    |    2 +
 src/lib/dhcp/iface_mgr_sun.cc                      |    2 +
 src/lib/dhcp/iface_mgr_windows.cc                  |   98 ++++++
 src/lib/dhcp/libdhcp++.cc                          |    5 +-
 src/lib/dhcp/libdhcp++.h                           |    3 +-
 src/lib/dhcp/option.cc                             |    6 +
 src/lib/dhcp/option.h                              |    6 +-
 src/lib/dhcp/option4_addrlst.cc                    |    6 +
 src/lib/dhcp/option4_addrlst.h                     |    3 +-
 src/lib/dhcp/option6_addrlst.cc                    |    6 +
 src/lib/dhcp/option6_addrlst.h                     |    3 +-
 src/lib/dhcp/option6_ia.cc                         |    6 +
 src/lib/dhcp/option6_ia.h                          |    3 +-
 src/lib/dhcp/option6_iaaddr.cc                     |    6 +
 src/lib/dhcp/option6_iaaddr.h                      |    3 +-
 src/lib/dhcp/pkt4.cc                               |    4 +
 src/lib/dhcp/pkt4.h                                |    3 +-
 src/lib/dhcp/pkt6.cc                               |    3 +
 src/lib/dhcp/pkt6.h                                |    3 +-
 src/lib/dhcp/tests/iface_mgr_unittest.cc           |   84 ++++-
 src/lib/dhcp/tests/libdhcp++_unittest.cc           |    5 +-
 src/lib/dhcp/tests/option4_addrlst_unittest.cc     |    4 +
 src/lib/dhcp/tests/option6_addrlst_unittest.cc     |    4 +
 src/lib/dhcp/tests/option6_ia_unittest.cc          |    6 +-
 src/lib/dhcp/tests/option6_iaaddr_unittest.cc      |    4 +
 src/lib/dhcp/tests/option_unittest.cc              |    4 +
 src/lib/dhcp/tests/pkt4_unittest.cc                |    4 +
 src/lib/dhcp/tests/pkt6_unittest.cc                |    4 +
 src/lib/dns/character_string.h                     |    2 +-
 src/lib/dns/{lib.h => dll.h}                       |    0
 src/lib/dns/edns.h                                 |    2 +-
 src/lib/dns/exceptions.h                           |    2 +-
 src/lib/dns/labelsequence.h                        |    2 +-
 src/lib/dns/masterload.h                           |    2 +-
 src/lib/dns/message.h                              |    2 +-
 src/lib/dns/messagerenderer.h                      |    2 +-
 src/lib/dns/name.h                                 |    2 +-
 src/lib/dns/nsec3hash.h                            |    2 +-
 src/lib/dns/opcode.h                               |    2 +-
 src/lib/dns/python/{lib.h => dll.h}                |    0
 src/lib/dns/python/edns_python.h                   |    2 +-
 src/lib/dns/python/message_python.h                |    2 +-
 src/lib/dns/python/messagerenderer_python.h        |    2 +-
 src/lib/dns/python/name_python.h                   |    2 +-
 src/lib/dns/python/nsec3hash_python.h              |    2 +-
 src/lib/dns/python/opcode_python.h                 |    2 +-
 src/lib/dns/python/pydnspp_common.cc               |    2 +-
 src/lib/dns/python/pydnspp_common.h                |    2 +-
 src/lib/dns/python/pydnspp_towire.h                |    2 +-
 src/lib/dns/python/question_python.h               |    2 +-
 src/lib/dns/python/rcode_python.h                  |    2 +-
 src/lib/dns/python/rdata_python.h                  |    2 +-
 src/lib/dns/python/rrclass_python.h                |    2 +-
 src/lib/dns/python/rrset_python.h                  |    2 +-
 src/lib/dns/python/rrttl_python.h                  |    2 +-
 src/lib/dns/python/rrtype_python.h                 |    2 +-
 src/lib/dns/python/serial_python.h                 |    2 +-
 src/lib/dns/python/tsig_python.h                   |    2 +-
 src/lib/dns/python/tsig_rdata_python.h             |    2 +-
 src/lib/dns/python/tsigerror_python.h              |    2 +-
 src/lib/dns/python/tsigkey_python.h                |    2 +-
 src/lib/dns/python/tsigrecord_python.h             |    2 +-
 src/lib/dns/question.h                             |    2 +-
 src/lib/dns/rcode.h                                |    2 +-
 src/lib/dns/rdata.h                                |    2 +-
 src/lib/dns/rdata/any_255/tsig_250.h               |    2 +-
 src/lib/dns/rdata/ch_3/a_1.h                       |    2 +-
 src/lib/dns/rdata/generic/afsdb_18.h               |    2 +-
 src/lib/dns/rdata/generic/cname_5.h                |    2 +-
 src/lib/dns/rdata/generic/detail/ds_like.h         |    2 +-
 .../dns/rdata/generic/detail/nsec3param_common.h   |    2 +-
 src/lib/dns/rdata/generic/detail/nsec_bitmap.h     |    2 +-
 src/lib/dns/rdata/generic/detail/txt_like.h        |    2 +-
 src/lib/dns/rdata/generic/dlv_32769.h              |    2 +-
 src/lib/dns/rdata/generic/dname_39.h               |    2 +-
 src/lib/dns/rdata/generic/dnskey_48.h              |    2 +-
 src/lib/dns/rdata/generic/ds_43.h                  |    2 +-
 src/lib/dns/rdata/generic/hinfo_13.h               |    2 +-
 src/lib/dns/rdata/generic/minfo_14.h               |    2 +-
 src/lib/dns/rdata/generic/mx_15.h                  |    2 +-
 src/lib/dns/rdata/generic/naptr_35.h               |    2 +-
 src/lib/dns/rdata/generic/ns_2.h                   |    2 +-
 src/lib/dns/rdata/generic/nsec3_50.h               |    2 +-
 src/lib/dns/rdata/generic/nsec3param_51.h          |    2 +-
 src/lib/dns/rdata/generic/nsec_47.h                |    2 +-
 src/lib/dns/rdata/generic/opt_41.h                 |    2 +-
 src/lib/dns/rdata/generic/ptr_12.h                 |    2 +-
 src/lib/dns/rdata/generic/rp_17.h                  |    2 +-
 src/lib/dns/rdata/generic/rrsig_46.h               |    2 +-
 src/lib/dns/rdata/generic/soa_6.h                  |    2 +-
 src/lib/dns/rdata/generic/spf_99.h                 |    2 +-
 src/lib/dns/rdata/generic/sshfp_44.h               |    2 +-
 src/lib/dns/rdata/generic/txt_16.h                 |    2 +-
 src/lib/dns/rdata/hs_4/a_1.h                       |    2 +-
 src/lib/dns/rdata/in_1/a_1.h                       |    2 +-
 src/lib/dns/rdata/in_1/aaaa_28.h                   |    2 +-
 src/lib/dns/rdata/in_1/dhcid_49.h                  |    2 +-
 src/lib/dns/rdata/in_1/srv_33.h                    |    2 +-
 src/lib/dns/rdata/template.h                       |    2 +-
 src/lib/dns/rdatafields.h                          |    2 +-
 src/lib/dns/rrclass-placeholder.h                  |    2 +-
 src/lib/dns/rrparamregistry.h                      |    2 +-
 src/lib/dns/rrset.h                                |    2 +-
 src/lib/dns/rrsetlist.h                            |    2 +-
 src/lib/dns/rrttl.h                                |    2 +-
 src/lib/dns/rrtype-placeholder.h                   |    2 +-
 src/lib/dns/serial.h                               |    2 +-
 src/lib/dns/tsig.h                                 |    2 +-
 src/lib/dns/tsigerror.h                            |    2 +-
 src/lib/dns/tsigkey.h                              |    2 +-
 src/lib/dns/tsigrecord.h                           |    2 +-
 src/lib/log/{lib.h => dll.h}                       |    0
 src/lib/log/dummylog.h                             |    2 +-
 src/lib/log/log_dbglevels.h                        |    2 +-
 src/lib/log/log_formatter.h                        |    2 +-
 src/lib/log/log_messages.h                         |    2 +-
 src/lib/log/logger.h                               |    2 +-
 src/lib/log/logger_impl.h                          |    2 +-
 src/lib/log/logger_level.h                         |    2 +-
 src/lib/log/logger_level_impl.h                    |    2 +-
 src/lib/log/logger_manager.h                       |    2 +-
 src/lib/log/logger_manager_impl.h                  |    2 +-
 src/lib/log/logger_name.h                          |    2 +-
 src/lib/log/logger_specification.h                 |    2 +-
 src/lib/log/logger_support.h                       |    2 +-
 src/lib/log/logger_unittest_support.h              |    2 +-
 src/lib/log/logimpl_messages.h                     |    2 +-
 src/lib/log/message_dictionary.h                   |    2 +-
 src/lib/log/message_exception.h                    |    2 +-
 src/lib/log/message_initializer.h                  |    2 +-
 src/lib/log/message_reader.h                       |    2 +-
 src/lib/log/message_types.h                        |    2 +-
 src/lib/log/output_option.h                        |    2 +-
 src/lib/nsas/address_entry.cc                      |    2 +
 src/lib/nsas/address_entry.h                       |    4 +-
 src/lib/nsas/address_request_callback.h            |    3 +-
 src/lib/nsas/asiolink.h                            |    2 +
 src/lib/{cc/lib.h => nsas/dll.h}                   |   14 +-
 src/lib/nsas/fetchable.h                           |    4 +-
 src/lib/nsas/glue_hints.cc                         |    9 +
 src/lib/nsas/glue_hints.h                          |    3 +-
 src/lib/nsas/hash.cc                               |    4 +
 src/lib/nsas/hash.h                                |    5 +-
 src/lib/nsas/hash_deleter.h                        |    1 +
 src/lib/nsas/hash_key.cc                           |    2 +
 src/lib/nsas/hash_key.h                            |    3 +-
 src/lib/nsas/hash_table.h                          |    1 +
 src/lib/{log => nsas}/lib.h                        |   14 +-
 src/lib/nsas/nameserver_address.cc                 |    2 +
 src/lib/nsas/nameserver_address.h                  |    9 +-
 src/lib/nsas/nameserver_address_store.cc           |    7 +
 src/lib/nsas/nameserver_address_store.h            |   11 +-
 src/lib/nsas/nameserver_entry.cc                   |   16 +
 src/lib/nsas/nameserver_entry.h                    |   14 +-
 src/lib/nsas/nsas_entry.h                          |    3 +-
 src/lib/nsas/nsas_entry_compare.h                  |    1 +
 src/lib/nsas/nsas_log.cc                           |    2 +
 src/lib/nsas/nsas_log.h                            |    1 +
 src/lib/nsas/nsas_types.h                          |    2 +
 .../tests/nameserver_address_store_unittest.cc     |    5 +
 src/lib/nsas/tests/nameserver_address_unittest.cc  |    5 +
 src/lib/nsas/tests/nameserver_entry_unittest.cc    |    5 +
 src/lib/nsas/tests/zone_entry_unittest.cc          |    5 +
 src/lib/nsas/zone_entry.cc                         |   17 +
 src/lib/nsas/zone_entry.h                          |    8 +-
 src/lib/{cc => resolve}/lib.h                      |   14 +-
 src/lib/resolve/recursive_query.cc                 |   49 ++-
 src/lib/resolve/recursive_query.h                  |    5 +-
 src/lib/resolve/resolve.cc                         |   24 +-
 src/lib/resolve/resolve.h                          |   21 +-
 src/lib/resolve/resolve_log.cc                     |    2 +
 src/lib/resolve/resolve_log.h                      |    1 +
 src/lib/resolve/resolver_callback.cc               |   10 +
 src/lib/resolve/resolver_callback.h                |    4 +-
 src/lib/resolve/resolver_interface.h               |    3 +-
 src/lib/resolve/response_classifier.cc             |    2 +
 src/lib/resolve/response_classifier.h              |    3 +-
 src/lib/resolve/tests/recursive_query_unittest.cc  |  158 +++++++++-
 .../resolve/tests/recursive_query_unittest_2.cc    |   11 +
 .../resolve/tests/recursive_query_unittest_3.cc    |   25 +-
 src/lib/resolve/tests/resolve_unittest.cc          |    7 +
 .../resolve/tests/resolver_callback_unittest.cc    |   16 +
 src/lib/resolve/tests/run_unittests.cc             |   14 +
 src/lib/statistics/counter.cc                      |    2 +
 src/lib/statistics/counter.h                       |    3 +-
 src/lib/statistics/counter_dict.cc                 |   18 +-
 src/lib/statistics/counter_dict.h                  |   20 +-
 src/lib/{asiodns/lib.h => statistics/dll.h}        |   14 +-
 src/lib/{asiolink/lib.h => testutils/dll.h}        |   14 +-
 src/lib/testutils/dnsmessage_test.cc               |    2 +
 src/lib/testutils/dnsmessage_test.h                |   20 +-
 src/lib/{acl => testutils}/lib.h                   |   14 +-
 src/lib/testutils/mockups.h                        |   44 ++-
 src/lib/testutils/portconfig.h                     |    1 +
 src/lib/testutils/socket_request.h                 |    5 +-
 src/lib/testutils/srv_test.cc                      |    7 +
 src/lib/testutils/srv_test.h                       |    9 +-
 src/lib/util/buffer.h                              |    4 +-
 src/lib/util/{lib.h => dll.h}                      |    0
 src/lib/util/encode/base16_from_binary.h           |    2 +-
 src/lib/util/encode/base32hex.h                    |    2 +-
 src/lib/util/encode/base32hex_from_binary.h        |    2 +-
 src/lib/util/encode/base64.h                       |    2 +-
 src/lib/util/encode/binary_from_base16.h           |    2 +-
 src/lib/util/encode/binary_from_base32hex.h        |    2 +-
 src/lib/util/encode/hex.h                          |    2 +-
 src/lib/util/filename.h                            |    2 +-
 src/lib/util/hash/sha1.h                           |    2 +-
 src/lib/util/interprocess_sync.h                   |    2 +-
 src/lib/util/interprocess_sync_file.h              |    2 +-
 src/lib/util/interprocess_sync_null.h              |    2 +-
 src/lib/util/io/fd.h                               |    2 +-
 src/lib/util/io/fd_share.h                         |    2 +-
 src/lib/util/io/pktinfo_utilities.h                |    2 +-
 src/lib/util/io/sockaddr_util.h                    |    2 +-
 src/lib/util/io/socketsession.h                    |    2 +-
 src/lib/util/io_utilities.h                        |    2 +-
 src/lib/util/locks.h                               |    2 +-
 src/lib/util/lru_list.h                            |    2 +-
 src/lib/util/python/pycppwrapper_util.h            |    2 +-
 src/lib/util/pyunittests/pyunittests_util.cc       |    2 +-
 src/lib/util/random/qid_gen.h                      |    2 +-
 src/lib/util/random/random_number_generator.h      |    2 +-
 src/lib/util/range_utilities.h                     |    4 +-
 src/lib/util/strutil.h                             |    2 +-
 src/lib/util/time_utilities.h                      |    2 +-
 src/lib/util/unittests/{lib.h => dll.h}            |    0
 src/lib/util/unittests/fork.h                      |    2 +-
 src/lib/util/unittests/mock_socketsession.cc       |   25 --
 src/lib/util/unittests/mock_socketsession.h        |    4 +-
 src/lib/util/unittests/newhook.h                   |    2 +-
 src/lib/util/unittests/resolver.cc                 |   25 --
 src/lib/util/unittests/resolver.h                  |    5 +-
 src/lib/util/unittests/resource.h                  |    2 +-
 src/lib/util/unittests/run_all.h                   |    2 +-
 src/lib/util/unittests/testdata.h                  |    2 +-
 src/lib/util/unittests/textdata.h                  |    2 +-
 src/lib/xfr/{lib.h => dll.h}                       |    0
 src/lib/xfr/xfrout_client.h                        |    2 +-
 win32build/VS2010/bind10.sln                       |   43 ++-
 win32build/VS2010/libcache/libcache.vcxproj        |   17 +-
 .../VS2010/libcache/libcache.vcxproj.filters       |    6 +
 .../VS2010/libcache_tests/libcache_tests.vcxproj   |   14 +-
 win32build/VS2010/libdhcp/libdhcp.vcxproj          |   15 +-
 win32build/VS2010/libdhcp/libdhcp.vcxproj.filters  |    6 +
 win32build/VS2010/libnsas/libnsas.vcxproj          |   17 +-
 win32build/VS2010/libnsas/libnsas.vcxproj.filters  |    6 +
 .../VS2010/libnsas_tests/libnsas_tests.vcxproj     |   15 +-
 .../libnsas_tests/libnsas_tests.vcxproj.filters    |    3 +
 win32build/VS2010/libresolve/libresolve.vcxproj    |   15 +-
 .../VS2010/libresolve/libresolve.vcxproj.filters   |    6 +
 .../libresolve_tests/libresolve_tests.vcxproj      |    9 +-
 .../libresolve_tests.vcxproj.filters               |    3 +
 .../VS2010/libstatistics/libstatistics.vcxproj     |   15 +-
 .../libstatistics/libstatistics.vcxproj.filters    |    6 +
 .../libstatistics_tests.vcxproj                    |   12 +-
 .../VS2010/libtestutils/libtestutils.vcxproj       |   19 +-
 .../libtestutils/libtestutils.vcxproj.filters      |    6 +
 .../libutil_unittests/libutil_unittests.vcxproj    |    3 -
 .../libutil_unittests.vcxproj.filters              |    9 -
 337 files changed, 1683 insertions(+), 557 deletions(-)
 copy src/lib/acl/{lib.h => dll.h} (100%)
 copy src/lib/asiodns/{lib.h => dll.h} (100%)
 copy src/lib/asiolink/{lib.h => dll.h} (100%)
 copy src/lib/bench/{lib.h => dll.h} (100%)
 copy src/lib/{cc => cache}/lib.h (80%)
 copy src/lib/cc/{lib.h => dll.h} (100%)
 copy src/lib/{cc/lib.h => dhcp/dll.h} (81%)
 create mode 100644 src/lib/dhcp/iface_mgr_windows.cc
 copy src/lib/dns/{lib.h => dll.h} (100%)
 copy src/lib/dns/python/{lib.h => dll.h} (100%)
 copy src/lib/log/{lib.h => dll.h} (100%)
 copy src/lib/{cc/lib.h => nsas/dll.h} (81%)
 copy src/lib/{log => nsas}/lib.h (81%)
 copy src/lib/{cc => resolve}/lib.h (79%)
 copy src/lib/{asiodns/lib.h => statistics/dll.h} (78%)
 copy src/lib/{asiolink/lib.h => testutils/dll.h} (78%)
 copy src/lib/{acl => testutils}/lib.h (78%)
 copy src/lib/util/{lib.h => dll.h} (100%)
 copy src/lib/util/unittests/{lib.h => dll.h} (100%)
 delete mode 100644 src/lib/util/unittests/mock_socketsession.cc
 delete mode 100644 src/lib/util/unittests/resolver.cc
 copy src/lib/xfr/{lib.h => dll.h} (100%)

-----------------------------------------------------------------------
diff --git a/WIN32-NOTES b/WIN32-NOTES
index 3b0f510..e47d950 100644
--- a/WIN32-NOTES
+++ b/WIN32-NOTES
@@ -176,9 +176,11 @@ Random notes (for porting new code):
 
 DLL specific:
  - add dllmain.cc (it doesn't seem to be required anyway?)
- - standard declaration trick in lib.h, included in all headers
+ - standard declaration trick in dll.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
+  (note it is possible to decorate only needed members/ctors/dtors,
+   and required in a few cases)
  - 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)
diff --git a/src/lib/acl/acl.h b/src/lib/acl/acl.h
index 0b0027e..1280217 100644
--- a/src/lib/acl/acl.h
+++ b/src/lib/acl/acl.h
@@ -15,7 +15,7 @@
 #ifndef ACL_ACL_H
 #define ACL_ACL_H
 
-#include <acl/lib.h>
+#include <acl/dll.h>
 #include "check.h"
 #include <vector>
 
diff --git a/src/lib/acl/check.h b/src/lib/acl/check.h
index 47486e7..9d9e108 100644
--- a/src/lib/acl/check.h
+++ b/src/lib/acl/check.h
@@ -19,7 +19,7 @@
 #include <typeinfo>
 #include <sstream>
 
-#include <acl/lib.h>
+#include <acl/dll.h>
 
 namespace isc {
 namespace acl {
diff --git a/src/lib/acl/dll.h b/src/lib/acl/dll.h
new file mode 100644
index 0000000..994efba
--- /dev/null
+++ b/src/lib/acl/dll.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/dns.h b/src/lib/acl/dns.h
index e697124..8115357 100644
--- a/src/lib/acl/dns.h
+++ b/src/lib/acl/dns.h
@@ -22,7 +22,7 @@
 
 #include <cc/data.h>
 
-#include <acl/lib.h>
+#include <acl/dll.h>
 #include <acl/ip_check.h>
 #include <acl/dnsname_check.h>
 #include <acl/loader.h>
diff --git a/src/lib/acl/dnsname_check.h b/src/lib/acl/dnsname_check.h
index 0faee2a..e3a91e9 100644
--- a/src/lib/acl/dnsname_check.h
+++ b/src/lib/acl/dnsname_check.h
@@ -17,7 +17,7 @@
 
 #include <dns/name.h>
 
-#include <acl/lib.h>
+#include <acl/dll.h>
 #include <acl/check.h>
 
 namespace isc {
diff --git a/src/lib/acl/ip_check.h b/src/lib/acl/ip_check.h
index 693c02f..34dc631 100644
--- a/src/lib/acl/ip_check.h
+++ b/src/lib/acl/ip_check.h
@@ -31,7 +31,7 @@
 #include <netinet/in.h>
 #endif
 
-#include <acl/lib.h>
+#include <acl/dll.h>
 #include <acl/check.h>
 #include <exceptions/exceptions.h>
 #include <util/strutil.h>
diff --git a/src/lib/acl/loader.h b/src/lib/acl/loader.h
index 81ace07..aca7c0e 100644
--- a/src/lib/acl/loader.h
+++ b/src/lib/acl/loader.h
@@ -16,7 +16,7 @@
 #define ACL_LOADER_H
 
 #include <exceptions/exceptions.h>
-#include <acl/lib.h>
+#include <acl/dll.h>
 #include <acl/acl.h>
 #include <cc/data.h>
 #include <boost/function.hpp>
diff --git a/src/lib/acl/logic_check.h b/src/lib/acl/logic_check.h
index 099a10e..b906c25 100644
--- a/src/lib/acl/logic_check.h
+++ b/src/lib/acl/logic_check.h
@@ -20,7 +20,7 @@
 #pragma warning(disable: 4512)
 #endif
 
-#include <acl/lib.h>
+#include <acl/dll.h>
 #include "check.h"
 #include "loader.h"
 
diff --git a/src/lib/asiodns/asiodns.h b/src/lib/asiodns/asiodns.h
index ce9a552..79816ef 100644
--- a/src/lib/asiodns/asiodns.h
+++ b/src/lib/asiodns/asiodns.h
@@ -15,7 +15,7 @@
 #ifndef __ASIODNS_H
 #define __ASIODNS_H 1
 
-#include <asiodns/lib.h>
+#include <asiodns/dll.h>
 #include <asiodns/dns_service.h>
 #include <asiodns/dns_server.h>
 #include <asiodns/dns_lookup.h>
diff --git a/src/lib/asiodns/dll.h b/src/lib/asiodns/dll.h
new file mode 100644
index 0000000..f0860c9
--- /dev/null
+++ b/src/lib/asiodns/dll.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/dns_answer.h b/src/lib/asiodns/dns_answer.h
index 757430e..09471f2 100644
--- a/src/lib/asiodns/dns_answer.h
+++ b/src/lib/asiodns/dns_answer.h
@@ -18,7 +18,7 @@
 #include <asiolink/io_message.h>
 #include <util/buffer.h>
 #include <dns/message.h>
-#include <asiodns/lib.h>
+#include <asiodns/dll.h>
 
 namespace isc {
 namespace asiodns {
diff --git a/src/lib/asiodns/dns_lookup.h b/src/lib/asiodns/dns_lookup.h
index 31d13e1..f7ce154 100644
--- a/src/lib/asiodns/dns_lookup.h
+++ b/src/lib/asiodns/dns_lookup.h
@@ -16,7 +16,7 @@
 #define __ASIOLINK_DNS_LOOKUP_H 1
 
 #include <asiolink/io_message.h>
-#include <asiodns/lib.h>
+#include <asiodns/dll.h>
 #include <asiodns/dns_server.h>
 #include <dns/message.h>
 #include <util/buffer.h>
diff --git a/src/lib/asiodns/dns_server.h b/src/lib/asiodns/dns_server.h
index 4c41e9a..ca53024 100644
--- a/src/lib/asiodns/dns_server.h
+++ b/src/lib/asiodns/dns_server.h
@@ -16,7 +16,7 @@
 #define __ASIOLINK_DNS_SERVER_H 1
 
 #include <asiolink/io_message.h>
-#include <asiodns/lib.h>
+#include <asiodns/dll.h>
 
 namespace isc {
 namespace asiodns {
diff --git a/src/lib/asiodns/dns_service.h b/src/lib/asiodns/dns_service.h
index 1d948cf..2aa0b98 100644
--- a/src/lib/asiodns/dns_service.h
+++ b/src/lib/asiodns/dns_service.h
@@ -20,7 +20,7 @@
 #include <asiolink/io_service.h>
 #include <asiolink/simple_callback.h>
 
-#include <asiodns/lib.h>
+#include <asiodns/dll.h>
 
 namespace isc {
 namespace asiodns {
diff --git a/src/lib/asiodns/io_fetch.h b/src/lib/asiodns/io_fetch.h
index a8b615a..8bb799a 100644
--- a/src/lib/asiodns/io_fetch.h
+++ b/src/lib/asiodns/io_fetch.h
@@ -26,7 +26,7 @@
 #include <asio/error_code.hpp>
 #include <asiolink/io_address.h>
 #include <asiolink/io_service.h>
-#include <asiodns/lib.h>
+#include <asiodns/dll.h>
 
 #include <util/buffer.h>
 #include <dns/question.h>
diff --git a/src/lib/asiodns/logger.h b/src/lib/asiodns/logger.h
index db5d1bb..b4ff03a 100644
--- a/src/lib/asiodns/logger.h
+++ b/src/lib/asiodns/logger.h
@@ -15,7 +15,7 @@
 #include <log/logger.h>
 #include <log/macros.h>
 #include <log/log_dbglevels.h>
-#include <asiodns/lib.h>
+#include <asiodns/dll.h>
 #include <asiodns/asiodns_messages.h>
 
 namespace isc {
diff --git a/src/lib/asiodns/sync_udp_server.h b/src/lib/asiodns/sync_udp_server.h
index d42b962..027bbe2 100644
--- a/src/lib/asiodns/sync_udp_server.h
+++ b/src/lib/asiodns/sync_udp_server.h
@@ -19,7 +19,7 @@
 #error "asio.hpp must be included before including this, see asiolink.h as to why"
 #endif
 
-#include <asiodns/lib.h>
+#include <asiodns/dll.h>
 #include "dns_answer.h"
 #include "dns_lookup.h"
 #include "dns_server.h"
diff --git a/src/lib/asiodns/tcp_server.h b/src/lib/asiodns/tcp_server.h
index d53fb37..540c79d 100644
--- a/src/lib/asiodns/tcp_server.h
+++ b/src/lib/asiodns/tcp_server.h
@@ -24,7 +24,7 @@
 
 #include <asiolink/asiolink.h>
 #include <coroutine.h>
-#include <asiodns/lib.h>
+#include <asiodns/dll.h>
 #include "dns_server.h"
 #include "dns_lookup.h"
 #include "dns_answer.h"
diff --git a/src/lib/asiodns/udp_server.h b/src/lib/asiodns/udp_server.h
index d63abbc..dbbf969 100644
--- a/src/lib/asiodns/udp_server.h
+++ b/src/lib/asiodns/udp_server.h
@@ -20,7 +20,7 @@
 #endif
 
 #include <asiolink/simple_callback.h>
-#include <asiodns/lib.h>
+#include <asiodns/dll.h>
 #include <asiodns/dns_answer.h>
 #include <asiodns/dns_lookup.h>
 #include <asiodns/dns_server.h>
diff --git a/src/lib/asiolink/asiolink.h b/src/lib/asiolink/asiolink.h
index 42ca2e8..795cc66 100644
--- a/src/lib/asiolink/asiolink.h
+++ b/src/lib/asiolink/asiolink.h
@@ -19,7 +19,7 @@
 // this file.  In particular, asio.hpp should never be included here.
 // See the description of the namespace below.
 
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 
 #include <asiolink/io_service.h>
 #include <asiolink/simple_callback.h>
diff --git a/src/lib/asiolink/dll.h b/src/lib/asiolink/dll.h
new file mode 100644
index 0000000..2e8cab5
--- /dev/null
+++ b/src/lib/asiolink/dll.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/dummy_io_cb.h b/src/lib/asiolink/dummy_io_cb.h
index 5f4866f..d88b4f9 100644
--- a/src/lib/asiolink/dummy_io_cb.h
+++ b/src/lib/asiolink/dummy_io_cb.h
@@ -17,7 +17,7 @@
 
 #include <iostream>
 
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 #include <asio/error.hpp>
 #include <asio/error_code.hpp>
 
diff --git a/src/lib/asiolink/interval_timer.h b/src/lib/asiolink/interval_timer.h
index 478220b..9ffb267 100644
--- a/src/lib/asiolink/interval_timer.h
+++ b/src/lib/asiolink/interval_timer.h
@@ -18,7 +18,7 @@
 #include <boost/function.hpp>
 #include <boost/shared_ptr.hpp>
 
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 #include <asiolink/io_service.h>
 
 namespace isc {
diff --git a/src/lib/asiolink/io_address.h b/src/lib/asiolink/io_address.h
index e3ffbe6..264a344 100644
--- a/src/lib/asiolink/io_address.h
+++ b/src/lib/asiolink/io_address.h
@@ -28,7 +28,7 @@
 #include <string>
 
 #include <exceptions/exceptions.h>
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 
 namespace isc {
 namespace asiolink {
diff --git a/src/lib/asiolink/io_asio_socket.h b/src/lib/asiolink/io_asio_socket.h
index 070ab9d..cb7c161 100644
--- a/src/lib/asiolink/io_asio_socket.h
+++ b/src/lib/asiolink/io_asio_socket.h
@@ -30,7 +30,7 @@
 
 #include <util/buffer.h>
 
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 #include <asiolink/io_error.h>
 #include <asiolink/io_socket.h>
 
diff --git a/src/lib/asiolink/io_endpoint.h b/src/lib/asiolink/io_endpoint.h
index 6158f17..894f5ce 100644
--- a/src/lib/asiolink/io_endpoint.h
+++ b/src/lib/asiolink/io_endpoint.h
@@ -28,7 +28,7 @@
 #include <string>
 
 #include <exceptions/exceptions.h>
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 #include <asiolink/io_address.h>
 
 # include <ostream>
diff --git a/src/lib/asiolink/io_error.h b/src/lib/asiolink/io_error.h
index 2961289..7fb2732 100644
--- a/src/lib/asiolink/io_error.h
+++ b/src/lib/asiolink/io_error.h
@@ -17,7 +17,7 @@
 #define __IO_ERROR_H
 
 #include <exceptions/exceptions.h>
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 
 namespace isc {
 namespace asiolink {
diff --git a/src/lib/asiolink/io_message.h b/src/lib/asiolink/io_message.h
index 3b197ad..e2409f6 100644
--- a/src/lib/asiolink/io_message.h
+++ b/src/lib/asiolink/io_message.h
@@ -27,7 +27,7 @@
 
 #include <exceptions/exceptions.h>
 
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 #include <asiolink/io_endpoint.h>
 #include <asiolink/io_socket.h>
 
diff --git a/src/lib/asiolink/io_service.h b/src/lib/asiolink/io_service.h
index 700aea1..04a66e9 100644
--- a/src/lib/asiolink/io_service.h
+++ b/src/lib/asiolink/io_service.h
@@ -15,7 +15,7 @@
 #ifndef __ASIOLINK_IO_SERVICE_H
 #define __ASIOLINK_IO_SERVICE_H 1
 
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 
 namespace asio {
     class io_service;
diff --git a/src/lib/asiolink/io_socket.h b/src/lib/asiolink/io_socket.h
index b9a891c..7ca37cc 100644
--- a/src/lib/asiolink/io_socket.h
+++ b/src/lib/asiolink/io_socket.h
@@ -28,7 +28,7 @@
 #include <string>
 
 #include <exceptions/exceptions.h>
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 
 namespace isc {
 namespace asiolink {
diff --git a/src/lib/asiolink/simple_callback.h b/src/lib/asiolink/simple_callback.h
index 4762721..77218be 100644
--- a/src/lib/asiolink/simple_callback.h
+++ b/src/lib/asiolink/simple_callback.h
@@ -15,7 +15,7 @@
 #ifndef __ASIOLINK_SIMPLE_CALLBACK_H
 #define __ASIOLINK_SIMPLE_CALLBACK_H 1
 
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 #include <asiolink/io_message.h>
 
 namespace isc {
diff --git a/src/lib/asiolink/tcp_endpoint.h b/src/lib/asiolink/tcp_endpoint.h
index 54e86d0..ec205a9 100644
--- a/src/lib/asiolink/tcp_endpoint.h
+++ b/src/lib/asiolink/tcp_endpoint.h
@@ -19,7 +19,7 @@
 #error "asio.hpp must be included before including this, see asiolink.h as to why"
 #endif
 
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 #include <asiolink/io_endpoint.h>
 
 namespace isc {
diff --git a/src/lib/asiolink/tcp_socket.h b/src/lib/asiolink/tcp_socket.h
index eacc21f..7132014 100644
--- a/src/lib/asiolink/tcp_socket.h
+++ b/src/lib/asiolink/tcp_socket.h
@@ -38,7 +38,7 @@
 #include <util/buffer.h>
 #include <util/io_utilities.h>
 
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 #include <asiolink/io_asio_socket.h>
 #include <asiolink/io_endpoint.h>
 #include <asiolink/io_service.h>
diff --git a/src/lib/asiolink/udp_endpoint.h b/src/lib/asiolink/udp_endpoint.h
index 7dfe403..672afe2 100644
--- a/src/lib/asiolink/udp_endpoint.h
+++ b/src/lib/asiolink/udp_endpoint.h
@@ -19,7 +19,7 @@
 #error "asio.hpp must be included before including this, see asiolink.h as to why"
 #endif
 
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 #include <asiolink/io_endpoint.h>
 
 namespace isc {
diff --git a/src/lib/asiolink/udp_socket.h b/src/lib/asiolink/udp_socket.h
index 2061e45..a62b707 100644
--- a/src/lib/asiolink/udp_socket.h
+++ b/src/lib/asiolink/udp_socket.h
@@ -30,7 +30,7 @@
 
 #include <config.h>
 
-#include <asiolink/lib.h>
+#include <asiolink/dll.h>
 #include <asiolink/io_asio_socket.h>
 #include <asiolink/io_endpoint.h>
 #include <asiolink/io_service.h>
diff --git a/src/lib/bench/benchmark.h b/src/lib/bench/benchmark.h
index f9b9d47..5a9298e 100644
--- a/src/lib/bench/benchmark.h
+++ b/src/lib/bench/benchmark.h
@@ -26,7 +26,7 @@
 #include <iostream>
 #include <ios>
 
-#include <bench/lib.h>
+#include <bench/dll.h>
 
 namespace isc {
 namespace bench {
diff --git a/src/lib/bench/benchmark_util.h b/src/lib/bench/benchmark_util.h
index dbd340e..7c27be1 100644
--- a/src/lib/bench/benchmark_util.h
+++ b/src/lib/bench/benchmark_util.h
@@ -31,7 +31,7 @@
 #include <vector>
 
 #include <exceptions/exceptions.h>
-#include <bench/lib.h>
+#include <bench/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/bench/dll.h b/src/lib/bench/dll.h
new file mode 100644
index 0000000..cd8d183
--- /dev/null
+++ b/src/lib/bench/dll.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/cache/cache_entry_key.cc b/src/lib/cache/cache_entry_key.cc
index 85c03a0..942be00 100644
--- a/src/lib/cache/cache_entry_key.cc
+++ b/src/lib/cache/cache_entry_key.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_LIBCACHE_EXPORT
+
 #include <sstream>
 #include "cache_entry_key.h"
 
@@ -19,7 +21,7 @@ using namespace std;
 
 namespace isc {
 namespace cache {
-const std::string
+ISC_LIBCACHE_API const std::string
 genCacheEntryName(const isc::dns::Name& name, const isc::dns::RRType& type) {
     std::string keystr = name.toText();
     ostringstream stream;
@@ -28,7 +30,7 @@ genCacheEntryName(const isc::dns::Name& name, const isc::dns::RRType& type) {
     return (keystr);
 }
 
-const std::string
+ISC_LIBCACHE_API const std::string
 genCacheEntryName(const std::string& namestr, const uint16_t type) {
     std::string keystr = namestr;
     ostringstream stream;
diff --git a/src/lib/cache/cache_entry_key.h b/src/lib/cache/cache_entry_key.h
index 674deb0..aa59c15 100644
--- a/src/lib/cache/cache_entry_key.h
+++ b/src/lib/cache/cache_entry_key.h
@@ -18,6 +18,7 @@
 #include <string>
 #include <dns/name.h>
 #include <dns/rrtype.h>
+#include <cache/dll.h>
 
 namespace isc {
 namespace cache {
@@ -36,7 +37,7 @@ namespace cache {
 /// \param name The Name to create a text entry for
 /// \param type The RRType to create a text entry for
 /// \return return the entry name.
-const std::string
+ISC_LIBCACHE_API const std::string
 genCacheEntryName(const isc::dns::Name& name, const isc::dns::RRType& type);
 
 ///
@@ -44,7 +45,7 @@ genCacheEntryName(const isc::dns::Name& name, const isc::dns::RRType& type);
 ///
 /// \param namestr A string representation of a DNS Name
 /// \param type The value of a DNS RRType
-const std::string
+ISC_LIBCACHE_API const std::string
 genCacheEntryName(const std::string& namestr, const uint16_t type);
 
 } // namespace cache
diff --git a/src/lib/cache/lib.h b/src/lib/cache/lib.h
new file mode 100644
index 0000000..14032c3
--- /dev/null
+++ b/src/lib/cache/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 __LIBCACHE_H
+#define __LIBCACHE_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBCACHE_API
+#else
+#ifdef ISC_LIBCACHE_EXPORT
+#define ISC_LIBCACHE_API __declspec(dllexport)
+#else
+#define ISC_LIBCACHE_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBCACHE_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/cache/local_zone_data.cc b/src/lib/cache/local_zone_data.cc
index 29ab2bf..bda4e42 100644
--- a/src/lib/cache/local_zone_data.cc
+++ b/src/lib/cache/local_zone_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_LIBCACHE_EXPORT
+
 #include <dns/rrset.h>
 #include "local_zone_data.h"
 #include "cache_entry_key.h"
diff --git a/src/lib/cache/local_zone_data.h b/src/lib/cache/local_zone_data.h
index df77f40..a0eba5b 100644
--- a/src/lib/cache/local_zone_data.h
+++ b/src/lib/cache/local_zone_data.h
@@ -19,6 +19,7 @@
 #include <string>
 #include <boost/shared_ptr.hpp>
 #include <dns/rrset.h>
+#include <cache/dll.h>
 
 namespace isc {
 namespace cache {
@@ -27,7 +28,7 @@ namespace cache {
 /// The object of LocalZoneData represents the data of one
 /// local zone. It provides the interface for lookup the rrsets
 /// in the zone.
-class LocalZoneData {
+class ISC_LIBCACHE_API LocalZoneData {
 public:
     LocalZoneData(uint16_t rrset_class) : class_(rrset_class)
     {}
diff --git a/src/lib/cache/logger.cc b/src/lib/cache/logger.cc
index f4b0f25..3fd1cb1 100644
--- a/src/lib/cache/logger.cc
+++ b/src/lib/cache/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_LIBCACHE_EXPORT
+
 #include <cache/logger.h>
 
 namespace isc {
diff --git a/src/lib/cache/logger.h b/src/lib/cache/logger.h
index 52c9743..dc6a00c 100644
--- a/src/lib/cache/logger.h
+++ b/src/lib/cache/logger.h
@@ -16,6 +16,7 @@
 #define __DATASRC_LOGGER_H
 
 #include <log/macros.h>
+#include <cache/dll.h>
 #include <cache/cache_messages.h>
 
 /// \file cache/logger.h
diff --git a/src/lib/cache/message_cache.cc b/src/lib/cache/message_cache.cc
index e141bb5..5bf4c15 100644
--- a/src/lib/cache/message_cache.cc
+++ b/src/lib/cache/message_cache.cc
@@ -13,6 +13,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBCACHE_EXPORT
+
 #include <config.h>
 
 #include <nsas/nsas_entry_compare.h>
diff --git a/src/lib/cache/message_cache.h b/src/lib/cache/message_cache.h
index b418f23..09e46f8 100644
--- a/src/lib/cache/message_cache.h
+++ b/src/lib/cache/message_cache.h
@@ -18,6 +18,7 @@
 #include <string>
 #include <boost/shared_ptr.hpp>
 #include <dns/message.h>
+#include <cache/dll.h>
 #include "message_entry.h"
 #include <nsas/hash_table.h>
 #include <util/lru_list.h>
@@ -32,7 +33,7 @@ namespace cache {
 ///
 /// \todo The message cache class should provide the interfaces for
 ///       loading, dumping and resizing.
-class MessageCache {
+class ISC_LIBCACHE_API MessageCache {
 // Noncopyable
 private:
     MessageCache(const MessageCache& source);
diff --git a/src/lib/cache/message_entry.cc b/src/lib/cache/message_entry.cc
index d9560a6..c085f31 100644
--- a/src/lib/cache/message_entry.cc
+++ b/src/lib/cache/message_entry.cc
@@ -12,9 +12,12 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBCACHE_EXPORT
+
 #include <config.h>
 
 #include <limits>
+#include <ctime>
 #include <dns/message.h>
 #include <nsas/nsas_entry.h>
 #include "message_entry.h"
@@ -156,7 +159,7 @@ MessageEntry::genMessage(const time_t& time_now,
         msg.setHeaderFlag(Message::HEADERFLAG_AA, false);
         msg.setHeaderFlag(Message::HEADERFLAG_TC, headerflag_tc_);
 
-        bool dnssec_need = msg.getEDNS().get();
+        bool dnssec_need = msg.getEDNS().get() != 0;
         addRRset(msg, rrset_entry_vec, Message::SECTION_ANSWER, dnssec_need);
         addRRset(msg, rrset_entry_vec, Message::SECTION_AUTHORITY, dnssec_need);
         addRRset(msg, rrset_entry_vec, Message::SECTION_ADDITIONAL, dnssec_need);
diff --git a/src/lib/cache/message_entry.h b/src/lib/cache/message_entry.h
index 6775ff6..46d40e0 100644
--- a/src/lib/cache/message_entry.h
+++ b/src/lib/cache/message_entry.h
@@ -19,6 +19,7 @@
 #include <dns/message.h>
 #include <dns/rrset.h>
 #include <nsas/nsas_entry.h>
+#include <cache/dll.h>
 #include "rrset_cache.h"
 #include "rrset_entry.h"
 
@@ -27,13 +28,13 @@ using namespace isc::nsas;
 namespace isc {
 namespace cache {
 
-class RRsetEntry;
+class ISC_LIBCACHE_API RRsetEntry;
 
 /// \brief Message Entry
 ///
 /// The object of MessageEntry represents one response message
 /// answered to the resolver client.
-class MessageEntry : public NsasEntry<MessageEntry> {
+class ISC_LIBCACHE_API MessageEntry : public NsasEntry<MessageEntry> {
 // Noncopyable
 private:
     MessageEntry(const MessageEntry& source);
diff --git a/src/lib/cache/message_utility.cc b/src/lib/cache/message_utility.cc
index 53a3352..4c95d4e 100644
--- a/src/lib/cache/message_utility.cc
+++ b/src/lib/cache/message_utility.cc
@@ -14,6 +14,8 @@
 
 // $Id$
 
+#define ISC_LIBCACHE_EXPORT
+
 #include "message_utility.h"
 #include <dns/rcode.h>
 
diff --git a/src/lib/cache/message_utility.h b/src/lib/cache/message_utility.h
index a77af07..a822203 100644
--- a/src/lib/cache/message_utility.h
+++ b/src/lib/cache/message_utility.h
@@ -18,6 +18,7 @@
 #define __MESSAGE_UTILITY_H
 
 #include <dns/message.h>
+#include <cache/dll.h>
 
 namespace isc {
 namespace cache {
diff --git a/src/lib/cache/resolver_cache.cc b/src/lib/cache/resolver_cache.cc
index 20f470e..5fc7c63 100644
--- a/src/lib/cache/resolver_cache.cc
+++ b/src/lib/cache/resolver_cache.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_LIBCACHE_EXPORT
+
 #include <config.h>
 
 #include "resolver_cache.h"
diff --git a/src/lib/cache/resolver_cache.h b/src/lib/cache/resolver_cache.h
index 5630bd7..4514039 100644
--- a/src/lib/cache/resolver_cache.h
+++ b/src/lib/cache/resolver_cache.h
@@ -21,6 +21,7 @@
 #include <dns/rrclass.h>
 #include <dns/message.h>
 #include <exceptions/exceptions.h>
+#include <cache/dll.h>
 #include "message_cache.h"
 #include "rrset_cache.h"
 #include "local_zone_data.h"
@@ -37,7 +38,7 @@ class RRsetCache;
 /// \brief Cache Size Information.
 ///
 /// Used to initialize the size of class-specific rrset/message cache.
-struct CacheSizeInfo
+struct ISC_LIBCACHE_API CacheSizeInfo
 {
 public:
     /// \brief Constructor
@@ -62,7 +63,7 @@ public:
 ///
 /// Thrown if the given message has no question section when looking up
 /// the message in cache.
-class MessageNoQuestionSection : public isc::Exception {
+class ISC_LIBCACHE_API MessageNoQuestionSection : public isc::Exception {
 public:
     MessageNoQuestionSection(const char*file, size_t line, const char*what) :
         isc::Exception(file, line, what)
@@ -79,7 +80,7 @@ public:
 ///
 /// \todo The resolver cache class should provide the interfaces for
 ///       loading, dumping and resizing.
-class ResolverClassCache {
+class ISC_LIBCACHE_API ResolverClassCache {
 public:
     /// \brief Default Constructor.
     ///
@@ -199,7 +200,7 @@ private:
     RRsetCachePtr negative_soa_cache_;
 };
 
-class ResolverCache {
+class ISC_LIBCACHE_API ResolverCache {
 public:
     /// \brief Default Constructor.
     ///
diff --git a/src/lib/cache/rrset_cache.cc b/src/lib/cache/rrset_cache.cc
index bb4d339..0d1ed3a 100644
--- a/src/lib/cache/rrset_cache.cc
+++ b/src/lib/cache/rrset_cache.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_LIBCACHE_EXPORT
+
 #include <config.h>
 
 #include "rrset_cache.h"
diff --git a/src/lib/cache/rrset_cache.h b/src/lib/cache/rrset_cache.h
index a4ea54e..6bc354c 100644
--- a/src/lib/cache/rrset_cache.h
+++ b/src/lib/cache/rrset_cache.h
@@ -20,12 +20,14 @@
 
 #include <util/lru_list.h>
 
+#include <cache/dll.h>
+
 using namespace isc::nsas;
 
 namespace isc {
 namespace cache {
 
-class RRsetEntry;
+class ISC_LIBCACHE_API RRsetEntry;
 
 /// \brief RRset Cache
 /// The object of RRsetCache represented the cache for class-specific
@@ -33,7 +35,7 @@ class RRsetEntry;
 ///
 /// \todo The rrset cache class should provide the interfaces for
 ///       loading, dumping and resizing.
-class RRsetCache{
+class ISC_LIBCACHE_API RRsetCache{
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/cache/rrset_copy.cc b/src/lib/cache/rrset_copy.cc
index b395ce1..7cc9364 100644
--- a/src/lib/cache/rrset_copy.cc
+++ b/src/lib/cache/rrset_copy.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_LIBCACHE_EXPORT
+
 #include "rrset_copy.h"
 
 using namespace isc::dns;
@@ -19,7 +21,7 @@ using namespace isc::dns;
 namespace isc {
 namespace cache {
 
-void
+ISC_LIBCACHE_API void
 rrsetCopy(const isc::dns::AbstractRRset& src, isc::dns::AbstractRRset& dst) {
     RdataIteratorPtr rdata_itor = src.getRdataIterator();
     rdata_itor->first();
diff --git a/src/lib/cache/rrset_copy.h b/src/lib/cache/rrset_copy.h
index e1dc489..845b591 100644
--- a/src/lib/cache/rrset_copy.h
+++ b/src/lib/cache/rrset_copy.h
@@ -16,6 +16,7 @@
 #define __RRSET_COPY_
 
 #include <dns/rrset.h>
+#include <cache/dll.h>
 
 namespace isc {
 namespace cache {
@@ -32,7 +33,7 @@ namespace cache {
 ///       doing RRset copy. But in cache's code, sometime
 ///       we have to do the copy.
 
-void
+ISC_LIBCACHE_API void
 rrsetCopy(const isc::dns::AbstractRRset& src, isc::dns::AbstractRRset& dst);
 
 } // namespace cache
diff --git a/src/lib/cache/rrset_entry.cc b/src/lib/cache/rrset_entry.cc
index 359fd68..48c0293 100644
--- a/src/lib/cache/rrset_entry.cc
+++ b/src/lib/cache/rrset_entry.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_LIBCACHE_EXPORT
+
 #include <config.h>
 
+#include <time.h>
+
 #include <dns/message.h>
 #include <nsas/nsas_entry.h>
 #include <nsas/fetchable.h>
diff --git a/src/lib/cache/rrset_entry.h b/src/lib/cache/rrset_entry.h
index 129300d..502e47a 100644
--- a/src/lib/cache/rrset_entry.h
+++ b/src/lib/cache/rrset_entry.h
@@ -20,6 +20,7 @@
 #include <dns/rrttl.h>
 #include <nsas/nsas_entry.h>
 #include <nsas/fetchable.h>
+#include <cache/dll.h>
 #include "cache_entry_key.h"
 
 using namespace isc::nsas;
@@ -60,7 +61,7 @@ enum RRsetTrustLevel {
 /// The object of RRsetEntry represents one cached RRset.
 /// Each RRset entry may be refered using shared_ptr by several message
 /// entries.
-class RRsetEntry : public NsasEntry<RRsetEntry>
+class ISC_LIBCACHE_API RRsetEntry : public NsasEntry<RRsetEntry>
 {
     ///
     /// \name Constructors and Destructor
diff --git a/src/lib/cache/tests/message_entry_unittest.cc b/src/lib/cache/tests/message_entry_unittest.cc
index 86cc89f..fc76ab5 100644
--- a/src/lib/cache/tests/message_entry_unittest.cc
+++ b/src/lib/cache/tests/message_entry_unittest.cc
@@ -14,6 +14,9 @@
 
 #include <config.h>
 #include <string>
+#ifdef _WIN32
+#include <ctime>
+#endif
 #include <gtest/gtest.h>
 #include <dns/tests/unittest_util.h>
 #include <dns/message.h>
diff --git a/src/lib/cache/tests/negative_cache_unittest.cc b/src/lib/cache/tests/negative_cache_unittest.cc
index 4935e4a..879fe1c 100644
--- a/src/lib/cache/tests/negative_cache_unittest.cc
+++ b/src/lib/cache/tests/negative_cache_unittest.cc
@@ -86,7 +86,11 @@ TEST_F(NegativeCacheTest, testNXDOMAIN){
     // Sleep for 2 seconds. 2 seconds to make sure the final range check
     // does not overlap with the original ones (in which case this test
     // would erroneously pass if the ttl value is not changed)
+#ifdef _WIN32
+    Sleep(2000);
+#else
     sleep(2);
+#endif
 
     // Query nonexist.example.com again
     Message msg_nxdomain2(Message::PARSE);
@@ -215,7 +219,11 @@ TEST_F(NegativeCacheTest, testNoerrorNodata){
     // Sleep for 2 seconds. 2 seconds to make sure the final range check
     // does not overlap with the original ones (in which case this test
     // would erroneously pass if the ttl value is not changed)
+#ifdef _WIN32
+    Sleep(2000);
+#else
     sleep(2);
+#endif
 
     EXPECT_TRUE(cache->lookup(example_dot_com, RRType::MX(), RRClass::IN(), msg_nodata2));
 
diff --git a/src/lib/cache/tests/rrset_entry_unittest.cc b/src/lib/cache/tests/rrset_entry_unittest.cc
index c7c3c6e..0cb588e 100644
--- a/src/lib/cache/tests/rrset_entry_unittest.cc
+++ b/src/lib/cache/tests/rrset_entry_unittest.cc
@@ -14,6 +14,9 @@
 
 #include <config.h>
 #include <string>
+#ifdef _WIN32
+#include <ctime>
+#endif
 #include <gtest/gtest.h>
 #include <cache/cache_entry_key.h>
 #include <cache/rrset_entry.h>
@@ -81,7 +84,11 @@ TEST_F(RRsetEntryTest, constructor) {
 
 TEST_F(RRsetEntryTest, updateTTL) {
     uint32_t ttl = rrset_entry.getTTL();
+#ifdef _WIN32
+    Sleep(1000);
+#else
     sleep(1);
+#endif
     // The TTL should be decreased
     EXPECT_TRUE(rrset_entry.getTTL() < ttl);
 }
@@ -89,10 +96,18 @@ TEST_F(RRsetEntryTest, updateTTL) {
 TEST_F(RRsetEntryTest, TTLExpire) {
     RRset exp_rrset(name, RRClass::IN(), RRType::A(), RRTTL(1));
     RRsetEntry rrset_entry(exp_rrset, RRSET_TRUST_ANSWER_AA);
+#ifdef _WIN32
+    Sleep(1000);
+#else
     sleep(1);
+#endif
     uint32_t ttl = rrset_entry.getTTL();
     EXPECT_LT(ttl, 1);
+#ifdef _WIN32
+    Sleep(1000);
+#else
     sleep(1);
+#endif
     ttl = rrset_entry.getTTL();
     EXPECT_LT(ttl, 1);
 }
diff --git a/src/lib/cc/data.h b/src/lib/cc/data.h
index b0f883d..ebdcb53 100644
--- a/src/lib/cc/data.h
+++ b/src/lib/cc/data.h
@@ -21,7 +21,7 @@
 #include <boost/shared_ptr.hpp>
 #include <stdexcept>
 #include <exceptions/exceptions.h>
-#include <cc/lib.h>
+#include <cc/dll.h>
 
 #ifdef _MSC_VER
 #pragma warning(push)
diff --git a/src/lib/cc/dll.h b/src/lib/cc/dll.h
new file mode 100644
index 0000000..ee9bc31
--- /dev/null
+++ b/src/lib/cc/dll.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.h b/src/lib/cc/logger.h
index 8da6be0..8b8754c 100644
--- a/src/lib/cc/logger.h
+++ b/src/lib/cc/logger.h
@@ -15,7 +15,7 @@
 #ifndef CC_LOGGER_H
 #define CC_LOGGER_H
 
-#include <cc/lib.h>
+#include <cc/dll.h>
 #include <cc/cc_messages.h>
 #include <log/macros.h>
 
diff --git a/src/lib/cc/session.h b/src/lib/cc/session.h
index 0e250a8..7e83acb 100644
--- a/src/lib/cc/session.h
+++ b/src/lib/cc/session.h
@@ -21,7 +21,7 @@
 
 #include <exceptions/exceptions.h>
 
-#include <cc/lib.h>
+#include <cc/dll.h>
 #include <cc/data.h>
 #include <cc/session_config.h>
 
diff --git a/src/lib/config/ccsession.h b/src/lib/config/ccsession.h
index a9466f4..0723e38 100644
--- a/src/lib/config/ccsession.h
+++ b/src/lib/config/ccsession.h
@@ -15,7 +15,7 @@
 #ifndef __CCSESSION_H
 #define __CCSESSION_H 1
 
-#include <config/lib.h>
+#include <config/dll.h>
 #include <config/config_data.h>
 #include <config/module_spec.h>
 
diff --git a/src/lib/config/config_data.h b/src/lib/config/config_data.h
index aea8c76..bc5a99c 100644
--- a/src/lib/config/config_data.h
+++ b/src/lib/config/config_data.h
@@ -18,7 +18,7 @@
 #include <string>
 #include <vector>
 
-#include <config/lib.h>
+#include <config/dll.h>
 #include <config/module_spec.h>
 #include <exceptions/exceptions.h>
 
diff --git a/src/lib/config/config_log.h b/src/lib/config/config_log.h
index 5a42680..5bfc801 100644
--- a/src/lib/config/config_log.h
+++ b/src/lib/config/config_log.h
@@ -16,7 +16,7 @@
 #define __CONFIG_LOG__H
 
 #include <log/macros.h>
-#include <config/lib.h>
+#include <config/dll.h>
 #include "config_messages.h"
 
 namespace isc {
diff --git a/src/lib/config/module_spec.h b/src/lib/config/module_spec.h
index 476bf95..945a6c4 100644
--- a/src/lib/config/module_spec.h
+++ b/src/lib/config/module_spec.h
@@ -17,7 +17,7 @@
 #define _MODULE_SPEC_H 1
 
 #include <cc/data.h>
-#include <config/lib.h>
+#include <config/dll.h>
 
 #include <sstream>
 
diff --git a/src/lib/cryptolink/crypto_hmac.h b/src/lib/cryptolink/crypto_hmac.h
index 86d238c..820c299 100644
--- a/src/lib/cryptolink/crypto_hmac.h
+++ b/src/lib/cryptolink/crypto_hmac.h
@@ -16,7 +16,7 @@
 
 #include <boost/noncopyable.hpp>
 
-#include <cryptolink/lib.h>
+#include <cryptolink/dll.h>
 #include <cryptolink/cryptolink.h>
 
 #ifndef _ISC_CRYPTO_HMAC_H
diff --git a/src/lib/cryptolink/cryptolink.h b/src/lib/cryptolink/cryptolink.h
index 160af70..3bf6032 100644
--- a/src/lib/cryptolink/cryptolink.h
+++ b/src/lib/cryptolink/cryptolink.h
@@ -24,7 +24,7 @@
 
 #include <memory>
 
-#include <cryptolink/lib.h>
+#include <cryptolink/dll.h>
 
 namespace isc {
 namespace cryptolink {
diff --git a/src/lib/dhcp/dll.h b/src/lib/dhcp/dll.h
new file mode 100644
index 0000000..a6a7c51
--- /dev/null
+++ b/src/lib/dhcp/dll.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 __LIBDHCP_H
+#define __LIBDHCP_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBDHCP_API
+#else
+#ifdef ISC_LIBDHCP_EXPORT
+#define ISC_LIBDHCP_API __declspec(dllexport)
+#else
+#define ISC_LIBDHCP_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBDHCP_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/dhcp/iface_mgr.cc b/src/lib/dhcp/iface_mgr.cc
index 508413d..fe18dae 100644
--- a/src/lib/dhcp/iface_mgr.cc
+++ b/src/lib/dhcp/iface_mgr.cc
@@ -12,13 +12,20 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDHCP_EXPORT
+
 #include <config.h>
 #include <sstream>
 #include <fstream>
 #include <string.h>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <netioapi.h>
+#else
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <sys/select.h>
+#endif
 
 #include <dhcp/dhcp4.h>
 #include <dhcp/dhcp6.h>
@@ -75,7 +82,7 @@ IfaceMgr::Iface::getPlainMac() const {
     ostringstream tmp;
     tmp.fill('0');
     tmp << hex;
-    for (int i = 0; i < mac_len_; i++) {
+    for (size_t i = 0; i < mac_len_; i++) {
         tmp.width(2);
         tmp <<  static_cast<int>(mac_[i]);
         if (i < mac_len_-1) {
@@ -107,11 +114,20 @@ bool IfaceMgr::Iface::delAddress(const isc::asiolink::IOAddress& addr) {
     return (false);
 }
 
-bool IfaceMgr::Iface::delSocket(uint16_t sockfd) {
+#ifdef _WIN32
+bool IfaceMgr::Iface::delSocket(SOCKET sockfd)
+#else
+bool IfaceMgr::Iface::delSocket(int sockfd)
+#endif
+{
     list<SocketInfo>::iterator sock = sockets_.begin();
     while (sock!=sockets_.end()) {
         if (sock->sockfd_ == sockfd) {
+#ifdef _WIN32
+            closesocket(sockfd);
+#else
             close(sockfd);
+#endif
             sockets_.erase(sock);
             return (true); //socket found
         }
@@ -121,7 +137,11 @@ bool IfaceMgr::Iface::delSocket(uint16_t sockfd) {
 }
 
 IfaceMgr::IfaceMgr()
+#ifdef _WIN32
+    :control_buf_len_(WSA_CMSG_SPACE(sizeof(struct in6_pktinfo))),
+#else
     :control_buf_len_(CMSG_SPACE(sizeof(struct in6_pktinfo))),
+#endif
      control_buf_(new char[control_buf_len_]),
      session_socket_(INVALID_SOCKET), session_callback_(NULL)
 {
@@ -155,7 +175,11 @@ void IfaceMgr::closeSockets() {
         for (SocketCollection::iterator sock = iface->sockets_.begin();
              sock != iface->sockets_.end(); ++sock) {
             cout << "Closing socket " << sock->sockfd_ << endl;
+#ifdef _WIN32
+            closesocket(sock->sockfd_);
+#else
             close(sock->sockfd_);
+#endif
         }
         iface->sockets_.clear();
     }
@@ -212,7 +236,7 @@ void IfaceMgr::stubDetectIfaces() {
 
         cout << "Detected interface " << ifaceName << "/" << v4addr << "/"
              << v6addr << endl;
-    } catch (const std::exception& ex) {
+    } catch (const std::exception&) {
         // TODO: deallocate whatever memory we used
         // not that important, since this function is going to be
         // thrown away as soon as we get proper interface detection
@@ -225,7 +249,11 @@ void IfaceMgr::stubDetectIfaces() {
 }
 
 bool IfaceMgr::openSockets4(const uint16_t port) {
+#ifdef _WIN32
+    SOCKET sock;
+#else
     int sock;
+#endif
     int count = 0;
 
     for (IfaceCollection::iterator iface=ifaces_.begin();
@@ -254,7 +282,7 @@ bool IfaceMgr::openSockets4(const uint16_t port) {
             }
 
             sock = openSocket(iface->getName(), *addr, port);
-            if (sock<0) {
+            if (sock == INVALID_SOCKET) {
                 cout << "Failed to open unicast socket." << endl;
                 return (false);
             }
@@ -267,7 +295,11 @@ bool IfaceMgr::openSockets4(const uint16_t port) {
 }
 
 bool IfaceMgr::openSockets6(const uint16_t port) {
+#ifdef _WIN32
+    SOCKET sock;
+#else
     int sock;
+#endif
     int count = 0;
 
     for (IfaceCollection::iterator iface=ifaces_.begin();
@@ -292,7 +324,7 @@ bool IfaceMgr::openSockets6(const uint16_t port) {
             }
 
             sock = openSocket(iface->getName(), *addr, port);
-            if (sock<0) {
+            if (sock == INVALID_SOCKET) {
                 cout << "Failed to open unicast socket." << endl;
                 return (false);
             }
@@ -302,7 +334,11 @@ bool IfaceMgr::openSockets6(const uint16_t port) {
             // on Linux.
             if ( !joinMulticast(sock, iface->getName(),
                                 string(ALL_DHCP_RELAY_AGENTS_AND_SERVERS) ) ) {
+#ifdef _WIN32
+                closesocket(sock);
+#else
                 close(sock);
+#endif
                 isc_throw(Unexpected, "Failed to join " << ALL_DHCP_RELAY_AGENTS_AND_SERVERS
                           << " multicast group.");
             }
@@ -380,8 +416,13 @@ IfaceMgr::getIface(const std::string& ifname) {
     return (NULL); // not found
 }
 
-int IfaceMgr::openSocket(const std::string& ifname, const IOAddress& addr,
-                         const uint16_t port) {
+#ifdef _WIN32
+SOCKET
+#else
+int
+#endif
+IfaceMgr::openSocket(const std::string& ifname, const IOAddress& addr,
+                     const uint16_t port) {
     Iface* iface = getIface(ifname);
     if (!iface) {
         isc_throw(BadValue, "There is no " << ifname << " interface present.");
@@ -397,7 +438,12 @@ int IfaceMgr::openSocket(const std::string& ifname, const IOAddress& addr,
     }
 }
 
-int IfaceMgr::openSocket4(Iface& iface, const IOAddress& addr, uint16_t port) {
+#ifdef _WIN32
+SOCKET
+#else
+int
+#endif
+IfaceMgr::openSocket4(Iface& iface, const IOAddress& addr, uint16_t port) {
 
     cout << "Creating UDP4 socket on " << iface.getFullName()
          << " " << addr.toText() << "/port=" << port << endl;
@@ -411,23 +457,40 @@ int IfaceMgr::openSocket4(Iface& iface, const IOAddress& addr, uint16_t port) {
     //addr4.sin_addr.s_addr = 0; // anyaddr: this will receive 0.0.0.0 => 255.255.255.255 traffic
     // addr4.sin_addr.s_addr = 0xffffffffu; // broadcast address. This will receive 0.0.0.0 => 255.255.255.255 as well
 
+#ifdef _WIN32
+    SOCKET sock = socket(AF_INET, SOCK_DGRAM, 0);
+#else
     int sock = socket(AF_INET, SOCK_DGRAM, 0);
-    if (sock < 0) {
+#endif
+    if (sock == INVALID_SOCKET) {
         isc_throw(Unexpected, "Failed to create UDP6 socket.");
     }
 
+#ifdef _WIN32
+    if (::bind(sock, (struct sockaddr *)&addr4, sizeof(addr4)) < 0) {
+        closesocket(sock);
+        isc_throw(Unexpected, "Failed to bind socket " << sock << " to " << addr.toText()
+                  << "/port=" << port);
+    }
+#else
     if (bind(sock, (struct sockaddr *)&addr4, sizeof(addr4)) < 0) {
         close(sock);
         isc_throw(Unexpected, "Failed to bind socket " << sock << " to " << addr.toText()
                   << "/port=" << port);
     }
+#endif
 
     // if there is no support for IP_PKTINFO, we are really out of luck
     // it will be difficult to undersand, where this packet came from
 #if defined(IP_PKTINFO)
     int flag = 1;
-    if (setsockopt(sock, IPPROTO_IP, IP_PKTINFO, &flag, sizeof(flag)) != 0) {
+    if (setsockopt(sock, IPPROTO_IP, IP_PKTINFO,
+                   (char *) &flag, sizeof(flag)) != 0) {
+#ifdef _WIN32
+        closesocket(sock);
+#else
         close(sock);
+#endif
         isc_throw(Unexpected, "setsockopt: IP_PKTINFO: failed.");
     }
 #endif
@@ -441,7 +504,12 @@ int IfaceMgr::openSocket4(Iface& iface, const IOAddress& addr, uint16_t port) {
     return (sock);
 }
 
-int IfaceMgr::openSocket6(Iface& iface, const IOAddress& addr, uint16_t port) {
+#ifdef _WIN32
+SOCKET
+#else
+int
+#endif
+IfaceMgr::openSocket6(Iface& iface, const IOAddress& addr, uint16_t port) {
 
     cout << "Creating UDP6 socket on " << iface.getFullName()
          << " " << addr.toText() << "/port=" << port << endl;
@@ -463,37 +531,60 @@ int IfaceMgr::openSocket6(Iface& iface, const IOAddress& addr, uint16_t port) {
     // TODO: use sockcreator once it becomes available
 
     // make a socket
+#ifdef _WIN32
+    SOCKET sock = socket(AF_INET6, SOCK_DGRAM, 0);
+#else
     int sock = socket(AF_INET6, SOCK_DGRAM, 0);
-    if (sock < 0) {
+#endif
+    if (sock == INVALID_SOCKET) {
         isc_throw(Unexpected, "Failed to create UDP6 socket.");
     }
 
     // Set the REUSEADDR option so that we don't fail to start if
     // we're being restarted.
     int flag = 1;
+#ifndef _WIN32
     if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
                    (char *)&flag, sizeof(flag)) < 0) {
         close(sock);
         isc_throw(Unexpected, "Can't set SO_REUSEADDR option on dhcpv6 socket.");
     }
+#endif
 
+#ifdef _WIN32
+    if (::bind(sock, (struct sockaddr *)&addr6, sizeof(addr6)) < 0) {
+        closesocket(sock);
+        isc_throw(Unexpected, "Failed to bind socket " << sock << " to " << addr.toText()
+                  << "/port=" << port);
+    }
+#else
     if (bind(sock, (struct sockaddr *)&addr6, sizeof(addr6)) < 0) {
         close(sock);
         isc_throw(Unexpected, "Failed to bind socket " << sock << " to " << addr.toText()
                   << "/port=" << port);
     }
+#endif
+
 #ifdef IPV6_RECVPKTINFO
     // RFC3542 - a new way
     if (setsockopt(sock, IPPROTO_IPV6, IPV6_RECVPKTINFO,
-                   &flag, sizeof(flag)) != 0) {
+                   (char *) &flag, sizeof(flag)) != 0) {
+#ifdef _WIN32
+        closesocket(sock);
+#else
         close(sock);
+#endif
         isc_throw(Unexpected, "setsockopt: IPV6_RECVPKTINFO failed.");
     }
 #else
     // RFC2292 - an old way
     if (setsockopt(sock, IPPROTO_IPV6, IPV6_PKTINFO,
-                   &flag, sizeof(flag)) != 0) {
+                   (char *) &flag, sizeof(flag)) != 0) {
+#ifdef _WIN32
+        closesocket(sock);
+#else
         close(sock);
+#endif
         isc_throw(Unexpected, "setsockopt: IPV6_PKTINFO: failed.");
     }
 #endif
@@ -506,7 +597,11 @@ int IfaceMgr::openSocket6(Iface& iface, const IOAddress& addr, uint16_t port) {
 
         if ( !joinMulticast( sock, iface.getName(),
                          string(ALL_DHCP_RELAY_AGENTS_AND_SERVERS) ) ) {
+#ifdef _WIN32
+            closesocket(sock);
+#else
             close(sock);
+#endif
             isc_throw(Unexpected, "Failed to join " << ALL_DHCP_RELAY_AGENTS_AND_SERVERS
                       << " multicast group.");
         }
@@ -522,8 +617,13 @@ int IfaceMgr::openSocket6(Iface& iface, const IOAddress& addr, uint16_t port) {
 }
 
 bool
-IfaceMgr::joinMulticast(int sock, const std::string& ifname,
-const std::string & mcast) {
+IfaceMgr::joinMulticast(
+#ifdef _WIN32
+                        SOCKET sock,
+#else
+                        int sock,
+#endif
+                        const std::string& ifname, const std::string & mcast) {
 
     struct ipv6_mreq mreq;
 
@@ -536,7 +636,7 @@ const std::string & mcast) {
 
     mreq.ipv6mr_interface = if_nametoindex(ifname.c_str());
     if (setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP,
-                   &mreq, sizeof(mreq)) < 0) {
+                   (char *)&mreq, sizeof(mreq)) < 0) {
         cout << "Failed to join " << mcast << " multicast group." << endl;
         return (false);
     }
@@ -570,10 +670,19 @@ IfaceMgr::send(const Pkt6Ptr& pkt) {
     to.sin6_scope_id = pkt->getIndex();
 
     // Initialize our message header structure.
+#ifdef _WIN32
+    WSAMSG m;
+#else
     struct msghdr m;
+#endif
     memset(&m, 0, sizeof(m));
-    m.msg_name = &to;
+#ifdef _WIN32
+    m.name = (struct sockaddr *)&to;
+    m.namelen = sizeof(to);
+#else
+    m.msg_name = (struct sockaddr *)&to;
     m.msg_namelen = sizeof(to);
+#endif
 
     // Set the data buffer we're sending. (Using this wacky
     // "scatter-gather" stuff... we only have a single chunk
@@ -586,12 +695,23 @@ IfaceMgr::send(const Pkt6Ptr& pkt) {
     // (defined as void*) we must use const cast from void *.
     // Otherwise C++ compiler would complain that we are trying
     // to assign const void* to void*.
+#ifdef _WIN32
+    WSABUF v;
+#else
     struct iovec v;
+#endif
     memset(&v, 0, sizeof(v));
+#ifdef _WIN32
+    v.buf = (char *)(pkt->getBuffer().getData());
+    v.len = pkt->getBuffer().getLength();
+    m.lpBuffers = &v;
+    m.dwBufferCount = 1;
+#else
     v.iov_base = const_cast<void *>(pkt->getBuffer().getData());
     v.iov_len = pkt->getBuffer().getLength();
     m.msg_iov = &v;
     m.msg_iovlen = 1;
+#endif
 
     // Setting the interface is a bit more involved.
     //
@@ -599,6 +719,15 @@ IfaceMgr::send(const Pkt6Ptr& pkt) {
     // define the IPv6 packet information. We could set the
     // source address if we wanted, but we can safely let the
     // kernel decide what that should be.
+#ifdef _WIN32
+    m.Control.buf = &control_buf_[0];
+    m.Control.len = control_buf_len_;
+    WSACMSGHDR *cmsg = WSA_CMSG_FIRSTHDR(&m);
+    cmsg->cmsg_level = IPPROTO_IPV6;
+    cmsg->cmsg_type = IPV6_PKTINFO;
+    cmsg->cmsg_len = WSA_CMSG_LEN(sizeof(struct in6_pktinfo));
+    struct in6_pktinfo *pktinfo = convertPktInfo6(WSA_CMSG_DATA(cmsg));
+#else
     m.msg_control = &control_buf_[0];
     m.msg_controllen = control_buf_len_;
     struct cmsghdr *cmsg = CMSG_FIRSTHDR(&m);
@@ -606,13 +735,26 @@ IfaceMgr::send(const Pkt6Ptr& pkt) {
     cmsg->cmsg_type = IPV6_PKTINFO;
     cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
     struct in6_pktinfo *pktinfo = convertPktInfo6(CMSG_DATA(cmsg));
+#endif
     memset(pktinfo, 0, sizeof(struct in6_pktinfo));
     pktinfo->ipi6_ifindex = pkt->getIndex();
+#ifdef _WIN32
+    m.Control.len = cmsg->cmsg_len;
+#else
     m.msg_controllen = cmsg->cmsg_len;
+#endif
 
     pkt->updateTimestamp();
 
+#ifdef _WIN32
+    DWORD bsent;
+    if (WSASendMsg(getSocket(*pkt), &m, 0, &bsent, NULL, NULL) == SOCKET_ERROR)
+        result = -1;
+    else
+        result = (int) bsent;
+#else
     result = sendmsg(getSocket(*pkt), &m, 0);
+#endif
     if (result < 0) {
         isc_throw(Unexpected, "Pkt6 send failed: sendmsg() returned " << result);
     }
@@ -622,7 +764,7 @@ IfaceMgr::send(const Pkt6Ptr& pkt) {
          << ", src=" << pkt->getLocalAddr().toText() << "]:" << pkt->getLocalPort()
          << endl;
 
-    return (result);
+    return (result >= 0);
 }
 
 bool
@@ -645,23 +787,43 @@ IfaceMgr::send(const Pkt4Ptr& pkt)
     to.sin_port = htons(pkt->getRemotePort());
     to.sin_addr.s_addr = htonl(pkt->getRemoteAddr());
 
+#ifdef _WIN32
+    WSAMSG m;
+#else
     struct msghdr m;
+#endif
     // Initialize our message header structure.
     memset(&m, 0, sizeof(m));
-    m.msg_name = &to;
+#ifdef _WIN32
+    m.name = (struct sockaddr *)&to;
+    m.namelen = sizeof(to);
+#else
+    m.msg_name = (struct sockaddr *)&to;
     m.msg_namelen = sizeof(to);
+#endif
 
     // Set the data buffer we're sending. (Using this wacky
     // "scatter-gather" stuff... we only have a single chunk
     // of data to send, so we declare a single vector entry.)
+#ifdef _WIN32
+    WSABUF v;
+#else
     struct iovec v;
+#endif
     memset(&v, 0, sizeof(v));
     // iov_base field is of void * type. We use it for packet
     // transmission, so this buffer will not be modified.
+#ifdef _WIN32
+    v.buf = (char *)(pkt->getBuffer().getData());
+    v.len = pkt->getBuffer().getLength();
+    m.lpBuffers = &v;
+    m.dwBufferCount = 1;
+#else
     v.iov_base = const_cast<void *>(pkt->getBuffer().getData());
     v.iov_len = pkt->getBuffer().getLength();
     m.msg_iov = &v;
     m.msg_iovlen = 1;
+#endif
 
     // call OS-specific routines (like setting interface index)
     os_send4(m, control_buf_, control_buf_len_, pkt);
@@ -673,7 +835,14 @@ IfaceMgr::send(const Pkt4Ptr& pkt)
 
     pkt->updateTimestamp();
 
+#ifdef _WIN32
+    DWORD bsent;
+    int result = -1;
+    if (WSASendMsg(getSocket(*pkt), &m, 0, &bsent, NULL, NULL) != SOCKET_ERROR)
+        result = (int) bsent;
+#else
     int result = sendmsg(getSocket(*pkt), &m, 0);
+#endif
     if (result < 0) {
         isc_throw(Unexpected, "Pkt4 send failed.");
     }
@@ -684,7 +853,7 @@ IfaceMgr::send(const Pkt4Ptr& pkt)
          << ", src=" << pkt->getLocalAddr().toText() << ":" << pkt->getLocalPort()
          << endl;
 
-    return (result);
+    return (result >= 0);
 }
 
 
@@ -714,9 +883,11 @@ IfaceMgr::receive4(uint32_t timeout) {
 
                 // Add this socket to listening set
                 FD_SET(s->sockfd_, &sockets);
+#ifndef _WIN32
                 if (maxfd < s->sockfd_) {
                     maxfd = s->sockfd_;
                 }
+#endif
             }
         }
     }
@@ -725,8 +896,10 @@ IfaceMgr::receive4(uint32_t timeout) {
     if (session_socket_ != INVALID_SOCKET) {
         // at it to the set as well
         FD_SET(session_socket_, &sockets);
+#ifndef _WIN32
         if (maxfd < session_socket_)
             maxfd = session_socket_;
+#endif
         names << session_socket_ << "(session)";
     }
 
@@ -744,7 +917,11 @@ IfaceMgr::receive4(uint32_t timeout) {
         // nothing received and timeout has been reached
         return (Pkt4Ptr()); // NULL
     } else if (result < 0) {
+#ifdef _WIN32
+        cout << "Socket read error: " << strerror(WSAGetLastError()) << endl;
+#else
         cout << "Socket read error: " << strerror(errno) << endl;
+#endif
 
         /// @todo: perhaps throw here?
         return (Pkt4Ptr()); // NULL
@@ -798,18 +975,37 @@ IfaceMgr::receive4(uint32_t timeout) {
     memset(&from_addr, 0, sizeof(from_addr));
 
     // Initialize our message header structure.
+#ifdef _WIN32
+    GUID WSARecvMsg_GUID = WSAID_WSARECVMSG;
+    LPFN_WSARECVMSG WSARecvMsg;
+    WSAMSG m;
+#else
     struct msghdr m;
+#endif
     memset(&m, 0, sizeof(m));
 
     // Point so we can get the from address.
-    m.msg_name = &from_addr;
+#ifdef _WIN32
+    m.name = (struct sockaddr *)&from_addr;
+    m.namelen = sizeof(from_addr);
+#else
+    m.msg_name = (struct sockaddr *)&from_addr;
     m.msg_namelen = sizeof(from_addr);
+#endif
 
+#ifdef _WIN32
+    WSABUF v;
+    v.buf = (char *)buf;
+    v.len = RCVBUFSIZE;
+    m.lpBuffers = &v;
+    m.dwBufferCount = 1;
+#else
     struct iovec v;
     v.iov_base = static_cast<void*>(buf);
     v.iov_len = RCVBUFSIZE;
     m.msg_iov = &v;
     m.msg_iovlen = 1;
+#endif
 
     // Getting the interface is a bit more involved.
     //
@@ -817,10 +1013,29 @@ IfaceMgr::receive4(uint32_t timeout) {
     // previously asked the kernel to give us packet
     // information (when we initialized the interface), so we
     // should get the destination address from that.
+#ifdef _WIN32
+    m.Control.buf = &control_buf_[0];
+    m.Control.len = control_buf_len_;
+#else
     m.msg_control = &control_buf_[0];
     m.msg_controllen = control_buf_len_;
+#endif
 
+#ifdef _WIN32
+    DWORD brecv;
+    if ((WSAIoctl(candidate->sockfd_,
+                  SIO_GET_EXTENSION_FUNCTION_POINTER,
+                  &WSARecvMsg_GUID, sizeof(WSARecvMsg_GUID),
+                  &WSARecvMsg, sizeof(WSARecvMsg),
+                  &brecv, NULL, NULL) == SOCKET_ERROR) ||
+        (WSARecvMsg(candidate->sockfd_, &m,
+                    &brecv, NULL, NULL) == SOCKET_ERROR))
+        result = -1;
+    else
+        result = (int) brecv;
+#else
     result = recvmsg(candidate->sockfd_, &m, 0);
+#endif
     if (result < 0) {
         cout << "Failed to receive UDP4 data." << endl;
         return (Pkt4Ptr()); // NULL
@@ -866,22 +1081,44 @@ Pkt6Ptr IfaceMgr::receive6() {
     memset(&from, 0, sizeof(from));
 
     // Initialize our message header structure.
+#ifdef _WIN32
+    GUID WSARecvMsg_GUID = WSAID_WSARECVMSG;
+    LPFN_WSARECVMSG WSARecvMsg;
+    WSAMSG m;
+#else
     struct msghdr m;
+#endif
     memset(&m, 0, sizeof(m));
 
     // Point so we can get the from address.
-    m.msg_name = &from;
+#ifdef _WIN32
+    m.name = (struct sockaddr *)&from;
+    m.namelen = sizeof(from);
+#else
+    m.msg_name = (struct sockaddr *)&from;
     m.msg_namelen = sizeof(from);
+#endif
 
     // Set the data buffer we're receiving. (Using this wacky
     // "scatter-gather" stuff... but we that doesn't really make
     // sense for us, so we use a single vector entry.)
+#ifdef _WIN32
+    WSABUF v;
+#else
     struct iovec v;
+#endif
     memset(&v, 0, sizeof(v));
+#ifdef _WIN32
+    v.buf = (char *)buf;
+    v.len = RCVBUFSIZE;
+    m.lpBuffers = &v;
+    m.dwBufferCount = 1;
+#else
     v.iov_base = static_cast<void*>(buf);
     v.iov_len = RCVBUFSIZE;
     m.msg_iov = &v;
     m.msg_iovlen = 1;
+#endif
 
     // Getting the interface is a bit more involved.
     //
@@ -889,8 +1126,13 @@ Pkt6Ptr IfaceMgr::receive6() {
     // previously asked the kernel to give us packet
     // information (when we initialized the interface), so we
     // should get the destination address from that.
+#ifdef _WIN32
+    m.Control.buf = &control_buf_[0];
+    m.Control.len = control_buf_len_;
+#else
     m.msg_control = &control_buf_[0];
     m.msg_controllen = control_buf_len_;
+#endif
 
     /// TODO: Need to move to select() and pool over
     /// all available sockets. For now, we just take the
@@ -928,7 +1170,20 @@ Pkt6Ptr IfaceMgr::receive6() {
     cout << "Trying to receive over UDP6 socket " << candidate->sockfd_ << " bound to "
          << candidate->addr_.toText() << "/port=" << candidate->port_ << " on "
          << iface->getFullName() << endl;
+#ifdef _WIN32
+    DWORD brecv;
+    int result = -1;
+    if ((WSAIoctl(candidate->sockfd_,
+                  SIO_GET_EXTENSION_FUNCTION_POINTER,
+                  &WSARecvMsg_GUID, sizeof(WSARecvMsg_GUID),
+                  &WSARecvMsg, sizeof(WSARecvMsg),
+                  &brecv, NULL, NULL) != SOCKET_ERROR) &&
+        (WSARecvMsg(candidate->sockfd_, &m,
+                    &brecv, NULL, NULL) != SOCKET_ERROR))
+        result = (int) brecv;
+#else
     int result = recvmsg(candidate->sockfd_, &m, 0);
+#endif
 
     struct in6_addr to_addr;
     memset(&to_addr, 0, sizeof(to_addr));
@@ -945,17 +1200,29 @@ Pkt6Ptr IfaceMgr::receive6() {
         // We also keep a flag to see if we found it. If we
         // didn't, then we consider this to be an error.
         bool found_pktinfo = false;
+#ifdef _WIN32
+        WSACMSGHDR* cmsg = WSA_CMSG_FIRSTHDR(&m);
+#else
         struct cmsghdr* cmsg = CMSG_FIRSTHDR(&m);
+#endif
         while (cmsg != NULL) {
             if ((cmsg->cmsg_level == IPPROTO_IPV6) &&
                 (cmsg->cmsg_type == IPV6_PKTINFO)) {
+#ifdef _WIN32
+                pktinfo = convertPktInfo6(WSA_CMSG_DATA(cmsg));
+#else
                 pktinfo = convertPktInfo6(CMSG_DATA(cmsg));
+#endif
                 to_addr = pktinfo->ipi6_addr;
                 ifindex = pktinfo->ipi6_ifindex;
                 found_pktinfo = true;
                 break;
             }
+#ifdef _WIN32
+            cmsg = WSA_CMSG_NXTHDR(&m, cmsg);
+#else
             cmsg = CMSG_NXTHDR(&m, cmsg);
+#endif
         }
         if (!found_pktinfo) {
             cout << "Unable to find pktinfo" << endl;
@@ -970,7 +1237,7 @@ Pkt6Ptr IfaceMgr::receive6() {
     Pkt6Ptr pkt;
     try {
         pkt = Pkt6Ptr(new Pkt6(buf, result));
-    } catch (const std::exception& ex) {
+    } catch (const std::exception&) {
         cout << "Failed to create new packet." << endl;
         return (Pkt6Ptr()); // NULL
     }
@@ -1003,7 +1270,12 @@ Pkt6Ptr IfaceMgr::receive6() {
     return (pkt);
 }
 
-uint16_t IfaceMgr::getSocket(const isc::dhcp::Pkt6& pkt) {
+#ifdef _WIN32
+SOCKET
+#else
+int
+#endif
+IfaceMgr::getSocket(const isc::dhcp::Pkt6& pkt) {
     Iface* iface = getIface(pkt.getIface());
     if (iface == NULL) {
         isc_throw(BadValue, "Tried to find socket for non-existent interface "
@@ -1025,7 +1297,12 @@ uint16_t IfaceMgr::getSocket(const isc::dhcp::Pkt6& pkt) {
               << " does not have any suitable IPv6 sockets open.");
 }
 
-uint16_t IfaceMgr::getSocket(isc::dhcp::Pkt4 const& pkt) {
+#ifdef _WIN32
+SOCKET
+#else
+int
+#endif
+IfaceMgr::getSocket(isc::dhcp::Pkt4 const& pkt) {
     Iface* iface = getIface(pkt.getIface());
     if (iface == NULL) {
         isc_throw(BadValue, "Tried to find socket for non-existent interface "
diff --git a/src/lib/dhcp/iface_mgr.h b/src/lib/dhcp/iface_mgr.h
index 7fa2e85..1951f8c 100644
--- a/src/lib/dhcp/iface_mgr.h
+++ b/src/lib/dhcp/iface_mgr.h
@@ -20,6 +20,7 @@
 #include <boost/scoped_array.hpp>
 #include <boost/noncopyable.hpp>
 #include <asiolink/io_address.h>
+#include <dhcp/dll.h>
 #include <dhcp/dhcp6.h>
 #include <dhcp/dhcp4.h>
 #include <dhcp/pkt4.h>
@@ -34,7 +35,7 @@ namespace dhcp {
 /// interfaces, configured addresses, link-local addresses, and provides
 /// API for using sockets.
 ///
-class IfaceMgr : public boost::noncopyable {
+class ISC_LIBDHCP_API IfaceMgr : public boost::noncopyable {
 public:
     /// type that defines list of addresses
     typedef std::vector<isc::asiolink::IOAddress> AddressCollection;
@@ -56,7 +57,11 @@ public:
 
     /// Holds information about socket.
     struct SocketInfo {
-        uint16_t sockfd_; /// socket descriptor
+#ifdef _WIN32
+        SOCKET sockfd_; /// socket descriptor
+#else
+        int sockfd_; /// socket descriptor
+#endif
         isc::asiolink::IOAddress addr_; /// bound address
         uint16_t port_;   /// socket port
         uint16_t family_; /// IPv4 or IPv6
@@ -66,8 +71,13 @@ public:
         /// @param sockfd socket descriptor
         /// @param addr an address the socket is bound to
         /// @param port a port the socket is bound to
-        SocketInfo(uint16_t sockfd, const isc::asiolink::IOAddress& addr,
-                   uint16_t port)
+        SocketInfo(
+#ifdef _WIN32
+                   SOCKET sockfd,
+#else
+                   int sockfd,
+#endif
+                   const isc::asiolink::IOAddress& addr, uint16_t port)
         :sockfd_(sockfd), addr_(addr), port_(port), family_(addr.getFamily()) { }
     };
 
@@ -190,7 +200,11 @@ public:
         ///
         /// @param sockfd socket descriptor to be closed/removed.
         /// @return true if there was such socket, false otherwise
-        bool delSocket(uint16_t sockfd);
+#ifdef _WIN32
+        bool delSocket(SOCKET sockfd);
+#else
+        bool delSocket(int sockfd);
+#endif
 
         /// socket used to sending data
         /// TODO: this should be protected
@@ -292,7 +306,11 @@ public:
     /// @param pkt a packet to be transmitted
     ///
     /// @return a socket descriptor
-    uint16_t getSocket(const isc::dhcp::Pkt6& pkt);
+#ifdef _WIN32
+    SOCKET getSocket(const isc::dhcp::Pkt6& pkt);
+#else
+    int getSocket(const isc::dhcp::Pkt6& pkt);
+#endif
 
     /// @brief Return most suitable socket for transmitting specified IPv6 packet.
     ///
@@ -305,7 +323,11 @@ public:
     /// @param pkt a packet to be transmitted
     ///
     /// @return a socket descriptor
-    uint16_t getSocket(const isc::dhcp::Pkt4& pkt);
+#ifdef _WIN32
+    SOCKET getSocket(const isc::dhcp::Pkt4& pkt);
+#else
+    int getSocket(const isc::dhcp::Pkt4& pkt);
+#endif
 
     /// debugging method that prints out all available interfaces
     ///
@@ -373,8 +395,13 @@ public:
     ///
     /// @return socket descriptor, if socket creation, binding and multicast
     /// group join were all successful.
-    int openSocket(const std::string& ifname,
-                   const isc::asiolink::IOAddress& addr, const uint16_t port);
+#ifdef _WIN32
+    SOCKET
+#else
+    int 
+#endif
+    openSocket(const std::string& ifname,
+               const isc::asiolink::IOAddress& addr, const uint16_t port);
 
     /// Opens IPv6 sockets on detected interfaces.
     ///
@@ -409,13 +436,20 @@ public:
     ///
     /// @param socketfd socket descriptor
     /// @param callback callback function
-    void set_session_socket(int socketfd, SessionCallback callback) {
+#ifdef _WIN32
+    void set_session_socket(SOCKET socketfd, SessionCallback callback)
+#else
+    void set_session_socket(int socketfd, SessionCallback callback)
+#endif
+    {
         session_socket_ = socketfd;
         session_callback_ = callback;
     }
 
     /// A value of socket descriptor representing "not specified" state.
+#ifndef _WIN32
     static const int INVALID_SOCKET = -1;
+#endif
 
     // don't use private, we need derived classes in tests
 protected:
@@ -439,7 +473,12 @@ protected:
     /// @param port a port that created socket should be bound to
     ///
     /// @return socket descriptor
-    int openSocket4(Iface& iface, const isc::asiolink::IOAddress& addr, uint16_t port);
+#ifdef _WIN32
+    SOCKET
+#else
+    int
+#endif
+    openSocket4(Iface& iface, const isc::asiolink::IOAddress& addr, uint16_t port);
 
     /// @brief Opens IPv6 socket.
     ///
@@ -452,7 +491,12 @@ protected:
     /// @param port a port that created socket should be bound to
     ///
     /// @return socket descriptor
-    int openSocket6(Iface& iface, const isc::asiolink::IOAddress& addr, uint16_t port);
+#ifdef _WIN32
+    SOCKET
+#else
+    int
+#endif
+    openSocket6(Iface& iface, const isc::asiolink::IOAddress& addr, uint16_t port);
 
     /// @brief Adds an interface to list of known interfaces.
     ///
@@ -509,7 +553,13 @@ protected:
     /// @param control_buf buffer to be used during transmission
     /// @param control_buf_len buffer length
     /// @param pkt packet to be sent
-    void os_send4(struct msghdr& m, boost::scoped_array<char>& control_buf,
+    void os_send4(
+#ifdef _WIN32
+                  WSAMSG& m,
+#else
+                  struct msghdr& m,
+#endif
+                  boost::scoped_array<char>& control_buf,
                   size_t control_buf_len, const Pkt4Ptr& pkt);
 
     /// @brief OS-specific operations during IPv4 packet reception
@@ -518,10 +568,20 @@ protected:
     /// @param pkt packet received (some fields will be set here)
     ///
     /// @return true if successful, false otherwise
-    bool os_receive4(struct msghdr& m, Pkt4Ptr& pkt);
+    bool os_receive4(
+#ifdef _WIN32
+                     WSAMSG& m,
+#else
+                     struct msghdr& m,
+#endif
+                     Pkt4Ptr& pkt);
 
     /// socket descriptor of the session socket
+#ifdef _WIN32
+    SOCKET session_socket_;
+#else
     int session_socket_;
+#endif
 
     /// a callback that will be called when data arrives over session_socket_
     SessionCallback session_callback_;
@@ -545,8 +605,13 @@ private:
     /// @return true if multicast join was successful
     ///
     bool
-    joinMulticast(int sock, const std::string& ifname,
-                  const std::string& mcast);
+    joinMulticast(
+#ifdef _WIN32
+                  SOCKET sock,
+#else
+                  int sock,
+#endif
+                  const std::string& ifname, const std::string& mcast);
 
 };
 
diff --git a/src/lib/dhcp/iface_mgr_bsd.cc b/src/lib/dhcp/iface_mgr_bsd.cc
index e3f11a1..5351694 100644
--- a/src/lib/dhcp/iface_mgr_bsd.cc
+++ b/src/lib/dhcp/iface_mgr_bsd.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_LIBDHCP_EXPORT
+
 #include <config.h>
 
 #if defined(OS_BSD)
diff --git a/src/lib/dhcp/iface_mgr_linux.cc b/src/lib/dhcp/iface_mgr_linux.cc
index 90431de..6cef882 100644
--- a/src/lib/dhcp/iface_mgr_linux.cc
+++ b/src/lib/dhcp/iface_mgr_linux.cc
@@ -27,6 +27,8 @@
 /// to do something with address labels. Getting a list of interfaces with
 /// addresses configured on it is just a small subset of all possible actions.
 
+#define ISC_LIBDHCP_EXPORT
+
 #include <config.h>
 
 #if defined(OS_LINUX)
diff --git a/src/lib/dhcp/iface_mgr_sun.cc b/src/lib/dhcp/iface_mgr_sun.cc
index 5847906..918f774 100644
--- a/src/lib/dhcp/iface_mgr_sun.cc
+++ b/src/lib/dhcp/iface_mgr_sun.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_LIBDHCP_EXPORT
+
 #include <config.h>
 
 #if defined(OS_SUN)
diff --git a/src/lib/dhcp/iface_mgr_windows.cc b/src/lib/dhcp/iface_mgr_windows.cc
new file mode 100644
index 0000000..699bd18
--- /dev/null
+++ b/src/lib/dhcp/iface_mgr_windows.cc
@@ -0,0 +1,98 @@
+// Copyright (C) 2011  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_LIBDHCP_EXPORT
+
+#include <config.h>
+
+#ifdef _WIN32
+
+#include <dhcp/iface_mgr.h>
+#include <exceptions/exceptions.h>
+
+using namespace std;
+using namespace isc;
+using namespace isc::asiolink;
+using namespace isc::dhcp;
+
+namespace isc {
+namespace dhcp {
+
+void
+IfaceMgr::detectIfaces() {
+    /// @todo do the actual detection on Windows. Currently just calling
+    /// stub implementation.
+    stubDetectIfaces();
+}
+
+void IfaceMgr::os_send4(WSAMSG& m,
+                        boost::scoped_array<char>& control_buf,
+                        size_t control_buf_len,
+                        const Pkt4Ptr& pkt) {
+    // Setting the interface is a bit more involved.
+    //
+    // We have to create a "control message", and set that to
+    // define the IPv4 packet information. We could set the
+    // source address if we wanted, but we can safely let the
+    // kernel decide what that should be.
+    m.Control.buf = &control_buf[0];
+    m.Control.len = control_buf_len;
+    WSACMSGHDR* cmsg = WSA_CMSG_FIRSTHDR(&m);
+    cmsg->cmsg_level = IPPROTO_IP;
+    cmsg->cmsg_type = IP_PKTINFO;
+    cmsg->cmsg_len = WSA_CMSG_LEN(sizeof(struct in_pktinfo));
+    struct in_pktinfo* pktinfo =(struct in_pktinfo *)WSA_CMSG_DATA(cmsg);
+    memset(pktinfo, 0, sizeof(struct in_pktinfo));
+    pktinfo->ipi_ifindex = pkt->getIndex();
+    m.Control.len = cmsg->cmsg_len;
+}
+
+bool IfaceMgr::os_receive4(WSAMSG& m, Pkt4Ptr& pkt) {
+    WSACMSGHDR* cmsg;
+    struct in_pktinfo* pktinfo;
+    struct in_addr to_addr;
+
+    memset(&to_addr, 0, sizeof(to_addr));
+
+    cmsg = WSA_CMSG_FIRSTHDR(&m);
+    while (cmsg != NULL) {
+        if ((cmsg->cmsg_level == IPPROTO_IP) &&
+            (cmsg->cmsg_type == IP_PKTINFO)) {
+            pktinfo = (struct in_pktinfo*)WSA_CMSG_DATA(cmsg);
+
+            pkt->setIndex(pktinfo->ipi_ifindex);
+            pkt->setLocalAddr(IOAddress(htonl(pktinfo->ipi_addr.s_addr)));
+            return (true);
+
+            // This field is useful, when we are bound to unicast
+            // address e.g. 192.0.2.1 and the packet was sent to
+            // broadcast. This will return broadcast address, not
+            // the address we are bound to.
+
+            // IOAddress tmp(htonl(pktinfo->ipi_spec_dst.s_addr));
+            // cout << "The other addr is: " << tmp.toText() << endl;
+
+            // Perhaps we should uncomment this:
+            // to_addr = pktinfo->ipi_spec_dst;
+        }
+        cmsg = WSA_CMSG_NXTHDR(&m, cmsg);
+    }
+
+    return (false);
+}
+
+} // end of isc::dhcp namespace
+} // end of dhcp namespace
+
+#endif
diff --git a/src/lib/dhcp/libdhcp++.cc b/src/lib/dhcp/libdhcp++.cc
index c054a4b..29a2a0a 100644
--- a/src/lib/dhcp/libdhcp++.cc
+++ b/src/lib/dhcp/libdhcp++.cc
@@ -12,11 +12,14 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDHCP_EXPORT
+
+#include <config.h>
+
 #include <boost/shared_array.hpp>
 #include <boost/shared_ptr.hpp>
 #include <util/buffer.h>
 #include <dhcp/libdhcp++.h>
-#include "config.h"
 #include <dhcp/dhcp4.h>
 #include <dhcp/dhcp6.h>
 #include <dhcp/option.h>
diff --git a/src/lib/dhcp/libdhcp++.h b/src/lib/dhcp/libdhcp++.h
index c7935c8..1f72896 100644
--- a/src/lib/dhcp/libdhcp++.h
+++ b/src/lib/dhcp/libdhcp++.h
@@ -17,12 +17,13 @@
 
 #include <iostream>
 #include <util/buffer.h>
+#include <dhcp/dll.h>
 #include <dhcp/pkt6.h>
 
 namespace isc {
 namespace dhcp {
 
-class LibDHCP {
+class ISC_LIBDHCP_API LibDHCP {
 
 public:
     /// Builds collection of options.
diff --git a/src/lib/dhcp/option.cc b/src/lib/dhcp/option.cc
index 0c71606..ec62e51 100644
--- a/src/lib/dhcp/option.cc
+++ b/src/lib/dhcp/option.cc
@@ -12,9 +12,15 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDHCP_EXPORT
+
 #include <string.h>
 #include <stdint.h>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
 #include <sstream>
 #include <iomanip>
 #include "exceptions/exceptions.h"
diff --git a/src/lib/dhcp/option.h b/src/lib/dhcp/option.h
index 0662967..6c46a04 100644
--- a/src/lib/dhcp/option.h
+++ b/src/lib/dhcp/option.h
@@ -15,11 +15,13 @@
 #ifndef OPTION_H_
 #define OPTION_H_
 
+#include <stdint.h>
 #include <string>
 #include <map>
 #include <vector>
 #include <boost/shared_ptr.hpp>
 #include <util/buffer.h>
+#include <dhcp/dll.h>
 
 namespace isc {
 namespace dhcp {
@@ -39,11 +41,11 @@ typedef OptionBuffer::const_iterator OptionBufferConstIter;
 typedef boost::shared_ptr<OptionBuffer> OptionBufferPtr;
 
 /// shared pointer to Option object
-class Option;
+class ISC_LIBDHCP_API Option;
 typedef boost::shared_ptr<Option> OptionPtr;
 
 
-class Option {
+class ISC_LIBDHCP_API Option {
 public:
     /// length of the usual DHCPv4 option header (there are exceptions)
     const static size_t OPTION4_HDR_LEN = 2;
diff --git a/src/lib/dhcp/option4_addrlst.cc b/src/lib/dhcp/option4_addrlst.cc
index 4b0224f..41626af 100644
--- a/src/lib/dhcp/option4_addrlst.cc
+++ b/src/lib/dhcp/option4_addrlst.cc
@@ -12,9 +12,15 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDHCP_EXPORT
+
 #include <string.h>
 #include <stdint.h>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
 #include <sstream>
 #include <iomanip>
 #include <exceptions/exceptions.h>
diff --git a/src/lib/dhcp/option4_addrlst.h b/src/lib/dhcp/option4_addrlst.h
index 3bedc6d..082c2d6 100644
--- a/src/lib/dhcp/option4_addrlst.h
+++ b/src/lib/dhcp/option4_addrlst.h
@@ -21,6 +21,7 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/shared_array.hpp>
 #include <util/buffer.h>
+#include <dhcp/dll.h>
 #include <dhcp/option.h>
 
 namespace isc {
@@ -31,7 +32,7 @@ namespace dhcp {
 ///
 /// This class handles a list of IPv4 addresses. An example of such option
 /// is dns-servers option. It can also be used to handle a single address.
-class Option4AddrLst : public isc::dhcp::Option {
+class ISC_LIBDHCP_API Option4AddrLst : public isc::dhcp::Option {
 public:
 
     /// Defines a collection of IPv4 addresses.
diff --git a/src/lib/dhcp/option6_addrlst.cc b/src/lib/dhcp/option6_addrlst.cc
index d23b700..c94e2b5 100644
--- a/src/lib/dhcp/option6_addrlst.cc
+++ b/src/lib/dhcp/option6_addrlst.cc
@@ -12,8 +12,14 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDHCP_EXPORT
+
 #include <stdint.h>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
 #include <sstream>
 #include "exceptions/exceptions.h"
 
diff --git a/src/lib/dhcp/option6_addrlst.h b/src/lib/dhcp/option6_addrlst.h
index 209d2dd..d34eea7 100644
--- a/src/lib/dhcp/option6_addrlst.h
+++ b/src/lib/dhcp/option6_addrlst.h
@@ -17,6 +17,7 @@
 
 #include <vector>
 #include <asiolink/io_address.h>
+#include <dhcp/dll.h>
 #include <dhcp/option.h>
 
 namespace isc {
@@ -26,7 +27,7 @@ namespace dhcp {
 ///
 /// This class handles a list of IPv6 addresses. An example of such option
 /// is dns-servers option. It can also be used to handle single address.
-class Option6AddrLst: public Option {
+class ISC_LIBDHCP_API Option6AddrLst: public Option {
 
 public:
     /// a container for (IPv6) addresses
diff --git a/src/lib/dhcp/option6_ia.cc b/src/lib/dhcp/option6_ia.cc
index 65be711..2e55165 100644
--- a/src/lib/dhcp/option6_ia.cc
+++ b/src/lib/dhcp/option6_ia.cc
@@ -12,8 +12,14 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDHCP_EXPORT
+
 #include <stdint.h>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
 #include <sstream>
 
 #include <exceptions/exceptions.h>
diff --git a/src/lib/dhcp/option6_ia.h b/src/lib/dhcp/option6_ia.h
index c2089d4..d1bca1c 100644
--- a/src/lib/dhcp/option6_ia.h
+++ b/src/lib/dhcp/option6_ia.h
@@ -17,11 +17,12 @@
 
 #include <stdint.h>
 #include "option.h"
+#include <dhcp/dll.h>
 
 namespace isc {
 namespace dhcp {
 
-class Option6IA: public Option {
+class ISC_LIBDHCP_API Option6IA: public Option {
 
 public:
     /// Length of IA_NA and IA_PD content
diff --git a/src/lib/dhcp/option6_iaaddr.cc b/src/lib/dhcp/option6_iaaddr.cc
index 084a5f3..8e7ff6f 100644
--- a/src/lib/dhcp/option6_iaaddr.cc
+++ b/src/lib/dhcp/option6_iaaddr.cc
@@ -12,8 +12,14 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDHCP_EXPORT
+
 #include <stdint.h>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
 #include <sstream>
 #include "exceptions/exceptions.h"
 
diff --git a/src/lib/dhcp/option6_iaaddr.h b/src/lib/dhcp/option6_iaaddr.h
index e6e2c16..19a4da4 100644
--- a/src/lib/dhcp/option6_iaaddr.h
+++ b/src/lib/dhcp/option6_iaaddr.h
@@ -16,12 +16,13 @@
 #define OPTION6_IAADDR_H_
 
 #include "asiolink/io_address.h"
+#include <dhcp/dll.h>
 #include "dhcp/option.h"
 
 namespace isc {
 namespace dhcp {
 
-class Option6IAAddr: public Option {
+class ISC_LIBDHCP_API Option6IAAddr: public Option {
 
 public:
     /// length of the fixed part of the IAADDR option
diff --git a/src/lib/dhcp/pkt4.cc b/src/lib/dhcp/pkt4.cc
index 2c3f1eb..5171ff3 100644
--- a/src/lib/dhcp/pkt4.cc
+++ b/src/lib/dhcp/pkt4.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_LIBDHCP_EXPORT
+
+#include <config.h>
+
 #include <dhcp/pkt4.h>
 #include <dhcp/libdhcp++.h>
 #include <dhcp/dhcp4.h>
diff --git a/src/lib/dhcp/pkt4.h b/src/lib/dhcp/pkt4.h
index b72c03e..ac8b9a1 100644
--- a/src/lib/dhcp/pkt4.h
+++ b/src/lib/dhcp/pkt4.h
@@ -22,13 +22,14 @@
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include "asiolink/io_address.h"
 #include "util/buffer.h"
+#include <dhcp/dll.h>
 #include "dhcp/option.h"
 
 namespace isc {
 
 namespace dhcp {
 
-class Pkt4 {
+class ISC_LIBDHCP_API Pkt4 {
 public:
 
     /// length of the CHADDR field in DHCPv4 message
diff --git a/src/lib/dhcp/pkt6.cc b/src/lib/dhcp/pkt6.cc
index e869c7b..3e2d164 100644
--- a/src/lib/dhcp/pkt6.cc
+++ b/src/lib/dhcp/pkt6.cc
@@ -12,6 +12,9 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDHCP_EXPORT
+
+#include <config.h>
 
 #include <dhcp/dhcp6.h>
 #include <dhcp/pkt6.h>
diff --git a/src/lib/dhcp/pkt6.h b/src/lib/dhcp/pkt6.h
index 2612f27..46a3f77 100644
--- a/src/lib/dhcp/pkt6.h
+++ b/src/lib/dhcp/pkt6.h
@@ -21,13 +21,14 @@
 #include <boost/shared_array.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include "asiolink/io_address.h"
+#include <dhcp/dll.h>
 #include "dhcp/option.h"
 
 namespace isc {
 
 namespace dhcp {
 
-class Pkt6 {
+class ISC_LIBDHCP_API Pkt6 {
 public:
     /// specifes DHCPv6 packet header length
     const static size_t DHCPV6_PKT_HDR_LEN = 4;
diff --git a/src/lib/dhcp/tests/iface_mgr_unittest.cc b/src/lib/dhcp/tests/iface_mgr_unittest.cc
index e7ccb68..5afa943 100644
--- a/src/lib/dhcp/tests/iface_mgr_unittest.cc
+++ b/src/lib/dhcp/tests/iface_mgr_unittest.cc
@@ -17,8 +17,13 @@
 #include <fstream>
 #include <sstream>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#define unlink _unlink
+#else
 #include <unistd.h>
 #include <arpa/inet.h>
+#endif
 #include <gtest/gtest.h>
 
 #include <asiolink/io_address.h>
@@ -62,6 +67,7 @@ public:
 
 // NOTE: At this stage of development, write access to current directory
 // during running tests is required.
+#ifndef _WIN32
 TEST_F(IfaceMgrTest, loDetect) {
 
     // poor man's interface detection
@@ -79,6 +85,7 @@ TEST_F(IfaceMgrTest, loDetect) {
         FAIL();
     }
 }
+#endif
 
 // uncomment this test to create packet writer. It will
 // write incoming DHCPv6 packets as C arrays. That is useful
@@ -142,12 +149,14 @@ TEST_F(IfaceMgrTest, dhcp6Sniffer) {
 }
 #endif
 
+#if defined(OS_LINUX)
 TEST_F(IfaceMgrTest, basic) {
     // checks that IfaceManager can be instantiated
 
     IfaceMgr & ifacemgr = IfaceMgr::instance();
     ASSERT_TRUE(&ifacemgr != 0);
 }
+#endif
 
 TEST_F(IfaceMgrTest, ifaceClass) {
     // basic tests for Iface inner class
@@ -161,6 +170,7 @@ TEST_F(IfaceMgrTest, ifaceClass) {
 
 // TODO: Implement getPlainMac() test as soon as interface detection
 // is implemented.
+#if defined(OS_LINUX)
 TEST_F(IfaceMgrTest, getIface) {
 
     cout << "Interface checks. Please ignore socket binding errors." << endl;
@@ -223,20 +233,33 @@ TEST_F(IfaceMgrTest, sockets6) {
     pkt6.setIface(LOOPBACK);
 
     // bind multicast socket to port 10547
+#ifdef _WIN32
+    SOCKET socket1 = ifacemgr->openSocket(LOOPBACK, loAddr, 10547);
+#else
     int socket1 = ifacemgr->openSocket(LOOPBACK, loAddr, 10547);
-    EXPECT_GT(socket1, 0); // socket > 0
+#endif
+    EXPECT_NE(socket1, INVALID_SOCKET); // socket > 0
 
     EXPECT_EQ(socket1, ifacemgr->getSocket(pkt6));
 
     // bind unicast socket to port 10548
+#ifdef _WIN32
+    SOCKET socket2 = ifacemgr->openSocket(LOOPBACK, loAddr, 10548);
+#else
     int socket2 = ifacemgr->openSocket(LOOPBACK, loAddr, 10548);
-    EXPECT_GT(socket2, 0);
+#endif
+    EXPECT_NE(socket2, INVALID_SOCKET);
 
     // removed code for binding socket twice to the same address/port
     // as it caused problems on some platforms (e.g. Mac OS X)
 
+#ifdef _WIN32
+    closesocket(socket1);
+    closesocket(socket2);
+#else
     close(socket1);
     close(socket2);
+#endif
 
     delete ifacemgr;
 }
@@ -253,21 +276,34 @@ TEST_F(IfaceMgrTest, DISABLED_sockets6Mcast) {
     IOAddress mcastAddr("ff02::1:2");
 
     // bind multicast socket to port 10547
+#ifdef _WIN32
+    SOCKET socket1 = ifacemgr->openSocket(LOOPBACK, mcastAddr, 10547);
+#else
     int socket1 = ifacemgr->openSocket(LOOPBACK, mcastAddr, 10547);
-    EXPECT_GT(socket1, 0); // socket > 0
+#endif
+    EXPECT_NE(socket1, INVALID_SOCKET); // socket > 0
 
     // expect success. This address/port is already bound, but
     // we are using SO_REUSEADDR, so we can bind it twice
+#ifdef _WIN32
+    SOCKET socket2 = ifacemgr->openSocket(LOOPBACK, mcastAddr, 10547);
+#else
     int socket2 = ifacemgr->openSocket(LOOPBACK, mcastAddr, 10547);
-    EXPECT_GT(socket2, 0);
+#endif
+    EXPECT_NE(socket2, INVALID_SOCKET);
 
     // there's no good way to test negative case here.
     // we would need non-multicast interface. We will be able
     // to iterate thru available interfaces and check if there
     // are interfaces without multicast-capable flag.
 
+#ifdef _WIN32
+    closesocket(socket1);
+    closesocket(socket2);
+#else
     close(socket1);
     close(socket2);
+#endif
 
     delete ifacemgr;
 }
@@ -281,14 +317,18 @@ TEST_F(IfaceMgrTest, sendReceive6) {
 
     // let's assume that every supported OS have lo interface
     IOAddress loAddr("::1");
-    int socket1 = 0, socket2 = 0;
+#ifdef _WIN32
+    SOCKET socket1 = INVALID_SOCKET, socket2 = INVALID_SOCKET;
+#else
+    int socket1 = INVALID_SOCKET, socket2 = INVALID_SOCKET;
+#endif
     EXPECT_NO_THROW(
         socket1 = ifacemgr->openSocket(LOOPBACK, loAddr, 10547);
         socket2 = ifacemgr->openSocket(LOOPBACK, loAddr, 10546);
     );
 
-    EXPECT_GT(socket1, 0);
-    EXPECT_GT(socket2, 0);
+    EXPECT_NE(socket1, INVALID_SOCKET);
+    EXPECT_NE(socket2, INVALID_SOCKET);
 
 
     // prepare dummy payload
@@ -338,14 +378,18 @@ TEST_F(IfaceMgrTest, sendReceive4) {
 
     // let's assume that every supported OS have lo interface
     IOAddress loAddr("127.0.0.1");
-    int socket1 = 0, socket2 = 0;
+#ifdef _WIN32
+    SOCKET socket1 = INVALID_SOCKET, socket2 = INVALID_SOCKET;
+#else
+    int socket1 = INVALID_SOCKET, socket2 = INVALID_SOCKET;
+#endif
     EXPECT_NO_THROW(
         socket1 = ifacemgr->openSocket(LOOPBACK, loAddr, DHCP4_SERVER_PORT + 10000);
         socket2 = ifacemgr->openSocket(LOOPBACK, loAddr, DHCP4_SERVER_PORT + 10000 + 1);
     );
 
-    EXPECT_GE(socket1, 0);
-    EXPECT_GE(socket2, 0);
+    EXPECT_NE(socket1, INVALID_SOCKET);
+    EXPECT_NE(socket2, INVALID_SOCKET);
 
     boost::shared_ptr<Pkt4> sendPkt(new Pkt4(DHCPDISCOVER, 1234) );
 
@@ -428,13 +472,17 @@ TEST_F(IfaceMgrTest, socket4) {
     // Let's assume that every supported OS have lo interface.
     IOAddress loAddr("127.0.0.1");
     // Use unprivileged port (it's convenient for running tests as non-root).
-    int socket1 = 0;
+#ifdef _WIN32
+    SOCKET socket1 = INVALID_SOCKET;
+#else
+    int socket1 = INVALID_SOCKET;
+#endif
 
     EXPECT_NO_THROW(
         socket1 = ifacemgr->openSocket(LOOPBACK, loAddr, DHCP4_SERVER_PORT + 10000);
     );
 
-    EXPECT_GT(socket1, 0);
+    EXPECT_NE(socket1, INVALID_SOCKET);
 
     Pkt4 pkt(DHCPDISCOVER, 1234);
     pkt.setIface(LOOPBACK);
@@ -442,10 +490,15 @@ TEST_F(IfaceMgrTest, socket4) {
     // Expect that we get the socket that we just opened.
     EXPECT_EQ(socket1, ifacemgr->getSocket(pkt));
 
+#ifdef _WIN32
+    closesocket(socket1);
+#else
     close(socket1);
+#endif
 
     delete ifacemgr;
 }
+#endif
 
 // Test the Iface structure itself
 TEST_F(IfaceMgrTest, iface) {
@@ -521,6 +574,7 @@ TEST_F(IfaceMgrTest, iface_methods) {
     EXPECT_EQ(0, memcmp(mac, iface.getMac(), iface.getMacLen()));
 }
 
+#if defined(OS_LINUX)
 TEST_F(IfaceMgrTest, socketInfo) {
 
     // check that socketinfo for IPv4 socket is functional
@@ -540,7 +594,7 @@ TEST_F(IfaceMgrTest, socketInfo) {
     // now let's test if IfaceMgr handles socket info properly
     NakedIfaceMgr* ifacemgr = new NakedIfaceMgr();
     IfaceMgr::Iface* loopback = ifacemgr->getIface(LOOPBACK);
-    ASSERT_TRUE(loopback);
+    ASSERT_TRUE(loopback != NULL);
     loopback->addSocket(sock1);
     loopback->addSocket(sock2);
 
@@ -608,8 +662,6 @@ TEST_F(IfaceMgrTest, socketInfo) {
     delete ifacemgr;
 }
 
-#if defined(OS_LINUX)
-
 /// @brief parses text representation of MAC address
 ///
 /// This function parses text representation of a MAC address and stores
@@ -900,6 +952,7 @@ TEST_F(IfaceMgrTest, DISABLED_detectIfaces_linux) {
 }
 #endif
 
+#ifndef _WIN32
 volatile bool callback_ok;
 
 void my_callback(void) {
@@ -947,5 +1000,6 @@ TEST_F(IfaceMgrTest, controlSession) {
     close(pipefd[1]);
     close(pipefd[0]);
 }
+#endif
 
 }
diff --git a/src/lib/dhcp/tests/libdhcp++_unittest.cc b/src/lib/dhcp/tests/libdhcp++_unittest.cc
index 7e18be6..86f019e 100644
--- a/src/lib/dhcp/tests/libdhcp++_unittest.cc
+++ b/src/lib/dhcp/tests/libdhcp++_unittest.cc
@@ -15,11 +15,14 @@
 #include <config.h>
 #include <iostream>
 #include <sstream>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
 #include <gtest/gtest.h>
 #include <util/buffer.h>
 #include <dhcp/libdhcp++.h>
-#include "config.h"
 
 using namespace std;
 using namespace isc;
diff --git a/src/lib/dhcp/tests/option4_addrlst_unittest.cc b/src/lib/dhcp/tests/option4_addrlst_unittest.cc
index d4ecf80..f011140 100644
--- a/src/lib/dhcp/tests/option4_addrlst_unittest.cc
+++ b/src/lib/dhcp/tests/option4_addrlst_unittest.cc
@@ -15,7 +15,11 @@
 #include <config.h>
 #include <iostream>
 #include <sstream>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
 #include <gtest/gtest.h>
 #include <asiolink/io_address.h>
 #include <dhcp/dhcp4.h>
diff --git a/src/lib/dhcp/tests/option6_addrlst_unittest.cc b/src/lib/dhcp/tests/option6_addrlst_unittest.cc
index 89d4f7c..9aabe13 100644
--- a/src/lib/dhcp/tests/option6_addrlst_unittest.cc
+++ b/src/lib/dhcp/tests/option6_addrlst_unittest.cc
@@ -15,7 +15,11 @@
 #include <config.h>
 #include <iostream>
 #include <sstream>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
 #include <gtest/gtest.h>
 #include <asiolink/io_address.h>
 #include <dhcp/dhcp6.h>
diff --git a/src/lib/dhcp/tests/option6_ia_unittest.cc b/src/lib/dhcp/tests/option6_ia_unittest.cc
index 47af50e..cd561b3 100644
--- a/src/lib/dhcp/tests/option6_ia_unittest.cc
+++ b/src/lib/dhcp/tests/option6_ia_unittest.cc
@@ -16,7 +16,11 @@
 #include <iostream>
 #include <sstream>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
 #include <gtest/gtest.h>
 
 #include <dhcp/dhcp6.h>
@@ -206,7 +210,7 @@ TEST_F(Option6IATest, suboptions_unpack) {
     EXPECT_NO_THROW({
             ia = new Option6IA(D6O_IA_NA, buf_.begin() + 4, buf_.begin() + sizeof(expected));
     });
-    ASSERT_TRUE(ia);
+    ASSERT_TRUE(ia != NULL);
 
     EXPECT_EQ(D6O_IA_NA, ia->getType());
     EXPECT_EQ(0x13579ace, ia->getIAID());
diff --git a/src/lib/dhcp/tests/option6_iaaddr_unittest.cc b/src/lib/dhcp/tests/option6_iaaddr_unittest.cc
index e351d17..129b807 100644
--- a/src/lib/dhcp/tests/option6_iaaddr_unittest.cc
+++ b/src/lib/dhcp/tests/option6_iaaddr_unittest.cc
@@ -16,7 +16,11 @@
 #include <iostream>
 #include <sstream>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
 #include <gtest/gtest.h>
 
 #include <dhcp/dhcp6.h>
diff --git a/src/lib/dhcp/tests/option_unittest.cc b/src/lib/dhcp/tests/option_unittest.cc
index 9b046f0..f5e2256 100644
--- a/src/lib/dhcp/tests/option_unittest.cc
+++ b/src/lib/dhcp/tests/option_unittest.cc
@@ -16,7 +16,11 @@
 #include <iostream>
 #include <sstream>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
 #include <gtest/gtest.h>
 #include <boost/shared_ptr.hpp>
 #include <exceptions/exceptions.h>
diff --git a/src/lib/dhcp/tests/pkt4_unittest.cc b/src/lib/dhcp/tests/pkt4_unittest.cc
index 9c8cc05..18208bd 100644
--- a/src/lib/dhcp/tests/pkt4_unittest.cc
+++ b/src/lib/dhcp/tests/pkt4_unittest.cc
@@ -15,7 +15,11 @@
 #include <config.h>
 #include <iostream>
 #include <sstream>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
 #include <gtest/gtest.h>
 #include <boost/static_assert.hpp>
 #include <boost/shared_ptr.hpp>
diff --git a/src/lib/dhcp/tests/pkt6_unittest.cc b/src/lib/dhcp/tests/pkt6_unittest.cc
index d6ca9b1..cd6529a 100644
--- a/src/lib/dhcp/tests/pkt6_unittest.cc
+++ b/src/lib/dhcp/tests/pkt6_unittest.cc
@@ -15,7 +15,11 @@
 #include <config.h>
 #include <iostream>
 #include <sstream>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <gtest/gtest.h>
 
diff --git a/src/lib/dns/character_string.h b/src/lib/dns/character_string.h
index a3a7661..7b5fe4c 100644
--- a/src/lib/dns/character_string.h
+++ b/src/lib/dns/character_string.h
@@ -18,7 +18,7 @@
 #include <string>
 #include <exceptions/exceptions.h>
 #include <util/buffer.h>
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/dll.h b/src/lib/dns/dll.h
new file mode 100644
index 0000000..0d7e634
--- /dev/null
+++ b/src/lib/dns/dll.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 __LIBDNS_H
+#define __LIBDNS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBDNS_API
+#else
+#ifdef ISC_LIBDNS_EXPORT
+#define ISC_LIBDNS_API __declspec(dllexport)
+#else
+#define ISC_LIBDNS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBDNS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/dns/edns.h b/src/lib/dns/edns.h
index 2721801..6850067 100644
--- a/src/lib/dns/edns.h
+++ b/src/lib/dns/edns.h
@@ -21,7 +21,7 @@
 
 #include <ostream>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 namespace isc {
diff --git a/src/lib/dns/exceptions.h b/src/lib/dns/exceptions.h
index af43602..1662b9e 100644
--- a/src/lib/dns/exceptions.h
+++ b/src/lib/dns/exceptions.h
@@ -21,7 +21,7 @@
 #define __DNS_EXCEPTIONS_H 1
 
 #include <exceptions/exceptions.h>
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/labelsequence.h b/src/lib/dns/labelsequence.h
index 325ce30..ccd9f79 100644
--- a/src/lib/dns/labelsequence.h
+++ b/src/lib/dns/labelsequence.h
@@ -15,7 +15,7 @@
 #ifndef __LABELSEQUENCE_H
 #define __LABELSEQUENCE_H 1
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <util/buffer.h>
 
diff --git a/src/lib/dns/masterload.h b/src/lib/dns/masterload.h
index 864d58a..0d43728 100644
--- a/src/lib/dns/masterload.h
+++ b/src/lib/dns/masterload.h
@@ -21,7 +21,7 @@
 
 #include <exceptions/exceptions.h>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rrset.h>
 
 namespace isc {
diff --git a/src/lib/dns/message.h b/src/lib/dns/message.h
index 8e12186..f0525f7 100644
--- a/src/lib/dns/message.h
+++ b/src/lib/dns/message.h
@@ -23,7 +23,7 @@
 
 #include <exceptions/exceptions.h>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/edns.h>
 #include <dns/question.h>
 #include <dns/rrset.h>
diff --git a/src/lib/dns/messagerenderer.h b/src/lib/dns/messagerenderer.h
index 7ec09e2..4cb04ff 100644
--- a/src/lib/dns/messagerenderer.h
+++ b/src/lib/dns/messagerenderer.h
@@ -16,7 +16,7 @@
 #define __MESSAGERENDERER_H 1
 
 #include <util/buffer.h>
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 namespace isc {
 
diff --git a/src/lib/dns/name.h b/src/lib/dns/name.h
index eb4f18d..f8866f5 100644
--- a/src/lib/dns/name.h
+++ b/src/lib/dns/name.h
@@ -21,7 +21,7 @@
 #include <vector>
 
 #include <exceptions/exceptions.h>
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/dns/nsec3hash.h b/src/lib/dns/nsec3hash.h
index cacf1c0..a2ad06c 100644
--- a/src/lib/dns/nsec3hash.h
+++ b/src/lib/dns/nsec3hash.h
@@ -18,7 +18,7 @@
 #include <string>
 
 #include <exceptions/exceptions.h>
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/opcode.h b/src/lib/dns/opcode.h
index bd075ff..00ebe77 100644
--- a/src/lib/dns/opcode.h
+++ b/src/lib/dns/opcode.h
@@ -21,7 +21,7 @@
 
 #include <ostream>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/dll.h b/src/lib/dns/python/dll.h
new file mode 100644
index 0000000..53352e6
--- /dev/null
+++ b/src/lib/dns/python/dll.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 __LIBDNS_PYTHON_H
+#define __LIBDNS_PYTHON_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBDNS_PYTHON_API
+#else
+#ifdef ISC_LIBDNS_PYTHON_EXPORT
+#define ISC_LIBDNS_PYTHON_API __declspec(dllexport)
+#else
+#define ISC_LIBDNS_PYTHON_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBDNS_PYTHON_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/dns/python/edns_python.h b/src/lib/dns/python/edns_python.h
index 19c4c97..e612a5f 100644
--- a/src/lib/dns/python/edns_python.h
+++ b/src/lib/dns/python/edns_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/message_python.h b/src/lib/dns/python/message_python.h
index a678dd1..370d216 100644
--- a/src/lib/dns/python/message_python.h
+++ b/src/lib/dns/python/message_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/messagerenderer_python.h b/src/lib/dns/python/messagerenderer_python.h
index 6f4207f..5d1586b 100644
--- a/src/lib/dns/python/messagerenderer_python.h
+++ b/src/lib/dns/python/messagerenderer_python.h
@@ -18,7 +18,7 @@
 #include <Python.h>
 
 #include <util/buffer.h>
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/name_python.h b/src/lib/dns/python/name_python.h
index 7ff163d..066c8ae 100644
--- a/src/lib/dns/python/name_python.h
+++ b/src/lib/dns/python/name_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/nsec3hash_python.h b/src/lib/dns/python/nsec3hash_python.h
index c4e435b..29abaa0 100644
--- a/src/lib/dns/python/nsec3hash_python.h
+++ b/src/lib/dns/python/nsec3hash_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/opcode_python.h b/src/lib/dns/python/opcode_python.h
index 8625298..d1efefa 100644
--- a/src/lib/dns/python/opcode_python.h
+++ b/src/lib/dns/python/opcode_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/pydnspp_common.cc b/src/lib/dns/python/pydnspp_common.cc
index 0e9cd5a..32da3c4 100644
--- a/src/lib/dns/python/pydnspp_common.cc
+++ b/src/lib/dns/python/pydnspp_common.cc
@@ -20,7 +20,7 @@
 
 #include <util/buffer.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 #include <dns/exceptions.h>
 #include <dns/name.h>
 #include <dns/messagerenderer.h>
diff --git a/src/lib/dns/python/pydnspp_common.h b/src/lib/dns/python/pydnspp_common.h
index ba6fdbd..fec8ae8 100644
--- a/src/lib/dns/python/pydnspp_common.h
+++ b/src/lib/dns/python/pydnspp_common.h
@@ -20,7 +20,7 @@
 #include <stdexcept>
 #include <string>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/pydnspp_towire.h b/src/lib/dns/python/pydnspp_towire.h
index 67802c4..52c9655 100644
--- a/src/lib/dns/python/pydnspp_towire.h
+++ b/src/lib/dns/python/pydnspp_towire.h
@@ -20,7 +20,7 @@
 #include <stdexcept>
 #include <string>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 #include <dns/messagerenderer.h>
 
 #include <util/buffer.h>
diff --git a/src/lib/dns/python/question_python.h b/src/lib/dns/python/question_python.h
index d8de92e..1dcbae1 100644
--- a/src/lib/dns/python/question_python.h
+++ b/src/lib/dns/python/question_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/rcode_python.h b/src/lib/dns/python/rcode_python.h
index e90e8ff..51b805f 100644
--- a/src/lib/dns/python/rcode_python.h
+++ b/src/lib/dns/python/rcode_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/rdata_python.h b/src/lib/dns/python/rdata_python.h
index fe11fe6..8688cc8 100644
--- a/src/lib/dns/python/rdata_python.h
+++ b/src/lib/dns/python/rdata_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 #include <dns/rdata.h>
 
 namespace isc {
diff --git a/src/lib/dns/python/rrclass_python.h b/src/lib/dns/python/rrclass_python.h
index d246a8d..d71aa97 100644
--- a/src/lib/dns/python/rrclass_python.h
+++ b/src/lib/dns/python/rrclass_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/rrset_python.h b/src/lib/dns/python/rrset_python.h
index 638b08b..f32d2b1 100644
--- a/src/lib/dns/python/rrset_python.h
+++ b/src/lib/dns/python/rrset_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 #include <dns/rrset.h>
 
 #include <util/python/pycppwrapper_util.h>
diff --git a/src/lib/dns/python/rrttl_python.h b/src/lib/dns/python/rrttl_python.h
index 74fc864..3683a89 100644
--- a/src/lib/dns/python/rrttl_python.h
+++ b/src/lib/dns/python/rrttl_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/rrtype_python.h b/src/lib/dns/python/rrtype_python.h
index 6683b56..01b4e20 100644
--- a/src/lib/dns/python/rrtype_python.h
+++ b/src/lib/dns/python/rrtype_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/serial_python.h b/src/lib/dns/python/serial_python.h
index a4658a0..22ee3eb 100644
--- a/src/lib/dns/python/serial_python.h
+++ b/src/lib/dns/python/serial_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/tsig_python.h b/src/lib/dns/python/tsig_python.h
index 0fd5f3d..455df3a 100644
--- a/src/lib/dns/python/tsig_python.h
+++ b/src/lib/dns/python/tsig_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/tsig_rdata_python.h b/src/lib/dns/python/tsig_rdata_python.h
index ffdc3d7..31df6d0 100644
--- a/src/lib/dns/python/tsig_rdata_python.h
+++ b/src/lib/dns/python/tsig_rdata_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/tsigerror_python.h b/src/lib/dns/python/tsigerror_python.h
index 08bb9f5..3622d33 100644
--- a/src/lib/dns/python/tsigerror_python.h
+++ b/src/lib/dns/python/tsigerror_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/tsigkey_python.h b/src/lib/dns/python/tsigkey_python.h
index 358852d..07a40a0 100644
--- a/src/lib/dns/python/tsigkey_python.h
+++ b/src/lib/dns/python/tsigkey_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/python/tsigrecord_python.h b/src/lib/dns/python/tsigrecord_python.h
index 819d7fd..892d127 100644
--- a/src/lib/dns/python/tsigrecord_python.h
+++ b/src/lib/dns/python/tsigrecord_python.h
@@ -17,7 +17,7 @@
 
 #include <Python.h>
 
-#include <dns/python/lib.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/question.h b/src/lib/dns/question.h
index 83db42f..813f333 100644
--- a/src/lib/dns/question.h
+++ b/src/lib/dns/question.h
@@ -20,7 +20,7 @@
 
 #include <boost/shared_ptr.hpp>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrclass.h>
 #include <dns/rrtype.h>
diff --git a/src/lib/dns/rcode.h b/src/lib/dns/rcode.h
index 722894b..e01e141 100644
--- a/src/lib/dns/rcode.h
+++ b/src/lib/dns/rcode.h
@@ -21,7 +21,7 @@
 
 #include <ostream>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 #if defined(_WIN32) && defined(NOERROR)
 #undef NOERROR
diff --git a/src/lib/dns/rdata.h b/src/lib/dns/rdata.h
index 910f49c..7a771f0 100644
--- a/src/lib/dns/rdata.h
+++ b/src/lib/dns/rdata.h
@@ -20,7 +20,7 @@
 #include <boost/shared_ptr.hpp>
 
 #include <exceptions/exceptions.h>
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/dns/rdata/any_255/tsig_250.h b/src/lib/dns/rdata/any_255/tsig_250.h
index 4e56dd3..6b93fcd 100644
--- a/src/lib/dns/rdata/any_255/tsig_250.h
+++ b/src/lib/dns/rdata/any_255/tsig_250.h
@@ -18,7 +18,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 namespace isc {
diff --git a/src/lib/dns/rdata/ch_3/a_1.h b/src/lib/dns/rdata/ch_3/a_1.h
index fbfb926..15881d1 100644
--- a/src/lib/dns/rdata/ch_3/a_1.h
+++ b/src/lib/dns/rdata/ch_3/a_1.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
diff --git a/src/lib/dns/rdata/generic/afsdb_18.h b/src/lib/dns/rdata/generic/afsdb_18.h
index 2055e1f..35778a9 100644
--- a/src/lib/dns/rdata/generic/afsdb_18.h
+++ b/src/lib/dns/rdata/generic/afsdb_18.h
@@ -18,7 +18,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
diff --git a/src/lib/dns/rdata/generic/cname_5.h b/src/lib/dns/rdata/generic/cname_5.h
index 457940e..09f6b67 100644
--- a/src/lib/dns/rdata/generic/cname_5.h
+++ b/src/lib/dns/rdata/generic/cname_5.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
diff --git a/src/lib/dns/rdata/generic/detail/ds_like.h b/src/lib/dns/rdata/generic/detail/ds_like.h
index 3231054..09ad27d 100644
--- a/src/lib/dns/rdata/generic/detail/ds_like.h
+++ b/src/lib/dns/rdata/generic/detail/ds_like.h
@@ -26,7 +26,7 @@
 
 #include <exceptions/exceptions.h>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/messagerenderer.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
diff --git a/src/lib/dns/rdata/generic/detail/nsec3param_common.h b/src/lib/dns/rdata/generic/detail/nsec3param_common.h
index 0b2ded6..50ba4d6 100644
--- a/src/lib/dns/rdata/generic/detail/nsec3param_common.h
+++ b/src/lib/dns/rdata/generic/detail/nsec3param_common.h
@@ -16,7 +16,7 @@
 #define __NSEC3PARAM_COMMON_H 1
 
 #include <util/buffer.h>
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 #include <stdint.h>
 
diff --git a/src/lib/dns/rdata/generic/detail/nsec_bitmap.h b/src/lib/dns/rdata/generic/detail/nsec_bitmap.h
index 2c3fcd1..41532b9 100644
--- a/src/lib/dns/rdata/generic/detail/nsec_bitmap.h
+++ b/src/lib/dns/rdata/generic/detail/nsec_bitmap.h
@@ -20,7 +20,7 @@
 #include <sstream>
 #include <vector>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/rdata/generic/detail/txt_like.h b/src/lib/dns/rdata/generic/detail/txt_like.h
index f3e7699..edbd92e 100644
--- a/src/lib/dns/rdata/generic/detail/txt_like.h
+++ b/src/lib/dns/rdata/generic/detail/txt_like.h
@@ -20,7 +20,7 @@
 #include <string>
 #include <vector>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 using namespace std;
 using namespace isc::util;
diff --git a/src/lib/dns/rdata/generic/dlv_32769.h b/src/lib/dns/rdata/generic/dlv_32769.h
index e181bd8..f9bb6a5 100644
--- a/src/lib/dns/rdata/generic/dlv_32769.h
+++ b/src/lib/dns/rdata/generic/dlv_32769.h
@@ -18,7 +18,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
diff --git a/src/lib/dns/rdata/generic/dname_39.h b/src/lib/dns/rdata/generic/dname_39.h
index 6c31beb..1de1d9f 100644
--- a/src/lib/dns/rdata/generic/dname_39.h
+++ b/src/lib/dns/rdata/generic/dname_39.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
diff --git a/src/lib/dns/rdata/generic/dnskey_48.h b/src/lib/dns/rdata/generic/dnskey_48.h
index 3b0d946..f431825 100644
--- a/src/lib/dns/rdata/generic/dnskey_48.h
+++ b/src/lib/dns/rdata/generic/dnskey_48.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
diff --git a/src/lib/dns/rdata/generic/ds_43.h b/src/lib/dns/rdata/generic/ds_43.h
index a976bc6..06da2a9 100644
--- a/src/lib/dns/rdata/generic/ds_43.h
+++ b/src/lib/dns/rdata/generic/ds_43.h
@@ -18,7 +18,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
diff --git a/src/lib/dns/rdata/generic/hinfo_13.h b/src/lib/dns/rdata/generic/hinfo_13.h
index a9c2b71..d2a7080 100644
--- a/src/lib/dns/rdata/generic/hinfo_13.h
+++ b/src/lib/dns/rdata/generic/hinfo_13.h
@@ -17,7 +17,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 #include <util/buffer.h>
diff --git a/src/lib/dns/rdata/generic/minfo_14.h b/src/lib/dns/rdata/generic/minfo_14.h
index 2125636..f29850b 100644
--- a/src/lib/dns/rdata/generic/minfo_14.h
+++ b/src/lib/dns/rdata/generic/minfo_14.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
diff --git a/src/lib/dns/rdata/generic/mx_15.h b/src/lib/dns/rdata/generic/mx_15.h
index bcf3bd8..12b8b03 100644
--- a/src/lib/dns/rdata/generic/mx_15.h
+++ b/src/lib/dns/rdata/generic/mx_15.h
@@ -18,7 +18,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
diff --git a/src/lib/dns/rdata/generic/naptr_35.h b/src/lib/dns/rdata/generic/naptr_35.h
index 2b8a201..c999585 100644
--- a/src/lib/dns/rdata/generic/naptr_35.h
+++ b/src/lib/dns/rdata/generic/naptr_35.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 #include <util/buffer.h>
diff --git a/src/lib/dns/rdata/generic/ns_2.h b/src/lib/dns/rdata/generic/ns_2.h
index 33b1f96..fe84249 100644
--- a/src/lib/dns/rdata/generic/ns_2.h
+++ b/src/lib/dns/rdata/generic/ns_2.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
diff --git a/src/lib/dns/rdata/generic/nsec3_50.h b/src/lib/dns/rdata/generic/nsec3_50.h
index ae773c8..298ff4f 100644
--- a/src/lib/dns/rdata/generic/nsec3_50.h
+++ b/src/lib/dns/rdata/generic/nsec3_50.h
@@ -17,7 +17,7 @@
 #include <string>
 #include <vector>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
diff --git a/src/lib/dns/rdata/generic/nsec3param_51.h b/src/lib/dns/rdata/generic/nsec3param_51.h
index 81eb448..171e285 100644
--- a/src/lib/dns/rdata/generic/nsec3param_51.h
+++ b/src/lib/dns/rdata/generic/nsec3param_51.h
@@ -17,7 +17,7 @@
 #include <string>
 #include <vector>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
diff --git a/src/lib/dns/rdata/generic/nsec_47.h b/src/lib/dns/rdata/generic/nsec_47.h
index 3fe239f..68cc749 100644
--- a/src/lib/dns/rdata/generic/nsec_47.h
+++ b/src/lib/dns/rdata/generic/nsec_47.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
diff --git a/src/lib/dns/rdata/generic/opt_41.h b/src/lib/dns/rdata/generic/opt_41.h
index 454a9e6..c231c89 100644
--- a/src/lib/dns/rdata/generic/opt_41.h
+++ b/src/lib/dns/rdata/generic/opt_41.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
diff --git a/src/lib/dns/rdata/generic/ptr_12.h b/src/lib/dns/rdata/generic/ptr_12.h
index acd70a2..41b451d 100644
--- a/src/lib/dns/rdata/generic/ptr_12.h
+++ b/src/lib/dns/rdata/generic/ptr_12.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
diff --git a/src/lib/dns/rdata/generic/rp_17.h b/src/lib/dns/rdata/generic/rp_17.h
index ee40dfe..6bdfc18 100644
--- a/src/lib/dns/rdata/generic/rp_17.h
+++ b/src/lib/dns/rdata/generic/rp_17.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
diff --git a/src/lib/dns/rdata/generic/rrsig_46.h b/src/lib/dns/rdata/generic/rrsig_46.h
index 8e49e61..9d12054 100644
--- a/src/lib/dns/rdata/generic/rrsig_46.h
+++ b/src/lib/dns/rdata/generic/rrsig_46.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
diff --git a/src/lib/dns/rdata/generic/soa_6.h b/src/lib/dns/rdata/generic/soa_6.h
index 9f601e4..b74cce8 100644
--- a/src/lib/dns/rdata/generic/soa_6.h
+++ b/src/lib/dns/rdata/generic/soa_6.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 #include <dns/serial.h>
diff --git a/src/lib/dns/rdata/generic/spf_99.h b/src/lib/dns/rdata/generic/spf_99.h
index 3a9a02e..096131a 100644
--- a/src/lib/dns/rdata/generic/spf_99.h
+++ b/src/lib/dns/rdata/generic/spf_99.h
@@ -19,7 +19,7 @@
 #include <string>
 #include <vector>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
diff --git a/src/lib/dns/rdata/generic/sshfp_44.h b/src/lib/dns/rdata/generic/sshfp_44.h
index 69f5e07..d6134b7 100644
--- a/src/lib/dns/rdata/generic/sshfp_44.h
+++ b/src/lib/dns/rdata/generic/sshfp_44.h
@@ -18,7 +18,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
diff --git a/src/lib/dns/rdata/generic/txt_16.h b/src/lib/dns/rdata/generic/txt_16.h
index 713837a..a59354d 100644
--- a/src/lib/dns/rdata/generic/txt_16.h
+++ b/src/lib/dns/rdata/generic/txt_16.h
@@ -19,7 +19,7 @@
 #include <string>
 #include <vector>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
diff --git a/src/lib/dns/rdata/hs_4/a_1.h b/src/lib/dns/rdata/hs_4/a_1.h
index fbfb926..15881d1 100644
--- a/src/lib/dns/rdata/hs_4/a_1.h
+++ b/src/lib/dns/rdata/hs_4/a_1.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
diff --git a/src/lib/dns/rdata/in_1/a_1.h b/src/lib/dns/rdata/in_1/a_1.h
index 1125a62..347a668 100644
--- a/src/lib/dns/rdata/in_1/a_1.h
+++ b/src/lib/dns/rdata/in_1/a_1.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
diff --git a/src/lib/dns/rdata/in_1/aaaa_28.h b/src/lib/dns/rdata/in_1/aaaa_28.h
index afea13c..975964a 100644
--- a/src/lib/dns/rdata/in_1/aaaa_28.h
+++ b/src/lib/dns/rdata/in_1/aaaa_28.h
@@ -18,7 +18,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
diff --git a/src/lib/dns/rdata/in_1/dhcid_49.h b/src/lib/dns/rdata/in_1/dhcid_49.h
index 564d8f1..b90991d 100644
--- a/src/lib/dns/rdata/in_1/dhcid_49.h
+++ b/src/lib/dns/rdata/in_1/dhcid_49.h
@@ -17,7 +17,7 @@
 #include <string>
 #include <vector>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
diff --git a/src/lib/dns/rdata/in_1/srv_33.h b/src/lib/dns/rdata/in_1/srv_33.h
index 598163a..7639154 100644
--- a/src/lib/dns/rdata/in_1/srv_33.h
+++ b/src/lib/dns/rdata/in_1/srv_33.h
@@ -16,7 +16,7 @@
 
 #include <stdint.h>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
diff --git a/src/lib/dns/rdata/template.h b/src/lib/dns/rdata/template.h
index 3889657..5ee9453 100644
--- a/src/lib/dns/rdata/template.h
+++ b/src/lib/dns/rdata/template.h
@@ -16,7 +16,7 @@
 
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
diff --git a/src/lib/dns/rdatafields.h b/src/lib/dns/rdatafields.h
index d4024bf..b4a7aef 100644
--- a/src/lib/dns/rdatafields.h
+++ b/src/lib/dns/rdatafields.h
@@ -19,7 +19,7 @@
 
 #include <cstddef>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/dns/rrclass-placeholder.h b/src/lib/dns/rrclass-placeholder.h
index 77fb590..e1b04d2 100644
--- a/src/lib/dns/rrclass-placeholder.h
+++ b/src/lib/dns/rrclass-placeholder.h
@@ -21,7 +21,7 @@
 #include <ostream>
 
 #include <exceptions/exceptions.h>
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 #if defined(_WIN32) && defined(IN)
 #undef IN
diff --git a/src/lib/dns/rrparamregistry.h b/src/lib/dns/rrparamregistry.h
index ae84274..4468798 100644
--- a/src/lib/dns/rrparamregistry.h
+++ b/src/lib/dns/rrparamregistry.h
@@ -23,7 +23,7 @@
 
 #include <exceptions/exceptions.h>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 namespace isc {
diff --git a/src/lib/dns/rrset.h b/src/lib/dns/rrset.h
index 8b0bffb..ae275cb 100644
--- a/src/lib/dns/rrset.h
+++ b/src/lib/dns/rrset.h
@@ -22,7 +22,7 @@
 
 #include <exceptions/exceptions.h>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rdata.h>
 #include <dns/rrtype.h>
 
diff --git a/src/lib/dns/rrsetlist.h b/src/lib/dns/rrsetlist.h
index 4bdcf67..6e5f64a 100644
--- a/src/lib/dns/rrsetlist.h
+++ b/src/lib/dns/rrsetlist.h
@@ -21,7 +21,7 @@
 
 #include <boost/shared_ptr.hpp>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rrset.h>
 #include <dns/rrclass.h>
 #include <dns/rrtype.h>
diff --git a/src/lib/dns/rrttl.h b/src/lib/dns/rrttl.h
index fe44610..386ba7e 100644
--- a/src/lib/dns/rrttl.h
+++ b/src/lib/dns/rrttl.h
@@ -18,7 +18,7 @@
 #include <stdint.h>
 
 #include <exceptions/exceptions.h>
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/dns/rrtype-placeholder.h b/src/lib/dns/rrtype-placeholder.h
index 1f74a5e..e437cad 100644
--- a/src/lib/dns/rrtype-placeholder.h
+++ b/src/lib/dns/rrtype-placeholder.h
@@ -21,7 +21,7 @@
 #include <ostream>
 
 #include <exceptions/exceptions.h>
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 // Solaris x86 defines DS in <sys/regset.h>, which gets pulled in by Boost
 #if defined(__sun) && defined(DS)
diff --git a/src/lib/dns/serial.h b/src/lib/dns/serial.h
index 7f1e3b4..34ce2bf 100644
--- a/src/lib/dns/serial.h
+++ b/src/lib/dns/serial.h
@@ -18,7 +18,7 @@
 #include <stdint.h>
 #include <iostream>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/tsig.h b/src/lib/dns/tsig.h
index 3a68b2f..0d8b187 100644
--- a/src/lib/dns/tsig.h
+++ b/src/lib/dns/tsig.h
@@ -19,7 +19,7 @@
 
 #include <exceptions/exceptions.h>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/tsigerror.h>
 #include <dns/tsigkey.h>
 #include <dns/tsigrecord.h>
diff --git a/src/lib/dns/tsigerror.h b/src/lib/dns/tsigerror.h
index 3eb322d..50b7f4c 100644
--- a/src/lib/dns/tsigerror.h
+++ b/src/lib/dns/tsigerror.h
@@ -18,7 +18,7 @@
 #include <ostream>
 #include <string>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/rcode.h>
 
 namespace isc {
diff --git a/src/lib/dns/tsigkey.h b/src/lib/dns/tsigkey.h
index de4c625..6bd687f 100644
--- a/src/lib/dns/tsigkey.h
+++ b/src/lib/dns/tsigkey.h
@@ -16,7 +16,7 @@
 #define __TSIGKEY_H 1
 
 #include <cryptolink/cryptolink.h>
-#include <dns/lib.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace dns {
diff --git a/src/lib/dns/tsigrecord.h b/src/lib/dns/tsigrecord.h
index bfbf988..31ad413 100644
--- a/src/lib/dns/tsigrecord.h
+++ b/src/lib/dns/tsigrecord.h
@@ -22,7 +22,7 @@
 
 #include <util/buffer.h>
 
-#include <dns/lib.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdataclass.h>
 
diff --git a/src/lib/log/dll.h b/src/lib/log/dll.h
new file mode 100644
index 0000000..7b99393
--- /dev/null
+++ b/src/lib/log/dll.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 __LIBLOG_H
+#define __LIBLOG_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBLOG_API
+#else
+#ifdef ISC_LIBLOG_EXPORT
+#define ISC_LIBLOG_API __declspec(dllexport)
+#else
+#define ISC_LIBLOG_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBLOG_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/log/dummylog.h b/src/lib/log/dummylog.h
index 6315617..de1bca7 100644
--- a/src/lib/log/dummylog.h
+++ b/src/lib/log/dummylog.h
@@ -16,7 +16,7 @@
 #define _ISC_DUMMYLOG_H 1
 
 #include <string>
-#include <log/lib.h>
+#include <log/dll.h>
 
 namespace isc {
 namespace log {
diff --git a/src/lib/log/log_dbglevels.h b/src/lib/log/log_dbglevels.h
index 3491c61..b81f144 100644
--- a/src/lib/log/log_dbglevels.h
+++ b/src/lib/log/log_dbglevels.h
@@ -15,7 +15,7 @@
 #ifndef __LOG_DBGLVLS_H
 #define __LOG_DBGLVLS_H
 
-#include <log/lib.h>
+#include <log/dll.h>
 
 /// \file
 ///
diff --git a/src/lib/log/log_formatter.h b/src/lib/log/log_formatter.h
index 99617e3..3d8447a 100644
--- a/src/lib/log/log_formatter.h
+++ b/src/lib/log/log_formatter.h
@@ -21,7 +21,7 @@
 
 #include <exceptions/exceptions.h>
 #include <boost/lexical_cast.hpp>
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/logger_level.h>
 
 namespace isc {
diff --git a/src/lib/log/log_messages.h b/src/lib/log/log_messages.h
index 5cea77d..1e50ad5 100644
--- a/src/lib/log/log_messages.h
+++ b/src/lib/log/log_messages.h
@@ -3,7 +3,7 @@
 #ifndef __LOG_MESSAGES_H
 #define __LOG_MESSAGES_H
 
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/message_types.h>
 
 namespace isc {
diff --git a/src/lib/log/logger.h b/src/lib/log/logger.h
index 869991d..4f7bfd1 100644
--- a/src/lib/log/logger.h
+++ b/src/lib/log/logger.h
@@ -21,7 +21,7 @@
 #include <cstring>
 
 #include <exceptions/exceptions.h>
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/logger_level.h>
 #include <log/message_types.h>
 #include <log/log_formatter.h>
diff --git a/src/lib/log/logger_impl.h b/src/lib/log/logger_impl.h
index f73b09c..e15465f 100644
--- a/src/lib/log/logger_impl.h
+++ b/src/lib/log/logger_impl.h
@@ -24,7 +24,7 @@
 #include <map>
 #include <utility>
 
-#include <log/lib.h>
+#include <log/dll.h>
 
 // log4cplus logger header file
 #include <log4cplus/logger.h>
diff --git a/src/lib/log/logger_level.h b/src/lib/log/logger_level.h
index 986e480..6daea87 100644
--- a/src/lib/log/logger_level.h
+++ b/src/lib/log/logger_level.h
@@ -16,7 +16,7 @@
 #define __LOGGER_LEVEL_H
 
 #include <string>
-#include <log/lib.h>
+#include <log/dll.h>
 
 namespace isc {
 namespace log {
diff --git a/src/lib/log/logger_level_impl.h b/src/lib/log/logger_level_impl.h
index 30c0f8d..b402e74 100644
--- a/src/lib/log/logger_level_impl.h
+++ b/src/lib/log/logger_level_impl.h
@@ -16,7 +16,7 @@
 #define __LOGGER_LEVEL_IMPL_H
 
 #include <log4cplus/logger.h>
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/logger_level.h>
 
 namespace isc {
diff --git a/src/lib/log/logger_manager.h b/src/lib/log/logger_manager.h
index 28c50ff..9448136 100644
--- a/src/lib/log/logger_manager.h
+++ b/src/lib/log/logger_manager.h
@@ -16,7 +16,7 @@
 #define __LOGGER_MANAGER_H
 
 #include "exceptions/exceptions.h"
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/logger_specification.h>
 
 // Generated if, when updating the logging specification, an unknown
diff --git a/src/lib/log/logger_manager_impl.h b/src/lib/log/logger_manager_impl.h
index 9040029..c088bff 100644
--- a/src/lib/log/logger_manager_impl.h
+++ b/src/lib/log/logger_manager_impl.h
@@ -18,7 +18,7 @@
 #include <string>
 
 #include <log4cplus/appender.h>
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/logger_level.h>
 
 // Forward declaration to avoid need to include log4cplus header file here.
diff --git a/src/lib/log/logger_name.h b/src/lib/log/logger_name.h
index 180e358..b8763ac 100644
--- a/src/lib/log/logger_name.h
+++ b/src/lib/log/logger_name.h
@@ -16,7 +16,7 @@
 #define __LOGGER_NAME_H
 
 #include <string>
-#include <log/lib.h>
+#include <log/dll.h>
 
 /// \brief Define Name of Root Logger
 ///
diff --git a/src/lib/log/logger_specification.h b/src/lib/log/logger_specification.h
index 9dfd5b2..856a380 100644
--- a/src/lib/log/logger_specification.h
+++ b/src/lib/log/logger_specification.h
@@ -18,7 +18,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/logger_level.h>
 #include <log/output_option.h>
 
diff --git a/src/lib/log/logger_support.h b/src/lib/log/logger_support.h
index fb1ad55..4dd2846 100644
--- a/src/lib/log/logger_support.h
+++ b/src/lib/log/logger_support.h
@@ -20,7 +20,7 @@
 #endif
 
 #include <string>
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/logger.h>
 #include <log/logger_unittest_support.h>
 
diff --git a/src/lib/log/logger_unittest_support.h b/src/lib/log/logger_unittest_support.h
index f2b695b..697a606 100644
--- a/src/lib/log/logger_unittest_support.h
+++ b/src/lib/log/logger_unittest_support.h
@@ -16,7 +16,7 @@
 #define __LOGGER_UNITTEST_SUPPORT_H
 
 #include <string>
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/logger.h>
 
 /// \file
diff --git a/src/lib/log/logimpl_messages.h b/src/lib/log/logimpl_messages.h
index f4cd59d..452c67c 100644
--- a/src/lib/log/logimpl_messages.h
+++ b/src/lib/log/logimpl_messages.h
@@ -3,7 +3,7 @@
 #ifndef __LOGIMPL_MESSAGES_H
 #define __LOGIMPL_MESSAGES_H
 
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/message_types.h>
 
 namespace isc {
diff --git a/src/lib/log/message_dictionary.h b/src/lib/log/message_dictionary.h
index b10931b..e469568 100644
--- a/src/lib/log/message_dictionary.h
+++ b/src/lib/log/message_dictionary.h
@@ -22,7 +22,7 @@
 
 #include <boost/lexical_cast.hpp>
 
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/message_types.h>
 
 namespace isc {
diff --git a/src/lib/log/message_exception.h b/src/lib/log/message_exception.h
index a661b88..dc35f64 100644
--- a/src/lib/log/message_exception.h
+++ b/src/lib/log/message_exception.h
@@ -16,7 +16,7 @@
 #define __MESSAGE_EXCEPTION_H
 
 #include <exceptions/exceptions.h>
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/message_types.h>
 
 #include <stdexcept>
diff --git a/src/lib/log/message_initializer.h b/src/lib/log/message_initializer.h
index 8efac43..35ddb04 100644
--- a/src/lib/log/message_initializer.h
+++ b/src/lib/log/message_initializer.h
@@ -18,7 +18,7 @@
 #include <cstdlib>
 #include <string>
 #include <vector>
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/message_dictionary.h>
 
 namespace isc {
diff --git a/src/lib/log/message_reader.h b/src/lib/log/message_reader.h
index 299c0a6..ae03e6e 100644
--- a/src/lib/log/message_reader.h
+++ b/src/lib/log/message_reader.h
@@ -19,7 +19,7 @@
 #include <string>
 #include <vector>
 
-#include <log/lib.h>
+#include <log/dll.h>
 #include <log/message_dictionary.h>
 #include <log/message_types.h>
 
diff --git a/src/lib/log/message_types.h b/src/lib/log/message_types.h
index 6e6f103..c74a8b6 100644
--- a/src/lib/log/message_types.h
+++ b/src/lib/log/message_types.h
@@ -17,7 +17,7 @@
 
 #include <string.h>
 
-#include <log/lib.h>
+#include <log/dll.h>
 
 namespace isc {
 namespace log {
diff --git a/src/lib/log/output_option.h b/src/lib/log/output_option.h
index cb1192e..edb2fcc 100644
--- a/src/lib/log/output_option.h
+++ b/src/lib/log/output_option.h
@@ -19,7 +19,7 @@
 #include <stdlib.h>
 #include <string>
 
-#include <log/lib.h>
+#include <log/dll.h>
 
 /// \brief Logger Output Option
 ///
diff --git a/src/lib/nsas/address_entry.cc b/src/lib/nsas/address_entry.cc
index 24b0dd9..7bc575b 100644
--- a/src/lib/nsas/address_entry.cc
+++ b/src/lib/nsas/address_entry.cc
@@ -30,6 +30,8 @@
 /// static class constant, and define it in this source file.  As we can control
 /// the order of include files, this ensures that the value is defined.
 
+#define ISC_LIBNSAS_EXPORT
+
 #define __STDC_LIMIT_MACROS
 #include <stdint.h>
 
diff --git a/src/lib/nsas/address_entry.h b/src/lib/nsas/address_entry.h
index 8698017..391cac8 100644
--- a/src/lib/nsas/address_entry.h
+++ b/src/lib/nsas/address_entry.h
@@ -20,13 +20,15 @@
 /// Lightweight class that couples an address with a RTT and provides some
 /// convenience methods for accessing and updating the information.
 
+#include <time.h>
 #include <stdint.h>
 #include <asiolink/io_address.h>
+#include <nsas/dll.h>
 
 namespace isc {
 namespace nsas {
 
-class AddressEntry {
+class ISC_LIBNSAS_API AddressEntry {
 public:
     /// Creates an address entry given IOAddress entry and RTT
     /// This is the only constructor; the default copy constructor and
diff --git a/src/lib/nsas/address_request_callback.h b/src/lib/nsas/address_request_callback.h
index ad0630e..8e035e4 100644
--- a/src/lib/nsas/address_request_callback.h
+++ b/src/lib/nsas/address_request_callback.h
@@ -15,6 +15,7 @@
 #ifndef __ADDRESS_REQUEST_CALLBACK_H
 #define __ADDRESS_REQUEST_CALLBACK_H
 
+#include <nsas/dll.h>
 #include "asiolink.h"
 #include "nameserver_address.h"
 
@@ -39,7 +40,7 @@ namespace nsas {
 /// callback object is up to the caller - if the caller wants to retain it
 /// they should keep the shared pointer.
 
-class AddressRequestCallback {
+class ISC_LIBNSAS_API AddressRequestCallback {
 public:
 
     /// Default constructor, copy contructor and assignment operator
diff --git a/src/lib/nsas/asiolink.h b/src/lib/nsas/asiolink.h
index d95868f..a7b8c4f 100644
--- a/src/lib/nsas/asiolink.h
+++ b/src/lib/nsas/asiolink.h
@@ -16,6 +16,8 @@
 #define __ASIOLINK_H
 
 #include <string>
+#ifndef _WIN32
 #include <sys/socket.h>
+#endif
 
 #endif // __ASIOLINK_H
diff --git a/src/lib/nsas/dll.h b/src/lib/nsas/dll.h
new file mode 100644
index 0000000..2c5293e
--- /dev/null
+++ b/src/lib/nsas/dll.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 __LIBNSAS_H
+#define __LIBNSAS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBNSAS_API
+#else
+#ifdef ISC_LIBNSAS_EXPORT
+#define ISC_LIBNSAS_API __declspec(dllexport)
+#else
+#define ISC_LIBNSAS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBNSAS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/nsas/fetchable.h b/src/lib/nsas/fetchable.h
index 461cfca..fc76b32 100644
--- a/src/lib/nsas/fetchable.h
+++ b/src/lib/nsas/fetchable.h
@@ -15,6 +15,8 @@
 #ifndef __FETCHABLE_H
 #define __FETCHABLE_H
 
+#include <nsas/dll.h>
+
 /**
  * \file fetchable.h
  * \short Interface of information that can be fetched.
@@ -29,7 +31,7 @@ namespace nsas {
  * This just holds a state of information that can be fetched from somewhere.
  * No locking is performed, if it is desirable, it should be locked manually.
  */
-class Fetchable {
+class ISC_LIBNSAS_API Fetchable {
     public:
         /// \short States the Fetchable object can be in.
         enum State {
diff --git a/src/lib/nsas/glue_hints.cc b/src/lib/nsas/glue_hints.cc
index 3caae25..3adb630 100644
--- a/src/lib/nsas/glue_hints.cc
+++ b/src/lib/nsas/glue_hints.cc
@@ -12,6 +12,15 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBNSAS_EXPORT
+
+#include <config.h>
+
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#endif
+
 #include "glue_hints.h"
 
 #include <stdlib.h>
diff --git a/src/lib/nsas/glue_hints.h b/src/lib/nsas/glue_hints.h
index 8e6ecf1..d24f8d5 100644
--- a/src/lib/nsas/glue_hints.h
+++ b/src/lib/nsas/glue_hints.h
@@ -19,13 +19,14 @@
 
 #include <dns/message.h>
 
+#include <nsas/dll.h>
 #include "nsas_types.h"
 #include "nameserver_address.h"
 
 namespace isc {
 namespace nsas {
 
-class GlueHints {
+class ISC_LIBNSAS_API GlueHints {
 public:
     /// \brief Empty constructor
     GlueHints() {};
diff --git a/src/lib/nsas/hash.cc b/src/lib/nsas/hash.cc
index ac2af15..cd6e4c9 100644
--- a/src/lib/nsas/hash.cc
+++ b/src/lib/nsas/hash.cc
@@ -52,6 +52,8 @@ or otherwise) arising in any way out of the use of this software, even
 if advised of the possibility of such damage.
 */
 
+#define ISC_LIBNSAS_EXPORT
+
 #include <cassert>
 #include <stdlib.h>
 #include <algorithm>
@@ -60,6 +62,8 @@ if advised of the possibility of such damage.
 
 #include <config.h>
 
+#include <time.h>
+
 #include "hash.h"
 
 using namespace std;
diff --git a/src/lib/nsas/hash.h b/src/lib/nsas/hash.h
index 85b82c3..aa74fca 100644
--- a/src/lib/nsas/hash.h
+++ b/src/lib/nsas/hash.h
@@ -19,6 +19,7 @@
 #include <vector>
 
 #include <exceptions/exceptions.h>
+#include <nsas/dll.h>
 
 #include "hash_key.h"
 
@@ -29,7 +30,7 @@ namespace nsas {
 ///
 /// Thrown if the expected maximum key length is too long for the data types
 /// declared in the class.
-class KeyLengthTooLong : public isc::Exception {
+class ISC_LIBNSAS_API KeyLengthTooLong : public isc::Exception {
 public:
     KeyLengthTooLong(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what)
@@ -40,7 +41,7 @@ public:
 /// \brief Hash Calculation
 ///
 /// Class abstracting the mechanics of the hash calculation.
-class Hash {
+class ISC_LIBNSAS_API Hash {
 public:
 
     /// \brief Constructor
diff --git a/src/lib/nsas/hash_deleter.h b/src/lib/nsas/hash_deleter.h
index 27f066e..78f9a49 100644
--- a/src/lib/nsas/hash_deleter.h
+++ b/src/lib/nsas/hash_deleter.h
@@ -18,6 +18,7 @@
 #include <boost/shared_ptr.hpp>
 #include <util/lru_list.h>
 
+#include <nsas/dll.h>
 #include "hash_table.h"
 
 namespace isc {
diff --git a/src/lib/nsas/hash_key.cc b/src/lib/nsas/hash_key.cc
index 782e3d8..c382a69 100644
--- a/src/lib/nsas/hash_key.cc
+++ b/src/lib/nsas/hash_key.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_LIBNSAS_EXPORT
+
 #include <cstring>
 
 #include <config.h>
diff --git a/src/lib/nsas/hash_key.h b/src/lib/nsas/hash_key.h
index c89b327..5b3c5f4 100644
--- a/src/lib/nsas/hash_key.h
+++ b/src/lib/nsas/hash_key.h
@@ -16,6 +16,7 @@
 #define __HASH_KEY_H
 
 #include <dns/rrclass.h>
+#include <nsas/dll.h>
 
 #include <stdint.h>
 #include <string>
@@ -41,7 +42,7 @@ namespace nsas {
 ///
 /// To avoid passing round three elements (key, key length, and class), they
 /// have been combined into this simple struct.
-struct HashKey {
+struct ISC_LIBNSAS_API HashKey {
 
     /// \brief Constructor
     ///
diff --git a/src/lib/nsas/hash_table.h b/src/lib/nsas/hash_table.h
index 6028473..c788bd5 100644
--- a/src/lib/nsas/hash_table.h
+++ b/src/lib/nsas/hash_table.h
@@ -21,6 +21,7 @@
 
 #include <util/locks.h>
 
+#include <nsas/dll.h>
 #include "hash.h"
 #include "hash_key.h"
 
diff --git a/src/lib/nsas/lib.h b/src/lib/nsas/lib.h
new file mode 100644
index 0000000..2c5293e
--- /dev/null
+++ b/src/lib/nsas/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 __LIBNSAS_H
+#define __LIBNSAS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBNSAS_API
+#else
+#ifdef ISC_LIBNSAS_EXPORT
+#define ISC_LIBNSAS_API __declspec(dllexport)
+#else
+#define ISC_LIBNSAS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBNSAS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/nsas/nameserver_address.cc b/src/lib/nsas/nameserver_address.cc
index 19d18c5..e3286e5 100644
--- a/src/lib/nsas/nameserver_address.cc
+++ b/src/lib/nsas/nameserver_address.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_LIBNSAS_EXPORT
+
 #include <config.h>
 
 #include "nameserver_address.h"
diff --git a/src/lib/nsas/nameserver_address.h b/src/lib/nsas/nameserver_address.h
index 07b6d4a..0cdfbd3 100644
--- a/src/lib/nsas/nameserver_address.h
+++ b/src/lib/nsas/nameserver_address.h
@@ -19,6 +19,7 @@
 
 #include <exceptions/exceptions.h>
 
+#include <nsas/dll.h>
 #include "asiolink.h"
 #include "address_entry.h"
 #include "nsas_types.h"
@@ -26,14 +27,14 @@
 namespace isc {
 namespace nsas {
 
-class ZoneEntry;
-class NameserverEntry;
+class ISC_LIBNSAS_API ZoneEntry;
+class ISC_LIBNSAS_API NameserverEntry;
 
 /// \brief Empty \c NameserverEntry pointer exception
 ///
 /// Thrown if the the \c NameservrEntry pointer in the \c boost::shared_ptr that passed
 /// into \c NameserverAddress' constructor is NULL
-class NullNameserverEntryPointer : public isc::Exception {
+class ISC_LIBNSAS_API NullNameserverEntryPointer : public isc::Exception {
 public:
     NullNameserverEntryPointer(const char* file, size_t line,
         const char* what) :
@@ -52,7 +53,7 @@ public:
 /// It is not thread safe, only reentrant. It is expected to be kept inside
 /// the resolver and used only once for the address and once for the update.
 
-class NameserverAddress {
+class ISC_LIBNSAS_API NameserverAddress {
 public:
     /// \brief Constructor
     ///
diff --git a/src/lib/nsas/nameserver_address_store.cc b/src/lib/nsas/nameserver_address_store.cc
index 867f028..0dca9d7 100644
--- a/src/lib/nsas/nameserver_address_store.cc
+++ b/src/lib/nsas/nameserver_address_store.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_LIBNSAS_EXPORT
+
 #include <config.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#endif
+
 #include <boost/shared_ptr.hpp>
 #include <boost/foreach.hpp>
 #include <boost/bind.hpp>
diff --git a/src/lib/nsas/nameserver_address_store.h b/src/lib/nsas/nameserver_address_store.h
index 1af535a..72905bc 100644
--- a/src/lib/nsas/nameserver_address_store.h
+++ b/src/lib/nsas/nameserver_address_store.h
@@ -22,6 +22,7 @@
 
 #include <resolve/resolver_interface.h>
 
+#include <nsas/dll.h>
 #include "nsas_types.h"
 #include "glue_hints.h"
 
@@ -29,7 +30,7 @@ namespace isc {
 // Some forward declarations, so we do not need to include so many headers
 
 namespace dns {
-class RRClass;
+class ISC_LIBNSAS_API RRClass;
 }
 
 namespace util {
@@ -39,9 +40,9 @@ template<class T> class LruList;
 namespace nsas {
 
 template<class T> class HashTable;
-class ZoneEntry;
-class NameserverEntry;
-class AddressRequestCallback;
+class ISC_LIBNSAS_API ZoneEntry;
+class ISC_LIBNSAS_API NameserverEntry;
+class ISC_LIBNSAS_API AddressRequestCallback;
 
 /// \brief Nameserver Address Store
 ///
@@ -50,7 +51,7 @@ class AddressRequestCallback;
 /// the logic for sending queries for the nameserver addresses if they are not
 /// in the store.
 
-class NameserverAddressStore {
+class ISC_LIBNSAS_API NameserverAddressStore {
 public:
 
     /// \brief Constructor
diff --git a/src/lib/nsas/nameserver_entry.cc b/src/lib/nsas/nameserver_entry.cc
index bca8f73..8322d81 100644
--- a/src/lib/nsas/nameserver_entry.cc
+++ b/src/lib/nsas/nameserver_entry.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_LIBNSAS_EXPORT
+
 #include <config.h>
 
 #include <algorithm>
@@ -22,7 +24,12 @@
 #include <boost/foreach.hpp>
 
 #include <ctype.h>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#else
 #include <strings.h>
+#endif
 
 #include <config.h>
 
@@ -42,6 +49,11 @@
 #include "nameserver_entry.h"
 #include "nsas_log.h"
 
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4373)
+#endif
+
 using namespace isc::asiolink;
 using namespace isc::nsas;
 using namespace isc::dns;
@@ -470,3 +482,7 @@ NameserverEntry::askIP(isc::resolve::ResolverInterface* resolver,
 
 } // namespace dns
 } // namespace isc
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
diff --git a/src/lib/nsas/nameserver_entry.h b/src/lib/nsas/nameserver_entry.h
index 0f214c6..1b71071 100644
--- a/src/lib/nsas/nameserver_entry.h
+++ b/src/lib/nsas/nameserver_entry.h
@@ -27,6 +27,7 @@
 
 #include <util/lru_list.h>
 
+#include <nsas/dll.h>
 #include "address_entry.h"
 #include "asiolink.h"
 #include "nsas_types.h"
@@ -38,13 +39,13 @@
 namespace isc {
 namespace nsas {
 
-class NameserverAddress;
+class ISC_LIBNSAS_API NameserverAddress;
 
 /// \brief Inconsistent Owner Names
 ///
 /// Thrown if a NameserverEntry is constructed from both an A and AAAA RRset
 /// where the owner names do not match.
-class InconsistentOwnerNames : public Exception {
+class ISC_LIBNSAS_API InconsistentOwnerNames : public Exception {
 public:
     InconsistentOwnerNames(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what)
@@ -54,7 +55,7 @@ public:
 /// \brief RTT is zero
 ///
 /// Thrown if a RTT related with an address is 0.
-class RTTIsZero : public Exception {
+class ISC_LIBNSAS_API RTTIsZero : public Exception {
 public:
     RTTIsZero(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what)
@@ -65,14 +66,14 @@ public:
 ///
 /// Thrown if a NameserverEntry is constructed from both an A and AAAA RRset
 /// where the classes do not match.
-class InconsistentClass : public Exception {
+class ISC_LIBNSAS_API InconsistentClass : public Exception {
 public:
     InconsistentClass(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what)
     {}
 };
 
-class ZoneEntry;
+class ISC_LIBNSAS_API ZoneEntry;
 
 /// \brief Nameserver Entry
 ///
@@ -91,7 +92,8 @@ class ZoneEntry;
 ///
 /// It uses shared_from_this in its methods. It must live inside a shared_ptr.
 
-class NameserverEntry : public NsasEntry<NameserverEntry>, public Fetchable {
+class ISC_LIBNSAS_API NameserverEntry :
+ public NsasEntry<NameserverEntry>, public Fetchable {
 public:
     /// List of addresses associated with this nameserver
     typedef std::vector<NameserverAddress>   AddressVector;
diff --git a/src/lib/nsas/nsas_entry.h b/src/lib/nsas/nsas_entry.h
index 9cbed11..57df3f5 100644
--- a/src/lib/nsas/nsas_entry.h
+++ b/src/lib/nsas/nsas_entry.h
@@ -21,6 +21,7 @@
 #include <exceptions/exceptions.h>
 #include <util/lru_list.h>
 
+#include <nsas/dll.h>
 #include "hash_key.h"
 #include "hash_table.h"
 
@@ -31,7 +32,7 @@ namespace nsas {
 ///
 /// Thrown if an attempt was made to access the iterator - the pointer into
 /// the LRU list where this element is located - when it is marked as invalid.
-class InvalidLruIterator : public isc::Exception {
+class ISC_LIBNSAS_API InvalidLruIterator : public isc::Exception {
 public:
     InvalidLruIterator(const char* file, size_t line, const char* what) :
         Exception(file, line, what)
diff --git a/src/lib/nsas/nsas_entry_compare.h b/src/lib/nsas/nsas_entry_compare.h
index 9e9ba7d..78a8b8e 100644
--- a/src/lib/nsas/nsas_entry_compare.h
+++ b/src/lib/nsas/nsas_entry_compare.h
@@ -15,6 +15,7 @@
 #ifndef __NSAS_ENTRY_COMPARE_H
 #define __NSAS_ENTRY_COMPARE_H
 
+#include <nsas/dll.h>
 #include "hash_key.h"
 #include "hash_table.h"
 
diff --git a/src/lib/nsas/nsas_log.cc b/src/lib/nsas/nsas_log.cc
index 931b131..1b203a5 100644
--- a/src/lib/nsas/nsas_log.cc
+++ b/src/lib/nsas/nsas_log.cc
@@ -14,6 +14,8 @@
 
 /// Defines the logger used by the NSAS
 
+#define ISC_LIBNSAS_EXPORT
+
 #include "nsas/nsas_log.h"
 
 namespace isc {
diff --git a/src/lib/nsas/nsas_log.h b/src/lib/nsas/nsas_log.h
index 031f46d..8872a52 100644
--- a/src/lib/nsas/nsas_log.h
+++ b/src/lib/nsas/nsas_log.h
@@ -16,6 +16,7 @@
 #define __NSAS_LOG__H
 
 #include <log/macros.h>
+#include <nsas/dll.h>
 #include "nsas_messages.h"
 
 namespace isc {
diff --git a/src/lib/nsas/nsas_types.h b/src/lib/nsas/nsas_types.h
index 940cc3e..828fcad 100644
--- a/src/lib/nsas/nsas_types.h
+++ b/src/lib/nsas/nsas_types.h
@@ -15,6 +15,8 @@
 #ifndef __NSAS_TYPES_H
 #define __NSAS_TYPES_H
 
+#include <nsas/dll.h>
+
 /// \file nsas_types.h
 /// \brief Nameserver Address Store Types
 ///
diff --git a/src/lib/nsas/tests/nameserver_address_store_unittest.cc b/src/lib/nsas/tests/nameserver_address_store_unittest.cc
index 6ddae72..4f1899d 100644
--- a/src/lib/nsas/tests/nameserver_address_store_unittest.cc
+++ b/src/lib/nsas/tests/nameserver_address_store_unittest.cc
@@ -18,6 +18,11 @@
 
 #include <config.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#endif
+
 #include <algorithm>
 #include <cassert>
 #include <string.h>
diff --git a/src/lib/nsas/tests/nameserver_address_unittest.cc b/src/lib/nsas/tests/nameserver_address_unittest.cc
index 1b211e9..063d450 100644
--- a/src/lib/nsas/tests/nameserver_address_unittest.cc
+++ b/src/lib/nsas/tests/nameserver_address_unittest.cc
@@ -14,6 +14,11 @@
 
 #include <config.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#endif
+
 #include <gtest/gtest.h>
 
 #include <dns/name.h>
diff --git a/src/lib/nsas/tests/nameserver_entry_unittest.cc b/src/lib/nsas/tests/nameserver_entry_unittest.cc
index 3aca08f..218e841 100644
--- a/src/lib/nsas/tests/nameserver_entry_unittest.cc
+++ b/src/lib/nsas/tests/nameserver_entry_unittest.cc
@@ -22,6 +22,11 @@
 #include <boost/shared_ptr.hpp>
 #include <gtest/gtest.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#endif
+
 #include <dns/rdata.h>
 #include <dns/rrset.h>
 #include <dns/rrclass.h>
diff --git a/src/lib/nsas/tests/zone_entry_unittest.cc b/src/lib/nsas/tests/zone_entry_unittest.cc
index 1982299..1cf1cb0 100644
--- a/src/lib/nsas/tests/zone_entry_unittest.cc
+++ b/src/lib/nsas/tests/zone_entry_unittest.cc
@@ -20,6 +20,11 @@
 #include <boost/lexical_cast.hpp>
 #include <cmath>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#endif
+
 #include <dns/rrclass.h>
 #include <dns/rdataclass.h>
 
diff --git a/src/lib/nsas/zone_entry.cc b/src/lib/nsas/zone_entry.cc
index 8a72e5f..db311b6 100644
--- a/src/lib/nsas/zone_entry.cc
+++ b/src/lib/nsas/zone_entry.cc
@@ -12,10 +12,18 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBNSAS_EXPORT
+
 #include <map>
 
 #include <config.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#include <time.h>
+#endif
+
 #include "zone_entry.h"
 #include "address_request_callback.h"
 #include "nameserver_entry.h"
@@ -27,6 +35,11 @@
 #include <dns/rcode.h>
 #include <dns/rdataclass.h>
 
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4373)
+#endif
+
 using namespace std;
 
 namespace isc {
@@ -568,3 +581,7 @@ ZoneEntry::insertCallback(NameserverPtr ns, AddressFamily family) {
 
 }; // namespace nsas
 }; // namespace isc
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
diff --git a/src/lib/nsas/zone_entry.h b/src/lib/nsas/zone_entry.h
index 482b89f..23dacb5 100644
--- a/src/lib/nsas/zone_entry.h
+++ b/src/lib/nsas/zone_entry.h
@@ -28,6 +28,7 @@
 #include <util/locks.h>
 #include <util/random/random_number_generator.h>
 
+#include <nsas/dll.h>
 #include "hash_key.h"
 #include "nsas_entry.h"
 #include "asiolink.h"
@@ -38,8 +39,8 @@
 namespace isc {
 namespace nsas {
 
-class NameserverEntry;
-class AddressRequestCallback;
+class ISC_LIBNSAS_API NameserverEntry;
+class ISC_LIBNSAS_API AddressRequestCallback;
 
 /// \brief Zone Entry
 ///
@@ -52,7 +53,8 @@ class AddressRequestCallback;
 ///
 /// It uses shared_from_this in its methods. It must live inside a shared_ptr.
 
-class ZoneEntry : public NsasEntry<ZoneEntry>, public Fetchable {
+class ISC_LIBNSAS_API ZoneEntry :
+ public NsasEntry<ZoneEntry>, public Fetchable {
 public:
 
     /**
diff --git a/src/lib/resolve/lib.h b/src/lib/resolve/lib.h
new file mode 100644
index 0000000..37230c9
--- /dev/null
+++ b/src/lib/resolve/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 __LIBRESOLVE_H
+#define __LIBRESOLVE_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBRESOLVE_API
+#else
+#ifdef ISC_LIBRESOLVE_EXPORT
+#define ISC_LIBRESOLVE_API __declspec(dllexport)
+#else
+#define ISC_LIBRESOLVE_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBRESOLVE_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/resolve/recursive_query.cc b/src/lib/resolve/recursive_query.cc
index 8d03c1c..7776bcd 100644
--- a/src/lib/resolve/recursive_query.cc
+++ b/src/lib/resolve/recursive_query.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_LIBRESOLVE_EXPORT
+
 #include <config.h>
 
-#include <stdlib.h>
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#else
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <unistd.h>             // for some IPC/network system calls
+#endif
+#include <stdlib.h>
 #include <string>
 
 #include <boost/lexical_cast.hpp>
@@ -87,7 +94,7 @@ questionText(const isc::dns::Question& question) {
 /// \param name The name we want to delegate to.
 /// \param rrclass The class.
 /// \param cache The place too look for known delegations.
-std::string
+ISC_LIBRESOLVE_API std::string
 deepestDelegation(Name name, RRClass rrclass,
                   isc::cache::ResolverCache& cache)
 {
@@ -146,6 +153,28 @@ RecursiveQuery::RecursiveQuery(DNSServiceBase& dns_service,
 {
 }
 
+#ifdef _WIN32
+static void
+win32_gettimeofday(struct timeval *tv)
+{
+    SYSTEMTIME epoch = { 1970, 1, 4, 1, 0, 0, 0, 0 };
+    FILETIME temp;
+    SystemTimeToFileTime(&epoch, &temp);
+    ULARGE_INTEGER t;
+    t.LowPart = temp.dwLowDateTime;
+    t.HighPart = temp.dwHighDateTime;
+    FILETIME now;
+    GetSystemTimeAsFileTime(&now);
+    ULARGE_INTEGER n;
+    n.LowPart = now.dwLowDateTime;
+    n.HighPart = now.dwHighDateTime;
+    n.QuadPart -= t.QuadPart;
+    tv->tv_sec = (long) (n.QuadPart / 10000000);
+    n.QuadPart -= tv->tv_sec * 10000000;
+    tv->tv_usec = (long) (n.QuadPart / 10);
+}
+#endif
+
 // Set the test server - only used for unit testing.
 void
 RecursiveQuery::setTestServer(const std::string& address, uint16_t port) {
@@ -349,7 +378,11 @@ private:
         // We need to keep track of the Address, so that we can update
         // the RTT
         current_ns_address = address;
+#ifdef _WIN32
+        win32_gettimeofday(&current_ns_qsent_time);
+#else
         gettimeofday(&current_ns_qsent_time, NULL);
+#endif
         ++outstanding_events_;
         if (test_server_.second != 0) {
             IOFetch query(protocol_, io_, question_,
@@ -375,7 +408,11 @@ private:
             LOG_DEBUG(isc::resolve::logger,
                       RESLIB_DBG_TRACE, RESLIB_TEST_UPSTREAM)
                 .arg(questionText(question_)).arg(test_server_.first);
+#ifdef _WIN32
+            win32_gettimeofday(&current_ns_qsent_time);
+#else
             gettimeofday(&current_ns_qsent_time, NULL);
+#endif
             ++outstanding_events_;
             IOFetch query(protocol, io_, question_,
                 test_server_.first,
@@ -816,7 +853,11 @@ public:
 
             // Update the NSAS with the time it took
             struct timeval cur_time;
+#ifdef _WIN32
+            win32_gettimeofday(&cur_time);
+#else
             gettimeofday(&cur_time, NULL);
+#endif
             uint32_t rtt = 0;
 
             // Only calculate RTT if it is positive
@@ -898,7 +939,7 @@ public:
     }
 };
 
-class ForwardQuery : public IOFetch::Callback {
+class ISC_LIBRESOLVE_API ForwardQuery : public IOFetch::Callback {
 private:
     // The io service to handle async calls
     IOService& io_;
@@ -1045,8 +1086,10 @@ public:
         client_timer.cancel();
         if (outstanding_events_ > 0) {
             return;
+#ifndef _MSC_VER
         } else {
             delete this;
+#endif
         }
     }
 
diff --git a/src/lib/resolve/recursive_query.h b/src/lib/resolve/recursive_query.h
index a819a94..cc9ab8f 100644
--- a/src/lib/resolve/recursive_query.h
+++ b/src/lib/resolve/recursive_query.h
@@ -20,6 +20,7 @@
 #include <asiodns/dns_server.h>
 #include <nsas/nameserver_address_store.h>
 #include <cache/resolver_cache.h>
+#include <resolve/dll.h>
 
 namespace isc {
 namespace asiodns {
@@ -32,7 +33,7 @@ namespace asiodns {
 /// A pointer to an object of this class is passed to RecursiveQuery which in
 /// turn passes it to the created RunningQuery class.  When a running query
 /// completes, its RTT is passed to the RTT Recorder object.
-class RttRecorder {
+class ISC_LIBRESOLVE_API RttRecorder {
 public:
     /// \brief Record Time
     ///
@@ -58,7 +59,7 @@ private:
 /// The \c RecursiveQuery class provides a layer of abstraction around
 /// the ASIO code that carries out an upstream query.
 
-class RecursiveQuery {
+class ISC_LIBRESOLVE_API RecursiveQuery {
     ///
     /// \name Constructors
     ///
diff --git a/src/lib/resolve/resolve.cc b/src/lib/resolve/resolve.cc
index f741121..d316075 100644
--- a/src/lib/resolve/resolve.cc
+++ b/src/lib/resolve/resolve.cc
@@ -12,6 +12,15 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBRESOLVE_EXPORT
+
+#include <config.h>
+
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#endif
+
 #include <resolve/resolve.h>
 
 #include <dns/message.h>
@@ -36,7 +45,7 @@ namespace {
 namespace isc {
 namespace resolve {
 
-void
+ISC_LIBRESOLVE_API void
 makeErrorMessage(MessagePtr answer_message,
                  const Rcode& error_code)
 {
@@ -47,8 +56,9 @@ makeErrorMessage(MessagePtr answer_message,
     answer_message->setRcode(error_code);
 }
 
-void initResponseMessage(const isc::dns::Message& query_message,
-                         isc::dns::Message& response_message)
+ISC_LIBRESOLVE_API void
+initResponseMessage(const isc::dns::Message& query_message,
+                    isc::dns::Message& response_message)
 {
     response_message.setOpcode(query_message.getOpcode());
     response_message.setQid(query_message.getQid());
@@ -57,14 +67,16 @@ void initResponseMessage(const isc::dns::Message& query_message,
         query_message);
 }
 
-void initResponseMessage(const isc::dns::Question& question,
-                         isc::dns::Message& response_message)
+ISC_LIBRESOLVE_API void
+initResponseMessage(const isc::dns::Question& question,
+                    isc::dns::Message& response_message)
 {
     response_message.setOpcode(isc::dns::Opcode::QUERY());
     response_message.addQuestion(question);
 }
 
-void copyResponseMessage(const Message& source, MessagePtr target) {
+ISC_LIBRESOLVE_API void
+copyResponseMessage(const Message& source, MessagePtr target) {
     target->setRcode(source.getRcode());
 
     target->appendSection(Message::SECTION_ANSWER, source);
diff --git a/src/lib/resolve/resolve.h b/src/lib/resolve/resolve.h
index 0a588e2..b5763e2 100644
--- a/src/lib/resolve/resolve.h
+++ b/src/lib/resolve/resolve.h
@@ -18,6 +18,7 @@
 /// This file includes all other libresolve headers, and provides
 /// several helper functions used in resolving.
 
+#include <resolve/dll.h>
 #include <resolve/resolver_interface.h>
 #include <resolve/resolver_callback.h>
 #include <resolve/response_classifier.h>
@@ -38,8 +39,9 @@ namespace resolve {
 ///
 /// \param answer_message The message to clear and place the error in
 /// \param error_code The error Rcode
-void makeErrorMessage(isc::dns::MessagePtr answer_message,
-                      const isc::dns::Rcode& error_code);
+ISC_LIBRESOLVE_API void
+makeErrorMessage(isc::dns::MessagePtr answer_message,
+                 const isc::dns::Rcode& error_code);
 
 
 /// \brief Initialize a response message
@@ -56,8 +58,9 @@ void makeErrorMessage(isc::dns::MessagePtr answer_message,
 ///                      and Opcode from.
 /// \param response_message The fresh response message to initialize
 ///                         (must be in RENDER mode)
-void initResponseMessage(const isc::dns::Message& query_message,
-                         isc::dns::Message& response_message);
+ISC_LIBRESOLVE_API void
+initResponseMessage(const isc::dns::Message& query_message,
+                    isc::dns::Message& response_message);
 
 
 /// \brief Initialize a response message
@@ -73,8 +76,9 @@ void initResponseMessage(const isc::dns::Message& query_message,
 /// \param question The question to place in the Question section
 /// \param response_message The fresh response message to initialize
 ///                         (must be in RENDER mode)
-void initResponseMessage(const isc::dns::Question& question,
-                         isc::dns::Message& response_message);
+ISC_LIBRESOLVE_API void
+initResponseMessage(const isc::dns::Question& question,
+                    isc::dns::Message& response_message);
 
 
 /// \brief Copies the parts relevant for a DNS response to the
@@ -85,8 +89,9 @@ void initResponseMessage(const isc::dns::Question& question,
 /// code
 /// \param source The Message to copy the data from
 /// \param target The Message to copy the data to
-void copyResponseMessage(const isc::dns::Message& source,
-                         isc::dns::MessagePtr target);
+ISC_LIBRESOLVE_API void
+copyResponseMessage(const isc::dns::Message& source,
+                    isc::dns::MessagePtr target);
 
 
 } // namespace resolve
diff --git a/src/lib/resolve/resolve_log.cc b/src/lib/resolve/resolve_log.cc
index e41d8d2..59929b9 100644
--- a/src/lib/resolve/resolve_log.cc
+++ b/src/lib/resolve/resolve_log.cc
@@ -14,6 +14,8 @@
 
 /// Defines the logger used by the NSAS
 
+#define ISC_LIBRESOLVE_EXPORT
+
 #include <resolve/resolve_log.h>
 
 namespace isc {
diff --git a/src/lib/resolve/resolve_log.h b/src/lib/resolve/resolve_log.h
index 828b9d3..9136ae2 100644
--- a/src/lib/resolve/resolve_log.h
+++ b/src/lib/resolve/resolve_log.h
@@ -16,6 +16,7 @@
 #define __RESOLVE_LOG__H
 
 #include <log/macros.h>
+#include <resolve/dll.h>
 #include "resolve_messages.h"
 
 namespace isc {
diff --git a/src/lib/resolve/resolver_callback.cc b/src/lib/resolve/resolver_callback.cc
index c0db55e..1df17ce 100644
--- a/src/lib/resolve/resolver_callback.cc
+++ b/src/lib/resolve/resolver_callback.cc
@@ -12,6 +12,16 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBRESOLVE_EXPORT
+
+#include <config.h>
+#include <stdint.h>
+
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#endif
+
 #include <resolve/resolver_callback.h>
 
 namespace isc {
diff --git a/src/lib/resolve/resolver_callback.h b/src/lib/resolve/resolver_callback.h
index 79138e8..3e0d2b4 100644
--- a/src/lib/resolve/resolver_callback.h
+++ b/src/lib/resolve/resolver_callback.h
@@ -18,6 +18,7 @@
 #include <asiodns/dns_server.h>
 #include <dns/message.h>
 
+#include <resolve/dll.h>
 #include <resolve/resolver_interface.h>
 
 namespace isc {
@@ -31,7 +32,8 @@ namespace resolve {
 ///
 /// This class will ignore the response MessagePtr in the callback,
 /// as the server itself should also have a reference.
-class ResolverCallbackServer : public ResolverInterface::Callback {
+class ISC_LIBRESOLVE_API ResolverCallbackServer :
+ public ResolverInterface::Callback {
 public:
     ResolverCallbackServer(asiodns::DNSServer* server) :
         server_(server->clone()) {}
diff --git a/src/lib/resolve/resolver_interface.h b/src/lib/resolve/resolver_interface.h
index 1d01e90..88378b0 100644
--- a/src/lib/resolve/resolver_interface.h
+++ b/src/lib/resolve/resolver_interface.h
@@ -16,6 +16,7 @@
 #define __RESOLVER_INTERFACE_H
 
 #include <dns/message.h>
+#include <resolve/dll.h>
 
 ///
 /// \file resolver_interface.h
@@ -44,7 +45,7 @@ namespace resolve {
 ///
 /// It is abstract to allow tests pass dummy resolvers.
 ///
-class ResolverInterface {
+class ISC_LIBRESOLVE_API ResolverInterface {
     public:
         /// \short An abstract callback for when the resolver is done.
         ///
diff --git a/src/lib/resolve/response_classifier.cc b/src/lib/resolve/response_classifier.cc
index 27c5cfc..e1bac65 100644
--- a/src/lib/resolve/response_classifier.cc
+++ b/src/lib/resolve/response_classifier.cc
@@ -14,6 +14,8 @@
 
 // $Id$
 
+#define ISC_LIBRESOLVE_EXPORT
+
 #include <cstddef>
 #include <vector>
 
diff --git a/src/lib/resolve/response_classifier.h b/src/lib/resolve/response_classifier.h
index a027bd0..daee898 100644
--- a/src/lib/resolve/response_classifier.h
+++ b/src/lib/resolve/response_classifier.h
@@ -22,6 +22,7 @@
 #include <dns/question.h>
 #include <dns/message.h>
 #include <dns/question.h>
+#include <resolve/dll.h>
 
 #define RESOLVER_MAX_CNAME_CHAIN    16
 
@@ -35,7 +36,7 @@ namespace resolve {
 ///
 /// TODO: The code here does not take into account any EDNS0 fields.
 
-class ResponseClassifier {
+class ISC_LIBRESOLVE_API ResponseClassifier {
 public:
 
     /// \brief Category of Answer
diff --git a/src/lib/resolve/tests/recursive_query_unittest.cc b/src/lib/resolve/tests/recursive_query_unittest.cc
index 02721f1..0860aac 100644
--- a/src/lib/resolve/tests/recursive_query_unittest.cc
+++ b/src/lib/resolve/tests/recursive_query_unittest.cc
@@ -14,9 +14,15 @@
 
 #include <config.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#include <time.h>
+#else
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/time.h>
+#endif
 
 #include <cstring>
 
@@ -133,6 +139,27 @@ struct ScopedAddrInfo {
 // This is made non copyable to avoid making an accidental copy, which could
 // result in duplicate close.
 struct ScopedSocket : private boost::noncopyable {
+#ifdef _WIN32
+    ScopedSocket() : s_(INVALID_SOCKET) {}
+    ScopedSocket(SOCKET s) : s_(s) {}
+    ~ScopedSocket() {
+        if (s_ != INVALID_SOCKET) {
+            closesocket(s_);
+        }
+    }
+    void reset(SOCKET new_s) {
+        if (s_ != INVALID_SOCKET) {
+            closesocket(s_);
+        }
+        s_ = new_s;
+    }
+    SOCKET release() {
+        SOCKET s = s_;
+        s_ = INVALID_SOCKET;
+        return (s);
+    }
+    SOCKET s_;
+#else
     ScopedSocket() : s_(-1) {}
     ScopedSocket(int s) : s_(s) {}
     ~ScopedSocket() {
@@ -152,6 +179,7 @@ struct ScopedSocket : private boost::noncopyable {
         return (s);
     }
     int s_;
+#endif
 };
 
 // This fixture is a framework for various types of network operations
@@ -186,11 +214,20 @@ protected:
 
         sock_.reset(socket(res->ai_family, res->ai_socktype,
                            res->ai_protocol));
+#ifdef _WIN32
+        if (sock_.s_ == INVALID_SOCKET) {
+            isc_throw(IOError, "failed to open test socket");
+        }
+        const int cc = sendto(sock_.s_,
+                              (const char *) test_data, sizeof(test_data), 0,
+                              res->ai_addr, res->ai_addrlen);
+#else
         if (sock_.s_ < 0) {
             isc_throw(IOError, "failed to open test socket");
         }
         const int cc = sendto(sock_.s_, test_data, sizeof(test_data), 0,
                               res->ai_addr, res->ai_addrlen);
+#endif
         if (cc != sizeof(test_data)) {
             isc_throw(IOError, "unexpected sendto result: " << cc);
         }
@@ -204,13 +241,24 @@ protected:
 
         sock_.reset(socket(res->ai_family, res->ai_socktype,
                            res->ai_protocol));
+#ifdef _WIN32
+        if (sock_.s_ == INVALID_SOCKET) {
+            isc_throw(IOError, "failed to open test socket");
+        }
+#else
         if (sock_.s_ < 0) {
             isc_throw(IOError, "failed to open test socket");
         }
+#endif
         if (connect(sock_.s_, res->ai_addr, res->ai_addrlen) < 0) {
             isc_throw(IOError, "failed to connect to the test server");
         }
+#ifdef _WIN32
+        const int cc = send(sock_.s_,
+                            (const char *) test_data, sizeof(test_data), 0);
+#else
         const int cc = send(sock_.s_, test_data, sizeof(test_data), 0);
+#endif
         if (cc != sizeof(test_data)) {
             isc_throw(IOError, "unexpected send result: " << cc);
         }
@@ -226,13 +274,21 @@ protected:
 
         sock_.reset(socket(res->ai_family, res->ai_socktype,
                            res->ai_protocol));
+#ifdef _WIN32
+        if (sock_.s_ == INVALID_SOCKET) {
+            isc_throw(IOError, "failed to open test socket");
+        }
+        if (::bind(sock_.s_, res->ai_addr, res->ai_addrlen) < 0) {
+            isc_throw(IOError, "bind failed: " << strerror(WSAGetLastError()));
+        }
+#else
         if (sock_.s_ < 0) {
             isc_throw(IOError, "failed to open test socket");
         }
-
         if (bind(sock_.s_, res->ai_addr, res->ai_addrlen) < 0) {
             isc_throw(IOError, "bind failed: " << strerror(errno));
         }
+#endif
 
         // The IO service queue should have a RecursiveQuery object scheduled
         // to run at this point.  This call will cause it to begin an
@@ -250,6 +306,18 @@ protected:
         // we add an ad hoc timeout.
         const struct timeval timeo = { 10, 0 };
         int recv_options = 0;
+#ifdef _WIN32
+        if (setsockopt(sock_.s_, SOL_SOCKET, SO_RCVTIMEO,
+                       (const char *) &timeo, sizeof(timeo))) {
+            isc_throw(IOError,
+                      "set RCVTIMEO failed: " << strerror(WSAGetLastError()));
+        }
+        const int ret = recv(sock_.s_, (char *) buffer, size, recv_options);
+        if (ret < 0) {
+            isc_throw(IOError,
+                      "recvfrom failed: " << strerror(WSAGetLastError()));
+        }
+#else
         if (setsockopt(sock_.s_, SOL_SOCKET, SO_RCVTIMEO, &timeo,
                        sizeof(timeo))) {
             if (errno == ENOPROTOOPT) {
@@ -267,7 +335,7 @@ protected:
         if (ret < 0) {
             isc_throw(IOError, "recvfrom failed: " << strerror(errno));
         }
-        
+#endif        
         // Pass the message size back via the size parameter
         size = ret;
     }
@@ -280,6 +348,23 @@ protected:
 
         ScopedSocket sock(socket(res->ai_family, res->ai_socktype,
                                  res->ai_protocol));
+#ifdef _WIN32
+        const SOCKET s = sock.s_;
+        if (s == INVALID_SOCKET) {
+            isc_throw(isc::Unexpected, "failed to open a test socket");
+        }
+        const int on = 1;
+        if (family == AF_INET6) {
+            if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
+                           (const char *) &on, sizeof(on)) == -1) {
+                isc_throw(isc::Unexpected,
+                          "failed to set socket option(IPV6_V6ONLY)");
+            }
+        }
+        if (::bind(s, res->ai_addr, res->ai_addrlen) != 0) {
+            isc_throw(isc::Unexpected, "failed to bind a test socket");
+        }
+#else
         const int s = sock.s_;
         if (s < 0) {
             isc_throw(isc::Unexpected, "failed to open a test socket");
@@ -299,6 +384,7 @@ protected:
         if (bind(s, res->ai_addr, res->ai_addrlen) != 0) {
             isc_throw(isc::Unexpected, "failed to bind a test socket");
         }
+#endif
         if (protocol == IPPROTO_TCP) {
             dns_service_->addServerTCPFromFD(sock.release(), family);
         } else {
@@ -502,7 +588,11 @@ protected:
     isc::cache::ResolverCache cache_;
     scoped_ptr<ASIOCallBack> callback_;
     int callback_protocol_;
+#ifdef _WIN32
+    SOCKET callback_native_;
+#else
     int callback_native_;
+#endif
     string callback_address_;
     vector<uint8_t> callback_data_;
     ScopedSocket sock_;
@@ -511,7 +601,12 @@ protected:
 
 RecursiveQueryTest::RecursiveQueryTest() :
     dns_service_(NULL), callback_(NULL), callback_protocol_(0),
-    callback_native_(-1), resolver_(new isc::util::unittests::TestResolver())
+#ifdef _WIN32
+    callback_native_(INVALID_SOCKET),
+#else
+    callback_native_(-1),
+#endif
+    resolver_(new isc::util::unittests::TestResolver())
 {
     nsas_.reset(new isc::nsas::NameserverAddressStore(resolver_));
 }
@@ -610,9 +705,9 @@ TEST_F(RecursiveQueryTest, v4TCPOnly) {
 
 vector<pair<string, uint16_t> >
 singleAddress(const string &address, uint16_t port) {
-    vector<pair<string, uint16_t> > result;
-    result.push_back(pair<string, uint16_t>(address, port));
-    return (result);
+    vector<pair<string, uint16_t> > results;
+    results.push_back(pair<string, uint16_t>(address, port));
+    return (results);
 }
 
 TEST_F(RecursiveQueryTest, recursiveSetupV4) {
@@ -677,26 +772,51 @@ TEST_F(RecursiveQueryTest, forwarderSend) {
     EXPECT_EQ(q.getClass(), q2->getClass());
 }
 
+#ifdef _WIN32
+SOCKET
+#else
 int
+#endif
 createTestSocket() {
     ScopedAddrInfo sai(resolveAddress(AF_INET, IPPROTO_UDP, true));
     struct addrinfo* res = sai.res_;
 
     ScopedSocket sock(socket(res->ai_family, res->ai_socktype,
                              res->ai_protocol));
+#ifdef _WIN32
+    if (sock.s_ == INVALID_SOCKET) {
+        isc_throw(IOError, "failed to open test socket");
+    }
+    if (::bind(sock.s_, res->ai_addr, res->ai_addrlen) < 0) {
+        isc_throw(IOError, "failed to bind test socket");
+    }
+#else
     if (sock.s_ < 0) {
         isc_throw(IOError, "failed to open test socket");
     }
     if (bind(sock.s_, res->ai_addr, res->ai_addrlen) < 0) {
         isc_throw(IOError, "failed to bind test socket");
     }
+#endif
     return (sock.release());
 }
 
 int
-setSocketTimeout(int sock, size_t tv_sec, size_t tv_usec) {
+#ifdef _WIN32
+setSocketTimeout(SOCKET sock, size_t tv_sec, size_t tv_usec)
+#else
+setSocketTimeout(int sock, size_t tv_sec, size_t tv_usec)
+#endif
+{
     const struct timeval timeo = { tv_sec, tv_usec };
     int recv_options = 0;
+#ifdef _WIN32
+    if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO,
+                   (const char *) &timeo, sizeof(timeo))) {
+        isc_throw(IOError,
+                 "set RCVTIMEO failed: " << strerror(WSAGetLastError()));
+    }
+#else
     if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &timeo, sizeof(timeo))) {
         if (errno == ENOPROTOOPT) { // see RecursiveQueryTest::recvUDP()
             recv_options = MSG_DONTWAIT;
@@ -704,13 +824,19 @@ setSocketTimeout(int sock, size_t tv_sec, size_t tv_usec) {
             isc_throw(IOError, "set RCVTIMEO failed: " << strerror(errno));
         }
     }
+#endif
     return (recv_options);
 }
 
 // try to read from the socket max time
 // *num is incremented for every succesfull read
 // returns true if it can read max times, false otherwise
-bool tryRead(int sock, int recv_options, size_t max, int* num) {
+#ifdef _WIN32
+bool tryRead(SOCKET sock, int recv_options, size_t max, int* num)
+#else
+bool tryRead(int sock, int recv_options, size_t max, int* num)
+#endif
+{
     size_t i = 0;
     do {
         char inbuff[512];
@@ -734,7 +860,7 @@ public:
     };
 
     MockResolverCallback(DNSServer* server):
-        result(DEFAULT),
+        result_(DEFAULT),
         server_(server->clone())
     {}
 
@@ -743,16 +869,16 @@ public:
     }
 
     void success(const isc::dns::MessagePtr response) {
-        result = SUCCESS;
+        result_ = SUCCESS;
         server_->resume(true);
     }
 
     void failure() {
-        result = FAILURE;
+        result_ = FAILURE;
         server_->resume(false);
     }
 
-    uint32_t result;
+    uint32_t result_;
 private:
     DNSServer* server_;
 };
@@ -787,7 +913,7 @@ TEST_F(RecursiveQueryTest, forwardQueryTimeout) {
     query.forward(ConstMessagePtr(&query_message), answer, buffer, &server, callback);
     // Run the test
     io_service_.run();
-    EXPECT_EQ(callback->result, MockResolverCallback::FAILURE);
+    EXPECT_EQ(callback->result_, MockResolverCallback::FAILURE);
 }
 
 // If we set client timeout to lower than querytimeout, we should
@@ -822,7 +948,7 @@ TEST_F(RecursiveQueryTest, forwardClientTimeout) {
     query.forward(ConstMessagePtr(&query_message), answer, buffer, &server, callback);
     // Run the test
     io_service_.run();
-    EXPECT_EQ(callback->result, MockResolverCallback::FAILURE);
+    EXPECT_EQ(callback->result_, MockResolverCallback::FAILURE);
 }
 
 // If we set lookup timeout to lower than querytimeout, the lookup
@@ -857,7 +983,7 @@ TEST_F(RecursiveQueryTest, forwardLookupTimeout) {
     query.forward(ConstMessagePtr(&query_message), answer, buffer, &server, callback);
     // Run the test
     io_service_.run();
-    EXPECT_EQ(callback->result, MockResolverCallback::FAILURE);
+    EXPECT_EQ(callback->result_, MockResolverCallback::FAILURE);
 }
 
 // Set everything very low and see if this doesn't cause weird
@@ -892,7 +1018,7 @@ TEST_F(RecursiveQueryTest, lowtimeouts) {
     query.forward(ConstMessagePtr(&query_message), answer, buffer, &server, callback);
     // Run the test
     io_service_.run();
-    EXPECT_EQ(callback->result, MockResolverCallback::FAILURE);
+    EXPECT_EQ(callback->result_, MockResolverCallback::FAILURE);
 }
 
 // as mentioned above, we need a more better framework for this,
diff --git a/src/lib/resolve/tests/recursive_query_unittest_2.cc b/src/lib/resolve/tests/recursive_query_unittest_2.cc
index 2b3d129..bdf6284 100644
--- a/src/lib/resolve/tests/recursive_query_unittest_2.cc
+++ b/src/lib/resolve/tests/recursive_query_unittest_2.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 <iomanip>
@@ -47,6 +49,11 @@
 #include <resolve/recursive_query.h>
 #include <resolve/resolver_interface.h>
 
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4351)
+#endif
+
 using namespace asio;
 using namespace asio::ip;
 using namespace isc::asiolink;
@@ -706,3 +713,7 @@ TEST_F(RecursiveQueryTest2, Resolve) {
 
 } // namespace asiodns
 } // namespace isc
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
diff --git a/src/lib/resolve/tests/recursive_query_unittest_3.cc b/src/lib/resolve/tests/recursive_query_unittest_3.cc
index 168ec80..687577f 100644
--- a/src/lib/resolve/tests/recursive_query_unittest_3.cc
+++ b/src/lib/resolve/tests/recursive_query_unittest_3.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 <iomanip>
@@ -47,6 +49,11 @@
 #include <resolve/recursive_query.h>
 #include <resolve/resolver_interface.h>
 
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4351)
+#endif
+
 using namespace asio;
 using namespace asio::ip;
 using namespace isc::asiolink;
@@ -200,7 +207,8 @@ public:
     /// \param ec ASIO error code, completion code of asynchronous I/O issued
     ///        by the "server" to receive data.
     /// \param length Amount of data received.
-    void udpReceiveHandler(error_code ec = error_code(), size_t length = 0) {
+    void udpReceiveHandler(asio::error_code ec = asio::error_code(),
+                           size_t length = 0) {
         // Expected state should be one greater than the last state.
         EXPECT_EQ(static_cast<int>(expected_), static_cast<int>(last_) + 1);
         last_ = expected_;
@@ -263,7 +271,8 @@ public:
     ///
     /// \param ec Completion error code of the send.
     /// \param length Actual number of bytes sent.
-    void udpSendHandler(error_code ec = error_code(), size_t length = 0) {
+    void udpSendHandler(asio::error_code ec = asio::error_code(),
+                        size_t length = 0) {
         // Check send was OK
         EXPECT_EQ(0, ec.value());
         EXPECT_EQ(udp_length_, length);
@@ -283,7 +292,8 @@ public:
     ///
     /// \param socket Socket on which data will be received
     /// \param ec Boost error code, value should be zero.
-    void tcpAcceptHandler(error_code ec = error_code(), size_t length = 0) {
+    void tcpAcceptHandler(asio::error_code ec = asio::error_code(),
+                          size_t length = 0) {
         // Expect that the accept completed without a problem.
         EXPECT_EQ(0, ec.value());
 
@@ -305,7 +315,8 @@ public:
     /// \param ec ASIO error code, completion code of asynchronous I/O issued
     ///        by the "server" to receive data.
     /// \param length Amount of data received.
-    void tcpReceiveHandler(error_code ec = error_code(), size_t length = 0) {
+    void tcpReceiveHandler(asio::error_code ec = asio::error_code(),
+                           size_t length = 0) {
         // Expect that the receive completed without a problem.
         EXPECT_EQ(0, ec.value());
 
@@ -391,7 +402,7 @@ public:
     /// \param ec Boost error code, value should be zero.
     /// \param length Number of bytes sent.
     void tcpSendHandler(size_t expected_length = 0,
-                        error_code ec = error_code(),
+                        asio::error_code ec = asio::error_code(),
                         size_t length = 0)
     {
         EXPECT_EQ(0, ec.value());       // Expect no error
@@ -565,3 +576,7 @@ TEST_F(RecursiveQueryTest3, Resolve) {
 
 } // namespace asiodns
 } // namespace isc
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
diff --git a/src/lib/resolve/tests/resolve_unittest.cc b/src/lib/resolve/tests/resolve_unittest.cc
index 85d264d..653353a 100644
--- a/src/lib/resolve/tests/resolve_unittest.cc
+++ b/src/lib/resolve/tests/resolve_unittest.cc
@@ -12,6 +12,13 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#endif
+
 #include <iostream>
 #include <gtest/gtest.h>
 
diff --git a/src/lib/resolve/tests/resolver_callback_unittest.cc b/src/lib/resolve/tests/resolver_callback_unittest.cc
index e94f13d..6d6be45 100644
--- a/src/lib/resolve/tests/resolver_callback_unittest.cc
+++ b/src/lib/resolve/tests/resolver_callback_unittest.cc
@@ -12,10 +12,22 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+#include <stdint.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
 #include <gtest/gtest.h>
 #include <asiodns/dns_server.h>
 #include <resolve/resolver_callback.h>
 
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4373)
+#endif
+
 using namespace isc::resolve;
 
 // Dummy subclass for DNSServer*
@@ -88,3 +100,7 @@ TEST_F(ResolverCallbackServerTest, testFailure) {
     EXPECT_TRUE(getResumeCalled());
     EXPECT_FALSE(getResumeValue());
 }
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
diff --git a/src/lib/resolve/tests/run_unittests.cc b/src/lib/resolve/tests/run_unittests.cc
index fe8124e..11b2abe 100644
--- a/src/lib/resolve/tests/run_unittests.cc
+++ b/src/lib/resolve/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>
 
@@ -23,5 +29,13 @@ 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/statistics/counter.cc b/src/lib/statistics/counter.cc
index 53dc58e..9836bab 100644
--- a/src/lib/statistics/counter.cc
+++ b/src/lib/statistics/counter.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_LIBSTATISTICS_EXPORT
+
 #include <vector>
 
 #include <boost/noncopyable.hpp>
diff --git a/src/lib/statistics/counter.h b/src/lib/statistics/counter.h
index 9e467ce..2713db4 100644
--- a/src/lib/statistics/counter.h
+++ b/src/lib/statistics/counter.h
@@ -19,6 +19,7 @@
 #include <boost/scoped_ptr.hpp>
 
 #include <exceptions/exceptions.h>
+#include <statistics/dll.h>
 
 namespace isc {
 namespace statistics {
@@ -26,7 +27,7 @@ namespace statistics {
 // forward declaration for pImpl idiom
 class CounterImpl;
 
-class Counter : boost::noncopyable {
+class ISC_LIBSTATISTICS_API Counter : boost::noncopyable {
 private:
     boost::scoped_ptr<CounterImpl> impl_;
 public:
diff --git a/src/lib/statistics/counter_dict.cc b/src/lib/statistics/counter_dict.cc
index 55353b2..c7bef91 100644
--- a/src/lib/statistics/counter_dict.cc
+++ b/src/lib/statistics/counter_dict.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_LIBSTATISTICS_EXPORT
+
 #include <cassert>
 #include <stdexcept>
 #include <iterator>
@@ -215,20 +217,20 @@ CounterDictionary::end() const {
                CounterDictionaryConstIteratorImpl(impl_->end())));
 }
 
-CounterDictionary::ConstIterator::ConstIterator() :
+ISC_LIBSTATISTICS_API CounterDictionary::ConstIterator::ConstIterator() :
     impl_(new CounterDictionaryConstIteratorImpl())
 {}
 
-CounterDictionary::ConstIterator::~ConstIterator() {}
+ISC_LIBSTATISTICS_API CounterDictionary::ConstIterator::~ConstIterator() {}
 
 // Copy constructor: deep copy of impl_
-CounterDictionary::ConstIterator::ConstIterator(
+ISC_LIBSTATISTICS_API CounterDictionary::ConstIterator::ConstIterator(
     const CounterDictionary::ConstIterator& source) :
     impl_(new CounterDictionaryConstIteratorImpl(*(source.impl_)))
 {}
 
 // Assignment operator: deep copy of impl_
-CounterDictionary::ConstIterator &
+ISC_LIBSTATISTICS_API CounterDictionary::ConstIterator &
 CounterDictionary::ConstIterator::operator=(
     const CounterDictionary::ConstIterator &source)
 {
@@ -237,25 +239,25 @@ CounterDictionary::ConstIterator::operator=(
 }
 
 // The constructor from implementation detail
-CounterDictionary::ConstIterator::ConstIterator(
+ISC_LIBSTATISTICS_API CounterDictionary::ConstIterator::ConstIterator(
     const CounterDictionaryConstIteratorImpl& source) :
     impl_(new CounterDictionaryConstIteratorImpl(source))
 {}
 
-const CounterDictionary::ConstIterator::value_type&
+ISC_LIBSTATISTICS_API const CounterDictionary::ConstIterator::value_type&
 CounterDictionary::ConstIterator::dereference() const
 {
     return (impl_->dereference());
 }
 
-bool
+ISC_LIBSTATISTICS_API bool
 CounterDictionary::ConstIterator::equal(
     CounterDictionary::ConstIterator const& other) const
 {
     return (impl_->equal(*(other.impl_)));
 }
 
-void
+ISC_LIBSTATISTICS_API void
 CounterDictionary::ConstIterator::increment() {
     impl_->increment();
     return;
diff --git a/src/lib/statistics/counter_dict.h b/src/lib/statistics/counter_dict.h
index e322119..22d9b21 100644
--- a/src/lib/statistics/counter_dict.h
+++ b/src/lib/statistics/counter_dict.h
@@ -23,6 +23,7 @@
 #include <boost/iterator/iterator_facade.hpp>
 
 #include <exceptions/exceptions.h>
+#include <statistics/dll.h>
 #include <statistics/counter.h>
 
 namespace isc {
@@ -31,7 +32,7 @@ namespace statistics {
 class CounterDictionaryImpl;
 class CounterDictionaryConstIteratorImpl;
 
-class CounterDictionary : boost::noncopyable {
+class ISC_LIBSTATISTICS_API CounterDictionary : boost::noncopyable {
 private:
     boost::scoped_ptr<CounterDictionaryImpl> impl_;
     // Default constructor is forbidden; number of counter items must be
@@ -98,23 +99,24 @@ public:
             /// This constructor is mostly exception free. But it may still
             /// throw a standard exception if memory allocation fails
             /// inside the method.
-            ConstIterator();
+            ISC_LIBSTATISTICS_API ConstIterator();
             /// The destructor.
             ///
             /// This method never throws an exception.
-            ~ConstIterator();
+            ISC_LIBSTATISTICS_API ~ConstIterator();
             /// The assignment operator.
             ///
             /// This method is mostly exception free. But it may still
             /// throw a standard exception if memory allocation fails
             /// inside the method.
-            ConstIterator& operator=(const ConstIterator &source);
+            ISC_LIBSTATISTICS_API ConstIterator&
+            operator=(const ConstIterator &source);
             /// The copy constructor.
             ///
             /// This constructor is mostly exception free. But it may still
             /// throw a standard exception if memory allocation fails
             /// inside the method.
-            ConstIterator(const ConstIterator& source);
+            ISC_LIBSTATISTICS_API ConstIterator(const ConstIterator& source);
             /// The constructor from implementation detail.
             ///
             /// This method is used to create an instance of ConstIterator
@@ -123,15 +125,15 @@ public:
             /// This constructor is mostly exception free. But it may still
             /// throw a standard exception if memory allocation fails
             /// inside the method.
-            ConstIterator(
+            ISC_LIBSTATISTICS_API ConstIterator(
                 const CounterDictionaryConstIteratorImpl& source);
         private:
             /// \brief An internal method to increment this iterator.
-            void increment();
+            ISC_LIBSTATISTICS_API void increment();
             /// \brief An internal method to check equality.
-            bool equal(const ConstIterator& other) const;
+            ISC_LIBSTATISTICS_API bool equal(const ConstIterator& other) const;
             /// \brief An internal method to dereference this iterator.
-            const value_type& dereference() const;
+            ISC_LIBSTATISTICS_API const value_type& dereference() const;
         private:
             friend class boost::iterator_core_access;
     };
diff --git a/src/lib/statistics/dll.h b/src/lib/statistics/dll.h
new file mode 100644
index 0000000..c830240
--- /dev/null
+++ b/src/lib/statistics/dll.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 __LIBSTATISTICS_H
+#define __LIBSTATISTICS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBSTATISTICS_API
+#else
+#ifdef ISC_LIBSTATISTICS_EXPORT
+#define ISC_LIBSTATISTICS_API __declspec(dllexport)
+#else
+#define ISC_LIBSTATISTICS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBSTATISTICS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/testutils/dll.h b/src/lib/testutils/dll.h
new file mode 100644
index 0000000..d47c882
--- /dev/null
+++ b/src/lib/testutils/dll.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 __LIBTESTUTILS_H
+#define __LIBTESTUTILS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBTESTUTILS_API
+#else
+#ifdef ISC_LIBTESTUTILS_EXPORT
+#define ISC_LIBTESTUTILS_API __declspec(dllexport)
+#else
+#define ISC_LIBTESTUTILS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBTESTUTILS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/testutils/dnsmessage_test.cc b/src/lib/testutils/dnsmessage_test.cc
index ec6914d..687f742 100644
--- a/src/lib/testutils/dnsmessage_test.cc
+++ b/src/lib/testutils/dnsmessage_test.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_LIBTESTUTILS_EXPORT
+
 #include <dns/message.h>
 #include <dns/opcode.h>
 #include <dns/rdata.h>
diff --git a/src/lib/testutils/dnsmessage_test.h b/src/lib/testutils/dnsmessage_test.h
index 57cb72c..d794953 100644
--- a/src/lib/testutils/dnsmessage_test.h
+++ b/src/lib/testutils/dnsmessage_test.h
@@ -28,6 +28,8 @@
 #include <dns/rrclass.h>
 #include <dns/rrset.h>
 
+#include <testutils/dll.h>
+
 #include <gtest/gtest.h>
 
 namespace isc {
@@ -78,7 +80,7 @@ extern const unsigned int CD_FLAG;
 /// \param ancount The expected value of ANCOUNT
 /// \param nscount The expected value of NSCOUNT
 /// \param arcount The expected value of ARCOUNT
-void
+ISC_LIBTESTUTILS_API void
 headerCheck(const isc::dns::Message& message, const isc::dns::qid_t qid,
             const isc::dns::Rcode& rcode,
             const uint16_t opcodeval, const unsigned int flags,
@@ -111,8 +113,9 @@ headerCheck(const isc::dns::Message& message, const isc::dns::qid_t qid,
 ///
 /// \param expected_rrset The expected RRset
 /// \param actual_rrset The RRset to be tested
-void rrsetCheck(isc::dns::ConstRRsetPtr expected_rrset,
-                isc::dns::ConstRRsetPtr actual_rrset);
+ISC_LIBTESTUTILS_API void
+rrsetCheck(isc::dns::ConstRRsetPtr expected_rrset,
+           isc::dns::ConstRRsetPtr actual_rrset);
 
 /// The definitions in this name space are not supposed to be used publicly,
 /// but are given here because they are used in templated functions.
@@ -191,11 +194,12 @@ private:
 /// parameter normally doesn't have to be specified, but for an SOA RR it
 /// must be set to its owner name, due to the internal check of
 /// \c dns::masterLoad().
-isc::dns::RRsetPtr textToRRset(const std::string& text_rrset,
-                               const isc::dns::RRClass& rrclass =
-                               isc::dns::RRClass::IN(),
-                               const isc::dns::Name& origin =
-                               isc::dns::Name::ROOT_NAME());
+ISC_LIBTESTUTILS_API isc::dns::RRsetPtr
+textToRRset(const std::string& text_rrset,
+            const isc::dns::RRClass& rrclass =
+            isc::dns::RRClass::IN(),
+            const isc::dns::Name& origin =
+            isc::dns::Name::ROOT_NAME());
 
 /// Set of unit tests to check if two sets of RRsets are identical.
 ///
diff --git a/src/lib/testutils/lib.h b/src/lib/testutils/lib.h
new file mode 100644
index 0000000..d47c882
--- /dev/null
+++ b/src/lib/testutils/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 __LIBTESTUTILS_H
+#define __LIBTESTUTILS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBTESTUTILS_API
+#else
+#ifdef ISC_LIBTESTUTILS_EXPORT
+#define ISC_LIBTESTUTILS_API __declspec(dllexport)
+#else
+#define ISC_LIBTESTUTILS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBTESTUTILS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/testutils/mockups.h b/src/lib/testutils/mockups.h
index b5def4b..09b7df8 100644
--- a/src/lib/testutils/mockups.h
+++ b/src/lib/testutils/mockups.h
@@ -26,6 +26,8 @@
 
 #include <asiodns/asiodns.h>
 
+#include <testutils/dll.h>
+
 #include <utility>
 #include <vector>
 
@@ -35,7 +37,7 @@ namespace testutils {
 // A minimal mock configuration session.  Most the methods are
 // stubbed out, except for a very basic group_sendmsg() and
 // group_recvmsg().  hasQueuedMessages() always returns false.
-class MockSession : public isc::cc::AbstractSession {
+class ISC_LIBTESTUTILS_API MockSession : public isc::cc::AbstractSession {
 public:
     MockSession() :
         // by default we return a simple "success" message.
@@ -106,15 +108,29 @@ private:
 
 // This mock object does nothing except for recording passed parameters
 // to addServerXXX methods so the test code subsequently checks the parameters.
-class MockDNSService : public isc::asiodns::DNSServiceBase {
+class ISC_LIBTESTUTILS_API MockDNSService :
+ public isc::asiodns::DNSServiceBase {
 public:
     // A helper tuple of parameters passed to addServerUDPFromFD().
     struct UDPFdParams {
+#ifdef _WIN32
+        SOCKET fd;
+#else
         int fd;
+#endif
         int af;
         ServerFlag options;
     };
 
+#ifdef _WIN32
+    virtual void addServerTCPFromFD(SOCKET fd, int af) {
+        tcp_fd_params_.push_back(std::pair<SOCKET, int>(fd, af));
+    }
+    virtual void addServerUDPFromFD(SOCKET fd, int af, ServerFlag options) {
+        UDPFdParams params = { fd, af, options };
+        udp_fd_params_.push_back(params);
+    }
+#else
     virtual void addServerTCPFromFD(int fd, int af) {
         tcp_fd_params_.push_back(std::pair<int, int>(fd, af));
     }
@@ -122,6 +138,7 @@ public:
         UDPFdParams params = { fd, af, options };
         udp_fd_params_.push_back(params);
     }
+#endif
     virtual void clearServers() {}
 
     virtual asiolink::IOService& getIOService() {
@@ -131,7 +148,12 @@ public:
 
     // These two allow the tests to check how the servers have been created
     // through this object.
-    const std::vector<std::pair<int, int> >& getTCPFdParams() const {
+#ifdef _WIN32
+    const std::vector<std::pair<SOCKET, int> >& getTCPFdParams() const
+#else
+    const std::vector<std::pair<int, int> >& getTCPFdParams() const
+#endif
+    {
         return (tcp_fd_params_);
     }
     const std::vector<UDPFdParams>& getUDPFdParams() const {
@@ -139,12 +161,16 @@ public:
     }
 
 private:
+#ifdef _WIN32
+    std::vector<std::pair<SOCKET, int> > tcp_fd_params_;
+#else
     std::vector<std::pair<int, int> > tcp_fd_params_;
+#endif
     std::vector<UDPFdParams> udp_fd_params_;
 };
 
 // A nonoperative DNSServer object to be used in calls to processMessage().
-class MockServer : public isc::asiodns::DNSServer {
+class ISC_LIBTESTUTILS_API MockServer : public isc::asiodns::DNSServer {
 public:
     MockServer() : done_(false) {}
     void operator()(asio::error_code, size_t) {}
@@ -156,7 +182,8 @@ private:
 };
 
 // Mock Xfrout client
-class MockXfroutClient : public isc::xfr::AbstractXfroutClient {
+class ISC_LIBTESTUTILS_API MockXfroutClient :
+ public isc::xfr::AbstractXfroutClient {
 public:
     MockXfroutClient() :
         is_connected_(false), connect_ok_(true), send_ok_(true),
@@ -179,7 +206,12 @@ public:
         is_connected_ = false;
     }
 
-    virtual int sendXfroutRequestInfo(int, const void*, uint16_t) {
+#ifdef _WIN32
+    virtual int sendXfroutRequestInfo(SOCKET, const void*, uint16_t)
+#else
+    virtual int sendXfroutRequestInfo(int, const void*, uint16_t)
+#endif
+    {
         if (!send_ok_) {
             isc_throw(isc::xfr::XfroutError,
                        "xfrout connection send is disabled for test");
diff --git a/src/lib/testutils/portconfig.h b/src/lib/testutils/portconfig.h
index ce1bb39..71856a0 100644
--- a/src/lib/testutils/portconfig.h
+++ b/src/lib/testutils/portconfig.h
@@ -18,6 +18,7 @@
 #include <gtest/gtest.h>
 #include <cc/data.h>
 #include <server_common/portconfig.h>
+#include <testutils/dll.h>
 
 namespace isc {
 namespace testutils {
diff --git a/src/lib/testutils/socket_request.h b/src/lib/testutils/socket_request.h
index 0ae15f3..bdba9ce 100644
--- a/src/lib/testutils/socket_request.h
+++ b/src/lib/testutils/socket_request.h
@@ -20,6 +20,8 @@
 
 #include <asiodns/asiodns.h>
 
+#include <testutils/dll.h>
+
 #include <gtest/gtest.h>
 #include <boost/lexical_cast.hpp>
 
@@ -43,7 +45,8 @@ namespace testutils {
 /// Some member variables are intentionally made public so that test cases
 /// can easily check the value of them.  We prefer convenience for tests over
 /// class integrity here.
-class TestSocketRequestor : public isc::server_common::SocketRequestor {
+class ISC_LIBTESTUTILS_API TestSocketRequestor :
+ public isc::server_common::SocketRequestor {
 public:
     /// \brief Constructor
     ///
diff --git a/src/lib/testutils/srv_test.cc b/src/lib/testutils/srv_test.cc
index d686da6..bb11c71 100644
--- a/src/lib/testutils/srv_test.cc
+++ b/src/lib/testutils/srv_test.cc
@@ -12,10 +12,17 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBTESTUTILS_EXPORT
+
 #include <config.h>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#else
 #include <sys/types.h>
 #include <netinet/in.h>
+#endif
 
 #include <dns/message.h>
 #include <dns/rcode.h>
diff --git a/src/lib/testutils/srv_test.h b/src/lib/testutils/srv_test.h
index a5c516e..5dd0bbd 100644
--- a/src/lib/testutils/srv_test.h
+++ b/src/lib/testutils/srv_test.h
@@ -24,12 +24,13 @@
 #include <dns/rrclass.h>
 #include <dns/rrtype.h>
 
+#include <testutils/dll.h>
 #include "mockups.h"
 
 namespace asiolink {
-class IOSocket;
-class IOMessage;
-class IOEndpoint;
+class ISC_LIBTESTUTILS_API IOSocket;
+class ISC_LIBTESTUTILS_API IOMessage;
+class ISC_LIBTESTUTILS_API IOEndpoint;
 }
 
 namespace isc {
@@ -49,7 +50,7 @@ extern const unsigned int AD_FLAG;
 extern const unsigned int CD_FLAG;
 
 /// \brief The base class for Auth and Recurse test case
-class SrvTestBase : public ::testing::Test {
+class ISC_LIBTESTUTILS_API SrvTestBase : public ::testing::Test {
 protected:
     SrvTestBase();
     virtual ~SrvTestBase();
diff --git a/src/lib/util/buffer.h b/src/lib/util/buffer.h
index 4138016..3e5a27d 100644
--- a/src/lib/util/buffer.h
+++ b/src/lib/util/buffer.h
@@ -15,7 +15,7 @@
 #ifndef __BUFFER_H
 #define __BUFFER_H 1
 
-#include <stdlib.h>
+#include <stddll.h>
 #include <cstring>
 #include <vector>
 
@@ -25,7 +25,7 @@
 
 #include <boost/shared_ptr.hpp>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/util/dll.h b/src/lib/util/dll.h
new file mode 100644
index 0000000..a9442a3
--- /dev/null
+++ b/src/lib/util/dll.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 __LIBUTIL_H
+#define __LIBUTIL_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBUTIL_API
+#else
+#ifdef ISC_LIBUTIL_EXPORT
+#define ISC_LIBUTIL_API __declspec(dllexport)
+#else
+#define ISC_LIBUTIL_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBUTIL_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/util/encode/base16_from_binary.h b/src/lib/util/encode/base16_from_binary.h
index 0a92450..b04dcc1 100644
--- a/src/lib/util/encode/base16_from_binary.h
+++ b/src/lib/util/encode/base16_from_binary.h
@@ -29,7 +29,7 @@ namespace std{
 // See base32hex_from_binary.h for why we need base64_from...hpp here.
 #include <boost/archive/iterators/base64_from_binary.hpp>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 namespace boost { 
 namespace archive {
diff --git a/src/lib/util/encode/base32hex.h b/src/lib/util/encode/base32hex.h
index f1c7307..c9d460d 100644
--- a/src/lib/util/encode/base32hex.h
+++ b/src/lib/util/encode/base32hex.h
@@ -19,7 +19,7 @@
 #include <string>
 #include <vector>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 //
 // Note: this helper module isn't specific to the DNS protocol per se.
diff --git a/src/lib/util/encode/base32hex_from_binary.h b/src/lib/util/encode/base32hex_from_binary.h
index f8c01ae..f244f70 100644
--- a/src/lib/util/encode/base32hex_from_binary.h
+++ b/src/lib/util/encode/base32hex_from_binary.h
@@ -31,7 +31,7 @@ namespace std{
 // simply include the base64 header here.
 #include <boost/archive/iterators/base64_from_binary.hpp>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 namespace boost { 
 namespace archive {
diff --git a/src/lib/util/encode/base64.h b/src/lib/util/encode/base64.h
index 11c6523..cf2b6ec 100644
--- a/src/lib/util/encode/base64.h
+++ b/src/lib/util/encode/base64.h
@@ -19,7 +19,7 @@
 #include <string>
 #include <vector>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 //
 // Note: this helper module isn't specific to the DNS protocol per se.
diff --git a/src/lib/util/encode/binary_from_base16.h b/src/lib/util/encode/binary_from_base16.h
index 49b9b7e..947047f 100644
--- a/src/lib/util/encode/binary_from_base16.h
+++ b/src/lib/util/encode/binary_from_base16.h
@@ -23,7 +23,7 @@
 
 #include <exceptions/exceptions.h>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 namespace boost { 
 namespace archive {
diff --git a/src/lib/util/encode/binary_from_base32hex.h b/src/lib/util/encode/binary_from_base32hex.h
index 1e35a66..e6b23be 100644
--- a/src/lib/util/encode/binary_from_base32hex.h
+++ b/src/lib/util/encode/binary_from_base32hex.h
@@ -25,7 +25,7 @@
 
 #include <exceptions/exceptions.h>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 namespace boost { 
 namespace archive {
diff --git a/src/lib/util/encode/hex.h b/src/lib/util/encode/hex.h
index f8b2e28..cf0eb97 100644
--- a/src/lib/util/encode/hex.h
+++ b/src/lib/util/encode/hex.h
@@ -19,7 +19,7 @@
 #include <string>
 #include <vector>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 //
 // Note: this helper module isn't specific to the DNS protocol per se.
diff --git a/src/lib/util/filename.h b/src/lib/util/filename.h
index c2637c9..ed4f1f7 100644
--- a/src/lib/util/filename.h
+++ b/src/lib/util/filename.h
@@ -17,7 +17,7 @@
 
 #include <string>
 
-#include <util/lib.h>
+#include <util/dll.h>
 #include <util/strutil.h>
 
 namespace isc {
diff --git a/src/lib/util/hash/sha1.h b/src/lib/util/hash/sha1.h
index d455b98..0fd2b9b 100644
--- a/src/lib/util/hash/sha1.h
+++ b/src/lib/util/hash/sha1.h
@@ -35,7 +35,7 @@
 
 #include <stdint.h>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/util/interprocess_sync.h b/src/lib/util/interprocess_sync.h
index 784cbf8..896f697 100644
--- a/src/lib/util/interprocess_sync.h
+++ b/src/lib/util/interprocess_sync.h
@@ -17,7 +17,7 @@
 
 #include <string>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/util/interprocess_sync_file.h b/src/lib/util/interprocess_sync_file.h
index 554f6af..90fdd63 100644
--- a/src/lib/util/interprocess_sync_file.h
+++ b/src/lib/util/interprocess_sync_file.h
@@ -15,7 +15,7 @@
 #ifndef __INTERPROCESS_SYNC_FILE_H__
 #define __INTERPROCESS_SYNC_FILE_H__
 
-#include <util/lib.h>
+#include <util/dll.h>
 #include <util/interprocess_sync.h>
 #include <exceptions/exceptions.h>
 
diff --git a/src/lib/util/interprocess_sync_null.h b/src/lib/util/interprocess_sync_null.h
index 542a294..e4f5f4e 100644
--- a/src/lib/util/interprocess_sync_null.h
+++ b/src/lib/util/interprocess_sync_null.h
@@ -15,7 +15,7 @@
 #ifndef __INTERPROCESS_SYNC_NULL_H__
 #define __INTERPROCESS_SYNC_NULL_H__
 
-#include <util/lib.h>
+#include <util/dll.h>
 #include <util/interprocess_sync.h>
 
 namespace isc {
diff --git a/src/lib/util/io/fd.h b/src/lib/util/io/fd.h
index e8c49c9..9c06503 100644
--- a/src/lib/util/io/fd.h
+++ b/src/lib/util/io/fd.h
@@ -23,7 +23,7 @@
 #include <unistd.h>
 #endif
 
-#include <util/io/lib.h>
+#include <util/io/dll.h>
 
 /**
  * @file fd.h
diff --git a/src/lib/util/io/fd_share.h b/src/lib/util/io/fd_share.h
index c3f02d3..3e75431 100644
--- a/src/lib/util/io/fd_share.h
+++ b/src/lib/util/io/fd_share.h
@@ -21,7 +21,7 @@
  * \todo This interface is very C-ish. Should we have some kind of exceptions?
  */
 
-#include <util/io/lib.h>
+#include <util/io/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/util/io/pktinfo_utilities.h b/src/lib/util/io/pktinfo_utilities.h
index 59da31d..12120f9 100644
--- a/src/lib/util/io/pktinfo_utilities.h
+++ b/src/lib/util/io/pktinfo_utilities.h
@@ -20,7 +20,7 @@
 #include <netinet/in.h>
 #endif
 
-#include <util/io/lib.h>
+#include <util/io/dll.h>
 
 // These definitions in this file are for the convenience of internal
 // implementation and test code, and are not intended to be used publicly.
diff --git a/src/lib/util/io/sockaddr_util.h b/src/lib/util/io/sockaddr_util.h
index d043706..a487d5b 100644
--- a/src/lib/util/io/sockaddr_util.h
+++ b/src/lib/util/io/sockaddr_util.h
@@ -25,7 +25,7 @@
 
 #include <cassert>
 
-#include <util/io/lib.h>
+#include <util/io/dll.h>
 
 // These definitions in this file are for the convenience of internal
 // implementation and test code, and are not intended to be used publicly.
diff --git a/src/lib/util/io/socketsession.h b/src/lib/util/io/socketsession.h
index edbbd80..56ebd3f 100644
--- a/src/lib/util/io/socketsession.h
+++ b/src/lib/util/io/socketsession.h
@@ -27,7 +27,7 @@
 #include <sys/socket.h>
 #endif
 
-#include <util/io/lib.h>
+#include <util/io/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/util/io_utilities.h b/src/lib/util/io_utilities.h
index a6b7bc4..4904f5b 100644
--- a/src/lib/util/io_utilities.h
+++ b/src/lib/util/io_utilities.h
@@ -17,7 +17,7 @@
 
 #include <cstddef>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/util/locks.h b/src/lib/util/locks.h
index 90adda7..a33d707 100644
--- a/src/lib/util/locks.h
+++ b/src/lib/util/locks.h
@@ -26,7 +26,7 @@
 #ifndef __LOCKS_
 #define __LOCKS_
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/util/lru_list.h b/src/lib/util/lru_list.h
index b9f8bd5..290c882 100644
--- a/src/lib/util/lru_list.h
+++ b/src/lib/util/lru_list.h
@@ -21,7 +21,7 @@
 #include <boost/noncopyable.hpp>
 #include <boost/shared_ptr.hpp>
 
-#include <util/lib.h>
+#include <util/dll.h>
 #include <util/locks.h>
 
 namespace isc {
diff --git a/src/lib/util/python/pycppwrapper_util.h b/src/lib/util/python/pycppwrapper_util.h
index cecd62e..666675f 100644
--- a/src/lib/util/python/pycppwrapper_util.h
+++ b/src/lib/util/python/pycppwrapper_util.h
@@ -19,7 +19,7 @@
 
 #include <exceptions/exceptions.h>
 
-#include <util/python/lib.h>
+#include <util/python/dll.h>
 
 /**
  * @file pycppwrapper_util.h
diff --git a/src/lib/util/pyunittests/pyunittests_util.cc b/src/lib/util/pyunittests/pyunittests_util.cc
index 73573f4..a66693d 100644
--- a/src/lib/util/pyunittests/pyunittests_util.cc
+++ b/src/lib/util/pyunittests/pyunittests_util.cc
@@ -16,7 +16,7 @@
 
 #include <stdint.h>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 // see util/time_utilities.h
 namespace isc {
diff --git a/src/lib/util/random/qid_gen.h b/src/lib/util/random/qid_gen.h
index b4dd2ff..75ea9d3 100644
--- a/src/lib/util/random/qid_gen.h
+++ b/src/lib/util/random/qid_gen.h
@@ -25,7 +25,7 @@
 #include <boost/random/uniform_int.hpp>
 #include <boost/random/variate_generator.hpp>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/util/random/random_number_generator.h b/src/lib/util/random/random_number_generator.h
index c2a57e8..ea3db36 100644
--- a/src/lib/util/random/random_number_generator.h
+++ b/src/lib/util/random/random_number_generator.h
@@ -26,7 +26,7 @@
 #include <boost/random/uniform_real.hpp>
 #include <boost/random/variate_generator.hpp>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/util/range_utilities.h b/src/lib/util/range_utilities.h
index d4a1e9b..22f10ac 100644
--- a/src/lib/util/range_utilities.h
+++ b/src/lib/util/range_utilities.h
@@ -15,10 +15,10 @@
 #ifndef __RANGE_UTIL_H_
 #define __RANGE_UTIL_H_ 1
 
-#include <stdlib.h>
+#include <stddll.h>
 #include <algorithm>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 // This header contains useful methods for conduction operations on
 // a range of container elements. Currently the collection is limited,
diff --git a/src/lib/util/strutil.h b/src/lib/util/strutil.h
index b23c6b8..5ac353c 100644
--- a/src/lib/util/strutil.h
+++ b/src/lib/util/strutil.h
@@ -23,7 +23,7 @@
 #include <exceptions/exceptions.h>
 #include <boost/lexical_cast.hpp>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/util/time_utilities.h b/src/lib/util/time_utilities.h
index f8f6359..dd5d8a8 100644
--- a/src/lib/util/time_utilities.h
+++ b/src/lib/util/time_utilities.h
@@ -22,7 +22,7 @@
 
 #include <exceptions/exceptions.h>
 
-#include <util/lib.h>
+#include <util/dll.h>
 
 //
 // Note: this helper module isn't specific to the DNS protocol per se.
diff --git a/src/lib/util/unittests/dll.h b/src/lib/util/unittests/dll.h
new file mode 100644
index 0000000..38e2fd1
--- /dev/null
+++ b/src/lib/util/unittests/dll.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 __LIBUTIL_UNITTESTS_H
+#define __LIBUTIL_UNITTESTS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBUTIL_UNITTESTS_API
+#else
+#ifdef ISC_LIBUTIL_UNITTESTS_EXPORT
+#define ISC_LIBUTIL_UNITTESTS_API __declspec(dllexport)
+#else
+#define ISC_LIBUTIL_UNITTESTS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBUTIL_UNITTESTS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/util/unittests/fork.h b/src/lib/util/unittests/fork.h
index 164c308..48570ea 100644
--- a/src/lib/util/unittests/fork.h
+++ b/src/lib/util/unittests/fork.h
@@ -21,7 +21,7 @@
 #include <unistd.h>
 #endif
 
-#include <util/unittests/lib.h>
+#include <util/unittests/dll.h>
 
 /**
  * @file fork.h
diff --git a/src/lib/util/unittests/mock_socketsession.cc b/src/lib/util/unittests/mock_socketsession.cc
deleted file mode 100644
index 9323dc1..0000000
--- a/src/lib/util/unittests/mock_socketsession.cc
+++ /dev/null
@@ -1,25 +0,0 @@
-// 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_LIBUTIL_UNITTESTS_EXPORT
-
-#include <util/unittests/mock_socketsession.h>
-
-// Instantiate class
-
-class ISC_LIBUTIL_UNITTESTS_API MockSocketSessionForwarder;
-
-// Local Variables:
-// mode: c++
-// End:
diff --git a/src/lib/util/unittests/mock_socketsession.h b/src/lib/util/unittests/mock_socketsession.h
index 2f9d970..aef5eb7 100644
--- a/src/lib/util/unittests/mock_socketsession.h
+++ b/src/lib/util/unittests/mock_socketsession.h
@@ -31,8 +31,6 @@
 #include <cstring>
 #include <vector>
 
-#include <util/unittests/lib.h>
-
 namespace isc {
 namespace util {
 namespace unittests {
@@ -42,7 +40,7 @@ namespace unittests {
 /// It emulates the behavior of SocketSessionForwarder without involving
 /// network communication, and allowing the tester to customize the behavior
 /// and to examine forwarded data afterwards.
-class ISC_LIBUTIL_UNITTESTS_API MockSocketSessionForwarder :
+class MockSocketSessionForwarder :
     public isc::util::io::BaseSocketSessionForwarder
 {
 public:
diff --git a/src/lib/util/unittests/newhook.h b/src/lib/util/unittests/newhook.h
index 182d206..3d2258c 100644
--- a/src/lib/util/unittests/newhook.h
+++ b/src/lib/util/unittests/newhook.h
@@ -15,7 +15,7 @@
 #ifndef __UTIL_UNITTESTS_NEWHOOK_H
 #define __UTIL_UNITTESTS_NEWHOOK_H 1
 
-#include <util/unittests/lib.h>
+#include <util/unittests/dll.h>
 
 /**
  * @file newhook.h
diff --git a/src/lib/util/unittests/resolver.cc b/src/lib/util/unittests/resolver.cc
deleted file mode 100644
index 8e3ef3c..0000000
--- a/src/lib/util/unittests/resolver.cc
+++ /dev/null
@@ -1,25 +0,0 @@
-// 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_LIBUTIL_UNITTESTS_EXPORT
-
-#include <util/unittests/resolver.h>
-
-// Instantiate class
-
-class ISC_LIBUTIL_UNITTESTS_API TestResolver;
-
-// Local Variables:
-// mode: c++
-// End:
diff --git a/src/lib/util/unittests/resolver.h b/src/lib/util/unittests/resolver.h
index 4b401d0..560a892 100644
--- a/src/lib/util/unittests/resolver.h
+++ b/src/lib/util/unittests/resolver.h
@@ -28,8 +28,6 @@
 #include <resolve/resolver_interface.h>
 #include <gtest/gtest.h>
 
-#include <util/unittests/lib.h>
-
 namespace isc {
 namespace util {
 namespace unittests {
@@ -51,8 +49,7 @@ createResponseMessage(isc::dns::RRsetPtr answer_rrset)
 /// This class pretends to be a resolver. However, it only stores the
 /// requests and can answer them right away by prepared answers. It doesn't
 /// do any real work and is intended for testing purposes.
-class ISC_LIBUTIL_UNITTESTS_API TestResolver :
- public isc::resolve::ResolverInterface {
+class TestResolver : public isc::resolve::ResolverInterface {
     private:
         bool checkIndex(size_t index) {
             return (requests.size() > index);
diff --git a/src/lib/util/unittests/resource.h b/src/lib/util/unittests/resource.h
index 9456fa7..1e10735 100644
--- a/src/lib/util/unittests/resource.h
+++ b/src/lib/util/unittests/resource.h
@@ -15,7 +15,7 @@
 #ifndef __UTIL_UNITTESTS_RESOURCE_H
 #define __UTIL_UNITTESTS_RESOURCE_H 1
 
-#include <util/unittests/lib.h>
+#include <util/unittests/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/util/unittests/run_all.h b/src/lib/util/unittests/run_all.h
index 2488088..a0e31b1 100644
--- a/src/lib/util/unittests/run_all.h
+++ b/src/lib/util/unittests/run_all.h
@@ -21,7 +21,7 @@
 
 #include <gtest/gtest.h>
 
-#include <util/unittests/lib.h>
+#include <util/unittests/dll.h>
 
 namespace isc {
 namespace util {
diff --git a/src/lib/util/unittests/testdata.h b/src/lib/util/unittests/testdata.h
index 1ec7a7a..547b9a2 100644
--- a/src/lib/util/unittests/testdata.h
+++ b/src/lib/util/unittests/testdata.h
@@ -15,7 +15,7 @@
 #ifndef __UTIL_UNITTESTS_TESTDATA_H
 #define __UTIL_UNITTESTS_TESTDATA_H 1
 
-#include <util/unittests/lib.h>
+#include <util/unittests/dll.h>
 
 /**
  * @file testdata.h
diff --git a/src/lib/util/unittests/textdata.h b/src/lib/util/unittests/textdata.h
index 850b541..dc2df7e 100644
--- a/src/lib/util/unittests/textdata.h
+++ b/src/lib/util/unittests/textdata.h
@@ -18,7 +18,7 @@
 
 #include <gtest/gtest.h>
 
-#include <util/unittests/lib.h>
+#include <util/unittests/dll.h>
 
 #ifndef __UTIL_UNITTESTS_TEXTDATA_H
 #define __UTIL_UNITTESTS_TEXTDATA_H 1
diff --git a/src/lib/xfr/dll.h b/src/lib/xfr/dll.h
new file mode 100644
index 0000000..8bc2b01
--- /dev/null
+++ b/src/lib/xfr/dll.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/xfrout_client.h b/src/lib/xfr/xfrout_client.h
index 0440235..56e348b 100644
--- a/src/lib/xfr/xfrout_client.h
+++ b/src/lib/xfr/xfrout_client.h
@@ -20,7 +20,7 @@
 #include <string>
 
 #include <exceptions/exceptions.h>
-#include <xfr/lib.h>
+#include <xfr/dll.h>
 
 namespace isc {
 namespace xfr {
diff --git a/win32build/VS2010/bind10.sln b/win32build/VS2010/bind10.sln
index f0b4d7a..041d77b 100755
--- a/win32build/VS2010/bind10.sln
+++ b/win32build/VS2010/bind10.sln
@@ -5,6 +5,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BINDInstall", "BINDInstall\
 	ProjectSection(ProjectDependencies) = postProject
 		{69048307-9655-4AAA-B07E-B67345C1DEF9} = {69048307-9655-4AAA-B07E-B67345C1DEF9}
 		{9F69DE07-D285-4B5C-8528-DF975C59ED3B} = {9F69DE07-D285-4B5C-8528-DF975C59ED3B}
+		{3FFD260A-C606-49D1-A34F-74B78D8DC76F} = {3FFD260A-C606-49D1-A34F-74B78D8DC76F}
 		{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}
@@ -17,19 +18,25 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BINDInstall", "BINDInstall\
 		{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}
+		{67046450-CCEA-4CAC-A05B-17516F3FB540} = {67046450-CCEA-4CAC-A05B-17516F3FB540}
 		{6A29BC58-CA6E-4196-8E88-C675FE944BBF} = {6A29BC58-CA6E-4196-8E88-C675FE944BBF}
+		{55BCB364-62B0-4F93-8B88-38F3349B22C8} = {55BCB364-62B0-4F93-8B88-38F3349B22C8}
 		{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}
+		{F8616086-9CE9-4F32-BC97-8494EADAEC6F} = {F8616086-9CE9-4F32-BC97-8494EADAEC6F}
 		{761E7D88-6CCB-4E41-9F1E-6C1FBBD062F5} = {761E7D88-6CCB-4E41-9F1E-6C1FBBD062F5}
 		{6280D58A-5E05-45D1-8B79-DF677C114CD4} = {6280D58A-5E05-45D1-8B79-DF677C114CD4}
+		{FF298091-A570-41CF-BB91-841ECB7F4E5F} = {FF298091-A570-41CF-BB91-841ECB7F4E5F}
 		{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}
+		{B5D971AD-D95B-4A15-9E31-38AEF4F69627} = {B5D971AD-D95B-4A15-9E31-38AEF4F69627}
 		{EB54F7B8-FAEF-4348-989C-D4E6B42CEFB1} = {EB54F7B8-FAEF-4348-989C-D4E6B42CEFB1}
 		{13D541BC-8365-42F7-840F-A117CA0413DD} = {13D541BC-8365-42F7-840F-A117CA0413DD}
+		{2D4553C4-1AA7-4524-ABC0-6FDF4EEE6F2E} = {2D4553C4-1AA7-4524-ABC0-6FDF4EEE6F2E}
 		{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}
@@ -40,6 +47,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BINDInstall", "BINDInstall\
 		{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}
+		{9C5774EF-E833-4150-8B7A-B6082D879775} = {9C5774EF-E833-4150-8B7A-B6082D879775}
+		{7B80F6F0-E0CD-40D3-87B7-95C2EA2581BA} = {7B80F6F0-E0CD-40D3-87B7-95C2EA2581BA}
 		{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}
@@ -208,7 +217,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libasiodns_tests", "libasio
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnsas", "libnsas\libnsas.vcxproj", "{67046450-CCEA-4CAC-A05B-17516F3FB540}"
 	ProjectSection(ProjectDependencies) = postProject
-		{7EB244E7-D381-4CF4-A2D4-739B81F77588} = {7EB244E7-D381-4CF4-A2D4-739B81F77588}
+		{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}") = "libnsas_tests", "libnsas_tests\libnsas_tests.vcxproj", "{B5D971AD-D95B-4A15-9E31-38AEF4F69627}"
@@ -218,13 +232,20 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnsas_tests", "libnsas_te
 		{13215E3E-E75D-463D-A0EF-93A1C9A20896} = {13215E3E-E75D-463D-A0EF-93A1C9A20896}
 		{67046450-CCEA-4CAC-A05B-17516F3FB540} = {67046450-CCEA-4CAC-A05B-17516F3FB540}
 		{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}
 		{2844FDFB-A0A1-4FA4-A654-15D69CC717DD} = {2844FDFB-A0A1-4FA4-A654-15D69CC717DD}
+		{AEF3DFFE-B566-4E6A-B299-B59B81022C06} = {AEF3DFFE-B566-4E6A-B299-B59B81022C06}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcache", "libcache\libcache.vcxproj", "{F8616086-9CE9-4F32-BC97-8494EADAEC6F}"
 	ProjectSection(ProjectDependencies) = postProject
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
 		{67046450-CCEA-4CAC-A05B-17516F3FB540} = {67046450-CCEA-4CAC-A05B-17516F3FB540}
+		{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}") = "libcache_tests", "libcache_tests\libcache_tests.vcxproj", "{7B80F6F0-E0CD-40D3-87B7-95C2EA2581BA}"
@@ -241,7 +262,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcache_tests", "libcache_
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libresolve", "libresolve\libresolve.vcxproj", "{3FFD260A-C606-49D1-A34F-74B78D8DC76F}"
 	ProjectSection(ProjectDependencies) = postProject
+		{69048307-9655-4AAA-B07E-B67345C1DEF9} = {69048307-9655-4AAA-B07E-B67345C1DEF9}
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
+		{67046450-CCEA-4CAC-A05B-17516F3FB540} = {67046450-CCEA-4CAC-A05B-17516F3FB540}
+		{8F120666-1A69-4506-8546-0F665E80FFB7} = {8F120666-1A69-4506-8546-0F665E80FFB7}
 		{F8616086-9CE9-4F32-BC97-8494EADAEC6F} = {F8616086-9CE9-4F32-BC97-8494EADAEC6F}
+		{2E64F6CC-3AD9-4DA7-8E05-ABBB83F9AFC4} = {2E64F6CC-3AD9-4DA7-8E05-ABBB83F9AFC4}
+		{F6E728D3-A0B2-40F6-9B91-7D4474D778F3} = {F6E728D3-A0B2-40F6-9B91-7D4474D778F3}
+		{7EB244E7-D381-4CF4-A2D4-739B81F77588} = {7EB244E7-D381-4CF4-A2D4-739B81F77588}
+		{AEF3DFFE-B566-4E6A-B299-B59B81022C06} = {AEF3DFFE-B566-4E6A-B299-B59B81022C06}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libresolve_tests", "libresolve_tests\libresolve_tests.vcxproj", "{9C5774EF-E833-4150-8B7A-B6082D879775}"
@@ -261,7 +290,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libresolve_tests", "libreso
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtestutils", "libtestutils\libtestutils.vcxproj", "{55BCB364-62B0-4F93-8B88-38F3349B22C8}"
 	ProjectSection(ProjectDependencies) = postProject
-		{3FFD260A-C606-49D1-A34F-74B78D8DC76F} = {3FFD260A-C606-49D1-A34F-74B78D8DC76F}
+		{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}
+		{F6E728D3-A0B2-40F6-9B91-7D4474D778F3} = {F6E728D3-A0B2-40F6-9B91-7D4474D778F3}
+		{7EB244E7-D381-4CF4-A2D4-739B81F77588} = {7EB244E7-D381-4CF4-A2D4-739B81F77588}
+		{CC29C1F9-A77B-476C-803E-8830F8312571} = {CC29C1F9-A77B-476C-803E-8830F8312571}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdatasrc", "libdatasrc\libdatasrc.vcxproj", "{32624520-5341-471B-B88D-2599DBCDABF5}"
@@ -347,7 +381,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxfr", "libxfr\libxfr.vcx
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdhcp", "libdhcp\libdhcp.vcxproj", "{F27BC0D0-A334-4DC0-9DC9-880D5DA74524}"
 	ProjectSection(ProjectDependencies) = postProject
-		{66C9A5EC-514B-4BDC-AC74-ED4CB465CAAF} = {66C9A5EC-514B-4BDC-AC74-ED4CB465CAAF}
+		{69048307-9655-4AAA-B07E-B67345C1DEF9} = {69048307-9655-4AAA-B07E-B67345C1DEF9}
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdhcp_tests", "libdhcp_tests\libdhcp_tests.vcxproj", "{D9178188-26B3-466B-A85A-C3C3344438BE}"
@@ -569,7 +604,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdns++_mbench", "libdns++
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libstatistics", "libstatistics\libstatistics.vcxproj", "{FF298091-A570-41CF-BB91-841ECB7F4E5F}"
 	ProjectSection(ProjectDependencies) = postProject
-		{F27BC0D0-A334-4DC0-9DC9-880D5DA74524} = {F27BC0D0-A334-4DC0-9DC9-880D5DA74524}
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libstatistics_tests", "libstatistics_tests\libstatistics_tests.vcxproj", "{2D4553C4-1AA7-4524-ABC0-6FDF4EEE6F2E}"
diff --git a/win32build/VS2010/libcache/libcache.vcxproj b/win32build/VS2010/libcache/libcache.vcxproj
index b8cb388..4a324ba 100755
--- a/win32build/VS2010/libcache/libcache.vcxproj
+++ b/win32build/VS2010/libcache/libcache.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\cache\cache_entry_key.h" />
     <ClInclude Include="..\..\..\src\lib\cache\cache_messages.h" />
+    <ClInclude Include="..\..\..\src\lib\cache\lib.h" />
     <ClInclude Include="..\..\..\src\lib\cache\local_zone_data.h" />
     <ClInclude Include="..\..\..\src\lib\cache\logger.h" />
     <ClInclude Include="..\..\..\src\lib\cache\message_cache.h" />
@@ -35,6 +36,7 @@
     <ClCompile Include="..\..\..\src\lib\cache\rrset_cache.cc" />
     <ClCompile Include="..\..\..\src\lib\cache\rrset_copy.cc" />
     <ClCompile Include="..\..\..\src\lib\cache\rrset_entry.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{F8616086-9CE9-4F32-BC97-8494EADAEC6F}</ProjectGuid>
@@ -43,12 +45,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>
@@ -64,10 +66,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>
@@ -81,6 +84,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;liblogd.lib;libdns++d.lib;libnsasd.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\cache
@@ -104,6 +109,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;liblog.lib;libdns++.lib;libnsas.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\cache
diff --git a/win32build/VS2010/libcache/libcache.vcxproj.filters b/win32build/VS2010/libcache/libcache.vcxproj.filters
index 76c7185..e39ec02 100755
--- a/win32build/VS2010/libcache/libcache.vcxproj.filters
+++ b/win32build/VS2010/libcache/libcache.vcxproj.filters
@@ -48,6 +48,9 @@
     <ClInclude Include="..\..\..\src\lib\cache\cache_messages.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\cache\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\cache\cache_entry_key.cc">
@@ -83,5 +86,8 @@
     <ClCompile Include="..\..\..\src\lib\cache\cache_messages.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/libcache_tests/libcache_tests.vcxproj b/win32build/VS2010/libcache_tests/libcache_tests.vcxproj
index 7cd32ce..eafd491 100755
--- a/win32build/VS2010/libcache_tests/libcache_tests.vcxproj
+++ b/win32build/VS2010/libcache_tests/libcache_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_SRCDIR="%BIND10HOME%/src/lib/cache/tests/testdata";TEST_DATA_BUILDDIR="%BIND10HOME%/src/lib/cache/tests/testdata";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;TEST_DATA_SRCDIR="%BIND10HOME%/src/lib/cache/tests/testdata";TEST_DATA_BUILDDIR="%BIND10HOME%/src/lib/cache/tests/testdata";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <CompileAs>CompileAsCpp</CompileAs>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\src\lib\dns;..\..\..\src\lib\cache;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </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;libcryptolink.lib;libdns++.lib;libasiolink.lib;libnsas.lib;libcache.lib;botan.lib;log4cplusSD.lib;gtestd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\liblog\$(Configuration);..\libcryptolink\$(Configuration);..\libdns++\$(Configuration);..\libasiolink\$(Configuration);..\libnsas\$(Configuration);..\libcache\$(Configuration);..\..\..\..\botan\md10\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libutil_unittestsd.lib;liblogd.lib;libcryptolinkd.lib;libdns++d.lib;libasiolinkd.lib;libnsasd.lib;libcached.lib;botand.lib;log4cplusD.lib;gtestd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\botan\v100\$(Configuration);..\..\..\..\log4cplus\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_SRCDIR="%BIND10HOME%/src/lib/cache/tests/testdata";TEST_DATA_BUILDDIR="%BIND10HOME%/src/lib/cache/tests/testdata";NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;TEST_DATA_SRCDIR="%BIND10HOME%/src/lib/cache/tests/testdata";TEST_DATA_BUILDDIR="%BIND10HOME%/src/lib/cache/tests/testdata";NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <CompileAs>CompileAsCpp</CompileAs>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\src\lib\dns;..\..\..\src\lib\cache;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </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;liblog.lib;libcryptolink.lib;libdns++.lib;libasiolink.lib;libnsas.lib;libcache.lib;botan.lib;log4cplusS.lib;gtest.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\liblog\$(Configuration);..\libcryptolink\$(Configuration);..\libdns++\$(Configuration);..\libasiolink\$(Configuration);..\libnsas\$(Configuration);..\libcache\$(Configuration);..\..\..\..\botan\md10\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libcryptolink.lib;libdns++.lib;libasiolink.lib;libnsas.lib;libcache.lib;botan.lib;log4cplus.lib;gtest.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\botan\v100\$(Configuration);..\..\..\..\log4cplus\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
diff --git a/win32build/VS2010/libdhcp/libdhcp.vcxproj b/win32build/VS2010/libdhcp/libdhcp.vcxproj
index 4b0908d..b5ff416 100755
--- a/win32build/VS2010/libdhcp/libdhcp.vcxproj
+++ b/win32build/VS2010/libdhcp/libdhcp.vcxproj
@@ -13,6 +13,7 @@
   <ItemGroup>
     <ClInclude Include="..\..\..\src\lib\dhcp\dhcp4.h" />
     <ClInclude Include="..\..\..\src\lib\dhcp\dhcp6.h" />
+    <ClInclude Include="..\..\..\src\lib\dhcp\dll.h" />
     <ClInclude Include="..\..\..\src\lib\dhcp\iface_mgr.h" />
     <ClInclude Include="..\..\..\src\lib\dhcp\libdhcp++.h" />
     <ClInclude Include="..\..\..\src\lib\dhcp\option.h" />
@@ -37,6 +38,7 @@
     <ClCompile Include="..\..\..\src\lib\dhcp\option6_iaaddr.cc" />
     <ClCompile Include="..\..\..\src\lib\dhcp\pkt4.cc" />
     <ClCompile Include="..\..\..\src\lib\dhcp\pkt6.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{F27BC0D0-A334-4DC0-9DC9-880D5DA74524}</ProjectGuid>
@@ -45,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>
@@ -66,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>
@@ -83,6 +86,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libasiolinkd.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -101,6 +106,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libasiolink.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/win32build/VS2010/libdhcp/libdhcp.vcxproj.filters b/win32build/VS2010/libdhcp/libdhcp.vcxproj.filters
index 2f71595..d2cfd50 100755
--- a/win32build/VS2010/libdhcp/libdhcp.vcxproj.filters
+++ b/win32build/VS2010/libdhcp/libdhcp.vcxproj.filters
@@ -48,6 +48,9 @@
     <ClInclude Include="..\..\..\src\lib\dhcp\option4_addrlst.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\dhcp\dll.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\dhcp\option.cc">
@@ -89,5 +92,8 @@
     <ClCompile Include="..\..\..\src\lib\dhcp\iface_mgr_windows.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/libnsas/libnsas.vcxproj b/win32build/VS2010/libnsas/libnsas.vcxproj
index 5b4c5fe..ebaf38f 100755
--- a/win32build/VS2010/libnsas/libnsas.vcxproj
+++ b/win32build/VS2010/libnsas/libnsas.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">
@@ -20,6 +20,7 @@
     <ClInclude Include="..\..\..\src\lib\nsas\hash_deleter.h" />
     <ClInclude Include="..\..\..\src\lib\nsas\hash_key.h" />
     <ClInclude Include="..\..\..\src\lib\nsas\hash_table.h" />
+    <ClInclude Include="..\..\..\src\lib\nsas\lib.h" />
     <ClInclude Include="..\..\..\src\lib\nsas\nameserver_address.h" />
     <ClInclude Include="..\..\..\src\lib\nsas\nameserver_address_store.h" />
     <ClInclude Include="..\..\..\src\lib\nsas\nameserver_entry.h" />
@@ -41,6 +42,7 @@
     <ClCompile Include="..\..\..\src\lib\nsas\nsas_log.cc" />
     <ClCompile Include="..\..\..\src\lib\nsas\nsas_messages.cc" />
     <ClCompile Include="..\..\..\src\lib\nsas\zone_entry.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{67046450-CCEA-4CAC-A05B-17516F3FB540}</ProjectGuid>
@@ -49,12 +51,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>
@@ -70,10 +72,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>
@@ -87,6 +90,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;liblogd.lib;libdns++d.lib;libasiolinkd.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\nsas
@@ -110,6 +115,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;liblog.lib;libdns++.lib;libasiolink.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\nsas
diff --git a/win32build/VS2010/libnsas/libnsas.vcxproj.filters b/win32build/VS2010/libnsas/libnsas.vcxproj.filters
index e6026be..15c3c0d 100755
--- a/win32build/VS2010/libnsas/libnsas.vcxproj.filters
+++ b/win32build/VS2010/libnsas/libnsas.vcxproj.filters
@@ -69,6 +69,9 @@
     <ClInclude Include="..\..\..\src\lib\nsas\nsas_log.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\nsas\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\nsas\address_entry.cc">
@@ -101,5 +104,8 @@
     <ClCompile Include="..\..\..\src\lib\nsas\nsas_log.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/libnsas_tests/libnsas_tests.vcxproj b/win32build/VS2010/libnsas_tests/libnsas_tests.vcxproj
index b6dce90..72773fd 100755
--- a/win32build/VS2010/libnsas_tests/libnsas_tests.vcxproj
+++ b/win32build/VS2010/libnsas_tests/libnsas_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\nsas;..\..\..\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;libcryptolink.lib;libdns++.lib;libasiolink.lib;libnsas.lib;botan.lib;log4cplusSD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\liblog\$(Configuration);..\libcryptolink\$(Configuration);..\libdns++\$(Configuration);..\libasiolink\$(Configuration);..\libnsas\$(Configuration);..\..\..\..\botan\md10\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libutil_unittestsd.lib;liblogd.lib;libcryptolinkd.lib;libdns++d.lib;libasiolinkd.lib;libnsasd.lib;botand.lib;log4cplusD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <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;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\src\lib\dns;..\..\..\src\lib\nsas;..\..\..\ext\asio;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
@@ -81,12 +81,13 @@
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libcryptolink.lib;libdns++.lib;libasiolink.lib;libnsas.lib;botan.lib;log4cplusS.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\liblog\$(Configuration);..\libcryptolink\$(Configuration);..\libdns++\$(Configuration);..\libasiolink\$(Configuration);..\libnsas\$(Configuration);..\..\..\..\botan\md10\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libcryptolink.lib;libdns++.lib;libasiolink.lib;libnsas.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>
     <ClInclude Include="..\..\..\src\lib\nsas\tests\nsas_test.h" />
+    <ClInclude Include="..\..\..\src\lib\util\unittests\resolver.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\nsas\tests\address_entry_unittest.cc" />
diff --git a/win32build/VS2010/libnsas_tests/libnsas_tests.vcxproj.filters b/win32build/VS2010/libnsas_tests/libnsas_tests.vcxproj.filters
index 1ded4c9..627c285 100755
--- a/win32build/VS2010/libnsas_tests/libnsas_tests.vcxproj.filters
+++ b/win32build/VS2010/libnsas_tests/libnsas_tests.vcxproj.filters
@@ -18,6 +18,9 @@
     <ClInclude Include="..\..\..\src\lib\nsas\tests\nsas_test.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\util\unittests\resolver.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\nsas\tests\address_entry_unittest.cc">
diff --git a/win32build/VS2010/libresolve/libresolve.vcxproj b/win32build/VS2010/libresolve/libresolve.vcxproj
index 6b3df55..bd85d70 100755
--- a/win32build/VS2010/libresolve/libresolve.vcxproj
+++ b/win32build/VS2010/libresolve/libresolve.vcxproj
@@ -11,6 +11,7 @@
     </ProjectConfiguration>
   </ItemGroup>
   <ItemGroup>
+    <ClInclude Include="..\..\..\src\lib\resolve\lib.h" />
     <ClInclude Include="..\..\..\src\lib\resolve\recursive_query.h" />
     <ClInclude Include="..\..\..\src\lib\resolve\resolve.h" />
     <ClInclude Include="..\..\..\src\lib\resolve\resolver_callback.h" />
@@ -26,6 +27,7 @@
     <ClCompile Include="..\..\..\src\lib\resolve\resolve_log.cc" />
     <ClCompile Include="..\..\..\src\lib\resolve\resolve_messages.cc" />
     <ClCompile Include="..\..\..\src\lib\resolve\response_classifier.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{3FFD260A-C606-49D1-A34F-74B78D8DC76F}</ProjectGuid>
@@ -34,12 +36,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>
@@ -55,10 +57,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>
@@ -72,6 +75,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;libasiodnsd.lib;libnsasd.lib;libcached.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\resolve
@@ -95,6 +100,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;libasiodns.lib;libnsas.lib;libcache.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\resolve
diff --git a/win32build/VS2010/libresolve/libresolve.vcxproj.filters b/win32build/VS2010/libresolve/libresolve.vcxproj.filters
index 5fba740..3753e1d 100755
--- a/win32build/VS2010/libresolve/libresolve.vcxproj.filters
+++ b/win32build/VS2010/libresolve/libresolve.vcxproj.filters
@@ -36,6 +36,9 @@
     <ClInclude Include="..\..\..\src\lib\resolve\resolve_messages.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\resolve\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\resolve\recursive_query.cc">
@@ -56,5 +59,8 @@
     <ClCompile Include="..\..\..\src\lib\resolve\resolve_messages.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/libresolve_tests/libresolve_tests.vcxproj b/win32build/VS2010/libresolve_tests/libresolve_tests.vcxproj
index 22d7a29..b27ddf8 100755
--- a/win32build/VS2010/libresolve_tests/libresolve_tests.vcxproj
+++ b/win32build/VS2010/libresolve_tests/libresolve_tests.vcxproj
@@ -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;liblog.lib;libasiolink.lib;libasiodns.lib;libnsas.lib;libcache.lib;libresolve.lib;botan.lib;log4cplusSD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\libcryptolink\$(Configuration);..\libdns++\$(Configuration);..\liblog\$(Configuration);..\libasiolink\$(Configuration);..\libasiodns\$(Configuration);..\libnsas\$(Configuration);..\libcache\$(Configuration);..\libresolve\$(Configuration);..\..\..\..\botan\md10\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libutil_unittestsd.lib;libcryptolinkd.lib;libdns++d.lib;liblogd.lib;libasiolinkd.lib;libasiodnsd.lib;libnsasd.lib;libcached.lib;libresolved.lib;botand.lib;log4cplusD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\botan\v100\$(Configuration);..\..\..\..\log4cplus\v100\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -81,12 +81,13 @@
       <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;libnsas.lib;libcache.lib;libresolve.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);..\libnsas\$(Configuration);..\libcache\$(Configuration);..\libresolve\$(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;libnsas.lib;libcache.lib;libresolve.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>
     <ClInclude Include="..\..\..\src\lib\dns\tests\unittest_util.h" />
+    <ClInclude Include="..\..\..\src\lib\util\unittests\resolver.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\dns\tests\unittest_util.cc" />
diff --git a/win32build/VS2010/libresolve_tests/libresolve_tests.vcxproj.filters b/win32build/VS2010/libresolve_tests/libresolve_tests.vcxproj.filters
index c32e172..1a2aa4e 100755
--- a/win32build/VS2010/libresolve_tests/libresolve_tests.vcxproj.filters
+++ b/win32build/VS2010/libresolve_tests/libresolve_tests.vcxproj.filters
@@ -18,6 +18,9 @@
     <ClInclude Include="..\..\..\src\lib\dns\tests\unittest_util.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\util\unittests\resolver.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\dns\tests\unittest_util.cc">
diff --git a/win32build/VS2010/libstatistics/libstatistics.vcxproj b/win32build/VS2010/libstatistics/libstatistics.vcxproj
index c57e8d2..91b3095 100755
--- a/win32build/VS2010/libstatistics/libstatistics.vcxproj
+++ b/win32build/VS2010/libstatistics/libstatistics.vcxproj
@@ -13,10 +13,12 @@
   <ItemGroup>
     <ClInclude Include="..\..\..\src\lib\statistics\counter.h" />
     <ClInclude Include="..\..\..\src\lib\statistics\counter_dict.h" />
+    <ClInclude Include="..\..\..\src\lib\statistics\dll.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\statistics\counter.cc" />
     <ClCompile Include="..\..\..\src\lib\statistics\counter_dict.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{FF298091-A570-41CF-BB91-841ECB7F4E5F}</ProjectGuid>
@@ -25,12 +27,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>
@@ -46,10 +48,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>
@@ -63,6 +66,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -81,6 +86,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/win32build/VS2010/libstatistics/libstatistics.vcxproj.filters b/win32build/VS2010/libstatistics/libstatistics.vcxproj.filters
index 3e035b9..5ef7ad6 100755
--- a/win32build/VS2010/libstatistics/libstatistics.vcxproj.filters
+++ b/win32build/VS2010/libstatistics/libstatistics.vcxproj.filters
@@ -21,6 +21,9 @@
     <ClInclude Include="..\..\..\src\lib\statistics\counter_dict.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\statistics\dll.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\statistics\counter.cc">
@@ -29,5 +32,8 @@
     <ClCompile Include="..\..\..\src\lib\statistics\counter_dict.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/libstatistics_tests/libstatistics_tests.vcxproj b/win32build/VS2010/libstatistics_tests/libstatistics_tests.vcxproj
index a98e408..3f617c1 100755
--- a/win32build/VS2010/libstatistics_tests/libstatistics_tests.vcxproj
+++ b/win32build/VS2010/libstatistics_tests/libstatistics_tests.vcxproj
@@ -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;..\..\..\..\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>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\liblog\$(Configuration);..\libstatistics\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libstatistics.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;libstatisticsd.lib;log4cplusD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -71,7 +71,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>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
@@ -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);..\libstatistics\$(Configuration);..\..\..\..\log4cplus\md10\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libstatistics.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;libstatistics.lib;log4cplus.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
diff --git a/win32build/VS2010/libtestutils/libtestutils.vcxproj b/win32build/VS2010/libtestutils/libtestutils.vcxproj
index 9144e67..b3ed1e8 100755
--- a/win32build/VS2010/libtestutils/libtestutils.vcxproj
+++ b/win32build/VS2010/libtestutils/libtestutils.vcxproj
@@ -11,6 +11,7 @@
     </ProjectConfiguration>
   </ItemGroup>
   <ItemGroup>
+    <ClInclude Include="..\..\..\src\lib\dns\tests\unittest_util.h" />
     <ClInclude Include="..\..\..\src\lib\testutils\dnsmessage_test.h" />
     <ClInclude Include="..\..\..\src\lib\testutils\mockups.h" />
     <ClInclude Include="..\..\..\src\lib\testutils\portconfig.h" />
@@ -18,6 +19,7 @@
     <ClInclude Include="..\..\..\src\lib\testutils\srv_test.h" />
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\..\src\lib\dns\tests\unittest_util.cc" />
     <ClCompile Include="..\..\..\src\lib\testutils\dnsmessage_test.cc" />
     <ClCompile Include="..\..\..\src\lib\testutils\srv_test.cc" />
   </ItemGroup>
@@ -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,23 +51,26 @@
   </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>
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
       <WarningLevel>Level4</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\ext\asio;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libdns++d.lib;libccd.lib;libxfrd.lib;libasiolinkd.lib;libasiodnsd.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\testutils\testdata
@@ -91,7 +96,7 @@ python %BIND10HOME%/src/lib/util/python/gen_wiredata.py -o simpleresponse_fromWi
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\ext\asio;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
@@ -100,6 +105,8 @@ python %BIND10HOME%/src/lib/util/python/gen_wiredata.py -o simpleresponse_fromWi
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;libdns++.lib;libcc.lib;libxfr.lib;libasiolink.lib;libasiodns.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\testutils\testdata
diff --git a/win32build/VS2010/libtestutils/libtestutils.vcxproj.filters b/win32build/VS2010/libtestutils/libtestutils.vcxproj.filters
index c7f48f9..6330ca8 100755
--- a/win32build/VS2010/libtestutils/libtestutils.vcxproj.filters
+++ b/win32build/VS2010/libtestutils/libtestutils.vcxproj.filters
@@ -30,6 +30,9 @@
     <ClInclude Include="..\..\..\src\lib\testutils\socket_request.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\dns\tests\unittest_util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\testutils\dnsmessage_test.cc">
@@ -38,5 +41,8 @@
     <ClCompile Include="..\..\..\src\lib\testutils\srv_test.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\src\lib\dns\tests\unittest_util.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/win32build/VS2010/libutil_unittests/libutil_unittests.vcxproj b/win32build/VS2010/libutil_unittests/libutil_unittests.vcxproj
index 68410b1..b5caaa6 100755
--- a/win32build/VS2010/libutil_unittests/libutil_unittests.vcxproj
+++ b/win32build/VS2010/libutil_unittests/libutil_unittests.vcxproj
@@ -13,9 +13,7 @@
   <ItemGroup>
     <ClInclude Include="..\..\..\src\lib\util\unittests\fork.h" />
     <ClInclude Include="..\..\..\src\lib\util\unittests\lib.h" />
-    <ClInclude Include="..\..\..\src\lib\util\unittests\mock_socketsession.h" />
     <ClInclude Include="..\..\..\src\lib\util\unittests\newhook.h" />
-    <ClInclude Include="..\..\..\src\lib\util\unittests\resolver.h" />
     <ClInclude Include="..\..\..\src\lib\util\unittests\resource.h" />
     <ClInclude Include="..\..\..\src\lib\util\unittests\run_all.h" />
     <ClInclude Include="..\..\..\src\lib\util\unittests\testdata.h" />
@@ -23,7 +21,6 @@
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\util\unittests\fork.cc" />
-    <ClCompile Include="..\..\..\src\lib\util\unittests\mock_socketsession.cc" />
     <ClCompile Include="..\..\..\src\lib\util\unittests\newhook.cc" />
     <ClCompile Include="..\..\..\src\lib\util\unittests\resource.cc" />
     <ClCompile Include="..\..\..\src\lib\util\unittests\run_all.cc" />
diff --git a/win32build/VS2010/libutil_unittests/libutil_unittests.vcxproj.filters b/win32build/VS2010/libutil_unittests/libutil_unittests.vcxproj.filters
index 6fa6ed6..1f7504f 100755
--- a/win32build/VS2010/libutil_unittests/libutil_unittests.vcxproj.filters
+++ b/win32build/VS2010/libutil_unittests/libutil_unittests.vcxproj.filters
@@ -18,9 +18,6 @@
     <ClInclude Include="..\..\..\src\lib\util\unittests\newhook.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\src\lib\util\unittests\resolver.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\src\lib\util\unittests\fork.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -39,9 +36,6 @@
     <ClInclude Include="..\..\..\src\lib\util\unittests\lib.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\src\lib\util\unittests\mock_socketsession.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\util\unittests\newhook.cc">
@@ -59,9 +53,6 @@
     <ClCompile Include="..\..\..\src\lib\util\unittests\resource.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\src\lib\util\unittests\mock_socketsession.cc">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\dllmain.cc">
       <Filter>Source Files</Filter>
     </ClCompile>



More information about the bind10-changes mailing list