Synchronize with trunk r58528.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 16 Mar 2013 22:10:42 +0000 (22:10 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 16 Mar 2013 22:10:42 +0000 (22:10 +0000)
svn path=/branches/ros-csrss/; revision=58529

474 files changed:
base/applications/calc/winmain.c
base/applications/cmdutils/dbgprint/dbgprint.c
base/applications/cmdutils/hostname/hostname.c
base/applications/games/winmine/main.c
base/applications/mscutils/eventvwr/eventvwr.c
base/applications/rapps/rapps/bittorrent.txt
base/applications/rapps/rapps/firefox5.txt
base/applications/rapps/rapps/kdewin.txt
base/applications/rapps/rapps/libreoffice.txt
base/applications/rapps/rapps/mirandaim.txt
base/applications/rapps/rapps/mirc.txt
base/applications/rapps/rapps/mono2.txt
base/applications/rapps/rapps/opera.txt
base/applications/rapps/rapps/scite.txt
base/applications/rapps/rapps/seamonkey.txt
base/applications/rapps/rapps/sumatrapdf.txt
base/applications/rapps/rapps/thunderbird5.txt
base/applications/rapps/rapps/utorrent.txt
base/applications/sc/print.c
base/applications/setup16/main.c
base/applications/shutdown/misc.c
base/applications/sndvol32/misc.c
base/applications/sndvol32/mixer.c
base/applications/sndvol32/sndvol32.c
base/applications/taskmgr/procpage.c
base/services/audiosrv/main.c
base/services/eventlog/eventlog.c
base/setup/reactos/reactos.c
base/setup/usetup/bootsup.h
base/setup/usetup/drivesup.c
base/setup/usetup/drivesup.h
base/setup/usetup/errorcode.h
base/setup/usetup/filequeue.h
base/setup/usetup/filesup.h
base/setup/usetup/format.h
base/setup/usetup/genlist.h
base/setup/usetup/inicache.c
base/setup/usetup/progress.h
base/setup/usetup/registry.h
base/setup/usetup/settings.h
base/setup/welcome/lang/ru-RU.rc
base/setup/welcome/welcome.c
base/shell/cmd/window.c
base/system/services/driver.c
base/system/services/lock.c
base/system/winlogon/setup.h
boot/bootdata/hivesft.inf
boot/freeldr/freeldr/inifile/parse.c
dll/cpl/access/access.c
dll/cpl/access/display.c
dll/cpl/access/general.c
dll/cpl/access/keyboard.c
dll/cpl/access/mouse.c
dll/cpl/access/sound.c
dll/cpl/appwiz/createlink.c
dll/cpl/desk/advappdlg.c
dll/cpl/desk/background.c
dll/cpl/desk/desk.c
dll/cpl/desk/dibitmap.c
dll/cpl/intl/currency.c
dll/cpl/intl/date.c
dll/cpl/intl/generalp.c
dll/cpl/intl/inplocale.c
dll/cpl/intl/intl.c
dll/cpl/intl/numbers.c
dll/cpl/intl/sort.c
dll/cpl/liccpa/liccpa.c
dll/cpl/liccpa/liccpa.rc
dll/cpl/main/keyboard.c
dll/cpl/main/main.c
dll/cpl/main/mouse.c
dll/cpl/mmsys/sounds.c
dll/cpl/mmsys/volume.c
dll/cpl/odbccp32/odbccp32.c
dll/cpl/powercfg/advanced.c
dll/cpl/powercfg/alarms.c
dll/cpl/powercfg/hibernate.c
dll/cpl/powercfg/powercfg.c
dll/cpl/powercfg/powershemes.c
dll/cpl/usrmgr/extra.c
dll/cpl/usrmgr/usrmgr.c
dll/directx/d3d8/d3d8.rc
dll/directx/d3d9/d3d9.rc
dll/directx/ddraw/Clipper/clipper_main.c
dll/directx/ddraw/Clipper/clipper_stubs.c
dll/directx/ddraw/Color/color_stubs.c
dll/directx/ddraw/Ddraw/GetCaps.c
dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c
dll/directx/ddraw/Ddraw/callbacks_dd_hel.c
dll/directx/ddraw/Ddraw/ddraw_displaymode.c
dll/directx/ddraw/Ddraw/ddraw_main.c
dll/directx/ddraw/Ddraw/ddraw_setcooperativelevel.c
dll/directx/ddraw/Ddraw/ddraw_stubs.c
dll/directx/ddraw/Gamma/gamma_stubs.c
dll/directx/ddraw/Kernel/kernel_stubs.c
dll/directx/ddraw/Palette/createpalette.c
dll/directx/ddraw/Palette/palette.c
dll/directx/ddraw/Palette/palette_stubs.c
dll/directx/ddraw/Surface/callbacks_surf_hel.c
dll/directx/ddraw/Surface/createsurface.c
dll/directx/ddraw/Surface/surface_main.c
dll/directx/ddraw/Surface/surface_stubs.c
dll/directx/ddraw/Videoport/videoport_stubs.c
dll/directx/ddraw/cleanup.c
dll/directx/ddraw/ddraw.rc
dll/directx/ddraw/main.c
dll/directx/ddraw/startup.c
dll/shellext/slayer/slayer.c
dll/win32/aclui/aclui.c
dll/win32/aclui/checklist.c
dll/win32/aclui/misc.c
dll/win32/aclui/sidcache.c
dll/win32/advapi32/misc/dllmain.c
dll/win32/advapi32/sec/ac.c
dll/win32/advapi32/sec/audit.c
dll/win32/advapi32/sec/sec.c
dll/win32/advapi32/sec/trustee.c
dll/win32/advapi32/service/scm.c
dll/win32/advapi32/token/privilege.c
dll/win32/comctl32/comctl32undoc.c
dll/win32/comctl32/datetime.c
dll/win32/comctl32/dpa.c
dll/win32/comctl32/imagelist.c
dll/win32/comctl32/listview.c
dll/win32/comctl32/monthcal.c
dll/win32/comctl32/propsheet.c
dll/win32/comctl32/rebar.c
dll/win32/comctl32/status.c
dll/win32/comctl32/toolbar.c
dll/win32/comctl32/tooltips.c
dll/win32/comctl32/treeview.c
dll/win32/comctl32/updown.c
dll/win32/devmgr/devprblm.c
dll/win32/devmgr/hwpage.c
dll/win32/devmgr/misc.c
dll/win32/dhcpcsvc/dhcp/api.c
dll/win32/dhcpcsvc/dhcp/pipe.c
dll/win32/hid/hid.c
dll/win32/hid/stubs.c
dll/win32/iprtprio/iprtprio.rc
dll/win32/kernel32/client/dosdev.c
dll/win32/kernel32/client/environ.c
dll/win32/kernel32/client/except.c
dll/win32/kernel32/client/file/backup.c
dll/win32/kernel32/client/file/cnotify.c
dll/win32/kernel32/client/file/copy.c
dll/win32/kernel32/client/file/create.c
dll/win32/kernel32/client/file/delete.c
dll/win32/kernel32/client/file/dir.c
dll/win32/kernel32/client/file/fileinfo.c
dll/win32/kernel32/client/file/hardlink.c
dll/win32/kernel32/client/file/iocompl.c
dll/win32/kernel32/client/file/lfile.c
dll/win32/kernel32/client/file/lock.c
dll/win32/kernel32/client/file/mailslot.c
dll/win32/kernel32/client/file/move.c
dll/win32/kernel32/client/file/rw.c
dll/win32/kernel32/client/file/tape.c
dll/win32/kernel32/client/file/volume.c
dll/win32/kernel32/client/job.c
dll/win32/kernel32/client/time.c
dll/win32/kernel32/client/toolhelp.c
dll/win32/kernel32/wine/lzexpand.c
dll/win32/kernel32/wine/muldiv.c
dll/win32/kernel32/wine/timezone.c
dll/win32/kernel32/winnls/string/nls.c
dll/win32/lsasrv/database.c
dll/win32/msgina/stubs.c
dll/win32/msvcrt/msvcrt.spec
dll/win32/mswsock/extensions.c
dll/win32/mswsock/stubs.c
dll/win32/ntmarta/ntmarta.c
dll/win32/psapi/internal.h
dll/win32/psapi/malloc.c
dll/win32/psapi/psapi.c
dll/win32/samlib/dllmain.c
dll/win32/samlib/samlib.c
dll/win32/samsrv/CMakeLists.txt
dll/win32/samsrv/alias.c [new file with mode: 0644]
dll/win32/samsrv/database.c
dll/win32/samsrv/group.c
dll/win32/samsrv/samrpc.c
dll/win32/samsrv/samsrv.c
dll/win32/samsrv/samsrv.h
dll/win32/samsrv/samsrv.spec
dll/win32/samsrv/setup.c
dll/win32/samsrv/user.c
dll/win32/secur32/dllmain.c
dll/win32/smdll/dllmain.c
dll/win32/smdll/query.c
dll/win32/smdll/readme.txt
dll/win32/syssetup/dllmain.c
dll/win32/syssetup/install.c
dll/win32/userenv/desktop.c
dll/win32/userenv/directory.c
dll/win32/userenv/environment.c
dll/win32/userenv/internal.h
dll/win32/userenv/misc.c
dll/win32/userenv/registry.c
dll/win32/userenv/resources.h
dll/win32/userenv/setup.c
dll/win32/userenv/userenv.c
dll/win32/winfax/winfax.c
dll/win32/winscard/winscard.c
dll/win32/winscard/winscard.rc
dll/win32/winspool/stubs.c
dll/win32/wsock32/stubs.c
drivers/base/beep/beep.rc
drivers/base/bootvid/bootvid.rc
drivers/base/kdcom/kdcom.rc
drivers/base/null/null.rc
drivers/bus/acpi/acpi.rc
drivers/bus/acpi/acpienum.c
drivers/bus/isapnp/isapnp.rc
drivers/bus/pci/pci.rc
drivers/bus/pci/pcidef.h
drivers/filesystems/cdfs/cdfs.c
drivers/filesystems/cdfs/cdfs.rc
drivers/filesystems/cdfs/cleanup.c
drivers/filesystems/cdfs/close.c
drivers/filesystems/cdfs/common.c
drivers/filesystems/cdfs/create.c
drivers/filesystems/cdfs/dirctl.c
drivers/filesystems/cdfs/fcb.c
drivers/filesystems/cdfs/finfo.c
drivers/filesystems/cdfs/misc.c
drivers/filesystems/cdfs/rw.c
drivers/filesystems/cdfs/volinfo.c
drivers/filesystems/ext2/ext2fs.rc
drivers/filesystems/msfs/msfs.rc
drivers/filesystems/mup/create.c
drivers/filesystems/mup/mup.c
drivers/filesystems/mup/mup.rc
drivers/input/kbdclass/kbdclass.rc
drivers/input/mouclass/mouclass.rc
drivers/input/sermouse/sermouse.rc
drivers/multimedia/audio/mpu401_nt4/mpu401.rc
drivers/multimedia/audio/sndblst.old/sndblst.rc
drivers/multimedia/audio/sndblst_sys/sndblst.rc
drivers/multimedia/audio/sound/sb16.c
drivers/multimedia/audio/sound/sb16.rc
drivers/network/afd/afd.rc
drivers/network/afd/afd/bind.c
drivers/network/afd/afd/connect.c
drivers/network/afd/afd/context.c
drivers/network/afd/afd/info.c
drivers/network/afd/afd/listen.c
drivers/network/afd/afd/lock.c
drivers/network/afd/afd/main.c
drivers/network/afd/afd/read.c
drivers/network/afd/afd/tdiconn.c
drivers/network/afd/include/afd.h
drivers/network/dd/ne2000/ne2000.rc
drivers/network/dd/pcnet/pcnet.rc
drivers/network/lan/lan.rc
drivers/network/ndis/ndis.rc
drivers/network/tdi/cte/string.c
drivers/network/tdi/misc/tdi.rc
drivers/network/tdi/tdi/handler.c
drivers/network/tdi/tdi/obsolete.c
drivers/network/tdi/tdi/stubs.c
drivers/parallel/parallel/parallel.c
drivers/parallel/parallel/parallel.rc
drivers/serial/serenum/serenum.rc
drivers/serial/serial/serial.rc
drivers/setup/blue/blue.rc
drivers/storage/class/cdrom/cdrom.rc
drivers/storage/class/class2/class2.rc
drivers/storage/class/disk/disk.rc
drivers/storage/class/include/class2.h
drivers/storage/floppy/floppy.rc
drivers/storage/ide/atapi/atapi.rc
drivers/wmi/wmilib.rc
hal/halppc/generic/display.c
hal/halppc/generic/dma.c
hal/halppc/generic/enum.c
hal/halppc/generic/font.c
hal/halppc/generic/irql.c
hal/halppc/generic/isa.c
hal/halppc/generic/portio.c
hal/halppc/generic/processor.c
hal/halppc/generic/reboot.c
hal/halppc/include/halirq.h
hal/halppc/up/halinit_up.c
hal/halx86/apic/halinit_apic.c
hal/halx86/include/halirq.h
hal/halx86/mp/apic.c
hal/halx86/mp/halinit_mp.c
hal/halx86/mp/ioapic.c
hal/halx86/mp/ipi_mp.c
hal/halx86/mp/mpconfig.c
hal/halx86/mp/processor_mp.c
hal/halx86/up/halinit_mini.c
hal/halx86/up/halinit_up.c
hal/halx86/xbox/halinit_xbox.c
hal/halx86/xbox/halxbox.h
hal/halx86/xbox/part_xbox.c
include/crt/conio.h
include/crt/direct.h
include/crt/errno.h
include/crt/float.h
include/crt/io.h
include/crt/locale.h
include/crt/malloc.h
include/crt/math.h
include/crt/mbctype.h
include/crt/sec_api/stdlib_s.h
include/crt/stdlib.h
include/ddk/ntpoapi.h
include/psdk/batclass.h
include/psdk/commctrl.h
include/psdk/ddkernel.h
include/psdk/dmemmgr.h
include/psdk/dvp.h
include/psdk/evntprov.h
include/psdk/ntddstor.h
include/psdk/objerror.h
include/psdk/polarity.h
include/psdk/sal.h
include/psdk/winnls.h
include/reactos/libs/epsapi/epsapi.h
include/reactos/libs/syssetup/syssetup.h
include/reactos/services/services.h
include/reactos/subsys/lsass/lsass.h
include/reactos/winlogon.h
lib/3rdparty/adns/README.html
lib/3rdparty/freetype/README.ROS
lib/epsapi/enum/drivers.c
lib/epsapi/enum/modules.c
lib/epsapi/enum/processes.c
lib/fslib/vfatlib/check/vfat.h
lib/sdk/crt/crt.cmake
lib/sdk/crt/except/i386/chkstk_asm.s
lib/sdk/crt/except/powerpc/chkstk_asm.s
lib/sdk/crt/libcntpr.cmake
lib/sdk/crt/math/adjust.c
lib/sdk/crt/mem/i386/memchr_asm.s
lib/sdk/crt/mem/i386/memset_asm.s
lib/sdk/crt/mem/memccpy.c
lib/sdk/crt/mem/memchr.c
lib/sdk/crt/mem/memcmp.c
lib/sdk/crt/mem/memset.c
lib/sdk/crt/printf/_snprintf_s.c [new file with mode: 0644]
lib/sdk/crt/printf/_snwprintf_s.c [new file with mode: 0644]
lib/sdk/crt/printf/_sxprintf.c
lib/sdk/crt/printf/_vsnprintf_s.c [new file with mode: 0644]
lib/sdk/crt/printf/_vsnwprintf_s.c [new file with mode: 0644]
lib/sdk/crt/printf/sprintf_s.c [new file with mode: 0644]
lib/sdk/crt/printf/swprintf_s.c [new file with mode: 0644]
lib/sdk/crt/printf/vsprintf_s.c [new file with mode: 0644]
lib/sdk/crt/printf/vswprintf_s.c [new file with mode: 0644]
lib/sdk/crt/setjmp/i386/setjmp.s
lib/sdk/crt/stdlib/makepath.c
lib/sdk/crt/stdlib/wmakpath.c
lib/sdk/crt/string/_splitpath.c [new file with mode: 0644]
lib/sdk/crt/string/_splitpath_s.c [new file with mode: 0644]
lib/sdk/crt/string/_tsplitpath_x.h [new file with mode: 0644]
lib/sdk/crt/string/_wsplitpath.c [new file with mode: 0644]
lib/sdk/crt/string/_wsplitpath_s.c [new file with mode: 0644]
lib/sdk/crt/string/i386/strcat_asm.s
lib/sdk/crt/string/i386/strchr_asm.s
lib/sdk/crt/string/i386/strcmp_asm.s
lib/sdk/crt/string/i386/strcpy_asm.s
lib/sdk/crt/string/i386/strlen_asm.s
lib/sdk/crt/string/i386/strncat_asm.s
lib/sdk/crt/string/i386/strncmp_asm.s
lib/sdk/crt/string/i386/strncpy_asm.s
lib/sdk/crt/string/i386/strnlen_asm.s
lib/sdk/crt/string/i386/strrchr_asm.s
lib/sdk/crt/string/i386/tchar.h
lib/sdk/crt/string/i386/tcscat.inc
lib/sdk/crt/string/i386/tcschr.inc
lib/sdk/crt/string/i386/tcscmp.inc
lib/sdk/crt/string/i386/tcscpy.inc
lib/sdk/crt/string/i386/tcslen.inc
lib/sdk/crt/string/i386/tcsncat.inc
lib/sdk/crt/string/i386/tcsncmp.inc
lib/sdk/crt/string/i386/tcsncpy.inc
lib/sdk/crt/string/i386/tcsnlen.inc
lib/sdk/crt/string/i386/tcsrchr.inc
lib/sdk/crt/string/i386/wcscat_asm.s
lib/sdk/crt/string/i386/wcschr_asm.s
lib/sdk/crt/string/i386/wcscmp_asm.s
lib/sdk/crt/string/i386/wcscpy_asm.s
lib/sdk/crt/string/i386/wcslen_asm.s
lib/sdk/crt/string/i386/wcsncat_asm.s
lib/sdk/crt/string/i386/wcsncmp_asm.s
lib/sdk/crt/string/i386/wcsncpy_asm.s
lib/sdk/crt/string/i386/wcsnlen_asm.s
lib/sdk/crt/string/i386/wcsrchr_asm.s
lib/sdk/crt/string/splitp.c [deleted file]
lib/sdk/crt/string/strcat.c
lib/sdk/crt/string/strchr.c
lib/sdk/crt/string/strcmp.c
lib/sdk/crt/string/strcpy.c
lib/sdk/crt/string/strcspn.c
lib/sdk/crt/string/strlen.c
lib/sdk/crt/string/strncat.c
lib/sdk/crt/string/strncmp.c
lib/sdk/crt/string/strncpy.c
lib/sdk/crt/string/strnlen.c
lib/sdk/crt/string/strpbrk.c
lib/sdk/crt/string/strrchr.c
lib/sdk/crt/string/strspn.c
lib/sdk/crt/string/strxspn.h
lib/sdk/crt/string/tcscat.h
lib/sdk/crt/string/tcschr.h
lib/sdk/crt/string/tcscmp.h
lib/sdk/crt/string/tcscpy.h
lib/sdk/crt/string/tcslen.h
lib/sdk/crt/string/tcsncat.h
lib/sdk/crt/string/tcsncmp.h
lib/sdk/crt/string/tcsncpy.h
lib/sdk/crt/string/tcsnlen.h
lib/sdk/crt/string/tcsrchr.h
lib/sdk/crt/string/wcscat.c
lib/sdk/crt/string/wcschr.c
lib/sdk/crt/string/wcscmp.c
lib/sdk/crt/string/wcscpy.c
lib/sdk/crt/string/wcslen.c
lib/sdk/crt/string/wcsncat.c
lib/sdk/crt/string/wcsncmp.c
lib/sdk/crt/string/wcsncpy.c
lib/sdk/crt/string/wcsnlen.c
lib/sdk/crt/string/wcsrchr.c
lib/sdk/crt/string/witow.c
lib/sdk/crt/string/wsplitp.c [deleted file]
lib/smlib/compses.c
lib/smlib/connect.c
lib/smlib/execpgm.c
lib/smlib/lookupss.c
media/doc/README.WINE
ntoskrnl/include/internal/i386/ke.h
ntoskrnl/include/internal/mm.h
ntoskrnl/kdbg/kdb.h
ntoskrnl/kdbg/kdb_cli.c
ntoskrnl/ke/i386/thrdini.c
ntoskrnl/ke/i386/v86vdm.c
ntoskrnl/ke/powerpc/ppc_irq.c
ntoskrnl/mm/ARM3/expool.c
ntoskrnl/mm/ARM3/procsup.c
ntoskrnl/mm/marea.c
ntoskrnl/ps/kill.c
subsystems/ntvdm/ntvdm.c
subsystems/ntvdm/ntvdm.rc
win32ss/drivers/font/ftfd/rosglue.c
win32ss/gdi/gdi32/main/dllmain.c
win32ss/gdi/gdi32/misc/hacks.c
win32ss/gdi/gdi32/misc/heap.c
win32ss/gdi/gdi32/misc/historic.c
win32ss/gdi/gdi32/objects/eng.c
win32ss/gdi/gdi32/objects/path.c
win32ss/reactx/dxg/dxg.rc
win32ss/reactx/dxgthk/dxgthk.rc
win32ss/user/ntuser/desktop.c
win32ss/user/ntuser/vis.h
win32ss/user/ntuser/winpos.c
win32ss/user/ntuser/winsta.c
win32ss/user/ntuser/winsta.h
win32ss/user/user32/include/regcontrol.h
win32ss/user/user32/misc/desktop.c
win32ss/user/user32/misc/object.c
win32ss/user/user32/misc/timer.c
win32ss/user/user32/misc/winsta.c
win32ss/user/user32/windows/accel.c
win32ss/user/user32/windows/caret.c
win32ss/user/user32/windows/clipboard.c
win32ss/user/user32/windows/dc.c
win32ss/user/user32/windows/font.c
win32ss/user/user32/windows/rect.c
win32ss/user/user32/windows/text.c
win32ss/user/winsrv/lang/es-ES.rc
win32ss/user/winsrv/shutdown.c
win32ss/win32k.rc

index 6279d3d..e9a82c8 100644 (file)
@@ -229,12 +229,12 @@ static void load_config(void)
 
     /* Try to load last selected layout */
     GetProfileString(TEXT("SciCalc"), TEXT("layout"), TEXT("0"), buf, SIZEOF(buf));
-    if (_stscanf(buf, TEXT("%ld"), &calc.layout) != 1)
+    if (_stscanf(buf, TEXT("%lu"), &calc.layout) != 1)
         calc.layout = CALC_LAYOUT_STANDARD;
 
     /* Try to load last selected formatting option */
     GetProfileString(TEXT("SciCalc"), TEXT("UseSep"), TEXT("0"), buf, SIZEOF(buf));
-    if (_stscanf(buf, TEXT("%ld"), &tmp) != 1)
+    if (_stscanf(buf, TEXT("%lu"), &tmp) != 1)
         calc.usesep = FALSE;
     else
         calc.usesep = (tmp == 1) ? TRUE : FALSE;
index 8699db6..ed3d76c 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: dbgprint.c 24720 2006-11-11 16:07:35Z janderwald $
- *
+/*
  * PROJECT:         ReactOS DbgPrint Utility
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            tools/dbgprint/dbgprint.c
index 08f754b..759015f 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT : See COPYING in the top level directory
  * PROJECT   : ReactOS/Win32 get host name
  * FILE      : subsys/system/hostname/hostname.c
@@ -44,7 +43,7 @@ int main (int argc, char ** argv)
                        printf ("%s\n", ComputerName);
                        return EXIT_SUCCESS;
                }
-               fprintf (stderr, "%s: Win32 error %ld.\n",
+               fprintf (stderr, "%s: Win32 error %lu.\n",
                        argv[0], GetLastError());
                return EXIT_FAILURE;
        }else{
index 9aa0dd2..1260c7b 100644 (file)
@@ -108,7 +108,7 @@ static void LoadBoard( BOARD *p_board )
         p_board->IsMarkQ = TRUE;
 
     for( i = 0; i < 3; i++ ) {
-        wsprintf( key_name, "Name%d", i+1 );
+        wsprintf( key_name, "Name%u", i+1 );
         size = sizeof( data );
         if( RegQueryValueEx( hkey, key_name, NULL, &type,
                 (LPBYTE) data, &size ) == ERROR_SUCCESS )
@@ -118,7 +118,7 @@ static void LoadBoard( BOARD *p_board )
     }
 
     for( i = 0; i < 3; i++ ) {
-        wsprintf( key_name, "Time%d", i+1 );
+        wsprintf( key_name, "Time%u", i+1 );
         size = sizeof( p_board->best_time[i] );
         if( !RegQueryValueEx( hkey, key_name, NULL, &type,
                 (LPBYTE) &p_board->best_time[i], &size ) == ERROR_SUCCESS )
index 628eac0..f04b511 100644 (file)
@@ -695,7 +695,7 @@ QueryEventMessages(LPWSTR lpMachineName,
     else
         _snwprintf(szWindowTitle+i, dwMaxLength, L"%s", lpComputerName);
 
-    swprintf(szStatusText, L"%s has %d event(s)", lpLogName, dwTotalRecords);
+    swprintf(szStatusText, L"%s has %lu event(s)", lpLogName, dwTotalRecords);
 
     // Update the status bar
     SendMessageW(hwndStatus, SB_SETTEXT, (WPARAM)0, (LPARAM)szStatusText);
index 68dd202..e5dd543 100644 (file)
@@ -2,13 +2,13 @@
 
 [Section]
 Name = BitTorrent
-Version = 7.7.2
+Version = 7.8
 Licence = Freeware for non-commercial uses
 Description = The Original BitTorrent Client.
-Size = 956KB
+Size = 1012KB
 Category = 5
 URLSite = http://www.bittorrent.com/
-URLDownload = http://download.bittorrent.com/7.7.2/BitTorrent.exe
+URLDownload = http://download.bittorrent.com/7.8/BitTorrent.exe
 CDPath = none
 
 [Section.0407]
index c7a488f..c8bc4c6 100644 (file)
@@ -1,33 +1,33 @@
 ; UTF-8
 
 [Section]
-Name = Mozilla Firefox 17
-Version = 17.0.1
+Name = Mozilla Firefox 19
+Version = 19.0.2
 Licence = MPL/GPL/LGPL
 Description = The most popular and one of the best free Web Browsers out there.
 Size = 15.8MB
 Category = 5
 URLSite = http://www.mozilla.com/en-US/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/17.0.1/win32/en-US/Firefox%20Setup%2017.0.1.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/19.0.2/win32/en-US/Firefox%20Setup%2019.0.2.exe
 CDPath = none
 
 [Section.0407]
 Description = Der populärste und einer der besten freien Webbrowser.
 Size = 15.7MB
 URLSite = http://www.mozilla-europe.org/de/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/17.0.1/win32/de/Firefox%20Setup%2017.0.1.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/19.0.2/win32/de/Firefox%20Setup%2019.0.2.exe
 
 [Section.040a]
 Description = El más popular y uno de los mejores navegadores web gratuitos que hay.
 Size = 15.6MB
 URLSite = http://www.mozilla-europe.org/es/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/17.0.1/win32/es-ES/Firefox%20Setup%2017.0.1.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/19.0.2/win32/es-ES/Firefox%20Setup%2019.0.2.exe
 
 [Section.040c]
 Description = Le navigateur web gratuit le plus populaire et l'un des meilleurs.
 Size = 15.9MB
 URLSite = http://www.mozilla-europe.org/fr/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/17.0.1/win32/fr/Firefox%20Setup%2017.0.1.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/19.0.2/win32/fr/Firefox%20Setup%2019.0.2.exe
 
 [Section.0413]
 Description = De meest populaire en een van de beste gratis Web browsers.
@@ -38,34 +38,34 @@ URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/14.0.
 Description = Mest populære og best også gratis nettleserene der ute.
 Size = 15.6MB
 URLSite = http://www.mozilla-europe.org/no/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/17.0.1/win32/nb-NO/Firefox%20Setup%2017.0.1.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/19.0.2/win32/nb-NO/Firefox%20Setup%2019.0.2.exe
 
 [Section.0415]
 Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych.
 Size = 16.5MB
 URLSite = http://www.mozilla-europe.org/pl/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/17.0.1/win32/pl/Firefox%20Setup%2017.0.1.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/19.0.2/win32/pl/Firefox%20Setup%2019.0.2.exe
 
 [Section.0418]
 Description = Cel mai popular și unul dintre cele mai bune navigatoare web gratuite existente.
 Size = 16,1 Mo
 URLSite = http://www.mozilla-europe.org/ro/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/17.0.1/win32/ro/Firefox%20Setup%2017.0.1.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/19.0.2/win32/ro/Firefox%20Setup%2019.0.2.exe
 
 [Section.0419]
 Description = Один из самых популярных и лучших бесплатных браузеров.
 Size = 16.1MB
 URLSite = http://www.mozilla-europe.org/ru/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/17.0.1/win32/ru/Firefox%20Setup%2017.0.1.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/19.0.2/win32/ru/Firefox%20Setup%2019.0.2.exe
 
 [Section.041b] 
 Description = Najpopulárnejší a jeden z najlepších slobodný webových prehliadačov.
 Size = 16.3MB
 URLSite = http://www.mozilla-europe.org/sk/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/17.0.1/win32/sk/Firefox%20Setup%2017.0.1.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/19.0.2/win32/sk/Firefox%20Setup%2019.0.2.exe
 
 [Section.0422]
 Description = Найпопулярніший та один з кращих безплатних веб-браузерів.
 Size = 16.1MB
 URLSite = http://www.mozilla-europe.org/uk/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/17.0.1/win32/uk/Firefox%20Setup%2017.0.1.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/19.0.2/win32/uk/Firefox%20Setup%2019.0.2.exe
index 7d9022d..fca793b 100644 (file)
@@ -2,13 +2,13 @@
 \r
 [Section]\r
 Name = K Desktop Environment\r
-Version = 0.9.9-7\r
+Version = 0.9.9-8\r
 Licence = GPL\r
 Description = KDE for Windows.\r
 Size = 2.21MB\r
 Category = 15\r
 URLSite = http://www.winkde.org/\r
-URLDownload = http://www.winkde.org/pub/kde/ports/win32/installer/kdewin-installer-gui-0.9.9-7.exe\r
+URLDownload = http://www.winkde.org/pub/kde/ports/win32/installer/kdewin-installer-gui-0.9.9-8.exe\r
 CDPath = none\r
 \r
 [Section.0407]\r
index 0fa0fd7..1cb734e 100644 (file)
@@ -2,13 +2,13 @@
 \r
 [Section]\r
 Name = LibreOffice\r
-Version = 3.6.4\r
+Version = 4.0.1\r
 Licence = LGPL\r
 Description = Former called OpenOffice. Open Source Office Suite.\r
 Size = 200.0MB\r
 Category = 6\r
 URLSite = http://www.documentfoundation.org/\r
-URLDownload = http://download.documentfoundation.org/libreoffice/stable/3.6.4/win/x86/LibO_3.6.4_Win_x86_install_multi.msi\r
+URLDownload = http://download.documentfoundation.org/libreoffice/stable/4.0.1/win/x86/LibreOffice_4.0.1_Win_x86.msi\r
 CDPath = none\r
 \r
 [Section.0407]\r
index 694fce2..1c39c74 100644 (file)
@@ -2,13 +2,13 @@
 \r
 [Section]\r
 Name = Miranda IM\r
-Version = 0.10.9\r
+Version = 0.10.11\r
 Licence = GPL\r
 Description = Open source multiprotocol instant messaging application - May not work completely.\r
 Size = 3.1MB\r
 Category = 5\r
 URLSite = http://www.miranda-im.org/\r
-URLDownload = http://miranda.googlecode.com/files/miranda-im-v0.10.9-unicode.exe\r
+URLDownload = http://miranda.googlecode.com/files/miranda-im-v0.10.11-unicode.exe\r
 CDPath = none\r
 \r
 [Section.0407]\r
index 921a250..953303c 100644 (file)
@@ -2,13 +2,13 @@
 \r
 [Section]\r
 Name = mIRC 7\r
-Version = 7.27\r
+Version = 7.29\r
 Licence = Shareware\r
 Description = The most popular client for the Internet Relay Chat (IRC).\r
 Size = 1.82MB\r
 Category = 5\r
 URLSite = http://www.mirc.com/\r
-URLDownload = http://download.mirc.com/6/mirc727.exe\r
+URLDownload = http://download.mirc.com/7/mirc729.exe\r
 CDPath = none\r
 \r
 [Section.0407]\r
index 2794b70..74be2a2 100644 (file)
@@ -8,7 +8,7 @@ Description = Open Source .net Framework.
 Size = 91.9MB\r
 Category = 14\r
 URLSite = http://www.mono-project.com/Main_Page\r
-URLDownload = http://download.mono-project.com/archive/2.11.4/windows-installer/mono-2.11.4-gtksharp-2.12.11-win32-0.exe\r
+URLDownload = http://download.mono-project.com/archive/2.10.9/windows-installer/0/mono-2.10.9-gtksharp-2.12.11-win32-0.exe\r
 CDPath = none\r
 \r
 [Section.040a]\r
index 96060dc..c0eaaab 100644 (file)
@@ -2,13 +2,13 @@
 \r
 [Section]\r
 Name = Opera\r
-Version = 12.12\r
+Version = 12.14\r
 Licence = Freeware\r
 Description = The popular Opera Browser with many advanced features and including a Mail and BitTorrent client.\r
 Size = 12.00MB\r
 Category = 5\r
 URLSite = http://www.opera.com/\r
-URLDownload = http://ftp.opera.com/pub/opera/win/1212/int/Opera_1212_int_Setup.exe\r
+URLDownload = http://ftp.opera.com/pub/opera/win/1214/int/Opera_1214_int_Setup.exe\r
 CDPath = none\r
 \r
 [Section.0405]\r
index 6a5ed5d..3d42b09 100644 (file)
@@ -2,13 +2,13 @@
 \r
 [Section]\r
 Name = SciTE\r
-Version = 3.2.3\r
+Version = 3.2.5\r
 Licence = Freeware\r
 Description = SciTE is a SCIntilla based Text Editor. Originally built to demonstrate Scintilla, it has grown to be a generally useful editor with facilities for building and running programs.\r
 Size = 685kB\r
 Category = 7\r
 URLSite = http://www.scintilla.org/\r
-URLDownload = http://heanet.dl.sourceforge.net/project/scintilla/SciTE/3.2.3/Sc323.exe\r
+URLDownload = http://heanet.dl.sourceforge.net/project/scintilla/SciTE/3.2.5/Sc325.exe\r
 CDPath = none\r
 \r
 [Section.0407]\r
index b04482c..fe171f7 100644 (file)
@@ -2,39 +2,39 @@
 \r
 [Section]\r
 Name = Mozilla SeaMonkey\r
-Version = 2.14.1\r
+Version = 2.16.2\r
 Licence = MPL/GPL/LGPL\r
 Description = Mozilla Suite is alive. This is the one and only Browser, Mail, Chat, and Composer bundle you will ever need.\r
 Size = 20.0MB\r
 Category = 5\r
 URLSite = http://www.seamonkey-project.org/\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.14.1/win32/en-US/SeaMonkey%20Setup%202.14.1.exe\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.16.2/win32/en-US/SeaMonkey%20Setup%202.16.2.exe\r
 CDPath = none\r
 \r
 [Section.0407]\r
 Description = Mozilla Suite lebt. Dies ist das einzige Browser-, Mail-, Chat- and Composerwerkzeug-Bundle welches Sie benötigen.\r
 Size = 20.0MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.14.1/win32/de/SeaMonkey%20Setup%202.14.1.exe\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.16.2/win32/de/SeaMonkey%20Setup%202.16.2.exe\r
 \r
 [Section.040a]\r
 Description = La suite de Mozilla está viva. Es el primero y único navegador web, gestor de correo, lector de noticias, Chat y editor HTML que necesitarás.\r
 Size = 19.9MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.14.1/win32/es-ES/SeaMonkey%20Setup%202.14.1.exe\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.16.2/win32/es-ES/SeaMonkey%20Setup%202.16.2.exe\r
 \r
 [Section.040c]\r
 Description = La suite Mozilla est en vie. Ceci est le seul et l'unique package navigateur, client mail, client chat et composer dont vous aurez besoin.\r
 Size = 20.2MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.14.1/win32/fr/SeaMonkey%20Setup%202.14.1.exe\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.16.2/win32/fr/SeaMonkey%20Setup%202.16.2.exe\r
 \r
 [Section.0413]\r
 Description = Mozilla Suite bundelt alle applicaties voor het Web: Browser, Mail, Chat, Composer.\r
 Size = 20.6MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.14.1/win32/nl/SeaMonkey%20Setup%202.14.1.exe\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.16.2/win32/nl/SeaMonkey%20Setup%202.16.2.exe\r
 \r
 [Section.0415]\r
 Description = Pakiet Mozilla żyje. W zestawie: przeglądarka, klient poczty, IRC oraz Edytor HTML - wszystko, czego potrzebujesz.\r
 Size = 20.8MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.14.1/win32/pl/SeaMonkey%20Setup%202.14.1.exe\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.16.2/win32/pl/SeaMonkey%20Setup%202.16.2.exe\r
 \r
 [Section.0418]\r
 Description = Suita Mozilla. Acest pachet ce încorporează navigator, poștă electronică, client IRC și editor HTML, acoperind astfel o arie largă de necesități.\r
@@ -43,9 +43,9 @@ Size = 20.59Mo
 [Section.0419]\r
 Description = Продолжение Mozilla Suite. Включает браузер, почтовый клиент, IRC-клиент и HTML-редактор.\r
 Size = 20.5MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.14.1/win32/ru/SeaMonkey%20Setup%202.14.1.exe\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.16.2/win32/ru/SeaMonkey%20Setup%202.16.2.exe\r
 \r
 [Section.0422]\r
 Description = Продовження Mozilla Suite. Включає в себе браузер, поштовий клієнт, IRC-клієнт та HTML-редактор.\r
 Size = 20.5MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.14.1/win32/ru/SeaMonkey%20Setup%202.14.1.exe\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.16.2/win32/ru/SeaMonkey%20Setup%202.16.2.exe\r
index d1c1465..9ee530c 100644 (file)
@@ -2,13 +2,13 @@
 \r
 [Section]\r
 Name = SumatraPDF\r
-Version = 2.2\r
+Version = 2.2.1\r
 Licence = GPLv3\r
 Description = Sumatra PDF is a slim, free, open-source PDF reader. Portable out of the box.\r
 Size = 4.8MB\r
 Category = 6\r
 URLSite = http://blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html\r
-URLDownload = https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-2.2-install.exe\r
+URLDownload = https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-2.2.1-install.exe\r
 CDPath = none\r
 \r
 [Section.0407]\r
index 0a8255f..e70d751 100644 (file)
@@ -2,32 +2,32 @@
 
 [Section]
 Name = Mozilla Thunderbird 17
-Version = 17.0
+Version = 17.0.4
 Licence = MPL/GPL/LGPL
 Description = The most popular and one of the best free Mail Clients out there.
 Size = 17.6MB
 Category = 5
 URLSite = http://www.mozilla-europe.org/en/products/thunderbird/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0/win32/en-US/Thunderbird%20Setup%2017.0.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0.4/win32/en-US/Thunderbird%20Setup%2017.0.4.exe
 CDPath = none
 
 [Section.0407]
 Description = Der populärste und einer der besten freien Mail-Clients.
 Size = 17.5MB
 URLSite = http://www.mozilla-europe.org/de/products/thunderbird/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0/win32/de/Thunderbird%20Setup%2017.0.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0.4/win32/de/Thunderbird%20Setup%2017.0.4.exe
 
 [Section.040a]
 Description = El más popular y uno de los mejores clientes mail que hay.
 Size = 17.4MB
 URLSite = http://www.mozilla-europe.org/es/products/thunderbird/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0/win32/es-ES/Thunderbird%20Setup%2017.0.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0.4/win32/es-ES/Thunderbird%20Setup%2017.0.4.exe
 
 [Section.040c]
 Description = Le plus populaire et l'un des meilleurs clients mail gratuits disponible.
 Size = 17.8MB
 URLSite = http://www.mozilla-europe.org/fr/products/thunderbird/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0/win32/fr/Thunderbird%20Setup%2017.0.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0.4/win32/fr/Thunderbird%20Setup%2017.0.4.exe
 
 [Section.0413]
 Description = De meest populaire en een van de beste gratis e-mail-programma's.
@@ -39,22 +39,22 @@ URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/1
 Description = Najpopularniejszy i jeden z najlepszych darmowych klientów poczty.
 Size = 18.3MB
 URLSite = http://www.mozilla-europe.org/pl/products/thunderbird/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0/win32/pl/Thunderbird%20Setup%2017.0.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0.4/win32/pl/Thunderbird%20Setup%2017.0.4.exe
 
 [Section.0418]
 Description = Cel mai popular și unul dintre cele mai bune clientele gratuite de poștă electronică.
 Size = 18,0 Mo
 URLSite = http://www.mozilla-europe.org/ro/products/thunderbird/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0/win32/ro/Thunderbird%20Setup%2017.0.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0.4/win32/ro/Thunderbird%20Setup%2017.0.4.exe
 
 [Section.0419]
 Description = Один из самых популярных и лучших бесплатных почтовых клиентов.
 Size = 17.9MB
 URLSite = http://www.mozilla-europe.org/ru/products/thunderbird/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0/win32/ru/Thunderbird%20Setup%2017.0.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0.4/win32/ru/Thunderbird%20Setup%2017.0.4.exe
 
 [Section.0422]
 Description = Найпопулярніший та один з кращих поштових клієнтів.
 Size = 17.9MB
 URLSite = http://www.mozillamessaging.com/uk/thunderbird/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0/win32/uk/Thunderbird%20Setup%2017.0.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/17.0.4/win32/uk/Thunderbird%20Setup%2017.0.4.exe
index 36f0225..434673c 100644 (file)
@@ -2,13 +2,13 @@
 \r
 [Section]\r
 Name = µTorrent\r
-Version = 3.2.3\r
+Version = 3.3\r
 Licence = Freeware for non-commercial uses\r
 Description = Small and fast BitTorrent Client.\r
 Size = 946.00kB\r
 Category = 5\r
 URLSite = http://www.utorrent.com/\r
-URLDownload = http://download.utorrent.com/3.2.3/uTorrent.exe\r
+URLDownload = http://download.utorrent.com/3.3/uTorrent.exe\r
 CDPath = none\r
 \r
 \r
index ea2c84d..276ac75 100644 (file)
@@ -81,10 +81,10 @@ PrintService(LPCTSTR lpServiceName,
 
     _tprintf(_T(")\n"));
 
-    _tprintf(_T("\tWIN32_EXIT_CODE    : %d  (0x%x)\n"),
+    _tprintf(_T("\tWIN32_EXIT_CODE    : %u  (0x%x)\n"),
         (unsigned int)pStatus->dwWin32ExitCode,
         (unsigned int)pStatus->dwWin32ExitCode);
-    _tprintf(_T("\tSERVICE_EXIT_CODE  : %d  (0x%x)\n"),
+    _tprintf(_T("\tSERVICE_EXIT_CODE  : %u  (0x%x)\n"),
         (unsigned int)pStatus->dwServiceSpecificExitCode,
         (unsigned int)pStatus->dwServiceSpecificExitCode);
     _tprintf(_T("\tCHECKPOINT         : 0x%x\n"),
index 639cd98..a3b2ae4 100644 (file)
@@ -143,7 +143,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
     else
     {
         WCHAR szMsg[MAX_PATH];
-        wsprintf(szMsg, L"Failed to load the installer. Error %d", GetLastError());
+        wsprintf(szMsg, L"Failed to load the installer. Error %lu", GetLastError());
         MessageBoxW(0, szMsg, L"Error", MB_OK | MB_ICONERROR);
         DeleteDirectory(szTempPath);
         return 1;
index b26ff70..a245bfa 100644 (file)
@@ -179,7 +179,7 @@ VOID DisplayError(DWORD dwError)
 
     /* Prints out the error message to the user */
     fprintf(stderr, resMsg);
-    fwprintf(stderr, L"Error code: %d\n", dwError);
+    fwprintf(stderr, L"Error code: %lu\n", dwError);
 
     LocalFree(lpMsgBuf);
     LocalFree(resMsg);
index 596cd2f..17e3eb2 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS Sound Volume Control
  * FILE:        subsys/system/sndvol32/misc.c
index bafee13..3445184 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS Sound Volume Control
  * FILE:        subsys/system/sndvol32/mixer.c
index a31f7d0..a09718f 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS Sound Volume Control
  * FILE:        subsys/system/sndvol32/sndvol32.c
index 99e9af1..33ceb8c 100644 (file)
@@ -536,13 +536,13 @@ BOOL PerfDataGetText(ULONG Index, ULONG ColumnIndex, LPTSTR lpText, int nMaxCoun
     if (ColumnDataHints[ColumnIndex] == COLUMN_IMAGENAME)
         PerfDataGetImageName(Index, lpText, nMaxCount);
     if (ColumnDataHints[ColumnIndex] == COLUMN_PID)
-        wsprintfW(lpText, L"%d", PerfDataGetProcessId(Index));
+        wsprintfW(lpText, L"%lu", PerfDataGetProcessId(Index));
     if (ColumnDataHints[ColumnIndex] == COLUMN_USERNAME)
         PerfDataGetUserName(Index, lpText, nMaxCount);
     if (ColumnDataHints[ColumnIndex] == COLUMN_SESSIONID)
-        wsprintfW(lpText, L"%d", PerfDataGetSessionId(Index));
+        wsprintfW(lpText, L"%lu", PerfDataGetSessionId(Index));
     if (ColumnDataHints[ColumnIndex] == COLUMN_CPUUSAGE)
-        wsprintfW(lpText, L"%02d", PerfDataGetCPUUsage(Index));
+        wsprintfW(lpText, L"%02lu", PerfDataGetCPUUsage(Index));
     if (ColumnDataHints[ColumnIndex] == COLUMN_CPUTIME)
     {
         DWORD dwHours;
@@ -551,74 +551,74 @@ BOOL PerfDataGetText(ULONG Index, ULONG ColumnIndex, LPTSTR lpText, int nMaxCoun
 
         time = PerfDataGetCPUTime(Index);
         gethmsfromlargeint(time, &dwHours, &dwMinutes, &dwSeconds);
-        wsprintfW(lpText, L"%d:%02d:%02d", dwHours, dwMinutes, dwSeconds);
+        wsprintfW(lpText, L"%lu:%02lu:%02lu", dwHours, dwMinutes, dwSeconds);
     }
     if (ColumnDataHints[ColumnIndex] == COLUMN_MEMORYUSAGE)
     {
-        wsprintfW(lpText, L"%d", PerfDataGetWorkingSetSizeBytes(Index) / 1024);
+        wsprintfW(lpText, L"%lu", PerfDataGetWorkingSetSizeBytes(Index) / 1024);
         CommaSeparateNumberString(lpText, nMaxCount);
         wcscat(lpText, L" K");
     }
     if (ColumnDataHints[ColumnIndex] == COLUMN_PEAKMEMORYUSAGE)
     {
-        wsprintfW(lpText, L"%d", PerfDataGetPeakWorkingSetSizeBytes(Index) / 1024);
+        wsprintfW(lpText, L"%lu", PerfDataGetPeakWorkingSetSizeBytes(Index) / 1024);
         CommaSeparateNumberString(lpText, nMaxCount);
         wcscat(lpText, L" K");
     }
     if (ColumnDataHints[ColumnIndex] == COLUMN_MEMORYUSAGEDELTA)
     {
-        wsprintfW(lpText, L"%d", PerfDataGetWorkingSetSizeDelta(Index) / 1024);
+        wsprintfW(lpText, L"%lu", PerfDataGetWorkingSetSizeDelta(Index) / 1024);
         CommaSeparateNumberString(lpText, nMaxCount);
         wcscat(lpText, L" K");
     }
     if (ColumnDataHints[ColumnIndex] == COLUMN_PAGEFAULTS)
     {
-        wsprintfW(lpText, L"%d", PerfDataGetPageFaultCount(Index));
+        wsprintfW(lpText, L"%lu", PerfDataGetPageFaultCount(Index));
         CommaSeparateNumberString(lpText, nMaxCount);
     }
     if (ColumnDataHints[ColumnIndex] == COLUMN_PAGEFAULTSDELTA)
     {
-        wsprintfW(lpText, L"%d", PerfDataGetPageFaultCountDelta(Index));
+        wsprintfW(lpText, L"%lu", PerfDataGetPageFaultCountDelta(Index));
         CommaSeparateNumberString(lpText, nMaxCount);
     }
     if (ColumnDataHints[ColumnIndex] == COLUMN_VIRTUALMEMORYSIZE)
     {
-        wsprintfW(lpText, L"%d", PerfDataGetVirtualMemorySizeBytes(Index) / 1024);
+        wsprintfW(lpText, L"%lu", PerfDataGetVirtualMemorySizeBytes(Index) / 1024);
         CommaSeparateNumberString(lpText, nMaxCount);
         wcscat(lpText, L" K");
     }
     if (ColumnDataHints[ColumnIndex] == COLUMN_PAGEDPOOL)
     {
-        wsprintfW(lpText, L"%d", PerfDataGetPagedPoolUsagePages(Index) / 1024);
+        wsprintfW(lpText, L"%lu", PerfDataGetPagedPoolUsagePages(Index) / 1024);
         CommaSeparateNumberString(lpText, nMaxCount);
         wcscat(lpText, L" K");
     }
     if (ColumnDataHints[ColumnIndex] == COLUMN_NONPAGEDPOOL)
     {
-        wsprintfW(lpText, L"%d", PerfDataGetNonPagedPoolUsagePages(Index) / 1024);
+        wsprintfW(lpText, L"%lu", PerfDataGetNonPagedPoolUsagePages(Index) / 1024);
         CommaSeparateNumberString(lpText, nMaxCount);
         wcscat(lpText, L" K");
     }
     if (ColumnDataHints[ColumnIndex] == COLUMN_BASEPRIORITY)
-        wsprintfW(lpText, L"%d", PerfDataGetBasePriority(Index));
+        wsprintfW(lpText, L"%lu", PerfDataGetBasePriority(Index));
     if (ColumnDataHints[ColumnIndex] == COLUMN_HANDLECOUNT)
     {
-        wsprintfW(lpText, L"%d", PerfDataGetHandleCount(Index));
+        wsprintfW(lpText, L"%lu", PerfDataGetHandleCount(Index));
         CommaSeparateNumberString(lpText, nMaxCount);
     }
     if (ColumnDataHints[ColumnIndex] == COLUMN_THREADCOUNT)
     {
-        wsprintfW(lpText, L"%d", PerfDataGetThreadCount(Index));
+        wsprintfW(lpText, L"%lu", PerfDataGetThreadCount(Index));
         CommaSeparateNumberString(lpText, nMaxCount);
     }
     if (ColumnDataHints[ColumnIndex] == COLUMN_USEROBJECTS)
     {
-        wsprintfW(lpText, L"%d", PerfDataGetUSERObjectCount(Index));
+        wsprintfW(lpText, L"%lu", PerfDataGetUSERObjectCount(Index));
         CommaSeparateNumberString(lpText, nMaxCount);
     }
     if (ColumnDataHints[ColumnIndex] == COLUMN_GDIOBJECTS)
     {
-        wsprintfW(lpText, L"%d", PerfDataGetGDIObjectCount(Index));
+        wsprintfW(lpText, L"%lu", PerfDataGetGDIObjectCount(Index));
         CommaSeparateNumberString(lpText, nMaxCount);
     }
     if (ColumnDataHints[ColumnIndex] == COLUMN_IOREADS)
index 13c4a64..b9324b0 100644 (file)
@@ -149,7 +149,7 @@ ServiceMain(DWORD argc, LPWSTR argv)
         return;
     }
 
-    logmsg("* Service started");
+    logmsg("* Service started\n");
     /* Tell SCM we are now running, and we may be stopped */
     service_status.dwCurrentState = SERVICE_RUNNING;
     service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP;
index 288dcf6..881594d 100644 (file)
@@ -101,7 +101,7 @@ ServiceControlHandler(DWORD dwControl,
             return ERROR_SUCCESS;
 
         default :
-            DPRINT1("  Control %lu received\n");
+            DPRINT1("  Control %lu received\n", dwControl);
             return ERROR_CALL_NOT_IMPLEMENTED;
     }
 }
@@ -293,7 +293,7 @@ PLOGFILE LoadLogFile(HKEY hKey, WCHAR * LogName)
                              &ValueLen);
     if (Result != ERROR_SUCCESS)
     {
-        DPRINT1("RegQueryValueEx failed: %d\n", GetLastError());
+        DPRINT1("RegQueryValueEx failed: %lu\n", GetLastError());
         HeapFree(MyHeap, 0, Buf);
         return NULL;
     }
@@ -491,17 +491,17 @@ VOID SystemTimeToEventTime(SYSTEMTIME * pSystemTime, DWORD * pEventTime)
 
 VOID PRINT_HEADER(PEVENTLOGHEADER header)
 {
-    DPRINT("HeaderSize = %d\n", header->HeaderSize);
+    DPRINT("HeaderSize = %lu\n", header->HeaderSize);
     DPRINT("Signature = 0x%x\n", header->Signature);
-    DPRINT("MajorVersion = %d\n", header->MajorVersion);
-    DPRINT("MinorVersion = %d\n", header->MinorVersion);
-    DPRINT("StartOffset = %d\n", header->StartOffset);
+    DPRINT("MajorVersion = %lu\n", header->MajorVersion);
+    DPRINT("MinorVersion = %lu\n", header->MinorVersion);
+    DPRINT("StartOffset = %lu\n", header->StartOffset);
     DPRINT("EndOffset = 0x%x\n", header->EndOffset);
-    DPRINT("CurrentRecordNumber = %d\n", header->CurrentRecordNumber);
-    DPRINT("OldestRecordNumber = %d\n", header->OldestRecordNumber);
+    DPRINT("CurrentRecordNumber = %lu\n", header->CurrentRecordNumber);
+    DPRINT("OldestRecordNumber = %lu\n", header->OldestRecordNumber);
     DPRINT("MaxSize = 0x%x\n", header->MaxSize);
     DPRINT("Retention = 0x%x\n", header->Retention);
-    DPRINT("EndHeaderSize = %d\n", header->EndHeaderSize);
+    DPRINT("EndHeaderSize = %lu\n", header->EndHeaderSize);
     DPRINT("Flags: ");
     if (header->Flags & ELF_LOGFILE_HEADER_DIRTY)  DPRINT("ELF_LOGFILE_HEADER_DIRTY");
     if (header->Flags & ELF_LOGFILE_HEADER_WRAP)  DPRINT("| ELF_LOGFILE_HEADER_WRAP ");
@@ -516,21 +516,21 @@ VOID PRINT_RECORD(PEVENTLOGRECORD pRec)
     WCHAR *str;
     SYSTEMTIME time;
 
-    DPRINT("Length = %d\n", pRec->Length);
+    DPRINT("Length = %lu\n", pRec->Length);
     DPRINT("Reserved = 0x%x\n", pRec->Reserved);
-    DPRINT("RecordNumber = %d\n", pRec->RecordNumber);
+    DPRINT("RecordNumber = %lu\n", pRec->RecordNumber);
 
     EventTimeToSystemTime(pRec->TimeGenerated, &time);
-    DPRINT("TimeGenerated = %d.%d.%d %d:%d:%d\n",
+    DPRINT("TimeGenerated = %hu.%hu.%hu %hu:%hu:%hu\n",
            time.wDay, time.wMonth, time.wYear,
            time.wHour, time.wMinute, time.wSecond);
 
     EventTimeToSystemTime(pRec->TimeWritten, &time);
-    DPRINT("TimeWritten = %d.%d.%d %d:%d:%d\n",
+    DPRINT("TimeWritten = %hu.%hu.%hu %hu:%hu:%hu\n",
            time.wDay, time.wMonth, time.wYear,
            time.wHour, time.wMinute, time.wSecond);
 
-    DPRINT("EventID = %d\n", pRec->EventID);
+    DPRINT("EventID = %lu\n", pRec->EventID);
 
     switch (pRec->EventType)
     {
@@ -550,18 +550,18 @@ VOID PRINT_RECORD(PEVENTLOGRECORD pRec)
             DPRINT("EventType = EVENTLOG_AUDIT_FAILURE\n");
             break;
         default:
-            DPRINT("EventType = %d\n", pRec->EventType);
+            DPRINT("EventType = %hu\n", pRec->EventType);
     }
 
-    DPRINT("NumStrings = %d\n", pRec->NumStrings);
-    DPRINT("EventCategory = %d\n", pRec->EventCategory);
+    DPRINT("NumStrings = %hu\n", pRec->NumStrings);
+    DPRINT("EventCategory = %hu\n", pRec->EventCategory);
     DPRINT("ReservedFlags = 0x%x\n", pRec->ReservedFlags);
-    DPRINT("ClosingRecordNumber = %d\n", pRec->ClosingRecordNumber);
-    DPRINT("StringOffset = %d\n", pRec->StringOffset);
-    DPRINT("UserSidLength = %d\n", pRec->UserSidLength);
-    DPRINT("UserSidOffset = %d\n", pRec->UserSidOffset);
-    DPRINT("DataLength = %d\n", pRec->DataLength);
-    DPRINT("DataOffset = %d\n", pRec->DataOffset);
+    DPRINT("ClosingRecordNumber = %lu\n", pRec->ClosingRecordNumber);
+    DPRINT("StringOffset = %lu\n", pRec->StringOffset);
+    DPRINT("UserSidLength = %lu\n", pRec->UserSidLength);
+    DPRINT("UserSidOffset = %lu\n", pRec->UserSidOffset);
+    DPRINT("DataLength = %lu\n", pRec->DataLength);
+    DPRINT("DataOffset = %lu\n", pRec->DataOffset);
 
     DPRINT("SourceName: %S\n", (WCHAR *) (((PBYTE) pRec) + sizeof(EVENTLOGRECORD)));
 
@@ -576,10 +576,10 @@ VOID PRINT_RECORD(PEVENTLOGRECORD pRec)
         str = (WCHAR *) (((PBYTE) pRec) + pRec->StringOffset);
         for (i = 0; i < pRec->NumStrings; i++)
         {
-            DPRINT("[%d] %S\n", i, str);
+            DPRINT("[%u] %S\n", i, str);
             str = str + lstrlenW(str) + 1;
         }
     }
 
-    DPRINT("Length2 = %d\n", *(PDWORD) (((PBYTE) pRec) + pRec->Length - 4));
+    DPRINT("Length2 = %lu\n", *(PDWORD) (((PBYTE) pRec) + pRec->Length - 4));
 }
index 1fbfc4d..416c2f3 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS GUI first stage setup application
  * FILE:        base/setup/reactos/reactos.c
index 75c772a..33b983a 100644 (file)
@@ -16,7 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS text-mode setup
  * FILE:            subsys/system/usetup/bootsup.h
index 526305d..a910e93 100644 (file)
@@ -16,7 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS text-mode setup
  * FILE:            subsys/system/usetup/drivesup.c
index 287b5a5..37c918c 100644 (file)
@@ -16,7 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS text-mode setup
  * FILE:            subsys/system/usetup/drivesup.h
index 79461a7..8bb5a43 100644 (file)
@@ -16,7 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id: registry.h 21704 2006-04-22 13:55:01Z tretiakov $
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS text-mode setup
  * FILE:            subsys/system/usetup/errcode.h
index 28829a4..7dc8587 100644 (file)
@@ -16,7 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS text-mode setup
  * FILE:            subsys/system/usetup/filequeue.h
index b7aecd8..a1d45cb 100644 (file)
@@ -16,7 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS text-mode setup
  * FILE:            subsys/system/usetup/filesup.h
index d2784c1..3c7706b 100644 (file)
@@ -16,7 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS text-mode setup
  * FILE:            subsys/system/usetup/format.h
index fd5682c..2d4cc74 100644 (file)
@@ -16,7 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS text-mode setup
  * FILE:            subsys/system/usetup/genlist.h
index 3010aa6..bcff69e 100644 (file)
@@ -16,7 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS text-mode setup
  * FILE:            subsys/system/usetup/inicache.c
index 630967d..948501c 100644 (file)
@@ -16,7 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS text-mode setup
  * FILE:            subsys/system/usetup/partlist.h
index 63d2b67..0d62ac9 100644 (file)
@@ -16,7 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS text-mode setup
  * FILE:            subsys/system/usetup/registry.h
index 65b59ef..fb8cd3c 100644 (file)
@@ -16,7 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS text-mode setup
  * FILE:            subsys/system/usetup/settings.h
index 39ec334..c40e3f1 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: En.rc 21257 2006-03-08 23:07:09Z audit $ */
 
 LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
 
index 57da7b6..93335f1 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS welcome/autorun application
  * FILE:        subsys/system/welcome/welcome.c
index 504fc0a..42771d5 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * WINDOW.C - activate & window internal commands.
  *
  * clone from 4nt activate command
index 8526b66..a22ed98 100644 (file)
@@ -141,13 +141,11 @@ ScmGetDriverStatus(PSERVICE lpService,
 
     if (lpService->Status.dwServiceType == SERVICE_KERNEL_DRIVER)
     {
-        RtlInitUnicodeString(&DirName,
-                             L"\\Driver");
+        RtlInitUnicodeString(&DirName, L"\\Driver");
     }
-    else
+    else // if (lpService->Status.dwServiceType == SERVICE_FILE_SYSTEM_DRIVER)
     {
-        RtlInitUnicodeString(&DirName,
-                             L"\\FileSystem");
+        RtlInitUnicodeString(&DirName, L"\\FileSystem");
     }
 
     InitializeObjectAttributes(&ObjectAttributes,
index 1f27d80..6993e3d 100644 (file)
@@ -2,7 +2,7 @@
  * PROJECT:     ReactOS Service Control Manager
  * LICENSE:     GPL - See COPYING in the top level directory
  * FILE:        base/system/services/lock.c
- * PURPOSE:     Service lock functions
+ * PURPOSE:     User-side Services Start Serialization Lock functions
  * COPYRIGHT:   Copyright 2012 Hermès Bélusca
  */
 
@@ -16,6 +16,7 @@
 
 /* GLOBALS *******************************************************************/
 
+/* The unique user service start lock of the SCM */
 static PSTART_LOCK pServiceStartLock = NULL;
 
 
index d16dbf3..6f980e0 100644 (file)
@@ -16,7 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS winlogon
  * FILE:            subsys/system/winlogon/setup.h
index 80fb969..d8a76a7 100644 (file)
@@ -1059,14 +1059,12 @@ HKLM,"SOFTWARE\ReactOS\ReactOS\CurrentVersion\IFS","FATX",0x00000000,"ufatx.dll"
 \r
 HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","ConsoleShell",0x00020000,"%SystemRoot%\system32\cmd.exe"\r
 HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","Shell",0x00020000,"%SystemRoot%\explorer.exe"\r
-HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","StartServices",0x00010001,0x00000001\r
-HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","StartLsass",0x00010001,0x00000001\r
 HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","Userinit",0x00020000,"%SystemRoot%\system32\userinit.exe"\r
 HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","AutoAdminLogon",0x00000000,"1"\r
 HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultUserName",0x00000000,"Administrator"\r
 HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultPassword",0x00000000,"Secret"\r
 \r
-;Time Zone Servers\r
+; Time Zone Servers\r
 HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers","1",0x00000000,"pool.ntp.org"\r
 HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers","2",0x00000000,"asia.pool.ntp.org"\r
 HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers","3",0x00000000,"europe.pool.ntp.org"\r
index 8af3080..ce9dbdf 100644 (file)
@@ -122,7 +122,7 @@ BOOLEAN IniParseFile(PCHAR IniFileData, ULONG IniFileSize)
                        // First check to make sure we're inside a [section]
                        if (CurrentSection == NULL)
                        {
-                               printf("Error: freeldr.ini:%ld: Setting '%s' found outside of a [section].\n", CurrentLineNumber, IniFileLine);
+                               printf("Error: freeldr.ini:%lu: Setting '%s' found outside of a [section].\n", CurrentLineNumber, IniFileLine);
                                printf("Press any key to continue...\n");
                                MachConsGetCh();
                                CurrentLineNumber++;
index 5b33e14..76be27d 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: access.c 29112 2007-09-19 21:31:49Z ekohl $
- *
+/*
  * PROJECT:         ReactOS Accessibility Control Panel
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            dll/cpl/access/access.c
index cf09292..3154da1 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: display.c 29112 2007-09-19 21:31:49Z ekohl $
- *
+/*
  * PROJECT:         ReactOS Accessibility Control Panel
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            dll/cpl/access/display.c
index 7fb7cf9..421348a 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: general.c 29112 2007-09-19 21:31:49Z ekohl $
- *
+/*
  * PROJECT:         ReactOS Accessibility Control Panel
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            dll/cpl/access/general.c
index 1b2f308..c63711e 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: keyboard.c 29170 2007-09-23 22:59:00Z ekohl $
- *
+/*
  * PROJECT:         ReactOS Accessibility Control Panel
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            dll/cpl/access/keyboard.c
index 0fe19e5..6473718 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: mouse.c 29112 2007-09-19 21:31:49Z ekohl $
- *
+/*
  * PROJECT:         ReactOS Accessibility Control Panel
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            dll/cpl/access/mouse.c
index 9190189..dea63e2 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: sound.c 29112 2007-09-19 21:31:49Z ekohl $
- *
+/*
  * PROJECT:         ReactOS Accessibility Control Panel
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            dll/cpl/access/sound.c
index 5819261..2c90201 100644 (file)
@@ -1,11 +1,10 @@
-/* $Id: appwiz.c 29364 2007-10-02 23:34:00Z janderwald $
- *
- * PROJECT:                    ReactOS Software Control Panel
- * FILE:                       dll/cpl/appwiz/createlink.c
- * PURPOSE:                    ReactOS Software Control Panel
- * PROGRAMMER:         Gero Kuehn (reactos.filter@gkware.com)
- *                             Dmitry Chapyshev (lentind@yandex.ru)
- *                             Johannes Anderwald
+/*
+ * PROJECT:         ReactOS Software Control Panel
+ * FILE:            dll/cpl/appwiz/createlink.c
+ * PURPOSE:         ReactOS Software Control Panel
+ * PROGRAMMER:      Gero Kuehn (reactos.filter@gkware.com)
+ *                  Dmitry Chapyshev (lentind@yandex.ru)
+ *                  Johannes Anderwald
  * UPDATE HISTORY:
  *      06-17-2004  Created
  */
index 837bc0b..6ccefac 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: advappdlg.c 24836 2007-02-12 03:12:56Z tkreuzer $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Display Control Panel
  * FILE:            dll/cpl/desk/advappdlg.c
index 12c5efe..982312f 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Display Control Panel
  * FILE:            dll/cpl/desk/background.c
index dbab35e..0f37271 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Display Control Panel
  * FILE:            dll/cpl/desk/desk.c
index b14b715..9486d5a 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Display Control Panel
  * FILE:            dll/cpl/desk/dibitmap.c
index 53a1067..7842368 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS International Control Panel
  * FILE:            dll/cpl/intl/currency.c
  * PURPOSE:         Currency property page
index 2473ae8..166899a 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS International Control Panel
  * FILE:            dll/cpl/intl/date.c
  * PURPOSE:         Date property page
index ee347d2..885bd90 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS International Control Panel
  * FILE:            dll/cpl/intl/generalp.c
  * PURPOSE:         General property page
index 6451e8a..0cd3fd1 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS International Control Panel
  * FILE:            dll/cpl/intl/inplocale.c
  * PURPOSE:         Input Locale property page
index eeed1ac..76758ed 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS International Control Panel
  * FILE:            dll/cpl/intl/intl.c
  * PURPOSE:         Property sheet code
index e2d8658..2daf993 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS International Control Panel
  * FILE:            dll/cpl/intl/numbers.c
  * PURPOSE:         Numbers property page
index dc99a40..52a6fad 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS International Control Panel
  * FILE:            dll/cpl/intl/sort.c
  * PURPOSE:         Sorting property page
index a8d2244..860954b 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: appearance.c 13406 2005-02-04 20:39:10Z weiden $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS License Manager
  * FILE:            dll/cpl/liccpa/liccpa.c
index cd33b4b..6e51ca7 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: cplsample.rc 12852 2005-01-06 13:58:04Z mf $ */
 
 #include <windows.h>
 #include "resource.h"
index 2f098a7..165d668 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS Main Control Panel
  * FILE:            dll/cpl/main/keyboard.c
  * PURPOSE:         Keyboard Control Panel
index 1853aa4..272aafc 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS Sample Control Panel
  * FILE:            dll/cpl/main/main.c
  * PURPOSE:         ReactOS Main Control Panel
index 2badb9a..8197e49 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS Main Control Panel
  * FILE:            dll/cpl/main/mouse.c
  * PURPOSE:         Mouse Control Panel
index f48d8d2..868606e 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: main.c 12852 2005-01-06 13:58:04Z mf $
- *
+/*
  * PROJECT:         ReactOS Multimedia Control Panel
  * FILE:            dll/cpl/mmsys/mmsys.c
  * PURPOSE:         ReactOS Multimedia Control Panel
index efe050a..9d1957a 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: main.c 12852 2005-01-06 13:58:04Z mf $
- *
+/*
  * PROJECT:         ReactOS Multimedia Control Panel
  * FILE:            dll/cpl/mmsys/mmsys.c
  * PURPOSE:         ReactOS Multimedia Control Panel
index 7b3e787..ce77120 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS ODBC Control Panel Applet
  * FILE:            dll/cpl/main/main.c
  * PURPOSE:         applet initialization
index 8fffcfd..f615966 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS Power Configuration Applet
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            dll/cpl/powercfg/advanced.c
index d582932..71f3a28 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS Power Configuration Applet
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            dll/cpl/powercfg/alarms.c
index 1ea6ea3..82f54fa 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS Power Configuration Applet
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            dll/cpl/powercfg/hibernate.c
index dca5e78..9e5b441 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS Power Configuration Applet
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            dll/cpl/powercfg/powershemes.c
index 3acbf91..7a6b3fd 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS Power Configuration Applet
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            dll/cpl/powercfg/powershemes.c
index c057b13..cf9b7c7 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS User Manager Control Panel
  * FILE:            dll/cpl/usrmgr/extra.c
index 527af2e..2668e18 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS User Manager Control Panel
  * FILE:            dll/cpl/usrmgr/usrmgr.c
index 5eec730..9030b03 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "ReactOS Direct3D\0"
index 4be2244..0f08fb0 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "ReactOS Direct3D\0"
index 8b20c9c..77f3e94 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/clipper/clipper_stubs.c
index 6f07149..cc39ee4 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: clipper.c 24690 2006-11-05 21:19:53Z greatlrd $
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/clipper/clipper_stubs.c
index c4fd611..776832b 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: color.c 24690 2006-11-05 21:19:53Z greatlrd $
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/color/color.c
index 59f002d..fa03166 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/ddraw/GetCaps.c
index 7903c8d..105430a 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/ddraw/GetDeviceIdentifier.c
index 57c30e3..08bdaf0 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/ddraw/callbacks_dd_hel.c
index 6ef2a38..ccd655a 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/ddraw/ddraw_displaymode.c
index fe02d0a..5f3355e 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/ddraw/ddraw_main.c
index 26fa7f9..21b98e0 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/ddraw/ddraw_main.c
index 4f11676..7b15248 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/ddraw/ddraw_stubs.c
index 4dd9751..5069c7f 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: gamma.c 24690 2006-11-05 21:19:53Z greatlrd $
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/gamma/gamma_stubs.c
index 16e30ff..add4f04 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: kernel.c 24690 2006-11-05 21:19:53Z greatlrd $
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/kernel/kernel_stubs.c
index 87bb0a9..1b3929c 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/surface/createsurface.c
index c366be9..1c5bad6 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: palette.c $
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/Palette/palette.c
index 07590f4..a0ab80c 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: palette.c 24690 2006-11-05 21:19:53Z greatlrd $
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/palette/palette_stubs.c
index 5a31199..7d8bda3 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/surface/callbacks_surf_hel.c
index d6d9557..be030e0 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/surface/createsurface.c
index 81abdf8..03bdbaa 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/surface/surface_main.c
index aac63dd..ffe2d99 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/surface/surface_stubs.c
index f40f03c..0fba94f 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: videoport.c 22739 2006-07-01 12:08:35Z greatlrd $
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS DirectX
  * FILE:                 ddraw/videoport/videoport_stubs.c
index 5b6d709..2e011d8 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: main.c 21434 2006-04-01 19:12:56Z greatlrd $
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS kernel
  * FILE:                 lib/ddraw/ddraw.c
index 1434f28..5e773bc 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #include "resource.h"
 
index 152de2a..447eaeb 100644 (file)
@@ -1,6 +1,4 @@
-
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS kernel
  * FILE:                 lib/ddraw/ddraw.c
index 6a5c6ba..e838959 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: main.c 21434 2006-04-01 19:12:56Z greatlrd $
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS kernel
  * FILE:                 lib/ddraw/ddraw.c
index 68a8a42..ee2260c 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS Compatibility Layer Shell Extension
  * FILE:            lib/shellext/cplsample/cplsample.c
  * PURPOSE:         ReactOS Compatibility Layer Shell Extension
index 1802278..53c32d3 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS Access Control List Editor
  * FILE:            lib/aclui/aclui.c
  * PURPOSE:         Access Control List Editor
index a6d445e..f81e453 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS Access Control List Editor
  * FILE:            lib/aclui/checklist.c
  * PURPOSE:         Access Control List Editor
index 4ca54eb..59f7605 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS Access Control List Editor
  * FILE:            lib/aclui/misc.c
  * PURPOSE:         Access Control List Editor
index 7e5ab9b..b396ed1 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id: aclui.c 19715 2005-11-28 01:10:49Z weiden $
- *
+/*
  * PROJECT:         ReactOS Access Control List Editor
  * FILE:            lib/aclui/sidcache.c
  * PURPOSE:         Access Control List Editor
index 042e3bf..97ae6d0 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/advapi32/misc/dllmain.c
index c1b083f..65b22c2 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/advapi32/sec/ac.c
index afd5a2c..c3b836c 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/advapi32/sec/audit.c
index d41e92f..d62edc3 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/advapi32/sec/sec.c
index 9a2b533..9b62f79 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/advapi32/sec/trustee.c
index f8cc95a..29ecebe 100644 (file)
@@ -1675,7 +1675,7 @@ WaitForSCManager(VOID)
     /* Try to open the existing event */
     hEvent = OpenEventW(SYNCHRONIZE,
                         FALSE,
-                        L"SvcctrlStartEvent_A3752DX");
+                        SCM_START_EVENT);
     if (hEvent == NULL)
     {
         if (GetLastError() != ERROR_FILE_NOT_FOUND)
@@ -1685,13 +1685,13 @@ WaitForSCManager(VOID)
         hEvent = CreateEventW(NULL,
                               TRUE,
                               FALSE,
-                              L"SvcctrlStartEvent_A3752DX");
+                              SCM_START_EVENT);
         if (hEvent == NULL)
         {
             /* Try to open the existing event again */
             hEvent = OpenEventW(SYNCHRONIZE,
                                 FALSE,
-                                L"SvcctrlStartEvent_A3752DX");
+                                SCM_START_EVENT);
             if (hEvent == NULL)
                 return;
         }
index 61a84bd..2b0762a 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/advapi32/token/privilege.c
index 54d5ca8..bdf20f5 100644 (file)
@@ -147,8 +147,8 @@ DWORD WINAPI GetSize (LPVOID lpMem)
  * MRU-Functions  {COMCTL32}
  *
  * NOTES
- * The MRU-Api is a set of functions to manipulate lists of M.R.U. (Most Recently
- * Used) items. It is an undocumented Api that is used (at least) by the shell
+ * The MRU-API is a set of functions to manipulate lists of M.R.U. (Most Recently
+ * Used) items. It is an undocumented API that is used (at least) by the shell
  * and explorer to implement their recent documents feature.
  *
  * Since these functions are undocumented, they are unsupported by MS and
index ff2eded..825b442 100644 (file)
@@ -205,16 +205,16 @@ DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *sy
           systime->wHour, systime->wMinute, systime->wSecond);
 
     if (flag == GDT_VALID) {
-      if (systime->wYear == 0 ||
-          systime->wMonth < 1 || systime->wMonth > 12 ||
-          systime->wDay < 1 ||
-          systime->wDay > MONTHCAL_MonthLength(systime->wMonth, systime->wYear) ||
-          systime->wHour > 23 ||
-          systime->wMinute > 59 ||
-          systime->wSecond > 59 ||
-          systime->wMilliseconds > 999
-          )
-        return FALSE;
+        if (systime->wYear == 0 ||
+            systime->wMonth < 1 || systime->wMonth > 12 ||
+            systime->wDay < 1 ||
+            systime->wDay > MONTHCAL_MonthLength(systime->wMonth, systime->wYear) ||
+            systime->wHour > 23 ||
+            systime->wMinute > 59 ||
+            systime->wSecond > 59 ||
+            systime->wMilliseconds > 999
+           )
+            return FALSE;
 
         /* Windows returns true if the date is valid but outside the limits set */
         if (DATETIME_IsDateInValidRange(infoPtr, systime) == FALSE)
index 9566c61..eceabca 100644 (file)
@@ -459,7 +459,7 @@ BOOL WINAPI DPA_Grow (HDPA hdpa, INT nGrow)
 /**************************************************************************
  * DPA_Clone [COMCTL32.331]
  *
- * Copies a pointer array to an other one or creates a copy
+ * Copies a pointer array to another one or creates a copy
  *
  * PARAMS
  *     hdpa    [I] handle (pointer) to the existing (source) pointer array
index 7582576..dfce617 100644 (file)
@@ -118,6 +118,7 @@ typedef struct
 {
     HWND       hwnd;
     HIMAGELIST himl;
+    HIMAGELIST himlNoCursor;
     /* position of the drag image relative to the window */
     INT                x;
     INT                y;
@@ -130,7 +131,7 @@ typedef struct
     HBITMAP    hbmBg;
 } INTERNALDRAG;
 
-static INTERNALDRAG InternalDrag = { 0, 0, 0, 0, 0, 0, FALSE, 0 };
+static INTERNALDRAG InternalDrag = { 0, 0, 0, 0, 0, 0, 0, FALSE, 0 };
 
 static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count);
 static HRESULT ImageListImpl_CreateInstance(const IUnknown *pUnkOuter, REFIID iid, void** ppv);
@@ -611,7 +612,7 @@ ImageList_BeginDrag (HIMAGELIST himlTrack, INT iTrack,
     cx = himlTrack->cx;
     cy = himlTrack->cy;
 
-    InternalDrag.himl = ImageList_Create (cx, cy, himlTrack->flags, 1, 1);
+    InternalDrag.himlNoCursor = InternalDrag.himl = ImageList_Create (cx, cy, himlTrack->flags, 1, 1);
     if (InternalDrag.himl == NULL) {
         WARN("Error creating drag image list!\n");
         return FALSE;
@@ -1639,8 +1640,10 @@ ImageList_EndDrag (void)
 {
     /* cleanup the InternalDrag struct */
     InternalDrag.hwnd = 0;
+    if (InternalDrag.himl != InternalDrag.himlNoCursor)
+        ImageList_Destroy (InternalDrag.himlNoCursor);
     ImageList_Destroy (InternalDrag.himl);
-    InternalDrag.himl = 0;
+    InternalDrag.himlNoCursor = InternalDrag.himl = 0;
     InternalDrag.x= 0;
     InternalDrag.y= 0;
     InternalDrag.dxHotspot = 0;
@@ -2083,6 +2086,7 @@ ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2,
     INT      cxDst, cyDst;
     INT      xOff1, yOff1, xOff2, yOff2;
     POINT    pt1, pt2;
+    INT      newFlags;
 
     TRACE("(himl1=%p i1=%d himl2=%p i2=%d dx=%d dy=%d)\n", himl1, i1, himl2,
           i2, dx, dy);
@@ -2122,7 +2126,10 @@ ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2,
         yOff2 = 0;
     }
 
-    himlDst = ImageList_Create (cxDst, cyDst, ILC_MASK | ILC_COLOR, 1, 1);
+    newFlags = (himl1->flags > himl2->flags ? himl1->flags : himl2->flags) & ILC_COLORDDB;
+    if (newFlags == ILC_COLORDDB && (himl1->flags & ILC_COLORDDB) == ILC_COLOR16)
+        newFlags = ILC_COLOR16; /* this is what native (at least v5) does, don't know why */
+    himlDst = ImageList_Create (cxDst, cyDst, ILC_MASK | newFlags, 1, 1);
 
     if (himlDst)
     {
@@ -2135,8 +2142,13 @@ ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2,
             BitBlt (himlDst->hdcImage, xOff1, yOff1, himl1->cx, himl1->cy, himl1->hdcImage, pt1.x, pt1.y, SRCCOPY);
         if (i2 >= 0 && i2 < himl2->cCurImage)
         {
-            BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcMask , pt2.x, pt2.y, SRCAND);
-            BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcImage, pt2.x, pt2.y, SRCPAINT);
+            if (himl2->flags & ILC_MASK)
+            {
+                BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcMask , pt2.x, pt2.y, SRCAND);
+                BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcImage, pt2.x, pt2.y, SRCPAINT);
+            }
+            else
+                BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcImage, pt2.x, pt2.y, SRCCOPY);
         }
 
         /* copy mask */
@@ -2239,7 +2251,7 @@ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm)
     void *image_bits, *mask_bits = NULL;
     ILHEAD     ilHead;
     HIMAGELIST himl;
-    int                i;
+    unsigned int i;
 
     TRACE("%p\n", pstm);
 
@@ -2703,7 +2715,7 @@ ImageList_SetDragCursorImage (HIMAGELIST himlDrag, INT iDrag,
 
     visible = InternalDrag.bShow;
 
-    himlTemp = ImageList_Merge (InternalDrag.himl, 0, himlDrag, iDrag,
+    himlTemp = ImageList_Merge (InternalDrag.himlNoCursor, 0, himlDrag, iDrag,
                                 dxHotspot, dyHotspot);
 
     if (visible) {
@@ -2717,7 +2729,8 @@ ImageList_SetDragCursorImage (HIMAGELIST himlDrag, INT iDrag,
        InternalDrag.hbmBg = 0;
     }
 
-    ImageList_Destroy (InternalDrag.himl);
+    if (InternalDrag.himl != InternalDrag.himlNoCursor)
+        ImageList_Destroy (InternalDrag.himl);
     InternalDrag.himl = himlTemp;
 
     if (visible) {
index c286952..675169b 100644 (file)
@@ -6,8 +6,9 @@
  * Copyright 2000 Jason Mawdsley
  * Copyright 2001 CodeWeavers Inc.
  * Copyright 2002 Dimitrie O. Paun
- * Copyright 2009-2012 Nikolay Sivov
+ * Copyright 2009-2013 Nikolay Sivov
  * Copyright 2009 Owen Rudge for CodeWeavers
+ * Copyright 2012-2013 Daniel Jelinski
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -54,7 +55,6 @@
  *   -- LVA_SNAPTOGRID not implemented
  *   -- LISTVIEW_ApproximateViewRect partially implemented
  *   -- LISTVIEW_SetColumnWidth ignores header images & bitmap
- *   -- LISTVIEW_SetIconSpacing is incomplete
  *   -- LISTVIEW_StyleChanged doesn't handle some changes too well
  *
  * Speedups
@@ -75,7 +75,6 @@
  * States
  *   -- LVIS_ACTIVATING (not currently supported by comctl32.dll version 6.0)
  *   -- LVIS_DROPHILITED
- *   -- LVIS_OVERLAYMASK
  *
  * Styles
  *   -- LVS_NOLABELWRAP
@@ -99,7 +98,6 @@
  *   -- LVN_GETINFOTIP
  *   -- LVN_HOTTRACK
  *   -- LVN_SETDISPINFO
- *   -- LVN_BEGINRDRAG
  *
  * Messages:
  *   -- LVM_ENABLEGROUPVIEW
@@ -290,6 +288,7 @@ typedef struct tagLISTVIEW_INFO
   HIMAGELIST himlSmall;
   HIMAGELIST himlState;
   SIZE iconSize;
+  BOOL autoSpacing;
   SIZE iconSpacing;
   SIZE iconStateSize;
   POINT currIconPos;        /* this is the position next icon will be placed */
@@ -326,12 +325,12 @@ typedef struct tagLISTVIEW_INFO
 
   /* mouse operation */
   BOOL bLButtonDown;
-  BOOL bRButtonDown;
   BOOL bDragging;
   POINT ptClickPos;         /* point where the user clicked */
   INT nLButtonDownItem;     /* tracks item to reset multiselection on WM_LBUTTONUP */
   DWORD dwHoverTime;
   HCURSOR hHotCursor;
+  INT cWheelRemainder;
 
   /* keyboard operation */
   DWORD lastKeyPressTimestamp;
@@ -775,13 +774,11 @@ static int get_ansi_notification(UINT unicodeNotificationCode)
 }
 
 /* forwards header notifications to listview parent */
-static LRESULT notify_forward_header(const LISTVIEW_INFO *infoPtr, const NMHEADERW *lpnmh)
+static LRESULT notify_forward_header(const LISTVIEW_INFO *infoPtr, NMHEADERW *lpnmhW)
 {
-    NMHEADERA nmhA;
-    HDITEMA hditema;
-    HD_TEXTFILTERA textfilter;
-    LPSTR text = NULL, filter = NULL;
+    LPCWSTR text = NULL, filter = NULL;
     LRESULT ret;
+    NMHEADERA *lpnmh = (NMHEADERA*) lpnmhW;
 
     /* on unicode format exit earlier */
     if (infoPtr->notifyFormat == NFR_UNICODE)
@@ -790,37 +787,38 @@ static LRESULT notify_forward_header(const LISTVIEW_INFO *infoPtr, const NMHEADE
 
     /* header always supplies unicode notifications,
        all we have to do is to convert strings to ANSI */
-    nmhA = *(const NMHEADERA*)lpnmh;
     if (lpnmh->pitem)
     {
-        hditema = *(HDITEMA*)lpnmh->pitem;
-        nmhA.pitem = &hditema;
         /* convert item text */
         if (lpnmh->pitem->mask & HDI_TEXT)
         {
-            hditema.pszText = NULL;
-            Str_SetPtrWtoA(&hditema.pszText, lpnmh->pitem->pszText);
-            text = hditema.pszText;
+            text = (LPCWSTR)lpnmh->pitem->pszText;
+            Str_SetPtrWtoA(&lpnmh->pitem->pszText, text);
         }
         /* convert filter text */
         if ((lpnmh->pitem->mask & HDI_FILTER) && (lpnmh->pitem->type == HDFT_ISSTRING) &&
              lpnmh->pitem->pvFilter)
         {
-            hditema.pvFilter = &textfilter;
-            textfilter = *(HD_TEXTFILTERA*)(lpnmh->pitem->pvFilter);
-            textfilter.pszText = NULL;
-            Str_SetPtrWtoA(&textfilter.pszText, ((HD_TEXTFILTERW*)lpnmh->pitem->pvFilter)->pszText);
-            filter = textfilter.pszText;
+            filter = (LPCWSTR)((HD_TEXTFILTERA*)lpnmh->pitem->pvFilter)->pszText;
+            Str_SetPtrWtoA(&((HD_TEXTFILTERA*)lpnmh->pitem->pvFilter)->pszText, filter);
         }
     }
-    nmhA.hdr.code = get_ansi_notification(lpnmh->hdr.code);
+    lpnmh->hdr.code = get_ansi_notification(lpnmh->hdr.code);
 
-    ret = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmhA.hdr.idFrom,
-                       (LPARAM)&nmhA);
+    ret = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, lpnmh->hdr.idFrom,
+                       (LPARAM)lpnmh);
 
     /* cleanup */
-    Free(text);
-    Free(filter);
+    if(text)
+    {
+        Free(lpnmh->pitem->pszText);
+        lpnmh->pitem->pszText = (LPSTR)text;
+    }
+    if(filter)
+    {
+        Free(((HD_TEXTFILTERA*)lpnmh->pitem->pvFilter)->pszText);
+        ((HD_TEXTFILTERA*)lpnmh->pitem->pvFilter)->pszText = (LPSTR)filter;
+    }
 
     return ret;
 }
@@ -888,11 +886,13 @@ static inline LRESULT notify_listview(const LISTVIEW_INFO *infoPtr, INT code, LP
     return notify_hdr(infoPtr, code, (LPNMHDR)plvnm);
 }
 
+/* Handles NM_DBLCLK, NM_CLICK, NM_RDBLCLK, NM_RCLICK. Only NM_RCLICK return value is used. */
 static BOOL notify_click(const LISTVIEW_INFO *infoPtr, INT code, const LVHITTESTINFO *lvht)
 {
     NMITEMACTIVATE nmia;
     LVITEMW item;
     HWND hwnd = infoPtr->hwndSelf;
+    LRESULT ret;
 
     TRACE("code=%d, lvht=%s\n", code, debuglvhittestinfo(lvht)); 
     ZeroMemory(&nmia, sizeof(nmia));
@@ -903,8 +903,8 @@ static BOOL notify_click(const LISTVIEW_INFO *infoPtr, INT code, const LVHITTEST
     item.iItem = lvht->iItem;
     item.iSubItem = 0;
     if (LISTVIEW_GetItemT(infoPtr, &item, TRUE)) nmia.lParam = item.lParam;
-    notify_hdr(infoPtr, code, (LPNMHDR)&nmia);
-    return IsWindow(hwnd);
+    ret = notify_hdr(infoPtr, code, (NMHDR*)&nmia);
+    return IsWindow(hwnd) && (code == NM_RCLICK ? !ret : TRUE);
 }
 
 static BOOL notify_deleteitem(const LISTVIEW_INFO *infoPtr, INT nItem)
@@ -1672,6 +1672,10 @@ static INT LISTVIEW_CreateHeader(LISTVIEW_INFO *infoPtr)
     /* set header font */
     SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, TRUE);
 
+    /* set header image list */
+    if (infoPtr->himlSmall)
+        SendMessageW(infoPtr->hwndHeader, HDM_SETIMAGELIST, 0, (LPARAM)infoPtr->himlSmall);
+
     LISTVIEW_UpdateSize(infoPtr);
 
     return 0;
@@ -1847,9 +1851,9 @@ static inline INT LISTVIEW_GetCountPerColumn(const LISTVIEW_INFO *infoPtr)
 static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, LPARAM keyData)
 {
     WCHAR buffer[MAX_PATH];
-    INT endidx, startidx;
     DWORD prevTime;
     LVITEMW item;
+    int startidx;
     INT nItem;
     INT diff;
 
@@ -1889,15 +1893,16 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L
         infoPtr->nSearchParamLength = 1;
     }
 
-    /* and search from the current position */
-    nItem = -1;
-    endidx = infoPtr->nItemCount;
-
     /* should start from next after focused item, so next item that matches
        will be selected, if there isn't any and focused matches it will be selected
        on second search stage from beginning of the list */
     if (infoPtr->nFocusedItem >= 0 && infoPtr->nItemCount > 1)
-        startidx = infoPtr->nFocusedItem + 1;
+    {
+        /* with some accumulated search data available start with current focus, otherwise
+           it's excluded from search */
+        startidx = infoPtr->nSearchParamLength > 1 ? infoPtr->nFocusedItem : infoPtr->nFocusedItem + 1;
+        if (startidx == infoPtr->nItemCount) startidx = 0;
+    }
     else
         startidx = 0;
 
@@ -1917,7 +1922,11 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L
     }
     else
     {
-        INT i = startidx;
+        int i = startidx, endidx;
+
+        /* and search from the current position */
+        nItem = -1;
+        endidx = infoPtr->nItemCount;
 
         /* first search in [startidx, endidx), on failure continue in [0, startidx) */
         while (1)
@@ -1939,12 +1948,15 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L
                 item.cchTextMax = MAX_PATH;
                 if (!LISTVIEW_GetItemW(infoPtr, &item)) return 0;
 
-                if (lstrncmpiW(item.pszText, infoPtr->szSearchParam, infoPtr->nSearchParamLength) == 0)
+                if (!lstrncmpiW(item.pszText, infoPtr->szSearchParam, infoPtr->nSearchParamLength))
                 {
                     nItem = i;
                     break;
                 }
-                else if (nItem == -1 && lstrncmpiW(item.pszText, infoPtr->szSearchParam, 1) == 0)
+                /* this is used to find first char match when search string is not available yet,
+                   otherwise every WM_CHAR will search to next item by first char, ignoring that we're
+                   already waiting for user to complete a string */
+                else if (nItem == -1 && infoPtr->nSearchParamLength == 1 && !lstrncmpiW(item.pszText, infoPtr->szSearchParam, 1))
                 {
                     /* this would work but we must keep looking for a longer match */
                     nItem = i;
@@ -2376,7 +2388,7 @@ static void LISTVIEW_GetItemMetrics(const LISTVIEW_INFO *infoPtr, const LVITEMW
            Icon.top    = Box.top;
            Icon.right  = Icon.left;
            if (infoPtr->himlSmall &&
-                (!lpColumnInfo || lpLVItem->iSubItem == 0 || (lpColumnInfo->fmt & LVCFMT_IMAGE) ||
+                (!lpColumnInfo || lpLVItem->iSubItem == 0 ||
                  ((infoPtr->dwLvExStyle & LVS_EX_SUBITEMIMAGES) && lpLVItem->iImage != I_IMAGECALLBACK)))
                Icon.right += infoPtr->iconSize.cx;
            Icon.bottom = Icon.top + infoPtr->iconSize.cy;
@@ -2967,15 +2979,12 @@ static INT LISTVIEW_CalculateItemHeight(const LISTVIEW_INFO *infoPtr)
        nItemHeight = infoPtr->iconSpacing.cy;
     else
     {
-       nItemHeight = infoPtr->ntmHeight; 
-        if (infoPtr->uView == LV_VIEW_DETAILS && infoPtr->dwLvExStyle & LVS_EX_GRIDLINES)
-            nItemHeight++;
+       nItemHeight = infoPtr->ntmHeight;
        if (infoPtr->himlState)
            nItemHeight = max(nItemHeight, infoPtr->iconStateSize.cy);
        if (infoPtr->himlSmall)
            nItemHeight = max(nItemHeight, infoPtr->iconSize.cy);
-       if (infoPtr->himlState || infoPtr->himlSmall)
-           nItemHeight += HEIGHT_PADDING;
+       nItemHeight += HEIGHT_PADDING;
     if (infoPtr->nMeasureItemHeight > 0)
         nItemHeight = infoPtr->nMeasureItemHeight;
     }
@@ -3459,7 +3468,6 @@ static inline BOOL LISTVIEW_SetItemFocus(LISTVIEW_INFO *infoPtr, INT nItem)
     return oldFocus != infoPtr->nFocusedItem;
 }
 
-/* Helper function for LISTVIEW_ShiftIndices *only* */
 static INT shift_item(const LISTVIEW_INFO *infoPtr, INT nShiftItem, INT nItem, INT direction)
 {
     if (nShiftItem < nItem) return nShiftItem;
@@ -3471,6 +3479,24 @@ static INT shift_item(const LISTVIEW_INFO *infoPtr, INT nShiftItem, INT nItem, I
     return min(nShiftItem, infoPtr->nItemCount - 1);
 }
 
+/* This function updates focus index.
+
+Parameters:
+   focus : current focus index
+   item : index of item to be added/removed
+   direction : add/remove flag
+*/
+static void LISTVIEW_ShiftFocus(LISTVIEW_INFO *infoPtr, INT focus, INT item, INT direction)
+{
+    BOOL old_change = infoPtr->bDoChangeNotify;
+
+    infoPtr->bDoChangeNotify = FALSE;
+    focus = shift_item(infoPtr, focus, item, direction);
+    if (focus != infoPtr->nFocusedItem)
+        LISTVIEW_SetItemFocus(infoPtr, focus);
+    infoPtr->bDoChangeNotify = old_change;
+}
+
 /**
 * DESCRIPTION:
 * Updates the various indices after an item has been inserted or deleted.
@@ -3485,31 +3511,15 @@ static INT shift_item(const LISTVIEW_INFO *infoPtr, INT nShiftItem, INT nItem, I
 */
 static void LISTVIEW_ShiftIndices(LISTVIEW_INFO *infoPtr, INT nItem, INT direction)
 {
-    INT nNewFocus;
-    BOOL bOldChange;
-
-    /* temporarily disable change notification while shifting items */
-    bOldChange = infoPtr->bDoChangeNotify;
-    infoPtr->bDoChangeNotify = FALSE;
-
-    TRACE("Shifting %iu, %i steps\n", nItem, direction);
+    TRACE("Shifting %i, %i steps\n", nItem, direction);
 
     ranges_shift(infoPtr->selectionRanges, nItem, direction, infoPtr->nItemCount);
-
     assert(abs(direction) == 1);
-
     infoPtr->nSelectionMark = shift_item(infoPtr, infoPtr->nSelectionMark, nItem, direction);
 
-    nNewFocus = shift_item(infoPtr, infoPtr->nFocusedItem, nItem, direction);
-    if (nNewFocus != infoPtr->nFocusedItem)
-        LISTVIEW_SetItemFocus(infoPtr, nNewFocus);
-    
     /* But we are not supposed to modify nHotItem! */
-
-    infoPtr->bDoChangeNotify = bOldChange;
 }
 
-
 /**
  * DESCRIPTION:
  * Adds a block of selections.
@@ -3550,8 +3560,8 @@ static BOOL LISTVIEW_AddGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem)
     ZeroMemory(&nmlv, sizeof(nmlv));
     nmlv.iFrom = nFirst;
     nmlv.iTo = nLast;
-    nmlv.uNewState = 0;
-    nmlv.uOldState = item.state;
+    nmlv.uOldState = 0;
+    nmlv.uNewState = item.state;
 
     notify_hdr(infoPtr, LVN_ODSTATECHANGED, (LPNMHDR)&nmlv);
     if (!IsWindow(hwndSelf))
@@ -3606,9 +3616,15 @@ static void LISTVIEW_SetGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem)
        POINT ptItem;
        
        rcItem.left = LVIR_BOUNDS;
-       if (!LISTVIEW_GetItemRect(infoPtr, nItem, &rcItem)) return;
+       if (!LISTVIEW_GetItemRect(infoPtr, nItem, &rcItem)) {
+            ranges_destroy (selection);
+            return;
+       }
        rcSelMark.left = LVIR_BOUNDS;
-       if (!LISTVIEW_GetItemRect(infoPtr, infoPtr->nSelectionMark, &rcSelMark)) return;
+       if (!LISTVIEW_GetItemRect(infoPtr, infoPtr->nSelectionMark, &rcSelMark)) {
+            ranges_destroy (selection);
+            return;
+       }
        UnionRect(&rcSel, &rcItem, &rcSelMark);
        iterator_frameditems(&i, infoPtr, &rcSel);
        while(iterator_next(&i))
@@ -3989,17 +4005,23 @@ static VOID CALLBACK LISTVIEW_ScrollTimer(HWND hWnd, UINT uMsg, UINT_PTR idEvent
  */
 static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, INT y)
 {
+    LVHITTESTINFO ht;
+    RECT rect;
+    POINT pt;
+
     if (!(fwKeys & MK_LBUTTON))
         infoPtr->bLButtonDown = FALSE;
 
     if (infoPtr->bLButtonDown)
     {
-        POINT tmp;
-        RECT rect;
-        LVHITTESTINFO lvHitTestInfo;
-        WORD wDragWidth = GetSystemMetrics(SM_CXDRAG);
-        WORD wDragHeight= GetSystemMetrics(SM_CYDRAG);
+        rect.left = rect.right = infoPtr->ptClickPos.x;
+        rect.top = rect.bottom = infoPtr->ptClickPos.y;
+
+        InflateRect(&rect, GetSystemMetrics(SM_CXDRAG), GetSystemMetrics(SM_CYDRAG));
+    }
 
+    if (infoPtr->bLButtonDown)
+    {
         if (infoPtr->bMarqueeSelect)
         {
             POINT coords_orig;
@@ -4042,22 +4064,17 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
             return 0;
         }
 
-        rect.left = infoPtr->ptClickPos.x - wDragWidth;
-        rect.right = infoPtr->ptClickPos.x + wDragWidth;
-        rect.top = infoPtr->ptClickPos.y - wDragHeight;
-        rect.bottom = infoPtr->ptClickPos.y + wDragHeight;
-
-        tmp.x = x;
-        tmp.y = y;
+        pt.x = x;
+        pt.y = y;
 
-        lvHitTestInfo.pt = tmp;
-        LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE);
+        ht.pt = pt;
+        LISTVIEW_HitTest(infoPtr, &ht, TRUE, TRUE);
 
         /* reset item marker */
-        if (infoPtr->nLButtonDownItem != lvHitTestInfo.iItem)
+        if (infoPtr->nLButtonDownItem != ht.iItem)
             infoPtr->nLButtonDownItem = -1;
 
-        if (!PtInRect(&rect, tmp))
+        if (!PtInRect(&rect, pt))
         {
             /* this path covers the following:
                1. WM_LBUTTONDOWN over selected item (sets focus on it)
@@ -4077,12 +4094,12 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
 
             if (!infoPtr->bDragging)
             {
-                lvHitTestInfo.pt = infoPtr->ptClickPos;
-                LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE);
+                ht.pt = infoPtr->ptClickPos;
+                LISTVIEW_HitTest(infoPtr, &ht, TRUE, TRUE);
 
                 /* If the click is outside the range of an item, begin a
                    highlight. If not, begin an item drag. */
-                if (lvHitTestInfo.iItem == -1)
+                if (ht.iItem == -1)
                 {
                     NMHDR hdr;
 
@@ -4107,7 +4124,7 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
                     NMLISTVIEW nmlv;
 
                     ZeroMemory(&nmlv, sizeof(nmlv));
-                    nmlv.iItem = lvHitTestInfo.iItem;
+                    nmlv.iItem = ht.iItem;
                     nmlv.ptAction = infoPtr->ptClickPos;
 
                     notify_listview(infoPtr, LVN_BEGINDRAG, &nmlv);
@@ -4158,7 +4175,7 @@ static inline BOOL is_assignable_item(const LVITEMW *lpLVItem, LONG lStyle)
 
 /***
  * DESCRIPTION:
- * Helper for LISTVIEW_SetItemT *only*: sets item attributes.
+ * Helper for LISTVIEW_SetItemT and LISTVIEW_InsertItemT: sets item attributes.
  *
  * PARAMETER(S):
  * [I] infoPtr : valid pointer to the listview structure
@@ -4227,20 +4244,19 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL
     if ((lpLVItem->mask & LVIF_TEXT) && textcmpWT(lpItem->hdr.pszText, lpLVItem->pszText, isW))
        uChanged |= LVIF_TEXT;
    
-    TRACE("uChanged=0x%x\n", uChanged); 
-    if (!uChanged) return TRUE;
-    *bChanged = TRUE;
+    TRACE("change mask=0x%x\n", uChanged);
     
-    ZeroMemory(&nmlv, sizeof(NMLISTVIEW));
+    memset(&nmlv, 0, sizeof(NMLISTVIEW));
     nmlv.iItem = lpLVItem->iItem;
     nmlv.uNewState = (item.state & ~stateMask) | (lpLVItem->state & stateMask);
     nmlv.uOldState = item.state;
-    nmlv.uChanged = uChanged;
+    nmlv.uChanged = uChanged ? uChanged : lpLVItem->mask;
     nmlv.lParam = item.lParam;
-    
-    /* send LVN_ITEMCHANGING notification, if the item is not being inserted */
-    /* and we are _NOT_ virtual (LVS_OWNERDATA), and change notifications */
-    /* are enabled */
+
+    /* Send LVN_ITEMCHANGING notification, if the item is not being inserted
+       and we are _NOT_ virtual (LVS_OWNERDATA), and change notifications
+       are enabled. Even nothing really changed we still need to send this,
+       in this case uChanged mask is just set to passed item mask. */
     if(lpItem && !isNew && infoPtr->bDoChangeNotify)
     {
       HWND hwndSelf = infoPtr->hwndSelf;
@@ -4251,6 +4267,18 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL
        return FALSE;
     }
 
+    /* When item is inserted we need to shift existing focus index if new item has lower index. */
+    if (isNew && (stateMask & ~infoPtr->uCallbackMask & LVIS_FOCUSED) &&
+        /* this means we won't hit a focus change path later */
+        ((uChanged & LVIF_STATE) == 0 || (!(lpLVItem->state & LVIS_FOCUSED) && (infoPtr->nFocusedItem != lpLVItem->iItem))))
+    {
+        if (infoPtr->nFocusedItem != -1 && (lpLVItem->iItem <= infoPtr->nFocusedItem))
+            infoPtr->nFocusedItem++;
+    }
+
+    if (!uChanged) return TRUE;
+    *bChanged = TRUE;
+
     /* copy information */
     if (lpLVItem->mask & LVIF_TEXT)
         textsetptrT(&lpItem->hdr.pszText, lpLVItem->pszText, isW);
@@ -4280,7 +4308,14 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL
        {
            ranges_delitem(infoPtr->selectionRanges, lpLVItem->iItem);
        }
-       /* if we are asked to change focus, and we manage it, do it */
+       /* If we are asked to change focus, and we manage it, do it.
+           It's important to have all new item data stored at this point,
+           because changing existing focus could result in a redrawing operation,
+           which in turn could ask for disp data, application should see all data
+           for inserted item when processing LVN_GETDISPINFO.
+
+           The way this works application will see nested item change notifications -
+           changed item notifications interrupted by ones from item losing focus. */
        if (stateMask & ~infoPtr->uCallbackMask & LVIS_FOCUSED)
        {
            if (lpLVItem->state & LVIS_FOCUSED)
@@ -4312,7 +4347,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL
 
     /* if we're inserting the item, we're done */
     if (isNew) return TRUE;
-    
+
     /* send LVN_ITEMCHANGED notification */
     if (lpLVItem->mask & LVIF_PARAM) nmlv.lParam = lpLVItem->lParam;
     if (infoPtr->bDoChangeNotify) notify_listview(infoPtr, LVN_ITEMCHANGED, &nmlv);
@@ -4554,7 +4589,6 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
     NMLVCUSTOMDRAW nmlvcd;
     HIMAGELIST himl;
     LVITEMW lvItem;
-    HFONT hOldFont;
 
     TRACE("(hdc=%p, nItem=%d, nSubItem=%d, pos=%s)\n", hdc, nItem, nSubItem, wine_dbgstr_point(&pos));
 
@@ -4562,7 +4596,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
     lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
     if (nSubItem == 0) lvItem.mask |= LVIF_STATE;
     if (infoPtr->uView == LV_VIEW_DETAILS) lvItem.mask |= LVIF_INDENT;
-    lvItem.stateMask = LVIS_SELECTED | LVIS_FOCUSED | LVIS_STATEIMAGEMASK | LVIS_CUT;
+    lvItem.stateMask = LVIS_SELECTED | LVIS_FOCUSED | LVIS_STATEIMAGEMASK | LVIS_CUT | LVIS_OVERLAYMASK;
     lvItem.iItem = nItem;
     lvItem.iSubItem = nSubItem;
     lvItem.state = 0;
@@ -4592,7 +4626,6 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
     /* fill in the custom draw structure */
     customdraw_fill(&nmlvcd, infoPtr, hdc, &rcBox, &lvItem);
 
-    hOldFont = GetCurrentObject(hdc, OBJ_FONT);
     if (nSubItem > 0) cdmode = infoPtr->cditemmode;
     if (cdmode & CDRF_SKIPDEFAULT) goto postpaint;
     if (cdmode & CDRF_NOTIFYITEMDRAW)
@@ -4600,7 +4633,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
     if (nSubItem == 0) infoPtr->cditemmode = cdsubitemmode;
     if (cdsubitemmode & CDRF_SKIPDEFAULT) goto postpaint;
     /* we have to send a CDDS_SUBITEM customdraw explicitly for subitem 0 */
-    if (nSubItem == 0 && cdsubitemmode == CDRF_NOTIFYITEMDRAW)
+    if (nSubItem == 0 && (cdsubitemmode & CDRF_NOTIFYITEMDRAW) != 0)
     {
         cdsubitemmode = notify_customdraw(infoPtr, CDDS_SUBITEM | CDDS_ITEMPREPAINT, &nmlvcd);
         if (cdsubitemmode & CDRF_SKIPDEFAULT) goto postpaint;
@@ -4610,21 +4643,25 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
     else if ((infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) == FALSE)
         prepaint_setup(infoPtr, hdc, &nmlvcd, TRUE);
 
-    /* in full row select, subitems, will just use main item's colors */
-    if (nSubItem && infoPtr->uView == LV_VIEW_DETAILS && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
-       nmlvcd.clrTextBk = CLR_NONE;
-
     /* FIXME: temporary hack */
     rcSelect.left = rcLabel.left;
 
-    /* draw the selection background, if we're drawing the main item */
-    if (nSubItem == 0)
-    {
-        /* in icon mode, the label rect is really what we want to draw the
-         * background for */
-        if (infoPtr->uView == LV_VIEW_ICON)
-           rcSelect = rcLabel;
+    /* in icon mode, the label rect is really what we want to draw the
+     * background for */
+    /* in detail mode, we want to paint background for label rect when
+     * item is not selected or listview has full row select; otherwise paint
+     * background for text only */
+    if (infoPtr->uView == LV_VIEW_ICON ||
+        (infoPtr->uView == LV_VIEW_DETAILS &&
+        (!(lvItem.state & LVIS_SELECTED) ||
+        (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) != 0)))
+        rcSelect = rcLabel;
+
+    if (nmlvcd.clrTextBk != CLR_NONE)
+        ExtTextOutW(hdc, rcSelect.left, rcSelect.top, ETO_OPAQUE, &rcSelect, NULL, 0, NULL);
 
+    if(nSubItem == 0 && infoPtr->nFocusedItem == nItem)
+    {
        if (infoPtr->uView == LV_VIEW_DETAILS && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
        {
            /* we have to update left focus bound too if item isn't in leftmost column
@@ -4647,10 +4684,8 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
            rcSelect.right = rcBox.right;
        }
 
-       if (nmlvcd.clrTextBk != CLR_NONE)
-           ExtTextOutW(hdc, rcSelect.left, rcSelect.top, ETO_OPAQUE, &rcSelect, NULL, 0, NULL);
        /* store new focus rectangle */
-       if (infoPtr->nFocusedItem == nItem) infoPtr->rcFocus = rcSelect;
+        infoPtr->rcFocus = rcSelect;
     }
 
     /* state icons */
@@ -4681,7 +4716,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
         ImageList_DrawEx(himl, lvItem.iImage, hdc, rcIcon.left, rcIcon.top,
                          rcIcon.right - rcIcon.left, rcIcon.bottom - rcIcon.top, infoPtr->clrBk,
                          lvItem.state & LVIS_CUT ? RGB(255, 255, 255) : CLR_DEFAULT,
-                         style);
+                         style | (lvItem.state & LVIS_OVERLAYMASK));
     }
 
     /* Don't bother painting item being edited */
@@ -4719,8 +4754,6 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
 postpaint:
     if (cdsubitemmode & CDRF_NOTIFYPOSTPAINT)
         notify_postpaint(infoPtr, &nmlvcd);
-    if (cdsubitemmode & CDRF_NEWFONT)
-        SelectObject(hdc, hOldFont);
     return TRUE;
 }
 
@@ -4847,6 +4880,7 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc,
     /* iterate through the invalidated rows */
     while(iterator_next(i))
     {
+        SelectObject(hdc, infoPtr->hFont);
        LISTVIEW_GetItemOrigin(infoPtr, i->nItem, &Position);
        Position.y += Origin.y;
 
@@ -4969,6 +5003,8 @@ static void LISTVIEW_RefreshReportGrid(LISTVIEW_INFO *infoPtr, HDC hdc)
         SelectObject( hdc, hOldPen );
         DeleteObject( hPen );
     }
+    else
+        ranges_destroy(colRanges);
 }
 
 /***
@@ -4992,6 +5028,7 @@ static void LISTVIEW_RefreshList(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, D
     
     while(iterator_prev(i))
     {
+        SelectObject(hdc, infoPtr->hFont);
        LISTVIEW_GetItemOrigin(infoPtr, i->nItem, &Position);
        Position.x += Origin.x;
        Position.y += Origin.y;
@@ -5015,7 +5052,7 @@ static void LISTVIEW_RefreshList(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, D
  */
 static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcErase)
 {
-    COLORREF oldTextColor = 0, oldBkColor = 0, oldClrTextBk, oldClrText;
+    COLORREF oldTextColor = 0, oldBkColor = 0;
     NMLVCUSTOMDRAW nmlvcd;
     HFONT hOldFont = 0;
     DWORD cdmode;
@@ -5072,21 +5109,12 @@ static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcEra
                hdcOrig, infoPtr->rcList.left, infoPtr->rcList.top, SRCCOPY);
     }
 
-    /* FIXME: Shouldn't need to do this */
-    oldClrTextBk = infoPtr->clrTextBk;
-    oldClrText   = infoPtr->clrText;
-   
     infoPtr->cditemmode = CDRF_DODEFAULT;
 
     GetClientRect(infoPtr->hwndSelf, &rcClient);
     customdraw_fill(&nmlvcd, infoPtr, hdc, &rcClient, 0);
     cdmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd);
     if (cdmode & CDRF_SKIPDEFAULT) goto enddraw;
-    prepaint_setup(infoPtr, hdc, &nmlvcd, FALSE);
-
-    /* Use these colors to draw the items */
-    infoPtr->clrTextBk = nmlvcd.clrTextBk;
-    infoPtr->clrText = nmlvcd.clrText;
 
     /* nothing to draw */
     if(infoPtr->nItemCount == 0) goto enddraw;
@@ -5139,9 +5167,6 @@ enddraw:
     if (cdmode & CDRF_NOTIFYPOSTPAINT)
        notify_postpaint(infoPtr, &nmlvcd);
 
-    infoPtr->clrTextBk = oldClrTextBk;
-    infoPtr->clrText = oldClrText;
-
     if(hbmp) {
         BitBlt(hdcOrig, infoPtr->rcList.left, infoPtr->rcList.top,
                infoPtr->rcList.right - infoPtr->rcList.left,
@@ -5322,6 +5347,7 @@ static HIMAGELIST LISTVIEW_CreateDragImage(LISTVIEW_INFO *infoPtr, INT iItem, LP
     POINT pos;
     HDC hdc, hdcOrig;
     HBITMAP hbmp, hOldbmp;
+    HFONT hOldFont;
     HIMAGELIST dragList = 0;
     TRACE("iItem=%d Count=%d\n", iItem, infoPtr->nItemCount);
 
@@ -5342,6 +5368,7 @@ static HIMAGELIST LISTVIEW_CreateDragImage(LISTVIEW_INFO *infoPtr, INT iItem, LP
     hdc = CreateCompatibleDC(hdcOrig);
     hbmp = CreateCompatibleBitmap(hdcOrig, size.cx, size.cy);
     hOldbmp = SelectObject(hdc, hbmp);
+    hOldFont = SelectObject(hdc, infoPtr->hFont);
 
     rcItem.left = rcItem.top = 0;
     rcItem.right = size.cx;
@@ -5358,6 +5385,7 @@ static HIMAGELIST LISTVIEW_CreateDragImage(LISTVIEW_INFO *infoPtr, INT iItem, LP
     else
         SelectObject(hdc, hOldbmp);
 
+    SelectObject(hdc, hOldFont);
     DeleteObject(hbmp);
     DeleteDC(hdc);
     ReleaseDC(infoPtr->hwndSelf, hdcOrig);
@@ -5642,9 +5670,8 @@ static void LISTVIEW_ScrollOnInsert(LISTVIEW_INFO *infoPtr, INT nItem, INT dir)
     TRACE("rcScroll=%s, dx=%d\n", wine_dbgstr_rect(&rcScroll), dir * infoPtr->nItemHeight);
     if (IntersectRect(&rcScroll, &rcScroll, &infoPtr->rcList))
     {
-       TRACE("Scrolling rcScroll=%s, rcList=%s\n", wine_dbgstr_rect(&rcScroll), wine_dbgstr_rect(&infoPtr->rcList));
-       ScrollWindowEx(infoPtr->hwndSelf, 0, dir * infoPtr->nItemHeight, 
-                      &rcScroll, &rcScroll, 0, 0, SW_ERASE | SW_INVALIDATE);
+       TRACE("Invalidating rcScroll=%s, rcList=%s\n", wine_dbgstr_rect(&rcScroll), wine_dbgstr_rect(&infoPtr->rcList));
+       InvalidateRect(infoPtr->hwndSelf, &rcScroll, TRUE);
     }
 
     /* report has only that column, so we're done */
@@ -5657,8 +5684,7 @@ static void LISTVIEW_ScrollOnInsert(LISTVIEW_INFO *infoPtr, INT nItem, INT dir)
     rcScroll.bottom = nPerCol * infoPtr->nItemHeight;
     OffsetRect(&rcScroll, Origin.x, Origin.y);
     if (IntersectRect(&rcScroll, &rcScroll, &infoPtr->rcList))
-       ScrollWindowEx(infoPtr->hwndSelf, 0, dir * infoPtr->nItemHeight,
-                      &rcScroll, &rcScroll, 0, 0, SW_ERASE | SW_INVALIDATE);
+       InvalidateRect(infoPtr->hwndSelf, &rcScroll, TRUE);
 }
 
 /***
@@ -5677,6 +5703,7 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem)
 {
     LVITEMW item;
     const BOOL is_icon = (infoPtr->uView == LV_VIEW_SMALLICON || infoPtr->uView == LV_VIEW_ICON);
+    INT focus = infoPtr->nFocusedItem;
 
     TRACE("(nItem=%d)\n", nItem);
 
@@ -5686,7 +5713,7 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem)
     item.state = 0;
     item.stateMask = LVIS_SELECTED | LVIS_FOCUSED;
     LISTVIEW_SetItemState(infoPtr, nItem, &item);
-           
+
     /* send LVN_DELETEITEM notification. */
     if (!notify_deleteitem(infoPtr, nItem)) return FALSE;
 
@@ -5727,6 +5754,7 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem)
 
     infoPtr->nItemCount--;
     LISTVIEW_ShiftIndices(infoPtr, nItem, -1);
+    LISTVIEW_ShiftFocus(infoPtr, focus, nItem, -1);
 
     /* now is the invalidation fun */
     if (!is_icon)
@@ -6554,7 +6582,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem,
     HDPA hdpaSubItems;
     INT isubitem;
 
-    TRACE("(lpLVItem=%s, isW=%d)\n", debuglvitem_t(lpLVItem, isW), isW);
+    TRACE("(item=%s, isW=%d)\n", debuglvitem_t(lpLVItem, isW), isW);
 
     if (!lpLVItem || lpLVItem->iItem < 0 || lpLVItem->iItem >= infoPtr->nItemCount)
        return FALSE;
@@ -7045,65 +7073,61 @@ static BOOL LISTVIEW_GetItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT
  * 
  * NOTE: for subItem = 0, we should return the bounds of the _entire_ item,
  *       not only those of the first column.
- *       Fortunately, LISTVIEW_GetItemMetrics does the right thing.
  * 
  * RETURN:
  *     TRUE: success
  *     FALSE: failure
  */
-static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT lprc)
+static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT item, LPRECT lprc)
 {
-    POINT Position, Origin;
-    LVITEMW lvItem;
-    INT nColumn;
+    RECT rect = { 0, 0, 0, 0 };
+    POINT origin;
+    INT y;
     
     if (!lprc) return FALSE;
 
-    nColumn = lprc->top;
-
-    TRACE("(nItem=%d, nSubItem=%d, type=%d)\n", nItem, lprc->top, lprc->left);
-    /* On WinNT, a subitem of '0' calls LISTVIEW_GetItemRect */
+    TRACE("(item=%d, subitem=%d, type=%d)\n", item, lprc->top, lprc->left);
+    /* Subitem of '0' means item itself, and this works for all control view modes */
     if (lprc->top == 0)
-        return LISTVIEW_GetItemRect(infoPtr, nItem, lprc);
+        return LISTVIEW_GetItemRect(infoPtr, item, lprc);
 
     if (infoPtr->uView != LV_VIEW_DETAILS) return FALSE;
 
-    /* special case for header items */
-    if (nItem == -1)
-    {
-        if (lprc->left != LVIR_BOUNDS)
-        {
-            FIXME("Only LVIR_BOUNDS is implemented for header, got %d\n", lprc->left);
-            return FALSE;
-        }
+    LISTVIEW_GetOrigin(infoPtr, &origin);
+    /* this works for any item index, no matter if it exists or not */
+    y = item * infoPtr->nItemHeight + origin.y;
 
-        if (infoPtr->hwndHeader)
-            return SendMessageW(infoPtr->hwndHeader, HDM_GETITEMRECT, lprc->top, (LPARAM)lprc);
-        else
-        {
-            memset(lprc, 0, sizeof(RECT));
-            return TRUE;
-        }
+    if (infoPtr->hwndHeader && SendMessageW(infoPtr->hwndHeader, HDM_GETITEMRECT, lprc->top, (LPARAM)&rect))
+    {
+        rect.top = 0;
+        rect.bottom = infoPtr->nItemHeight;
+    }
+    else
+    {
+        /* Native implementation is broken for this case and garbage is left for left and right fields,
+           we zero them to get predictable output */
+        lprc->left = lprc->right = lprc->top = 0;
+        lprc->bottom = infoPtr->nItemHeight;
+        OffsetRect(lprc, origin.x, y);
+        TRACE("return rect %s\n", wine_dbgstr_rect(lprc));
+        return TRUE;
     }
 
-    if (!LISTVIEW_GetItemPosition(infoPtr, nItem, &Position)) return FALSE;
-    LISTVIEW_GetOrigin(infoPtr, &Origin);
-
-    if (nColumn < 0 || nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return FALSE;
-
-    lvItem.mask = 0;
-    lvItem.iItem = nItem;
-    lvItem.iSubItem = nColumn;
-    
-    switch(lprc->left)
+    switch (lprc->left)
     {
     case LVIR_ICON:
-       LISTVIEW_GetItemMetrics(infoPtr, &lvItem, NULL, NULL, lprc, NULL, NULL);
-        break;
+    {
+        /* it doesn't matter if main item actually has an icon, if imagelist is set icon width is returned */
+        if (infoPtr->himlSmall)
+            rect.right = rect.left + infoPtr->iconSize.cx;
+        else
+            rect.right = rect.left;
 
+        rect.bottom = rect.top + infoPtr->iconSize.cy;
+        break;
+    }
     case LVIR_LABEL:
     case LVIR_BOUNDS:
-       LISTVIEW_GetItemMetrics(infoPtr, &lvItem, lprc, NULL, NULL, NULL, NULL);
         break;
 
     default:
@@ -7111,7 +7135,8 @@ static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPR
        return FALSE;
     }
 
-    OffsetRect(lprc, Origin.x, Position.y);
+    OffsetRect(&rect, origin.x, y);
+    *lprc = rect;
     TRACE("return rect %s\n", wine_dbgstr_rect(lprc));
 
     return TRUE;
@@ -7680,7 +7705,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
     LVITEMW item;
     HWND hwndSelf = infoPtr->hwndSelf;
 
-    TRACE("(lpLVItem=%s, isW=%d)\n", debuglvitem_t(lpLVItem, isW), isW);
+    TRACE("(item=%s, isW=%d)\n", debuglvitem_t(lpLVItem, isW), isW);
 
     if (infoPtr->dwStyle & LVS_OWNERDATA) return infoPtr->nItemCount++;
 
@@ -7730,7 +7755,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
     else
         nItem = min(lpLVItem->iItem, infoPtr->nItemCount);
 
-    TRACE(" inserting at %d, sorted=%d, count=%d, iItem=%d\n", nItem, is_sorted, infoPtr->nItemCount, lpLVItem->iItem);
+    TRACE("inserting at %d, sorted=%d, count=%d, iItem=%d\n", nItem, is_sorted, infoPtr->nItemCount, lpLVItem->iItem);
     nItem = DPA_InsertPtr( infoPtr->hdpaItems, nItem, hdpaSubItems );
     if (nItem == -1) goto fail;
     infoPtr->nItemCount++;
@@ -7762,6 +7787,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
         item.state &= ~LVIS_STATEIMAGEMASK;
         item.state |= INDEXTOSTATEIMAGEMASK(1);
     }
+
     if (!set_main_item(infoPtr, &item, TRUE, isW, &has_changed)) goto undo;
 
     /* make room for the position, if we are in the right mode */
@@ -7775,9 +7801,9 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
            goto undo;
        }
     }
-    
+
     /* send LVN_INSERTITEM notification */
-    ZeroMemory(&nmlv, sizeof(NMLISTVIEW));
+    memset(&nmlv, 0, sizeof(NMLISTVIEW));
     nmlv.iItem = nItem;
     nmlv.lParam = lpItem->lParam;
     notify_listview(infoPtr, LVN_INSERTITEM, &nmlv);
@@ -7803,6 +7829,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
 
 undo:
     LISTVIEW_ShiftIndices(infoPtr, nItem, -1);
+    LISTVIEW_ShiftFocus(infoPtr, infoPtr->nFocusedItem, nItem, -1);
     DPA_DeletePtr(infoPtr->hdpaItems, nItem);
     infoPtr->nItemCount--;
 fail:
@@ -8283,10 +8310,10 @@ static BOOL LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn, INT cx)
        lvItem.mask = LVIF_TEXT;        
        lvItem.iItem = 0;
        lvItem.iSubItem = nColumn;
-       lvItem.pszText = szDispText;
        lvItem.cchTextMax = DISP_TEXT_SIZE;
        for (; lvItem.iItem < infoPtr->nItemCount; lvItem.iItem++)
        {
+            lvItem.pszText = szDispText;
            if (!LISTVIEW_GetItemW(infoPtr, &lvItem)) continue;
            nLabelWidth = LISTVIEW_GetStringWidthT(infoPtr, lvItem.pszText, TRUE);
            if (max_cx < nLabelWidth) max_cx = nLabelWidth;
@@ -8570,36 +8597,33 @@ static DWORD LISTVIEW_SetHoverTime(LISTVIEW_INFO *infoPtr, DWORD dwHoverTime)
  */
 static DWORD LISTVIEW_SetIconSpacing(LISTVIEW_INFO *infoPtr, INT cx, INT cy)
 {
+    INT iconWidth = 0, iconHeight = 0;
     DWORD oldspacing = MAKELONG(infoPtr->iconSpacing.cx, infoPtr->iconSpacing.cy);
 
     TRACE("requested=(%d,%d)\n", cx, cy);
-    
-    /* this is supported only for LVS_ICON style */
-    if (infoPtr->uView != LV_VIEW_ICON) return oldspacing;
-  
-    /* set to defaults, if instructed to */
-    if (cx == -1) cx = GetSystemMetrics(SM_CXICONSPACING);
-    if (cy == -1) cy = GetSystemMetrics(SM_CYICONSPACING);
 
-    /* if 0 then compute width
-     * FIXME: computed cx and cy is not matching native behaviour */
-    if (cx == 0) {
-        cx = GetSystemMetrics(SM_CXICONSPACING);
-        if (infoPtr->iconSize.cx + ICON_LR_PADDING > cx)
-            cx = infoPtr->iconSize.cx + ICON_LR_PADDING;
+    /* set to defaults, if instructed to */
+    if (cx == -1 && cy == -1)
+    {
+        infoPtr->autoSpacing = TRUE;
+        if (infoPtr->himlNormal)
+            ImageList_GetIconSize(infoPtr->himlNormal, &iconWidth, &iconHeight);
+        cx = GetSystemMetrics(SM_CXICONSPACING) - GetSystemMetrics(SM_CXICON) + iconWidth;
+        cy = GetSystemMetrics(SM_CYICONSPACING) - GetSystemMetrics(SM_CYICON) + iconHeight;
     }
+    else
+        infoPtr->autoSpacing = FALSE;
 
-    /* if 0 then compute height */
-    if (cy == 0) 
-       cy = infoPtr->iconSize.cy + 2 * infoPtr->ntmHeight +
-            ICON_BOTTOM_PADDING + ICON_TOP_PADDING + LABEL_VERT_PADDING;
-    
+    /* if 0 then keep width */
+    if (cx != 0)
+        infoPtr->iconSpacing.cx = cx;
 
-    infoPtr->iconSpacing.cx = cx;
-    infoPtr->iconSpacing.cy = cy;
+    /* if 0 then keep height */
+    if (cy != 0)
+        infoPtr->iconSpacing.cy = cy;
 
     TRACE("old=(%d,%d), new=(%d,%d), iconSize=(%d,%d), ntmH=%d\n",
-         LOWORD(oldspacing), HIWORD(oldspacing), cx, cy, 
+          LOWORD(oldspacing), HIWORD(oldspacing), infoPtr->iconSpacing.cx, infoPtr->iconSpacing.cy,
          infoPtr->iconSize.cx, infoPtr->iconSize.cy,
          infoPtr->ntmHeight);
 
@@ -8651,13 +8675,16 @@ static HIMAGELIST LISTVIEW_SetImageList(LISTVIEW_INFO *infoPtr, INT nType, HIMAG
         himlOld = infoPtr->himlNormal;
         infoPtr->himlNormal = himl;
         if (infoPtr->uView == LV_VIEW_ICON) set_icon_size(&infoPtr->iconSize, himl, FALSE);
-        LISTVIEW_SetIconSpacing(infoPtr, 0, 0);
+        if (infoPtr->autoSpacing)
+            LISTVIEW_SetIconSpacing(infoPtr, -1, -1);
     break;
 
     case LVSIL_SMALL:
         himlOld = infoPtr->himlSmall;
         infoPtr->himlSmall = himl;
         if (infoPtr->uView != LV_VIEW_ICON) set_icon_size(&infoPtr->iconSize, himl, TRUE);
+        if (infoPtr->hwndHeader)
+            SendMessageW(infoPtr->hwndHeader, HDM_SETIMAGELIST, 0, (LPARAM)himl);
     break;
 
     case LVSIL_STATE:
@@ -8854,6 +8881,10 @@ static BOOL LISTVIEW_SetItemState(LISTVIEW_INFO *infoPtr, INT nItem, const LVITE
         UINT oldstate = 0;
         BOOL notify;
 
+        /* special case optimization for recurring attempt to deselect all */
+        if (lvItem.state == 0 && lvItem.stateMask == LVIS_SELECTED && !LISTVIEW_GetSelectedCount(infoPtr))
+            return TRUE;
+
        /* select all isn't allowed in LVS_SINGLESEL */
        if ((lvItem.state & lvItem.stateMask & LVIS_SELECTED) && (infoPtr->dwStyle & LVS_SINGLESEL))
            return FALSE;
@@ -9039,7 +9070,6 @@ static BOOL LISTVIEW_SetUnicodeFormat( LISTVIEW_INFO *infoPtr, BOOL unicode)
  */
 static INT LISTVIEW_SetView(LISTVIEW_INFO *infoPtr, DWORD nView)
 {
-  SIZE oldIconSize = infoPtr->iconSize;
   HIMAGELIST himl;
 
   if (infoPtr->uView == nView) return 1;
@@ -9065,14 +9095,6 @@ static INT LISTVIEW_SetView(LISTVIEW_INFO *infoPtr, DWORD nView)
   switch (nView)
   {
   case LV_VIEW_ICON:
-      if ((infoPtr->iconSize.cx != oldIconSize.cx) || (infoPtr->iconSize.cy != oldIconSize.cy))
-      {
-            TRACE("icon old size=(%d,%d), new size=(%d,%d)\n",
-                   oldIconSize.cx, oldIconSize.cy, infoPtr->iconSize.cx, infoPtr->iconSize.cy);
-           LISTVIEW_SetIconSpacing(infoPtr, 0, 0);
-      }
-      LISTVIEW_Arrange(infoPtr, LVA_DEFAULT);
-      break;
   case LV_VIEW_SMALLICON:
       LISTVIEW_Arrange(infoPtr, LVA_DEFAULT);
       break;
@@ -9369,11 +9391,13 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs)
   infoPtr->bRedraw = TRUE;
   infoPtr->bNoItemMetrics = TRUE;
   infoPtr->bDoChangeNotify = TRUE;
-  infoPtr->iconSpacing.cx = GetSystemMetrics(SM_CXICONSPACING);
-  infoPtr->iconSpacing.cy = GetSystemMetrics(SM_CYICONSPACING);
+  infoPtr->autoSpacing = TRUE;
+  infoPtr->iconSpacing.cx = GetSystemMetrics(SM_CXICONSPACING) - GetSystemMetrics(SM_CXICON);
+  infoPtr->iconSpacing.cy = GetSystemMetrics(SM_CYICONSPACING) - GetSystemMetrics(SM_CYICON);
   infoPtr->nEditLabelItem = -1;
   infoPtr->nLButtonDownItem = -1;
   infoPtr->dwHoverTime = HOVER_DEFAULT; /* default system hover time */
+  infoPtr->cWheelRemainder = 0;
   infoPtr->nMeasureItemHeight = 0;
   infoPtr->xTrackLine = -1;  /* no track line */
   infoPtr->itemEdit.fEnabled = FALSE;
@@ -9774,14 +9798,10 @@ static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode,
 
 static LRESULT LISTVIEW_MouseWheel(LISTVIEW_INFO *infoPtr, INT wheelDelta)
 {
-    INT gcWheelDelta = 0;
-    INT pulScrollLines = 3;
+    UINT pulScrollLines = 3;
 
     TRACE("(wheelDelta=%d)\n", wheelDelta);
 
-    SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0);
-    gcWheelDelta -= wheelDelta;
-
     switch(infoPtr->uView)
     {
     case LV_VIEW_ICON:
@@ -9790,21 +9810,31 @@ static LRESULT LISTVIEW_MouseWheel(LISTVIEW_INFO *infoPtr, INT wheelDelta)
         *  listview should be scrolled by a multiple of 37 dependently on its dimension or its visible item number
         *  should be fixed in the future.
         */
-        LISTVIEW_VScroll(infoPtr, SB_INTERNAL, (gcWheelDelta < 0) ?
+        LISTVIEW_VScroll(infoPtr, SB_INTERNAL, (wheelDelta > 0) ?
                 -LISTVIEW_SCROLL_ICON_LINE_SIZE : LISTVIEW_SCROLL_ICON_LINE_SIZE);
         break;
 
     case LV_VIEW_DETAILS:
-        if (abs(gcWheelDelta) >= WHEEL_DELTA && pulScrollLines)
+        SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0);
+
+        /* if scrolling changes direction, ignore left overs */
+        if ((wheelDelta < 0 && infoPtr->cWheelRemainder < 0) ||
+            (wheelDelta > 0 && infoPtr->cWheelRemainder > 0))
+            infoPtr->cWheelRemainder += wheelDelta;
+        else
+            infoPtr->cWheelRemainder = wheelDelta;
+        if (infoPtr->cWheelRemainder && pulScrollLines)
         {
-            int cLineScroll = min(LISTVIEW_GetCountPerColumn(infoPtr), pulScrollLines);
-            cLineScroll *= (gcWheelDelta / WHEEL_DELTA);
-            LISTVIEW_VScroll(infoPtr, SB_INTERNAL, cLineScroll);
+            int cLineScroll;
+            pulScrollLines = min((UINT)LISTVIEW_GetCountPerColumn(infoPtr), pulScrollLines);
+            cLineScroll = pulScrollLines * (float)infoPtr->cWheelRemainder / WHEEL_DELTA;
+            infoPtr->cWheelRemainder -= WHEEL_DELTA * cLineScroll / (int)pulScrollLines;
+            LISTVIEW_VScroll(infoPtr, SB_INTERNAL, -cLineScroll);
         }
         break;
 
     case LV_VIEW_LIST:
-        LISTVIEW_HScroll(infoPtr, (gcWheelDelta < 0) ? SB_LINELEFT : SB_LINERIGHT, 0);
+        LISTVIEW_HScroll(infoPtr, (wheelDelta > 0) ? SB_LINELEFT : SB_LINERIGHT, 0);
         break;
     }
     return 0;
@@ -9931,7 +9961,10 @@ static LRESULT LISTVIEW_KillFocus(LISTVIEW_INFO *infoPtr)
 {
     TRACE("()\n");
 
-    /* if we did not have the focus, there's nothing to do */
+    /* drop any left over scroll amount */
+    infoPtr->cWheelRemainder = 0;
+
+    /* if we did not have the focus, there's nothing more to do */
     if (!infoPtr->bFocus) return 0;
    
     /* send NM_KILLFOCUS notification */
@@ -10004,6 +10037,52 @@ static LRESULT LISTVIEW_LButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, INT x,
     return 0;
 }
 
+static LRESULT LISTVIEW_TrackMouse(const LISTVIEW_INFO *infoPtr, POINT pt)
+{
+    MSG msg;
+    RECT r;
+
+    r.top = r.bottom = pt.y;
+    r.left = r.right = pt.x;
+
+    InflateRect(&r, GetSystemMetrics(SM_CXDRAG), GetSystemMetrics(SM_CYDRAG));
+
+    SetCapture(infoPtr->hwndSelf);
+
+    while (1)
+    {
+       if (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE | PM_NOYIELD))
+       {
+           if (msg.message == WM_MOUSEMOVE)
+           {
+               pt.x = (short)LOWORD(msg.lParam);
+               pt.y = (short)HIWORD(msg.lParam);
+               if (PtInRect(&r, pt))
+                   continue;
+               else
+               {
+                   ReleaseCapture();
+                   return 1;
+               }
+           }
+           else if (msg.message >= WM_LBUTTONDOWN &&
+                    msg.message <= WM_RBUTTONDBLCLK)
+           {
+               break;
+           }
+
+           DispatchMessageW(&msg);
+       }
+
+       if (GetCapture() != infoPtr->hwndSelf)
+           return 0;
+    }
+
+    ReleaseCapture();
+    return 0;
+}
+
+
 /***
  * DESCRIPTION:
  * Processes mouse down messages (left mouse button).
@@ -10257,9 +10336,9 @@ static LRESULT LISTVIEW_NCDestroy(LISTVIEW_INFO *infoPtr)
  * RETURN:
  * Zero
  */
-static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, const NMHDR *lpnmhdr)
+static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, NMHDR *lpnmhdr)
 {
-    const NMHEADERW *lpnmh;
+    NMHEADERW *lpnmh;
     
     TRACE("(lpnmhdr=%p)\n", lpnmhdr);
 
@@ -10267,7 +10346,7 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, const NMHDR *lpnmhdr)
 
     /* remember: HDN_LAST < HDN_FIRST */
     if (lpnmhdr->code > HDN_FIRST || lpnmhdr->code < HDN_LAST) return 0;
-    lpnmh = (const NMHEADERW *)lpnmhdr;
+    lpnmh = (NMHEADERW *)lpnmhdr;
 
     if (lpnmh->iItem < 0 || lpnmh->iItem >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return 0;
 
@@ -10292,26 +10371,25 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, const NMHDR *lpnmhdr)
             LISTVIEW_GetOrigin(infoPtr, &ptOrigin);
             infoPtr->xTrackLine = x + ptOrigin.x;
             LISTVIEW_DrawTrackLine(infoPtr);
-            break;
+            return notify_forward_header(infoPtr, lpnmh);
        }
-       
+
        case HDN_ENDTRACKA:
        case HDN_ENDTRACKW:
            /* remove the track line (if any) */
            LISTVIEW_DrawTrackLine(infoPtr);
            infoPtr->xTrackLine = -1;
-           break;
+            return notify_forward_header(infoPtr, lpnmh);
 
         case HDN_BEGINDRAG:
-            notify_forward_header(infoPtr, lpnmh);
-            return (infoPtr->dwLvExStyle & LVS_EX_HEADERDRAGDROP) == 0;
+            if ((infoPtr->dwLvExStyle & LVS_EX_HEADERDRAGDROP) == 0) return 1;
+            return notify_forward_header(infoPtr, lpnmh);
 
         case HDN_ENDDRAG:
             infoPtr->colRectsDirty = TRUE;
             LISTVIEW_InvalidateList(infoPtr);
-            notify_forward_header(infoPtr, lpnmh);
-            return FALSE;
-            
+            return notify_forward_header(infoPtr, lpnmh);
+
        case HDN_ITEMCHANGEDW:
        case HDN_ITEMCHANGEDA:
        {
@@ -10391,8 +10469,8 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, const NMHDR *lpnmhdr)
                    LISTVIEW_InvalidateRect(infoPtr, &rcCol);
                }
            }
-       }
-       break;
+           break;
+        }
 
        case HDN_ITEMCLICKW:
        case HDN_ITEMCLICKA:
@@ -10404,9 +10482,8 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, const NMHDR *lpnmhdr)
             nmlv.iItem = -1;
             nmlv.iSubItem = lpnmh->iItem;
             notify_listview(infoPtr, LVN_COLUMNCLICK, &nmlv);
-            notify_forward_header(infoPtr, lpnmh);
+            return notify_forward_header(infoPtr, lpnmh);
         }
-       break;
 
        case HDN_DIVIDERDBLCLICKW:
        case HDN_DIVIDERDBLCLICKA:
@@ -10414,10 +10491,8 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, const NMHDR *lpnmhdr)
                       we should use LVSCW_AUTOSIZE_USEHEADER, helper rework or
                       split needed for that */
             LISTVIEW_SetColumnWidth(infoPtr, lpnmh->iItem, LVSCW_AUTOSIZE);
-            notify_forward_header(infoPtr, lpnmh);
-            break;
+            return notify_forward_header(infoPtr, lpnmh);
     }
-
     return 0;
 }
 
@@ -10612,94 +10687,76 @@ static LRESULT LISTVIEW_RButtonDblClk(const LISTVIEW_INFO *infoPtr, WORD wKey, I
 
 /***
  * DESCRIPTION:
- * Processes mouse down messages (right mouse button).
+ * Processes WM_RBUTTONDOWN message and corresponding drag operation.
  *
  * PARAMETER(S):
  * [I] infoPtr : valid pointer to the listview structure
  * [I] wKey : key flag
- * [I] x,y : mouse coordinate
+ * [I] x, y : mouse coordinate
  *
  * RETURN:
  * Zero
  */
 static LRESULT LISTVIEW_RButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
 {
-    LVHITTESTINFO lvHitTestInfo;
-    INT nItem;
+    LVHITTESTINFO ht;
+    INT item;
 
-    TRACE("(key=%hu,X=%u,Y=%u)\n", wKey, x, y);
+    TRACE("(key=%hu, x=%d, y=%d)\n", wKey, x, y);
 
     /* send NM_RELEASEDCAPTURE notification */
     if (!notify(infoPtr, NM_RELEASEDCAPTURE)) return 0;
 
+    /* determine the index of the selected item */
+    ht.pt.x = x;
+    ht.pt.y = y;
+    item = LISTVIEW_HitTest(infoPtr, &ht, TRUE, TRUE);
+
     /* make sure the listview control window has the focus */
     if (!infoPtr->bFocus) SetFocus(infoPtr->hwndSelf);
 
-    /* set right button down flag */
-    infoPtr->bRButtonDown = TRUE;
-
-    /* determine the index of the selected item */
-    lvHitTestInfo.pt.x = x;
-    lvHitTestInfo.pt.y = y;
-    nItem = LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE);
-  
-    if ((nItem >= 0) && (nItem < infoPtr->nItemCount))
+    if ((item >= 0) && (item < infoPtr->nItemCount))
     {
-       LISTVIEW_SetItemFocus(infoPtr, nItem);
+       LISTVIEW_SetItemFocus(infoPtr, item);
        if (!((wKey & MK_SHIFT) || (wKey & MK_CONTROL)) &&
-            !LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED))
-           LISTVIEW_SetSelection(infoPtr, nItem);
+            !LISTVIEW_GetItemState(infoPtr, item, LVIS_SELECTED))
+           LISTVIEW_SetSelection(infoPtr, item);
     }
     else
-    {
        LISTVIEW_DeselectAll(infoPtr);
-    }
-
-    return 0;
-}
-
-/***
- * DESCRIPTION:
- * Processes mouse up messages (right mouse button).
- *
- * PARAMETER(S):
- * [I] infoPtr : valid pointer to the listview structure
- * [I] wKey : key flag
- * [I] x,y : mouse coordinate
- *
- * RETURN:
- * Zero
- */
-static LRESULT LISTVIEW_RButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
-{
-    LVHITTESTINFO lvHitTestInfo;
-    POINT pt;
 
-    TRACE("(key=%hu,X=%u,Y=%u)\n", wKey, x, y);
+    if (LISTVIEW_TrackMouse(infoPtr, ht.pt))
+    {
+       if (ht.iItem != -1)
+       {
+            NMLISTVIEW nmlv;
 
-    if (!infoPtr->bRButtonDown) return 0;
-    /* set button flag */
-    infoPtr->bRButtonDown = FALSE;
+            memset(&nmlv, 0, sizeof(nmlv));
+            nmlv.iItem = ht.iItem;
+            nmlv.ptAction = ht.pt;
 
-    /* Send NM_RCLICK notification */
-    lvHitTestInfo.pt.x = x;
-    lvHitTestInfo.pt.y = y;
-    LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, FALSE);
-    if (!notify_click(infoPtr, NM_RCLICK, &lvHitTestInfo)) return 0;
+            notify_listview(infoPtr, LVN_BEGINRDRAG, &nmlv);
+       }
+    }
+    else
+    {
+       SetFocus(infoPtr->hwndSelf);
 
-    /* Change to screen coordinate for WM_CONTEXTMENU */
-    pt = lvHitTestInfo.pt;
-    ClientToScreen(infoPtr->hwndSelf, &pt);
+        ht.pt.x = x;
+        ht.pt.y = y;
+        LISTVIEW_HitTest(infoPtr, &ht, TRUE, FALSE);
 
-    /* Send a WM_CONTEXTMENU message in response to the RBUTTONUP */
-    SendMessageW(infoPtr->hwndSelf, WM_CONTEXTMENU,
-                (WPARAM)infoPtr->hwndSelf, MAKELPARAM(pt.x, pt.y));
+       if (notify_click(infoPtr, NM_RCLICK, &ht))
+       {
+           /* Send a WM_CONTEXTMENU message in response to the WM_RBUTTONUP */
+           SendMessageW(infoPtr->hwndSelf, WM_CONTEXTMENU,
+               (WPARAM)infoPtr->hwndSelf, (LPARAM)GetMessagePos());
+       }
+    }
 
     return 0;
 }
 
-
 /***
  * DESCRIPTION:
  * Sets the cursor.
@@ -10782,6 +10839,7 @@ static LRESULT LISTVIEW_SetFocus(LISTVIEW_INFO *infoPtr, HWND hwndLoseFocus)
 static LRESULT LISTVIEW_SetFont(LISTVIEW_INFO *infoPtr, HFONT hFont, WORD fRedraw)
 {
     HFONT oldFont = infoPtr->hFont;
+    INT oldHeight = infoPtr->nItemHeight;
 
     TRACE("(hfont=%p,redraw=%hu)\n", hFont, fRedraw);
 
@@ -10790,12 +10848,16 @@ static LRESULT LISTVIEW_SetFont(LISTVIEW_INFO *infoPtr, HFONT hFont, WORD fRedra
     
     LISTVIEW_SaveTextMetrics(infoPtr);
 
+    infoPtr->nItemHeight = LISTVIEW_CalculateItemHeight(infoPtr);
+
     if (infoPtr->uView == LV_VIEW_DETAILS)
     {
        SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(fRedraw, 0));
         LISTVIEW_UpdateSize(infoPtr);
         LISTVIEW_UpdateScroll(infoPtr);
     }
+    else if (infoPtr->nItemHeight != oldHeight)
+        LISTVIEW_UpdateScroll(infoPtr);
 
     if (fRedraw) LISTVIEW_InvalidateList(infoPtr);
 
@@ -10973,7 +11035,6 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
 
     if (uNewView != uOldView)
     {
-       SIZE oldIconSize = infoPtr->iconSize;
        HIMAGELIST himl;
     
         SendMessageW(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0);
@@ -10984,17 +11045,8 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
 
         himl = (uNewView == LVS_ICON ? infoPtr->himlNormal : infoPtr->himlSmall);
         set_icon_size(&infoPtr->iconSize, himl, uNewView != LVS_ICON);
-    
-        if (uNewView == LVS_ICON)
-        {
-            if ((infoPtr->iconSize.cx != oldIconSize.cx) || (infoPtr->iconSize.cy != oldIconSize.cy))
-            {
-                TRACE("icon old size=(%d,%d), new size=(%d,%d)\n",
-                     oldIconSize.cx, oldIconSize.cy, infoPtr->iconSize.cx, infoPtr->iconSize.cy);
-               LISTVIEW_SetIconSpacing(infoPtr, 0, 0);
-            }
-        }
-        else if (uNewView == LVS_REPORT)
+
+        if (uNewView == LVS_REPORT)
         {
             HDLAYOUT hl;
             WINDOWPOS wp;
@@ -11425,7 +11477,9 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
     return LISTVIEW_SetHoverTime(infoPtr, (DWORD)lParam);
 
   case LVM_SETICONSPACING:
-    return LISTVIEW_SetIconSpacing(infoPtr, (short)LOWORD(lParam), (short)HIWORD(lParam));
+    if(lParam == -1)
+        return LISTVIEW_SetIconSpacing(infoPtr, -1, -1);
+    return LISTVIEW_SetIconSpacing(infoPtr, LOWORD(lParam), HIWORD(lParam));
 
   case LVM_SETIMAGELIST:
     return (LRESULT)LISTVIEW_SetImageList(infoPtr, (INT)wParam, (HIMAGELIST)lParam);
@@ -11588,9 +11642,6 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
   case WM_RBUTTONDOWN:
     return LISTVIEW_RButtonDown(infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
 
-  case WM_RBUTTONUP:
-    return LISTVIEW_RButtonUp(infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
-
   case WM_SETCURSOR:
     return LISTVIEW_SetCursor(infoPtr, wParam, lParam);
 
index a9b76d4..3dba540 100644 (file)
@@ -1076,7 +1076,8 @@ static void MONTHCAL_PaintFocusAndCircle(const MONTHCAL_INFO *infoPtr, HDC hdc,
 /* months before first calendar month and after last calendar month */
 static void MONTHCAL_PaintLeadTrailMonths(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps)
 {
-  INT mask, length, index;
+  INT mask, index;
+  UINT length;
   SYSTEMTIME st_max, st;
 
   if (infoPtr->dwStyle & MCS_NOTRAILINGDATES) return;
@@ -1116,7 +1117,8 @@ static void MONTHCAL_PaintLeadTrailMonths(const MONTHCAL_INFO *infoPtr, HDC hdc,
 static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx)
 {
   const SYSTEMTIME *date = &infoPtr->calendars[calIdx].month;
-  INT i, j, length;
+  INT i, j;
+  UINT length;
   RECT r, fill_bk_rect;
   SYSTEMTIME st;
   WCHAR buf[80];
index a1c5673..03b275f 100644 (file)
@@ -168,7 +168,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
                                 int index,
                                 int skipdir,
                                 HPROPSHEETPAGE hpage);
-static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo* psInfo);
+static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo* psInfo, int original_index);
 static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheetInfo* psInfo);
 static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID);
 static BOOL PROPSHEET_RemovePage(HWND hwndDlg, int index, HPROPSHEETPAGE hpage);
@@ -1998,9 +1998,8 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
   HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
 
   TRACE("index %d, skipdir %d, hpage %p\n", index, skipdir, hpage);
-  /* hpage takes precedence over index */
-  if (hpage != NULL)
-    index = PROPSHEET_GetPageIndex(hpage, psInfo);
+
+  index = PROPSHEET_GetPageIndex(hpage, psInfo, index);
 
   if (index < 0 || index >= psInfo->nPages)
   {
@@ -2331,13 +2330,8 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
   if (!psInfo) {
     return FALSE;
   }
-  /*
-   * hpage takes precedence over index.
-   */
-  if (hpage != 0)
-  {
-    index = PROPSHEET_GetPageIndex(hpage, psInfo);
-  }
+
+  index = PROPSHEET_GetPageIndex(hpage, psInfo, index);
 
   /* Make sure that index is within range */
   if (index < 0 || index >= psInfo->nPages)
@@ -2575,16 +2569,11 @@ static LRESULT PROPSHEET_IndexToHwnd(HWND hwndDlg, int iPageIndex)
  */
 static LRESULT PROPSHEET_PageToIndex(HWND hwndDlg, HPROPSHEETPAGE hPage)
 {
-    int index;
     PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
 
     TRACE("(%p, %p)\n", hwndDlg, hPage);
 
-    for (index = 0; index < psInfo->nPages; index++)
-        if (psInfo->proppage[index].hpage == hPage)
-            return index;
-    WARN("%p not found\n", hPage);
-    return -1;
+    return PROPSHEET_GetPageIndex(hPage, psInfo, -1);
 }
 
 /******************************************************************************
@@ -2660,26 +2649,20 @@ static BOOL PROPSHEET_RecalcPageSizes(HWND hwndDlg)
  *            PROPSHEET_GetPageIndex
  *
  * Given a HPROPSHEETPAGE, returns the index of the corresponding page from
- * the array of PropPageInfo.
+ * the array of PropPageInfo. If page is not found original index is used
+ * (page takes precedence over index).
  */
-static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo* psInfo)
+static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE page, const PropSheetInfo* psInfo, int original_index)
 {
-  BOOL found = FALSE;
-  int index = 0;
+    int index;
 
-  TRACE("hpage %p\n", hpage);
-  while ((index < psInfo->nPages) && (found == FALSE))
-  {
-    if (psInfo->proppage[index].hpage == hpage)
-      found = TRUE;
-    else
-      index++;
-  }
+    TRACE("page %p index %d\n", page, original_index);
 
-  if (found == FALSE)
-    index = -1;
+    for (index = 0; index < psInfo->nPages; index++)
+        if (psInfo->proppage[index].hpage == page)
+            return index;
 
-  return index;
+    return original_index;
 }
 
 /******************************************************************************
index 2dc99cd..592e382 100644 (file)
@@ -1123,7 +1123,7 @@ REBAR_MoveChildWindows (const REBAR_INFO *infoPtr, UINT start, UINT endplus)
  * or infoPtr->uNumBands if none */
 static int next_visible(const REBAR_INFO *infoPtr, int i)
 {
-    int n;
+    unsigned int n;
     for (n = i + 1; n < infoPtr->uNumBands; n++)
         if (!HIDDENBAND(REBAR_GetBand(infoPtr, n)))
             break;
index d16e163..45df803 100644 (file)
@@ -285,7 +285,6 @@ STATUSBAR_RefreshPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPA
 static LRESULT
 STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
 {
-    int      i;
     RECT   rect;
     HBRUSH hbrBk;
     HFONT  hOldFont;
@@ -319,6 +318,8 @@ STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
     if (infoPtr->simple) {
        STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->part0, 0);
     } else {
+        unsigned int i;
+
        for (i = 0; i < infoPtr->numParts; i++) {
            STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->parts[i], i);
        }
@@ -336,7 +337,8 @@ STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
 static int
 STATUSBAR_InternalHitTest(const STATUS_INFO *infoPtr, const POINT *pt)
 {
-    int i;
+    unsigned int i;
+
     if (infoPtr->simple)
         return 255;
 
@@ -352,7 +354,7 @@ STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr)
 {
     STATUSWINDOWPART *part;
     RECT rect, *r;
-    int        i;
+    UINT i;
 
     /* get our window size */
     GetClientRect (infoPtr->Self, &rect);
@@ -883,7 +885,7 @@ STATUSBAR_Simple (STATUS_INFO *infoPtr, BOOL simple)
 static LRESULT
 STATUSBAR_WMDestroy (STATUS_INFO *infoPtr)
 {
-    int        i;
+    unsigned int i;
 
     TRACE("\n");
     for (i = 0; i < infoPtr->numParts; i++) {
index 9923cdb..702694f 100644 (file)
@@ -5212,9 +5212,9 @@ TOOLBAR_Destroy (TOOLBAR_INFO *infoPtr)
     if (infoPtr->himlInt)
        ImageList_Destroy (infoPtr->himlInt);
 
-       TOOLBAR_DeleteImageList(&infoPtr->himlDef, &infoPtr->cimlDef);
-       TOOLBAR_DeleteImageList(&infoPtr->himlDis, &infoPtr->cimlDis);
-       TOOLBAR_DeleteImageList(&infoPtr->himlHot, &infoPtr->cimlHot);
+    TOOLBAR_DeleteImageList(&infoPtr->himlDef, &infoPtr->cimlDef);
+    TOOLBAR_DeleteImageList(&infoPtr->himlDis, &infoPtr->cimlDis);
+    TOOLBAR_DeleteImageList(&infoPtr->himlHot, &infoPtr->cimlHot);
 
     /* delete default font */
     DeleteObject (infoPtr->hDefaultFont);
index 34da653..a51fa35 100644 (file)
@@ -991,9 +991,17 @@ TOOLTIPS_CheckTool (const TOOLTIPS_INFO *infoPtr, BOOL bShowTest)
     if (nTool == -1)
        return -1;
 
-    if (!(GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TTS_ALWAYSTIP) && bShowTest) {
-       if (!TOOLTIPS_IsWindowActive (GetWindow (infoPtr->hwndSelf, GW_OWNER)))
-           return -1;
+    if (!(GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TTS_ALWAYSTIP) && bShowTest)
+    {
+        TTTOOL_INFO *ti = &infoPtr->tools[nTool];
+        HWND hwnd = (ti->uFlags & TTF_IDISHWND) ? (HWND)ti->uId : ti->hwnd;
+
+        if (!TOOLTIPS_IsWindowActive(hwnd))
+        {
+            TRACE("not active: hwnd %p, parent %p, active %p\n",
+                  hwnd, GetParent(hwnd), GetActiveWindow());
+            return -1;
+        }
     }
 
     TRACE("tool %d\n", nTool);
index 8dd0dca..d8a36ce 100644 (file)
@@ -102,6 +102,7 @@ typedef struct tagTREEVIEW_INFO
   BOOL          insertBeforeorAfter; /* flag used by TVM_SETINSERTMARK */
   HIMAGELIST    dragList;       /* Bitmap of dragged item */
   LONG          scrollX;
+  INT           wheelRemainder;
   COLORREF      clrBk;
   COLORREF      clrText;
   COLORREF      clrLine;
@@ -110,6 +111,7 @@ typedef struct tagTREEVIEW_INFO
   HFONT         hDefaultFont;
   HFONT         hBoldFont;
   HFONT         hUnderlineFont;
+  HFONT         hBoldUnderlineFont;
   HCURSOR       hcurHand;
   HWND          hwndToolTip;
 
@@ -303,11 +305,22 @@ TREEVIEW_CreateUnderlineFont(HFONT hOrigFont)
     return CreateFontIndirectW(&font);
 }
 
+static HFONT
+TREEVIEW_CreateBoldUnderlineFont(HFONT hfont)
+{
+    LOGFONTW font;
+
+    GetObjectW(hfont, sizeof(font), &font);
+    font.lfWeight = FW_BOLD;
+    font.lfUnderline = TRUE;
+    return CreateFontIndirectW(&font);
+}
+
 static inline HFONT
 TREEVIEW_FontForItem(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
 {
     if ((infoPtr->dwStyle & TVS_TRACKSELECT) && (item == infoPtr->hotItem))
-        return infoPtr->hUnderlineFont;
+        return item->state & TVIS_BOLD ? infoPtr->hBoldUnderlineFont : infoPtr->hUnderlineFont;
     if (item->state & TVIS_BOLD)
         return infoPtr->hBoldFont;
     return infoPtr->hFont;
@@ -1562,7 +1575,7 @@ TREEVIEW_DeleteItem(TREEVIEW_INFO *infoPtr, HTREEITEM item)
               newFirstVisible = item->prevSibling;
            else if (item->parent != infoPtr->root)
               newFirstVisible = item->parent;
-              TREEVIEW_SetFirstVisible(infoPtr, NULL, TRUE);
+           TREEVIEW_SetFirstVisible(infoPtr, NULL, TRUE);
        }
        else
            newFirstVisible = infoPtr->firstVisible;
@@ -1903,8 +1916,10 @@ TREEVIEW_SetFont(TREEVIEW_INFO *infoPtr, HFONT hFont, BOOL bRedraw)
 
     DeleteObject(infoPtr->hBoldFont);
     DeleteObject(infoPtr->hUnderlineFont);
+    DeleteObject(infoPtr->hBoldUnderlineFont);
     infoPtr->hBoldFont = TREEVIEW_CreateBoldFont(infoPtr->hFont);
     infoPtr->hUnderlineFont = TREEVIEW_CreateUnderlineFont(infoPtr->hFont);
+    infoPtr->hBoldUnderlineFont = TREEVIEW_CreateBoldUnderlineFont(infoPtr->hFont);
 
     if (!infoPtr->bHeightSet)
        infoPtr->uItemHeight = TREEVIEW_NaturalHeight(infoPtr);
@@ -3155,10 +3170,10 @@ TREEVIEW_Sort(TREEVIEW_INFO *infoPtr, HTREEITEM parent,
        {
            int visOrder = infoPtr->firstVisible->visibleOrder;
 
-        if (parent == infoPtr->root)
-            TREEVIEW_RecalculateVisibleOrder(infoPtr, NULL);
-        else
-            TREEVIEW_RecalculateVisibleOrder(infoPtr, parent);
+           if (parent == infoPtr->root)
+               TREEVIEW_RecalculateVisibleOrder(infoPtr, NULL);
+           else
+               TREEVIEW_RecalculateVisibleOrder(infoPtr, parent);
 
            if (TREEVIEW_IsChildOf(parent, infoPtr->firstVisible))
            {
@@ -4916,7 +4931,7 @@ scroll:
 static LRESULT
 TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
 {
-    short gcWheelDelta;
+    short wheelDelta;
     UINT pulScrollLines = 3;
 
     if (wParam & (MK_SHIFT | MK_CONTROL))
@@ -4927,13 +4942,25 @@ TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
 
     SystemParametersInfoW(SPI_GETWHEELSCROLLLINES, 0, &pulScrollLines, 0);
 
-    gcWheelDelta = -(short)HIWORD(wParam);
-    pulScrollLines *= (gcWheelDelta / WHEEL_DELTA);
+    wheelDelta = GET_WHEEL_DELTA_WPARAM(wParam);
+    /* if scrolling changes direction, ignore left overs */
+    if ((wheelDelta < 0 && infoPtr->wheelRemainder < 0) ||
+        (wheelDelta > 0 && infoPtr->wheelRemainder > 0))
+        infoPtr->wheelRemainder += wheelDelta;
+    else
+        infoPtr->wheelRemainder = wheelDelta;
 
-    if (abs(gcWheelDelta) >= WHEEL_DELTA && pulScrollLines)
+    if (infoPtr->wheelRemainder && pulScrollLines)
     {
-       int newDy = infoPtr->firstVisible->visibleOrder + pulScrollLines;
-       int maxDy = infoPtr->maxVisibleOrder;
+       int newDy;
+       int maxDy;
+       int lineScroll;
+
+       lineScroll = pulScrollLines * (float)infoPtr->wheelRemainder / WHEEL_DELTA;
+       infoPtr->wheelRemainder -= WHEEL_DELTA * lineScroll / (int)pulScrollLines;
+
+       newDy = infoPtr->firstVisible->visibleOrder - lineScroll;
+       maxDy = infoPtr->maxVisibleOrder;
 
        if (newDy > maxDy)
            newDy = maxDy;
@@ -5038,6 +5065,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
     /* dragList */
 
     infoPtr->scrollX = 0;
+    infoPtr->wheelRemainder = 0;
 
     infoPtr->clrBk   = CLR_NONE; /* use system color */
     infoPtr->clrText = CLR_NONE; /* use system color */
@@ -5064,6 +5092,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
     infoPtr->hFont = infoPtr->hDefaultFont = CreateFontIndirectW(&lf);
     infoPtr->hBoldFont = TREEVIEW_CreateBoldFont(infoPtr->hFont);
     infoPtr->hUnderlineFont = TREEVIEW_CreateUnderlineFont(infoPtr->hFont);
+    infoPtr->hBoldUnderlineFont = TREEVIEW_CreateBoldUnderlineFont(infoPtr->hFont);
     infoPtr->hcurHand = LoadCursorW(NULL, (LPWSTR)IDC_HAND);
 
     infoPtr->uItemHeight = TREEVIEW_NaturalHeight(infoPtr);
@@ -5123,6 +5152,7 @@ TREEVIEW_Destroy(TREEVIEW_INFO *infoPtr)
     DeleteObject(infoPtr->hDefaultFont);
     DeleteObject(infoPtr->hBoldFont);
     DeleteObject(infoPtr->hUnderlineFont);
+    DeleteObject(infoPtr->hBoldUnderlineFont);
     Free(infoPtr);
 
     return 0;
index d3be289..3216226 100644 (file)
@@ -1026,10 +1026,10 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
 
             if (TRACE_ON(updown))
             {
-                INT i;
+                UINT i;
 
                 for (i = 0; i < wParam; i++)
-                    TRACE("%d: nSec %u nInc %u\n", i,
+                    TRACE("%u: nSec %u nInc %u\n", i,
                         infoPtr->AccelVect[i].nSec, infoPtr->AccelVect[i].nInc);
             }
 
index ac43249..d578b68 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id: hwpage.c 19599 2005-11-26 02:12:58Z weiden $
- *
+/*
  * PROJECT:         ReactOS devmgr.dll
  * FILE:            lib/devmgr/devprblm.c
  * PURPOSE:         ReactOS Device Manager
index 794725f..82ee053 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS devmgr.dll
  * FILE:            lib/devmgr/hwpage.c
  * PURPOSE:         ReactOS Device Manager
index a4a70c5..550ea9f 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id: devmgr.c 12852 2005-01-06 13:58:04Z mf $
- *
+/*
  * PROJECT:         ReactOS devmgr.dll
  * FILE:            lib/devmgr/misc.c
  * PURPOSE:         ReactOS Device Manager
index 7e8a2b9..62fd2c5 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: $
- *
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             subsys/system/dhcp/api.c
index d9ac7db..aff1812 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: $
- *
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             subsys/system/dhcp/pipe.c
index bd693d7..ea9aeab 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS Hid User Library
  * FILE:            lib/hid/hid.c
  * PURPOSE:         ReactOS Hid User Library
index abd58df..ecb87f7 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Hid User Library
  * FILE:            lib/hid/stubs.c
index 3f4caea..568748a 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "ReactOS IP Route Priority API DLL\0"
index 19be52f..bf6c991 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: dosdev.c 54326 2011-11-07 00:18:13Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/dosdev.c
index cbc3b1e..8948980 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: environ.c 54459 2011-11-20 17:00:39Z pschweitzer $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/misc/env.c
index 4dc0eaf..9e6e63c 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: except.c 57269 2012-09-11 03:50:20Z mnordell $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/misc/except.c
index 8162d51..14b4b81 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: backup.c 48475 2010-08-07 05:02:58Z sir_richard $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/backup.c
index 2bc7d97..eb28c5c 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: cnotify.c 55801 2012-02-21 23:27:45Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/find.c
index b123cce..47b8199 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: copy.c 55885 2012-02-27 17:10:44Z sir_richard $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/copy.c
index af2d0b7..5ee7513 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: create.c 54326 2011-11-07 00:18:13Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/create.c
index c31ff8e..11840a4 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: delete.c 56650 2012-05-23 16:51:22Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/delete.c
index b99a436..52a5342 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: dir.c 55866 2012-02-25 21:09:28Z khornicek $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/client/file/dir.c
index 392347a..a7486c6 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: fileinfo.c 54326 2011-11-07 00:18:13Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/file.c
index b4a43a6..dc1e8a5 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: hardlink.c 55790 2012-02-21 19:18:57Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            dll/win32/kernel32/client/file/hardlink.c
index 4d77889..0ee9800 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: iocompl.c 55793 2012-02-21 21:31:01Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/iocompl.c
index abfed12..904e1e2 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: lfile.c 48475 2010-08-07 05:02:58Z sir_richard $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/lfile.c
index 2b71e4e..708b633 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: lock.c 55795 2012-02-21 21:38:08Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            dll/win32/kernel32/file/lock.c
index d9875c3..a6b22d6 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: mailslot.c 55791 2012-02-21 19:19:44Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/mailslot.c
index 87fbc2f..8ddd4bb 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: move.c 54326 2011-11-07 00:18:13Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/file.c
index 69661da..82dc7ca 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: rw.c 54326 2011-11-07 00:18:13Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/rw.c
index 37c3066..b0642e8 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: tape.c 54334 2011-11-07 07:41:52Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/tape.c
index 6b3b4ac..3759e1e 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: volume.c 52819 2011-07-23 18:54:29Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/file/volume.c
index 6baf5da..e5a20c0 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: job.c 54306 2011-11-06 00:09:33Z pschweitzer $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/process/job.c
index ff729d2..44516d4 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: time.c 52770 2011-07-22 02:13:57Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/misc/time.c
index 1f22104..0eae03b 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: toolhelp.c 54071 2011-10-10 12:14:12Z tfaber $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            dll/win32/kernel32/misc/toolhelp.c
index c24f3e0..eb4b4d2 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: lzexpand.c 52854 2011-07-24 23:42:09Z ion $
- * 
+/* 
  * LZ Decompression functions
  *
  * Copyright 1996 Marcus Meissner
index 2f12caa..45a1b87 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: muldiv.c 37829 2008-12-03 17:33:13Z dgorbachev $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            dll/win32/kernel32/misc/muldiv.c
index 6ffc578..ae0e053 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: timezone.c 52819 2011-07-23 18:54:29Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/kernel32/misc/time.c
index 7a90818..8bfc515 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: nls.c 52854 2011-07-24 23:42:09Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            dll/win32/kernel32/misc/nls.c
index c74604d..0b9b17b 100644 (file)
@@ -293,8 +293,7 @@ LsapCreateDatabaseObjects(VOID)
     if (!NT_SUCCESS(Status))
         goto done;
 
-    Status = LsapCreatePolicySd(&PolicySd,
-                                &PolicySdSize);
+    Status = LsapCreatePolicySd(&PolicySd, &PolicySdSize);
     if (!NT_SUCCESS(Status))
         goto done;
 
@@ -356,7 +355,7 @@ LsapCreateDatabaseObjects(VOID)
     /* Set the audit events attribute */
     LsapSetObjectAttribute(PolicyObject,
                            L"PolAdtEv",
-                           &AuditEventsInfo,
+                           AuditEventsInfo,
                            AuditEventsSize);
 
     /* Set the DNS Domain Name attribute */
@@ -990,7 +989,8 @@ LsapSetObjectAttribute(PLSA_DB_OBJECT DbObject,
                          NULL);
     if (!NT_SUCCESS(Status))
     {
-
+        ERR("NtCreateKey failed for '%S' with status 0x%lx\n", 
+            AttributeName, Status);
         return Status;
     }
 
@@ -1001,6 +1001,12 @@ LsapSetObjectAttribute(PLSA_DB_OBJECT DbObject,
 
     NtClose(AttributeKey);
 
+    if (!NT_SUCCESS(Status))
+    {
+        ERR("RtlpNtSetValueKey failed for '%S' with status 0x%lx\n", 
+            AttributeName, Status);
+    }
+
     return Status;
 }
 
index 581991b..19fd551 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS msgina.dll
  * FILE:            lib/msgina/stubs.c
index 23ca3b7..db1d101 100644 (file)
 # stub _snprintf_c
 # stub _snprintf_c_l
 # stub _snprintf_l
-# stub _snprintf_s
+@ varargs _snprintf_s(ptr long long ptr)
 # stub _snprintf_s_l
 # stub _snscanf
 # stub _snscanf_l
 # stub _snscanf_s_l
 @ varargs _snwprintf(ptr long wstr)
 # stub _snwprintf_l
-# stub _snwprintf_s
+@ varargs _snwprintf_s(ptr long long ptr)
 # stub _snwprintf_s_l
 # stub _snwscanf
 # stub _snwscanf_l
 @ cdecl _spawnvp(long str ptr)
 @ cdecl _spawnvpe(long str ptr ptr)
 @ cdecl _splitpath(str ptr ptr ptr ptr)
-# stub _splitpath_s
+@ cdecl _splitpath_s(str ptr long ptr long ptr long ptr long)
 # stub _sprintf_l
 # stub _sprintf_p_l
 # stub _sprintf_s_l
 @ cdecl _vsnprintf_c(ptr long str ptr) _vsnprintf
 # @ cdecl _vsnprintf_c_l(ptr long str ptr ptr) _vsnprintf_l
 # @ cdecl _vsnprintf_l(ptr long str ptr ptr)
-@ cdecl _vsnprintf_s(ptr long long str ptr)
+@ cdecl _vsnprintf_s(ptr long long str ptr)
 # @ cdecl _vsnprintf_s_l(ptr long long str ptr ptr)
 @ cdecl _vsnwprintf(ptr long wstr ptr)
 # @ cdecl _vsnwprintf_l(ptr long wstr ptr ptr)
-@ cdecl _vsnwprintf_s(ptr long long wstr ptr)
+@ cdecl _vsnwprintf_s(ptr long long wstr ptr)
 # @ cdecl _vsnwprintf_s_l(ptr long long wstr ptr ptr)
 # stub _vsprintf_l
 @ cdecl _vsprintf_p(ptr long str ptr)
 @ cdecl _wspawnvp(long wstr ptr)
 @ cdecl _wspawnvpe(long wstr ptr ptr)
 @ cdecl _wsplitpath(wstr ptr ptr ptr ptr)
-@ cdecl _wsplitpath_s(wstr ptr long ptr long ptr long ptr long)
+@ cdecl _wsplitpath_s(wstr ptr long ptr long ptr long ptr long)
 @ cdecl _wstat(wstr ptr)
 @ cdecl _wstati64(wstr ptr)
 @ cdecl _wstat64(wstr ptr)
 @ cdecl -arch=x86_64 sinf(long)
 @ cdecl sinh(double)
 @ varargs sprintf(ptr str)
-@ varargs sprintf_s(ptr long str)
+@ varargs sprintf_s(ptr long str)
 @ cdecl sqrt(double)
 @ cdecl -arch=x86_64 sqrtf(long)
 @ cdecl srand(long)
 @ cdecl strtoul(str ptr long)
 @ cdecl strxfrm(ptr str long)
 @ varargs swprintf(ptr wstr)
-@ varargs swprintf_s(ptr long wstr)
+@ varargs swprintf_s(ptr long wstr)
 @ varargs swscanf(wstr wstr)
 # @ varargs swscanf_s(wstr wstr)
 @ cdecl system(str)
 @ cdecl vprintf_s(str ptr)
 # stub vsnprintf
 @ cdecl vsprintf(ptr str ptr)
-@ cdecl vsprintf_s(ptr long str ptr)
+@ cdecl vsprintf_s(ptr long str ptr)
 @ cdecl vswprintf(ptr wstr ptr)
-@ cdecl vswprintf_s(ptr long wstr ptr)
+@ cdecl vswprintf_s(ptr long wstr ptr)
 @ cdecl vwprintf(wstr ptr)
 @ cdecl vwprintf_s(wstr ptr)
 # stub wcrtomb
index acb7ba0..3064267 100644 (file)
@@ -1,10 +1,9 @@
-/* $Id: stubs.c 12852 2005-01-06 13:58:04Z mf $
- *
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock DLL
- * FILE:        stubs.c
- * PURPOSE:     WSAIoctl wrappers for Microsoft extensions to Winsock
- * PROGRAMMERS: KJK::Hyperion <hackbunny@reactos.com>
+/*
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS WinSock DLL
+ * FILE:            stubs.c
+ * PURPOSE:         WSAIoctl wrappers for Microsoft extensions to Winsock
+ * PROGRAMMERS:     KJK::Hyperion <hackbunny@reactos.com>
  * REVISIONS:
  */
 
index fe74b00..7661bee 100644 (file)
@@ -1,10 +1,9 @@
-/* $Id$
- *
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock DLL
- * FILE:        stubs.c
- * PURPOSE:     Stub functions
- * PROGRAMMERS: Ge van Geldorp (ge@gse.nl)
+/*
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS WinSock DLL
+ * FILE:            stubs.c
+ * PURPOSE:         Stub functions
+ * PROGRAMMERS:     Ge van Geldorp (ge@gse.nl)
  * REVISIONS:
  */
 
index 251b6f5..e45f1e5 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id: ntmarta.c 31176 2007-12-12 07:04:12Z weiden $
- *
+/*
  * PROJECT:         ReactOS MARTA provider
  * FILE:            lib/ntmarta/ntmarta.c
  * PURPOSE:         ReactOS MARTA provider
index 91579d6..8d6245b 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
-*/
 /*
  * epsapi.h
  *
index 089019e..49357e6 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 /*
  * COPYRIGHT:   None
  * LICENSE:     Public domain
index 03734a9..12a3ba0 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 /*
  * COPYRIGHT:   See COPYING in the top level directory
  * LICENSE:     See LGPL.txt in the top level directory
index e790d30..4e66ceb 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS system libraries
  * PURPOSE:           SAM interface library
index 74122ac..9225a87 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS system libraries
  * PURPOSE:           SAM interface library
index 101748a..0639b26 100644 (file)
@@ -8,6 +8,7 @@ add_rpc_files(server ${REACTOS_SOURCE_DIR}/include/reactos/idl/sam.idl)
 spec2def(samsrv.dll samsrv.spec ADD_IMPORTLIB)
 
 list(APPEND SOURCE
+    alias.c
     database.c
     domain.c
     group.c
diff --git a/dll/win32/samsrv/alias.c b/dll/win32/samsrv/alias.c
new file mode 100644 (file)
index 0000000..96e70c8
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * PROJECT:     Local Security Authority Server DLL
+ * LICENSE:     GPL - See COPYING in the top level directory
+ * FILE:        dll/win32/samsrv/alias.c
+ * PURPOSE:     Alias specific helper functions
+ * COPYRIGHT:   Copyright 2013 Eric Kohl
+ */
+
+/* INCLUDES ****************************************************************/
+
+#include "samsrv.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(samsrv);
+
+
+/* FUNCTIONS ***************************************************************/
+
+NTSTATUS
+SampOpenAliasObject(IN PSAM_DB_OBJECT DomainObject,
+                    IN ULONG AliasId,
+                    IN ACCESS_MASK DesiredAccess,
+                    OUT PSAM_DB_OBJECT *AliasObject)
+{
+    WCHAR szRid[9];
+
+    TRACE("(%p %lu %lx %p)\n",
+          DomainObject, AliasId, DesiredAccess, AliasObject);
+
+    /* Convert the RID into a string (hex) */
+    swprintf(szRid, L"%08lX", AliasId);
+
+    /* Create the user object */
+    return SampOpenDbObject(DomainObject,
+                            L"Aliases",
+                            szRid,
+                            AliasId,
+                            SamDbAliasObject,
+                            DesiredAccess,
+                            AliasObject);
+}
+
+/* EOF */
index 3d2a882..fc459a0 100644 (file)
@@ -210,7 +210,7 @@ SampCreateDbObject(IN PSAM_DB_OBJECT ParentObject,
     }
 
     NewObject = RtlAllocateHeap(RtlGetProcessHeap(),
-                                0,
+                                HEAP_ZERO_MEMORY,
                                 sizeof(SAM_DB_OBJECT));
     if (NewObject == NULL)
     {
@@ -243,6 +243,9 @@ SampCreateDbObject(IN PSAM_DB_OBJECT ParentObject,
     NewObject->RelativeId = RelativeId;
     NewObject->ParentObject = ParentObject;
 
+    if (ParentObject != NULL)
+        NewObject->Trusted = ParentObject->Trusted;
+
     *DbObject = NewObject;
 
     return STATUS_SUCCESS;
@@ -359,7 +362,7 @@ SampOpenDbObject(IN PSAM_DB_OBJECT ParentObject,
     }
 
     NewObject = RtlAllocateHeap(RtlGetProcessHeap(),
-                                0,
+                                HEAP_ZERO_MEMORY,
                                 sizeof(SAM_DB_OBJECT));
     if (NewObject == NULL)
     {
@@ -391,6 +394,9 @@ SampOpenDbObject(IN PSAM_DB_OBJECT ParentObject,
     NewObject->RelativeId = RelativeId;
     NewObject->ParentObject = ParentObject;
 
+    if (ParentObject != NULL)
+        NewObject->Trusted = ParentObject->Trusted;
+
     *DbObject = NewObject;
 
     return STATUS_SUCCESS;
index 4b1ab71..9bf0c86 100644 (file)
@@ -15,6 +15,30 @@ WINE_DEFAULT_DEBUG_CHANNEL(samsrv);
 
 /* FUNCTIONS ***************************************************************/
 
+NTSTATUS
+SampOpenGroupObject(IN PSAM_DB_OBJECT DomainObject,
+                    IN ULONG GroupId,
+                    IN ACCESS_MASK DesiredAccess,
+                    OUT PSAM_DB_OBJECT *GroupObject)
+{
+    WCHAR szRid[9];
+
+    TRACE("(%p %lu %lx %p)\n",
+          DomainObject, GroupId, DesiredAccess, GroupObject);
+
+    /* Convert the RID into a string (hex) */
+    swprintf(szRid, L"%08lX", GroupId);
+
+    /* Create the user object */
+    return SampOpenDbObject(DomainObject,
+                            L"Groups",
+                            szRid,
+                            GroupId,
+                            SamDbGroupObject,
+                            DesiredAccess,
+                            GroupObject);
+}
+
 
 NTSTATUS
 SampAddMemberToGroup(IN PSAM_DB_OBJECT GroupObject,
index ead3344..24892e5 100644 (file)
@@ -57,6 +57,8 @@ static GENERIC_MAPPING UserMapping =
     USER_ALL_ACCESS
 };
 
+PGENERIC_MAPPING pServerMapping = &ServerMapping;
+
 
 /* FUNCTIONS *****************************************************************/
 
@@ -203,8 +205,23 @@ NTSTATUS
 NTAPI
 SamrShutdownSamServer(IN SAMPR_HANDLE ServerHandle)
 {
-    UNIMPLEMENTED;
-    return STATUS_NOT_IMPLEMENTED;
+    PSAM_DB_OBJECT ServerObject;
+    NTSTATUS Status;
+
+    TRACE("(%p)\n", ServerHandle);
+
+    /* Validate the server handle */
+    Status = SampValidateDbObject(ServerHandle,
+                                  SamDbServerObject,
+                                  SAM_SERVER_SHUTDOWN,
+                                  &ServerObject);
+    if (!NT_SUCCESS(Status))
+        return Status;
+
+    /* Shut the server down */
+    RpcMgmtStopServerListening(0);
+
+    return STATUS_SUCCESS;
 }
 
 
@@ -6043,14 +6060,19 @@ done:
 }
 
 
-static NTSTATUS
+static
+NTSTATUS
 SampQueryUserInternal1(PSAM_DB_OBJECT UserObject,
-                      PSAMPR_USER_INFO_BUFFER *Buffer)
+                       PSAMPR_USER_INFO_BUFFER *Buffer)
 {
     PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
     ULONG Length = 0;
     NTSTATUS Status = STATUS_SUCCESS;
 
+    /* Fail, if the caller is not a trusted caller */
+    if (UserObject->Trusted == FALSE)
+        return STATUS_INVALID_INFO_CLASS;
+
     *Buffer = NULL;
 
     InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
index c78cfb8..59d5b87 100644 (file)
@@ -25,6 +25,43 @@ WINE_DEFAULT_DEBUG_CHANNEL(samsrv);
 
 /* FUNCTIONS ****************************************************************/
 
+NTSTATUS
+NTAPI
+SamIConnect(IN PSAMPR_SERVER_NAME ServerName,
+            OUT SAMPR_HANDLE *ServerHandle,
+            IN ACCESS_MASK DesiredAccess,
+            IN BOOLEAN Trusted)
+{
+    PSAM_DB_OBJECT ServerObject;
+    NTSTATUS Status;
+
+    TRACE("SamIConnect(%p %p %lx %ld)\n",
+          ServerName, ServerHandle, DesiredAccess, Trusted);
+
+    /* Map generic access rights */
+    RtlMapGenericMask(&DesiredAccess,
+                      pServerMapping);
+
+    /* Open the Server Object */
+    Status = SampOpenDbObject(NULL,
+                              NULL,
+                              L"SAM",
+                              0,
+                              SamDbServerObject,
+                              DesiredAccess,
+                              &ServerObject);
+    if (NT_SUCCESS(Status))
+    {
+        ServerObject->Trusted = Trusted;
+        *ServerHandle = (SAMPR_HANDLE)ServerObject;
+    }
+
+    TRACE("SamIConnect done (Status 0x%08lx)\n", Status);
+
+    return Status;
+}
+
+
 NTSTATUS
 NTAPI
 SamIInitialize(VOID)
@@ -64,6 +101,20 @@ SampInitializeRegistry(VOID)
 }
 
 
+VOID
+NTAPI
+SamIFree_SAMPR_PSID_ARRAY(PSAMPR_PSID_ARRAY Ptr)
+{
+    if (Ptr != NULL)
+    {
+        if (Ptr->Sids !=0)
+        {
+            MIDL_user_free(Ptr->Sids);
+        }
+    }
+}
+
+
 VOID
 NTAPI
 SamIFree_SAMPR_RETURNED_USTRING_ARRAY(PSAMPR_RETURNED_USTRING_ARRAY Ptr)
index a9bc13e..672211b 100644 (file)
@@ -50,6 +50,7 @@ typedef struct _SAM_DB_OBJECT
     HANDLE KeyHandle;
     HANDLE MembersKeyHandle;  // only used by Aliases
     ULONG RelativeId;
+    BOOLEAN Trusted;
     struct _SAM_DB_OBJECT *ParentObject;
 } SAM_DB_OBJECT, *PSAM_DB_OBJECT;
 
@@ -68,11 +69,11 @@ typedef struct _SAM_DOMAIN_FIXED_DATA
     ULONG Reserved;
     LARGE_INTEGER CreationTime;
     LARGE_INTEGER DomainModifiedCount;
-    LARGE_INTEGER MaxPasswordAge;
-    LARGE_INTEGER MinPasswordAge;
-    LARGE_INTEGER ForceLogoff;
-    LARGE_INTEGER LockoutDuration;
-    LARGE_INTEGER LockoutObservationWindow;
+    LARGE_INTEGER MaxPasswordAge;               /* relative Time */
+    LARGE_INTEGER MinPasswordAge;               /* relative Time */
+    LARGE_INTEGER ForceLogoff;                  /* relative Time */
+    LARGE_INTEGER LockoutDuration;              /* relative Time */
+    LARGE_INTEGER LockoutObservationWindow;     /* relative Time */
     LARGE_INTEGER ModifiedCountAtLastPromotion;
     ULONG NextRid;
     ULONG PasswordProperties;
@@ -113,6 +114,18 @@ typedef struct _SAM_USER_FIXED_DATA
 } SAM_USER_FIXED_DATA, *PSAM_USER_FIXED_DATA;
 
 
+extern PGENERIC_MAPPING pServerMapping;
+
+
+/* alias.c */
+
+NTSTATUS
+SampOpenAliasObject(IN PSAM_DB_OBJECT DomainObject,
+                    IN ULONG AliasId,
+                    IN ACCESS_MASK DesiredAccess,
+                    OUT PSAM_DB_OBJECT *AliasObject);
+
+
 /* database.c */
 
 NTSTATUS
@@ -188,6 +201,12 @@ SampCheckAccountNameInDomain(IN PSAM_DB_OBJECT DomainObject,
 
 /* group.h */
 
+NTSTATUS
+SampOpenGroupObject(IN PSAM_DB_OBJECT DomainObject,
+                    IN ULONG GroupId,
+                    IN ACCESS_MASK DesiredAccess,
+                    OUT PSAM_DB_OBJECT *GroupObject);
+
 NTSTATUS
 SampAddMemberToGroup(IN PSAM_DB_OBJECT GroupObject,
                      IN ULONG MemberId);
@@ -297,6 +316,9 @@ SampSetUserGroupAttributes(IN PSAM_DB_OBJECT DomainObject,
                            IN ULONG GroupId,
                            IN ULONG GroupAttributes);
 
+NTSTATUS
+SampRemoveUserFromAllGroups(IN PSAM_DB_OBJECT UserObject);
+
 NTSTATUS
 SampSetUserPassword(IN PSAM_DB_OBJECT UserObject,
                     IN PENCRYPTED_NT_OWF_PASSWORD NtPassword,
index a6c9e5a..e4ae0d2 100644 (file)
@@ -1,7 +1,22 @@
 @ stub SamIAccountRestrictions
-@ stub SamIConnect
+@ stub SamIAddDSNameToAlias
+@ stub SamIAddDSNameToGroup
+@ stub SamIAmIGC
+@ stub SamIChangePasswordForeignUser
+@ stub SamIChangePasswordForeignUser2
+@ stdcall SamIConnect(ptr ptr long long)
 @ stub SamICreateAccountByRid
+@ stub SamIDemote
+@ stub SamIDemoteUndo
+@ stub SamIDoFSMORoleChange
+@ stub SamIDsCreateObjectInDomain
+@ stub SamIDsSetObjectInformation
 @ stub SamIEnumerateAccountRids
+@ stub SamIEnumerateInterdomainTrustAccountsForUpgrade
+@ stub SamIFloatingSingleMasterOpEx
+@ stub SamIFreeSidAndAttributesList
+@ stub SamIFreeSidArray
+@ stub SamIFreeVoid
 @ stub SamIFree_SAMPR_ALIAS_INFO_BUFFER
 @ stub SamIFree_SAMPR_DISPLAY_INFO_BUFFER
 @ stub SamIFree_SAMPR_DOMAIN_INFO_BUFFER
 @ stub SamIFree_SAMPR_GET_GROUPS_BUFFER
 @ stub SamIFree_SAMPR_GET_MEMBERS_BUFFER
 @ stub SamIFree_SAMPR_GROUP_INFO_BUFFER
-@ stub SamIFree_SAMPR_PSID_ARRAY
+@ stdcall SamIFree_SAMPR_PSID_ARRAY(ptr)
 @ stdcall SamIFree_SAMPR_RETURNED_USTRING_ARRAY(ptr)
 @ stub SamIFree_SAMPR_SR_SECURITY_DESCRIPTOR
 @ stdcall SamIFree_SAMPR_ULONG_ARRAY(ptr)
 @ stub SamIFree_SAMPR_USER_INFO_BUFFER
+@ stub SamIFree_UserInternal6Information
+@ stub SamIGCLookupNames
+@ stub SamIGCLookupSids
+@ stub SamIGetAliasMembership
+@ stub SamIGetBootKeyInformation
+@ stub SamIGetDefaultAdministratorName
+@ stub SamIGetFixedAttributes
+@ stub SamIGetinterdomainTrustAccountPasswordsForUpgrade
 @ stub SamIGetPrivateData
+@ stub SamIGetResourceGroupmembershipsTransitive
 @ stub SamIGetSerialNumberDomain
+@ stub SamIGetuserLogonInformation
+@ stub SamIGetuserLogonInformation2
+@ stub SamIGetuserLogonInformationEx
+@ stub SamIImpersonateNullSession
+@ stub SamIIncrementPerformanceCounter
 @ stdcall SamIInitialize()
+@ stub SamIIsDownlevelDcUpgrade
+@ stub SamIIsExtendedSidMode
+@ stub SamIIsRebootAfterPromotion
+@ stub SamIIsSetupInProgress
+@ stub SamILoadDownlevelDatabase
+@ stub SamILoopbackConnect
+@ stub SamIMixedDomain
+@ stub SamIMixedDomain2
+@ stub SamINT4UpgradeInProgress
+@ stub SamINetLogonPing
 @ stub SamINotifyDelta
+@ stub SamINotifyRoleChange
+@ stub SamINotifyServerDelta
+@ stub SamIOpenAccount
+@ stub SamIOpenUserByAlternateId
+@ stub SamIPromote
+@ stub SamIPromoteUndo
+@ stub SamIQueryServerRole
+@ stub SamIQueryServerRole2
+@ stub SamIRemoveDSNameFromAlias
+@ stub SamIRemoveDSNameFromGroup
+@ stub SamIRelaceDownlevelDatabase
+@ stub SamIResetBadPwdCountOnPdc
+@ stub SamIRetrievePrimaryCredentials
+@ stub SamIRevertNullSession
+@ stub SamISameSite
 @ stub SamISetAuditingInformation
+@ stub SamISetMixedDomainFlag
+@ stub SamISetPasswordForeignUser
+@ stub SamISetPasswordForeignUser2
+@ stub SamISetPasswordInfoOnPdc
 @ stub SamISetPrivateData
 @ stub SamISetSerialNumberDomain
+@ stub SamIStorePrimaryCredentials
+@ stub SamIUPNFromUserHandle
+@ stub SamIUnLoadDownlevelDatabase
+@ stub SamIUpdateLogonStatistics
+@ stub SampAbortSingleLoopbackTask
+@ stub SampAccountControlToFlags
+@ stub SampAcquireSamLockExclusive
+@ stub SampAcquireWriteLock
+@ stub SampCommitBufferedWrites
+@ stub SampConvertNt4SdToNt5Sd
+@ stub SampDsChangePasswordUser
+@ stub SampFlagsToAccountControl
+@ stub SampGetDefaultSecurityDescriptorForClass
+@ stub SampGetSerialNumberDomain2
 @ stdcall SampInitializeRegistry()
+@ stub SampInitializeSdConversion
+@ stub SampInvalidateDomainCache
+@ stub SampInvalidateRidRange
+@ stub SampNetLogonNotificationRequired
+@ stub SampNotifyReplicatedInChange
+@ stub SampProcessSingleLoopbackTask
+@ stub SampReleaseSamLockExclusive
+@ stub SampReleaseWriteLock
 @ stub SampRtlConvertUlongToUnicodeString
+@ stub SampSetSerialNumberDomain2
+@ stub SampUsingDsData
+@ stub SampWriteGroupType
 @ stdcall SamrAddMemberToAlias(ptr ptr)
 @ stdcall SamrAddMemberToGroup(ptr long long)
 @ stdcall SamrAddMultipleMembersToAlias(ptr ptr)
 @ stdcall SamrConnect(ptr ptr long)
 @ stdcall SamrCreateAliasInDomain(ptr ptr long ptr ptr)
 @ stdcall SamrCreateGroupInDomain(ptr ptr long ptr ptr)
+@ stdcall SamrCreateUser2InDomain(ptr ptr long long ptr ptr ptr)
 @ stdcall SamrCreateUserInDomain(ptr ptr long ptr ptr)
 @ stdcall SamrDeleteAlias(ptr)
 @ stdcall SamrDeleteGroup(ptr)
 @ stdcall SamrRemoveMemberFromForeignDomain(ptr ptr)
 @ stdcall SamrRemoveMemberFromGroup(ptr long)
 @ stdcall SamrRemoveMultipleMembersFromAlias(ptr ptr)
+@ stdcall SamrRidToSid(ptr long ptr)
 @ stdcall SamrSetInformationAlias(ptr long ptr)
 @ stdcall SamrSetInformationDomain(ptr long ptr)
 @ stdcall SamrSetInformationGroup(ptr long ptr)
 @ stdcall SamrShutdownSamServer(ptr)
 @ stdcall SamrTestPrivateFunctionsDomain(ptr)
 @ stdcall SamrTestPrivateFunctionsUser(ptr)
-; EOF
\ No newline at end of file
+@ stdcall SamrUnicodeChangePasswordUser2(ptr ptr ptr ptr ptr long ptr ptr)
+; EOF
index 6f87a60..bab10fe 100644 (file)
 
 WINE_DEFAULT_DEBUG_CHANNEL(samsrv);
 
+
 /* GLOBALS *****************************************************************/
 
+#define TICKS_PER_SECOND 10000000LL
+
 SID_IDENTIFIER_AUTHORITY SecurityNtAuthority = {SECURITY_NT_AUTHORITY};
 
+
 /* FUNCTIONS ***************************************************************/
 
 BOOL
@@ -423,11 +427,11 @@ SampCreateDomain(IN HKEY hDomainsKey,
     FixedData.Version = 1;
     NtQuerySystemTime(&FixedData.CreationTime);
     FixedData.DomainModifiedCount.QuadPart = 0;
-//    FixedData.MaxPasswordAge                 // 6 Weeks
-    FixedData.MinPasswordAge.QuadPart = 0;     // Now
-//    FixedData.ForceLogoff
-//    FixedData.LockoutDuration                // 30 minutes
-//    FixedData.LockoutObservationWindow       // 30 minutes
+    FixedData.MaxPasswordAge.QuadPart = -(6LL * 7LL * 24LL * 60LL * 60LL * TICKS_PER_SECOND); /* 6 weeks */
+    FixedData.MinPasswordAge.QuadPart = 0;                                                    /* right now */
+//    FixedData.ForceLogoff.QuadPart = // very far in the future aka never
+    FixedData.LockoutDuration.QuadPart = -(30LL * 60LL * TICKS_PER_SECOND);                   /* 30 minutes */
+    FixedData.LockoutObservationWindow.QuadPart = -(30LL * 60LL * TICKS_PER_SECOND);          /* 30 minutes */
     FixedData.ModifiedCountAtLastPromotion.QuadPart = 0;
     FixedData.NextRid = 1000;
     FixedData.PasswordProperties = 0;
index 0aa392a..a80402b 100644 (file)
@@ -320,6 +320,69 @@ done:
 }
 
 
+NTSTATUS
+SampRemoveUserFromAllGroups(IN PSAM_DB_OBJECT UserObject)
+{
+    PGROUP_MEMBERSHIP GroupsBuffer = NULL;
+    PSAM_DB_OBJECT GroupObject;
+    ULONG Length = 0;
+    ULONG i;
+    NTSTATUS Status;
+
+    SampGetObjectAttribute(UserObject,
+                           L"Groups",
+                           NULL,
+                           NULL,
+                           &Length);
+
+    if (Length == 0)
+        return STATUS_SUCCESS;
+
+    GroupsBuffer = midl_user_allocate(Length);
+    if (GroupsBuffer == NULL)
+    {
+        Status = STATUS_INSUFFICIENT_RESOURCES;
+        goto done;
+    }
+
+    Status = SampGetObjectAttribute(UserObject,
+                                    L"Groups",
+                                    NULL,
+                                    GroupsBuffer,
+                                    &Length);
+    if (!NT_SUCCESS(Status))
+        goto done;
+
+    for (i = 0; i < (Length / sizeof(GROUP_MEMBERSHIP)); i++)
+    {
+        Status = SampOpenGroupObject(UserObject->ParentObject,
+                                     GroupsBuffer[i].RelativeId,
+                                     0,
+                                     &GroupObject);
+        if (!NT_SUCCESS(Status))
+        {
+            goto done;
+        }
+
+        Status = SampRemoveMemberFromGroup(GroupObject,
+                                           UserObject->RelativeId);
+
+        SampCloseDbObject(GroupObject);
+
+        if (!NT_SUCCESS(Status))
+        {
+            goto done;
+        }
+    }
+
+done:
+    if (GroupsBuffer != NULL)
+        midl_user_free(GroupsBuffer);
+
+    return Status;
+}
+
+
 NTSTATUS
 SampSetUserPassword(IN PSAM_DB_OBJECT UserObject,
                     IN PENCRYPTED_NT_OWF_PASSWORD NtPassword,
index 39f8ad0..481cc5c 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/secur32/lsa.c
index ade429a..604f894 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS
  * FILE:            lib/smdll/dllmain.c
index 6dff367..a26e8b7 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/smdll/query.c
index e2b8c33..d555161 100644 (file)
@@ -1,4 +1,3 @@
-$Id$
 
 This is SMDLL: a helper library to talk to the ReactOS session manager (SM).
 
index 643f8ee..731a784 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS system libraries
  * PURPOSE:           Main file
index 43867e2..4869e8e 100644 (file)
@@ -439,10 +439,10 @@ EnableUserModePnpManager(VOID)
     bRet = TRUE;
 
 cleanup:
-    if (hSCManager != NULL)
-        CloseServiceHandle(hSCManager);
     if (hService != NULL)
         CloseServiceHandle(hService);
+    if (hSCManager != NULL)
+        CloseServiceHandle(hSCManager);
     return bRet;
 }
 
index 55ebba2..1cc1a8c 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/userenv/desktop.c
index 0cabeee..c42030b 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/userenv/directory.c
index cab9959..c07db23 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/userenv/environment.c
index 526e158..07c1498 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/userenv/internal.h
index 9af05ef..92e66c1 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/userenv/misc.c
index dec7685..cd822f8 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/userenv/registry.c
index 9f9120c..a78cd0a 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/userenv/resource.h
index b2a9ff0..f662110 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/userenv/setup.c
index d1338cb..6295fd7 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/userenv/userenv.c
index bb1b400..3576b7a 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS FAX API Support
  * FILE:            lib/winfax/winfax.c
  * PURPOSE:         ReactOS FAX API Support
index 9d993fe..e2eb755 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS SmartCard API
  * FILE:            lib/winscard/winscard.c
  * PURPOSE:         ReactOS SmartCard API
index e15de3a..19959dc 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "ReactOS SmartCard API\0"
index d1f32d4..35c4518 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS winspool DRV
  * FILE:        stubs.c
index 9bedf51..fb64df3 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS WinSock DLL
  * FILE:        stubs.c
index 7bc431a..4d9ae99 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "PC Speaker Device Driver\0"
index e491cb0..94fc8f0 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "VGA Boot Driver\0"
index c33d67f..48cc0b8 100644 (file)
@@ -1,12 +1,6 @@
-/* $Id: bootvid.rc 24464 2006-10-09 04:00:34Z ion $ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "ReactOS KDBG COM Library\0"
 #define REACTOS_STR_INTERNAL_NAME      "kdcom\0"
 #define REACTOS_STR_ORIGINAL_FILENAME  "kdcom.sys\0"
 #include <reactos/version.rc>
-
-IDB_BOOTIMAGE   BITMAP  DISCARDABLE   "bootimage.bmp"
-IDB_BAR         BITMAP  DISCARDABLE   "bar.bmp"
-
-
index 5b01125..fe0e7bf 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Null Device Driver\0"
index 7a46694..82a090c 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: acpi.rc 21698 2006-04-22 05:55:17Z tretiakov $ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "ReactOS ACPI Driver\0"
index 5e94468..4abb3da 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: acpienum.c 21698 2006-04-22 05:55:17Z tretiakov $
- *
+/*
  * PROJECT:         ReactOS ACPI bus driver
  * FILE:            acpi/ospm/acpienum.c
  * PURPOSE:         ACPI namespace enumerator
index cc52ebe..7e49fdb 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "ISA Plug And Play Bus Driver\0"
index ed1ed12..0cb6555 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "PCI Bus Driver\0"
index 34407c4..73f4caf 100644 (file)
@@ -1,6 +1,4 @@
 /*
- *     $Id$
- *
  *     PCI defines and function prototypes
  *     Copyright 1994, Drew Eckhardt
  *     Copyright 1997--1999 Martin Mares <mj@suse.cz>
index 172282e..5be1d5c 100644 (file)
@@ -1,30 +1,29 @@
 /*
-*  ReactOS kernel
-*  Copyright (C) 2002, 2003 ReactOS Team
-*
-*  This program is free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  This program is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  You should have received a copy of the GNU General Public License along
-*  with this program; if not, write to the Free Software Foundation, Inc.,
-*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-/* $Id$
-*
-* COPYRIGHT:        See COPYING in the top level directory
-* PROJECT:          ReactOS kernel
-* FILE:             drivers/fs/cdfs/cdfs.c
-* PURPOSE:          CDROM (ISO 9660) filesystem driver
-* PROGRAMMER:       Art Yerkes
-*                   Eric Kohl
-*/
+ *  ReactOS kernel
+ *  Copyright (C) 2002, 2003 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS kernel
+ * FILE:             drivers/fs/cdfs/cdfs.c
+ * PURPOSE:          CDROM (ISO 9660) filesystem driver
+ * PROGRAMMER:       Art Yerkes
+ *                   Eric Kohl
+ */
 
 /* INCLUDES *****************************************************************/
 
index 08da891..d5d0e62 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "ISO9660 Driver\0"
index 3e0100f..af894fb 100644 (file)
@@ -1,30 +1,29 @@
 /*
-*  ReactOS kernel
-*  Copyright (C) 2002 ReactOS Team
-*
-*  This program is free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  This program is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  You should have received a copy of the GNU General Public License along
-*  with this program; if not, write to the Free Software Foundation, Inc.,
-*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-/* $Id$
-*
-* COPYRIGHT:        See COPYING in the top level directory
-* PROJECT:          ReactOS kernel
-* FILE:             services/fs/cdfs/cleanup.c
-* PURPOSE:          CDROM (ISO 9660) filesystem driver
-* PROGRAMMER:
-* UPDATE HISTORY:
-*/
+ *  ReactOS kernel
+ *  Copyright (C) 2002 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS kernel
+ * FILE:             services/fs/cdfs/cleanup.c
+ * PURPOSE:          CDROM (ISO 9660) filesystem driver
+ * PROGRAMMER:
+ * UPDATE HISTORY:
+ */
 
 /* INCLUDES *****************************************************************/
 
index 38f7e0a..b5f3510 100644 (file)
@@ -1,30 +1,29 @@
 /*
-*  ReactOS kernel
-*  Copyright (C) 2002 ReactOS Team
-*
-*  This program is free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  This program is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  You should have received a copy of the GNU General Public License along
-*  with this program; if not, write to the Free Software Foundation, Inc.,
-*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-/* $Id$
-*
-* COPYRIGHT:        See COPYING in the top level directory
-* PROJECT:          ReactOS kernel
-* FILE:             services/fs/cdfs/close.c
-* PURPOSE:          CDROM (ISO 9660) filesystem driver
-* PROGRAMMER:       Art Yerkes
-* UPDATE HISTORY:
-*/
+ *  ReactOS kernel
+ *  Copyright (C) 2002 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS kernel
+ * FILE:             services/fs/cdfs/close.c
+ * PURPOSE:          CDROM (ISO 9660) filesystem driver
+ * PROGRAMMER:       Art Yerkes
+ * UPDATE HISTORY:
+ */
 
 /* INCLUDES *****************************************************************/
 
index d73864b..2dc126e 100644 (file)
@@ -1,30 +1,29 @@
 /*
-*  ReactOS kernel
-*  Copyright (C) 2002, 2003 ReactOS Team
-*
-*  This program is free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  This program is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  You should have received a copy of the GNU General Public License along
-*  with this program; if not, write to the Free Software Foundation, Inc.,
-*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-/* $Id$
-*
-* COPYRIGHT:        See COPYING in the top level directory
-* PROJECT:          ReactOS kernel
-* FILE:             drivers/fs/cdfs/common.c
-* PURPOSE:          CDROM (ISO 9660) filesystem driver
-* PROGRAMMER:       Art Yerkes
-*                   Eric Kohl
-*/
+ *  ReactOS kernel
+ *  Copyright (C) 2002, 2003 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS kernel
+ * FILE:             drivers/fs/cdfs/common.c
+ * PURPOSE:          CDROM (ISO 9660) filesystem driver
+ * PROGRAMMER:       Art Yerkes
+ *                   Eric Kohl
+ */
 
 /* INCLUDES *****************************************************************/
 
index d7a6440..39e5ca8 100644 (file)
@@ -1,30 +1,29 @@
 /*
-*  ReactOS kernel
-*  Copyright (C) 2002, 2003, 2004 ReactOS Team
-*
-*  This program is free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  This program is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  You should have received a copy of the GNU General Public License along
-*  with this program; if not, write to the Free Software Foundation, Inc.,
-*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-/* $Id$
-*
-* COPYRIGHT:        See COPYING in the top level directory
-* PROJECT:          ReactOS kernel
-* FILE:             services/fs/cdfs/cdfs.c
-* PURPOSE:          CDROM (ISO 9660) filesystem driver
-* PROGRAMMER:       Art Yerkes
-*                   Eric Kohl
-*/
+ *  ReactOS kernel
+ *  Copyright (C) 2002, 2003, 2004 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS kernel
+ * FILE:             services/fs/cdfs/cdfs.c
+ * PURPOSE:          CDROM (ISO 9660) filesystem driver
+ * PROGRAMMER:       Art Yerkes
+ *                   Eric Kohl
+ */
 
 /* INCLUDES *****************************************************************/
 
index 3cb8ada..9a130a7 100644 (file)
@@ -1,31 +1,30 @@
 /*
-*  ReactOS kernel
-*  Copyright (C) 2002, 2004 ReactOS Team
-*
-*  This program is free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  This program is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  You should have received a copy of the GNU General Public License along
-*  with this program; if not, write to the Free Software Foundation, Inc.,
-*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-/* $Id$
-*
-* COPYRIGHT:        See COPYING in the top level directory
-* PROJECT:          ReactOS kernel
-* FILE:             services/fs/cdfs/dirctl.c
-* PURPOSE:          CDROM (ISO 9660) filesystem driver
-* PROGRAMMER:       Art Yerkes
-*                   Eric Kohl
-* UPDATE HISTORY:
-*/
+ *  ReactOS kernel
+ *  Copyright (C) 2002, 2004 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS kernel
+ * FILE:             services/fs/cdfs/dirctl.c
+ * PURPOSE:          CDROM (ISO 9660) filesystem driver
+ * PROGRAMMER:       Art Yerkes
+ *                   Eric Kohl
+ * UPDATE HISTORY:
+ */
 
 /* INCLUDES *****************************************************************/
 
index 12bee1d..0b52408 100644 (file)
@@ -1,30 +1,29 @@
 /*
-*  ReactOS kernel
-*  Copyright (C) 2002, 2004 ReactOS Team
-*
-*  This program is free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  This program is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  You should have received a copy of the GNU General Public License along
-*  with this program; if not, write to the Free Software Foundation, Inc.,
-*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-/* $Id$
-*
-* COPYRIGHT:        See COPYING in the top level directory
-* PROJECT:          ReactOS kernel
-* FILE:             services/fs/cdfs/fcb.c
-* PURPOSE:          CDROM (ISO 9660) filesystem driver
-* PROGRAMMER:       Art Yerkes
-* UPDATE HISTORY:
-*/
+ *  ReactOS kernel
+ *  Copyright (C) 2002, 2004 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS kernel
+ * FILE:             services/fs/cdfs/fcb.c
+ * PURPOSE:          CDROM (ISO 9660) filesystem driver
+ * PROGRAMMER:       Art Yerkes
+ * UPDATE HISTORY:
+ */
 
 /* INCLUDES *****************************************************************/
 
index 3ad68bc..c93cbbb 100644 (file)
@@ -1,31 +1,30 @@
 /*
-*  ReactOS kernel
-*  Copyright (C) 2002, 2004 ReactOS Team
-*
-*  This program is free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  This program is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  You should have received a copy of the GNU General Public License along
-*  with this program; if not, write to the Free Software Foundation, Inc.,
-*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-/* $Id$
-*
-* COPYRIGHT:        See COPYING in the top level directory
-* PROJECT:          ReactOS kernel
-* FILE:             services/fs/cdfs/finfo.c
-* PURPOSE:          CDROM (ISO 9660) filesystem driver
-* PROGRAMMER:       Art Yerkes
-*                   Eric Kohl
-* UPDATE HISTORY:
-*/
+ *  ReactOS kernel
+ *  Copyright (C) 2002, 2004 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS kernel
+ * FILE:             services/fs/cdfs/finfo.c
+ * PURPOSE:          CDROM (ISO 9660) filesystem driver
+ * PROGRAMMER:       Art Yerkes
+ *                   Eric Kohl
+ * UPDATE HISTORY:
+ */
 
 /* INCLUDES *****************************************************************/
 
index d1f618a..fd48da2 100644 (file)
@@ -1,30 +1,29 @@
 /*
-*  ReactOS kernel
-*  Copyright (C) 2002, 2004 ReactOS Team
-*
-*  This program is free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  This program is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  You should have received a copy of the GNU General Public License along
-*  with this program; if not, write to the Free Software Foundation, Inc.,
-*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-/* $Id$
-*
-* COPYRIGHT:        See COPYING in the top level directory
-* PROJECT:          ReactOS kernel
-* FILE:             services/fs/cdfs/misc.c
-* PURPOSE:          CDROM (ISO 9660) filesystem driver
-* PROGRAMMER:       Eric Kohl
-* UPDATE HISTORY:
-*/
+ *  ReactOS kernel
+ *  Copyright (C) 2002, 2004 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS kernel
+ * FILE:             services/fs/cdfs/misc.c
+ * PURPOSE:          CDROM (ISO 9660) filesystem driver
+ * PROGRAMMER:       Eric Kohl
+ * UPDATE HISTORY:
+ */
 
 /* INCLUDES *****************************************************************/
 
index ef94d22..72cd9c3 100644 (file)
@@ -1,30 +1,29 @@
 /*
-*  ReactOS kernel
-*  Copyright (C) 2002, 2003 ReactOS Team
-*
-*  This program is free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  This program is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  You should have received a copy of the GNU General Public License along
-*  with this program; if not, write to the Free Software Foundation, Inc.,
-*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-/* $Id$
-*
-* COPYRIGHT:        See COPYING in the top level directory
-* PROJECT:          ReactOS kernel
-* FILE:             drivers/fs/cdfs/rw.c
-* PURPOSE:          CDROM (ISO 9660) filesystem driver
-* PROGRAMMER:       Art Yerkes
-*                   Eric Kohl
-*/
+ *  ReactOS kernel
+ *  Copyright (C) 2002, 2003 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS kernel
+ * FILE:             drivers/fs/cdfs/rw.c
+ * PURPOSE:          CDROM (ISO 9660) filesystem driver
+ * PROGRAMMER:       Art Yerkes
+ *                   Eric Kohl
+ */
 
 /* INCLUDES *****************************************************************/
 
index 0198335..1a02819 100644 (file)
@@ -1,30 +1,29 @@
 /*
-*  ReactOS kernel
-*  Copyright (C) 2002, 2003 ReactOS Team
-*
-*  This program is free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  This program is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  You should have received a copy of the GNU General Public License along
-*  with this program; if not, write to the Free Software Foundation, Inc.,
-*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-/* $Id$
-*
-* COPYRIGHT:        See COPYING in the top level directory
-* PROJECT:          ReactOS kernel
-* FILE:             services/fs/vfat/volume.c
-* PURPOSE:          CDROM (ISO 9660) filesystem driver
-* PROGRAMMER:       Art Yerkes
-*                   Eric Kohl
-*/
+ *  ReactOS kernel
+ *  Copyright (C) 2002, 2003 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS kernel
+ * FILE:             services/fs/vfat/volume.c
+ * PURPOSE:          CDROM (ISO 9660) filesystem driver
+ * PROGRAMMER:       Art Yerkes
+ *                   Eric Kohl
+ */
 
 /* INCLUDES *****************************************************************/
 
index 0cbc172..e5c5721 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: ext2fs.rc 12852 2005-01-06 13:58:04Z mf $ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Linux ext2 IFS Driver\0"
index bfbfbd1..dae5b63 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Mailslot IFS Driver\0"
index 6a0088b..e8da746 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/fs/mup/create.c
index 9da6cb7..a6f7f11 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/fs/mup/mup.c
index bdfd694..cd270a2 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Multi UNC Provider\0"
index 49988d9..b1229d8 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Keyboard Device Driver\0"
index 3721a52..20f4588 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Mouse Class Device Driver\0"
index 81ab2cd..e078a9e 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Serial mouse device driver\0"
index ba6a0d5..9aaccfc 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: mpu401.rc 21285 2006-03-10 23:22:58Z jimtabor $ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "MPU-401 MIDI Driver\0"
index 8e9d351..8ea5f67 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "SoundBlaster Driver\0"
index 9588d5c..4eacc41 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: sndblst.rc 39744 2009-02-25 09:10:46Z silverblade $ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "SoundBlaster Driver\0"
index ea74f65..70cdc4d 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS kernel
  * FILE:                 services/dd/sound/sb16.c
index 2cc53d9..0f4f9ce 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "SB16 driver\0"
index 685f807..e8f7429 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Socket Filesystem Driver\0"
index c3e2c14..0c5b33d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id$
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/bind.c
index 86ce48f..36dd290 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id$
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/connect.c
index ce2d9e1..9dec195 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id$
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/context.c
index b1e771e..68cbe2e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id$
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/info.c
index c47bad9..5c17fe0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id$
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/listen.c
index d26fbf2..4fcfba0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id$
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/lock.c
index eb050bd..4fa43c8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id$
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/main.c
index fcaea4b..090aed0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id$
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/read.c
index 517f886..72b7c3f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id$
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/tdiconn.c
index 827e057..c05eaed 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/include/afd.h
index 3e0beff..c20e635 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Novell NE2000 network driver\0"
index 9bf89cd..db010ec 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "PCNet Ethernet PCI Driver\0"
index a58d91f..f7630a8 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "TCP/IP protocol driver\0"
index da85ed0..3cef52f 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "NDIS Library\0"
index 2f28750..04992c9 100644 (file)
@@ -1,6 +1,4 @@
-/* $Id$
- *
- */
+
 #include "precomp.h"
 
 /*
index 7b6bd1f..bf38783 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "TDI wrapper kernel module\0"
index fe24d0b..7a64e3f 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * DESCRIPTION: Default TDI event handlers.
  */
 #include "precomp.h"
index 42c3935..98e72ad 100644 (file)
@@ -1,6 +1,3 @@
-/* $Id$
- *
- */
 
 #include "precomp.h"
 
index 8af72d8..4832d7f 100644 (file)
@@ -1,7 +1,4 @@
 
-/* $Id$
- *
- */
 #include "precomp.h"
 
 /*
index 25b9b27..36e58fe 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             services/parallel/parallel.c
index 5c9d862..db11bce 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Parallel Port Device Driver\0"
index a88af0f..6da34d9 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Serial port enumerator\0"
index b72104d..910ccf9 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Serial Port Device Driver\0"
index f8fb242..3aec979 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "HAL Console Device Driver\0"
index 3ad0e51..7a60cb1 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "CD-ROM Class Driver\0"
index e6e694c..4c87c57 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: class2.rc 26227 2007-04-01 16:29:16Z fireball $ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "SCSI Class Driver Helper\0"
index cce8f8d..88a5f22 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Disk Class Driver\0"
index 48aa271..b967c3d 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            services/storage/include/class2.h
index 307ebb3..d239880 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  *  ReactOS Floppy Driver
  *  Copyright (C) 2004, Vizzini (vizzini@plasmic.com)
  *
index 94e9860..fb5d655 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "ATAPI IDE Miniport Driver\0"
index 79ac792..7756101 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: wmilib.rc 21844 2006-05-07 19:34:23Z fireball $ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "WmiLib\0"
index 9d82553..42e3cbd 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id: display.c 23907 2006-09-04 05:52:23Z arty $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/hal/x86/display.c
index 9ba4bbb..5393554 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: dma.c 24759 2006-11-14 20:59:48Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/hal/x86/dma.c
index af8b06d..2a6ea7c 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: enum.c 23907 2006-09-04 05:52:23Z arty $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/hal/x86/enum.c
index 570cc5f..d427943 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: font.c 21840 2006-05-07 18:56:52Z ion $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         Xbox HAL
  * FILE:            hal/halx86/xbox/font.h
index 2a3b404..77c06f9 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/hal/x86/irql.c
index 12d220a..bba345e 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: isa.c 23907 2006-09-04 05:52:23Z arty $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/hal/isa.c
index 0fe5283..f5af0d1 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: portio.c 23907 2006-09-04 05:52:23Z arty $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/hal/x86/portio.c
index 1557697..1c1d087 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: processor.c 23907 2006-09-04 05:52:23Z arty $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            hal/halx86/generic/processor.c
index b43fd1e..cd3a8f3 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: reboot.c 23907 2006-09-04 05:52:23Z arty $
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/hal/x86/reboot.c
index c3cc625..e741027 100644 (file)
@@ -1,6 +1,3 @@
-/*
- * $Id: halirq.h 23669 2006-08-23 16:58:43Z ion $
- */
 
 #pragma once
 
index cbb18bc..d151f8b 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: halinit_up.c 24964 2006-11-29 08:28:20Z ion $
- *
+/*
  * COPYRIGHT:     See COPYING in the top level directory
  * PROJECT:       ReactOS kernel
  * FILE:          ntoskrnl/hal/x86/halinit.c
index c432232..5c81231 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: halinit_up.c 53529 2011-09-02 14:45:19Z tkreuzer $
- *
+/*
  * COPYRIGHT:     See COPYING in the top level directory
  * PROJECT:       ReactOS kernel
  * FILE:          ntoskrnl/hal/x86/halinit.c
index ba5f953..6e68f87 100644 (file)
@@ -1,6 +1,3 @@
-/*
- * $Id$
- */
 
 #pragma once
 
index 6aea485..88248e4 100644 (file)
@@ -16,8 +16,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS kernel
  * FILE:        hal/halx86/mp/apic.c
index edb9106..5c1bc28 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:     See COPYING in the top level directory
  * PROJECT:       ReactOS kernel
  * FILE:          hal/halx86/mp/halinit_mp.c
index 15710d9..bc99c76 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:             See COPYING in the top level directory
  * PROJECT:               ReactOS kernel
  * FILE:                  hal/halx86/mp/ioapic.c
index c9bbb0e..ca0eae4 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:             See COPYING in the top level directory
  * PROJECT:               ReactOS kernel
  * FILE:                  hal/halx86/mp/ipi_mp.c
index 42e2ac3..6f3c5df 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:             See COPYING in the top level directory
  * PROJECT:               ReactOS kernel
  * FILE:                  hal/halx86/mp/mpconfig.c
index 0627e90..51607b1 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            hal/halx86/mp/processor_mp.c
index 7b349e4..3593924 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: halinit_up.c 53529 2011-09-02 14:45:19Z tkreuzer $
- *
+/*
  * COPYRIGHT:     See COPYING in the top level directory
  * PROJECT:       ReactOS kernel
  * FILE:          ntoskrnl/hal/x86/halinit.c
index f9be15f..a2170a8 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:     See COPYING in the top level directory
  * PROJECT:       ReactOS kernel
  * FILE:          ntoskrnl/hal/x86/halinit.c
index 6a7e7d7..1cb9f63 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:     See COPYING in the top level directory
  * PROJECT:       ReactOS kernel
  * FILE:          ntoskrnl/hal/x86/halinit.c
index bbe9d5a..b27c6e3 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         Xbox HAL
  * FILE:            hal/halx86/xbox/halxbox.h
index bab0a53..261dbe4 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:     See COPYING in the top level directory
  * PROJECT:       ReactOS kernel
  * FILE:          hal/halx86/xbox/part_xbox.c
index 74fbbac..74dcf45 100644 (file)
 extern "C" {
 #endif
 
-  _CRTIMP char * __cdecl _cgets(char *_Buffer);
-  _CRTIMP int __cdecl _cprintf(const char *_Format,...);
-  _CRTIMP int __cdecl _cputs(const char *_Str);
-  _CRT_INSECURE_DEPRECATE(_cscanf_s) _CRTIMP int __cdecl _cscanf(const char *_Format,...);
-  _CRT_INSECURE_DEPRECATE(_cscanf_s_l) _CRTIMP int __cdecl _cscanf_l(const char *_Format,_locale_t _Locale,...);
-  _CRTIMP int __cdecl _getch(void);
-  _CRTIMP int __cdecl _getche(void);
-  _CRTIMP int __cdecl _vcprintf(const char *_Format,va_list _ArgList);
-  _CRTIMP int __cdecl _cprintf_p(const char *_Format,...);
-  _CRTIMP int __cdecl _vcprintf_p(const char *_Format,va_list _ArgList);
-  _CRTIMP int __cdecl _cprintf_l(const char *_Format,_locale_t _Locale,...);
-  _CRTIMP int __cdecl _vcprintf_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
-  _CRTIMP int __cdecl _cprintf_p_l(const char *_Format,_locale_t _Locale,...);
-  _CRTIMP int __cdecl _vcprintf_p_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
-  _CRTIMP int __cdecl _kbhit(void);
-  _CRTIMP int __cdecl _putch(int _Ch);
-  _CRTIMP int __cdecl _ungetch(int _Ch);
-  _CRTIMP int __cdecl _getch_nolock(void);
-  _CRTIMP int __cdecl _getche_nolock(void);
-  _CRTIMP int __cdecl _putch_nolock(int _Ch);
-  _CRTIMP int __cdecl _ungetch_nolock(int _Ch);
+  _CRTIMP
+  char*
+  __cdecl
+  _cgets(
+    _Pre_notnull_ _Post_z_ char *_Buffer);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _cprintf(
+    _In_z_ _Printf_format_string_ const char *_Format,
+    ...);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _cputs(
+    _In_z_ const char *_Str);
+
+  _Check_return_opt_
+  _CRT_INSECURE_DEPRECATE(_cscanf_s)
+  _CRTIMP
+  int
+  __cdecl
+  _cscanf(
+    _In_z_ _Scanf_format_string_ const char *_Format,
+    ...);
+
+  _Check_return_opt_
+  _CRT_INSECURE_DEPRECATE(_cscanf_s_l)
+  _CRTIMP
+  int
+  __cdecl
+  _cscanf_l(
+    _In_z_ _Scanf_format_string_ const char *_Format,
+    _In_opt_ _locale_t _Locale,
+    ...);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _getch(void);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _getche(void);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _vcprintf(
+    _In_z_ _Printf_format_string_ const char *_Format,
+    va_list _ArgList);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _cprintf_p(
+    _In_z_ _Printf_format_string_ const char *_Format,
+    ...);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _vcprintf_p(
+    _In_z_ _Printf_format_string_ const char *_Format,
+    va_list _ArgList);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _cprintf_l(
+    _In_z_ _Printf_format_string_ const char *_Format,
+    _In_opt_ _locale_t _Locale,
+    ...);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _vcprintf_l(
+    _In_z_ _Printf_format_string_ const char *_Format,
+    _In_opt_ _locale_t _Locale,
+    va_list _ArgList);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _cprintf_p_l(
+    _In_z_ _Printf_format_string_ const char *_Format,
+    _In_opt_ _locale_t _Locale,
+    ...);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _vcprintf_p_l(
+    _In_z_ _Printf_format_string_ const char *_Format,
+    _In_opt_ _locale_t _Locale,
+    va_list _ArgList);
+
+  _CRTIMP
+  int
+  __cdecl
+  _kbhit(void);
+
+  _CRTIMP
+  int
+  __cdecl
+  _putch(
+    _In_ int _Ch);
+
+  _CRTIMP
+  int
+  __cdecl
+  _ungetch(
+    _In_ int _Ch);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _getch_nolock(void);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _getche_nolock(void);
+
+  _CRTIMP
+  int
+  __cdecl
+  _putch_nolock(
+    _In_ int _Ch);
+
+  _CRTIMP
+  int
+  __cdecl
+  _ungetch_nolock(
+    _In_ int _Ch);
 
 #if defined(_X86_) && !defined(__x86_64)
   int __cdecl _inp(unsigned short);
@@ -54,26 +185,153 @@ extern "C" {
 #define WEOF (wint_t)(0xFFFF)
 #endif
 
-  _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer);
-  _CRTIMP wint_t __cdecl _getwch(void);
-  _CRTIMP wint_t __cdecl _getwche(void);
-  _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh);
-  _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh);
-  _CRTIMP int __cdecl _cputws(const wchar_t *_String);
-  _CRTIMP int __cdecl _cwprintf(const wchar_t *_Format,...);
-  _CRT_INSECURE_DEPRECATE(_cwscanf_s) _CRTIMP int __cdecl _cwscanf(const wchar_t *_Format,...);
-  _CRT_INSECURE_DEPRECATE(_cwscanf_s_l) _CRTIMP int __cdecl _cwscanf_l(const wchar_t *_Format,_locale_t _Locale,...);
-  _CRTIMP int __cdecl _vcwprintf(const wchar_t *_Format,va_list _ArgList);
-  _CRTIMP int __cdecl _cwprintf_p(const wchar_t *_Format,...);
-  _CRTIMP int __cdecl _vcwprintf_p(const wchar_t *_Format,va_list _ArgList);
-  _CRTIMP int __cdecl _cwprintf_l(const wchar_t *_Format,_locale_t _Locale,...);
-  _CRTIMP int __cdecl _vcwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
-  _CRTIMP int __cdecl _cwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...);
-  _CRTIMP int __cdecl _vcwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
-  _CRTIMP wint_t __cdecl _putwch_nolock(wchar_t _WCh);
-  _CRTIMP wint_t __cdecl _getwch_nolock(void);
-  _CRTIMP wint_t __cdecl _getwche_nolock(void);
-  _CRTIMP wint_t __cdecl _ungetwch_nolock(wint_t _WCh);
+  _CRTIMP
+  wchar_t*
+  _cgetws(
+    _Pre_notnull_ _Post_z_ wchar_t *_Buffer);
+
+  _Check_return_
+  _CRTIMP
+  wint_t
+  __cdecl
+  _getwch(void);
+
+  _Check_return_
+  _CRTIMP
+  wint_t
+  __cdecl
+  _getwche(void);
+
+  _Check_return_
+  _CRTIMP
+  wint_t
+  __cdecl
+  _putwch(
+    wchar_t _WCh);
+
+  _Check_return_
+  _CRTIMP
+  wint_t
+  __cdecl
+  _ungetwch(
+    wint_t _WCh);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _cputws(
+    _In_z_ const wchar_t *_String);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _cwprintf(
+    _In_z_ _Printf_format_string_ const wchar_t *_Format,
+    ...);
+
+  _Check_return_opt_
+  _CRT_INSECURE_DEPRECATE(_cwscanf_s)
+  _CRTIMP
+  int
+  __cdecl
+  _cwscanf(
+    _In_z_ _Scanf_format_string_ const wchar_t *_Format,
+    ...);
+
+  _Check_return_opt_
+  _CRT_INSECURE_DEPRECATE(_cwscanf_s_l)
+  _CRTIMP
+  int
+  __cdecl
+  _cwscanf_l(
+    _In_z_ _Scanf_format_string_ const wchar_t *_Format,
+    _In_opt_ _locale_t _Locale,
+    ...);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _vcwprintf(
+    _In_z_ _Printf_format_string_ const wchar_t *_Format,
+    va_list _ArgList);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _cwprintf_p(
+    _In_z_ _Printf_format_string_ const wchar_t *_Format,
+    ...);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _vcwprintf_p(
+    _In_z_ _Printf_format_string_ const wchar_t *_Format,
+    va_list _ArgList);
+
+  _CRTIMP
+  int
+  __cdecl
+  _cwprintf_l(
+    _In_z_ _Printf_format_string_ const wchar_t *_Format,
+    _In_opt_ _locale_t _Locale,
+    ...);
+
+  _CRTIMP
+  int
+  __cdecl
+  _vcwprintf_l(
+    _In_z_ _Printf_format_string_ const wchar_t *_Format,
+    _In_opt_ _locale_t _Locale,
+    va_list _ArgList);
+
+  _CRTIMP
+  int
+  __cdecl
+  _cwprintf_p_l(
+    _In_z_ _Printf_format_string_ const wchar_t *_Format,
+    _In_opt_ _locale_t _Locale,
+    ...);
+
+  _CRTIMP
+  int
+  __cdecl
+  _vcwprintf_p_l(
+    _In_z_ _Printf_format_string_ const wchar_t *_Format,
+    _In_opt_ _locale_t _Locale,
+    va_list _ArgList);
+
+  _Check_return_opt_
+  _CRTIMP
+  wint_t
+  __cdecl
+  _putwch_nolock(
+    wchar_t _WCh);
+
+  _Check_return_
+  _CRTIMP
+  wint_t
+  __cdecl
+  _getwch_nolock(void);
+
+  _Check_return_
+  _CRTIMP
+  wint_t
+  __cdecl
+  _getwche_nolock(void);
+
+  _Check_return_opt_
+  _CRTIMP
+  wint_t
+  __cdecl
+  _ungetwch_nolock(
+    wint_t _WCh);
+
 #endif /* _WCONIO_DEFINED */
 
 #ifndef _MT
@@ -83,16 +341,79 @@ extern "C" {
 #define _ungetwch() _ungetwch_nolock()
 #endif
 
-#ifndef        NO_OLDNAMES
-  _CRT_NONSTDC_DEPRECATE(_cgets) _CRT_INSECURE_DEPRECATE(_cgets_s) _CRTIMP char *__cdecl cgets(char *_Buffer);
-  _CRT_NONSTDC_DEPRECATE(_cprintf) _CRTIMP int __cdecl cprintf(const char *_Format,...);
-  _CRT_NONSTDC_DEPRECATE(_cputs) _CRTIMP int __cdecl cputs(const char *_Str);
-  _CRT_NONSTDC_DEPRECATE(_cscanf) _CRTIMP int __cdecl cscanf(const char *_Format,...);
-  _CRT_NONSTDC_DEPRECATE(_getch) _CRTIMP int __cdecl getch(void);
-  _CRT_NONSTDC_DEPRECATE(_getche) _CRTIMP int __cdecl getche(void);
-  _CRT_NONSTDC_DEPRECATE(_kbhit) _CRTIMP int __cdecl kbhit(void);
-  _CRT_NONSTDC_DEPRECATE(_putch) _CRTIMP int __cdecl putch(int _Ch);
-  _CRT_NONSTDC_DEPRECATE(_ungetch) _CRTIMP int __cdecl ungetch(int _Ch);
+#ifndef NO_OLDNAMES
+
+  _Check_return_opt_
+  _CRT_NONSTDC_DEPRECATE(_cgets)
+  _CRT_INSECURE_DEPRECATE(_cgets_s)
+  _CRTIMP
+  char*
+  __cdecl
+  cgets(
+    _Out_writes_z_(_Inexpressible_(*_Buffer + 2)) char *_Buffer);
+
+  _Check_return_opt_
+  _CRT_NONSTDC_DEPRECATE(_cprintf)
+  _CRTIMP
+  int
+  __cdecl
+  cprintf(
+    _In_z_ _Printf_format_string_ const char *_Format,
+    ...);
+
+  _Check_return_opt_
+  _CRT_NONSTDC_DEPRECATE(_cputs)
+  _CRTIMP
+  int
+  __cdecl
+  cputs(
+    _In_z_ const char *_Str);
+
+  _Check_return_opt_
+  _CRT_NONSTDC_DEPRECATE(_cscanf)
+  _CRTIMP
+  int
+  __cdecl
+  cscanf(
+    _In_z_ _Scanf_format_string_ const char *_Format,
+    ...);
+
+  _Check_return_
+  _CRT_NONSTDC_DEPRECATE(_getch)
+  _CRTIMP
+  int
+  __cdecl
+  getch(void);
+
+  _Check_return_
+  _CRT_NONSTDC_DEPRECATE(_getche)
+  _CRTIMP
+  int
+  __cdecl
+  getche(void);
+
+  _Check_return_
+  _CRT_NONSTDC_DEPRECATE(_kbhit)
+  _CRTIMP
+  int
+  __cdecl
+  kbhit(void);
+
+  _Check_return_opt_
+  _CRT_NONSTDC_DEPRECATE(_putch)
+  _CRTIMP
+  int
+  __cdecl
+  putch(
+    int _Ch);
+
+  _Check_return_opt_
+  _CRT_NONSTDC_DEPRECATE(_ungetch)
+  _CRTIMP
+  int
+  __cdecl
+  ungetch(
+    int _Ch);
 
 #if (defined(_X86_) && !defined(__x86_64))
   _CRT_NONSTDC_DEPRECATE(_inp) _CRTIMP int __cdecl inp(unsigned short);
@@ -100,6 +421,7 @@ extern "C" {
   _CRT_NONSTDC_DEPRECATE(_outp) _CRTIMP int __cdecl outp(unsigned short,int);
   _CRT_NONSTDC_DEPRECATE(_outpw) _CRTIMP unsigned short __cdecl outpw(unsigned short,unsigned short);
 #endif
+
 #endif /* !NO_OLDNAMES */
 
 #ifdef __cplusplus
index e9eb50b..0504179 100644 (file)
@@ -25,40 +25,174 @@ extern "C" {
   };
 #endif
 
-  _CRTIMP char *__cdecl _getcwd(char *_DstBuf,int _SizeInBytes);
-  _CRTIMP char *__cdecl _getdcwd(int _Drive,char *_DstBuf,int _SizeInBytes);
-  char *__cdecl _getdcwd_nolock(int _Drive,char *_DstBuf,int _SizeInBytes);
-  _CRTIMP int __cdecl _chdir(const char *_Path);
-  _CRTIMP int __cdecl _mkdir(const char *_Path);
-  _CRTIMP int __cdecl _rmdir(const char *_Path);
-  _CRTIMP int __cdecl _chdrive(int _Drive);
-  _CRTIMP int __cdecl _getdrive(void);
-  _CRTIMP unsigned long __cdecl _getdrives(void);
+  _Check_return_
+  _Ret_opt_z_
+  _CRTIMP
+  char*
+  __cdecl
+  _getcwd(
+    _Out_writes_opt_(_SizeInBytes) char *_DstBuf,
+    _In_ int _SizeInBytes);
+
+  _Check_return_
+  _Ret_opt_z_
+  _CRTIMP
+  char*
+  __cdecl
+  _getdcwd(
+    _In_ int _Drive,
+    _Out_writes_opt_(_SizeInBytes) char *_DstBuf,
+    _In_ int _SizeInBytes);
+
+  _Check_return_
+  _Ret_opt_z_
+  char*
+  __cdecl
+  _getdcwd_nolock(
+    _In_ int _Drive,
+    _Out_writes_opt_(_SizeInBytes) char *_DstBuf,
+    _In_ int _SizeInBytes);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _chdir(
+    _In_z_ const char *_Path);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _mkdir(
+    _In_z_ const char *_Path);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _rmdir(
+    _In_z_ const char *_Path);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _chdrive(
+    _In_ int _Drive);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _getdrive(void);
+
+  _Check_return_
+  _CRTIMP
+  unsigned long
+  __cdecl
+  _getdrives(void);
 
 #ifndef _GETDISKFREE_DEFINED
 #define _GETDISKFREE_DEFINED
-  _CRTIMP unsigned __cdecl _getdiskfree(unsigned _Drive,struct _diskfree_t *_DiskFree);
+  _Check_return_
+  _CRTIMP
+  unsigned
+  __cdecl
+  _getdiskfree(
+    _In_ unsigned _Drive,
+    _Out_ struct _diskfree_t *_DiskFree);
 #endif
 
 #ifndef _WDIRECT_DEFINED
 #define _WDIRECT_DEFINED
-  _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords);
-  _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
-  wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
-  _CRTIMP int __cdecl _wchdir(const wchar_t *_Path);
-  _CRTIMP int __cdecl _wmkdir(const wchar_t *_Path);
-  _CRTIMP int __cdecl _wrmdir(const wchar_t *_Path);
-#endif
 
-#ifndef        NO_OLDNAMES
+  _Check_return_
+  _Ret_opt_z_
+  _CRTIMP
+  wchar_t*
+  __cdecl
+  _wgetcwd(
+    _Out_writes_opt_(_SizeInWords) wchar_t *_DstBuf,
+    _In_ int _SizeInWords);
+
+  _Check_return_
+  _Ret_opt_z_
+  _CRTIMP
+  wchar_t*
+  __cdecl
+  _wgetdcwd(
+    _In_ int _Drive,
+    _Out_writes_opt_(_SizeInWords) wchar_t *_DstBuf,
+    _In_ int _SizeInWords);
+
+  _Check_return_
+  _Ret_opt_z_
+  wchar_t*
+  __cdecl
+  _wgetdcwd_nolock(
+    _In_ int _Drive,
+    _Out_writes_opt_(_SizeInWords) wchar_t *_DstBuf,
+    _In_ int _SizeInWords);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _wchdir(
+    _In_z_ const wchar_t *_Path);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _wmkdir(
+    _In_z_ const wchar_t *_Path);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _wrmdir(
+    _In_z_ const wchar_t *_Path);
+
+#endif /* _WDIRECT_DEFINED */
+
+#ifndef NO_OLDNAMES
 
 #define diskfree_t _diskfree_t
 
-  _CRTIMP char *__cdecl getcwd(char *_DstBuf,int _SizeInBytes);
-  _CRTIMP int __cdecl chdir(const char *_Path);
-  _CRTIMP int __cdecl mkdir(const char *_Path);
-  _CRTIMP int __cdecl rmdir(const char *_Path);
-#endif
+  _Check_return_
+  _Ret_opt_z_
+  _CRTIMP
+  char*
+  __cdecl
+  getcwd(
+    _Out_writes_opt_(_SizeInBytes) char *_DstBuf,
+    _In_ int _SizeInBytes);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  chdir(
+    _In_z_ const char *_Path);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  mkdir(
+    _In_z_ const char *_Path);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  rmdir(
+    _In_z_ const char *_Path);
+
+#endif /* NO_OLDNAMES */
 
 #ifdef __cplusplus
 }
index 944b3ad..8e8917b 100644 (file)
@@ -17,8 +17,8 @@ extern "C" {
   _CRTIMP extern int *__cdecl _errno(void);
 #define errno (*_errno())
 
-  errno_t __cdecl _set_errno(int _Value);
-  errno_t __cdecl _get_errno(int *_Value);
+  errno_t __cdecl _set_errno(_In_ int _Value);
+  errno_t __cdecl _get_errno(_Out_ int *_Value);
 #endif
 
 #define EPERM 1
index d80ae0e..6870b0c 100644 (file)
@@ -105,9 +105,22 @@ extern "C" {
 /* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask),
  * i.e. change the bits in unMask to have the values they have in unNew,
  * leaving other bits unchanged. */
-__MINGW_NOTHROW _CRTIMP unsigned int __cdecl _controlfp (unsigned int unNew, unsigned int unMask);
-__MINGW_NOTHROW _CRTIMP unsigned int __cdecl _control87 (unsigned int unNew, unsigned int unMask);
 
+__MINGW_NOTHROW
+_CRTIMP
+unsigned int
+__cdecl
+_controlfp(
+  _In_ unsigned int unNew,
+  _In_ unsigned int unMask);
+
+__MINGW_NOTHROW
+_CRTIMP
+unsigned int
+__cdecl
+_control87(
+  _In_ unsigned int unNew,
+  _In_ unsigned int unMask);
 
 __MINGW_NOTHROW _CRTIMP unsigned int __cdecl _clearfp (void);  /* Clear the FPU status word */
 __MINGW_NOTHROW _CRTIMP unsigned int __cdecl _statusfp (void); /* Report the FPU status word */
@@ -136,17 +149,74 @@ __MINGW_NOTHROW _CRTIMP int * __cdecl __fpecode(void);
  * but they really belong in math.h.
  */
 
-__MINGW_NOTHROW _CRTIMP double __cdecl _chgsign        (double);
-__MINGW_NOTHROW _CRTIMP double __cdecl _copysign (double, double);
-__MINGW_NOTHROW _CRTIMP double __cdecl _logb (double);
-__MINGW_NOTHROW _CRTIMP double __cdecl _nextafter (double, double);
-__MINGW_NOTHROW _CRTIMP double __cdecl _scalb (double, long);
-
-__MINGW_NOTHROW _CRTIMP int __cdecl _finite (double);
-__MINGW_NOTHROW _CRTIMP int __cdecl _fpclass (double);
-__MINGW_NOTHROW _CRTIMP int __cdecl _isnan (double);
-
-#ifdef __cplusplus
+_Check_return_
+__MINGW_NOTHROW
+_CRTIMP
+double
+__cdecl
+_chgsign(
+  _In_ double);
+
+_Check_return_
+__MINGW_NOTHROW
+_CRTIMP
+double
+__cdecl
+_copysign(
+  _In_ double,
+  _In_ double);
+
+_Check_return_
+__MINGW_NOTHROW
+_CRTIMP
+double
+__cdecl
+_logb(
+  _In_ double);
+
+_Check_return_
+__MINGW_NOTHROW
+_CRTIMP
+double
+__cdecl
+_nextafter(
+  _In_ double,
+  _In_ double);
+
+_Check_return_
+__MINGW_NOTHROW
+_CRTIMP
+double
+__cdecl
+_scalb(
+  _In_ double,
+  _In_ long);
+
+_Check_return_
+__MINGW_NOTHROW
+_CRTIMP
+int
+__cdecl
+_finite(
+  _In_ double);
+
+_Check_return_
+__MINGW_NOTHROW
+_CRTIMP
+int
+__cdecl
+_fpclass(
+  _In_ double);
+
+_Check_return_
+__MINGW_NOTHROW
+_CRTIMP
+int
+__cdecl
+_isnan(
+  _In_ double);
+
+#ifdef __cplusplus
 }
 #endif
 
index 4a3f37d..5e29e67 100644 (file)
 extern "C" {
 #endif
 
-_CRTIMP char* __cdecl _getcwd (char*, int);
+_Check_return_
+_Ret_opt_z_
+_CRTIMP
+char*
+__cdecl
+_getcwd(
+  _Out_writes_opt_(_SizeInBytes) char *_DstBuf,
+  _In_ int _SizeInBytes);
+
 #ifndef _FSIZE_T_DEFINED
   typedef unsigned long _fsize_t;
 #define _FSIZE_T_DEFINED
@@ -162,57 +170,316 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
 #define        W_OK    2       /* Check for write permission */
 #define        R_OK    4       /* Check for read permission */
 
-  _CRTIMP int __cdecl _access(const char *_Filename,int _AccessMode);
-  _CRTIMP int __cdecl _chmod(const char *_Filename,int _Mode);
-  _CRTIMP int __cdecl _chsize(int _FileHandle,long _Size);
-  _CRTIMP int __cdecl _close(int _FileHandle);
-  _CRTIMP int __cdecl _commit(int _FileHandle);
-  _CRTIMP int __cdecl _creat(const char *_Filename,int _PermissionMode);
-  _CRTIMP int __cdecl _dup(int _FileHandle);
-  _CRTIMP int __cdecl _dup2(int _FileHandleSrc,int _FileHandleDst);
-  _CRTIMP int __cdecl _eof(int _FileHandle);
-  _CRTIMP long __cdecl _filelength(int _FileHandle);
-  _CRTIMP intptr_t __cdecl _findfirst(const char *_Filename, struct _finddata_t *_FindData);
-  _CRTIMP intptr_t __cdecl _findfirst32(const char *_Filename,struct _finddata32_t *_FindData);
-  _CRTIMP int __cdecl _findnext(intptr_t _FindHandle,struct _finddata_t *_FindData);
-  _CRTIMP int __cdecl _findnext32(intptr_t _FindHandle,struct _finddata32_t *_FindData);
-  _CRTIMP int __cdecl _findclose(intptr_t _FindHandle);
-  _CRTIMP int __cdecl _isatty(int _FileHandle);
-  _CRTIMP int __cdecl _locking(int _FileHandle,int _LockMode,long _NumOfBytes);
-  _CRTIMP long __cdecl _lseek(int _FileHandle,long _Offset,int _Origin);
-  _CRTIMP char *__cdecl _mktemp(char *_TemplateName);
-  _CRTIMP int __cdecl _pipe(int *_PtHandles,unsigned int _PipeSize,int _TextMode);
-  _CRTIMP int __cdecl _read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount);
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _access(
+    _In_z_ const char *_Filename,
+    _In_ int _AccessMode);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _chmod(
+    _In_z_ const char *_Filename,
+    _In_ int _Mode);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _chsize(
+    _In_ int _FileHandle,
+    _In_ long _Size);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _close(
+    _In_ int _FileHandle);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _commit(
+    _In_ int _FileHandle);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _creat(
+    _In_z_ const char *_Filename,
+    _In_ int _PermissionMode);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _dup(
+    _In_ int _FileHandle);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _dup2(
+    _In_ int _FileHandleSrc,
+    _In_ int _FileHandleDst);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _eof(
+    _In_ int _FileHandle);
+
+  _Check_return_
+  _CRTIMP
+  long
+  __cdecl
+  _filelength(
+    _In_ int _FileHandle);
+
+  _CRTIMP
+  intptr_t
+  __cdecl
+  _findfirst(
+    const char *_Filename,
+    struct _finddata_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  intptr_t
+  __cdecl
+  _findfirst32(
+    _In_z_ const char *_Filename,
+    _Out_ struct _finddata32_t *_FindData);
+
+  _CRTIMP
+  int
+  __cdecl
+  _findnext(
+    intptr_t _FindHandle,
+    struct _finddata_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _findnext32(
+    _In_ intptr_t _FindHandle,
+    _Out_ struct _finddata32_t *_FindData);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  _findclose(
+    _In_ intptr_t _FindHandle);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _isatty(
+    _In_ int _FileHandle);
+
+  _CRTIMP
+  int
+  __cdecl
+  _locking(
+    _In_ int _FileHandle,
+    _In_ int _LockMode,
+    _In_ long _NumOfBytes);
+
+  _Check_return_opt_
+  _CRTIMP
+  long
+  __cdecl
+  _lseek(
+    _In_ int _FileHandle,
+    _In_ long _Offset,
+    _In_ int _Origin);
+
+  _Check_return_
+  _CRTIMP
+  char*
+  __cdecl
+  _mktemp(
+    _Inout_z_ char *_TemplateName);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _pipe(
+    _Inout_updates_(2) int *_PtHandles,
+    _In_ unsigned int _PipeSize,
+    _In_ int _TextMode);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _read(
+    _In_ int _FileHandle,
+    _Out_writes_bytes_(_MaxCharCount) void *_DstBuf,
+    _In_ unsigned int _MaxCharCount);
 
 #ifndef _CRT_DIRECTORY_DEFINED
 #define _CRT_DIRECTORY_DEFINED
-  int __cdecl remove(const char *_Filename);
-  int __cdecl rename(const char *_OldFilename,const char *_NewFilename);
-  _CRTIMP int __cdecl _unlink(const char *_Filename);
-#ifndef        NO_OLDNAMES
-  _CRTIMP int __cdecl unlink(const char *_Filename);
-#endif
+
+  _Check_return_
+  int
+  __cdecl
+  remove(
+    _In_z_ const char *_Filename);
+
+  _Check_return_
+  int
+  __cdecl
+  rename(
+    _In_z_ const char *_OldFilename,
+    _In_z_ const char *_NewFilename);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _unlink(
+    _In_z_ const char *_Filename);
+
+#ifndef NO_OLDNAMES
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  unlink(
+    _In_z_ const char *_Filename);
 #endif
 
-  _CRTIMP int __cdecl _setmode(int _FileHandle,int _Mode);
-  _CRTIMP long __cdecl _tell(int _FileHandle);
-  _CRTIMP int __cdecl _umask(int _Mode);
-  _CRTIMP int __cdecl _write(int _FileHandle,const void *_Buf,unsigned int _MaxCharCount);
+#endif /* _CRT_DIRECTORY_DEFINED */
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _setmode(
+    _In_ int _FileHandle,
+    _In_ int _Mode);
+
+  _Check_return_
+  _CRTIMP
+  long
+  __cdecl
+  _tell(
+    _In_ int _FileHandle);
+
+  _CRTIMP
+  int
+  __cdecl
+  _umask(
+    _In_ int _Mode);
+
+  _CRTIMP
+  int
+  __cdecl
+  _write(
+    _In_ int _FileHandle,
+    _In_reads_bytes_(_MaxCharCount) const void *_Buf,
+    _In_ unsigned int _MaxCharCount);
 
 #if _INTEGRAL_MAX_BITS >= 64
-  __MINGW_EXTENSION _CRTIMP __int64 __cdecl _filelengthi64(int _FileHandle);
-  _CRTIMP intptr_t __cdecl _findfirst32i64(const char *_Filename,struct _finddata32i64_t *_FindData);
-  _CRTIMP intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData);
-  _CRTIMP intptr_t __cdecl _findfirst64(const char *_Filename,struct __finddata64_t *_FindData);
-  _CRTIMP int __cdecl _findnext32i64(intptr_t _FindHandle,struct _finddata32i64_t *_FindData);
-  _CRTIMP int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData);
-  _CRTIMP int __cdecl _findnext64(intptr_t _FindHandle,struct __finddata64_t *_FindData);
-  __MINGW_EXTENSION _CRTIMP __int64 __cdecl _lseeki64(int _FileHandle,__int64 _Offset,int _Origin);
-  __MINGW_EXTENSION _CRTIMP __int64 __cdecl _telli64(int _FileHandle);
+
+  _Check_return_
+  __MINGW_EXTENSION
+  _CRTIMP
+  __int64
+  __cdecl
+  _filelengthi64(
+    _In_ int _FileHandle);
+
+  _Check_return_
+  _CRTIMP
+  intptr_t
+  __cdecl
+  _findfirst32i64(
+    _In_z_ const char *_Filename,
+    _Out_ struct _finddata32i64_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  intptr_t
+  __cdecl
+  _findfirst64i32(
+    _In_z_ const char *_Filename,
+    _Out_ struct _finddata64i32_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  intptr_t
+  __cdecl
+  _findfirst64(
+    _In_z_ const char *_Filename,
+    _Out_ struct __finddata64_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _findnext32i64(
+    _In_ intptr_t _FindHandle,
+    _Out_ struct _finddata32i64_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _findnext64i32(
+    _In_ intptr_t _FindHandle,
+    _Out_ struct _finddata64i32_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _findnext64(
+    _In_ intptr_t _FindHandle,
+    _Out_ struct __finddata64_t *_FindData);
+
+  _Check_return_opt_
+  __MINGW_EXTENSION
+  _CRTIMP
+  __int64
+  __cdecl
+  _lseeki64(
+    _In_ int _FileHandle,
+    _In_ __int64 _Offset,
+    _In_ int _Origin);
+
+  _Check_return_
+  __MINGW_EXTENSION
+  _CRTIMP
+  __int64
+  __cdecl
+  _telli64(
+    _In_ int _FileHandle);
+
 #ifdef __cplusplus
 #include <string.h>
 #endif
-  __CRT_INLINE intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData)
+
+  __CRT_INLINE
+  intptr_t
+  __cdecl
+  _findfirst64i32(
+    const char *_Filename,
+    struct _finddata64i32_t *_FindData)
   {
     struct __finddata64_t fd;
     intptr_t ret = _findfirst64(_Filename,&fd);
@@ -224,7 +491,13 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
     strncpy(_FindData->name,fd.name,260);
     return ret;
   }
-  __CRT_INLINE int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData)
+
+  __CRT_INLINE
+  int
+  __cdecl
+  _findnext64i32(
+    intptr_t _FindHandle,
+    struct _finddata64i32_t *_FindData)
   {
     struct __finddata64_t fd;
     int ret = _findnext64(_FindHandle,&fd);
@@ -236,20 +509,69 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
     strncpy(_FindData->name,fd.name,260);
     return ret;
   }
-#endif
+
+#endif /* _INTEGRAL_MAX_BITS >= 64 */
 
 #ifndef NO_OLDNAMES
 #ifndef _UWIN
-  _CRTIMP int __cdecl chdir (const char *);
-  _CRTIMP char *__cdecl getcwd (char *, int);
-  _CRTIMP int __cdecl mkdir (const char *);
-  _CRTIMP char *__cdecl mktemp(char *);
-  _CRTIMP int __cdecl rmdir (const char*);
-  _CRTIMP int __cdecl chmod (const char *, int);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  chdir(
+    _In_z_ const char *_Path);
+
+  _Check_return_
+  _Ret_opt_z_
+  _CRTIMP
+  char*
+  __cdecl
+  getcwd(
+    _Out_writes_opt_(_SizeInBytes) char *_DstBuf,
+    _In_ int _SizeInBytes);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  mkdir(
+    _In_z_ const char *_Path);
+
+  _CRTIMP
+  char*
+  __cdecl
+  mktemp(
+    _Inout_z_ char *_TemplateName);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  rmdir(
+    _In_z_ const char *_Path);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  chmod(
+    _In_z_ const char *_Filename,
+    _In_ int _AccessMode);
+
 #endif /* _UWIN */
 #endif /* Not NO_OLDNAMES */
 
-  _CRTIMP errno_t __cdecl _sopen_s(int *_FileHandle,const char *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode);
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _sopen_s(
+    _Out_ int *_FileHandle,
+    _In_z_ const char *_Filename,
+    _In_ int _OpenFlag,
+    _In_ int _ShareFlag,
+    _In_ int _PermissionMode);
 
 #ifndef __cplusplus
   _CRTIMP int __cdecl _open(const char *_Filename,int _OpenFlag,...);
@@ -261,25 +583,130 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
 
 #ifndef _WIO_DEFINED
 #define _WIO_DEFINED
-  _CRTIMP int __cdecl _waccess(const wchar_t *_Filename,int _AccessMode);
-  _CRTIMP int __cdecl _wchmod(const wchar_t *_Filename,int _Mode);
-  _CRTIMP int __cdecl _wcreat(const wchar_t *_Filename,int _PermissionMode);
-  _CRTIMP intptr_t __cdecl _wfindfirst32(const wchar_t *_Filename,struct _wfinddata32_t *_FindData);
-  _CRTIMP int __cdecl _wfindnext32(intptr_t _FindHandle,struct _wfinddata32_t *_FindData);
-  _CRTIMP int __cdecl _wunlink(const wchar_t *_Filename);
-  _CRTIMP int __cdecl _wrename(const wchar_t *_NewFilename,const wchar_t *_OldFilename);
-  _CRTIMP wchar_t *__cdecl _wmktemp(wchar_t *_TemplateName);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _waccess(
+    _In_z_ const wchar_t *_Filename,
+    _In_ int _AccessMode);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _wchmod(
+    _In_z_ const wchar_t *_Filename,
+    _In_ int _Mode);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _wcreat(
+    _In_z_ const wchar_t *_Filename,
+    _In_ int _PermissionMode);
+
+  _Check_return_
+  _CRTIMP
+  intptr_t
+  __cdecl
+  _wfindfirst32(
+    _In_z_ const wchar_t *_Filename,
+    _Out_ struct _wfinddata32_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _wfindnext32(
+    _In_ intptr_t _FindHandle,
+    _Out_ struct _wfinddata32_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _wunlink(
+    _In_z_ const wchar_t *_Filename);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _wrename(
+    _In_z_ const wchar_t *_NewFilename,
+    _In_z_ const wchar_t *_OldFilename);
+
+  _CRTIMP
+  wchar_t*
+  __cdecl
+  _wmktemp(
+    _Inout_z_ wchar_t *_TemplateName);
 
 #if _INTEGRAL_MAX_BITS >= 64
-  _CRTIMP intptr_t __cdecl _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData);
-  intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData);
-  _CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t *_Filename,struct _wfinddata64_t *_FindData);
-  _CRTIMP int __cdecl _wfindnext32i64(intptr_t _FindHandle,struct _wfinddata32i64_t *_FindData);
-  int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData);
-  _CRTIMP int __cdecl _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData);
-#endif
 
-  _CRTIMP errno_t __cdecl _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag);
+  _Check_return_
+  _CRTIMP
+  intptr_t
+  __cdecl
+  _wfindfirst32i64(
+    _In_z_ const wchar_t *_Filename,
+    _Out_ struct _wfinddata32i64_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  intptr_t
+  __cdecl
+  _wfindfirst64i32(
+    _In_z_ const wchar_t *_Filename,
+    _Out_ struct _wfinddata64i32_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  intptr_t
+  __cdecl
+  _wfindfirst64(
+    _In_z_ const wchar_t *_Filename,
+    _Out_ struct _wfinddata64_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _wfindnext32i64(
+    _In_ intptr_t _FindHandle,
+    _Out_ struct _wfinddata32i64_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _wfindnext64i32(
+    _In_ intptr_t _FindHandle,
+    _Out_ struct _wfinddata64i32_t *_FindData);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _wfindnext64(
+    _In_ intptr_t _FindHandle,
+    _Out_ struct _wfinddata64_t *_FindData);
+
+#endif /* _INTEGRAL_MAX_BITS >= 64 */
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _wsopen_s(
+    _Out_ int *_FileHandle,
+    _In_z_ const wchar_t *_Filename,
+    _In_ int _OpenFlag,
+    _In_ int _ShareFlag,
+    _In_ int _PermissionFlag);
 
 #if !defined(__cplusplus) || !(defined(_X86_) && !defined(__x86_64))
   _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,...);
@@ -291,33 +718,187 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
 
 #endif /* !_WIO_DEFINED */
 
-  int __cdecl __lock_fhandle(int _Filehandle);
-  void __cdecl _unlock_fhandle(int _Filehandle);
-  _CRTIMP intptr_t __cdecl _get_osfhandle(int _FileHandle);
-  _CRTIMP int __cdecl _open_osfhandle(intptr_t _OSFileHandle,int _Flags);
-
-#ifndef        NO_OLDNAMES
-  _CRTIMP int __cdecl access(const char *_Filename,int _AccessMode);
-  _CRTIMP int __cdecl chmod(const char *_Filename,int _AccessMode);
-  _CRTIMP int __cdecl chsize(int _FileHandle,long _Size);
-  _CRTIMP int __cdecl close(int _FileHandle);
-  _CRTIMP int __cdecl creat(const char *_Filename,int _PermissionMode);
-  _CRTIMP int __cdecl dup(int _FileHandle);
-  _CRTIMP int __cdecl dup2(int _FileHandleSrc,int _FileHandleDst);
-  _CRTIMP int __cdecl eof(int _FileHandle);
-  _CRTIMP long __cdecl filelength(int _FileHandle);
-  _CRTIMP int __cdecl isatty(int _FileHandle);
-  _CRTIMP int __cdecl locking(int _FileHandle,int _LockMode,long _NumOfBytes);
-  _CRTIMP long __cdecl lseek(int _FileHandle,long _Offset,int _Origin);
-  _CRTIMP char *__cdecl mktemp(char *_TemplateName);
-  _CRTIMP int __cdecl open(const char *_Filename,int _OpenFlag,...);
-  _CRTIMP int __cdecl read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount);
-  _CRTIMP int __cdecl setmode(int _FileHandle,int _Mode);
-  _CRTIMP int __cdecl sopen(const char *_Filename,int _OpenFlag,int _ShareFlag,...);
-  _CRTIMP long __cdecl tell(int _FileHandle);
-  _CRTIMP int __cdecl umask(int _Mode);
-  _CRTIMP int __cdecl write(int _Filehandle,const void *_Buf,unsigned int _MaxCharCount);
-#endif
+  int
+  __cdecl
+  __lock_fhandle(
+    _In_ int _Filehandle);
+
+  void
+  __cdecl
+  _unlock_fhandle(
+    _In_ int _Filehandle);
+
+  _CRTIMP
+  intptr_t
+  __cdecl
+  _get_osfhandle(
+    _In_ int _FileHandle);
+
+  _CRTIMP
+  int
+  __cdecl
+  _open_osfhandle(
+    _In_ intptr_t _OSFileHandle,
+    _In_ int _Flags);
+
+#ifndef NO_OLDNAMES
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  access(
+    _In_z_ const char *_Filename,
+    _In_ int _AccessMode);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  chmod(
+    _In_z_ const char *_Filename,
+    _In_ int _AccessMode);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  chsize(
+    _In_ int _FileHandle,
+    _In_ long _Size);
+
+  _Check_return_opt_
+  _CRTIMP
+  int
+  __cdecl
+  close(
+    _In_ int _FileHandle);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  creat(
+    _In_z_ const char *_Filename,
+    _In_ int _PermissionMode);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  dup(
+    _In_ int _FileHandle);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  dup2(
+    _In_ int _FileHandleSrc,
+    _In_ int _FileHandleDst);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  __cdecl eof(
+    _In_ int _FileHandle);
+
+  _Check_return_
+  _CRTIMP
+  long
+  __cdecl
+  filelength(
+    _In_ int _FileHandle);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  isatty(
+    _In_ int _FileHandle);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  locking(
+    _In_ int _FileHandle,
+    _In_ int _LockMode,
+    _In_ long _NumOfBytes);
+
+  _Check_return_opt_
+  _CRTIMP
+  long
+  __cdecl
+  lseek(
+    _In_ int _FileHandle,
+    _In_ long _Offset,
+    _In_ int _Origin);
+
+  _CRTIMP
+  char*
+  __cdecl
+  mktemp(
+    _Inout_z_ char *_TemplateName);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  open(
+    _In_z_ const char *_Filename,
+    _In_ int _OpenFlag,
+    ...);
+
+  _CRTIMP
+  int
+  __cdecl
+  read(
+    _In_ int _FileHandle,
+    _Out_writes_bytes_(_MaxCharCount) void *_DstBuf,
+    _In_ unsigned int _MaxCharCount);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  setmode(
+    _In_ int _FileHandle,
+    _In_ int _Mode);
+
+  _CRTIMP
+  int
+  __cdecl
+  sopen(
+    const char *_Filename,
+    int _OpenFlag,
+    int _ShareFlag,
+    ...);
+
+  _Check_return_
+  _CRTIMP
+  long
+  __cdecl
+  tell(
+    _In_ int _FileHandle);
+
+  _CRTIMP
+  int
+  __cdecl
+  umask(
+    _In_ int _Mode);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  write(
+    _In_ int _Filehandle,
+    _In_reads_bytes_(_MaxCharCount) const void *_Buf,
+    _In_ unsigned int _MaxCharCount);
+
+#endif /* NO_OLDNAMES */
 
 #ifdef __cplusplus
 }
@@ -345,12 +926,10 @@ static inline int __mingw_access (const char *__fname, int __mode) {
 #define access(__f,__m)  __mingw_access (__f, __m)
 #endif
 
-
 #ifdef __cplusplus
 }
 #endif
 
-
 #pragma pack(pop)
 
 #include <sec_api/io_s.h>
index d7ba107..f5cdc8a 100644 (file)
@@ -68,19 +68,68 @@ extern "C" {
 
 #endif
 
-  int __cdecl _configthreadlocale(int _Flag);
-  char *__cdecl setlocale(int _Category,const char *_Locale);
-  _CRTIMP struct lconv *__cdecl localeconv(void);
-  _locale_t __cdecl _get_current_locale(void);
-  _locale_t __cdecl _create_locale(int _Category,const char *_Locale);
-  void __cdecl _free_locale(_locale_t _Locale);
-  _locale_t __cdecl __get_current_locale(void);
-  _locale_t __cdecl __create_locale(int _Category,const char *_Locale);
-  void __cdecl __free_locale(_locale_t _Locale);
+  _Check_return_opt_
+  int
+  __cdecl
+  _configthreadlocale(
+    _In_ int _Flag);
+
+  _Check_return_opt_
+  char*
+  __cdecl
+  setlocale(
+    _In_ int _Category,
+    _In_opt_z_ const char *_Locale);
+
+  _Check_return_opt_
+  _CRTIMP
+  struct lconv*
+  __cdecl
+  localeconv(void);
+
+  _Check_return_opt_
+  _locale_t
+  __cdecl
+  _get_current_locale(void);
+
+  _Check_return_opt_
+  _locale_t
+  __cdecl
+  _create_locale(
+    _In_ int _Category,
+    _In_z_ const char *_Locale);
+
+  void
+  __cdecl
+  _free_locale(
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_
+  _locale_t
+  __cdecl
+  __get_current_locale(void);
+
+  _Check_return_
+  _locale_t
+  __cdecl
+  __create_locale(
+    _In_ int _Category,
+    _In_z_ const char *_Locale);
+
+  void
+  __cdecl
+  __free_locale(
+    _In_opt_ _locale_t _Locale);
 
 #ifndef _WLOCALE_DEFINED
 #define _WLOCALE_DEFINED
-  _CRTIMP wchar_t *__cdecl _wsetlocale(int _Category,const wchar_t *_Locale);
+  _Check_return_opt_
+  _CRTIMP
+  wchar_t*
+  __cdecl
+  _wsetlocale(
+    _In_ int _Category,
+    _In_opt_z_ const wchar_t *_Locale);
 #endif
 
 #ifdef __cplusplus
index 51542e6..c0ebb2e 100644 (file)
@@ -69,23 +69,129 @@ extern "C" {
 
 #ifndef _CRT_ALLOCATION_DEFINED
 #define _CRT_ALLOCATION_DEFINED
-  void *__cdecl calloc(size_t _NumOfElements,size_t _SizeOfElements);
-  void __cdecl free(void *_Memory);
-  void *__cdecl malloc(size_t _Size);
-  void *__cdecl realloc(void *_Memory,size_t _NewSize);
-  _CRTIMP void *__cdecl _recalloc(void *_Memory,size_t _Count,size_t _Size);
+
+  _Check_return_
+  _Ret_maybenull_
+  _Post_writable_byte_size_(_NumOfElements * _SizeOfElements)
+  void*
+  __cdecl
+  calloc(
+    _In_ size_t _NumOfElements,
+    _In_ size_t _SizeOfElements);
+
+  void
+  __cdecl
+  free(
+    _Pre_maybenull_ _Post_invalid_ void *_Memory);
+
+  _Check_return_
+  _Ret_maybenull_
+  _Post_writable_byte_size_(_Size)
+  void*
+  __cdecl
+  malloc(
+    _In_ size_t _Size);
+
+  _Check_return_
+  _Ret_maybenull_
+  _Post_writable_byte_size_(_NewSize)
+  void*
+  __cdecl
+  realloc(
+    _Pre_maybenull_ _Post_invalid_ void *_Memory,
+    _In_ size_t _NewSize);
+
+  _Check_return_
+  _Ret_maybenull_
+  _Post_writable_byte_size_(_Count * _Size)
+  _CRTIMP
+  void*
+  __cdecl
+  _recalloc(
+    _Pre_maybenull_ _Post_invalid_ void *_Memory,
+    _In_ size_t _Count,
+    _In_ size_t _Size);
 
 #ifdef __DO_ALIGN_DEFINES
-  _CRTIMP void __cdecl _aligned_free(void *_Memory);
-  _CRTIMP void *__cdecl _aligned_malloc(size_t _Size,size_t _Alignment);
-#endif
 
-  _CRTIMP void *__cdecl _aligned_offset_malloc(size_t _Size,size_t _Alignment,size_t _Offset);
-  _CRTIMP void *__cdecl _aligned_realloc(void *_Memory,size_t _Size,size_t _Alignment);
-  _CRTIMP void *__cdecl _aligned_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment);
-  _CRTIMP void *__cdecl _aligned_offset_realloc(void *_Memory,size_t _Size,size_t _Alignment,size_t _Offset);
-  _CRTIMP void *__cdecl _aligned_offset_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment,size_t _Offset);
-#endif
+  _CRTIMP
+  void
+  __cdecl
+  _aligned_free(
+    _Pre_maybenull_ _Post_invalid_ void *_Memory);
+
+  _Check_return_
+  _Ret_maybenull_
+  _Post_writable_byte_size_(_Size)
+  _CRTIMP
+  void*
+  __cdecl
+  _aligned_malloc(
+    _In_ size_t _Size,
+    _In_ size_t _Alignment);
+
+#endif /* __DO_ALIGN_DEFINES */
+
+  _Check_return_
+  _Ret_maybenull_
+  _Post_writable_byte_size_(_Size)
+  _CRTIMP
+  void*
+  __cdecl
+  _aligned_offset_malloc(
+    _In_ size_t _Size,
+    _In_ size_t _Alignment,
+    _In_ size_t _Offset);
+
+  _Check_return_
+  _Ret_maybenull_
+  _Post_writable_byte_size_(_Size)
+  _CRTIMP
+  void*
+  __cdecl
+  _aligned_realloc(
+    _Pre_maybenull_ _Post_invalid_ void *_Memory,
+    _In_ size_t _Size,
+    _In_ size_t _Alignment);
+
+  _Check_return_
+  _Ret_maybenull_
+  _Post_writable_byte_size_(_Count * _Size)
+  _CRTIMP
+  void*
+  __cdecl
+  _aligned_recalloc(
+    _Pre_maybenull_ _Post_invalid_ void *_Memory,
+    _In_ size_t _Count,
+    _In_ size_t _Size,
+    _In_ size_t _Alignment);
+
+  _Check_return_
+  _Ret_maybenull_
+  _Post_writable_byte_size_(_Size)
+  _CRTIMP
+  void*
+  __cdecl
+  _aligned_offset_realloc(
+    _Pre_maybenull_ _Post_invalid_ void *_Memory,
+    _In_ size_t _Size,
+    _In_ size_t _Alignment,
+    _In_ size_t _Offset);
+
+  _Check_return_
+  _Ret_maybenull_
+  _Post_writable_byte_size_(_Count * _Size)
+  _CRTIMP
+  void*
+  __cdecl
+  _aligned_offset_recalloc(
+    _Pre_maybenull_ _Post_invalid_ void *_Memory,
+    _In_ size_t _Count,
+    _In_ size_t _Size,
+    _In_ size_t _Alignment,
+    _In_ size_t _Offset);
+
+#endif /* _CRT_ALLOCATION_DEFINED */
 
 #ifdef __DO_ALIGN_DEFINES
 #undef __DO_ALIGN_DEFINES
@@ -98,27 +204,109 @@ extern "C" {
 #define _MAX_WAIT_MALLOC_CRT 60000
 
   _CRTIMP int __cdecl _resetstkoflw (void);
-  _CRTIMP unsigned long __cdecl _set_malloc_crt_max_wait(unsigned long _NewValue);
 
-  _CRTIMP void *__cdecl _expand(void *_Memory,size_t _NewSize);
-  _CRTIMP size_t __cdecl _msize(void *_Memory);
+  _CRTIMP
+  unsigned long
+  __cdecl
+  _set_malloc_crt_max_wait(
+    _In_ unsigned long _NewValue);
+
+  _Check_return_
+  _Ret_maybenull_
+  _Post_writable_byte_size_(_NewSize)
+  _CRTIMP
+  void*
+  __cdecl
+  _expand(
+    _In_opt_ void *_Memory,
+    _In_ size_t _NewSize);
+
+  _Check_return_
+  _CRTIMP
+  size_t
+  __cdecl
+  _msize(
+    _In_ void *_Memory);
+
 #ifdef __GNUC__
 #undef _alloca
 #define _alloca(x) __builtin_alloca((x))
 #else
-  void *__cdecl _alloca(size_t _Size);
-#endif
-  _CRTIMP size_t __cdecl _get_sbh_threshold(void);
-  _CRTIMP int __cdecl _set_sbh_threshold(size_t _NewValue);
-  _CRTIMP errno_t __cdecl _set_amblksiz(size_t _Value);
-  _CRTIMP errno_t __cdecl _get_amblksiz(size_t *_Value);
-  _CRTIMP int __cdecl _heapadd(void *_Memory,size_t _Size);
-  _CRTIMP int __cdecl _heapchk(void);
-  _CRTIMP int __cdecl _heapmin(void);
-  _CRTIMP int __cdecl _heapset(unsigned int _Fill);
-  _CRTIMP int __cdecl _heapwalk(_HEAPINFO *_EntryInfo);
-  _CRTIMP size_t __cdecl _heapused(size_t *_Used,size_t *_Commit);
-  _CRTIMP intptr_t __cdecl _get_heap_handle(void);
+  _Ret_notnull_
+  _Post_writable_byte_size_(_Size)
+  void*
+  __cdecl
+  _alloca(
+    _In_ size_t _Size);
+#endif
+
+  _Check_return_
+  _CRTIMP
+  size_t
+  __cdecl
+  _get_sbh_threshold(void);
+
+  _CRTIMP
+  int
+  __cdecl
+  _set_sbh_threshold(
+    _In_ size_t _NewValue);
+
+  _CRTIMP
+  errno_t
+  __cdecl
+  _set_amblksiz(
+    _In_ size_t _Value);
+
+  _CRTIMP
+  errno_t
+  __cdecl
+  _get_amblksiz(
+    _Out_ size_t *_Value);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _heapadd(
+    _In_ void *_Memory,
+    _In_ size_t _Size);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _heapchk(void);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _heapmin(void);
+
+  _CRTIMP
+  int
+  __cdecl
+  _heapset(
+    _In_ unsigned int _Fill);
+
+  _CRTIMP
+  int
+  __cdecl
+  _heapwalk(
+    _Inout_ _HEAPINFO *_EntryInfo);
+
+  _CRTIMP
+  size_t
+  __cdecl
+  _heapused(
+    size_t *_Used,
+    size_t *_Commit);
+
+  _CRTIMP
+  intptr_t
+  __cdecl
+  _get_heap_handle(void);
 
 #define _ALLOCA_S_THRESHOLD 1024
 #define _ALLOCA_S_STACK_MARKER 0xCCCC
@@ -179,14 +367,18 @@ extern "C" {
   typedef int (__cdecl *_HEAPHOOK)(int,size_t,void *,void **);
 #endif
 
-  _CRTIMP _HEAPHOOK __cdecl _setheaphook(_HEAPHOOK _NewHook);
+  _CRTIMP
+  _HEAPHOOK
+  __cdecl
+  _setheaphook(
+    _In_opt_ _HEAPHOOK _NewHook);
 
-#define _HEAP_MALLOC 1
-#define _HEAP_CALLOC 2
-#define _HEAP_FREE 3
+#define _HEAP_MALLOC  1
+#define _HEAP_CALLOC  2
+#define _HEAP_FREE    3
 #define _HEAP_REALLOC 4
-#define _HEAP_MSIZE 5
-#define _HEAP_EXPAND 6
+#define _HEAP_MSIZE   5
+#define _HEAP_EXPAND  6
 #endif
 
 #ifdef __cplusplus
index 3b0a542..1eaf68a 100644 (file)
@@ -55,159 +55,182 @@ extern "C" {
 
 #ifndef _CRT_ABS_DEFINED
 #define _CRT_ABS_DEFINED
-  int __cdecl abs(int x);
-  long __cdecl labs(long x);
+  int __cdecl abs(_In_ int x);
+  long __cdecl labs(_In_ long x);
 #endif
-  double __cdecl acos(double x);
-  double __cdecl asin(double x);
-  double __cdecl atan(double x);
-  double __cdecl atan2(double y, double x);
-  double __cdecl cos(double x);
-  double __cdecl cosh(double x);
-  double __cdecl exp(double x);
-  double __cdecl fabs(double x);
-  double __cdecl fmod(double x, double y);
-  double __cdecl log(double x);
-  double __cdecl log10(double x);
-  double __cdecl pow(double x, double y);
-  double __cdecl sin(double x);
-  double __cdecl sinh(double x);
-  double __cdecl sqrt(double x);
-  double __cdecl tan(double x);
-  double __cdecl tanh(double x);
+
+  double __cdecl acos(_In_ double x);
+  double __cdecl asin(_In_ double x);
+  double __cdecl atan(_In_ double x);
+  double __cdecl atan2(_In_ double y, _In_ double x);
+  double __cdecl cos(_In_ double x);
+  double __cdecl cosh(_In_ double x);
+  double __cdecl exp(_In_ double x);
+  double __cdecl fabs(_In_ double x);
+  double __cdecl fmod(_In_ double x, _In_ double y);
+  double __cdecl log(_In_ double x);
+  double __cdecl log10(_In_ double x);
+  double __cdecl pow(_In_ double x, double y);
+  double __cdecl sin(_In_ double x);
+  double __cdecl sinh(_In_ double x);
+  double __cdecl sqrt(_In_ double x);
+  double __cdecl tan(_In_ double x);
+  double __cdecl tanh(_In_ double x);
+
 #ifndef _CRT_MATHERR_DEFINED
 #define _CRT_MATHERR_DEFINED
-  int __cdecl _matherr(struct _exception *except);
+  int __cdecl _matherr(_Inout_ struct _exception *except);
 #endif
 
 #ifndef _CRT_ATOF_DEFINED
 #define _CRT_ATOF_DEFINED
-  _CRTIMP double __cdecl atof(const char *str);
-  _CRTIMP double __cdecl _atof_l(const char *str ,_locale_t locale);
-#endif
+
+  _Check_return_
+  _CRTIMP
+  double
+  __cdecl
+  atof(
+    _In_z_ const char *str);
+
+  _Check_return_
+  _CRTIMP
+  double
+  __cdecl
+  _atof_l(
+    _In_z_ const char *str,
+    _In_opt_ _locale_t locale);
+
+#endif /* _CRT_ATOF_DEFINED */
+
 #ifndef _SIGN_DEFINED
 #define _SIGN_DEFINED
-  _CRTIMP double __cdecl _copysign(double x,double sgn);
-  _CRTIMP double __cdecl _chgsign(double x);
+  _Check_return_ _CRTIMP double __cdecl _copysign(_In_ double x, _In_ double sgn);
+  _Check_return_ _CRTIMP double __cdecl _chgsign(_In_ double x);
 #endif
-  _CRTIMP double __cdecl _cabs(struct _complex a);
-  _CRTIMP double __cdecl ceil(double x);
-  _CRTIMP double __cdecl floor(double x);
-  _CRTIMP double __cdecl frexp(double x, int *y);
-  _CRTIMP double __cdecl _hypot(double x, double y);
-  _CRTIMP double __cdecl _j0(double x);
-  _CRTIMP double __cdecl _j1(double x);
-  _CRTIMP double __cdecl _jn(int x, double y);
-  _CRTIMP double __cdecl ldexp(double x, int y);
-  _CRTIMP double __cdecl modf(double x, double *y);
-  _CRTIMP double __cdecl _y0(double x);
-  _CRTIMP double __cdecl _y1(double x);
-  _CRTIMP double __cdecl _yn(int x, double y);
-  _CRTIMP float __cdecl _hypotf(float x, float y);
+
+  _CRTIMP double __cdecl _cabs(_In_ struct _complex a);
+  _CRTIMP double __cdecl ceil(_In_ double x);
+  _CRTIMP double __cdecl floor(_In_ double x);
+  _CRTIMP double __cdecl frexp(_In_ double x, _Out_ int *y);
+  _CRTIMP double __cdecl _hypot(_In_ double x, _In_ double y);
+  _CRTIMP double __cdecl _j0(_In_ double x);
+  _CRTIMP double __cdecl _j1(_In_ double x);
+  _CRTIMP double __cdecl _jn(_In_ int x, _In_ double y);
+  _CRTIMP double __cdecl ldexp(_In_ double x, _In_ int y);
+  _CRTIMP double __cdecl modf(_In_ double x, _Out_ double *y);
+  _CRTIMP double __cdecl _y0(_In_ double x);
+  _CRTIMP double __cdecl _y1(_In_ double x);
+  _CRTIMP double __cdecl _yn(_In_ int x, _In_ double y);
+  _CRTIMP float __cdecl _hypotf(_In_ float x, _In_ float y);
 
 #if defined(__i386__) || defined(_M_IX86)
-  _CRTIMP int __cdecl _set_SSE2_enable(int flag);
+  _CRTIMP int __cdecl _set_SSE2_enable(_In_ int flag);
 #endif
 
 #if defined(__x86_64) || defined(_M_AMD64)
-  _CRTIMP float __cdecl _copysignf(float x, float sgn);
-  _CRTIMP float __cdecl _chgsignf(float x);
-  _CRTIMP float __cdecl _logbf(float x);
-  _CRTIMP float __cdecl _nextafterf(float x,float y);
-  _CRTIMP int __cdecl _finitef(float x);
-  _CRTIMP int __cdecl _isnanf(float x);
-  _CRTIMP int __cdecl _fpclassf(float x);
+  _CRTIMP float __cdecl _copysignf(_In_ float x, _In_ float sgn);
+  _CRTIMP float __cdecl _chgsignf(_In_ float x);
+  _CRTIMP float __cdecl _logbf(_In_ float x);
+  _CRTIMP float __cdecl _nextafterf(_In_ float x, _In_ float y);
+  _CRTIMP int __cdecl _finitef(_In_ float x);
+  _CRTIMP int __cdecl _isnanf(_In_ float x);
+  _CRTIMP int __cdecl _fpclassf(_In_ float x);
 #endif
 
 #if defined(__ia64__) || defined (_M_IA64)
-  _CRTIMP float __cdecl fabsf(float x);
-  _CRTIMP float __cdecl ldexpf(float x, int y);
-  _CRTIMP long double __cdecl tanl(long double x);
+  _CRTIMP float __cdecl fabsf(_In_ float x);
+  _CRTIMP float __cdecl ldexpf(_In_ float x, _In_ int y);
+  _CRTIMP long double __cdecl tanl(_In_ long double x);
 #else
-  __CRT_INLINE float __cdecl fabsf(float x) { return ((float)fabs((double)x)); }
-  __CRT_INLINE float __cdecl ldexpf(float x, int expn) { return (float)ldexp (x, expn); }
-  __CRT_INLINE long double tanl(long double x) { return (tan((double)x)); }
+  __CRT_INLINE float __cdecl fabsf(_In_ float x) { return ((float)fabs((double)x)); }
+  __CRT_INLINE float __cdecl ldexpf(_In_ float x, _In_ int expn) { return (float)ldexp(x, expn); }
+  __CRT_INLINE long double tanl(_In_ long double x) { return (tan((double)x)); }
 #endif
 
-#if (_WIN32_WINNT >= 0x600) && \
+#if (_WIN32_WINNT >= 0x600) &&                 \
     (defined(__x86_64) || defined(_M_AMD64) || \
      defined (__ia64__) || defined (_M_IA64))
-  _CRTIMP float __cdecl acosf(float x);
-  _CRTIMP float __cdecl asinf(float x);
-  _CRTIMP float __cdecl atanf(float x);
-  _CRTIMP float __cdecl atan2f(float x, float y);
-  _CRTIMP float __cdecl ceilf(float x);
-  _CRTIMP float __cdecl cosf(float x);
-  _CRTIMP float __cdecl coshf(float x);
-  _CRTIMP float __cdecl expf(float x);
-  _CRTIMP float __cdecl floorf(float x);
-  _CRTIMP float __cdecl fmodf(float x, float y);
-  _CRTIMP float __cdecl logf(float x);
-  _CRTIMP float __cdecl log10f(float x);
-  _CRTIMP float __cdecl modff(float x, float *y);
-  _CRTIMP float __cdecl powf(float b, float e);
-  _CRTIMP float __cdecl sinf(float x);
-  _CRTIMP float __cdecl sinhf(float x);
-  _CRTIMP float __cdecl sqrtf(float x);
-  _CRTIMP float __cdecl tanf(float x);
-  _CRTIMP float __cdecl tanhf(float x);
+
+  _CRTIMP float __cdecl acosf(_In_ float x);
+  _CRTIMP float __cdecl asinf(_In_ float x);
+  _CRTIMP float __cdecl atanf(_In_ float x);
+  _CRTIMP float __cdecl atan2f(_In_ float x, _In_ float y);
+  _CRTIMP float __cdecl ceilf(_In_ float x);
+  _CRTIMP float __cdecl cosf(_In_ float x);
+  _CRTIMP float __cdecl coshf(_In_ float x);
+  _CRTIMP float __cdecl expf(_In_ float x);
+  _CRTIMP float __cdecl floorf(_In_ float x);
+  _CRTIMP float __cdecl fmodf(_In_ float x, _In_ float y);
+  _CRTIMP float __cdecl logf(_In_ float x);
+  _CRTIMP float __cdecl log10f(_In_ float x);
+  _CRTIMP float __cdecl modff(_In_ float x, _Out_ float *y);
+  _CRTIMP float __cdecl powf(_In_ float b, _In_ float e);
+  _CRTIMP float __cdecl sinf(_In_ float x);
+  _CRTIMP float __cdecl sinhf(_In_ float x);
+  _CRTIMP float __cdecl sqrtf(_In_ float x);
+  _CRTIMP float __cdecl tanf(_In_ float x);
+  _CRTIMP float __cdecl tanhf(_In_ float x);
+
 #else
-  __CRT_INLINE float acosf(float x) { return ((float)acos((double)x)); }
-  __CRT_INLINE float asinf(float x) { return ((float)asin((double)x)); }
-  __CRT_INLINE float atanf(float x) { return ((float)atan((double)x)); }
-  __CRT_INLINE float atan2f(float x,float y) { return ((float)atan2((double)x,(double)y)); }
-  __CRT_INLINE float ceilf(float x) { return ((float)ceil((double)x)); }
-  __CRT_INLINE float cosf(float x) { return ((float)cos((double)x)); }
-  __CRT_INLINE float coshf(float x) { return ((float)cosh((double)x)); }
-  __CRT_INLINE float expf(float x) { return ((float)exp((double)x)); }
-  __CRT_INLINE float floorf(float x) { return ((float)floor((double)x)); }
-  __CRT_INLINE float fmodf(float x,float y) { return ((float)fmod((double)x,(double)y)); }
-  __CRT_INLINE float logf(float x) { return ((float)log((double)x)); }
-  __CRT_INLINE float log10f(float x) { return ((float)log10((double)x)); }
-  __CRT_INLINE float modff(float x,float *y) {
+
+  __CRT_INLINE float acosf(_In_ float x) { return ((float)acos((double)x)); }
+  __CRT_INLINE float asinf(_In_ float x) { return ((float)asin((double)x)); }
+  __CRT_INLINE float atanf(_In_ float x) { return ((float)atan((double)x)); }
+  __CRT_INLINE float atan2f(_In_ float x, _In_ float y) { return ((float)atan2((double)x,(double)y)); }
+  __CRT_INLINE float ceilf(_In_ float x) { return ((float)ceil((double)x)); }
+  __CRT_INLINE float cosf(_In_ float x) { return ((float)cos((double)x)); }
+  __CRT_INLINE float coshf(_In_ float x) { return ((float)cosh((double)x)); }
+  __CRT_INLINE float expf(_In_ float x) { return ((float)exp((double)x)); }
+  __CRT_INLINE float floorf(_In_ float x) { return ((float)floor((double)x)); }
+  __CRT_INLINE float fmodf(_In_ float x, _In_ float y) { return ((float)fmod((double)x,(double)y)); }
+  __CRT_INLINE float logf(_In_ float x) { return ((float)log((double)x)); }
+  __CRT_INLINE float log10f(_In_ float x) { return ((float)log10((double)x)); }
+  __CRT_INLINE float modff(_In_ float x, _Out_ float *y) {
     double _Di,_Df = modf((double)x,&_Di);
     *y = (float)_Di;
     return ((float)_Df);
   }
-  __CRT_INLINE float powf(float x,float y) { return ((float)pow((double)x,(double)y)); }
-  __CRT_INLINE float sinf(float x) { return ((float)sin((double)x)); }
-  __CRT_INLINE float sinhf(float x) { return ((float)sinh((double)x)); }
-  __CRT_INLINE float sqrtf(float x) { return ((float)sqrt((double)x)); }
-  __CRT_INLINE float tanf(float x) { return ((float)tan((double)x)); }
-  __CRT_INLINE float tanhf(float x) { return ((float)tanh((double)x)); }
+  __CRT_INLINE float powf(_In_ float x, _In_ float y) { return ((float)pow((double)x,(double)y)); }
+  __CRT_INLINE float sinf(_In_ float x) { return ((float)sin((double)x)); }
+  __CRT_INLINE float sinhf(_In_ float x) { return ((float)sinh((double)x)); }
+  __CRT_INLINE float sqrtf(_In_ float x) { return ((float)sqrt((double)x)); }
+  __CRT_INLINE float tanf(_In_ float x) { return ((float)tan((double)x)); }
+  __CRT_INLINE float tanhf(_In_ float x) { return ((float)tanh((double)x)); }
+
 #endif
 
-  __CRT_INLINE long double acosl(long double x) { return (acos((double)x)); }
-  __CRT_INLINE long double asinl(long double x) { return (asin((double)x)); }
-  __CRT_INLINE long double atanl(long double x) { return (atan((double)x)); }
-  __CRT_INLINE long double atan2l(long double y, long double x) { return (atan2((double)y, (double)x)); }
-  __CRT_INLINE long double ceill(long double x) { return (ceil((double)x)); }
-  __CRT_INLINE long double cosl(long double x) { return (cos((double)x)); }
-  __CRT_INLINE long double coshl(long double x) { return (cosh((double)x)); }
-  __CRT_INLINE long double expl(long double x) { return (exp((double)x)); }
-  __CRT_INLINE long double floorl(long double x) { return (floor((double)x)); }
-  __CRT_INLINE long double fmodl(long double x, long double y) { return (fmod((double)x, (double)y)); }
-  __CRT_INLINE long double frexpl(long double x, int *y) { return (frexp((double)x, y)); }
-  __CRT_INLINE long double logl(long double x) { return (log((double)x)); }
-  __CRT_INLINE long double log10l(long double x) { return (log10((double)x)); }
-  __CRT_INLINE long double powl(long double x, long double y) { return (pow((double)x, (double)y)); }
-  __CRT_INLINE long double sinl(long double x) { return (sin((double)x)); }
-  __CRT_INLINE long double sinhl(long double x) { return (sinh((double)x)); }
-  __CRT_INLINE long double sqrtl(long double x) { return (sqrt((double)x)); }
-  __CRT_INLINE long double tanhl(long double x) {return (tanh((double)x)); }
-  __CRT_INLINE long double __cdecl fabsl(long double x) { return fabs((double)x); }
-  __CRT_INLINE long double _chgsignl(long double _Number) { return _chgsign((double)(_Number)); }
-  __CRT_INLINE long double _copysignl(long double _Number, long double _Sign) { return _copysign((double)(_Number),(double)(_Sign)); }
-  __CRT_INLINE long double _hypotl(long double x,long double y) { return _hypot((double)(x),(double)(y)); }
-  __CRT_INLINE float frexpf(float x, int *y) { return ((float)frexp((double)x,y)); }
-  __CRT_INLINE long double ldexpl(long double x, int y) { return ldexp((double)x, y); }
-  __CRT_INLINE long double modfl(long double x,long double *y) {
+  __CRT_INLINE long double acosl(_In_ long double x) { return (acos((double)x)); }
+  __CRT_INLINE long double asinl(_In_ long double x) { return (asin((double)x)); }
+  __CRT_INLINE long double atanl(_In_ long double x) { return (atan((double)x)); }
+  __CRT_INLINE long double atan2l(_In_ long double y, _In_ long double x) { return (atan2((double)y, (double)x)); }
+  __CRT_INLINE long double ceill(_In_ long double x) { return (ceil((double)x)); }
+  __CRT_INLINE long double cosl(_In_ long double x) { return (cos((double)x)); }
+  __CRT_INLINE long double coshl(_In_ long double x) { return (cosh((double)x)); }
+  __CRT_INLINE long double expl(_In_ long double x) { return (exp((double)x)); }
+  __CRT_INLINE long double floorl(_In_ long double x) { return (floor((double)x)); }
+  __CRT_INLINE long double fmodl(_In_ long double x, _In_ long double y) { return (fmod((double)x, (double)y)); }
+  __CRT_INLINE long double frexpl(_In_ long double x, _Out_ int *y) { return (frexp((double)x, y)); }
+  __CRT_INLINE long double logl(_In_ long double x) { return (log((double)x)); }
+  __CRT_INLINE long double log10l(_In_ long double x) { return (log10((double)x)); }
+  __CRT_INLINE long double powl(_In_ long double x, _In_ long double y) { return (pow((double)x, (double)y)); }
+  __CRT_INLINE long double sinl(_In_ long double x) { return (sin((double)x)); }
+  __CRT_INLINE long double sinhl(_In_ long double x) { return (sinh((double)x)); }
+  __CRT_INLINE long double sqrtl(_In_ long double x) { return (sqrt((double)x)); }
+  __CRT_INLINE long double tanhl(_In_ long double x) {return (tanh((double)x)); }
+  __CRT_INLINE long double __cdecl fabsl(_In_ long double x) { return fabs((double)x); }
+  __CRT_INLINE long double _chgsignl(_In_ long double _Number) { return _chgsign((double)(_Number)); }
+  __CRT_INLINE long double _copysignl(_In_ long double _Number, _In_ long double _Sign) { return _copysign((double)(_Number),(double)(_Sign)); }
+  __CRT_INLINE long double _hypotl(_In_ long double x, _In_ long double y) { return _hypot((double)(x),(double)(y)); }
+  __CRT_INLINE float frexpf(_In_ float x, _Out_ int *y) { return ((float)frexp((double)x,y)); }
+  __CRT_INLINE long double ldexpl(_In_ long double x, _In_ int y) { return ldexp((double)x, y); }
+  __CRT_INLINE long double modfl(_In_ long double x, _Out_ long double *y) {
     double _Di,_Df = modf((double)x,&_Di);
     *y = (long double)_Di;
     return (_Df);
   }
 
-#ifndef        NO_OLDNAMES
+#ifndef NO_OLDNAMES
+
 #define DOMAIN _DOMAIN
 #define SING _SING
 #define OVERFLOW _OVERFLOW
@@ -218,15 +241,17 @@ extern "C" {
 #define HUGE _HUGE
   // _CRTIMP double __cdecl cabs(struct _complex x);
   #define cabs _cabs
-  _CRTIMP double __cdecl hypot(double x,double y);
-  _CRTIMP double __cdecl j0(double x);
-  _CRTIMP double __cdecl j1(double x);
-  _CRTIMP double __cdecl jn(int x,double y);
-  _CRTIMP double __cdecl y0(double x);
-  _CRTIMP double __cdecl y1(double x);
-  _CRTIMP double __cdecl yn(int x,double y);
-  __CRT_INLINE float __cdecl hypotf(float x, float y) { return (float) hypot (x, y); }
-#endif
+
+  _CRTIMP double __cdecl hypot(_In_ double x, _In_ double y);
+  _CRTIMP double __cdecl j0(_In_ double x);
+  _CRTIMP double __cdecl j1(_In_ double x);
+  _CRTIMP double __cdecl jn(_In_ int x, _In_ double y);
+  _CRTIMP double __cdecl y0(_In_ double x);
+  _CRTIMP double __cdecl y1(_In_ double x);
+  _CRTIMP double __cdecl yn(_In_ int x, _In_ double y);
+  __CRT_INLINE float __cdecl hypotf(_In_ float x, _In_ float y) { return (float) hypot(x, y); }
+
+#endif /* NO_OLDNAMES */
 
 #ifdef __cplusplus
 }
index f39c66f..7a7a709 100644 (file)
@@ -17,8 +17,8 @@ extern "C" {
 #if 1
 #if defined (_DLL) && defined (_M_IX86)
   /* Retained for compatibility with VC++ 5.0 and earlier versions */
-  _CRTIMP unsigned char * __cdecl __p__mbctype(void);
-  _CRTIMP unsigned char * __cdecl __p__mbcasemap(void);
+  _Check_return_ _CRTIMP unsigned char * __cdecl __p__mbctype(void);
+  _Check_return_ _CRTIMP unsigned char * __cdecl __p__mbcasemap(void);
 #endif  /* defined (_DLL) && defined (_M_IX86) */
 #endif
 #ifndef _mbctype
@@ -70,40 +70,225 @@ extern "C" {
 #ifndef _MBCTYPE_DEFINED
 #define _MBCTYPE_DEFINED
 
-  _CRTIMP int __cdecl _setmbcp(int _CodePage);
-  _CRTIMP int __cdecl _getmbcp(void);
-  _CRTIMP int __cdecl _ismbbkalnum(unsigned int _C);
-  _CRTIMP int __cdecl _ismbbkalnum_l(unsigned int _C,_locale_t _Locale);
-  _CRTIMP int __cdecl _ismbbkana(unsigned int _C);
-  _CRTIMP int __cdecl _ismbbkana_l(unsigned int _C,_locale_t _Locale);
-  _CRTIMP int __cdecl _ismbbkpunct(unsigned int _C);
-  _CRTIMP int __cdecl _ismbbkpunct_l(unsigned int _C,_locale_t _Locale);
-  _CRTIMP int __cdecl _ismbbkprint(unsigned int _C);
-  _CRTIMP int __cdecl _ismbbkprint_l(unsigned int _C,_locale_t _Locale);
-  _CRTIMP int __cdecl _ismbbalpha(unsigned int _C);
-  _CRTIMP int __cdecl _ismbbalpha_l(unsigned int _C,_locale_t _Locale);
-  _CRTIMP int __cdecl _ismbbpunct(unsigned int _C);
-  _CRTIMP int __cdecl _ismbbpunct_l(unsigned int _C,_locale_t _Locale);
-  _CRTIMP int __cdecl _ismbbalnum(unsigned int _C);
-  _CRTIMP int __cdecl _ismbbalnum_l(unsigned int _C,_locale_t _Locale);
-  _CRTIMP int __cdecl _ismbbprint(unsigned int _C);
-  _CRTIMP int __cdecl _ismbbprint_l(unsigned int _C,_locale_t _Locale);
-  _CRTIMP int __cdecl _ismbbgraph(unsigned int _C);
-  _CRTIMP int __cdecl _ismbbgraph_l(unsigned int _C,_locale_t _Locale);
+  _CRTIMP
+  int
+  __cdecl
+  _setmbcp(
+    _In_ int _CodePage);
+
+  _CRTIMP
+  int
+  __cdecl
+  _getmbcp(void);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbkalnum(
+    _In_ unsigned int _C);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbkalnum_l(
+    _In_ unsigned int _C,
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbkana(
+    _In_ unsigned int _C);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbkana_l(
+    _In_ unsigned int _C,
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbkpunct(
+    _In_ unsigned int _C);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbkpunct_l(
+    _In_ unsigned int _C,
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbkprint(
+    _In_ unsigned int _C);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbkprint_l(
+    _In_ unsigned int _C,
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbalpha(
+    _In_ unsigned int _C);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbalpha_l(
+    _In_ unsigned int _C,
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbpunct(
+    _In_ unsigned int _C);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbpunct_l(
+    _In_ unsigned int _C,
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbalnum(
+    _In_ unsigned int _C);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbalnum_l(
+    _In_ unsigned int _C,
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbprint(
+    _In_ unsigned int _C);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbprint_l(
+    _In_ unsigned int _C,
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbgraph(
+    _In_ unsigned int _C);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbgraph_l(
+    _In_ unsigned int _C,
+    _In_opt_ _locale_t _Locale);
+
 #ifndef _MBLEADTRAIL_DEFINED
 #define _MBLEADTRAIL_DEFINED
-  _CRTIMP int __cdecl _ismbblead(unsigned int _C);
-  _CRTIMP int __cdecl _ismbblead_l(unsigned int _C,_locale_t _Locale);
-  _CRTIMP int __cdecl _ismbbtrail(unsigned int _C);
-  _CRTIMP int __cdecl _ismbbtrail_l(unsigned int _C,_locale_t _Locale);
-  _CRTIMP int __cdecl _ismbslead(const unsigned char *_Str,const unsigned char *_Pos);
-  _CRTIMP int __cdecl _ismbslead_l(const unsigned char *_Str,const unsigned char *_Pos,_locale_t _Locale);
-  _CRTIMP int __cdecl _ismbstrail(const unsigned char *_Str,const unsigned char *_Pos);
-  _CRTIMP int __cdecl _ismbstrail_l(const unsigned char *_Str,const unsigned char *_Pos,_locale_t _Locale);
-#endif
-#endif
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbblead(
+    _In_ unsigned int _C);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbblead_l(
+    _In_ unsigned int _C,
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbtrail(
+    _In_ unsigned int _C);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbbtrail_l(
+    _In_ unsigned int _C,
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbslead(
+    _In_reads_z_(_Pos - _Str + 1) const unsigned char *_Str,
+    _In_z_ const unsigned char *_Pos);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbslead_l(
+    _In_reads_z_(_Pos - _Str + 1) const unsigned char *_Str,
+    _In_z_ const unsigned char *_Pos,
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbstrail(
+    _In_reads_z_(_Pos - _Str + 1) const unsigned char *_Str,
+    _In_z_ const unsigned char *_Pos);
+
+  _Check_return_
+  _CRTIMP
+  int
+  __cdecl
+  _ismbstrail_l(
+    _In_reads_z_(_Pos - _Str + 1) const unsigned char *_Str,
+    _In_z_ const unsigned char *_Pos,
+    _In_opt_ _locale_t _Locale);
+
+#endif /* _MBLEADTRAIL_DEFINED */
+
+#endif /* _MBCTYPE_DEFINED */
 
 #ifdef __cplusplus
 }
 #endif
-#endif
+
+#endif /* _INC_MBCTYPE */
index 2601746..2f2697b 100644 (file)
 extern "C" {
 #endif
 
-  _CRTIMP errno_t __cdecl _dupenv_s(char **_PBuffer,size_t *_PBufferSizeInBytes,const char *_VarName);
-  _CRTIMP errno_t __cdecl _itoa_s(int _Value,char *_DstBuf,size_t _Size,int _Radix);
-  _CRTIMP errno_t __cdecl _i64toa_s(__int64 _Val,char *_DstBuf,size_t _Size,int _Radix);
-  _CRTIMP errno_t __cdecl _ui64toa_s(unsigned __int64 _Val,char *_DstBuf,size_t _Size,int _Radix);
-  _CRTIMP errno_t __cdecl _ltoa_s(long _Val,char *_DstBuf,size_t _Size,int _Radix);
-  _CRTIMP errno_t __cdecl mbstowcs_s(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount);
-  _CRTIMP errno_t __cdecl _mbstowcs_s_l(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount,_locale_t _Locale);
-  _CRTIMP errno_t __cdecl _ultoa_s(unsigned long _Val,char *_DstBuf,size_t _Size,int _Radix);
-  _CRTIMP errno_t __cdecl _wctomb_s_l(int *_SizeConverted,char *_MbCh,size_t _SizeInBytes,wchar_t _WCh,_locale_t _Locale);
-  _CRTIMP errno_t __cdecl wcstombs_s(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes);
-  _CRTIMP errno_t __cdecl _wcstombs_s_l(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes,_locale_t _Locale);
+  _Check_return_opt_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _dupenv_s(
+    _Outptr_result_buffer_maybenull_(*_PBufferSizeInBytes) _Outptr_result_z_ char **_PBuffer,
+    _Out_opt_ size_t *_PBufferSizeInBytes,
+    _In_z_ const char *_VarName);
+
+  _Check_return_opt_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _itoa_s(
+    _In_ int _Value,
+    _Out_writes_z_(_Size) char *_DstBuf,
+    _In_ size_t _Size,
+    _In_ int _Radix);
+
+  _Check_return_opt_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _i64toa_s(
+    _In_ __int64 _Val,
+    _Out_writes_z_(_Size) char *_DstBuf,
+    _In_ size_t _Size,
+    _In_ int _Radix);
+
+  _Check_return_opt_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _ui64toa_s(
+    _In_ unsigned __int64 _Val,
+    _Out_writes_z_(_Size) char *_DstBuf,
+    _In_ size_t _Size,
+    _In_ int _Radix);
+
+  _Check_return_opt_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _ltoa_s(
+    _In_ long _Val,
+    _Out_writes_z_(_Size) char *_DstBuf,
+    _In_ size_t _Size,
+    _In_ int _Radix);
+
+  _Success_(return!=EINVAL)
+  _Check_return_opt_
+  _CRTIMP
+  errno_t
+  __cdecl
+  mbstowcs_s(
+    _Out_opt_ size_t *pcchConverted,
+    _Out_writes_to_opt_(sizeInWords, *pcchConverted) wchar_t *pwcstr,
+    _In_ size_t sizeInWords,
+    _In_reads_or_z_(count) const char *pmbstr,
+    _In_ size_t count);
+
+  _Check_return_opt_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _mbstowcs_s_l(
+    _Out_opt_ size_t *_PtNumOfCharConverted,
+    _Out_writes_to_opt_(_SizeInWords, *_PtNumOfCharConverted) wchar_t *_DstBuf,
+    _In_ size_t _SizeInWords,
+    _In_reads_or_z_(_MaxCount) const char *_SrcBuf,
+    _In_ size_t _MaxCount,
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_opt_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _ultoa_s(
+    _In_ unsigned long _Val,
+    _Out_writes_z_(_Size) char *_DstBuf,
+    _In_ size_t _Size,
+    _In_ int _Radix);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _wctomb_s_l(
+    _Out_opt_ int *_SizeConverted,
+    _Out_writes_opt_z_(_SizeInBytes) char *_MbCh,
+    _In_ size_t _SizeInBytes,
+    _In_ wchar_t _WCh,
+    _In_opt_ _locale_t _Locale);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  wcstombs_s(
+    _Out_opt_ size_t *_PtNumOfCharConverted,
+    _Out_writes_bytes_to_opt_(_DstSizeInBytes, *_PtNumOfCharConverted) char *_Dst,
+    _In_ size_t _DstSizeInBytes,
+    _In_z_ const wchar_t *_Src,
+    _In_ size_t _MaxCountInBytes);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _wcstombs_s_l(
+    _Out_opt_ size_t *_PtNumOfCharConverted,
+    _Out_writes_bytes_to_opt_(_DstSizeInBytes, *_PtNumOfCharConverted) char *_Dst,
+    _In_ size_t _DstSizeInBytes,
+    _In_z_ const wchar_t *_Src,
+    _In_ size_t _MaxCountInBytes,
+    _In_opt_ _locale_t _Locale);
 
 #ifndef _WSTDLIB_S_DEFINED
 #define _WSTDLIB_S_DEFINED
-  _CRTIMP errno_t __cdecl _itow_s (int _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
-  _CRTIMP errno_t __cdecl _ltow_s (long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
-  _CRTIMP errno_t __cdecl _ultow_s (unsigned long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
-  _CRTIMP errno_t __cdecl _wgetenv_s(size_t *_ReturnSize,wchar_t *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName);
-  _CRTIMP errno_t __cdecl _wdupenv_s(wchar_t **_Buffer,size_t *_BufferSizeInWords,const wchar_t *_VarName);
-  _CRTIMP errno_t __cdecl _i64tow_s(__int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
-  _CRTIMP errno_t __cdecl _ui64tow_s(unsigned __int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
-#endif
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _itow_s(
+    _In_ int _Val,
+    _Out_writes_z_(_SizeInWords) wchar_t *_DstBuf,
+    _In_ size_t _SizeInWords,
+    _In_ int _Radix);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _ltow_s(
+    _In_ long _Val,
+    _Out_writes_z_(_SizeInWords) wchar_t *_DstBuf,
+    _In_ size_t _SizeInWords,
+    _In_ int _Radix);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _ultow_s(
+    _In_ unsigned long _Val,
+    _Out_writes_z_(_SizeInWords) wchar_t *_DstBuf,
+    _In_ size_t _SizeInWords,
+    _In_ int _Radix);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _wgetenv_s(
+    _Out_ size_t *_ReturnSize,
+    _Out_writes_opt_z_(_DstSizeInWords) wchar_t *_DstBuf,
+    _In_ size_t _DstSizeInWords,
+    _In_z_ const wchar_t *_VarName);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _wdupenv_s(
+    _Outptr_result_buffer_maybenull_(*_BufferSizeInWords) _Outptr_result_z_ wchar_t **_Buffer,
+    _Out_opt_ size_t *_BufferSizeInWords,
+    _In_z_ const wchar_t *_VarName);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _i64tow_s(
+    _In_ __int64 _Val,
+    _Out_writes_z_(_SizeInWords) wchar_t *_DstBuf,
+    _In_ size_t _SizeInWords,
+    _In_ int _Radix);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _ui64tow_s(
+    _In_ unsigned __int64 _Val,
+    _Out_writes_z_(_SizeInWords) wchar_t *_DstBuf,
+    _In_ size_t _SizeInWords,
+    _In_ int _Radix);
+
+#endif /* _WSTDLIB_S_DEFINED */
 
 #ifndef _POSIX_
-  _CRTIMP errno_t __cdecl _ecvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDights,int *_PtDec,int *_PtSign);
-  _CRTIMP errno_t __cdecl _fcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDec,int *_PtDec,int *_PtSign);
-  _CRTIMP errno_t __cdecl _gcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDigits);
-  _CRTIMP errno_t __cdecl _makepath_s(char *_PathResult,size_t _Size,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext);
-  _CRTIMP errno_t __cdecl _putenv_s(const char *_Name,const char *_Value);
-  _CRTIMP errno_t __cdecl _searchenv_s(const char *_Filename,const char *_EnvVar,char *_ResultPath,size_t _SizeInBytes);
-  _CRTIMP errno_t __cdecl _splitpath_s(const char *_FullPath,char *_Drive,size_t _DriveSize,char *_Dir,size_t _DirSize,char *_Filename,size_t _FilenameSize,char *_Ext,size_t _ExtSize);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _ecvt_s(
+    _Out_writes_z_(_Size) char *_DstBuf,
+    _In_ size_t _Size,
+    _In_ double _Val,
+    _In_ int _NumOfDights,
+    _Out_ int *_PtDec,
+    _Out_ int *_PtSign);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _fcvt_s(
+    _Out_writes_z_(_Size) char *_DstBuf,
+    _In_ size_t _Size,
+    _In_ double _Val,
+    _In_ int _NumOfDec,
+    _Out_ int *_PtDec,
+    _Out_ int *_PtSign);
+
+  _CRTIMP
+  errno_t
+  __cdecl
+  _gcvt_s(
+    _Out_writes_z_(_Size) char *_DstBuf,
+    _In_ size_t _Size,
+    _In_ double _Val,
+    _In_ int _NumOfDigits);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _makepath_s(
+    _Out_writes_z_(_Size) char *_PathResult,
+    _In_ size_t _Size,
+    _In_opt_z_ const char *_Drive,
+    _In_opt_z_ const char *_Dir,
+    _In_opt_z_ const char *_Filename,
+    _In_opt_z_ const char *_Ext);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _putenv_s(
+    _In_z_ const char *_Name,
+    _In_z_ const char *_Value);
+
+  _CRTIMP
+  errno_t
+  __cdecl
+  _searchenv_s(
+    _In_z_ const char *_Filename,
+    _In_z_ const char *_EnvVar,
+    _Out_writes_z_(_SizeInBytes) char *_ResultPath,
+    _In_ size_t _SizeInBytes);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _splitpath_s(
+    _In_z_ const char *_FullPath,
+    _Out_writes_opt_z_(_DriveSize) char *_Drive,
+    _In_ size_t _DriveSize,
+    _Out_writes_opt_z_(_DirSize) char *_Dir,
+    _In_ size_t _DirSize,
+    _Out_writes_opt_z_(_FilenameSize) char *_Filename,
+    _In_ size_t _FilenameSize,
+    _Out_writes_opt_z_(_ExtSize) char *_Ext,
+    _In_ size_t _ExtSize);
 
 #ifndef _WSTDLIBP_S_DEFINED
 #define _WSTDLIBP_S_DEFINED
-  _CRTIMP errno_t __cdecl _wmakepath_s(wchar_t *_PathResult,size_t _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext);
-  _CRTIMP errno_t __cdecl _wputenv_s(const wchar_t *_Name,const wchar_t *_Value);
-  _CRTIMP errno_t __cdecl _wsearchenv_s(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords);
-  _CRTIMP errno_t __cdecl _wsplitpath_s(const wchar_t *_FullPath,wchar_t *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t _DirSizeInWords,wchar_t *_Filename,size_t _FilenameSizeInWords,wchar_t *_Ext,size_t _ExtSizeInWords);
-#endif
-#endif
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _wmakepath_s(
+    _Out_writes_z_(_SizeInWords) wchar_t *_PathResult,
+    _In_ size_t _SizeInWords,
+    _In_opt_z_ const wchar_t *_Drive,
+    _In_opt_z_ const wchar_t *_Dir,
+    _In_opt_z_ const wchar_t *_Filename,
+    _In_opt_z_ const wchar_t *_Ext);
+
+  _Check_return_wat_
+  _CRTIMP
+  errno_t
+  __cdecl
+  _wputenv_s(
+    _In_z_ const wchar_t *_Name,
+    _In_z_ const wchar_t *_Value);
+
+  _CRTIMP
+  errno_t
+  __cdecl
+  _wsearchenv_s(
+    _In_z_ const wchar_t *_Filename,
+    _In_z_ const wchar_t *_EnvVar,
+    _Out_writes_z_(_SizeInWords) wchar_t *_ResultPath,
+    _In_ size_t _SizeInWords);
+
+  _CRTIMP
+  errno_t
+  __cdecl
+  _wsplitpath_s(
+    _In_z_ const wchar_t *_FullPath,
+    _Out_writes_opt_z_(_DriveSizeInWords) wchar_t *_Drive,
+    _In_ size_t _DriveSizeInWords,
+    _Out_writes_opt_z_(_DirSizeInWords) wchar_t *_Dir,
+    _In_ size_t _DirSizeInWords,
+    _Out_writes_opt_z_(_FilenameSizeInWords) wchar_t *_Filename,
+    _In_ size_t _FilenameSizeInWords,
+    _Out_writes_opt_z_(_ExtSizeInWords) wchar_t *_Ext,
+    _In_ size_t _ExtSizeInWords);
+
+#endif /* _WSTDLIBP_S_DEFINED */
+
+#endif /* _POSIX_ */
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif
-#endif
+#endif /* defined(MINGW_HAS_SECURE_API) */
+
+#endif /* _INC_STDLIB_S */
index 1ee091d..cd19728 100644 (file)
@@ -131,11 +131,11 @@ extern "C" {
 
   typedef void (__cdecl *_purecall_handler)(void);
 
-  _CRTIMP _purecall_handler __cdecl _set_purecall_handler(_purecall_handler _Handler);
+  _CRTIMP _purecall_handler __cdecl _set_purecall_handler(_In_opt_ _purecall_handler _Handler);
   _CRTIMP _purecall_handler __cdecl _get_purecall_handler(void);
 
   typedef void (__cdecl *_invalid_parameter_handler)(const wchar_t *,const wchar_t *,const wchar_t *,unsigned int,uintptr_t);
-  _invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_invalid_parameter_handler _Handler);
+  _invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_In_opt_ _invalid_parameter_handler _Handler);
   _invalid_parameter_handler __cdecl _get_invalid_parameter_handler(void);
 
 #include <errno.h>
@@ -186,8 +186,8 @@ extern "C" {
 
   _CRTIMP errno_t __cdecl _get_environ(_Out_ char***);
   _CRTIMP errno_t __cdecl _get_wenviron(_Out_ wchar_t***);
-  _CRTIMP errno_t __cdecl _get_pgmptr(_Deref_out_z_ char **_Value);
-  _CRTIMP errno_t __cdecl _get_wpgmptr(_Deref_out_z_ wchar_t **_Value);
+  _CRTIMP errno_t __cdecl _get_pgmptr(_Outptr_result_z_ char **_Value);
+  _CRTIMP errno_t __cdecl _get_wpgmptr(_Outptr_result_z_ wchar_t **_Value);
 
 #ifdef _M_CEE_PURE
   _CRTIMP int* __cdecl __p__fmode();
@@ -330,7 +330,7 @@ extern "C" {
   void
   __cdecl
   qsort(
-    _Inout_updates_bytes_(_NumOfElements * _SizeOfElements) void *_Base,
+    _Inout_updates_bytes_(_NumOfElements * _SizeOfElements) _Post_readable_byte_size_(_NumOfElements * _SizeOfElements) void *_Base,
     _In_ size_t _NumOfElements,
     _In_ size_t _SizeOfElements,
     _In_ int (__cdecl *_PtFuncCompare)(const void *,const void *));
@@ -464,6 +464,7 @@ extern "C" {
 
 #endif /* _INTEGRAL_MAX_BITS >= 64 */
 
+  _Check_return_
   ldiv_t
   __cdecl
   ldiv(
@@ -710,6 +711,7 @@ extern "C" {
   malloc(
     _In_ size_t _Size);
 
+  _Success_(return != 0)
   _Check_return_
   _Ret_maybenull_
   _Post_writable_byte_size_(_NewSize)
@@ -719,6 +721,7 @@ extern "C" {
     _Pre_maybenull_ _Post_invalid_ void *_Memory,
     _In_ size_t _NewSize);
 
+  _Success_(return != 0)
   _Check_return_
   _Ret_maybenull_
   _Post_writable_byte_size_(_Count * _Size)
@@ -768,6 +771,7 @@ extern "C" {
     _In_ size_t _Alignment,
     _In_ size_t _Offset);
 
+  _Success_(return != 0)
   _Check_return_
   _Ret_maybenull_
   _Post_writable_byte_size_(_Size)
@@ -779,6 +783,7 @@ extern "C" {
     _In_ size_t _Size,
     _In_ size_t _Alignment);
 
+  _Success_(return != 0)
   _Check_return_
   _Ret_maybenull_
   _Post_writable_byte_size_(_Count * _Size)
@@ -791,6 +796,7 @@ extern "C" {
     _In_ size_t _Size,
     _In_ size_t _Alignment);
 
+  _Success_(return != 0)
   _Check_return_
   _Ret_maybenull_
   _Post_writable_byte_size_(_Size)
@@ -1143,12 +1149,14 @@ extern "C" {
     _In_z_ char *_Str,
     _In_opt_ _locale_t _Locale);
 
+  _Check_return_
   unsigned long
   __cdecl
   _lrotl(
     _In_ unsigned long _Val,
     _In_ int _Shift);
 
+  _Check_return_
   unsigned long
   __cdecl
   _lrotr(
@@ -1426,10 +1434,10 @@ extern "C" {
 
   __MINGW_EXTENSION typedef struct { long long quot, rem; } lldiv_t;
 
-  __MINGW_EXTENSION lldiv_t __cdecl lldiv(long long, long long);
+  _Check_return_ __MINGW_EXTENSION lldiv_t __cdecl lldiv(_In_ long long, _In_ long long);
 
 #ifndef _MSC_VER
-  __MINGW_EXTENSION __CRT_INLINE long long __cdecl llabs(long long _j) { return (_j >= 0 ? _j : -_j); }
+  __MINGW_EXTENSION __CRT_INLINE long long __cdecl llabs(_In_ long long _j) { return (_j >= 0 ? _j : -_j); }
 #endif
 
   __MINGW_EXTENSION long long  __cdecl strtoll(const char* __restrict__, char** __restrict, int);
index ae16656..7f14963 100644 (file)
@@ -150,9 +150,11 @@ typedef struct _PROCESSOR_IDLE_TIMES {
   ULONG IdleHandlerReserved[4];
 } PROCESSOR_IDLE_TIMES, *PPROCESSOR_IDLE_TIMES;
 
-typedef BOOLEAN
-(FASTCALL*PPROCESSOR_IDLE_HANDLER)(
-  IN OUT PPROCESSOR_IDLE_TIMES IdleTimes);
+_Function_class_(PROCESSOR_IDLE_HANDLER)
+typedef NTSTATUS
+(FASTCALL *PPROCESSOR_IDLE_HANDLER)(
+  _In_ ULONG_PTR Context,
+  _Inout_ PPROCESSOR_IDLE_TIMES IdleTimes);
 
 typedef struct _PROCESSOR_IDLE_HANDLER_INFO {
   ULONG HardwareLatency;
@@ -188,17 +190,21 @@ typedef enum _POWER_STATE_HANDLER_TYPE {
   PowerStateMaximum
 } POWER_STATE_HANDLER_TYPE, *PPOWER_STATE_HANDLER_TYPE;
 
+_Function_class_(ENTER_STATE_SYSTEM_HANDLER)
+_IRQL_requires_same_
 typedef NTSTATUS
-(NTAPI*PENTER_STATE_SYSTEM_HANDLER)(
-  IN PVOID SystemContext);
+(NTAPI *PENTER_STATE_SYSTEM_HANDLER)(
+  _In_ PVOID SystemContext);
 
+_Function_class_(ENTER_STATE_HANDLER)
+_IRQL_requires_same_
 typedef NTSTATUS
-(NTAPI*PENTER_STATE_HANDLER)(
-  IN PVOID Context,
-  IN PENTER_STATE_SYSTEM_HANDLER SystemHandler OPTIONAL,
-  IN PVOID SystemContext,
-  IN LONG NumberProcessors,
-  IN LONG volatile *Number);
+(NTAPI *PENTER_STATE_HANDLER)(
+  _In_opt_ PVOID Context,
+  _In_opt_ PENTER_STATE_SYSTEM_HANDLER SystemHandler,
+  _In_opt_ PVOID SystemContext,
+  _In_ LONG NumberProcessors,
+  _In_opt_ LONG volatile *Number);
 
 typedef struct _POWER_STATE_HANDLER {
   POWER_STATE_HANDLER_TYPE Type;
@@ -208,26 +214,30 @@ typedef struct _POWER_STATE_HANDLER {
   PVOID Context;
 } POWER_STATE_HANDLER, *PPOWER_STATE_HANDLER;
 
+_Function_class_(ENTER_STATE_NOTIFY_HANDLER)
+_IRQL_requires_same_
 typedef NTSTATUS
-(NTAPI*PENTER_STATE_NOTIFY_HANDLER)(
-  IN POWER_STATE_HANDLER_TYPE State,
-  IN PVOID Context,
-  IN BOOLEAN Entering);
+(NTAPI *PENTER_STATE_NOTIFY_HANDLER)(
+  _In_ POWER_STATE_HANDLER_TYPE State,
+  _In_ PVOID Context,
+  _In_ BOOLEAN Entering);
 
 typedef struct _POWER_STATE_NOTIFY_HANDLER {
   PENTER_STATE_NOTIFY_HANDLER Handler;
   PVOID Context;
 } POWER_STATE_NOTIFY_HANDLER, *PPOWER_STATE_NOTIFY_HANDLER;
 
+_IRQL_requires_max_(APC_LEVEL)
+__kernel_entry
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtPowerInformation(
-  IN POWER_INFORMATION_LEVEL InformationLevel,
-  IN PVOID InputBuffer OPTIONAL,
-  IN ULONG InputBufferLength,
-  OUT PVOID OutputBuffer OPTIONAL,
-  IN ULONG OutputBufferLength);
+  _In_ POWER_INFORMATION_LEVEL InformationLevel,
+  _In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer,
+  _In_ ULONG InputBufferLength,
+  _Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer,
+  _In_ ULONG OutputBufferLength);
 
 #define PROCESSOR_STATE_TYPE_PERFORMANCE  1
 #define PROCESSOR_STATE_TYPE_THROTTLE     2
@@ -261,49 +271,59 @@ typedef struct _PROCESSOR_STATE_HANDLER2 {
   PROCESSOR_PERF_LEVEL PerfLevel[1];
 } PROCESSOR_STATE_HANDLER2, *PPROCESSOR_STATE_HANDLER2;
 
+_IRQL_requires_max_(PASSIVE_LEVEL)
+__kernel_entry
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtSetThreadExecutionState(
-  IN EXECUTION_STATE esFlags,
-  OUT EXECUTION_STATE *PreviousFlags);
+  _In_ EXECUTION_STATE esFlags,
+  _Out_ EXECUTION_STATE *PreviousFlags);
 
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtRequestWakeupLatency(
-  IN LATENCY_TIME latency);
+  _In_ LATENCY_TIME latency);
 
+_IRQL_requires_max_(APC_LEVEL)
+__kernel_entry
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtInitiatePowerAction(
-  IN POWER_ACTION SystemAction,
-  IN SYSTEM_POWER_STATE MinSystemState,
-  IN ULONG Flags,
-  IN BOOLEAN Asynchronous);
+  _In_ POWER_ACTION SystemAction,
+  _In_ SYSTEM_POWER_STATE MinSystemState,
+  _In_ ULONG Flags,
+  _In_ BOOLEAN Asynchronous);
 
+_IRQL_requires_max_(APC_LEVEL)
+__kernel_entry
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtSetSystemPowerState(
-  IN POWER_ACTION SystemAction,
-  IN SYSTEM_POWER_STATE MinSystemState,
-  IN ULONG Flags);
+  _In_ POWER_ACTION SystemAction,
+  _In_ SYSTEM_POWER_STATE MinSystemState,
+  _In_ ULONG Flags);
 
+_IRQL_requires_max_(APC_LEVEL)
+__kernel_entry
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtGetDevicePowerState(
-  IN HANDLE Device,
-  OUT DEVICE_POWER_STATE *State);
+  _In_ HANDLE Device,
+  _Out_ DEVICE_POWER_STATE *State);
 
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtCancelDeviceWakeupRequest(
-  IN HANDLE Device);
+  _In_ HANDLE Device);
 
+_IRQL_requires_max_(APC_LEVEL)
+__kernel_entry
 NTSYSCALLAPI
 BOOLEAN
 NTAPI
@@ -313,7 +333,7 @@ NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtRequestDeviceWakeup(
-  IN HANDLE Device);
+  _In_ HANDLE Device);
 
 #define WINLOGON_LOCK_ON_SLEEP            0x00000001
 
index 371ecc4..f97140d 100644 (file)
@@ -163,28 +163,40 @@ typedef struct _BATTERY_STATUS {
 #define BATTERY_CLASS_MAJOR_VERSION       0x0001
 #define BATTERY_CLASS_MINOR_VERSION       0x0000
 
+_Function_class_(BCLASS_QUERY_TAG_CALLBACK)
+_IRQL_requires_same_
+_IRQL_requires_max_(PASSIVE_LEVEL)
+_Check_return_
 typedef NTSTATUS
 (NTAPI BCLASS_QUERY_TAG_CALLBACK)(
-  IN PVOID Context,
-  OUT PULONG BatteryTag);
+  _In_ PVOID Context,
+  _Out_ PULONG BatteryTag);
 typedef BCLASS_QUERY_TAG_CALLBACK *PBCLASS_QUERY_TAG_CALLBACK;
 
+_Function_class_(BCLASS_QUERY_INFORMATION_CALLBACK)
+_IRQL_requires_same_
+_IRQL_requires_max_(PASSIVE_LEVEL)
+_Check_return_
 typedef NTSTATUS
 (NTAPI BCLASS_QUERY_INFORMATION_CALLBACK)(
-  IN PVOID Context,
-  IN ULONG BatteryTag,
-  IN BATTERY_QUERY_INFORMATION_LEVEL Level,
-  IN LONG AtRate,
-  OUT PVOID Buffer,
-  IN ULONG BufferLength,
-  OUT PULONG ReturnedLength);
+  _In_ PVOID Context,
+  _In_ ULONG BatteryTag,
+  _In_ BATTERY_QUERY_INFORMATION_LEVEL Level,
+  _In_ LONG AtRate,
+  _Out_writes_bytes_to_(BufferLength, *ReturnedLength) PVOID Buffer,
+  _In_ ULONG BufferLength,
+  _Out_ PULONG ReturnedLength);
 typedef BCLASS_QUERY_INFORMATION_CALLBACK *PBCLASS_QUERY_INFORMATION_CALLBACK;
 
+_Function_class_(BCLASS_QUERY_STATUS_CALLBACK)
+_IRQL_requires_same_
+_IRQL_requires_max_(PASSIVE_LEVEL)
+_Check_return_
 typedef NTSTATUS
 (NTAPI BCLASS_QUERY_STATUS_CALLBACK)(
-  IN PVOID Context,
-  IN ULONG BatteryTag,
-  OUT PBATTERY_STATUS BatteryStatus);
+  _In_ PVOID Context,
+  _In_ ULONG BatteryTag,
+  _Out_ PBATTERY_STATUS BatteryStatus);
 typedef BCLASS_QUERY_STATUS_CALLBACK *PBCLASS_QUERY_STATUS_CALLBACK;
 
 typedef struct _BATTERY_NOTIFY {
@@ -193,24 +205,36 @@ typedef struct _BATTERY_NOTIFY {
   ULONG HighCapacity;
 } BATTERY_NOTIFY, *PBATTERY_NOTIFY;
 
+_Function_class_(BCLASS_SET_STATUS_NOTIFY_CALLBACK)
+_IRQL_requires_same_
+_IRQL_requires_max_(PASSIVE_LEVEL)
+_Check_return_
 typedef NTSTATUS
 (NTAPI BCLASS_SET_STATUS_NOTIFY_CALLBACK)(
-  IN PVOID Context,
-  IN ULONG BatteryTag,
-  IN PBATTERY_NOTIFY BatteryNotify);
+  _In_ PVOID Context,
+  _In_ ULONG BatteryTag,
+  _In_ PBATTERY_NOTIFY BatteryNotify);
 typedef BCLASS_SET_STATUS_NOTIFY_CALLBACK *PBCLASS_SET_STATUS_NOTIFY_CALLBACK;
 
+_Function_class_(BCLASS_SET_INFORMATION_CALLBACK)
+_IRQL_requires_same_
+_IRQL_requires_max_(PASSIVE_LEVEL)
+_Check_return_
 typedef NTSTATUS
 (NTAPI BCLASS_SET_INFORMATION_CALLBACK)(
-  IN PVOID Context,
-  IN ULONG BatteryTag,
-  IN BATTERY_SET_INFORMATION_LEVEL Level,
-  IN PVOID Buffer OPTIONAL);
+  _In_ PVOID Context,
+  _In_ ULONG BatteryTag,
+  _In_ BATTERY_SET_INFORMATION_LEVEL Level,
+  _In_opt_ PVOID Buffer);
 typedef BCLASS_SET_INFORMATION_CALLBACK *PBCLASS_SET_INFORMATION_CALLBACK;
 
+_Function_class_(BCLASS_DISABLE_STATUS_NOTIFY_CALLBACK)
+_IRQL_requires_same_
+_IRQL_requires_max_(PASSIVE_LEVEL)
+_Check_return_
 typedef NTSTATUS
 (NTAPI BCLASS_DISABLE_STATUS_NOTIFY_CALLBACK)(
-  IN PVOID Context);
+  _In_ PVOID Context);
 typedef BCLASS_DISABLE_STATUS_NOTIFY_CALLBACK *PBCLASS_DISABLE_STATUS_NOTIFY_CALLBACK;
 
 typedef PBCLASS_QUERY_TAG_CALLBACK BCLASS_QUERY_TAG;
@@ -302,57 +326,67 @@ typedef struct _BATTERY_TAG_CHANGE {
 #define BCLASSAPI DECLSPEC_IMPORT
 #endif
 
+_IRQL_requires_max_(PASSIVE_LEVEL)
+_Check_return_
 BCLASSAPI
 NTSTATUS
 NTAPI
 BatteryClassInitializeDevice(
-  IN PBATTERY_MINIPORT_INFO MiniportInfo,
-  IN PVOID *ClassData);
+  _In_ PBATTERY_MINIPORT_INFO MiniportInfo,
+  _Out_ PVOID *ClassData);
 
+_IRQL_requires_max_(PASSIVE_LEVEL)
+_Check_return_
 BCLASSAPI
 NTSTATUS
 NTAPI
 BatteryClassIoctl(
-  IN PVOID ClassData,
-  IN OUT PIRP Irp);
+  _In_ PVOID ClassData,
+  _Inout_ PIRP Irp);
 
+_IRQL_requires_max_(DISPATCH_LEVEL)
 BCLASSAPI
 NTSTATUS
 NTAPI
 BatteryClassStatusNotify(
-  IN PVOID  ClassData);
+  _In_ PVOID ClassData);
 
 #if (NTDDI_VERSION >= NTDDI_WINXP)
 
+_IRQL_requires_max_(PASSIVE_LEVEL)
+_Check_return_
 BCLASSAPI
 NTSTATUS
 NTAPI
 BatteryClassQueryWmiDataBlock(
-  IN PVOID ClassData,
-  IN OUT PDEVICE_OBJECT DeviceObject,
-  IN OUT PIRP Irp,
-  IN ULONG GuidIndex,
-  OUT PULONG InstanceLengthArray,
-  IN ULONG OutBufferSize,
-  OUT PUCHAR Buffer OPTIONAL);
-
+  _In_ PVOID ClassData,
+  _Inout_ PDEVICE_OBJECT DeviceObject,
+  _Inout_ PIRP Irp,
+  _In_ ULONG GuidIndex,
+  _Out_writes_(1) PULONG InstanceLengthArray,
+  _In_ ULONG OutBufferSize,
+  _Out_writes_bytes_opt_(OutBufferSize) PUCHAR Buffer);
+
+_IRQL_requires_max_(PASSIVE_LEVEL)
+_Check_return_
 BCLASSAPI
 NTSTATUS
 NTAPI
 BatteryClassSystemControl(
-  IN PVOID ClassData,
-  IN PVOID WmiLibContext, /* PWMILIB_CONTEXT */
-  IN PDEVICE_OBJECT DeviceObject,
-  IN OUT PIRP Irp,
-  OUT PVOID Disposition); /* PSYSCTL_IRP_DISPOSITION */
+  _In_ PVOID ClassData,
+  _In_ PVOID WmiLibContext, /* PWMILIB_CONTEXT */
+  _In_ PDEVICE_OBJECT DeviceObject,
+  _Inout_ PIRP Irp,
+  _Out_ PVOID Disposition); /* PSYSCTL_IRP_DISPOSITION */
 
 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
 
+_IRQL_requires_max_(PASSIVE_LEVEL)
 BCLASSAPI
 NTSTATUS
 NTAPI
 BatteryClassUnload(
-  IN PVOID ClassData);
+  _In_ PVOID ClassData);
 
 #endif /* _WINDOWS_H */
 
index 64326f9..7ac0ef1 100644 (file)
@@ -656,6 +656,10 @@ extern "C" {
 #define HDN_ENDDRAG (HDN_FIRST-11)
 #define HDN_FILTERCHANGE (HDN_FIRST-12)
 #define HDN_FILTERBTNCLICK (HDN_FIRST-13)
+#define HDN_BEGINFILTEREDIT (HDN_FIRST-14)
+#define HDN_ENDFILTEREDIT (HDN_FIRST-15)
+#define HDN_ITEMSTATEICONCLICK (HDN_FIRST-16)
+#define HDN_ITEMKEYDOWN (HDN_FIRST-17)
 
 #define HDN_ITEMCHANGING __MINGW_NAME_AW(HDN_ITEMCHANGING)
 #define HDN_ITEMCHANGED __MINGW_NAME_AW(HDN_ITEMCHANGED)
index 8ffedf8..6d67625 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            This file is in the public domain.
  * PROJECT:              ReactOS kernel
  * FILE:
index 5a637f7..429b459 100644 (file)
@@ -1,6 +1,4 @@
-
-/* $Id: $
- *
+/*
  * COPYRIGHT:            This file is in the public domain.
  * PROJECT:              ReactOS kernel
  * FILE:
index 0e79d3e..07787f5 100644 (file)
@@ -1,6 +1,4 @@
-
-/* $Id$
- *
+/*
  * COPYRIGHT:            This file is in the public domain.
  * PROJECT:              ReactOS kernel
  * FILE:
index c7c37d5..13c1ed0 100644 (file)
@@ -90,72 +90,72 @@ typedef struct _EVENT_FILTER_HEADER {
 
 typedef VOID
 (NTAPI *PENABLECALLBACK)(
-  IN LPCGUID SourceId,
-  IN ULONG IsEnabled,
-  IN UCHAR Level,
-  IN ULONGLONG MatchAnyKeyword,
-  IN ULONGLONG MatchAllKeyword,
-  IN PEVENT_FILTER_DESCRIPTOR FilterData OPTIONAL,
-  IN OUT PVOID CallbackContext OPTIONAL);
+  _In_ LPCGUID SourceId,
+  _In_ ULONG IsEnabled,
+  _In_ UCHAR Level,
+  _In_ ULONGLONG MatchAnyKeyword,
+  _In_ ULONGLONG MatchAllKeyword,
+  _In_opt_ PEVENT_FILTER_DESCRIPTOR FilterData,
+  _Inout_opt_ PVOID CallbackContext);
 
 #if (WINVER >= _WIN32_WINNT_VISTA)
 ULONG
 EVNTAPI
 EventRegister(
-  IN LPCGUID ProviderId,
-  IN PENABLECALLBACK EnableCallback OPTIONAL,
-  IN PVOID CallbackContext OPTIONAL,
-  OUT PREGHANDLE RegHandle);
+  _In_ LPCGUID ProviderId,
+  _In_opt_ PENABLECALLBACK EnableCallback,
+  _In_opt_ PVOID CallbackContext,
+  _Out_ PREGHANDLE RegHandle);
 
 ULONG
 EVNTAPI
 EventUnregister(
-  IN REGHANDLE RegHandle);
+  _In_ REGHANDLE RegHandle);
 
 BOOLEAN
 EVNTAPI
 EventEnabled(
-  IN REGHANDLE RegHandle,
-  IN PCEVENT_DESCRIPTOR EventDescriptor);
+  _In_ REGHANDLE RegHandle,
+  _In_ PCEVENT_DESCRIPTOR EventDescriptor);
 
 BOOLEAN
 EVNTAPI
 EventProviderEnabled(
-  IN REGHANDLE RegHandle,
-  IN UCHAR Level,
-  IN ULONGLONG Keyword);
+  _In_ REGHANDLE RegHandle,
+  _In_ UCHAR Level,
+  _In_ ULONGLONG Keyword);
 
 ULONG
 EVNTAPI
 EventWrite(
-  IN REGHANDLE RegHandle,
-  IN PCEVENT_DESCRIPTOR EventDescriptor,
-  IN ULONG UserDataCount,
-  IN PEVENT_DATA_DESCRIPTOR UserData);
+  _In_ REGHANDLE RegHandle,
+  _In_ PCEVENT_DESCRIPTOR EventDescriptor,
+  _In_ ULONG UserDataCount,
+  _In_reads_opt_(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData);
 
 ULONG
 EVNTAPI
 EventWriteTransfer(
-  IN REGHANDLE RegHandle,
-  IN PCEVENT_DESCRIPTOR EventDescriptor,
-  IN LPCGUID ActivityId OPTIONAL,
-  IN LPCGUID RelatedActivityId OPTIONAL,
-  IN ULONG UserDataCount,
-  IN PEVENT_DATA_DESCRIPTOR UserData OPTIONAL);
+  _In_ REGHANDLE RegHandle,
+  _In_ PCEVENT_DESCRIPTOR EventDescriptor,
+  _In_opt_ LPCGUID ActivityId,
+  _In_opt_ LPCGUID RelatedActivityId,
+  _In_ ULONG UserDataCount,
+  _In_reads_opt_(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData);
 
 ULONG
 EVNTAPI
 EventWriteString(
-  IN REGHANDLE RegHandle,
-  IN UCHAR Level,
-  IN ULONGLONG Keyword,
-  IN PCWSTR String);
+  _In_ REGHANDLE RegHandle,
+  _In_ UCHAR Level,
+  _In_ ULONGLONG Keyword,
+  _In_ PCWSTR String);
 
 ULONG
 EVNTAPI
 EventActivityIdControl(
-  IN ULONG ControlCode,
-  IN OUT LPGUID ActivityId);
+  _In_ ULONG ControlCode,
+  _Inout_ LPGUID ActivityId);
 
 #endif /* (WINVER >= _WIN32_WINNT_VISTA) */
 
@@ -163,14 +163,14 @@ EventActivityIdControl(
 ULONG
 EVNTAPI
 EventWriteEx(
-  IN REGHANDLE RegHandle,
-  IN PCEVENT_DESCRIPTOR EventDescriptor,
-  IN ULONG64 Filter,
-  IN ULONG Flags,
-  IN LPCGUID ActivityId OPTIONAL,
-  IN LPCGUID RelatedActivityId OPTIONAL,
-  IN ULONG UserDataCount,
-  IN PEVENT_DATA_DESCRIPTOR UserData OPTIONAL);
+  _In_ REGHANDLE RegHandle,
+  _In_ PCEVENT_DESCRIPTOR EventDescriptor,
+  _In_ ULONG64 Filter,
+  _In_ ULONG Flags,
+  _In_opt_ LPCGUID ActivityId,
+  _In_opt_ LPCGUID RelatedActivityId,
+  _In_ ULONG UserDataCount,
+  _In_reads_opt_(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData);
 #endif
 
 #endif // _ETW_KM_ 
@@ -178,9 +178,9 @@ EventWriteEx(
 FORCEINLINE
 VOID
 EventDataDescCreate(
-  OUT PEVENT_DATA_DESCRIPTOR EventDataDescriptor,
-  IN const VOID* DataPtr,
-  IN ULONG DataSize)
+  _Out_ PEVENT_DATA_DESCRIPTOR EventDataDescriptor,
+  _In_reads_bytes_(DataSize) const VOID* DataPtr,
+  _In_ ULONG DataSize)
 {
   EventDataDescriptor->Ptr = (ULONGLONG)(ULONG_PTR)DataPtr;
   EventDataDescriptor->Size = DataSize;
@@ -190,14 +190,14 @@ EventDataDescCreate(
 FORCEINLINE
 VOID
 EventDescCreate(
-  OUT PEVENT_DESCRIPTOR EventDescriptor,
-  IN USHORT Id,
-  IN UCHAR Version,
-  IN UCHAR Channel,
-  IN UCHAR Level,
-  IN USHORT Task,
-  IN UCHAR Opcode,
-  IN ULONGLONG Keyword)
+  _Out_ PEVENT_DESCRIPTOR EventDescriptor,
+  _In_ USHORT Id,
+  _In_ UCHAR Version,
+  _In_ UCHAR Channel,
+  _In_ UCHAR Level,
+  _In_ USHORT Task,
+  _In_ UCHAR Opcode,
+  _In_ ULONGLONG Keyword)
 {
   EventDescriptor->Id = Id;
   EventDescriptor->Version = Version;
@@ -211,7 +211,7 @@ EventDescCreate(
 FORCEINLINE
 VOID
 EventDescZero(
-  OUT PEVENT_DESCRIPTOR EventDescriptor)
+  _Out_ PEVENT_DESCRIPTOR EventDescriptor)
 {
   memset(EventDescriptor, 0, sizeof(EVENT_DESCRIPTOR));
 }
@@ -219,7 +219,7 @@ EventDescZero(
 FORCEINLINE
 USHORT
 EventDescGetId(
-  IN PCEVENT_DESCRIPTOR EventDescriptor)
+  _In_ PCEVENT_DESCRIPTOR EventDescriptor)
 {
   return (EventDescriptor->Id);
 }
@@ -227,7 +227,7 @@ EventDescGetId(
 FORCEINLINE
 UCHAR
 EventDescGetVersion(
-  IN PCEVENT_DESCRIPTOR EventDescriptor)
+  _In_ PCEVENT_DESCRIPTOR EventDescriptor)
 {
   return (EventDescriptor->Version);
 }
@@ -235,7 +235,7 @@ EventDescGetVersion(
 FORCEINLINE
 USHORT
 EventDescGetTask(
-  IN PCEVENT_DESCRIPTOR EventDescriptor)
+  _In_ PCEVENT_DESCRIPTOR EventDescriptor)
 {
   return (EventDescriptor->Task);
 }
@@ -243,7 +243,7 @@ EventDescGetTask(
 FORCEINLINE
 UCHAR
 EventDescGetOpcode(
-  IN PCEVENT_DESCRIPTOR EventDescriptor)
+  _In_ PCEVENT_DESCRIPTOR EventDescriptor)
 {
   return (EventDescriptor->Opcode);
 }
@@ -251,7 +251,7 @@ EventDescGetOpcode(
 FORCEINLINE
 UCHAR
 EventDescGetChannel(
-  IN PCEVENT_DESCRIPTOR EventDescriptor)
+  _In_ PCEVENT_DESCRIPTOR EventDescriptor)
 {
   return (EventDescriptor->Channel);
 }
@@ -259,7 +259,7 @@ EventDescGetChannel(
 FORCEINLINE
 UCHAR
 EventDescGetLevel(
-  IN PCEVENT_DESCRIPTOR EventDescriptor)
+  _In_ PCEVENT_DESCRIPTOR EventDescriptor)
 {
   return (EventDescriptor->Level);
 }
@@ -267,7 +267,7 @@ EventDescGetLevel(
 FORCEINLINE
 ULONGLONG
 EventDescGetKeyword(
-  IN PCEVENT_DESCRIPTOR EventDescriptor)
+  _In_ PCEVENT_DESCRIPTOR EventDescriptor)
 {
   return (EventDescriptor->Keyword);
 }
@@ -275,8 +275,8 @@ EventDescGetKeyword(
 FORCEINLINE
 PEVENT_DESCRIPTOR
 EventDescSetId(
-  IN PEVENT_DESCRIPTOR EventDescriptor,
-  IN USHORT Id)
+  _In_ PEVENT_DESCRIPTOR EventDescriptor,
+  _In_ USHORT Id)
 {
   EventDescriptor->Id = Id;
   return (EventDescriptor);
@@ -285,8 +285,8 @@ EventDescSetId(
 FORCEINLINE
 PEVENT_DESCRIPTOR
 EventDescSetVersion(
-  IN PEVENT_DESCRIPTOR EventDescriptor,
-  IN UCHAR Version)
+  _In_ PEVENT_DESCRIPTOR EventDescriptor,
+  _In_ UCHAR Version)
 {
   EventDescriptor->Version = Version;
   return (EventDescriptor);
@@ -295,8 +295,8 @@ EventDescSetVersion(
 FORCEINLINE
 PEVENT_DESCRIPTOR
 EventDescSetTask(
-  IN PEVENT_DESCRIPTOR EventDescriptor,
-  IN USHORT Task)
+  _In_ PEVENT_DESCRIPTOR EventDescriptor,
+  _In_ USHORT Task)
 {
   EventDescriptor->Task = Task;
   return (EventDescriptor);
@@ -305,8 +305,8 @@ EventDescSetTask(
 FORCEINLINE
 PEVENT_DESCRIPTOR
 EventDescSetOpcode(
-  IN PEVENT_DESCRIPTOR EventDescriptor,
-  IN UCHAR Opcode)
+  _In_ PEVENT_DESCRIPTOR EventDescriptor,
+  _In_ UCHAR Opcode)
 {
   EventDescriptor->Opcode = Opcode;
   return (EventDescriptor);
@@ -315,8 +315,8 @@ EventDescSetOpcode(
 FORCEINLINE
 PEVENT_DESCRIPTOR
 EventDescSetLevel(
-  IN PEVENT_DESCRIPTOR EventDescriptor,
-  IN UCHAR  Level)
+  _In_ PEVENT_DESCRIPTOR EventDescriptor,
+  _In_ UCHAR  Level)
 {
   EventDescriptor->Level = Level;
   return (EventDescriptor);
@@ -325,8 +325,8 @@ EventDescSetLevel(
 FORCEINLINE
 PEVENT_DESCRIPTOR
 EventDescSetChannel(
-  IN PEVENT_DESCRIPTOR EventDescriptor,
-  IN UCHAR Channel)
+  _In_ PEVENT_DESCRIPTOR EventDescriptor,
+  _In_ UCHAR Channel)
 {
   EventDescriptor->Channel = Channel;
   return (EventDescriptor);
@@ -335,8 +335,8 @@ EventDescSetChannel(
 FORCEINLINE
 PEVENT_DESCRIPTOR
 EventDescSetKeyword(
-  IN PEVENT_DESCRIPTOR EventDescriptor,
-  IN ULONGLONG Keyword)
+  _In_ PEVENT_DESCRIPTOR EventDescriptor,
+  _In_ ULONGLONG Keyword)
 {
   EventDescriptor->Keyword = Keyword;
   return (EventDescriptor);
@@ -346,8 +346,8 @@ EventDescSetKeyword(
 FORCEINLINE
 PEVENT_DESCRIPTOR
 EventDescOrKeyword(
-  IN PEVENT_DESCRIPTOR EventDescriptor,
-  IN ULONGLONG Keyword)
+  _In_ PEVENT_DESCRIPTOR EventDescriptor,
+  _In_ ULONGLONG Keyword)
 {
   EventDescriptor->Keyword |= Keyword;
   return (EventDescriptor);
@@ -356,4 +356,3 @@ EventDescOrKeyword(
 #ifdef __cplusplus
 }
 #endif
-
index 3d5081e..c1955d6 100644 (file)
@@ -435,12 +435,12 @@ typedef struct _STORAGE_PROPERTY_QUERY {
   UCHAR AdditionalParameters[1];
 } STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY;
 
-typedef struct _STORAGE_DESCRIPTOR_HEADER {
+typedef _Struct_size_bytes_(Size) struct _STORAGE_DESCRIPTOR_HEADER {
   ULONG Version;
   ULONG Size;
 } STORAGE_DESCRIPTOR_HEADER, *PSTORAGE_DESCRIPTOR_HEADER;
 
-typedef struct _STORAGE_DEVICE_DESCRIPTOR {
+typedef _Struct_size_bytes_(Size) struct _STORAGE_DEVICE_DESCRIPTOR {
   ULONG Version;
   ULONG Size;
   UCHAR DeviceType;
@@ -456,7 +456,7 @@ typedef struct _STORAGE_DEVICE_DESCRIPTOR {
   UCHAR RawDeviceProperties[1];
 } STORAGE_DEVICE_DESCRIPTOR, *PSTORAGE_DEVICE_DESCRIPTOR;
 
-typedef struct _STORAGE_ADAPTER_DESCRIPTOR {
+typedef _Struct_size_bytes_(Size) struct _STORAGE_ADAPTER_DESCRIPTOR {
   ULONG Version;
   ULONG Size;
   ULONG MaximumTransferLength;
@@ -475,7 +475,7 @@ typedef struct _STORAGE_ADAPTER_DESCRIPTOR {
   USHORT BusMinorVersion;
 } STORAGE_ADAPTER_DESCRIPTOR, *PSTORAGE_ADAPTER_DESCRIPTOR;
 
-typedef struct _STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR {
+typedef _Struct_size_bytes_(Size) struct _STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR {
   ULONG Version;
   ULONG Size;
   ULONG BytesPerCacheLine;
@@ -539,7 +539,7 @@ typedef struct _STORAGE_IDENTIFIER {
   UCHAR Identifier[1];
 } STORAGE_IDENTIFIER, *PSTORAGE_IDENTIFIER;
 
-typedef struct _STORAGE_DEVICE_ID_DESCRIPTOR {
+typedef _Struct_size_bytes_(Size) struct _STORAGE_DEVICE_ID_DESCRIPTOR {
   ULONG Version;
   ULONG Size;
   ULONG NumberOfIdentifiers;
@@ -646,7 +646,7 @@ typedef struct _PERSISTENT_RESERVE_COMMAND {
 
 #endif /* defined(_MSC_EXTENSIONS) */
 
-typedef struct _STORAGE_READ_CAPACITY {
+typedef _Struct_size_bytes_(Size) struct _STORAGE_READ_CAPACITY {
   ULONG Version;
   ULONG Size;
   ULONG BlockLength;
@@ -679,7 +679,7 @@ typedef enum _WRITE_THROUGH {
   WriteThroughSupported
 } WRITE_THROUGH;
 
-typedef struct _STORAGE_WRITE_CACHE_PROPERTY {
+typedef _Struct_size_bytes_(Size) struct _STORAGE_WRITE_CACHE_PROPERTY {
   ULONG Version;
   ULONG Size;
   WRITE_CACHE_TYPE WriteCacheType;
index 06b30e7..f6b86b1 100644 (file)
@@ -1,6 +1,4 @@
-
-/* $Id$
- *
+/*
  * COPYRIGHT:            This file is in the public domain.
  * PROJECT:              ReactOS kernel
  * FILE:
@@ -10,4 +8,3 @@
  */
 
 #include <winerror.h>
-
index ecc79a7..e607870 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:            This file is in the public domain.
  * PROJECT:              ReactOS kernel
  * FILE:
index 6fd8a03..8f0ed8f 100644 (file)
@@ -807,13 +807,13 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes, _SAL_default};
 //#define _Out_z_capcount_(capcount)
 #define _Outptr_                                                    _SAL2_NAME(_Outptr_) _Group_([SA_Pre(Null=SA_No,Notref=1)] [SA_Pre(WritableElementsConst=1,Notref=1)] [SA_Post(Valid=SA_Yes)] [SA_Post(Deref=1,Null=SA_No,Notref=1,ValidElements="\n""1")])
 #define _Outptr_opt_                                                _SAL2_NAME(_Outptr_opt_) _Group_([SA_Pre(Null=SA_Maybe,Notref=1)] [SA_Pre(WritableElementsConst=1,Notref=1)] [SA_Post(Valid=SA_Yes)] [SA_Post(Deref=1,Null=SA_No,Notref=1,ValidElements="\n""1")])
-//#define _Outptr_opt_result_buffer_(size)
+#define _Outptr_opt_result_buffer_(size)                            _SAL2_NAME(_Outptr_opt_result_buffer_) _Group_([SA_Pre(Null=SA_Maybe,Notref=1)] [SA_Pre(WritableElementsConst=1,Notref=1)] [SA_Post(Valid=SA_Yes)] [SA_Post(Deref=1,Null=SA_No,Notref=1,WritableElements="\n" _SA_SPECSTRIZE(size))])
 //#define _Outptr_opt_result_buffer_all_(size)
 //#define _Outptr_opt_result_buffer_all_maybenull_(size)
 //#define _Outptr_opt_result_buffer_maybenull_(size)
 //#define _Outptr_opt_result_buffer_to_(size, count)
 //#define _Outptr_opt_result_buffer_to_maybenull_(size, count)
-//#define _Outptr_opt_result_bytebuffer_(size)
+#define _Outptr_opt_result_bytebuffer_(size)                        _SAL2_NAME(_Outptr_opt_result_bytebuffer_) _Group_([SA_Pre(Null=SA_Maybe,Notref=1)] [SA_Pre(WritableElementsConst=1,Notref=1)] [SA_Post(Valid=SA_Yes)] [SA_Post(Deref=1,Null=SA_No,Notref=1,WritableBytes="\n" _SA_SPECSTRIZE(size))])
 //#define _Outptr_opt_result_bytebuffer_all_(size)
 #define _Outptr_opt_result_bytebuffer_all_maybenull_(size)          _SAL2_NAME(_Outptr_opt_) _Group_([SA_Pre(Null=SA_Maybe,Notref=1)] [SA_Pre(WritableElementsConst=1,Notref=1)] [SA_Post(Valid=SA_Yes)] [SA_Post(Deref=1,Null=SA_Maybe,Notref=1,ValidBytes="\n" _SA_SPECSTRIZE(size))])
 //#define _Outptr_opt_result_bytebuffer_maybenull_(size)
@@ -838,7 +838,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes, _SAL_default};
 #define _Outptr_result_maybenull_                                   _SAL2_NAME(_Outptr_result_maybenull_) _Group_([SA_Pre(Null=SA_No,Notref=1)] [SA_Pre(WritableElementsConst=1,Notref=1)] [SA_Post(Valid=SA_Yes)] [SA_Post(Deref=1,Null=SA_Maybe,Notref=1,ValidElements="\n""1")] )
 //#define _Outptr_result_maybenull_z_
 #define _Outptr_result_nullonfailure_                               _SAL2_NAME(_Outptr_result_nullonfailure_) _Group_(_Outptr_ [SAL_context(p1="SAL_failed")] _Group_([SAL_post] _Deref_post_null_) )
-//#define _Outptr_result_z_
+#define _Outptr_result_z_                                           _SAL2_NAME(_Outptr_result_z_) _Group_([SA_Pre(Null=SA_No,Notref=1)] [SA_Pre(WritableElementsConst=1,Notref=1)] [SA_Post(Valid=SA_Yes)] _Deref_post_z_)
 //#define _Outref_
 //#define _Outref_result_buffer_(size)
 //#define _Outref_result_buffer_all_(size)
index b3dfdcb..4b1a9c3 100644 (file)
@@ -624,44 +624,199 @@ typedef struct _FILEMUIINFO {
 #define IS_LOW_SURROGATE(ch) ((ch) >= LOW_SURROGATE_START  && (ch) <= LOW_SURROGATE_END)
 #define IS_SURROGATE_PAIR(high,low) (IS_HIGH_SURROGATE(high) && IS_LOW_SURROGATE(low))
 
-int WINAPI CompareStringA(LCID,DWORD,LPCSTR,int,LPCSTR,int);
-int WINAPI CompareStringW(LCID,DWORD,LPCWSTR,int,LPCWSTR,int);
-LCID WINAPI ConvertDefaultLocale(LCID);
-BOOL WINAPI EnumCalendarInfoA(CALINFO_ENUMPROCA,LCID,CALID,CALTYPE);
-BOOL WINAPI EnumCalendarInfoW(CALINFO_ENUMPROCW,LCID,CALID,CALTYPE);
-BOOL WINAPI EnumDateFormatsA(DATEFMT_ENUMPROCA,LCID,DWORD);
-BOOL WINAPI EnumDateFormatsW(DATEFMT_ENUMPROCW,LCID,DWORD);
-BOOL WINAPI EnumSystemCodePagesA(CODEPAGE_ENUMPROCA,DWORD);
-BOOL WINAPI EnumSystemCodePagesW(CODEPAGE_ENUMPROCW,DWORD);
-BOOL WINAPI EnumSystemGeoID(GEOCLASS,GEOID,GEO_ENUMPROC);
-BOOL WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA,DWORD);
-BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW,DWORD);
-BOOL WINAPI EnumTimeFormatsA(TIMEFMT_ENUMPROCA,LCID,DWORD);
-BOOL WINAPI EnumTimeFormatsW(TIMEFMT_ENUMPROCW,LCID,DWORD);
-int WINAPI FoldStringA(DWORD,LPCSTR,int,LPSTR,int);
-int WINAPI FoldStringW(DWORD,LPCWSTR,int,LPWSTR,int);
+int
+WINAPI
+CompareStringA(
+  _In_ LCID Locale,
+  _In_ DWORD dwCmpFlags,
+  _In_reads_(cchCount1) LPCSTR lpString1,
+  _In_ int cchCount1,
+  _In_reads_(cchCount2) LPCSTR lpString2,
+  _In_ int cchCount2);
+
+int
+WINAPI
+CompareStringW(
+  _In_ LCID Locale,
+  _In_ DWORD dwCmpFlags,
+  _In_reads_(cchCount1) LPCWSTR lpString1,
+  _In_ int cchCount1,
+  _In_reads_(cchCount2) LPCWSTR lpString2,
+  _In_ int cchCount2);
+
+LCID WINAPI ConvertDefaultLocale(_In_ LCID);
+BOOL WINAPI EnumCalendarInfoA(_In_ CALINFO_ENUMPROCA, _In_ LCID, _In_ CALID, _In_ CALTYPE);
+BOOL WINAPI EnumCalendarInfoW(_In_ CALINFO_ENUMPROCW, _In_ LCID, _In_ CALID, _In_ CALTYPE);
+BOOL WINAPI EnumDateFormatsA(_In_ DATEFMT_ENUMPROCA, _In_ LCID, _In_ DWORD);
+BOOL WINAPI EnumDateFormatsW(_In_ DATEFMT_ENUMPROCW, _In_ LCID, _In_ DWORD);
+BOOL WINAPI EnumSystemCodePagesA(_In_ CODEPAGE_ENUMPROCA, _In_ DWORD);
+BOOL WINAPI EnumSystemCodePagesW(_In_ CODEPAGE_ENUMPROCW, _In_ DWORD);
+BOOL WINAPI EnumSystemGeoID(_In_ GEOCLASS, _In_ GEOID, _In_ GEO_ENUMPROC);
+BOOL WINAPI EnumSystemLocalesA(_In_ LOCALE_ENUMPROCA, _In_ DWORD);
+BOOL WINAPI EnumSystemLocalesW(_In_ LOCALE_ENUMPROCW, _In_ DWORD);
+BOOL WINAPI EnumTimeFormatsA(_In_ TIMEFMT_ENUMPROCA, _In_ LCID, _In_ DWORD);
+BOOL WINAPI EnumTimeFormatsW(_In_ TIMEFMT_ENUMPROCW, _In_ LCID, _In_ DWORD);
+
+int
+WINAPI
+FoldStringA(
+  _In_ DWORD dwMapFlags,
+  _In_reads_(cchSrc) LPCSTR lpSrcStr,
+  _In_ int cchSrc,
+  _Out_writes_opt_(cchDest) LPSTR lpDestStr,
+  _In_ int cchDest);
+
+int
+WINAPI
+FoldStringW(
+  _In_ DWORD dwMapFlags,
+  _In_reads_(cchSrc) LPCWSTR lpSrcStr,
+  _In_ int cchSrc,
+  _Out_writes_opt_(cchDest) LPWSTR lpDestStr,
+  _In_ int cchDest);
+
 UINT WINAPI GetACP(void);
-int WINAPI GetCalendarInfoA(LCID,CALID,CALTYPE,LPSTR,int,LPDWORD);
-int WINAPI GetCalendarInfoW(LCID,CALID,CALTYPE,LPWSTR,int,LPDWORD);
-BOOL WINAPI GetCPInfo(UINT,LPCPINFO);
-BOOL WINAPI GetCPInfoExA(UINT,DWORD,LPCPINFOEXA);
-BOOL WINAPI GetCPInfoExW(UINT,DWORD,LPCPINFOEXW);
-int WINAPI GetCurrencyFormatA(LCID,DWORD,LPCSTR,const CURRENCYFMTA*,LPSTR,int);
-int WINAPI GetCurrencyFormatW(LCID,DWORD,LPCWSTR,const CURRENCYFMTW*,LPWSTR,int);
+
+int
+WINAPI
+GetCalendarInfoA(
+  _In_ LCID Locale,
+  _In_ CALID Calendar,
+  _In_ CALTYPE CalType,
+  _Out_writes_opt_(cchData) LPSTR lpCalData,
+  _In_ int cchData,
+  _Out_opt_ LPDWORD lpValue);
+
+int
+WINAPI
+GetCalendarInfoW(
+  _In_ LCID Locale,
+  _In_ CALID Calendar,
+  _In_ CALTYPE CalType,
+  _Out_writes_opt_(cchData) LPWSTR lpCalData,
+  _In_ int cchData,
+  _Out_opt_ LPDWORD lpValue);
+
+BOOL WINAPI GetCPInfo(_In_ UINT, _Out_ LPCPINFO);
+BOOL WINAPI GetCPInfoExA(_In_ UINT, _In_ DWORD, _Out_ LPCPINFOEXA);
+BOOL WINAPI GetCPInfoExW(_In_ UINT, _In_ DWORD, _Out_ LPCPINFOEXW);
+
+int
+WINAPI
+GetCurrencyFormatA(
+  _In_ LCID Locale,
+  _In_ DWORD dwFlags,
+  _In_ LPCSTR lpValue,
+  _In_opt_ const CURRENCYFMTA *lpFormat,
+  _Out_writes_opt_(cchCurrency) LPSTR lpCurrencyStr,
+  _In_ int cchCurrency);
+
+int
+WINAPI
+GetCurrencyFormatW(
+  _In_ LCID Locale,
+  _In_ DWORD dwFlags,
+  _In_ LPCWSTR lpValue,
+  _In_opt_ const CURRENCYFMTW *lpFormat,
+  _Out_writes_opt_(cchCurrency) LPWSTR lpCurrencyStr,
+  _In_ int cchCurrency);
+
 int WINAPI GetDateFormatA(LCID,DWORD,const SYSTEMTIME*,LPCSTR,LPSTR,int);
 int WINAPI GetDateFormatW(LCID,DWORD,const SYSTEMTIME*,LPCWSTR,LPWSTR,int);
-int WINAPI GetGeoInfoA(GEOID,GEOTYPE,LPSTR,int,LANGID);
-int WINAPI GetGeoInfoW(GEOID,GEOTYPE,LPWSTR,int,LANGID);
-int WINAPI GetLocaleInfoA(LCID,LCTYPE,LPSTR,int);
-int WINAPI GetLocaleInfoW(LCID,LCTYPE,LPWSTR,int);
-BOOL WINAPI GetNLSVersion(NLS_FUNCTION,LCID,LPNLSVERSIONINFO);
-int WINAPI GetNumberFormatA(LCID,DWORD,LPCSTR,const NUMBERFMTA*,LPSTR,int);
-int WINAPI GetNumberFormatW(LCID,DWORD,LPCWSTR,const NUMBERFMTW*,LPWSTR,int);
+
+int
+WINAPI
+GetGeoInfoA(
+  _In_ GEOID Location,
+  _In_ GEOTYPE GeoType,
+  _Out_writes_opt_(cchData) LPSTR lpGeoData,
+  _In_ int cchData,
+  _In_ LANGID LangId);
+
+int
+WINAPI
+GetGeoInfoW(
+  _In_ GEOID Location,
+  _In_ GEOTYPE GeoType,
+  _Out_writes_opt_(cchData) LPWSTR lpGeoData,
+  _In_ int cchData,
+  _In_ LANGID LangId);
+
+int
+WINAPI
+GetLocaleInfoA(
+  _In_ LCID Locale,
+  _In_ LCTYPE LCType,
+  _Out_writes_opt_(cchData) LPSTR lpLCData,
+  _In_ int cchData);
+
+int
+WINAPI
+GetLocaleInfoW(
+  _In_ LCID Locale,
+  _In_ LCTYPE LCType,
+  _Out_writes_opt_(cchData) LPWSTR lpLCData,
+  _In_ int cchData);
+
+BOOL WINAPI GetNLSVersion(_In_ NLS_FUNCTION, _In_ LCID, _Inout_ LPNLSVERSIONINFO);
+
+int
+WINAPI
+GetNumberFormatA(
+  _In_ LCID Locale,
+  _In_ DWORD dwFlags,
+  _In_ LPCSTR lpValue,
+  _In_opt_ const NUMBERFMTA *lpFormat,
+  _Out_writes_opt_(cchNumber) LPSTR lpNumberStr,
+  _In_ int cchNumber);
+
+int
+WINAPI
+GetNumberFormatW(
+  _In_ LCID Locale,
+  _In_ DWORD dwFlags,
+  _In_ LPCWSTR lpValue,
+  _In_opt_ const NUMBERFMTW *lpFormat,
+  _Out_writes_opt_(cchNumber) LPWSTR lpNumberStr,
+  _In_ int cchNumber);
+
 UINT WINAPI GetOEMCP(void);
-BOOL WINAPI GetStringTypeA(LCID,DWORD,LPCSTR,int,LPWORD);
-BOOL WINAPI GetStringTypeW(DWORD,LPCWSTR,int,LPWORD);
-BOOL WINAPI GetStringTypeExA(LCID,DWORD,LPCSTR,int,LPWORD);
-BOOL WINAPI GetStringTypeExW(LCID,DWORD,LPCWSTR,int,LPWORD);
+
+BOOL
+WINAPI
+GetStringTypeA(
+  _In_ LCID Locale,
+  _In_ DWORD dwInfoType,
+  _In_reads_(cchSrc) LPCSTR lpSrcStr,
+  _In_ int cchSrc,
+  _Out_ LPWORD lpCharType);
+
+BOOL
+WINAPI
+GetStringTypeW(
+  _In_ DWORD dwInfoType,
+  _In_reads_(cchSrc) LPCWSTR lpSrcStr,
+  _In_ int cchSrc,
+  _Out_ LPWORD lpCharType);
+
+BOOL
+WINAPI
+GetStringTypeExA(
+  _In_ LCID Locale,
+  _In_ DWORD dwInfoType,
+  _In_reads_(cchSrc) LPCSTR lpSrcStr,
+  _In_ int cchSrc,
+  _Out_writes_(cchSrc) LPWORD lpCharType);
+
+BOOL
+WINAPI
+GetStringTypeExW(
+  _In_ LCID Locale,
+  _In_ DWORD dwInfoType,
+  _In_reads_(cchSrc) LPCWSTR lpSrcStr,
+  _In_ int cchSrc,
+  _Out_writes_(cchSrc) LPWORD lpCharType);
+
 LANGID WINAPI GetSystemDefaultLangID(void);
 LCID WINAPI GetSystemDefaultLCID(void);
 LCID WINAPI GetThreadLocale(void);
@@ -670,60 +825,199 @@ int WINAPI GetTimeFormatW(LCID,DWORD,const SYSTEMTIME*,LPCWSTR,LPWSTR,int);
 LANGID WINAPI GetUserDefaultLangID(void);
 LCID WINAPI GetUserDefaultLCID(void);
 LANGID WINAPI GetUserDefaultUILanguage(void);
-GEOID WINAPI GetUserGeoID(GEOCLASS);
-BOOL WINAPI IsDBCSLeadByte(BYTE);
-BOOL WINAPI IsDBCSLeadByteEx(UINT,BYTE);
-BOOL WINAPI IsNLSDefinedString(NLS_FUNCTION,DWORD,LPNLSVERSIONINFO,LPCWSTR,int);
-BOOL WINAPI IsValidCodePage(UINT);
-BOOL WINAPI IsValidLocale(LCID,DWORD);
-int WINAPI LCMapStringA(LCID,DWORD,LPCSTR,int,LPSTR,int);
-int WINAPI LCMapStringW(LCID,DWORD,LPCWSTR,int,LPWSTR,int);
+GEOID WINAPI GetUserGeoID(_In_ GEOCLASS);
+BOOL WINAPI IsDBCSLeadByte(_In_ BYTE);
+BOOL WINAPI IsDBCSLeadByteEx(_In_ UINT, _In_ BYTE);
+
+BOOL
+WINAPI
+IsNLSDefinedString(
+  _In_ NLS_FUNCTION Function,
+  _In_ DWORD dwFlags,
+  _In_ LPNLSVERSIONINFO lpVersionInformation,
+  _In_reads_(cchStr) LPCWSTR lpString,
+  _In_ int cchStr);
+
+BOOL WINAPI IsValidCodePage(_In_ UINT);
+BOOL WINAPI IsValidLocale(_In_ LCID, _In_ DWORD);
+
+int
+WINAPI
+LCMapStringA(
+  _In_ LCID Locale,
+  _In_ DWORD dwMapFlags,
+  _In_reads_(cchSrc) LPCSTR lpSrcStr,
+  _In_ int cchSrc,
+  _Out_writes_opt_(_Inexpressible_(cchDest)) LPSTR lpDestStr,
+  _In_ int cchDest);
+
+int
+WINAPI
+LCMapStringW(
+  _In_ LCID Locale,
+  _In_ DWORD dwMapFlags,
+  _In_reads_(cchSrc) LPCWSTR lpSrcStr,
+  _In_ int cchSrc,
+  _Out_writes_opt_(_Inexpressible_(cchDest)) LPWSTR lpDestStr,
+  _In_ int cchDest);
+
 int WINAPI MultiByteToWideChar(UINT,DWORD,LPCSTR,int,LPWSTR,int);
-int WINAPI SetCalendarInfoA(LCID,CALID,CALTYPE,LPCSTR);
-int WINAPI SetCalendarInfoW(LCID,CALID,CALTYPE,LPCWSTR);
-BOOL WINAPI SetLocaleInfoA(LCID,LCTYPE,LPCSTR);
-BOOL WINAPI SetLocaleInfoW(LCID,LCTYPE,LPCWSTR);
-BOOL WINAPI SetThreadLocale(LCID);
-LANGID WINAPI SetThreadUILanguage(LANGID);
+int WINAPI SetCalendarInfoA(_In_ LCID, _In_ CALID, _In_ CALTYPE, _In_ LPCSTR);
+int WINAPI SetCalendarInfoW(_In_ LCID, _In_ CALID, _In_ CALTYPE, _In_ LPCWSTR);
+BOOL WINAPI SetLocaleInfoA(_In_ LCID, _In_ LCTYPE, _In_ LPCSTR);
+BOOL WINAPI SetLocaleInfoW(_In_ LCID, _In_ LCTYPE, _In_ LPCWSTR);
+BOOL WINAPI SetThreadLocale(_In_ LCID);
+LANGID WINAPI SetThreadUILanguage(_In_ LANGID);
 BOOL WINAPI SetUserDefaultLCID(LCID);
 BOOL WINAPI SetUserDefaultUILanguage(LANGID);
-BOOL WINAPI SetUserGeoID(GEOID);
+BOOL WINAPI SetUserGeoID(_In_ GEOID);
 int WINAPI WideCharToMultiByte(UINT,DWORD,LPCWSTR,int,LPSTR,int,LPCSTR,LPBOOL);
 #if (WINVER >= 0x0500)
-BOOL WINAPI EnumCalendarInfoExA(CALINFO_ENUMPROCEXA,LCID,CALID,CALTYPE);
-BOOL WINAPI EnumCalendarInfoExW(CALINFO_ENUMPROCEXW,LCID,CALID,CALTYPE);
-BOOL WINAPI EnumDateFormatsExA(DATEFMT_ENUMPROCEXA,LCID,DWORD);
-BOOL WINAPI EnumDateFormatsExW(DATEFMT_ENUMPROCEXW,LCID,DWORD);
-BOOL WINAPI EnumSystemLanguageGroupsA(LANGUAGEGROUP_ENUMPROCA,DWORD,LONG_PTR);
-BOOL WINAPI EnumSystemLanguageGroupsW(LANGUAGEGROUP_ENUMPROCW,DWORD,LONG_PTR);
-BOOL WINAPI EnumLanguageGroupLocalesA(LANGGROUPLOCALE_ENUMPROCA,LGRPID,DWORD,LONG_PTR);
-BOOL WINAPI EnumLanguageGroupLocalesW(LANGGROUPLOCALE_ENUMPROCW,LGRPID,DWORD,LONG_PTR);
-BOOL WINAPI EnumUILanguagesA(UILANGUAGE_ENUMPROCA,DWORD,LONG_PTR);
-BOOL WINAPI EnumUILanguagesW(UILANGUAGE_ENUMPROCW,DWORD,LONG_PTR);
+BOOL WINAPI EnumCalendarInfoExA(_In_ CALINFO_ENUMPROCEXA, _In_ LCID, _In_ CALID, _In_ CALTYPE);
+BOOL WINAPI EnumCalendarInfoExW(_In_ CALINFO_ENUMPROCEXW, _In_ LCID, _In_ CALID, _In_ CALTYPE);
+BOOL WINAPI EnumDateFormatsExA(_In_ DATEFMT_ENUMPROCEXA, _In_ LCID, _In_ DWORD);
+BOOL WINAPI EnumDateFormatsExW(_In_ DATEFMT_ENUMPROCEXW, _In_ LCID, _In_ DWORD);
+BOOL WINAPI EnumSystemLanguageGroupsA(_In_ LANGUAGEGROUP_ENUMPROCA, _In_ DWORD, _In_ LONG_PTR);
+BOOL WINAPI EnumSystemLanguageGroupsW(_In_ LANGUAGEGROUP_ENUMPROCW, _In_ DWORD, _In_ LONG_PTR);
+BOOL WINAPI EnumLanguageGroupLocalesA(_In_ LANGGROUPLOCALE_ENUMPROCA, _In_ LGRPID, _In_ DWORD, _In_ LONG_PTR);
+BOOL WINAPI EnumLanguageGroupLocalesW(_In_ LANGGROUPLOCALE_ENUMPROCW, _In_ LGRPID, _In_ DWORD, _In_ LONG_PTR);
+BOOL WINAPI EnumUILanguagesA(_In_ UILANGUAGE_ENUMPROCA, _In_ DWORD, _In_ LONG_PTR);
+BOOL WINAPI EnumUILanguagesW(_In_ UILANGUAGE_ENUMPROCW, _In_ DWORD, _In_ LONG_PTR);
 LANGID WINAPI GetSystemDefaultUILanguage(void);
 LANGID WINAPI GetUserDefaultUILanguage(void);
-BOOL WINAPI IsValidLanguageGroup(LGRPID,DWORD);
+BOOL WINAPI IsValidLanguageGroup(_In_ LGRPID, _In_ DWORD);
 #endif /* (WINVER >= 0x0500) */
+
 #if (WINVER >= 0x0600)
-BOOL WINAPI GetFileMUIInfo(DWORD,PCWSTR,PFILEMUIINFO,DWORD*);
-BOOL WINAPI GetFileMUIPath(DWORD,PCWSTR,PWSTR,PULONG,PWSTR,PULONG,PULONGLONG);
+
+_Success_(return != FALSE)
+BOOL
+WINAPI
+GetFileMUIInfo(
+  _In_ DWORD dwFlags,
+  _In_ PCWSTR pcwszFilePath,
+  _Inout_updates_bytes_to_opt_(*pcbFileMUIInfo, *pcbFileMUIInfo) PFILEMUIINFO pFileMUIInfo,
+  _Inout_ DWORD *pcbFileMUIInfo);
+
+BOOL
+WINAPI
+GetFileMUIPath(
+  _In_ DWORD dwFlags,
+  _In_ PCWSTR pcwszFilePath,
+  _Inout_updates_opt_(*pcchLanguage) PWSTR pwszLanguage,
+  _Inout_ PULONG pcchLanguage,
+  _Out_writes_opt_(*pcchFileMUIPath) PWSTR pwszFileMUIPath,
+  _Inout_ PULONG pcchFileMUIPath,
+  _Inout_ PULONGLONG pululEnumerator);
+
 WINBASEAPI
-int WINAPI GetLocaleInfoEx(LPCWSTR,LCTYPE,LPWSTR,int);
-BOOL WINAPI GetProcessPreferredUILanguages(DWORD,PULONG,PZZWSTR,PULONG);
-BOOL WINAPI GetSystemPreferredUILanguages(DWORD,PULONG,PZZWSTR,PULONG);
-BOOL WINAPI GetThreadPreferredUILanguages(DWORD,PULONG,PZZWSTR,PULONG);
+int
+WINAPI
+GetLocaleInfoEx(
+  _In_opt_ LPCWSTR lpLocaleName,
+  _In_ LCTYPE LCType,
+  _Out_writes_opt_(cchData) LPWSTR lpLCData,
+  _In_ int cchData);
+
+BOOL
+WINAPI
+GetProcessPreferredUILanguages(
+  _In_ DWORD dwFlags,
+  _Out_ PULONG pulNumLanguages,
+  _Out_writes_opt_(*pcchLanguagesBuffer) PZZWSTR pwszLanguagesBuffer,
+  _Inout_ PULONG pcchLanguagesBuffer);
+
+BOOL
+WINAPI
+GetSystemPreferredUILanguages(
+  _In_ DWORD dwFlags,
+  _Out_ PULONG pulNumLanguages,
+  _Out_writes_opt_(*pcchLanguagesBuffer) PZZWSTR pwszLanguagesBuffer,
+  _Inout_ PULONG pcchLanguagesBuffer);
+
+BOOL
+WINAPI
+GetThreadPreferredUILanguages(
+  _In_ DWORD dwFlags,
+  _Out_ PULONG pulNumLanguages,
+  _Out_writes_opt_(*pcchLanguagesBuffer) PZZWSTR pwszLanguagesBuffer,
+  _Inout_ PULONG pcchLanguagesBuffer);
+
 LANGID WINAPI GetThreadUILanguage(void);
-BOOL WINAPI GetUILanguageInfo(DWORD,PCZZWSTR,PZZWSTR,PDWORD,PDWORD);
-BOOL WINAPI GetUserPreferredUILanguages(DWORD,PULONG,PZZWSTR,PULONG);
-int WINAPI IdnToAscii(DWORD,LPCWSTR,int,LPWSTR,int);
-int WINAPI IdnToNameprepUnicode(DWORD,LPCWSTR,int,LPWSTR,int);
-int WINAPI IdnToUnicode(DWORD,LPCWSTR,int,LPWSTR,int);
-BOOL WINAPI IsNormalizedString(NORM_FORM,LPCWSTR,int);
-int WINAPI NormalizeString(NORM_FORM,LPCWSTR,int,LPWSTR,int);
-int WINAPI GetStringScripts(DWORD,LPCWSTR,int,LPWSTR,int);
-BOOL WINAPI SetProcessPreferredUILanguages(DWORD,PCZZWSTR,PULONG);
-BOOL WINAPI SetThreadPreferredUILanguages(DWORD,PCZZWSTR,PULONG);
-BOOL WINAPI VerifyScripts(DWORD,LPCWSTR,int,LPCWSTR,int);
+
+BOOL
+WINAPI
+GetUILanguageInfo(
+  _In_ DWORD dwFlags,
+  _In_ PCZZWSTR pwmszLanguage,
+  _Out_writes_opt_(*pcchFallbackLanguages) PZZWSTR pwszFallbackLanguages,
+  _Inout_opt_ PDWORD pcchFallbackLanguages,
+  _Out_ PDWORD pAttributes);
+
+BOOL
+WINAPI
+GetUserPreferredUILanguages(
+  _In_ DWORD dwFlags,
+  _Out_ PULONG pulNumLanguages,
+  _Out_writes_opt_(*pcchLanguagesBuffer) PZZWSTR pwszLanguagesBuffer,
+  _Inout_ PULONG pcchLanguagesBuffer);
+
+int
+WINAPI
+IdnToAscii(
+  _In_ DWORD dwFlags,
+  _In_reads_(cchUnicodeChar) LPCWSTR lpUnicodeCharStr,
+  _In_ int cchUnicodeChar,
+  _Out_writes_opt_(cchASCIIChar) LPWSTR lpASCIICharStr,
+  _In_ int cchASCIIChar);
+
+int
+WINAPI
+IdnToNameprepUnicode(
+  _In_ DWORD dwFlags,
+  _In_reads_(cchUnicodeChar) LPCWSTR lpUnicodeCharStr,
+  _In_ int cchUnicodeChar,
+  _Out_writes_opt_(cchNameprepChar) LPWSTR lpNameprepCharStr,
+  _In_ int cchNameprepChar);
+
+int
+WINAPI
+IdnToUnicode(
+  _In_ DWORD dwFlags,
+  _In_reads_(cchASCIIChar) LPCWSTR lpASCIICharStr,
+  _In_ int cchASCIIChar,
+  _Out_writes_opt_(cchUnicodeChar) LPWSTR lpUnicodeCharStr,
+  _In_ int cchUnicodeChar);
+
+BOOL
+WINAPI
+IsNormalizedString(
+  _In_ NORM_FORM NormForm,
+  _In_reads_(cwLength) LPCWSTR lpString,
+  _In_ int cwLength);
+
+int
+WINAPI
+NormalizeString(
+  _In_ NORM_FORM NormForm,
+  _In_reads_(cwSrcLength) LPCWSTR lpSrcString,
+  _In_ int cwSrcLength,
+  _Out_writes_opt_(cwDstLength) LPWSTR lpDstString,
+  _In_ int cwDstLength);
+
+int
+WINAPI
+GetStringScripts(
+  _In_ DWORD dwFlags,
+  _In_ LPCWSTR lpString,
+  _In_ int cchString,
+  _Out_writes_opt_(cchScripts) LPWSTR lpScripts,
+  _In_ int cchScripts);
+
+BOOL WINAPI SetProcessPreferredUILanguages(_In_ DWORD, _In_opt_ PCZZWSTR, _Out_opt_ PULONG);
+BOOL WINAPI SetThreadPreferredUILanguages(_In_ DWORD, _In_opt_ PCZZWSTR, _Out_opt_ PULONG);
+BOOL WINAPI VerifyScripts(_In_ DWORD, _In_ LPCWSTR, _In_ int, _In_ LPCWSTR, _In_ int);
+
 #endif /* (WINVER >= 0x0600) */
 
 #ifdef UNICODE
index b30854e..c513a29 100644 (file)
 /* Start a service that runs in its own process */
 #define SERVICE_CONTROL_START_OWN   81
 
+/*
+ * Start event name used by OpenSCManager
+ * to know whether the SCM is initialized.
+ */
+#define SCM_START_EVENT L"SvcctrlStartEvent_A3752DX"
+
 typedef struct _SCM_CONTROL_PACKET
 {
     DWORD dwSize;
index 5eb709a..96b0497 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            include/lsass/lsass.h
index 4c00b67..b8571da 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS kernel
  * FILE:        include/reactos/winlogon.h
index 760c278..a35b96e 100644 (file)
@@ -16,7 +16,7 @@ library and utilities.</strong>
 <!--  Please ensure that all links continine to be correct        -->
 <!--  both for www.gnu.org and chiark.                            -->
 <!--                                                              -->
-<!--  $Id$        -->   
+<!--  $Id: README.html 21334 2006-03-18 18:25:48Z peterw $        -->   
 
 <p>
 
index d33a314..5d4eb63 100644 (file)
@@ -67,4 +67,4 @@ file, so it is obvious to everyone which FreeType version we're using.
 After testing, you can commit the new/changed files to CVS. ALthough files
 config.mk and freetype.def are generated, they should be included in CVS.
 
-$Id$
+$Id: README.ROS 25663 2007-01-31 06:11:48Z greatlrd $
index 961628d..fa87c54 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
-*/
 /*
  * COPYRIGHT:   See COPYING in the top level directory
  * LICENSE:     See LGPL.txt in the top level directory
index f5a3d73..8cfc2bf 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
-*/
 /*
  * COPYRIGHT:   See COPYING in the top level directory
  * LICENSE:     See LGPL.txt in the top level directory
index 3d772d0..0891305 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
-*/
 /*
  * COPYRIGHT:   See COPYING in the top level directory
  * LICENSE:     See LGPL.txt in the top level directory
index 1aecfba..a7536c9 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: vfat.h 16656 2005-07-20 02:52:52Z ion $ */
 
 #include <ddk/ntifs.h>
 #include <ddk/ntdddisk.h>
index eaf22f2..c01e175 100644 (file)
@@ -135,13 +135,17 @@ list(APPEND CRT_SOURCE
     printf/_cprintf.c
     printf/_cwprintf.c
     printf/_snprintf.c
+    printf/_snprintf_s.c
     printf/_snwprintf.c
+    printf/_snwprintf_s.c
     printf/_vcprintf.c
     printf/_vcwprintf.c
     printf/_vscprintf.c
     printf/_vscwprintf.c
     printf/_vsnprintf.c
+    printf/_vsnprintf_s.c
     printf/_vsnwprintf.c
+    printf/_vsnwprintf_s.c
     printf/_vsprintf_p.c
     printf/fprintf.c
     printf/fprintf_s.c
@@ -150,8 +154,10 @@ list(APPEND CRT_SOURCE
     printf/printf.c
     printf/printf_s.c
     printf/sprintf.c
+    printf/sprintf_s.c
     printf/streamout.c
     printf/swprintf.c
+    printf/swprintf_s.c
     printf/vfprintf.c
     printf/vfprintf_s.c
     printf/vfwprintf.c
@@ -159,7 +165,9 @@ list(APPEND CRT_SOURCE
     printf/vprintf.c
     printf/vprintf_s.c
     printf/vsprintf.c
+    printf/vsprintf_s.c
     printf/vswprintf.c
+    printf/vswprintf_s.c
     printf/vwprintf.c
     printf/vwprintf_s.c
     printf/wprintf.c
@@ -252,6 +260,10 @@ list(APPEND CRT_SOURCE
     stdlib/wmakpath_s.c
     string/_mbsnlen.c
     string/_mbstrnlen.c
+    string/_splitpath.c
+    string/_splitpath_s.c
+    string/_wsplitpath.c
+    string/_wsplitpath_s.c
     string/atof.c
     string/atoi.c
     string/atoi64.c
@@ -263,7 +275,6 @@ list(APPEND CRT_SOURCE
     string/itow.c
     string/mbstowcs_s.c
     string/scanf.c
-    string/splitp.c
     string/strcoll.c
     string/strcspn.c
     string/strdup.c
@@ -291,7 +302,6 @@ list(APPEND CRT_SOURCE
     string/wcstombs_s.c
     string/wcstoul.c
     string/wctype.c
-    string/wsplitp.c
     string/wtoi.c
     string/wtoi64.c
     string/wtol.c
index 58879f1..5508611 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS kernel
  * PURPOSE:           Stack checker
index 653fec4..67b7268 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: chkstk_asm.s 26099 2007-03-14 20:30:32Z ion $
- *
+/*
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS kernel
  * PURPOSE:           Stack checker
index 7c8e490..487c92e 100644 (file)
@@ -26,6 +26,8 @@ list(APPEND LIBCNTPR_SOURCE
     search/bsearch.c
     search/lfind.c
     stdlib/qsort.c
+    string/_splitpath.c
+    string/_wsplitpath.c
     string/ctype.c
     string/iswctype.c
     string/is_wctype.c
@@ -46,7 +48,6 @@ list(APPEND LIBCNTPR_SOURCE
     string/itoa.c
     string/itow.c
     string/mbstowcs_nt.c
-    string/splitp.c
     string/strtol.c
     string/strtoul.c
     string/strtoull.c
@@ -55,7 +56,6 @@ list(APPEND LIBCNTPR_SOURCE
     string/wcstombs_nt.c
     string/wcstoul.c
     string/wctype.c
-    string/wsplitp.c
     string/wtoi64.c
     string/wtoi.c
     string/wtol.c
index f27c825..dcffa5f 100644 (file)
@@ -1,6 +1,3 @@
-/* $Id$
- *
- */
 
 int _adjust_fdiv = 0;
 
index 40cd3dc..37e5deb 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            lib/sdk/crt/mem/i386/memchr.s
index 8143047..dc964ac 100644 (file)
@@ -1,6 +1,3 @@
-/* 
- * $Id$
- */
 
 #include <asm.inc>
 #include <ks386.inc>
index c760b85..f819b39 100644 (file)
@@ -1,6 +1,3 @@
-/*
- * $Id$
- */
 
 #include <string.h>
 
@@ -8,18 +5,18 @@
 void *
 _memccpy (void *to, const void *from,int c,size_t count)
 {
-  char t;
-  size_t i;
-  char *dst=(char*)to;
-  const char *src=(const char*)from;
+    char t;
+    size_t i;
+    char *dst=(char*)to;
+    const char *src=(const char*)from;
 
-  for ( i = 0; i < count; i++ )
-  {
-    dst[i] = t = src[i];
-    if ( t == '\0' )
-      break;
-    if ( t == c )
-      return &dst[i+1];
-  }
-  return NULL; /* didn't copy c */
+    for ( i = 0; i < count; i++ )
+    {
+        dst[i] = t = src[i];
+        if ( t == '\0' )
+            break;
+        if ( t == c )
+            return &dst[i+1];
+    }
+    return NULL; /* didn't copy c */
 }
index 9a9ce8a..47be47e 100644 (file)
@@ -1,18 +1,15 @@
-/*
- * $Id$
- */
 
 #include <string.h>
 
 void* memchr(const void *s, int c, size_t n)
 {
-  if (n)
-  {
-    const char *p = s;
-    do {
-      if (*p++ == c)
-       return (void *)(p-1);
-    } while (--n != 0);
-  }
-  return 0;
+    if (n)
+    {
+        const char *p = s;
+        do {
+            if (*p++ == c)
+                return (void *)(p-1);
+        } while (--n != 0);
+    }
+    return 0;
 }
index b9b4334..4b3a835 100644 (file)
@@ -1,6 +1,3 @@
-/*
- * $Id$
- */
 
 #include <string.h>
 
@@ -15,7 +12,7 @@ int memcmp(const void *s1, const void *s2, size_t n)
         const unsigned char *p1 = s1, *p2 = s2;
         do {
             if (*p1++ != *p2++)
-                   return (*--p1 - *--p2);
+                return (*--p1 - *--p2);
         } while (--n != 0);
     }
     return 0;
index 692c09d..60ad45a 100644 (file)
@@ -1,17 +1,14 @@
-/*
- * $Id$
- */
 
 #include <string.h>
 
 void* memset(void* src, int val, size_t count)
 {
-       char *char_src = (char *)src;
+    char *char_src = (char *)src;
 
-       while(count>0) {
-               *char_src = val;
-               char_src++;
-               count--;
-       }
-       return src;
+    while(count>0) {
+        *char_src = val;
+        char_src++;
+        count--;
+    }
+    return src;
 }
diff --git a/lib/sdk/crt/printf/_snprintf_s.c b/lib/sdk/crt/printf/_snprintf_s.c
new file mode 100644 (file)
index 0000000..249a8b3
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/printf/_snprintf_s.c
+ * PURPOSE:         Implementation of _snprintf_s
+ * PROGRAMMER:      Timo Kreuzer
+ */
+
+#define _sxprintf _snprintf_s
+#define USE_COUNT 1
+#define IS_SECAPI 1
+
+#include "_sxprintf.c"
diff --git a/lib/sdk/crt/printf/_snwprintf_s.c b/lib/sdk/crt/printf/_snwprintf_s.c
new file mode 100644 (file)
index 0000000..cd60e13
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/printf/_snwprintf_s.c
+ * PURPOSE:         Implementation of _snwprintf_s
+ * PROGRAMMER:      Timo Kreuzer
+ */
+
+#define _sxprintf _snwprintf_s
+#define USE_COUNT 1
+#define _UNICODE
+#define IS_SECAPI 1
+
+#include "_sxprintf.c"
index 44d35ec..28d77aa 100644 (file)
@@ -10,6 +10,9 @@
 #include <stdarg.h>
 #include <limits.h>
 #include <tchar.h>
+#if IS_SECAPI
+#include <internal/safecrt.h>
+#endif
 
 #ifdef _UNICODE
 #define _tstreamout wstreamout
@@ -17,6 +20,8 @@
 #define _tstreamout streamout
 #endif
 
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+
 int _cdecl _tstreamout(FILE *stream, const TCHAR *format, va_list argptr);
 
 int
@@ -27,6 +32,9 @@ _cdecl
 #endif
 _sxprintf(
     TCHAR *buffer,
+#if IS_SECAPI
+    size_t sizeOfBuffer,
+#endif
 #if USE_COUNT
    size_t count,
 #endif
@@ -37,20 +45,42 @@ _sxprintf(
     ...)
 #endif
 {
+#if !USE_COUNT
+    const size_t count = INT_MAX;
+#endif
+#if !IS_SECAPI
+    const size_t sizeOfBuffer = count;
+#endif
 #if !USE_VARARGS
     va_list argptr;
 #endif
     int result;
     FILE stream;
 
+    /* Check trivial case */
+    if ((buffer == NULL) && (count == 0) && (sizeOfBuffer == 0))
+    {
+        return 0;
+    }
+
+#if IS_SECAPI
+    /* Validate parameters */
+    if (MSVCRT_CHECK_PMT(((buffer == NULL) || (format == NULL) || (sizeOfBuffer <= 0))))
+    {
+        errno = EINVAL;
+        return -1;
+    }
+
+    /* Limit output to count + 1 characters */
+    if (count != -1)
+        sizeOfBuffer = min(sizeOfBuffer, count + 1);
+#endif
+
+    /* Setup the FILE structure */
     stream._base = (char*)buffer;
     stream._ptr = stream._base;
     stream._charbuf = 0;
-#if USE_COUNT
-    stream._cnt = (int)(count * sizeof(TCHAR));
-#else
-    stream._cnt = INT_MAX;
-#endif
+    stream._cnt = (int)(sizeOfBuffer * sizeof(TCHAR));
     stream._bufsiz = 0;
     stream._flag = _IOSTRG | _IOWRT;
     stream._tmpfname = 0;
@@ -63,8 +93,33 @@ _sxprintf(
     va_end(argptr);
 #endif
 
+#if IS_SECAPI
+    /* Check for failure or unterminated string */
+    if ((result < 0) || (result == sizeOfBuffer))
+    {
+        /* Null-terminate the buffer at the end */
+        buffer[sizeOfBuffer-1] = _T('\0');
+
+        /* Check if we can truncate */
+        if (count != _TRUNCATE)
+        {
+            /* We can't, invoke invalid parameter handler */
+            MSVCRT_INVALID_PMT("Buffer is too small");
+
+            /* If we came back, set the buffer to an empty string */
+            *buffer = 0;
+        }
+
+        /* Return failure */
+        return -1;
+    }
+
+    /* Null-terminate the buffer after the string */
+    buffer[result] = _T('\0');
+#else
     /* Only zero terminate if there is enough space left */
     if (stream._cnt >= sizeof(TCHAR)) *(TCHAR*)stream._ptr = _T('\0');
+#endif
 
     return result;
 }
diff --git a/lib/sdk/crt/printf/_vsnprintf_s.c b/lib/sdk/crt/printf/_vsnprintf_s.c
new file mode 100644 (file)
index 0000000..7355406
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/printf/_vsnprintf_s.c
+ * PURPOSE:         Implementation of _vsnprintf_s
+ * PROGRAMMER:      Timo Kreuzer
+ */
+
+#define _sxprintf _vsnprintf_s
+#define USE_COUNT 1
+#define USE_VARARGS 1
+#define IS_SECAPI 1
+
+#include "_sxprintf.c"
diff --git a/lib/sdk/crt/printf/_vsnwprintf_s.c b/lib/sdk/crt/printf/_vsnwprintf_s.c
new file mode 100644 (file)
index 0000000..fc7585c
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/printf/_vsnwprintf_s.c
+ * PURPOSE:         Implementation of _vsnwprintf_s
+ * PROGRAMMER:      Timo Kreuzer
+ */
+
+#define _sxprintf _vsnwprintf_s
+#define USE_COUNT 1
+#define USE_VARARGS 1
+#define _UNICODE
+#define IS_SECAPI 1
+
+#include "_sxprintf.c"
diff --git a/lib/sdk/crt/printf/sprintf_s.c b/lib/sdk/crt/printf/sprintf_s.c
new file mode 100644 (file)
index 0000000..6717473
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/printf/sprintf_s.c
+ * PURPOSE:         Implementation of sprintf_s
+ * PROGRAMMER:      Timo Kreuzer
+ */
+
+#define _sxprintf sprintf_s
+#define USE_COUNT 0
+#define IS_SECAPI 1
+
+#include "_sxprintf.c"
diff --git a/lib/sdk/crt/printf/swprintf_s.c b/lib/sdk/crt/printf/swprintf_s.c
new file mode 100644 (file)
index 0000000..a77136c
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/printf/swprintf_s.c
+ * PURPOSE:         Implementation of swprintf_s
+ * PROGRAMMER:      Timo Kreuzer
+ */
+
+#define _sxprintf swprintf_s
+#define USE_COUNT 0
+#define USE_VARARGS 0
+#define IS_SECAPI 1
+
+#include "_sxprintf.c"
diff --git a/lib/sdk/crt/printf/vsprintf_s.c b/lib/sdk/crt/printf/vsprintf_s.c
new file mode 100644 (file)
index 0000000..b049afa
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/printf/vsprintf_s.c
+ * PURPOSE:         Implementation of vsprintf_s
+ * PROGRAMMER:      Timo Kreuzer
+ */
+
+#define _sxprintf vsprintf_s
+#define USE_COUNT 0
+#define USE_VARARGS 1
+#define IS_SECAPI 1
+
+#include "_sxprintf.c"
diff --git a/lib/sdk/crt/printf/vswprintf_s.c b/lib/sdk/crt/printf/vswprintf_s.c
new file mode 100644 (file)
index 0000000..68702ba
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/printf/vswprintf_s.c
+ * PURPOSE:         Implementation of vswprintf_s
+ * PROGRAMMER:      Timo Kreuzer
+ */
+
+#define _sxprintf vswprintf_s
+#define USE_COUNT 0
+#define USE_VARARGS 1
+#define _UNICODE
+#define IS_SECAPI 1
+
+#include "_sxprintf.c"
index 95c4aac..6c165df 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS system libraries
  * PURPOSE:           Implementation of _setjmp/longjmp
index c048fb8..1e40e10 100644 (file)
@@ -11,8 +11,6 @@
  *
  */
 
-/* $Id$
- */
 #include <precomp.h>
 #include <stdlib.h>
 #include <string.h>
index 16ad4e3..156d870 100644 (file)
@@ -11,8 +11,6 @@
  *
  */
 
-/* $Id$
- */
 #include <precomp.h>
 
 /*
diff --git a/lib/sdk/crt/string/_splitpath.c b/lib/sdk/crt/string/_splitpath.c
new file mode 100644 (file)
index 0000000..0a14da4
--- /dev/null
@@ -0,0 +1,11 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/string/_splitpath.c
+ * PURPOSE:         Implementation of _splitpath
+ * PROGRAMMER:      Timo Kreuzer
+ */
+
+#define _tsplitpath_x _splitpath
+
+#include "_tsplitpath_x.h"
diff --git a/lib/sdk/crt/string/_splitpath_s.c b/lib/sdk/crt/string/_splitpath_s.c
new file mode 100644 (file)
index 0000000..ed9c4e2
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/string/_splitpath_s.c
+ * PURPOSE:         Implementation of _splitpath_s
+ * PROGRAMMER:      Timo Kreuzer
+ */
+
+#define _tsplitpath_x _splitpath_s
+#define IS_SECAPI 1
+
+#include "_tsplitpath_x.h"
diff --git a/lib/sdk/crt/string/_tsplitpath_x.h b/lib/sdk/crt/string/_tsplitpath_x.h
new file mode 100644 (file)
index 0000000..76473c9
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * PROJECT:         ReactOS Kernel
+ * LICENSE:         BSD - See COPYING.ARM in the top level directory
+ * PURPOSE:         CRT: implementation of __[w]splitpath[_s]
+ * PROGRAMMERS:     Timo Kreuzer
+ */
+
+#include <precomp.h>
+#include <tchar.h>
+
+#if IS_SECAPI
+#define _FAILURE -1
+#define _SUCCESS 0
+
+_Check_return_wat_
+_CRTIMP_ALTERNATIVE
+errno_t
+__cdecl
+_tsplitpath_x(
+    _In_z_ const _TCHAR* path,
+    _Out_writes_opt_z_(drive_size) _TCHAR* drive,
+    _In_ size_t drive_size,
+    _Out_writes_opt_z_(dir_size) _TCHAR* dir,
+    _In_ size_t dir_size,
+    _Out_writes_opt_z_(fname_size) _TCHAR* fname,
+    _In_ size_t fname_size,
+    _Out_writes_opt_z_(ext_size) _TCHAR* ext,
+    _In_ size_t ext_size)
+#else
+#define _FAILURE
+#define _SUCCESS
+
+_CRT_INSECURE_DEPRECATE(_splitpath_s)
+_CRTIMP
+void
+__cdecl
+_tsplitpath_x(
+    _In_z_ const _TCHAR* path,
+    _Pre_maybenull_ _Post_z_ _TCHAR* drive,
+    _Pre_maybenull_ _Post_z_ _TCHAR* dir,
+    _Pre_maybenull_ _Post_z_ _TCHAR* fname,
+    _Pre_maybenull_ _Post_z_ _TCHAR* ext)
+#endif
+{
+    const _TCHAR *src, *dir_start, *file_start = 0, *ext_start = 0;
+    size_t count;
+#if !IS_SECAPI
+    const size_t drive_size = INT_MAX, dir_size = INT_MAX,
+        fname_size = INT_MAX, ext_size = INT_MAX;
+#endif
+
+#if IS_SECAPI
+    /* Validate parameters */
+    if (MSVCRT_CHECK_PMT((path == NULL) ||
+                         ((drive != NULL) && (drive_size == 0)) ||
+                         ((dir != NULL) &&  (dir_size == 0)) ||
+                         ((fname != NULL) && (fname_size == 0)) ||
+                         ((ext != NULL) && (ext_size == 0))))
+    {
+        errno = EINVAL;
+        return -1;
+    }
+#endif
+
+    /* Truncate all output strings */
+    if (drive) drive[0] = '\0';
+    if (dir) dir[0] = '\0';
+    if (fname) fname[0] = '\0';
+    if (ext) ext[0] = '\0';
+
+#if WINVER >= 0x600
+    /* Check parameter */
+    if (!path)
+    {
+#ifndef _LIBCNT_
+        _set_errno(EINVAL);
+#endif
+        return _FAILURE;
+    }
+#endif
+
+    _Analysis_assume_(path != 0);
+
+#if WINVER == 0x600
+    /* Skip '\\?\' prefix */
+    if ((path[0] == '\\') && (path[1] == '\\') &&
+        (path[2] == '?') && (path[3] == '\\')) path += 4;
+#endif
+
+    if (path[0] == '\0') return _FAILURE;
+
+    /* Check if we have a drive letter (only 1 char supported) */
+    if (path[1] == ':')
+    {
+        if (drive && (drive_size >= 3))
+        {
+            drive[0] = path[0];
+            drive[1] = ':';
+            drive[2] = '\0';
+        }
+        path += 2;
+       }
+
+    /* Scan the rest of the string */
+    dir_start = path;
+    while (*path != '\0')
+    {
+        /* Remember last path separator and last dot */
+        if ((*path == '\\') || (*path == '/')) file_start = path + 1;
+        if (*path == '.') ext_start = path;
+        path++;
+    }
+
+    /* Check if we got a file name / extension */
+    if (!file_start)
+        file_start = dir_start;
+    if (!ext_start || ext_start < file_start)
+        ext_start = path;
+
+    if (dir)
+    {
+        src = dir_start;
+        count = dir_size - 1;
+        while (src < file_start && count--) *dir++ = *src++;
+        *dir = '\0';
+    }
+
+    if (fname)
+    {
+        src = file_start;
+        count = fname_size - 1;
+        while (src < ext_start && count--) *fname++ = *src++;
+        *fname = '\0';
+    }
+
+    if (ext)
+    {
+        src = ext_start;
+        count = ext_size - 1;
+        while (*src != '\0' && count--) *ext++ = *src++;
+        *ext = '\0';
+    }
+
+    return _SUCCESS;
+}
+
diff --git a/lib/sdk/crt/string/_wsplitpath.c b/lib/sdk/crt/string/_wsplitpath.c
new file mode 100644 (file)
index 0000000..7cca818
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/string/_wsplitpath.c
+ * PURPOSE:         Implementation of _wsplitpath
+ * PROGRAMMER:      Timo Kreuzer
+ */
+
+#define _tsplitpath_x _wsplitpath
+#define _UNICODE
+
+#include "_tsplitpath_x.h"
diff --git a/lib/sdk/crt/string/_wsplitpath_s.c b/lib/sdk/crt/string/_wsplitpath_s.c
new file mode 100644 (file)
index 0000000..bebfc81
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/string/_wsplitpath_s.c
+ * PURPOSE:         Implementation of _wsplitpath_s
+ * PROGRAMMER:      Timo Kreuzer
+ */
+
+#define _tsplitpath_x _wsplitpath_s
+#define _UNICODE
+#define IS_SECAPI 1
+
+#include "_tsplitpath_x.h"
index 10df6b9..fd3c361 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #ifndef __TCHAR_INC_S__
 #define __TCHAR_INC_S__
index d587128..bc709f7 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tcscat.inc 49591 2010-11-15 01:29:12Z tkreuzer $\r
- */\r
 \r
 #include "tchar.h"\r
 #include <asm.inc>\r
index 9554ac3..8e7184f 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tcschr.inc 49591 2010-11-15 01:29:12Z tkreuzer $\r
- */\r
 \r
 #include "tchar.h"\r
 #include <asm.inc>\r
index 3bcf453..7331dbb 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tcscmp.inc 49591 2010-11-15 01:29:12Z tkreuzer $\r
- */\r
 \r
 #include "tchar.h"\r
 #include <asm.inc>\r
index 6b5086f..797771d 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tcscpy.inc 49591 2010-11-15 01:29:12Z tkreuzer $\r
- */\r
 \r
 #include "tchar.h"\r
 #include <asm.inc>\r
index f749b9d..c1304cc 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tcslen.inc 49591 2010-11-15 01:29:12Z tkreuzer $\r
-*/\r
 \r
 #include "tchar.h"\r
 #include <asm.inc>\r
index b03bb87..a25df29 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tcsncat.inc 49591 2010-11-15 01:29:12Z tkreuzer $\r
- */\r
 \r
 #include "tchar.h"\r
 #include <asm.inc>\r
index 9545e58..ce8fdf8 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tcsncmp.inc 49591 2010-11-15 01:29:12Z tkreuzer $\r
- */\r
 \r
 #include "tchar.h"\r
 #include <asm.inc>\r
index 248c5ce..9d021d4 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tcsncpy.inc 49591 2010-11-15 01:29:12Z tkreuzer $\r
- */\r
 \r
 #include "tchar.h"\r
 #include <asm.inc>\r
index fc72607..5982778 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tcsnlen.inc 49591 2010-11-15 01:29:12Z tkreuzer $\r
-*/\r
 \r
 #include "tchar.h"\r
 #include <asm.inc>\r
index 9527853..84c7598 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tcsrchr.inc 49591 2010-11-15 01:29:12Z tkreuzer $\r
- */\r
 \r
 #include "tchar.h"\r
 #include <asm.inc>\r
index b833d0d..0d9b2f9 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include "tcscat.inc"
index 8fc6c36..51b5cfd 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include "tcschr.inc"
index b4f5425..752f5e3 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include "tcscmp.inc"
index 78b6fe2..604b58a 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include "tcscpy.inc"
index 5d4bfe0..f7f8d0d 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include "tcslen.inc"
index d28bbc3..5911c28 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include "tcsncat.inc"
index 5ae53ef..7997ec3 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include "tcsncmp.inc"
index b4591cf..abc040e 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include "tcsncpy.inc"
index 3934992..ca05841 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include "tcsnlen.inc"
index a845ee5..75d39c9 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include "tcsrchr.inc"
diff --git a/lib/sdk/crt/string/splitp.c b/lib/sdk/crt/string/splitp.c
deleted file mode 100644 (file)
index 7500c92..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * PROJECT:         ReactOS Kernel
- * LICENSE:         BSD - See COPYING.ARM in the top level directory
- * PURPOSE:         CRT: implementation of _splitpath / _wsplitpath
- * PROGRAMMERS:     Timo Kreuzer
- */
-
-#include <precomp.h>
-#include <tchar.h>
-
-/*
- * @implemented
- */
-void _tsplitpath(const _TCHAR* path, _TCHAR* drive, _TCHAR* dir, _TCHAR* fname, _TCHAR* ext)
-{
-    const _TCHAR *src, *dir_start, *file_start = 0, *ext_start = 0;
-
-    /* Truncate all output strings */
-    if (drive) drive[0] = '\0';
-    if (dir) dir[0] = '\0';
-    if (fname) fname[0] = '\0';
-    if (ext) ext[0] = '\0';
-
-#if WINVER >= 0x600
-    /* Check parameter */
-    if (!path)
-    {
-#ifndef _LIBCNT_
-        _set_errno(EINVAL);
-#endif
-        return;
-    }
-#endif
-
-    _Analysis_assume_(path != 0);
-
-#if WINVER == 0x600
-    /* Skip '\\?\' prefix */
-    if ((path[0] == '\\') && (path[1] == '\\') &&
-        (path[2] == '?') && (path[3] == '\\')) path += 4;
-#endif
-
-    if (path[0] == '\0') return;
-
-    /* Check if we have a drive letter (only 1 char supported) */
-    if (path[1] == ':')
-    {
-        if (drive)
-        {
-            drive[0] = path[0];
-            drive[1] = ':';
-            drive[2] = '\0';
-        }
-        path += 2;
-       }
-
-    /* Scan the rest of the string */
-    dir_start = path;
-    while (*path != '\0')
-    {
-        /* Remember last path seperator and last dot */
-        if ((*path == '\\') || (*path == '/')) file_start = path + 1;
-        if (*path == '.') ext_start = path;
-        path++;
-    }
-
-    /* Check if we got a file name / extension */
-    if (!file_start)
-        file_start = dir_start;
-    if (!ext_start || ext_start < file_start)
-        ext_start = path;
-
-    if (dir)
-    {
-        src = dir_start;
-        while (src < file_start) *dir++ = *src++;
-        *dir = '\0';
-    }
-
-    if (fname)
-    {
-        src = file_start;
-        while (src < ext_start) *fname++ = *src++;
-        *fname = '\0';
-    }
-
-    if (ext)
-    {
-        src = ext_start;
-        while (*src != '\0') *ext++ = *src++;
-        *ext = '\0';
-    }
-}
-
index 59aee1a..7507ebc 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <string.h>
 #include "tcscat.h"
index e504e4b..ce6804f 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _XINT int
 #include <string.h>
index df8e140..9ca05ce 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <string.h>
 #include "tcscmp.h"
index 9f09b15..bbeb611 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <string.h>
 #include "tcscpy.h"
index 5b50745..7fc3c53 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _x(_X_) (_X_)
 #define _strxspn strcspn
index 7dd8d68..131835f 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <string.h>
 #include "tcslen.h"
index b2390f5..6fa1dac 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <string.h>
 #include "tcsncat.h"
index 3837822..b47feaf 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <string.h>
 #include "tcsncmp.h"
index c172eb7..6961eda 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- */
+
 #include <string.h>
 #include "tcsncpy.h"
 
index 269c495..3126d51 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <string.h>
 #include "tcsnlen.h"
index dc05fbc..083fc61 100644 (file)
@@ -1,6 +1,4 @@
-/*
- * $Id$
- */
+
 #include <limits.h>
 #include <string.h>
 
index 1525615..9ef39c1 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _XINT int
 #include <string.h>
index a4c4109..e1c4461 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _x(_X_) (!(_X_))
 #define _strxspn strspn
index e253927..1da43d3 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <limits.h>
 #include <string.h>
index 72a17f7..1c45439 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <tchar.h>
 
index 8c5e1ff..65e01b2 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <tchar.h>
 
index f94af94..e7c5b28 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <tchar.h>
 
index ae28557..716e06e 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <tchar.h>
 
index 918fc06..ab2cc75 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <stddef.h>
 #include <tchar.h>
index 146de33..d213a01 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <stddef.h>
 #include <tchar.h>
index 420dc22..ae6c8d1 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <stddef.h>
 #include <tchar.h>
index c8f9ab4..dbab841 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <stddef.h>
 #include <tchar.h>
index 17d8476..953b5ad 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <stddef.h>
 #include <tchar.h>
index 3540032..81890a0 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #include <tchar.h>
 
index adf0e1c..af16385 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include <wchar.h>
index 20c852a..c01bea2 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #define _XINT wchar_t
index dc2ca0d..e7a9639 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include <wchar.h>
index 283d6ab..8d6714b 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include <wchar.h>
index 768c52a..930680e 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include <wchar.h>
index c2ec3af..2a5611c 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include <wchar.h>
index 13059cc..4e20c86 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include <wchar.h>
index 90a93ab..da1f4af 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include <wchar.h>
index 445a4aa..7f4d969 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #include <wchar.h>
index 0bd8320..0168651 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$
- */
 
 #define _UNICODE
 #define _XINT wchar_t
index d2cb3ec..4add331 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS system libraries
  * FILE:        lib/msvcrt/stdlib/itow.c
diff --git a/lib/sdk/crt/string/wsplitp.c b/lib/sdk/crt/string/wsplitp.c
deleted file mode 100644 (file)
index 4655be5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#define _UNICODE
-#define UNICODE
-
-#include <tchar.h>
-
-#include "splitp.c"
index f3a90ec..73978d7 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/smlib/compses.c
index 5e58f13..aa95d9a 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:  See COPYING in the top level directory
  * PROJECT:    ReactOS system libraries
  * FILE:       reactos/lib/smlib/connect.c
index 169f5e7..82cba98 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/smlib/execpgm.c
index e1e892f..f4971f8 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
  * FILE:            lib/smlib/lookupss.c
index e2e8e01..f1b1936 100644 (file)
@@ -48,7 +48,7 @@ reactos/dll/win32/browseui        # Out of sync
 reactos/dll/win32/cabinet         # Synced to Wine-1.5.19
 reactos/dll/win32/clusapi         # Synced to Wine-1.5.19
 reactos/dll/win32/comcat          # Synced to Wine-1.5.4
-reactos/dll/win32/comctl32        # Synced to Wine 1.5.19
+reactos/dll/win32/comctl32        # Synced to Wine 1.5.26
 reactos/dll/win32/comdlg32        # Synced to Wine 1.3.37
 reactos/dll/win32/compstui        # Synced to Wine-1.5.19
 reactos/dll/win32/credui          # Synced to Wine-1.5.4
index 3ae219a..2830d6a 100644 (file)
@@ -279,6 +279,23 @@ KiRundownThread(IN PKTHREAD Thread)
 #endif
 }
 
+FORCEINLINE
+VOID
+Ke386SetGdtEntryBase(PKGDTENTRY GdtEntry, PVOID BaseAddress)
+{
+    GdtEntry->BaseLow = (USHORT)((ULONG_PTR)BaseAddress & 0xFFFF);
+    GdtEntry->HighWord.Bytes.BaseMid = (UCHAR)((ULONG_PTR)BaseAddress >> 16);
+    GdtEntry->HighWord.Bytes.BaseHi = (UCHAR)((ULONG_PTR)BaseAddress >> 24);
+}
+
+FORCEINLINE
+VOID
+KiSetTebBase(PKPCR Pcr, PVOID TebAddress)
+{
+    Pcr->NtTib.Self = TebAddress;
+    Ke386SetGdtEntryBase(&Pcr->GDT[KGDT_R3_TEB / sizeof(KGDTENTRY)], TebAddress);
+}
+
 VOID
 FASTCALL
 Ki386InitializeTss(
index b9799c4..a905b96 100644 (file)
@@ -257,7 +257,7 @@ typedef struct _MEMORY_AREA
     ULONG Protect;
     ULONG Flags;
     BOOLEAN DeleteInProgress;
-    ULONG PageOpCount;
+    ULONG Magic;
     PVOID Vad;
     union
     {
@@ -586,6 +586,15 @@ MmMapMemoryArea(PVOID BaseAddress,
                 ULONG Consumer,
                 ULONG Protection);
 
+VOID
+NTAPI
+MiRosCheckMemoryAreas(
+   PMMSUPPORT AddressSpace);
+
+VOID
+NTAPI
+MiCheckAllProcessMemoryAreas(VOID);
+
 /* npool.c *******************************************************************/
 
 VOID
@@ -1748,3 +1757,13 @@ MmGetKernelAddressSpace(VOID)
 {
     return MmKernelAddressSpace;
 }
+
+
+/* expool.c ******************************************************************/
+
+VOID
+NTAPI
+ExpCheckPoolAllocation(
+    PVOID P,
+    POOL_TYPE PoolType,
+    ULONG Tag);
index 1872377..55c6698 100644 (file)
@@ -114,6 +114,12 @@ KdbpPrint(
    IN PCHAR Format,
    IN ...  OPTIONAL);
 
+BOOLEAN
+NTAPI
+KdbpGetHexNumber(
+    IN PCHAR pszNum,
+    OUT ULONG_PTR *pulValue);
+
 /* from kdb_expr.c */
 
 BOOLEAN
index ec0e53f..e7d0451 100644 (file)
@@ -90,6 +90,8 @@ static BOOLEAN KdbpCmdSet(ULONG Argc, PCHAR Argv[]);
 static BOOLEAN KdbpCmdHelp(ULONG Argc, PCHAR Argv[]);
 static BOOLEAN KdbpCmdDmesg(ULONG Argc, PCHAR Argv[]);
 
+BOOLEAN ExpKdbgExtPool(ULONG Argc, PCHAR Argv[]);
+
 #ifdef __ROS_DWARF__
 static BOOLEAN KdbpCmdPrintStruct(ULONG Argc, PCHAR Argv[]);
 #endif
@@ -178,7 +180,8 @@ static const struct
     { "set", "set [var] [value]", "Sets var to value or displays value of var.", KdbpCmdSet },
     { "dmesg", "dmesg", "Display debug messages on screen, with navigation on pages.", KdbpCmdDmesg },
     { "kmsg", "kmsg", "Kernel dmesg. Alias for dmesg.", KdbpCmdDmesg },
-    { "help", "help", "Display help screen.", KdbpCmdHelp }
+    { "help", "help", "Display help screen.", KdbpCmdHelp },
+    { "!pool", "!pool [Address [Flags]]", "Display information about pool allocations.", ExpKdbgExtPool }
 };
 
 /* FUNCTIONS *****************************************************************/
@@ -403,6 +406,24 @@ KdbpEvaluateExpression(
     return Ok;
 }
 
+BOOLEAN
+NTAPI
+KdbpGetHexNumber(
+    IN PCHAR pszNum,
+    OUT ULONG_PTR *pulValue)
+{
+    char *endptr;
+
+    /* Skip optional '0x' prefix */
+    if ((pszNum[0] == '0') && ((pszNum[1] == 'x') || (pszNum[1] == 'X')))
+        pszNum += 2;
+
+    /* Make a number from the string (hex) */
+    *pulValue = strtoul(pszNum, &endptr, 16);
+
+    return (*endptr == '\0');
+}
+
 /*!\brief Evaluates an expression and displays the result.
  */
 static BOOLEAN
index 8ee6314..b254caf 100644 (file)
@@ -332,7 +332,6 @@ KiSwapContextExit(IN PKTHREAD OldThread,
 {
     PKIPCR Pcr = (PKIPCR)KeGetPcr();
     PKPROCESS OldProcess, NewProcess;
-    PKGDTENTRY GdtEntry;
     PKTHREAD NewThread;
 
     /* We are on the new thread stack now */
@@ -347,7 +346,7 @@ KiSwapContextExit(IN PKTHREAD OldThread,
         if (*(PULONGLONG)&OldProcess->LdtDescriptor != *(PULONGLONG)&NewProcess->LdtDescriptor)
         {
             DPRINT1("LDT switch not implemented\n");
-            ASSERT(FALSE);            
+            ASSERT(FALSE);
         }
 
         /* Switch address space and flush TLB */
@@ -358,11 +357,7 @@ KiSwapContextExit(IN PKTHREAD OldThread,
     Ke386SetGs(0);
 
     /* Set the TEB */
-    Pcr->NtTib.Self = (PVOID)NewThread->Teb;
-    GdtEntry = &Pcr->GDT[KGDT_R3_TEB / sizeof(KGDTENTRY)];
-    GdtEntry->BaseLow = (USHORT)((ULONG_PTR)NewThread->Teb & 0xFFFF);
-    GdtEntry->HighWord.Bytes.BaseMid = (UCHAR)((ULONG_PTR)NewThread->Teb >> 16);
-    GdtEntry->HighWord.Bytes.BaseHi = (UCHAR)((ULONG_PTR)NewThread->Teb >> 24);
+    KiSetTebBase((PKPCR)Pcr, NewThread->Teb);
 
     /* Set new TSS fields */
     Pcr->TSS->Esp0 = (ULONG_PTR)NewThread->InitialStack;
@@ -491,7 +486,7 @@ KiDispatchInterrupt(VOID)
         KiQuantumEnd();
     }
     else if (Prcb->NextThread)
-    {       
+    {
         /* Capture current thread data */
         OldThread = Prcb->CurrentThread;
         NewThread = Prcb->NextThread;
index ec9c08d..cb73f07 100644 (file)
@@ -45,14 +45,14 @@ KiVdmUnhandledOpcode(INTO);
 KiVdmUnhandledOpcode(INV);
 
 /* OPCODE HANDLERS ************************************************************/
-    
+
 BOOLEAN
 FASTCALL
 KiVdmOpcodePUSHF(IN PKTRAP_FRAME TrapFrame,
                  IN ULONG Flags)
 {
     ULONG Esp, V86EFlags, TrapEFlags;
-    
+
     /* Check for VME support */
     ASSERT(KeI386VirtualIntExtensions == FALSE);
 
@@ -67,10 +67,10 @@ KiVdmOpcodePUSHF(IN PKTRAP_FRAME TrapFrame,
     /* Add in those flags if they exist, and add in the IOPL flag */
     V86EFlags |= TrapEFlags;
     V86EFlags |= EFLAGS_IOPL;
-    
+
     /* Build flat ESP */
     Esp = (TrapFrame->HardwareSegSs << 4) + (USHORT)TrapFrame->HardwareEsp;
-    
+
     /* Check for OPER32 */
     if (KiVdmGetPrefixFlags(Flags) & PFX_FLAG_OPER32)
     {
@@ -84,11 +84,11 @@ KiVdmOpcodePUSHF(IN PKTRAP_FRAME TrapFrame,
         Esp -= 2;
         *(PUSHORT)Esp = (USHORT)V86EFlags;
     }
-    
+
     /* Set new ESP and EIP */
     TrapFrame->HardwareEsp = Esp - (TrapFrame->HardwareSegSs << 4);
     TrapFrame->Eip += KiVdmGetInstructionSize(Flags);
-    
+
     /* We're done */
     return TRUE;
 }
@@ -99,10 +99,10 @@ KiVdmOpcodePOPF(IN PKTRAP_FRAME TrapFrame,
                 IN ULONG Flags)
 {
     ULONG Esp, V86EFlags, EFlags, TrapEFlags;
-    
+
     /* Build flat ESP */
     Esp = (TrapFrame->HardwareSegSs << 4) + (USHORT)TrapFrame->HardwareEsp;
-    
+
     /* Check for OPER32 */
     if (KiVdmGetPrefixFlags(Flags) & PFX_FLAG_OPER32)
     {
@@ -116,22 +116,22 @@ KiVdmOpcodePOPF(IN PKTRAP_FRAME TrapFrame,
         EFlags = *(PUSHORT)Esp;
         Esp += 2;
     }
-    
+
     /* Set new ESP */
     TrapFrame->HardwareEsp = Esp - (TrapFrame->HardwareSegSs << 4);
-    
+
     /* Mask out IOPL from the flags */
     EFlags &= ~EFLAGS_IOPL;
-    
+
     /* Save the V86 flags, but mask out the nested task flag */
     V86EFlags = EFlags & ~EFLAGS_NESTED_TASK;
-    
+
     /* Now leave only alignment, nested task and interrupt flag */
     EFlags &= (EFLAGS_ALIGN_CHECK | EFLAGS_NESTED_TASK | EFLAGS_INTERRUPT_MASK);
-    
+
     /* Get trap EFlags */
     TrapEFlags = TrapFrame->EFlags;
-                
+
     /* Check for VME support */
     ASSERT(KeI386VirtualIntExtensions == FALSE);
 
@@ -143,16 +143,16 @@ KiVdmOpcodePOPF(IN PKTRAP_FRAME TrapFrame,
 
     /* Check if ESP0 needs to be fixed up */
     if (TrapEFlags & EFLAGS_V86_MASK) Ki386AdjustEsp0(TrapFrame);
-    
+
     /* Update the V8086 EFlags state */
     KiVdmClearVdmEFlags(EFLAGS_ALIGN_CHECK | EFLAGS_NESTED_TASK | EFLAGS_INTERRUPT_MASK);
     KiVdmSetVdmEFlags(EFlags);
-   
+
     /* FIXME: Check for VDM interrupts */
-    
+
     /* Update EIP */
     TrapFrame->Eip += KiVdmGetInstructionSize(Flags);
-    
+
     /* We're done */
     return TRUE;
 }
@@ -163,63 +163,63 @@ KiVdmOpcodeINTnn(IN PKTRAP_FRAME TrapFrame,
                  IN ULONG Flags)
 {
     ULONG Esp, V86EFlags, TrapEFlags, Eip, Interrupt;
-    
+
     /* Read trap frame EFlags */
     TrapEFlags = TrapFrame->EFlags;
-    
+
     /* Remove interrupt flag from V8086 EFlags */
     V86EFlags = *KiNtVdmState;
     KiVdmClearVdmEFlags(EFLAGS_INTERRUPT_MASK);
-    
+
     /* Keep only alignment and interrupt flag from the V8086 state */
     V86EFlags &= (EFLAGS_ALIGN_CHECK | EFLAGS_INTERRUPT_MASK);
-    
+
     /* Check for VME support */
     ASSERT(KeI386VirtualIntExtensions == FALSE);
-    
+
     /* Mask in the relevant V86 EFlags into the trap flags */
     V86EFlags |= (TrapEFlags & ~EFLAGS_INTERRUPT_MASK);
-    
+
     /* And mask out the VIF, nested task and TF flag from the trap flags */
     TrapFrame->EFlags = TrapEFlags &~ (EFLAGS_VIF | EFLAGS_NESTED_TASK | EFLAGS_TF);
-    
+
     /* Add the IOPL flag to the local trap flags */
     V86EFlags |= EFLAGS_IOPL;
-    
+
     /* Build flat ESP */
     Esp = (TrapFrame->HardwareSegSs << 4) + TrapFrame->HardwareEsp;
-    
+
     /* Push EFlags */
     Esp -= 2;
     *(PUSHORT)(Esp) = (USHORT)V86EFlags;
-    
+
     /* Push CS */
     Esp -= 2;
     *(PUSHORT)(Esp) = (USHORT)TrapFrame->SegCs;
-    
+
     /* Push IP */
     Esp -= 2;
     *(PUSHORT)(Esp) = (USHORT)TrapFrame->Eip + KiVdmGetInstructionSize(Flags) + 1;
-    
+
     /* Update ESP */
     TrapFrame->HardwareEsp = (USHORT)Esp;
-    
+
     /* Get flat EIP */
     Eip = (TrapFrame->SegCs << 4) + TrapFrame->Eip;
-    
+
     /* Now get the *next* EIP address (current is original + the count - 1) */
     Eip += KiVdmGetInstructionSize(Flags);
-    
+
     /* Now read the interrupt number */
     Interrupt = *(PUCHAR)Eip;
-        
+
     /* Read the EIP from its IVT entry */
     Interrupt = *(PULONG)(Interrupt * 4);
     TrapFrame->Eip = (USHORT)Interrupt;
-    
+
     /* Now get the CS segment */
     Interrupt = (USHORT)(Interrupt >> 16);
-    
+
     /* Check if the trap was not V8086 trap */
     if (!(TrapFrame->EFlags & EFLAGS_V86_MASK))
     {
@@ -241,7 +241,7 @@ KiVdmOpcodeINTnn(IN PKTRAP_FRAME TrapFrame,
         /* Set IVT CS */
         TrapFrame->SegCs = Interrupt;
     }
-    
+
     /* We're done */
     return TRUE;
 }
@@ -255,17 +255,17 @@ KiVdmOpcodeIRET(IN PKTRAP_FRAME TrapFrame,
 
     /* Build flat ESP */
     Esp = (TrapFrame->HardwareSegSs << 4) + TrapFrame->HardwareEsp;
-    
+
     /* Check for OPER32 */
     if (KiVdmGetPrefixFlags(Flags) & PFX_FLAG_OPER32)
     {
         /* Build segmented EIP */
         TrapFrame->Eip = *(PULONG)Esp;
         TrapFrame->SegCs = *(PUSHORT)(Esp + 4);
-        
+
         /* Set new ESP */
         TrapFrame->HardwareEsp += 12;
-        
+
         /* Get EFLAGS */
         EFlags = *(PULONG)(Esp + 8);
     }
@@ -281,28 +281,28 @@ KiVdmOpcodeIRET(IN PKTRAP_FRAME TrapFrame,
         /* Get EFLAGS */
         EFlags = *(PUSHORT)(Esp + 4);
     }
-    
+
     /* Mask out EFlags */
     EFlags &= ~(EFLAGS_IOPL + EFLAGS_VIF + EFLAGS_NESTED_TASK + EFLAGS_VIP);
     V86EFlags = EFlags;
-    
+
     /* Check for VME support */
     ASSERT(KeI386VirtualIntExtensions == FALSE);
-    
+
     /* Add V86 and Interrupt flag */
     EFlags |= EFLAGS_V86_MASK | EFLAGS_INTERRUPT_MASK;
-    
+
     /* Update EFlags in trap frame */
     TrapEFlags = TrapFrame->EFlags;
     TrapFrame->EFlags = (TrapFrame->EFlags & EFLAGS_VIP) | EFlags;
-    
+
     /* Check if ESP0 needs to be fixed up */
     if (!(TrapEFlags & EFLAGS_V86_MASK)) Ki386AdjustEsp0(TrapFrame);
-    
+
     /* Update the V8086 EFlags state */
     KiVdmClearVdmEFlags(EFLAGS_INTERRUPT_MASK);
     KiVdmSetVdmEFlags(V86EFlags);
-    
+
     /* Build flat EIP and check if this is the BOP instruction */
     Eip = (TrapFrame->SegCs << 4) + TrapFrame->Eip;
     if (*(PUSHORT)Eip == 0xC4C4)
@@ -315,7 +315,7 @@ KiVdmOpcodeIRET(IN PKTRAP_FRAME TrapFrame,
         /* FIXME: Check for VDM interrupts */
        DPRINT("FIXME: Check for VDM interrupts\n");
     }
-    
+
     /* We're done */
     return TRUE;
 }
@@ -324,16 +324,16 @@ BOOLEAN
 FASTCALL
 KiVdmOpcodeCLI(IN PKTRAP_FRAME TrapFrame,
                IN ULONG Flags)
-{       
+{
     /* Check for VME support */
     ASSERT(KeI386VirtualIntExtensions == FALSE);
 
     /* Disable interrupts */
     KiVdmClearVdmEFlags(EFLAGS_INTERRUPT_MASK);
-    
+
     /* Skip instruction */
     TrapFrame->Eip += KiVdmGetInstructionSize(Flags);
-    
+
     /* Done */
     return TRUE;
 }
@@ -348,10 +348,10 @@ KiVdmOpcodeSTI(IN PKTRAP_FRAME TrapFrame,
 
     /* Enable interrupts */
     KiVdmSetVdmEFlags(EFLAGS_INTERRUPT_MASK);
-    
+
     /* Skip instruction */
     TrapFrame->Eip += KiVdmGetInstructionSize(Flags);
-    
+
     /* Done */
     return TRUE;
 }
@@ -364,11 +364,11 @@ KiVdmHandleOpcode(IN PKTRAP_FRAME TrapFrame,
                   IN ULONG Flags)
 {
     ULONG Eip;
-    
+
     /* Get flat EIP of the *current* instruction (not the original EIP) */
     Eip = (TrapFrame->SegCs << 4) + TrapFrame->Eip;
     Eip += KiVdmGetInstructionSize(Flags) - 1;
-    
+
     /* Read the opcode entry */
     switch (*(PUCHAR)Eip)
     {
@@ -401,11 +401,11 @@ KiVdmHandleOpcode(IN PKTRAP_FRAME TrapFrame,
         case 0x9D:              return KiCallVdmHandler(POPF);
         case 0xCD:              return KiCallVdmHandler(INTnn);
         case 0xCE:              return KiCallVdmHandler(INTO);
-        case 0xCF:              return KiCallVdmHandler(IRET);   
-        case 0xE4:              return KiCallVdmHandler(INBimm);   
+        case 0xCF:              return KiCallVdmHandler(IRET);
+        case 0xE4:              return KiCallVdmHandler(INBimm);
         case 0xE5:              return KiCallVdmHandler(INWimm);
         case 0xE6:              return KiCallVdmHandler(OUTBimm);
-        case 0xE7:              return KiCallVdmHandler(OUTWimm);        
+        case 0xE7:              return KiCallVdmHandler(OUTWimm);
         case 0xEC:              return KiCallVdmHandler(INB);
         case 0xED:              return KiCallVdmHandler(INW);
         case 0xEE:              return KiCallVdmHandler(OUTB);
@@ -414,7 +414,7 @@ KiVdmHandleOpcode(IN PKTRAP_FRAME TrapFrame,
         case 0xFA:              return KiCallVdmHandler(CLI);
         case 0xFB:              return KiCallVdmHandler(STI);
         default:                return KiCallVdmHandler(INV);
-    }    
+    }
 }
 
 /* PREFIX HANDLER *************************************************************/
@@ -426,7 +426,7 @@ KiVdmOpcodePrefix(IN PKTRAP_FRAME TrapFrame,
 {
     /* Increase instruction size */
     Flags++;
-    
+
     /* Handle the next opcode */
     return KiVdmHandleOpcode(TrapFrame, Flags);
 }
@@ -450,37 +450,30 @@ FASTCALL
 KiExitV86Mode(IN PKTRAP_FRAME TrapFrame)
 {
     PKV8086_STACK_FRAME StackFrame;
-    PKGDTENTRY GdtEntry;
     PKTHREAD Thread;
     PKTRAP_FRAME PmTrapFrame;
     PKV86_FRAME V86Frame;
     PFX_SAVE_AREA NpxFrame;
-    
+
     /* Get the stack frame back */
     StackFrame = CONTAINING_RECORD(TrapFrame->Esi, KV8086_STACK_FRAME, V86Frame);
     PmTrapFrame = &StackFrame->TrapFrame;
     V86Frame = &StackFrame->V86Frame;
     NpxFrame = &StackFrame->NpxArea;
-    
+
     /* Copy the FPU frame back */
     Thread = KeGetCurrentThread();
     RtlCopyMemory(KiGetThreadNpxArea(Thread), NpxFrame, sizeof(FX_SAVE_AREA));
 
     /* Set initial stack back */
     Thread->InitialStack = (PVOID)((ULONG_PTR)V86Frame->ThreadStack + sizeof(FX_SAVE_AREA));
-    
+
     /* Set ESP0 back in the KTSS */
     KeGetPcr()->TSS->Esp0 = (ULONG_PTR)&PmTrapFrame->V86Es;
 
     /* Restore TEB addresses */
     Thread->Teb = V86Frame->ThreadTeb;
-    KeGetPcr()->NtTib.Self = V86Frame->PcrTeb;
-    
-    /* Setup real TEB descriptor */
-    GdtEntry = &((PKIPCR)KeGetPcr())->GDT[KGDT_R3_TEB / sizeof(KGDTENTRY)];
-    GdtEntry->BaseLow = (USHORT)((ULONG_PTR)Thread->Teb & 0xFFFF);
-    GdtEntry->HighWord.Bytes.BaseMid = (UCHAR)((ULONG_PTR)Thread->Teb >> 16);
-    GdtEntry->HighWord.Bytes.BaseHi = (UCHAR)((ULONG_PTR)Thread->Teb >> 24);
+    KiSetTebBase(KeGetPcr(), V86Frame->ThreadTeb);
 
     /* Enable interrupts and return a pointer to the trap frame */
     _enable();
@@ -492,7 +485,6 @@ FASTCALL
 KiEnterV86Mode(IN PKV8086_STACK_FRAME StackFrame)
 {
     PKTHREAD Thread;
-    PKGDTENTRY GdtEntry;
     PKTRAP_FRAME TrapFrame = &StackFrame->TrapFrame;
     PKV86_FRAME V86Frame = &StackFrame->V86Frame;
     PFX_SAVE_AREA NpxFrame = &StackFrame->NpxArea;
@@ -501,26 +493,26 @@ KiEnterV86Mode(IN PKV8086_STACK_FRAME StackFrame)
     TrapFrame->SegCs = KGDT_R0_CODE | RPL_MASK;
     TrapFrame->SegEs = TrapFrame->SegDs = TrapFrame->SegFs = TrapFrame->SegGs = 0;
     TrapFrame->ErrCode = 0;
-    
+
     /* Get the current thread's initial stack */
     Thread = KeGetCurrentThread();
     V86Frame->ThreadStack = KiGetThreadNpxArea(Thread);
-    
+
     /* Save TEB addresses */
     V86Frame->ThreadTeb = Thread->Teb;
     V86Frame->PcrTeb = KeGetPcr()->NtTib.Self;
-    
+
     /* Save return EIP */
     TrapFrame->Eip = (ULONG_PTR)Ki386BiosCallReturnAddress;
-    
+
     /* Save our stack (after the frames) */
     TrapFrame->Esi = (ULONG_PTR)V86Frame;
     TrapFrame->Edi = (ULONG_PTR)_AddressOfReturnAddress() + 4;
-    
+
     /* Sanitize EFlags and enable interrupts */
     TrapFrame->EFlags = __readeflags() & 0x60DD7;
     TrapFrame->EFlags |= EFLAGS_INTERRUPT_MASK;
-    
+
     /* Fill out the rest of the frame */
     TrapFrame->HardwareSegSs = KGDT_R3_DATA | RPL_MASK;
     TrapFrame->HardwareEsp = 0x11FFE;
@@ -529,38 +521,32 @@ KiEnterV86Mode(IN PKV8086_STACK_FRAME StackFrame)
 
     /* Set some debug fields if trap debugging is enabled */
     KiFillTrapFrameDebug(TrapFrame);
-    
+
     /* Disable interrupts */
     _disable();
-    
+
     /* Copy the thread's NPX frame */
     RtlCopyMemory(NpxFrame, V86Frame->ThreadStack, sizeof(FX_SAVE_AREA));
-    
+
     /* Clear exception list */
     KeGetPcr()->NtTib.ExceptionList = EXCEPTION_CHAIN_END;
-    
+
     /* Set new ESP0 */
     KeGetPcr()->TSS->Esp0 = (ULONG_PTR)&TrapFrame->V86Es;
-                             
+
     /* Set new initial stack */
     Thread->InitialStack = V86Frame;
-        
+
     /* Set VDM TEB */
     Thread->Teb = (PTEB)TRAMPOLINE_TEB;
-    KeGetPcr()->NtTib.Self = (PVOID)TRAMPOLINE_TEB;
-    
-    /* Setup VDM TEB descriptor */
-    GdtEntry = &((PKIPCR)KeGetPcr())->GDT[KGDT_R3_TEB / sizeof(KGDTENTRY)];
-    GdtEntry->BaseLow = (USHORT)((ULONG_PTR)TRAMPOLINE_TEB & 0xFFFF);
-    GdtEntry->HighWord.Bytes.BaseMid = (UCHAR)((ULONG_PTR)TRAMPOLINE_TEB >> 16);
-    GdtEntry->HighWord.Bytes.BaseHi = (UCHAR)((ULONG_PTR)TRAMPOLINE_TEB >> 24);
-    
+    KiSetTebBase(KeGetPcr(), (PVOID)TRAMPOLINE_TEB);
+
     /* Enable interrupts */
     _enable();
+
     /* Start VDM execution */
     NtVdmControl(VdmStartExecution, NULL);
-    
+
     /* Exit to V86 mode */
     KiEoiHelper(TrapFrame);
 }
@@ -585,14 +571,14 @@ Ke386SetIOPL(VOID)
     /* Convert to a context */
     Context.ContextFlags = CONTEXT_CONTROL;
     KeTrapFrameToContext(TrapFrame, NULL, &Context);
-    
+
     /* Set the IOPL flag */
     Context.EFlags |= EFLAGS_IOPL;
-    
+
     /* Convert back to a trap frame */
     KeContextToTrapFrame(&Context, NULL, TrapFrame, CONTEXT_CONTROL, UserMode);
 }
+
 /* PUBLIC FUNCTIONS ***********************************************************/
 
 /*
index cbdbc77..1b273ca 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/ke/i386/irq.c
index d496345..ee330ca 100644 (file)
@@ -281,6 +281,86 @@ ExpCheckPoolHeader(IN PPOOL_HEADER Entry)
     }
 }
 
+VOID
+NTAPI
+ExpCheckPoolAllocation(
+    PVOID P,
+    POOL_TYPE PoolType,
+    ULONG Tag)
+{
+    PPOOL_HEADER Entry;
+    ULONG i;
+    KIRQL OldIrql;
+    POOL_TYPE RealPoolType;
+
+    /* Get the pool header */
+    Entry = ((PPOOL_HEADER)P) - 1;
+
+    /* Check if this is a large allocation */
+    if (PAGE_ALIGN(P) == P)
+    {
+        /* Lock the pool table */
+        KeAcquireSpinLock(&ExpLargePoolTableLock, &OldIrql);
+
+        /* Find the pool tag */
+        for (i = 0; i < PoolBigPageTableSize; i++)
+        {
+            /* Check if this is our allocation */
+            if (PoolBigPageTable[i].Va == P)
+            {
+                /* Make sure the tag is ok */
+                if (PoolBigPageTable[i].Key != Tag)
+                {
+                    KeBugCheckEx(BAD_POOL_CALLER, 0x0A, (ULONG_PTR)P, PoolBigPageTable[i].Key, Tag);
+                }
+
+                break;
+            }
+        }
+
+        /* Release the lock */
+        KeReleaseSpinLock(&ExpLargePoolTableLock, OldIrql);
+
+        if (i == PoolBigPageTableSize)
+        {
+            /* Did not find the allocation */
+            //ASSERT(FALSE);
+        }
+
+        /* Get Pool type by address */
+        RealPoolType = MmDeterminePoolType(P);
+    }
+    else
+    {
+        /* Verify the tag */
+        if (Entry->PoolTag != Tag)
+        {
+            DPRINT1("Allocation has wrong pool tag! Expected '%.4s', got '%.4s' (0x%08lx)\n",
+                    &Tag, &Entry->PoolTag, Entry->PoolTag);
+            KeBugCheckEx(BAD_POOL_CALLER, 0x0A, (ULONG_PTR)P, Entry->PoolTag, Tag);
+        }
+
+        /* Check the rest of the header */
+        ExpCheckPoolHeader(Entry);
+
+        /* Get Pool type from entry */
+        RealPoolType = (Entry->PoolType - 1);
+    }
+
+    /* Should we check the pool type? */
+    if (PoolType != -1)
+    {
+        /* Verify the pool type */
+        if (RealPoolType != PoolType)
+        {
+            DPRINT1("Wrong pool type! Expected %s, got %s\n",
+                    PoolType & BASE_POOL_TYPE_MASK ? "PagedPool" : "NonPagedPool",
+                    (Entry->PoolType - 1) & BASE_POOL_TYPE_MASK ? "PagedPool" : "NonPagedPool");
+            KeBugCheckEx(BAD_POOL_CALLER, 0xCC, (ULONG_PTR)P, Entry->PoolTag, Tag);
+        }
+    }
+}
+
 VOID
 NTAPI
 ExpCheckPoolBlocks(IN PVOID Block)
@@ -2436,4 +2516,103 @@ ExAllocatePoolWithQuotaTag(IN POOL_TYPE PoolType,
     return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag);
 }
 
+#if DBG && KDBG
+
+BOOLEAN
+ExpKdbgExtPool(
+    ULONG Argc,
+    PCHAR Argv[])
+{
+    ULONG_PTR Address = 0, Flags = 0;
+    PVOID PoolPage;
+    PPOOL_HEADER Entry;
+    BOOLEAN ThisOne;
+    PULONG Data;
+
+    if (Argc > 1)
+    {
+        /* Get address */
+        if (!KdbpGetHexNumber(Argv[1], &Address))
+        {
+            KdbpPrint("Invalid parameter: %s\n", Argv[0]);
+            return TRUE;
+        }
+    }
+
+    if (Argc > 2)
+    {
+        /* Get address */
+        if (!KdbpGetHexNumber(Argv[1], &Flags))
+        {
+            KdbpPrint("Invalid parameter: %s\n", Argv[0]);
+            return TRUE;
+        }
+    }
+
+    /* Check if we got an address */
+    if (Address != 0)
+    {
+        /* Get the base page */
+        PoolPage = PAGE_ALIGN(Address);
+    }
+    else
+    {
+        KdbpPrint("Heap is unimplemented\n");
+        return TRUE;
+    }
+
+    /* No paging support! */
+    if (!MmIsAddressValid(PoolPage))
+    {
+        KdbpPrint("Address not accessible!\n");
+        return TRUE;
+    }
+
+    /* Get pool type */
+    if ((Address >= (ULONG_PTR)MmPagedPoolStart) && (Address <= (ULONG_PTR)MmPagedPoolEnd))
+        KdbpPrint("Allocation is from PagedPool region\n");
+    else if ((Address >= (ULONG_PTR)MmNonPagedPoolStart) && (Address <= (ULONG_PTR)MmNonPagedPoolEnd))
+        KdbpPrint("Allocation is from NonPagedPool region\n");
+    else
+    {
+        KdbpPrint("Address 0x%p is not within any pool!\n", (PVOID)Address);
+        return TRUE;
+    }
+
+    /* Loop all entries of that page */
+    Entry = PoolPage;
+    do
+    {
+        /* Check if the address is within that entry */
+        ThisOne = ((Address >= (ULONG_PTR)Entry) &&
+                   (Address < (ULONG_PTR)(Entry + Entry->BlockSize)));
+
+        if (!(Flags & 1) || ThisOne)
+        {
+            /* Print the line */
+            KdbpPrint("%c%p size: %4d previous size: %4d  %s  %.4s\n",
+                     ThisOne ? '*' : ' ', Entry, Entry->BlockSize, Entry->PreviousSize,
+                     (Flags & 0x80000000) ? "" : (Entry->PoolType ? "(Allocated)" : "(Free)     "),
+                     (Flags & 0x80000000) ? "" : (PCHAR)&Entry->PoolTag);
+        }
+
+        if (Flags & 1)
+        {
+            Data = (PULONG)(Entry + 1);
+            KdbpPrint("    %p  %08lx %08lx %08lx %08lx\n"
+                     "    %p  %08lx %08lx %08lx %08lx\n",
+                     &Data[0], Data[0], Data[1], Data[2], Data[3],
+                     &Data[4], Data[4], Data[5], Data[6], Data[7]);
+        }
+
+        /* Go to next entry */
+        Entry = POOL_BLOCK(Entry, Entry->BlockSize);
+    }
+    while ((Entry->BlockSize != 0) && ((ULONG_PTR)Entry < (ULONG_PTR)PoolPage + PAGE_SIZE));
+
+    return TRUE;
+}
+
+#endif // DBG && KDBG
+
 /* EOF */
index d9c1e71..4a7fafa 100644 (file)
@@ -1644,7 +1644,8 @@ MiSessionRemoveProcess(VOID)
     ASSERT(MmIsAddressValid(MmSessionSpace) == TRUE);
 
     /* Remove the process from the list ,and dereference the session */
-    RemoveEntryList(&CurrentProcess->SessionProcessLinks);
+    // DO NOT ENABLE THIS UNLESS YOU FIXED THE NP POOL CORRUPTION THAT IT CAUSES!!!
+    //RemoveEntryList(&CurrentProcess->SessionProcessLinks);
     //MiDereferenceSession();
 }
 
@@ -1673,7 +1674,8 @@ MiSessionAddProcess(IN PEPROCESS NewProcess)
     NewProcess->Session = SessionGlobal;
 
     /* Insert it into the process list */
-    InsertTailList(&SessionGlobal->ProcessList, &NewProcess->SessionProcessLinks);
+    // DO NOT ENABLE THIS UNLESS YOU FIXED THE NP POOL CORRUPTION THAT IT CAUSES!!!
+    //InsertTailList(&SessionGlobal->ProcessList, &NewProcess->SessionProcessLinks);
 
     /* Set the flag */
     PspSetProcessFlag(NewProcess, PSF_PROCESS_IN_SESSION_BIT);
index 9ecaeb9..aae43d6 100644 (file)
@@ -401,7 +401,7 @@ MmInsertMemoryArea(
        Vad->u.VadFlags.Spare = 1;
        Vad->u.VadFlags.PrivateMemory = 1;
        Vad->u.VadFlags.Protection = MiMakeProtectionMask(marea->Protect);
-       
+
        /* Insert the VAD */
        MiInsertVad(Vad, Process);
        marea->Vad = Vad;
@@ -676,6 +676,100 @@ NTAPI
 MiRemoveNode(IN PMMADDRESS_NODE Node,
 IN PMM_AVL_TABLE Table);
 
+#if DBG
+
+static
+VOID
+MiRosCheckMemoryAreasRecursive(
+   PMEMORY_AREA Node)
+{
+    /* Check if the allocation is ok */
+    ExpCheckPoolAllocation(Node, NonPagedPool, 'ERAM');
+
+    /* Check some fields */
+    ASSERT(Node->Magic == 'erAM');
+    ASSERT(PAGE_ALIGN(Node->StartingAddress) == Node->StartingAddress);
+    ASSERT(Node->EndingAddress != NULL);
+    ASSERT(PAGE_ALIGN(Node->EndingAddress) == Node->EndingAddress);
+    ASSERT((ULONG_PTR)Node->StartingAddress < (ULONG_PTR)Node->EndingAddress);
+    ASSERT((Node->Type == 0) ||
+           (Node->Type == MEMORY_AREA_CACHE) ||
+          // (Node->Type == MEMORY_AREA_CACHE_SEGMENT) ||
+           (Node->Type == MEMORY_AREA_SECTION_VIEW) ||
+           (Node->Type == MEMORY_AREA_OWNED_BY_ARM3) ||
+           (Node->Type == (MEMORY_AREA_OWNED_BY_ARM3 | MEMORY_AREA_STATIC)));
+
+    /* Recursively check children */
+    if (Node->LeftChild != NULL)
+        MiRosCheckMemoryAreasRecursive(Node->LeftChild);
+    if (Node->RightChild != NULL)
+        MiRosCheckMemoryAreasRecursive(Node->RightChild);
+}
+
+VOID
+NTAPI
+MiRosCheckMemoryAreas(
+   PMMSUPPORT AddressSpace)
+{
+    PMEMORY_AREA RootNode;
+    PEPROCESS AddressSpaceOwner;
+    BOOLEAN NeedReleaseLock;
+
+    NeedReleaseLock = FALSE;
+
+    /* Get the address space owner */
+    AddressSpaceOwner = CONTAINING_RECORD(AddressSpace, EPROCESS, Vm);
+
+    /* Check if we already own the address space lock */
+    if (AddressSpaceOwner->AddressCreationLock.Owner != KeGetCurrentThread())
+    {
+        /* We must own it! */
+        MmLockAddressSpace(AddressSpace);
+        NeedReleaseLock = TRUE;
+    }
+
+    /* Check all memory areas */
+    RootNode = (PMEMORY_AREA)AddressSpace->WorkingSetExpansionLinks.Flink;
+    MiRosCheckMemoryAreasRecursive(RootNode);
+
+    /* Release the lock, if we acquired it */
+    if (NeedReleaseLock)
+    {
+        MmUnlockAddressSpace(AddressSpace);
+    }
+}
+
+extern KGUARDED_MUTEX PspActiveProcessMutex;
+
+VOID
+NTAPI
+MiCheckAllProcessMemoryAreas(VOID)
+{
+    PEPROCESS Process;
+    PLIST_ENTRY Entry;
+
+    /* Acquire the Active Process Lock */
+    KeAcquireGuardedMutex(&PspActiveProcessMutex);
+
+    /* Loop the process list */
+    Entry = PsActiveProcessHead.Flink;
+    while (Entry != &PsActiveProcessHead)
+    {
+        /* Get the process */
+        Process = CONTAINING_RECORD(Entry, EPROCESS, ActiveProcessLinks);
+
+        /* Check memory areas */
+        MiRosCheckMemoryAreas(&Process->Vm);
+
+        Entry = Entry->Flink;
+    }
+
+    /* Release the lock */
+    KeReleaseGuardedMutex(&PspActiveProcessMutex);
+}
+
+#endif
+
 /**
  * @name MmFreeMemoryArea
  *
@@ -712,6 +806,12 @@ MmFreeMemoryArea(
    ULONG_PTR Address;
    PVOID EndAddress;
 
+   /* Make sure we own the address space lock! */
+   ASSERT(CONTAINING_RECORD(AddressSpace, EPROCESS, Vm)->AddressCreationLock.Owner == KeGetCurrentThread());
+
+    /* Check magic */
+    ASSERT(MemoryArea->Magic == 'erAM');
+
    if (MemoryArea->Type != MEMORY_AREA_OWNED_BY_ARM3)
    {
        PEPROCESS CurrentProcess = PsGetCurrentProcess();
@@ -731,7 +831,7 @@ MmFreeMemoryArea(
             BOOLEAN Dirty = FALSE;
             SWAPENTRY SwapEntry = 0;
             PFN_NUMBER Page = 0;
-             
+
              if (MmIsPageSwapEntry(Process, (PVOID)Address))
              {
                 MmDeletePageFileMapping(Process, (PVOID)Address, &SwapEntry);
@@ -788,9 +888,6 @@ MmFreeMemoryArea(
        }
     }
 
-    /* There must be no page ops in progress */
-    ASSERT(MemoryArea->PageOpCount == 0);
-
    /* Remove the tree item. */
    {
       if (MemoryArea->Parent != NULL)
@@ -979,7 +1076,7 @@ MmCreateMemoryArea(PMMSUPPORT AddressSpace,
    MemoryArea->Protect = Protect;
    MemoryArea->Flags = AllocationFlags;
    //MemoryArea->LockCount = 0;
-   MemoryArea->PageOpCount = 0;
+   MemoryArea->Magic = 'erAM';
    MemoryArea->DeleteInProgress = FALSE;
 
    MmInsertMemoryArea(AddressSpace, MemoryArea);
@@ -1072,17 +1169,17 @@ MmDeleteProcessAddressSpace(PEPROCESS Process)
             KeBugCheck(MEMORY_MANAGEMENT);
       }
    }
-   
+
 #if (_MI_PAGING_LEVELS == 2)
     {
         KIRQL OldIrql;
         PMMPDE pointerPde;
         /* Attach to Process */
         KeAttachProcess(&Process->Pcb);
-        
+
         /* Acquire PFN lock */
         OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
-        
+
         for(Address = MI_LOWEST_VAD_ADDRESS;
             Address < MM_HIGHEST_VAD_ADDRESS;
             Address =(PVOID)((ULONG_PTR)Address + (PAGE_SIZE * PTE_COUNT)))
@@ -1098,7 +1195,7 @@ MmDeleteProcessAddressSpace(PEPROCESS Process)
         }
         /* Release lock */
         KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
-        
+
         /* Detach */
         KeDetachProcess();
     }
index d864d96..bea94ce 100644 (file)
@@ -205,6 +205,52 @@ PspReapRoutine(IN PVOID Context)
                                                (PVOID)1) != (PVOID)1);
 }
 
+#if DBG
+VOID
+NTAPI
+PspCheckProcessList()
+{
+    PLIST_ENTRY Entry;
+
+    KeAcquireGuardedMutex(&PspActiveProcessMutex);
+    DbgPrint("# checking PsActiveProcessHead @ %p\n", &PsActiveProcessHead);
+    for (Entry = PsActiveProcessHead.Flink;
+         Entry != &PsActiveProcessHead;
+         Entry = Entry->Flink)
+    {
+        PEPROCESS Process = CONTAINING_RECORD(Entry, EPROCESS, ActiveProcessLinks);
+        POBJECT_HEADER Header;
+        PVOID Info, HeaderLocation;
+
+        /* Get the header and assume this is what we'll free */
+        Header = OBJECT_TO_OBJECT_HEADER(Process);
+        HeaderLocation = Header;
+
+        /* To find the header, walk backwards from how we allocated */
+        if ((Info = OBJECT_HEADER_TO_CREATOR_INFO(Header)))
+        {
+            HeaderLocation = Info;
+        }
+        if ((Info = OBJECT_HEADER_TO_NAME_INFO(Header)))
+        {
+            HeaderLocation = Info;
+        }
+        if ((Info = OBJECT_HEADER_TO_HANDLE_INFO(Header)))
+        {
+            HeaderLocation = Info;
+        }
+        if ((Info = OBJECT_HEADER_TO_QUOTA_INFO(Header)))
+        {
+            HeaderLocation = Info;
+        }
+
+        ExpCheckPoolAllocation(HeaderLocation, NonPagedPool, 'corP');
+    }
+
+    KeReleaseGuardedMutex(&PspActiveProcessMutex);
+}
+#endif
+
 VOID
 NTAPI
 PspDeleteProcess(IN PVOID ObjectBody)
@@ -221,6 +267,8 @@ PspDeleteProcess(IN PVOID ObjectBody)
         /* Remove it from the Active List */
         KeAcquireGuardedMutex(&PspActiveProcessMutex);
         RemoveEntryList(&Process->ActiveProcessLinks);
+        Process->ActiveProcessLinks.Flink = NULL;
+        Process->ActiveProcessLinks.Blink = NULL;
         KeReleaseGuardedMutex(&PspActiveProcessMutex);
     }
 
index 5e135b3..29cf573 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            subsys/ntvdm/ntvdm->c
index 5888a62..7a60799 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #include <windows.h>
 #define REACTOS_STR_FILE_DESCRIPTION   "ReactOS Virtual DOS Machine\0"
index 6a8c025..5917521 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: rosglue.c 39928 2009-03-10 02:49:45Z tkreuzer $
- *
+/*
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           FreeType implementation for ReactOS
  * PURPOSE:           Glue functions between FreeType
index 22c80c3..5b41c6b 100644 (file)
@@ -2,8 +2,8 @@
  * dllmain.c
  *
  * $Revision: 1.11 $
- * $Author$
- * $Date$
+ * $Author: hbelusca $
+ * $Date: 2013-01-28 23:45:53 +0100 (lun. 28 janv. 2013) $
  *
  */
 
index 51e46be..c8ac998 100644 (file)
@@ -1,12 +1,11 @@
 #include "precomp.h"
 
-/* $Id: stubs.c 28709 2007-08-31 15:09:51Z greatlrd $
- *
+/*
  * reactos/lib/gdi32/misc/hacks.c
  *
  * GDI32.DLL hacks
  *
- * Api that are hacked but we can not do correct implemtions yetm but using own syscall
+ * Apis that are hacked but we cannot write correct implementations yet but we are using our own syscall
  *
  */
 
index 83c4747..64b4207 100644 (file)
@@ -15,7 +15,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 /*
- * $Id:
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS GDI32
  * PURPOSE:
index c144069..689aecb 100644 (file)
@@ -1,10 +1,9 @@
-/* $Id: stubs.c 28709 2007-08-31 15:09:51Z greatlrd $
- *
+/*
  * reactos/lib/gdi32/misc/historic.c
  *
  * GDI32.DLL Stubs
  *
- * Api that does basic nothing, but is here for backwords compatible with older windows
+ * Apis that do basically nothing, but are here for backwards compatibility with older Windows
  *
  */
 
index e13f84c..b8d3d8e 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: stubs.c 28533 2007-08-24 22:44:36Z greatlrd $
- *
+/*
  * reactos/lib/gdi32/misc/eng.c
  *
  * GDI32.DLL eng part
index db08f05..50ed87f 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: stubs.c 18897 2005-12-08 23:10:33Z cwittich $
- *
+/*
  * reactos/lib/gdi32/objects/path.c
  *
  * GDI32.DLL Path
index 9418600..28671e2 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: vbemp.rc 21844 2006-05-07 19:34:23Z ion $ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "DXG DirectX interface Device Driver\0"
index 5f88c53..1c3c816 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: vbemp.rc 21844 2006-05-07 19:34:23Z ion $ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "DirectX Graphics Driver Thunk\0"
index 82dead1..c0e5028 100644 (file)
@@ -1632,6 +1632,12 @@ NtUserSwitchDesktop(HDESK hdesk)
       RETURN(FALSE);
    }
 
+   if (PsGetCurrentProcessSessionId() != pdesk->rpwinstaParent->dwSessionId)
+   {
+      ERR("NtUserSwitchDesktop called for a desktop of a different session\n");
+      RETURN(FALSE);  
+   }
+
    if(pdesk == gpdeskInputDesktop)
    {
        WARN("NtUserSwitchDesktop called for active desktop\n");
index 768b29d..93e27b5 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS Win32k subsystem
  * PURPOSE:          Visibility computations interface definition
index ba3fb0e..bb68c9f 100644 (file)
@@ -2218,11 +2218,15 @@ co_WinPosShowWindow(PWND Wnd, INT Cmd)
 
    if ((Cmd == SW_HIDE) || (Cmd == SW_MINIMIZE))
    {
-      if ( ( Wnd->spwndParent == UserGetDesktopWindow() && !ActivateOtherWindowMin(Wnd) ) ||
-           // and Rule #1.
-           ( Wnd == pti->MessageQueue->spwndActive && pti->MessageQueue == IntGetFocusMessageQueue() ) )
+      if ( Wnd == pti->MessageQueue->spwndActive && pti->MessageQueue == IntGetFocusMessageQueue()  )
       {
-         co_WinPosActivateOtherWindow(Wnd);
+          if ( Wnd->spwndParent == UserGetDesktopWindow())
+          {
+              if(!ActivateOtherWindowMin(Wnd))
+                co_WinPosActivateOtherWindow(Wnd);
+          }
+          else
+              co_WinPosActivateOtherWindow(Wnd);
       }
 
       /* Revert focus to parent */
index 5974fbc..e1ce7e5 100644 (file)
@@ -432,6 +432,7 @@ NtUserCreateWindowStation(
    Status = RtlCreateAtomTable(37, &WindowStationObject->AtomTable);
    WindowStationObject->SystemMenuTemplate = (HANDLE)0;
    WindowStationObject->Name = WindowStationName;
+   WindowStationObject->dwSessionId = NtCurrentPeb()->SessionId;
 
    if (InputWindowStation == NULL)
    {
index 01d22d2..443ac96 100644 (file)
@@ -9,6 +9,8 @@
 
 typedef struct _WINSTATION_OBJECT
 {
+    DWORD dwSessionId;
+
     KSPIN_LOCK Lock;
     UNICODE_STRING Name;
     LIST_ENTRY DesktopListHead;
index 0527532..91a9892 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS User32
  * PURPOSE:          Built-in control registration
index 27ba3ed..da21a5e 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/misc/desktop.c
index a40eef2..d85e676 100644 (file)
@@ -16,8 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/misc/dde.c
  * PURPOSE:         DDE
index 42c64d5..a3303c1 100644 (file)
@@ -16,8 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/misc/dde.c
  * PURPOSE:         DDE
index b38732d..ad7768d 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/misc/winsta.c
index dde48b4..40db647 100644 (file)
@@ -16,8 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/windows/input.c
  * PURPOSE:         Accelerator tables
index 2befd87..6b3b16c 100644 (file)
@@ -16,8 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/windows/caret.c
  * PURPOSE:         Caret
index 01d4baf..fe321a8 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/windows/clipboard.c
  * PURPOSE:         Input
index 8815c9b..6ade68f 100644 (file)
@@ -16,8 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/windows/input.c
  * PURPOSE:         Input
index 468718c..a6f00eb 100644 (file)
@@ -16,8 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/windows/input.c
  * PURPOSE:         Input
index f52ef8a..451407c 100644 (file)
@@ -16,8 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/windows/input.c
  * PURPOSE:         Input
index b8c32f9..a6770b4 100644 (file)
@@ -16,8 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/windows/input.c
  * PURPOSE:         Input
index 847b3d3..c98ebe7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *Spanish Language resource file
+ * Spanish Language resource file
  * Traducido por: Javier Remacha 2008-26-01
  */
 
index 24c9c24..0c9d8c8 100644 (file)
@@ -34,6 +34,7 @@ typedef struct tagNOTIFY_CONTEXT
     WPARAM wParam;
     LPARAM lParam;
     HDESK Desktop;
+    HDESK OldDesktop;
     DWORD StartTime;
     DWORD QueryResult;
     HWND Dlg;
@@ -398,8 +399,13 @@ NotifyDesktopEnum(LPWSTR DesktopName, LPARAM lParam)
         return FALSE;
     }
 
+    Context->OldDesktop = GetThreadDesktop(GetCurrentThreadId());
+    SwitchDesktop(Context->Desktop);
+
     EnumDesktopWindows(Context->Desktop, NotifyTopLevelEnum, lParam);
 
+    SwitchDesktop(Context->OldDesktop);
+
     CloseDesktop(Context->Desktop);
 
     return QUERY_RESULT_CONTINUE == Context->QueryResult;
index 351f18a..476b8d2 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "W32 GDI KM subsystem\0"