Index: dllmain.d
===================================================================
--- dllmain.d	(revision 0)
+++ dllmain.d	(revision 0)
@@ -0,0 +1,33 @@
+// Public Domain
+
+import std.c.windows.windows;
+import std.c.stdio;
+import core.dll_helper;
+
+extern (Windows)
+BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved)
+{
+    switch (ulReason)
+    {
+	case DLL_PROCESS_ATTACH:
+	    dll_process_attach( hInstance, true );
+	    std.c.stdio._fcloseallp = null; // don't cause trouble closing stdout prematurely
+	    break;
+
+	case DLL_PROCESS_DETACH:
+	    dll_process_detach( hInstance, true );
+	    break;
+
+	case DLL_THREAD_ATTACH:
+	    dll_thread_attach( true, true );
+	    break;
+
+	case DLL_THREAD_DETACH:
+	    dll_thread_detach( true, true );
+	    break;
+	    
+	default:
+	    return false;
+    }
+    return true;
+}
Index: phobos.def
===================================================================
--- phobos.def	(revision 0)
+++ phobos.def	(revision 0)
@@ -0,0 +1,672 @@
+LIBRARY "phobos.dll" 
+EXETYPE NT 			
+SUBSYSTEM WINDOWS		
+CODE SHARED EXECUTE	
+DATA WRITE				
+EXPORTS 			
+ __d_throw@4=__d_throw@4 			
+ __d_framehandler=_d_framehandler			
+ __d_local_unwind2=_d_local_unwind2 			
+ ;__minit=_minit 			
+
+ _abort                           = abort                           
+ _abs                             = abs                             
+ _access                          = access                          
+ _acos                            = acos                            
+ _acosf                           = acosf                           
+ _acosh                           = acosh                           
+ _acoshf                          = acoshf                          
+ _acoshl                          = acoshl                          
+ _acosl                           = acosl                           
+ _alloca                          = alloca                          
+ _altzone                         = altzone                         
+ _asctime                         = asctime                         
+ _asin                            = asin                            
+ _asinf                           = asinf                           
+ _asinh                           = asinh                           
+ _asinhf                          = asinhf                          
+ _asinhl                          = asinhl                          
+ _asinl                           = asinl                           
+ _atan                            = atan                            
+ _atan2                           = atan2                           
+ _atan2f                          = atan2f                          
+ _atan2l                          = atan2l                          
+ _atanf                           = atanf                           
+ _atanh                           = atanh                           
+ _atanhf                          = atanhf                          
+ _atanhl                          = atanhl                          
+ _atanl                           = atanl                           
+ _atexit                          = atexit                          
+ _atof                            = atof                            
+ _atoi                            = atoi                            
+ _atol                            = atol                            
+ _atoll                           = atoll                           
+ _bsearch                         = bsearch                         
+ _cabs                            = cabs                            
+ _cabsf                           = cabsf                           
+ _cabsl                           = cabsl                           
+ _cacos                           = cacos                           
+ _cacosf                          = cacosf                          
+ _cacosh                          = cacosh                          
+ _cacoshf                         = cacoshf                         
+ _cacoshl                         = cacoshl                         
+ _cacosl                          = cacosl                          
+ _calloc                          = calloc                          
+ _carg                            = carg                            
+ _cargf                           = cargf                           
+ _cargl                           = cargl                           
+ _casin                           = casin                           
+ _casinf                          = casinf                          
+ _casinh                          = casinh                          
+ _casinhf                         = casinhf                         
+ _casinhl                         = casinhl                         
+ _casinl                          = casinl                          
+ _catan                           = catan                           
+ _catanf                          = catanf                          
+ _catanh                          = catanh                          
+ _catanhf                         = catanhf                         
+ _catanhl                         = catanhl                         
+ _catanl                          = catanl                          
+ _cbrt                            = cbrt                            
+ _cbrtf                           = cbrtf                           
+ _cbrtl                           = cbrtl                           
+ _cconj                           = cconj                           
+ _cconjf                          = cconjf                          
+ _cconjl                          = cconjl                          
+ _ccos                            = ccos                            
+ _ccosf                           = ccosf                           
+ _ccosh                           = ccosh                           
+ _ccoshf                          = ccoshf                          
+ _ccoshl                          = ccoshl                          
+ _ccosl                           = ccosl                           
+ _ceil                            = ceil                            
+ _ceilf                           = ceilf                           
+ _ceill                           = ceill                           
+ _cexp                            = cexp                            
+ _cexpf                           = cexpf                           
+ _cexpl                           = cexpl                           
+ _chdir                           = chdir                           
+; _CheckWin32sVer                  = _CheckWin32sVer                  
+ _chmod                           = chmod                           
+ _chsize                          = chsize                          
+ _clearerr                        = clearerr                        
+ _clock                           = clock                           
+ _clog                            = clog                            
+ _clog10                          = clog10                          
+ _clog10f                         = clog10f                         
+ _clog10l                         = clog10l                         
+ _clogf                           = clogf                           
+ _clogl                           = clogl                           
+ _close                           = close                           
+ _controlc_close                  = controlc_close                  
+ _controlc_open                   = controlc_open                   
+ _copysign                        = copysign                        
+ _copysignf                       = copysignf                       
+ _copysignl                       = copysignl                       
+ _coreleft                        = coreleft                        
+ _cos                             = cos                             
+ _cosf                            = cosf                            
+ _cosh                            = cosh                            
+ _coshf                           = coshf                           
+ _coshl                           = coshl                           
+ _cosl                            = cosl                            
+ _cpow                            = cpow                            
+ _cpowf                           = cpowf                           
+ _cpowl                           = cpowl                           
+ _cproj                           = cproj                           
+ _cprojf                          = cprojf                          
+ _cprojl                          = cprojl                          
+ _cputype                         = cputype                         
+ _creat                           = creat                           
+ _creatnew                        = creatnew                        
+ _creattemp                       = creattemp                       
+ _csin                            = csin                            
+ _csinf                           = csinf                           
+ _csinh                           = csinh                           
+ _csinhf                          = csinhf                          
+ _csinhl                          = csinhl                          
+ _csinl                           = csinl                           
+ _csqrt                           = csqrt                           
+ _csqrtf                          = csqrtf                          
+ _csqrtl                          = csqrtl                          
+ _ctan                            = ctan                            
+ _ctanf                           = ctanf                           
+ _ctanh                           = ctanh                           
+ _ctanhf                          = ctanhf                          
+ _ctanhl                          = ctanhl                          
+ _ctanl                           = ctanl                           
+ _ctime                           = ctime                           
+ _daylight                        = daylight                        
+ _difftime                        = difftime                        
+ _disp_box                        = disp_box                        
+ _disp_close                      = disp_close                      
+ _disp_eeol                       = disp_eeol                       
+ _disp_eeop                       = disp_eeop                       
+ _disp_endstand                   = disp_endstand                   
+ _disp_fillbox                    = disp_fillbox                    
+ _disp_flush                      = disp_flush                      
+ _disp_getattr                    = disp_getattr                    
+ _disp_getmode                    = disp_getmode                    
+ _disp_hidecursor                 = disp_hidecursor                 
+ _disp_move                       = disp_move                       
+ _disp_open                       = disp_open                       
+ _disp_peekbox                    = disp_peekbox                    
+ _disp_peekw                      = disp_peekw                      
+ _disp_pokebox                    = disp_pokebox                    
+ _disp_pokew                      = disp_pokew                      
+ _disp_printf                     = disp_printf                     
+ _disp_putc                       = disp_putc                       
+ _disp_puts                       = disp_puts                       
+ _disp_reset43                    = disp_reset43                    
+ _disp_scroll                     = disp_scroll                     
+ _disp_set43                      = disp_set43                      
+ _disp_setattr                    = disp_setattr                    
+ _disp_setcursortype              = disp_setcursortype              
+ _disp_showcursor                 = disp_showcursor                 
+ _disp_startstand                 = disp_startstand                 
+ _div                             = div                             
+ _dos_abs_disk_read               = dos_abs_disk_read               
+ _dos_abs_disk_write              = dos_abs_disk_write              
+ _dos_close                       = dos_close                       
+ _dos_creat                       = dos_creat                       
+ _dos_exterr                      = dos_exterr                      
+ _dos_get_ctrl_break              = dos_get_ctrl_break              
+ _dos_get_verify                  = dos_get_verify                  
+ _dos_getdate                     = dos_getdate                     
+ _dos_getdiskfreespace            = dos_getdiskfreespace            
+ _dos_getdrive                    = dos_getdrive                    
+ _dos_getfileattr                 = dos_getfileattr                 
+ _dos_getftime                    = dos_getftime                    
+ _dos_gettime                     = dos_gettime                     
+ _dos_open                        = dos_open                        
+ _dos_set_ctrl_break              = dos_set_ctrl_break              
+ _dos_set_verify                  = dos_set_verify                  
+ _dos_setdate                     = dos_setdate                     
+ _dos_setdrive                    = dos_setdrive                    
+ _dos_setfileattr                 = dos_setfileattr                 
+ _dos_setftime                    = dos_setftime                    
+ _dos_settime                     = dos_settime                     
+ _dosexterr                       = dosexterr                       
+ _dup                             = dup                             
+ _dup2                            = dup2                            
+ _ecvt                            = ecvt                            
+ _eof                             = eof                             
+ _erf                             = erf                             
+ _erfc                            = erfc                            
+ _erfcf                           = erfcf                           
+ _erfcl                           = erfcl                           
+ _erff                            = erff                            
+ _erfl                            = erfl                            
+ _errno                           = errno                           
+ _execl                           = execl                           
+ _execle                          = execle                          
+ _execlp                          = execlp                          
+ _execlpe                         = execlpe                         
+ _execv                           = execv                           
+ _execve                          = execve                          
+ _execvp                          = execvp                          
+ _execvpe                         = execvpe                         
+ _exit                            = exit                            
+ _exit_popstate                   = exit_popstate                   
+ _exit_PUSHSTATE                  = exit_PUSHSTATE                  
+ _exp                             = exp                             
+ _exp2                            = exp2                            
+ _exp2f                           = exp2f                           
+ _exp2l                           = exp2l                           
+ _expf                            = expf                            
+ _expl                            = expl                            
+ _expm1                           = expm1                           
+ _expm1f                          = expm1f                          
+ _expm1l                          = expm1l                          
+ _fabs                            = fabs                            
+ _fabsf                           = fabsf                           
+ _fabsl                           = fabsl                           
+ _fatan_chk                       = fatan_chk                       
+ _fclose                          = fclose                          
+ _fcloseall                       = fcloseall                       
+ _fcvt                            = fcvt                            
+ _FDIV_DETECT                     = FDIV_DETECT                     
+ _fdiv_m16i                       = fdiv_m16i                       
+ _fdiv_m32                        = fdiv_m32                        
+ _fdiv_m32i                       = fdiv_m32i                       
+ _fdiv_m64                        = fdiv_m64                        
+ _fdiv_r                          = fdiv_r                          
+ _fdivr_m16i                      = fdivr_m16i                      
+ _fdivr_m32                       = fdivr_m32                       
+ _fdivr_m32i                      = fdivr_m32i                      
+ _fdivr_m64                       = fdivr_m64                       
+ _fdopen                          = fdopen                          
+ _feclearexcept                   = feclearexcept                   
+ _fegetenv                        = fegetenv                        
+ _fegetexceptflag                 = fegetexceptflag                 
+ _fegetprec                       = fegetprec                       
+ _fegetround                      = fegetround                      
+ _feholdexcept                    = feholdexcept                    
+ _feof                            = feof                            
+ _feraiseexcept                   = feraiseexcept                   
+ _ferror                          = ferror                          
+ _fesetenv                        = fesetenv                        
+ _fesetexceptflag                 = fesetexceptflag                 
+ _fesetprec                       = fesetprec                       
+ _fesetround                      = fesetround                      
+ _fetestexcept                    = fetestexcept                    
+ _feupdateenv                     = feupdateenv                     
+ _fflush                          = fflush                          
+ _fgetc                           = fgetc                           
+ _fgetchar                        = fgetchar                        
+ _fgetpos                         = fgetpos                         
+ _fgets                           = fgets                           
+ _fgetwc                          = fgetwc                          
+ _fgetwchar                       = fgetwchar                       
+ _fgetws                          = fgetws                          
+ _file_append                     = file_append                     
+ _file_read                       = file_read                       
+ _file_write                      = file_write                      
+ _filelength                      = filelength                      
+ _filesize                        = filesize                        
+ _FILETIME                        = FILETIME                        
+ _findfirst                       = findfirst                       
+ _findnext                        = findnext                        
+ _floor                           = floor                           
+ _floorf                          = floorf                          
+ _floorl                          = floorl                          
+ _flushall                        = flushall                        
+ _fmod                            = fmod                            
+ _fmodf                           = fmodf                           
+ _fmodl                           = fmodl                           
+ _fnmerge                         = fnmerge                         
+ _fnsplit                         = fnsplit                         
+ _fopen                           = fopen                           
+ _FP_SEG                          = FP_SEG                          
+ _fprintf                         = fprintf                         
+ _fptan_chk                       = fptan_chk                       
+ _fputc                           = fputc                           
+ _fputchar                        = fputchar                        
+ _fputs                           = fputs                           
+ _fputwc                          = fputwc                          
+ _fputwchar                       = fputwchar                       
+ _fputws                          = fputws                          
+ _fread                           = fread                           
+ _free                            = free                            
+ _FREEBUF                         = FREEBUF                         
+ _freopen                         = freopen                         
+ _frexp                           = frexp                           
+ _frexpf                          = frexpf                          
+ _frexpl                          = frexpl                          
+ _fscanf                          = fscanf                          
+ _fseek                           = fseek                           
+ _fsetpos                         = fsetpos                         
+ _fstat                           = fstat                           
+ _ftell                           = ftell                           
+ _fwide                           = fwide                           
+ _fwprintf                        = fwprintf                        
+ _fwrite                          = fwrite                          
+ _fwscanf                         = fwscanf                         
+ _gcvt                            = gcvt                            
+ _getc                            = getc                            
+ _getch                           = getch                           
+ _getchar                         = getchar                         
+ _getche                          = getche                          
+ _getcurdir                       = getcurdir                       
+ _getcwd                          = getcwd                          
+ _getdate                         = getdate                         
+ _getdisk                         = getdisk                         
+ _getDS                           = getDS                           
+ _getenv                          = getenv                          
+ _getftime                        = getftime                        
+ _getpid                          = getpid                          
+ _gets                            = gets                            
+ _gettime                         = gettime                         
+ _getw                            = getw                            
+ _getwc                           = getwc                           
+ _GetWin32sVer                    = GetWin32sVer                    
+ _gmtime                          = gmtime                          
+ _hypot                           = hypot                           
+ _hypotf                          = hypotf                          
+ _hypotl                          = hypotl                          
+ _ilogb                           = ilogb                           
+ _ilogbf                          = ilogbf                          
+ _ilogbl                          = ilogbl                          
+ _imaxabs                         = imaxabs                         
+ _imaxdiv                         = imaxdiv                         
+ _inp                             = inp                             
+ _inpl                            = inpl                            
+ _inpw                            = inpw                            
+ _isalnum                         = isalnum                         
+ _isalpha                         = isalpha                         
+ _isascii                         = isascii                         
+ _isatty                          = isatty                          
+ _isblank                         = isblank                         
+ _iscntrl                         = iscntrl                         
+ _iscsym                          = iscsym                          
+ _iscsymf                         = iscsymf                         
+ _isdigit                         = isdigit                         
+ _isgraph                         = isgraph                         
+ _isleadbyte                      = isleadbyte                      
+ _islower                         = islower                         
+ _isprint                         = isprint                         
+ _ispunct                         = ispunct                         
+ _isspace                         = isspace                         
+ _isupper                         = isupper                         
+ _iswalnum                        = iswalnum                        
+ _iswalpha                        = iswalpha                        
+ _iswascii                        = iswascii                        
+ _iswcntrl                        = iswcntrl                        
+ _iswctype                        = iswctype                        
+ _iswdigit                        = iswdigit                        
+ _iswgraph                        = iswgraph                        
+ _iswlower                        = iswlower                        
+ _iswprint                        = iswprint                        
+ _iswpunct                        = iswpunct                        
+ _iswspace                        = iswspace                        
+ _iswupper                        = iswupper                        
+ _iswxdigit                       = iswxdigit                       
+ _isxdigit                        = isxdigit                        
+ _itoa                            = itoa                            
+ _kbhit                           = kbhit                           
+ _labs                            = labs                            
+ _ldexp                           = ldexp                           
+ _ldexpl                          = ldexpl                          
+ _ldiv                            = ldiv                            
+ _lgamma                          = lgamma                          
+ _lgammaf                         = lgammaf                         
+ _lgammal                         = lgammal                         
+ _llabs                           = llabs                           
+ _lldiv                           = lldiv                           
+ _localeconv                      = localeconv                      
+ _localtime                       = localtime                       
+ _locking                         = locking                         
+ _log                             = log                             
+ _log10                           = log10                           
+ _log10f                          = log10f                          
+ _log10l                          = log10l                          
+ _log1p                           = log1p                           
+ _log1pf                          = log1pf                          
+ _log1pl                          = log1pl                          
+ _log2                            = log2                            
+ _log2f                           = log2f                           
+ _log2l                           = log2l                           
+ _logb                            = logb                            
+ _logbf                           = logbf                           
+ _logbl                           = logbl                           
+ _logf                            = logf                            
+ _logl                            = logl                            
+ _longjmp                         = longjmp                         
+ _lseek                           = lseek                           
+ _ltoa                            = ltoa                            
+ _malloc                          = malloc                          
+ _matherr                         = matherr                         
+ _MAXGAMMA                        = MAXGAMMA                        
+ _mblen                           = mblen                           
+ _mbstowcs                        = mbstowcs                        
+ _mbtowc                          = mbtowc                          
+ _memccpy                         = memccpy                         
+ _memchr                          = memchr                          
+ _memcmp                          = memcmp                          
+ _memcpy                          = memcpy                          
+ _memicmp                         = memicmp                         
+ _memmove                         = memmove                         
+ _memset                          = memset                          
+ _MK_FP                           = MK_FP                           
+ _mkdir                           = mkdir                           
+ _mktemp                          = mktemp                          
+ _mktime                          = mktime                          
+ _modf                            = modf                            
+ _modff                           = modff                           
+ _modfl                           = modfl                           
+ _movedata                        = movedata                        
+ _msleep                          = msleep                          
+ _nan                             = nan                             
+ _nanf                            = nanf                            
+ _nanl                            = nanl                            
+ _nans                            = nans                            
+ _nansf                           = nansf                           
+ _nansl                           = nansl                           
+ _nearbyint                       = nearbyint                       
+ _nearbyintf                      = nearbyintf                      
+ _nearbyintl                      = nearbyintl                      
+ _nextafter                       = nextafter                       
+ _nextafterf                      = nextafterf                      
+ _open                            = open                            
+ _outp                            = outp                            
+ _outpl                           = outpl                           
+ _outpw                           = outpw                           
+ _page_calloc                     = page_calloc                     
+ _page_free                       = page_free                       
+ _page_initialize                 = page_initialize                 
+ _page_malloc                     = page_malloc                     
+ _page_maxfree                    = page_maxfree                    
+ _page_realloc                    = page_realloc                    
+ _perror                          = perror                          
+ _polarl                          = polarl                          
+ _pow                             = pow                             
+ _powf                            = powf                            
+ _powl                            = powl                            
+ _printf                          = printf                          
+ _putc                            = putc                            
+ _putch                           = putch                           
+ _putchar                         = putchar                         
+ _putenv                          = putenv                          
+ _puts                            = puts                            
+ _putw                            = putw                            
+ _putwc                           = putwc                           
+ _qsort                           = qsort                           
+ _raise                           = raise                           
+ _rand                            = rand                            
+ _random                          = random                          
+ _randomize                       = randomize                       
+ _read                            = read                            
+ _realloc                         = realloc                         
+ _remainder                       = remainder                       
+ _remainderf                      = remainderf                      
+ _remainderl                      = remainderl                      
+ _remove                          = remove                          
+ _remquo                          = remquo                          
+ _remquof                         = remquof                         
+ _remquol                         = remquol                         
+ _rename                          = rename                          
+ _rewind                          = rewind                          
+ _rint                            = rint                            
+ _rintf                           = rintf                           
+ _rintl                           = rintl                           
+ _rmdir                           = rmdir                           
+ _rndtol                          = rndtol                          
+ _rndtonl                         = rndtonl                         
+ _round                           = round                           
+ _roundf                          = roundf                          
+ _roundl                          = roundl                          
+ _RTLPoolAlloc                    = RTLPoolAlloc                    
+ _RTLPoolCreate                   = RTLPoolCreate                   
+ _RTLPoolDestroy                  = RTLPoolDestroy                  
+ _RTLPoolFree                     = RTLPoolFree                     
+ _sbrk                            = sbrk                            
+ _scalb                           = scalb                           
+ _scalbf                          = scalbf                          
+ _scanf                           = scanf                           
+ _searchpath                      = searchpath                      
+ _setbuf                          = setbuf                          
+ _setdisk                         = setdisk                         
+ _setjmp                          = setjmp                          
+ _setlocale                       = setlocale                       
+ _setmode                         = setmode                         
+ _setvbuf                         = setvbuf                         
+ _signal                          = signal                          
+ _sin                             = sin                             
+ _sinf                            = sinf                            
+ _sinh                            = sinh                            
+ _sinhf                           = sinhf                           
+ _sinhl                           = sinhl                           
+ _sinl                            = sinl                            
+ _sleep                           = sleep                           
+ _sopen                           = sopen                           
+ _sound_beep                      = sound_beep                      
+ _sound_click                     = sound_click                     
+ _sound_note                      = sound_note                      
+ _spawnl                          = spawnl                          
+ _spawnle                         = spawnle                         
+ _spawnlp                         = spawnlp                         
+ _spawnlpe                        = spawnlpe                        
+ _spawnv                          = spawnv                          
+ _spawnve                         = spawnve                         
+ _spawnvp                         = spawnvp                         
+ _spawnvpe                        = spawnvpe                        
+ _sprintf                         = sprintf                         
+ _sqrt                            = sqrt                            
+ _SQRT2PI                         = SQRT2PI                         
+ _sqrtf                           = sqrtf                           
+ _sqrtl                           = sqrtl                           
+ _sqrtpnt5                        = sqrtpnt5                        
+ _srand                           = srand                           
+ _sscanf                          = sscanf                          
+ _stackavail                      = stackavail                      
+ _stat                            = stat                            
+ _stpcpy                          = stpcpy                          
+ _strcat                          = strcat                          
+ _strchr                          = strchr                          
+ _strcmp                          = strcmp                          
+ _strcmpl                         = strcmpl                         
+ _strcoll                         = strcoll                         
+ _strcpy                          = strcpy                          
+ _strcspn                         = strcspn                         
+ _strdup                          = strdup                          
+ _strerror                        = strerror                        
+ _strftime                        = strftime                        
+ _stricmp                         = stricmp                         
+ _strlen                          = strlen                          
+ _strlwr                          = strlwr                          
+ _strncat                         = strncat                         
+ _strncmp                         = strncmp                         
+ _strncpy                         = strncpy                         
+ _strnicmp                        = strnicmp                        
+ _strnset                         = strnset                         
+ _strpbrk                         = strpbrk                         
+ _strrchr                         = strrchr                         
+ _strrev                          = strrev                          
+ _strset                          = strset                          
+ _strspn                          = strspn                          
+ _strstr                          = strstr                          
+ _strtod                          = strtod                          
+ _strtof                          = strtof                          
+ _strtoimax                       = strtoimax                       
+ _strtok                          = strtok                          
+ _strtol                          = strtol                          
+ _strtold                         = strtold                         
+ _strtoll                         = strtoll                         
+ _strtoul                         = strtoul                         
+ _strtoull                        = strtoull                        
+ _strtoumax                       = strtoumax                       
+ _strupr                          = strupr                          
+ _strxfrm                         = strxfrm                         
+ _swab                            = swab                            
+ _swprintf                        = swprintf                        
+ _swscanf                         = swscanf                         
+ _sys_errlist                     = sys_errlist                     
+ _sys_nerr                        = sys_nerr                        
+ _system                          = system                          
+ _tab_sizeget                     = tab_sizeget                     
+ _tab_sizegetenv                  = tab_sizegetenv                  
+ _tab_sizeputenv                  = tab_sizeputenv                  
+ _tab_sizeset                     = tab_sizeset                     
+ _tan                             = tan                             
+ _tanf                            = tanf                            
+ _tanh                            = tanh                            
+ _tanhf                           = tanhf                           
+ _tanhl                           = tanhl                           
+ _tanl                            = tanl                            
+ _tempnam                         = tempnam                         
+ _tgamma                          = tgamma                          
+ _tgammaf                         = tgammaf                         
+ _tgammal                         = tgammal                         
+ _ThreadStarted                   = ThreadStarted                   
+ _time                            = time                            
+ _timezone                        = timezone                        
+ _tmpfile                         = tmpfile                         
+ _tmpnam                          = tmpnam                          
+ _toascii                         = toascii                         
+ _tolower                         = tolower                         
+ _toupper                         = toupper                         
+ _towlower                        = towlower                        
+ _towupper                        = towupper                        
+; _trace_setdeffilename            = trace_setdeffilename            
+; _trace_setlogfilename            = trace_setlogfilename            
+; _trace_term                      = trace_term                      
+ _trunc                           = trunc                           
+ _truncf                          = truncf                          
+ _truncl                          = truncl                          
+ _tzname                          = tzname                          
+ _tzset                           = tzset                           
+ _ultoa                           = ultoa                           
+ _ungetc                          = ungetc                          
+ _ungetch                         = ungetch                         
+ _ungetwc                         = ungetwc                         
+ _unlink                          = unlink                          
+ _unmangle_ident                  = unmangle_ident                  
+ _unmangle_pt                     = unmangle_pt                     
+ _usleep                          = usleep                          
+ _utime                           = utime                           
+ _vfprintf                        = vfprintf                        
+ _vfscanf                         = vfscanf                         
+ _vfwprintf                       = vfwprintf                       
+ _vprintf                         = vprintf                         
+ _vscanf                          = vscanf                          
+ _vsnprintf                       = vsnprintf                       
+ _vsprintf                        = vsprintf                        
+ _vsscanf                         = vsscanf                         
+ _vswprintf                       = vswprintf                       
+ _vwprintf                        = vwprintf                        
+ _wcscat                          = wcscat                          
+ _wcschr                          = wcschr                          
+ _wcscmp                          = wcscmp                          
+ _wcscoll                         = wcscoll                         
+ _wcscpy                          = wcscpy                          
+ _wcscspn                         = wcscspn                         
+ _wcsftime                        = wcsftime                        
+ _wcslen                          = wcslen                          
+ _wcsncat                         = wcsncat                         
+ _wcsncmp                         = wcsncmp                         
+ _wcsncpy                         = wcsncpy                         
+ _wcspbrk                         = wcspbrk                         
+ _wcsrchr                         = wcsrchr                         
+ _wcsspn                          = wcsspn                          
+ _wcsstr                          = wcsstr                          
+ _wcstod                          = wcstod                          
+ _wcstoimax                       = wcstoimax                       
+ _wcstok                          = wcstok                          
+ _wcstol                          = wcstol                          
+ _wcstold                         = wcstold                         
+ _wcstoll                         = wcstoll                         
+ _wcstombs                        = wcstombs                        
+ _wcstoul                         = wcstoul                         
+ _wcstoull                        = wcstoull                        
+ _wcstoumax                       = wcstoumax                       
+ _wcsxfrm                         = wcsxfrm                         
+ _wctomb                          = wctomb                          
+ _wfnmerge                        = wfnmerge                        
+ _wfnsplit = wfnsplit
+ 
+ ;__acrtused_con = _acrtused_con
+ ;_mainCRTStartup                  = mainCRTStartup                  
+ 
+ ;__except_list = _except_list
+ ___alloca = __alloca
+ __fputwc_nlock = _fputwc_nlock
+ __fputc_nlock = _fputc_nlock
+ 
+  __except_handler3= _except_handler3
+  ___initmbctype= __initmbctype
+ ; __setargv= _setargv
+ ; __cinit= _cinit
+  __environ= _environ
+ ; ___argv= __argv
+ ; __argc= _argc
+  ___xcfilter= __xcfilter
+  __Exit= _Exit
+ ; __clearbss= _clearbss
+  __InitSemaphoreSys= _InitSemaphoreSys
+  __allocinit= _allocinit
+  __thread_init= _thread_init
+  __mbschr= _mbschr
+  __ismbblead = _ismbblead
+  __setenvp = _setenvp
+  ___faterr = __faterr
+  ___callve = __callve
Index: win32.mak
===================================================================
--- win32.mak	(revision 1477)
+++ win32.mak	(working copy)
@@ -8,6 +8,8 @@
 #		Same as make unittest
 #	make phobos.lib
 #		Build phobos.lib
+#	make dll
+#		Build phobos.dll
 #	make clean
 #		Delete unneeded files created by build process
 #	make unittest
@@ -52,7 +54,13 @@
 DMD=$(DIR)\bin\dmd
 #DMD=..\dmd
 DMD=dmd
+MAKE=make
 
+## Tools to build phobos.dll
+LIB=lib
+IMPLIB=implib
+SNN_LIB=$(DIR)\windows\lib\snn.lib
+
 ## Location of where to write the html documentation files
 
 DOCSRC = ../docsrc
@@ -312,9 +320,69 @@
 
 ######################################################
 
+phobos_dynamic.obj : std\zlib.d $(SRCS) win32.mak
+	$(DMD) -c -exportall -of$@ $(DFLAGS) $(SRCS) std\zlib.d
+
+OBJS_DLL = \
+	$(DRUNTIME)\lib\druntime.obj \
+	phobos_dynamic.obj Czlib.obj \
+	$(DRUNTIME)\lib\druntime_dynamic.lib \
+	etc\c\zlib\zlib.lib 
+
+OBJS_SHAREDRTL = \
+	$(DRUNTIME)\lib\dll_helper.obj \
+	$(DRUNTIME)\lib\memory.obj \
+	$(DRUNTIME)\lib\cmain.obj \
+	$(DRUNTIME)\lib\moduleinit.obj \
+	$(DRUNTIME)\src\rt\minit.obj
+
+phobos.dll : dllmain.d phobos.def $(OBJS_DLL) win32.mak
+	$(DMD) -of$@ $(DFLAGS) dllmain.d $(OBJS_DLL) phobos.def
+
+phobos_shared.lib: phobos.dll $(OBJS_SHAREDRTL)
+	# optlink produces corrupted lib with /IMPLIB
+	$(IMPLIB) /noi phobos_shared.lib phobos.dll
+	$(LIB) phobos_shared.lib $(OBJS_SHAREDRTL)
+
+OBJS_SNN = \
+	cinit \
+	clearbss \
+	constart \
+	dllstart \
+	ehinit \
+	excptlst \
+	exit \
+	setargv \
+	tlsdata \
+	tlsseg \
+	winstart
+
+snn_shared.lib: $(SNN_LIB)
+	if not exist snn\nul mkdir snn
+	cd snn
+	$(LIB) -x $(SNN_LIB) $(OBJS_SNN)
+	$(LIB) -c $@ $(OBJS_SNN)
+	cd ..
+
+druntime_dll:
+	+cd $(DRUNTIME) && $(MAKE) -f win32.mak target druntime_dll
+	
+dll: druntime_dll phobos_shared.lib snn_shared.lib
+
+DLL_FILES_TO_CLEAN = \
+	phobos.dll \
+	phobos.map \
+	phobos.obj \
+	phobos_dynamic.obj \
+	phobos_shared.lib \
+	phobos_shared.bak \
+	snn\*.obj snn\*.bak snn\*.lib
+	
+######################################################
+
 etc\c\zlib\zlib.lib:
 	cd etc\c\zlib
-	make -f win32.mak zlib.lib
+	$(MAKE) -f win32.mak zlib.lib
 	cd ..\..\..
 
 ### std
@@ -791,12 +859,13 @@
 
 clean:
 	cd etc\c\zlib
-	make -f win32.mak clean
+	$(MAKE) -f win32.mak clean
 	cd ..\..\..
 	del $(OBJS)
 	del $(DOCS)
 	del unittest.obj unittest.map unittest.exe
 	del phobos.lib
+	del $(DLL_FILES_TO_CLEAN)
 
 cleanhtml:
 	del $(DOCS)
@@ -815,3 +884,9 @@
 	#$(CP) $(SRC_ETC) $(DIR)\src\phobos\etc
 	$(CP) $(SRC_ETC_C) $(DIR)\src\phobos\etc\c
 	$(CP) $(SRC_ZLIB) $(DIR)\src\phobos\etc\c\zlib
+
+install_dll:
+	$(CP) phobos_shared.lib $(DIR)\windows\lib
+	$(CP) snn\snn_shared.lib $(DIR)\windows\lib
+	$(CP) phobos.dll $(DIR)\windows\bin
+
