Sync to trunk head (r42241)
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 26 Jul 2009 23:21:27 +0000 (23:21 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 26 Jul 2009 23:21:27 +0000 (23:21 +0000)
svn path=/branches/ros-amd64-bringup/; revision=42244

93 files changed:
1  2 
reactos/boot/bootdata/packages/reactos.dff
reactos/boot/freeldr/freeldr/bootmgr.c
reactos/dll/ntdll/dbg/dbgui.c
reactos/dll/ntdll/ldr/utils.c
reactos/dll/ntdll/ntdll.rbuild
reactos/dll/win32/kernel32/misc/stubs.c
reactos/dll/win32/kernel32/process/proc.c
reactos/dll/win32/kernel32/process/session.c
reactos/dll/win32/kernel32/thread/thread.c
reactos/dll/win32/msafd/misc/dllmain.c
reactos/dll/win32/msgina/gui.c
reactos/dll/win32/user32/include/dde_private.h
reactos/dll/win32/user32/include/user32.h
reactos/dll/win32/user32/include/user32p.h
reactos/dll/win32/user32/misc/dde.c
reactos/dll/win32/user32/misc/misc.c
reactos/dll/win32/user32/windows/class.c
reactos/dll/win32/user32/windows/defwnd.c
reactos/dll/win32/user32/windows/draw.c
reactos/dll/win32/user32/windows/hook.c
reactos/dll/win32/user32/windows/window.c
reactos/dll/win32/wdmaud.drv/wdmaud.c
reactos/dll/win32/win32.rbuild
reactos/dll/win32/ws2_32/misc/stubs.c
reactos/drivers/network/afd/afd/lock.c
reactos/drivers/network/afd/afd/main.c
reactos/drivers/network/dd/ne2000/ne2000/8390.c
reactos/drivers/network/dd/pcnet/pcnet.c
reactos/drivers/network/ndis/include/ndissys.h
reactos/drivers/network/ndis/ndis/miniport.c
reactos/drivers/network/tcpip/tcpip/dispatch.c
reactos/drivers/storage/ide/atapi/atapi.c
reactos/drivers/video/videoprt/agp.c
reactos/drivers/wdm/audio/legacy/wdmaud/interface.h
reactos/hal/hal/hal.c
reactos/hal/hal/hal.rbuild
reactos/hal/halx86/mp/apic.c
reactos/include/crt/mingw32/intrin_x86.h
reactos/include/crt/stdlib.h
reactos/include/crt/wchar.h
reactos/include/ddk/ndis.h
reactos/include/ddk/winddk.h
reactos/include/ndk/ketypes.h
reactos/include/ndk/pstypes.h
reactos/include/psdk/mmsystem.h
reactos/include/psdk/winnt.h
reactos/include/psdk/winsock2.h
reactos/include/psdk/winuser.h
reactos/include/reactos/libs/pseh/pseh2.h
reactos/include/reactos/libs/sound/mmebuddy.h
reactos/include/reactos/win32k/ntuser.h
reactos/lib/drivers/sound/mmebuddy/mmewrap.c
reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c
reactos/lib/pseh/pseh.rbuild
reactos/lib/sdk/crt/crt.rbuild
reactos/lib/sdk/crt/include/internal/wine/cppexcept.h
reactos/lib/sdk/delayimp/delayimp.c
reactos/lib/sdk/sdk.rbuild
reactos/ntoskrnl/cc/copy.c
reactos/ntoskrnl/ex/fastinterlck.c
reactos/ntoskrnl/ex/sysinfo.c
reactos/ntoskrnl/include/internal/ke.h
reactos/ntoskrnl/include/internal/mm.h
reactos/ntoskrnl/include/internal/ntoskrnl.h
reactos/ntoskrnl/kd/kdmain.c
reactos/ntoskrnl/kdbg/kdb.c
reactos/ntoskrnl/ke/bug.c
reactos/ntoskrnl/ke/freeldr.c
reactos/ntoskrnl/ke/spinlock.c
reactos/ntoskrnl/ke/wait.c
reactos/ntoskrnl/mm/i386/page.c
reactos/ntoskrnl/mm/mminit.c
reactos/ntoskrnl/mm/pool.c
reactos/ntoskrnl/mm/procsup.c
reactos/ntoskrnl/mm/section.c
reactos/ntoskrnl/mm/virtual.c
reactos/ntoskrnl/ntoskrnl-generic.rbuild
reactos/ntoskrnl/ntoskrnl.pspec
reactos/ntoskrnl/se/token.c
reactos/subsystems/win32/csrss/api/wapi.c
reactos/subsystems/win32/csrss/win32csr/win32csr.rbuild
reactos/subsystems/win32/win32k/eng/engwindow.c
reactos/subsystems/win32/win32k/ntuser/callback.c
reactos/subsystems/win32/win32k/ntuser/class.c
reactos/subsystems/win32/win32k/ntuser/event.c
reactos/subsystems/win32/win32k/ntuser/hook.c
reactos/subsystems/win32/win32k/ntuser/menu.c
reactos/subsystems/win32/win32k/ntuser/message.c
reactos/subsystems/win32/win32k/ntuser/misc.c
reactos/subsystems/win32/win32k/ntuser/painting.c
reactos/subsystems/win32/win32k/ntuser/simplecall.c
reactos/subsystems/win32/win32k/win32k.rbuild
reactos/tools/rbuild/backend/mingw/mingw.cpp

@@@ -31,89 -31,94 +31,90 @@@ 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\lodctr\lodctr.exe            1
 -base\applications\cmdutils\more\more.exe                1
 -base\applications\cmdutils\xcopy\xcopy.exe              1
 -base\applications\control\control.exe                   1
 -base\applications\downloader\downloader.exe             1
 -base\applications\downloader\downloader.xml             1
 -base\applications\dxdiag\dxdiag.exe                     1
 -base\applications\fontview\fontview.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                             4
 -base\applications\kbswitch\kbswitch.exe                 1
 -base\applications\kbswitch\kbsdll\kbsdll.dll            1
 -base\applications\logoff\logoff.exe                     1
 -base\applications\magnify\magnify.exe                   1
 -base\applications\mplay32\mplay32.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\tracert\tracert.exe           1
 -base\applications\network\whois\whois.exe               1
 -base\applications\notepad\notepad.exe                   1
 -base\applications\paint\paint.exe                       1
 -base\applications\regedit\regedit.exe                   4
 -base\applications\regedit\clb\clb.dll                   1
 -base\applications\regedt32\regedt32.exe                 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                 4
 -base\applications\winver\winver.exe                     1
 -base\applications\wordpad\wordpad.exe                   1
 -base\applications\write\write.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\telnetd\telnetd.exe                   1
 -base\services\tcpsvcs\quotes                        5
 -base\services\umpnpmgr\umpnpmgr.exe                 1
 -base\services\wlansvc\wlansvc.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\lodctr\lodctr.exe            1
 +;base\applications\cmdutils\more\more.exe                1
 +;base\applications\cmdutils\xcopy\xcopy.exe              1
 +;base\applications\control\control.exe                   1
 +;base\applications\downloader\downloader.exe             1
 +;base\applications\downloader\downloader.xml             1
 +;base\applications\dxdiag\dxdiag.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                             4
 +;base\applications\kbswitch\kbswitch.exe                 1
 +;base\applications\kbswitch\kbsdll\kbsdll.dll            1
 +;base\applications\logoff\logoff.exe                     1
 +;base\applications\mplay32\mplay32.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\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\regedt32\regedt32.exe                 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                 4
 +;base\applications\wordpad\wordpad.exe                   1
 +;base\applications\write\write.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\telnetd\telnetd.exe                   1
 +;base\services\tcpsvcs\quotes                        5
 +;base\services\umpnpmgr\umpnpmgr.exe                 1
 +;base\services\wlansvc\wlansvc.exe                   1
+ base\services\svchost\svchost.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-cfg-template.xml       4
 -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\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-cfg-template.xml       4
 +;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
  
  
  ; Dynamic Link Libraries
@@@ -637,12 -651,27 +638,27 @@@ media\sounds\ReactOS_LogOn.wa
  boot\bootdata\bootcdregtest\regtest.cmd             7   optional
  
  ; 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\ntvdm\ntvdm.exe                          1
 +;subsystems\win32\win32k\win32k.sys                  1
  
- ; Modules
+ ; Optional/proprietary files
+ modules\optional\kvmnet.inf                         6  optional
+ modules\optional\kvmnet.sys                         2  optional
+ modules\optional\mfc42.dll                          1  optional
+ modules\optional\mfc42u.dll                         1  optional
+ modules\optional\msvbvm50.dll                       1  optional
+ modules\optional\msvbvm60.dll                       1  optional
+ modules\optional\msvcirt.dll                        1  optional
+ modules\optional\Systema.ttf                        3  optional
+ modules\optional\vmx_fb.dll                         1  optional
+ modules\optional\vmx_mode.dll                       1  optional
+ modules\optional\vmx_svga.inf                       6  optional
+ modules\optional\vmx_svga.sys                       2  optional
+ modules\optional\wine_gecko-0.9.1.cab               4  optional
+ ; Rosapps
  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
@@@ -701,14 -719,10 +717,15 @@@ modules\rosapps\applications\sysutils\u
  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\green\green.sys                                    2   optional
 +modules\rosapps\templates\dialog\dialog.exe                                1   optional
  
+ ; Rostests
  modules\rostests\rosautotest\rosautotest.exe                               1   optional
  modules\rostests\tests\pseh2\pseh2_test.exe                                7   optional
  modules\rostests\winetests\advapi32\advapi32_winetest.exe                  7   optional
@@@ -122,14 -122,14 +122,16 @@@ VOID RunLoader(VOID
                        // to have different install methods, etc.
                        LoadReactOSSetup();
                }
+ #ifdef __i386__
                else if (_stricmp(SettingValue, "ReactOSSetup2") == 0)
                {
 +#ifdef __i386__
                        // WinLdr-style boot
                        LoadReactOSSetup2();
 +#endif
                }
  #endif
+ #endif
  #ifdef __i386__
                else if (_stricmp(SettingValue, "WindowsNT40") == 0)
                {
Simple merge
Simple merge
Simple merge
Simple merge
    (BOOL)NtUserCallNoParam(NOPARAM_ROUTINE_ANYPOPUP)
  
  #define NtUserValidateRgn(hWnd, hRgn) \
 -  (BOOL)NtUserCallTwoParam((DWORD)hWnd, (DWORD)hRgn, TWOPARAM_ROUTINE_VALIDATERGN)
 +  (BOOL)NtUserCallTwoParam((DWORD_PTR)hWnd, (DWORD_PTR)hRgn, TWOPARAM_ROUTINE_VALIDATERGN)
  
  #define NtUserSetWindowContextHelpId(hWnd, dwContextHelpId) \
 -  (BOOL)NtUserCallTwoParam((DWORD)hwnd, dwContextHelpId, TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID)
 +  (BOOL)NtUserCallTwoParam((DWORD_PTR)hwnd, dwContextHelpId, TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID)
  
  #define NtUserSetCaretPos(X, Y) \
 -  (BOOL)NtUserCallTwoParam((DWORD)X, (DWORD)Y, TWOPARAM_ROUTINE_SETCARETPOS)
 +  (BOOL)NtUserCallTwoParam((DWORD_PTR)X, (DWORD_PTR)Y, TWOPARAM_ROUTINE_SETCARETPOS)
  
  #define NtUserSetGUIThreadHandle(field, hwnd) \
 -  (BOOL)NtUserCallTwoParam((DWORD)field, (DWORD)hwnd, TWOPARAM_ROUTINE_SETGUITHRDHANDLE)
 +  (BOOL)NtUserCallTwoParam((DWORD_PTR)field, (DWORD_PTR)hwnd, TWOPARAM_ROUTINE_SETGUITHRDHANDLE)
  
  #define NtUserSetMenuItemRect(menu, mir) \
 -  (BOOL)NtUserCallTwoParam((DWORD)menu, (DWORD)mir, TWOPARAM_ROUTINE_SETMENUITEMRECT)
 +  (BOOL)NtUserCallTwoParam((DWORD_PTR)menu, (DWORD_PTR)mir, TWOPARAM_ROUTINE_SETMENUITEMRECT)
  
  #define NtUserSetMenuBarHeight(menu, height) \
 -  (BOOL)NtUserCallTwoParam((DWORD)menu, (DWORD)height, TWOPARAM_ROUTINE_SETMENUBARHEIGHT)
 +  (BOOL)NtUserCallTwoParam((DWORD_PTR)menu, (DWORD_PTR)height, TWOPARAM_ROUTINE_SETMENUBARHEIGHT)
  
  #define NtUserGetWindowInfo(hwnd, pwi) \
 -  (BOOL)NtUserCallTwoParam((DWORD)hwnd, (DWORD)pwi, TWOPARAM_ROUTINE_GETWINDOWINFO)
 +  (BOOL)NtUserCallTwoParam((DWORD_PTR)hwnd, (DWORD_PTR)pwi, TWOPARAM_ROUTINE_GETWINDOWINFO)
  
  #define NtUserRegisterLogonProcess(hproc, x) \
 -  (BOOL)NtUserCallTwoParam((DWORD)hproc, (DWORD)x, TWOPARAM_ROUTINE_REGISTERLOGONPROC)
 +  (BOOL)NtUserCallTwoParam((DWORD_PTR)hproc, (DWORD_PTR)x, TWOPARAM_ROUTINE_REGISTERLOGONPROC)
  
  #define NtUserGetSysColorBrushes(HBrushes, count) \
 -  (BOOL)NtUserCallTwoParam((DWORD)(HBrushes), (DWORD)(count), TWOPARAM_ROUTINE_GETSYSCOLORBRUSHES)
 +  (BOOL)NtUserCallTwoParam((DWORD_PTR)(HBrushes), (DWORD_PTR)(count), TWOPARAM_ROUTINE_GETSYSCOLORBRUSHES)
  
- #define NtUserGetSysColorPens(HPens, count) \
-   (BOOL)NtUserCallTwoParam((DWORD_PTR)(HPens), (DWORD_PTR)(count), TWOPARAM_ROUTINE_GETSYSCOLORPENS)
  #define NtUserGetSysColors(ColorRefs, count) \
 -  (BOOL)NtUserCallTwoParam((DWORD)(ColorRefs), (DWORD)(count), TWOPARAM_ROUTINE_GETSYSCOLORS)
 +  (BOOL)NtUserCallTwoParam((DWORD_PTR)(ColorRefs), (DWORD_PTR)(count), TWOPARAM_ROUTINE_GETSYSCOLORS)
  
  #define NtUserSetCaretBlinkTime(uMSeconds) \
 -  (BOOL)NtUserCallOneParam((DWORD)uMSeconds, ONEPARAM_ROUTINE_SETCARETBLINKTIME)
 +  (BOOL)NtUserCallOneParam((DWORD_PTR)uMSeconds, ONEPARAM_ROUTINE_SETCARETBLINKTIME)
  
- #define NtUserRegisterUserModule(hInstance) \
-   (BOOL)NtUserCallOneParam((DWORD_PTR)hInstance, ONEPARAM_ROUTINE_REGISTERUSERMODULE)
  /*
  #define NtUserEnumClipboardFormats(format) \
    (UINT)NtUserCallOneParam(format, ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS)
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -152,7 -152,7 +152,7 @@@ extern "C" 
    _CRTIMP extern char *_sys_errlist[];
    _CRTIMP extern int _sys_nerr;
  
- #if (defined(_X86_) || defined(__x86_64)) // HACK
 -#if !defined(__x86_64)
++//#if !defined(__x86_64)// hack here!
    _CRTIMP int *__cdecl __p___argc(void);
    _CRTIMP char ***__cdecl __p___argv(void);
    _CRTIMP wchar_t ***__cdecl __p___wargv(void);
    _CRTIMP wchar_t ***__cdecl __p__wenviron(void);
    _CRTIMP char **__cdecl __p__pgmptr(void);
    _CRTIMP wchar_t **__cdecl __p__wpgmptr(void);
--#endif
++//#endif
  #ifndef __argc
  #ifdef _MSVCRT_
    extern int __argc;
Simple merge
@@@ -2020,13 -2020,40 +2020,16 @@@ NdisQueryPacket
   *   OUT PNDIS_BUFFER  *FirstBuffer  OPTIONAL,
   *   OUT PUINT  TotalPacketLength  OPTIONAL);
   */
- #define NdisQueryPacketLength(Packet,                                     \
-                               TotalPacketLength)                          \
- {                                                                         \
+ static __inline
+ VOID
+ NdisQueryPacketLength(
+     IN PNDIS_PACKET  Packet,
+     OUT PUINT  TotalPacketLength  OPTIONAL)
+ {
 -  if ((TotalPacketLength))                                                \
 -  {                                                                       \
 -    if (!(Packet)->Private.ValidCounts) {                                 \
 -      UINT _Offset;                                                       \
 -      UINT _PacketLength;                                                 \
 -      PNDIS_BUFFER _NdisBuffer;                                           \
 -      UINT _PhysicalBufferCount = 0;                                      \
 -      UINT _TotalPacketLength   = 0;                                      \
 -      UINT _Count               = 0;                                      \
 -                                                                          \
 -      for (_NdisBuffer = (Packet)->Private.Head;                          \
 -        _NdisBuffer != (PNDIS_BUFFER)NULL;                                \
 -        _NdisBuffer = _NdisBuffer->Next)                                  \
 -      {                                                                   \
 -        _PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(_NdisBuffer);   \
 -        NdisQueryBufferOffset(_NdisBuffer, &_Offset, &_PacketLength);     \
 -        _TotalPacketLength += _PacketLength;                              \
 -        _Count++;                                                         \
 -      }                                                                   \
 -      (Packet)->Private.PhysicalCount = _PhysicalBufferCount;             \
 -      (Packet)->Private.TotalLength   = _TotalPacketLength;               \
 -      (Packet)->Private.Count         = _Count;                           \
 -      (Packet)->Private.ValidCounts   = TRUE;                             \
 -  }                                                                       \
 -                                                                          \
 -  if (TotalPacketLength)                                                  \
 -      *((PUINT)TotalPacketLength) = (Packet)->Private.TotalLength;        \
 -  } \
 +  if (!(Packet)->Private.ValidCounts)                                     \
 +    NdisQueryPacket(Packet, NULL, NULL, NULL, TotalPacketLength);         \
 +  else                                                                    \
 +    *(TotalPacketLength) = (Packet)->Private.TotalLength;                 \
  }
  
  
@@@ -5673,9 -5693,50 +5693,51 @@@ KefReleaseSpinLockFromDpcLevel
  #define KeAcquireSpinLock(a,b)  *(b) = KfAcquireSpinLock(a)
  #define KeReleaseSpinLock(a,b)  KfReleaseSpinLock(a,b)
  
- #else // !defined (_X86_)
+ #define KeGetDcacheFillSize() 1L
+     
+ #elif defined(_M_ARM) // !defined (_X86_)
+     
+     NTHALAPI
+     KIRQL
+     FASTCALL
+     KfAcquireSpinLock(
+                       IN PKSPIN_LOCK SpinLock);
+     
+     NTHALAPI
+     VOID
+     FASTCALL
+     KfReleaseSpinLock(
+                       IN PKSPIN_LOCK SpinLock,
+                       IN KIRQL NewIrql);
+     
+     
+     NTKERNELAPI
+     VOID
+     FASTCALL
+     KefAcquireSpinLockAtDpcLevel(
+                                  IN PKSPIN_LOCK  SpinLock);
+     
+     NTKERNELAPI
+     VOID
+     FASTCALL
+     KefReleaseSpinLockFromDpcLevel(
+                                    IN PKSPIN_LOCK  SpinLock);
+     
+     
+ #define KeAcquireSpinLockAtDpcLevel(SpinLock) KefAcquireSpinLockAtDpcLevel(SpinLock)
+ #define KeReleaseSpinLockFromDpcLevel(SpinLock) KefReleaseSpinLockFromDpcLevel(SpinLock)
+ #define KeAcquireSpinLock(a,b)  *(b) = KfAcquireSpinLock(a)
+ #define KeReleaseSpinLock(a,b)  KfReleaseSpinLock(a,b)
+     
+     NTKERNELAPI
+     VOID
+     NTAPI
+     KeInitializeSpinLock(
+                          IN PKSPIN_LOCK  SpinLock);
+     
+ #else
+     
 +FORCEINLINE
  VOID
  NTAPI
  KeInitializeSpinLock(
Simple merge
Simple merge
@@@ -1507,9 -1534,27 +1534,27 @@@ typedef struct tagMCI_SEEK_PARMS 
        DWORD dwTo;
  } MCI_SEEK_PARMS, *PMCI_SEEK_PARMS,*LPMCI_SEEK_PARMS;
  
+ #ifdef _WINE
+ typedef struct tagMCI_SOUND_PARMSA {
+     DWORD_PTR   dwCallback;
+     LPCSTR      lpstrSoundName;
+ } MCI_SOUND_PARMSA, *LPMCI_SOUND_PARMSA;
+ typedef struct tagMCI_SOUND_PARMSW {
+     DWORD_PTR   dwCallback;
+     LPCWSTR     lpstrSoundName;
+ } MCI_SOUND_PARMSW, *LPMCI_SOUND_PARMSW;
+ #ifdef UNICODE
+ typedef MCI_SOUND_PARMSW MCI_SOUND_PARMS;
+ #else
+ typedef MCI_SOUND_PARMSA MCI_SOUND_PARMS;
+ #endif
+ #endif
  typedef struct tagMCI_STATUS_PARMS {
 -      DWORD dwCallback;
 -      DWORD dwReturn;
 +      DWORD_PTR dwCallback;
 +      DWORD_PTR dwReturn;
        DWORD dwItem;
        DWORD dwTrack;
  } MCI_STATUS_PARMS,*PMCI_STATUS_PARMS,*LPMCI_STATUS_PARMS;
Simple merge
Simple merge
@@@ -2010,8 -2028,10 +2028,11 @@@ extern "C" 
  #define DCX_EXCLUDERGN 64
  #define DCX_INTERSECTRGN 128
  #define DCX_VALIDATE 0x200000
 +#define DCX_USESTYLE 0x00010000
  #define DCX_EXCLUDEUPDATE   0x100
+ #ifdef _WINE
+ #define DCX_USESTYLE     0x10000
+ #endif
  #define GMDI_GOINTOPOPUPS 2
  #define GMDI_USEDISABLED 1
  #define FKF_AVAILABLE 2
@@@ -3119,14 -3188,16 +3189,16 @@@ 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;
  #ifdef UNICODE
  typedef ICONMETRICSW ICONMETRICS,*LPICONMETRICS;
  #else /* UNICODE */
@@@ -418,7 -421,22 +424,23 @@@ __SEH_END_SCOPE_CHAIN
  
  #endif
  
+ #else
+ #define _SEH2_TRY  {
+ #define _SEH2_FINALLY }  {
+ #define _SEH2_EXCEPT(...) } if (0) {
+ #define _SEH2_END }
+ #define _SEH2_GetExceptionInformation() 
+ #define _SEH2_GetExceptionCode() STATUS_SUCCESS
+ #define _SEH2_AbnormalTermination() 
+ #define _SEH2_YIELD(STMT_) STMT_
+ #define _SEH2_LEAVE
  #endif
  
 +#endif
+ #endif
  /* EOF */
@@@ -375,8 -385,17 +385,17 @@@ MmeOpenWaveDevice
  
  MMRESULT
  MmeCloseDevice(
 -    IN  DWORD PrivateHandle);
 +    IN  DWORD_PTR PrivateHandle);
  
+ MMRESULT
+ MmeGetPosition(
+     IN  MMDEVICE_TYPE DeviceType,
+     IN  DWORD DeviceId,
+     IN  DWORD PrivateHandle,
+     IN  MMTIME* Time,
+     IN  DWORD Size);
  #define MmePrepareWaveHeader(private_handle, header) \
      PrepareWaveHeader((PSOUND_DEVICE_INSTANCE)private_handle, (PWAVEHDR)header)
  
Simple merge
                                <file>fmod.c</file>
                                <file>ldexp.c</file>
                        </directory>
+                       <file>j0_y0.c</file>
+                       <file>j1_y1.c</file>
+                       <file>jn_yn.c</file>
                </if>
                <if property="ARCH" value="amd64">
 -                      <directory name="i386">
 -                              <file>atan2.c</file>
 -                              <file>exp.c</file>
 -                              <file>fmod.c</file>
 -                              <file>ldexp.c</file>
 +                      <directory name="amd64">
 +                              <file>alldiv.S</file>
 +                              <file>atan.S</file>
 +                              <file>atan2.S</file>
 +                              <file>ceil.S</file>
 +                              <file>ceilf.S</file>
 +                              <file>cos.S</file>
 +                              <file>exp.S</file>
 +                              <file>fabs.S</file>
 +                              <file>floor.S</file>
 +                              <file>floorf.S</file>
 +                              <file>fmod.S</file>
 +                              <file>fmodf.S</file>
 +                              <file>ldexp.S</file>
 +                              <file>log.S</file>
 +                              <file>log10.S</file>
 +                              <file>pow.S</file>
 +                              <file>sin.S</file>
 +                              <file>sqrt.S</file>
 +                              <file>sqrtf.S</file>
 +                              <file>tan.S</file>
                        </directory>
+                       <file>j0_y0.c</file>
+                       <file>j1_y1.c</file>
+                       <file>jn_yn.c</file>
                </if>
                <ifnot property="ARCH" value="i386">
                        <file>stubs.c</file>
  #define EH_STACK_INVALID    0x08
  #define EH_NESTED_CALL      0x10
  
+ #ifndef _M_ARM
  static inline EXCEPTION_REGISTRATION_RECORD *__wine_push_frame( EXCEPTION_REGISTRATION_RECORD *frame )
  {
 +#if defined(__i386__)
      frame->Next = (struct _EXCEPTION_REGISTRATION_RECORD *)__readfsdword(0);
        __writefsdword(0, (unsigned long)frame);
      return frame->Next;
  
  static inline EXCEPTION_REGISTRATION_RECORD *__wine_pop_frame( EXCEPTION_REGISTRATION_RECORD *frame )
  {
 +#if defined(__i386__)
        __writefsdword(0, (unsigned long)frame->Next);
      return frame->Next;
 +#else
 +      NT_TIB *teb = (NT_TIB *)NtCurrentTeb();
 +      teb->ExceptionList = frame->Next;
 +      return frame->Next;
 +#endif
  }
+ #endif
  
  #define __TRY _SEH2_TRY
  #define __EXCEPT(func) _SEH2_EXCEPT(func(_SEH2_GetExceptionInformation()))
index 0000000,ae6aeba..2547688
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,100 +1,100 @@@
 -              pIAT[index].u1.Function = (DWORD)pProc;
+ /*
+  * PROJECT:         ReactOS SDK Library
+  * LICENSE:         LGPL, see LGPL.txt in top level directory.
+  * FILE:            lib/sdk/delayimp/delayimp.c
+  * PURPOSE:         Library for delay importing from dlls
+  * PROGRAMMERS:     Timo Kreuzer <timo.kreuzer@reactos.org>
+  *
+  */
+ #include <windows.h>
+ #include <delayimp.h>
+ /**** load helper ****/
+ FARPROC WINAPI
+ __delayLoadHelper2(PCImgDelayDescr pidd, PImgThunkData pIATEntry)
+ {
+       DelayLoadInfo dli;
+       int index;
+       PImgThunkData pIAT;
+       PImgThunkData pINT;
+       HMODULE *phMod;
+       FARPROC pProc;
+       pIAT = PFromRva(pidd->rvaIAT);
+       pINT = PFromRva(pidd->rvaINT);
+       phMod = PFromRva(pidd->rvaHmod);
+       index = IndexFromPImgThunkData(pIATEntry, pIAT);
+       dli.cb = sizeof(dli);
+       dli.pidd = pidd;
+       dli.ppfn = (FARPROC*)pIATEntry->u1.Function;
+       dli.szDll = PFromRva(pidd->rvaDLLName);
+       dli.dlp.fImportByName = !(pINT[index].u1.Ordinal & IMAGE_ORDINAL_FLAG);
+       if (dli.dlp.fImportByName)
+       {
+               /* u1.AdressOfData points to a IMAGE_IMPORT_BY_NAME struct */
+               PIMAGE_IMPORT_BY_NAME piibn = PFromRva((RVA)pINT[index].u1.AddressOfData);
+               dli.dlp.szProcName = (LPCSTR)&piibn->Name;
+       }
+       else
+       {
+               dli.dlp.dwOrdinal = pINT[index].u1.Ordinal & ~IMAGE_ORDINAL_FLAG;
+       }
+       dli.hmodCur = *phMod;
+       dli.pfnCur = (FARPROC)pIAT[index].u1.Function;
+       dli.dwLastError = GetLastError();
+       pProc = __pfnDliNotifyHook2(dliStartProcessing, &dli);
+       if (pProc)
+       {
 -      pIAT[index].u1.Function = (DWORD)pProc;
++              pIAT[index].u1.Function = (DWORD_PTR)pProc;
+               return pProc;
+       }
+       if (dli.hmodCur == NULL)
+       {
+               dli.hmodCur = LoadLibraryA(dli.szDll);
+               if (!dli.hmodCur)
+               {
+                       dli.dwLastError = GetLastError();
+                       __pfnDliFailureHook2(dliFailLoadLib, &dli);
+ //                    if (ret)
+ //                    {
+ //                    }
+                       // FIXME: raise exception;
+                       return NULL;
+               }
+               *phMod = dli.hmodCur;
+       }
+       /* dli.dlp.szProcName might also contain the ordinal */
+       pProc = GetProcAddress(dli.hmodCur, dli.dlp.szProcName);
+       if (!pProc)
+       {
+               dli.dwLastError = GetLastError();
+               __pfnDliFailureHook2(dliFailGetProc, &dli);
+               // FIXME: handle return value & raise exception
+               return NULL;
+       }
++      pIAT[index].u1.Function = (DWORD_PTR)pProc;
+       return pProc;
+ }
+ /*** The default hooks ***/
+ FARPROC WINAPI
+ DefaultDliNotifyHook2(unsigned dliNotify, PDelayLoadInfo pdli)
+ {
+       return NULL;
+ }
+ FARPROC WINAPI
+ DefaultDliFailureHook2(unsigned dliNotify, PDelayLoadInfo pdli)
+ {
+       return NULL;
+ }
+ PfnDliHook __pfnDliNotifyHook2 = DefaultDliNotifyHook2;
+ PfnDliHook __pfnDliFailureHook2 = DefaultDliFailureHook2;
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -194,12 -156,10 +194,11 @@@ C_ASSERT(FIELD_OFFSET(KTHREAD, TrapFram
  C_ASSERT(FIELD_OFFSET(KTHREAD, CallbackStack) == KTHREAD_CALLBACK_STACK);
  C_ASSERT(FIELD_OFFSET(KTHREAD, ApcState.Process) == KTHREAD_APCSTATE_PROCESS);
  C_ASSERT(FIELD_OFFSET(KPROCESS, DirectoryTableBase) == KPROCESS_DIRECTORY_TABLE_BASE);
- C_ASSERT(FIELD_OFFSET(KPCR, Tib.ExceptionList) == KPCR_EXCEPTION_LIST);
- C_ASSERT(FIELD_OFFSET(KPCR, Self) == KPCR_SELF);
 +#endif
  
  #ifdef _M_IX86
+ C_ASSERT(FIELD_OFFSET(KPCR, Tib.ExceptionList) == KPCR_EXCEPTION_LIST);
+ C_ASSERT(FIELD_OFFSET(KPCR, Self) == KPCR_SELF);
  C_ASSERT(FIELD_OFFSET(KPCR, IRR) == KPCR_IRR);
  C_ASSERT(FIELD_OFFSET(KPCR, IDR) == KPCR_IDR);
  C_ASSERT(FIELD_OFFSET(KPCR, Irql) == KPCR_IRQL);
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -86,7 -86,38 +86,39 @@@ KeReleaseQueuedSpinLockFromDpcLevel(IN 
  
  /* PUBLIC FUNCTIONS **********************************************************/
  
 +#ifdef _X86_
+ /*
+  * @implemented
+  */
+ KIRQL
+ NTAPI
+ KeAcquireInterruptSpinLock(IN PKINTERRUPT Interrupt)
+ {
+     KIRQL OldIrql;
+     /* Raise IRQL */
+     KeRaiseIrql(Interrupt->SynchronizeIrql, &OldIrql);
+     /* Acquire spinlock on MP */
+     KeAcquireSpinLockAtDpcLevel(Interrupt->ActualLock);
+     return OldIrql;
+ }
+ /*
+  * @implemented
+  */
+ VOID
+ NTAPI
+ KeReleaseInterruptSpinLock(IN PKINTERRUPT Interrupt,
+                            IN KIRQL OldIrql)
+ {
+     /* Release lock on MP */
+     KeReleaseSpinLockFromDpcLevel(Interrupt->ActualLock);
+     /* Lower IRQL */
+     KeLowerIrql(OldIrql);
+ }
  /*
   * @implemented
   */
Simple merge
Simple merge
@@@ -394,60 -142,48 +142,48 @@@ MmInit1(VOID
      MmKernelAddressSpace = MmGetCurrentAddressSpace();
      MmInitGlobalKernelPageDirectory();
      
-     /* Get kernel address boundaries */
-     LdrEntry = CONTAINING_RECORD(KeLoaderBlock->LoadOrderListHead.Flink,
-                                  LDR_DATA_TABLE_ENTRY,
-                                  InLoadOrderLinks);
-     MiKSeg0Start = (ULONG_PTR)LdrEntry->DllBase | KSEG0_BASE;
-     MiKSeg0End = PAGE_ROUND_UP(MiGetLastKernelAddress()  | KSEG0_BASE);
-     /* We'll put the PFN array right after the loaded modules */
-     MmPfnDatabase = (PVOID)MiKSeg0End;
-     MmPfnDatabaseEnd = (ULONG_PTR)MmPfnDatabase + (MmHighestPhysicalPage * sizeof(PHYSICAL_PAGE));
-     MmPfnDatabaseEnd = PAGE_ROUND_UP(MmPfnDatabaseEnd);
+     /* Dump memory descriptors */
+     if (MiDbgEnableMdDump) MiDbgDumpMemoryDescriptors();
      
-     /*
-      * FreeLDR maps 6MB starting at the kernel base address, followed by the
-      * PFN database. If the PFN database doesn't go over the FreeLDR allocation
-      * then choose the end of the FreeLDR block. If it does go past the FreeLDR
-      * allocation, then choose the next PAGE_SIZE boundary.
-      */
-     if ((ULONG_PTR)MmPfnDatabaseEnd < (MiKSeg0Start + 0x600000))
-     {
-         /* Use the first memory following FreeLDR's 6MB mapping */
-         MiNonPagedPoolStart = (PVOID)((ULONG_PTR)MiKSeg0Start + 0x600000);
-     }
-     else
-     {
-         /* Use the next free available page */
-         MiNonPagedPoolStart = (PVOID)MmPfnDatabaseEnd;
-     }
+     //
 -    // Initialize ARM³ in phase 0
++    // Initialize ARM³ in phase 0
+     //
+     MmArmInitSystem(0, KeLoaderBlock);    
      
-     /* Length of non-paged pool */
-     MiNonPagedPoolLength = MM_NONPAGED_POOL_SIZE;
+     /* Intialize system memory areas */
+     MiInitSystemMemoryAreas();
  
-     /* Put the paged pool after the non-paged pool */
+     /* Initialize the page list */
+     MmInitializePageList();
+        
+     //
 -    // Initialize ARM³ in phase 1
++    // Initialize ARM³ in phase 1
+     //
+     MmArmInitSystem(1, KeLoaderBlock);
+                                                                   // DEPRECATED
+     /* Put nonpaged pool after the loaded modules */              // DEPRECATED
+     MiNonPagedPoolStart = (PVOID)((ULONG_PTR)MmSystemRangeStart + // DEPRECATED
+                                   MmBootImageSize);               // DEPRECATED
+     MiNonPagedPoolLength = MM_NONPAGED_POOL_SIZE;                 // DEPRECATED
+                                                                   // DEPRECATED
+     /* Initialize nonpaged pool */                                // DEPRECATED
+     MiInitializeNonPagedPool();                                   // DEPRECATED
+                                                                   // DEPRECATED
+     /* Put the paged pool after nonpaged pool */
      MmPagedPoolBase = (PVOID)PAGE_ROUND_UP((ULONG_PTR)MiNonPagedPoolStart +
                                             MiNonPagedPoolLength);
      MmPagedPoolSize = MM_PAGED_POOL_SIZE;
-     
-     /* Dump kernel memory layout */
-     MiDbgKernelLayout();
  
-     /* Initialize hyperspace */
-     MiInitHyperSpace();
-     /* Initialize the page list */
-     MmInitializePageList();
-     /* Unmap low memory */
-     MmDeletePageTable(NULL, 0);
-     /* Intialize memory areas */
-     MmInitVirtualMemory();
-     /* Initialize MDLs */
-     MmInitializeMdlImplementation();
+     //
 -    // Initialize ARM³ in phase 2
++    // Initialize ARM³ in phase 2
+     //
+     MmArmInitSystem(2, KeLoaderBlock);
+     
+     /* Initialize paged pool */
+     MmInitializePagedPool();
+     
+     /* Initialize working sets */
+     MmInitializeMemoryConsumer(MC_USER, MmTrimUserMemory);
  }
  
  BOOLEAN
@@@ -164,8 -164,9 +164,9 @@@ ExAllocatePoolWithTag (POOL_TYPE PoolTy
   * @implemented
   */
  #undef ExAllocatePoolWithQuota
+ #undef ExAllocatePoolWithQuotaTag
  PVOID NTAPI
 -ExAllocatePoolWithQuota (POOL_TYPE PoolType, ULONG NumberOfBytes)
 +ExAllocatePoolWithQuota (POOL_TYPE PoolType, SIZE_T NumberOfBytes)
  {
     return(ExAllocatePoolWithQuotaTag(PoolType, NumberOfBytes, TAG_NONE));
  }
Simple merge
Simple merge
Simple merge
                                <file>page.c</file>
                        </directory>
                </if>
 +              <if property="ARCH" value="amd64">
 +                      <directory name="amd64">
 +                              <file>page.c</file>
 +                      </directory>
 +              </if>
+               <directory name="ARM3">
+                       <if property="ARCH" value="i386">
+                               <directory name="i386">
+                                       <file>init.c</file>
+                               </directory>
+                       </if>
+                       <if property="ARCH" value="arm">
+                               <directory name="arm">
+                                       <file>init.c</file>
+                               </directory>
+                       </if>
+                       <file>contmem.c</file>
+                       <file>drvmgmt.c</file>
+                       <file>dynamic.c</file>
+                       <file>expool.c</file>
+                       <file>hypermap.c</file>
+                       <file>iosup.c</file>
+                       <file>mdlsup.c</file>
+                       <file>ncache.c</file>
+                       <file>pool.c</file>
+                       <file>procsup.c</file>
+                       <file>syspte.c</file>
+               </directory>
                <file>anonmem.c</file>
                <file>balance.c</file>
-               <file>cont.c</file>
                <file>dbgpool.c</file>
-               <file>drvlck.c</file>
                <file>freelist.c</file>
-               <file>hypermap.c</file>
-               <file>iospace.c</file>
-               <file>kmap.c</file>
                <file>marea.c</file>
-               <file>mdlsup.c</file>
-               <file>mm.c</file>
+               <file>mmfault.c</file>
+               <file>mmsup.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>
  @ stdcall KeInitializeMutex(ptr long)
  @ stdcall KeInitializeQueue(ptr long)
  @ stdcall KeInitializeSemaphore(ptr long long)
- @ stdcall KeInitializeSpinLock(ptr)
 +#ifndef __x86_64__
+ @ stdcall KeInitializeSpinLock(ptr) _KeInitializeSpinLock
 +#endif
  @ stdcall KeInitializeThreadedDpc(ptr ptr ptr)
  @ stdcall KeInitializeTimer(ptr)
  @ stdcall KeInitializeTimerEx(ptr long)
Simple merge
@@@ -136,8 -136,8 +136,8 @@@ IntEngWndUpdateClipObj
    }
  
    RtlCopyMemory(&WndObjInt->WndObj.coClient, ClipObj, sizeof (CLIPOBJ));
-   RtlCopyMemory(&WndObjInt->WndObj.rclClient, &Window->Wnd->ClientRect, sizeof (RECT));
+   RtlCopyMemory(&WndObjInt->WndObj.rclClient, &Window->Wnd->rcClient, sizeof (RECT));
 -  OldClipObj = InterlockedExchangePointer(&WndObjInt->ClientClipObj, ClipObj);
 +  OldClipObj = InterlockedExchangePointer((PVOID*)&WndObjInt->ClientClipObj, ClipObj);
    if (OldClipObj != NULL)
      IntEngDeleteClipRegion(OldClipObj);
  
@@@ -427,24 -469,49 +469,49 @@@ co_IntCallHookProc(INT HookId
              case HCBT_CREATEWND:
                 Common->lParam = (LPARAM) (Extra - (PCHAR) Common);
                 CbtCreatewndExtra = (PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS) Extra;
-                CbtCreatewndExtra->Cs = *(CbtCreateWnd->lpcs);
+                RtlCopyMemory( &CbtCreatewndExtra->Cs, CbtCreateWnd->lpcs, sizeof(CREATESTRUCTW) );
                 CbtCreatewndExtra->WndInsertAfter = CbtCreateWnd->hwndInsertAfter;
                 Extra = (PCHAR) (CbtCreatewndExtra + 1);
-                RtlCopyMemory(Extra, WindowName->Buffer, WindowName->Length);
+                RtlCopyMemory(Extra, WindowName.Buffer, WindowName.Length);
                 CbtCreatewndExtra->Cs.lpszName = (LPCWSTR) (Extra - (PCHAR) CbtCreatewndExtra);
-                CbtCreatewndExtra->Cs.lpszClass = ClassName->Buffer;
-                Extra += WindowName->Length;
-                *((WCHAR *) Extra) = L'\0';
-                Extra += sizeof(WCHAR);
-                if (! IS_ATOM(ClassName->Buffer))
+                CbtCreatewndExtra->Cs.lpszClass = ClassName.Buffer;
+                Extra += WindowName.Length;
+                if (Ansi)
+                {
+                  *((CHAR *) Extra) = '\0';
+                  Extra += sizeof(CHAR);
+                }
+                else
+                {
+                  *((WCHAR *) Extra) = L'\0';
+                  Extra += sizeof(WCHAR);
+                }
+                if (! IS_ATOM(ClassName.Buffer))
                 {
-                   RtlCopyMemory(Extra, ClassName->Buffer, ClassName->Length);
+                   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';
+                   Extra += ClassName.Length;
+                   if (Ansi)
+                      *((CHAR *) Extra) = '\0';
+                   else
+                      *((WCHAR *) Extra) = L'\0';
                 }
                 break;
+             case HCBT_CLICKSKIPPED:
+                RtlCopyMemory(Extra, (PVOID) lParam, sizeof(MOUSEHOOKSTRUCT));
+                Common->lParam = (LPARAM) (Extra - (PCHAR) Common);
+                break;
+             case HCBT_MOVESIZE:
+                RtlCopyMemory(Extra, (PVOID) lParam, sizeof(RECTL));
+                Common->lParam = (LPARAM) (Extra - (PCHAR) Common);
+                break;
+             case HCBT_ACTIVATE:
+                RtlCopyMemory(Extra, (PVOID) lParam, sizeof(CBTACTIVATESTRUCT));
+                Common->lParam = (LPARAM) (Extra - (PCHAR) Common);
+                break;
           }
           break;
        case WH_KEYBOARD_LL:
@@@ -563,15 -654,10 +654,10 @@@ co_IntCallEventProc(HWINEVENTHOOK hook
                                 &ResultPointer,
                                 &ResultLength);
  
-    /* Simulate old behaviour: copy into our local buffer */
-    Result = *(LRESULT*)ResultPointer;
     UserEnterCo();
  
-    IntRestoreTebWndCallback (hWnd, pWnd);
     IntCbFreeMemory(Argument);
 -  
 +
     if (!NT_SUCCESS(Status))
     {
        return 0;
@@@ -483,10 -506,10 +506,10 @@@ IntGetClassForDesktop(IN OUT PCLS BaseC
              else
              {
                  /* link in the clone */
-                 Class->Clone = NULL;
-                 Class->Base = BaseClass;
-                 Class->Next = BaseClass->Clone;
-                 (void)InterlockedExchangePointer((VOID*)&BaseClass->Clone,
+                 Class->pclsClone = NULL;
+                 Class->pclsBase = BaseClass;
+                 Class->pclsNext = BaseClass->pclsClone;
 -                (void)InterlockedExchangePointer(&BaseClass->pclsClone,
++                (void)InterlockedExchangePointer((VOID*)&BaseClass->pclsClone,
                                                   Class);
              }
          }
@@@ -150,14 -153,14 +153,14 @@@ co_EVENT_CallEvents( DWORD event
  
     pEH = pEP->pEH;
     
-    Result = co_IntCallEventProc( pEH->Self,
-                                      event,
-                                       hwnd,
-                              pEP->idObject,
-                               pEP->idChild,
+    Result = co_IntCallEventProc( pEH->head.h,
+                                        event,
+                                         hwnd,
+                                pEP->idObject,
+                                 pEP->idChild,
 - (DWORD)(NtCurrentTeb()->ClientId).UniqueThread,
 + (DWORD_PTR)(NtCurrentTeb()->ClientId).UniqueThread,
-                   (DWORD)EngGetTickCount(),
-                                  pEH->Proc);
+                     (DWORD)EngGetTickCount(),
+                                    pEH->Proc);
     return Result;
  }
  
@@@ -185,9 -195,13 +195,13 @@@ IntNotifyWinEvent
          if ((pEH->Thread != PsGetCurrentThread()) && (pEH->Thread != NULL))
          { // if all process || all thread || other thread same process
             if (!(pEH->idProcess) || !(pEH->idThread) || 
 -               (NtCurrentTeb()->ClientId.UniqueProcess == (PVOID)pEH->idProcess))
 +               (NtCurrentTeb()->ClientId.UniqueProcess == (PVOID)(DWORD_PTR)pEH->idProcess))
             {
-               Result = IntCallLowLevelEvent(pEH, Event, Window->hSelf, idObject, idChild);
+               Result = IntCallLowLevelEvent( pEH,
+                                              Event,
+                                              UserHMGetHandle(pWnd),
+                                              idObject,
+                                              idChild);
             }
          }// if ^skip own thread && ((Pid && CPid == Pid && ^skip own process) || all process)
          else if ( !(pEH->Flags & WINEVENT_SKIPOWNTHREAD) &&
@@@ -208,43 -208,16 +208,16 @@@ NtUserCallOneParam
           }
  
        case ONEPARAM_ROUTINE_WINDOWFROMDC:
 -         RETURN( (DWORD)IntWindowFromDC((HDC)Param));
 +         RETURN( (DWORD_PTR)IntWindowFromDC((HDC)Param));
  
-       case ONEPARAM_ROUTINE_GETWNDCONTEXTHLPID:
-          {
-             PWINDOW_OBJECT Window;
-             DWORD_PTR Result;
-             Window = UserGetWindowObject((HWND)Param);
-             if(!Window)
-             {
-                RETURN( FALSE);
-             }
-             Result = Window->Wnd->ContextHelpId;
-             RETURN( Result);
-          }
        case ONEPARAM_ROUTINE_SWAPMOUSEBUTTON:
           {
-             PWINSTATION_OBJECT WinSta;
-             NTSTATUS Status;
 -            DWORD Result;
 +            DWORD_PTR Result;
  
-             Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
-                                                     KernelMode,
-                                                     0,
-                                                     &WinSta);
-             if (!NT_SUCCESS(Status))
-                RETURN( (DWORD_PTR)FALSE);
-             /* FIXME
-             Result = (DWORD_PTR)IntSwapMouseButton(WinStaObject, (BOOL)Param); */
-             Result = 0;
-             ObDereferenceObject(WinSta);
-             RETURN( Result);
+             Result = gspv.bMouseBtnSwap;
+             gspv.bMouseBtnSwap = Param ? TRUE : FALSE;
+             gpsi->aiSysMet[SM_SWAPBUTTON] = gspv.bMouseBtnSwap;
+             RETURN(Result);
           }
  
        case ONEPARAM_ROUTINE_SWITCHCARETSHOWING:
                 RETURN( FALSE);
              }
  
-             Result = (DWORD_PTR)Window->Wnd->Instance;
 -            Result = (DWORD)Window->Wnd->hModule;
++            Result = (DWORD_PTR)Window->Wnd->hModule;
              RETURN( Result);
           }
  
           RETURN( UserGetKeyboardType(Param));
  
        case ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT:
 -         RETURN( (DWORD)UserGetKeyboardLayout(Param));
 +         RETURN( (DWORD_PTR)UserGetKeyboardLayout(Param));
  
-       case ONEPARAM_ROUTINE_REGISTERUSERMODULE:
-       {
-           PW32THREADINFO ti;
-           ti = GetW32ThreadInfo();
-           if (ti == NULL)
-           {
-               DPRINT1("Cannot register user32 module instance!\n");
-               SetLastWin32Error(ERROR_INVALID_PARAMETER);
-               RETURN(FALSE);
-           }
-           if (InterlockedCompareExchangePointer(&ti->ppi->hModUser,
-                                                 (HINSTANCE)Param,
-                                                 NULL) == NULL)
-           {
-               RETURN(TRUE);
-           }
-       }
        case ONEPARAM_ROUTINE_RELEASEDC:
           RETURN (UserReleaseDC(NULL, (HDC) Param, FALSE));
  
@@@ -564,15 -518,18 +518,18 @@@ NtUserCallTwoParam
  
           if(!(Window = UserGetWindowObject((HWND)Param1)))
           {
 -            RETURN( (DWORD)FALSE);
 +            RETURN( (DWORD_PTR)FALSE);
           }
  
-          Window->Wnd->ContextHelpId = Param2;
+          if ( Param2 )
+             IntSetProp(Window, gpsi->atomContextHelpIdProp, (HANDLE)Param2);
+          else
+             IntRemoveProp(Window, gpsi->atomContextHelpIdProp);
  
 -         RETURN( (DWORD)TRUE);
 +         RETURN( (DWORD_PTR)TRUE);
  
        case TWOPARAM_ROUTINE_SETCARETPOS:
 -         RETURN( (DWORD)co_IntSetCaretPos((int)Param1, (int)Param2));
 +         RETURN( (DWORD_PTR)co_IntSetCaretPos((int)Param1, (int)Param2));
  
        case TWOPARAM_ROUTINE_GETWINDOWINFO:
           {
           }
  
        case TWOPARAM_ROUTINE_REGISTERLOGONPROC:
 -         RETURN( (DWORD)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2));
 +         RETURN( (DWORD_PTR)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2));
  
-       case TWOPARAM_ROUTINE_GETSYSCOLORBRUSHES:
-       case TWOPARAM_ROUTINE_GETSYSCOLORPENS:
-       case TWOPARAM_ROUTINE_GETSYSCOLORS:
-          {
-             DWORD_PTR Ret = 0;
-             union
-             {
-                PVOID Pointer;
-                HBRUSH *Brushes;
-                HPEN *Pens;
-                COLORREF *Colors;
-             } Buffer;
-             /* FIXME - we should make use of SEH here... */
-             Buffer.Pointer = ExAllocatePool(PagedPool, Param2 * sizeof(HANDLE));
-             if(Buffer.Pointer != NULL)
-             {
-                switch(Routine)
-                {
-                   case TWOPARAM_ROUTINE_GETSYSCOLORBRUSHES:
-                      Ret = (DWORD_PTR)IntGetSysColorBrushes(Buffer.Brushes, (UINT)Param2);
-                      break;
-                   case TWOPARAM_ROUTINE_GETSYSCOLORPENS:
-                      Ret = (DWORD_PTR)IntGetSysColorPens(Buffer.Pens, (UINT)Param2);
-                      break;
-                   case TWOPARAM_ROUTINE_GETSYSCOLORS:
-                      Ret = (DWORD_PTR)IntGetSysColors(Buffer.Colors, (UINT)Param2);
-                      break;
-                   default:
-                      Ret = 0;
-                      break;
-                }
-                if(Ret > 0)
-                {
-                   Status = MmCopyToCaller((PVOID)Param1, Buffer.Pointer, Param2 * sizeof(HANDLE));
-                   if(!NT_SUCCESS(Status))
-                   {
-                      SetLastNtError(Status);
-                      Ret = 0;
-                   }
-                }
-                ExFreePool(Buffer.Pointer);
-             }
-             RETURN( Ret);
-          }
        case TWOPARAM_ROUTINE_ROS_REGSYSCLASSES:
        {
 -          DWORD Ret = 0;
 +          DWORD_PTR Ret = 0;
            DWORD Count = Param1;
            PREGISTER_SYSCLASS RegSysClassArray = (PREGISTER_SYSCLASS)Param2;
  
@@@ -746,10 -654,10 +654,10 @@@ NtUserCallHwndLock
              PMENU_OBJECT Menu;
              DPRINT("HWNDLOCK_ROUTINE_DRAWMENUBAR\n");
              Ret = FALSE;
-             if (!((Wnd->Style & (WS_CHILD | WS_POPUP)) != WS_CHILD))
+             if (!((Wnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD))
                 break;
  
 -            if(!(Menu = UserGetMenuObject((HMENU) Wnd->IDMenu)))
 +            if(!(Menu = UserGetMenuObject((HMENU)(DWORD_PTR) Wnd->IDMenu)))
                 break;
  
              Menu->MenuInfo.WndOwner = hWnd;