- Merge to trunk r37270.
authorSamuel Serapion <samuel.serapion@gmail.com>
Mon, 10 Nov 2008 13:52:28 +0000 (13:52 +0000)
committerSamuel Serapion <samuel.serapion@gmail.com>
Mon, 10 Nov 2008 13:52:28 +0000 (13:52 +0000)
- Modified rbuild files to conform to trunk.
- Added spec file for bzip2
- Covert user32 to use pspec and use it for WIN64 specific exports.
- Added liboldnames in rbuild, needed to fix explorer build.
- Comented out code in mingw startup lib that requires linking to kernel32 (mostly security cookie code, which is not used).
- Remove unneeded stubs from amd64stubs.c
- i386 builds again, explorer crashes, need to investigate further.

svn path=/branches/ros-amd64-bringup/; revision=37279

97 files changed:
1  2 
reactos/ReactOS-amd64.rbuild
reactos/base/applications/network/ping/ping.c
reactos/base/applications/notepad/dialog.c
reactos/base/applications/notepad/main.c
reactos/base/shell/explorer/explorer.rbuild
reactos/base/shell/explorer/explorer.rc
reactos/base/system/services/rpcserver.c
reactos/boot/bootdata/packages/reactos.dff
reactos/dll/3rdparty/freetype/freetype.rbuild
reactos/dll/cpl/appwiz-new/appwiz.rbuild
reactos/dll/cpl/appwiz/appwiz.rbuild
reactos/dll/cpl/desk/desk.rbuild
reactos/dll/cpl/input/input.rbuild
reactos/dll/cpl/intl/intl.rbuild
reactos/dll/cpl/joy/joy.rbuild
reactos/dll/cpl/main/main.rbuild
reactos/dll/cpl/ncpa/ncpa.rbuild
reactos/dll/cpl/odbccp32/odbccp32.rbuild
reactos/dll/cpl/powercfg/powercfg.rbuild
reactos/dll/cpl/sysdm/startrec.c
reactos/dll/cpl/sysdm/sysdm.rbuild
reactos/dll/cpl/telephon/telephon.rbuild
reactos/dll/cpl/timedate/timedate.rbuild
reactos/dll/cpl/usrmgr/usrmgr.rbuild
reactos/dll/directx/d3d8/d3d8.rbuild
reactos/dll/directx/d3d9/adapter.c
reactos/dll/ntdll/ntdll.rbuild
reactos/dll/win32/advapi32/advapi32.rbuild
reactos/dll/win32/advapi32/reg/reg.c
reactos/dll/win32/advapi32/sec/misc.c
reactos/dll/win32/comctl32/comctl32.rbuild
reactos/dll/win32/crtdll/crtdll.rbuild
reactos/dll/win32/fmifs/fmifs.rbuild
reactos/dll/win32/gdi32/gdi32.rbuild
reactos/dll/win32/gdi32/misc/stubs.c
reactos/dll/win32/glu32/glu32.rbuild
reactos/dll/win32/kernel32/kernel32.rbuild
reactos/dll/win32/kernel32/misc/stubs.c
reactos/dll/win32/kernel32/process/proc.c
reactos/dll/win32/lsasrv/lsasrv.c
reactos/dll/win32/lsasrv/lsasrv.rbuild
reactos/dll/win32/msafd/misc/dllmain.c
reactos/dll/win32/msafd/msafd.rbuild
reactos/dll/win32/msvcrt/msvcrt-i386.def
reactos/dll/win32/msvcrt/msvcrt.rbuild
reactos/dll/win32/msvcrt20/msvcrt20.spec
reactos/dll/win32/msvcrt40/msvcrt40.rbuild
reactos/dll/win32/ole32/ole32.spec
reactos/dll/win32/opengl32/opengl32.rbuild
reactos/dll/win32/rpcrt4/rpcrt4.rbuild
reactos/dll/win32/secur32/secur32.rbuild
reactos/dll/win32/user32/misc/stubs.c
reactos/dll/win32/user32/user32.pspec
reactos/dll/win32/user32/user32.rbuild
reactos/dll/win32/userenv/userenv.rbuild
reactos/dll/win32/winspool/winspool.rbuild
reactos/dll/win32/ws2_32/ws2_32.rbuild
reactos/drivers/base/bootvid/bootvid.rbuild
reactos/drivers/base/kdcom/kdcom.rbuild
reactos/drivers/network/afd/afd/lock.c
reactos/drivers/storage/floppy/floppy.c
reactos/drivers/storage/scsiport/scsiport.rbuild
reactos/hal/hal/hal.rbuild
reactos/include/psdk/winnt.h
reactos/include/psdk/winuser.h
reactos/include/reactos/win32k/ntuser.h
reactos/lib/3rdparty/bzip2/bzip2.rbuild
reactos/lib/3rdparty/bzip2/unbzip2.def
reactos/lib/3rdparty/bzip2/unbzip2.spec
reactos/lib/3rdparty/libxml2/libxml2.rbuild
reactos/lib/3rdparty/mingw/crtexe.c
reactos/lib/3rdparty/mingw/gccmain.c
reactos/lib/3rdparty/mingw/mingw.rbuild
reactos/lib/rtl/rtlp.h
reactos/lib/sdk/crt/include/internal/file.h
reactos/lib/sdk/crt/stdio/file.c
reactos/ntoskrnl/amd64stubs.c
reactos/ntoskrnl/include/internal/ke.h
reactos/ntoskrnl/include/internal/ke_x.h
reactos/ntoskrnl/kdbg/kdb.c
reactos/ntoskrnl/ke/bug.c
reactos/ntoskrnl/ke/clock.c
reactos/ntoskrnl/ke/dpc.c
reactos/ntoskrnl/ke/i386/cpu.c
reactos/ntoskrnl/ke/queue.c
reactos/ntoskrnl/ke/thrdschd.c
reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild
reactos/ntoskrnl/ntoskrnl.pspec
reactos/subsystems/win32/win32k/ntuser/callback.c
reactos/subsystems/win32/win32k/ntuser/hook.c
reactos/subsystems/win32/win32k/ntuser/menu.c
reactos/subsystems/win32/win32k/ntuser/misc.c
reactos/tools/nci/ncitool.c
reactos/tools/rbuild/backend/mingw/mingw.cpp
reactos/tools/rbuild/module.cpp
reactos/tools/widl/client.c
reactos/tools/winebuild/spec32.c

index 46d9d72,0000000..bd76338
mode 100644,000000..100644
--- /dev/null
@@@ -1,230 -1,0 +1,230 @@@
-       <linkerflag>-enable-stdcall-fixup</linkerflag>
 +<?xml version="1.0"?>
 +<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
 +<project name="ReactOS" makefile="makefile-amd64.auto" xmlns:xi="http://www.w3.org/2001/XInclude">
 +      <xi:include href="config-amd64.rbuild">
 +              <xi:fallback>
 +                      <xi:include href="config-amd64.template.rbuild" />
 +              </xi:fallback>
 +      </xi:include>
 +
 +      <define name="_M_AMD64" />
 +      <define name="_AMD64_" />
 +      <define name="_M_AXP64" />
 +      <define name="__x86_64__" />
 +      <define name="_X86AMD64_" />
 +      <define name="_WIN64" />
 +      <define name="TARGET_amd64" host="true" />
 +
 +      <property name="PLATFORM" value="PC"/>
 +      <property name="usewrc" value="false"/>
 +      <property name="WINEBUILD_FLAGS" value="--kill-at"/>
 +      <property name="NTOSKRNL_SHARED" value="-shared"/>
-       <compilerflag>-Wno-uninitialized</compilerflag>
-       <linkerflag>-enable-stdcall-fixup</linkerflag>
++      <linkerflag>-disable-stdcall-fixup</linkerflag>
 +      <compilerflag>-U_X86_</compilerflag>
 +
 +      <if property="OPTIMIZE" value="1">
 +              <compilerflag>-Os</compilerflag>
 +              <compilerflag>-ftracer</compilerflag>
 +              <compilerflag>-momit-leaf-frame-pointer</compilerflag>
 +      </if>
 +      <if property="OPTIMIZE" value="2">
 +              <compilerflag>-Os</compilerflag>
 +      </if>
 +      <if property="OPTIMIZE" value="3">
 +              <compilerflag>-O1</compilerflag>
 +      </if>
 +      <if property="OPTIMIZE" value="4">
 +              <compilerflag>-O2</compilerflag>
 +      </if>
 +      <if property="OPTIMIZE" value="5">
 +              <compilerflag>-O3</compilerflag>
 +      </if>
 +
 +      <compilerflag>-mpreferred-stack-boundary=4</compilerflag>
 +      <compilerflag>-fno-strict-aliasing</compilerflag>
 +      <compilerflag>-Wno-strict-aliasing</compilerflag>
++      <compilerflag>-fno-ira</compilerflag>
 +      <compilerflag>-Wpointer-arith</compilerflag>
++      <linkerflag>-disable-stdcall-fixup</linkerflag>
 +      <linkerflag>-static</linkerflag>
 +
 +<!-- Here starts <xi:include href="ReactOS-generic.rbuild" /> -->
 +
 +      <xi:include href="baseaddress.rbuild" />
 +
 +      <define name="__REACTOS__" />
 +      <if property="DBG" value="1">
 +              <define name="DBG">1</define>
 +              <define name="_SEH_ENABLE_TRACE" />
 +              <property name="DBG_OR_KDBG" value="true" />
 +      </if>
 +      <if property="KDBG" value="1">
 +              <define name="KDBG">1</define>
 +              <property name="DBG_OR_KDBG" value="true" />
 +      </if>
 +
 +      <!-- The version target valid values are: Nt4 , NT5 , NT51 -->
 +      <property name="VERSION_TARGET" value="NT52" />
 +
 +      <if property="VERSION_TARGET" value="NT4">
 +              <define name="WINVER" overridable="true">0x400</define>
 +              <define name="_WIN32_IE">0x600</define>
 +              <define name="_WIN32_WINNT" overridable="true">0x400</define>
 +              <define name="_WIN32_WINDOWS">0x400</define>
 +              <define name="_SETUPAPI_VER">0x400</define>
 +      </if>
 +
 +      <if property="VERSION_TARGET" value="NT5">
 +              <define name="WINVER" overridable="true">0x500</define>
 +              <define name="_WIN32_IE">0x600</define>
 +              <define name="_WIN32_WINNT" overridable="true">0x500</define>
 +              <define name="_WIN32_WINDOWS">0x500</define>
 +              <define name="_SETUPAPI_VER">0x500</define>
 +      </if>
 +
 +      <if property="VERSION_TARGET" value="NT51">
 +              <define name="WINVER" overridable="true">0x501</define>
 +              <define name="_WIN32_IE">0x600</define>
 +              <define name="_WIN32_WINNT" overridable="true">0x501</define>
 +              <define name="_WIN32_WINDOWS">0x501</define>
 +              <define name="_SETUPAPI_VER">0x501</define>
 +      </if>
 +
 +      <if property="VERSION_TARGET" value="NT52">
 +              <define name="WINVER" overridable="true">0x502</define>
 +              <define name="_WIN32_IE">0x600</define>
 +              <define name="_WIN32_WINNT" overridable="true">0x502</define>
 +              <define name="_WIN32_WINDOWS">0x502</define>
 +              <define name="_SETUPAPI_VER">0x502</define>
 +      </if>
 +
 +      <if property="VERSION_TARGET" value="NT6">
 +              <define name="WINVER" overridable="true">0x600</define>
 +              <define name="_WIN32_IE">0x600</define>
 +              <define name="_WIN32_WINNT" overridable="true">0x600</define>
 +              <define name="_WIN32_WINDOWS">0x600</define>
 +              <define name="_SETUPAPI_VER">0x600</define>
 +      </if>
 +
 +      <include>.</include>
 +      <include>include</include>
 +      <include root="intermediate">include</include>
 +      <include>include/psdk</include>
 +      <include root="intermediate">include/psdk</include>
 +      <include>include/dxsdk</include>
 +      <include root="intermediate">include/dxsdk</include>
 +      <include>include/crt</include>
 +      <include>include/crt/mingw32</include>
 +      <include>include/ddk</include>
 +      <include>include/GL</include>
 +      <include>include/ndk</include>
 +      <include>include/reactos</include>
 +      <include root="intermediate">include/reactos</include>
 +      <include root="intermediate">include/reactos/mc</include>
 +      <include>include/reactos/libs</include>
 +
 +      <include host="true">include</include>
 +      <include host="true" root="intermediate">include</include>
 +      <include host="true">include/reactos</include>
 +      <include host="true">include/reactos/wine</include>
 +
 +      <!-- directory name="base">
 +              <xi:include href="base/base.rbuild" />
 +      </directory -->
 +
 +      <directory name="boot">
 +              <xi:include href="boot/boot.rbuild" />
 +      </directory>
 +
 +      <!-- directory name="dll">
 +              <xi:include href="dll/dll.rbuild" />
 +      </directory -->
 +
 +      <directory name="drivers">
 +              <directory name="base">
 +                      <xi:include href="drivers/base/directory.rbuild" />
 +              </directory>
 +              <directory name="filesystems">
 +                      <directory name="cdfs">
 +                              <xi:include href="drivers/filesystems/cdfs/cdfs.rbuild" />
 +                      </directory>
 +                      <directory name="fastfat">
 +                              <xi:include href="drivers/filesystems/fastfat/vfatfs.rbuild" />
 +                      </directory>
 +                      <directory name="ext2">
 +                              <!-- xi:include href="drivers/filesystems/ext2/ext2.rbuild" / -->
 +                      </directory>
 +              </directory>
 +              <directory name="input">
 +                      <xi:include href="drivers/input/directory.rbuild" />
 +              </directory>
 +              <directory name="network">
 +                      <directory name="ndis">
 +                              <xi:include href="drivers/network/ndis/ndis.rbuild" />
 +                      </directory>
 +                      <directory name="tcpip">
 +                              <xi:include href="drivers/network/tcpip/tcpip.rbuild" />
 +                      </directory>
 +              </directory>
 +              <directory name="setup">
 +                      <xi:include href="drivers/setup/directory.rbuild" />
 +              </directory>
 +              <directory name="storage">
 +                      <directory name="class">
 +                              <directory name="cdrom">
 +                                      <xi:include href="drivers/storage/class/cdrom/cdrom.rbuild" />
 +                              </directory>
 +                              <directory name="class2">
 +                                      <xi:include href="drivers/storage/class/class2/class2.rbuild" />
 +                              </directory>
 +                              <directory name="disk">
 +                                      <xi:include href="drivers/storage/class/disk/disk.rbuild" />
 +                              </directory>
 +                      </directory>
 +                      <directory name="floppy">
 +                              <xi:include href="drivers/storage/floppy/floppy.rbuild" />
 +                      </directory>
 +                      <directory name="ide">
 +                              <directory name="atapi">
 +                                      <xi:include href="drivers/storage/ide/atapi/atapi.rbuild" />
 +                              </directory>
 +                      </directory>
 +                      <directory name="port">
 +                              <xi:include href="drivers/storage/port/directory.rbuild" />
 +                      </directory>
 +                      <directory name="scsiport">
 +                              <xi:include href="drivers/storage/scsiport/scsiport.rbuild" />
 +                      </directory>
 +              </directory>
 +      </directory>
 +
 +      <directory name="hal">
 +              <xi:include href="hal/hal.rbuild" />
 +      </directory>
 +
 +      <directory name="include">
 +              <xi:include href="include/directory.rbuild" />
 +      </directory>
 +      <directory name="lib">
 +              <xi:include href="lib/lib.rbuild" />
 +      </directory>
 +
 +      <directory name="media">
 +              <xi:include href="media/media.rbuild" />
 +      </directory>
 +
 +      <directory name="ntoskrnl">
 +              <xi:include href="ntoskrnl/ntoskrnl-amd64hack.rbuild" />
 +      </directory>
 +
 +      <!-- directory name="subsystems">
 +              <xi:include href="subsystems/subsystems.rbuild" />
 +      </directory -->
 +
 +      <directory name="tools">
 +              <xi:include href="tools/tools.rbuild" />
 +      </directory>
 +
 +<!-- Here ends <xi:include href="ReactOS-generic.rbuild" /> -->
 +
 +</project>
  
  #define NDEBUG
  
- #ifndef _MSC_VER
- /* Should be in the header files somewhere (exported by ntdll.dll) */
- long atol(const char *str);
- #ifndef __int64
- typedef long long __int64;
- #endif
- char * _i64toa(__int64 value, char *string, int radix);
- #endif /* _MSC_VER */
  /* General ICMP constants */
  #define ICMP_MINSIZE        8     /* Minimum ICMP packet size */
  #define ICMP_MAXSIZE        65535 /* Maximum ICMP packet size */
@@@ -233,7 -220,7 +220,7 @@@ static BOOL ParseCmdline(int argc, char
                      DataSize = GetULONG2(&argv[i][2], argv[i + 1], &i);
                      if (DataSize > ICMP_MAXSIZE - sizeof(ICMP_ECHO_PACKET))
                      {
 -                        printf("Bad value for option -l, valid range is from 0 to %d.\n",
 +                        printf("Bad value for option -l, valid range is from 0 to %I64d.\n",
                              ICMP_MAXSIZE - sizeof(ICMP_ECHO_PACKET));
                          return FALSE;
                     }
@@@ -466,7 -453,7 +453,7 @@@ static BOOL DecodeResponse(PCHAR buffer
      }
  
  
 -    printf("Reply from %s: bytes=%d time%s%s TTL=%d\n", inet_ntoa(from->sin_addr),
 +    printf("Reply from %s: bytes=%I64d time%s%s TTL=%d\n", inet_ntoa(from->sin_addr),
        size - IphLength - sizeof(ICMP_ECHO_PACKET), Sign, Time, IpHeader->TTL);
      if (RelativeTime.QuadPart < MinRTT.QuadPart || !MinRTTSet)
      {
@@@ -478,7 -478,7 +478,7 @@@ VOID DIALOG_FileSaveAs(VOID
          OFN_HIDEREADONLY | OFN_EXPLORER | OFN_ENABLETEMPLATE | OFN_ENABLEHOOK;
      saveas.lpstrDefExt       = szDefaultExt;
      saveas.lpTemplateName    = MAKEINTRESOURCE(DIALOG_ENCODING);
 -    saveas.lpfnHook          = DIALOG_FileSaveAs_Hook;
 +    saveas.lpfnHook          = (LPOFNHOOKPROC)DIALOG_FileSaveAs_Hook;
  
      if (GetSaveFileName(&saveas)) {
          SetFileName(szPath);
@@@ -871,19 -871,15 +871,15 @@@ VOID DIALOG_GoTo(VOID
  
  VOID DIALOG_StatusBarUpdateCaretPos(VOID)
  {
-     int line;
-     int col;
-     int ccol;
-     POINT point;
+     int line, col;
      TCHAR buff[MAX_PATH];
+     DWORD dwStart, dwSize;
  
-     GetCaretPos(&point);
-     line = (int) SendMessage(Globals.hEdit, EM_LINEFROMCHAR, (WPARAM)-1, (LPARAM)0);
-     ccol = (int) SendMessage(Globals.hEdit, EM_CHARFROMPOS, (WPARAM)0, (LPARAM)MAKELPARAM(point.x, point.y));
-     ccol = LOWORD(ccol);
-     col = ccol - (int) SendMessage(Globals.hEdit, EM_LINEINDEX, (WPARAM)line, (LPARAM)0);
+     SendMessage(Globals.hEdit, EM_GETSEL, (WPARAM)&dwStart, (LPARAM)&dwSize);
+     line = SendMessage(Globals.hEdit, EM_LINEFROMCHAR, (WPARAM)dwStart, 0);
+     col  = dwStart - SendMessage(Globals.hEdit, EM_LINEINDEX, (WPARAM)line, 0);
  
-     _stprintf(buff, TEXT("%S %d, %S %d"), Globals.szStatusBarLine, line+1, Globals.szStatusBarCol, col+1);
+     _stprintf(buff, Globals.szStatusBarLineCol, line+1, col+1);
      SendMessage(Globals.hStatusBar, SB_SETTEXT, (WPARAM) SB_SIMPLEID, (LPARAM)buff);
  }
  
@@@ -896,8 -892,7 +892,7 @@@ VOID DIALOG_ViewStatusBar(VOID
     if ( !Globals.hStatusBar )
     {
         Globals.hStatusBar = CreateStatusWindow(WS_CHILD | WS_VISIBLE | WS_EX_STATICEDGE, TEXT("test"), Globals.hMainWnd, CMD_STATUSBAR_WND_ID );
-        LoadString(Globals.hInstance, STRING_LINE, Globals.szStatusBarLine, MAX_PATH-1);
-        LoadString(Globals.hInstance, STRING_COLUMN, Globals.szStatusBarCol, MAX_PATH-1);
+        LoadString(Globals.hInstance, STRING_LINE_COLUMN, Globals.szStatusBarLineCol, MAX_PATH-1);
         SendMessage(Globals.hStatusBar, SB_SIMPLE, (WPARAM)TRUE, (LPARAM)0);
     }
      CheckMenuItem(GetMenu(Globals.hMainWnd), CMD_STATUSBAR,
@@@ -931,7 -926,7 +926,7 @@@ VOID DIALOG_HelpHelp(VOID
  #ifdef _MSC_VER
  #pragma warning(disable : 4100)
  #endif
 -BOOL CALLBACK
 +INT_PTR CALLBACK
  AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
  {
      HWND    hLicenseEditWnd;
@@@ -91,7 -91,7 +91,7 @@@ static int NOTEPAD_MenuCommand(WPARAM w
      case CMD_ABOUT:            DialogBox(GetModuleHandle(NULL),
                                           MAKEINTRESOURCE(IDD_ABOUTBOX),
                                           Globals.hMainWnd,
 -                                         (DLGPROC) AboutDialogProc);
 +                                         AboutDialogProc);
                                 break;
      case CMD_ABOUT_WINE:       DIALOG_HelpAboutWine(); break;
  
@@@ -302,6 -302,7 +302,7 @@@ LRESULT CALLBACK EDIT_WndProc(HWND hWnd
  { 
      switch (msg)
      {
+         case WM_KEYDOWN:
          case WM_KEYUP:
          {
              switch (wParam)
@@@ -18,7 -18,7 +18,7 @@@
        <library>shell32</library>
        <library>uuid</library>
        <library>notifyhook</library>
--      <pch>precomp.h</pch>
++
        <directory name="desktop">
                <file>desktop.cpp</file>
        </directory>
@@@ -14,8 -14,8 +14,8 @@@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_
  
  LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
  
--STRINGTABLE DISCARDABLE
--BEGIN
--    IDS_VERSION_STR REACTOS_STR_PRODUCT_VERSION
--    IDS_EXPLORER_VERSION_STR "ReactOS %s Explorer"
--END
++//STRINGTABLE DISCARDABLE
++//BEGIN
++//    IDS_VERSION_STR REACTOS_STR_PRODUCT_VERSION
++//    IDS_EXPLORER_VERSION_STR "ReactOS %s Explorer"
++//END
@@@ -1018,7 -1018,7 +1018,7 @@@ DWORD RSetServiceStatus
          return ERROR_INVALID_HANDLE;
      }
  
--    lpService = ScmGetServiceEntryByClientHandle(hServiceStatus);
++    lpService = ScmGetServiceEntryByClientHandle(LongToPtr(hServiceStatus));
      if (lpService == NULL)
      {
          DPRINT1("lpService == NULL!\n");
      }
  
      /* Check accepted controls */
-     if (lpServiceStatus->dwControlsAccepted == 0 ||
-         lpServiceStatus->dwControlsAccepted & ~0xFF)
+     if (lpServiceStatus->dwControlsAccepted & ~0xFF)
      {
          DPRINT1("Invalid controls accepted!\n");
          return ERROR_INVALID_DATA;
@@@ -30,636 -30,635 +30,651 @@@ Signature = "$ReactOS$
  
  
  ; Base files
;base\applications\cacls\cacls.exe                       1
;base\applications\calc\calc.exe                         1
;base\applications\charmap\charmap.exe                   1
;base\applications\cmdutils\dbgprint\dbgprint.exe        1
;base\applications\cmdutils\doskey\doskey.exe            1
;base\applications\cmdutils\find\find.exe                1
;base\applications\cmdutils\hostname\hostname.exe        1
;base\applications\cmdutils\more\more.exe                1
;base\applications\cmdutils\xcopy\xcopy.exe              1
;base\applications\control\control.exe                   1
;base\applications\mscutils\devmgmt\devmgmt.exe          1
;base\applications\mscutils\eventvwr\eventvwr.exe        1
;base\applications\games\solitaire\sol.exe               1
;base\applications\games\winemine\winemine.exe           1
;base\applications\hh\hh.exe                             1
;base\applications\kbswitch\kbswitch.exe                 1
;base\applications\kbswitch\kbsdll\kbsdll.dll            1
;base\applications\logoff\logoff.exe                     1
;base\applications\msconfig\msconfig.exe                 1
;base\applications\mstsc\mstsc.exe                       1
;base\applications\network\arp\arp.exe                   1
;base\applications\network\dwnl\dwnl.exe                 1
;base\applications\network\route\route.exe               1
;base\applications\network\finger\finger.exe             1
;base\applications\network\ftp\ftp.exe                   1
;base\applications\network\ipconfig\ipconfig.exe         1
;base\applications\network\netstat\netstat.exe           1
;base\applications\network\ping\ping.exe                 1
+ base\applications\cacls\cacls.exe                       1
+ base\applications\calc\calc.exe                         1
+ base\applications\charmap\charmap.exe                   1
+ base\applications\cmdutils\dbgprint\dbgprint.exe        1
+ base\applications\cmdutils\doskey\doskey.exe            1
+ base\applications\cmdutils\find\find.exe                1
+ base\applications\cmdutils\hostname\hostname.exe        1
+ base\applications\cmdutils\more\more.exe                1
+ base\applications\cmdutils\xcopy\xcopy.exe              1
+ base\applications\control\control.exe                   1
+ base\applications\mscutils\devmgmt\devmgmt.exe          1
+ base\applications\mscutils\eventvwr\eventvwr.exe        1
+ base\applications\games\solitaire\sol.exe               1
+ base\applications\games\winemine\winemine.exe           1
+ base\applications\hh\hh.exe                             1
+ base\applications\kbswitch\kbswitch.exe                 1
+ base\applications\kbswitch\kbsdll\kbsdll.dll            1
+ base\applications\logoff\logoff.exe                     1
+ base\applications\msconfig\msconfig.exe                 1
+ base\applications\mstsc\mstsc.exe                       1
+ base\applications\network\arp\arp.exe                   1
+ base\applications\network\dwnl\dwnl.exe                 1
+ base\applications\network\route\route.exe               1
+ base\applications\network\finger\finger.exe             1
+ base\applications\network\ftp\ftp.exe                   1
+ base\applications\network\ipconfig\ipconfig.exe         1
+ base\applications\network\netstat\netstat.exe           1
+ base\applications\network\ping\ping.exe                 1
 -base\applications\network\telnet\telnet.exe             1
 +;base\applications\network\telnet\telnet.exe             1
- ;base\applications\network\tracert\tracert.exe           1
- ;base\applications\network\whois\whois.exe               1
- ;base\applications\notepad\notepad.exe                   1
- ;base\applications\regedit\regedit.exe                   4
- ;base\applications\regedit\clb\clb.dll                   1
- ;base\applications\sc\sc.exe                             1
- ;base\applications\screensavers\3dtext\3dtext.scr        1
- ;base\applications\screensavers\logon\logon.scr          1
- ;base\applications\mscutils\servman\servman.exe          1
- ;base\applications\shutdown\shutdown.exe                 1
- ;base\applications\sndvol32\sndvol32.exe                 1
- ;base\applications\taskmgr\taskmgr.exe                   1
- ;base\applications\winhlp32\winhlp32.exe                 1
- ;base\applications\wordpad\wordpad.exe                   1
- ;base\services\audiosrv\audiosrv.exe                 1
- ;base\services\dhcp\dhcp.exe                         1
- ;base\services\eventlog\eventlog.exe                 1
- ;base\services\rpcss\rpcss.exe                       1
- ;base\services\spoolsv\spoolsv.exe                   1
- ;base\services\tcpsvcs\tcpsvcs.exe                   1
- ;base\services\tcpsvcs\quotes                        5
- ;base\services\umpnpmgr\umpnpmgr.exe                 1
- ;base\services\audiosrv\audiosrv.exe                 1
- ;base\setup\setup\setup.exe                          1
- ;base\setup\vmwinst\vmwinst.exe                      1
- ;base\shell\cmd\cmd.exe                              1
+ base\applications\network\tracert\tracert.exe           1
+ base\applications\network\whois\whois.exe               1
+ base\applications\notepad\notepad.exe                   1
+ base\applications\regedit\regedit.exe                   4
+ base\applications\regedit\clb\clb.dll                   1
+ base\applications\sc\sc.exe                             1
+ base\applications\screensavers\3dtext\3dtext.scr        1
+ base\applications\screensavers\logon\logon.scr          1
+ base\applications\mscutils\servman\servman.exe          1
+ base\applications\shutdown\shutdown.exe                 1
+ base\applications\sndvol32\sndvol32.exe                 1
+ base\applications\taskmgr\taskmgr.exe                   1
+ base\applications\winhlp32\winhlp32.exe                 1
+ base\applications\wordpad\wordpad.exe                   1
+ base\services\audiosrv\audiosrv.exe                 1
+ base\services\dhcp\dhcp.exe                         1
+ base\services\eventlog\eventlog.exe                 1
+ base\services\rpcss\rpcss.exe                       1
+ base\services\spoolsv\spoolsv.exe                   1
+ base\services\tcpsvcs\tcpsvcs.exe                   1
+ base\services\tcpsvcs\quotes                        5
+ base\services\umpnpmgr\umpnpmgr.exe                 1
++base\services\audiosrv\audiosrv.exe                 1
+ base\setup\setup\setup.exe                          1
+ base\setup\vmwinst\vmwinst.exe                      1
+ base\shell\cmd\cmd.exe                              1
 -base\shell\explorer\explorer.exe                    4
 +;base\shell\explorer\explorer.exe                    4
;base\shell\explorer\explorer-cfg-template.xml       4
+ base\shell\explorer\explorer-cfg-template.xml       4
 -base\shell\explorer\notifyhook\notifyhook.dll       1
 +;base\shell\explorer\notifyhook\notifyhook.dll       1
;base\shell\explorer-new\explorer_new.exe            4   optional
;base\system\autochk\autochk.exe                     1
;base\system\bootok\bootok.exe                       1
;base\system\format\format.exe                       1
;base\system\lsass\lsass.exe                         1
;base\system\msiexec\msiexec.exe                     1
;base\system\regsvr32\regsvr32.exe                   1
;base\system\rundll32\rundll32.exe                   1
;base\system\services\services.exe                   1
;base\system\userinit\userinit.exe                   1
;base\system\winlogon\winlogon.exe                   1
;base\system\expand\expand.exe                       1
;base\system\smss\smss.exe                           1
+ base\shell\explorer-new\explorer_new.exe            4   optional
+ base\system\autochk\autochk.exe                     1
+ base\system\bootok\bootok.exe                       1
+ base\system\format\format.exe                       1
+ base\system\lsass\lsass.exe                         1
+ base\system\msiexec\msiexec.exe                     1
+ base\system\regsvr32\regsvr32.exe                   1
+ base\system\rundll32\rundll32.exe                   1
+ base\system\services\services.exe                   1
+ base\system\userinit\userinit.exe                   1
+ base\system\winlogon\winlogon.exe                   1
+ base\system\expand\expand.exe                       1
+ base\system\smss\smss.exe                           1
  
  
  ; Dynamic Link Libraries
;dll\3rdparty\freetype\freetype.dll                  1
;dll\3rdparty\mesa32\mesa32.dll                      1
;dll\3rdparty\dxtn\dxtn.dll                          1   optional
;dll\cpl\access\access.cpl                           1
;dll\cpl\appwiz\appwiz.cpl                           1
;dll\cpl\console\console.dll                         1
;dll\cpl\desk\desk.cpl                               1
;dll\cpl\intl\intl.cpl                               1
;dll\cpl\main\main.cpl                               1
;dll\cpl\mmsys\mmsys.cpl                             1
;dll\cpl\ncpa\ncpa.cpl                               1
;dll\cpl\powercfg\powercfg.cpl                       1
;dll\cpl\sysdm\sysdm.cpl                             1
;dll\cpl\timedate\timedate.cpl                       1
;dll\cpl\input\input.dll                             1
;dll\cpl\joy\joy.cpl                                 1
;dll\directx\dinput\dinput.dll                       1
;dll\directx\dinput8\dinput8.dll                     1
;dll\directx\dplay\dplay.dll                         1
;dll\directx\dplayx\dplayx.dll                       1
;dll\directx\dsound\dsound.dll                       1
;dll\directx\dxdiagn\dxdiagn.dll                     1
;dll\directx\ddraw\ddraw.dll                         1
;dll\directx\d3d8thk\d3d8thk.dll                     1
;dll\directx\devenum\devenum.dll                     1
;dll\directx\ksproxy\ksproxy.ax                      1
;dll\directx\ksuser\ksuser.dll                       1
;dll\directx\msdmo\msdmo.dll                         1
;dll\directx\quartz\quartz.dll                       1
;dll\directx\qedit\qedit.dll                         1
+ dll\3rdparty\freetype\freetype.dll                  1
+ dll\3rdparty\mesa32\mesa32.dll                      1
+ dll\3rdparty\dxtn\dxtn.dll                          1   optional
+ dll\cpl\access\access.cpl                           1
+ dll\cpl\appwiz\appwiz.cpl                           1
+ dll\cpl\console\console.dll                         1
+ dll\cpl\desk\desk.cpl                               1
+ dll\cpl\intl\intl.cpl                               1
+ dll\cpl\main\main.cpl                               1
+ dll\cpl\mmsys\mmsys.cpl                             1
+ dll\cpl\ncpa\ncpa.cpl                               1
+ dll\cpl\powercfg\powercfg.cpl                       1
+ dll\cpl\sysdm\sysdm.cpl                             1
+ dll\cpl\timedate\timedate.cpl                       1
+ dll\cpl\input\input.dll                             1
+ dll\cpl\joy\joy.cpl                                 1
+ dll\directx\dinput\dinput.dll                       1
+ dll\directx\dinput8\dinput8.dll                     1
+ dll\directx\dplay\dplay.dll                         1
+ dll\directx\dplayx\dplayx.dll                       1
+ dll\directx\dsound\dsound.dll                       1
+ dll\directx\dxdiagn\dxdiagn.dll                     1
+ dll\directx\ddraw\ddraw.dll                         1
+ dll\directx\d3d8thk\d3d8thk.dll                     1
+ dll\directx\devenum\devenum.dll                     1
+ dll\directx\ksproxy\ksproxy.ax                      1
+ dll\directx\ksuser\ksuser.dll                       1
+ dll\directx\msdmo\msdmo.dll                         1
+ dll\directx\quartz\quartz.dll                       1
+ dll\directx\qedit\qedit.dll                         1
 -dll\directx\wine\d3d8\d3d8.dll                      1
 -dll\directx\wine\wined3d\wined3d.dll                1
 -dll\directx\wine\d3d9\d3d9.dll                      1
 +;dll\directx\wine\d3d8\d3d8.dll                      1
 +;dll\directx\wine\wined3d\wined3d.dll                1
 +;dll\directx\wine\d3d9\d3d9.dll                      1
  
;dll\keyboard\kbda1\kbda1.dll                        1
;dll\keyboard\kbda2\kbda2.dll                        1
;dll\keyboard\kbda3\kbda3.dll                        1
;dll\keyboard\kbdal\kbdal.dll                        1
;dll\keyboard\kbdarme\kbdarme.dll                    1
;dll\keyboard\kbdarmw\kbdarmw.dll                    1
;dll\keyboard\kbdaze\kbdaze.dll                      1
;dll\keyboard\kbdazel\kbdazel.dll                    1
;dll\keyboard\kbdbgm\kbdbgm.dll                      1
;dll\keyboard\kbdbgt\kbdbgt.dll                      1
;dll\keyboard\kbdblr\kbdblr.dll                      1
;dll\keyboard\kbdbr\kbdbr.dll                        1
;dll\keyboard\kbdbga\kbdbga.dll                      1
;dll\keyboard\kbdbe\kbdbe.dll                        1
;dll\keyboard\kbdbur\kbdbur.dll                      1
;dll\keyboard\kbdcan\kbdcan.dll                      1
;dll\keyboard\kbdcr\kbdcr.dll                        1
;dll\keyboard\kbdcz1\kbdcz1.dll                      1
;dll\keyboard\kbdda\kbdda.dll                        1
;dll\keyboard\kbddv\kbddv.dll                        1
;dll\keyboard\kbdes\kbdes.dll                        1
;dll\keyboard\kbdest\kbdest.dll                      1
;dll\keyboard\kbdfc\kbdfc.dll                        1
;dll\keyboard\kbdfi\kbdfi.dll                        1
;dll\keyboard\kbdfr\kbdfr.dll                        1
;dll\keyboard\kbdgeo\kbdgeo.dll                      1
;dll\keyboard\kbdgerg\kbdgerg.dll                    1
;dll\keyboard\kbdgneo\kbdgneo.dll                    1
;dll\keyboard\kbdgrist\kbdgrist.dll                  1
;dll\keyboard\kbdgr\kbdgr.dll                        1
;dll\keyboard\kbdhe\kbdhe.dll                        1
;dll\keyboard\kbdheb\kbdheb.dll                      1
;dll\keyboard\kbdhu\kbdhu.dll                        1
;dll\keyboard\kbdic\kbdic.dll                        1
;dll\keyboard\kbdinasa\kbdinasa.dll                  1
;dll\keyboard\kbdinben\kbdinben.dll                  1
;dll\keyboard\kbdindev\kbdindev.dll                  1
;dll\keyboard\kbdinguj\kbdinguj.dll                  1
;dll\keyboard\kbdinmal\kbdinmal.dll                  1
;dll\keyboard\kbdir\kbdir.dll                        1
;dll\keyboard\kbdit\kbdit.dll                        1
;dll\keyboard\kbdja\kbdja.dll                        1
;dll\keyboard\kbdkaz\kbdkaz.dll                      1
;dll\keyboard\kbdla\kbdla.dll                        1
;dll\keyboard\kbdlt\kbdlt.dll                        1
;dll\keyboard\kbdlv\kbdlv.dll                        1
;dll\keyboard\kbdmac\kbdmac.dll                      1
;dll\keyboard\kbdne\kbdne.dll                        1
;dll\keyboard\kbdno\kbdno.dll                        1
;dll\keyboard\kbdpl1\kbdpl1.dll                      1
;dll\keyboard\kbdpo\kbdpo.dll                        1
;dll\keyboard\kbdro\kbdro.dll                        1
;dll\keyboard\kbdru\kbdru.dll                        1
;dll\keyboard\kbdru1\kbdru1.dll                      1
;dll\keyboard\kbdsg\kbdsg.dll                        1
;dll\keyboard\kbdsk\kbdsk.dll                        1
;dll\keyboard\kbdsk1\kbdsk1.dll                      1
;dll\keyboard\kbdsw\kbdsw.dll                        1
;dll\keyboard\kbdtat\kbdtat.dll                      1
;dll\keyboard\kbdth0\kbdth0.dll                      1
;dll\keyboard\kbdth1\kbdth1.dll                      1
;dll\keyboard\kbdth2\kbdth2.dll                      1
;dll\keyboard\kbdth3\kbdth3.dll                      1
;dll\keyboard\kbdtuf\kbdtuf.dll                      1
;dll\keyboard\kbdtuq\kbdtuq.dll                      1
;dll\keyboard\kbduk\kbduk.dll                        1
;dll\keyboard\kbdur\kbdur.dll                        1
;dll\keyboard\kbdurs\kbdurs.dll                      1
;dll\keyboard\kbdus\kbdus.dll                        1
;dll\keyboard\kbdusa\kbdusa.dll                      1
;dll\keyboard\kbdusl\kbdusl.dll                      1
;dll\keyboard\kbdusr\kbdusr.dll                      1
;dll\keyboard\kbdusx\kbdusx.dll                      1
;dll\keyboard\kbduzb\kbduzb.dll                      1
;dll\keyboard\kbdvntc\kbdvntc.dll                    1
;dll\keyboard\kbdycc\kbdycc.dll                      1
;dll\keyboard\kbdycl\kbdycl.dll                      1
;dll\keyboard\kbdko\kbdko.dll                        1
;dll\nt;dll\ntdll.dll                                 1
;dll\win32\acledit\acledit.dll                       1
;dll\win32\aclui\aclui.dll                           1
;dll\win32\advapi32\advapi32.dll                     1
;dll\win32\advpack\advpack.dll                       1
;dll\win32\atl\atl.dll                               1
;dll\win32\authz\authz.dll                           1
;dll\win32\avifil32\avifil32.dll                     1
;dll\win32\beepmidi\beepmidi.dll                     1
;dll\win32\browseui\browseui.dll                     1
;dll\win32\cabinet\cabinet.dll                       1
;dll\win32\cards\cards.dll                           1
;dll\win32\cfgmgr32\cfgmgr32.dll                     1
;dll\win32\clusapi\clusapi.dll                       1
;dll\win32\comcat\comcat.dll                         1
;dll\win32\comctl32\comctl32.dll                     1
;dll\win32\comdlg32\comdlg32.dll                     1
;dll\win32\compstui\compstui.dll                     1
;dll\win32\credui\credui.dll                         1
;dll\win32\crtdll\crtdll.dll                         1
;dll\win32\crypt32\crypt32.dll                       1
;dll\win32\cryptdll\cryptdll.dll                     1
;dll\win32\cryptnet\cryptnet.dll                     1
;dll\win32\cryptui\cryptui.dll                       1
;dll\win32\dbghelp\dbghelp.dll                       1
;dll\win32\dciman32\dciman32.dll                     1
;dll\win32\devmgr\devmgr.dll                         1
;dll\win32\dhcpcsvc\dhcpcsvc.dll                     1
;dll\win32\dnsapi\dnsapi.dll                         1
;dll\win32\fmifs\fmifs.dll                           1
;dll\win32\fusion\fusion.dll                         1
;dll\win32\gdi32\gdi32.dll                           1
;dll\win32\gdiplus\gdiplus.dll                       1
;dll\win32\getuname\getuname.dll                     1
;dll\win32\glu32\glu32.dll                           1
;dll\win32\hhctrl.ocx\hhctrl.ocx                     1
;dll\win32\hid\hid.dll                               1
;dll\win32\hlink\hlink.dll                           1
;dll\win32\icmp\icmp.dll                             1
;dll\win32\imagehlp\imagehlp.dll                     1
;dll\win32\imm32\imm32.dll                           1
;dll\win32\inetcomm\inetcomm.dll                     1
;dll\win32\inetmib1\inetmib1.dll                     1
;dll\win32\iphlpapi\iphlpapi.dll                     1
;dll\win32\jscript\jscript.dll                       1
;dll\win32\kernel32\kernel32.dll                     1
;dll\win32\lsasrv\lsasrv.dll                         1
;dll\win32\lz32\lz32.dll                             1
;dll\win32\mapi32\mapi32.dll                         1
;dll\win32\mlang\mlang.dll                           1
;dll\win32\mmdrv\mmdrv.dll                           1
;dll\win32\modemui\modemui.dll                       1
;dll\win32\mpr\mpr.dll                               1
;dll\win32\mprapi\mprapi.dll                         1
;dll\win32\msacm32\msacm32.dll                       1
;dll\win32\msafd\msafd.dll                           1
;dll\win32\mscoree\mscoree.dll                       1
;dll\win32\msgina\msgina.dll                         1
;dll\win32\mshtml\mshtml.dll                         1
;dll\win32\mshtml.tlb\mshtml.tlb                     1
;dll\win32\msi\msi.dll                               1
;dll\win32\msimg32\msimg32.dll                       1
;dll\win32\mstask\mstask.dll                         1
;dll\win32\msvcrt\msvcrt.dll                         1
;dll\win32\msvcrt20\msvcrt20.dll                     1
;dll\win32\msvcrt40\msvcrt40.dll                     1
;dll\win32\msvfw32\msvfw32.dll                       1
;dll\win32\mswsock\mswsock.dll                       1
;dll\win32\msxml3\msxml3.dll                         1
;dll\win32\nddeapi\nddeapi.dll                       1
;dll\win32\netapi32\netapi32.dll                     1
;dll\win32\netcfgx\netcfgx.dll                       1
;dll\win32\netid\netid.dll                           1
;dll\win32\netshell\netshell.dll                     1
;dll\win32\newdev\newdev.dll                         1
;dll\win32\ntdsapi\ntdsapi.dll                       1
;dll\win32\ntmarta\ntmarta.dll                       1
;dll\win32\objsel\objsel.dll                         1
;dll\win32\odbc32\odbc32.dll                         1
;dll\win32\odbccp32\odbccp32.dll                     1
;dll\win32\ole32\ole32.dll                           1
;dll\win32\oleacc\oleacc.dll                         1
;dll\win32\oleaut32\oleaut32.dll                     1
;dll\win32\oledlg\oledlg.dll                         1
;dll\win32\olepro32\olepro32.dll                     1
;dll\win32\opengl32\opengl32.dll                     1
;dll\win32\pdh\pdh.dll                               1
;dll\win32\powrprof\powrprof.dll                     1
;dll\win32\printui\printui.dll                       1
;dll\win32\psapi\psapi.dll                           1
;dll\win32\pstorec\pstorec.dll                       1
;dll\win32\rasapi32\rasapi32.dll                     1
;dll\win32\rasdlg\rasdlg.dll                         1
;dll\win32\rasman\rasman.dll                         1
;dll\win32\riched20\riched20.dll                     1
;dll\win32\riched32\riched32.dll                     1
;dll\win32\rpcrt4\rpcrt4.dll                         1
;dll\win32\rsabase\rsabase.dll                       1
;dll\win32\rsaenh\rsaenh.dll                         1
;dll\win32\samlib\samlib.dll                         1
;dll\win32\samsrv\samsrv.dll                         1
;dll\win32\schannel\schannel.dll                     1
;dll\win32\secur32\secur32.dll                       1
;dll\win32\security\security.dll                     1
;dll\win32\sensapi\sensapi.dll                       1
;dll\win32\serialui\serialui.dll                     1
;dll\win32\setupapi\setupapi.dll                     1
;dll\win32\sfc\sfc.dll                               1
;dll\win32\sfc_os\sfc_os.dll                         1
;dll\win32\shdocvw\shdocvw.dll                       1
;dll\win32\shell32\shell32.dll                       1
;dll\win32\shfolder\shfolder.dll                     1
;dll\win32\shimgvw\shimgvw.dll                       1
;dll\win32\shlwapi\shlwapi.dll                       1
;dll\win32\smdll\smdll.dll                           1
;dll\win32\snmpapi\snmpapi.dll                       1
;dll\win32\stdole2.tlb\stdole2.tlb                   1
;dll\win32\stdole32.tlb\stdole32.tlb                 1
;dll\win32\sxs\sxs.dll                               1
;dll\win32\syssetup\syssetup.dll                     1
;dll\win32\tapi32\tapi32.dll                         1
;dll\win32\tapiui\tapiui.dll                         1
;dll\win32\twain_32\twain_32.dll                     1
;dll\win32\uext2\uext2.dll                           1
;dll\win32\ufat\ufat.dll                             1
;dll\win32\ufatx\ufatx.dll                           1   optional
;dll\win32\untfs\untfs.dll                           1
;dll\win32\urlmon\urlmon.dll                         1
;dll\win32\user32\user32.dll                         1
;dll\win32\userenv\userenv.dll                       1
;dll\win32\usp10\usp10.dll                           1
;dll\win32\uxtheme\uxtheme.dll                       1
;dll\win32\vdmdbg\vdmdbg.dll                         1
;dll\win32\version\version.dll                       1
;dll\win32\winfax\winfax.dll                         1
;dll\win32\winhttp\winhttp.dll                       1
;dll\win32\wininet\wininet.dll                       1
;dll\win32\winmm\winmm.dll                           1
;dll\win32\winspool\winspool.drv                     1
;dll\win32\winsta\winsta.dll                         1
;dll\win32\wintrust\wintrust.dll                     1
;dll\win32\wldap32\wldap32.dll                       1
;dll\win32\ws2_32\ws2_32.dll                         1
;dll\win32\ws2help\ws2help.dll                       1
;dll\win32\wshirda\wshirda.dll                       1
;dll\win32\wshtcpip\wshtcpip.dll                     1
;dll\win32\wsock32\wsock32.dll                       1
;dll\win32\wtsapi32\wtsapi32.dll                     1
;dll\win32\winmm\midimap\midimap.dll                 1
;dll\win32\winmm\wavemap\msacm32.drv                 1   optional
+ dll\keyboard\kbda1\kbda1.dll                        1
+ dll\keyboard\kbda2\kbda2.dll                        1
+ dll\keyboard\kbda3\kbda3.dll                        1
+ dll\keyboard\kbdal\kbdal.dll                        1
+ dll\keyboard\kbdarme\kbdarme.dll                    1
+ dll\keyboard\kbdarmw\kbdarmw.dll                    1
+ dll\keyboard\kbdaze\kbdaze.dll                      1
+ dll\keyboard\kbdazel\kbdazel.dll                    1
+ dll\keyboard\kbdbgm\kbdbgm.dll                      1
+ dll\keyboard\kbdbgt\kbdbgt.dll                      1
+ dll\keyboard\kbdblr\kbdblr.dll                      1
+ dll\keyboard\kbdbr\kbdbr.dll                        1
+ dll\keyboard\kbdbga\kbdbga.dll                      1
+ dll\keyboard\kbdbe\kbdbe.dll                        1
+ dll\keyboard\kbdbur\kbdbur.dll                      1
+ dll\keyboard\kbdcan\kbdcan.dll                      1
+ dll\keyboard\kbdcr\kbdcr.dll                        1
+ dll\keyboard\kbdcz1\kbdcz1.dll                      1
+ dll\keyboard\kbdda\kbdda.dll                        1
+ dll\keyboard\kbddv\kbddv.dll                        1
+ dll\keyboard\kbdes\kbdes.dll                        1
+ dll\keyboard\kbdest\kbdest.dll                      1
+ dll\keyboard\kbdfc\kbdfc.dll                        1
+ dll\keyboard\kbdfi\kbdfi.dll                        1
+ dll\keyboard\kbdfr\kbdfr.dll                        1
+ dll\keyboard\kbdgeo\kbdgeo.dll                      1
+ dll\keyboard\kbdgerg\kbdgerg.dll                    1
+ dll\keyboard\kbdgneo\kbdgneo.dll                    1
+ dll\keyboard\kbdgrist\kbdgrist.dll                  1
+ dll\keyboard\kbdgr\kbdgr.dll                        1
+ dll\keyboard\kbdhe\kbdhe.dll                        1
+ dll\keyboard\kbdheb\kbdheb.dll                      1
+ dll\keyboard\kbdhu\kbdhu.dll                        1
+ dll\keyboard\kbdic\kbdic.dll                        1
+ dll\keyboard\kbdinasa\kbdinasa.dll                  1
+ dll\keyboard\kbdinben\kbdinben.dll                  1
+ dll\keyboard\kbdindev\kbdindev.dll                  1
+ dll\keyboard\kbdinguj\kbdinguj.dll                  1
+ dll\keyboard\kbdinmal\kbdinmal.dll                  1
+ dll\keyboard\kbdir\kbdir.dll                        1
+ dll\keyboard\kbdit\kbdit.dll                        1
+ dll\keyboard\kbdja\kbdja.dll                        1
+ dll\keyboard\kbdkaz\kbdkaz.dll                      1
+ dll\keyboard\kbdla\kbdla.dll                        1
+ dll\keyboard\kbdlt\kbdlt.dll                        1
+ dll\keyboard\kbdlv\kbdlv.dll                        1
+ dll\keyboard\kbdmac\kbdmac.dll                      1
+ dll\keyboard\kbdne\kbdne.dll                        1
+ dll\keyboard\kbdno\kbdno.dll                        1
+ dll\keyboard\kbdpl1\kbdpl1.dll                      1
+ dll\keyboard\kbdpo\kbdpo.dll                        1
+ dll\keyboard\kbdro\kbdro.dll                        1
+ dll\keyboard\kbdru\kbdru.dll                        1
+ dll\keyboard\kbdru1\kbdru1.dll                      1
+ dll\keyboard\kbdsg\kbdsg.dll                        1
+ dll\keyboard\kbdsk\kbdsk.dll                        1
+ dll\keyboard\kbdsk1\kbdsk1.dll                      1
+ dll\keyboard\kbdsw\kbdsw.dll                        1
+ dll\keyboard\kbdtat\kbdtat.dll                      1
+ dll\keyboard\kbdth0\kbdth0.dll                      1
+ dll\keyboard\kbdth1\kbdth1.dll                      1
+ dll\keyboard\kbdth2\kbdth2.dll                      1
+ dll\keyboard\kbdth3\kbdth3.dll                      1
+ dll\keyboard\kbdtuf\kbdtuf.dll                      1
+ dll\keyboard\kbdtuq\kbdtuq.dll                      1
+ dll\keyboard\kbduk\kbduk.dll                        1
+ dll\keyboard\kbdur\kbdur.dll                        1
+ dll\keyboard\kbdurs\kbdurs.dll                      1
+ dll\keyboard\kbdus\kbdus.dll                        1
+ dll\keyboard\kbdusa\kbdusa.dll                      1
+ dll\keyboard\kbdusl\kbdusl.dll                      1
+ dll\keyboard\kbdusr\kbdusr.dll                      1
+ dll\keyboard\kbdusx\kbdusx.dll                      1
+ dll\keyboard\kbduzb\kbduzb.dll                      1
+ dll\keyboard\kbdvntc\kbdvntc.dll                    1
+ dll\keyboard\kbdycc\kbdycc.dll                      1
+ dll\keyboard\kbdycl\kbdycl.dll                      1
+ dll\keyboard\kbdko\kbdko.dll                        1
dll\ntdll\ntdll.dll                                 1
+ dll\win32\acledit\acledit.dll                       1
+ dll\win32\aclui\aclui.dll                           1
+ dll\win32\advapi32\advapi32.dll                     1
+ dll\win32\advpack\advpack.dll                       1
+ dll\win32\atl\atl.dll                               1
+ dll\win32\authz\authz.dll                           1
+ dll\win32\avifil32\avifil32.dll                     1
+ dll\win32\beepmidi\beepmidi.dll                     1
+ dll\win32\browseui\browseui.dll                     1
+ dll\win32\cabinet\cabinet.dll                       1
+ dll\win32\cards\cards.dll                           1
+ dll\win32\cfgmgr32\cfgmgr32.dll                     1
+ dll\win32\clusapi\clusapi.dll                       1
+ dll\win32\comcat\comcat.dll                         1
+ dll\win32\comctl32\comctl32.dll                     1
+ dll\win32\comdlg32\comdlg32.dll                     1
+ dll\win32\compstui\compstui.dll                     1
+ dll\win32\credui\credui.dll                         1
+ dll\win32\crtdll\crtdll.dll                         1
+ dll\win32\crypt32\crypt32.dll                       1
+ dll\win32\cryptdll\cryptdll.dll                     1
+ dll\win32\cryptnet\cryptnet.dll                     1
+ dll\win32\cryptui\cryptui.dll                       1
+ dll\win32\dbghelp\dbghelp.dll                       1
+ dll\win32\dciman32\dciman32.dll                     1
+ dll\win32\devmgr\devmgr.dll                         1
+ dll\win32\dhcpcsvc\dhcpcsvc.dll                     1
+ dll\win32\dnsapi\dnsapi.dll                         1
+ dll\win32\fmifs\fmifs.dll                           1
+ dll\win32\fusion\fusion.dll                         1
+ dll\win32\gdi32\gdi32.dll                           1
+ dll\win32\gdiplus\gdiplus.dll                       1
+ dll\win32\getuname\getuname.dll                     1
+ dll\win32\glu32\glu32.dll                           1
+ dll\win32\hhctrl.ocx\hhctrl.ocx                     1
+ dll\win32\hid\hid.dll                               1
+ dll\win32\hlink\hlink.dll                           1
+ dll\win32\icmp\icmp.dll                             1
+ dll\win32\imagehlp\imagehlp.dll                     1
+ dll\win32\imm32\imm32.dll                           1
+ dll\win32\inetcomm\inetcomm.dll                     1
+ dll\win32\inetmib1\inetmib1.dll                     1
+ dll\win32\iphlpapi\iphlpapi.dll                     1
+ dll\win32\jscript\jscript.dll                       1
+ dll\win32\kernel32\kernel32.dll                     1
+ dll\win32\lsasrv\lsasrv.dll                         1
+ dll\win32\lz32\lz32.dll                             1
+ dll\win32\mapi32\mapi32.dll                         1
+ dll\win32\mlang\mlang.dll                           1
+ dll\win32\mmdrv\mmdrv.dll                           1
+ dll\win32\modemui\modemui.dll                       1
+ dll\win32\mpr\mpr.dll                               1
+ dll\win32\mprapi\mprapi.dll                         1
+ dll\win32\msacm32\msacm32.dll                       1
+ dll\win32\msafd\msafd.dll                           1
+ dll\win32\mscoree\mscoree.dll                       1
+ dll\win32\msgina\msgina.dll                         1
+ dll\win32\mshtml\mshtml.dll                         1
+ dll\win32\mshtml.tlb\mshtml.tlb                     1
+ dll\win32\msi\msi.dll                               1
+ dll\win32\msimg32\msimg32.dll                       1
+ dll\win32\mstask\mstask.dll                         1
+ dll\win32\msvcrt\msvcrt.dll                         1
+ dll\win32\msvcrt20\msvcrt20.dll                     1
+ dll\win32\msvcrt40\msvcrt40.dll                     1
+ dll\win32\msvfw32\msvfw32.dll                       1
+ dll\win32\mswsock\mswsock.dll                       1
+ dll\win32\msxml3\msxml3.dll                         1
+ dll\win32\nddeapi\nddeapi.dll                       1
+ dll\win32\netapi32\netapi32.dll                     1
+ dll\win32\netcfgx\netcfgx.dll                       1
+ dll\win32\netid\netid.dll                           1
+ dll\win32\netshell\netshell.dll                     1
+ dll\win32\newdev\newdev.dll                         1
+ dll\win32\ntdsapi\ntdsapi.dll                       1
+ dll\win32\ntmarta\ntmarta.dll                       1
+ dll\win32\objsel\objsel.dll                         1
+ dll\win32\odbc32\odbc32.dll                         1
+ dll\win32\odbccp32\odbccp32.dll                     1
+ dll\win32\ole32\ole32.dll                           1
+ dll\win32\oleacc\oleacc.dll                         1
+ dll\win32\oleaut32\oleaut32.dll                     1
+ dll\win32\oledlg\oledlg.dll                         1
+ dll\win32\olepro32\olepro32.dll                     1
+ dll\win32\opengl32\opengl32.dll                     1
+ dll\win32\pdh\pdh.dll                               1
+ dll\win32\powrprof\powrprof.dll                     1
+ dll\win32\printui\printui.dll                       1
+ dll\win32\psapi\psapi.dll                           1
+ dll\win32\pstorec\pstorec.dll                       1
+ dll\win32\rasapi32\rasapi32.dll                     1
+ dll\win32\rasdlg\rasdlg.dll                         1
+ dll\win32\rasman\rasman.dll                         1
+ dll\win32\riched20\riched20.dll                     1
+ dll\win32\riched32\riched32.dll                     1
+ dll\win32\rpcrt4\rpcrt4.dll                         1
+ dll\win32\rsabase\rsabase.dll                       1
+ dll\win32\rsaenh\rsaenh.dll                         1
+ dll\win32\samlib\samlib.dll                         1
+ dll\win32\samsrv\samsrv.dll                         1
+ dll\win32\schannel\schannel.dll                     1
+ dll\win32\secur32\secur32.dll                       1
+ dll\win32\security\security.dll                     1
+ dll\win32\sensapi\sensapi.dll                       1
+ dll\win32\serialui\serialui.dll                     1
+ dll\win32\setupapi\setupapi.dll                     1
+ dll\win32\sfc\sfc.dll                               1
+ dll\win32\sfc_os\sfc_os.dll                         1
+ dll\win32\shdocvw\shdocvw.dll                       1
+ dll\win32\shell32\shell32.dll                       1
+ dll\win32\shfolder\shfolder.dll                     1
+ dll\win32\shimgvw\shimgvw.dll                       1
+ dll\win32\shlwapi\shlwapi.dll                       1
+ dll\win32\smdll\smdll.dll                           1
+ dll\win32\snmpapi\snmpapi.dll                       1
+ dll\win32\stdole2.tlb\stdole2.tlb                   1
+ dll\win32\stdole32.tlb\stdole32.tlb                 1
+ dll\win32\sxs\sxs.dll                               1
+ dll\win32\syssetup\syssetup.dll                     1
+ dll\win32\tapi32\tapi32.dll                         1
+ dll\win32\tapiui\tapiui.dll                         1
+ dll\win32\twain_32\twain_32.dll                     1
+ dll\win32\uext2\uext2.dll                           1
+ dll\win32\ufat\ufat.dll                             1
+ dll\win32\ufatx\ufatx.dll                           1   optional
+ dll\win32\untfs\untfs.dll                           1
+ dll\win32\urlmon\urlmon.dll                         1
+ dll\win32\user32\user32.dll                         1
+ dll\win32\userenv\userenv.dll                       1
+ dll\win32\usp10\usp10.dll                           1
+ dll\win32\uxtheme\uxtheme.dll                       1
+ dll\win32\vdmdbg\vdmdbg.dll                         1
+ dll\win32\version\version.dll                       1
+ dll\win32\winfax\winfax.dll                         1
+ dll\win32\winhttp\winhttp.dll                       1
+ dll\win32\wininet\wininet.dll                       1
+ dll\win32\winmm\winmm.dll                           1
+ dll\win32\winspool\winspool.drv                     1
+ dll\win32\winsta\winsta.dll                         1
+ dll\win32\wintrust\wintrust.dll                     1
+ dll\win32\wldap32\wldap32.dll                       1
+ dll\win32\ws2_32\ws2_32.dll                         1
+ dll\win32\ws2help\ws2help.dll                       1
+ dll\win32\wshirda\wshirda.dll                       1
+ dll\win32\wshtcpip\wshtcpip.dll                     1
+ dll\win32\wsock32\wsock32.dll                       1
+ dll\win32\wtsapi32\wtsapi32.dll                     1
+ dll\win32\winmm\midimap\midimap.dll                 1
+ dll\win32\winmm\wavemap\msacm32.drv                 1   optional
  
  ; Shell Extensions
;dll\shellext\deskadp\deskadp.dll                    1
;dll\shellext\deskmon\deskmon.dll                    1
+ dll\shellext\deskadp\deskadp.dll                    1
+ dll\shellext\deskmon\deskmon.dll                    1
  
  ; Drivers
;drivers\base\bootvid\bootvid.dll                    1
;drivers\base\beep\beep.sys                          2
;drivers\base\null\null.sys                          2
+ drivers\base\bootvid\bootvid.dll                    1
+ drivers\base\beep\beep.sys                          2
+ drivers\base\null\null.sys                          2
  
;drivers\bus\isapnp\isapnp.sys                       2
+ drivers\bus\isapnp\isapnp.sys                       2
  
;drivers\directx\dxapi\dxapi.sys                     2
;drivers\directx\dxg\dxg.sys                         2
;drivers\directx\dxgthk\dxgthk.sys                   2
+ drivers\directx\dxapi\dxapi.sys                     2
+ drivers\directx\dxg\dxg.sys                         2
+ drivers\directx\dxgthk\dxgthk.sys                   2
  
;drivers\filesystems\fs_rec\fs_rec.sys               2
;drivers\filesystems\msfs\msfs.sys                   2
;drivers\filesystems\mup\mup.sys                     2
;drivers\filesystems\npfs\npfs.sys                   2
+ drivers\filesystems\fs_rec\fs_rec.sys               2
+ drivers\filesystems\msfs\msfs.sys                   2
+ drivers\filesystems\mup\mup.sys                     2
+ drivers\filesystems\npfs\npfs.sys                   2
  
;drivers\input\mouclass\mouclass.sys                 2
;drivers\input\sermouse\sermouse.sys                 2
+ drivers\input\mouclass\mouclass.sys                 2
+ drivers\input\sermouse\sermouse.sys                 2
  
;drivers\network\afd\afd.sys                         2
;drivers\network\ndis\ndis.sys                       2
;drivers\network\tcpip\tcpip.sys                     2
;drivers\network\tdi\tdi.sys                         2
;drivers\network\dd\ne2000\ne2000.sys                2
;drivers\network\dd\pcnet\pcnet.sys                  2
+ drivers\network\afd\afd.sys                         2
+ drivers\network\ndis\ndis.sys                       2
+ drivers\network\tcpip\tcpip.sys                     2
+ drivers\network\tdi\tdi.sys                         2
+ drivers\network\dd\ne2000\ne2000.sys                2
+ drivers\network\dd\pcnet\pcnet.sys                  2
  
;drivers\serial\serenum\serenum.sys                  2
;drivers\serial\serial\serial.sys                    2
+ drivers\serial\serenum\serenum.sys                  2
+ drivers\serial\serial\serial.sys                    2
  
;drivers\storage\ide\pciide\pciide.sys               2
;drivers\storage\ide\pciidex\pciidex.sys             2
+ drivers\storage\ide\pciide\pciide.sys               2
+ drivers\storage\ide\pciidex\pciidex.sys             2
  
- ;;drivers\usb\miniport\usbohci\usbohci.sys           2
- ;;drivers\usb\miniport\usbuhci\usbuhci.sys           2
- ;;drivers\usb\usbhub\usbhub.sys                      2
- ;;drivers\usb\usbport\usbport.sys                    2
;drivers\usb\nt4compat\usbdriver\usbdriver.sys       2
+ ;drivers\usb\miniport\usbohci\usbohci.sys           2
+ ;drivers\usb\miniport\usbuhci\usbuhci.sys           2
+ ;drivers\usb\usbhub\usbhub.sys                      2
+ ;drivers\usb\usbport\usbport.sys                    2
+ drivers\usb\nt4compat\usbdriver\usbdriver.sys       2
  
;drivers\video\displays\vga\vgaddi.dll               1
;drivers\video\displays\framebuf\framebuf.dll        1
;drivers\video\miniport\vga\vgamp.sys                2
;drivers\video\miniport\vbe\vbemp.sys                2
;drivers\video\videoprt\videoprt.sys                 2
+ drivers\video\displays\vga\vgaddi.dll               1
+ drivers\video\displays\framebuf\framebuf.dll        1
+ drivers\video\miniport\vga\vgamp.sys                2
+ drivers\video\miniport\vbe\vbemp.sys                2
+ drivers\video\videoprt\videoprt.sys                 2
  
;drivers\wmi\wmilib.sys                              2
+ drivers\wmi\wmilib.sys                              2
  
  ; Media
;media\fonts\DejaVuSans.ttf                          3
;media\fonts\DejaVuSans-Bold.ttf                     3
;media\fonts\DejaVuSans-BoldOblique.ttf              3
;media\fonts\DejaVuSansMono.ttf                      3
;media\fonts\DejaVuSansMono-Bold.ttf                 3
;media\fonts\DejaVuSansMono-BoldOblique.ttf          3
;media\fonts\DejaVuSansMono-Oblique.ttf              3
;media\fonts\DejaVuSans-Oblique.ttf                  3
;media\fonts\DejaVuSerif.ttf                         3
;media\fonts\DejaVuSerif-Bold.ttf                    3
;media\fonts\DejaVuSerif-BoldItalic.ttf              3
;media\fonts\DejaVuSerif-Italic.ttf                  3
;media\fonts\FreeMono.ttf                            3
;media\fonts\FreeMonoBold.ttf                        3
;media\fonts\FreeMonoBoldOblique.ttf                 3
;media\fonts\FreeMonoOblique.ttf                     3
;media\fonts\LiberationMono-Bold.ttf                 3
;media\fonts\LiberationMono-BoldItalic.ttf           3
;media\fonts\LiberationMono-Italic.ttf               3
;media\fonts\LiberationMono-Regular.ttf              3
;media\fonts\LiberationSans-Bold.ttf                 3
;media\fonts\LiberationSans-BoldItalic.ttf           3
;media\fonts\LiberationSans-Italic.ttf               3
;media\fonts\LiberationSans-Regular.ttf              3
;media\fonts\LiberationSerif-Bold.ttf                3
;media\fonts\LiberationSerif-BoldItalic.ttf          3
;media\fonts\LiberationSerif-Italic.ttf              3
;media\fonts\LiberationSerif-Regular.ttf             3
;media\fonts\Marlett.ttf                             3
;media\fonts\tahoma.ttf                              3
;media\fonts\tahomabd.ttf                            3
;media\nls\c_037.nls                                 1
;media\nls\c_500.nls                                 1
;media\nls\c_737.nls                                 1
;media\nls\c_775.nls                                 1
;media\nls\c_850.nls                                 1
;media\nls\c_852.nls                                 1
;media\nls\c_855.nls                                 1
;media\nls\c_856.nls                                 1
;media\nls\c_857.nls                                 1
;media\nls\c_860.nls                                 1
;media\nls\c_861.nls                                 1
;media\nls\c_862.nls                                 1
;media\nls\c_863.nls                                 1
;media\nls\c_864.nls                                 1
;media\nls\c_865.nls                                 1
;media\nls\c_866.nls                                 1
;media\nls\c_869.nls                                 1
;media\nls\c_874.nls                                 1
;media\nls\c_875.nls                                 1
;media\nls\c_878.nls                                 1
;media\nls\c_932.nls                                 1
;media\nls\c_936.nls                                 1
;media\nls\c_949.nls                                 1
;media\nls\c_950.nls                                 1
;media\nls\c_1006.nls                                1
;media\nls\c_1026.nls                                1
;media\nls\c_1250.nls                                1
;media\nls\c_1251.nls                                1
;media\nls\c_1253.nls                                1
;media\nls\c_1254.nls                                1
;media\nls\c_1255.nls                                1
;media\nls\c_1256.nls                                1
;media\nls\c_1257.nls                                1
;media\nls\c_1258.nls                                1
;media\nls\c_10000.nls                               1
;media\nls\c_10006.nls                               1
;media\nls\c_10007.nls                               1
;media\nls\c_10029.nls                               1
;media\nls\c_10079.nls                               1
;media\nls\c_10081.nls                               1
;media\nls\c_20866.nls                               1
;media\nls\c_28591.nls                               1
;media\nls\c_28592.nls                               1
;media\nls\c_28593.nls                               1
;media\nls\c_28594.nls                               1
;media\nls\c_28595.nls                               1
;media\nls\c_28596.nls                               1
;media\nls\c_28597.nls                               1
;media\nls\c_28598.nls                               1
;media\nls\c_28599.nls                               1
;media\drivers\etc\services                          5
;media\inf\acpi.inf                                  6
;media\inf\cdrom.inf                                 6
;media\inf\display.inf                               6
;media\inf\font.inf                                  6
;media\inf\hdc.inf                                   6
;media\inf\intl.inf                                  6
;media\inf\layout.inf                                6
;media\inf\machine.inf                               6
;media\inf\msmouse.inf                               6
;media\inf\keyboard.inf                              6
;media\inf\NET_NIC.inf                               6
;media\inf\netamd.inf                                6
;media\inf\netisa.inf                                6
;media\inf\netrtpnt.inf                              6
;media\inf\nettcpip.inf                              6
;media\inf\ports.inf                                 6
;media\inf\scsi.inf                                  6
;media\inf\syssetup.inf                              6
;media\inf\usbport.inf                               6
;media\inf\usb.inf                                   6
;media\inf\usbstor.inf                               6
;media\inf\xboxdisp.inf                              6
+ media\fonts\DejaVuSans.ttf                          3
+ media\fonts\DejaVuSans-Bold.ttf                     3
+ media\fonts\DejaVuSans-BoldOblique.ttf              3
+ media\fonts\DejaVuSansMono.ttf                      3
+ media\fonts\DejaVuSansMono-Bold.ttf                 3
+ media\fonts\DejaVuSansMono-BoldOblique.ttf          3
+ media\fonts\DejaVuSansMono-Oblique.ttf              3
+ media\fonts\DejaVuSans-Oblique.ttf                  3
+ media\fonts\DejaVuSerif.ttf                         3
+ media\fonts\DejaVuSerif-Bold.ttf                    3
+ media\fonts\DejaVuSerif-BoldItalic.ttf              3
+ media\fonts\DejaVuSerif-Italic.ttf                  3
+ media\fonts\FreeMono.ttf                            3
+ media\fonts\FreeMonoBold.ttf                        3
+ media\fonts\FreeMonoBoldOblique.ttf                 3
+ media\fonts\FreeMonoOblique.ttf                     3
+ media\fonts\LiberationMono-Bold.ttf                 3
+ media\fonts\LiberationMono-BoldItalic.ttf           3
+ media\fonts\LiberationMono-Italic.ttf               3
+ media\fonts\LiberationMono-Regular.ttf              3
+ media\fonts\LiberationSans-Bold.ttf                 3
+ media\fonts\LiberationSans-BoldItalic.ttf           3
+ media\fonts\LiberationSans-Italic.ttf               3
+ media\fonts\LiberationSans-Regular.ttf              3
+ media\fonts\LiberationSerif-Bold.ttf                3
+ media\fonts\LiberationSerif-BoldItalic.ttf          3
+ media\fonts\LiberationSerif-Italic.ttf              3
+ media\fonts\LiberationSerif-Regular.ttf             3
+ media\fonts\Marlett.ttf                             3
+ media\fonts\tahoma.ttf                              3
+ media\fonts\tahomabd.ttf                            3
+ media\nls\c_037.nls                                 1
+ media\nls\c_500.nls                                 1
+ media\nls\c_737.nls                                 1
+ media\nls\c_775.nls                                 1
+ media\nls\c_850.nls                                 1
+ media\nls\c_852.nls                                 1
+ media\nls\c_855.nls                                 1
+ media\nls\c_856.nls                                 1
+ media\nls\c_857.nls                                 1
+ media\nls\c_860.nls                                 1
+ media\nls\c_861.nls                                 1
+ media\nls\c_862.nls                                 1
+ media\nls\c_863.nls                                 1
+ media\nls\c_864.nls                                 1
+ media\nls\c_865.nls                                 1
+ media\nls\c_866.nls                                 1
+ media\nls\c_869.nls                                 1
+ media\nls\c_874.nls                                 1
+ media\nls\c_875.nls                                 1
+ media\nls\c_878.nls                                 1
+ media\nls\c_932.nls                                 1
+ media\nls\c_936.nls                                 1
+ media\nls\c_949.nls                                 1
+ media\nls\c_950.nls                                 1
+ media\nls\c_1006.nls                                1
+ media\nls\c_1026.nls                                1
+ media\nls\c_1250.nls                                1
+ media\nls\c_1251.nls                                1
+ media\nls\c_1253.nls                                1
+ media\nls\c_1254.nls                                1
+ media\nls\c_1255.nls                                1
+ media\nls\c_1256.nls                                1
+ media\nls\c_1257.nls                                1
+ media\nls\c_1258.nls                                1
+ media\nls\c_10000.nls                               1
+ media\nls\c_10006.nls                               1
+ media\nls\c_10007.nls                               1
+ media\nls\c_10029.nls                               1
+ media\nls\c_10079.nls                               1
+ media\nls\c_10081.nls                               1
+ media\nls\c_20866.nls                               1
+ media\nls\c_28591.nls                               1
+ media\nls\c_28592.nls                               1
+ media\nls\c_28593.nls                               1
+ media\nls\c_28594.nls                               1
+ media\nls\c_28595.nls                               1
+ media\nls\c_28596.nls                               1
+ media\nls\c_28597.nls                               1
+ media\nls\c_28598.nls                               1
+ media\nls\c_28599.nls                               1
+ media\drivers\etc\services                          5
+ media\inf\acpi.inf                                  6
+ media\inf\cdrom.inf                                 6
+ media\inf\display.inf                               6
+ media\inf\font.inf                                  6
+ media\inf\hdc.inf                                   6
+ media\inf\intl.inf                                  6
+ media\inf\layout.inf                                6
+ media\inf\machine.inf                               6
+ media\inf\msmouse.inf                               6
+ media\inf\keyboard.inf                              6
+ media\inf\NET_NIC.inf                               6
+ media\inf\netamd.inf                                6
+ media\inf\netisa.inf                                6
+ media\inf\netrtpnt.inf                              6
+ media\inf\nettcpip.inf                              6
+ media\inf\ports.inf                                 6
+ media\inf\scsi.inf                                  6
+ media\inf\syssetup.inf                              6
+ media\inf\usbport.inf                               6
+ media\inf\usb.inf                                   6
+ media\inf\usbstor.inf                               6
+ media\inf\xboxdisp.inf                              6
  
  ; Subsystems
- ;subsystems\win32\csrss\csrss.exe                    1
- ;subsystems\win32\csrss\win32csr\win32csr.dll        1
- ;subsystems\ntvdm\ntvdm.exe                          1
- ;subsystems\win32\win32k\win32k.sys                  1
+ subsystems\win32\csrss\csrss.exe                    1
+ subsystems\win32\csrss\win32csr\win32csr.dll        1
++subsystems\csr\csr.exe                              1   optional
++subsystems\csr\csrsrv\csrsrv.dll                    1   optional
++subsystems\win\basesrv\basesrv.dll                  1   optional
++subsystems\win\winsrv\winsrv.dll                    1   optional
+ subsystems\ntvdm\ntvdm.exe                          1
+ subsystems\win32\win32k\win32k.sys                  1
++
  boot\bootdata\bootcdregtest\testboot.bat            7   optional
++tools\dbgprint\dbgprint.exe                         7   optional
  
  ; Modules
- ;modules\rosapps\applications\screensavers\cylfrac\cylfrac.scr              1   optional
- ;modules\rosapps\applications\screensavers\matrix\matrix.scr                1   optional
- ;modules\rosapps\applications\screensavers\blankscr\scrnsave.scr            1   optional
- ;modules\rosapps\applications\screensavers\starfield\starfield.scr          1   optional
- ;modules\rosapps\applications\screensavers\mazescr\mazescr.scr              1   optional
- ;modules\rosapps\applications\screensavers\butterflies\butterflies.scr      1   optional
- ;modules\rosapps\applications\cmdutils\comp\comp.exe                                     1   optional
- ;modules\rosapps\applications\cmdutils\mode\mode.exe                                     1   optional
- ;modules\rosapps\applications\cmdutils\sort\sort.exe                                     1   optional
- ;modules\rosapps\applications\cmdutils\tee\tee.exe                                       1   optional
- ;modules\rosapps\applications\cmdutils\touch\touch.exe                                   1   optional
- ;modules\rosapps\applications\cmdutils\uptime\uptime.exe                                 1   optional
- ;modules\rosapps\applications\cmdutils\y\y.exe                                           1   optional
- ;modules\rosapps\applications\devutils\gdb2\gdb2.exe                                     1   optional
- ;modules\rosapps\applications\devutils\gdihv\gdihv.exe                                   1   optional
- ;modules\rosapps\applications\devutils\genguid\genguid.exe                               1   optional
- ;modules\rosapps\applications\devutils\gettype\gettype.exe                               1   optional
- ;modules\rosapps\applications\devutils\roswebparser\roswebparser.exe                     1   optional
- ;modules\rosapps\applications\devutils\zoomin\zoomin.exe                                 1   optional
- ;modules\rosapps\applications\downloader\downloader.exe                                  1   optional
- ;modules\rosapps\applications\downloader\downloader.xml                                  1   optional
- ;modules\rosapps\applications\fontview\fontview.exe                                      1   optional
- ;modules\rosapps\applications\imagesoft\imagesoft.exe                                    1   optional
- ;modules\rosapps\applications\net\ncftp\ncftp.exe                                        1   optional
- ;modules\rosapps\applications\net\netreg\netreg.exe                                      1   optional
- ;modules\rosapps\applications\net\niclist\niclist.exe                                    1   optional
- ;modules\rosapps\applications\net\roshttpd\roshttpd.exe                                      1   optional
- ;modules\rosapps\applications\notevil\notevil.exe                                        1   optional
- ;modules\rosapps\applications\magnify\magnify.exe                                        1   optional
- ;modules\rosapps\applications\packmgr\cmd-line\rosget.exe                                1   optional
- ;modules\rosapps\applications\packmgr\gui\packmgr.exe                                    1   optional
- ;modules\rosapps\applications\packmgr\lib\package.dll                                    1   optional
- ;modules\rosapps\applications\sysutils\chkdsk\chkdsk.exe                                 1   optional
- ;modules\rosapps\applications\sysutils\systeminfo\systeminfo.exe                         1   optional
- ;modules\rosapps\applications\sysutils\chklib\chklib.exe                                 1   optional
- ;modules\rosapps\applications\sysutils\ctm\ctm.exe                                       1   optional
- ;modules\rosapps\applications\sysutils\dosfsck\dosfsck.exe                                       1   optional
- ;modules\rosapps\applications\sysutils\kill\kill.exe                                     1   optional
- ;modules\rosapps\applications\sysutils\lsdd\lsdd.exe                                     1   optional
- ;modules\rosapps\applications\sysutils\man\man.exe                                       1   optional
- ;modules\rosapps\applications\sysutils\pedump\pedump.exe                                 1   optional
- ;modules\rosapps\applications\sysutils\regexpl\regexpl.exe                               1   optional
- ;modules\rosapps\applications\sysutils\tcat\tcat.exe                                     1   optional
- ;modules\rosapps\applications\sysutils\tlist\tlist.exe                                   1   optional
- ;modules\rosapps\applications\sysutils\screenshot\screenshot.exe                                  1   optional
- ;modules\rosapps\applications\sysutils\utils\binpatch\binpatch.exe                       1   optional
- ;modules\rosapps\applications\sysutils\utils\cat\cat.exe                                 1   optional
- ;modules\rosapps\applications\sysutils\utils\driver\load\load.exe                        1   optional
- ;modules\rosapps\applications\sysutils\utils\driver\unload\unload.exe                    1   optional
- ;modules\rosapps\applications\sysutils\utils\infinst\infinst.exe                         1   optional
- ;modules\rosapps\applications\sysutils\utils\nts2w32err\nts2w32err.exe                   1   optional
- ;modules\rosapps\applications\sysutils\utils\objdir\objdir.exe                           1   optional
- ;modules\rosapps\applications\sysutils\utils\partinfo\partinfo.exe                       1   optional
- ;modules\rosapps\applications\sysutils\utils\ps\ps.exe                                   1   optional
- ;modules\rosapps\applications\sysutils\utils\rosperf\rosperf.exe                         1   optional
- ;modules\rosapps\applications\sysutils\utils\stats\stats.exe                             1   optional
- ;modules\rosapps\applications\sysutils\utils\tickcount\tickcount.exe                     1   optional
- ;modules\rosapps\applications\winfile\winfile.exe                                        1   optional
- ;modules\rosapps\applications\winver\winver.exe                                          1   optional
- ;modules\rosapps\applications\write\write.exe                                            1   optional
- ;modules\rosapps\demos\ddraw\ddraw_demo.exe                                 1   optional
- ;modules\rosapps\demos\maze\maze.exe                                        1   optional
- ;modules\rosapps\dflat32\edit.exe                                           1   optional
- ;modules\rosapps\drivers\avtest\avtest.sys                                  1   optional
- ;modules\rosapps\drivers\ramdrv\ramdrv.sys                                  1   optional
- ;modules\rosapps\drivers\green\green.sys                                    1   optional
- ;modules\rosapps\templates\dialog\dialog.exe                                       1   optional
- ;modules\rostests\winetests\advapi32\advapi32_winetest.exe                  7   optional
- ;modules\rostests\winetests\advpack\advpack_winetest.exe                    7   optional
- ;modules\rostests\winetests\browseui\browseui_winetest.exe                  7   optional
- ;modules\rostests\winetests\cabinet\cabinet_winetest.exe                    7   optional
- ;modules\rostests\winetests\comcat\comcat_winetest.exe                      7   optional
- ;modules\rostests\winetests\comctl32\comctl32_winetest.exe                  7   optional
- ;modules\rostests\winetests\comdlg32\comdlg32_winetest.exe                  7   optional
- ;modules\rostests\winetests\gdi32\gdi32_winetest.exe                        7   optional
- ;modules\rostests\winetests\gdiplus\gdiplus_winetest.exe                    7   optional
- ;modules\rostests\winetests\hlink\hlink_winetest.exe                        7   optional
- ;modules\rostests\winetests\icmp\icmp_winetest.exe                          7   optional
- ;modules\rostests\winetests\kernel32\kernel32_winetest.exe                  7   optional
- ;modules\rostests\winetests\lz32\lz32_winetest.exe                          7   optional
- ;modules\rostests\winetests\mapi32\mapi32_winetest.exe                      7   optional
- ;modules\rostests\winetests\mlang\mlang_winetest.exe                        7   optional
- ;modules\rostests\winetests\mshtml\mshtml_winetest.exe                      7   optional
- ;modules\rostests\winetests\msi\msi_winetest.exe                            7   optional
- ;modules\rostests\winetests\mstask\mstask_winetest.exe                      7   optional
- ;modules\rostests\winetests\msvcrt\msvcrt_winetest.exe                      7   optional
- ;modules\rostests\winetests\netapi32\netapi32_winetest.exe                  7   optional
- ;modules\rostests\winetests\ntdll\ntdll_winetest.exe                        7   optional
- ;modules\rostests\winetests\odbccp32\odbccp32_winetest.exe                  7   optional
- ;modules\rostests\winetests\ole32\ole32_winetest.exe                        7   optional
- ;modules\rostests\winetests\oleaut32\oleaut32_winetest.exe                  7   optional
- ;modules\rostests\winetests\powrprof\powrprof_winetest.exe                  7   optional
- ;modules\rostests\winetests\psapi\psapi_winetest.exe                        7   optional
- ;modules\rostests\winetests\riched20\riched20_winetest.exe                  7   optional
- ;modules\rostests\winetests\rpcrt4\rpcrt4_winetest.exe                      7   optional
- ;modules\rostests\winetests\rsabase\rsabase_winetest.exe                    7   optional
- ;modules\rostests\winetests\rsaenh\rsaenh_winetest.exe                      7   optional
- ;modules\rostests\winetests\schannel\schannel_winetest.exe                  7   optional
- ;modules\rostests\winetests\secur32\secur32_winetest.exe                    7   optional
- ;modules\rostests\winetests\setupapi\setupapi_winetest.exe                  7   optional
- ;modules\rostests\winetests\shdocvw\shdocvw_winetest.exe                    7   optional
- ;modules\rostests\winetests\shell32\shell32_winetest.exe                    7   optional
- ;modules\rostests\winetests\shlwapi\shlwapi_winetest.exe                    7   optional
- ;modules\rostests\winetests\urlmon\urlmon_winetest.exe                      7   optional
- ;modules\rostests\winetests\user32\user32_winetest.exe                      7   optional
- ;modules\rostests\winetests\usp10\usp10_winetest.exe                        7   optional
- ;modules\rostests\winetests\uxtheme\uxtheme_winetest.exe                    7   optional
- ;modules\rostests\winetests\version\version_winetest.exe                    7   optional
- ;modules\rostests\winetests\winhttp\winhttp_winetest.exe                    7   optional
- ;modules\rostests\winetests\wininet\wininet_winetest.exe                    7   optional
- ;modules\wallpaper\lake.bmp                                                 4   optional
++modules\os2\server\os2srv.dll                                              1   optional
++modules\os2\dll\win32\doscalls\doscalls.dll                                1   optional
++modules\posix\server\psxsrv.dll                                            1   optional
++modules\posix\dll\win32\psxdll\psxdll.dll                                  1   optional
++modules\rosky\dll\win32\libsky\libsky.dll                                  1   optional
++modules\rosky\dll\win32\libskygi\libskygi.dll                              1   optional
++modules\vms\server\vmssrv.dll                                              1   optional
++modules\vms\dll\win32\vmsdll\vmsdll.dll                                    1   optional
+ modules\rosapps\applications\screensavers\cylfrac\cylfrac.scr              1   optional
+ modules\rosapps\applications\screensavers\matrix\matrix.scr                1   optional
+ modules\rosapps\applications\screensavers\blankscr\scrnsave.scr            1   optional
+ modules\rosapps\applications\screensavers\starfield\starfield.scr          1   optional
+ modules\rosapps\applications\screensavers\mazescr\mazescr.scr              1   optional
+ modules\rosapps\applications\screensavers\butterflies\butterflies.scr      1   optional
+ modules\rosapps\applications\cmdutils\comp\comp.exe                                     1   optional
+ modules\rosapps\applications\cmdutils\mode\mode.exe                                     1   optional
+ modules\rosapps\applications\cmdutils\sort\sort.exe                                     1   optional
+ modules\rosapps\applications\cmdutils\tee\tee.exe                                       1   optional
+ modules\rosapps\applications\cmdutils\touch\touch.exe                                   1   optional
+ modules\rosapps\applications\cmdutils\uptime\uptime.exe                                 1   optional
+ modules\rosapps\applications\cmdutils\y\y.exe                                           1   optional
+ modules\rosapps\applications\devutils\gdb2\gdb2.exe                                     1   optional
+ modules\rosapps\applications\devutils\gdihv\gdihv.exe                                   1   optional
+ modules\rosapps\applications\devutils\genguid\genguid.exe                               1   optional
 -modules\rosapps\applications\sysutils\gettype\gettype.exe                               1   optional
++modules\rosapps\applications\devutils\gettype\gettype.exe                               1   optional
+ modules\rosapps\applications\devutils\roswebparser\roswebparser.exe                     1   optional
+ modules\rosapps\applications\devutils\zoomin\zoomin.exe                                 1   optional
+ modules\rosapps\applications\downloader\downloader.exe                                  1   optional
+ modules\rosapps\applications\downloader\downloader.xml                                  1   optional
+ modules\rosapps\applications\fontview\fontview.exe                                      1   optional
+ modules\rosapps\applications\imagesoft\imagesoft.exe                                    1   optional
+ modules\rosapps\applications\net\ncftp\ncftp.exe                                        1   optional
+ modules\rosapps\applications\net\netreg\netreg.exe                                      1   optional
+ modules\rosapps\applications\net\niclist\niclist.exe                                    1   optional
 -modules\rosapps\applications\net\roshttpd\roshttpd.exe                                  1   optional
++modules\rosapps\applications\net\roshttpd\roshttpd.exe                                      1   optional
+ modules\rosapps\applications\notevil\notevil.exe                                        1   optional
+ modules\rosapps\applications\magnify\magnify.exe                                        1   optional
+ modules\rosapps\applications\packmgr\cmd-line\rosget.exe                                1   optional
+ modules\rosapps\applications\packmgr\gui\packmgr.exe                                    1   optional
+ modules\rosapps\applications\packmgr\lib\package.dll                                    1   optional
+ modules\rosapps\applications\sysutils\chkdsk\chkdsk.exe                                 1   optional
+ modules\rosapps\applications\sysutils\systeminfo\systeminfo.exe                         1   optional
+ modules\rosapps\applications\sysutils\chklib\chklib.exe                                 1   optional
+ modules\rosapps\applications\sysutils\ctm\ctm.exe                                       1   optional
+ modules\rosapps\applications\sysutils\dosfsck\dosfsck.exe                                       1   optional
+ modules\rosapps\applications\sysutils\kill\kill.exe                                     1   optional
+ modules\rosapps\applications\sysutils\lsdd\lsdd.exe                                     1   optional
+ modules\rosapps\applications\sysutils\man\man.exe                                       1   optional
+ modules\rosapps\applications\sysutils\pedump\pedump.exe                                 1   optional
+ modules\rosapps\applications\sysutils\regexpl\regexpl.exe                               1   optional
+ modules\rosapps\applications\sysutils\tcat\tcat.exe                                     1   optional
+ modules\rosapps\applications\sysutils\tlist\tlist.exe                                   1   optional
 -modules\rosapps\applications\sysutils\screenshot\screenshot.exe                         1   optional
++modules\rosapps\applications\sysutils\screenshot\screenshot.exe                                  1   optional
+ modules\rosapps\applications\sysutils\utils\binpatch\binpatch.exe                       1   optional
+ modules\rosapps\applications\sysutils\utils\cat\cat.exe                                 1   optional
+ modules\rosapps\applications\sysutils\utils\driver\load\load.exe                        1   optional
+ modules\rosapps\applications\sysutils\utils\driver\unload\unload.exe                    1   optional
+ modules\rosapps\applications\sysutils\utils\infinst\infinst.exe                         1   optional
+ modules\rosapps\applications\sysutils\utils\nts2w32err\nts2w32err.exe                   1   optional
+ modules\rosapps\applications\sysutils\utils\objdir\objdir.exe                           1   optional
+ modules\rosapps\applications\sysutils\utils\partinfo\partinfo.exe                       1   optional
+ modules\rosapps\applications\sysutils\utils\ps\ps.exe                                   1   optional
+ modules\rosapps\applications\sysutils\utils\rosperf\rosperf.exe                         1   optional
+ modules\rosapps\applications\sysutils\utils\stats\stats.exe                             1   optional
+ modules\rosapps\applications\sysutils\utils\tickcount\tickcount.exe                     1   optional
+ modules\rosapps\applications\winfile\winfile.exe                                        1   optional
+ modules\rosapps\applications\winver\winver.exe                                          1   optional
+ modules\rosapps\applications\write\write.exe                                            1   optional
+ modules\rosapps\demos\ddraw\ddraw_demo.exe                                 1   optional
+ modules\rosapps\demos\maze\maze.exe                                        1   optional
+ modules\rosapps\dflat32\edit.exe                                           1   optional
+ modules\rosapps\drivers\avtest\avtest.sys                                  1   optional
+ modules\rosapps\drivers\ramdrv\ramdrv.sys                                  1   optional
+ modules\rosapps\drivers\green\green.sys                                    1   optional
 -modules\rosapps\templates\dialog\dialog.exe                                       1   optional
++modules\rosapps\lib\dflat32\dflat32.dll                                    1   optional
++modules\rosapps\templates\dialog.exe                                       1   optional
++modules\rosapps\templates\mdi.exe                                          1   optional
+ modules\rostests\winetests\advapi32\advapi32_winetest.exe                  7   optional
+ modules\rostests\winetests\advpack\advpack_winetest.exe                    7   optional
+ modules\rostests\winetests\browseui\browseui_winetest.exe                  7   optional
+ modules\rostests\winetests\cabinet\cabinet_winetest.exe                    7   optional
+ modules\rostests\winetests\comcat\comcat_winetest.exe                      7   optional
+ modules\rostests\winetests\comctl32\comctl32_winetest.exe                  7   optional
+ modules\rostests\winetests\comdlg32\comdlg32_winetest.exe                  7   optional
+ modules\rostests\winetests\gdi32\gdi32_winetest.exe                        7   optional
+ modules\rostests\winetests\gdiplus\gdiplus_winetest.exe                    7   optional
+ modules\rostests\winetests\hlink\hlink_winetest.exe                        7   optional
+ modules\rostests\winetests\icmp\icmp_winetest.exe                          7   optional
+ modules\rostests\winetests\kernel32\kernel32_winetest.exe                  7   optional
+ modules\rostests\winetests\lz32\lz32_winetest.exe                          7   optional
+ modules\rostests\winetests\mapi32\mapi32_winetest.exe                      7   optional
+ modules\rostests\winetests\mlang\mlang_winetest.exe                        7   optional
+ modules\rostests\winetests\mshtml\mshtml_winetest.exe                      7   optional
+ modules\rostests\winetests\msi\msi_winetest.exe                            7   optional
 -modules\rostests\winetests\mstask\mstask_winetest.exe                      7   optional
+ modules\rostests\winetests\msvcrt\msvcrt_winetest.exe                      7   optional
+ modules\rostests\winetests\netapi32\netapi32_winetest.exe                  7   optional
+ modules\rostests\winetests\ntdll\ntdll_winetest.exe                        7   optional
+ modules\rostests\winetests\odbccp32\odbccp32_winetest.exe                  7   optional
+ modules\rostests\winetests\ole32\ole32_winetest.exe                        7   optional
+ modules\rostests\winetests\oleaut32\oleaut32_winetest.exe                  7   optional
+ modules\rostests\winetests\powrprof\powrprof_winetest.exe                  7   optional
+ modules\rostests\winetests\psapi\psapi_winetest.exe                        7   optional
+ modules\rostests\winetests\riched20\riched20_winetest.exe                  7   optional
+ modules\rostests\winetests\rpcrt4\rpcrt4_winetest.exe                      7   optional
+ modules\rostests\winetests\rsabase\rsabase_winetest.exe                    7   optional
+ modules\rostests\winetests\rsaenh\rsaenh_winetest.exe                      7   optional
+ modules\rostests\winetests\schannel\schannel_winetest.exe                  7   optional
+ modules\rostests\winetests\secur32\secur32_winetest.exe                    7   optional
+ modules\rostests\winetests\setupapi\setupapi_winetest.exe                  7   optional
+ modules\rostests\winetests\shdocvw\shdocvw_winetest.exe                    7   optional
+ modules\rostests\winetests\shell32\shell32_winetest.exe                    7   optional
+ modules\rostests\winetests\shlwapi\shlwapi_winetest.exe                    7   optional
+ modules\rostests\winetests\urlmon\urlmon_winetest.exe                      7   optional
+ modules\rostests\winetests\user32\user32_winetest.exe                      7   optional
+ modules\rostests\winetests\usp10\usp10_winetest.exe                        7   optional
+ modules\rostests\winetests\uxtheme\uxtheme_winetest.exe                    7   optional
+ modules\rostests\winetests\version\version_winetest.exe                    7   optional
+ modules\rostests\winetests\winhttp\winhttp_winetest.exe                    7   optional
+ modules\rostests\winetests\wininet\wininet_winetest.exe                    7   optional
+ modules\wallpaper\lake.bmp                                                 4   optional
  
  ; Native libraries
;modules\windows\mfc42.dll                                                  1   optional
;modules\windows\vmx_fb.dll                                                 1   optional
;modules\windows\vmx_mode.dll                                               1   optional
;modules\windows\vmx_svga.sys                                               2   optional
;modules\windows\vmx_svga.inf                                               6   optional
;modules\windows\kvmnet.sys                                                 2   optional
;modules\windows\kvmnet.inf                                                 6   optional
+ modules\windows\mfc42.dll                                                  1   optional
+ modules\windows\vmx_fb.dll                                                 1   optional
+ modules\windows\vmx_mode.dll                                               1   optional
+ modules\windows\vmx_svga.sys                                               2   optional
+ modules\windows\vmx_svga.inf                                               6   optional
+ modules\windows\kvmnet.sys                                                 2   optional
+ modules\windows\kvmnet.inf                                                 6   optional
@@@ -1,13 -1,12 +1,13 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
- <module name="freetype" type="kernelmodedll" entrypoint="0" baseaddress="${BASEADDRESS_FREETYPE}" installbase="system32" installname="freetype.dll" allowwarnings="true">
+ <module name="freetype" type="kernelmodedll" entrypoint="0" baseaddress="${BASEADDRESS_FREETYPE}" installbase="system32" installname="freetype.dll" allowwarnings="true" crt="libcntpr">
        <importlibrary definition="freetype.def" />
        <include base="freetype">include</include>
        <define name="_DISABLE_TIDENTS" />
        <define name="__NTDRIVER__" />
        <define name="__NO_CTYPE_INLINES" />
        <define name="FT2_BUILD_LIBRARY"  />
 +      <library>libcntpr</library>
        <if property="NSWPAT" value="0">
                <define name="TT_CONFIG_OPTION_UNPATENTED_HINTING" />
        </if>
                <define name="TT_CONFIG_OPTION_BYTECODE_INTERPRETER" />
        </if>
        <library>ntoskrnl</library>
-       <library>libcntpr</library>
 +      <if property="ARCH" value="i386">
        <directory name="i386">
                <file>setjmplongjmp.s</file>
        </directory>
 +      </if>
 +      <if property="ARCH" value="amd64">
 +      <directory name="amd64">
 +              <file>setjmplongjmp.s</file>
 +      </directory>
 +      </if>
        <directory name="src">
                <directory name="base">
                        <file>ftsystem.c</file>
@@@ -1,12 -1,13 +1,12 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="appwiz-new" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_APPWIZ}"  installbase="system32" installname="appwiz-new.cpl" unicode="yes" allowwarnings="true">
 -      <importlibrary definition="appwiz.def" />
 +      <importlibrary definition="appwiz.spec" />
        <include base="appwiz-new">.</include>
        <library>kernel32</library>
        <library>advapi32</library>
        <library>user32</library>
        <library>comctl32</library>
 -      <library>msvcrt</library>
        <library>ole32</library>
        <library>uuid</library>
        <library>shell32</library>
@@@ -15,5 -16,4 +15,4 @@@
        <file>appwiz.c</file>
        <file>createlink.c</file>
        <file>appwiz.rc</file>
-       <file>appwiz.spec</file>
  </module>
@@@ -1,12 -1,13 +1,12 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="appwiz" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_APPWIZ}"  installbase="system32" installname="appwiz.cpl" unicode="yes">
 -      <importlibrary definition="appwiz.def" />
 +      <importlibrary definition="appwiz.spec" />
        <include base="appwiz">.</include>
        <library>kernel32</library>
        <library>advapi32</library>
        <library>user32</library>
        <library>comctl32</library>
 -      <library>msvcrt</library>
        <library>ole32</library>
        <library>uuid</library>
        <library>shell32</library>
@@@ -17,5 -18,4 +17,4 @@@
        <file>createlink.c</file>
        <file>updates.c</file>
        <file>appwiz.rc</file>
-       <file>appwiz.spec</file>
  </module>
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="desk" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_DESK}" installbase="system32" installname="desk.cpl" unicode="yes">
 -      <importlibrary definition="desk.def" />
 +      <importlibrary definition="desk.spec" />
        <include base="desk">.</include>
        <define name="_WIN32" />
        <library>kernel32</library>
@@@ -31,5 -31,4 +31,4 @@@
        <file>monslctl.c</file>
        <file>general.c</file>
        <file>desk.rc</file>
-       <file>desk.spec</file>
  </module>
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="input" type="win32dll" extension=".dll" baseaddress="${BASEADDRESS_INPUT}" installbase="system32" installname="input.dll" unicode="yes">
 -      <importlibrary definition="input.def" />
 +      <importlibrary definition="input.spec" />
        <include base="input">.</include>
        <library>kernel32</library>
        <library>advapi32</library>
@@@ -14,5 -14,4 +14,4 @@@
        <file>add.c</file>
        <file>changekeyseq.c</file>
        <file>input.rc</file>
-       <file>input.spec</file>
  </module>
@@@ -1,26 -1,24 +1,24 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="intl" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_INTL}" installbase="system32" installname="intl.cpl" unicode="yes">
 -    <importlibrary definition="intl.def" />
 -    <include base="intl">.</include>
 -    <library>kernel32</library>
 -    <library>user32</library>
 -    <library>comctl32</library>
 -    <library>advapi32</library>
 -    <library>setupapi</library>
 -    <library>shell32</library>
 -    <file>currency.c</file>
 -    <file>date.c</file>
 -    <file>generalp.c</file>
 -    <file>intl.c</file>
 -    <file>inplocale.c</file>
 -    <file>numbers.c</file>
 -    <file>time.c</file>
 -    <file>misc.c</file>
 -    <file>languages.c</file>
 -    <file>advanced.c</file>
 -    <file>sort.c</file>
 -    <file>intl.rc</file>
 +      <importlibrary definition="intl.spec" />
 +      <include base="intl">.</include>
 +      <library>kernel32</library>
 +      <library>user32</library>
 +      <library>comctl32</library>
 +      <library>advapi32</library>
 +      <library>setupapi</library>
-     <library>msvcrt</library>
 +      <library>shell32</library>
 +      <file>currency.c</file>
 +      <file>date.c</file>
 +      <file>generalp.c</file>
 +      <file>intl.c</file>
 +      <file>inplocale.c</file>
 +      <file>numbers.c</file>
 +      <file>time.c</file>
 +      <file>misc.c</file>
 +      <file>languages.c</file>
 +      <file>advanced.c</file>
 +      <file>sort.c</file>
 +      <file>intl.rc</file>
-       <file>intl.spec</file>
  </module>
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="joy" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_JOY}"  installbase="system32" installname="joy.cpl" unicode="yes">
 -      <importlibrary definition="joy.def" />
 +      <importlibrary definition="joy.spec" />
        <include base="joy">.</include>
        <library>kernel32</library>
        <library>advapi32</library>
@@@ -12,5 -12,4 +12,4 @@@
        <library>shell32</library>
        <file>joy.c</file>
        <file>joy.rc</file>
-       <file>joy.spec</file>
  </module>
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="main" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_MAIN}" installbase="system32" installname="main.cpl" unicode="yes">
 -      <importlibrary definition="main.def" />
 +      <importlibrary definition="main.spec" />
        <include base="main">.</include>
        <library>kernel32</library>
        <library>advapi32</library>
@@@ -15,5 -15,4 +15,4 @@@
        <file>main.c</file>
        <file>mouse.c</file>
        <file>main.rc</file>
-       <file>main.spec</file>
  </module>
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="ncpa" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_NCPA}" installbase="system32" installname="ncpa.cpl" unicode="yes">
 -      <importlibrary definition="ncpa.def" />
 +      <importlibrary definition="ncpa.spec" />
        <include base="ncpa">.</include>
  
        <define name="_WIN32_WINNT">0x600</define>
@@@ -10,5 -10,4 +10,4 @@@
        <library>advapi32</library>
        <library>shell32</library>
        <file>ncpa.c</file>
-       <file>ncpa.spec</file>
  </module>
@@@ -1,12 -1,11 +1,11 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="odbccp32i" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_ODBCCP32}" installbase="system32" installname="odbccp32.cpl" unicode="yes">
 -      <importlibrary definition="odbccp32.def" />
 +      <importlibrary definition="odbccp32.spec" />
        <include base="odbccp32">.</include>
        <library>kernel32</library>
        <library>user32</library>
        <library>comctl32</library>
        <file>odbccp32.c</file>
        <file>odbccp32.rc</file>
-       <file>odbccp32.spec</file>
  </module>
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="powercfg" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_PWRCFG}" installbase="system32" installname="powercfg.cpl" unicode="yes">
 -      <importlibrary definition="powercfg.def" />
 +      <importlibrary definition="powercfg.spec" />
        <include base="powercfg">.</include>
        <include base="ReactOS">include/reactos/wine</include>
        <library>kernel32</library>
@@@ -16,5 -16,4 +16,4 @@@
        <file>advanced.c</file>
        <file>hibernate.c</file>
        <file>powercfg.rc</file>
-       <file>powercfg.spec</file>
  </module>
@@@ -12,9 -12,9 +12,9 @@@
  
  typedef struct _STARTINFO
  {
-     TCHAR szFreeldrIni[MAX_PATH + 15];
-     TCHAR szDumpFile[MAX_PATH];
-     TCHAR szMinidumpDir[MAX_PATH];
+     WCHAR szFreeldrIni[MAX_PATH + 15];
+     WCHAR szDumpFile[MAX_PATH];
+     WCHAR szMinidumpDir[MAX_PATH];
      DWORD dwCrashDumpEnabled;
      INT iFreeLdrIni;
  } STARTINFO, *PSTARTINFO;
@@@ -33,8 -33,8 +33,8 @@@ SetTimeout(HWND hwndDlg, INT Timeout
          EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECLISTUPDWN), TRUE);
          EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECLISTEDIT), TRUE);
      }
-     SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN, UDM_SETRANGE, (WPARAM) 0, (LPARAM) MAKELONG((short) 999, 0));
-     SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN, UDM_SETPOS, (WPARAM) 0, (LPARAM) MAKELONG((short) Timeout, 0));
+     SendDlgItemMessageW(hwndDlg, IDC_STRRECLISTUPDWN, UDM_SETRANGE, (WPARAM) 0, (LPARAM) MAKELONG((short) 999, 0));
+     SendDlgItemMessageW(hwndDlg, IDC_STRRECLISTUPDWN, UDM_SETPOS, (WPARAM) 0, (LPARAM) MAKELONG((short) Timeout, 0));
  }
  
  static VOID
@@@ -50,33 -50,33 +50,33 @@@ SetRecoveryTimeout(HWND hwndDlg, INT Ti
          EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECRECUPDWN), TRUE);
          EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECRECEDIT), TRUE);
      }
-     SendDlgItemMessage(hwndDlg, IDC_STRRECRECUPDWN, UDM_SETRANGE, (WPARAM) 0, (LPARAM) MAKELONG((short) 999, 0));
-     SendDlgItemMessage(hwndDlg, IDC_STRRECRECUPDWN, UDM_SETPOS, (WPARAM) 0, (LPARAM) MAKELONG((short) Timeout, 0));
+     SendDlgItemMessageW(hwndDlg, IDC_STRRECRECUPDWN, UDM_SETRANGE, (WPARAM) 0, (LPARAM) MAKELONG((short) 999, 0));
+     SendDlgItemMessageW(hwndDlg, IDC_STRRECRECUPDWN, UDM_SETPOS, (WPARAM) 0, (LPARAM) MAKELONG((short) Timeout, 0));
  }
  
  
  static DWORD
- GetSystemDrive(TCHAR **szSystemDrive)
+ GetSystemDrive(WCHAR **szSystemDrive)
  {
      DWORD dwBufSize;
  
      /* get Path to freeldr.ini or boot.ini */
-     *szSystemDrive = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(TCHAR));
+     *szSystemDrive = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
      if (szSystemDrive != NULL)
      {
-         dwBufSize = GetEnvironmentVariable(_T("SystemDrive"), *szSystemDrive, MAX_PATH);
+         dwBufSize = GetEnvironmentVariableW(L"SystemDrive", *szSystemDrive, MAX_PATH);
          if (dwBufSize > MAX_PATH)
          {
-             TCHAR *szTmp;
+             WCHAR *szTmp;
              DWORD dwBufSize2;
  
-             szTmp = HeapReAlloc(GetProcessHeap(), 0, *szSystemDrive, dwBufSize * sizeof(TCHAR));
+             szTmp = HeapReAlloc(GetProcessHeap(), 0, *szSystemDrive, dwBufSize * sizeof(WCHAR));
              if (szTmp == NULL)
                  goto FailGetSysDrive;
  
              *szSystemDrive = szTmp;
  
-             dwBufSize2 = GetEnvironmentVariable(_T("SystemDrive"), *szSystemDrive, dwBufSize);
+             dwBufSize2 = GetEnvironmentVariableW(L"SystemDrive", *szSystemDrive, dwBufSize);
              if (dwBufSize2 > dwBufSize || dwBufSize2 == 0)
                  goto FailGetSysDrive;
          }
@@@ -95,15 -95,15 +95,15 @@@ FailGetSysDrive
  }
  
  static PBOOTRECORD
- ReadFreeldrSection(HINF hInf, TCHAR *szSectionName)
+ ReadFreeldrSection(HINF hInf, WCHAR *szSectionName)
  {
      PBOOTRECORD pRecord;
      INFCONTEXT InfContext;
-     TCHAR szName[MAX_PATH];
-     TCHAR szValue[MAX_PATH];
+     WCHAR szName[MAX_PATH];
+     WCHAR szValue[MAX_PATH];
      DWORD LineLength;
  
-     if (!SetupFindFirstLine(hInf,
+     if (!SetupFindFirstLineW(hInf,
                              szSectionName,
                              NULL,
                              &InfContext))
          return NULL;
      }
  
-     _tcscpy(pRecord->szSectionName, szSectionName);
+     wcscpy(pRecord->szSectionName, szSectionName);
  
      do
      {
-         if (!SetupGetStringField(&InfContext,
+         if (!SetupGetStringFieldW(&InfContext,
                                    0,
                                    szName,
-                                   sizeof(szName) / sizeof(TCHAR),
+                                   sizeof(szName) / sizeof(WCHAR),
                                    &LineLength))
          {
              break;
          }
  
-         if (!SetupGetStringField(&InfContext,
+         if (!SetupGetStringFieldW(&InfContext,
                                    1,
                                    szValue,
-                                   sizeof(szValue) / sizeof(TCHAR),
+                                   sizeof(szValue) / sizeof(WCHAR),
                                    &LineLength))
          {
              break;
          }
  
-         if (!_tcsnicmp(szName, _T("BootType"), 8))
+         if (!wcsnicmp(szName, L"BootType", 8))
          {
-             if (!_tcsnicmp(szValue, _T("ReactOS"), 7))
+             if (!wcsnicmp(szValue, L"ReactOS", 7))
              {
                  //FIXME store as enum
                  pRecord->BootType = 1;
                  pRecord->BootType = 0;
              }
          }
-         else if (!_tcsnicmp(szName, _T("SystemPath"), 10))
+         else if (!wcsnicmp(szName, L"SystemPath", 10))
          {
-             _tcscpy(pRecord->szBootPath, szValue);
+             wcscpy(pRecord->szBootPath, szValue);
          }
-         else if (!_tcsnicmp(szName, _T("Options"), 7))
+         else if (!wcsnicmp(szName, L"Options", 7))
          {
              //FIXME store flags as values
-             _tcscpy(pRecord->szOptions, szValue);
+             wcscpy(pRecord->szOptions, szValue);
          }
  
      }
@@@ -174,35 -174,35 +174,35 @@@ LoadFreeldrSettings(HINF hInf, HWND hwn
  {
      INFCONTEXT InfContext;
      PBOOTRECORD pRecord;
-     TCHAR szDefaultOs[MAX_PATH];
-     TCHAR szName[MAX_PATH];
-     TCHAR szValue[MAX_PATH];
+     WCHAR szDefaultOs[MAX_PATH];
+     WCHAR szName[MAX_PATH];
+     WCHAR szValue[MAX_PATH];
      DWORD LineLength;
      DWORD TimeOut;
      LRESULT lResult;
  
-     if (!SetupFindFirstLine(hInf,
-                            _T("FREELOADER"),
-                            _T("DefaultOS"),
+     if (!SetupFindFirstLineW(hInf,
+                            L"FREELOADER",
+                            L"DefaultOS",
                             &InfContext))
      {
          /* failed to find default os */
          return FALSE;
      }
  
-     if (!SetupGetStringField(&InfContext,
+     if (!SetupGetStringFieldW(&InfContext,
                               1,
                               szDefaultOs,
-                              sizeof(szDefaultOs) / sizeof(TCHAR),
+                              sizeof(szDefaultOs) / sizeof(WCHAR),
                               &LineLength))
      {
          /* no key */
          return FALSE;
      }
  
-     if (!SetupFindFirstLine(hInf,
-                            _T("FREELOADER"),
-                            _T("TimeOut"),
+     if (!SetupFindFirstLineW(hInf,
+                            L"FREELOADER",
+                            L"TimeOut",
                             &InfContext))
      {
          /* expected to find timeout value */
          return FALSE;
      }
  
-     if (!SetupFindFirstLine(hInf,
-                            _T("Operating Systems"),
+     if (!SetupFindFirstLineW(hInf,
+                            L"Operating Systems",
                             NULL,
                             &InfContext))
      {
  
      do
      {
-         if (!SetupGetStringField(&InfContext,
+         if (!SetupGetStringFieldW(&InfContext,
                                   0,
                                   szName,
-                                  sizeof(szName) / sizeof(TCHAR),
+                                  sizeof(szName) / sizeof(WCHAR),
                                   &LineLength))
          {
              /* the ini file is messed up */
              return FALSE;
          }
  
-         if (!SetupGetStringField(&InfContext,
+         if (!SetupGetStringFieldW(&InfContext,
                                   1,
                                   szValue,
-                                  sizeof(szValue) / sizeof(TCHAR),
+                                  sizeof(szValue) / sizeof(WCHAR),
                                   &LineLength))
          {
              /* the ini file is messed up */
          pRecord = ReadFreeldrSection(hInf, szName);
          if (pRecord)
          {
-             lResult = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM)szValue);
+             lResult = SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM)szValue);
              if (lResult != CB_ERR)
              {
-                 SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)pRecord);
-                 if (!_tcscmp(szDefaultOs, szName))
+                 SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)pRecord);
+                 if (!wcscmp(szDefaultOs, szName))
                  {
                      /* we store the friendly name as key */
-                     _tcscpy(szDefaultOs, szValue);
+                     wcscpy(szDefaultOs, szValue);
                  }
              }
              else
      while (SetupFindNextLine(&InfContext, &InfContext));
  
      /* find default os in list */
-     lResult = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_FINDSTRING, (WPARAM)-1, (LPARAM)szDefaultOs);
+     lResult = SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_FINDSTRING, (WPARAM)-1, (LPARAM)szDefaultOs);
      if (lResult != CB_ERR)
      {
         /* set cur sel */
-        SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_SETCURSEL, (WPARAM)lResult, (LPARAM)0);
+        SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_SETCURSEL, (WPARAM)lResult, (LPARAM)0);
      }
  
      if(TimeOut)
      {
-         SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
+         SendDlgItemMessageW(hwndDlg, IDC_STRECLIST, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
      }
  
      SetTimeout(hwndDlg, TimeOut);
@@@ -292,17 -292,17 +292,17 @@@ static IN
  LoadBootSettings(HINF hInf, HWND hwndDlg)
  {
      INFCONTEXT InfContext;
-     TCHAR szName[MAX_PATH];
-     TCHAR szValue[MAX_PATH];
+     WCHAR szName[MAX_PATH];
+     WCHAR szValue[MAX_PATH];
      DWORD LineLength;
      DWORD TimeOut = 0;
-     TCHAR szDefaultOS[MAX_PATH];
-     TCHAR szOptions[MAX_PATH];
+     WCHAR szDefaultOS[MAX_PATH];
+     WCHAR szOptions[MAX_PATH];
      PBOOTRECORD pRecord;
      LRESULT lResult;
  
-     if(!SetupFindFirstLine(hInf,
-                            _T("boot loader"),
+     if(!SetupFindFirstLineW(hInf,
+                            L"boot loader",
                             NULL,
                             &InfContext))
      {
  
      do
      {
-         if (!SetupGetStringField(&InfContext,
+         if (!SetupGetStringFieldW(&InfContext,
                                   0,
                                   szName,
-                                  sizeof(szName) / sizeof(TCHAR),
+                                  sizeof(szName) / sizeof(WCHAR),
                                   &LineLength))
          {
              return FALSE;
          }
  
-         if (!SetupGetStringField(&InfContext,
+         if (!SetupGetStringFieldW(&InfContext,
                                   1,
                                   szValue,
-                                  sizeof(szValue) / sizeof(TCHAR),
+                                  sizeof(szValue) / sizeof(WCHAR),
                                   &LineLength))
          {
              return FALSE;
          }
  
-         if (!_tcsnicmp(szName, _T("timeout"), 7))
+         if (!wcsnicmp(szName, L"timeout", 7))
          {
-             TimeOut = _ttoi(szValue);
+             TimeOut = _wtoi(szValue);
          }
  
-         if (!_tcsnicmp(szName, _T("default"), 7))
+         if (!wcsnicmp(szName, L"default", 7))
          {
-             _tcscpy(szDefaultOS, szValue);
+             wcscpy(szDefaultOS, szValue);
          }
  
      }
      while (SetupFindNextLine(&InfContext, &InfContext));
  
-     if (!SetupFindFirstLine(hInf,
-                             _T("operating systems"),
+     if (!SetupFindFirstLineW(hInf,
+                             L"operating systems",
                              NULL,
                              &InfContext))
      {
  
      do
      {
-         if (!SetupGetStringField(&InfContext,
+         if (!SetupGetStringFieldW(&InfContext,
                                   0,
                                   szName,
-                                  sizeof(szName) / sizeof(TCHAR),
+                                  sizeof(szName) / sizeof(WCHAR),
                                   &LineLength))
          {
              return FALSE;
          }
  
-         if (!SetupGetStringField(&InfContext,
+         if (!SetupGetStringFieldW(&InfContext,
                                   1,
                                   szValue,
-                                  sizeof(szValue) / sizeof(TCHAR),
+                                  sizeof(szValue) / sizeof(WCHAR),
                                   &LineLength))
          {
              return FALSE;
          }
  
-         SetupGetStringField(&InfContext,
+         SetupGetStringFieldW(&InfContext,
                              2,
                              szOptions,
-                             sizeof(szOptions) / sizeof(TCHAR),
+                             sizeof(szOptions) / sizeof(WCHAR),
                              &LineLength);
  
          pRecord = (PBOOTRECORD) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BOOTRECORD));
          if (pRecord)
          {
              pRecord->BootType = 0;
-             _tcscpy(pRecord->szBootPath, szName);
-             _tcscpy(pRecord->szSectionName, szValue);
-             _tcscpy(pRecord->szOptions, szOptions);
+             wcscpy(pRecord->szBootPath, szName);
+             wcscpy(pRecord->szSectionName, szValue);
+             wcscpy(pRecord->szOptions, szOptions);
  
-             if (!_tcscmp(szName, szDefaultOS))
+             if (!wcscmp(szName, szDefaultOS))
              {
                  /* ms boot ini stores the path not the friendly name */
-                 _tcscpy(szDefaultOS, szValue);
+                 wcscpy(szDefaultOS, szValue);
              }
  
-             lResult = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM)szValue);
+             lResult = SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM)szValue);
              if (lResult != CB_ERR)
              {
-                 SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)pRecord);
+                 SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)pRecord);
              }
              else
              {
      while (SetupFindNextLine(&InfContext, &InfContext));
  
      /* find default os in list */
-     lResult = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_FINDSTRING, (WPARAM)0, (LPARAM)szDefaultOS);
+     lResult = SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_FINDSTRING, (WPARAM)0, (LPARAM)szDefaultOS);
      if (lResult != CB_ERR)
      {
         /* set cur sel */
-        SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_SETCURSEL, (WPARAM)lResult, (LPARAM)0);
+        SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_SETCURSEL, (WPARAM)lResult, (LPARAM)0);
      }
  
      if(TimeOut)
      {
-         SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
+         SendDlgItemMessageW(hwndDlg, IDC_STRECLIST, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
      }
  
      SetTimeout(hwndDlg, TimeOut);
@@@ -430,40 -430,40 +430,40 @@@ DeleteBootRecords(HWND hwndDlg
      LONG index;
      PBOOTRECORD pRecord;
  
-     lIndex = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_GETCOUNT, (WPARAM)0, (LPARAM)0);
+     lIndex = SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_GETCOUNT, (WPARAM)0, (LPARAM)0);
      if (lIndex == CB_ERR)
          return;
  
      for (index = 0; index <lIndex; index++)
      {
-         pRecord = (PBOOTRECORD) SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_GETITEMDATA, (WPARAM)index, (LPARAM)0);
+         pRecord = (PBOOTRECORD) SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_GETITEMDATA, (WPARAM)index, (LPARAM)0);
 -        if ((INT)pRecord != CB_ERR)
 +        if ((INT_PTR)pRecord != CB_ERR)
          {
              HeapFree(GetProcessHeap(), 0, pRecord);
          }
      }
  
-     SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_RESETCONTENT, (WPARAM)0, (LPARAM)0);
+     SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_RESETCONTENT, (WPARAM)0, (LPARAM)0);
  }
  
  static LRESULT
  LoadOSList(HWND hwndDlg, PSTARTINFO pStartInfo)
  {
      DWORD dwBufSize;
-     TCHAR *szSystemDrive;
+     WCHAR *szSystemDrive;
      HINF hInf;
  
      dwBufSize = GetSystemDrive(&szSystemDrive);
      if (!dwBufSize)
          return FALSE;
  
-     _tcscpy(pStartInfo->szFreeldrIni, szSystemDrive);
-     _tcscat(pStartInfo->szFreeldrIni, _T("\\freeldr.ini"));
+     wcscpy(pStartInfo->szFreeldrIni, szSystemDrive);
+     wcscat(pStartInfo->szFreeldrIni, L"\\freeldr.ini");
  
-     if (PathFileExists(pStartInfo->szFreeldrIni))
+     if (PathFileExistsW(pStartInfo->szFreeldrIni))
      {
          /* freeldr.ini exists */
-         hInf = SetupOpenInfFile(pStartInfo->szFreeldrIni,
+         hInf = SetupOpenInfFileW(pStartInfo->szFreeldrIni,
                                  NULL,
                                  INF_STYLE_OLDNT,
                                  NULL);
      }
  
      /* try load boot.ini settings */
-     _tcscpy(pStartInfo->szFreeldrIni, szSystemDrive);
-     _tcscat(pStartInfo->szFreeldrIni, _T("\\boot.ini"));
+     wcscpy(pStartInfo->szFreeldrIni, szSystemDrive);
+     wcscat(pStartInfo->szFreeldrIni, L"\\boot.ini");
  
-     if (PathFileExists(pStartInfo->szFreeldrIni))
+     if (PathFileExistsW(pStartInfo->szFreeldrIni))
      {
          /* load boot.ini settings */
-         hInf = SetupOpenInfFile(pStartInfo->szFreeldrIni,
+         hInf = SetupOpenInfFileW(pStartInfo->szFreeldrIni,
                                  NULL,
                                  INF_STYLE_OLDNT,
                                  NULL);
@@@ -518,16 -518,16 +518,16 @@@ SetCrashDlgItems(HWND hwnd, PSTARTINFO 
          /* minidump type */
          EnableWindow(GetDlgItem(hwnd, IDC_STRRECDUMPFILE), TRUE);
          EnableWindow(GetDlgItem(hwnd, IDC_STRRECOVERWRITE), FALSE);
-         SendMessage(GetDlgItem(hwnd, IDC_STRRECDUMPFILE), WM_SETTEXT, (WPARAM)0, (LPARAM)pStartInfo->szMinidumpDir);
+         SendMessageW(GetDlgItem(hwnd, IDC_STRRECDUMPFILE), WM_SETTEXT, (WPARAM)0, (LPARAM)pStartInfo->szMinidumpDir);
      }
      else if (pStartInfo->dwCrashDumpEnabled == 1 || pStartInfo->dwCrashDumpEnabled == 2)
      {
          /* kernel or complete dump */
          EnableWindow(GetDlgItem(hwnd, IDC_STRRECDUMPFILE), TRUE);
          EnableWindow(GetDlgItem(hwnd, IDC_STRRECOVERWRITE), TRUE);
-         SendMessage(GetDlgItem(hwnd, IDC_STRRECDUMPFILE), WM_SETTEXT, (WPARAM)0, (LPARAM)pStartInfo->szDumpFile);
+         SendMessageW(GetDlgItem(hwnd, IDC_STRRECDUMPFILE), WM_SETTEXT, (WPARAM)0, (LPARAM)pStartInfo->szDumpFile);
      }
-     SendDlgItemMessage(hwnd, IDC_STRRECDEBUGCOMBO, CB_SETCURSEL, (WPARAM)pStartInfo->dwCrashDumpEnabled, (LPARAM)0);
+     SendDlgItemMessageW(hwnd, IDC_STRRECDEBUGCOMBO, CB_SETCURSEL, (WPARAM)pStartInfo->dwCrashDumpEnabled, (LPARAM)0);
  }
  
  static VOID
@@@ -536,8 -536,8 +536,8 @@@ WriteStartupRecoveryOptions(HWND hwndDl
      HKEY hKey;
      DWORD lResult;
  
-     if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                      _T("System\\CurrentControlSet\\Control\\CrashControl"),
+     if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
+                      L"System\\CurrentControlSet\\Control\\CrashControl",
                       0,
                       KEY_WRITE,
                       &hKey) != ERROR_SUCCESS)
      }
  
      lResult = (DWORD) SendDlgItemMessage(hwndDlg, IDC_STRRECWRITEEVENT, BM_GETCHECK, (WPARAM)0, (LPARAM)0);
-     RegSetValueEx(hKey, _T("LogEvent"), 0, REG_DWORD, (LPBYTE)&lResult, sizeof(lResult));
+     RegSetValueExW(hKey, L"LogEvent", 0, REG_DWORD, (LPBYTE)&lResult, sizeof(lResult));
  
      lResult = (DWORD) SendDlgItemMessage(hwndDlg, IDC_STRRECSENDALERT, BM_GETCHECK, (WPARAM)0, (LPARAM)0);
-     RegSetValueEx(hKey, _T("SendAlert"), 0, REG_DWORD, (LPBYTE)&lResult, sizeof(lResult));
+     RegSetValueExW(hKey, L"SendAlert", 0, REG_DWORD, (LPBYTE)&lResult, sizeof(lResult));
  
      lResult = (DWORD) SendDlgItemMessage(hwndDlg, IDC_STRRECRESTART, BM_GETCHECK, (WPARAM)0, (LPARAM)0);
-     RegSetValueEx(hKey, _T("AutoReboot"), 0, REG_DWORD, (LPBYTE)&lResult, sizeof(lResult));
+     RegSetValueExW(hKey, L"AutoReboot", 0, REG_DWORD, (LPBYTE)&lResult, sizeof(lResult));
  
      lResult = (DWORD) SendDlgItemMessage(hwndDlg, IDC_STRRECOVERWRITE, BM_GETCHECK, (WPARAM)0, (LPARAM)0);
-     RegSetValueEx(hKey, _T("Overwrite"), 0, REG_DWORD, (LPBYTE)&lResult, sizeof(lResult));
+     RegSetValueExW(hKey, L"Overwrite", 0, REG_DWORD, (LPBYTE)&lResult, sizeof(lResult));
  
  
      if (pStartInfo->dwCrashDumpEnabled == 1 || pStartInfo->dwCrashDumpEnabled == 2)
      {
-         SendDlgItemMessage(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szDumpFile) / sizeof(TCHAR), (LPARAM)pStartInfo->szDumpFile);
-         RegSetValueEx(hKey, _T("DumpFile"), 0, REG_EXPAND_SZ, (LPBYTE)pStartInfo->szDumpFile, (_tcslen(pStartInfo->szDumpFile) + 1) * sizeof(TCHAR));
+         SendDlgItemMessage(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szDumpFile) / sizeof(WCHAR), (LPARAM)pStartInfo->szDumpFile);
+         RegSetValueExW(hKey, L"DumpFile", 0, REG_EXPAND_SZ, (LPBYTE)pStartInfo->szDumpFile, (wcslen(pStartInfo->szDumpFile) + 1) * sizeof(WCHAR));
      }
      else if (pStartInfo->dwCrashDumpEnabled == 3)
      {
-         SendDlgItemMessage(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szDumpFile) / sizeof(TCHAR), (LPARAM)pStartInfo->szDumpFile);
-         RegSetValueEx(hKey, _T("MinidumpDir"), 0, REG_EXPAND_SZ, (LPBYTE)pStartInfo->szDumpFile, (_tcslen(pStartInfo->szDumpFile) + 1) * sizeof(TCHAR));
+         SendDlgItemMessage(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szDumpFile) / sizeof(WCHAR), (LPARAM)pStartInfo->szDumpFile);
+         RegSetValueExW(hKey, L"MinidumpDir", 0, REG_EXPAND_SZ, (LPBYTE)pStartInfo->szDumpFile, (wcslen(pStartInfo->szDumpFile) + 1) * sizeof(WCHAR));
      }
  
-     RegSetValueEx(hKey, _T("CrashDumpEnabled"), 0, REG_DWORD, (LPBYTE)(DWORD_PTR)pStartInfo->dwCrashDumpEnabled, sizeof(pStartInfo->dwCrashDumpEnabled));
 -    RegSetValueExW(hKey, L"CrashDumpEnabled", 0, REG_DWORD, (LPBYTE)pStartInfo->dwCrashDumpEnabled, sizeof(pStartInfo->dwCrashDumpEnabled));
++    RegSetValueExW(hKey, L"CrashDumpEnabled", 0, REG_DWORD, (LPBYTE)(DWORD_PTR)pStartInfo->dwCrashDumpEnabled, sizeof(pStartInfo->dwCrashDumpEnabled));
      RegCloseKey(hKey);
  }
  
@@@ -578,13 -578,11 +578,11 @@@ static VOI
  LoadRecoveryOptions(HWND hwndDlg, PSTARTINFO pStartInfo)
  {
      HKEY hKey;
-     DWORD dwValues;
-     TCHAR szName[MAX_PATH];
-     TCHAR szValue[MAX_PATH];
-     DWORD i, dwName, dwValue, dwValueLength, dwType;
+     WCHAR szName[MAX_PATH];
+     DWORD dwValue, dwValueLength, dwType;
  
      if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                      _T("System\\CurrentControlSet\\Control\\CrashControl"),
+                      L"System\\CurrentControlSet\\Control\\CrashControl",
                       0,
                       KEY_READ,
                       &hKey) != ERROR_SUCCESS)
          return;
      }
  
-     if (RegQueryInfoKey(hKey,
-                         NULL,
-                         NULL,
-                         NULL,
-                         NULL,
-                         NULL,
-                         NULL,
-                         &dwValues,
-                         NULL,
-                         NULL,
-                         NULL,
-                         NULL) != ERROR_SUCCESS)
-     {
-         RegCloseKey(hKey);
-         return;
-     }
+     dwValueLength = sizeof(DWORD);
+     if (RegQueryValueExW(hKey, L"LogEvent", NULL, &dwType, (LPBYTE)&dwValue, &dwValueLength) == ERROR_SUCCESS && dwType == REG_DWORD && dwValue)
+         SendDlgItemMessageW(hwndDlg, IDC_STRRECWRITEEVENT, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
  
-     for (i = 0; i < dwValues; i++)
-     {
-         dwName = sizeof(szName) / sizeof(TCHAR);
+     dwValueLength = sizeof(DWORD);
+     if (RegQueryValueExW(hKey, L"SendAlert", NULL, &dwType, (LPBYTE)&dwValue, &dwValueLength) == ERROR_SUCCESS && dwType == REG_DWORD && dwValue)
+         SendDlgItemMessageW(hwndDlg, IDC_STRRECSENDALERT, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
  
-         RegEnumValue(hKey, i, szName, &dwName, NULL, &dwType, NULL, NULL);
-         if (dwType == REG_DWORD)
-         {
-             dwValueLength = sizeof(dwValue);
-             dwName = sizeof(szName) / sizeof(TCHAR);
-             if (RegEnumValue(hKey, i, szName, &dwName, NULL, &dwType, (LPBYTE)&dwValue, &dwValueLength) != ERROR_SUCCESS)
-                 continue;
-         }
-         else
-         {
-             dwValueLength = sizeof(szValue);
-             dwName = sizeof(szName) / sizeof(TCHAR);
-             if (RegEnumValue(hKey, i, szName, &dwName, NULL, &dwType, (LPBYTE)&szValue, &dwValueLength) != ERROR_SUCCESS)
-                 continue;
-         }
+     dwValueLength = sizeof(DWORD);
+     if (RegQueryValueExW(hKey, L"AutoReboot", NULL, &dwType, (LPBYTE)&dwValue, &dwValueLength) == ERROR_SUCCESS && dwType == REG_DWORD && dwValue)
+         SendDlgItemMessageW(hwndDlg, IDC_STRRECRESTART, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
  
-         if (!_tcscmp(szName, _T("LogEvent")))
-         {
-             if (dwValue)
-                 SendDlgItemMessage(hwndDlg, IDC_STRRECWRITEEVENT, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
-         }
-         else if (!_tcscmp(szName, _T("SendAlert")))
-         {
-             if (dwValue)
-                 SendDlgItemMessage(hwndDlg, IDC_STRRECSENDALERT, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
-         }
-         else if (!_tcscmp(szName, _T("AutoReboot")))
-         {
-             if (dwValue)
-                 SendDlgItemMessage(hwndDlg, IDC_STRRECRESTART, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
-         }
-         else if (!_tcscmp(szName, _T("Overwrite")))
-         {
-             if (dwValue)
-                 SendDlgItemMessage(hwndDlg, IDC_STRRECOVERWRITE, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
-         }
-         else if (!_tcscmp(szName, _T("DumpFile")))
-         {
-             _tcscpy(pStartInfo->szDumpFile, szValue);
-         }
-         else if (!_tcscmp(szName, _T("MinidumpDir")))
-         {
-             _tcscpy(pStartInfo->szMinidumpDir, szValue);
-         }
-         else if (!_tcscmp(szName, _T("CrashDumpEnabled")))
-         {
-             pStartInfo->dwCrashDumpEnabled = dwValue;
-         }
-     }
+     dwValueLength = sizeof(DWORD);
+     if (RegQueryValueExW(hKey, L"Overwrite", NULL, &dwType, (LPBYTE)&dwValue, &dwValueLength) == ERROR_SUCCESS && dwType == REG_DWORD && dwValue)
+         SendDlgItemMessageW(hwndDlg, IDC_STRRECOVERWRITE, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
+     dwValueLength = sizeof(DWORD);
+     if (RegQueryValueExW(hKey, L"CrashDumpEnabled", NULL, &dwType, (LPBYTE)&dwValue, &dwValueLength) == ERROR_SUCCESS && dwType == REG_DWORD && dwValue)
+         pStartInfo->dwCrashDumpEnabled = dwValue;
  
-     if (LoadString(hApplet, IDS_NO_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) < sizeof(szValue) / sizeof(TCHAR))
-         SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szValue);
+    dwValueLength = sizeof(pStartInfo->szDumpFile);
+    if (RegQueryValueExW(hKey, L"DumpFile", NULL, &dwType, (LPBYTE)pStartInfo->szDumpFile, &dwValueLength) != ERROR_SUCCESS)
+        pStartInfo->szDumpFile[0] = L'\0';
  
-     if (LoadString(hApplet, IDS_FULL_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) < sizeof(szValue) / sizeof(TCHAR))
-         SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szValue);
+     dwValueLength = sizeof(pStartInfo->szMinidumpDir);
+     if (RegQueryValueExW(hKey, L"MinidumpDir", NULL, &dwType, (LPBYTE)pStartInfo->szMinidumpDir, &dwValueLength) != ERROR_SUCCESS)
+         pStartInfo->szMinidumpDir[0] = L'\0';
  
-     if (LoadString(hApplet, IDS_KERNEL_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) < sizeof(szValue) / sizeof(TCHAR))
-         SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szValue);
+     if (LoadStringW(hApplet, IDS_NO_DUMP, szName, sizeof(szName) / sizeof(WCHAR)))
+     {
+         szName[(sizeof(szName)/sizeof(WCHAR))-1] = L'\0';
+         SendDlgItemMessageW(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szName);
+     }
  
-     if (LoadString(hApplet, IDS_MINI_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) < sizeof(szValue) / sizeof(TCHAR))
-         SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szValue);
+     if (LoadString(hApplet, IDS_FULL_DUMP, szName, sizeof(szName) / sizeof(WCHAR)))
+     {
+         szName[(sizeof(szName)/sizeof(WCHAR))-1] = L'\0';
+         SendDlgItemMessageW(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szName);
+     }
+     if (LoadStringW(hApplet, IDS_KERNEL_DUMP, szName, sizeof(szName) / sizeof(WCHAR)))
+     {
+         szName[(sizeof(szName)/sizeof(WCHAR))-1] = L'\0';
+         SendDlgItemMessageW(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szName);
+     }
+     if (LoadStringW(hApplet, IDS_MINI_DUMP, szName, sizeof(szName) / sizeof(WCHAR)))
+     {
+         szName[(sizeof(szName)/sizeof(WCHAR))-1] = L'\0';
+         SendDlgItemMessageW(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szName);
+     }
  
      SetCrashDlgItems(hwndDlg, pStartInfo);
      RegCloseKey(hKey);
@@@ -692,7 -659,7 +659,7 @@@ StartRecDlgProc(HWND hwndDlg
      PBOOTRECORD pRecord;
      int iTimeout;
      LRESULT lResult;
-     TCHAR szTimeout[10];
+     WCHAR szTimeout[10];
  
      UNREFERENCED_PARAMETER(lParam);
  
              switch(LOWORD(wParam))
              {
                  case IDC_STRRECEDIT:
-                     ShellExecute(0, _T("open"), _T("notepad"), pStartInfo->szFreeldrIni, NULL, SW_SHOWNORMAL);
+                     ShellExecuteW(0, L"open", L"notepad", pStartInfo->szFreeldrIni, NULL, SW_SHOWNORMAL);
                      // FIXME use CreateProcess and wait untill finished
                      //  DeleteBootRecords(hwndDlg);
                      //  LoadOSList(hwndDlg);
                          iTimeout = SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN, UDM_GETPOS, (WPARAM)0, (LPARAM)0);
                      else
                          iTimeout = 0;
-                     _stprintf(szTimeout, _T("%i"), iTimeout);
+                     swprintf(szTimeout, L"%i", iTimeout);
  
-                     lResult = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
+                     lResult = SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
                      if (lResult == CB_ERR)
                      {
                          /* ? */
  
                      pRecord = (PBOOTRECORD) SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_GETITEMDATA, (WPARAM)lResult, (LPARAM)0);
  
 -                    if ((INT)pRecord != CB_ERR)
 +                    if ((INT_PTR)pRecord != CB_ERR)
                      {
                          if (pStartInfo->iFreeLdrIni == 1) // FreeLdrIni style
                          {
                              /* set default timeout */
-                             WritePrivateProfileString(_T("FREELOADER"),
-                                                       _T("TimeOut"),
+                             WritePrivateProfileStringW(L"FREELOADER",
+                                                       L"TimeOut",
                                                        szTimeout,
                                                        pStartInfo->szFreeldrIni);
                              /* set default os */
-                             WritePrivateProfileString(_T("FREELOADER"),
-                                                       _T("DefaultOS"),
+                             WritePrivateProfileStringW(L"FREELOADER",
+                                                       L"DefaultOS",
                                                        pRecord->szSectionName,
                                                        pStartInfo->szFreeldrIni);
  
                          else if (pStartInfo->iFreeLdrIni == 2) // BootIni style
                          {
                              /* set default timeout */
-                             WritePrivateProfileString(_T("boot loader"),
-                                                       _T("timeout"),
+                             WritePrivateProfileStringW(L"boot loader",
+                                                       L"timeout",
                                                        szTimeout,
                                                        pStartInfo->szFreeldrIni);
                              /* set default os */
-                             WritePrivateProfileString(_T("boot loader"),
-                                                       _T("default"),
+                             WritePrivateProfileStringW(L"boot loader",
+                                                       L"default",
                                                        pRecord->szBootPath,
                                                        pStartInfo->szFreeldrIni);
  
                          {
                              if (pStartInfo->dwCrashDumpEnabled == 1 || pStartInfo->dwCrashDumpEnabled == 2)
                              {
-                                 SendDlgItemMessage(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szDumpFile) / sizeof(TCHAR), (LPARAM)pStartInfo->szDumpFile);
+                                 SendDlgItemMessageW(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szDumpFile) / sizeof(WCHAR), (LPARAM)pStartInfo->szDumpFile);
                              }
                              else if (pStartInfo->dwCrashDumpEnabled == 3)
                              {
-                                 SendDlgItemMessage(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szMinidumpDir) / sizeof(TCHAR), (LPARAM)pStartInfo->szMinidumpDir);
+                                 SendDlgItemMessageW(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szMinidumpDir) / sizeof(WCHAR), (LPARAM)pStartInfo->szMinidumpDir);
                              }
  
                              pStartInfo->dwCrashDumpEnabled = lResult;
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="sysdm" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_SYSDM}" installbase="system32" installname="sysdm.cpl" unicode="yes">
 -      <importlibrary definition="sysdm.def" />
 +      <importlibrary definition="sysdm.spec" />
        <include base="sysdm">.</include>
        <library>kernel32</library>
        <library>advapi32</library>
@@@ -9,7 -9,6 +9,6 @@@
        <library>user32</library>
        <library>gdi32</library>
        <library>comctl32</library>
-       <library>ntdll</library>
        <library>msimg32</library>
        <library>shell32</library>
        <library>shlwapi</library>
@@@ -26,6 -25,5 +25,5 @@@
        <file>userprofile.c</file>
        <file>virtmem.c</file>
        <file>sysdm.rc</file>
-       <file>sysdm.spec</file>
        <pch>precomp.h</pch>
  </module>
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="telephon" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_TELEPHON}"  installbase="system32" installname="telephon.cpl" unicode="yes">
 -      <importlibrary definition="telephon.def" />
 +      <importlibrary definition="telephon.spec" />
        <include base="telephon">.</include>
        <library>kernel32</library>
        <library>advapi32</library>
@@@ -12,5 -12,4 +12,4 @@@
        <library>shell32</library>
        <file>telephon.c</file>
        <file>telephon.rc</file>
-       <file>telephon.spec</file>
  </module>
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="timedate" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_TIMEDATE}" installbase="system32" installname="timedate.cpl" unicode="yes">
 -      <importlibrary definition="timedate.def" />
 +      <importlibrary definition="timedate.spec" />
        <include base="timedate">.</include>
        <library>kernel32</library>
        <library>advapi32</library>
@@@ -18,6 -18,4 +18,5 @@@
        <file>timedate.c</file>
        <file>timezone.c</file>
        <file>timedate.rc</file>
-       <file>timedate.spec</file>
  </module>
 +
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="usrmgr" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_USRMGR}" installbase="system32" installname="usrmgr.cpl" unicode="yes">
 -      <importlibrary definition="usrmgr.def" />
 +      <importlibrary definition="usrmgr.spec" />
        <include base="usrmgr">.</include>
        <library>kernel32</library>
        <library>advapi32</library>
@@@ -18,5 -18,4 +18,4 @@@
        <file>users.c</file>
        <file>usrmgr.c</file>
        <file>usrmgr.rc</file>
-       <file>usrmgr.spec</file>
  </module>
@@@ -1,8 -1,7 +1,7 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="d3d8" type="win32dll" entrypoint="0" installbase="system32" installname="d3d8.dll">
 -      <importlibrary definition="d3d8.def" />
 +      <importlibrary definition="d3d8.spec" />
        <file>d3d8.c</file>
        <file>d3d8.rc</file>
-       <file>d3d8.spec</file>
  </module>
@@@ -6,7 -6,7 +6,7 @@@
   * PROGRAMERS:      Gregor Brunmar <gregor (dot) brunmar (at) home (dot) se>
   */
  
--#define _WIN32_WINNT    0x0502
++//#define _WIN32_WINNT    0x0502
  #include "d3d9_common.h"
  #include <d3d9.h>
  #include <ddraw.h>
@@@ -1,7 -1,10 +1,10 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
  <group>
-       <module name="ntdll" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_NTDLL}" installbase="system32" installname="ntdll.dll">
+       <module name="ntsys" type="staticlibrary">
+               <importlibrary definition="def/ntsys.pspec" dllname="ntdll.dll" root="intermediate" />
+       </module>
+       <module name="ntdll" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_NTDLL}" installbase="system32" installname="ntdll.dll" iscrt="yes">
                <bootstrap installbase="$(CDOUTPUT)/system32" />
                <importlibrary definition="def/ntdll_$(ARCH).def" />
                <include base="ntdll">include</include>
                                        <file>dispatch.S</file>
                                </directory>
                        </if>
 +                      <if property="ARCH" value="amd64">
 +                              <directory name="amd64">
 +                                      <file>stubs.c</file>
 +                              </directory>
 +                      </if>
                        <if property="ARCH" value="arm">
                                <directory name="arm">
                                        <file>stubs_asm.s</file>
@@@ -1,6 -1,6 +1,6 @@@
  <module name="advapi32" type="win32dll" baseaddress="${BASEADDRESS_ADVAPI32}" installbase="system32" installname="advapi32.dll" unicode="yes">
  
 -      <importlibrary definition="advapi32.def" />
 +      <importlibrary definition="advapi32.spec" />
        <include base="advapi32">.</include>
        <include base="scm_client">.</include>
        <include base="lsa_client">.</include>
@@@ -18,7 -18,6 +18,6 @@@
        <library>pseh</library>
        <library>ntdll</library>
        <pch>advapi32.h</pch>
-       <file>advapi32.spec</file>
        <directory name="crypt">
                        <file>crypt.c</file>
                        <file>crypt_arc4.c</file>
@@@ -41,9 -41,9 +41,9 @@@ static VOID CloseDefaultKeys(VOID)
          NtClose(Handle);                                                       \
      }
  #define IsPredefKey(HKey)                                                      \
 -    (((ULONG)(HKey) & 0xF0000000) == 0x80000000)
 +    (((ULONG_PTR)(HKey) & 0xF0000000) == 0x80000000)
  #define GetPredefKeyIndex(HKey)                                                \
 -    ((ULONG)(HKey) & 0x0FFFFFFF)
 +    ((ULONG_PTR)(HKey) & 0x0FFFFFFF)
  
  static NTSTATUS OpenClassesRootKey(PHANDLE KeyHandle);
  static NTSTATUS OpenLocalMachineKey (PHANDLE KeyHandle);
@@@ -400,7 -400,7 +400,7 @@@ RegCloseKey (HKEY hKey
    NTSTATUS Status;
  
    /* don't close null handle or a pseudo handle */
 -  if ((!hKey) || (((ULONG)hKey & 0xF0000000) == 0x80000000))
 +  if ((!hKey) || (((ULONG_PTR)hKey & 0xF0000000) == 0x80000000))
      {
        return ERROR_INVALID_HANDLE;
      }
@@@ -917,6 -917,8 +917,8 @@@ CreateNestedKey(PHKEY KeyHandle
    LocalObjectAttributes.ObjectName = &LocalKeyName;
    FullNameLength = LocalKeyName.Length / sizeof(WCHAR);
  
+   LocalKeyHandle = NULL;
    /* Remove the last part of the key name and try to create the key again. */
    while (Status == STATUS_OBJECT_NAME_NOT_FOUND)
      {
    Length = wcslen (LocalKeyName.Buffer);
    while (TRUE)
      {
-       NtClose (LocalKeyHandle);
+       if (LocalKeyHandle)
+       NtClose (LocalKeyHandle);
  
        LocalKeyName.Buffer[Length] = L'\\';
        Length = wcslen (LocalKeyName.Buffer);
@@@ -1018,7 -1021,7 +1021,7 @@@ RegCreateKeyExA (HKEY hKey
      {
        return RtlNtStatusToDosError (Status);
      }
 -  TRACE("ParentKey %x\n", (ULONG)ParentKey);
 +  TRACE("ParentKey %p\n", ParentKey);
  
    if (lpClass != NULL)
      {
@@@ -1091,7 -1094,7 +1094,7 @@@ RegCreateKeyExW (HKEY hKey
      {
        return RtlNtStatusToDosError(Status);
      }
 -  TRACE("ParentKey %x\n", (ULONG)ParentKey);
 +  TRACE("ParentKey %p\n", ParentKey);
  
    RtlInitUnicodeString (&ClassString,
                        lpClass);
@@@ -2544,7 -2547,7 +2547,7 @@@ RegEnumKeyExA (HKEY hKey
                }
        }
  
-       TRACE("Key Namea0 Length %d\n", StringU.Length);
+       /*TRACE("Key Namea0 Length %d\n", StringU.Length);*/ /* BUGBUG could be uninitialized */
        TRACE("Key Namea1 Length %d\n", NameLength);
        TRACE("Key Namea Length %d\n", *lpcbName);
        TRACE("Key Namea %s\n", lpName);
@@@ -4685,13 -4688,14 +4688,14 @@@ RegSetValueExA (HKEY hKey
      {
        RtlCreateUnicodeStringFromAsciiz (&ValueName,
                                        (PSTR)lpValueName);
-       pValueName = (LPWSTR)ValueName.Buffer;
      }
    else
      {
-       pValueName = NULL;
+       ValueName.Buffer = NULL;
      }
  
+   pValueName = (LPWSTR)ValueName.Buffer;
    if (((dwType == REG_SZ) ||
         (dwType == REG_MULTI_SZ) ||
         (dwType == REG_EXPAND_SZ)) &&
@@@ -188,7 -188,7 +188,7 @@@ CheckNtMartaPresent(VOID
  {
      DWORD ErrorCode;
  
 -    if (InterlockedCompareExchangePointer(&NtMarta,
 +    if (InterlockedCompareExchangePointer((PVOID)&NtMarta,
                                            NULL,
                                            NULL) == NULL)
      {
          if (ErrorCode == ERROR_SUCCESS)
          {
              /* try change the NtMarta pointer */
 -            if (InterlockedCompareExchangePointer(&NtMarta,
 +            if (InterlockedCompareExchangePointer((PVOID)&NtMarta,
                                                    &NtMartaStatic,
                                                    NULL) != NULL)
              {
  VOID
  UnloadNtMarta(VOID)
  {
 -    if (InterlockedExchangePointer(&NtMarta,
 +    if (InterlockedExchangePointer((PVOID)&NtMarta,
                                     NULL) != NULL)
      {
          FreeLibrary(NtMartaStatic.hDllInstance);
@@@ -1252,6 -1252,8 +1252,8 @@@ LookupPrivilegeValueA(LPCSTR lpSystemNa
          RtlCreateUnicodeStringFromAsciiz(&SystemName,
                                           (LPSTR)lpSystemName);
      }
+       else
+               SystemName.Buffer = NULL;
  
      /* Check the privilege name is not NULL */
      if (lpName == NULL)
      RtlCreateUnicodeStringFromAsciiz(&Name,
                                       (LPSTR)lpName);
  
-     Result = LookupPrivilegeValueW((lpSystemName != NULL) ? SystemName.Buffer : NULL,
+     Result = LookupPrivilegeValueW(SystemName.Buffer,
                                     Name.Buffer,
                                     lpLuid);
  
      RtlFreeUnicodeString(&Name);
  
      /* Remote system? */
-     if (lpSystemName != NULL)
+     if (SystemName.Buffer != NULL)
      {
          RtlFreeUnicodeString(&SystemName);
      }
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <group>
 -<module name="comctl32" type="win32dll" baseaddress="${BASEADDRESS_COMCTL32}" installbase="system32" installname="comctl32.dll" allowwarnings="true">
 +<module name="comctl32" type="win32dll" baseaddress="${BASEADDRESS_COMCTL32}" installbase="system32" installname="comctl32.dll" unicode="yes">
        <autoregister infsection="OleControlDlls" type="DllInstall" />
        <importlibrary definition="comctl32.spec" />
        <include base="comctl32">.</include>
@@@ -43,7 -43,6 +43,6 @@@
        <file>treeview.c</file>
        <file>updown.c</file>
        <file>rsrc.rc</file>
-       <file>comctl32.spec</file>
        <library>wine</library>
        <library>user32</library>
        <library>gdi32</library>
@@@ -1,11 -1,10 +1,11 @@@
- <module name="crtdll" type="win32dll" baseaddress="${BASEADDRESS_CRTDLL}" mangledsymbols="true" installbase="system32" installname="crtdll.dll">
+ <module name="crtdll" type="win32dll" baseaddress="${BASEADDRESS_CRTDLL}" mangledsymbols="true" installbase="system32" installname="crtdll.dll" iscrt="true">
 -      <importlibrary definition="crtdll.def" />
 +      <importlibrary definition="crtdll.spec" />
        <include base="crtdll">.</include>
        <include base="crt">include</include>
        <define name="_DISABLE_TIDENTS" />
        <define name="USE_MSVCRT_PREFIX" />
        <define name="_MSVCRT_LIB_" />
 +      <define name="_MSVCRT_" />
        <define name="__NO_CTYPE_INLINES" />
        <define name="_CTYPE_DISABLE_MACROS" />
        <define name="_NO_INLINING" />
@@@ -21,5 -20,4 +21,4 @@@
        <pch>precomp.h</pch>
        <file>dllmain.c</file>
        <file>crtdll.rc</file>
-       <file>crtdll.spec</file>
  </module>
@@@ -1,5 -1,5 +1,5 @@@
  <module name="fmifs" type="win32dll" entrypoint="InitializeFmIfs@12" baseaddress="${BASEADDRESS_FMIFS}" installbase="system32" installname="fmifs.dll">
 -      <importlibrary definition="fmifs.def" />
 +      <importlibrary definition="fmifs.spec" />
        <include base="fmifs">.</include>
        <define name="_DISABLE_TIDENTS" />
        <library>ntdll</library>
@@@ -13,6 -13,5 +13,5 @@@
        <file>media.c</file>
        <file>query.c</file>
        <file>fmifs.rc</file>
-       <file>fmifs.spec</file>
        <pch>precomp.h</pch>
  </module>
@@@ -1,5 -1,5 +1,5 @@@
 -<module name="gdi32" type="win32dll" baseaddress="${BASEADDRESS_GDI32}" installbase="system32" installname="gdi32.dll" unicode="yes">
 -      <importlibrary definition="gdi32.def" />
 +<module name="gdi32" type="win32dll" baseaddress="${BASEADDRESS_GDI32}" installbase="system32" installname="gdi32.dll" unicode="yes" allowwarnings="true">
 +      <importlibrary definition="gdi32.spec" />
        <include base="gdi32">include</include>
        <define name="_DISABLE_TIDENTS" />
        <define name="LANGPACK" />
@@@ -10,7 -10,7 +10,6 @@@
        <library>pseh</library>
        <library>dxguid</library>
        <library>ntdll</library>
--
        <directory name="include">
                <pch>precomp.h</pch>
        </directory>
@@@ -49,5 -49,4 +48,4 @@@
                <file>path.c</file>
        </directory>
        <file>gdi32.rc</file>
-       <file>gdi32.spec</file>
  </module>
@@@ -173,21 -173,6 +173,6 @@@ GetMetaFileBitsEx
        return 0;
  }
  
- /*
-  * @unimplemented
-  */
- DWORD
- STDCALL
- GetFontLanguageInfo(
-       HDC     hDc
-       )
- {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
- }
  /*
   * @unimplemented
   */
@@@ -561,7 -546,19 +546,19 @@@ STDCAL
  UnrealizeObject(HGDIOBJ  hgdiobj)
  {
      BOOL retValue = TRUE;
+ /*
+    Win 2k Graphics API, Black Book. by coriolis.com
+    Page 62, Note that Steps 3, 5, and 6 are not required for Windows NT(tm)
+    and Windows 2000(tm).
  
+    Step 5. UnrealizeObject(hTrackBrush);
+  */
+ /*
+     msdn.microsoft.com,
+     "Windows 2000/XP: If hgdiobj is a brush, UnrealizeObject does nothing,
+     and the function returns TRUE. Use SetBrushOrgEx to set the origin of
+     a brush."
+  */
      if (GDI_HANDLE_GET_TYPE(hgdiobj) != GDI_OBJECT_TYPE_BRUSH)
      {
          retValue = NtGdiUnrealizeObject(hgdiobj);
@@@ -968,7 -965,7 +965,7 @@@ GetGlyphOutlineWow
   */
  DWORD
  STDCALL
 -gdiPlaySpoolStream(
 +GdiPlaySpoolStream(
        DWORD   a0,
        DWORD   a1,
        DWORD   a2,
@@@ -1,5 -1,5 +1,5 @@@
  <module name="glu32" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_GLU32}" installbase="system32" installname="glu32.dll" allowwarnings="true">
 -      <importlibrary definition="glu32.def" />
 +      <importlibrary definition="glu32.spec" />
        <include base="glu32">include</include>
        <include base="glu32">libnurbs/internals</include>
        <include base="glu32">libnurbs/interface</include>
@@@ -14,7 -14,6 +14,6 @@@
        <library>opengl32</library>
        <library>kernel32</library>
        <library>gdi32</library>
-       <file>glu32.spec</file>
        <directory name="libnurbs">
                <directory name="interface">
                        <file>bezierEval.cc</file>
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0"?>
  <!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd">
  <group>
 -      <module name="kernel32_base" type="objectlibrary">
 +      <module name="kernel32_base" type="objectlibrary" allowwarnings="true">
                <include base="kernel32_base">.</include>
                <include base="kernel32_base">include</include>
                <include base="ReactOS">include/reactos/subsys</include>
@@@ -57,6 -57,7 +57,7 @@@
                        <file>actctx.c</file>
                        <file>atom.c</file>
                        <file>chartype.c</file>
+                       <file>casemap.c</file>
                        <file>comm.c</file>
                        <file>computername.c</file>
                        <file>console.c</file>
@@@ -64,6 -65,7 +65,7 @@@
                        <file>env.c</file>
                        <file>error.c</file>
                        <file>errormsg.c</file>
+                       <file>fold.c</file>
                        <file>handle.c</file>
                        <file>lang.c</file>
                        <file>ldr.c</file>
                                        <file>thread.S</file>
                                </directory>
                        </if>
 +                      <if property="ARCH" value="amd64">
 +                              <directory name="amd64">
 +                                      <file>fiber.S</file>
 +                                      <file>thread.S</file>
 +                              </directory>
 +                      </if>
                </directory>
  
                <compilerflag compiler="cpp">-fno-exceptions</compilerflag>
                <library>normalize</library>
        </module>
        <module name="kernel32" type="win32dll" baseaddress="${BASEADDRESS_KERNEL32}" installbase="system32" installname="kernel32.dll">
 -              <importlibrary definition="kernel32.def" />
 +              <importlibrary definition="kernel32.spec" />
                <include base="kernel32">.</include>
                <include base="kernel32" root="intermediate">.</include>
                <include base="kernel32">include</include>
                <file>kernel32.rc</file>
  
                <library>ntdll</library>
-               <file>kernel32.spec</file>
        </module>
  </group>
@@@ -125,42 -125,6 +125,6 @@@ ExtendVirtualBuffer 
  }
  
  
- /*
-  * @unimplemented
-  */
- int
- STDCALL
- FoldStringW (
-     DWORD   dwMapFlags,
-     LPCWSTR lpSrcStr,
-     int cchSrc,
-     LPWSTR  lpDestStr,
-     int cchDest
-     )
- {
-     STUB;
-     return 0;
- }
- /*
-  * @unimplemented
-  */
- int
- STDCALL
- FoldStringA (
-     DWORD   dwMapFlags,
-     LPCSTR  lpSrcStr,
-     int cchSrc,
-     LPSTR   lpDestStr,
-     int cchDest
-     )
- {
-     STUB;
-     return 0;
- }
  /*
   * @unimplemented
   */
@@@ -567,21 -531,6 +531,6 @@@ IsSystemResumeAutomatic
      return 0;
  }
  
- /*
-  * @unimplemented
-  */
- BOOL
- STDCALL
- IsWow64Process(
-     HANDLE hProcess,
-     PBOOL Wow64Process
-     )
- {
-     STUB;
-     *Wow64Process = FALSE;
-     return TRUE;
- }
  /*
   * @unimplemented
   */
@@@ -1386,16 -1335,3 +1335,16 @@@ GetNumaAvailableMemoryNode(IN UCHAR Nod
      STUB;
      return FALSE;
  }
 +
 +BOOL WINAPI TermsrvAppInstallMode(void)
 +{
 +     STUB;
 +     return FALSE;
 +}
 +
 +DWORD WINAPI SetTermsrvAppInstallMode(BOOL bInstallMode)
 +{
 +    STUB;
 +    return 0;
 +}
 +
@@@ -17,6 -17,8 +17,8 @@@
  #include <debug.h>
  
  
+ typedef INT (WINAPI *MessageBoxW_Proc) (HWND, LPCWSTR, LPCWSTR, UINT);
  /* GLOBALS *******************************************************************/
  
  WaitForInputIdleType  lpfnGlobalRegisterWaitForInputIdle;
@@@ -33,8 -35,8 +35,8 @@@ RegisterWaitForInputIdle(WaitForInputId
   */
  BOOL STDCALL
  GetProcessAffinityMask (HANDLE hProcess,
 -                      LPDWORD lpProcessAffinityMask,
 -                      LPDWORD lpSystemAffinityMask)
 +                      PDWORD_PTR lpProcessAffinityMask,
 +                      PDWORD_PTR lpSystemAffinityMask)
  {
    PROCESS_BASIC_INFORMATION ProcessInfo;
    SYSTEM_BASIC_INFORMATION SystemInfo;
@@@ -73,7 -75,7 +75,7 @@@
   */
  BOOL STDCALL
  SetProcessAffinityMask (HANDLE hProcess,
 -                      DWORD dwProcessAffinityMask)
 +                      DWORD_PTR dwProcessAffinityMask)
  {
    NTSTATUS Status;
  
@@@ -617,8 -619,8 +619,8 @@@ TerminateProcess (HANDLE   hProcess
   * @unimplemented
   */
  VOID STDCALL
- FatalAppExitA (UINT   uAction,
-              LPCSTR   lpMessageText)
+ FatalAppExitA(UINT uAction,
+                 LPCSTR lpMessageText)
  {
    UNICODE_STRING MessageTextU;
    ANSI_STRING MessageText;
   */
  VOID STDCALL
  FatalAppExitW(UINT uAction,
-             LPCWSTR lpMessageText)
+               LPCWSTR lpMessageText)
  {
-   return;
+     static const WCHAR szUser32[] = L"user32.dll\0";
+     HMODULE hModule = GetModuleHandleW(szUser32);
+     MessageBoxW_Proc pMessageBoxW = NULL;
+     DPRINT1("AppExit\n");
+     if (hModule)
+         pMessageBoxW = (MessageBoxW_Proc) GetProcAddress(hModule, "MessageBoxW");
+     if (pMessageBoxW)
+         pMessageBoxW(0, lpMessageText, NULL, MB_SYSTEMMODAL | MB_OK);
+     else
+         DPRINT1("%s\n", lpMessageText);
+     ExitProcess(0);
  }
  
  
@@@ -895,4 -912,34 +912,34 @@@ GetProcessHandleCount(HANDLE hProcess
      return FALSE;
  }
  
+ /*
+  * @implemented
+  */
+ BOOL
+ STDCALL
+ IsWow64Process(
+     HANDLE hProcess,
+     PBOOL Wow64Process
+     )
+ {
+     ULONG pbi;
+     NTSTATUS Status;
+     Status = NtQueryInformationProcess(hProcess,
+                                        ProcessWow64Information,
+                                        &pbi,
+                                        sizeof(pbi),
+                                        NULL);
+     if (!NT_SUCCESS(Status))
+     {
+         SetLastError(RtlNtStatusToDosError(Status));
+         return FALSE;
+     }
+     *Wow64Process = (pbi != 0);
+     return TRUE;
+ }
  /* EOF */
@@@ -3,8 -3,6 +3,8 @@@
  #define NTOS_MODE_USER
  #include <ndk/ntndk.h>
  
 +DECLARE_HANDLE(LSAPR_HANDLE);
 +
  #define NDEBUG
  #include <debug.h>
  
@@@ -42,9 -40,5 +42,4 @@@ void __RPC_USER midl_user_free(void __R
      RtlFreeHeap(RtlGetProcessHeap(), 0, ptr);
  }
  
- void __RPC_USER LSAPR_HANDLE_rundown(LSAPR_HANDLE hObject)
- {
- }
--
  /* EOF */
@@@ -1,5 -1,5 +1,5 @@@
  <module name="lsasrv" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_LSASRV}" installbase="system32" installname="lsasrv.dll" unicode="yes">
 -      <importlibrary definition="lsasrv.def" />
 +      <importlibrary definition="lsasrv.spec" />
        <include base="lsasrv">.</include>
        <include base="lsa_server">.</include>
        <library>lsa_server</library>
@@@ -11,5 -11,4 +11,4 @@@
        <file>lsarpc.c</file>
        <file>lsasrv.c</file>
        <file>lsasrv.rc</file>
-       <file>lsasrv.spec</file>
 -</module>
 +</module>
@@@ -666,7 -666,7 +666,7 @@@ WSPSelect
      
      if (readfds != NULL) {
        for (i = 0; i < readfds->fd_count; i++, j++) {
--          PollInfo->Handles[j].Handle = readfds->fd_array[i];
++          PollInfo->Handles[j].Handle = LongToHandle(readfds->fd_array[i]);
            PollInfo->Handles[j].Events = AFD_EVENT_RECEIVE | 
                                          AFD_EVENT_DISCONNECT |
                                          AFD_EVENT_ABORT |
      }
      if (writefds != NULL) {
        for (i = 0; i < writefds->fd_count; i++, j++) {
--          PollInfo->Handles[j].Handle = writefds->fd_array[i];
++          PollInfo->Handles[j].Handle = LongToHandle(writefds->fd_array[i]);
            PollInfo->Handles[j].Events = AFD_EVENT_SEND |
                                          AFD_EVENT_CONNECT;
        }       
      }
      if (exceptfds != NULL) {
        for (i = 0; i < exceptfds->fd_count; i++, j++) {
--          PollInfo->Handles[j].Handle = exceptfds->fd_array[i];
++          PollInfo->Handles[j].Handle = LongToHandle(exceptfds->fd_array[i]);
            PollInfo->Handles[j].Events = AFD_EVENT_OOB_RECEIVE |
                                          AFD_EVENT_CONNECT_FAIL;
        }
@@@ -786,9 -786,9 +786,9 @@@ WSPAP
  WSPAccept(
        SOCKET Handle, 
        struct sockaddr *SocketAddress, 
--      int *SocketAddressLength, 
++      LPINT SocketAddressLength, 
        LPCONDITIONPROC lpfnCondition, 
--      DWORD_PTR dwCallbackData, 
++      DWORD dwCallbackData, 
        LPINT lpErrno)
  {
        IO_STATUS_BLOCK                         IOSB;
@@@ -1,4 -1,4 +1,4 @@@
--<module name="msafd" type="win32dll" baseaddress="${BASEADDRESS_MSAFD}" installbase="system32" installname="msafd.dll" unicode="yes">
++<module name="msafd" type="win32dll" baseaddress="${BASEADDRESS_MSAFD}" installbase="system32" installname="msafd.dll" unicode="yes" allowwarnings="true">
        <importlibrary definition="msafd.def" />
        <include base="msafd">.</include>
        <include base="msafd">include</include>
index 6c45a0f,0000000..73c7754
mode 100644,000000..100644
--- /dev/null
@@@ -1,848 -1,0 +1,850 @@@
 +;
 +; ReactOS MSVCRT Library
 +;
 +LIBRARY msvcrt.dll
 +
 +EXPORTS
 +  $I10_OUTPUT=MSVCRT_I10_OUTPUT @57
 +  ??0__non_rtti_object@@QAE@ABV0@@Z=__thiscall_MSVCRT___non_rtti_object_copy_ctor @1
 +  ??0__non_rtti_object@@QAE@PBD@Z=__thiscall_MSVCRT___non_rtti_object_ctor @2
 +;  ??0bad_cast@@AAE@PBQBD@Z @3
 +  ??0bad_cast@@QAE@ABQBD@Z=__thiscall_MSVCRT_bad_cast_ctor @4
 +  ??0bad_cast@@QAE@ABV0@@Z=__thiscall_MSVCRT_bad_cast_copy_ctor @5
 +;  ??0bad_cast@@QAE@PBD@Z @6
 +  ??0bad_typeid@@QAE@ABV0@@Z=__thiscall_MSVCRT_bad_typeid_copy_ctor @7
 +  ??0bad_typeid@@QAE@PBD@Z=__thiscall_MSVCRT_bad_typeid_ctor @8
 +  ??0exception@@QAE@ABQBD@Z=__thiscall_MSVCRT_exception_ctor @9
 +;  ??0exception@@QAE@ABQBDH@Z @10
 +  ??0exception@@QAE@ABV0@@Z=__thiscall_MSVCRT_exception_copy_ctor @11
 +  ??0exception@@QAE@XZ=__thiscall_MSVCRT_exception_default_ctor @12
 +  ??1__non_rtti_object@@UAE@XZ=__thiscall_MSVCRT___non_rtti_object_dtor @13
 +  ??1bad_cast@@UAE@XZ=__thiscall_MSVCRT_bad_cast_dtor @14
 +  ??1bad_typeid@@UAE@XZ=__thiscall_MSVCRT_bad_typeid_dtor @15
 +  ??1exception@@UAE@XZ=__thiscall_MSVCRT_exception_dtor @16
 +  ??1type_info@@UAE@XZ=__thiscall_MSVCRT_type_info_dtor @17
 +  ??2@YAPAXI@Z=MSVCRT_operator_new @18
 +  ??3@YAXPAX@Z=MSVCRT_operator_delete @19
 +  ??4__non_rtti_object@@QAEAAV0@ABV0@@Z=__thiscall_MSVCRT___non_rtti_object_opequals @20
 +  ??4bad_cast@@QAEAAV0@ABV0@@Z=__thiscall_MSVCRT_bad_cast_opequals @21
 +  ??4bad_typeid@@QAEAAV0@ABV0@@Z=__thiscall_MSVCRT_bad_typeid_opequals @22
 +  ??4exception@@QAEAAV0@ABV0@@Z=__thiscall_MSVCRT_exception_opequals @23
 +  ??8type_info@@QBEHABV0@@Z=__thiscall_MSVCRT_type_info_opequals_equals @24
 +  ??9type_info@@QBEHABV0@@Z=__thiscall_MSVCRT_type_info_opnot_equals @25
 +  ??_7__non_rtti_object@@6B@=MSVCRT___non_rtti_object_vtable@@6B@ @26 DATA
 +  ??_7bad_cast@@6B@=MSVCRT_bad_cast_vtable @27 DATA
 +  ??_7bad_typeid@@6B@=MSVCRT_bad_typeid_vtable @28 DATA
 +  ??_7exception@@6B@=MSVCRT_exception_vtable @29 DATA
 +  ??_E__non_rtti_object@@UAEPAXI@Z=__thiscall_MSVCRT___non_rtti_object_vector_dtor @30
 +  ??_Ebad_cast@@UAEPAXI@Z=__thiscall_MSVCRT_bad_cast_vector_dtor @31
 +  ??_Ebad_typeid@@UAEPAXI@Z=__thiscall_MSVCRT_bad_typeid_vector_dtor @32
 +  ??_Eexception@@UAEPAXI@Z=__thiscall_MSVCRT_exception_vector_dtor @33
 +;  ??_Fbad_cast@@QAEXXZ @34
 +;  ??_Fbad_typeid@@QAEXXZ @35
 +  ??_G__non_rtti_object@@UAEPAXI@Z=__thiscall_MSVCRT___non_rtti_object_scalar_dtor @36
 +  ??_Gbad_cast@@UAEPAXI@Z=__thiscall_MSVCRT_bad_cast_scalar_dtor @37
 +  ??_Gbad_typeid@@UAEPAXI@Z=__thiscall_MSVCRT_bad_typeid_scalar_dtor @38
 +  ??_Gexception@@UAEPAXI@Z=__thiscall_MSVCRT_exception_scalar_dtor @39
 +  ??_U@YAPAXI@Z=MSVCRT_operator_new @40
 +  ??_V@YAXPAX@Z=MSVCRT_operator_delete @41
 +  ?_query_new_handler@@YAP6AHI@ZXZ=MSVCRT__query_new_handler @43
 +  ?_query_new_mode@@YAHXZ=MSVCRT__query_new_mode @44
 +  ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z=MSVCRT__set_new_handler @45
 +  ?_set_new_mode@@YAHH@Z=MSVCRT__set_new_mode @46
 +  ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z=MSVCRT__set_se_translator @47
 +  ?before@type_info@@QBEHABV1@@Z=__thiscall_MSVCRT_type_info_before @48
 +  ?name@type_info@@QBEPBDXZ=__thiscall_MSVCRT_type_info_name @49
 +  ?raw_name@type_info@@QBEPBDXZ=__thiscall_MSVCRT_type_info_raw_name @50
 +  ?set_new_handler@@YAP6AXXZP6AXXZ@Z=MSVCRT__set_new_handler @51
 +  ?set_terminate@@YAP6AXXZP6AXXZ@Z=MSVCRT_set_terminate @52
 +  ?set_unexpected@@YAP6AXXZP6AXXZ@Z=MSVCRT_set_unexpected @53
 +  ?terminate@@YAXXZ=MSVCRT_terminate @54
 +  ?unexpected@@YAXXZ=MSVCRT_unexpected @55
 +  ?what@exception@@UBEPBDXZ=__thiscall_MSVCRT_what_exception @56
 +  _CIacos @58
 +  _CIasin @59
 +  _CIatan @60
 +  _CIatan2 @61
 +  _CIcos @62
 +  _CIcosh @63
 +  _CIexp @64
 +  _CIfmod @65
 +  _CIlog @66
 +  _CIlog10 @67
 +  _CIpow @68
 +  _CIsin @69
 +  _CIsinh @70
 +  _CIsqrt @71
 +  _CItan @72
 +  _CItanh @73
 +  _CxxThrowException @74
 +  _EH_prolog @75
 +  _Getdays @76
 +  _Getmonths @77
 +  _Gettnames @78
 +  _HUGE @79 DATA
 +  _Strftime @80
 +  _XcptFilter @81
 +  __CppXcptFilter @82
 +;  __CxxCallUnwindDtor @83
 +;  __CxxCallUnwindVecDtor @84
 +  __CxxDetectRethrow @85
 +;  __CxxExceptionFilter @86
 +  __CxxFrameHandler @87
 +;  __CxxFrameHandler2 @88
 +  __CxxLongjmpUnwind @89
 +  __CxxQueryExceptionSize @90
 +;  __CxxRegisterExceptionObject @91
 +;  __CxxUnregisterExceptionObject @92
 +;  __DestructExceptionObject @93
 +  __RTCastToVoid=MSVCRT___RTCastToVoid @94
 +  __RTDynamicCast=MSVCRT___RTDynamicCast @95
 +  __RTtypeid=MSVCRT___RTtypeid @96
 +  __STRINGTOLD @97
 +;  ___lc_codepage_func @98
 +;  ___lc_collate_cp_func @99
 +;  ___lc_handle_func @100
 +;  ___mb_cur_max_func @101
 +  ___setlc_active_func @102
 +  ___unguarded_readlc_active_add_func @103
 +  __argc @104 DATA
 +  __argv @105 DATA
 +  __badioinfo @106 DATA
 +  __crtCompareStringA=kernel32.CompareStringA @107
 +  __crtCompareStringW=kernel32.CompareStringW @108
 +  __crtGetLocaleInfoW=kernel32.GetLocaleInfo @109
 +  __crtGetStringTypeW=kernel32.GetStringTypeW @110
 +  __crtLCMapStringA @111
 +;  __crtLCMapStringW @112
 +  __dllonexit @113
 +  __doserrno @114
 +  __fpecode @115
 +  __getmainargs @116
 +  __initenv @117
 +;  __iob_func @118
 +  __isascii @119
 +  __iscsym @120
 +  __iscsymf @121
 +  __lc_codepage @122 DATA
 +  __lc_collate_cp @123 DATA
 +  __lc_handle @124 DATA
 +  __lconv_init @125
 +  __mb_cur_max @126 DATA
 +  __p___argc @127
 +  __p___argv @128
 +  __p___initenv @129
 +  __p___mb_cur_max @130
 +  __p___wargv @131
 +  __p___winitenv @132
 +  __p__acmdln @133
 +  __p__amblksiz @134
 +  __p__commode @135
 +  __p__daylight @136
 +  __p__dstbias @137
 +  __p__environ @138
 +;  __p__fileinfo @139
 +  __p__fmode @140
 +  __p__iob @141
 +;  __p__mbcasemap @142
 +  __p__mbctype @143
 +  __p__osver @144
 +  __p__pctype @145
 +  __p__pgmptr @146
 +  __p__pwctype @147
 +  __p__timezone @148
 +  __p__tzname @149
 +  __p__wcmdln @150
 +  __p__wenviron @151
 +  __p__winmajor @152
 +  __p__winminor @153
 +  __p__winver @154
 +  __p__wpgmptr @155
 +;  __pctype_func @156
 +  __pioinfo @157 DATA
 +;  __pwctype_func @158
 +  __pxcptinfoptrs @159
 +  __set_app_type @160
 +  __setlc_active @161 DATA
 +  __setusermatherr @162
 +  __threadhandle @163
 +  __threadid @164
 +  __toascii @165
 +  __unDName @166
 +  __unDNameEx @167
 +;  __uncaught_exception @42
 +  __unguarded_readlc_active @168 DATA
 +  __wargv @169 DATA
 +;  __wcserror @170
 +  __wgetmainargs @171
 +  __winitenv @172 DATA
 +  _abnormal_termination @173
 +;  _abs64 @174
 +  _access @175
 +  _acmdln @176 DATA
 +  _adj_fdiv_m16i @177
 +  _adj_fdiv_m32 @178
 +  _adj_fdiv_m32i @179
 +  _adj_fdiv_m64 @180
 +  _adj_fdiv_r @181
 +  _adj_fdivr_m16i @182
 +  _adj_fdivr_m32 @183
 +  _adj_fdivr_m32i @184
 +  _adj_fdivr_m64 @185
 +  _adj_fpatan @186
 +  _adj_fprem @187
 +  _adj_fprem1 @188
 +  _adj_fptan @189
 +  _adjust_fdiv @190 DATA
 +  _aexit_rtn @191
 +  _aligned_free @192
 +  _aligned_malloc @193
 +  _aligned_offset_malloc @194
 +  _aligned_offset_realloc @195
 +  _aligned_realloc @196
 +  _amsg_exit @197
 +  _assert @198
 +;  _atodbl @199
 +  _atoi64 @200
 +  _atoldbl @201
 +  _beep @202
 +  _beginthread @203
 +  _beginthreadex @204
 +  _c_exit @205
 +  _cabs @206
 +  _callnewh @207
 +  _cexit @208
 +  _cgets @209
 +;  _cgetws @210
 +  _chdir @211
 +  _chdrive @212
 +  _chgsign @213
 +  _chkesp @214
 +  _chmod @215
 +  _chsize @216
 +  _clearfp @217
 +  _close @218
 +  _commit @219
 +  _commode @220 DATA
 +  _control87 @221
 +  _controlfp @222
 +  _copysign @223
 +  _cprintf @224
 +  _cputs @225
 +;  _cputws @226
 +  _creat @227
 +  _cscanf @228
 +;  _ctime64 @229
 +  _ctype @230 DATA
 +  _cwait @231
 +;  _cwprintf @232
 +;  _cwscanf @233
 +  _daylight @234 DATA
 +  _dstbias @235 DATA
 +  _dup @236
 +  _dup2 @237
 +  _ecvt @238
 +  _endthread @239
 +  _endthreadex @240
 +  _environ @241 DATA
 +  _eof @242
 +  _errno @243
 +  _except_handler2 @244
 +  _except_handler3 @245
 +  _execl @246
 +  _execle @247
 +  _execlp @248
 +  _execlpe @249
 +  _execv @250
 +  _execve @251
 +  _execvp @252
 +  _execvpe @253
 +  _exit @254
 +  _expand @255
 +  _fcloseall @256
 +  _fcvt @257
 +  _fdopen @258
 +  _fgetchar @259
 +  _fgetwchar @260
 +  _filbuf @261
 +;  _fileinfo @262
 +  _filelength @263
 +  _filelengthi64 @264
 +  _fileno @265
 +  _findclose @266
 +  _findfirst @267
 +;  _findfirst64 @268
 +  ;_findfirsti64 @269
 +  _findnext @270
 +;  _findnext64 @271
 +  ;_findnexti64 @272
 +  _finite @273
 +  _flsbuf @274
 +  _flushall @275
 +  _fmode @276 DATA
 +  _fpclass @277
 +  _fpieee_flt @278
 +  _fpreset @279
 +  _fputchar @280
 +  _fputwchar @281
 +  _fsopen @282
 +  _fstat @283
 +  _fstat64 @284
 +  ;_fstati64 @285
 +  ;_ftime @286
 +;  _ftime64 @287
 +  _ftol @288
 +  _fullpath @289
 +  _futime @290
 +;  _futime64 @291
 +  _gcvt @292
 +;  _get_heap_handle @293
 +  _get_osfhandle @294
 +  _get_sbh_threshold @295
 +  _getch @296
 +  _getche @297
 +  _getcwd @298
 +  _getdcwd @299
 +  _getdiskfree @300
 +  _getdllprocaddr @301
 +  _getdrive @302
 +  _getdrives=kernel32.GetLogicalDrives @303
 +  _getmaxstdio @304
 +  _getmbcp @305
 +  _getpid=kernel32.GetCurrentProcessId @306
 +  _getsystime @307
 +  _getw @308
 +;  _getwch @309
 +;  _getwche @310
 +  _getws @311
 +  _global_unwind2 @312
 +;  _gmtime64 @313
 +  _heapadd @314
 +  _heapchk @315
 +  _heapmin @316
 +  _heapset @317
 +;  _heapused @318
 +  _heapwalk @319
 +  _hypot @320
 +  _i64toa @321
 +  _i64tow @322
 +  _initterm @323
 +;  _inp @324
 +;  _inpd @325
 +;  _inpw @326
 +  _iob @327 DATA
 +  _isatty @328
 +  _isctype @329
 +  _ismbbalnum @330
 +  _ismbbalpha @331
 +  _ismbbgraph @332
 +  _ismbbkalnum @333
 +  _ismbbkana @334
 +;  _ismbbkprint @335
 +  _ismbbkpunct @336
 +  _ismbblead @337
 +  _ismbbprint @338
 +  _ismbbpunct @339
 +  _ismbbtrail @340
 +  _ismbcalnum @341
 +  _ismbcalpha @342
 +  _ismbcdigit @343
 +  _ismbcgraph @344
 +  _ismbchira @345
 +  _ismbckata @346
 +  _ismbcl0 @347
 +  _ismbcl1 @348
 +  _ismbcl2 @349
 +  _ismbclegal @350
 +  _ismbclower @351
 +  _ismbcprint @352
 +  _ismbcpunct @353
 +  _ismbcspace @354
 +  _ismbcsymbol @355
 +  _ismbcupper @356
 +  _ismbslead @357
 +  _ismbstrail @358
 +  _isnan @359
 +  _itoa @360
 +  _itow @361
 +  _j0 @362
 +  _j1 @363
 +  _jn @364
 +  _kbhit @365
 +  _lfind @366
 +  _loaddll @367
 +  _local_unwind2 @368
 +;  _localtime64 @369
 +  _lock @370
 +  _locking @371
 +  _logb @372
 +  _longjmpex=longjmp @373
 +  _lrotl @374
 +  _lrotr @375
 +  _lsearch @376
 +  _lseek @377
 +  _lseeki64 @378
 +  _ltoa @379
 +  _ltow @380
 +  _makepath @381
 +  _mbbtombc @382
 +  _mbbtype @383
 +;  _mbcasemap @384
 +  _mbccpy @385
 +  _mbcjistojms @386
 +  _mbcjmstojis @387
 +  _mbclen @388
 +  _mbctohira @389
 +  _mbctokata @390
 +  _mbctolower @391
 +  _mbctombb @392
 +  _mbctoupper @393
 +  _mbctype @394 DATA
 +  _mbsbtype @395
 +  _mbscat @396
 +  _mbschr @397
 +  _mbscmp @398
 +  _mbscoll @399
 +  _mbscpy @400
 +  _mbscspn @401
 +  _mbsdec @402
 +  _mbsdup @403
 +  _mbsicmp @404
 +  _mbsicoll @405
 +  _mbsinc @406
 +  _mbslen @407
 +  _mbslwr @408
 +  _mbsnbcat @409
 +  _mbsnbcmp @410
 +  _mbsnbcnt @411
 +  _mbsnbcoll @412
 +  _mbsnbcpy @413
 +  _mbsnbicmp @414
 +  _mbsnbicoll @415
 +  _mbsnbset @416
 +  _mbsncat @417
 +  _mbsnccnt @418
 +  _mbsncmp @419
 +  _mbsncoll @420
 +  _mbsncpy @421
 +  _mbsnextc @422
 +  _mbsnicmp @423
 +  _mbsnicoll @424
 +  _mbsninc @425
 +  _mbsnset @426
 +  _mbspbrk @427
 +  _mbsrchr @428
 +  _mbsrev @429
 +  _mbsset @430
 +  _mbsspn @431
 +  _mbsspnp @432
 +  _mbsstr @433
 +  _mbstok @434
 +  _mbstrlen @435
 +  _mbsupr @436
 +  _memccpy @437
 +  _memicmp @438
 +  _mkdir @439
 +;  _mkgmtime @440
 +;  _mkgmtime64 @441
 +  _mktemp @442
 +;  _mktime64 @443
 +  _msize @444
 +  _nextafter @445
 +  _onexit @446
 +  _open @447
 +  _open_osfhandle @448
 +;  _osplatform @449
 +  _osver @450 DATA
 +;  _outp @451
 +;  _outpd @452
 +;  _outpw @453
 +  _pclose @454
 +  _pctype @455 DATA
 +  _pgmptr @456 DATA
 +  _pipe @457
 +  _popen @458
 +  _purecall @459
 +  _putch @460
 +  _putenv @461
 +  _putw @462
 +;  _putwch @463
 +  _putws @464
 +  _pwctype @465
 +  _read @466
 +;  _resetstkoflw @467
 +  _rmdir @468
 +  _rmtmp @469
 +  _rotl @470
 +;  _rotl64 @471
 +  _rotr @472
 +;  _rotr64 @473
 +  _safe_fdiv @474
 +  _safe_fdivr @475
 +  _safe_fprem @476
 +  _safe_fprem1 @477
 +  _scalb @478
 +;  _scprintf @479
 +;  _scwprintf @480
 +  _searchenv @481
 +  _seh_longjmp_unwind=_seh_longjmp_unwind@4 @482
 +;  _set_SSE2_enable @483
 +  _set_error_mode @484
 +  _set_sbh_threshold @485
 +  _seterrormode @486
 +  _setjmp @487
 +  _setjmp3 @488
 +  _setmaxstdio @489
 +  _setmbcp @490
 +  _setmode @491
 +  _setsystime @492
 +  _sleep @493
 +  _snprintf @494
 +;  _snscanf @495
 +  _snwprintf @496
 +;  _snwscanf @497
 +  _sopen @498
 +  _spawnl @499
 +  _spawnle @500
 +  _spawnlp @501
 +  _spawnlpe @502
 +  _spawnv @503
 +  _spawnve @504
 +  _spawnvp @505
 +  _spawnvpe @506
 +  _splitpath @507
 +  _stat @508
 +  _stat64 @509
 +  ;_stati64 @510
 +  _statusfp @511
 +  _strcmpi @512
 +  _strdate @513
 +  _strdup @514
 +  _strerror @515
 +  _stricmp @516
 +  _stricoll @517
 +  _strlwr @518
 +  _strncoll @519
 +  _strnicmp @520
 +  _strnicoll @521
 +  _strnset @522
 +  _strrev @523
 +  _strset @524
 +  _strtime @525
 +;  _strtoi64 @526
 +  _strtoui64=strtoull @527
 +  _strupr @528
 +  _swab @529
 +  _sys_errlist @530 DATA
 +  _sys_nerr @531 DATA
 +  _tell @532
 +  _telli64 @533
 +  _tempnam @534
 +;  _time64 @535
 +  _timezone @536 DATA
 +  _tolower @537
 +  _toupper @538
 +  _tzname @539 DATA
 +  _tzset @540
 +  _ui64toa @541
 +  _ui64tow @542
 +  _ultoa @543
 +  _ultow @544
 +  _umask @545
 +  _ungetch @546
 +;  _ungetwch @547
 +  _unlink @548
 +  _unloaddll @549
 +  _unlock @550
 +  _utime @551
 +;  _utime64 @552
 +;  _vscprintf @553
 +;  _vscwprintf @554
 +  _vsnprintf @555
 +  _vsnwprintf @556
 +  _waccess @557
 +  _wasctime @558
 +  _wchdir @559
 +  _wchmod @560
 +  _wcmdln @561
 +  _wcreat @562
 +  _wcsdup @563
 +;  _wcserror @564
 +  _wcsicmp @565
 +  _wcsicoll @566
 +  _wcslwr @567
 +  _wcsncoll @568
 +  _wcsnicmp @569
 +  _wcsnicoll @570
 +  _wcsnset @571
 +  _wcsrev @572
 +  _wcsset @573
 +;  _wcstoi64 @574
 +;  _wcstoui64 @575
 +  _wcsupr @576
 +  _wctime @577
 +;  _wctime64 @578
 +;  _wctype @579
 +  _wenviron @580 DATA
 +  _wexecl @581
 +  _wexecle @582
 +  _wexeclp @583
 +  _wexeclpe @584
 +  _wexecv @585
 +  _wexecve @586
 +  _wexecvp @587
 +  _wexecvpe @588
 +  _wfdopen @589
 +  ;_wfindfirst @590
 +;  _wfindfirst64 @591
 +  ;_wfindfirsti64 @592
 +  ;_wfindnext @593
 +;  _wfindnext64 @594
 +  ;_wfindnexti64 @595
 +  _wfopen @596
 +  _wfreopen @597
 +  _wfsopen @598
 +  _wfullpath @599
 +  _wgetcwd @600
 +  _wgetdcwd @601
 +  _wgetenv @602
 +  _winmajor @603 DATA
 +  _winminor @604 DATA
 +  _winver @605 DATA
 +  _wmakepath @606
 +  _wmkdir @607
 +  _wmktemp @608
 +  _wopen @609
 +  _wperror @610
 +  _wpgmptr @611 DATA
 +  _wpopen @612
 +  _wputenv @613
 +  _wremove @614
 +  _wrename @615
 +  _write @616
 +  _wrmdir @617
 +  _wsearchenv @618
 +  _wsetlocale @619
 +  _wsopen @620
 +  _wspawnl @621
 +  _wspawnle @622
 +  _wspawnlp @623
 +  _wspawnlpe @624
 +  _wspawnv @625
 +  _wspawnve @626
 +  _wspawnvp @627
 +  _wspawnvpe @628
 +  _wsplitpath @629
 +  _wstat @630
 +  _wstat64 @631
 +  ;_wstati64 @632
 +  _wstrdate @633
 +  _wstrtime @634
 +  _wsystem @635
 +  _wtempnam @636
 +  _wtmpnam @637
 +;  _wtof @638
 +  _wtoi @639
 +  _wtoi64 @640
 +  _wtol @641
 +  _wunlink @642
 +  _wutime @643
 +;  _wutime64 @644
 +  _y0 @645
 +  _y1 @646
 +  _yn @647
 +  abort @648
 +  abs @649
 +  acos @650
 +  asctime @651
 +  asin @652
 +  atan @653
 +  atan2 @654
 +  atexit @655
 +  atof @656
 +  atoi @657
 +  atol @658
 +  bsearch @659
 +  calloc @660
 +  ceil @661
 +  clearerr @662
 +  clock @663
 +  cos @664
 +  cosh @665
 +  ctime @666
 +  difftime @667
 +  div @668
 +  exit @669
 +  exp @670
 +  fabs @671
 +  fclose @672
 +  feof @673
 +  ferror @674
 +  fflush @675
 +  fgetc @676
 +  fgetpos @677
 +  fgets @678
 +  fgetwc @679
 +  fgetws @680
 +  floor @681
 +  fmod @682
 +  fopen @683
 +  fprintf @684
 +  fputc @685
 +  fputs @686
 +  fputwc @687
 +  fputws @688
 +  fread @689
 +  free @690
 +  freopen @691
 +  frexp @692
 +  fscanf @693
 +  fseek @694
 +  fsetpos @695
 +  ftell @696
 +  fwprintf @697
 +  fwrite @698
 +  fwscanf @699
 +  getc @700
 +  getchar @701
 +  getenv @702
 +  gets @703
 +  getwc @704
 +  getwchar @705
 +  gmtime @706
 +  is_wctype @707
 +  isalnum @708
 +  isalpha @709
 +  iscntrl @710
 +  isdigit @711
 +  isgraph @712
 +  isleadbyte @713
 +  islower @714
 +  isprint @715
 +  ispunct @716
 +  isspace @717
 +  isupper @718
 +  iswalnum @719
 +  iswalpha @720
 +  iswascii @721
 +  iswcntrl @722
 +  iswctype @723
 +  iswdigit @724
 +  iswgraph @725
 +  iswlower @726
 +  iswprint @727
 +  iswpunct @728
 +  iswspace @729
 +  iswupper @730
 +  iswxdigit @731
 +  isxdigit @732
 +  labs @733
 +  ldexp @734
 +  ldiv @735
 +  localeconv @736
 +  localtime @737
 +  log @738
 +  log10 @739
 +  longjmp @740
 +  malloc @741
 +  mblen @742
 +  mbstowcs @743
 +  mbtowc @744
 +  memchr @745
 +  memcmp @746
 +  memcpy @747
 +  memmove @748
 +  memset @749
 +  mktime @750
 +  modf @751
 +  perror @752
 +  pow @753
 +  printf @754
 +  putc @755
 +  putchar @756
 +  puts @757
 +  putwc=fputwc @758
 +  putwchar=_fputwchar @759
 +  qsort @760
 +  raise @761
 +  rand @762
 +  realloc @763
 +  remove @764
 +  rename @765
 +  rewind @766
 +  scanf @767
 +  setbuf @768
 +  setlocale @769
 +  setvbuf @770
 +  signal @771
 +  sin @772
 +  sinh @773
 +  sprintf @774
 +  sqrt @775
 +  srand @776
 +  sscanf @777
 +  strcat @778
 +  strchr @779
 +  strcmp @780
 +  strcoll @781
 +  strcpy @782
 +  strcspn @783
 +  strerror @784
 +  strftime @785
 +  strlen @786
 +  strncat @787
 +  strncmp @788
 +  strncpy @789
 +  strpbrk @790
 +  strrchr @791
 +  strspn @792
 +  strstr @793
 +  strtod @794
 +  strtok @795
 +  strtol @796
 +  strtoul @797
 +  strxfrm @798
 +  swprintf @799
 +  swscanf @800
 +  system @801
 +  tan @802
 +  tanh @803
 +  time @804
 +  tmpfile @805
 +  tmpnam @806
 +  tolower @807
 +  toupper @808
 +  towlower @809
 +  towupper @810
 +  ungetc @811
 +  ungetwc @812
 +  vfprintf @813
 +  vfwprintf @814
 +  vprintf @815
 +  vsprintf @816
 +  vswprintf @817
 +  vwprintf @818
 +  wcscat @819
 +  wcschr @820
 +  wcscmp @821
 +  wcscoll @822
 +  wcscpy @823
 +  wcscspn @824
 +  wcsftime @825
 +  wcslen @826
 +  wcsncat @827
 +  wcsncmp @828
 +  wcsncpy @829
 +  wcspbrk @830
 +  wcsrchr @831
 +  wcsspn @832
 +  wcsstr @833
 +  wcstod @834
 +  wcstok @835
 +  wcstol @836
 +  wcstombs @837
 +  wcstoul @838
 +  wcsxfrm @839
 +  wctomb @840
 +  wprintf @841
 +  wscanf @842
++
++  _swprintf=swprintf
@@@ -1,10 -1,9 +1,10 @@@
- <module name="msvcrt" type="win32dll" baseaddress="${BASEADDRESS_MSVCRT}" mangledsymbols="true" installbase="system32" installname="msvcrt.dll">
+ <module name="msvcrt" type="win32dll" baseaddress="${BASEADDRESS_MSVCRT}" mangledsymbols="true" installbase="system32" installname="msvcrt.dll" iscrt="yes">
 -      <importlibrary definition="msvcrt.def" />
 +      <importlibrary definition="msvcrt-$(ARCH).def" />
        <include base="msvcrt">.</include>
        <include base="crt">include</include>
        <define name="_DISABLE_TIDENTS" />
        <define name="USE_MSVCRT_PREFIX" />
 +      <define name="_MSVCRT_" />
        <define name="_MSVCRT_LIB_" />
        <define name="_MT" />
        <define name="__NO_CTYPE_INLINES" />
  @ cdecl __dllonexit(ptr ptr ptr) msvcrt.__dllonexit
  @ cdecl __doserrno() msvcrt.__doserrno
  @ cdecl __fpecode() msvcrt.__fpecode
--@ cdecl __getmainargs(ptr ptr ptr long long) MSVCRT20__getmainargs
++@ cdecl __getmainargs(ptr ptr ptr ptr ptr) MSVCRT20__getmainargs
  @ extern __initenv msvcrt.__initenv
  @ cdecl __isascii(long) msvcrt.__isascii
  @ cdecl __iscsym(long) msvcrt.__iscsym
@@@ -1,14 -1,14 +1,13 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <group>
- <module name="msvcrt40" type="win32dll" baseaddress="${BASEADDRESS_MSVCRT40}" installbase="system32" installname="msvcrt40.dll">
+ <module name="msvcrt40" type="win32dll" baseaddress="${BASEADDRESS_MSVCRT40}" installbase="system32" installname="msvcrt40.dll" iscrt="yes">
        <importlibrary definition="msvcrt40.spec" />
        <include base="msvcrt40">.</include>
        <include base="ReactOS">include/reactos/wine</include>
        <define name="__WINESRC__" />
        <file>msvcrt40.c</file>
-       <file>msvcrt40.spec</file>
        <library>wine</library>
 -      <library>msvcrt</library>
        <library>kernel32</library>
  </module>
  </group>
@@@ -22,7 -22,7 +22,7 @@@
  @ stdcall CoFreeUnusedLibraries()
  @ stdcall CoFreeUnusedLibrariesEx(long long)
  @ stdcall CoGetCallContext(ptr ptr)
- @ stub CoGetCallerTID
+ @ stdcall CoGetCallerTID(ptr)
  @ stdcall CoGetClassObject(ptr long ptr ptr ptr)
  @ stdcall CoGetContextToken(ptr)
  @ stub CoGetCurrentLogicalThreadId
  @ stdcall WriteClassStm(ptr ptr)
  @ stdcall WriteFmtUserTypeStg(ptr long ptr)
  @ stub WriteOleStg
--@ stub WriteStringStream
++@ stub WriteStringStream
@@@ -1,5 -1,5 +1,5 @@@
  <module name="opengl32" type="win32dll" baseaddress="${BASEADDRESS_OPENGL32}" installbase="system32" installname="opengl32.dll" unicode="yes">
 -      <importlibrary definition="opengl32.def" />
 +      <importlibrary definition="opengl32.spec" />
        <define name="_DISABLE_TIDENTS" />
        <library>ntdll</library>
        <library>kernel32</library>
@@@ -10,5 -10,4 +10,4 @@@
        <file>gl.c</file>
        <file>opengl32.c</file>
        <file>wgl.c</file>
-       <file>opengl32.spec</file>
  </module>
@@@ -3,11 -3,13 +3,12 @@@
        <importlibrary definition="rpcrt4.spec" />
        <include base="rpcrt4">.</include>
        <include base="ReactOS">include/reactos/wine</include>
 -      <define name="_STDDEF_H" />
        <define name="_RPCRT4_" />
        <define name="COM_NO_WINDOWS_H" />
        <define name="MSWMSG" />
        <library>wine</library>
        <library>uuid</library>
+       <library>rpcrt4_epm_client</library>
        <library>kernel32</library>
        <library>user32</library>
        <library>advapi32</library>
        <file>rpc_server.c</file>
        <file>rpc_transport.c</file>
        <file>rpcrt4_main.c</file>
-       <file>rpcss_np_client.c</file>
        <file>unix_func.c</file>
        <file>ndr_es.c</file>
        <file>rpcrt4.rc</file>
-       <file>rpcrt4.spec</file>
+       <file>epm.idl</file>
+       <include base="rpcrt4" root="intermediate">.</include>
+ </module>
+ <module name="rpcrt4_epm_client" type="rpcclient">
+       <file>epm.idl</file>
  </module>
@@@ -1,5 -1,5 +1,5 @@@
  <module name="secur32" type="win32dll" baseaddress="${BASEADDRESS_SECUR32}" installbase="system32" installname="secur32.dll">
 -      <importlibrary definition="secur32.def" />
 +      <importlibrary definition="secur32.spec" />
        <include base="secur32">.</include>
        <include base="ReactOS">include/reactos/subsys</include>
        <define name="__SECUR32__" />
@@@ -11,6 -11,5 +11,5 @@@
        <file>secext.c</file>
        <file>sspi.c</file>
        <file>secur32.rc</file>
-       <file>secur32.spec</file>
        <pch>precomp.h</pch>
  </module>
@@@ -62,15 -62,14 +62,14 @@@ GetMouseMovePointsEx
  
  
  /*
-  * @unimplemented
+  * @implemented
   */
  BOOL
  STDCALL
  LockWindowUpdate(
    HWND hWndLock)
  {
-   UNIMPLEMENTED;
-   return FALSE;
+     return NtUserLockWindowUpdate(hWndLock);
  }
  
  
@@@ -227,7 -226,7 +226,7 @@@ DragObject
           HWND    hwnd1,
           HWND    hwnd2,
           UINT    u1,
 -         DWORD   dw1,
 +         ULONG_PTR   dw1,
           HCURSOR hc1
           )
  {
index 4d136a1,0000000..422e3e2
mode 100644,000000..100644
--- /dev/null
@@@ -1,785 -1,0 +1,782 @@@
- # @ stub BuildReasonArray
 +@ stdcall ActivateKeyboardLayout(long long) NtUserActivateKeyboardLayout
 +@ stdcall AdjustWindowRect(ptr long long)
 +@ stdcall AdjustWindowRectEx(ptr long long long)
 +@ stdcall AlignRects(ptr long long long)
 +@ stdcall AllowForegroundActivation()
 +@ stdcall AllowSetForegroundWindow (long)
 +@ stdcall AnimateWindow(long long long)
 +@ stdcall AnyPopup()
 +@ stdcall AppendMenuA(long long long ptr)
 +@ stdcall AppendMenuW(long long long ptr)
 +@ stdcall ArrangeIconicWindows(long)
 +@ stdcall AttachThreadInput(long long long)
 +@ stdcall BeginDeferWindowPos(long)
 +@ stdcall BeginPaint(long ptr)
 +@ stdcall BlockInput(long)
 +@ stdcall BringWindowToTop(long)
 +@ stdcall BroadcastSystemMessage(long ptr long long long) BroadcastSystemMessageA
 +@ stdcall BroadcastSystemMessageA(long ptr long long long)
 +@ stdcall BroadcastSystemMessageExA(long ptr long long long ptr)
 +@ stdcall BroadcastSystemMessageExW(long ptr long long long ptr)
 +@ stdcall BroadcastSystemMessageW(long ptr long long long)
- # @ stub CalcMenuBar
++; @ stub BuildReasonArray
 +@ stdcall CalcChildScroll(long long)
- # @ stdcall CharNextExW(long wstr long)
++; @ stub CalcMenuBar
 +@ stdcall CallMsgFilter(ptr long) CallMsgFilterA
 +@ stdcall CallMsgFilterA(ptr long)
 +@ stdcall CallMsgFilterW(ptr long)
 +@ stdcall CallNextHookEx(long long long long)
 +@ stdcall CallWindowProcA(ptr long long long long)
 +@ stdcall CallWindowProcW(ptr long long long long)
 +@ stdcall CascadeChildWindows(long long)
 +@ stdcall CascadeWindows(long long ptr long ptr)
 +@ stdcall ChangeClipboardChain(long long)
 +@ stdcall ChangeDisplaySettingsA(ptr long)
 +@ stdcall ChangeDisplaySettingsExA(str ptr long long ptr)
 +@ stdcall ChangeDisplaySettingsExW(wstr ptr long long ptr)
 +@ stdcall ChangeDisplaySettingsW(ptr long)
 +@ stdcall ChangeMenuA(long long ptr long long)
 +@ stdcall ChangeMenuW(long long ptr long long)
 +@ stdcall CharLowerA(str)
 +@ stdcall CharLowerBuffA(str long)
 +@ stdcall CharLowerBuffW(wstr long)
 +@ stdcall CharLowerW(wstr)
 +@ stdcall CharNextA(str)
 +@ stdcall CharNextExA(long str long)
- # @ stdcall CharPrevExW(long wstr wstr long)
++; @ stdcall CharNextExW(long wstr long)
 +@ stdcall CharNextW(wstr)
 +@ stdcall CharPrevA(str str)
 +@ stdcall CharPrevExA(long str str long)
- # @ stub CreateSystemThreads
++; @ stdcall CharPrevExW(long wstr wstr long)
 +@ stdcall CharPrevW(wstr wstr)
 +@ stdcall CharToOemA(str ptr)
 +@ stdcall CharToOemBuffA(str ptr long)
 +@ stdcall CharToOemBuffW(wstr ptr long)
 +@ stdcall CharToOemW(wstr ptr)
 +@ stdcall CharUpperA(str)
 +@ stdcall CharUpperBuffA(str long)
 +@ stdcall CharUpperBuffW(wstr long)
 +@ stdcall CharUpperW(wstr)
 +@ stdcall CheckDlgButton(long long long)
 +@ stdcall CheckMenuItem(long long long)
 +@ stdcall CheckMenuRadioItem(long long long long long)
 +@ stdcall CheckRadioButton(long long long long)
 +@ stdcall ChildWindowFromPoint(long double)
 +@ stdcall ChildWindowFromPointEx(long double long)
 +@ stub CliImmSetHotKey
 +@ stub ClientThreadConnect
 +@ stub ClientThreadSetup
 +@ stdcall ClientToScreen(long ptr)
 +@ stdcall ClipCursor(ptr)
 +@ stdcall CloseClipboard()
 +@ stdcall CloseDesktop(long)
 +@ stdcall CloseWindow(long)
 +@ stdcall CloseWindowStation(long)
 +@ stdcall CopyAcceleratorTableA(long ptr long)
 +@ stdcall CopyAcceleratorTableW(long ptr long)
 +@ stdcall CopyIcon(long)
 +@ stdcall CopyImage(long long long long long)
 +@ stdcall CopyRect(ptr ptr)
 +@ stdcall CountClipboardFormats()
 +@ stdcall CreateAcceleratorTableA(ptr long)
 +@ stdcall CreateAcceleratorTableW(ptr long)
 +@ stdcall CreateCaret(long long long long)
 +@ stdcall CreateCursor(long long long long long ptr ptr)
 +@ stdcall CreateDesktopA(str str ptr long long ptr)
 +@ stdcall CreateDesktopW(wstr wstr ptr long long ptr)
 +@ stdcall CreateDialogIndirectParamA(long ptr long ptr long)
 +@ stdcall CreateDialogIndirectParamAorW(long ptr long ptr long long)
 +@ stdcall CreateDialogIndirectParamW(long ptr long ptr long)
 +@ stdcall CreateDialogParamA(long ptr long ptr long)
 +@ stdcall CreateDialogParamW(long ptr long ptr long)
 +@ stdcall CreateIcon(long long long long long ptr ptr)
 +@ stdcall CreateIconFromResource (ptr long long long)
 +@ stdcall CreateIconFromResourceEx(ptr long long long long long long)
 +@ stdcall CreateIconIndirect(ptr)
 +@ stdcall CreateMDIWindowA(ptr ptr long long long long long long long long)
 +@ stdcall CreateMDIWindowW(ptr ptr long long long long long long long long)
 +@ stdcall CreateMenu()
 +@ stdcall CreatePopupMenu()
- # @ stub DestroyReasons
++; @ stub CreateSystemThreads
 +@ stdcall CreateWindowExA(long str str long long long long long long long long ptr)
 +@ stdcall CreateWindowExW(long wstr wstr long long long long long long long long ptr)
 +@ stdcall CreateWindowStationA(str long long ptr)
 +@ stdcall CreateWindowStationW(wstr long long ptr)
 +@ stdcall CsrBroadcastSystemMessageExW(long ptr long long long ptr)
 +@ stdcall CtxInitUser32()
 +@ stdcall DdeAbandonTransaction(long long long)
 +@ stdcall DdeAccessData(long ptr)
 +@ stdcall DdeAddData(long ptr long long)
 +@ stdcall DdeClientTransaction(ptr long long long long long long ptr)
 +@ stdcall DdeCmpStringHandles(long long)
 +@ stdcall DdeConnect(long long long ptr)
 +@ stdcall DdeConnectList(long long long long ptr)
 +@ stdcall DdeCreateDataHandle(long ptr long long long long long)
 +@ stdcall DdeCreateStringHandleA(long str long)
 +@ stdcall DdeCreateStringHandleW(long wstr long)
 +@ stdcall DdeDisconnect(long)
 +@ stdcall DdeDisconnectList(long)
 +@ stdcall DdeEnableCallback(long long long)
 +@ stdcall DdeFreeDataHandle(long)
 +@ stdcall DdeFreeStringHandle(long long)
 +@ stdcall DdeGetData(long ptr long long)
 +@ stdcall DdeGetLastError(long)
 +@ stdcall DdeGetQualityOfService(long long ptr)
 +@ stdcall DdeImpersonateClient(long)
 +@ stdcall DdeInitializeA(ptr ptr long long)
 +@ stdcall DdeInitializeW(ptr ptr long long)
 +@ stdcall DdeKeepStringHandle(long long)
 +@ stdcall DdeNameService(long long long long)
 +@ stdcall DdePostAdvise(long long long)
 +@ stdcall DdeQueryConvInfo(long long ptr)
 +@ stdcall DdeQueryNextServer(long long)
 +@ stdcall DdeQueryStringA(long long ptr long long)
 +@ stdcall DdeQueryStringW(long long ptr long long)
 +@ stdcall DdeReconnect(long)
 +@ stdcall DdeSetQualityOfService(long ptr ptr)
 +@ stdcall DdeSetUserHandle (long long long)
 +@ stdcall DdeUnaccessData(long)
 +@ stdcall DdeUninitialize(long)
 +@ stdcall DefDlgProcA(long long long long)
 +@ stdcall DefDlgProcW(long long long long)
 +@ stdcall DefFrameProcA(long long long long long)
 +@ stdcall DefFrameProcW(long long long long long)
 +@ stdcall DefMDIChildProcA(long long long long)
 +@ stdcall DefMDIChildProcW(long long long long)
 +@ stdcall DefRawInputProc(ptr long long)
 +@ stdcall DefWindowProcA(long long long long)
 +@ stdcall DefWindowProcW(long long long long)
 +@ stdcall DeferWindowPos(long long long long long long long long)
 +@ stdcall DeleteMenu(long long long)
 +@ stdcall DeregisterShellHookWindow (long)
 +@ stdcall DestroyAcceleratorTable(long)
 +@ stdcall DestroyCaret()
 +@ stdcall DestroyCursor(long)
 +@ stdcall DestroyIcon(long)
 +@ stdcall DestroyMenu(long)
- # @ stub DeviceEventWorker
++; @ stub DestroyReasons
 +@ stdcall DestroyWindow(long)
- # @ stub DisableProcessWindowsGhosting
++; @ stub DeviceEventWorker
 +@ stdcall DialogBoxIndirectParamA(long ptr long ptr long)
 +@ stdcall DialogBoxIndirectParamAorW(long ptr long ptr long long)
 +@ stdcall DialogBoxIndirectParamW(long ptr long ptr long)
 +@ stdcall DialogBoxParamA(long str long ptr long)
 +@ stdcall DialogBoxParamW(long wstr long ptr long)
- # @ stub DisplayExitWindowsWarnings
++; @ stub DisableProcessWindowsGhosting
 +@ stdcall DispatchMessageA(ptr)
 +@ stdcall DispatchMessageW(ptr)
- # @ stub EnterReaderModeHelper
++; @ stub DisplayExitWindowsWarnings
 +@ stdcall DlgDirListA(long str long long long)
 +@ stdcall DlgDirListComboBoxA(long ptr long long long)
 +@ stdcall DlgDirListComboBoxW(long ptr long long long)
 +@ stdcall DlgDirListW(long wstr long long long)
 +@ stdcall DlgDirSelectComboBoxExA(long ptr long long)
 +@ stdcall DlgDirSelectComboBoxExW(long ptr long long)
 +@ stdcall DlgDirSelectExA(long ptr long long)
 +@ stdcall DlgDirSelectExW(long ptr long long)
 +@ stdcall DragDetect(long double)
 +@ stdcall DragObject(long long long long long)
 +@ stdcall DrawAnimatedRects(long long ptr ptr)
 +@ stdcall DrawCaption(long long ptr long)
 +@ stdcall DrawCaptionTempA(long long ptr long long str long)
 +@ stdcall DrawCaptionTempW(long long ptr long long wstr long)
 +@ stdcall DrawEdge(long ptr long long)
 +@ stdcall DrawFocusRect(long ptr)
 +@ stub DrawFrame
 +@ stdcall DrawFrameControl(long ptr long long)
 +@ stdcall DrawIcon(long long long long)
 +@ stdcall DrawIconEx(long long long long long long long long long)
 +@ stdcall DrawMenuBar(long)
 +@ stdcall DrawMenuBarTemp(long long long long long)
 +@ stdcall DrawStateA(long long ptr long long long long long long long)
 +@ stdcall DrawStateW(long long ptr long long long long long long long)
 +@ stdcall DrawTextA(long str long ptr long)
 +@ stdcall DrawTextExA(long str long ptr long ptr)
 +@ stdcall DrawTextExW(long wstr long ptr long ptr)
 +@ stdcall DrawTextW(long wstr long ptr long)
 +@ stdcall EditWndProc(long long long long) EditWndProcA
 +@ stdcall EmptyClipboard()
 +@ stdcall EnableMenuItem(long long long)
 +@ stdcall EnableScrollBar(long long long)
 +@ stdcall EnableWindow(long long)
 +@ stdcall EndDeferWindowPos(long)
 +@ stdcall EndDialog(long long)
 +@ stdcall EndMenu()
 +@ stdcall EndPaint(long ptr)
 +@ stub EndTask
- @ stub EnumDisplayDeviceModesA #(str long ptr long)
- @ stub EnumDisplayDeviceModesW #(wstr long ptr long)
++; @ stub EnterReaderModeHelper
 +@ stdcall EnumChildWindows(long ptr long)
 +@ stdcall EnumClipboardFormats(long)
 +@ stdcall EnumDesktopWindows(long ptr ptr)
 +@ stdcall EnumDesktopsA(ptr ptr long)
 +@ stdcall EnumDesktopsW(ptr ptr long)
- ; FIXME -- Only for Win64
++@ stub EnumDisplayDeviceModesA ;(str long ptr long)
++@ stub EnumDisplayDeviceModesW ;(wstr long ptr long)
 +@ stdcall EnumDisplayDevicesA(ptr long ptr long)
 +@ stdcall EnumDisplayDevicesW(ptr long ptr long)
 +@ stdcall EnumDisplayMonitors(long ptr ptr long)
 +@ stdcall EnumDisplaySettingsA(str long ptr)
 +@ stdcall EnumDisplaySettingsExA(str long ptr long)
 +@ stdcall EnumDisplaySettingsExW(wstr long ptr long)
 +@ stdcall EnumDisplaySettingsW(wstr long ptr )
 +@ stdcall EnumPropsA(long ptr)
 +@ stdcall EnumPropsExA(long ptr long)
 +@ stdcall EnumPropsExW(long ptr long)
 +@ stdcall EnumPropsW(long ptr)
 +@ stdcall EnumThreadWindows(long ptr long)
 +@ stdcall EnumWindowStationsA(ptr long)
 +@ stdcall EnumWindowStationsW(ptr long)
 +@ stdcall EnumWindows(ptr long)
 +@ stdcall EqualRect(ptr ptr)
 +@ stdcall ExcludeUpdateRgn(long long)
 +@ stdcall ExitWindowsEx(long long)
 +@ stdcall FillRect(long ptr long)
 +@ stdcall FindWindowA(str str)
 +@ stdcall FindWindowExA(long long str str)
 +@ stdcall FindWindowExW(long long wstr wstr)
 +@ stdcall FindWindowW(wstr wstr)
 +@ stdcall FlashWindow(long long)
 +@ stdcall FlashWindowEx(ptr)
 +@ stdcall FrameRect(long ptr long)
 +@ stdcall FreeDDElParam(long long)
 +@ stdcall GetActiveWindow()
 +@ stdcall GetAltTabInfo(long long ptr ptr long) GetAltTabInfoA
 +@ stdcall GetAltTabInfoA(long long ptr ptr long)
 +@ stdcall GetAltTabInfoW(long long ptr ptr long)
 +@ stdcall GetAncestor(long long)
 +@ stdcall GetAppCompatFlags(long)
 +@ stdcall GetAppCompatFlags2(long)
 +@ stdcall GetAsyncKeyState(long)
 +@ stdcall GetCapture()
 +@ stdcall GetCaretBlinkTime()
 +@ stdcall GetCaretPos(ptr)
 +@ stdcall GetClassInfoA(long str ptr)
 +@ stdcall GetClassInfoExA(long str ptr)
 +@ stdcall GetClassInfoExW(long wstr ptr)
 +@ stdcall GetClassInfoW(long wstr ptr)
 +@ stdcall GetClassLongA(long long)
 +@ stdcall GetClassLongW(long long)
++#ifdef _WIN64
 +@ stdcall GetClassLongPtrA(ptr long)
 +@ stdcall GetClassLongPtrW(ptr long)
- # @ stub GetCursorFrameInfo
++#endif
 +@ stdcall GetClassNameA(long ptr long)
 +@ stdcall GetClassNameW(long ptr long)
 +@ stdcall GetClassWord(long long)
 +@ stdcall GetClientRect(long long)
 +@ stdcall GetClipCursor(ptr)
 +@ stdcall GetClipboardData(long)
 +@ stdcall GetClipboardFormatNameA(long ptr long)
 +@ stdcall GetClipboardFormatNameW(long ptr long)
 +@ stdcall GetClipboardOwner()
 +@ stdcall GetClipboardSequenceNumber ()
 +@ stdcall GetClipboardViewer()
 +@ stdcall GetComboBoxInfo(long ptr)
 +@ stdcall GetCursor()
- # @ stub GetListBoxInfo
++; @ stub GetCursorFrameInfo
 +@ stdcall GetCursorInfo(ptr)
 +@ stdcall GetCursorPos(ptr)
 +@ stdcall GetDC(long)
 +@ stdcall GetDCEx(long long long)
 +@ stdcall GetDesktopWindow()
 +@ stdcall GetDialogBaseUnits()
 +@ stdcall GetDlgCtrlID(long)
 +@ stdcall GetDlgItem(long long)
 +@ stdcall GetDlgItemInt(long long ptr long)
 +@ stdcall GetDlgItemTextA(long long ptr long)
 +@ stdcall GetDlgItemTextW(long long ptr long)
 +@ stdcall GetDoubleClickTime()
 +@ stdcall GetFocus()
 +@ stdcall GetForegroundWindow()
 +@ stdcall GetGUIThreadInfo(long ptr)
 +@ stdcall GetGuiResources(long long)
 +@ stdcall GetIconInfo(long ptr)
 +@ stdcall GetInputDesktop()
 +@ stdcall GetInputState()
 +@ stdcall GetInternalWindowPos(long ptr ptr)
 +@ stdcall GetKBCodePage()
 +@ stdcall GetKeyNameTextA(long ptr long)
 +@ stdcall GetKeyNameTextW(long ptr long)
 +@ stdcall GetKeyState(long)
 +@ stdcall GetKeyboardLayout(long)
 +@ stdcall GetKeyboardLayoutList(long ptr) NtUserGetKeyboardLayoutList
 +@ stdcall GetKeyboardLayoutNameA(ptr)
 +@ stdcall GetKeyboardLayoutNameW(ptr)
 +@ stdcall GetKeyboardState(ptr)
 +@ stdcall GetKeyboardType(long)
 +@ stdcall GetLastActivePopup(long)
 +@ stdcall GetLastInputInfo(ptr)
 +@ stdcall GetLayeredWindowAttributes(long ptr ptr ptr) NtUserGetLayeredWindowAttributes
- # @ stub GetNextQueueWindow
++; @ stub GetListBoxInfo
 +@ stdcall GetMenu(long)
 +@ stdcall GetMenuBarInfo(long long long ptr)
 +@ stdcall GetMenuCheckMarkDimensions()
 +@ stdcall GetMenuContextHelpId(long)
 +@ stdcall GetMenuDefaultItem(long long long)
 +@ stub GetMenuIndex
 +@ stdcall GetMenuInfo(long ptr)
 +@ stdcall GetMenuItemCount(long)
 +@ stdcall GetMenuItemID(long long)
 +@ stdcall GetMenuItemInfoA(long long long ptr)
 +@ stdcall GetMenuItemInfoW(long long long ptr)
 +@ stdcall GetMenuItemRect(long long long ptr)
 +@ stdcall GetMenuState(long long long)
 +@ stdcall GetMenuStringA(long long ptr long long)
 +@ stdcall GetMenuStringW(long long ptr long long)
 +@ stdcall GetMessageA(ptr long long long)
 +@ stdcall GetMessageExtraInfo()
 +@ stdcall GetMessagePos()
 +@ stdcall GetMessageTime()
 +@ stdcall GetMessageW(ptr long long long)
 +@ stdcall GetMonitorInfoA(long ptr)
 +@ stdcall GetMonitorInfoW(long ptr)
 +@ stdcall GetMouseMovePointsEx(long ptr ptr long long)
 +@ stdcall GetNextDlgGroupItem(long long long)
 +@ stdcall GetNextDlgTabItem(long long long)
- # @ stub GetReasonTitleFromReasonCode
++; @ stub GetNextQueueWindow
 +@ stdcall GetOpenClipboardWindow()
 +@ stdcall GetParent(long)
 +@ stdcall GetPriorityClipboardFormat(ptr long)
 +@ stdcall GetProcessDefaultLayout(ptr)
 +@ stdcall GetProcessWindowStation()
 +@ stdcall GetProgmanWindow ()
 +@ stdcall GetPropA(long str)
 +@ stdcall GetPropW(long wstr)
 +@ stdcall GetQueueStatus(long)
 +@ stdcall GetRawInputBuffer(ptr ptr long)
 +@ stdcall GetRawInputData(ptr long ptr ptr long)
 +@ stdcall GetRawInputDeviceInfoA(ptr long ptr ptr)
 +@ stdcall GetRawInputDeviceInfoW(ptr long ptr ptr)
 +@ stdcall GetRawInputDeviceList(ptr ptr long)
- # @ stub GetWinStationInfo
++; @ stub GetReasonTitleFromReasonCode
 +@ stdcall GetRegisteredRawInputDevices(ptr ptr long)
 +@ stdcall GetScrollBarInfo(long long ptr)
 +@ stdcall GetScrollInfo(long long ptr)
 +@ stdcall GetScrollPos(long long)
 +@ stdcall GetScrollRange(long long ptr ptr)
 +@ stdcall GetShellWindow()
 +@ stdcall GetSubMenu(long long)
 +@ stdcall GetSysColor(long)
 +@ stdcall GetSysColorBrush(long)
 +@ stdcall GetSystemMenu(long long)
 +@ stdcall GetSystemMetrics(long)
 +@ stdcall GetTabbedTextExtentA(long str long long ptr)
 +@ stdcall GetTabbedTextExtentW(long wstr long long ptr)
 +@ stdcall GetTaskmanWindow ()
 +@ stdcall GetThreadDesktop(long)
 +@ stdcall GetTitleBarInfo(long ptr)
 +@ stdcall GetTopWindow(long)
 +@ stdcall GetUpdateRect(long ptr long)
 +@ stdcall GetUpdateRgn(long long long)
 +@ stdcall GetUserObjectInformationA (long long ptr long ptr)
 +@ stdcall GetUserObjectInformationW (long long ptr long ptr)
 +@ stdcall GetUserObjectSecurity (long ptr ptr long ptr)
- ; FIXME -- Only for Win64
++; @ stub GetWinStationInfo
 +@ stdcall GetWindow(long long)
 +@ stdcall GetWindowContextHelpId(long)
 +@ stdcall GetWindowDC(long)
 +@ stdcall GetWindowInfo(long ptr)
 +@ stdcall GetWindowLongA(long long)
++#ifdef _WIN64
 +@ stdcall GetWindowLongPtrA(ptr long)
 +@ stdcall GetWindowLongPtrW(ptr long)
- # @ stub HasSystemSleepStarted
++#endif
 +@ stdcall GetWindowLongW(long long)
 +@ stdcall GetWindowModuleFileName(long ptr long) GetWindowModuleFileNameA
 +@ stdcall GetWindowModuleFileNameA(long ptr long)
 +@ stdcall GetWindowModuleFileNameW(long ptr long)
 +@ stdcall GetWindowPlacement(long ptr)
 +@ stdcall GetWindowRect(long ptr)
 +@ stdcall GetWindowRgn(long long)
 +@ stdcall GetWindowRgnBox(long ptr)
 +@ stdcall GetWindowTextA(long ptr long)
 +@ stdcall GetWindowTextLengthA(long)
 +@ stdcall GetWindowTextLengthW(long)
 +@ stdcall GetWindowTextW(long ptr long)
 +@ stdcall GetWindowThreadProcessId(long ptr)
 +@ stdcall GetWindowWord(long long)
 +@ stdcall GrayStringA(long long ptr long long long long long long)
 +@ stdcall GrayStringW(long long ptr long long long long long long)
- # @ stub InitSharedTable
- # @ stub InitTask
++; @ stub HasSystemSleepStarted
 +@ stdcall HideCaret(long) NtUserHideCaret
 +@ stdcall HiliteMenuItem(long long long long)
 +@ stdcall IMPGetIMEA(long ptr)
 +@ stdcall IMPGetIMEW(long ptr)
 +@ stdcall IMPQueryIMEA(ptr)
 +@ stdcall IMPQueryIMEW(ptr)
 +@ stdcall IMPSetIMEA(long ptr)
 +@ stdcall IMPSetIMEW(long ptr)
 +@ stdcall ImpersonateDdeClientWindow(long long)
 +@ stdcall InSendMessage()
 +@ stdcall InSendMessageEx(ptr)
 +@ stdcall InflateRect(ptr long long)
- # @ stub InitializeWin32EntryTable
++; @ stub InitSharedTable
++; @ stub InitTask
 +@ stdcall InitializeLpkHooks(ptr)
- # @ stub IsHungThread
++; @ stub InitializeWin32EntryTable
 +@ stdcall InsertMenuA(long long long long ptr)
 +@ stdcall InsertMenuItemA(long long long ptr)
 +@ stdcall InsertMenuItemW(long long long ptr)
 +@ stdcall InsertMenuW(long long long long ptr)
 +@ stdcall InternalGetWindowText(long long long)
 +@ stdcall IntersectRect(ptr ptr ptr)
 +@ stdcall InvalidateRect(long ptr long) NtUserInvalidateRect
 +@ stdcall InvalidateRgn(long long long)
 +@ stdcall InvertRect(long ptr)
 +@ stdcall IsCharAlphaA(long)
 +@ stdcall IsCharAlphaNumericA(long)
 +@ stdcall IsCharAlphaNumericW(long)
 +@ stdcall IsCharAlphaW(long)
 +@ stdcall IsCharLowerA(long)
 +@ stdcall IsCharLowerW(long)
 +@ stdcall IsCharUpperA(long)
 +@ stdcall IsCharUpperW(long)
 +@ stdcall IsChild(long long)
 +@ stdcall IsClipboardFormatAvailable(long)
 +@ stdcall IsDialogMessage(long ptr) IsDialogMessageA
 +@ stdcall IsDialogMessageA(long ptr)
 +@ stdcall IsDialogMessageW(long ptr)
 +@ stdcall IsDlgButtonChecked(long long)
 +@ stdcall IsGUIThread(long)
 +@ stdcall IsHungAppWindow(long)
- # @ stub LoadKeyboardLayoutEx
++; @ stub IsHungThread
 +@ stdcall IsIconic(long)
 +@ stdcall IsMenu(long)
 +@ stdcall IsRectEmpty(ptr)
 +@ stdcall IsServerSideWindow(long)
 +@ stdcall IsWinEventHookInstalled(long)
 +@ stdcall IsWindow(long)
 +@ stdcall IsWindowEnabled(long)
 +@ stdcall IsWindowInDestroy(long)
 +@ stdcall IsWindowUnicode(long)
 +@ stdcall IsWindowVisible(long)
 +@ stdcall IsZoomed(long)
 +@ stdcall KillSystemTimer(long long)
 +@ stdcall KillTimer(long long)
 +@ stdcall LoadAcceleratorsA(long str)
 +@ stdcall LoadAcceleratorsW(long wstr)
 +@ stdcall LoadBitmapA(long str)
 +@ stdcall LoadBitmapW(long wstr)
 +@ stdcall LoadCursorA(long str)
 +@ stdcall LoadCursorFromFileA(str)
 +@ stdcall LoadCursorFromFileW(wstr)
 +@ stdcall LoadCursorW(long wstr)
 +@ stdcall LoadIconA(long str)
 +@ stdcall LoadIconW(long wstr)
 +@ stdcall LoadImageA(long str long long long long)
 +@ stdcall LoadImageW(long wstr long long long long)
 +@ stdcall LoadKeyboardLayoutA(str long)
- # @ stub MessageBoxTimeoutA
- # @ stub MessageBoxTimeoutW
++; @ stub LoadKeyboardLayoutEx
 +@ stdcall LoadKeyboardLayoutW(wstr long)
 +@ stdcall LoadLocalFonts()
 +@ stdcall LoadMenuA(long str)
 +@ stdcall LoadMenuIndirectA(ptr)
 +@ stdcall LoadMenuIndirectW(ptr)
 +@ stdcall LoadMenuW(long wstr)
 +@ stub LoadRemoteFonts
 +@ stdcall LoadStringA(long long ptr long)
 +@ stdcall LoadStringW(long long ptr long)
 +@ stdcall LockSetForegroundWindow (long)
 +@ stub LockWindowStation
 +@ stdcall LockWindowUpdate(long)
 +@ stub LockWorkStation
 +@ stdcall LookupIconIdFromDirectory(ptr long)
 +@ stdcall LookupIconIdFromDirectoryEx(ptr long long long long)
 +@ stub MBToWCSEx
 +@ stdcall MB_GetString(ptr)
 +@ stdcall MapDialogRect(long ptr)
 +@ stdcall MapVirtualKeyA(long long)
 +@ stdcall MapVirtualKeyExA(long long long)
 +@ stdcall MapVirtualKeyExW(long long long)
 +@ stdcall MapVirtualKeyW(long long)
 +@ stdcall MapWindowPoints(long long ptr long)
 +@ stdcall MenuItemFromPoint(long long double)
 +@ stdcall MenuWindowProcA (long long long long)
 +@ stdcall MenuWindowProcW (long long long long)
 +@ stdcall MessageBeep(long)
 +@ stdcall MessageBoxA(long str str long)
 +@ stdcall MessageBoxExA(long str str long long)
 +@ stdcall MessageBoxExW(long wstr wstr long long)
 +@ stdcall MessageBoxIndirectA(ptr)
 +@ stdcall MessageBoxIndirectW(ptr)
- # @ stub ModifyAccess
++; @ stub MessageBoxTimeoutA
++; @ stub MessageBoxTimeoutW
 +@ stdcall MessageBoxW(long wstr wstr long)
- # @ stub PaintMenuBar
++; @ stub ModifyAccess
 +@ stdcall ModifyMenuA(long long long long ptr)
 +@ stdcall ModifyMenuW(long long long long ptr)
 +@ stdcall MonitorFromPoint(double long)
 +@ stdcall MonitorFromRect(ptr long)
 +@ stdcall MonitorFromWindow(long long)
 +@ stdcall MoveWindow(long long long long long long)
 +@ stdcall MsgWaitForMultipleObjects(long ptr long long long)
 +@ stdcall MsgWaitForMultipleObjectsEx(long ptr long long long)
 +@ stdcall NotifyWinEvent(long long long long)
 +@ stdcall OemKeyScan(long)
 +@ stdcall OemToCharA(ptr ptr)
 +@ stdcall OemToCharBuffA(ptr ptr long)
 +@ stdcall OemToCharBuffW(ptr ptr long)
 +@ stdcall OemToCharW(ptr ptr)
 +@ stdcall OffsetRect(ptr long long)
 +@ stdcall OpenClipboard(long)
 +@ stdcall OpenDesktopA(str long long long)
 +@ stdcall OpenDesktopW(wstr long long long)
 +@ stdcall OpenIcon(long)
 +@ stdcall OpenInputDesktop(long long long)
 +@ stdcall OpenWindowStationA(str long long)
 +@ stdcall OpenWindowStationW(wstr long long)
 +@ stdcall PackDDElParam(long long long)
 +@ stdcall PaintDesktop(long)
- # @ stub PrintWindow
++; @ stub PaintMenuBar
 +@ stdcall PeekMessageA(ptr long long long long)
 +@ stdcall PeekMessageW(ptr long long long long)
 +@ stub PlaySoundEvent
 +@ stdcall PostMessageA(long long long long)
 +@ stdcall PostMessageW(long long long long)
 +@ stdcall PostQuitMessage(long)
 +@ stdcall PostThreadMessageA(long long long long)
 +@ stdcall PostThreadMessageW(long long long long)
- # @ stub PrivateSetDbgTag
- # @ stub PrivateSetRipFlags
++; @ stub PrintWindow
 +@ stdcall PrivateExtractIconExA(str long ptr ptr long)
 +@ stdcall PrivateExtractIconExW(wstr long ptr ptr long)
 +@ stdcall PrivateExtractIconsA (str long long long ptr ptr long long)
 +@ stdcall PrivateExtractIconsW (wstr long long long ptr ptr long long)
- # @ stub QueryUserCounters
++; @ stub PrivateSetDbgTag
++; @ stub PrivateSetRipFlags
 +@ stdcall PtInRect(ptr double)
 +@ stub QuerySendMessage
- # @ stub ReasonCodeNeedsBugID
- # @ stub ReasonCodeNeedsComment
- # @ stub RecordShutdownReason
++; @ stub QueryUserCounters
 +@ stdcall RealChildWindowFromPoint(long double)
 +@ stdcall RealGetWindowClass(long ptr long) RealGetWindowClassA
 +@ stdcall RealGetWindowClassA(long ptr long)
 +@ stdcall RealGetWindowClassW(long ptr long)
- # @ stub RegisterMessagePumpHook
++; @ stub ReasonCodeNeedsBugID
++; @ stub ReasonCodeNeedsComment
++; @ stub RecordShutdownReason
 +@ stdcall RedrawWindow(long ptr long long)
 +@ stdcall RegisterClassA(ptr)
 +@ stdcall RegisterClassExA(ptr)
 +@ stdcall RegisterClassExW(ptr)
 +@ stdcall RegisterClassW(ptr)
 +@ stdcall RegisterClipboardFormatA(str)
 +@ stdcall RegisterClipboardFormatW(wstr)
 +@ stdcall RegisterDeviceNotificationA(long ptr long) RegisterDeviceNotificationW
 +@ stdcall RegisterDeviceNotificationW(long ptr long)
 +@ stdcall RegisterHotKey(long long long long)
 +@ stdcall RegisterLogonProcess(long long)
- # @ stub RegisterUserApiHook
++; @ stub RegisterMessagePumpHook
 +@ stub RegisterNetworkCapabilities
 +@ stdcall RegisterRawInputDevices(ptr long long)
 +@ stdcall RegisterServicesProcess(long)
 +@ stdcall RegisterShellHookWindow (long)
 +@ stdcall RegisterSystemThread(long long)
 +@ stdcall RegisterTasklist (long)
- # @ stub ResolveDesktopForWOW
++; @ stub RegisterUserApiHook
 +@ stdcall RegisterWindowMessageA(str)
 +@ stdcall RegisterWindowMessageW(wstr)
 +@ stdcall ReleaseCapture()
 +@ stdcall ReleaseDC(long long)
 +@ stdcall RemoveMenu(long long long)
 +@ stdcall RemovePropA(long str)
 +@ stdcall RemovePropW(long wstr)
 +@ stdcall ReplyMessage(long)
 +@ stub ResetDisplay
- ; FIXME -- Only for Win64
++; @ stub ResolveDesktopForWOW
 +@ stdcall ReuseDDElParam(long long long long long)
 +@ stdcall ScreenToClient(long ptr)
 +@ stdcall ScrollChildren(long long long long)
 +@ stdcall ScrollDC(long long long ptr ptr long ptr)
 +@ stdcall ScrollWindow(long long long ptr ptr)
 +@ stdcall ScrollWindowEx(long long long ptr ptr long ptr long)
 +@ stdcall SendDlgItemMessageA(long long long long long)
 +@ stdcall SendDlgItemMessageW(long long long long long)
 +@ stdcall SendIMEMessageExA(long long)
 +@ stdcall SendIMEMessageExW(long long)
 +@ stdcall SendInput(long ptr long)
 +@ stdcall SendMessageA(long long long long)
 +@ stdcall SendMessageCallbackA(long long long long ptr long)
 +@ stdcall SendMessageCallbackW(long long long long ptr long)
 +@ stdcall SendMessageTimeoutA(long long long long long long ptr)
 +@ stdcall SendMessageTimeoutW(long long long long long long ptr)
 +@ stdcall SendMessageW(long long long long)
 +@ stdcall SendNotifyMessageA(long long long long)
 +@ stdcall SendNotifyMessageW(long long long long)
 +@ stub ServerSetFunctionPointers
 +@ stdcall SetActiveWindow(long)
 +@ stdcall SetCapture(long)
 +@ stdcall SetCaretBlinkTime(long)
 +@ stdcall SetCaretPos(long long)
 +@ stdcall SetClassLongA(long long long)
++#ifdef _WIN64
 +@ stdcall SetClassLongPtrA(ptr long ptr)
 +@ stdcall SetClassLongPtrW(ptr long ptr)
- # @ stub SetConsoleReserveKeys
++#endif
 +@ stdcall SetClassLongW(long long long)
 +@ stdcall SetClassWord(long long long)
 +@ stdcall SetClipboardData(long long)
 +@ stdcall SetClipboardViewer(long)
- # @ stub SetDesktopBitmap
++; @ stub SetConsoleReserveKeys
 +@ stdcall SetCursor(long)
 +@ stub SetCursorContents
 +@ stdcall SetCursorPos(long long)
 +@ stdcall SetDebugErrorLevel(long)
 +@ stdcall SetDeskWallpaper(ptr)
- ; FIXME -- Only for Win64
++; @ stub SetDesktopBitmap
 +@ stdcall SetDlgItemInt(long long long long)
 +@ stdcall SetDlgItemTextA(long long str)
 +@ stdcall SetDlgItemTextW(long long wstr)
 +@ stdcall SetDoubleClickTime(long)
 +@ stdcall SetFocus(long)
 +@ stdcall SetForegroundWindow(long)
 +@ stdcall SetInternalWindowPos(long long ptr ptr)
 +@ stdcall SetKeyboardState(ptr)
 +@ stdcall SetLastErrorEx(long long)
 +@ stdcall SetLayeredWindowAttributes(ptr long long long) NtUserSetLayeredWindowAttributes
 +@ stdcall SetLogonNotifyWindow(long long)
 +@ stdcall SetMenu(long long)
 +@ stdcall SetMenuContextHelpId(long long)
 +@ stdcall SetMenuDefaultItem(long long long)
 +@ stdcall SetMenuInfo(long ptr)
 +@ stdcall SetMenuItemBitmaps(long long long long long)
 +@ stdcall SetMenuItemInfoA(long long long ptr)
 +@ stdcall SetMenuItemInfoW(long long long ptr)
 +@ stdcall SetMessageExtraInfo(long)
 +@ stdcall SetMessageQueue(long)
 +@ stdcall SetParent(long long)
 +@ stdcall SetProcessDefaultLayout(long)
 +@ stub SetProcessDPIAware
 +@ stdcall SetProcessWindowStation(long)
 +@ stdcall SetProgmanWindow (long)
 +@ stdcall SetPropA(long str long)
 +@ stdcall SetPropW(long wstr long)
 +@ stdcall SetRect(ptr long long long long)
 +@ stdcall SetRectEmpty(ptr)
 +@ stdcall SetScrollInfo(long long ptr long)
 +@ stdcall SetScrollPos(long long long long)
 +@ stdcall SetScrollRange(long long long long long)
 +@ stdcall SetShellWindow(long)
 +@ stdcall SetShellWindowEx (long long)
 +@ stdcall SetSysColors(long ptr ptr)
 +@ stdcall SetSysColorsTemp(ptr ptr long)
 +@ stdcall SetSystemCursor(long long)
 +@ stdcall SetSystemMenu(long long)
 +@ stdcall SetSystemTimer(long long long ptr)
 +@ stdcall SetTaskmanWindow (long)
 +@ stdcall SetThreadDesktop(long)
 +@ stdcall SetTimer(long long long ptr)
 +@ stdcall SetUserObjectInformationA(long long ptr long)
 +@ stdcall SetUserObjectInformationW(long long ptr long)
 +@ stdcall SetUserObjectSecurity(long ptr ptr)
 +@ stdcall SetWinEventHook(long long long ptr long long long)
 +@ stdcall SetWindowContextHelpId(long long)
 +@ stub SetWindowFullScreenState
 +@ stdcall SetWindowLongA(long long long)
++#ifdef _WIN64
 +@ stdcall SetWindowLongPtrA(ptr long ptr)
 +@ stdcall SetWindowLongPtrW(ptr long ptr)
- # @ stub SoftModalMessageBox
++#endif
 +@ stdcall SetWindowLongW(long long long)
 +@ stdcall SetWindowPlacement(long ptr)
 +@ stdcall SetWindowPos(long long long long long long long)
 +@ stdcall SetWindowRgn(long long long)
 +@ stdcall SetWindowStationUser(long long long long)
 +@ stdcall SetWindowText(long str) SetWindowTextA
 +@ stdcall SetWindowTextA(long str)
 +@ stdcall SetWindowTextW(long wstr)
 +@ stdcall SetWindowWord(long long long)
 +@ stdcall SetWindowsHookA(long ptr)
 +@ stdcall SetWindowsHookExA(long long long long)
 +@ stdcall SetWindowsHookExW(long long long long)
 +@ stdcall SetWindowsHookW(long ptr)
 +@ stdcall ShowCaret(long) NtUserShowCaret
 +@ stdcall ShowCursor(long)
 +@ stdcall ShowOwnedPopups(long long)
 +@ stdcall ShowScrollBar(long long long)
 +@ stub ShowStartGlass
 +@ stdcall ShowWindow(long long)
 +@ stdcall ShowWindowAsync(long long)
- # @ stub SysErrorBox
++; @ stub SoftModalMessageBox
 +@ stdcall SubtractRect(ptr ptr ptr)
 +@ stdcall SwapMouseButton(long)
 +@ stdcall SwitchDesktop(long)
 +@ stdcall SwitchToThisWindow(long long)
- # @ stub TranslateMessageEx
++; @ stub SysErrorBox
 +@ stdcall SystemParametersInfoA(long long ptr long)
 +@ stdcall SystemParametersInfoW(long long ptr long)
 +@ stdcall TabbedTextOutA(long long long str long long ptr long)
 +@ stdcall TabbedTextOutW(long long long wstr long long ptr long)
 +@ stdcall TileChildWindows(long long)
 +@ stdcall TileWindows(long long ptr long ptr)
 +@ stdcall ToAscii(long long ptr ptr long)
 +@ stdcall ToAsciiEx(long long ptr ptr long long)
 +@ stdcall ToUnicode(long long ptr ptr long long)
 +@ stdcall ToUnicodeEx(long long ptr ptr long long long)
 +@ stdcall TrackMouseEvent(ptr)
 +@ stdcall TrackPopupMenu(long long long long long long ptr)
 +@ stdcall TrackPopupMenuEx(long long long long long ptr)
 +@ stdcall TranslateAccelerator(long long ptr) TranslateAcceleratorA
 +@ stdcall TranslateAcceleratorA(long long ptr)
 +@ stdcall TranslateAcceleratorW(long long ptr)
 +@ stdcall TranslateMDISysAccel(long ptr)
 +@ stdcall TranslateMessage(ptr)
- # @ stub UnregisterMessagePumpHook
- # @ stub UnregisterUserApiHook
++; @ stub TranslateMessageEx
 +@ stdcall UnhookWinEvent(long) NtUserUnhookWinEvent
 +@ stdcall UnhookWindowsHook(long ptr)
 +@ stdcall UnhookWindowsHookEx(long) NtUserUnhookWindowsHookEx
 +@ stdcall UnionRect(ptr ptr ptr)
 +@ stdcall UnloadKeyboardLayout(long) NtUserUnloadKeyboardLayout
 +@ stub UnlockWindowStation
 +@ stdcall UnpackDDElParam(long long ptr ptr)
 +@ stdcall UnregisterClassA(str long)
 +@ stdcall UnregisterClassW(wstr long)
 +@ stdcall UnregisterDeviceNotification(long)
 +@ stdcall UnregisterHotKey(long long) NtUserUnregisterHotKey
- # @ stub UserIsSystemResumeAutomatic
- # @ stub UserLpkPSMTextOut
- # @ stub UserLpkTabbedTextOut
++; @ stub UnregisterMessagePumpHook
++; @ stub UnregisterUserApiHook
 +@ stdcall UpdateLayeredWindow(long long ptr ptr long ptr long ptr long) NtUserUpdateLayeredWindow
 +@ stdcall UpdatePerUserSystemParameters(long long)
 +@ stdcall UpdateWindow(long)
 +@ stdcall User32InitializeImmEntryTable(ptr)
 +@ stdcall UserClientDllInitialize(long long ptr) DllMain
 +@ stub UserHandleGrantAccess
- # @ stub UserSetDeviceHoldState
- # @ stdcall UserSignalProc(long long long long)
- # @ stub VRipOutput
- # @ stub VTagOutput
++; @ stub UserIsSystemResumeAutomatic
++; @ stub UserLpkPSMTextOut
++; @ stub UserLpkTabbedTextOut
 +@ stdcall UserRealizePalette(long)
 +@ stub UserRegisterWowHandlers
- # @ stub Win32PoolAllocationStats
++; @ stub UserSetDeviceHoldState
++; @ stdcall UserSignalProc(long long long long)
++; @ stub VRipOutput
++; @ stub VTagOutput
 +@ stdcall ValidateRect(long ptr)
 +@ stdcall ValidateRgn(long long)
 +@ stdcall VkKeyScanA(long)
 +@ stdcall VkKeyScanExA(long long)
 +@ stdcall VkKeyScanExW(long long)
 +@ stdcall VkKeyScanW(long)
 +@ stub WCSToMBEx
 +@ stdcall WINNLSEnableIME(long long)
 +@ stdcall WINNLSGetEnableStatus(long)
 +@ stdcall WINNLSGetIMEHotkey(long)
 +@ stub WNDPROC_CALLBACK
 +@ stdcall WaitForInputIdle(long long)
 +@ stdcall WaitMessage()
- # @ stub WinOldAppHackoMatic
++; @ stub Win32PoolAllocationStats
 +@ stdcall WinHelpA(long str long long)
 +@ stdcall WinHelpW(long wstr long long)
- # @ stub YieldTask
- # @ stub _SetProcessDefaultLayout
++; @ stub WinOldAppHackoMatic
 +@ stdcall WindowFromDC(long)
 +@ stdcall WindowFromPoint(double)
- # ROS specific exports
++; @ stub YieldTask
++; @ stub _SetProcessDefaultLayout
 +@ stdcall keybd_event(long long long long)
 +@ stdcall mouse_event(long long long long long)
 +@ varargs wsprintfA(str str)
 +@ varargs wsprintfW(wstr wstr)
 +@ stdcall wvsprintfA(ptr str ptr)
 +@ stdcall wvsprintfW(ptr wstr ptr)
 +
++; ROS specific exports
 +@ stdcall PrivateCsrssManualGuiCheck(long)
 +@ stdcall PrivateCsrssInitialized()
++
@@@ -1,5 -1,5 +1,5 @@@
 -<module name="user32" type="win32dll" baseaddress="${BASEADDRESS_USER32}" installbase="system32" installname="user32.dll" unicode="yes">
 -      <importlibrary definition="user32.def" />
 +<module name="user32" type="win32dll" baseaddress="${BASEADDRESS_USER32}" installbase="system32" installname="user32.dll" unicode="yes" allowwarnings="true">
-       <importlibrary definition="user32.spec" />
++      <importlibrary definition="user32.pspec" />
        <include base="user32">.</include>
        <include base="user32">include</include>
        <include base="ReactOS">include/reactos/subsys</include>
@@@ -73,5 -73,4 +73,4 @@@
                <file>winpos.c</file>
        </directory>
        <file>user32.rc</file>
-       <file>user32.spec</file>
  </module>
@@@ -1,5 -1,5 +1,5 @@@
  <module name="userenv" type="win32dll" baseaddress="${BASEADDRESS_USERENV}" installbase="system32" installname="userenv.dll">
 -      <importlibrary definition="userenv.def" />
 +      <importlibrary definition="userenv.spec" />
        <include base="userenv">.</include>
        <library>uuid</library>
        <library>ntdll</library>
@@@ -17,5 -17,4 +17,4 @@@
        <file>setup.c</file>
        <file>userenv.c</file>
        <file>userenv.rc</file>
-       <file>userenv.spec</file>
  </module>
@@@ -1,5 -1,5 +1,5 @@@
  <module name="winspool" type="win32dll" extension=".drv" baseaddress="${BASEADDRESS_WINSPOOL}" installbase="system32" installname="winspool.drv" allowwarnings="true" unicode="yes">
 -      <importlibrary definition="winspool.def" />
 +      <importlibrary definition="winspool.spec" />
        <include base="winspool">.</include>
        <define name="_DISABLE_TIDENTS" />
        <library>ntdll</library>
@@@ -9,5 -9,4 +9,4 @@@
        <file>info.c</file>
        <file>stubs.c</file>
        <file>winspool.rc</file>
-       <file>winspool.spec</file>
  </module>
@@@ -1,5 -1,5 +1,5 @@@
  <module name="ws2_32" type="win32dll" baseaddress="${BASEADDRESS_WS2_32}" installbase="system32" installname="ws2_32.dll" unicode="yes">
 -      <importlibrary definition="ws2_32.def" />
 +      <importlibrary definition="ws2_32.spec" />
        <include base="ws2_32">include</include>
        <include base="ReactOS">include/reactos/wine</include>
        <define name="_DISABLE_TIDENTS" />
@@@ -26,6 -26,4 +26,5 @@@
                <file>async.c</file>
        </directory>
        <file>ws2_32.rc</file>
-       <file>ws2_32.spec</file>
  </module>
 +
@@@ -6,7 -6,7 +6,7 @@@
        <include base="bootvid">.</include>
        <library>ntoskrnl</library>
        <library>hal</library>
 -      <if property="ARCH" value="i386">
 +      <if property="PLATFORM" value="PC">
                <directory name="i386">
                        <file>bootvid.c</file>
                        <file>bootdata.c</file>
@@@ -20,6 -20,5 +20,5 @@@
                </directory>
        </if>
        <file>bootvid.rc</file>
-       <file>bootvid.spec</file>
        <pch>precomp.h</pch>
  </module>
                                <file>kdbg.c</file>
                </directory>
        </if>
-       <file>kdcom.spec</file>
 +      <if property="ARCH" value="amd64">
 +              <directory name="i386">
 +                              <file>kdbg.c</file>
 +              </directory>
 +      </if>
  </module>
@@@ -25,7 -25,7 +25,7 @@@ PVOID LockRequest( PIRP Irp, PIO_STACK_
                       NULL );
      if( Irp->MdlAddress ) {
        _SEH_TRY {
-           MmProbeAndLockPages( Irp->MdlAddress, KernelMode, IoModifyAccess );
+           MmProbeAndLockPages( Irp->MdlAddress, Irp->RequestorMode, IoModifyAccess );
        } _SEH_HANDLE {
            LockFailed = TRUE;
        } _SEH_END;
@@@ -180,7 -180,7 +180,7 @@@ PAFD_HANDLE LockHandles( PAFD_HANDLE Ha
        if( !HandleArray[i].Handle ) continue;
        if( NT_SUCCESS(Status) ) {
                Status = ObReferenceObjectByHandle
 -              ( (PVOID)HandleArray[i].Handle,
 +              ( (PVOID)(ULONG_PTR)HandleArray[i].Handle,
                 FILE_ALL_ACCESS,
                 NULL,
                 KernelMode,
@@@ -202,7 -202,7 +202,7 @@@ VOID UnlockHandles( PAFD_HANDLE HandleA
  
      for( i = 0; i < HandleCount; i++ ) {
        if( HandleArray[i].Handle )
 -          ObDereferenceObject( (PVOID)HandleArray[i].Handle );
 +          ObDereferenceObject( (PVOID)(ULONG_PTR)HandleArray[i].Handle );
      }
  
      ExFreePool( HandleArray );
@@@ -520,7 -520,7 +520,7 @@@ static NTSTATUS NTAPI ConfigCallback(PV
            if(AddressSpace == 0)
                gControllerInfo[gNumberOfControllers].BaseAddress = MmMapIoSpace(TranslatedAddress, FDC_PORT_BYTES, MmNonCached);
            else
 -              gControllerInfo[gNumberOfControllers].BaseAddress = (PUCHAR)TranslatedAddress.u.LowPart;
 +              gControllerInfo[gNumberOfControllers].BaseAddress = (PUCHAR)(ULONG_PTR)TranslatedAddress.QuadPart;
          }
  
        else if(PartialDescriptor->Type == CmResourceTypeDma)
@@@ -686,16 -686,16 +686,16 @@@ static NTSTATUS NTAPI InitController(PC
        return STATUS_IO_DEVICE_ERROR;
      }
  
- /* Check if floppy drive exists */
  /* Check if floppy drive exists */
    if(HwSenseInterruptStatus(ControllerInfo) != STATUS_SUCCESS)
-       {
-         WARN_(FLOPPY, "Floppy drive not detected! Returning STATUS_IO_DEVICE_ERROR\n");
-         return STATUS_IO_DEVICE_ERROR;
-       }
+     {
+       WARN_(FLOPPY, "Floppy drive not detected!\n");
+       return STATUS_NO_SUCH_DEVICE;
+     }
  
    INFO_(FLOPPY, "InitController: resetting the controller after floppy detection\n");
  
-   /* Reset the controller */
+   /* Reset the controller again after drive detection */
    if(HwReset(ControllerInfo) != STATUS_SUCCESS)
      {
        WARN_(FLOPPY, "InitController: unable to reset controller\n");
@@@ -984,6 -984,9 +984,9 @@@ static BOOLEAN NTAPI AddControllers(PDR
  
          /* 3i: Now that we're done, set the Initialized flag so we know to free this in Unload */
          gControllerInfo[i].DriveInfo[j].Initialized = TRUE;
+         /* 3j: Clear the DO_DEVICE_INITIALIZING flag */
+       gControllerInfo[i].DriveInfo[j].DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
          }
      }
  
@@@ -3,12 -3,10 +3,11 @@@
  <module name="scsiport" type="kernelmodedriver" installbase="system32/drivers" installname="scsiport.sys">
        <bootstrap installbase="$(CDOUTPUT)" />
        <define name="_SCSIPORT_" />
 -      <importlibrary definition="scsiport.spec" />
 +      <importlibrary definition="scsiport.pspec" />
        <include base="scsiport">.</include>
        <library>ntoskrnl</library>
        <library>hal</library>
        <file>scsiport.c</file>
 +      <file>stubs.c</file>
        <file>scsiport.rc</file>
-       <file>scsiport.pspec</file>
  </module>
@@@ -9,10 -9,9 +9,9 @@@
                <define name="_NTHAL_" />
                <file>hal.c</file>
                <file>hal.rc</file>
-               <file>hal.pspec</file>
        </module>
 -    </if>
 -    <if property="ARCH" value="i386">
 +      </if>
 +      <if property="ARCH" value="i386">
        <module name="hal" type="kernelmodedll">
                <importlibrary definition="hal.pspec" />
                <include base="ntoskrnl">include</include>
@@@ -20,9 -19,8 +19,8 @@@
                <define name="_NTHAL_" />
                <file>hal.c</file>
                <file>hal.rc</file>
-               <file>hal.pspec</file>
        </module>
 -    </if>
 +      </if>
        <if property="ARCH" value="i386">
                <module ifnot="false" name="halupalias" type="alias" installbase="system32" installname="hal.dll" aliasof="halup">
                </module>
        <if property="ARCH" value="powerpc">
                <module name="halupalias" type="alias" installbase="system32" installname="hal.dll" aliasof="halppc_up"/>
        </if>
 +      <if property="ARCH" value="amd64">
 +      <module name="hal" type="kernelmodedll">
 +              <importlibrary definition="hal_amd64.def" />
 +              <include base="ntoskrnl">include</include>
 +              <library>ntoskrnl</library>
 +              <define name="_NTHAL_" />
 +              <file>hal.c</file>
 +              <file>hal.rc</file>
 +      </module>
 +      </if>
  </group>
@@@ -70,6 -70,12 +70,12 @@@ extern "C" 
  #endif
  #endif
  
+ #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
+ #define __WINE_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
+ #else
+ #define __WINE_ALLOC_SIZE(x)
+ #endif
  #ifndef FORCEINLINE
  #if (_MSC_VER >= 1200)
  #define FORCEINLINE __forceinline
@@@ -140,39 -146,41 +146,39 @@@ typedef WCHAR *PWCHAR,*LPWCH,*PWCH,*NWP
  typedef CONST WCHAR *LPCWCH,*PCWCH,*LPCWSTR,*PCWSTR;
  typedef CHAR *PCHAR,*LPCH,*PCH,*NPSTR,*LPSTR,*PSTR;
  typedef CONST CHAR *LPCCH,*PCCH,*PCSTR,*LPCSTR;
 +typedef PWSTR *PZPWSTR;
 +typedef CONST PWSTR *PCZPWSTR;
 +typedef WCHAR UNALIGNED *LPUWSTR,*PUWSTR;
 +typedef PCWSTR *PZPCWSTR;
 +typedef CONST WCHAR UNALIGNED *LPCUWSTR,*PCUWSTR;
 +typedef PSTR *PZPSTR;
 +typedef CONST PSTR *PCZPSTR;
 +typedef PCSTR *PZPCSTR;
 +
 +#ifdef UNICODE
  #ifndef _TCHAR_DEFINED
  #define _TCHAR_DEFINED
 -#ifdef UNICODE
 -/*
 - * NOTE: This tests UNICODE, which is different from the _UNICODE define
 - *       used to differentiate standard C runtime calls.
 - */
 -typedef WCHAR TCHAR;
 -typedef WCHAR _TCHAR;
 -#else
 -typedef CHAR TCHAR;
 -typedef CHAR _TCHAR;
 -#endif
 +  typedef WCHAR TCHAR,*PTCHAR;
 +  typedef WCHAR TBYTE ,*PTBYTE;
  #endif
 -typedef TCHAR TBYTE,*PTCH,*PTBYTE;
 -typedef TCHAR *LPTCH,*PTSTR,*LPTSTR,*LP,*PTCHAR;
 -typedef const TCHAR *LPCTSTR;
 -#ifdef UNICODE
 -/*
 - * __TEXT is a private macro whose specific use is to force the expansion of a
 - * macro passed as an argument to the macro TEXT.  DO NOT use this
 - * macro within your programs.  It's name and function could change without
 - * notice.
 - */
 -#define __TEXT(q) L##q
 +  typedef LPWSTR LPTCH,PTCH,PTSTR,LPTSTR,LP,PTCHAR;
 +  typedef LPCWSTR PCTSTR,LPCTSTR;
 +  typedef LPUWSTR PUTSTR,LPUTSTR;
 +  typedef LPCUWSTR PCUTSTR,LPCUTSTR;
 +#define __TEXT(quote) L##quote
  #else
 -#define __TEXT(q) q
 +#ifndef _TCHAR_DEFINED
 +#define _TCHAR_DEFINED
 +  typedef char TCHAR,*PTCHAR;
 +  typedef unsigned char TBYTE ,*PTBYTE;
  #endif
 -/*
 - * UNICODE a constant string when UNICODE is defined, else returns the string
 - * unmodified.
 - * The corresponding macros  _TEXT() and _T() for mapping _UNICODE strings
 - * passed to C runtime functions are defined in mingw/tchar.h
 - */
 -#define TEXT(q) __TEXT(q)
 +  typedef LPSTR LPTCH,PTCH,PTSTR,LPTSTR,PUTSTR,LPUTSTR,PTCHAR;
 +  typedef LPCSTR PCTSTR,LPCTSTR,PCUTSTR,LPCUTSTR;
 +#define __TEXT(quote) quote
 +#endif
 +
 +#define TEXT(quote) __TEXT(quote)
 +
  typedef SHORT *PSHORT;
  typedef LONG *PLONG;
  #ifdef STRICT
@@@ -1530,9 -1538,6 +1536,9 @@@ typedef enu
  #define IMAGE_REL_BASED_HIGHLOW 3
  #define IMAGE_REL_BASED_HIGHADJ 4
  #define IMAGE_REL_BASED_MIPS_JMPADDR 5
 +#define IMAGE_REL_BASED_MIPS_JMPADDR16 9
 +#define IMAGE_REL_BASED_IA64_IMM64 9
 +#define IMAGE_REL_BASED_DIR64 10
  #define IMAGE_ARCHIVE_START_SIZE 8
  #define IMAGE_ARCHIVE_START "!<arch>\n"
  #define IMAGE_ARCHIVE_END "`\n"
@@@ -4654,11 -4659,7 +4660,11 @@@ static __inline__ PVOID GetCurrentFiber
  #elif defined (_M_AMD64)
  FORCEINLINE PVOID GetCurrentFiber(VOID)
  {
 +  #ifdef NONAMELESSUNION
 +    return (PVOID)__readgsqword(FIELD_OFFSET(NT_TIB, DUMMYUNIONNAME.FiberData));
 +  #else
      return (PVOID)__readgsqword(FIELD_OFFSET(NT_TIB, FiberData));
 +  #endif
  }
  #elif defined (_M_ARM)
      PVOID WINAPI GetCurrentFiber(VOID);
@@@ -4875,7 -4876,7 +4881,7 @@@ MemoryBarrier(VOID
  }
  #endif
  #elif defined (_M_AMD64)
 -#define MemoryBarrier()
 +#define MemoryBarrier __faststorefence
  #elif defined(_M_PPC)
  #define MemoryBarrier()
  #elif defined(_M_ARM)
@@@ -615,8 -615,8 +615,8 @@@ extern "C" 
  #define RT_RCDATA MAKEINTRESOURCE(10)
  #define RT_MESSAGETABLE MAKEINTRESOURCE(11)
  #define DIFFERENCE 11
 -#define RT_GROUP_CURSOR MAKEINTRESOURCE((DWORD)RT_CURSOR+DIFFERENCE)
 -#define RT_GROUP_ICON MAKEINTRESOURCE((DWORD)RT_ICON+DIFFERENCE)
 +#define RT_GROUP_CURSOR MAKEINTRESOURCE((ULONG_PTR)RT_CURSOR+DIFFERENCE)
 +#define RT_GROUP_ICON MAKEINTRESOURCE((ULONG_PTR)RT_ICON+DIFFERENCE)
  #define RT_VERSION MAKEINTRESOURCE(16)
  #define RT_DLGINCLUDE MAKEINTRESOURCE(17)
  #define RT_PLUGPLAY MAKEINTRESOURCE(19)
  #define DCX_EXCLUDERGN 64
  #define DCX_INTERSECTRGN 128
  #define DCX_VALIDATE 0x200000
++#define DCX_USESTYLE 0x00010000
  #define DCX_EXCLUDEUPDATE   0x100
  #define GMDI_GOINTOPOPUPS 2
  #define GMDI_USEDISABLED 1
  #define STATE_SYSTEM_VALID 0x1fffffff
  
  #ifndef RC_INVOKED
 -typedef BOOL(CALLBACK *DLGPROC)(HWND,UINT,WPARAM,LPARAM);
 -typedef VOID(CALLBACK *TIMERPROC)(HWND,UINT,UINT,DWORD);
 +typedef INT_PTR(CALLBACK *DLGPROC)(HWND,UINT,WPARAM,LPARAM);
 +typedef VOID(CALLBACK *TIMERPROC)(HWND,UINT,UINT_PTR,DWORD);
  typedef BOOL(CALLBACK *GRAYSTRINGPROC)(HDC,LPARAM,int);
  typedef LRESULT(CALLBACK *HOOKPROC)(int,WPARAM,LPARAM);
  typedef BOOL(CALLBACK *PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
@@@ -2804,13 -2804,13 +2805,13 @@@ typedef struct tagCOMPAREITEMSTRUCT 
        UINT    CtlID;
        HWND    hwndItem;
        UINT    itemID1;
 -      DWORD   itemData1;
 +      ULONG_PTR       itemData1;
        UINT    itemID2;
 -      DWORD   itemData2;
 +      ULONG_PTR       itemData2;
        DWORD   dwLocaleId;
  } COMPAREITEMSTRUCT,*LPCOMPAREITEMSTRUCT;
  typedef struct tagCOPYDATASTRUCT {
 -      DWORD dwData;
 +      ULONG_PTR dwData;
        DWORD cbData;
        PVOID lpData;
  } COPYDATASTRUCT,*PCOPYDATASTRUCT;
@@@ -2848,7 -2848,7 +2849,7 @@@ typedef struct tagDELETEITEMSTRUCT 
        UINT CtlID;
        UINT itemID;
        HWND hwndItem;
 -      UINT itemData;
 +      ULONG_PTR itemData;
  } DELETEITEMSTRUCT,*PDELETEITEMSTRUCT,*LPDELETEITEMSTRUCT;
  #pragma pack(push,2)
  typedef struct {
@@@ -2887,7 -2887,7 +2888,7 @@@ typedef struct tagDRAWITEMSTRUCT 
        HWND hwndItem;
        HDC     hDC;
        RECT rcItem;
 -      DWORD itemData;
 +      ULONG_PTR itemData;
  } DRAWITEMSTRUCT,*LPDRAWITEMSTRUCT,*PDRAWITEMSTRUCT;
  typedef struct {
        UINT cbSize;
@@@ -2921,7 -2921,7 +2922,7 @@@ typedef struct _ICONINFO 
  } ICONINFO,*PICONINFO;
  typedef struct tagNMHDR {
        HWND hwndFrom;
 -      UINT idFrom;
 +      UINT_PTR idFrom;
        UINT code;
  } NMHDR,*LPNMHDR;
  typedef struct _WNDCLASSA {
@@@ -2985,7 -2985,7 +2986,7 @@@ typedef struct tagMENUITEMINFOA 
        HMENU hSubMenu;
        HBITMAP hbmpChecked;
        HBITMAP hbmpUnchecked;
 -      DWORD dwItemData;
 +      ULONG_PTR dwItemData;
        LPSTR dwTypeData;
        UINT cch;
  #if (_WIN32_WINNT >= 0x0500)
@@@ -3002,7 -3002,7 +3003,7 @@@ typedef struct tagMENUITEMINFOW 
        HMENU hSubMenu;
        HBITMAP hbmpChecked;
        HBITMAP hbmpUnchecked;
 -      DWORD dwItemData;
 +      ULONG_PTR dwItemData;
        LPWSTR dwTypeData;
        UINT cch;
  #if (_WIN32_WINNT >= 0x0500)
@@@ -3043,7 -3043,7 +3044,7 @@@ typedef struct tagHELPINFO 
        int iContextType;
        int iCtrlId;
        HANDLE hItemHandle;
 -      DWORD dwContextId;
 +      DWORD_PTR dwContextId;
        POINT MousePos;
  } HELPINFO,*LPHELPINFO;
  typedef void(CALLBACK *MSGBOXCALLBACK)(LPHELPINFO);
@@@ -3055,7 -3055,7 +3056,7 @@@ typedef struct 
        LPCSTR lpszCaption;
        DWORD dwStyle;
        LPCSTR lpszIcon;
 -      DWORD dwContextHelpId;
 +      DWORD_PTR dwContextHelpId;
        MSGBOXCALLBACK lpfnMsgBoxCallback;
        DWORD dwLanguageId;
  } MSGBOXPARAMSA,*PMSGBOXPARAMSA,*LPMSGBOXPARAMSA;
@@@ -3067,7 -3067,7 +3068,7 @@@ typedef struct 
        LPCWSTR lpszCaption;
        DWORD dwStyle;
        LPCWSTR lpszIcon;
 -      DWORD dwContextHelpId;
 +      DWORD_PTR dwContextHelpId;
        MSGBOXCALLBACK lpfnMsgBoxCallback;
        DWORD dwLanguageId;
  } MSGBOXPARAMSW,*PMSGBOXPARAMSW,*LPMSGBOXPARAMSW;
@@@ -3101,14 -3101,14 +3102,14 @@@ typedef struct tagICONMETRICSA 
        int iVertSpacing;
        int iTitleWrap;
        LOGFONTA lfFont;
--} ICONMETRICSA,*LPICONMETRICSA;
++} ICONMETRICSA, *PICONMETRICSA, *LPICONMETRICSA;
  typedef struct tagICONMETRICSW {
        UINT cbSize;
        int iHorzSpacing;
        int iVertSpacing;
        int iTitleWrap;
        LOGFONTW lfFont;
--} ICONMETRICSW,*LPICONMETRICSW;
++} ICONMETRICSW, *PICONMETRICSW, *LPICONMETRICSW;
  #endif /*  NOGDI */
  typedef struct tagMINIMIZEDMETRICS {
        UINT cbSize;
@@@ -3220,7 -3220,7 +3221,7 @@@ typedef struct tagMOUSEHOOKSTRUCT 
        POINT pt;
        HWND hwnd;
        UINT wHitTestCode;
 -      DWORD dwExtraInfo;
 +      ULONG_PTR dwExtraInfo;
  } MOUSEHOOKSTRUCT,*LPMOUSEHOOKSTRUCT,*PMOUSEHOOKSTRUCT;
  #if ( _WIN32_WINNT >= 0x0500 )
  #ifdef __cplusplus
@@@ -3306,13 -3306,13 +3307,13 @@@ typedef struct tagMEASUREITEMSTRUCT 
        UINT itemID;
        UINT itemWidth;
        UINT itemHeight;
 -      DWORD itemData;
 +      ULONG_PTR itemData;
  } MEASUREITEMSTRUCT,*PMEASUREITEMSTRUCT,*LPMEASUREITEMSTRUCT;
  typedef struct tagDROPSTRUCT {
        HWND hwndSource;
        HWND hwndSink;
        DWORD wFmt;
 -      DWORD dwData;
 +      ULONG_PTR dwData;
        POINT ptDrop;
        DWORD dwControlData;
  } DROPSTRUCT,*PDROPSTRUCT,*LPDROPSTRUCT;
@@@ -3451,7 -3451,7 +3452,7 @@@ typedef struct tagKBDLLHOOKSTRUCT 
        DWORD scanCode;
        DWORD flags;
        DWORD time;
 -      DWORD dwExtraInfo;
 +      ULONG_PTR dwExtraInfo;
  } KBDLLHOOKSTRUCT,*LPKBDLLHOOKSTRUCT,*PKBDLLHOOKSTRUCT;
  typedef struct tagMSLLHOOKSTRUCT
  {
@@@ -3735,12 -3735,12 +3736,12 @@@ BOOL WINAPI DestroyWindow(HWND)
  #define DialogBoxW(i,t,p,f) DialogBoxParamW(i,t,p,f,0)
  #define DialogBoxIndirectA(i,t,p,f) DialogBoxIndirectParamA(i,t,p,f,0)
  #define DialogBoxIndirectW(i,t,p,f) DialogBoxIndirectParamW(i,t,p,f,0)
 -int WINAPI DialogBoxIndirectParamA(HINSTANCE,LPCDLGTEMPLATE,HWND,DLGPROC,LPARAM);
 -int WINAPI DialogBoxIndirectParamW(HINSTANCE,LPCDLGTEMPLATE,HWND,DLGPROC,LPARAM);
 -int WINAPI DialogBoxParamA(HINSTANCE,LPCSTR,HWND,DLGPROC,LPARAM);
 -int WINAPI DialogBoxParamW(HINSTANCE,LPCWSTR,HWND,DLGPROC,LPARAM);
 -LONG WINAPI DispatchMessageA(const MSG*);
 -LONG WINAPI DispatchMessageW(const MSG*);
 +INT_PTR WINAPI DialogBoxIndirectParamA(HINSTANCE,LPCDLGTEMPLATE,HWND,DLGPROC,LPARAM);
 +INT_PTR WINAPI DialogBoxIndirectParamW(HINSTANCE,LPCDLGTEMPLATE,HWND,DLGPROC,LPARAM);
 +INT_PTR WINAPI DialogBoxParamA(HINSTANCE,LPCSTR,HWND,DLGPROC,LPARAM);
 +INT_PTR WINAPI DialogBoxParamW(HINSTANCE,LPCWSTR,HWND,DLGPROC,LPARAM);
 +LRESULT WINAPI DispatchMessageA(const MSG*);
 +LRESULT WINAPI DispatchMessageW(const MSG*);
  int WINAPI DlgDirListA(HWND,LPSTR,int,int,UINT);
  int WINAPI DlgDirListW(HWND,LPWSTR,int,int,UINT);
  int WINAPI DlgDirListComboBoxA(HWND,LPSTR,int,int,UINT);
@@@ -3750,7 -3750,7 +3751,7 @@@ BOOL WINAPI DlgDirSelectComboBoxExW(HWN
  BOOL WINAPI DlgDirSelectExA(HWND,LPSTR,int,int);
  BOOL WINAPI DlgDirSelectExW(HWND,LPWSTR,int,int);
  BOOL WINAPI DragDetect(HWND,POINT);
 -DWORD WINAPI DragObject(HWND,HWND,UINT,DWORD,HCURSOR);
 +DWORD WINAPI DragObject(HWND,HWND,UINT,ULONG_PTR,HCURSOR);
  BOOL WINAPI DrawAnimatedRects(HWND,int,LPCRECT,LPCRECT);
  BOOL WINAPI DrawCaption(HWND,HDC,LPCRECT,UINT);
  BOOL WINAPI DrawCaptionTempA(HWND,HDC,const RECT*,HFONT,HICON,LPCSTR,UINT);
@@@ -3773,7 -3773,7 +3774,7 @@@ BOOL WINAPI EnableMenuItem(HMENU,UINT,U
  BOOL WINAPI EnableScrollBar(HWND,UINT,UINT);
  BOOL WINAPI EnableWindow(HWND,BOOL);
  BOOL WINAPI EndDeferWindowPos(HDWP);
 -BOOL WINAPI EndDialog(HWND,int);
 +BOOL WINAPI EndDialog(HWND,INT_PTR);
  BOOL WINAPI EndMenu(void);
  BOOL WINAPI EndPaint(HWND,const PAINTSTRUCT*);
  #if (_WIN32_WINNT >= 0x0500)
@@@ -3830,8 -3830,8 +3831,8 @@@ BOOL WINAPI GetClassInfoExW(HINSTANCE,L
  DWORD WINAPI GetClassLongA(HWND,int);
  DWORD WINAPI GetClassLongW(HWND,int);
  #ifdef _WIN64
 -LONG_PTR WINAPI GetClassLongPtrA(HWND,int);
 -LONG_PTR WINAPI GetClassLongPtrW(HWND,int);
 +ULONG_PTR WINAPI GetClassLongPtrA(HWND,int);
 +ULONG_PTR WINAPI GetClassLongPtrW(HWND,int);
  #else
  #define GetClassLongPtrA GetClassLongA
  #define GetClassLongPtrW GetClassLongW
@@@ -3892,7 -3892,7 +3893,7 @@@ int WINAPI GetMenuStringA(HMENU,UINT,LP
  int WINAPI GetMenuStringW(HMENU,UINT,LPWSTR,int,UINT);
  BOOL WINAPI GetMessageA(LPMSG,HWND,UINT,UINT);
  BOOL WINAPI GetMessageW(LPMSG,HWND,UINT,UINT);
 -LONG WINAPI GetMessageExtraInfo(void);
 +LPARAM WINAPI GetMessageExtraInfo(void);
  DWORD WINAPI GetMessagePos(void);
  LONG WINAPI GetMessageTime(void);
  #if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0490)
@@@ -3988,8 -3988,8 +3989,8 @@@ BOOL WINAPI InSendMessage(void)
  #if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
  DWORD WINAPI InSendMessageEx(LPVOID);
  #endif
 -BOOL WINAPI InsertMenuA(HMENU,UINT,UINT,UINT,LPCSTR);
 -BOOL WINAPI InsertMenuW(HMENU,UINT,UINT,UINT,LPCWSTR);
 +BOOL WINAPI InsertMenuA(HMENU,UINT,UINT,UINT_PTR,LPCSTR);
 +BOOL WINAPI InsertMenuW(HMENU,UINT,UINT,UINT_PTR,LPCWSTR);
  BOOL WINAPI InsertMenuItemA(HMENU,UINT,BOOL,LPCMENUITEMINFOA);
  BOOL WINAPI InsertMenuItemW(HMENU,UINT,BOOL,LPCMENUITEMINFOW);
  INT WINAPI InternalGetWindowText(HWND,LPWSTR,INT);
@@@ -4027,8 -4027,8 +4028,8 @@@ BOOL WINAPI IsWindowVisible(HWND)
  BOOL WINAPI IsWinEventHookInstalled(DWORD);
  #endif
  BOOL WINAPI IsZoomed(HWND);
 -VOID WINAPI keybd_event(BYTE,BYTE,DWORD,DWORD);
 -BOOL WINAPI KillTimer(HWND,UINT);
 +VOID WINAPI keybd_event(BYTE,BYTE,DWORD,ULONG_PTR);
 +BOOL WINAPI KillTimer(HWND,UINT_PTR);
  HACCEL WINAPI LoadAcceleratorsA(HINSTANCE,LPCSTR);
  HACCEL WINAPI LoadAcceleratorsW(HINSTANCE,LPCWSTR);
  HBITMAP WINAPI LoadBitmapA(HINSTANCE,LPCSTR);
@@@ -4069,8 -4069,8 +4070,8 @@@ int WINAPI MessageBoxExA(HWND,LPCSTR,LP
  int WINAPI MessageBoxExW(HWND,LPCWSTR,LPCWSTR,UINT,WORD);
  int WINAPI MessageBoxIndirectA(CONST MSGBOXPARAMSA*);
  int WINAPI MessageBoxIndirectW(CONST MSGBOXPARAMSW*);
 -BOOL WINAPI ModifyMenuA(HMENU,UINT,UINT,UINT,LPCSTR);
 -BOOL WINAPI ModifyMenuW(HMENU,UINT,UINT,UINT,LPCWSTR);
 +BOOL WINAPI ModifyMenuA(HMENU,UINT,UINT,UINT_PTR,LPCSTR);
 +BOOL WINAPI ModifyMenuW(HMENU,UINT,UINT,UINT_PTR,LPCWSTR);
  HMONITOR WINAPI MonitorFromPoint(POINT,DWORD);
  HMONITOR WINAPI MonitorFromRect(LPCRECT,DWORD);
  HMONITOR WINAPI MonitorFromWindow(HWND,DWORD);
@@@ -4140,16 -4140,16 +4141,16 @@@ BOOL WINAPI ScreenToClient(HWND,LPPOINT
  BOOL WINAPI ScrollDC(HDC,int,int,LPCRECT,LPCRECT,HRGN,LPRECT);
  BOOL WINAPI ScrollWindow(HWND,int,int,LPCRECT,LPCRECT);
  int WINAPI ScrollWindowEx(HWND,int,int,LPCRECT,LPCRECT,HRGN,LPRECT,UINT);
 -LONG WINAPI SendDlgItemMessageA(HWND,int,UINT,WPARAM,LPARAM);
 -LONG WINAPI SendDlgItemMessageW(HWND,int,UINT,WPARAM,LPARAM);
 +LRESULT WINAPI SendDlgItemMessageA(HWND,int,UINT,WPARAM,LPARAM);
 +LRESULT WINAPI SendDlgItemMessageW(HWND,int,UINT,WPARAM,LPARAM);
  #if (_WIN32_WINNT >= 0x0403)
  UINT WINAPI SendInput(UINT,LPINPUT,int);
  #endif
  LRESULT WINAPI SendMessageA(HWND,UINT,WPARAM,LPARAM);
 -BOOL WINAPI SendMessageCallbackA(HWND,UINT,WPARAM,LPARAM,SENDASYNCPROC,DWORD);
 -BOOL WINAPI SendMessageCallbackW(HWND,UINT,WPARAM,LPARAM,SENDASYNCPROC,DWORD);
 -LRESULT WINAPI SendMessageTimeoutA(HWND,UINT,WPARAM,LPARAM,UINT,UINT,PDWORD);
 -LRESULT WINAPI SendMessageTimeoutW(HWND,UINT,WPARAM,LPARAM,UINT,UINT,PDWORD);
 +BOOL WINAPI SendMessageCallbackA(HWND,UINT,WPARAM,LPARAM,SENDASYNCPROC,ULONG_PTR);
 +BOOL WINAPI SendMessageCallbackW(HWND,UINT,WPARAM,LPARAM,SENDASYNCPROC,ULONG_PTR);
 +LRESULT WINAPI SendMessageTimeoutA(HWND,UINT,WPARAM,LPARAM,UINT,UINT,PDWORD_PTR);
 +LRESULT WINAPI SendMessageTimeoutW(HWND,UINT,WPARAM,LPARAM,UINT,UINT,PDWORD_PTR);
  LRESULT WINAPI SendMessageW(HWND,UINT,WPARAM,LPARAM);
  BOOL WINAPI SendNotifyMessageA(HWND,UINT,WPARAM,LPARAM);
  BOOL WINAPI SendNotifyMessageW(HWND,UINT,WPARAM,LPARAM);
@@@ -4205,7 -4205,7 +4206,7 @@@ DWORD WINAPI SetSysColorsTemp(const COL
  #define SetSysModalWindow(h) (NULL)
  BOOL WINAPI SetSystemCursor(HCURSOR,DWORD);
  BOOL WINAPI SetThreadDesktop(HDESK);
 -UINT WINAPI SetTimer(HWND,UINT,UINT,TIMERPROC);
 +UINT_PTR WINAPI SetTimer(HWND,UINT_PTR,UINT,TIMERPROC);
  BOOL WINAPI SetUserObjectInformationA(HANDLE,int,PVOID,DWORD);
  BOOL WINAPI SetUserObjectInformationW(HANDLE,int,PVOID,DWORD);
  BOOL WINAPI SetUserObjectSecurity(HANDLE,PSECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
@@@ -4284,8 -4284,8 +4285,8 @@@ BOOL WINAPI WaitMessage(void)
  HWND WINAPI WindowFromDC(HDC hDC);
  HWND WINAPI WindowFromPoint(POINT);
  UINT WINAPI WinExec(LPCSTR,UINT);
 -BOOL WINAPI WinHelpA(HWND,LPCSTR,UINT,DWORD);
 -BOOL WINAPI WinHelpW(HWND,LPCWSTR,UINT,DWORD);
 +BOOL WINAPI WinHelpA(HWND,LPCSTR,UINT,ULONG_PTR);
 +BOOL WINAPI WinHelpW(HWND,LPCWSTR,UINT,ULONG_PTR);
  int WINAPIV wsprintfA(LPSTR,LPCSTR,...);
  int WINAPIV wsprintfW(LPWSTR,LPCWSTR,...);
  int WINAPI wvsprintfA(LPSTR,LPCSTR,va_list arglist);
@@@ -4475,8 -4475,8 +4476,8 @@@ typedef MONITORINFOEXW MONITORINFOEX, *
  #define WinHelp WinHelpW
  #define wsprintf wsprintfW
  #define wvsprintf wvsprintfW
--#ifndef NOGDI
--typedef ICONMETRICSW ICONMETRICS,*LPICONMETRICS;
++#if defined(_WINGDI_) && !defined(NOGDI)
++typedef ICONMETRICSW ICONMETRICS;
  typedef NONCLIENTMETRICSW NONCLIENTMETRICS,*LPNONCLIENTMETRICS;
  #define ChangeDisplaySettings ChangeDisplaySettingsW
  #define ChangeDisplaySettingsEx ChangeDisplaySettingsExW
@@@ -4644,7 -4644,7 +4645,7 @@@ typedef MONITORINFOEXA MONITORINFOEX, *
  #define wsprintf wsprintfA
  #define wvsprintf wvsprintfA
  #if defined(_WINGDI_) && !defined(NOGDI)
--typedef ICONMETRICSA ICONMETRICS,*LPICONMETRICS;
++typedef ICONMETRICSA ICONMETRICS;
  typedef NONCLIENTMETRICSA NONCLIENTMETRICS,*LPNONCLIENTMETRICS;
  #define ChangeDisplaySettings ChangeDisplaySettingsA
  #define ChangeDisplaySettingsEx ChangeDisplaySettingsExA
@@@ -917,18 -917,18 +917,18 @@@ NtUserCallNextHookEx
    LPARAM lParam,
    BOOL Ansi);
  
 -DWORD
 +DWORD_PTR
  NTAPI
  NtUserCallNoParam(
    DWORD Routine);
  
 -DWORD
 +DWORD_PTR
  NTAPI
  NtUserCallOneParam(
    DWORD Param,
    DWORD Routine);
  
 -DWORD
 +DWORD_PTR
  NTAPI
  NtUserCallTwoParam(
    DWORD Param1,
@@@ -1673,7 -1673,7 +1673,7 @@@ enum ThreadStateRoutine
      THREADSTATE_TASKMANWINDOW
  };
  
 -DWORD
 +DWORD_PTR
  NTAPI
  NtUserGetThreadState(
    DWORD Routine);
@@@ -1724,12 -1724,12 +1724,12 @@@ NtUserImpersonateDdeClientWindow
    HWND hWndClient,
    HWND hWndServer);
  
- DWORD
+ NTSTATUS
  NTAPI
  NtUserInitialize(
-     DWORD dwUnknown1,
-     DWORD dwUnknown2,
-     DWORD dwUnknown3);
+   DWORD   dwWinVersion,
+   HANDLE  hPowerRequestEvent,
+   HANDLE  hMediaRequestEvent);
  
  NTSTATUS
  NTAPI
@@@ -1805,10 -1805,10 +1805,10 @@@ NTAP
  NtUserLockWindowStation(
    HWINSTA hWindowStation);
  
- DWORD
- NTAPI
+ BOOL
+ STDCALL
  NtUserLockWindowUpdate(
-   DWORD Unknown0);
+   HWND hWnd);
  
  BOOL
  NTAPI
@@@ -1,10 -1,11 +1,10 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
  <module name="bzip2" type="kernelmodedll" installbase="system32/drivers" installname="bzip2.dll">
--      <importlibrary definition="unbzip2.def" />
++      <importlibrary definition="unbzip2.spec" />
        <define name="BZ_NO_STDIO" />
        <define name="BZ_DECOMPRESS_ONLY" />
        <library>ntoskrnl</library>
 -      <library>hal</library>
        <file>bzlib.c</file>
        <file>randtable.c</file>
        <file>crctable.c</file>
diff --combined reactos/lib/3rdparty/bzip2/unbzip2.def
index 181a120,181a120..0000000
deleted file mode 100644,100644
+++ /dev/null
@@@ -1,4 -1,4 +1,0 @@@
--LIBRARY unbzip2.dll
--
--EXPORTS
--BZ2_bzBuffToBuffDecompress@24
index 0000000,0000000..68d5d87
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++ @ stdcall BZ2_bzBuffToBuffDecompress(str ptr str long long long)
@@@ -1,12 -1,13 +1,12 @@@
  <?xml version="1.0"?>
  <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
- <module name="libxml2" type="staticlibrary" allowwarnings="true">
+ <module name="libxml2" type="staticlibrary" allowwarnings="true" crt="dll">
        <define name="HAVE_CONFIG_H" />
        <define name="WIN32" />
        <define name="_WINDOWS" />
        <define name="_MBCS" />
        <define name="HAVE_WIN32_THREADS" />
        <define name="_REENTRANT" />
 -      <define name="_WINSOCKAPI_" />
        <define name="LIBXML_STATIC" />
        <include base="libxml2">include</include>
        <include base="libxml2">.</include>
index 6b56ff3,0000000..79eaf40
mode 100644,000000..100644
--- /dev/null
@@@ -1,472 -1,0 +1,472 @@@
-   __security_init_cookie ();
 +#undef CRTDLL
 +#define _DLL
 +
 +#define SPECIAL_CRTEXE
 +
 +#include "oscalls.h"
 +#include "internal.h"
 +#include <process.h>
 +#include <signal.h>
 +#include <math.h>
 +#include <stdlib.h>
 +#include <tchar.h>
 +#include <locale.h>
 +
 +#ifndef __winitenv
 +extern wchar_t ***_imp____winitenv;
 +#define __winitenv (*_imp____winitenv)
 +#endif
 +
 +#ifndef __initenv
 +extern char ***_imp____initenv;
 +#define __initenv (*_imp____initenv)
 +#endif
 +
 +/* Hack, for bug in ld.  Will be removed soon.  */
 +#define __ImageBase _image_base__
 +/* This symbol is defined by ld.  */
 +extern IMAGE_DOS_HEADER __ImageBase;
 +
 +extern void _fpreset (void);
 +#define SPACECHAR _T(' ')
 +#define DQUOTECHAR _T('\"')
 +
 +_CRTIMP void __setusermatherr(int (__cdecl *)(struct _exception *));
 +
 +extern int *_imp___fmode;
 +extern int *_imp___commode;
 +
 +#undef _fmode
 +extern int _fmode;
 +extern int *_imp___commode;
 +#define _commode (*_imp___commode)
 +extern int _dowildcard;
 +
 +extern int __defaultmatherr;
 +extern _CRTIMP void __cdecl _initterm(_PVFV *, _PVFV *);
 +
 +static int __cdecl check_managed_app (void);
 +
 +extern _CRTALLOC(".CRT$XIA") _PIFV __xi_a[];
 +extern _CRTALLOC(".CRT$XIZ") _PIFV __xi_z[];
 +extern _CRTALLOC(".CRT$XCA") _PVFV __xc_a[];
 +extern _CRTALLOC(".CRT$XCZ") _PVFV __xc_z[];
 +
 +extern const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback;
 +
 +extern _PVFV *__onexitbegin;
 +extern _PVFV *__onexitend;
 +
 +extern int mingw_app_type;
 +
 +static int argc;
 +#ifdef WPRFLAG
 +static wchar_t **argv;
 +static wchar_t **envp;
 +#else
 +static char **argv;
 +static char **envp;
 +#endif
 +
 +static int argret=0;
 +static int mainret=0;
 +static int managedapp=0;
 +static int has_cctor = 0;
 +static _startupinfo startinfo;
 +
 +extern void _pei386_runtime_relocator (void);
 +static CALLBACK long _gnu_exception_handler (EXCEPTION_POINTERS * exception_data);
 +//static LONG __mingw_vex(EXCEPTION_POINTERS * exception_data);
 +#ifdef WPRFLAG
 +static void duplicate_ppstrings (int ac, wchar_t ***av);
 +#else
 +static void duplicate_ppstrings (int ac, char ***av);
 +#endif
 +
 +static int __cdecl pre_c_init (void);
 +static void __cdecl pre_cpp_init (void);
 +
 +_CRTALLOC(".CRT$XIAA") _PIFV mingw_pcinit = pre_c_init;
 +_CRTALLOC(".CRT$XCAA") _PVFV mingw_pcppinit = pre_cpp_init;
 +
 +static int __cdecl
 +pre_c_init (void)
 +{
 +  managedapp = check_managed_app ();
 +  if (mingw_app_type)
 +    __set_app_type(_GUI_APP);
 +  else
 +    __set_app_type (_CONSOLE_APP);
 +  __onexitbegin = __onexitend = (_PVFV *) _encode_pointer ((_PVFV *)(-1));
 +
 +  *_imp___fmode = _fmode;
 +  *_imp___commode = _commode;
 +
 +#ifndef WPRFLAG
 +  _dowildcard = 1;
 +#endif
 +
 +  if (! __defaultmatherr)
 +    __setusermatherr (_matherr);
 +
 +  if (__globallocalestatus == -1)
 +    {
 +    }
 +  return 0;
 +}
 +
 +static void __cdecl
 +pre_cpp_init (void)
 +{
 +  startinfo.newmode = _newmode;
 +#ifdef WPRFLAG
 +  argret = __wgetmainargs(&argc,&argv,&envp,_dowildcard,&startinfo);
 +#else
 +  argret = __getmainargs(&argc,&argv,&envp,_dowildcard,&startinfo);
 +#endif
 +
 +}
 +
 +static int __mingw_CRTStartup (void);
 +
 +#ifdef WPRFLAG
 +int wWinMainCRTStartup (void)
 +#else
 +int WinMainCRTStartup (void)
 +#endif
 +{
 +  mingw_app_type = 1;
-   __security_init_cookie ();
++  //__security_init_cookie ();
 +  return __mingw_CRTStartup ();
 +}
 +
 +#ifdef WPRFLAG
 +int wmainCRTStartup (void)
 +#else
 +int mainCRTStartup (void)
 +#endif
 +{
 +  mingw_app_type = 0;
++  //__security_init_cookie ();
 +  return __mingw_CRTStartup ();
 +}
 +
 +
 +__declspec(noinline) int
 +__mingw_CRTStartup (void)
 +{
 +  _TCHAR *lpszCommandLine = NULL;
 +  STARTUPINFO StartupInfo;
 +  BOOL inDoubleQuote = FALSE;
 +  memset (&StartupInfo, 0, sizeof (STARTUPINFO));
 +  int nested = FALSE;
 +
 +  if (mingw_app_type)
 +    GetStartupInfo (&StartupInfo);
 +  {
 +#if 0 //not ready for this yet
 +    void *lock_free = NULL;
 +    void *fiberid = ((PNT_TIB)NtCurrentTeb())->StackBase;
 +    while((lock_free = InterlockedCompareExchangePointer ((volatile PVOID *) &__native_startup_lock,
 +                                                        fiberid, 0)) != 0)
 +      {
 +      if (lock_free == fiberid)
 +        {
 +          nested = TRUE;
 +          break;
 +        }
 +      Sleep(1000);
 +      }
 +#endif
 +    if (__native_startup_state == __initializing)
 +      {
 +      _amsg_exit (31);
 +      }
 +    else if (__native_startup_state == __uninitialized)
 +      {
 +      __native_startup_state = __initializing;
 +      _initterm ((_PVFV *)(void *)__xi_a, (_PVFV *)(void *) __xi_z);
 +      }
 +    else
 +      has_cctor = 1;
 +
 +    if (__native_startup_state == __initializing)
 +      {
 +      _initterm (__xc_a, __xc_z);
 +      __native_startup_state = __initialized;
 +      }
 +    _ASSERTE(__native_startup_state == __initialized);
 +    if (! nested)
 +      (VOID)InterlockedExchangePointer ((volatile PVOID *) &__native_startup_lock, 0);
 +    
 +    if (__dyn_tls_init_callback != NULL && _IsNonwritableInCurrentImage ((PBYTE) &__dyn_tls_init_callback))
 +      __dyn_tls_init_callback (NULL, DLL_THREAD_ATTACH, NULL);
 +    
 +#if defined(__i386__) || defined(__x86_64__)
 +    _pei386_runtime_relocator ();
 +#endif
 +    
 +    #if defined(__x86_64__)
 +    __asm__ __volatile__ (
 +      "xorq %rax,%rax\n\t"
 +      "decq %rax\n\t"
 +      "movq %rax,%gs:0" "\n");
 +    #elif defined(__i386__)
 +    __asm__ __volatile__ (
 +      "xorl %eax,%eax\n\t"
 +      "decl %eax\n\t"
 +      "movl %eax,%fs:0" "\n");
 +    #endif
 +    //AddVectoredExceptionHandler (0, (PVECTORED_EXCEPTION_HANDLER)__mingw_vex);
 +    SetUnhandledExceptionFilter (_gnu_exception_handler);
 +
 +    if (mingw_app_type)
 +      {
 +#ifdef WPRFLAG
 +    if (_wcmdln == NULL)
 +      return 255;
 +    lpszCommandLine = (_TCHAR *) _wcmdln;
 +#else
 +    lpszCommandLine = (char *) _acmdln;
 +#endif
 +    while (*lpszCommandLine > SPACECHAR || (*lpszCommandLine && inDoubleQuote))
 +      {
 +      if (*lpszCommandLine == DQUOTECHAR)
 +        inDoubleQuote = TRUE;
 +#ifdef _MBCS
 +      if (_ismbblead (*lpszCommandLine))
 +        {
 +          if (lpszCommandLine)
 +            lpszCommandLine++;
 +        }
 +#endif
 +      ++lpszCommandLine;
 +      }
 +    while (*lpszCommandLine && (*lpszCommandLine <= SPACECHAR))
 +      lpszCommandLine++;
 +
 +#ifdef WPRFLAG
 +    mainret = wmain (
 +      (int) (StartupInfo.dwFlags & STARTF_USESHOWWINDOW ? StartupInfo.wShowWindow : SW_SHOWDEFAULT),
 +      (wchar_t **) lpszCommandLine, (wchar_t **) (HINSTANCE) &__ImageBase);
 +#else
 +    mainret = main (
 +      (int) (StartupInfo.dwFlags & STARTF_USESHOWWINDOW ? StartupInfo.wShowWindow : SW_SHOWDEFAULT),
 +      (char **) lpszCommandLine, (char **) (HINSTANCE) &__ImageBase);
 +#endif
 +    }
 +  else
 +    {
 +    duplicate_ppstrings (argc, &argv);
 +#ifdef WPRFLAG
 +    __winitenv = envp;
 +    mainret = wmain (argc, argv, envp);
 +#else
 +    __initenv = envp;
 +    mainret = main (argc, argv, envp);
 +#endif
 +    }
 +    if (!managedapp)
 +      exit (mainret);
 +
 +    if (has_cctor == 0)
 +      _cexit ();
 +  }
 +  return mainret;
 +}
 +
 +extern int mingw_initltsdrot_force;
 +extern int mingw_initltsdyn_force;
 +extern int mingw_initltssuo_force;
 +extern int mingw_initcharmax;
 +
 +static int __cdecl
 +check_managed_app (void)
 +{
 +  PIMAGE_DOS_HEADER pDOSHeader;
 +  PIMAGE_NT_HEADERS pPEHeader;
 +  PIMAGE_OPTIONAL_HEADER32 pNTHeader32;
 +  PIMAGE_OPTIONAL_HEADER64 pNTHeader64;
 +
 +  /* Force to be linked.  */
 +  //TLS sections
 +  //mingw_initltsdrot_force=1;
 +  //mingw_initltsdyn_force=1;
 +  //mingw_initltssuo_force=1;
 +  mingw_initcharmax=1;
 +
 +  pDOSHeader = (PIMAGE_DOS_HEADER) &__ImageBase;
 +  if (pDOSHeader->e_magic != IMAGE_DOS_SIGNATURE)
 +    return 0;
 +
 +  pPEHeader = (PIMAGE_NT_HEADERS)((char *)pDOSHeader + pDOSHeader->e_lfanew);
 +  if (pPEHeader->Signature != IMAGE_NT_SIGNATURE)
 +    return 0;
 +
 +  pNTHeader32 = (PIMAGE_OPTIONAL_HEADER32) &pPEHeader->OptionalHeader;
 +  switch (pNTHeader32->Magic)
 +    {
 +    case IMAGE_NT_OPTIONAL_HDR32_MAGIC:
 +      if (pNTHeader32->NumberOfRvaAndSizes <= IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR)
 +      return 0;
 +      return !! pNTHeader32->DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress;
 +    case IMAGE_NT_OPTIONAL_HDR64_MAGIC:
 +      pNTHeader64 = (PIMAGE_OPTIONAL_HEADER64)pNTHeader32;
 +      if (pNTHeader64->NumberOfRvaAndSizes <= IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR)
 +      return 0;
 +      return !! pNTHeader64->DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress;
 +    }
 +  return 0;
 +}
 +
 +int __defaultmatherr;
 +
 +static CALLBACK long
 +_gnu_exception_handler (EXCEPTION_POINTERS * exception_data)
 +{
 +  void (*old_handler) (int);
 +  long action = EXCEPTION_CONTINUE_SEARCH;
 +  int reset_fpu = 0;
 +
 +  switch (exception_data->ExceptionRecord->ExceptionCode)
 +    {
 +    case EXCEPTION_ACCESS_VIOLATION:
 +      /* test if the user has set SIGSEGV */
 +      old_handler = signal (SIGSEGV, SIG_DFL);
 +      if (old_handler == SIG_IGN)
 +      {
 +        /* this is undefined if the signal was raised by anything other
 +           than raise ().  */
 +        signal (SIGSEGV, SIG_IGN);
 +        action = EXCEPTION_CONTINUE_EXECUTION;
 +      }
 +      else if (old_handler != SIG_DFL)
 +      {
 +        /* This means 'old' is a user defined function. Call it */
 +        (*old_handler) (SIGSEGV);
 +        action = EXCEPTION_CONTINUE_EXECUTION;
 +      }
 +      break;
 +
 +    case EXCEPTION_ILLEGAL_INSTRUCTION:
 +    case EXCEPTION_PRIV_INSTRUCTION:
 +      /* test if the user has set SIGILL */
 +      old_handler = signal (SIGILL, SIG_DFL);
 +      if (old_handler == SIG_IGN)
 +      {
 +        /* this is undefined if the signal was raised by anything other
 +           than raise ().  */
 +        signal (SIGILL, SIG_IGN);
 +        action = EXCEPTION_CONTINUE_EXECUTION;
 +      }
 +      else if (old_handler != SIG_DFL)
 +      {
 +        /* This means 'old' is a user defined function. Call it */
 +        (*old_handler) (SIGILL);
 +        action = EXCEPTION_CONTINUE_EXECUTION;
 +      }
 +      break;
 +
 +    case EXCEPTION_FLT_INVALID_OPERATION:
 +    case EXCEPTION_FLT_DIVIDE_BY_ZERO:
 +    case EXCEPTION_FLT_DENORMAL_OPERAND:
 +    case EXCEPTION_FLT_OVERFLOW:
 +    case EXCEPTION_FLT_UNDERFLOW:
 +    case EXCEPTION_FLT_INEXACT_RESULT:
 +      reset_fpu = 1;
 +      /* fall through. */
 +
 +    case EXCEPTION_INT_DIVIDE_BY_ZERO:
 +      /* test if the user has set SIGFPE */
 +      old_handler = signal (SIGFPE, SIG_DFL);
 +      if (old_handler == SIG_IGN)
 +      {
 +        signal (SIGFPE, SIG_IGN);
 +        if (reset_fpu)
 +          _fpreset ();
 +        action = EXCEPTION_CONTINUE_EXECUTION;
 +      }
 +      else if (old_handler != SIG_DFL)
 +      {
 +        /* This means 'old' is a user defined function. Call it */
 +        (*old_handler) (SIGFPE);
 +        action = EXCEPTION_CONTINUE_EXECUTION;
 +      }
 +      break;
 +
 +    default:
 +      break;
 +    }
 +  return action;
 +}
 +
 +#if 0
 +static LONG __mingw_vex(EXCEPTION_POINTERS * exception_data)
 +{
 +  /* TODO this is not chainablem, therefore need rewrite. Disabled the ill code. */
 +
 +  #ifdef _WIN64
 +  __asm__ __volatile__ (
 +      "movq %gs:0,%rax" "\n\t"
 +      "orq %rax,%rax\n\t"
 +      "jz l1\n\t"
 +      "jmp *8(%rax)\n\r"
 +      "l1:\n\t"
 +      "nop\n");
 +#else
 +  __asm__ __volatile__ (
 +      "movl %fs:0,%eax" "\n\t"
 +      "orl %eax,%eax\n\t"
 +      "jz l1\n\t"
 +      "jmp *4(%eax)\n\r"
 +      "l1:\n\t"
 +      "nop\n");
 +#endif
 +  return _gnu_exception_handler(exception_data);
 +}
 +#endif
 +
 +#ifdef WPRFLAG
 +
 +static size_t wbytelen(const wchar_t *p)
 +{
 +      size_t ret = 1;
 +      while (*p!=0) {
 +              ret++,++p;
 +      }
 +      return ret*2;
 +}
 +static void duplicate_ppstrings (int ac, wchar_t ***av)
 +{
 +      wchar_t **avl;
 +      int i;
 +      wchar_t **n = (wchar_t **) malloc (sizeof (wchar_t *) * (ac + 1));
 +
 +      avl=*av;
 +      for (i=0; i < ac; i++)
 +        {
 +              int l = wbytelen (avl[i]);
 +              n[i] = (wchar_t *) malloc (l);
 +              memcpy (n[i], avl[i], l);
 +        }
 +      n[i] = NULL;
 +      *av = n;
 +}
 +#else
 +static void duplicate_ppstrings (int ac, char ***av)
 +{
 +      char **avl;
 +      int i;
 +      char **n = (char **) malloc (sizeof (char *) * (ac + 1));
 +      
 +      avl=*av;
 +      for (i=0; i < ac; i++)
 +        {
 +              int l = strlen (avl[i]) + 1;
 +              n[i] = (char *) malloc (l);
 +              memcpy (n[i], avl[i], l);
 +        }
 +      n[i] = NULL;
 +      *av = n;
 +}
 +#endif
@@@ -1,32 -1,38 +1,32 @@@
 -/*
 - * gccmain.c
 - * This file has no copyright assigned and is placed in the Public Domain.
 - * This file is a part of the mingw-runtime package.
 - * No warranty is given; refer to the file DISCLAIMER within the package.
 - *
 - * A separate version of __main, __do_global_ctors and __do_global_dtors for
 - * Mingw32 for use with Cygwin32 b19. Hopefully this object file will only
 - * be linked if the libgcc.a doesn't include __main, __do_global_dtors and
 - * __do_global_ctors.
 - *
 - */
 -
 -/* Needed for the atexit prototype. */
 +#include <windows.h>
  #include <stdlib.h>
 -#include <stddef.h>
 +#include <setjmp.h>
  
  typedef void (*func_ptr) (void);
  extern func_ptr __CTOR_LIST__[];
  extern func_ptr __DTOR_LIST__[];
  
- static HMODULE hMsvcrt = NULL;
++//static HMODULE hMsvcrt = NULL;
 +
 +typedef void __cdecl flongjmp(jmp_buf _Buf,int _Value);
 +
 +flongjmp *fctMsvcrtLongJmp = NULL;
 +
  void
  __do_global_dtors (void)
  {
    static func_ptr *p = __DTOR_LIST__ + 1;
  
 -  /*
 -   * Call each destructor in the destructor list until a null pointer
 -   * is encountered.
 -   */
    while (*p)
      {
        (*(p)) ();
        p++;
      }
-   if (hMsvcrt)
-     {
-       FreeLibrary (hMsvcrt);
-       hMsvcrt = NULL;
-     }
++  //if (hMsvcrt)
++  //  {
++  //    FreeLibrary (hMsvcrt);
++  //    hMsvcrt = NULL;
++  //  }
  }
  
  void
@@@ -35,21 -41,27 +35,21 @@@ __do_global_ctors (void
    unsigned long nptrs = (unsigned long) (ptrdiff_t) __CTOR_LIST__[0];
    unsigned long i;
  
-   if (!hMsvcrt) {
-     hMsvcrt = LoadLibrary ("msvcrt.dll");
-     fctMsvcrtLongJmp = (flongjmp *) GetProcAddress( hMsvcrt, "longjmp");
-   }
 -  /*
 -   * If the first entry in the constructor list is -1 then the list
 -   * is terminated with a null entry. Otherwise the first entry was
 -   * the number of pointers in the list.
 -   */
 -  if (nptrs == -1)
++  //if (!hMsvcrt) {
++  //  hMsvcrt = LoadLibrary ("msvcrt.dll");
++  //  fctMsvcrtLongJmp = (flongjmp *) GetProcAddress( hMsvcrt, "longjmp");
++  //}
 +
 +  if (nptrs == (unsigned long) -1)
      {
        for (nptrs = 0; __CTOR_LIST__[nptrs + 1] != 0; nptrs++);
      }
  
 -  /*
 -   * Go through the list backwards calling constructors.
 -   */
    for (i = nptrs; i >= 1; i--)
      {
        __CTOR_LIST__[i] ();
      }
  
 -  /*
 -   * Register the destructors for processing on exit.
 -   */
    atexit (__do_global_dtors);
  }
  
@@@ -64,3 -76,5 +64,3 @@@ __main (void
        __do_global_ctors ();
      }
  }
 -
 -
@@@ -1,49 -1,38 +1,48 @@@
  <?xml version="1.0"?>
  <!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd">
  <group>
- <module name="mingw_common" type="staticlibrary" isstartuplib="true" underscoresymbols="true">
+ <module name="mingw_common" type="staticlibrary" isstartuplib="true" underscoresymbols="true" crt="dll">
        <importlibrary definition="moldname-msvcrt.def" dllname="msvcrt.dll" />
        <include base="mingw_common">include</include>
 -      <file>cpu_features.c</file>
 -      <file>CRTfmode.c</file>
 -      <file>CRTglob.c</file>
 -      <file>CRTinit.c</file>
 +      <file>_newmode.c</file>
 +      <file>_wgetopt.c</file>
 +      <file>argv.c</file>
 +      <file>atonexit.c</file>
 +      <file>binmode.c</file>
 +      <file>charmax.c</file>
 +      <file>cinitexe.c</file>
 +      <file>CRT_fp10.c</file>
 +      <file>crtdll.c</file>
 +      <file>dllentry.c</file>
 +      <file>dllmain.c</file>
        <file>gccmain.c</file>
        <file>getopt.c</file>
-       <file>gs_support.c</file>
 -      <file>isascii.c</file>
 -      <file>iscsym.c</file>
 -      <file>iscsymf.c</file>
 -      <file>toascii.c</file>
 -      <file>_wgetopt.c</file>
 -      <if property="ARCH" value="i386">
 -              <file>pseudo-reloc.c</file>
 -      </if>
++      <!-- <file>gs_support.c</file> -->
 +      <file>merr.c</file>
 +      <file>mingw_helpers.c</file>
 +      <file>natstart.c</file>
 +      <file>pesect.c</file>
 +      <file>pseudo-reloc.c</file>
 +      <file>tlssup.c</file>
 +      <file>wildcard.c</file>
 +      <file>xncommod.c</file>
 +      <file>xthdloc.c</file>
 +      <file>xtxtmode.c</file>
  </module>
- <module name="mingw_main" type="staticlibrary" isstartuplib="true" allowwarnings="true">
+ <module name="mingw_main" type="staticlibrary" isstartuplib="true" allowwarnings="true" crt="dll">
        <include base="mingw_common">include</include>
 -      <file>binmode.c</file>
 -      <file>crt1.c</file>
 -      <file>main.c</file>
 +      <file>crt0_c.c</file>
 +      <file>crtexe.c</file>
  </module>
- <module name="mingw_wmain" type="staticlibrary" isstartuplib="true" allowwarnings="true" unicode="yes">
 -<module name="mingw_wmain" type="staticlibrary" isstartuplib="true" allowwarnings="true" crt="dll">
++<module name="mingw_wmain" type="staticlibrary" isstartuplib="true" allowwarnings="true" unicode="yes" crt="dll">
        <include base="mingw_common">include</include>
 -      <file>wbinmode.c</file>
 -      <file>wcrt1.c</file>
 -      <file>wmain.c</file>
 +      <define name="WPRFLAG"/>
 +      <file>crt0_w.c</file>
 +      <file>crtexe.c</file>
  </module>
- <module name="mingw_dllmain" type="staticlibrary" isstartuplib="true">
+ <module name="mingw_dllmain" type="staticlibrary" isstartuplib="true" crt="dll">
        <include base="mingw_common">include</include>
 -      <file>dllcrt1.c</file>
 +      <file>dllentry.c</file>
 +      <file>dllmain.c</file>
  </module>
  </group>
diff --combined reactos/lib/rtl/rtlp.h
@@@ -19,11 -19,9 +19,11 @@@ extern VOID FASTCALL CHECK_PAGED_CODE_R
  #ifdef _PPC_
  #define SWAPD(x) ((((x)&0xff)<<24)|(((x)&0xff00)<<8)|(((x)>>8)&0xff00)|(((x)>>24)&0xff))
  #define SWAPW(x) ((((x)&0xff)<<8)|(((x)>>8)&0xff))
 +#define SWAPQ(x) ((SWAPD((x)&0xffffffff) << 32) | (SWAPD((x)>>32)))
  #else
 -#define SWAPD(x) x
 -#define SWAPW(x) x
 +#define SWAPD(x) (x)
 +#define SWAPW(x) (x)
 +#define SWAPQ(x) (x)
  #endif
  
  VOID
@@@ -39,6 -37,13 +39,13 @@@ VOI
  NTAPI
  RtlpSetExceptionList(PEXCEPTION_REGISTRATION_RECORD NewExceptionList);
  
+ BOOLEAN
+ NTAPI
+ RtlCallVectoredExceptionHandlers(
+     IN PEXCEPTION_RECORD ExceptionRecord,
+     IN PCONTEXT Context
+ );
  typedef struct _DISPATCHER_CONTEXT
  {
      PEXCEPTION_REGISTRATION_RECORD RegistrationPointer;
@@@ -127,10 -127,10 +127,10 @@@ int access_dirW(const wchar_t *_path)
  #define MB_CUR_MAX __mb_cur_max
  
  
--int _isnanl(long double x);
--int _isinfl(long double x);
--int _isnan(double x);
--int _isinf(double x);
++//int _isnanl(long double x);
++//int _isinfl(long double x);
++//int _isnan(double x);
++//int _isinf(double x);
  
  /* Flags for the iobuf structure (for reference) */
  #if 0
  
  wint_t _filwbuf(FILE *f);
  
--#if __MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 2
--   int __cdecl _filbuf (FILE*);
--   int __cdecl _flsbuf (int, FILE*);
--#endif
++//#if __MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 2
++//   int __cdecl _filbuf (FILE*);
++//   int __cdecl _flsbuf (int, FILE*);
++//#endif
  
  #endif /* __dj_include_libc_file_h__ */
--
@@@ -68,6 -68,11 +68,6 @@@ int *__p___mb_cur_max(void)
  #undef vprintf
  #undef vwprintf
  
 -/* for stat mode, permissions apply to all,owner and group */
 -#define ALL_S_IREAD  (_S_IREAD  | (_S_IREAD  >> 3) | (_S_IREAD  >> 6))
 -#define ALL_S_IWRITE (_S_IWRITE | (_S_IWRITE >> 3) | (_S_IWRITE >> 6))
 -#define ALL_S_IEXEC  (_S_IEXEC  | (_S_IEXEC  >> 3) | (_S_IEXEC  >> 6))
 -
  /* _access() bit flags FIXME: incomplete */
  /* defined in crt/io.h */
  
@@@ -89,7 -94,7 +89,7 @@@ typedef struct 
      DWORD               unkn[7]; /* critical section and init flag */       
  } ioinfo;
  
 -/*static */ioinfo fdesc[MAX_FILES];
 +ioinfo fdesc[MAX_FILES];
  
  FILE _iob[3] = { { 0 } };
  
@@@ -105,6 -110,17 +105,6 @@@ static int MSVCRT_umask = 0
  /* INTERNAL: Static buffer for temp file name */
  static char tmpname[MAX_PATH];
  
 -static const unsigned int EXE = 'e' << 16 | 'x' << 8 | 'e';
 -static const unsigned int BAT = 'b' << 16 | 'a' << 8 | 't';
 -static const unsigned int CMD = 'c' << 16 | 'm' << 8 | 'd';
 -static const unsigned int COM = 'c' << 16 | 'o' << 8 | 'm';
 -
 -#define TOUL(x) (ULONGLONG)(x)
 -static const ULONGLONG WCEXE = TOUL('e') << 32 | TOUL('x') << 16 | TOUL('e');
 -static const ULONGLONG WCBAT = TOUL('b') << 32 | TOUL('a') << 16 | TOUL('t');
 -static const ULONGLONG WCCMD = TOUL('c') << 32 | TOUL('m') << 16 | TOUL('d');
 -static const ULONGLONG WCCOM = TOUL('c') << 32 | TOUL('o') << 16 | TOUL('m');
 -
  /* This critical section protects the tables fdesc and fstreams,
   * and their related indexes, fdstart, fdend,
   * and stream_idx, from race conditions.
@@@ -116,20 -132,35 +116,20 @@@ static CRITICAL_SECTION FILE_cs
  #define LOCK_FILES()    do { EnterCriticalSection(&FILE_cs); } while (0)
  #define UNLOCK_FILES()  do { LeaveCriticalSection(&FILE_cs); } while (0)
  
- void stat64_to_stati64(const struct __stat64 *buf64, struct _stati64 *buf)
 -static void stat64_to_stat(const struct __stat64 *buf64, struct _stat *buf)
 -{
 -    buf->st_dev   = buf64->st_dev;
 -    buf->st_ino   = buf64->st_ino;
 -    buf->st_mode  = buf64->st_mode;
 -    buf->st_nlink = buf64->st_nlink;
 -    buf->st_uid   = buf64->st_uid;
 -    buf->st_gid   = buf64->st_gid;
 -    buf->st_rdev  = buf64->st_rdev;
 -    buf->st_size  = buf64->st_size;
 -    buf->st_atime = buf64->st_atime;
 -    buf->st_mtime = buf64->st_mtime;
 -    buf->st_ctime = buf64->st_ctime;
 -}
 -
 -static void stat64_to_stati64(const struct __stat64 *buf64, struct _stati64 *buf)
--{
--    buf->st_dev   = buf64->st_dev;
--    buf->st_ino   = buf64->st_ino;
--    buf->st_mode  = buf64->st_mode;
--    buf->st_nlink = buf64->st_nlink;
--    buf->st_uid   = buf64->st_uid;
--    buf->st_gid   = buf64->st_gid;
--    buf->st_rdev  = buf64->st_rdev;
--    buf->st_size  = buf64->st_size;
--    buf->st_atime = buf64->st_atime;
--    buf->st_mtime = buf64->st_mtime;
--    buf->st_ctime = buf64->st_ctime;
--}
++//void stat64_to_stati64(const struct __stat64 *buf64, struct _stati64 *buf)
++//{
++//    buf->st_dev   = buf64->st_dev;
++//    buf->st_ino   = buf64->st_ino;
++//    buf->st_mode  = buf64->st_mode;
++//    buf->st_nlink = buf64->st_nlink;
++//    buf->st_uid   = buf64->st_uid;
++//    buf->st_gid   = buf64->st_gid;
++//    buf->st_rdev  = buf64->st_rdev;
++//    buf->st_size  = buf64->st_size;
++//    buf->st_atime = buf64->st_atime;
++//    buf->st_mtime = buf64->st_mtime;
++//    buf->st_ctime = buf64->st_ctime;
++//}
  
  static inline BOOL is_valid_fd(int fd)
  {
   * it returns a valid handle which is about to be closed, a subsequent call
   * will fail, most likely in a sane way.
   */
 -static HANDLE fdtoh(int fd)
 +HANDLE fdtoh(int fd)
  {
    if (!is_valid_fd(fd))
    {
@@@ -463,7 -494,7 +463,7 @@@ static void int_to_base32(int num, cha
   */
  FILE * CDECL __p__iob(void)
  {
 - return &_iob[0];
 + return _iob;
  }
  
  /*********************************************************************
@@@ -1132,6 -1163,92 +1132,6 @@@ int CDECL _fileno(FILE* file
    return file->_file;
  }
  
 -/*********************************************************************
 - *            _fstat64 (MSVCRT.@)
 - */
 -int CDECL _fstat64(int fd, struct __stat64* buf)
 -{
 -  DWORD dw;
 -  DWORD type;
 -  BY_HANDLE_FILE_INFORMATION hfi;
 -  HANDLE hand = fdtoh(fd);
 -
 -  TRACE(":fd (%d) stat (%p)\n",fd,buf);
 -  if (hand == INVALID_HANDLE_VALUE)
 -    return -1;
 -
 -  if (!buf)
 -  {
 -    WARN(":failed-NULL buf\n");
 -    __set_errno(ERROR_INVALID_PARAMETER);
 -    return -1;
 -  }
 -
 -  memset(&hfi, 0, sizeof(hfi));
 -  memset(buf, 0, sizeof(struct __stat64));
 -  type = GetFileType(hand);
 -  if (type == FILE_TYPE_PIPE)
 -  {
 -    buf->st_dev = buf->st_rdev = fd;
 -    buf->st_mode = S_IFIFO;
 -    buf->st_nlink = 1;
 -  }
 -  else if (type == FILE_TYPE_CHAR)
 -  {
 -    buf->st_dev = buf->st_rdev = fd;
 -    buf->st_mode = S_IFCHR;
 -    buf->st_nlink = 1;
 -  }
 -  else /* FILE_TYPE_DISK etc. */
 -  {
 -    if (!GetFileInformationByHandle(hand, &hfi))
 -    {
 -      WARN(":failed-last error (%d)\n",GetLastError());
 -      __set_errno(ERROR_INVALID_PARAMETER);
 -      return -1;
 -    }
 -    buf->st_mode = S_IFREG | S_IREAD;
 -    if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
 -      buf->st_mode |= S_IWRITE;
 -    buf->st_size  = ((__int64)hfi.nFileSizeHigh << 32) + hfi.nFileSizeLow;
 -    RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw);
 -    buf->st_atime = dw;
 -    RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw);
 -    buf->st_mtime = buf->st_ctime = dw;
 -    buf->st_nlink = hfi.nNumberOfLinks;
 -  }
 -  TRACE(":dwFileAttributes = 0x%x, mode set to 0x%x\n",hfi.dwFileAttributes,
 -   buf->st_mode);
 -  return 0;
 -}
 -
 -/*********************************************************************
 - *            _fstati64 (MSVCRT.@)
 - */
 -int CDECL _fstati64(int fd, struct _stati64* buf)
 -{
 -  int ret;
 -  struct __stat64 buf64;
 -
 -  ret = _fstat64(fd, &buf64);
 -  if (!ret)
 -    stat64_to_stati64(&buf64, buf);
 -  return ret;
 -}
 -
 -/*********************************************************************
 - *            _fstat (MSVCRT.@)
 - */
 -int CDECL _fstat(int fd, struct _stat* buf)
 -{ int ret;
 -  struct __stat64 buf64;
 -
 -  ret = _fstat64(fd, &buf64);
 -  if (!ret)
 -      stat64_to_stat(&buf64, buf);
 -  return ret;
 -}
 -
  /*********************************************************************
   *            _futime (MSVCRT.@)
   */
@@@ -1170,12 -1287,12 +1170,12 @@@ int CDECL _futime(int fd, struct _utimb
  /*********************************************************************
   *            _get_osfhandle (MSVCRT.@)
   */
 -long CDECL _get_osfhandle(int fd)
 +intptr_t CDECL _get_osfhandle(int fd)
  {
    HANDLE hand = fdtoh(fd);
    TRACE(":fd (%d) handle (%p)\n",fd,hand);
  
 -  return (long)hand;
 +  return (long)(LONG_PTR)hand;
  }
  
  /*********************************************************************
@@@ -1525,7 -1642,7 +1525,7 @@@ int CDECL _wcreat(const wchar_t *path, 
  /*********************************************************************
   *            _open_osfhandle (MSVCRT.@)
   */
 -int CDECL _open_osfhandle(long handle, int oflags)
 +int CDECL _open_osfhandle(intptr_t handle, int oflags)
  {
    int fd;
  
    if (!(oflags & (_O_BINARY | _O_TEXT)))
        oflags |= _O_BINARY;
  
 -  fd = alloc_fd((HANDLE)handle, split_oflags(oflags));
 +  fd = alloc_fd((HANDLE)(LONG_PTR)handle, split_oflags(oflags));
    TRACE(":handle (%ld) fd (%d) flags 0x%08x\n", handle, fd, oflags);
    return fd;
  }
@@@ -1680,6 -1797,188 +1680,6 @@@ int CDECL _setmode(int fd,int mode
    return ret;
  }
  
 -/*********************************************************************
 - *            _stat64 (MSVCRT.@)
 - */
 -int CDECL _stat64(const char* path, struct __stat64 * buf)
 -{
 -  DWORD dw;
 -  WIN32_FILE_ATTRIBUTE_DATA hfi;
 -  unsigned short mode = ALL_S_IREAD;
 -  int plen;
 -
 -  TRACE(":file (%s) buf(%p)\n",path,buf);
 -
 -  if (!GetFileAttributesExA(path, GetFileExInfoStandard, &hfi))
 -  {
 -      TRACE("failed (%d)\n",GetLastError());
 -      __set_errno(ERROR_FILE_NOT_FOUND);
 -      return -1;
 -  }
 -
 -  memset(buf,0,sizeof(struct __stat64));
 -
 -  /* FIXME: rdev isn't drive num, despite what the docs say-what is it?
 -     Bon 011120: This FIXME seems incorrect
 -                 Also a letter as first char isn't enough to be classified
 -               as a drive letter
 -  */
 -  if (isalpha(*path)&& (*(path+1)==':'))
 -    buf->st_dev = buf->st_rdev = toupper(*path) - 'A'; /* drive num */
 -  else
 -    buf->st_dev = buf->st_rdev = _getdrive() - 1;
 -
 -  plen = strlen(path);
 -
 -  /* Dir, or regular file? */
 -  if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
 -      (path[plen-1] == '\\'))
 -    mode |= (_S_IFDIR | ALL_S_IEXEC);
 -  else
 -  {
 -    mode |= _S_IFREG;
 -    /* executable? */
 -    if (plen > 6 && path[plen-4] == '.')  /* shortest exe: "\x.exe" */
 -    {
 -      unsigned int ext = tolower(path[plen-1]) | (tolower(path[plen-2]) << 8) |
 -                                 (tolower(path[plen-3]) << 16);
 -      if (ext == EXE || ext == BAT || ext == CMD || ext == COM)
 -          mode |= ALL_S_IEXEC;
 -    }
 -  }
 -
 -  if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
 -    mode |= ALL_S_IWRITE;
 -
 -  buf->st_mode  = mode;
 -  buf->st_nlink = 1;
 -  buf->st_size  = ((__int64)hfi.nFileSizeHigh << 32) + hfi.nFileSizeLow;
 -  RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw);
 -  buf->st_atime = dw;
 -  RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw);
 -  buf->st_mtime = buf->st_ctime = dw;
 -  TRACE("%d %d 0x%08lx%08lx %ld %ld %ld\n", buf->st_mode,buf->st_nlink,
 -        (long)(buf->st_size >> 32),(long)buf->st_size,
 -        (long)buf->st_atime,(long)buf->st_mtime,(long)buf->st_ctime);
 -  return 0;
 -}
 -
 -/*********************************************************************
 - *            _stati64 (MSVCRT.@)
 - */
 -int CDECL _stati64(const char* path, struct _stati64 * buf)
 -{
 -  int ret;
 -  struct __stat64 buf64;
 -
 -  ret = _stat64(path, &buf64);
 -  if (!ret)
 -    stat64_to_stati64(&buf64, buf);
 -  return ret;
 -}
 -
 -/*********************************************************************
 - *            _stat (MSVCRT.@)
 - */
 -int CDECL _stat(const char* path, struct _stat * buf)
 -{ int ret;
 -  struct __stat64 buf64;
 -
 -  ret = _stat64( path, &buf64);
 -  if (!ret)
 -      stat64_to_stat(&buf64, buf);
 -  return ret;
 -}
 -
 -/*********************************************************************
 - *            _wstat64 (MSVCRT.@)
 - */
 -int CDECL _wstat64(const wchar_t* path, struct __stat64 * buf)
 -{
 -  DWORD dw;
 -  WIN32_FILE_ATTRIBUTE_DATA hfi;
 -  unsigned short mode = ALL_S_IREAD;
 -  int plen;
 -
 -  TRACE(":file (%s) buf(%p)\n",debugstr_w(path),buf);
 -
 -  if (!GetFileAttributesExW(path, GetFileExInfoStandard, &hfi))
 -  {
 -      TRACE("failed (%d)\n",GetLastError());
 -      __set_errno(ERROR_FILE_NOT_FOUND);
 -      return -1;
 -  }
 -
 -  memset(buf,0,sizeof(struct __stat64));
 -
 -  /* FIXME: rdev isn't drive num, despite what the docs says-what is it? */
 -  if (iswalpha(*path))
 -    buf->st_dev = buf->st_rdev = toupperW(*path - 'A'); /* drive num */
 -  else
 -    buf->st_dev = buf->st_rdev = _getdrive() - 1;
 -
 -  plen = strlenW(path);
 -
 -  /* Dir, or regular file? */
 -  if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
 -      (path[plen-1] == '\\'))
 -    mode |= (_S_IFDIR | ALL_S_IEXEC);
 -  else
 -  {
 -    mode |= _S_IFREG;
 -    /* executable? */
 -    if (plen > 6 && path[plen-4] == '.')  /* shortest exe: "\x.exe" */
 -    {
 -      ULONGLONG ext = tolowerW(path[plen-1]) | (tolowerW(path[plen-2]) << 16) |
 -                               ((ULONGLONG)tolowerW(path[plen-3]) << 32);
 -      if (ext == WCEXE || ext == WCBAT || ext == WCCMD || ext == WCCOM)
 -        mode |= ALL_S_IEXEC;
 -    }
 -  }
 -
 -  if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
 -    mode |= ALL_S_IWRITE;
 -
 -  buf->st_mode  = mode;
 -  buf->st_nlink = 1;
 -  buf->st_size  = ((__int64)hfi.nFileSizeHigh << 32) + hfi.nFileSizeLow;
 -  RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw);
 -  buf->st_atime = dw;
 -  RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw);
 -  buf->st_mtime = buf->st_ctime = dw;
 -  TRACE("%d %d 0x%08lx%08lx %ld %ld %ld\n", buf->st_mode,buf->st_nlink,
 -        (long)(buf->st_size >> 32),(long)buf->st_size,
 -        (long)buf->st_atime,(long)buf->st_mtime,(long)buf->st_ctime);
 -  return 0;
 -}
 -
 -/*********************************************************************
 - *            _wstati64 (MSVCRT.@)
 - */
 -int CDECL _wstati64(const wchar_t* path, struct _stati64 * buf)
 -{
 -  int ret;
 -  struct __stat64 buf64;
 -
 -  ret = _wstat64(path, &buf64);
 -  if (!ret)
 -    stat64_to_stati64(&buf64, buf);
 -  return ret;
 -}
 -
 -/*********************************************************************
 - *            _wstat (MSVCRT.@)
 - */
 -int CDECL _wstat(const wchar_t* path, struct _stat * buf)
 -{
 -  int ret;
 -  struct __stat64 buf64;
 -
 -  ret = _wstat64( path, &buf64 );
 -  if (!ret) stat64_to_stat(&buf64, buf);
 -  return ret;
 -}
 -
  /*********************************************************************
   *            _tell (MSVCRT.@)
   */
index b4a6d7d,0000000..22e735d
mode 100644,000000..100644
--- /dev/null
@@@ -1,235 -1,0 +1,227 @@@
- STUB(ExEnterCriticalRegionAndAcquireResourceShared)
- STUB(ExEnterCriticalRegionAndAcquireSharedWaitForExclusive)
 +
 +unsigned long (*FrLdrDbgPrint)(const char *Format, ...);
 +
 +
 +
 +#define STUB(x) void x() {FrLdrDbgPrint("Sorry, %s is only a stub!\n", __FUNCTION__);}
 +
 +STUB(KdpEnableSafeMem)
 +STUB(KiIdleLoop)
 +STUB(KeBugcheckCallbackListHead)
 +STUB(ExpInterlockedPushEntrySList)
 +STUB(NtContinue)
 +STUB(KeActiveProcessors)
 +STUB(KeDisableInterrupts)
 +STUB(KeContextToTrapFrame)
 +STUB(KiDispatchException)
 +STUB(MiGetUserPageDirectoryCount)
 +STUB(MmStats)
 +STUB(ExAcquireResourceLock)
 +STUB(ExReleaseResourceLock)
 +STUB(MiNonPagedPoolLength)
 +STUB(MiNonPagedPoolStart)
 +STUB(KiInitializeUserApc)
 +STUB(KiComputeTimerTableIndex)
 +STUB(KeBugcheckReasonCallbackListHead)
 +STUB(BugCheckCallbackLock)
 +STUB(NtCallbackReturn)
 +STUB(NtRaiseException)
 +STUB(NtSetLdtEntries)
 +STUB(NtVdmControl)
 +STUB(KiSwapProcess)
 +STUB(KeGetCurrentProcessorNumber)
 +STUB(ExpInterlockedPopEntrySList)
 +STUB(ExAllocateFromNPagedLookasideList)
 +STUB(RtlGetCallersAddress)
 +STUB(RtlCompareMemory)
 +STUB(ExpEnvironmentLock)
 +STUB(ExpFirmwareTableProviderListHead)
 +STUB(ExInterlockedInsertTailList)
 +STUB(ExInterlockedRemoveHeadList)
 +STUB(ExInterlockedAddLargeStatistic)
 +STUB(ExpFirmwareTableResource)
 +STUB(MmNumberOfPhysicalPages)
 +STUB(MmMapLockedPage)
 +STUB(PsThreadType)
 +STUB(ExfInterlockedCompareExchange64)
 +STUB(ExInterlockedInsertHeadList)
 +STUB(IoCompletionType)
 +STUB(IoCompletionPacketLookaside)
 +STUB(CancelSpinLock)
 +STUB(KdbpCliInit)
 +STUB(KeDisconnectInterrupt)
 +STUB(KeInitializeInterrupt)
 +STUB(MiFreeDescriptor)
 +STUB(MmPfnDatabase)
 +STUB(MmHighestPhysicalPage)
 +STUB(MiFreeDescriptorOrg)
 +STUB(ExEventObjectType)
 +STUB(KeRosDumpStackFrames)
 +STUB(RtlWalkFrameChain)
 +STUB(ExSystemLookasideListHead)
 +STUB(PspGetOrSetContextKernelRoutine)
 +STUB(KeConnectInterrupt)
 +STUB(KeRaiseUserException)
 +STUB(_ExSemaphoreObjectType)
 +STUB(KeFeatureBits)
 +STUB(KiSystemService)
 +STUB(KdpGdbStubInit)
 +STUB(KdbpSafeReadMemory)
 +STUB(RtlFillMemoryUlong)
 +STUB(RtlCaptureContext)
 +STUB(RtlpGetExceptionAddress)
 +STUB(RtlDispatchException)
 +STUB(DbgkDebugObjectType)
 +STUB(KdbEnterDebuggerException)
 +STUB(KdbpCliModuleLoaded)
 +STUB(RtlUnwind)
 +STUB(RtlInitializeContext)
 +STUB(DbgCommandString)
 +STUB(ExAcquireRundownProtection)
 +STUB(ExAcquireRundownProtectionCacheAware)
 +STUB(ExAcquireRundownProtectionCacheAwareEx)
 +STUB(ExAcquireRundownProtectionEx)
 +STUB(ExAllocateFromPagedLookasideList)
- STUB(IoTranslateBusAddress)
 +STUB(ExFreeToPagedLookasideList)
 +STUB(ExInitializeRundownProtection)
 +STUB(ExInterlockedAddLargeInteger)
 +STUB(ExInterlockedAddUlong)
 +STUB(ExInterlockedPopEntryList)
 +STUB(ExInterlockedPushEntryList)
 +STUB(ExQueryDepthSList)
 +STUB(ExRaiseException)
 +STUB(ExRaiseStatus)
 +STUB(ExReInitializeRundownProtection)
 +STUB(ExReInitializeRundownProtectionCacheAware)
 +STUB(ExReleaseRundownProtection)
 +STUB(ExReleaseRundownProtectionCacheAware)
 +STUB(ExReleaseRundownProtectionCacheAwareEx)
 +STUB(ExReleaseRundownProtectionEx)
 +STUB(ExRundownCompleted)
 +STUB(ExRundownCompletedCacheAware)
 +STUB(ExSemaphoreObjectType)
 +STUB(ExWaitForRundownProtectionRelease)
 +STUB(ExWaitForRundownProtectionReleaseCacheAware)
 +STUB(ExpInterlockedFlushSList)
 +STUB(FsRtlAddBaseMcbEntry)
 +STUB(FsRtlGetNextBaseMcbEntry)
 +STUB(FsRtlInitializeBaseMcb)
 +STUB(FsRtlLegalAnsiCharacterArray)
 +STUB(FsRtlLookupBaseMcbEntry)
 +STUB(FsRtlLookupLastBaseMcbEntry)
 +STUB(FsRtlLookupLastBaseMcbEntryAndIndex)
 +STUB(FsRtlNumberOfRunsInBaseMcb)
 +STUB(FsRtlRemoveBaseMcbEntry)
 +STUB(FsRtlResetBaseMcb)
 +STUB(FsRtlSplitBaseMcb)
 +STUB(FsRtlTruncateBaseMcb)
 +STUB(FsRtlUninitializeBaseMcb)
 +STUB(HalDispatchTable)
 +STUB(HeadlessDispatch)
 +STUB(InitializeSListHead)
 +STUB(IoFileObjectType)
 +STUB(IoForwardAndCatchIrp)
 +STUB(IoIs32bitProcess)
- STUB(PoCancelDeviceNotify)
- STUB(PoRegisterDeviceNotify)
- STUB(PoRequestShutdownEvent)
- STUB(PoSetHiberRange)
- STUB(PoShutdownBugCheck)
 +STUB(IoWMIDeviceObjectToProviderId)
 +STUB(KdDebuggerEnabled)
 +STUB(KdDebuggerNotPresent)
 +STUB(KeEnterCriticalRegion)
 +STUB(KeEnterGuardedRegion)
 +STUB(KeExpandKernelStackAndCallout)
 +STUB(KeFlushEntireTb)
 +STUB(KeGenericCallDpc)
 +STUB(KeGetRecommendedSharedDataAlignment)
 +STUB(KeInvalidateAllCaches)
 +STUB(KeIsWaitListEmpty)
 +STUB(KeLastBranchMSR)
 +STUB(KeLeaveCriticalRegion)
 +STUB(KeLeaveGuardedRegion)
 +STUB(KeQueryActiveProcessors)
 +STUB(KeQueryMultiThreadProcessorSet)
 +STUB(KeQueryPrcbAddress)
 +STUB(KeReadStateMutex)
 +STUB(KeRestoreFloatingPointState)
 +STUB(KeSaveFloatingPointState)
 +STUB(KeSaveStateForHibernate)
 +STUB(KeSetDmaIoCoherency)
 +STUB(KeSignalCallDpcDone)
 +STUB(KeSignalCallDpcSynchronize)
 +STUB(KeSynchronizeExecution)
 +STUB(KeUpdateRunTime)
 +STUB(KeUpdateSystemTime)
 +STUB(KeUserModeCallback)
 +STUB(KeWaitForMutexObject)
 +STUB(KiBugCheckData)
 +STUB(KiCpuId)
 +STUB(MmCommitSessionMappedView)
 +STUB(MmCreateMirror)
 +STUB(MmIsIoSpaceActive)
 +STUB(MmLockPagableImageSection)
 +STUB(NlsOemLeadByteInfo)
 +STUB(ObDeleteCapturedInsertInfo)
 +STUB(ObSetHandleAttributes)
 +STUB(PfxFindPrefix)
 +STUB(PfxInitialize)
 +STUB(PfxInsertPrefix)
 +STUB(PfxRemovePrefix)
 +STUB(PsGetCurrentProcess)
 +STUB(PsGetCurrentProcessWow64Process)
 +STUB(PsGetCurrentThread)
 +STUB(PsGetCurrentThreadProcess)
 +STUB(PsGetCurrentThreadProcessId)
 +STUB(PsGetCurrentThreadTeb)
 +STUB(PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion)
 +STUB(PsGetProcessSessionIdEx)
 +STUB(PsGetProcessWow64Process)
 +STUB(PsProcessType)
 +STUB(PsWrapApcWow64Thread)
 +STUB(RtlAnsiStringToUnicodeSize)
 +STUB(RtlCompareMemoryUlong)
 +STUB(RtlCopyMemory)
 +STUB(RtlCopyMemoryNonTemporal)
 +STUB(RtlFillMemory)
 +STUB(RtlLookupFunctionEntry)
 +STUB(RtlMoveMemory)
 +STUB(RtlOemStringToUnicodeSize)
 +STUB(RtlPcToFileHeader)
 +STUB(RtlPrefetchMemoryNonTemporal)
 +STUB(RtlRestoreContext)
 +STUB(RtlTraceDatabaseAdd)
 +STUB(RtlTraceDatabaseCreate)
 +STUB(RtlTraceDatabaseDestroy)
 +STUB(RtlTraceDatabaseEnumerate)
 +STUB(RtlTraceDatabaseFind)
 +STUB(RtlTraceDatabaseLock)
 +STUB(RtlTraceDatabaseUnlock)
 +STUB(RtlTraceDatabaseValidate)
 +STUB(RtlUnicodeStringToAnsiSize)
 +STUB(RtlUnicodeStringToOemSize)
 +STUB(RtlUnwindEx)
 +STUB(RtlVirtualUnwind)
 +STUB(RtlZeroMemory)
 +STUB(SeReportSecurityEvent)
 +STUB(SeSetAuditParameter)
 +STUB(SeTokenObjectType)
 +STUB(VfFailDeviceNode)
 +STUB(VfFailDriver)
 +STUB(VfFailSystemBIOS)
 +STUB(VfIsVerificationEnabled)
 +STUB(WmiFlushTrace)
 +STUB(WmiGetClock)
 +STUB(WmiQueryTrace)
 +STUB(WmiStartTrace)
 +STUB(WmiStopTrace)
 +STUB(WmiTraceFastEvent)
 +STUB(WmiUpdateTrace)
 +STUB(XIPDispatch)
 +STUB(__C_specific_handler)
 +STUB(__misaligned_access)
 +STUB(_local_unwind)
 +STUB(_setjmp)
 +STUB(_setjmpex)
 +STUB(longjmp)
 +STUB(KeProcessorArchitecture)
 +STUB(KeProcessorLevel)
 +STUB(KeProcessorRevision)
 +STUB(RtlpGetStackLimits)
 +STUB(KeSwitchKernelStack)
@@@ -105,7 -105,7 +105,7 @@@ extern PULONG KiInterruptTemplateObject
  extern PULONG KiInterruptTemplateDispatch;
  extern PULONG KiInterruptTemplate2ndDispatch;
  extern ULONG KiUnexpectedEntrySize;
 -#ifdef _M_IX86
 +#if defined(_M_IX86) || defined(_M_AMD64)
  extern PVOID Ki386IopmSaveArea;
  extern ULONG KeI386EFlagsAndMaskV86;
  extern ULONG KeI386EFlagsOrMaskV86;
@@@ -192,7 -192,7 +192,7 @@@ extern ULONG KiDPCTimeout
  /* INTERNAL KERNEL FUNCTIONS ************************************************/
  
  /* Finds a new thread to run */
 -NTSTATUS
 +LONG_PTR
  FASTCALL
  KiSwapThread(
      IN PKTHREAD Thread,
@@@ -286,6 -286,13 +286,13 @@@ KiInsertTimerTable
      IN ULONG Hand
  );
  
+ VOID
+ FASTCALL
+ KiTimerListExpire(
+     IN PLIST_ENTRY ExpiredListHead,
+     IN KIRQL OldIrql
+ );
  BOOLEAN
  FASTCALL
  KiInsertTreeTimer(
@@@ -327,12 -334,35 +334,35 @@@ KeWaitForGate
  /* ipi.c ********************************************************************/
  
  VOID
- NTAPI
- KiIpiSendRequest(
+ FASTCALL
+ KiIpiSend(
      KAFFINITY TargetSet,
      ULONG IpiRequest
  );
  
+ VOID
+ NTAPI
+ KiIpiSendPacket(
+     IN KAFFINITY TargetProcessors,
+     IN PKIPI_WORKER WorkerFunction,
+     IN PKIPI_BROADCAST_WORKER BroadcastFunction,
+     IN ULONG_PTR Context,
+     IN PULONG Count
+ );
+ VOID
+ FASTCALL
+ KiIpiSignalPacketDone(
+     IN PKIPI_CONTEXT PacketContext
+ );
+ VOID
+ FASTCALL
+ KiIpiSignalPacketDoneAndStall(
+     IN PKIPI_CONTEXT PacketContext,
+     IN volatile PULONG ReverseStall
+ );
  /* next file ***************************************************************/
  
  UCHAR
@@@ -535,7 -565,7 +565,7 @@@ VOI
  FASTCALL
  KiUnwaitThread(
      IN PKTHREAD Thread,
 -    IN NTSTATUS WaitStatus,
 +    IN LONG_PTR WaitStatus,
      IN KPRIORITY Increment
  );
  
@@@ -96,8 -96,6 +96,8 @@@ KeGetCurrentThread(VOID
  #ifdef _M_IX86
      /* Return the current thread */
      return ((PKIPCR)KeGetPcr())->PrcbData.CurrentThread;
 +#elif defined (_M_AMD64)
 +    return (PRKTHREAD)__readgsqword(FIELD_OFFSET(KIPCR, Prcb.CurrentThread));
  #else
      PKPRCB Prcb = KeGetCurrentPrcb();
      return Prcb->CurrentThread;
@@@ -392,7 -390,7 +392,7 @@@ FORCEINLIN
  VOID
  KiRundownThread(IN PKTHREAD Thread)
  {
 -#if defined(_M_IX86) || defined(_M_AMD64)
 +#if defined(_M_IX86)
      /* Check if this is the NPX Thread */
      if (KeGetCurrentPrcb()->NpxThread == Thread)
      {
@@@ -596,7 -594,7 +596,7 @@@ KiRescheduleThread(IN BOOLEAN NewThread
      if ((NewThread) && !(KeGetPcr()->Number == Cpu))
      {
          /* Send an IPI to request delivery */
-         KiIpiSendRequest(AFFINITY_MASK(Cpu), IPI_DPC);
+         KiIpiSend(AFFINITY_MASK(Cpu), IPI_DPC);
      }
  }
  
@@@ -753,7 -751,7 +753,7 @@@ KiRequestApcInterrupt(IN BOOLEAN NeedAp
          if (KeGetPcr()->Number != Processor)
          {
              /* Send an IPI to request delivery */
-             KiIpiSendRequest(AFFINITY_MASK(Processor), IPI_APC);
+             KiIpiSend(AFFINITY_MASK(Processor), IPI_APC);
          }
          else
          {
@@@ -1101,6 -1099,37 +1101,37 @@@ KiCheckAlertability(IN PKTHREAD Thread
      return STATUS_WAIT_0;
  }
  
+ //
+ // Called from KiCompleteTimer, KiInsertTreeTimer, KeSetSystemTime
+ // to remove timer entries
+ // See Windows HPI blog for more information.
+ VOID
+ FORCEINLINE
+ KiRemoveEntryTimer(IN PKTIMER Timer)
+ {
+     ULONG Hand;
+     PKTIMER_TABLE_ENTRY TableEntry;
+     
+     /* Remove the timer from the timer list and check if it's empty */
+     Hand = Timer->Header.Hand;
+     if (RemoveEntryList(&Timer->TimerListEntry))
+     {
+         /* Get the respective timer table entry */
+         TableEntry = &KiTimerTableListHead[Hand];
+         if (&TableEntry->Entry == TableEntry->Entry.Flink)
+         {
+             /* Set the entry to an infinite absolute time */
+             TableEntry->Time.HighPart = 0xFFFFFFFF;
+         }
+     }
+     /* Clear the list entries on dbg builds so we can tell the timer is gone */
+ #if DBG
+     Timer->TimerListEntry.Flink = NULL;
+     Timer->TimerListEntry.Blink = NULL;
+ #endif
+ }
  //
  // Called by Wait and Queue code to insert a timer for dispatching.
  // Also called by KeSetTimerEx to insert a timer from the caller.
@@@ -1129,6 -1158,57 +1160,57 @@@ KxInsertTimer(IN PKTIMER Timer
      }
  }
  
+ //
+ // Called by KeSetTimerEx and KiInsertTreeTimer to calculate Due Time
+ // See the Windows HPI Blog for more information
+ //
+ BOOLEAN
+ FORCEINLINE
+ KiComputeDueTime(IN PKTIMER Timer,
+                  IN LARGE_INTEGER DueTime,
+                  OUT PULONG Hand)
+ {
+     LARGE_INTEGER InterruptTime, SystemTime, DifferenceTime;
+     
+     /* Convert to relative time if needed */
+     Timer->Header.Absolute = FALSE;
+     if (DueTime.HighPart >= 0)
+     {
+         /* Get System Time */
+         KeQuerySystemTime(&SystemTime);
+         
+         /* Do the conversion */
+         DifferenceTime.QuadPart = SystemTime.QuadPart - DueTime.QuadPart;
+         
+         /* Make sure it hasn't already expired */
+         Timer->Header.Absolute = TRUE;
+         if (DifferenceTime.HighPart >= 0)
+         {
+             /* Cancel everything */
+             Timer->Header.SignalState = TRUE;
+             Timer->Header.Hand = 0;
+             Timer->DueTime.QuadPart = 0;
+             *Hand = 0;
+             return FALSE;
+         }
+         
+         /* Set the time as Absolute */
+         DueTime = DifferenceTime;
+     }
+     
+     /* Get the Interrupt Time */
+     InterruptTime.QuadPart = KeQueryInterruptTime();
+     
+     /* Recalculate due time */
+     Timer->DueTime.QuadPart = InterruptTime.QuadPart - DueTime.QuadPart;
+     
+     /* Get the handle */
+     *Hand = KiComputeTimerTableIndex(Timer->DueTime.QuadPart);
+     Timer->Header.Hand = (UCHAR)*Hand;
+     Timer->Header.Inserted = TRUE;
+     return TRUE;
+ }
  //
  // Called from Unlink and Queue Insert Code.
  // Also called by timer code when canceling an inserted timer.
@@@ -51,6 -51,7 +51,7 @@@ PKDB_KTRAP_FRAME KdbCurrentTrapFrame = 
  STATIC KDB_KTRAP_FRAME KdbTrapFrame = { { 0 } };  /* The trapframe which was passed to KdbEnterDebuggerException */
  STATIC KDB_KTRAP_FRAME KdbThreadTrapFrame = { { 0 } }; /* The trapframe of the current thread (KdbCurrentThread) */
  STATIC KAPC_STATE KdbApcState;
+ extern BOOLEAN KdbpBugCheckRequested;
  
  /* Array of conditions when to enter KDB */
  STATIC KDB_ENTER_CONDITION KdbEnterConditions[][2] =
@@@ -201,7 -202,6 +202,7 @@@ KdbpKdbTrapFrameFromKernelStack(PVOID K
  
     RtlZeroMemory(KdbTrapFrame, sizeof(KDB_KTRAP_FRAME));
     StackPtr = (ULONG_PTR *) KernelStack;
 +#if _M_X86_
     KdbTrapFrame->Tf.Ebp = StackPtr[3];
     KdbTrapFrame->Tf.Edi = StackPtr[4];
     KdbTrapFrame->Tf.Esi = StackPtr[5];
     KdbTrapFrame->Tf.SegDs = KGDT_R0_DATA;
     KdbTrapFrame->Tf.SegEs = KGDT_R0_DATA;
     KdbTrapFrame->Tf.SegGs = KGDT_R0_DATA;
 +#endif
  
     /* FIXME: what about the other registers??? */
  }
@@@ -407,7 -406,7 +408,7 @@@ KdbpStepIntoInstruction(ULONG_PTR Eip
     }
  
     /* Get the interrupt descriptor */
 -   if (!NT_SUCCESS(KdbpSafeReadMemory(IntDesc, (PVOID)(Idtr.Base + (IntVect * 8)), sizeof (IntDesc))))
 +   if (!NT_SUCCESS(KdbpSafeReadMemory(IntDesc, (PVOID)(ULONG_PTR)(Idtr.Base + (IntVect * 8)), sizeof (IntDesc))))
     {
        /*KdbpPrint("Couldn't access memory at 0x%p\n", (ULONG_PTR)Idtr.Base + (IntVect * 8));*/
        return FALSE;
@@@ -1075,7 -1074,7 +1076,7 @@@ KdbpAttachToThread
     /* Get a pointer to the thread */
     if (!NT_SUCCESS(PsLookupThreadByThreadId(ThreadId, &Thread)))
     {
 -      KdbpPrint("Invalid thread id: 0x%08x\n", (ULONG)ThreadId);
 +      KdbpPrint("Invalid thread id: 0x%08x\n", (ULONG_PTR)ThreadId);
        return FALSE;
     }
     Process = Thread->ThreadsProcess;
@@@ -1154,14 -1153,14 +1155,14 @@@ KdbpAttachToProcess
     /* Get a pointer to the process */
     if (!NT_SUCCESS(PsLookupProcessByProcessId(ProcessId, &Process)))
     {
 -      KdbpPrint("Invalid process id: 0x%08x\n", (ULONG)ProcessId);
 +      KdbpPrint("Invalid process id: 0x%08x\n", (ULONG_PTR)ProcessId);
        return FALSE;
     }
  
     Entry = Process->ThreadListHead.Flink;
     if (Entry == &KdbCurrentProcess->ThreadListHead)
     {
 -      KdbpPrint("No threads in process 0x%08x, cannot attach to process!\n", (ULONG)ProcessId);
 +      KdbpPrint("No threads in process 0x%p, cannot attach to process!\n", ProcessId);
        return FALSE;
     }
  
@@@ -1202,7 -1201,7 +1203,7 @@@ KdbpInternalEnter(
     SavedStackLimit = Thread->Tcb.StackLimit;
     SavedKernelStack = Thread->Tcb.KernelStack;
     Thread->Tcb.InitialStack = Thread->Tcb.StackBase = (char*)KdbStack + KDB_STACK_SIZE;
 -   Thread->Tcb.StackLimit = (ULONG)KdbStack;
 +   Thread->Tcb.StackLimit = (ULONG_PTR)KdbStack;
     Thread->Tcb.KernelStack = (char*)KdbStack + KDB_STACK_SIZE;
  
     /*KdbpPrint("Switching to KDB stack 0x%08x-0x%08x (Current Stack is 0x%08x)\n", Thread->Tcb.StackLimit, Thread->Tcb.StackBase, Esp);*/
@@@ -1603,6 -1602,13 +1604,13 @@@ KdbEnterDebuggerException
     /* Leave critical section */
     Ke386RestoreFlags(OldEflags);
  
+    /* Check if user requested a bugcheck */
+    if (KdbpBugCheckRequested)
+    {
+        /* Bugcheck the system */
+        KeBugCheck(MANUALLY_INITIATED_CRASH);
+    }
  continue_execution:
     /* Clear debug status */
     if (ExceptionCode == STATUS_BREAKPOINT) /* FIXME: Why clear DR6 on INT3? */
        TrapFrame->Dr6 &= ~0x0000e00f;
  
        /* Skip the current instruction */
 -      Context->Eip++;
 +//      Context->Eip++;
     }
  
     return ContinueType;
@@@ -227,7 -227,7 +227,7 @@@ KeRosCaptureUserStackBackTrace(IN ULON
      return (USHORT)i;
  }
  
 -
 +#ifndef _M_AMD64
  VOID
  FASTCALL
  KeRosDumpStackFrameArray(IN PULONG Frames,
@@@ -316,7 -316,6 +316,7 @@@ KeRosDumpStackFrames(IN PULONG Frame OP
          }
      }
  }
 +#endif
  
  VOID
  NTAPI
@@@ -726,8 -725,8 +726,8 @@@ KiDisplayBlueScreen(IN ULONG MessageId
  
      /* Show the technical Data */
      sprintf(AnsiName,
 -            "\r\n\r\n*** STOP: 0x%08lX (0x%p,0x%p,0x%p,0x%p)\r\n\r\n",
 -            KiBugCheckData[0],
 +            "\r\n\r\n*** STOP: 0x%p (0x%p,0x%p,0x%p,0x%p)\r\n\r\n",
 +            (PVOID)KiBugCheckData[0],
              (PVOID)KiBugCheckData[1],
              (PVOID)KiBugCheckData[2],
              (PVOID)KiBugCheckData[3],
@@@ -1131,7 -1130,7 +1131,7 @@@ KeBugCheckWithTf(IN ULONG BugCheckCode
              if (i != (LONG)KeGetCurrentProcessorNumber())
              {
                  /* Send the IPI and give them one second to catch up */
-                 KiIpiSendRequest(1 << i, IPI_FREEZE);
+                 KiIpiSend(1 << i, IPI_FREEZE);
                  KeStallExecutionProcessor(1000000);
              }
          }
@@@ -40,7 -40,6 +40,6 @@@ KeSetSystemTime(IN PLARGE_INTEGER NewTi
      PKSPIN_LOCK_QUEUE LockQueue;
      LIST_ENTRY TempList, TempList2;
      ULONG Hand, i;
-     PKTIMER_TABLE_ENTRY TimerEntry;
  
      /* Sanity checks */
      ASSERT((NewTime->HighPart & 0xF0000000) == 0);
      /* Query the system time now */
      KeQuerySystemTime(OldTime);
  
-     /* Set the new system time */
+     /* Set the new system time (ordering of these operations is critical) */
+     SharedUserData->SystemTime.High2Time = NewTime->HighPart;
      SharedUserData->SystemTime.LowPart = NewTime->LowPart;
      SharedUserData->SystemTime.High1Time = NewTime->HighPart;
-     SharedUserData->SystemTime.High2Time = NewTime->HighPart;
  
      /* Check if this was for the HAL and set the RTC time */
      if (HalTime) ExCmosClockIsSane = HalSetRealTimeClock(&TimeFields);
              if (Timer->Header.Absolute)
              {
                  /* Remove it from the timer list */
-                 if (RemoveEntryList(&Timer->TimerListEntry))
-                 {
-                     /* Get the entry and check if it's empty */
-                     TimerEntry = &KiTimerTableListHead[Timer->Header.Hand];
-                     if (IsListEmpty(&TimerEntry->Entry))
-                     {
-                         /* Clear the time then */
-                         TimerEntry->Time.HighPart = 0xFFFFFFFF;
-                     }
-                 }
+                 KiRemoveEntryTimer(Timer);
  
                  /* Insert it into our temporary list */
                  InsertTailList(&TempList, &Timer->TimerListEntry);
          if (KiInsertTimerTable(Timer, Hand))
          {
              /* Remove it from the timer list */
-             if (RemoveEntryList(&Timer->TimerListEntry))
-             {
-                 /* Get the entry and check if it's empty */
-                 TimerEntry = &KiTimerTableListHead[Timer->Header.Hand];
-                 if (IsListEmpty(&TimerEntry->Entry))
-                 {
-                     /* Clear the time then */
-                     TimerEntry->Time.HighPart = 0xFFFFFFFF;
-                 }
-             }
+             KiRemoveEntryTimer(Timer);
  
              /* Insert it into our temporary list */
              InsertTailList(&TempList2, &Timer->TimerListEntry);
          KiReleaseTimerLock(LockQueue);
      }
  
-     /* FIXME: Process expired timers! */
-     KiReleaseDispatcherLock(OldIrql);
+     /* Process expired timers. This releases the dispatcher lock. */
+     KiTimerListExpire(&TempList2, OldIrql);
  
      /* Revert affinity */
      KeRevertToUserAffinityThread();
@@@ -196,7 -177,6 +177,7 @@@ KeQueryTickCount(IN PLARGE_INTEGER Tick
      }
  }
  
 +#ifndef _M_AMD64
  /*
   * @implemented
   */
@@@ -239,7 -219,6 +220,7 @@@ KeQueryInterruptTime(VOID
      /* Return the time value */
      return CurrentTime.QuadPart;
  }
 +#endif
  
  /*
   * @implemented
@@@ -86,13 -86,15 +86,15 @@@ KiTimerExpiration(IN PKDPC Dpc
      LONG Limit, Index, i;
      ULONG Timers, ActiveTimers, DpcCalls;
      PLIST_ENTRY ListHead, NextEntry;
-     PKTIMER_TABLE_ENTRY TimerEntry;
      KIRQL OldIrql;
      PKTIMER Timer;
      PKDPC TimerDpc;
      ULONG Period;
      DPC_QUEUE_ENTRY DpcEntry[MAX_TIMER_DPCS];
      PKSPIN_LOCK_QUEUE LockQueue;
+ #ifdef CONFIG_SMP
+     PKPRCB Prcb = KeGetCurrentPrcb();
+ #endif
  
      /* Disable interrupts */
      _disable();
              {
                  /* It's expired, remove it */
                  ActiveTimers--;
-                 if (RemoveEntryList(&Timer->TimerListEntry))
-                 {
-                     /* Get the entry and check if it's empty */
-                     TimerEntry = &KiTimerTableListHead[Timer->Header.Hand];
-                     if (IsListEmpty(&TimerEntry->Entry))
-                     {
-                         /* Clear the time then */
-                         TimerEntry->Time.HighPart = 0xFFFFFFFF;
-                     }
-                 }
+                 KiRemoveEntryTimer(Timer);
  
                  /* Make it non-inserted, unlock it, and signal it */
                  Timer->Header.Inserted = FALSE;
                  /* Check if we have a DPC */
                  if (TimerDpc)
                  {
-                     /* Setup the DPC Entry */
-                     DpcEntry[DpcCalls].Dpc = TimerDpc;
-                     DpcEntry[DpcCalls].Routine = TimerDpc->DeferredRoutine;
-                     DpcEntry[DpcCalls].Context = TimerDpc->DeferredContext;
-                     DpcCalls++;
+ #ifdef CONFIG_SMP
+                     /* 
+                      * If the DPC is targeted to another processor,
+                      * then insert it into that processor's DPC queue
+                      * instead of delivering it now.
+                      * If the DPC is a threaded DPC, and the current CPU
+                      * has threaded DPCs enabled (KiExecuteDpc is actively parsing DPCs),
+                      * then also insert it into the DPC queue for threaded delivery,
+                      * instead of doing it here.
+                      */
+                     if (((TimerDpc->Number >= MAXIMUM_PROCESSORS) &&
+                         ((TimerDpc->Number - MAXIMUM_PROCESSORS) != Prcb->Number)) ||
+                         ((TimerDpc->Type == ThreadedDpcObject) && (Prcb->ThreadDpcEnable)))
+                     {
+                         /* Queue it */
+                         KeInsertQueueDpc(TimerDpc,
+                                          UlongToPtr(SystemTime.LowPart),
+                                          UlongToPtr(SystemTime.HighPart));
+                     }
+                     else
+ #endif
+                     {
+                         /* Setup the DPC Entry */
+                         DpcEntry[DpcCalls].Dpc = TimerDpc;
+                         DpcEntry[DpcCalls].Routine = TimerDpc->DeferredRoutine;
+                         DpcEntry[DpcCalls].Context = TimerDpc->DeferredContext;
+                         DpcCalls++;
+                         ASSERT(DpcCalls < MAX_TIMER_DPCS);
+                     }
                  }
  
                  /* Check if we're done processing */
      }
  }
  
+ VOID
+ FASTCALL
+ KiTimerListExpire(IN PLIST_ENTRY ExpiredListHead,
+                   IN KIRQL OldIrql)
+ {
+     ULARGE_INTEGER SystemTime;
+     LARGE_INTEGER Interval;
+     LONG i;
+     ULONG DpcCalls = 0;
+     PKTIMER Timer;
+     PKDPC TimerDpc;
+     ULONG Period;
+     DPC_QUEUE_ENTRY DpcEntry[MAX_TIMER_DPCS];
+ #ifdef CONFIG_SMP
+     PKPRCB Prcb = KeGetCurrentPrcb();
+ #endif
+     /* Query system */
+     KeQuerySystemTime((PLARGE_INTEGER)&SystemTime);
+     
+     /* Loop expired list */
+     while (ExpiredListHead->Flink != ExpiredListHead)
+     {
+         /* Get the current timer */
+         Timer = CONTAINING_RECORD(ExpiredListHead->Flink, KTIMER, TimerListEntry);
+         
+         /* Remove it */
+         RemoveEntryList(&Timer->TimerListEntry);
+         
+         /* Not inserted */
+         Timer->Header.Inserted = FALSE;
+         
+         /* Signal it */
+         Timer->Header.SignalState = 1;
+         
+         /* Get the DPC and period */
+         TimerDpc = Timer->Dpc;
+         Period = Timer->Period;
+         
+         /* Check if there's any waiters */
+         if (!IsListEmpty(&Timer->Header.WaitListHead))
+         {
+             /* Check the type of event */
+             if (Timer->Header.Type == TimerNotificationObject)
+             {
+                 /* Unwait the thread */
+                 KxUnwaitThread(&Timer->Header, IO_NO_INCREMENT);
+             }
+             else
+             {
+                 /* Otherwise unwait the thread and signal the timer */
+                 KxUnwaitThreadForEvent((PKEVENT)Timer, IO_NO_INCREMENT);
+             }
+         }
+         
+         /* Check if we have a period */
+         if (Period)
+         {
+             /* Calculate the interval and insert the timer */
+             Interval.QuadPart = Int32x32To64(Period, -10000);
+             while (!KiInsertTreeTimer(Timer, Interval));
+         }
+         /* Check if we have a DPC */
+         if (TimerDpc)
+         {
+ #ifdef CONFIG_SMP
+             /* 
+              * If the DPC is targeted to another processor,
+              * then insert it into that processor's DPC queue
+              * instead of delivering it now.
+              * If the DPC is a threaded DPC, and the current CPU
+              * has threaded DPCs enabled (KiExecuteDpc is actively parsing DPCs),
+              * then also insert it into the DPC queue for threaded delivery,
+              * instead of doing it here.
+              */
+             if (((TimerDpc->Number >= MAXIMUM_PROCESSORS) &&
+                 ((TimerDpc->Number - MAXIMUM_PROCESSORS) != Prcb->Number)) ||
+                 ((TimerDpc->Type == ThreadedDpcObject) && (Prcb->ThreadDpcEnable)))
+             {
+                 /* Queue it */
+                 KeInsertQueueDpc(TimerDpc,
+                                  UlongToPtr(SystemTime.LowPart),
+                                  UlongToPtr(SystemTime.HighPart));
+             }
+             else
+ #endif
+             {
+                 /* Setup the DPC Entry */
+                 DpcEntry[DpcCalls].Dpc = TimerDpc;
+                 DpcEntry[DpcCalls].Routine = TimerDpc->DeferredRoutine;
+                 DpcEntry[DpcCalls].Context = TimerDpc->DeferredContext;
+                 DpcCalls++;
+                 ASSERT(DpcCalls < MAX_TIMER_DPCS);
+             }
+         }
+     }
+     
+     /* Check if we still have DPC entries */
+     if (DpcCalls)
+     {
+         /* Release the dispatcher while doing DPCs */
+         KiReleaseDispatcherLock(DISPATCH_LEVEL);
+         
+         /* Start looping all DPC Entries */
+         for (i = 0; DpcCalls; DpcCalls--, i++)
+         {
+             /* Call the DPC */
+             DpcEntry[i].Routine(DpcEntry[i].Dpc,
+                                 DpcEntry[i].Context,
+                                 UlongToPtr(SystemTime.LowPart),
+                                 UlongToPtr(SystemTime.HighPart));
+         }
+         
+         /* Lower IRQL */
+         KeLowerIrql(OldIrql);
+     }
+     else
+     {
+         /* Unlock the dispatcher */
+         KiReleaseDispatcherLock(OldIrql);
+     }
+ }
  VOID
  NTAPI
  KiQuantumEnd(VOID)
@@@ -437,7 -578,7 +578,7 @@@ KiRetireDpcList(IN PKPRCB Prcb
          while (DpcData->DpcQueueDepth != 0)
          {
              /* Lock the DPC data and get the DPC entry*/
 -            KefAcquireSpinLockAtDpcLevel(&DpcData->DpcLock);
 +            KeAcquireSpinLockAtDpcLevel(&DpcData->DpcLock);
              DpcEntry = ListHead->Flink;
  
              /* Make sure we have an entry */
  
                  /* Decrease the queue depth */
                  DpcData->DpcQueueDepth--;
 -
 +#ifndef _M_AMD64
                  /* Clear DPC Time */
                  Prcb->DebugDpcTime = 0;
 -
 +#endif
                  /* Release the lock */
 -                KefReleaseSpinLockFromDpcLevel(&DpcData->DpcLock);
 +                KeReleaseSpinLockFromDpcLevel(&DpcData->DpcLock);
  
                  /* Re-enable interrupts */
                  _enable();
                  ASSERT(DpcData->DpcQueueDepth == 0);
  
                  /* Release DPC Lock */
 -                KefReleaseSpinLockFromDpcLevel(&DpcData->DpcLock);
 +                KeReleaseSpinLockFromDpcLevel(&DpcData->DpcLock);
              }
          }
  
@@@ -683,7 -824,7 +824,7 @@@ KeInsertQueueDpc(IN PKDPC Dpc
          if (Prcb != CurrentPrcb)
          {
              /* It was, request and IPI */
-             KiIpiSendRequest(AFFINITY_MASK(Cpu), IPI_DPC);
+             KiIpiSend(AFFINITY_MASK(Cpu), IPI_DPC);
          }
          else
          {
@@@ -206,30 -206,30 +206,30 @@@ KiGetCpuVendor(VOID
      Prcb->VendorString[sizeof(Prcb->VendorString) - sizeof(CHAR)] = ANSI_NULL;
  
      /* Now check the CPU Type */
 -    if (!strcmp(Prcb->VendorString, CmpIntelID))
 +    if (!strcmp((PCHAR)Prcb->VendorString, CmpIntelID))
      {
          return CPU_INTEL;
      }
 -    else if (!strcmp(Prcb->VendorString, CmpAmdID))
 +    else if (!strcmp((PCHAR)Prcb->VendorString, CmpAmdID))
      {
          return CPU_AMD;
      }
 -    else if (!strcmp(Prcb->VendorString, CmpCyrixID))
 +    else if (!strcmp((PCHAR)Prcb->VendorString, CmpCyrixID))
      {
          DPRINT1("Cyrix CPU support not fully tested!\n");
          return CPU_CYRIX;
      }
 -    else if (!strcmp(Prcb->VendorString, CmpTransmetaID))
 +    else if (!strcmp((PCHAR)Prcb->VendorString, CmpTransmetaID))
      {
          DPRINT1("Transmeta CPU support not fully tested!\n");
          return CPU_TRANSMETA;
      }
 -    else if (!strcmp(Prcb->VendorString, CmpCentaurID))
 +    else if (!strcmp((PCHAR)Prcb->VendorString, CmpCentaurID))
      {
          DPRINT1("Centaur CPU support not fully tested!\n");
          return CPU_CENTAUR;
      }
 -    else if (!strcmp(Prcb->VendorString, CmpRiseID))
 +    else if (!strcmp((PCHAR)Prcb->VendorString, CmpRiseID))
      {
          DPRINT1("Rise CPU support not fully tested!\n");
          return CPU_RISE;
@@@ -994,6 -994,20 +994,20 @@@ KeGetRecommendedSharedDataAlignment(VOI
      return KeLargestCacheLine;
  }
  
+ VOID
+ NTAPI
+ KiFlushTargetEntireTb(IN PKIPI_CONTEXT PacketContext,
+                       IN PVOID Ignored1,
+                       IN PVOID Ignored2,
+                       IN PVOID Ignored3)
+ {
+     /* Signal this packet as done */
+     KiIpiSignalPacketDone(PacketContext);
+     /* Flush the TB for the Current CPU */
+     KeFlushCurrentTb();
+ }
  /*
   * @implemented
   */
@@@ -1003,19 -1017,50 +1017,50 @@@ KeFlushEntireTb(IN BOOLEAN Invalid
                  IN BOOLEAN AllProcessors)
  {
      KIRQL OldIrql;
+ #ifdef CONFIG_SMP
+     KAFFINITY TargetAffinity;
+     PKPRCB Prcb = KeGetCurrentPrcb();
+ #endif
  
      /* Raise the IRQL for the TB Flush */
      OldIrql = KeRaiseIrqlToSynchLevel();
  
  #ifdef CONFIG_SMP
-     /* FIXME: Support IPI Flush */
- #error Not yet implemented!
+     /* FIXME: Use KiTbFlushTimeStamp to synchronize TB flush */
+     /* Get the current processor affinity, and exclude ourselves */
+     TargetAffinity = KeActiveProcessors;
+     TargetAffinity &= ~Prcb->SetMember;
+     /* Make sure this is MP */
+     if (TargetAffinity)
+     {
+         /* Send an IPI TB flush to the other processors */
+         KiIpiSendPacket(TargetAffinity,
+                         KiFlushTargetEntireTb,
+                         NULL,
+                         0,
+                         NULL);
+     }
  #endif
  
-     /* Flush the TB for the Current CPU */
+     /* Flush the TB for the Current CPU, and update the flush stamp */
      KeFlushCurrentTb();
  
-     /* Return to Original IRQL */
+ #ifdef CONFIG_SMP
+     /* If this is MP, wait for the other processors to finish */
+     if (TargetAffinity)
+     {
+         /* Sanity check */
+         ASSERT(Prcb == (volatile PKPRCB)KeGetCurrentPrcb());
+         /* FIXME: TODO */
+         ASSERTMSG("Not yet implemented\n", FALSE);
+     }
+ #endif
+     /* Update the flush stamp and return to original IRQL */
+     InterlockedExchangeAdd(&KiTbFlushTimeStamp, 1);
      KeLowerIrql(OldIrql);
  }
  
@@@ -57,7 -57,7 +57,7 @@@ KiActivateWaiterQueue(IN PKQUEUE Queue
                                            KWAIT_BLOCK,
                                            WaitListEntry);
              Thread = WaitBlock->Thread;
 -            KiUnwaitThread(Thread, (NTSTATUS)QueueEntry, IO_NO_INCREMENT);
 +            KiUnwaitThread(Thread, (LONG_PTR)QueueEntry, IO_NO_INCREMENT);
          }
      }
  }
@@@ -102,7 -102,7 +102,7 @@@ KiInsertQueue(IN PKQUEUE Queue
          Thread = WaitBlock->Thread;
  
          /* Remove the queue from the thread's wait list */
 -        Thread->WaitStatus = (NTSTATUS)Entry;
 +        Thread->WaitStatus = (LONG_PTR)Entry;
          if (Thread->WaitListEntry.Flink) RemoveEntryList(&Thread->WaitListEntry);
  
          /* Increase the active threads and remove any wait reason */
@@@ -239,7 -239,7 +239,7 @@@ KeRemoveQueue(IN PKQUEUE Queue
                IN PLARGE_INTEGER Timeout OPTIONAL)
  {
      PLIST_ENTRY QueueEntry;
 -    NTSTATUS Status;
 +    LONG_PTR Status;
      PKTHREAD Thread = KeGetCurrentThread();
      PKQUEUE PreviousQueue;
      PKWAIT_BLOCK WaitBlock = &Thread->WaitBlock[0];
@@@ -436,8 -436,7 +436,7 @@@ PLIST_ENTR
  NTAPI
  KeRundownQueue(IN PKQUEUE Queue)
  {
-     PLIST_ENTRY ListHead, NextEntry;
-     PLIST_ENTRY FirstEntry = NULL;
+     PLIST_ENTRY FirstEntry, NextEntry;
      PKTHREAD Thread;
      KIRQL OldIrql;
      ASSERT_QUEUE(Queue);
  
      /* Get the Dispatcher Lock */
      OldIrql = KiAcquireDispatcherLock();
-     /* Make sure the list is not empty */
-     if (!IsListEmpty(&Queue->EntryListHead))
+  
+     /* Check if the list is empty */
+     FirstEntry = Queue->EntryListHead.Flink;
+     if (FirstEntry == &Queue->EntryListHead)
      {
-         /* Remove it */
-         FirstEntry = RemoveHeadList(&Queue->EntryListHead);
+         /* We won't return anything */
+         FirstEntry = NULL;
      }
-     /* Unlink threads and clear their Thread->Queue */
-     ListHead = &Queue->ThreadListHead;
-     NextEntry = ListHead->Flink;
-     while (ListHead != NextEntry)
+     else
+     {
+         /* Remove this entry */
+         RemoveEntryList(&Queue->EntryListHead);
+     }
+  
+     /* Loop the list */
+     while (!IsListEmpty(&Queue->ThreadListHead))
      {
-         /* Get the Entry's Thread */
+         /* Get the next entry */
+         NextEntry = Queue->ThreadListHead.Flink;
+  
+         /* Get the associated thread */
          Thread = CONTAINING_RECORD(NextEntry, KTHREAD, QueueListEntry);
  
-         /* Kill its Queue */
+         /* Clear its queue */
          Thread->Queue = NULL;
  
          /* Remove this entry */
          RemoveEntryList(NextEntry);
-         /* Get the next entry */
-         NextEntry = NextEntry->Flink;
      }
  
-     /* Release the lock and return */
-     KiReleaseDispatcherLock(OldIrql);
+     /* Release the dispatcher lock */
+     KiReleaseDispatcherLockFromDpcLevel();
+  
+     /* Exit the dispatcher and return the first entry (if any) */
+     KiExitDispatcher(OldIrql);
      return FirstEntry;
  }
  
@@@ -253,7 -253,7 +253,7 @@@ KiDeferredReadyThread(IN PKTHREAD Threa
              if (KeGetCurrentProcessorNumber() != Thread->NextProcessor)
              {
                  /* We are, send an IPI */
-                 KiIpiSendRequest(AFFINITY_MASK(Thread->NextProcessor), IPI_DPC);
+                 KiIpiSend(AFFINITY_MASK(Thread->NextProcessor), IPI_DPC);
              }
              return;
          }
@@@ -308,7 -308,7 +308,7 @@@ KiSelectNextThread(IN PKPRCB Prcb
      return Thread;
  }
  
 -NTSTATUS
 +LONG_PTR
  FASTCALL
  KiSwapThread(IN PKTHREAD CurrentThread,
               IN PKPRCB Prcb)
@@@ -612,7 -612,7 +612,7 @@@ KiSetPriorityThread(IN PKTHREAD Thread
                          if (KeGetCurrentProcessorNumber() != Processor)
                          {
                              /* We are, send an IPI */
-                             KiIpiSendRequest(AFFINITY_MASK(Processor), IPI_DPC);
+                             KiIpiSend(AFFINITY_MASK(Processor), IPI_DPC);
                          }
                      }
                  }
index 1e39788,0000000..2d7d68e
mode 100644,000000..100644
--- /dev/null
@@@ -1,489 -1,0 +1,488 @@@
-       <file>ntoskrnl.pspec</file>
 +<?xml version="1.0"?>
 +<!DOCTYPE module SYSTEM "../tools/rbuild/project.dtd">
 +<module name="ntoskrnl" type="kernel" installbase="system32" installname="ntoskrnl.exe" baseaddress="0xfffff80000800000" entrypoint="KiSystemStartup" allowwarnings="true">
 +      <bootstrap installbase="$(CDOUTPUT)" />
 +      <importlibrary definition="ntoskrnl.pspec" />
 +      <define name="_DISABLE_TIDENTS" />
 +      <define name="__NTOSKRNL__" />
 +      <define name="_NTOSKRNL_" />
 +      <define name="_NTSYSTEM_" />
 +      <define name="__NO_CTYPE_INLINES" />
 +      <define name="WIN9X_COMPAT_SPINLOCK" />
 +      <define name="_IN_KERNEL_" />
 +      <if property="_WINKD_" value="1">
 +              <define name="_WINKD_" />
 +      </if>
 +      <if property="_ELF_" value="1">
 +              <define name="_ELF_" />
 +      </if>
 +      <include base="cmlib">.</include>
 +      <include base="ntoskrnl">include</include>
 +      <include base="ntoskrnl" root="intermediate"></include>
 +      <include base="ntoskrnl" root="intermediate">include</include>
 +      <include base="ntoskrnl" root="intermediate">include/internal</include>
 +      <include base="ReactOS">include/reactos/drivers</include>
 +      <library>csq</library>
 +      <library>hal</library>
 +      <library>pseh</library>
 +      <library>cmlib</library>
 +      <library>rtl</library>
 +      <library>rossym</library>
 +      <library>libcntpr</library>
 +      <library>kdcom</library>
 +      <library>bootvid</library>
 +      <library>wdmguid</library>
 +      <dependency>bugcodes</dependency>
 +      <directory name="include">
 +              <pch>ntoskrnl.h</pch>
 +      </directory>
 +      <file>amd64stubs.c</file>
 +      <directory name="ke">
 +              <if property="ARCH" value="i386">
 +                      <directory name="i386">
 +                              <file first="true">boot.S</file>
 +                              <file>abios.c</file>
 +                              <file>cpu.c</file>
 +                              <file>ctxswitch.S</file>
 +                              <file>exp.c</file>
 +                              <file>irqobj.c</file>
 +                              <file>kiinit.c</file>
 +                              <file>ldt.c</file>
 +                              <file>mtrr.c</file>
 +                              <file>patpge.c</file>
 +                              <file>systimer.S</file>
 +                              <file>thrdini.c</file>
 +                              <file>trap.s</file>
 +                              <file>usercall_asm.S</file>
 +                              <file>usercall.c</file>
 +                              <file>v86vdm.c</file>
 +                              <file>v86m_sup.S</file>
 +                      </directory>
 +              </if>
 +              <if property="ARCH" value="arm">
 +                      <directory name="arm">
 +                              <file first="true">boot.s</file>
 +                              <file>cpu.c</file>
 +                              <file>ctxswtch.s</file>
 +                              <file>exp.c</file>
 +                              <file>kiinit.c</file>
 +                              <file>stubs_asm.s</file>
 +                              <file>thrdini.c</file>
 +                              <file>time.c</file>
 +                              <file>trap.s</file>
 +                              <file>trapc.c</file>
 +                              <file>usercall.c</file>
 +                      </directory>
 +              </if>
 +              <if property="ARCH" value="powerpc">
 +                      <directory name="powerpc">
 +                              <file first="true">main_asm.S</file>
 +                              <file>cpu.c</file>
 +                              <file>exp.c</file>
 +                              <file>kiinit.c</file>
 +                              <file>ppc_irq.c</file>
 +                              <file>stubs.c</file>
 +                              <file>systimer.c</file>
 +                              <file>thrdini.c</file>
 +                              <file>ctxswitch.c</file>
 +                              <file>ctxhelp.S</file>
 +                      </directory>
 +              </if>
 +              <if property="ARCH" value="amd64">
 +                      <directory name="amd64">
 +                              <file first="true">boot.S</file>
 +                              <file>cpu.c</file>
 +                              <file>ctxswitch.S</file>
 +                              <file>except.c</file>
 +                              <file>irql.c</file>
 +                              <file>kiinit.c</file>
 +                              <file>spinlock.c</file>
 +                              <file>thrdini.c</file>
 +                              <file>trap.S</file>
 +                      </directory>
 +              </if>
 +              <file>apc.c</file>
 +              <file>balmgr.c</file>
 +              <file>bug.c</file>
 +              <file>clock.c</file>
 +              <file>config.c</file>
 +              <file>devqueue.c</file>
 +              <file>dpc.c</file>
 +              <file>eventobj.c</file>
 +              <file>except.c</file>
 +              <file>freeldr.c</file>
 +              <file>gate.c</file>
 +              <file>gmutex.c</file>
 +              <file>ipi.c</file>
 +              <file>krnlinit.c</file>
 +              <file>mutex.c</file>
 +              <file>procobj.c</file>
 +              <file>profobj.c</file>
 +              <file>queue.c</file>
 +              <file>semphobj.c</file>
 +              <file>spinlock.c</file>
 +              <file>thrdschd.c</file>
 +              <file>thrdobj.c</file>
 +              <file>timerobj.c</file>
 +              <file>wait.c</file>
 +      </directory>
 +      <directory name="cc">
 +              <file>cacheman.c</file>
 +              <file>copy.c</file>
 +              <file>fs.c</file>
 +              <file>mdl.c</file>
 +              <file>pin.c</file>
 +              <file>view.c</file>
 +      </directory>
 +      <directory name="config">
 +              <if property="ARCH" value="i386">
 +                      <directory name="i386">
 +                              <file>cmhardwr.c</file>
 +                      </directory>
 +              </if>
 +              <if property="ARCH" value="amd64">
 +                      <directory name="i386">
 +                              <file>cmhardwr.c</file>
 +                      </directory>
 +              </if>
 +              <if property="ARCH" value="arm">
 +                      <directory name="arm">
 +                              <file>cmhardwr.c</file>
 +                      </directory>
 +              </if>
 +              <if property="ARCH" value="powerpc">
 +                      <directory name="powerpc">
 +                              <file>cmhardwr.c</file>
 +                      </directory>
 +              </if>
 +              <file>cmalloc.c</file>
 +              <file>cmapi.c</file>
 +              <file>cmboot.c</file>
 +              <file>cmcheck.c</file>
 +              <file>cmcontrl.c</file>
 +              <file>cmconfig.c</file>
 +              <file>cmdata.c</file>
 +              <file>cmdelay.c</file>
 +              <file>cmindex.c</file>
 +              <file>cminit.c</file>
 +              <file>cmhook.c</file>
 +              <file>cmkcbncb.c</file>
 +              <file>cmkeydel.c</file>
 +              <file>cmlazy.c</file>
 +              <file>cmmapvw.c</file>
 +              <file>cmname.c</file>
 +              <file>cmparse.c</file>
 +              <file>cmse.c</file>
 +              <file>cmsecach.c</file>
 +              <file>cmsysini.c</file>
 +              <file>cmvalue.c</file>
 +              <file>cmvalche.c</file>
 +              <file>cmwraprs.c</file>
 +              <file>ntapi.c</file>
 +      </directory>
 +      <directory name="dbgk">
 +              <file>dbgkutil.c</file>
 +              <file>dbgkobj.c</file>
 +      </directory>
 +      <directory name="ex" root="intermediate">
 +              <file>zw.S</file>
 +      </directory>
 +      <directory name="ex">
 +              <if property="ARCH" value="i386">
 +                      <directory name="i386">
 +                              <file>interlck_asm.S</file>
 +                              <file>fastinterlck_asm.S</file>
 +                              <file>ioport.S</file>
 +                      </directory>
 +              </if>
 +              <file>atom.c</file>
 +              <file>callback.c</file>
 +              <file>dbgctrl.c</file>
 +              <file>efi.c</file>
 +              <file>event.c</file>
 +              <file>evtpair.c</file>
 +              <file>exintrin.c</file>
 +              <file>fastinterlck.c</file>
 +              <file>fmutex.c</file>
 +              <file>handle.c</file>
 +              <file>harderr.c</file>
 +              <file>hdlsterm.c</file>
 +              <file>init.c</file>
 +              <file>keyedevt.c</file>
 +              <file>locale.c</file>
 +              <file>lookas.c</file>
 +              <file>mutant.c</file>
 +              <file>pushlock.c</file>
 +              <file>profile.c</file>
 +              <file>resource.c</file>
 +              <file>rundown.c</file>
 +              <file>sem.c</file>
 +              <file>shutdown.c</file>
 +              <file>sysinfo.c</file>
 +              <file>time.c</file>
 +              <file>timer.c</file>
 +              <file>uuid.c</file>
 +              <file>win32k.c</file>
 +              <file>work.c</file>
 +              <file>xipdisp.c</file>
 +              <file>zone.c</file>
 +      </directory>
 +      <directory name="fsrtl">
 +              <file>dbcsname.c</file>
 +              <file>fastio.c</file>
 +              <file>faulttol.c</file>
 +              <file>filelock.c</file>
 +              <file>filter.c</file>
 +              <file>filtrctx.c</file>
 +              <file>fsfilter.c</file>
 +              <file>fsrtlpc.c</file>
 +              <file>largemcb.c</file>
 +              <file>name.c</file>
 +              <file>notify.c</file>
 +              <file>oplock.c</file>
 +              <file>pnp.c</file>
 +              <file>stackovf.c</file>
 +              <file>tunnel.c</file>
 +              <file>unc.c</file>
 +      </directory>
 +      <directory name="fstub">
 +              <file>disksup.c</file>
 +              <file>fstubex.c</file>
 +              <file>halstub.c</file>
 +      </directory>
 +      <directory name="inbv">
 +              <file>inbv.c</file>
 +      </directory>
 +      <directory name="io">
 +              <directory name="iomgr">
 +                      <file>adapter.c</file>
 +                      <file>arcname.c</file>
 +                      <file>bootlog.c</file>
 +                      <file>controller.c</file>
 +                      <file>device.c</file>
 +                      <file>deviface.c</file>
 +                      <file>driver.c</file>
 +                      <file>drvrlist.c</file>
 +                      <file>error.c</file>
 +                      <file>file.c</file>
 +                      <file>iocomp.c</file>
 +                      <file>ioevent.c</file>
 +                      <file>iofunc.c</file>
 +                      <file>iomdl.c</file>
 +                      <file>iomgr.c</file>
 +                      <file>iorsrce.c</file>
 +                      <file>iotimer.c</file>
 +                      <file>iowork.c</file>
 +                      <file>irp.c</file>
 +                      <file>irq.c</file>
 +                      <file>ramdisk.c</file>
 +                      <file>rawfs.c</file>
 +                      <file>remlock.c</file>
 +                      <file>util.c</file>
 +                      <file>symlink.c</file>
 +                      <file>volume.c</file>
 +              </directory>
 +              <directory name="pnpmgr">
 +                      <file>plugplay.c</file>
 +                      <file>pnpdma.c</file>
 +                      <file>pnpmgr.c</file>
 +                      <file>pnpnotify.c</file>
 +                      <file>pnpreport.c</file>
 +                      <file>pnproot.c</file>
 +              </directory>
 +      </directory>
 +      <if property="_WINKD_" value="0">
 +              <directory name="kdbg">
 +                      <if property="ARCH" value="i386">
 +                              <directory name="i386">
 +                                      <if property="KDBG" value="1">
 +                                              <group>
 +                                                      <file>i386-dis.c</file>
 +                                                      <file>kdb_help.S</file>
 +                                                      <file>longjmp.S</file>
 +                                                      <file>setjmp.S</file>
 +                                              </group>
 +                                      </if>
 +                              </directory>
 +                      </if>
 +                      <if property="KDBG" value="1">
 +                              <!-- file>kdb.c</file -->
 +                              <!-- file>kdb_cli.c</file -->
 +                              <!-- file>kdb_expr.c</file -->
 +                              <file>kdb_keyboard.c</file>
 +                              <file>kdb_serial.c</file>
 +                              <if property="ARCH" value="amd64">
 +                                      <directory name="amd64">
 +                                              <file>kdb.c</file>
 +                                      </directory>
 +                              </if>
 +                      </if>
 +                      <if property="DBG_OR_KDBG" value="true">
 +                              <file>kdb_symbols.c</file>
 +                      </if>
 +              </directory>
 +              <directory name="kd">
 +                      <directory name="wrappers">
 +                              <file>bochs.c</file>
 +                              <if property="ARCH" value="i386">
 +                                      <file>gdbstub.c</file>
 +                              </if>
 +                              <if property="ARCH" value="powerpc">
 +                                      <file>gdbstub_powerpc.c</file>
 +                              </if>
 +                              <file>kdbg.c</file>
 +                      </directory>
 +                      <file>kdinit.c</file>
 +                      <file>kdio.c</file>
 +                      <file>kdmain.c</file>
 +              </directory>
 +      </if>
 +      <if property="_WINKD_" value ="1">
 +              <directory name="kd64">
 +                      <file>kdapi.c</file>
 +                      <file>kdbreak.c</file>
 +                      <file>kddata.c</file>
 +                      <file>kdinit.c</file>
 +                      <file>kdlock.c</file>
 +                      <file>kdprint.c</file>
 +                      <file>kdtrap.c</file>
 +              </directory>
 +      </if>
 +      <directory name="lpc">
 +              <file>close.c</file>
 +              <file>complete.c</file>
 +              <file>connect.c</file>
 +              <file>create.c</file>
 +              <file>listen.c</file>
 +              <file>port.c</file>
 +              <file>reply.c</file>
 +              <file>send.c</file>
 +      </directory>
 +      <directory name="mm">
 +              <if property="ARCH" value="i386">
 +                      <directory name="i386">
 +                              <file>page.c</file>
 +                      </directory>
 +              </if>
 +              <if property="ARCH" value="arm">
 +                      <directory name="arm">
 +                              <file>stubs.c</file>
 +                      </directory>
 +              </if>
 +              <if property="ARCH" value="powerpc">
 +                      <directory name="powerpc">
 +                              <file>pfault.c</file>
 +                              <file>page.c</file>
 +                      </directory>
 +              </if>
 +              <if property="ARCH" value="amd64">
 +                      <directory name="amd64">
 +                              <file>page.c</file>
 +                      </directory>
 +              </if>
 +              <file>anonmem.c</file>
 +              <file>balance.c</file>
 +              <file>cont.c</file>
 +              <file>drvlck.c</file>
 +              <file>freelist.c</file>
 +              <file>iospace.c</file>
 +              <file>kmap.c</file>
 +              <file>marea.c</file>
 +              <file>mdlsup.c</file>
 +              <file>mm.c</file>
 +              <file>mminit.c</file>
 +              <file>mpw.c</file>
 +              <file>ncache.c</file>
 +              <file>npool.c</file>
 +              <file>pagefile.c</file>
 +              <file>pageop.c</file>
 +              <file>pe.c</file>
 +              <file>physical.c</file>
 +              <file>pool.c</file>
 +              <file>ppool.c</file>
 +              <file>procsup.c</file>
 +              <file>region.c</file>
 +              <file>rmap.c</file>
 +              <file>section.c</file>
 +              <file>sysldr.c</file>
 +              <file>verifier.c</file>
 +              <file>virtual.c</file>
 +              <file>wset.c</file>
 +              <if property="_ELF_" value="1">
 +                      <file>elf32.c</file>
 +                      <file>elf64.c</file>
 +              </if>
 +      </directory>
 +      <directory name="ob">
 +              <file>obdir.c</file>
 +              <file>obinit.c</file>
 +              <file>obhandle.c</file>
 +              <file>obname.c</file>
 +              <file>oblife.c</file>
 +              <file>obref.c</file>
 +              <file>obsdcach.c</file>
 +              <file>obsecure.c</file>
 +              <file>oblink.c</file>
 +              <file>obwait.c</file>
 +      </directory>
 +      <directory name="po">
 +              <file>power.c</file>
 +              <file>events.c</file>
 +      </directory>
 +      <directory name="ps">
 +              <if property="ARCH" value="i386">
 +                      <directory name="i386">
 +                              <file>psctx.c</file>
 +                      </directory>
 +              </if>
 +              <if property="ARCH" value="arm">
 +                      <directory name="arm">
 +                              <file>psctx.c</file>
 +                      </directory>
 +              </if>
 +              <file>debug.c</file>
 +              <file>job.c</file>
 +              <file>kill.c</file>
 +              <file>psnotify.c</file>
 +              <file>process.c</file>
 +              <file>psmgr.c</file>
 +              <file>query.c</file>
 +              <file>quota.c</file>
 +              <file>security.c</file>
 +              <file>state.c</file>
 +              <file>thread.c</file>
 +              <file>win32.c</file>
 +      </directory>
 +      <directory name="rtl">
 +              <if property="ARCH" value="arm">
 +                      <directory name="arm">
 +                              <file>rtlexcpt.c</file>
 +                      </directory>
 +              </if>
 +              <file>libsupp.c</file>
 +              <file>misc.c</file>
 +      </directory>
 +      <directory name="se">
 +              <file>access.c</file>
 +              <file>acl.c</file>
 +              <file>audit.c</file>
 +              <file>lsa.c</file>
 +              <file>priv.c</file>
 +              <file>sd.c</file>
 +              <file>semgr.c</file>
 +              <file>sid.c</file>
 +              <file>token.c</file>
 +      </directory>
 +      <directory name="vdm">
 +              <if property="ARCH" value="i386">
 +                      <file>vdmmain.c</file>
 +                      <file>vdmexec.c</file>
 +              </if>
 +      </directory>
 +      <directory name="wmi">
 +              <file>wmi.c</file>
 +      </directory>
 +      <file>ntoskrnl.rc</file>
 +      <linkerscript>ntoskrnl_$(ARCH).lnk</linkerscript>
 +</module>
 +
@@@ -1,4 -1,4 +1,4 @@@
- #include "include/reactos/msvctarget.h"
+ #include <msvctarget.h>
  
  @ stdcall CcCanIWrite(ptr long long long)
  @ stdcall CcCopyRead(ptr ptr long long ptr ptr)
@@@ -55,9 -55,6 +55,9 @@@
  @ stdcall DbgPrompt(str ptr long)
  @ stdcall DbgQueryDebugFilterState(long long)
  @ stdcall DbgSetDebugFilterState(long long long)
 +#ifdef __x86_64__
 +@ fastcall ExAcquireFastMutex(ptr)
 +#endif
  @ fastcall ExAcquireFastMutexUnsafe(ptr)
  @ stdcall ExAcquireResourceExclusiveLite(ptr long)
  @ stdcall ExAcquireResourceSharedLite(ptr long)
@@@ -83,8 -80,8 +83,8 @@@
  @ stdcall ExDisableResourceBoostLite(ptr)
  @ fastcall ExEnterCriticalRegionAndAcquireFastMutexUnsafe(ptr)
  @ stdcall ExEnterCriticalRegionAndAcquireResourceExclusive(ptr)
- ;ExEnterCriticalRegionAndAcquireResourceShared
- ;ExEnterCriticalRegionAndAcquireSharedWaitForExclusive
+ @ stdcall ExEnterCriticalRegionAndAcquireResourceShared(ptr)
+ @ stdcall ExEnterCriticalRegionAndAcquireSharedWaitForExclusive(ptr)
  @ stdcall ExEnumHandleTable(ptr ptr ptr ptr)
  @ extern ExEventObjectType _ExEventObjectType
  @ stdcall ExExtendZone(ptr ptr long)
  @ stdcall ExInterlockedAddLargeInteger(ptr long long ptr)
  @ fastcall ExInterlockedAddLargeStatistic(ptr long)
  @ stdcall ExInterlockedAddUlong(ptr long ptr)
 +#ifndef __x86_64__
  @ fastcall ExInterlockedCompareExchange64(ptr ptr ptr ptr)
  @ stdcall ExInterlockedDecrementLong(ptr ptr)
  @ stdcall ExInterlockedExchangeUlong(ptr long ptr)
 +#endif
  @ stdcall ExInterlockedExtendZone(ptr ptr long ptr)
 +#ifndef __x86_64__
  @ fastcall ExInterlockedFlushSList(ptr)
  @ stdcall ExInterlockedIncrementLong(ptr ptr)
 +#endif
  @ stdcall ExInterlockedInsertHeadList(ptr ptr ptr)
  @ stdcall ExInterlockedInsertTailList(ptr ptr ptr)
  @ stdcall ExInterlockedPopEntryList(ptr ptr)
 +#ifndef __x86_64__
  @ fastcall ExInterlockedPopEntrySList(ptr ptr)
 +#endif
  @ stdcall ExInterlockedPushEntryList(ptr ptr ptr)
 +#ifndef __x86_64__
  @ fastcall ExInterlockedPushEntrySList(ptr ptr ptr)
 +#endif
  @ stdcall ExInterlockedRemoveHeadList(ptr ptr)
  @ stdcall ExIsProcessorFeaturePresent(long)
  @ stdcall ExIsResourceAcquiredExclusiveLite(ptr)
  @ fastcall ExReInitializeRundownProtectionCacheAware(ptr) ExfReInitializeRundownProtectionCacheAware
  @ stdcall ExRegisterCallback(ptr ptr ptr)
  @ stdcall ExReinitializeResourceLite(ptr)
 +#ifdef __x86_64__
 +@ fastcall ExReleaseFastMutex(ptr)
 +#endif
  @ fastcall ExReleaseFastMutexUnsafe(ptr)
  @ fastcall ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(ptr)
  @ fastcall ExReleaseResourceAndLeaveCriticalRegion(ptr)
  @ stdcall ExSizeOfRundownProtectionCacheAware()
  @ stdcall ExSystemExceptionFilter()
  @ stdcall ExSystemTimeToLocalTime(ptr ptr)
 +#ifdef __x86_64__
 +@ fastcall ExTryToAcquireFastMutex(ptr)
 +#endif
  @ stdcall ExUnregisterCallback(ptr)
  @ stdcall ExUuidCreate(ptr)
  @ stdcall ExVerifySuite(long)
  @ extern ExWindowStationObjectType
  @ fastcall ExfAcquirePushLockExclusive(ptr)
  @ fastcall ExfAcquirePushLockShared(ptr)
 +#ifndef __x86_64__
  @ fastcall ExfInterlockedAddUlong(ptr long ptr)
  @ fastcall ExfInterlockedCompareExchange64(ptr ptr ptr)
  @ fastcall ExfInterlockedInsertHeadList(ptr ptr ptr)
  @ fastcall ExfInterlockedPopEntryList(ptr ptr)
  @ fastcall ExfInterlockedPushEntryList(ptr ptr ptr)
  @ fastcall ExfInterlockedRemoveHeadList(ptr ptr)
 +#endif
  @ fastcall ExfReleasePushLock(ptr)
  @ fastcall ExfReleasePushLockExclusive(ptr)
  @ fastcall ExfReleasePushLockShared(ptr)
  @ fastcall ExfTryToWakePushLock(ptr)
  @ fastcall ExfUnblockPushLock(ptr ptr)
 +#ifdef __x86_64__
 +@ stdcall ExpInterlockedFlushSList(ptr)
 +@ stdcall ExpInterlockedPopEntrySList(ptr ptr)
 +@ stdcall ExpInterlockedPushEntrySList(ptr ptr)
 +#endif
  #ifdef _M_IX86
  @ fastcall Exfi386InterlockedDecrementLong(ptr)
  @ fastcall Exfi386InterlockedExchangeUlong(ptr long)
  @ stdcall Exi386InterlockedExchangeUlong(ptr long long)
  @ stdcall Exi386InterlockedIncrementLong(ptr)
  #endif
 +#ifdef _M_IX86
  @ fastcall ExiAcquireFastMutex(ptr) ExAcquireFastMutex
  @ fastcall ExiReleaseFastMutex(ptr) ExReleaseFastMutex
  @ fastcall ExiTryToAcquireFastMutex(ptr) ExTryToAcquireFastMutex
 +#endif
  @ stdcall FsRtlAcquireFileExclusive(ptr)
  ;FsRtlAddBaseMcbEntry
  @ stdcall FsRtlAddLargeMcbEntry(ptr long long long long long long)
  @ fastcall InterlockedExchange(ptr long)
  @ fastcall InterlockedExchangeAdd(ptr long)
  @ fastcall InterlockedIncrement(ptr)
 +#ifndef __x86_64__
  @ fastcall InterlockedPopEntrySList(ptr)
  @ fastcall InterlockedPushEntrySList(ptr ptr)
 +#endif
  @ stdcall IoAcquireCancelSpinLock(ptr)
  @ stdcall IoAcquireRemoveLockEx(ptr ptr str long long)
  @ stdcall IoAcquireVpbSpinLock(ptr)
  @ stdcall IoSynchronousInvalidateDeviceRelations(ptr long)
  @ stdcall IoSynchronousPageWrite(ptr ptr ptr ptr ptr)
  @ stdcall IoThreadToProcess(ptr)
- ;IoTranslateBusAddress
+ @ stdcall IoTranslateBusAddress(long long long long ptr ptr)
  @ stdcall IoUnregisterFileSystem(ptr)
  @ stdcall IoUnregisterFsRegistrationChange(ptr ptr)
  @ stdcall IoUnregisterPlugPlayNotification(ptr)
  @ stdcall KdSystemDebugControl(long ptr long ptr long ptr long)
  #ifdef _M_IX86
  @ stdcall Ke386CallBios(long ptr)
- ;Ke386IoSetAccessProcess
- ;Ke386QueryIoAccessMap
- ;Ke386SetIoAccessMap
+ @ stdcall Ke386IoSetAccessProcess(ptr long)
+ @ stdcall Ke386QueryIoAccessMap(long ptr)
+ @ stdcall Ke386SetIoAccessMap(long ptr)
  #endif
  @ fastcall KeAcquireGuardedMutex(ptr)
  @ fastcall KeAcquireGuardedMutexUnsafe(ptr)
  @ stdcall KeAcquireInterruptSpinLock(ptr)
  @ stdcall KeAcquireSpinLockAtDpcLevel(ptr)
  @ fastcall KeAcquireSpinLockForDpc(ptr)
 +#ifdef __x86_64__
 +@ stdcall KeAcquireSpinLockRaiseToDpc(ptr)
 +#endif
  @ stdcall KeAddSystemServiceTable(ptr ptr long ptr long)
  @ stdcall KeAreAllApcsDisabled()
  @ stdcall KeAreApcsDisabled()
  @ stdcall KeInitializeMutex(ptr long)
  @ stdcall KeInitializeQueue(ptr long)
  @ stdcall KeInitializeSemaphore(ptr long long)
 +#ifndef __x86_64__
  @ stdcall KeInitializeSpinLock(ptr)
 +#endif
  @ stdcall KeInitializeThreadedDpc(ptr ptr ptr)
  @ stdcall KeInitializeTimer(ptr)
  @ stdcall KeInitializeTimerEx(ptr long)
  @ stdcall KeProfileInterruptWithSource(ptr long)
  @ stdcall KePulseEvent(ptr long long)
  @ stdcall KeQueryActiveProcessors()
 +#ifndef __x86_64__
  @ stdcall KeQueryInterruptTime()
 +#endif
  @ stdcall KeQueryPriorityThread(ptr)
  @ stdcall KeQueryRuntimeThread(ptr ptr)
 +#ifndef __x86_64__
  @ stdcall KeQuerySystemTime(ptr)
 +#endif
  @ stdcall KeQueryTickCount(ptr)
  @ stdcall KeQueryTimeIncrement()
  @ stdcall KeRaiseUserException(long)
  @ stdcall KeReleaseMutant(ptr long long long)
  @ stdcall KeReleaseMutex(ptr long)
  @ stdcall KeReleaseSemaphore(ptr long long long)
 +#ifdef __x86_64__
 +@ stdcall KeReleaseSpinLock(ptr long)
 +#endif
  @ fastcall KeReleaseSpinLockForDpc(ptr long)
  @ stdcall KeReleaseSpinLockFromDpcLevel(ptr)
  @ stdcall KeRemoveByKeyDeviceQueue(ptr long)
  @ fastcall KiAcquireSpinLock(ptr)
  @ extern KiBugCheckData
  @ stdcall KiCheckForKernelApcDelivery()
+ ;KiCheckForSListAddress
  #ifdef _M_IX86
  @ stdcall KiCoprocessorError()
  #endif
  ;PfxInsertPrefix
  ;PfxRemovePrefix
  @ stdcall PoCallDriver(ptr ptr)
- ;PoCancelDeviceNotify
+ @ stdcall PoCancelDeviceNotify(ptr)
  @ stdcall PoQueueShutdownWorkItem(ptr)
  @ stdcall PoRegisterDeviceForIdleDetection(ptr long long long)
- ;PoRegisterDeviceNotify
+ @ stdcall PoRegisterDeviceNotify(ptr long long long ptr ptr)
  @ stdcall PoRegisterSystemState(ptr long)
  @ stdcall PoRequestPowerIrp(ptr long long ptr ptr ptr)
- ;PoRequestShutdownEvent
- ;PoSetHiberRange
+ @ stdcall PoRequestShutdownEvent(ptr)
+ @ stdcall PoSetHiberRange(ptr long ptr long long)
  @ stdcall PoSetPowerState(ptr long long)
  @ stdcall PoSetSystemState(long)
- ;PoShutdownBugCheck
+ @ stdcall PoShutdownBugCheck(long long ptr ptr ptr ptr)
  @ stdcall PoStartNextPowerIrp(ptr)
  @ stdcall PoUnregisterSystemState(ptr)
  @ stdcall ProbeForRead(ptr long long)
  @ stdcall PsTerminateSystemThread(long)
  @ extern PsThreadType _PsThreadType
  ;PsWrapApcWow64Thread
 +#ifndef __x86_64__
  @ stdcall READ_REGISTER_BUFFER_UCHAR(ptr ptr long)
  @ stdcall READ_REGISTER_BUFFER_ULONG(ptr ptr long)
  @ stdcall READ_REGISTER_BUFFER_USHORT(ptr ptr long)
  @ stdcall READ_REGISTER_UCHAR(ptr)
  @ stdcall READ_REGISTER_ULONG(ptr)
  @ stdcall READ_REGISTER_USHORT(ptr)
 +#endif
  @ stdcall KeRosDumpStackFrames(ptr long)
  @ stdcall RtlAbsoluteToSelfRelativeSD(ptr ptr ptr)
  @ stdcall RtlAddAccessAllowedAce(ptr long long ptr)
  ;RtlTraceDatabaseLock
  ;RtlTraceDatabaseUnlock
  ;RtlTraceDatabaseValidate
 +#ifndef __x86_64__
  @ fastcall RtlUlongByteSwap(long)
  @ fastcall RtlUlonglongByteSwap(long long)
 +#endif
  @ stdcall RtlUnicodeStringToAnsiSize(ptr) RtlxUnicodeStringToAnsiSize
  @ stdcall RtlUnicodeStringToAnsiString(ptr ptr long)
  @ stdcall RtlUnicodeStringToCountedOemString(ptr ptr long)
  @ stdcall RtlUpcaseUnicodeToOemN(ptr long ptr wstr long)
  @ stdcall RtlUpperChar(long)
  @ stdcall RtlUpperString(ptr ptr)
 +#ifndef __x86_64__
  @ fastcall RtlUshortByteSwap(long)
 +#endif
  @ stdcall RtlValidRelativeSecurityDescriptor(ptr long long)
  @ stdcall RtlValidSecurityDescriptor(ptr)
  @ stdcall RtlValidSid(ptr)
  ;VfFailDriver
  ;VfFailSystemBIOS
  ;VfIsVerificationEnabled
 +#ifndef __x86_64__
  @ stdcall WRITE_REGISTER_BUFFER_UCHAR(ptr ptr long)
  @ stdcall WRITE_REGISTER_BUFFER_ULONG(ptr ptr long)
  @ stdcall WRITE_REGISTER_BUFFER_USHORT(ptr ptr long)
  @ stdcall WRITE_REGISTER_UCHAR(ptr long)
  @ stdcall WRITE_REGISTER_ULONG(ptr long)
  @ stdcall WRITE_REGISTER_USHORT(ptr long)
 +#endif
  ;WmiFlushTrace
  ;WmiGetClock
  ;WmiQueryTrace
  ;_CIcos
  ;_CIsin
  ;_CIsqrt
 +#ifndef __x86_64
  @ cdecl _abnormal_termination()
 +#endif
  #ifdef _M_IX86
  @ cdecl _alldiv()
  @ cdecl _alldvrm()
  @ cdecl _aullrem()
  @ cdecl _aullshr()
  #endif
 +#ifndef __x86_64
  @ cdecl _except_handler2()
  @ cdecl _except_handler3()
  @ cdecl _global_unwind2()
 +#endif
  @ cdecl _itoa()
  @ cdecl _itow()
 +#ifndef __x86_64
  @ cdecl _local_unwind2()
 +#endif
  @ cdecl _purecall()
  @ cdecl _snprintf()
  @ cdecl _snwprintf()
@@@ -86,7 -86,7 +86,7 @@@ IntCbFreeMemory(PVOID Data
     RemoveEntryList(&Mem->ListEntry);
  
     /* free memory */
-    ExFreePool(Mem);
+    ExFreePoolWithTag(Mem, TAG_CALLBACK);
  }
  
  VOID FASTCALL
@@@ -440,7 -440,7 +440,7 @@@ co_IntCallHookProc(INT HookId
                 {
                    RtlCopyMemory(Extra, ClassName->Buffer, ClassName->Length);
                    CbtCreatewndExtra->Cs.lpszClass =
 -                     (LPCWSTR) MAKELONG(Extra - (PCHAR) CbtCreatewndExtra, 1);
 +                     (LPCWSTR)(ULONG_PTR) MAKELONG(Extra - (PCHAR) CbtCreatewndExtra, 1);
                    Extra += ClassName->Length;
                    *((WCHAR *) Extra) = L'\0';
                 }
@@@ -573,7 -573,7 +573,7 @@@ co_IntCallEventProc(HWINEVENTHOOK hook
     IntRestoreTebWndCallback (hWnd, pWnd);
  
     IntCbFreeMemory(Argument);
 -  
 +
     if (!NT_SUCCESS(Status))
     {
        return 0;
@@@ -275,7 -275,7 +275,7 @@@ IntCallLowLevelHook(PHOOK Hook, INT Cod
     /* FIXME should get timeout from
      * HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout */
     Status = co_MsqSendMessage(((PTHREADINFO)Hook->Thread->Tcb.Win32Thread)->MessageQueue,
 -                                    (HWND) Code,
 +                               (HWND)(UINT_PTR)Code,
                                     Hook->HookId,
                                           wParam,
                                           lParam,
@@@ -553,7 -553,7 +553,7 @@@ IntCallDebugHook
  
     if (HooklParam) Debug.lParam = (LPARAM)HooklParam;
     lResult = co_HOOK_CallHookNext(Hook, Code, wParam, (LPARAM)&Debug);
-    if (HooklParam) ExFreePool(HooklParam);
+    if (HooklParam) ExFreePoolWithTag(HooklParam, TAG_HOOK);
     return lResult;
  }
  
@@@ -942,7 -942,7 +942,7 @@@ CLEANUP
  HHOOK
  STDCALL
  NtUserSetWindowsHookAW(
 -   int idHook, 
 +   int idHook,
     HOOKPROC lpfn,
     BOOL Ansi)
  {
@@@ -1002,7 -1002,7 +1002,7 @@@ NtUserSetWindowsHookEx
        }
        Mod = NULL;
        Global = FALSE;
 -      if (! NT_SUCCESS(PsLookupThreadByThreadId((HANDLE) ThreadId, &Thread)))
 +      if (! NT_SUCCESS(PsLookupThreadByThreadId((HANDLE)(DWORD_PTR)ThreadId, &Thread)))
        {
           DPRINT1("Invalid thread id 0x%x\n", ThreadId);
           SetLastWin32Error(ERROR_INVALID_PARAMETER);
                                  ModuleName.MaximumLength);
        if (! NT_SUCCESS(Status))
        {
-          ExFreePool(Hook->ModuleName.Buffer);
+          ExFreePoolWithTag(Hook->ModuleName.Buffer, TAG_HOOK);
           UserDereferenceObject(Hook);
           IntRemoveHook(Hook, WinStaObj, FALSE);
           if (NULL != Thread)
@@@ -1214,5 -1214,5 +1214,5 @@@ CLEANUP
     UserLeave();
     END_CLEANUP;
  }
 - 
 +
  /* EOF */
@@@ -387,7 -387,7 +387,7 @@@ IntCloneMenuItems(PMENU_OBJECT Destinat
              NewMenuItem->Text.Buffer = (PWSTR)ExAllocatePoolWithTag(PagedPool, MenuItem->Text.MaximumLength, TAG_STRING);
              if(!NewMenuItem->Text.Buffer)
              {
-                ExFreePool(NewMenuItem);
+                ExFreePoolWithTag(NewMenuItem, TAG_MENUITEM);
                 break;
              }
              RtlCopyUnicodeString(&NewMenuItem->Text, &MenuItem->Text);
@@@ -938,7 -938,7 +938,7 @@@ IntInsertMenuItem(PMENU_OBJECT MenuObje
  
     if(!IntSetMenuItemInfo(SubMenu, MenuItem, ItemInfo))
     {
-       ExFreePool(MenuItem);
+       ExFreePoolWithTag(MenuItem, TAG_MENUITEM);
        return FALSE;
     }
  
@@@ -1889,7 -1889,7 +1889,7 @@@ NtUserGetMenuBarInfo
          RETURN(FALSE);
       }
  
 -   hMenu = (HMENU)WindowObject->Wnd->IDMenu;
 +   hMenu = (HMENU)(DWORD_PTR)WindowObject->Wnd->IDMenu;
  
     if (!(MenuObject = UserGetMenuObject(hMenu)))
       {
@@@ -2192,7 -2192,7 +2192,7 @@@ NtUserHiliteMenuItem
        RETURN(FALSE);
     }
  
 -   if(Window->Wnd->IDMenu == (UINT)hMenu)
 +   if(Window->Wnd->IDMenu == (UINT)(UINT_PTR)hMenu)
     {
        RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite));
     }
@@@ -2599,7 -2599,7 +2599,7 @@@ NtUserThunkedMenuItemInfo
        if bInsert == TRUE call NtUserInsertMenuItem() else NtUserSetMenuItemInfo()   */
  
     if (bInsert) return UserInsertMenuItem(hMenu, uItem, fByPosition, lpmii);
 -   
 +
     UNIMPLEMENTED
     return 0;
  }
  #include <debug.h>
  
  
+ SHORT
+ FASTCALL
+ IntGdiGetLanguageID()
+ {
+   HANDLE KeyHandle;
+   ULONG Size = sizeof(WCHAR) * (MAX_PATH + 12);
+   OBJECT_ATTRIBUTES ObAttr;
+ //  http://support.microsoft.com/kb/324097
+   ULONG Ret = 0x409; // English
+   PVOID KeyInfo;
+   UNICODE_STRING Language;
+   
+   RtlInitUnicodeString( &Language,
+     L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Language");
+   InitializeObjectAttributes( &ObAttr,
+                             &Language,
+                  OBJ_CASE_INSENSITIVE,
+                                  NULL,
+                                  NULL);
+   if ( NT_SUCCESS(ZwOpenKey(&KeyHandle, KEY_READ, &ObAttr)))
+   {
+      KeyInfo = ExAllocatePoolWithTag(PagedPool, Size, TAG_STRING);
+      if ( KeyInfo )
+      {
+         RtlInitUnicodeString(&Language, L"Default");
+         if ( NT_SUCCESS(ZwQueryValueKey( KeyHandle,
+                                          &Language,
+                         KeyValuePartialInformation,
+                                            KeyInfo,
+                                               Size,
+                                              &Size)) )
+       {
+         RtlInitUnicodeString(&Language, (PVOID)((char *)KeyInfo + 12));
+         RtlUnicodeStringToInteger(&Language, 16, &Ret);
+       }
+       ExFreePoolWithTag(KeyInfo, TAG_STRING);
+     }
+     ZwClose(KeyHandle);
+   }
+   DPRINT1("Language ID = %x\n",Ret);
+   return (SHORT) Ret;
+ }
  /*
   * @unimplemented
   */
 -DWORD STDCALL
 +DWORD_PTR STDCALL
  NtUserGetThreadState(
     DWORD Routine)
  {
 -   DECLARE_RETURN(DWORD);
 +   DWORD_PTR ret = 0;
  
     DPRINT("Enter NtUserGetThreadState\n");
     if (Routine != THREADSTATE_GETTHREADINFO)
     {
        case THREADSTATE_GETTHREADINFO:
           GetW32ThreadInfo();
 -         RETURN(0);
 -
 +         break;
        case THREADSTATE_FOCUSWINDOW:
 -         RETURN( (DWORD)IntGetThreadFocusWindow());
 +         ret = (DWORD_PTR)IntGetThreadFocusWindow();
 +         break;
        case THREADSTATE_CAPTUREWINDOW:
           /* FIXME should use UserEnterShared */
 -         RETURN( (DWORD)IntGetCapture());
 +         ret = (DWORD_PTR)IntGetCapture();
 +         break;
        case THREADSTATE_PROGMANWINDOW:
 -         RETURN( (DWORD)GetW32ThreadInfo()->Desktop->hProgmanWindow);
 +         ret = (DWORD_PTR)GetW32ThreadInfo()->Desktop->hProgmanWindow;
 +         break;
        case THREADSTATE_TASKMANWINDOW:
 -         RETURN( (DWORD)GetW32ThreadInfo()->Desktop->hTaskManWindow);
 +         ret = (DWORD_PTR)GetW32ThreadInfo()->Desktop->hTaskManWindow;
 +         break;
        case THREADSTATE_ACTIVEWINDOW:
 -         RETURN ( (DWORD)UserGetActiveWindow());
 +         ret = (DWORD_PTR)UserGetActiveWindow();
 +         break;
     }
 -   RETURN( 0);
  
 -CLEANUP:
 -   DPRINT("Leave NtUserGetThreadState, ret=%i\n",_ret_);
 +   DPRINT("Leave NtUserGetThreadState, ret=%i\n", ret);
     UserLeave();
 -   END_CLEANUP;
 +
 +   return ret;
  }
  
  
@@@ -127,7 -170,7 +173,7 @@@ NtUserGetGUIThreadInfo
  
     if(idThread)
     {
 -      Status = PsLookupThreadByThreadId((HANDLE)idThread, &Thread);
 +      Status = PsLookupThreadByThreadId((HANDLE)(DWORD_PTR)idThread, &Thread);
        if(!NT_SUCCESS(Status))
        {
           SetLastWin32Error(ERROR_ACCESS_DENIED);
@@@ -298,7 -341,7 +344,7 @@@ IntSafeCopyUnicodeString(PUNICODE_STRIN
        Status = MmCopyFromCaller(Dest->Buffer, Src, Dest->Length);
        if(!NT_SUCCESS(Status))
        {
-          ExFreePool(Dest->Buffer);
+          ExFreePoolWithTag(Dest->Buffer, TAG_STRING);
           Dest->Buffer = NULL;
           return Status;
        }
@@@ -345,7 -388,7 +391,7 @@@ IntSafeCopyUnicodeStringTerminateNULL(P
        Status = MmCopyFromCaller(Dest->Buffer, Src, Dest->Length);
        if(!NT_SUCCESS(Status))
        {
-          ExFreePool(Dest->Buffer);
+          ExFreePoolWithTag(Dest->Buffer, TAG_STRING);
           Dest->Buffer = NULL;
           return Status;
        }
@@@ -419,7 -462,7 +465,7 @@@ GetW32ProcessInfo(VOID
                                  (ULONG_PTR)W32Process->HeapMappings.UserMapping;
              pi->psi = gpsi;
  
 -            if (InterlockedCompareExchangePointer(&W32Process->ProcessInfo,
 +            if (InterlockedCompareExchangePointer((PVOID*)&W32Process->ProcessInfo,
                                                    pi,
                                                    NULL) != NULL)
              {
  /* DEFINES  ****************************************************************/
  
  #define INPUT_BUFFER_SIZE 255
- #define Arguments 7
+ #define Arguments 8
  
  /******* Table Indexes ************/
  #define MAIN_INDEX 0x0
  #define WIN32K_INDEX 0x1000
  
  /******* Argument List ************/
- /* First, define the Databases */
+ /* Databases */
  #define NativeSystemDb 0
  #define NativeGuiDb 1
  
- /* Now the Service Tables */
+ /* Service Tables */
  #define NtosServiceTable 2
  #define Win32kServiceTable 3
  
- /* And finally, the stub files. */
+ /* Stub Files */
  #define NtosUserStubs 4
  #define NtosKernelStubs 5
  #define Win32kStubs 6
  
+ /* Spec Files */
+ #define NtSpec 7
  /********** Stub Code ************/
  
  /*
                              "    call *(%%ecx)\n" \
                              "    ret $0x%x\n\n"
  
 +#define UserModeStub_amd64  "    movl $0x%x, %%eax\n" \
 +                            "    movq %%rcx, %%r10\n" \
 +                            "    syscall\n" \
 +                            "    ret $0x%x\n\n"
 +
  #define UserModeStub_ppc    "    stwu 1,-16(1)\n" \
                              "    mflr 0\n\t" \
                              "    stw  0,0(1)\n" \
                              "    call _KiSystemService\n" \
                              "    ret $0x%x\n\n"
  
 +#define KernelModeStub_amd64 "    movl $0x%x, %%eax\n" \
 +                            "    call _KiSystemService\n" \
 +                            "    ret $0x%x\n\n"
 +
  /* For now, use the usermode stub.  We'll optimize later */
  #define KernelModeStub_ppc  UserModeStub_ppc
  
  
  /***** Arch Dependent Stuff ******/
  struct ncitool_data_t {
-       const char *arch;
-       int args_to_bytes;
-       const char *km_stub;
-       const char *um_stub;
-       const char *global_header;
-       const char *declaration;
+     const char *arch;
+     int args_to_bytes;
+     const char *km_stub;
+     const char *um_stub;
+     const char *global_header;
+     const char *declaration;
  };
  
  struct ncitool_data_t ncitool_data[] = {
-       { "i386", 4, KernelModeStub_x86, UserModeStub_x86,
-         ".global _%s@%d\n", "_%s@%d:\n" },
-       { "amd64", 4, KernelModeStub_amd64, UserModeStub_amd64,
-         ".global _%s\n", "_%s:\n" },
-       { "powerpc", 4, KernelModeStub_ppc, UserModeStub_ppc,
-         "\t.globl %s\n", "%s:\n" },
-       { "mips", 4, KernelModeStub_mips, UserModeStub_mips,
-         "\t.globl %s\n", "%s:\n" },
-       { "arm", 4, KernelModeStub_arm, UserModeStub_arm,
+     { "i386", 4, KernelModeStub_x86, UserModeStub_x86,
+       ".global _%s@%d\n", "_%s@%d:\n" },
++    { "amd64", 4, KernelModeStub_amd64, UserModeStub_amd64,
++      ".global _%s\n", "_%s:\n" },
+     { "powerpc", 4, KernelModeStub_ppc, UserModeStub_ppc,
+       "\t.globl %s\n", "%s:\n" },
+     { "mips", 4, KernelModeStub_mips, UserModeStub_mips,
+       "\t.globl %s\n", "%s:\n" },
+     { "arm", 4, KernelModeStub_arm, UserModeStub_arm,
      "\t.globl %s\n", "%s:\n" },
-       { 0, }
+     { 0, }
  };
  int arch_sel = 0;
  #define ARGS_TO_BYTES(x) (x)*(ncitool_data[arch_sel].args_to_bytes)
@@@ -545,6 -537,108 +548,108 @@@ CreateSystemServiceTable(FILE *SyscallD
      fprintf(SyscallTable, "ULONG %sNumberOfSysCalls = %d;\n", Name, SyscallId);
  }
  
+ /*++
+  * WriteSpec
+  *
+  *     Prints out the Spec Entry for a System Call.
+  *
+  * Params:
+  *     SpecFile - Spec File to which to write the header.
+  *
+  *     SyscallName - Name of System Call for which to add the stub.
+  *
+  *     CountArguments - Number of arguments to the System Call.
+  *
+  * Returns:
+  *     None.
+  *
+  * Remarks:
+  *     None.
+  *
+  *--*/
+ void
+ WriteSpec(FILE* StubFile,
+           char* SyscallName,
+           unsigned CountArguments)
+ {
+     unsigned i;
+     fprintf(StubFile, "@ stdcall %s", SyscallName);
+     fputc ('(', StubFile);
+     for (i = 0; i < CountArguments; ++ i)
+         fputs ("ptr ", StubFile);
+     fputc (')', StubFile);
+     fputc ('\n', StubFile);
+ }
+ /*++
+  * CreateSpec
+  *
+  *     Parses a System Call Database and creates a spec file for all the entries.
+  *
+  * Params:
+  *     SyscallDb - System Call Database to parse.
+  *
+  *     Files - Array of Spec Files to which to write.
+  *
+  *     CountFiles - Number of Spec Files to create
+  *
+  *     UseZw - Use Zw prefix?
+  *
+  * Returns:
+  *     None.
+  *
+  * Remarks:
+  *     None.
+  *
+  *--*/
+ void
+ CreateSpec(FILE * SyscallDb,
+            FILE * Files[],
+            unsigned CountFiles,
+            unsigned UseZw)
+ {
+     char Line[INPUT_BUFFER_SIZE];
+     char *NtSyscallName;
+     char *SyscallArguments;
+     unsigned CountArguments;
+     /* We loop until the end of the file  */
+     while ((!feof(SyscallDb)) && (fgets(Line, sizeof(Line), SyscallDb) != NULL)) {
+         /* Extract the Name and Arguments */
+         GetNameAndArgumentsFromDb(Line, &NtSyscallName, &SyscallArguments);
+         CountArguments = strtoul(SyscallArguments, NULL, 0);
+         /* Make sure we really extracted something */
+         if (NtSyscallName) {
+             int i;
+             for (i= 0; i < CountFiles; i++) {
+                 if (!UseZw) {
+                     WriteSpec(Files[i],
+                               NtSyscallName,
+                               CountArguments);
+                 }
+                 if (UseZw && NtSyscallName[0] == 'N' && NtSyscallName[1] == 't') {
+                     NtSyscallName[0] = 'Z';
+                     NtSyscallName[1] = 'w';
+                     WriteSpec(Files[i],
+                               NtSyscallName,
+                               CountArguments);
+                 }
+             }
+         }
+     }
+ }
  void usage(char * argv0)
  {
      printf("Usage: %s [-arch <arch>] sysfuncs.lst w32ksvc.db napi.h ssdt.h napi.S zw.S win32k.S win32k.S\n"
             "  zw.S          NTOSKRNL Zw stubs\n"
             "  win32k.S      GDI32 stubs\n"
             "  win32k.S      USER32 stubs\n"
+            "  nt.pspec      NTDLL exports\n"
             "  -arch is optional, default is %s\n",
             argv0,
             ncitool_data[0].arch
@@@ -630,21 -725,32 +736,32 @@@ int main(int argc, char* argv[]
                  1,
                  0);
  
-     /* Rewind the databases */
-     rewind(Files[NativeSystemDb]);
-     rewind(Files[NativeGuiDb]);
      /* Create the Service Tables */
+     rewind(Files[NativeSystemDb]);
      CreateSystemServiceTable(Files[NativeSystemDb],
                              Files[NtosServiceTable],
                              "Main",
                              argv[NtosServiceTable + ArgOffset]);
  
+     rewind(Files[NativeGuiDb]);
      CreateSystemServiceTable(Files[NativeGuiDb],
                              Files[Win32kServiceTable],
                              "Win32k",
                              argv[Win32kServiceTable + ArgOffset]);
  
+     /* Create the Spec Files */
+     rewind(Files[NativeSystemDb]);
+     CreateSpec(Files[NativeSystemDb],
+                &Files[NtSpec],
+                1,
+                0);
+     rewind(Files[NativeSystemDb]);
+     CreateSpec(Files[NativeSystemDb],
+                &Files[NtSpec],
+                1,
+                1);
      /* Close all files */
      for (FileNumber = 0; FileNumber < Arguments-ArgOffset; FileNumber++) {
  
@@@ -450,7 -450,44 +450,44 @@@ MingwBackend::GenerateProjectGccOptions
                }
        }
  
-       fprintf ( fMakefile, "\n" );
+       fputs ( "\n", fMakefile );
+       // TODO: reference these from somewhere
+       fprintf (
+               fMakefile,
+               "PROJECT_GCC_CFLAGS %s",
+               assignmentOperation );
+       for ( i = 0; i < data.compilerFlags.size(); i++ )
+       {
+               if ( data.compilerFlags[i]->compiler == CompilerTypeCC )
+               {
+                       fprintf (
+                               fMakefile,
+                               " %s",
+                               data.compilerFlags[i]->flag.c_str() );
+               }
+       }
+       fputs ( "\n", fMakefile );
+       fprintf (
+               fMakefile,
+               "PROJECT_GCC_CXXFLAGS %s",
+               assignmentOperation );
+       for ( i = 0; i < data.compilerFlags.size(); i++ )
+       {
+               if ( data.compilerFlags[i]->compiler == CompilerTypeCPP )
+               {
+                       fprintf (
+                               fMakefile,
+                               " %s",
+                               data.compilerFlags[i]->flag.c_str() );
+               }
+       }
+       fputs ( "\n", fMakefile );
  }
  
  void
@@@ -495,7 -532,7 +532,7 @@@ MingwBackend::GenerateGlobalVariables (
        fprintf ( fMakefile, "PROJECT_RCFLAGS := $(PROJECT_CFLAGS) $(PROJECT_CDEFINES)\n" );
        fprintf ( fMakefile, "PROJECT_WIDLFLAGS := $(PROJECT_CFLAGS) $(PROJECT_CDEFINES)\n" );
        fprintf ( fMakefile, "PROJECT_LFLAGS := '$(shell ${TARGET_CC} -print-libgcc-file-name)' %s\n", GenerateProjectLFLAGS ().c_str () );
--      fprintf ( fMakefile, "PROJECT_LPPFLAGS := '$(shell ${TARGET_CPP} -print-file-name=libstdc++.a)' '$(shell ${TARGET_CPP} -print-file-name=libgcc.a)' '$(shell ${TARGET_CPP} -print-file-name=libmingw32.a)' '$(shell ${TARGET_CPP} -print-file-name=libmingwex.a)'\n" );
++      fprintf ( fMakefile, "PROJECT_LPPFLAGS := '$(shell ${TARGET_CPP} -print-file-name=libstdc++.a)' '$(shell ${TARGET_CPP} -print-file-name=libgcc.a)' '$(shell ${TARGET_CPP} -print-file-name=libmingw32.a)' '$(shell ${TARGET_CPP} -print-file-name=libmingwex.a)' '$(shell ${TARGET_CPP} -print-file-name=libcoldname.a)'\n" );
        fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" );
        fprintf ( fMakefile, "ifneq ($(OARCH),)\n" );
        fprintf ( fMakefile, "PROJECT_CFLAGS += -march=$(OARCH)\n" );
@@@ -232,6 -232,28 +232,28 @@@ void IfableData::ProcessXML (
                compilationUnits[i]->ProcessXML ();
  }
  
+ bool Module::GetBooleanAttribute ( const XMLElement& moduleNode, const char * name, bool default_value )
+ {
+       const XMLAttribute* att = moduleNode.GetAttribute ( name, false );
+       if ( att != NULL )
+       {
+               const char* p = att->value.c_str();
+               if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) )
+                       return true;
+               else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) )
+                       return false;
+               else
+               {
+                       throw InvalidAttributeValueException (
+                               moduleNode.location,
+                               name,
+                               att->value );
+               }
+       }
+       else
+               return default_value;
+ }
  Module::Module ( const Project& project,
                   const XMLElement& moduleNode,
                   const string& modulePath )
        else
                extension = GetDefaultModuleExtension ();
  
-       att = moduleNode.GetAttribute ( "unicode", false );
-       if ( att != NULL )
-       {
-               const char* p = att->value.c_str();
-               if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) )
-                       isUnicode = true;
-               else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) )
-                       isUnicode = false;
-               else
-               {
-                       throw InvalidAttributeValueException (
-                               moduleNode.location,
-                               "unicode",
-                               att->value );
-               }
-       }
-       else
-               isUnicode = false;
+       isUnicode = GetBooleanAttribute ( moduleNode, "unicode" );
  
        if (isUnicode)
        {
        else
                baseaddress = GetDefaultModuleBaseaddress ();
  
-       att = moduleNode.GetAttribute ( "mangledsymbols", false );
-       if ( att != NULL )
-       {
-               const char* p = att->value.c_str();
-               if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) )
-                       mangledSymbols = true;
-               else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) )
-                       mangledSymbols = false;
-               else
-               {
-                       throw InvalidAttributeValueException (
-                               moduleNode.location,
-                               "mangledsymbols",
-                               att->value );
-               }
-       }
-       else
-               mangledSymbols = false;
+       mangledSymbols = GetBooleanAttribute ( moduleNode, "mangledsymbols" );
  
        att = moduleNode.GetAttribute ( "underscoresymbols", false );
        if ( att != NULL )
        else
                underscoreSymbols = false;
  
-       att = moduleNode.GetAttribute ( "isstartuplib", false );
-       if ( att != NULL )
+       isStartupLib = GetBooleanAttribute ( moduleNode, "isstartuplib" );
+       isCRT = GetBooleanAttribute ( moduleNode, "iscrt", GetDefaultModuleIsCRT () );
+       att = moduleNode.GetAttribute ( "crt", false );
+       if ( att != NULL)
        {
-               const char* p = att->value.c_str();
-               if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) )
-                       isStartupLib = true;
-               else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) )
-                       isStartupLib = false;
-               else
-               {
-                       throw InvalidAttributeValueException (
-                               moduleNode.location,
-                               "isstartuplib",
-                               att->value );
-               }
+               CRT = att->value;
+               if ( stricmp ( CRT.c_str (), "auto" ) == 0 )
+                       CRT = GetDefaultModuleCRT ();
        }
        else
-               isStartupLib = false;
+               CRT = GetDefaultModuleCRT ();
+       const char * crtAttr = CRT.c_str ();
+       if ( crtAttr == NULL || stricmp ( crtAttr, "none" ) == 0 )
+               dynamicCRT = false;
+       else if ( stricmp ( crtAttr, "libc" ) == 0 )
+               dynamicCRT = false;
+       else if ( stricmp ( crtAttr, "msvcrt" ) == 0 )
+               dynamicCRT = true;
+       else if ( stricmp ( crtAttr, "libcntpr" ) == 0 )
+               dynamicCRT = false;
+       else if ( stricmp ( crtAttr, "ntdll" ) == 0 )
+               dynamicCRT = true;
+       else if ( stricmp ( crtAttr, "static" ) == 0 )
+               dynamicCRT = false;
+       else if ( stricmp ( crtAttr, "dll" ) == 0 )
+               dynamicCRT = true;
+       else
+       {
+               throw InvalidAttributeValueException (
+                       moduleNode.location,
+                       "crt",
+                       std::string ( crtAttr ) );
+       }
+       if ( isCRT && dynamicCRT )
+       {
+               throw XMLInvalidBuildFileException (
+                       moduleNode.location,
+                       "C runtime module '%s' cannot be compiled for a dynamically-linked C runtime",
+                       name.c_str() );
+       }
  
        att = moduleNode.GetAttribute ( "prefix", false );
        if ( att != NULL )
@@@ -1155,6 -1169,67 +1169,67 @@@ Module::GetDefaultModuleBaseaddress () 
                                          __LINE__ );
  }
  
+ std::string
+ Module::GetDefaultModuleCRT () const
+ {
+       if ( isCRT )
+               return "static";
+       switch ( type )
+       {
+               case Kernel:
+                       return "static";
+               case Win32DLL:
+               case Win32OCX:
+                       return "msvcrt";
+               case NativeDLL:
+               case NativeCUI:
+                       return "ntdll";
+               case Win32CUI:
+               case Win32SCR:
+               case Win32GUI:
+                       return "msvcrt";
+               case Test:
+                       return "msvcrt"; // BUGBUG: not sure about this
+               case KeyboardLayout:
+                       return "none";
+               case KernelModeDLL:
+               case KernelModeDriver:
+                       return "dll";
+               case BootLoader:
+                       return "libcntpr";
+               case ElfExecutable:
+               case BuildTool:
+               case StaticLibrary:
+               case HostStaticLibrary:
+               case ObjectLibrary:
+               case BootSector:
+               case Iso:
+               case LiveIso:
+               case IsoRegTest:
+               case LiveIsoRegTest:
+               case RpcServer:
+               case RpcClient:
+               case RpcProxy:
+               case Alias:
+               case BootProgram:
+               case IdlHeader:
+               case MessageHeader:
+               case EmbeddedTypeLib:
+               case Cabinet:
+               case TypeDontCare:
+                       return "none";
+       }
+       throw InvalidOperationException ( __FILE__,
+                                         __LINE__ );
+ }
+ bool
+ Module::GetDefaultModuleIsCRT () const
+ {
+       return type == Kernel;
+ }
  bool
  Module::HasImportLibrary () const
  {
@@@ -1244,14 -1319,6 +1319,14 @@@ Module::GetEntryPoint(bool leadingUnder
                result = "_";
  
        result += entrypoint;
 +
 +      if (Environment::GetArch() == "amd64")
 +      {
 +              size_t at_index = result.find_last_of( '@' );
 +              if ( at_index != result.npos )
 +                      return result.substr (0, at_index );
 +      }
 +
        return result;
  }
  
@@@ -1295,6 -1362,16 +1370,16 @@@ Module::SetImportLibrary ( ImportLibrar
                                        HasImportLibrary () ? "lib" + name + ".a" : output->name );
  }
  
+ std::string
+ Module::GetDllName () const
+ {
+       if ( importLibrary && !importLibrary->dllname.empty() )
+               return importLibrary->dllname;
+       else if ( output )
+               return output->name;
+       else
+               throw new InvalidOperationException ( __FILE__, __LINE__, "Module %s has no dllname." );
+ }
  
  File::File ( DirectoryLocation directory,
               const string& relative_path,
@@@ -102,6 -102,7 +102,7 @@@ static void write_function_stubs(type_
          const var_t* explicit_generic_handle_var = NULL;
          const var_t* context_handle_var = NULL;
          int has_full_pointer = is_full_pointer_function(func);
+         const char *callconv = get_attrp(def->type->attrs, ATTR_CALLCONV);
  
          /* check for a defined binding handle */
          explicit_handle_var = get_explicit_handle_var(func);
          write_type_decl_left(client, get_func_return_type(func));
          if (needs_space_after(get_func_return_type(func)))
            fprintf(client, " ");
+         if (callconv) fprintf(client, "%s ", callconv);
          write_prefix_name(client, prefix_client, def);
          fprintf(client, "(\n");
          indent++;
          indent--;
          fprintf(client, "\n");
  
+         if (is_attr(def->attrs, ATTR_IDEMPOTENT) || is_attr(def->attrs, ATTR_BROADCAST))
+         {
+             print_client("_RpcMessage.RpcFlags = ( RPC_NCA_FLAGS_DEFAULT ");
+             if (is_attr(def->attrs, ATTR_IDEMPOTENT))
+                 fprintf(client, "| RPC_NCA_FLAGS_IDEMPOTENT ");
+             if (is_attr(def->attrs, ATTR_BROADCAST))
+                 fprintf(client, "| RPC_NCA_FLAGS_BROADCAST ");
+             fprintf(client, ");\n\n");
+         }
          if (implicit_handle)
          {
              print_client("_Handle = %s;\n", implicit_handle);
@@@ -489,7 -501,7 +501,7 @@@ void write_client(ifref_list_t *ifaces
              write_function_stubs(iface->iface, &proc_offset);
  
              print_client("#if !defined(__RPC_WIN32__)\n");
 -            print_client("#error  Invalid build platform for this stub.\n");
 +            print_client("//#error  Invalid build platform for this stub.\n");
              print_client("#endif\n");
  
              fprintf(client, "\n");
@@@ -417,13 -417,38 +417,38 @@@ void BuildSpec32File( DLLSPEC *spec 
  
      /* Reserve some space for the PE header */
  
-     output( "\t.text\n" );
-     output( "\t.align %d\n", get_alignment(page_size) );
-     output( "__wine_spec_pe_header:\n" );
-     if (target_platform == PLATFORM_APPLE)
+     switch (target_platform)
+     {
+     case PLATFORM_APPLE:
+         output( "\t.text\n" );
+         output( "\t.align %d\n", get_alignment(page_size) );
+         output( "__wine_spec_pe_header:\n" );
          output( "\t.space 65536\n" );
-     else
-         output( "\t.skip 65536\n" );
+         break;
+     case PLATFORM_SOLARIS:
+         output( "\n\t.section \".text\",\"ax\"\n" );
+         output( "__wine_spec_pe_header:\n" );
+         output( "\t.skip %u\n", 65536 + page_size );
+         break;
+     default:
+         output( "\n\t.section \".init\",\"ax\"\n" );
+         switch(target_cpu)
+         {
+         case CPU_x86:
+         case CPU_x86_64:
+         case CPU_ALPHA:
+         case CPU_SPARC:
+             output( "\tjmp 1f\n" );
+             break;
+         case CPU_POWERPC:
+             output( "\tb 1f\n" );
+             break;
+         }
+         output( "__wine_spec_pe_header:\n" );
+         output( "\t.skip %u\n", 65536 + page_size );
+         output( "1:\n" );
+         break;
+     }
  
      /* Output the NT header */
  
@@@ -693,16 -718,20 +718,16 @@@ void BuildPedllFile( DLLSPEC *spec 
          return;
      }
  
 -    output( "#include <stdarg.h>\n");
 -    output( "#include \"windef.h\"\n");
 -    output( "#include \"winbase.h\"\n");
 -    output( "#include \"wine/config.h\"\n");
 -    output( "#include \"wine/exception.h\"\n\n");
 +    output( "#include <windows.h>\n");
 +    output( "#include <reactos/debug.h>\n");
  
 -    output( "void __wine_spec_unimplemented_stub( const char *module, const char *function )\n");
 +    output( "DWORD __stdcall __wine_spec_unimplemented_stub( const char *module, const char *function )\n");
      output( "{\n");
 -    output( "    ULONG_PTR args[2];\n");
 +    output( "    DPRINT1(\"%%s hit stub for %%s\\n\",module,function);");
      output( "\n");
 -    output( "    args[0] = (ULONG_PTR)module;\n");
 -    output( "    args[1] = (ULONG_PTR)function;\n");
 -    output( "    RaiseException( EXCEPTION_WINE_STUB, EH_NONCONTINUABLE, 2, args );\n");
 -    output( "}\n\n");
 +    output( "    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);\n");
 +    output( "    return -1;\n");
 +    output( "}\n");
  
      output( "static const char __wine_spec_file_name[] = \"%s\";\n\n", spec->file_name );