
    mDN Wrapper - Client Side mDN Conversion for Windows

    Copyright (c) 2000 Japan Network Information Center.
                All rights reserved.

    *** IMPORTANT NOTICE ********************************************
    If you install a new version of mDN Wrapper to a machine where
    older version is already installed, you need to rewrap all the
    programs that has been wrapped when you first use the new version.
    This can be done by pressing "Rewrap All" button from the
    configuration GUI.
    *****************************************************************


1. Introduction

    For supporting multi-lingual domain name on Windows, client 
    application should convert domain names (their encodings) to that
    DNS server accepts.  Ofcourse, this requires windows applications to
    handle multi-lingualized domain names in its core, and it is maker's
    responsibility to make program mDN compatible.

    But now, there are still no acceptable standard for mDN, it is
    difficult to expect software providers to create mDN version of the 
    programs.  So, some tricks to make legacy application to do client 
    side mDN conversions.  'dnsproxy' in mDNkit is one of such solution,
    and also this one, WINSOCK Wrapper is another solution.

    On windows, name resolving request is passed to WINSOCK DLL. So,
    replacing WINSOCK DLL with multi-lingual domain name version makes
    legacy windows applications compatible with mDN.

2. Setup and Configuration

    mDN Wrapper, as standard installation, wraps WINSOCK DLL on 
    application's directory.  For this installation, mDN Wrapper
    presents setup program and configuration program.
    
    NOTE:   You can also install mDN wrapper DLLs to wrap WINSOCK at
            system directory.  But this installations is very dangerous.
	    You should try it at your own risk.

2.1. Setup Program

    To install mDN wrapper, run "setup.exe".  Setup program will do:
    
    Install Files
    
        Copy mDN wrapper files (DLL, Program EXE, etc) into diretory
	
	    "\Program Files\JPONIC\mDN Wrapper"

        This directory may be changed on setup sequence.

    Registry setting

        Setup program will create keys and values under registry:
	
	    "HKEY_LOCAL_MACHINES\Software\JPNIC\MDN"

        Encoding        REG_SZ  "RACE"
	
	    Name of DNS encoding.  Default value is "RACE", which is
            current candidate for DNS encoding.  This value may be
            changed with registry editor.

        PerProg         KEY
	
	    Under this key, mDN wrapper set program specific values. mDN
            wrapper uses program's executable name as key, and put
            values under that key.
	    
	    PerProg\<progname>\Where    REG_DWORD Encoding Position
	    PerProg\>progname>\Encoding REG_SZ    Local Encoding Name

            Configuration program set local encpoding name.  "Where"
            value is usually not required in standard installation.  If
            you installed mDN wrapper in system directory, chanage
            "Where" values to fit your environment.

    Creating ICON
    
        Setup program will create program icon for mDN wrapper's
        configuration program, and put it into "Start Menu".  You can
        start configuration program with it.
	   
2.2. Configuration Program

    Configuration program is a tool for wrap specific program, or unwrap
    programs.  If you start "Configuration Program", you'll get window
    link this.

    +---+-------------------------------------------------+---+---+---+
    |   | mDN Wrapper - Configuration                     | _ | O | X |
    +---+-------------------------------------------------+---+---+---+
    |                  Wrapped Program                    +---------+ |
    | +---------------------------------------------+---+ | Wrap..  | |
    | |                                             | A | +---------+ |
    | |                                             +---+ +---------+ |
    | |                                             |   | | Unwrap..| |
    | |                                             |   | +---------+ |
    | |                                             |   | +---------+ |
    | |                                             |   | |UnwrapAll| |
    | |                                             |   | +---------+ |
    | |                                             |   | +---------+ |
    | |                                             |   | |RewrapAll| |
    | |                                             |   | +---------+ |
    | |                                             |   | +---------+ |
    | |                                             |   | |  Log..  | |
    | |                                             |   | +---------+ |
    | |                                             |   | +---------+ |
    | |                                             +---+ |Advanced.| |
    | |                                             | V | +---------+ |
    | +---+-------------------------------------+---+---+ +---------+ |
    | | < |                                     | > |     |  Exit   | |
    | +---+-------------------------------------+---+     +---------+ |
    +-----------------------------------------------------------------+

    Listbox contains list of current wrapped programs.  It initially
    empty.  
    
    To wrap a program, press button "wrap".  You'll get following dialog.
    
    +---+-------------------------------------------------+---+---+---+
    |   | mDN Wrapper - Wrap Executable                   | _ | O | X |
    +---+-------------------------------------------------+---+---+---+
    |           +----------------------------------------+ +--------+ |
    |  Program: |                                        | |Browse..| |
    |           +----------------------------------------+ +--------+ |
    |           +----------+                                          |
    | Encoding: |          |  o Default  o UTF-8                      |
    |           +----------+                                          |
    +-----------------------------------------------------------------+
    |                                           +--------+ +--------+ |
    |                                           |  Wrap  | | Cancel | |
    |                                           +--------+ +--------+ |
    +-----------------------------------------------------------------+

    First, enter program (executable name with full path) or browse
    wrapping exectable from file browser. Then set local encoding of
    that program.  Usually use "Default" as local encoding. If target
    program uses internationalized encoding, then specify "UFT-8". 
    Finally, put "wrap" button to wrap specified program with given
    encoding. Wrapped program will be listed in listbox of the first
    window.

    When you install a new version of mDN Wrapper, you have to re-wrap
    your programs in order to update DLLs used for wrapping.  "Rewrap
    all" button is provided for this purpose.  Just press the button,
    and all the currently wrapped programs will be re-wrapped.

    To unwrap a program, press button "unwrap".  You'll get following 
    confirmating dialog.
    
    +---+-------------------------------------------------+---+---+---+
    |   | mDN Wrapper - Unwrap Executable                 | _ | O | X |
    +---+-------------------------------------------------+---+---+---+
    |           +---------------------------------------------------+ |
    | Program:  |                                                   | |
    |           +---------------------------------------------------+ |
    +-----------------------------------------------------------------+
    |                                           +--------+ +--------+ |
    |                                           | Unwrap | | Cancel | |
    |                                           +--------+ +--------+ |
    +-----------------------------------------------------------------+

    If you unwrapped a program, this program will vanished from listbox
    of the first window.

    Also "Unwrap all" button is provided to unwrap all the programs
    that are currently wrapped.

    To configure logging, press button "log".  You'll get the following
    dialog.

    +---+-------------------------------------------------+---+---+---+
    |   | mDN Wrapper - Log Configuration                 | _ | O | X |
    +---+-------------------------------------------------+---+---+---+
    |    Log Level: o None o Fatal o Error o Warning o Info o Trace   |
    |                                                                 |
    |              +------------------------------------+ +---------+ |
    |     Log File:|                                    | | Browse..| |
    |              +------------------------------------+ +---------+ |
    |               +------+ +--------+                               |
    |Log Operation: | View | | Delete |                               |
    |               +------+ +--------+                               |
    +-----------------------------------------------------------------+
    |                                           +--------+ +--------+ |
    |                                           |   OK   | | Cancel | |
    |                                           +--------+ +--------+ |
    +-----------------------------------------------------------------+

    Logging level can be selected from the followings.
	None	no logging at all
	Fatal   only records fatal errors
	Error	also records non-fatal errors
	Warning	also records warning mssages
	Info	also records informational messages
	Trace	also records trace information
    Note that these levels are for log output from MDN library (libmdn).
    mDN Wrapper itself supports only off (None) and on (the rest).

    Pathname of the log file can also be specified with this dialog.

    You can view the current log file contents by pressing "View" button,
    or delete it by "Delete" button.

    Note that log level and log file configuration doesn't affect already
    running processes.

    Press "advanced" button to invoke the advanced configuration dialog.
    This dialog is for advanced users and enables customization for
    some basic parameters which normal users need not change, since
    appropriate defaults are provided.

    +---+-------------------------------------------------+---+---+---+
    |   | mDN Wrapper - Advanced Configuration            | _ | O | X |
    +---+-------------------------------------------------+---+---+---+
    |                    MDN Wrapping Mode                            |
    |  o Wrap both WINSOCK 1.1 and WINSOCK 2.0                        |
    |  o Wrap only WINSOCK 1.1                                        |
    |  o Wrap only WINSOCK 2.0                                        |
    |  o Wrap only WINSOCK 2.0 if it exists.                          |
    |    Otherwise wrap only WINSOCK 1.1                              |
    +-----------------------------------------------------------------+
    |                       Normalization                             |
    |          Selected                         Available             |
    |  +-----------------------+---+   +-----------------------+---+  |
    |  |                       | A |   |                       | A |  |
    |  |                       +---+   |                       +---+  |
    |  |                       |   |   |                       |   |  |
    |  |                       |   |   |                       |   |  |
    |  |                       |   |   |                       |   |  |
    |  |                       |   |   |                       |   |  |
    |  |                       +---+   |                       +---+  |
    |  |                       | V |   |                       | V |  |
    |  +-----------------------+---+   +-----------------------+---+  |
    |           +-------+  +-------+  +-------+  +-------+            |
    |           |  Add  |  |Remove |  | Clear |  | Reset |            |
    |           +-------+  +-------+  +-------+  +-------+            |
    +-----------------------------------------------------------------+
    |                        DNS Encoding                             |
    |            +--------------------------+                         |
    |  Encoding: |                          |                         |
    |            +--------------------------+                         |
    +-----------------------------------------------------------------+
    |                                           +--------+ +--------+ |
    |                                           |   OK   | | Cancel | |
    |                                           +--------+ +--------+ |
    +-----------------------------------------------------------------+

    With the dialog users can set 3 types of configurations:

    Wrapping Mode
	Customize wrapping mode.  Normally the topmost item should be
	appropriate.  Changing it to other item may help when you
	have problems.

    Normalization
	Customize normalization schemes.  Select one scheme at a time
	in the right listbox, and press "Add" button.  The selected
	scheme will be added to the end of the list of selected
	schemes.  Pressing "Reset" reverts to the default.

    DNS Encoding
	Customize DNS-side domain name encoding.  The default is
	"RACE", which is a reasonable choice, but you can specify any
	encoding MDN library supports.

3. Limitations

3.1. DLL Versions

    Wrapper DLL is tightly coupled with specific DLL version. Wrapper
    DLL is expoected to export all entries including un-documented ones.
    If WINSOCK DLL version changed, mDN wrapper may not work correctly.

    Current mDN Wrapper is confirmed on
    
        WinNT4.0 SP6a   (WINSOCK 1.1 + 2.0)
        Win98           (WINSOCK 1.1 + 2.0)
	Win95 OSR2      (WINSOCK 1.1)

    But there are no assuarance for feature version of windows.

3.2. DNS, WINS, LMHOSTS

    There are three name resolving methods in windows, DNS, WINS and
    LMHOSTS. Using mDN wrapper, domain name conversion will performed 
    on all of thoses methods.  It may cause some trouble if windows 
    using WINS or LMHOSTS.  We recommend use DNS oly if you want to use
    mDN Wrapper.

3.3. Converting Names other than Domain Name

    In WINSOCK 2.0, there are generic name resolution APIs are
    introduced.
    
        WSALookupServiceBeginW
	WSALookupServiceNextW
	WSALookupServiceEnd

    They are use mainly domain name conversion now, but not limited to
    resolving domain name.  mDN wrapper hooks this API and convert
    given name anyway.  This causes some trouble if conversion name is
    not domain name.

3.4. Applications don't use these APIa

    Some applications don't use these APIs to resolving domain names.
    For example, 'nslookup' issue DNS request locally.  For these
    applications, mDN wrapper does not work.

3.5. Applications bined to specific WINSOCK DLL

    SOme apllications are binded to specific DLL, not rely on standard
    DLL search path. Netscape Communicator is oe of such program. mDN
    wrapper in standard installation, cannot wrap such programs.
    
    If you want to wrap those programs, you may use installation into
    system directory.  But this installation is very dangerouse, and
    worst, it make your system cannot boot again.

3.6. But 'dnsproxy' exist

    If you have above problems with your environments, there is 
    'dnsproxy'.  It hooks on DNS transactions, so it is free from above
    problems.  But of course, it is harder to setup, and also cannot work
    with program specific encodings, such as IE, but sometimes, works
    well than mDN wrapper.

4. Registry Setting - Summary

4.1. Priority of Setting

    Settings of mDN Wrapper is placed on registry 
    
        Software\JPNIC\MDN
	
    under HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER.  mDN Wrapper first
    read HKEY_LOCAL_MACHINE, and if HKEY_CURRENT_USER exist, overwrite
    with this one.  Usually set HKEY_LOCAL_MACHINE only.  But if you
    need per user setting, then set HKEY_CURRENT_USER.

    Note that the configuration program reads/writes only
    HKEY_LOCAL_MACHINE.

4.2. Registry Key

    There's common settings and per program settings.
    
_Common Settings

        Software\\JPNIC\\MDN\\Where         Where convert encoding
	                    0: both WINSOCK 1.1 and WINSOCK 2.0
                            1: if WINSOCK 2.0 exist, convert at 2.0 DLL
                               if WINSOCK 1.1 only, convert at 1.1 DLL
			    2: only in WINSOCK1.1
			    3: only in WINSOCK2.0
        Software\\JPNIC\\MDN\\Encoding      DNS Encoding Name
        Software\\JPNIC\\MDN\\Normalize     Normalization Scheme
        Software\\JPNIC\\MDN\\LogLevel      Log Level
        Software\\JPNIC\\MDN\\LogFile       Log File

_Per Program Settings

    Converting position and program's local encoding may be set per
    program bases.

        Software\\JPNIC\\MDN\\PerProg\\<name>\\Where
        Software\\JPNIC\\MDN\\PerProg\\<name>\\Encoding

    If not specified,
    
        Where       0       both 1.1 DLL and 2.0 DLL
	Encoding            process's code page
