From 17c0b5798e0a3780ca3f179ed96f6962eccfaecc Mon Sep 17 00:00:00 2001 From: Casper Hornstrup Date: Sun, 8 Sep 2002 10:23:54 +0000 Subject: [PATCH] Reverted latest changes. svn path=/trunk/; revision=3473 --- reactos/Makefile | 2 +- reactos/apps/tests/apc/apc.c | 4 +- reactos/apps/tests/atomtest/atomtest.c | 3 +- .../tests/dump_shared_data/dump_shared_data.c | 3 +- reactos/apps/tests/isotest/isotest.c | 3 +- reactos/apps/tests/lpc/lpcclt.c | 8 +- reactos/apps/tests/lpc/lpcsrv.c | 8 +- reactos/apps/tests/pteb/pteb.c | 1 - reactos/apps/tests/regtest/regtest.c | 3 +- reactos/apps/tests/sectest/sectest.c | 4 +- reactos/apps/tests/tokentest/tokentest.c | 11 +- reactos/apps/utils/objdir/objdir.c | 8 +- reactos/apps/utils/partinfo/partinfo.c | 2 - reactos/baseaddress.cfg | 43 +- reactos/drivers/bus/acpi/acpi.rc | 2 +- reactos/drivers/bus/acpi/include/acmacros.h | 6 +- reactos/drivers/bus/acpi/include/actypes.h | 8 +- .../drivers/bus/acpi/include/platform/types.h | 779 +- reactos/drivers/bus/acpi/makefile | 4 +- .../drivers/bus/acpi/ospm/include/acpisys.h | 5 +- reactos/drivers/bus/isapnp/isapnp.c | 10 +- reactos/drivers/bus/isapnp/isapnp.rc | 3 +- reactos/drivers/bus/pci/pci.rc | 3 +- reactos/drivers/dd/beep/beep.c | 5 +- reactos/drivers/dd/beep/beep.rc | 3 +- reactos/drivers/dd/blue/blue.c | 7 +- reactos/drivers/dd/blue/blue.rc | 3 +- reactos/drivers/dd/floppy/floppy.c | 7 +- reactos/drivers/dd/floppy/floppy.rc | 3 +- reactos/drivers/dd/ide/ide.c | 3 +- reactos/drivers/dd/ide/ide.rc | 3 +- reactos/drivers/dd/null/null.c | 6 +- reactos/drivers/dd/null/null.rc | 3 +- reactos/drivers/dd/parallel/parallel.rc | 4 +- reactos/drivers/dd/ramdrv/makefile | 8 +- reactos/drivers/dd/ramdrv/ramdrv.c | 2 +- reactos/drivers/dd/serial/serial.rc | 3 +- reactos/drivers/dd/vga/display/main/enable.c | 9 +- .../drivers/dd/vga/display/objects/bitblt.c | 4 +- .../drivers/dd/vga/display/objects/pointer.c | 14 +- .../drivers/dd/vga/display/objects/transblt.c | 14 +- reactos/drivers/dd/vga/display/vgaddi.h | 2 +- reactos/drivers/dd/vga/display/vgaddi.rc | 4 +- .../dd/vga/display/vgavideo/vgavideo.c | 2 +- .../dd/vga/display/vgavideo/vgavideo.h | 3 +- reactos/drivers/dd/vga/miniport/initvga.c | 12 +- reactos/drivers/dd/vga/miniport/vgamp.c | 6 +- reactos/drivers/dd/vga/miniport/vgamp.rc | 4 +- reactos/drivers/dd/vga/miniport/vgavideo.h | 7 +- reactos/drivers/dd/vidport/vidport.c | 10 +- reactos/drivers/dd/vidport/vidport.rc | 3 +- reactos/drivers/fs/cdfs/cdfs.h | 8 +- reactos/drivers/fs/cdfs/cdfs.rc | 3 +- reactos/drivers/fs/cdfs/create.c | 4 +- reactos/drivers/fs/cdfs/dirctl.c | 6 +- reactos/drivers/fs/cdfs/fcb.c | 13 +- reactos/drivers/fs/cdfs/fsctl.c | 8 +- reactos/drivers/fs/cdfs/misc.c | 6 +- reactos/drivers/fs/ext2/ext2fs.rc | 3 +- reactos/drivers/fs/fs_rec/cdfs.c | 7 +- reactos/drivers/fs/fs_rec/fat.c | 6 +- reactos/drivers/fs/fs_rec/fs_rec.c | 7 +- reactos/drivers/fs/fs_rec/fs_rec.rc | 3 +- reactos/drivers/fs/fs_rec/ntfs.c | 4 +- reactos/drivers/fs/minix/minix.rc | 3 +- reactos/drivers/fs/ms/create.c | 3 +- reactos/drivers/fs/ms/finfo.c | 15 +- reactos/drivers/fs/ms/fsctrl.c | 11 +- reactos/drivers/fs/ms/msfs.c | 3 +- reactos/drivers/fs/ms/msfs.h | 3 - reactos/drivers/fs/ms/msfs.rc | 3 +- reactos/drivers/fs/ms/rw.c | 4 +- reactos/drivers/fs/mup/mup.rc | 3 +- reactos/drivers/fs/np/create.c | 4 +- reactos/drivers/fs/np/finfo.c | 3 +- reactos/drivers/fs/np/fsctrl.c | 9 +- reactos/drivers/fs/np/npfs.c | 3 +- reactos/drivers/fs/np/npfs.h | 4 +- reactos/drivers/fs/np/npfs.rc | 3 +- reactos/drivers/fs/np/rw.c | 3 +- reactos/drivers/fs/np/volume.c | 3 +- reactos/drivers/fs/ntfs/dirctl.c | 6 +- reactos/drivers/fs/ntfs/fcb.c | 12 +- reactos/drivers/fs/ntfs/fsctl.c | 4 +- reactos/drivers/fs/ntfs/ntfs.h | 10 +- reactos/drivers/fs/ntfs/ntfs.rc | 3 +- reactos/drivers/fs/vfat/create.c | 14 +- reactos/drivers/fs/vfat/dir.c | 16 +- reactos/drivers/fs/vfat/direntry.c | 6 +- reactos/drivers/fs/vfat/dirwr.c | 14 +- reactos/drivers/fs/vfat/fat.c | 22 +- reactos/drivers/fs/vfat/fcb.c | 14 +- reactos/drivers/fs/vfat/finfo.c | 4 +- reactos/drivers/fs/vfat/fsctl.c | 21 +- reactos/drivers/fs/vfat/rw.c | 10 +- reactos/drivers/fs/vfat/vfat.h | 11 +- reactos/drivers/fs/vfat/vfatfs.rc | 3 +- reactos/drivers/fs/vfat/volume.c | 8 +- reactos/drivers/input/keyboard/keyboard.c | 8 +- reactos/drivers/input/keyboard/keyboard.h | 1 - reactos/drivers/input/keyboard/keyboard.rc | 3 +- reactos/drivers/input/mouclass/mouclass.c | 11 +- reactos/drivers/input/mouclass/mouclass.rc | 3 +- reactos/drivers/input/psaux/psaux.c | 8 +- reactos/drivers/input/psaux/psaux.rc | 3 +- reactos/drivers/lib/bzip2/bzlib.c | 2 +- reactos/drivers/net/afd/afd.rc | 2 +- reactos/drivers/net/afd/include/afd.h | 22 +- reactos/drivers/net/afd/include/debug.h | 1 - reactos/drivers/net/dd/ne2000/include/debug.h | 3 - .../drivers/net/dd/ne2000/include/ne2000.h | 11 +- reactos/drivers/net/dd/ne2000/ne2000.rc | 2 +- reactos/drivers/net/ndis/Makefile | 4 +- reactos/drivers/net/ndis/include/debug.h | 8 +- reactos/drivers/net/ndis/include/miniport.h | 1 - reactos/drivers/net/ndis/include/ndissys.h | 31 +- reactos/drivers/net/ndis/include/protocol.h | 2 +- reactos/drivers/net/ndis/ndis.rc | 2 +- reactos/drivers/net/ndis/ndis/40gone.c | 133 +- reactos/drivers/net/ndis/ndis/50gone.c | 46 +- reactos/drivers/net/ndis/ndis/buffer.c | 79 +- reactos/drivers/net/ndis/ndis/cl.c | 21 +- reactos/drivers/net/ndis/ndis/cm.c | 46 +- reactos/drivers/net/ndis/ndis/co.c | 24 +- reactos/drivers/net/ndis/ndis/control.c | 34 +- reactos/drivers/net/ndis/ndis/hardware.c | 18 +- reactos/drivers/net/ndis/ndis/io.c | 44 +- reactos/drivers/net/ndis/ndis/main.c | 11 +- reactos/drivers/net/ndis/ndis/memory.c | 40 +- reactos/drivers/net/ndis/ndis/miniport.c | 98 +- reactos/drivers/net/ndis/ndis/protocol.c | 38 +- reactos/drivers/net/ndis/ndis/string.c | 20 +- reactos/drivers/net/ndis/ndis/stubs.c | 144 +- reactos/drivers/net/ndis/ndis/time.c | 17 +- reactos/drivers/net/tcpip/datalink/lan.c | 6 +- reactos/drivers/net/tcpip/include/debug.h | 3 - reactos/drivers/net/tcpip/include/ip.h | 2 +- reactos/drivers/net/tcpip/include/tcpip.h | 6 +- reactos/drivers/net/tcpip/tcpip.rc | 2 +- reactos/drivers/net/tcpip/tcpip/main.c | 8 +- reactos/drivers/net/tdi/cte/string.c | 4 +- reactos/drivers/net/tdi/cte/stubs.c | 4 +- reactos/drivers/net/tdi/misc/main.c | 4 +- reactos/drivers/net/tdi/misc/tdi.rc | 4 +- reactos/drivers/net/tdi/tdi/dereg.c | 6 +- reactos/drivers/net/tdi/tdi/handler.c | 6 +- reactos/drivers/net/tdi/tdi/obsolete.c | 5 +- reactos/drivers/net/tdi/tdi/stubs.c | 6 +- reactos/drivers/net/tditest/include/debug.h | 3 - reactos/drivers/net/tditest/include/tditest.h | 4 +- reactos/drivers/net/tditest/tditest.rc | 2 +- reactos/drivers/net/wshtcpip/debug.h | 3 - reactos/drivers/net/wshtcpip/makefile | 4 +- reactos/drivers/net/wshtcpip/wshtcpip.c | 8 +- reactos/drivers/net/wshtcpip/wshtcpip.rc | 2 +- reactos/drivers/storage/atapi/atapi.rc | 3 +- reactos/drivers/storage/cdrom/cdrom.c | 12 +- reactos/drivers/storage/cdrom/cdrom.rc | 3 +- reactos/drivers/storage/class2/class2.c | 15 +- reactos/drivers/storage/class2/class2.rc | 3 +- reactos/drivers/storage/disk/disk.c | 10 +- reactos/drivers/storage/disk/disk.rc | 3 +- reactos/drivers/storage/include/class2.h | 10 +- reactos/drivers/storage/include/ntddscsi.h | 4 +- reactos/drivers/storage/include/scsi.h | 16 +- reactos/drivers/storage/include/srb.h | 4 +- reactos/drivers/storage/scsiport/scsiport.c | 13 +- reactos/drivers/storage/scsiport/scsiport.rc | 3 +- reactos/hal/hal/Makefile | 4 +- reactos/hal/hal/hal.c | 21 +- reactos/hal/hal/hal.rc | 2 +- reactos/hal/halx86/Makefile | 8 +- reactos/hal/halx86/adapter.c | 11 +- reactos/hal/halx86/beep.c | 2 +- reactos/hal/halx86/bios32.c | 7 +- reactos/hal/halx86/bus.c | 7 +- reactos/hal/halx86/display.c | 9 +- reactos/hal/halx86/dma.c | 19 +- reactos/hal/halx86/drive.c | 8 +- reactos/hal/halx86/enum.c | 6 +- reactos/hal/halx86/fmutex.c | 6 +- reactos/hal/halx86/halinit.c | 9 +- reactos/hal/halx86/halx86mp.rc | 2 +- reactos/hal/halx86/halx86up.rc | 2 +- reactos/hal/halx86/include/hal.h | 23 +- reactos/hal/halx86/irql.c | 8 +- reactos/hal/halx86/isa.c | 8 +- reactos/hal/halx86/kdbg.c | 6 +- reactos/hal/halx86/mbr.c | 6 +- reactos/hal/halx86/misc.c | 7 +- reactos/hal/halx86/mp.c | 14 +- reactos/hal/halx86/mpsirql.c | 6 +- reactos/hal/halx86/pci.c | 5 +- reactos/hal/halx86/perfcnt.c | 8 +- reactos/hal/halx86/portio.c | 7 +- reactos/hal/halx86/pwroff.c | 8 +- reactos/hal/halx86/reboot.c | 7 +- reactos/hal/halx86/spinlock.c | 6 +- reactos/hal/halx86/sysbus.c | 8 +- reactos/hal/halx86/sysinfo.c | 4 +- reactos/hal/halx86/time.c | 6 +- reactos/hal/halx86/udelay.c | 5 +- reactos/iface/native/sysfuncs.lst | 6 +- reactos/include/ascii.h | 2997 +++++++ reactos/include/base.h | 493 ++ reactos/include/crtdll/mbstring.h | 4 +- reactos/include/csrss/csrss.h | 14 +- reactos/include/debug.h | 3 - reactos/include/defines.h | 4724 ++++++++++ reactos/include/devices.h | 16 + reactos/include/errors.h | 1163 +++ reactos/include/excpt.h | 121 + reactos/include/funcs.h | 7590 +++++++++++++++++ reactos/include/in.h | 491 ++ reactos/include/kernel32/error.h | 4 +- reactos/include/kernel32/heap.h | 3 +- reactos/include/kernel32/kernel32.h | 2 +- reactos/include/lsass/lsass.h | 10 +- reactos/include/messages.h | 1099 +++ reactos/include/msvcrt/alloc.h | 85 + reactos/include/msvcrt/assert.h | 69 + reactos/include/msvcrt/conio.h | 67 + reactos/include/msvcrt/ctype.h | 139 + reactos/include/msvcrt/dir.h | 148 + reactos/include/msvcrt/direct.h | 46 + reactos/include/msvcrt/errno.h | 120 + reactos/include/msvcrt/fcntl.h | 127 + reactos/include/msvcrt/float.h | 199 + reactos/include/msvcrt/io.h | 155 + reactos/include/msvcrt/locale.h | 84 + reactos/include/msvcrt/malloc.h | 53 + reactos/include/msvcrt/math.h | 161 + reactos/include/msvcrt/mbctype.h | 49 + reactos/include/msvcrt/mbstring.h | 108 + .../include => include/msvcrt}/msvcrtdbg.h | 86 +- reactos/include/msvcrt/process.h | 160 + reactos/include/msvcrt/search.h | 35 + reactos/include/msvcrt/share.h | 17 + reactos/include/msvcrt/signal.h | 111 + reactos/include/msvcrt/stdarg.h | 114 + reactos/include/msvcrt/stddef.h | 174 + reactos/include/msvcrt/stdio.h | 375 + reactos/include/msvcrt/stdlib.h | 232 + reactos/include/msvcrt/string.h | 194 + reactos/include/msvcrt/time.h | 126 + reactos/include/msvcrt/wchar.h | 32 + reactos/include/ntddk.h | 5 + reactos/include/ntdll/base.h | 2 +- reactos/include/ntdll/rtl.h | 119 +- reactos/include/ntos.h | 71 +- reactos/include/ntos/console.h | 24 + reactos/include/ntos/core.h | 35 - reactos/include/ntos/dbg.h | 61 - reactos/include/ntos/ddk.h | 27 - reactos/include/ntos/disk.h | 112 +- reactos/include/ntos/except.h | 131 +- reactos/include/ntos/fs.h | 129 - reactos/include/ntos/gdi.h | 18 - reactos/include/ntos/hal.h | 616 -- reactos/include/ntos/i386/segment.h | 353 - reactos/include/ntos/keyboard.h | 51 +- reactos/include/ntos/lpc.h | 148 - reactos/include/ntos/mm.h | 73 +- reactos/include/ntos/npipe.h | 197 - reactos/include/ntos/ntddblue.h | 64 - reactos/include/ntos/ntddvid.h | 480 -- reactos/include/ntos/ps.h | 359 +- reactos/include/ntos/rtl.h | 1856 ---- reactos/include/ntos/security.h | 342 +- reactos/include/ntos/shared_data.h | 71 - reactos/include/ntos/teb.h | 236 - reactos/include/ntos/types.h | 1369 +-- reactos/include/ntos/w32api.h | 27 - reactos/include/ntos/win32.h | 75 - reactos/include/ntos/zw.h | 4727 ---------- reactos/include/ntos/zwtypes.h | 597 -- reactos/include/pe.h | 428 +- reactos/include/sockets.h | 965 +++ reactos/include/structs.h | 4460 ++++++++++ reactos/include/tchar.h | 231 + reactos/include/unicode.h | 3030 +++++++ reactos/include/win32k/brush.h | 6 +- reactos/include/win32k/color.h | 2 - reactos/include/win32k/coord.h | 12 +- reactos/include/win32k/dc.h | 2 +- reactos/include/win32k/debug1.h | 3 - reactos/include/win32k/driver.h | 87 +- reactos/include/win32k/ntuser.h | 2 - reactos/include/win32k/print.h | 2 +- reactos/include/win32k/text.h | 4 +- reactos/include/windows.h | 165 + reactos/include/winsock2.h | 1570 ++++ reactos/include/ws2spi.h | 566 ++ reactos/include/wsahelp.h | 349 + reactos/lib/advapi32/advapi32.rc | 2 +- reactos/lib/advapi32/include/advapi32.h | 11 - reactos/lib/advapi32/makefile | 6 +- reactos/lib/advapi32/misc/dllmain.c | 11 +- reactos/lib/advapi32/misc/shutdown.c | 10 +- reactos/lib/advapi32/misc/sysfunc.c | 5 +- reactos/lib/advapi32/reg/reg.c | 57 +- reactos/lib/advapi32/sec/ac.c | 6 +- reactos/lib/advapi32/sec/lsa.c | 6 +- reactos/lib/advapi32/sec/misc.c | 4 +- reactos/lib/advapi32/sec/sec.c | 4 +- reactos/lib/advapi32/sec/sid.c | 6 +- reactos/lib/advapi32/service/scm.c | 37 +- reactos/lib/advapi32/service/sctrl.c | 6 +- reactos/lib/advapi32/service/undoc.c | 5 +- reactos/lib/advapi32/token/privilege.c | 6 +- reactos/lib/advapi32/token/token.c | 4 +- reactos/lib/crtdll/crtdll.rc | 2 +- reactos/lib/crtdll/except/exhand2.c | 2 - reactos/lib/crtdll/makefile | 4 +- reactos/lib/crtdll/mbstring/mbstok.c | 2 +- reactos/lib/crtdll/stdio/vfprintf.c | 1 - reactos/lib/fmifs/fmifs.rc | 2 +- reactos/lib/gdi32/gdi32.rc | 2 +- reactos/lib/gdi32/main/dllmain.c | 5 +- reactos/lib/gdi32/makefile | 4 +- reactos/lib/gdi32/misc/stubs.c | 24 +- reactos/lib/gdi32/misc/stubsa.c | 8 +- reactos/lib/gdi32/misc/stubsw.c | 8 +- reactos/lib/gdi32/objects/bitblt.c | 2 +- reactos/lib/gdi32/objects/text.c | 36 +- reactos/lib/kernel32/except/except.c | 10 +- reactos/lib/kernel32/file/backup.c | 20 +- reactos/lib/kernel32/file/copy.c | 16 +- reactos/lib/kernel32/file/create.c | 8 +- reactos/lib/kernel32/file/curdir.c | 6 +- reactos/lib/kernel32/file/delete.c | 6 +- reactos/lib/kernel32/file/deviceio.c | 5 +- reactos/lib/kernel32/file/dir.c | 6 +- reactos/lib/kernel32/file/dosdev.c | 5 +- reactos/lib/kernel32/file/file.c | 5 +- reactos/lib/kernel32/file/find.c | 6 +- reactos/lib/kernel32/file/iocompl.c | 18 +- reactos/lib/kernel32/file/lock.c | 7 +- reactos/lib/kernel32/file/mailslot.c | 21 +- reactos/lib/kernel32/file/move.c | 12 +- reactos/lib/kernel32/file/npipe.c | 11 +- reactos/lib/kernel32/file/pipe.c | 5 +- reactos/lib/kernel32/file/rw.c | 5 +- reactos/lib/kernel32/file/tape.c | 5 +- reactos/lib/kernel32/file/volume.c | 6 +- reactos/lib/kernel32/include/kernel32.h | 10 - reactos/lib/kernel32/kernel32.edf | 6 +- reactos/lib/kernel32/kernel32.rc | 2 +- reactos/lib/kernel32/makefile | 10 +- reactos/lib/kernel32/mem/global.c | 8 +- reactos/lib/kernel32/mem/heap.c | 6 +- reactos/lib/kernel32/mem/isbad.c | 5 +- reactos/lib/kernel32/mem/local.c | 6 +- reactos/lib/kernel32/mem/procmem.c | 9 +- reactos/lib/kernel32/mem/section.c | 8 +- reactos/lib/kernel32/mem/virtual.c | 7 +- reactos/lib/kernel32/misc/atom.c | 9 +- reactos/lib/kernel32/misc/comm.c | 8 +- reactos/lib/kernel32/misc/console.c | 21 +- reactos/lib/kernel32/misc/debug.c | 8 +- reactos/lib/kernel32/misc/dllmain.c | 9 +- reactos/lib/kernel32/misc/env.c | 14 +- reactos/lib/kernel32/misc/error.c | 9 +- reactos/lib/kernel32/misc/handle.c | 7 +- reactos/lib/kernel32/misc/ldr.c | 6 +- reactos/lib/kernel32/misc/profile.c | 75 +- reactos/lib/kernel32/misc/res.c | 8 +- reactos/lib/kernel32/misc/stubs.c | 57 +- reactos/lib/kernel32/misc/sysinfo.c | 25 +- reactos/lib/kernel32/misc/time.c | 47 +- reactos/lib/kernel32/process/cmdline.c | 12 +- reactos/lib/kernel32/process/create.c | 46 +- reactos/lib/kernel32/process/proc.c | 19 +- reactos/lib/kernel32/process/session.c | 5 +- reactos/lib/kernel32/synch/critical.c | 9 +- reactos/lib/kernel32/synch/event.c | 5 +- reactos/lib/kernel32/synch/intrlck.c | 9 +- reactos/lib/kernel32/synch/mutex.c | 8 +- reactos/lib/kernel32/synch/sem.c | 5 +- reactos/lib/kernel32/synch/timer.c | 13 +- reactos/lib/kernel32/synch/wait.c | 7 +- reactos/lib/kernel32/thread/fiber.c | 8 +- reactos/lib/kernel32/thread/thread.c | 17 +- reactos/lib/kernel32/thread/tls.c | 6 +- reactos/lib/msafd/include/debug.h | 2 +- reactos/lib/msafd/include/msafd.h | 9 +- reactos/lib/msafd/makefile | 4 +- reactos/lib/msafd/msafd.rc | 2 +- reactos/lib/msvcrt/Makefile | 845 +- reactos/lib/msvcrt/conio.c | 9 - reactos/lib/msvcrt/conio/cgets.c | 3 +- reactos/lib/msvcrt/conio/cprintf.c | 4 +- reactos/lib/msvcrt/conio/cputs.c | 7 +- reactos/lib/msvcrt/conio/cscanf.c | 5 +- reactos/lib/msvcrt/conio/getch.c | 6 +- reactos/lib/msvcrt/conio/getche.c | 10 +- reactos/lib/msvcrt/conio/kbhit.c | 5 +- reactos/lib/msvcrt/conio/putch.c | 3 +- reactos/lib/msvcrt/conio/ungetch.c | 5 +- reactos/lib/msvcrt/ctype.c | 17 - reactos/lib/msvcrt/ctype/isalnum.c | 2 +- reactos/lib/msvcrt/ctype/isalpha.c | 2 +- reactos/lib/msvcrt/ctype/isascii.c | 2 +- reactos/lib/msvcrt/ctype/iscntrl.c | 3 +- reactos/lib/msvcrt/ctype/iscsym.c | 2 +- reactos/lib/msvcrt/ctype/isctype.c | 10 +- reactos/lib/msvcrt/ctype/isdigit.c | 3 +- reactos/lib/msvcrt/ctype/isgraph.c | 3 +- reactos/lib/msvcrt/ctype/islower.c | 3 +- reactos/lib/msvcrt/ctype/isprint.c | 3 +- reactos/lib/msvcrt/ctype/ispunct.c | 3 +- reactos/lib/msvcrt/ctype/isspace.c | 3 +- reactos/lib/msvcrt/ctype/isupper.c | 3 +- reactos/lib/msvcrt/ctype/isxdigit.c | 3 +- reactos/lib/msvcrt/ctype/toascii.c | 3 +- reactos/lib/msvcrt/ctype/tolower.c | 3 +- reactos/lib/msvcrt/ctype/toupper.c | 2 +- reactos/lib/msvcrt/direct.c | 8 - reactos/lib/msvcrt/direct/chdir.c | 4 +- reactos/lib/msvcrt/direct/chdrive.c | 6 +- reactos/lib/msvcrt/direct/getcwd.c | 4 +- reactos/lib/msvcrt/direct/getdcwd.c | 4 +- reactos/lib/msvcrt/direct/getdfree.c | 4 +- reactos/lib/msvcrt/direct/getdrive.c | 4 +- reactos/lib/msvcrt/direct/mkdir.c | 3 +- reactos/lib/msvcrt/direct/rmdir.c | 4 +- reactos/lib/msvcrt/except.c | 6 - reactos/lib/msvcrt/except/abnorter.c | 3 +- reactos/lib/msvcrt/except/exhand2.c | 3 +- reactos/lib/msvcrt/except/exhand3.c | 3 +- reactos/lib/msvcrt/except/matherr.c | 4 - reactos/lib/msvcrt/except/unwind.c | 4 +- reactos/lib/msvcrt/except/xcptfil.c | 2 +- reactos/lib/msvcrt/float.c | 12 - reactos/lib/msvcrt/float/chgsign.c | 4 +- reactos/lib/msvcrt/float/clearfp.c | 3 +- reactos/lib/msvcrt/float/cntrlfp.c | 3 +- reactos/lib/msvcrt/float/copysign.c | 4 +- reactos/lib/msvcrt/float/fpclass.c | 5 +- reactos/lib/msvcrt/float/fpecode.c | 4 +- reactos/lib/msvcrt/float/fpreset.c | 3 +- reactos/lib/msvcrt/float/isnan.c | 8 +- reactos/lib/msvcrt/float/logb.c | 5 +- reactos/lib/msvcrt/float/nafter.c | 5 +- reactos/lib/msvcrt/float/scalb.c | 4 +- reactos/lib/msvcrt/float/statfp.c | 3 +- reactos/lib/msvcrt/include/msvcrti.h | 290 - reactos/lib/msvcrt/io.c | 26 - reactos/lib/msvcrt/io/access.c | 8 +- reactos/lib/msvcrt/io/chmod.c | 6 +- reactos/lib/msvcrt/io/chsize.c | 7 +- reactos/lib/msvcrt/io/close.c | 9 +- reactos/lib/msvcrt/io/commit.c | 10 +- reactos/lib/msvcrt/io/create.c | 6 +- reactos/lib/msvcrt/io/dup.c | 8 +- reactos/lib/msvcrt/io/dup2.c | 4 +- reactos/lib/msvcrt/io/eof.c | 4 +- reactos/lib/msvcrt/io/filelen.c | 8 +- reactos/lib/msvcrt/io/find.c | 17 +- reactos/lib/msvcrt/io/fmode.c | 4 +- reactos/lib/msvcrt/io/isatty.c | 8 +- reactos/lib/msvcrt/io/locking.c | 6 +- reactos/lib/msvcrt/io/lseek.c | 4 +- reactos/lib/msvcrt/io/mktemp.c | 6 +- reactos/lib/msvcrt/io/open.c | 25 +- reactos/lib/msvcrt/io/pipe.c | 7 +- reactos/lib/msvcrt/io/read.c | 13 +- reactos/lib/msvcrt/io/setmode.c | 9 +- reactos/lib/msvcrt/io/sopen.c | 42 +- reactos/lib/msvcrt/io/tell.c | 3 +- reactos/lib/msvcrt/io/umask.c | 7 +- reactos/lib/msvcrt/io/unlink.c | 5 +- reactos/lib/msvcrt/io/utime.c | 7 +- reactos/lib/msvcrt/io/write.c | 15 +- reactos/lib/msvcrt/locale/locale.c | 5 +- reactos/lib/msvcrt/math.c | 31 - reactos/lib/msvcrt/math/acos.c | 5 +- reactos/lib/msvcrt/math/asin.c | 5 +- reactos/lib/msvcrt/math/atan.c | 5 +- reactos/lib/msvcrt/math/atan2.c | 2 +- reactos/lib/msvcrt/math/cabs.c | 3 +- reactos/lib/msvcrt/math/ceil.c | 3 +- reactos/lib/msvcrt/math/cos.c | 3 +- reactos/lib/msvcrt/math/cosh.c | 3 +- reactos/lib/msvcrt/math/exp.c | 2 +- reactos/lib/msvcrt/math/fabs.c | 5 +- reactos/lib/msvcrt/math/floor.c | 5 +- reactos/lib/msvcrt/math/fmod.c | 5 +- reactos/lib/msvcrt/math/frexp.c | 5 +- reactos/lib/msvcrt/math/ftol.c | 3 +- reactos/lib/msvcrt/math/huge_val.c | 5 +- reactos/lib/msvcrt/math/hypot.c | 6 +- reactos/lib/msvcrt/math/j0_y0.c | 3 +- reactos/lib/msvcrt/math/j1_y1.c | 3 +- reactos/lib/msvcrt/math/jn_yn.c | 3 +- reactos/lib/msvcrt/math/ldexp.c | 5 +- reactos/lib/msvcrt/math/log.c | 5 +- reactos/lib/msvcrt/math/log10.c | 5 +- reactos/lib/msvcrt/math/modf.c | 6 +- reactos/lib/msvcrt/math/pow.c | 5 +- reactos/lib/msvcrt/math/sin.c | 5 +- reactos/lib/msvcrt/math/sinh.c | 3 +- reactos/lib/msvcrt/math/sqrt.c | 6 +- reactos/lib/msvcrt/math/stubs.c | 3 +- reactos/lib/msvcrt/math/tan.c | 5 +- reactos/lib/msvcrt/math/tanh.c | 2 +- reactos/lib/msvcrt/mbstring.c | 54 - reactos/lib/msvcrt/mbstring/hanzen.c | 6 +- reactos/lib/msvcrt/mbstring/ischira.c | 3 +- reactos/lib/msvcrt/mbstring/iskana.c | 8 +- reactos/lib/msvcrt/mbstring/iskmoji.c | 3 +- reactos/lib/msvcrt/mbstring/iskpun.c | 3 +- reactos/lib/msvcrt/mbstring/islead.c | 7 +- reactos/lib/msvcrt/mbstring/islwr.c | 3 +- reactos/lib/msvcrt/mbstring/ismbal.c | 6 +- reactos/lib/msvcrt/mbstring/ismbaln.c | 5 +- reactos/lib/msvcrt/mbstring/ismbc.c | 4 +- reactos/lib/msvcrt/mbstring/ismbgra.c | 7 +- reactos/lib/msvcrt/mbstring/ismbkaln.c | 4 +- reactos/lib/msvcrt/mbstring/ismblead.c | 7 +- reactos/lib/msvcrt/mbstring/ismbpri.c | 7 +- reactos/lib/msvcrt/mbstring/ismbpun.c | 7 +- reactos/lib/msvcrt/mbstring/ismbtrl.c | 3 +- reactos/lib/msvcrt/mbstring/isuppr.c | 3 +- reactos/lib/msvcrt/mbstring/jistojms.c | 5 +- reactos/lib/msvcrt/mbstring/jmstojis.c | 4 +- reactos/lib/msvcrt/mbstring/mbbtype.c | 5 +- reactos/lib/msvcrt/mbstring/mbccpy.c | 4 +- reactos/lib/msvcrt/mbstring/mbclen.c | 4 +- reactos/lib/msvcrt/mbstring/mbscat.c | 3 +- reactos/lib/msvcrt/mbstring/mbschr.c | 3 +- reactos/lib/msvcrt/mbstring/mbscmp.c | 4 +- reactos/lib/msvcrt/mbstring/mbscoll.c | 2 +- reactos/lib/msvcrt/mbstring/mbscpy.c | 4 +- reactos/lib/msvcrt/mbstring/mbscspn.c | 3 +- reactos/lib/msvcrt/mbstring/mbsdec.c | 5 +- reactos/lib/msvcrt/mbstring/mbsdup.c | 4 +- reactos/lib/msvcrt/mbstring/mbsicmp.c | 5 +- reactos/lib/msvcrt/mbstring/mbsicoll.c | 5 +- reactos/lib/msvcrt/mbstring/mbsinc.c | 3 +- reactos/lib/msvcrt/mbstring/mbslen.c | 3 +- reactos/lib/msvcrt/mbstring/mbslwr.c | 4 +- reactos/lib/msvcrt/mbstring/mbsncat.c | 3 +- reactos/lib/msvcrt/mbstring/mbsnccnt.c | 3 +- reactos/lib/msvcrt/mbstring/mbsncmp.c | 2 +- reactos/lib/msvcrt/mbstring/mbsncoll.c | 3 +- reactos/lib/msvcrt/mbstring/mbsncpy.c | 2 +- reactos/lib/msvcrt/mbstring/mbsnextc.c | 5 +- reactos/lib/msvcrt/mbstring/mbsnicmp.c | 3 +- reactos/lib/msvcrt/mbstring/mbsnicoll.c | 3 +- reactos/lib/msvcrt/mbstring/mbsninc.c | 3 +- reactos/lib/msvcrt/mbstring/mbsnset.c | 3 +- reactos/lib/msvcrt/mbstring/mbspbrk.c | 3 +- reactos/lib/msvcrt/mbstring/mbsrchr.c | 2 +- reactos/lib/msvcrt/mbstring/mbsrev.c | 3 +- reactos/lib/msvcrt/mbstring/mbsset.c | 2 +- reactos/lib/msvcrt/mbstring/mbsspn.c | 3 +- reactos/lib/msvcrt/mbstring/mbsspnp.c | 3 +- reactos/lib/msvcrt/mbstring/mbsstr.c | 4 +- reactos/lib/msvcrt/mbstring/mbstok.c | 15 +- reactos/lib/msvcrt/mbstring/mbstrlen.c | 4 +- reactos/lib/msvcrt/mbstring/mbsupr.c | 4 +- reactos/lib/msvcrt/misc.c | 8 - reactos/lib/msvcrt/misc/amsg.c | 3 +- reactos/lib/msvcrt/misc/assert.c | 6 +- reactos/lib/msvcrt/misc/dllmain.c | 16 +- reactos/lib/msvcrt/misc/getargs.c | 9 +- reactos/lib/msvcrt/misc/initterm.c | 5 +- reactos/lib/msvcrt/misc/purecall.c | 2 +- reactos/lib/msvcrt/misc/tls.c | 6 +- reactos/lib/msvcrt/msvcrt.rc | 2 +- reactos/lib/msvcrt/process.c | 22 - reactos/lib/msvcrt/process/_cwait.c | 6 +- reactos/lib/msvcrt/process/_system.c | 11 +- reactos/lib/msvcrt/process/dll.c | 3 +- reactos/lib/msvcrt/process/execl.c | 4 +- reactos/lib/msvcrt/process/execle.c | 4 +- reactos/lib/msvcrt/process/execlp.c | 5 +- reactos/lib/msvcrt/process/execlpe.c | 8 +- reactos/lib/msvcrt/process/execv.c | 3 +- reactos/lib/msvcrt/process/execve.c | 5 +- reactos/lib/msvcrt/process/execvp.c | 5 +- reactos/lib/msvcrt/process/execvpe.c | 3 +- reactos/lib/msvcrt/process/procid.c | 4 +- reactos/lib/msvcrt/process/spawnl.c | 4 +- reactos/lib/msvcrt/process/spawnle.c | 4 +- reactos/lib/msvcrt/process/spawnlp.c | 4 +- reactos/lib/msvcrt/process/spawnlpe.c | 4 +- reactos/lib/msvcrt/process/spawnv.c | 3 +- reactos/lib/msvcrt/process/spawnve.c | 87 +- reactos/lib/msvcrt/process/spawnvp.c | 5 +- reactos/lib/msvcrt/process/spawnvpe.c | 4 +- reactos/lib/msvcrt/process/thread.c | 7 +- reactos/lib/msvcrt/process/threadid.c | 4 +- reactos/lib/msvcrt/search/lfind.c | 3 +- reactos/lib/msvcrt/search/lsearch.c | 5 +- reactos/lib/msvcrt/setjmp/setjmp.c | 3 - reactos/lib/msvcrt/signal/signal.c | 23 +- reactos/lib/msvcrt/stdio.c | 57 - reactos/lib/msvcrt/stdio/allocfil.c | 5 +- reactos/lib/msvcrt/stdio/clearerr.c | 5 +- reactos/lib/msvcrt/stdio/fclose.c | 18 +- reactos/lib/msvcrt/stdio/fdopen.c | 6 +- reactos/lib/msvcrt/stdio/feof.c | 5 +- reactos/lib/msvcrt/stdio/ferror.c | 4 +- reactos/lib/msvcrt/stdio/fflush.c | 13 +- reactos/lib/msvcrt/stdio/fgetc.c | 4 +- reactos/lib/msvcrt/stdio/fgetchar.c | 6 +- reactos/lib/msvcrt/stdio/fgetpos.c | 4 +- reactos/lib/msvcrt/stdio/fgets.c | 4 +- reactos/lib/msvcrt/stdio/filbuf.c | 13 +- reactos/lib/msvcrt/stdio/fileno.c | 3 +- reactos/lib/msvcrt/stdio/flsbuf.c | 16 +- reactos/lib/msvcrt/stdio/fopen.c | 10 +- reactos/lib/msvcrt/stdio/fprintf.c | 5 +- reactos/lib/msvcrt/stdio/fputc.c | 5 +- reactos/lib/msvcrt/stdio/fputchar.c | 5 +- reactos/lib/msvcrt/stdio/fputs.c | 6 +- reactos/lib/msvcrt/stdio/fread.c | 8 +- reactos/lib/msvcrt/stdio/freopen.c | 11 +- reactos/lib/msvcrt/stdio/fscanf.c | 11 +- reactos/lib/msvcrt/stdio/fseek.c | 11 +- reactos/lib/msvcrt/stdio/fsetpos.c | 5 +- reactos/lib/msvcrt/stdio/fsopen.c | 12 +- reactos/lib/msvcrt/stdio/ftell.c | 10 +- reactos/lib/msvcrt/stdio/fwalk.c | 5 +- reactos/lib/msvcrt/stdio/fwrite.c | 11 +- reactos/lib/msvcrt/stdio/getc.c | 7 +- reactos/lib/msvcrt/stdio/getchar.c | 4 +- reactos/lib/msvcrt/stdio/gets.c | 3 +- reactos/lib/msvcrt/stdio/getw.c | 5 +- reactos/lib/msvcrt/stdio/perror.c | 4 +- reactos/lib/msvcrt/stdio/popen.c | 21 +- reactos/lib/msvcrt/stdio/printf.c | 7 +- reactos/lib/msvcrt/stdio/putc.c | 7 +- reactos/lib/msvcrt/stdio/putchar.c | 3 +- reactos/lib/msvcrt/stdio/puts.c | 6 +- reactos/lib/msvcrt/stdio/putw.c | 7 +- reactos/lib/msvcrt/stdio/remove.c | 7 +- reactos/lib/msvcrt/stdio/rename.c | 4 +- reactos/lib/msvcrt/stdio/rewind.c | 7 +- reactos/lib/msvcrt/stdio/rmtmp.c | 10 +- reactos/lib/msvcrt/stdio/scanf.c | 10 +- reactos/lib/msvcrt/stdio/setbuf.c | 5 +- reactos/lib/msvcrt/stdio/setvbuf.c | 6 +- reactos/lib/msvcrt/stdio/sprintf.c | 9 +- reactos/lib/msvcrt/stdio/sscanf.c | 10 +- reactos/lib/msvcrt/stdio/stdhnd.c | 4 +- reactos/lib/msvcrt/stdio/tempnam.c | 4 +- reactos/lib/msvcrt/stdio/tmpfile.c | 17 +- reactos/lib/msvcrt/stdio/tmpnam.c | 4 +- reactos/lib/msvcrt/stdio/ungetc.c | 6 +- reactos/lib/msvcrt/stdio/vfprintf.c | 19 +- reactos/lib/msvcrt/stdio/vfscanf.c | 15 +- reactos/lib/msvcrt/stdio/vfwprint.c | 16 +- reactos/lib/msvcrt/stdio/vprintf.c | 6 +- reactos/lib/msvcrt/stdio/vscanf.c | 6 +- reactos/lib/msvcrt/stdio/vsprintf.c | 6 +- reactos/lib/msvcrt/stdio/vsscanf.c | 7 +- reactos/lib/msvcrt/stdlib.c | 40 - reactos/lib/msvcrt/stdlib/_exit.c | 7 +- reactos/lib/msvcrt/stdlib/abort.c | 8 +- reactos/lib/msvcrt/stdlib/abs.c | 3 +- reactos/lib/msvcrt/stdlib/atexit.c | 4 +- reactos/lib/msvcrt/stdlib/atof.c | 3 +- reactos/lib/msvcrt/stdlib/atoi.c | 3 +- reactos/lib/msvcrt/stdlib/atoi64.c | 3 +- reactos/lib/msvcrt/stdlib/atol.c | 3 +- reactos/lib/msvcrt/stdlib/atold.c | 3 +- reactos/lib/msvcrt/stdlib/bsearch.c | 3 +- reactos/lib/msvcrt/stdlib/div.c | 3 +- reactos/lib/msvcrt/stdlib/ecvt.c | 4 +- reactos/lib/msvcrt/stdlib/ecvtbuf.c | 12 +- reactos/lib/msvcrt/stdlib/errno.c | 8 +- reactos/lib/msvcrt/stdlib/fcvt.c | 4 +- reactos/lib/msvcrt/stdlib/fcvtbuf.c | 12 +- reactos/lib/msvcrt/stdlib/fullpath.c | 4 +- reactos/lib/msvcrt/stdlib/gcvt.c | 5 +- reactos/lib/msvcrt/stdlib/getenv.c | 5 +- reactos/lib/msvcrt/stdlib/itoa.c | 4 +- reactos/lib/msvcrt/stdlib/itow.c | 4 +- reactos/lib/msvcrt/stdlib/labs.c | 3 +- reactos/lib/msvcrt/stdlib/ldiv.c | 3 +- reactos/lib/msvcrt/stdlib/makepath.c | 6 +- reactos/lib/msvcrt/stdlib/malloc.c | 4 +- reactos/lib/msvcrt/stdlib/mbstow.c | 2 +- reactos/lib/msvcrt/stdlib/mbstowcs.c | 3 +- reactos/lib/msvcrt/stdlib/obsol.c | 4 +- reactos/lib/msvcrt/stdlib/putenv.c | 8 +- reactos/lib/msvcrt/stdlib/qsort.c | 7 +- reactos/lib/msvcrt/stdlib/rand.c | 4 +- reactos/lib/msvcrt/stdlib/rot.c | 4 +- reactos/lib/msvcrt/stdlib/senv.c | 7 +- reactos/lib/msvcrt/stdlib/splitp.c | 4 +- reactos/lib/msvcrt/stdlib/strtod.c | 3 +- reactos/lib/msvcrt/stdlib/strtol.c | 5 +- reactos/lib/msvcrt/stdlib/strtold.c | 5 +- reactos/lib/msvcrt/stdlib/strtoll.c | 7 +- reactos/lib/msvcrt/stdlib/strtoul.c | 5 +- reactos/lib/msvcrt/stdlib/strtoull.c | 7 +- reactos/lib/msvcrt/stdlib/swab.c | 3 +- reactos/lib/msvcrt/stdlib/wcstod.c | 2 +- reactos/lib/msvcrt/stdlib/wcstol.c | 2 +- reactos/lib/msvcrt/stdlib/wcstom.c | 3 +- reactos/lib/msvcrt/stdlib/wcstomb.c | 7 +- reactos/lib/msvcrt/stdlib/wcstombs.c | 6 +- reactos/lib/msvcrt/stdlib/wcstoul.c | 6 +- reactos/lib/msvcrt/stdlib/wtoi.c | 3 +- reactos/lib/msvcrt/stdlib/wtoi64.c | 3 +- reactos/lib/msvcrt/string.c | 32 - reactos/lib/msvcrt/string/memccpy.c | 2 +- reactos/lib/msvcrt/string/memchr.c | 2 +- reactos/lib/msvcrt/string/memcmp.c | 3 +- reactos/lib/msvcrt/string/memcpy.c | 3 +- reactos/lib/msvcrt/string/memicmp.c | 4 +- reactos/lib/msvcrt/string/memmove.c | 2 +- reactos/lib/msvcrt/string/memset.c | 3 +- reactos/lib/msvcrt/string/strcat.c | 3 +- reactos/lib/msvcrt/string/strchr.c | 2 +- reactos/lib/msvcrt/string/strcmp.c | 3 +- reactos/lib/msvcrt/string/strcoll.c | 4 +- reactos/lib/msvcrt/string/strcpy.c | 2 +- reactos/lib/msvcrt/string/strcspn.c | 3 +- reactos/lib/msvcrt/string/strdup.c | 3 +- reactos/lib/msvcrt/string/strerror.c | 12 +- reactos/lib/msvcrt/string/stricmp.c | 4 +- reactos/lib/msvcrt/string/strlen.c | 3 +- reactos/lib/msvcrt/string/strlwr.c | 3 +- reactos/lib/msvcrt/string/strncat.c | 3 +- reactos/lib/msvcrt/string/strncmp.c | 2 +- reactos/lib/msvcrt/string/strncpy.c | 3 +- reactos/lib/msvcrt/string/strnicmp.c | 4 +- reactos/lib/msvcrt/string/strnlen.c | 3 +- reactos/lib/msvcrt/string/strpbrk.c | 2 +- reactos/lib/msvcrt/string/strrchr.c | 3 +- reactos/lib/msvcrt/string/strrev.c | 3 +- reactos/lib/msvcrt/string/strset.c | 4 +- reactos/lib/msvcrt/string/strspn.c | 3 +- reactos/lib/msvcrt/string/strstr.c | 2 +- reactos/lib/msvcrt/string/strtok.c | 4 +- reactos/lib/msvcrt/string/strupr.c | 5 +- reactos/lib/msvcrt/string/strxfrm.c | 2 +- reactos/lib/msvcrt/sys_stat.c | 3 - reactos/lib/msvcrt/sys_stat/fstat.c | 21 +- reactos/lib/msvcrt/sys_stat/futime.c | 11 +- reactos/lib/msvcrt/sys_stat/stat.c | 17 +- reactos/lib/msvcrt/time.c | 6 - reactos/lib/msvcrt/time/clock.c | 6 +- reactos/lib/msvcrt/time/ctime.c | 36 +- reactos/lib/msvcrt/time/difftime.c | 3 +- reactos/lib/msvcrt/time/strdate.c | 10 +- reactos/lib/msvcrt/time/strftime.c | 9 +- reactos/lib/msvcrt/time/strtime.c | 6 +- reactos/lib/msvcrt/time/time.c | 7 +- reactos/lib/msvcrt/wstring.c | 24 - reactos/lib/msvcrt/wstring/wcscat.c | 3 +- reactos/lib/msvcrt/wstring/wcschr.c | 2 +- reactos/lib/msvcrt/wstring/wcscmp.c | 2 +- reactos/lib/msvcrt/wstring/wcscoll.c | 2 +- reactos/lib/msvcrt/wstring/wcscpy.c | 2 +- reactos/lib/msvcrt/wstring/wcscspn.c | 3 +- reactos/lib/msvcrt/wstring/wcsdup.c | 4 +- reactos/lib/msvcrt/wstring/wcsicmp.c | 4 +- reactos/lib/msvcrt/wstring/wcslen.c | 3 +- reactos/lib/msvcrt/wstring/wcslwr.c | 2 +- reactos/lib/msvcrt/wstring/wcsncat.c | 3 +- reactos/lib/msvcrt/wstring/wcsncmp.c | 3 +- reactos/lib/msvcrt/wstring/wcsncpy.c | 3 +- reactos/lib/msvcrt/wstring/wcsnicmp.c | 3 +- reactos/lib/msvcrt/wstring/wcsnlen.c | 3 +- reactos/lib/msvcrt/wstring/wcspbrk.c | 5 +- reactos/lib/msvcrt/wstring/wcsrchr.c | 3 +- reactos/lib/msvcrt/wstring/wcsrev.c | 3 +- reactos/lib/msvcrt/wstring/wcsset.c | 3 +- reactos/lib/msvcrt/wstring/wcsspn.c | 3 +- reactos/lib/msvcrt/wstring/wcsstr.c | 3 +- reactos/lib/msvcrt/wstring/wcstok.c | 4 +- reactos/lib/msvcrt/wstring/wcsupr.c | 3 +- reactos/lib/msvcrt/wstring/wcsxfrm.c | 3 +- reactos/lib/ntdll/csr/capture.c | 9 +- reactos/lib/ntdll/csr/lpc.c | 11 +- reactos/lib/ntdll/csr/probe.c | 8 +- reactos/lib/ntdll/csr/thread.c | 11 +- reactos/lib/ntdll/dbg/brkpoint.c | 7 +- reactos/lib/ntdll/dbg/debug.c | 13 +- reactos/lib/ntdll/dbg/print.c | 9 +- reactos/lib/ntdll/dbg/winedbg.c | 3 +- reactos/lib/ntdll/def/ntdll.def | 26 +- reactos/lib/ntdll/def/ntdll.edf | 30 +- reactos/lib/ntdll/def/ntdll.rc | 2 +- reactos/lib/ntdll/ldr/startup.c | 22 +- reactos/lib/ntdll/ldr/utils.c | 17 +- reactos/lib/ntdll/main/dllmain.c | 11 +- reactos/lib/ntdll/makefile | 6 +- reactos/lib/ntdll/rtl/access.c | 8 +- reactos/lib/ntdll/rtl/acl.c | 20 +- reactos/lib/ntdll/rtl/apc.c | 8 +- reactos/lib/ntdll/rtl/atom.c | 20 +- reactos/lib/ntdll/rtl/bitmap.c | 8 +- reactos/lib/ntdll/rtl/callback.c | 14 +- reactos/lib/ntdll/rtl/critical.c | 30 +- reactos/lib/ntdll/rtl/dos8dot3.c | 11 +- reactos/lib/ntdll/rtl/env.c | 14 +- reactos/lib/ntdll/rtl/error.c | 8 +- reactos/lib/ntdll/rtl/exception.c | 8 +- reactos/lib/ntdll/rtl/handle.c | 8 +- reactos/lib/ntdll/rtl/heap.c | 25 +- reactos/lib/ntdll/rtl/image.c | 8 +- reactos/lib/ntdll/rtl/intrlck.c | 10 +- reactos/lib/ntdll/rtl/largeint.c | 8 +- reactos/lib/ntdll/rtl/luid.c | 9 +- reactos/lib/ntdll/rtl/mem.c | 30 +- reactos/lib/ntdll/rtl/message.c | 8 +- reactos/lib/ntdll/rtl/misc.c | 9 +- reactos/lib/ntdll/rtl/nls.c | 9 +- reactos/lib/ntdll/rtl/path.c | 9 +- reactos/lib/ntdll/rtl/ppb.c | 35 +- reactos/lib/ntdll/rtl/process.c | 40 +- reactos/lib/ntdll/rtl/propvar.c | 7 +- reactos/lib/ntdll/rtl/registry.c | 29 +- reactos/lib/ntdll/rtl/resource.c | 12 +- reactos/lib/ntdll/rtl/sd.c | 18 +- reactos/lib/ntdll/rtl/security.c | 9 +- reactos/lib/ntdll/rtl/sid.c | 127 +- reactos/lib/ntdll/rtl/thread.c | 17 +- reactos/lib/ntdll/rtl/time.c | 9 +- reactos/lib/ntdll/rtl/timezone.c | 10 +- reactos/lib/ntdll/rtl/trace.c | 9 +- reactos/lib/ntdll/rtl/unicode.c | 19 +- reactos/lib/ntdll/stdio/sprintf.c | 7 +- reactos/lib/ntdll/stdio/swprintf.c | 7 +- reactos/lib/ntdll/string/ctype.c | 10 +- reactos/lib/ntdll/stubs/stubs.c | 3 +- reactos/lib/ole32/ole32.rc | 2 +- reactos/lib/oleaut32/oleaut32.rc | 2 +- reactos/lib/psapi/psapi.rc | 2 +- reactos/lib/secur32/Makefile | 4 +- reactos/lib/secur32/dllmain.c | 3 +- reactos/lib/secur32/lsa.c | 22 +- reactos/lib/secur32/secur32.rc | 2 +- reactos/lib/shell32/shell32.rc | 2 +- reactos/lib/user32/Makefile | 4 +- reactos/lib/user32/controls/combobox.c | 4 +- reactos/lib/user32/controls/listbox.c | 4 +- reactos/lib/user32/controls/scrollbar.c | 4 +- reactos/lib/user32/include/debug.h | 2 +- reactos/lib/user32/include/user32.h | 10 - reactos/lib/user32/misc/dde.c | 6 +- reactos/lib/user32/misc/desktop.c | 13 +- reactos/lib/user32/misc/display.c | 6 +- reactos/lib/user32/misc/dllmain.c | 5 +- reactos/lib/user32/misc/object.c | 4 +- reactos/lib/user32/misc/resources.c | 5 +- reactos/lib/user32/misc/stubs.c | 10 +- reactos/lib/user32/misc/timer.c | 4 +- reactos/lib/user32/misc/winsta.c | 13 +- reactos/lib/user32/user32.rc | 2 +- reactos/lib/user32/windows/accel.c | 4 +- reactos/lib/user32/windows/bitmap.c | 4 +- reactos/lib/user32/windows/class.c | 31 +- reactos/lib/user32/windows/clipboard.c | 4 +- reactos/lib/user32/windows/cursor.c | 4 +- reactos/lib/user32/windows/dc.c | 4 +- reactos/lib/user32/windows/defwnd.c | 6 +- reactos/lib/user32/windows/dialog.c | 4 +- reactos/lib/user32/windows/draw.c | 13 +- reactos/lib/user32/windows/font.c | 4 +- reactos/lib/user32/windows/hook.c | 4 +- reactos/lib/user32/windows/icon.c | 4 +- reactos/lib/user32/windows/input.c | 4 +- reactos/lib/user32/windows/mdi.c | 4 +- reactos/lib/user32/windows/menu.c | 32 +- reactos/lib/user32/windows/message.c | 6 +- reactos/lib/user32/windows/messagebox.c | 8 +- reactos/lib/user32/windows/paint.c | 4 +- reactos/lib/user32/windows/prop.c | 12 +- reactos/lib/user32/windows/rect.c | 4 +- reactos/lib/user32/windows/text.c | 4 +- reactos/lib/user32/windows/window.c | 32 +- reactos/lib/version/makefile | 4 +- reactos/lib/version/misc/stubs.c | 6 +- reactos/lib/version/version.rc | 2 +- reactos/lib/ws2_32/include/debug.h | 9 +- reactos/lib/ws2_32/include/ws2_32.h | 5 +- reactos/lib/ws2_32/makefile | 4 +- reactos/lib/ws2_32/misc/dllmain.c | 36 +- reactos/lib/ws2_32/misc/sndrcv.c | 20 +- reactos/lib/ws2_32/misc/stubs.c | 4 +- reactos/lib/ws2_32/ws2_32.rc | 2 +- reactos/lib/ws2help/ws2help.rc | 2 +- reactos/lib/wshirda/debug.h | 7 +- reactos/lib/wshirda/wshirda.c | 2 +- reactos/lib/wshirda/wshirda.rc | 2 +- reactos/ntoskrnl/Makefile | 13 +- reactos/ntoskrnl/cc/cacheman.c | 4 +- reactos/ntoskrnl/cc/copy.c | 67 +- reactos/ntoskrnl/cc/misc.c | 15 +- reactos/ntoskrnl/cc/pin.c | 17 +- reactos/ntoskrnl/cc/view.c | 111 +- reactos/ntoskrnl/cm/cm.h | 7 - reactos/ntoskrnl/cm/import.c | 14 +- reactos/ntoskrnl/cm/ntfunc.c | 26 +- reactos/ntoskrnl/cm/regfile.c | 26 +- reactos/ntoskrnl/cm/registry.c | 27 +- reactos/ntoskrnl/cm/regobj.c | 13 +- reactos/ntoskrnl/cm/rtlfunc.c | 24 +- reactos/ntoskrnl/dbg/dbgctrl.c | 7 +- reactos/ntoskrnl/dbg/errinfo.c | 32 +- reactos/ntoskrnl/dbg/kdb.c | 8 +- reactos/ntoskrnl/dbg/kdb.h | 2 +- reactos/ntoskrnl/dbg/kdb_keyboard.c | 9 +- reactos/ntoskrnl/dbg/kdb_stabs.c | 13 +- reactos/ntoskrnl/dbg/print.c | 8 +- reactos/ntoskrnl/dbg/rdebug.c | 7 +- reactos/ntoskrnl/dbg/user.c | 11 +- reactos/ntoskrnl/ex/btree.c | 5 +- reactos/ntoskrnl/ex/callback.c | 8 +- reactos/ntoskrnl/ex/fmutex.c | 8 +- reactos/ntoskrnl/ex/hashtab.c | 5 +- reactos/ntoskrnl/ex/i386/interlck.c | 19 +- reactos/ntoskrnl/ex/init.c | 4 +- reactos/ntoskrnl/ex/interlck.c | 15 +- reactos/ntoskrnl/ex/list.c | 75 +- reactos/ntoskrnl/ex/lookas.c | 165 +- reactos/ntoskrnl/ex/napi.c | 7 +- reactos/ntoskrnl/ex/power.c | 9 +- reactos/ntoskrnl/ex/resource.c | 140 +- reactos/ntoskrnl/ex/stree.c | 5 +- reactos/ntoskrnl/ex/sysinfo.c | 188 +- reactos/ntoskrnl/ex/time.c | 9 +- reactos/ntoskrnl/ex/win32k.c | 11 +- reactos/ntoskrnl/ex/work.c | 22 +- reactos/ntoskrnl/ex/zone.c | 20 +- reactos/ntoskrnl/fs/dbcsname.c | 9 +- reactos/ntoskrnl/fs/filelock.c | 9 +- reactos/ntoskrnl/fs/mcb.c | 7 +- reactos/ntoskrnl/fs/mdl.c | 11 +- reactos/ntoskrnl/fs/name.c | 9 +- reactos/ntoskrnl/fs/notify.c | 39 +- reactos/ntoskrnl/fs/oplock.c | 8 +- reactos/ntoskrnl/fs/pool.c | 10 +- reactos/ntoskrnl/fs/tunnel.c | 13 +- reactos/ntoskrnl/fs/unc.c | 8 +- reactos/ntoskrnl/fs/util.c | 8 +- reactos/ntoskrnl/include/internal/arch/ke.h | 2 +- reactos/ntoskrnl/include/internal/arch/mm.h | 2 +- reactos/ntoskrnl/include/internal/arch/ps.h | 2 +- reactos/ntoskrnl/include/internal/cc.h | 70 +- reactos/ntoskrnl/include/internal/dbg.h | 7 +- reactos/ntoskrnl/include/internal/debug.h | 2 - reactos/ntoskrnl/include/internal/ex.h | 38 +- reactos/ntoskrnl/include/internal/handle.h | 7 - reactos/ntoskrnl/include/internal/i386/fpu.h | 4 - reactos/ntoskrnl/include/internal/i386/ke.h | 12 +- reactos/ntoskrnl/include/internal/i386/mm.h | 34 +- reactos/ntoskrnl/include/internal/i386/ps.h | 49 +- reactos/ntoskrnl/include/internal/id.h | 4 +- reactos/ntoskrnl/include/internal/ifs.h | 6 +- reactos/ntoskrnl/include/internal/io.h | 12 +- reactos/ntoskrnl/include/internal/kd.h | 6 +- reactos/ntoskrnl/include/internal/ke.h | 16 +- reactos/ntoskrnl/include/internal/ldr.h | 4 - reactos/ntoskrnl/include/internal/mm.h | 20 +- reactos/ntoskrnl/include/internal/module.h | 6 +- reactos/ntoskrnl/include/internal/nt.h | 13 - reactos/ntoskrnl/include/internal/ntoskrnl.h | 19 +- reactos/ntoskrnl/include/internal/ob.h | 4 +- reactos/ntoskrnl/include/internal/po.h | 6 +- reactos/ntoskrnl/include/internal/pool.h | 13 +- reactos/ntoskrnl/include/internal/port.h | 7 +- reactos/ntoskrnl/include/internal/ps.h | 380 +- reactos/ntoskrnl/include/internal/registry.h | 6 +- reactos/ntoskrnl/include/internal/safe.h | 4 - reactos/ntoskrnl/include/internal/se.h | 15 +- reactos/ntoskrnl/include/internal/trap.h | 5 +- reactos/ntoskrnl/include/internal/v86m.h | 8 +- reactos/ntoskrnl/include/internal/xhal.h | 4 - reactos/ntoskrnl/include/ntoskrnl.h | 55 - reactos/ntoskrnl/io/adapter.c | 12 +- reactos/ntoskrnl/io/arcname.c | 11 +- reactos/ntoskrnl/io/buildirp.c | 6 +- reactos/ntoskrnl/io/cancel.c | 7 +- reactos/ntoskrnl/io/cleanup.c | 13 +- reactos/ntoskrnl/io/cntrller.c | 7 +- reactos/ntoskrnl/io/create.c | 15 +- reactos/ntoskrnl/io/device.c | 29 +- reactos/ntoskrnl/io/dir.c | 10 +- reactos/ntoskrnl/io/driver.c | 15 +- reactos/ntoskrnl/io/errlog.c | 25 +- reactos/ntoskrnl/io/error.c | 7 +- reactos/ntoskrnl/io/event.c | 7 +- reactos/ntoskrnl/io/file.c | 6 +- reactos/ntoskrnl/io/flush.c | 4 +- reactos/ntoskrnl/io/fs.c | 24 +- reactos/ntoskrnl/io/iocomp.c | 4 +- reactos/ntoskrnl/io/ioctrl.c | 7 +- reactos/ntoskrnl/io/iomgr.c | 31 +- reactos/ntoskrnl/io/irp.c | 26 +- reactos/ntoskrnl/io/lock.c | 4 +- reactos/ntoskrnl/io/mailslot.c | 3 +- reactos/ntoskrnl/io/mdl.c | 13 +- reactos/ntoskrnl/io/npipe.c | 3 +- reactos/ntoskrnl/io/page.c | 6 +- reactos/ntoskrnl/io/parttab.c | 16 +- reactos/ntoskrnl/io/pnpmgr.c | 14 +- reactos/ntoskrnl/io/pnproot.c | 7 +- reactos/ntoskrnl/io/process.c | 9 +- reactos/ntoskrnl/io/queue.c | 11 +- reactos/ntoskrnl/io/resource.c | 11 +- reactos/ntoskrnl/io/rw.c | 6 +- reactos/ntoskrnl/io/share.c | 6 +- reactos/ntoskrnl/io/shutdown.c | 6 +- reactos/ntoskrnl/io/symlink.c | 11 +- reactos/ntoskrnl/io/timer.c | 6 +- reactos/ntoskrnl/io/vpb.c | 16 +- reactos/ntoskrnl/io/xhaldisp.c | 18 +- reactos/ntoskrnl/io/xhaldrv.c | 8 +- reactos/ntoskrnl/kd/dlog.c | 12 +- reactos/ntoskrnl/kd/gdbstub.c | 8 +- reactos/ntoskrnl/kd/kdebug.c | 55 +- reactos/ntoskrnl/kd/mda.c | 8 +- reactos/ntoskrnl/kd/service.c | 10 +- reactos/ntoskrnl/ke/apc.c | 8 +- reactos/ntoskrnl/ke/bug.c | 8 +- reactos/ntoskrnl/ke/catch.c | 50 +- reactos/ntoskrnl/ke/critical.c | 6 +- reactos/ntoskrnl/ke/dpc.c | 6 +- reactos/ntoskrnl/ke/error.c | 4 +- reactos/ntoskrnl/ke/event.c | 5 +- reactos/ntoskrnl/ke/i386/bios.c | 4 +- reactos/ntoskrnl/ke/i386/brkpoint.c | 4 +- reactos/ntoskrnl/ke/i386/bthread.S | 7 +- reactos/ntoskrnl/ke/i386/exp.c | 14 +- reactos/ntoskrnl/ke/i386/fpu.c | 6 +- reactos/ntoskrnl/ke/i386/gdt.c | 14 +- reactos/ntoskrnl/ke/i386/idt.c | 3 +- reactos/ntoskrnl/ke/i386/irq.c | 17 +- reactos/ntoskrnl/ke/i386/irqhand.s | 2 +- reactos/ntoskrnl/ke/i386/kernel.c | 41 +- reactos/ntoskrnl/ke/i386/ldt.c | 6 +- reactos/ntoskrnl/ke/i386/multiboot.S | 6 +- reactos/ntoskrnl/ke/i386/stkswitch.S | 4 +- reactos/ntoskrnl/ke/i386/syscall.S | 12 +- reactos/ntoskrnl/ke/i386/thread.c | 9 +- reactos/ntoskrnl/ke/i386/trap.s | 11 +- reactos/ntoskrnl/ke/i386/tskswitch.S | 5 +- reactos/ntoskrnl/ke/i386/tss.c | 6 +- reactos/ntoskrnl/ke/i386/usercall.c | 12 +- reactos/ntoskrnl/ke/i386/usertrap.c | 15 +- reactos/ntoskrnl/ke/i386/v86m.c | 8 +- reactos/ntoskrnl/ke/i386/v86m_sup.S | 6 +- reactos/ntoskrnl/ke/kqueue.c | 43 +- reactos/ntoskrnl/ke/kthread.c | 12 +- reactos/ntoskrnl/ke/main.c | 98 +- reactos/ntoskrnl/ke/mutex.c | 9 +- reactos/ntoskrnl/ke/process.c | 9 +- reactos/ntoskrnl/ke/queue.c | 9 +- reactos/ntoskrnl/ke/sem.c | 7 +- reactos/ntoskrnl/ke/spinlock.c | 59 +- reactos/ntoskrnl/ke/timer.c | 9 +- reactos/ntoskrnl/ke/wait.c | 8 +- reactos/ntoskrnl/ldr/init.c | 18 +- reactos/ntoskrnl/ldr/loader.c | 33 +- reactos/ntoskrnl/ldr/resource.c | 5 +- reactos/ntoskrnl/ldr/rtl.c | 10 +- reactos/ntoskrnl/ldr/sysdll.c | 8 +- reactos/ntoskrnl/ldr/userldr.c | 8 +- reactos/ntoskrnl/lpc/close.c | 7 +- reactos/ntoskrnl/lpc/complete.c | 10 +- reactos/ntoskrnl/lpc/connect.c | 27 +- reactos/ntoskrnl/lpc/create.c | 13 +- reactos/ntoskrnl/lpc/listen.c | 10 +- reactos/ntoskrnl/lpc/port.c | 10 +- reactos/ntoskrnl/lpc/query.c | 10 +- reactos/ntoskrnl/lpc/queue.c | 8 +- reactos/ntoskrnl/lpc/receive.c | 8 +- reactos/ntoskrnl/lpc/reply.c | 19 +- reactos/ntoskrnl/lpc/send.c | 8 +- reactos/ntoskrnl/mm/anonmem.c | 39 +- reactos/ntoskrnl/mm/aspace.c | 11 +- reactos/ntoskrnl/mm/balance.c | 7 +- reactos/ntoskrnl/mm/cont.c | 14 +- reactos/ntoskrnl/mm/drvlck.c | 7 +- reactos/ntoskrnl/mm/freelist.c | 105 +- reactos/ntoskrnl/mm/i386/page.c | 17 +- reactos/ntoskrnl/mm/i386/pfault.c | 7 +- reactos/ntoskrnl/mm/iospace.c | 26 +- reactos/ntoskrnl/mm/kmap.c | 27 +- reactos/ntoskrnl/mm/marea.c | 20 +- reactos/ntoskrnl/mm/mdl.c | 35 +- reactos/ntoskrnl/mm/mm.c | 17 +- reactos/ntoskrnl/mm/mminit.c | 42 +- reactos/ntoskrnl/mm/mpw.c | 14 +- reactos/ntoskrnl/mm/ncache.c | 11 +- reactos/ntoskrnl/mm/npool.c | 63 +- reactos/ntoskrnl/mm/pagefile.c | 29 +- reactos/ntoskrnl/mm/pageop.c | 16 +- reactos/ntoskrnl/mm/pager.c | 14 +- reactos/ntoskrnl/mm/pagfault.c | 10 +- reactos/ntoskrnl/mm/paging.c | 4 +- reactos/ntoskrnl/mm/pool.c | 13 +- reactos/ntoskrnl/mm/ppool.c | 8 +- reactos/ntoskrnl/mm/region.c | 10 +- reactos/ntoskrnl/mm/rmap.c | 7 +- reactos/ntoskrnl/mm/section.c | 87 +- reactos/ntoskrnl/mm/slab.c | 16 +- reactos/ntoskrnl/mm/virtual.c | 20 +- reactos/ntoskrnl/mm/wset.c | 8 +- reactos/ntoskrnl/nls/nls.c | 9 +- reactos/ntoskrnl/nt/channel.c | 4 +- reactos/ntoskrnl/nt/evtpair.c | 30 +- reactos/ntoskrnl/nt/misc.c | 4 +- reactos/ntoskrnl/nt/mutant.c | 7 +- reactos/ntoskrnl/nt/nt.c | 7 +- reactos/ntoskrnl/nt/ntevent.c | 12 +- reactos/ntoskrnl/nt/ntsem.c | 11 +- reactos/ntoskrnl/nt/nttimer.c | 12 +- reactos/ntoskrnl/nt/plugplay.c | 4 +- reactos/ntoskrnl/nt/profile.c | 13 +- reactos/ntoskrnl/nt/vdm.c | 9 +- reactos/ntoskrnl/ntoskrnl.def | 30 +- reactos/ntoskrnl/ntoskrnl.edf | 34 +- reactos/ntoskrnl/ntoskrnl.rc | 2 +- reactos/ntoskrnl/ob/dirobj.c | 10 +- reactos/ntoskrnl/ob/handle.c | 32 +- reactos/ntoskrnl/ob/namespc.c | 15 +- reactos/ntoskrnl/ob/ntobj.c | 13 +- reactos/ntoskrnl/ob/object.c | 17 +- reactos/ntoskrnl/ob/security.c | 25 +- reactos/ntoskrnl/po/power.c | 8 +- reactos/ntoskrnl/ps/create.c | 78 +- reactos/ntoskrnl/ps/debug.c | 10 +- reactos/ntoskrnl/ps/idle.c | 19 +- reactos/ntoskrnl/ps/kill.c | 11 +- reactos/ntoskrnl/ps/locale.c | 5 +- reactos/ntoskrnl/ps/process.c | 77 +- reactos/ntoskrnl/ps/psmgr.c | 8 +- reactos/ntoskrnl/ps/suspend.c | 9 +- reactos/ntoskrnl/ps/thread.c | 32 +- reactos/ntoskrnl/ps/tinfo.c | 20 +- reactos/ntoskrnl/ps/w32call.c | 15 +- reactos/ntoskrnl/ps/win32.c | 10 +- reactos/ntoskrnl/rtl/atom.c | 31 +- reactos/ntoskrnl/rtl/bitmap.c | 7 +- reactos/ntoskrnl/rtl/capture.c | 6 +- reactos/ntoskrnl/rtl/ctype.c | 7 +- reactos/ntoskrnl/rtl/dos8dot3.c | 5 +- reactos/ntoskrnl/rtl/error.c | 8 +- reactos/ntoskrnl/rtl/handle.c | 6 +- reactos/ntoskrnl/rtl/i386/memcpy.c | 4 +- reactos/ntoskrnl/rtl/i386/memset.c | 3 +- reactos/ntoskrnl/rtl/largeint.c | 4 +- reactos/ntoskrnl/rtl/mem.c | 26 +- reactos/ntoskrnl/rtl/memchr.c | 5 +- reactos/ntoskrnl/rtl/memcmp.c | 6 +- reactos/ntoskrnl/rtl/memcpy.c | 4 +- reactos/ntoskrnl/rtl/memmove.c | 6 +- reactos/ntoskrnl/rtl/memset.c | 5 +- reactos/ntoskrnl/rtl/message.c | 4 +- reactos/ntoskrnl/rtl/nls.c | 6 +- reactos/ntoskrnl/rtl/regio.c | 7 +- reactos/ntoskrnl/rtl/seh.c | 11 +- reactos/ntoskrnl/rtl/sprintf.c | 10 +- reactos/ntoskrnl/rtl/stdlib.c | 12 +- reactos/ntoskrnl/rtl/string.c | 7 +- reactos/ntoskrnl/rtl/strtok.c | 3 +- reactos/ntoskrnl/rtl/swprintf.c | 9 +- reactos/ntoskrnl/rtl/time.c | 5 +- reactos/ntoskrnl/rtl/timezone.c | 10 +- reactos/ntoskrnl/rtl/unicode.c | 17 +- reactos/ntoskrnl/rtl/wstring.c | 3 +- reactos/ntoskrnl/se/access.c | 7 +- reactos/ntoskrnl/se/acl.c | 25 +- reactos/ntoskrnl/se/lsa.c | 9 +- reactos/ntoskrnl/se/luid.c | 7 +- reactos/ntoskrnl/se/priv.c | 38 +- reactos/ntoskrnl/se/sd.c | 20 +- reactos/ntoskrnl/se/semgr.c | 35 +- reactos/ntoskrnl/se/sid.c | 85 +- reactos/ntoskrnl/se/token.c | 355 +- reactos/rules.mak | 6 +- reactos/services/eventlog/eventlog.c | 6 +- reactos/services/eventlog/eventlog.rc | 4 +- reactos/services/eventlog/logport.c | 7 +- reactos/services/rpcss/rpcss.c | 6 +- reactos/services/rpcss/rpcss.rc | 4 +- reactos/subsys/csrss/api.h | 1 - reactos/subsys/csrss/api/conio.c | 60 +- reactos/subsys/csrss/api/handle.c | 7 +- reactos/subsys/csrss/api/process.c | 18 +- reactos/subsys/csrss/api/wapi.c | 16 +- reactos/subsys/csrss/csrss.c | 9 +- reactos/subsys/csrss/csrss.rc | 4 +- reactos/subsys/csrss/init.c | 7 +- reactos/subsys/csrss/print.c | 6 +- reactos/subsys/csrss/video.c | 6 +- reactos/subsys/smss/init.c | 27 +- reactos/subsys/smss/smapi.c | 8 +- reactos/subsys/smss/smss.c | 5 +- reactos/subsys/smss/smss.rc | 2 +- reactos/subsys/system/autochk/autochk.c | 6 +- reactos/subsys/system/autochk/autochk.rc | 2 +- reactos/subsys/system/gstart/gstart.c | 4 +- reactos/subsys/system/gstart/gstart.rc | 4 +- reactos/subsys/system/services/database.c | 6 +- reactos/subsys/system/services/services.c | 8 +- reactos/subsys/system/services/services.rc | 4 +- reactos/subsys/system/shell/shell.c | 9 +- reactos/subsys/system/shell/shell.rc | 4 +- reactos/subsys/system/winlogon/winlogon.c | 6 +- reactos/subsys/system/winlogon/winlogon.rc | 2 +- reactos/subsys/win32k/dib/dib.h | 30 +- reactos/subsys/win32k/dib/dib24bpp.c | 36 +- reactos/subsys/win32k/dib/dib4bpp.c | 11 +- reactos/subsys/win32k/eng/bitblt.c | 10 +- reactos/subsys/win32k/eng/brush.c | 15 +- reactos/subsys/win32k/eng/clip.c | 8 +- reactos/subsys/win32k/eng/copybits.c | 9 +- reactos/subsys/win32k/eng/lineto.c | 10 +- reactos/subsys/win32k/eng/mouse.c | 4 +- reactos/subsys/win32k/eng/objects.h | 57 +- reactos/subsys/win32k/eng/paint.c | 3 +- reactos/subsys/win32k/eng/palette.c | 3 +- reactos/subsys/win32k/eng/transblt.c | 18 +- reactos/subsys/win32k/eng/xlate.c | 11 +- reactos/subsys/win32k/freetype/grfont.c | 8 +- reactos/subsys/win32k/include/callback.h | 3 - reactos/subsys/win32k/include/class.h | 5 +- reactos/subsys/win32k/include/eng.h | 2 - reactos/subsys/win32k/include/mouse.h | 6 +- reactos/subsys/win32k/include/object.h | 3 +- reactos/subsys/win32k/include/winsta.h | 5 +- reactos/subsys/win32k/ldr/loader.c | 5 +- reactos/subsys/win32k/main/dllmain.c | 8 +- reactos/subsys/win32k/main/svctabm.c | 5 +- reactos/subsys/win32k/makefile | 4 +- reactos/subsys/win32k/misc/driver.c | 12 +- reactos/subsys/win32k/misc/error.c | 3 +- reactos/subsys/win32k/ntuser/class.c | 7 +- reactos/subsys/win32k/ntuser/guicheck.c | 7 +- reactos/subsys/win32k/ntuser/window.c | 4 +- reactos/subsys/win32k/ntuser/winsta.c | 10 +- reactos/subsys/win32k/objects/bitmaps.c | 20 +- reactos/subsys/win32k/objects/brush.c | 16 +- reactos/subsys/win32k/objects/cliprgn.c | 6 +- reactos/subsys/win32k/objects/color.c | 34 +- reactos/subsys/win32k/objects/dc.c | 29 +- reactos/subsys/win32k/objects/dib.c | 19 +- reactos/subsys/win32k/objects/fillshap.c | 7 +- reactos/subsys/win32k/objects/gdiobj.c | 6 +- reactos/subsys/win32k/objects/objconv.c | 7 +- reactos/subsys/win32k/objects/palette.c | 56 +- reactos/subsys/win32k/objects/print.c | 2 +- reactos/subsys/win32k/objects/region.c | 2 +- reactos/subsys/win32k/objects/text.c | 27 +- reactos/subsys/win32k/win32k.rc | 5 +- reactos/tools/depend.mk | 1 - reactos/tools/helper.mk | 9 +- reactos/tools/mkconfig.c | 2 +- reactos/tools/wmc/write.c | 6 +- reactos/tools/wmc/y_tab.c | 4 +- 1261 files changed, 42752 insertions(+), 18631 deletions(-) create mode 100644 reactos/include/ascii.h create mode 100644 reactos/include/base.h create mode 100644 reactos/include/defines.h create mode 100644 reactos/include/devices.h create mode 100644 reactos/include/errors.h create mode 100644 reactos/include/excpt.h create mode 100644 reactos/include/funcs.h create mode 100644 reactos/include/in.h create mode 100644 reactos/include/messages.h create mode 100644 reactos/include/msvcrt/alloc.h create mode 100644 reactos/include/msvcrt/assert.h create mode 100644 reactos/include/msvcrt/conio.h create mode 100644 reactos/include/msvcrt/ctype.h create mode 100644 reactos/include/msvcrt/dir.h create mode 100644 reactos/include/msvcrt/direct.h create mode 100644 reactos/include/msvcrt/errno.h create mode 100644 reactos/include/msvcrt/fcntl.h create mode 100644 reactos/include/msvcrt/float.h create mode 100644 reactos/include/msvcrt/io.h create mode 100644 reactos/include/msvcrt/locale.h create mode 100644 reactos/include/msvcrt/malloc.h create mode 100644 reactos/include/msvcrt/math.h create mode 100644 reactos/include/msvcrt/mbctype.h create mode 100644 reactos/include/msvcrt/mbstring.h rename reactos/{lib/msvcrt/include => include/msvcrt}/msvcrtdbg.h (96%) mode change 100755 => 100644 create mode 100644 reactos/include/msvcrt/process.h create mode 100644 reactos/include/msvcrt/search.h create mode 100644 reactos/include/msvcrt/share.h create mode 100644 reactos/include/msvcrt/signal.h create mode 100644 reactos/include/msvcrt/stdarg.h create mode 100644 reactos/include/msvcrt/stddef.h create mode 100644 reactos/include/msvcrt/stdio.h create mode 100644 reactos/include/msvcrt/stdlib.h create mode 100644 reactos/include/msvcrt/string.h create mode 100644 reactos/include/msvcrt/time.h create mode 100644 reactos/include/msvcrt/wchar.h create mode 100644 reactos/include/ntddk.h delete mode 100755 reactos/include/ntos/core.h delete mode 100755 reactos/include/ntos/dbg.h delete mode 100644 reactos/include/ntos/ddk.h delete mode 100755 reactos/include/ntos/fs.h delete mode 100755 reactos/include/ntos/gdi.h delete mode 100755 reactos/include/ntos/hal.h delete mode 100755 reactos/include/ntos/i386/segment.h delete mode 100755 reactos/include/ntos/lpc.h delete mode 100755 reactos/include/ntos/npipe.h delete mode 100755 reactos/include/ntos/ntddblue.h delete mode 100755 reactos/include/ntos/ntddvid.h delete mode 100755 reactos/include/ntos/rtl.h delete mode 100755 reactos/include/ntos/shared_data.h delete mode 100755 reactos/include/ntos/teb.h delete mode 100755 reactos/include/ntos/w32api.h delete mode 100755 reactos/include/ntos/win32.h delete mode 100755 reactos/include/ntos/zw.h delete mode 100755 reactos/include/ntos/zwtypes.h create mode 100644 reactos/include/sockets.h create mode 100644 reactos/include/structs.h create mode 100644 reactos/include/tchar.h create mode 100644 reactos/include/unicode.h create mode 100644 reactos/include/windows.h create mode 100644 reactos/include/winsock2.h create mode 100644 reactos/include/ws2spi.h create mode 100644 reactos/include/wsahelp.h delete mode 100755 reactos/lib/advapi32/include/advapi32.h delete mode 100755 reactos/lib/kernel32/include/kernel32.h delete mode 100755 reactos/lib/msvcrt/conio.c delete mode 100755 reactos/lib/msvcrt/ctype.c delete mode 100755 reactos/lib/msvcrt/direct.c delete mode 100755 reactos/lib/msvcrt/except.c delete mode 100755 reactos/lib/msvcrt/float.c delete mode 100755 reactos/lib/msvcrt/include/msvcrti.h delete mode 100755 reactos/lib/msvcrt/io.c delete mode 100755 reactos/lib/msvcrt/math.c delete mode 100755 reactos/lib/msvcrt/mbstring.c delete mode 100755 reactos/lib/msvcrt/misc.c delete mode 100755 reactos/lib/msvcrt/process.c delete mode 100755 reactos/lib/msvcrt/stdio.c delete mode 100755 reactos/lib/msvcrt/stdlib.c delete mode 100755 reactos/lib/msvcrt/string.c delete mode 100755 reactos/lib/msvcrt/sys_stat.c delete mode 100755 reactos/lib/msvcrt/time.c delete mode 100755 reactos/lib/msvcrt/wstring.c delete mode 100755 reactos/ntoskrnl/include/ntoskrnl.h diff --git a/reactos/Makefile b/reactos/Makefile index 2a710d2a7d2..4ec0ca00069 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -46,7 +46,7 @@ LOADERS = dos # Driver support libraries #bzip2 zlib -DRIVERS_LIB = bzip2 +DRIVERS_LIB = bzip2 zlib # Kernel mode device drivers # beep blue floppy ide keyboard mouse null parallel ramdrv serial vga vidport diff --git a/reactos/apps/tests/apc/apc.c b/reactos/apps/tests/apc/apc.c index 08e35182c7c..aac7fee331b 100644 --- a/reactos/apps/tests/apc/apc.c +++ b/reactos/apps/tests/apc/apc.c @@ -20,13 +20,11 @@ int main(int argc, char* argv[]) NTSTATUS Status; HANDLE FileHandle; OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING FileName; + UNICODE_STRING FileName = UNICODE_STRING_INITIALIZER(L"\\C:\\a.txt"); IO_STATUS_BLOCK IoStatus; CHAR Buffer[256]; HANDLE EventHandle; - RtlInitUnicodeString(&FileName, L"\\C:\\a.txt"); - AllocConsole(); InputHandle = GetStdHandle(STD_INPUT_HANDLE); OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE); diff --git a/reactos/apps/tests/atomtest/atomtest.c b/reactos/apps/tests/atomtest/atomtest.c index c52a95b8024..f71253dde7c 100644 --- a/reactos/apps/tests/atomtest/atomtest.c +++ b/reactos/apps/tests/atomtest/atomtest.c @@ -1,8 +1,7 @@ #include #include #include -#define NTOS_USER_MODE -#include +#include #define BUFFER_SIZE 256 diff --git a/reactos/apps/tests/dump_shared_data/dump_shared_data.c b/reactos/apps/tests/dump_shared_data/dump_shared_data.c index 4506f8b6aee..0b4a9e808ed 100644 --- a/reactos/apps/tests/dump_shared_data/dump_shared_data.c +++ b/reactos/apps/tests/dump_shared_data/dump_shared_data.c @@ -1,6 +1,5 @@ #include -#define NTOS_USER_MODE -#include +#include int main() { diff --git a/reactos/apps/tests/isotest/isotest.c b/reactos/apps/tests/isotest/isotest.c index f8fb13ee6b6..684cc334d89 100644 --- a/reactos/apps/tests/isotest/isotest.c +++ b/reactos/apps/tests/isotest/isotest.c @@ -2,9 +2,8 @@ * isotest - display cdrom information */ -#include #include -#include +//#include #include #include diff --git a/reactos/apps/tests/lpc/lpcclt.c b/reactos/apps/tests/lpc/lpcclt.c index f7951d01da2..0782a5d36a9 100644 --- a/reactos/apps/tests/lpc/lpcclt.c +++ b/reactos/apps/tests/lpc/lpcclt.c @@ -1,11 +1,11 @@ -/* $Id: lpcclt.c,v 1.10 2002/09/07 15:11:55 chorns Exp $ +/* $Id: lpcclt.c,v 1.11 2002/09/08 10:21:58 chorns Exp $ * * DESCRIPTION: Simple LPC Client * PROGRAMMER: David Welch */ +#include #include -#define NTOS_USER_MODE -#include +#include #include #include #include @@ -63,7 +63,7 @@ int main(int argc, char* argv[]) ZeroMemory(& Request, sizeof Request); strcpy(Request.Data, GetCommandLineA()); Request.Header.DataSize = strlen(Request.Data); - Request.Header.MessageSize = sizeof(LPC_MESSAGE) + + Request.Header.MessageSize = sizeof(LPC_MESSAGE_HEADER) + Request.Header.DataSize; printf("%s: Sending to port 0x%x message \"%s\"...\n", diff --git a/reactos/apps/tests/lpc/lpcsrv.c b/reactos/apps/tests/lpc/lpcsrv.c index 0d12cda1a02..31cc4193fef 100644 --- a/reactos/apps/tests/lpc/lpcsrv.c +++ b/reactos/apps/tests/lpc/lpcsrv.c @@ -1,11 +1,11 @@ -/* $Id: lpcsrv.c,v 1.10 2002/09/07 15:11:55 chorns Exp $ +/* $Id: lpcsrv.c,v 1.11 2002/09/08 10:21:58 chorns Exp $ * * DESCRIPTION: Simple LPC Server * PROGRAMMER: David Welch */ +#include #include -#define NTOS_USER_MODE -#include +#include #include #include #include @@ -74,7 +74,7 @@ int main(int argc, char* argv[]) printf("%s: Received connection request 0x%08x on port 0x%x.\n", MyName, ConnectMsg.Header.MessageId, NamedPortHandle); printf("%s: Request from: PID=%x, TID=%x.\n", MyName, - ConnectMsg.Header.ClientId.UniqueProcess, ConnectMsg.Header.ClientId.UniqueThread); + ConnectMsg.Header.Cid.UniqueProcess, ConnectMsg.Header.Cid.UniqueThread); printf("%s: Accepting connection request 0x%08x...\n", MyName, ConnectMsg.Header.MessageId); diff --git a/reactos/apps/tests/pteb/pteb.c b/reactos/apps/tests/pteb/pteb.c index 861de931dc2..6e3592d0b4a 100644 --- a/reactos/apps/tests/pteb/pteb.c +++ b/reactos/apps/tests/pteb/pteb.c @@ -1,4 +1,3 @@ -#define NTOS_USER_MODE #include #include diff --git a/reactos/apps/tests/regtest/regtest.c b/reactos/apps/tests/regtest/regtest.c index ac24675c1f5..88e11b2c654 100644 --- a/reactos/apps/tests/regtest/regtest.c +++ b/reactos/apps/tests/regtest/regtest.c @@ -2,8 +2,7 @@ #include #include #include -#define NTOS_USER_MODE -#include +#include HANDLE OutputHandle; HANDLE InputHandle; diff --git a/reactos/apps/tests/sectest/sectest.c b/reactos/apps/tests/sectest/sectest.c index b16a7356db1..c244a92c75c 100644 --- a/reactos/apps/tests/sectest/sectest.c +++ b/reactos/apps/tests/sectest/sectest.c @@ -1,8 +1,7 @@ -/* $Id: sectest.c,v 1.3 2002/09/07 15:11:55 chorns Exp $ */ +/* $Id: sectest.c,v 1.4 2002/09/08 10:22:01 chorns Exp $ */ #define UNICODE #define _UNICODE #include -#include int main(int argc, char* argv[]) { @@ -69,3 +68,4 @@ int main(int argc, char* argv[]) return 0; } + diff --git a/reactos/apps/tests/tokentest/tokentest.c b/reactos/apps/tests/tokentest/tokentest.c index 9407b7241ce..189f130fe7d 100644 --- a/reactos/apps/tests/tokentest/tokentest.c +++ b/reactos/apps/tests/tokentest/tokentest.c @@ -6,17 +6,16 @@ #define INCLUDE_THE_DDK_HEADERS #ifdef INCLUDE_THE_DDK_HEADERS -#define NTOS_USER_MODE -#include -#define ROS_ACE_HEADER ROS_ACE_HEADER -#define ROS_ACE IACE +#include +#define ROS_ACE_HEADER ACE_HEADER +#define ROS_ACE ACE // // Allocate the System Luid. The first 1000 LUIDs are reserved. // Use #999 here (0x3E7 = 999) // -//#define SYSTEM_LUID { 0x3E7, 0x0 } +#define SYSTEM_LUID { 0x3E7, 0x0 } #define ANONYMOUS_LOGON_LUID { 0x3e6, 0x0 } #define LOCALSERVICE_LUID { 0x3e5, 0x0 } #define NETWORKSERVICE_LUID { 0x3e4, 0x0 } @@ -252,7 +251,7 @@ DisplayDacl(PACL pAcl) LPWSTR wszType = 0; PSID pSid; - status = RtlGetAce(pAcl, i, (PACE*) &pAce); + status = RtlGetAce(pAcl, i, (ROS_ACE**) &pAce); if ( ! NT_SUCCESS(status) ) { printf("RtlGetAce(): status = 0x%08x\n", status); diff --git a/reactos/apps/utils/objdir/objdir.c b/reactos/apps/utils/objdir/objdir.c index b8e92b7599e..c8eaf4de094 100644 --- a/reactos/apps/utils/objdir/objdir.c +++ b/reactos/apps/utils/objdir/objdir.c @@ -1,4 +1,4 @@ -/* $Id: objdir.c,v 1.9 2002/09/07 15:11:56 chorns Exp $ +/* $Id: objdir.c,v 1.10 2002/09/08 10:22:01 chorns Exp $ * * DESCRIPTION: Object Manager Simple Explorer * PROGRAMMER: David Welch @@ -16,8 +16,8 @@ * 2001-05-02 (ea) * Added -r option. */ -#define NTOS_USER_MODE -#include + +#include #include #include #include @@ -75,6 +75,8 @@ StatusToName (NTSTATUS Status) return "STATUS_OBJECT_NAME_INVALID"; case STATUS_OBJECT_NAME_NOT_FOUND: return "STATUS_OBJECT_NAME_NOT_FOUND"; + case STATUS_PATH_SYNTAX_BAD: + return "STATUS_PATH_SYNTAX_BAD"; case STATUS_NO_MORE_ENTRIES: return "STATUS_NO_MORE_ENTRIES"; case STATUS_UNSUCCESSFUL: diff --git a/reactos/apps/utils/partinfo/partinfo.c b/reactos/apps/utils/partinfo/partinfo.c index 7fea962a833..56dbd482906 100644 --- a/reactos/apps/utils/partinfo/partinfo.c +++ b/reactos/apps/utils/partinfo/partinfo.c @@ -3,8 +3,6 @@ */ #include -#define NTOS_USER_MODE -#include //#include #include #include diff --git a/reactos/baseaddress.cfg b/reactos/baseaddress.cfg index 267be49456d..fa86adafad2 100644 --- a/reactos/baseaddress.cfg +++ b/reactos/baseaddress.cfg @@ -3,34 +3,23 @@ REACTOS -# The DLLs are given relatively large address space regions -# to allow for debug version of the images to be used without -# getting conflicts. -# For release versions we should make this more compact to avoid -# fragmentation. - -BASE ADDRESS NAME ---------------------------------------- -# We should use the WINE version of these DLLs -0x76260000 oleaut32.dll -0x77260000 shell32.dll -0x77a50000 ole32.dll - -0x77000000 fmifs.dll -0x77050000 version.dll -0x77100000 secur32.dll -0x77200000 wshtcpip.dll -0x77300000 msafd.dll -0x77400000 ws2_32.dll -0x77500000 crtdll.dll -0x77700000 gdi32.dll -0x77600000 msvcrt.dll -0x78000000 advapi32.dll -0x78200000 user32.dll -0x78600000 kernel32.dll -0x78800000 ntdll.dll - +lib/advapi32 TARGET_BASE=0x77dc0000 +lib/crtdll TARGET_BASE=0x77630000 +lib/fmifs TARGET_BASE=0x76df0000 +lib/gdi32 TARGET_BASE=0x77ed0000 +lib/kernel32 TARGET_BASE=0x77f00000 +lib/msafd TARGET_BASE=0x777a0000 +lib/msvcrt TARGET_BASE=0x78000000 +lib/ntdll TARGET_BASE=0x77f60000 +lib/ole32 TARGET_BASE=0x77a50000 +lib/oleaut32 TARGET_BASE=0x76260000 +lib/secur32 TARGET_BASE=0x10000000 +lib/shell32 TARGET_BASE=0x77260000 +lib/user32 TARGET_BASE=0x77e70000 +lib/version TARGET_BASE=0x77a90000 +lib/ws2_32 TARGET_BASE=0x77780000 services/dd/vga/display TARGET_BASE=0x70000000 +services/net/wshtcpip TARGET_BASE=0x777c0000 subsys/psx/lib/psxdll TARGET_BASE=0x68EB0000 subsys/psx/lib/psxx # TARGET_BASE=0x77dc0000 subsys/win32k TARGET_BASE=0x0 diff --git a/reactos/drivers/bus/acpi/acpi.rc b/reactos/drivers/bus/acpi/acpi.rc index 633fe35af4b..f267c923f8a 100644 --- a/reactos/drivers/bus/acpi/acpi.rc +++ b/reactos/drivers/bus/acpi/acpi.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/bus/acpi/include/acmacros.h b/reactos/drivers/bus/acpi/include/acmacros.h index f94394bfa93..6c557cb50c7 100644 --- a/reactos/drivers/bus/acpi/include/acmacros.h +++ b/reactos/drivers/bus/acpi/include/acmacros.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acmacros.h - C macros for the entire subsystem. - * $Revision: 1.2 $ + * $Revision: 1.3 $ * *****************************************************************************/ @@ -163,12 +163,8 @@ * Rounding macros (Power of two boundaries only) */ -#ifndef ROUND_DOWN #define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1))) -#endif -#ifndef ROUND_UP #define ROUND_UP(value,boundary) (((value) + ((boundary)-1)) & (~((boundary)-1))) -#endif #define ROUND_DOWN_TO_32_BITS(a) ROUND_DOWN(a,4) #define ROUND_DOWN_TO_64_BITS(a) ROUND_DOWN(a,8) diff --git a/reactos/drivers/bus/acpi/include/actypes.h b/reactos/drivers/bus/acpi/include/actypes.h index ff35985cefe..7ee74bac942 100644 --- a/reactos/drivers/bus/acpi/include/actypes.h +++ b/reactos/drivers/bus/acpi/include/actypes.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: actypes.h - Common data types for the entire ACPI subsystem - * $Revision: 1.2 $ + * $Revision: 1.3 $ * *****************************************************************************/ @@ -26,8 +26,6 @@ #ifndef __ACTYPES_H__ #define __ACTYPES_H__ -#include - /*! [Begin] no source code translation (keep the typedefs) */ /* @@ -116,16 +114,12 @@ typedef char *ACPI_PHYSICAL_ADDRESS; * 32-bit type definitions (default) */ typedef unsigned char UINT8; -#if 0 typedef unsigned char BOOLEAN; typedef unsigned char UCHAR; -#endif typedef unsigned short UINT16; -#if 0 typedef int INT32; typedef unsigned int UINT32; typedef COMPILER_DEPENDENT_UINT64 UINT64; -#endif typedef UINT32 NATIVE_UINT; typedef INT32 NATIVE_INT; diff --git a/reactos/drivers/bus/acpi/include/platform/types.h b/reactos/drivers/bus/acpi/include/platform/types.h index 0e5cb7dff6b..6326448d007 100644 --- a/reactos/drivers/bus/acpi/include/platform/types.h +++ b/reactos/drivers/bus/acpi/include/platform/types.h @@ -14,12 +14,783 @@ #ifndef __INCLUDE_ACPI_TYPES_H #define __INCLUDE_ACPI_TYPES_H -#include -#include +/* Fixed precision types */ +typedef signed char INT8, *PINT8; +typedef signed short INT16, *PINT16; +#if 0 +typedef signed int INT32, *PINT32; +#endif +typedef signed long long INT64, *PINT64; +#if 0 +typedef unsigned char UINT8, *PUINT8; +typedef unsigned short UINT16, *PUINT16; +typedef unsigned int UINT32, *PUINT32; +typedef unsigned long long UINT64, *PUINT64; +#endif -/* Undefine some duplicate defined defines */ -#undef EXCLUSIVE +typedef signed long int LONG32, *PLONG32; +typedef unsigned long int ULONG32, *PULONG32; +typedef unsigned long int DWORD32, *PDWORD32; + + +#ifdef _WIN64 + +/* 64-bit architecture */ + +typedef INT64 INT, *PINT; +typedef LONG64 LONG, *PLONG; +typedef DWORD64 DWORD, *PDWORD; +typedef UINT64 UINT, *PUINT; +typedef ULONG64 ULONG, *PULONG; + +/* Pointer precision types */ +typedef long long INT_PTR, *PINT_PTR; +typedef unsigned long long UINT_PTR, *PUINT_PTR; +typedef long long LONG_PTR, *PLONG_PTR; +typedef unsigned long long ULONG_PTR, *PULONG_PTR; +typedef unsigned long long HANDLE_PTR; +typedef unsigned int UHALF_PTR, *PUHALF_PTR; +typedef int HALF_PTR, *PHALF_PTR; + +#else /* _WIN64 */ + +/* 32-bit architecture */ + +typedef INT32 INT, *PINT; +typedef LONG32 LONG, *PLONG; +typedef DWORD32 DWORD, *PDWORD; +typedef UINT32 UINT, *PUINT; +typedef ULONG32 ULONG, *PULONG; + + +/* Pointer precision types */ +typedef int INT_PTR, *PINT_PTR; +typedef unsigned int UINT_PTR, *PUINT_PTR; +typedef long LONG_PTR, *PLONG_PTR; +typedef unsigned long ULONG_PTR, *PULONG_PTR; +typedef unsigned short UHALF_PTR, *PUHALF_PTR; +typedef short HALF_PTR, *PHALF_PTR; +typedef unsigned long HANDLE_PTR; + +#endif /* _WIN64 */ + +typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR; + +typedef long long LONG64, *PLONG64; + +typedef unsigned long long ULONG64, *PULONG64; +typedef unsigned long long DWORD64, *PDWORD64; + + +#if 0 +typedef unsigned char UCHAR; +#endif +typedef unsigned short USHORT; +typedef unsigned short WCHAR; +typedef unsigned short WORD; +typedef int BOOL; +#if 0 +typedef unsigned char BOOLEAN; +#endif +typedef BOOLEAN* PBOOLEAN; +typedef unsigned short *LPWSTR; +typedef unsigned short *PWSTR; +typedef unsigned char *PUCHAR; +typedef unsigned short *PUSHORT; +typedef void *PVOID; +typedef unsigned char BYTE; +typedef void *LPVOID; +typedef float *PFLOAT; +typedef unsigned short *PWCH; +typedef unsigned short *PWORD; + +typedef long long LONGLONG; +typedef unsigned long long ULONGLONG; +typedef long long *PLONGLONG; +typedef unsigned long long *PULONGLONG; + +/* Check VOID before defining CHAR, SHORT */ +#ifndef VOID +#define VOID void +typedef char CHAR; +typedef short SHORT; +#endif + +typedef CHAR *PCHAR; +typedef CHAR *PCH; +typedef void *HANDLE; +typedef char CCHAR; +typedef CCHAR *PCCHAR; + +#if 0 +#define FALSE 0 +#define TRUE 1 +#endif + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void*)0) +#endif /* __cplusplus */ +#endif /* NULL */ + +typedef const unsigned short *PCWSTR; + +typedef char* PCSZ; + +typedef union _LARGE_INTEGER +{ + struct + { + DWORD LowPart; + LONG HighPart; + } u; +#ifdef ANONYMOUSUNIONS + struct + { + DWORD LowPart; + LONG HighPart; + }; +#endif /* ANONYMOUSUNIONS */ + LONGLONG QuadPart; +} LARGE_INTEGER, *PLARGE_INTEGER; + +typedef union _ULARGE_INTEGER +{ + struct + { + DWORD LowPart; + DWORD HighPart; + } u; +#ifdef ANONYMOUSUNIONS + struct + { + DWORD LowPart; + DWORD HighPart; + }; +#endif /* ANONYMOUSUNIONS */ + ULONGLONG QuadPart; +} ULARGE_INTEGER, *PULARGE_INTEGER; + +typedef struct _FILETIME +{ + DWORD dwLowDateTime; + DWORD dwHighDateTime; +} FILETIME, *LPFILETIME, *PFILETIME; + +#define CONST const + +#ifdef i386 +#define STDCALL __attribute__ ((stdcall)) +#define CDECL __attribute((cdecl)) +#define CALLBACK WINAPI +#define PASCAL WINAPI +#else +#define STDCALL +#define CDECL +#define CALLBACK +#define PASCAL +#endif + +typedef struct _LIST_ENTRY { + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; +} LIST_ENTRY, *PLIST_ENTRY; + +typedef struct _SINGLE_LIST_ENTRY { + struct _SINGLE_LIST_ENTRY *Next; +} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY; + +typedef DWORD STDCALL (*PTHREAD_START_ROUTINE) (LPVOID); +typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; + +typedef unsigned short *PWCHAR; + +#ifdef __PPC__ +#define CONTEXT_CONTROL 1L +#define CONTEXT_FLOATING_POINT 2L +#define CONTEXT_INTEGER 4L +#define CONTEXT_DEBUG_REGISTERS 8L + +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) +#define CONTEXT_DEBUGGER (CONTEXT_FULL) + +#else /* x86 */ +/* The doc refered me to winnt.h, so I had to look... */ +#define SIZE_OF_80387_REGISTERS 80 + +/* Values for contextflags */ +#define CONTEXT_i386 0x10000 +#define CONTEXT_CONTROL (CONTEXT_i386 | 1) +#define CONTEXT_INTEGER (CONTEXT_i386 | 2) +#define CONTEXT_SEGMENTS (CONTEXT_i386 | 4) +#define CONTEXT_FLOATING_POINT (CONTEXT_i386 | 8) +#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386 | 0x10) +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS) + +/* our own invention */ +#define FLAG_TRACE_BIT 0x100 +#define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT) + +#endif + +#ifdef __i386__ + +typedef struct _FLOATING_SAVE_AREA { + DWORD ControlWord; + DWORD StatusWord; + DWORD TagWord; + DWORD ErrorOffset; + DWORD ErrorSelector; + DWORD DataOffset; + DWORD DataSelector; + BYTE RegisterArea[80]; + DWORD Cr0NpxState; +} FLOATING_SAVE_AREA; + +typedef struct _CONTEXT { + DWORD ContextFlags; + + DWORD Dr0; + DWORD Dr1; + DWORD Dr2; + DWORD Dr3; + DWORD Dr6; + DWORD Dr7; + + FLOATING_SAVE_AREA FloatSave; + + DWORD SegGs; + DWORD SegFs; + DWORD SegEs; + DWORD SegDs; + + DWORD Edi; + DWORD Esi; + DWORD Ebx; + DWORD Edx; + DWORD Ecx; + DWORD Eax; + + DWORD Ebp; + DWORD Eip; + DWORD SegCs; + DWORD EFlags; + DWORD Esp; + DWORD SegSs; +} CONTEXT, *PCONTEXT, *LPCONTEXT; + +#else /* __ppc__ */ + +typedef struct + { + /* Floating point registers returned when CONTEXT_FLOATING_POINT is set */ + double Fpr0; + double Fpr1; + double Fpr2; + double Fpr3; + double Fpr4; + double Fpr5; + double Fpr6; + double Fpr7; + double Fpr8; + double Fpr9; + double Fpr10; + double Fpr11; + double Fpr12; + double Fpr13; + double Fpr14; + double Fpr15; + double Fpr16; + double Fpr17; + double Fpr18; + double Fpr19; + double Fpr20; + double Fpr21; + double Fpr22; + double Fpr23; + double Fpr24; + double Fpr25; + double Fpr26; + double Fpr27; + double Fpr28; + double Fpr29; + double Fpr30; + double Fpr31; + double Fpscr; + + /* Integer registers returned when CONTEXT_INTEGER is set. */ + DWORD Gpr0; + DWORD Gpr1; + DWORD Gpr2; + DWORD Gpr3; + DWORD Gpr4; + DWORD Gpr5; + DWORD Gpr6; + DWORD Gpr7; + DWORD Gpr8; + DWORD Gpr9; + DWORD Gpr10; + DWORD Gpr11; + DWORD Gpr12; + DWORD Gpr13; + DWORD Gpr14; + DWORD Gpr15; + DWORD Gpr16; + DWORD Gpr17; + DWORD Gpr18; + DWORD Gpr19; + DWORD Gpr20; + DWORD Gpr21; + DWORD Gpr22; + DWORD Gpr23; + DWORD Gpr24; + DWORD Gpr25; + DWORD Gpr26; + DWORD Gpr27; + DWORD Gpr28; + DWORD Gpr29; + DWORD Gpr30; + DWORD Gpr31; + + DWORD Cr; /* Condition register */ + DWORD Xer; /* Fixed point exception register */ + + /* The following are set when CONTEXT_CONTROL is set. */ + DWORD Msr; /* Machine status register */ + DWORD Iar; /* Instruction address register */ + DWORD Lr; /* Link register */ + DWORD Ctr; /* Control register */ + + /* Control which context values are returned */ + DWORD ContextFlags; + DWORD Fill[3]; + + /* Registers returned if CONTEXT_DEBUG_REGISTERS is set. */ + DWORD Dr0; /* Breakpoint Register 1 */ + DWORD Dr1; /* Breakpoint Register 2 */ + DWORD Dr2; /* Breakpoint Register 3 */ + DWORD Dr3; /* Breakpoint Register 4 */ + DWORD Dr4; /* Breakpoint Register 5 */ + DWORD Dr5; /* Breakpoint Register 6 */ + DWORD Dr6; /* Debug Status Register */ + DWORD Dr7; /* Debug Control Register */ +} CONTEXT, *PCONTEXT, *LPCONTEXT; +#endif + +typedef HANDLE *PHANDLE; + +typedef struct value_ent { + LPWSTR ve_valuename; + DWORD ve_valuelen; + DWORD ve_valueptr; + DWORD ve_type; +} WVALENT, *PWVALENT; + + +typedef const void *LPCVOID; +typedef BYTE *LPBYTE, *PBYTE; + +typedef BOOL *PBOOL; + +typedef DWORD LCID; +typedef DWORD *PLCID; + +typedef const char *LPCSTR; + +typedef char *LPSTR; + +typedef const unsigned short *LPCWSTR; + +typedef unsigned short RTL_ATOM; +typedef unsigned short *PRTL_ATOM; +typedef WORD ATOM; + +typedef struct _COORD { + SHORT X; + SHORT Y; +} COORD; + +typedef struct _SMALL_RECT { + SHORT Left; + SHORT Top; + SHORT Right; + SHORT Bottom; +} SMALL_RECT, *PSMALL_RECT; + + +typedef +VOID +(*PTIMERAPCROUTINE)( + LPVOID lpArgToCompletionRoutine, + DWORD dwTimerLowValue, + DWORD dwTimerHighValue + ); + +#include #endif /* __INCLUDE_ACPI_TYPES_H */ + +#if 0 + + +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/types.h + * PURPOSE: Types used by all the parts of the system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ + +#ifndef __INCLUDE_ACPI_TYPES_H +#define __INCLUDE_ACPI_TYPES_H +#if 0 +typedef unsigned char UCHAR; +#endif +typedef unsigned int UINT; +typedef unsigned long ULONG; +typedef unsigned short USHORT; +typedef unsigned short WCHAR; +typedef unsigned short WORD; +typedef int BOOL; +#if 0 +typedef unsigned char BOOLEAN; +#endif +typedef BOOLEAN* PBOOLEAN; +typedef unsigned int DWORD; /* was unsigned long */ +typedef unsigned short *LPWSTR; +typedef unsigned short *PWSTR; +typedef unsigned char *PUCHAR; +typedef unsigned int *PUINT; +typedef unsigned long *PULONG; +typedef unsigned short *PUSHORT; +typedef void *PVOID; +typedef unsigned char BYTE; +typedef void *LPVOID; +typedef DWORD *PDWORD; +typedef float *PFLOAT; +typedef unsigned short *PWCH; +typedef unsigned short *PWORD; + +typedef long long LONGLONG; +typedef unsigned long long ULONGLONG; +typedef long long *PLONGLONG; +typedef unsigned long long *PULONGLONG; + +/* Check VOID before defining CHAR, SHORT, and LONG */ +#ifndef VOID +#define VOID void +typedef char CHAR; +typedef short SHORT; +typedef long LONG; +#endif + +typedef CHAR *PCHAR; +typedef CHAR *PCH; +typedef void *HANDLE; +typedef char CCHAR; + +#if 0 +#define FALSE 0 +#define TRUE 1 +#endif + +typedef const unsigned short *PCWSTR; + +typedef char* PCSZ; + +typedef union _LARGE_INTEGER +{ + struct + { + DWORD LowPart; + LONG HighPart; + } u; +#ifdef ANONYMOUSUNIONS + struct + { + DWORD LowPart; + LONG HighPart; + }; +#endif /* ANONYMOUSUNIONS */ + LONGLONG QuadPart; +} LARGE_INTEGER, *PLARGE_INTEGER; + +typedef union _ULARGE_INTEGER +{ + struct + { + DWORD LowPart; + DWORD HighPart; + } u; +#ifdef ANONYMOUSUNIONS + struct + { + DWORD LowPart; + DWORD HighPart; + }; +#endif /* ANONYMOUSUNIONS */ + ULONGLONG QuadPart; +} ULARGE_INTEGER, *PULARGE_INTEGER; + +#define CONST const + +#ifdef i386 +#define STDCALL __attribute__ ((stdcall)) +#define CDECL __attribute((cdecl)) +#define CALLBACK WINAPI +#define PASCAL WINAPI +#else +#define STDCALL +#define CDECL +#define CALLBACK +#define PASCAL +#endif + +typedef struct _LIST_ENTRY { + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; +} LIST_ENTRY, *PLIST_ENTRY; + +typedef struct _SINGLE_LIST_ENTRY { + struct _SINGLE_LIST_ENTRY *Next; +} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY; + +typedef DWORD STDCALL (*PTHREAD_START_ROUTINE) (LPVOID); +typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; + +typedef unsigned short *PWCHAR; + +#ifdef __PPC__ +#define CONTEXT_CONTROL 1L +#define CONTEXT_FLOATING_POINT 2L +#define CONTEXT_INTEGER 4L +#define CONTEXT_DEBUG_REGISTERS 8L + +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) +#define CONTEXT_DEBUGGER (CONTEXT_FULL) + +#else /* x86 */ +/* The doc refered me to winnt.h, so I had to look... */ +#define SIZE_OF_80387_REGISTERS 80 + +/* Values for contextflags */ +#define CONTEXT_i386 0x10000 +#define CONTEXT_CONTROL (CONTEXT_i386 | 1) +#define CONTEXT_INTEGER (CONTEXT_i386 | 2) +#define CONTEXT_SEGMENTS (CONTEXT_i386 | 4) +#define CONTEXT_FLOATING_POINT (CONTEXT_i386 | 8) +#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386 | 0x10) +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS) + +/* our own invention */ +#define FLAG_TRACE_BIT 0x100 +#define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT) + +#endif + +#ifdef __i386__ + +typedef struct _FLOATING_SAVE_AREA { + DWORD ControlWord; + DWORD StatusWord; + DWORD TagWord; + DWORD ErrorOffset; + DWORD ErrorSelector; + DWORD DataOffset; + DWORD DataSelector; + BYTE RegisterArea[80]; + DWORD Cr0NpxState; +} FLOATING_SAVE_AREA; + +typedef struct _CONTEXT { + DWORD ContextFlags; + + DWORD Dr0; + DWORD Dr1; + DWORD Dr2; + DWORD Dr3; + DWORD Dr6; + DWORD Dr7; + + FLOATING_SAVE_AREA FloatSave; + + DWORD SegGs; + DWORD SegFs; + DWORD SegEs; + DWORD SegDs; + + DWORD Edi; + DWORD Esi; + DWORD Ebx; + DWORD Edx; + DWORD Ecx; + DWORD Eax; + + DWORD Ebp; + DWORD Eip; + DWORD SegCs; + DWORD EFlags; + DWORD Esp; + DWORD SegSs; +} CONTEXT, *PCONTEXT, *LPCONTEXT; + +#else /* __ppc__ */ + +typedef struct + { + /* Floating point registers returned when CONTEXT_FLOATING_POINT is set */ + double Fpr0; + double Fpr1; + double Fpr2; + double Fpr3; + double Fpr4; + double Fpr5; + double Fpr6; + double Fpr7; + double Fpr8; + double Fpr9; + double Fpr10; + double Fpr11; + double Fpr12; + double Fpr13; + double Fpr14; + double Fpr15; + double Fpr16; + double Fpr17; + double Fpr18; + double Fpr19; + double Fpr20; + double Fpr21; + double Fpr22; + double Fpr23; + double Fpr24; + double Fpr25; + double Fpr26; + double Fpr27; + double Fpr28; + double Fpr29; + double Fpr30; + double Fpr31; + double Fpscr; + + /* Integer registers returned when CONTEXT_INTEGER is set. */ + DWORD Gpr0; + DWORD Gpr1; + DWORD Gpr2; + DWORD Gpr3; + DWORD Gpr4; + DWORD Gpr5; + DWORD Gpr6; + DWORD Gpr7; + DWORD Gpr8; + DWORD Gpr9; + DWORD Gpr10; + DWORD Gpr11; + DWORD Gpr12; + DWORD Gpr13; + DWORD Gpr14; + DWORD Gpr15; + DWORD Gpr16; + DWORD Gpr17; + DWORD Gpr18; + DWORD Gpr19; + DWORD Gpr20; + DWORD Gpr21; + DWORD Gpr22; + DWORD Gpr23; + DWORD Gpr24; + DWORD Gpr25; + DWORD Gpr26; + DWORD Gpr27; + DWORD Gpr28; + DWORD Gpr29; + DWORD Gpr30; + DWORD Gpr31; + + DWORD Cr; /* Condition register */ + DWORD Xer; /* Fixed point exception register */ + + /* The following are set when CONTEXT_CONTROL is set. */ + DWORD Msr; /* Machine status register */ + DWORD Iar; /* Instruction address register */ + DWORD Lr; /* Link register */ + DWORD Ctr; /* Control register */ + + /* Control which context values are returned */ + DWORD ContextFlags; + DWORD Fill[3]; + + /* Registers returned if CONTEXT_DEBUG_REGISTERS is set. */ + DWORD Dr0; /* Breakpoint Register 1 */ + DWORD Dr1; /* Breakpoint Register 2 */ + DWORD Dr2; /* Breakpoint Register 3 */ + DWORD Dr3; /* Breakpoint Register 4 */ + DWORD Dr4; /* Breakpoint Register 5 */ + DWORD Dr5; /* Breakpoint Register 6 */ + DWORD Dr6; /* Debug Status Register */ + DWORD Dr7; /* Debug Control Register */ +} CONTEXT, *PCONTEXT, *LPCONTEXT; +#endif + +typedef HANDLE *PHANDLE; + +typedef struct value_ent { + LPWSTR ve_valuename; + DWORD ve_valuelen; + DWORD ve_valueptr; + DWORD ve_type; +} WVALENT, *PWVALENT; + +typedef long *PLONG; + +typedef const void *LPCVOID; +typedef BYTE *LPBYTE; + +typedef BYTE *PBYTE; + +typedef DWORD LCID; +typedef DWORD *PLCID; + +typedef const char *LPCSTR; + +typedef char *LPSTR; + +typedef const unsigned short *LPCWSTR; + +typedef unsigned short RTL_ATOM; +typedef unsigned short *PRTL_ATOM; +typedef WORD ATOM; + +typedef struct _COORD { + SHORT X; + SHORT Y; +} COORD; + +typedef struct _SMALL_RECT { + SHORT Left; + SHORT Top; + SHORT Right; + SHORT Bottom; +} SMALL_RECT, *PSMALL_RECT; + + +typedef +VOID +(*PTIMERAPCROUTINE)( + LPVOID lpArgToCompletionRoutine, + DWORD dwTimerLowValue, + DWORD dwTimerHighValue + ); + +#include + +#endif /* __INCLUDE_ACPI_TYPES_H */ + +#endif + diff --git a/reactos/drivers/bus/acpi/makefile b/reactos/drivers/bus/acpi/makefile index b62d04607d3..4fa295b3c04 100644 --- a/reactos/drivers/bus/acpi/makefile +++ b/reactos/drivers/bus/acpi/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.8 2002/09/07 15:11:56 chorns Exp $ +# $Id: makefile,v 1.9 2002/09/08 10:22:02 chorns Exp $ PATH_TO_TOP = ../../.. @@ -6,7 +6,7 @@ TARGET_TYPE = driver TARGET_NAME = acpi -TARGET_CFLAGS = -I./include -I./ospm/include -I$(PATH_TO_TOP)/include +TARGET_CFLAGS = -I./include -I./ospm/include OBJECTS_PATH = objects diff --git a/reactos/drivers/bus/acpi/ospm/include/acpisys.h b/reactos/drivers/bus/acpi/ospm/include/acpisys.h index 68ae930b20b..e8f4f85179a 100644 --- a/reactos/drivers/bus/acpi/ospm/include/acpisys.h +++ b/reactos/drivers/bus/acpi/ospm/include/acpisys.h @@ -4,8 +4,11 @@ * PURPOSE: ACPI bus driver definitions */ #define ACPI_DEBUG -#include #include +#define __INCLUDE_TYPES_H +#include +#undef ROUND_UP +#include #include typedef ACPI_STATUS (*ACPI_DRIVER_FUNCTION)(VOID); diff --git a/reactos/drivers/bus/isapnp/isapnp.c b/reactos/drivers/bus/isapnp/isapnp.c index d875b7cbef9..894fef4feee 100644 --- a/reactos/drivers/bus/isapnp/isapnp.c +++ b/reactos/drivers/bus/isapnp/isapnp.c @@ -1,4 +1,4 @@ -/* $Id: isapnp.c,v 1.3 2002/09/07 15:11:57 chorns Exp $ +/* $Id: isapnp.c,v 1.4 2002/09/08 10:22:03 chorns Exp $ * * PROJECT: ReactOS ISA PnP Bus driver * FILE: isapnp.c @@ -925,7 +925,7 @@ static BOOLEAN CreateLogicalDevice(PISAPNP_DEVICE_EXTENSION DeviceExtension, PISAPNP_LOGICAL_DEVICE LogicalDevice; BOOLEAN Small; ULONG Priority = 0; - ULONG Option = IO_RESOURCE_DEFAULT; + ULONG Option = IO_RESOURCE_REQUIRED; DPRINT("Card %d Size %d\n", Card->CardId, Size); @@ -955,7 +955,7 @@ static BOOLEAN CreateLogicalDevice(PISAPNP_DEVICE_EXTENSION DeviceExtension, skip = 1; } Priority = 0; - Option = IO_RESOURCE_DEFAULT; + Option = IO_RESOURCE_REQUIRED; compat = 0; break; @@ -1011,7 +1011,7 @@ static BOOLEAN CreateLogicalDevice(PISAPNP_DEVICE_EXTENSION DeviceExtension, if (Size != 0) goto skip; Priority = 0; - Option = IO_RESOURCE_DEFAULT; + Option = IO_RESOURCE_REQUIRED; LogicalDevice->CurrentDescriptorCount = 0; break; @@ -1558,7 +1558,7 @@ ISAPNPDispatchOpenClose( DPRINT("Called\n"); Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; + Irp->IoStatus.Information = FILE_OPENED; IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; diff --git a/reactos/drivers/bus/isapnp/isapnp.rc b/reactos/drivers/bus/isapnp/isapnp.rc index 84adf3da0da..205420a16fa 100644 --- a/reactos/drivers/bus/isapnp/isapnp.rc +++ b/reactos/drivers/bus/isapnp/isapnp.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/bus/pci/pci.rc b/reactos/drivers/bus/pci/pci.rc index 4122c745928..e21a994aba6 100644 --- a/reactos/drivers/bus/pci/pci.rc +++ b/reactos/drivers/bus/pci/pci.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/dd/beep/beep.c b/reactos/drivers/dd/beep/beep.c index 25fc093ca98..f277c62a707 100644 --- a/reactos/drivers/dd/beep/beep.c +++ b/reactos/drivers/dd/beep/beep.c @@ -1,4 +1,4 @@ -/* $Id: beep.c,v 1.13 2002/09/07 15:11:58 chorns Exp $ +/* $Id: beep.c,v 1.14 2002/09/08 10:22:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,8 +12,7 @@ /* INCLUDES ****************************************************************/ -#define NTOS_KERNEL_MODE -#include +#include #include #define NDEBUG diff --git a/reactos/drivers/dd/beep/beep.rc b/reactos/drivers/dd/beep/beep.rc index 30180d677e8..c48ff212574 100644 --- a/reactos/drivers/dd/beep/beep.rc +++ b/reactos/drivers/dd/beep/beep.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/dd/blue/blue.c b/reactos/drivers/dd/blue/blue.c index c070b5460a9..85be356e6a0 100644 --- a/reactos/drivers/dd/blue/blue.c +++ b/reactos/drivers/dd/blue/blue.c @@ -1,4 +1,4 @@ -/* $Id: blue.c,v 1.34 2002/09/07 15:11:58 chorns Exp $ +/* $Id: blue.c,v 1.35 2002/09/08 10:22:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,9 +11,10 @@ /* INCLUDES ******************************************************************/ -#define NTOS_KERNEL_MODE -#include +#include +#include #include +#include #define NDEBUG #include diff --git a/reactos/drivers/dd/blue/blue.rc b/reactos/drivers/dd/blue/blue.rc index d69fef232ee..dafbe1fe23e 100644 --- a/reactos/drivers/dd/blue/blue.rc +++ b/reactos/drivers/dd/blue/blue.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/dd/floppy/floppy.c b/reactos/drivers/dd/floppy/floppy.c index cec01cba150..573a058d5fe 100644 --- a/reactos/drivers/dd/floppy/floppy.c +++ b/reactos/drivers/dd/floppy/floppy.c @@ -15,7 +15,6 @@ */ #include -#include #include "floppy.h" #define NDEBUG @@ -102,7 +101,7 @@ FloppyCreateController(PDRIVER_OBJECT DriverObject, DeviceDescription.Master = FALSE; DeviceDescription.ScatterGather = FALSE; DeviceDescription.AutoInitialize = FALSE; - DeviceDescription.Dma32BitAddresses = FALSE; + DeviceDescription.Dma32BitAddress = FALSE; DeviceDescription.DmaChannel = ControllerParameters->DmaChannel; DeviceDescription.InterfaceType = Isa; // DeviceDescription.DmaWidth = Width8Bits; @@ -123,7 +122,7 @@ FloppyCreateController(PDRIVER_OBJECT DriverObject, #endif /* FIXME: Let's assume one drive and one controller for the moment */ - RtlInitUnicodeString(&DeviceName, L"\\Device\\Floppy0"); + RtlInitUnicodeStringFromLiteral(&DeviceName, L"\\Device\\Floppy0"); Status = IoCreateDevice(DriverObject, sizeof(FLOPPY_DEVICE_EXTENSION), &DeviceName, @@ -217,7 +216,7 @@ FloppyCreateController(PDRIVER_OBJECT DriverObject, CHECKPOINT; Status = IoAllocateAdapterChannel( ControllerExtension->AdapterObject, DeviceObject, - 0x3000/PAGE_SIZE, // max track size is 12k + 0x3000/PAGESIZE, // max track size is 12k FloppyAdapterControl, ControllerExtension ); if( !NT_SUCCESS( Status ) ) diff --git a/reactos/drivers/dd/floppy/floppy.rc b/reactos/drivers/dd/floppy/floppy.rc index 7afc7983cef..61da49f2e1e 100644 --- a/reactos/drivers/dd/floppy/floppy.rc +++ b/reactos/drivers/dd/floppy/floppy.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/dd/ide/ide.c b/reactos/drivers/dd/ide/ide.c index 5c54e5ac0bd..3f85a0eeafc 100644 --- a/reactos/drivers/dd/ide/ide.c +++ b/reactos/drivers/dd/ide/ide.c @@ -1,4 +1,4 @@ -/* $Id: ide.c,v 1.55 2002/09/07 15:11:58 chorns Exp $ +/* $Id: ide.c,v 1.56 2002/09/08 10:22:04 chorns Exp $ * * IDE.C - IDE Disk driver * written by Rex Jolliff @@ -68,7 +68,6 @@ // ------------------------------------------------------------------------- #include -#include #define NDEBUG #include diff --git a/reactos/drivers/dd/ide/ide.rc b/reactos/drivers/dd/ide/ide.rc index 1375186feb3..5981746c951 100644 --- a/reactos/drivers/dd/ide/ide.rc +++ b/reactos/drivers/dd/ide/ide.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/dd/null/null.c b/reactos/drivers/dd/null/null.c index 64d319ee413..15d3ed20961 100644 --- a/reactos/drivers/dd/null/null.c +++ b/reactos/drivers/dd/null/null.c @@ -1,4 +1,4 @@ -/* $Id: null.c,v 1.9 2002/09/07 15:11:58 chorns Exp $ +/* $Id: null.c,v 1.10 2002/09/08 10:22:05 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -113,7 +113,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) DriverObject->DriverUnload = NullUnload; /* create null device */ - RtlInitUnicodeString(&wstrDeviceName, L"\\Device\\Null"); + RtlInitUnicodeStringFromLiteral(&wstrDeviceName, L"\\Device\\Null"); nErrCode = IoCreateDevice ( @@ -135,7 +135,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) pdoNullDevice->DeviceExtension = (PVOID)&nxNull; /* create zero device */ - RtlInitUnicodeString(&wstrDeviceName, L"\\Device\\Zero"); + RtlInitUnicodeStringFromLiteral(&wstrDeviceName, L"\\Device\\Zero"); nErrCode = IoCreateDevice ( diff --git a/reactos/drivers/dd/null/null.rc b/reactos/drivers/dd/null/null.rc index a50417e18c6..5a61bc9d7f8 100644 --- a/reactos/drivers/dd/null/null.rc +++ b/reactos/drivers/dd/null/null.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/dd/parallel/parallel.rc b/reactos/drivers/dd/parallel/parallel.rc index 354d234d4a3..b0e6298b0df 100644 --- a/reactos/drivers/dd/parallel/parallel.rc +++ b/reactos/drivers/dd/parallel/parallel.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US @@ -35,3 +36,4 @@ BEGIN VALUE "Translation", 0x409, 1200 END END + diff --git a/reactos/drivers/dd/ramdrv/makefile b/reactos/drivers/dd/ramdrv/makefile index 60da3949b14..c221104325a 100644 --- a/reactos/drivers/dd/ramdrv/makefile +++ b/reactos/drivers/dd/ramdrv/makefile @@ -1,6 +1,6 @@ -# $Id: makefile,v 1.8 2002/09/07 15:11:59 chorns Exp $ +# $Id: makefile,v 1.9 2002/09/08 10:22:05 chorns Exp $ -# $Id: makefile,v 1.8 2002/09/07 15:11:59 chorns Exp $ +# $Id: makefile,v 1.9 2002/09/08 10:22:05 chorns Exp $ PATH_TO_TOP = ../../.. @@ -12,7 +12,9 @@ TARGET_OBJECTS = ramdrv.o TARGET_DDKLIBS = unbzip2.a -TARGET_CFLAGS=-I$(PATH_TO_TOP)/ntoskrnl/include -g +TARGET_NORC = yes + +TARGET_CFLAGS=-I../../../ntoskrnl/include -g include $(PATH_TO_TOP)/rules.mak diff --git a/reactos/drivers/dd/ramdrv/ramdrv.c b/reactos/drivers/dd/ramdrv/ramdrv.c index 8bcea860091..1219ae3585c 100644 --- a/reactos/drivers/dd/ramdrv/ramdrv.c +++ b/reactos/drivers/dd/ramdrv/ramdrv.c @@ -1,4 +1,4 @@ -#include +#include #include "ramdrv.h" #include #include "../../lib/bzip2/bzlib.h" diff --git a/reactos/drivers/dd/serial/serial.rc b/reactos/drivers/dd/serial/serial.rc index d88522a5697..1b1b9fab779 100644 --- a/reactos/drivers/dd/serial/serial.rc +++ b/reactos/drivers/dd/serial/serial.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/dd/vga/display/main/enable.c b/reactos/drivers/dd/vga/display/main/enable.c index f5abdc1fff3..972ae98e66e 100644 --- a/reactos/drivers/dd/vga/display/main/enable.c +++ b/reactos/drivers/dd/vga/display/main/enable.c @@ -1,9 +1,9 @@ /* * entry.c * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * $Author: chorns $ - * $Date: 2002/09/07 15:11:59 $ + * $Date: 2002/09/08 10:22:07 $ * */ @@ -74,7 +74,7 @@ DrvEnableDriver(IN ULONG EngineVersion, DriveEnableData->pdrvfn = FuncList; DriveEnableData->c = sizeof(FuncList) / sizeof(DRVFN); - DriveEnableData->iDriverVersion = DDI_DRIVER_VERSION_NT4; + DriveEnableData->iDriverVersion = DDI_DRIVER_VERSION; return TRUE; } @@ -115,6 +115,7 @@ DrvDisableDriver(VOID) // IN HANDLE Driver handle to KM driver // RETURNS: // DHPDEV a handle to a DPev object + DHPDEV STDCALL DrvEnablePDEV(IN DEVMODEW *DM, IN LPWSTR LogAddress, @@ -124,7 +125,7 @@ DrvEnablePDEV(IN DEVMODEW *DM, OUT ULONG *DevCaps, IN ULONG DevInfoSize, OUT DEVINFO *DI, - IN HDEV hDev, + IN LPWSTR DevDataFile, IN LPWSTR DeviceName, IN HANDLE Driver) { diff --git a/reactos/drivers/dd/vga/display/objects/bitblt.c b/reactos/drivers/dd/vga/display/objects/bitblt.c index adddbb1529c..279e6a78363 100644 --- a/reactos/drivers/dd/vga/display/objects/bitblt.c +++ b/reactos/drivers/dd/vga/display/objects/bitblt.c @@ -1,4 +1,4 @@ -#include +#include #define NDEBUG #include #include "../vgaddi.h" @@ -101,7 +101,7 @@ BOOL VGAtoDIB( // Used by the temporary DFB PDEVSURF TargetSurf; DEVSURF DestDevSurf; - SURFOBJ *TargetBitmapSurf; + PSURFOBJ TargetBitmapSurf; HBITMAP hTargetBitmap; SIZEL InterSize; POINTL ZeroPoint; diff --git a/reactos/drivers/dd/vga/display/objects/pointer.c b/reactos/drivers/dd/vga/display/objects/pointer.c index bde6e31238e..c449c77237c 100644 --- a/reactos/drivers/dd/vga/display/objects/pointer.c +++ b/reactos/drivers/dd/vga/display/objects/pointer.c @@ -35,10 +35,10 @@ BOOL InitPointer(PPDEV ppdev) VOID STDCALL -DrvMovePointer(IN SURFOBJ *pso, +DrvMovePointer(IN PSURFOBJ pso, IN LONG x, IN LONG y, - IN RECTL *prcl) + IN PRECTL prcl) { PPDEV ppdev = (PPDEV)pso->dhpdev; @@ -60,15 +60,15 @@ DrvMovePointer(IN SURFOBJ *pso, ULONG STDCALL -DrvSetPointerShape(SURFOBJ *pso, - SURFOBJ *psoMask, - SURFOBJ *psoColor, - XLATEOBJ *pxlo, +DrvSetPointerShape(PSURFOBJ pso, + PSURFOBJ psoMask, + PSURFOBJ psoColor, + PXLATEOBJ pxlo, LONG xHot, LONG yHot, LONG x, LONG y, - RECTL *prcl, + PRECTL prcl, ULONG fl) { PPDEV ppdev = (PPDEV)pso->dhpdev; diff --git a/reactos/drivers/dd/vga/display/objects/transblt.c b/reactos/drivers/dd/vga/display/objects/transblt.c index 165ef9ffb30..f4f8fd203e3 100644 --- a/reactos/drivers/dd/vga/display/objects/transblt.c +++ b/reactos/drivers/dd/vga/display/objects/transblt.c @@ -1,4 +1,4 @@ -#include +#include #define NDEBUG #include #include "../vgaddi.h" @@ -7,12 +7,12 @@ #include "bitblt.h" BOOL STDCALL -DrvTransparentBlt(SURFOBJ *Dest, - SURFOBJ *Source, - CLIPOBJ *Clip, - XLATEOBJ *ColorTranslation, - RECTL *DestRect, - RECTL *SourceRect, +DrvTransparentBlt(PSURFOBJ Dest, + PSURFOBJ Source, + PCLIPOBJ Clip, + PXLATEOBJ ColorTranslation, + PRECTL DestRect, + PRECTL SourceRect, ULONG TransparentColor, ULONG Reserved) { diff --git a/reactos/drivers/dd/vga/display/vgaddi.h b/reactos/drivers/dd/vga/display/vgaddi.h index 470071f2823..ce1d05659f2 100644 --- a/reactos/drivers/dd/vga/display/vgaddi.h +++ b/reactos/drivers/dd/vga/display/vgaddi.h @@ -1,6 +1,6 @@ #include #include -#include +#include HANDLE GdiHeap; diff --git a/reactos/drivers/dd/vga/display/vgaddi.rc b/reactos/drivers/dd/vga/display/vgaddi.rc index daa797a38d5..5c34e3dc5ab 100644 --- a/reactos/drivers/dd/vga/display/vgaddi.rc +++ b/reactos/drivers/dd/vga/display/vgaddi.rc @@ -1,5 +1,5 @@ -#include -#include +#include "../../../../include/defines.h" +#include "../../../../include/reactos/resource.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/dd/vga/display/vgavideo/vgavideo.c b/reactos/drivers/dd/vga/display/vgavideo/vgavideo.c index 17272ea1c70..34c509078b2 100644 --- a/reactos/drivers/dd/vga/display/vgavideo/vgavideo.c +++ b/reactos/drivers/dd/vga/display/vgavideo/vgavideo.c @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include "vgavideo.h" diff --git a/reactos/drivers/dd/vga/display/vgavideo/vgavideo.h b/reactos/drivers/dd/vga/display/vgavideo/vgavideo.h index 3c7a0d999a4..c3bb59d8c65 100644 --- a/reactos/drivers/dd/vga/display/vgavideo/vgavideo.h +++ b/reactos/drivers/dd/vga/display/vgavideo/vgavideo.h @@ -7,7 +7,8 @@ #define VGA_OR 16 #define VGA_XOR 24 -typedef struct { int quot, rem; } div_t; +//This is in mingw standard headers +//typedef struct { int quot, rem; } div_t; int maskbit[640], y80[480], xconv[640], bit8[640], startmasks[8], endmasks[8]; diff --git a/reactos/drivers/dd/vga/miniport/initvga.c b/reactos/drivers/dd/vga/miniport/initvga.c index 16bc25f1690..212efcc7490 100644 --- a/reactos/drivers/dd/vga/miniport/initvga.c +++ b/reactos/drivers/dd/vga/miniport/initvga.c @@ -1,7 +1,4 @@ -#define NTOS_KERNEL_MODE -#include -#include -#include +#include #include #include "vgavideo.h" @@ -71,7 +68,7 @@ void InitVGAMode() { int i; VIDEO_X86_BIOS_ARGUMENTS vxba; - NTSTATUS vps; + VP_STATUS vps; // FIXME: Use Vidport to map the memory properly vidmem = (char *)(0xd0000000 + 0xa0000); @@ -105,7 +102,7 @@ VOID VGAResetDevice(OUT PSTATUS_BLOCK StatusBlock) UNICODE_STRING Name = UNICODE_STRING_INITIALIZER(L"\\TextConsoleRefreshEvent"); NTSTATUS Status; VIDEO_X86_BIOS_ARGUMENTS vxba; - NTSTATUS vps; + VP_STATUS vps; ULONG ThreadRelease = 1; CHECKPOINT; @@ -126,3 +123,6 @@ VOID VGAResetDevice(OUT PSTATUS_BLOCK StatusBlock) ZwClose( Event ); } } + + + diff --git a/reactos/drivers/dd/vga/miniport/vgamp.c b/reactos/drivers/dd/vga/miniport/vgamp.c index 5c2afc7698d..8dd9ba31662 100644 --- a/reactos/drivers/dd/vga/miniport/vgamp.c +++ b/reactos/drivers/dd/vga/miniport/vgamp.c @@ -3,10 +3,8 @@ * */ -#define NTOS_KERNEL_MODE -#include -#include -#include +#include +#include #define UNIMPLEMENTED do {DbgPrint("%s:%d: Function not implemented", __FILE__, __LINE__); for(;;);} while (0) diff --git a/reactos/drivers/dd/vga/miniport/vgamp.rc b/reactos/drivers/dd/vga/miniport/vgamp.rc index 560410f8d91..b9c24bd7aff 100644 --- a/reactos/drivers/dd/vga/miniport/vgamp.rc +++ b/reactos/drivers/dd/vga/miniport/vgamp.rc @@ -1,5 +1,5 @@ -#include -#include +#include "../../../../include/defines.h" +#include "../../../../include/reactos/resource.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/dd/vga/miniport/vgavideo.h b/reactos/drivers/dd/vga/miniport/vgavideo.h index 73334a3c7d4..9fb566b61dc 100644 --- a/reactos/drivers/dd/vga/miniport/vgavideo.h +++ b/reactos/drivers/dd/vga/miniport/vgavideo.h @@ -1,13 +1,12 @@ -#define NTOS_KERNEL_MODE -#include -#include -#include +#include +#include #define VGA_NORMAL 0 #define VGA_AND 8 #define VGA_OR 16 #define VGA_XOR 24 +//This is in mingw standard headers //typedef struct { int quot, rem; } div_t; int maskbit[640], y80[480], xconv[640], bit8[640], startmasks[8], endmasks[8]; diff --git a/reactos/drivers/dd/vidport/vidport.c b/reactos/drivers/dd/vidport/vidport.c index 903595dc80d..a220d558846 100644 --- a/reactos/drivers/dd/vidport/vidport.c +++ b/reactos/drivers/dd/vidport/vidport.c @@ -1,12 +1,12 @@ -/* $Id: vidport.c,v 1.24 2002/09/07 15:12:00 chorns Exp $ +/* $Id: vidport.c,v 1.25 2002/09/08 10:22:08 chorns Exp $ * * VideoPort driver * Written by Rex Jolliff */ -#define NTOS_KERNEL_MODE -#include -#include +#include +#include + #include "../../../ntoskrnl/include/internal/v86m.h" #include "vidport.h" @@ -792,7 +792,7 @@ VidDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject, vrp->OutputBufferLength = IrpStack->Parameters.DeviceIoControl.OutputBufferLength; // Call the Miniport Driver with the VRP - ((PDRIVER_STARTIO)DeviceObject->DriverObject->DriverStartIo)(DeviceObject->DeviceExtension, (PIRP)vrp); + DeviceObject->DriverObject->DriverStartIo(DeviceObject->DeviceExtension, (PIRP)vrp); // Translate the VRP back into the IRP for OutputBuffer Irp->UserBuffer = vrp->OutputBuffer; diff --git a/reactos/drivers/dd/vidport/vidport.rc b/reactos/drivers/dd/vidport/vidport.rc index 29083eb66dc..92f19089948 100644 --- a/reactos/drivers/dd/vidport/vidport.rc +++ b/reactos/drivers/dd/vidport/vidport.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/fs/cdfs/cdfs.h b/reactos/drivers/fs/cdfs/cdfs.h index 67c76608a3e..11487f90072 100644 --- a/reactos/drivers/fs/cdfs/cdfs.h +++ b/reactos/drivers/fs/cdfs/cdfs.h @@ -1,12 +1,8 @@ #ifndef CDFS_H #define CDFS_H -#define NTOS_KERNEL_MODE -#include #include -#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) - #define CDFS_BASIC_SECTOR 2048 #define CDFS_PRIMARY_DESCRIPTOR_LOCATION 16 #define BLOCKSIZE CDFS_BASIC_SECTOR @@ -206,9 +202,7 @@ typedef struct _CCB ULONG LastOffset; } CCB, *PCCB; -#ifndef TAG #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) -#endif #define TAG_CCB TAG('I', 'C', 'C', 'B') @@ -350,7 +344,7 @@ CdfsSwapString(PWCHAR Out, VOID CdfsDateTimeToFileTime(PFCB Fcb, - LARGE_INTEGER *FileTime); + TIME *FileTime); VOID CdfsFileFlagsToAttributes(PFCB Fcb, diff --git a/reactos/drivers/fs/cdfs/cdfs.rc b/reactos/drivers/fs/cdfs/cdfs.rc index 1237f6a758c..4c9fb194091 100644 --- a/reactos/drivers/fs/cdfs/cdfs.rc +++ b/reactos/drivers/fs/cdfs/cdfs.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/fs/cdfs/create.c b/reactos/drivers/fs/cdfs/create.c index 4eaa86b222e..7d6e08891e9 100644 --- a/reactos/drivers/fs/cdfs/create.c +++ b/reactos/drivers/fs/cdfs/create.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: create.c,v 1.5 2002/09/07 15:12:00 chorns Exp $ +/* $Id: create.c,v 1.6 2002/09/08 10:22:08 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -243,4 +243,4 @@ ByeBye: return(Status); } -/* EOF */ +/* EOF */ \ No newline at end of file diff --git a/reactos/drivers/fs/cdfs/dirctl.c b/reactos/drivers/fs/cdfs/dirctl.c index 939e6129396..2b5bd360a7e 100644 --- a/reactos/drivers/fs/cdfs/dirctl.c +++ b/reactos/drivers/fs/cdfs/dirctl.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dirctl.c,v 1.8 2002/09/07 15:12:00 chorns Exp $ +/* $Id: dirctl.c,v 1.9 2002/09/08 10:22:08 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -518,14 +518,14 @@ CdfsQueryDirectory(PDEVICE_OBJECT DeviceObject, PCCB Ccb; FCB TempFcb; BOOLEAN First = FALSE; - PEXTENDED_IO_STACK_LOCATION Stack; + PIO_STACK_LOCATION Stack; PFILE_OBJECT FileObject; NTSTATUS Status = STATUS_SUCCESS; DPRINT("CdfsQueryDirectory() called\n"); DeviceExtension = DeviceObject->DeviceExtension; - Stack = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp); + Stack = IoGetCurrentIrpStackLocation(Irp); FileObject = Stack->FileObject; Ccb = (PCCB)FileObject->FsContext2; diff --git a/reactos/drivers/fs/cdfs/fcb.c b/reactos/drivers/fs/cdfs/fcb.c index a38e2df7800..d796acc7445 100644 --- a/reactos/drivers/fs/cdfs/fcb.c +++ b/reactos/drivers/fs/cdfs/fcb.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: fcb.c,v 1.8 2002/09/07 15:12:00 chorns Exp $ +/* $Id: fcb.c,v 1.9 2002/09/08 10:22:09 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -38,10 +38,7 @@ /* MACROS *******************************************************************/ -#ifndef TAG #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) -#endif - #define TAG_FCB TAG('I', 'F', 'C', 'B') #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) @@ -240,7 +237,7 @@ CdfsFCBInitializeCache(PVCB Vcb, FileObject->Flags = FileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ; - FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers; + FileObject->SectionObjectPointers = &Fcb->SectionObjectPointers; FileObject->FsContext = (PVOID) &Fcb->RFCB; FileObject->FsContext2 = newCCB; newCCB->Fcb = Fcb; @@ -250,7 +247,7 @@ CdfsFCBInitializeCache(PVCB Vcb, Status = CcRosInitializeFileCache(FileObject, &Fcb->RFCB.Bcb, - PAGE_SIZE); + PAGESIZE); if (!NT_SUCCESS(Status)) { DbgPrint("CcRosInitializeFileCache failed\n"); @@ -417,7 +414,7 @@ CdfsAttachFCBToFileObject(PDEVICE_EXTENSION Vcb, FileObject->Flags = FileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ; - FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers; + FileObject->SectionObjectPointers = &Fcb->SectionObjectPointers; FileObject->FsContext = (PVOID)&Fcb->RFCB; FileObject->FsContext2 = newCCB; newCCB->Fcb = Fcb; @@ -428,7 +425,7 @@ CdfsAttachFCBToFileObject(PDEVICE_EXTENSION Vcb, { Status = CcRosInitializeFileCache(FileObject, &Fcb->RFCB.Bcb, - PAGE_SIZE); + PAGESIZE); if (!NT_SUCCESS(Status)) { DbgPrint("CcRosInitializeFileCache failed\n"); diff --git a/reactos/drivers/fs/cdfs/fsctl.c b/reactos/drivers/fs/cdfs/fsctl.c index 8bf020c2be0..7cb1b8e2e06 100644 --- a/reactos/drivers/fs/cdfs/fsctl.c +++ b/reactos/drivers/fs/cdfs/fsctl.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: fsctl.c,v 1.8 2002/09/07 15:12:00 chorns Exp $ +/* $Id: fsctl.c,v 1.9 2002/09/08 10:22:09 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -70,7 +70,7 @@ CdfsGetPVDData(PUCHAR Buffer, /* Extract the volume label */ pc = Pvd->VolumeId; pw = Vpb->VolumeLabel; - for (i = 0; i < (MAXIMUM_VOLUME_LABEL_LENGTH / sizeof(WCHAR)) && *pc != ' '; i++) + for (i = 0; i < MAXIMUM_VOLUME_LABEL_LENGTH && *pc != ' '; i++) { *pw++ = (WCHAR)*pc++; } @@ -327,7 +327,7 @@ CdfsMountVolume(PDEVICE_OBJECT DeviceObject, DeviceExt->StreamFileObject->Flags = DeviceExt->StreamFileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ; DeviceExt->StreamFileObject->FsContext = (PVOID)&Fcb->RFCB; DeviceExt->StreamFileObject->FsContext2 = Ccb; - DeviceExt->StreamFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers; + DeviceExt->StreamFileObject->SectionObjectPointers = &Fcb->SectionObjectPointers; DeviceExt->StreamFileObject->PrivateCacheMap = NULL; DeviceExt->StreamFileObject->Vpb = DeviceExt->Vpb; Ccb->Fcb = Fcb; @@ -346,7 +346,7 @@ CdfsMountVolume(PDEVICE_OBJECT DeviceObject, Status = CcRosInitializeFileCache(DeviceExt->StreamFileObject, &Fcb->RFCB.Bcb, - PAGE_SIZE); + PAGESIZE); if (!NT_SUCCESS (Status)) { DbgPrint("CcRosInitializeFileCache failed\n"); diff --git a/reactos/drivers/fs/cdfs/misc.c b/reactos/drivers/fs/cdfs/misc.c index f6317a9e309..3f86186969a 100644 --- a/reactos/drivers/fs/cdfs/misc.c +++ b/reactos/drivers/fs/cdfs/misc.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: misc.c,v 1.3 2002/09/07 15:12:01 chorns Exp $ +/* $Id: misc.c,v 1.4 2002/09/08 10:22:09 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -103,7 +103,7 @@ CdfsSwapString(PWCHAR Out, VOID CdfsDateTimeToFileTime(PFCB Fcb, - LARGE_INTEGER *FileTime) + TIME *FileTime) { TIME_FIELDS TimeFields; @@ -134,4 +134,4 @@ CdfsFileFlagsToAttributes(PFCB Fcb, (Fcb->Entry.FileFlags & 0x10) ? FILE_ATTRIBUTE_READONLY : 0; } -/* EOF */ +/* EOF */ \ No newline at end of file diff --git a/reactos/drivers/fs/ext2/ext2fs.rc b/reactos/drivers/fs/ext2/ext2fs.rc index 0a0bb83d771..ab3ab66cd8e 100644 --- a/reactos/drivers/fs/ext2/ext2fs.rc +++ b/reactos/drivers/fs/ext2/ext2fs.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/fs/fs_rec/cdfs.c b/reactos/drivers/fs/fs_rec/cdfs.c index 512ab90dced..a98af26792e 100644 --- a/reactos/drivers/fs/fs_rec/cdfs.c +++ b/reactos/drivers/fs/fs_rec/cdfs.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: cdfs.c,v 1.6 2002/09/07 15:12:01 chorns Exp $ +/* $Id: cdfs.c,v 1.7 2002/09/08 10:22:09 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -28,9 +28,6 @@ /* INCLUDES *****************************************************************/ #include -#include -#include -#include #define NDEBUG #include @@ -122,7 +119,7 @@ FsRecCdfsFsControl(IN PDEVICE_OBJECT DeviceObject, case IRP_MN_LOAD_FILE_SYSTEM: DPRINT("Cdfs: IRP_MN_LOAD_FILE_SYSTEM\n"); - RtlInitUnicodeString(&RegistryPath, + RtlInitUnicodeStringFromLiteral(&RegistryPath, L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Cdfs"); Status = ZwLoadDriver(&RegistryPath); if (!NT_SUCCESS(Status)) diff --git a/reactos/drivers/fs/fs_rec/fat.c b/reactos/drivers/fs/fs_rec/fat.c index d7c0937ef88..3de3344fa90 100644 --- a/reactos/drivers/fs/fs_rec/fat.c +++ b/reactos/drivers/fs/fs_rec/fat.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: fat.c,v 1.5 2002/09/07 15:12:01 chorns Exp $ +/* $Id: fat.c,v 1.6 2002/09/08 10:22:09 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -28,8 +28,6 @@ /* INCLUDES *****************************************************************/ #include -#include -#include #define NDEBUG #include @@ -119,7 +117,7 @@ FsRecVfatFsControl(IN PDEVICE_OBJECT DeviceObject, case IRP_MN_LOAD_FILE_SYSTEM: DPRINT("FAT: IRP_MN_LOAD_FILE_SYSTEM\n"); - RtlInitUnicodeString(&RegistryPath, + RtlInitUnicodeStringFromLiteral(&RegistryPath, L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Vfatfs"); Status = ZwLoadDriver(&RegistryPath); if (!NT_SUCCESS(Status)) diff --git a/reactos/drivers/fs/fs_rec/fs_rec.c b/reactos/drivers/fs/fs_rec/fs_rec.c index b4ce7565fea..bb9474d24d3 100644 --- a/reactos/drivers/fs/fs_rec/fs_rec.c +++ b/reactos/drivers/fs/fs_rec/fs_rec.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: fs_rec.c,v 1.3 2002/09/07 15:12:01 chorns Exp $ +/* $Id: fs_rec.c,v 1.4 2002/09/08 10:22:09 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -28,7 +28,6 @@ /* INCLUDES *****************************************************************/ #include -#include #define NDEBUG #include @@ -151,7 +150,7 @@ FsRecRegisterFs(PDRIVER_OBJECT DriverObject, NULL, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, - FILE_OPEN_IF, + OPEN_EXISTING, 0, NULL, 0); @@ -205,7 +204,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject, ConfigInfo = IoGetConfigurationInformation(); - if (ConfigInfo->CdRomCount > 0) + if (ConfigInfo->CDRomCount > 0) { Status = FsRecRegisterFs(DriverObject, L"\\Cdfs", diff --git a/reactos/drivers/fs/fs_rec/fs_rec.rc b/reactos/drivers/fs/fs_rec/fs_rec.rc index 0ed6a166003..946e3f937a5 100644 --- a/reactos/drivers/fs/fs_rec/fs_rec.rc +++ b/reactos/drivers/fs/fs_rec/fs_rec.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/fs/fs_rec/ntfs.c b/reactos/drivers/fs/fs_rec/ntfs.c index af8a20657cd..caf9544c6b7 100644 --- a/reactos/drivers/fs/fs_rec/ntfs.c +++ b/reactos/drivers/fs/fs_rec/ntfs.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: ntfs.c,v 1.5 2002/09/07 15:12:01 chorns Exp $ +/* $Id: ntfs.c,v 1.6 2002/09/08 10:22:09 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -28,8 +28,6 @@ /* INCLUDES *****************************************************************/ #include -#include -#include #define NDEBUG #include diff --git a/reactos/drivers/fs/minix/minix.rc b/reactos/drivers/fs/minix/minix.rc index b218a0eda4d..37081597650 100644 --- a/reactos/drivers/fs/minix/minix.rc +++ b/reactos/drivers/fs/minix/minix.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/fs/ms/create.c b/reactos/drivers/fs/ms/create.c index cf7f621272f..740eed7cc46 100644 --- a/reactos/drivers/fs/ms/create.c +++ b/reactos/drivers/fs/ms/create.c @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.3 2002/09/07 15:12:02 chorns Exp $ +/* $Id: create.c,v 1.4 2002/09/08 10:22:10 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,6 +9,7 @@ /* INCLUDES ******************************************************************/ +#include #include "msfs.h" #define NDEBUG diff --git a/reactos/drivers/fs/ms/finfo.c b/reactos/drivers/fs/ms/finfo.c index bb96b541103..f9731aa6c2e 100644 --- a/reactos/drivers/fs/ms/finfo.c +++ b/reactos/drivers/fs/ms/finfo.c @@ -1,4 +1,4 @@ -/* $Id: finfo.c,v 1.4 2002/09/07 15:12:02 chorns Exp $ +/* $Id: finfo.c,v 1.5 2002/09/08 10:22:10 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,6 +9,7 @@ /* INCLUDES ******************************************************************/ +#include #include "msfs.h" #define NDEBUG @@ -30,19 +31,19 @@ MsfsQueryMailslotInformation(PMSFS_FCB Fcb, Mailslot = Fcb->Mailslot; - Buffer->MaximumMessageSize = Mailslot->MaxMessageSize; - Buffer->ReadTimeout = Mailslot->TimeOut; + Buffer->MaxMessageSize = Mailslot->MaxMessageSize; + Buffer->Timeout = Mailslot->TimeOut; KeAcquireSpinLock(&Mailslot->MessageListLock, &oldIrql); - Buffer->MessagesAvailable = Mailslot->MessageCount; + Buffer->MessageCount = Mailslot->MessageCount; if (Mailslot->MessageCount == 0) { - Buffer->NextMessageSize = 0; + Buffer->NextSize = 0; } else { /* FIXME: read size of first message (head) */ - Buffer->NextMessageSize = 0; + Buffer->NextSize = 0; } KeReleaseSpinLock(&Mailslot->MessageListLock, oldIrql); @@ -60,7 +61,7 @@ MsfsSetMailslotInformation(PMSFS_FCB Fcb, if (*BufferLength < sizeof(FILE_MAILSLOT_SET_INFORMATION)) return(STATUS_BUFFER_OVERFLOW); - Fcb->Mailslot->TimeOut = Buffer->ReadTimeout; + Fcb->Mailslot->TimeOut = Buffer->Timeout; return(STATUS_SUCCESS); } diff --git a/reactos/drivers/fs/ms/fsctrl.c b/reactos/drivers/fs/ms/fsctrl.c index 2f41a991aae..78979a839ef 100644 --- a/reactos/drivers/fs/ms/fsctrl.c +++ b/reactos/drivers/fs/ms/fsctrl.c @@ -1,4 +1,4 @@ -/* $Id: fsctrl.c,v 1.2 2002/09/07 15:12:02 chorns Exp $ +/* $Id: fsctrl.c,v 1.3 2002/09/08 10:22:10 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,9 +9,10 @@ /* INCLUDES ******************************************************************/ +#include #include "msfs.h" -#define NDEBUG +//#define NDEBUG #include @@ -21,7 +22,7 @@ NTSTATUS STDCALL MsfsFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { - PEXTENDED_IO_STACK_LOCATION IoStack; + PIO_STACK_LOCATION IoStack; PFILE_OBJECT FileObject; PMSFS_MAILSLOT Mailslot; PMSFS_FCB Fcb; @@ -29,14 +30,14 @@ MsfsFileSystemControl(PDEVICE_OBJECT DeviceObject, DPRINT1("MsfsFileSystemControl(DeviceObject %p Irp %p)\n", DeviceObject, Irp); - IoStack = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp); + IoStack = IoGetCurrentIrpStackLocation(Irp); FileObject = IoStack->FileObject; Fcb = FileObject->FsContext; Mailslot = Fcb->Mailslot; DPRINT1("Mailslot name: %wZ\n", &Mailslot->Name); - switch (IoStack->Parameters.FileSystemControl.FsControlCode) + switch (IoStack->Parameters.FileSystemControl.IoControlCode) { #if 0 case FSCTL_WAIT_PIPE: diff --git a/reactos/drivers/fs/ms/msfs.c b/reactos/drivers/fs/ms/msfs.c index f256f9708a5..a61bbcf5565 100644 --- a/reactos/drivers/fs/ms/msfs.c +++ b/reactos/drivers/fs/ms/msfs.c @@ -1,4 +1,4 @@ -/* $Id: msfs.c,v 1.4 2002/09/07 15:12:02 chorns Exp $ +/* $Id: msfs.c,v 1.5 2002/09/08 10:22:10 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,6 +9,7 @@ /* INCLUDES ******************************************************************/ +#include #include "msfs.h" #define NDEBUG diff --git a/reactos/drivers/fs/ms/msfs.h b/reactos/drivers/fs/ms/msfs.h index 87ead7ec241..4f7da5439f7 100644 --- a/reactos/drivers/fs/ms/msfs.h +++ b/reactos/drivers/fs/ms/msfs.h @@ -1,9 +1,6 @@ #ifndef __SERVICES_FS_MS_MSFS_H #define __SERVICES_FS_MS_MSFS_H -#define NTOS_KERNEL_MODE -#include - typedef struct _MSFS_DEVICE_EXTENSION { LIST_ENTRY MailslotListHead; diff --git a/reactos/drivers/fs/ms/msfs.rc b/reactos/drivers/fs/ms/msfs.rc index 4a3b06be74e..a3a164d5428 100644 --- a/reactos/drivers/fs/ms/msfs.rc +++ b/reactos/drivers/fs/ms/msfs.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/fs/ms/rw.c b/reactos/drivers/fs/ms/rw.c index b772f5616f6..ddd2ff0080d 100644 --- a/reactos/drivers/fs/ms/rw.c +++ b/reactos/drivers/fs/ms/rw.c @@ -1,4 +1,4 @@ -/* $Id: rw.c,v 1.3 2002/09/07 15:12:02 chorns Exp $ +/* $Id: rw.c,v 1.4 2002/09/08 10:22:10 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,6 +9,8 @@ /* INCLUDES ******************************************************************/ +#include +#include #include "msfs.h" #define NDEBUG diff --git a/reactos/drivers/fs/mup/mup.rc b/reactos/drivers/fs/mup/mup.rc index 31e0a05f1f8..28189c8f4c4 100644 --- a/reactos/drivers/fs/mup/mup.rc +++ b/reactos/drivers/fs/mup/mup.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/fs/np/create.c b/reactos/drivers/fs/np/create.c index 5d06b0b7ade..ba79d5a73e1 100644 --- a/reactos/drivers/fs/np/create.c +++ b/reactos/drivers/fs/np/create.c @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.13 2002/09/07 15:12:02 chorns Exp $ +/* $Id: create.c,v 1.14 2002/09/08 10:22:11 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,6 +9,8 @@ /* INCLUDES ******************************************************************/ +#include + #include "npfs.h" #define NDEBUG diff --git a/reactos/drivers/fs/np/finfo.c b/reactos/drivers/fs/np/finfo.c index 1989ee1ae64..450f0655523 100644 --- a/reactos/drivers/fs/np/finfo.c +++ b/reactos/drivers/fs/np/finfo.c @@ -1,4 +1,4 @@ -/* $Id: finfo.c,v 1.4 2002/09/07 15:12:02 chorns Exp $ +/* $Id: finfo.c,v 1.5 2002/09/08 10:22:11 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,6 +9,7 @@ /* INCLUDES ******************************************************************/ +#include #include "npfs.h" #define NDEBUG diff --git a/reactos/drivers/fs/np/fsctrl.c b/reactos/drivers/fs/np/fsctrl.c index a82b773cef4..e23818179de 100644 --- a/reactos/drivers/fs/np/fsctrl.c +++ b/reactos/drivers/fs/np/fsctrl.c @@ -1,4 +1,4 @@ -/* $Id: fsctrl.c,v 1.9 2002/09/07 15:12:02 chorns Exp $ +/* $Id: fsctrl.c,v 1.10 2002/09/08 10:22:11 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -10,6 +10,7 @@ /* INCLUDES ******************************************************************/ +#include #include "npfs.h" #define NDEBUG @@ -394,7 +395,7 @@ NTSTATUS STDCALL NpfsFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { - PEXTENDED_IO_STACK_LOCATION IoStack; + PIO_STACK_LOCATION IoStack; PFILE_OBJECT FileObject; NTSTATUS Status; PNPFS_DEVICE_EXTENSION DeviceExt; @@ -404,7 +405,7 @@ NpfsFileSystemControl(PDEVICE_OBJECT DeviceObject, DPRINT("NpfsFileSystemContol(DeviceObject %p Irp %p)\n", DeviceObject, Irp); DeviceExt = (PNPFS_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - IoStack = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp); + IoStack = IoGetCurrentIrpStackLocation(Irp); DPRINT("IoStack: %p\n", IoStack); FileObject = IoStack->FileObject; DPRINT("FileObject: %p\n", FileObject); @@ -414,7 +415,7 @@ NpfsFileSystemControl(PDEVICE_OBJECT DeviceObject, DPRINT("Pipe: %p\n", Pipe); DPRINT("PipeName: %wZ\n", &Pipe->PipeName); - switch (IoStack->Parameters.FileSystemControl.FsControlCode) + switch (IoStack->Parameters.FileSystemControl.IoControlCode) { case FSCTL_PIPE_ASSIGN_EVENT: DPRINT("Assign event\n"); diff --git a/reactos/drivers/fs/np/npfs.c b/reactos/drivers/fs/np/npfs.c index f45ebacf61f..4c8364aa83a 100644 --- a/reactos/drivers/fs/np/npfs.c +++ b/reactos/drivers/fs/np/npfs.c @@ -1,4 +1,4 @@ -/* $Id: npfs.c,v 1.4 2002/09/07 15:12:02 chorns Exp $ +/* $Id: npfs.c,v 1.5 2002/09/08 10:22:11 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,6 +9,7 @@ /* INCLUDES ******************************************************************/ +#include #include "npfs.h" #define NDEBUG diff --git a/reactos/drivers/fs/np/npfs.h b/reactos/drivers/fs/np/npfs.h index 979a3b852cd..46222787ccb 100644 --- a/reactos/drivers/fs/np/npfs.h +++ b/reactos/drivers/fs/np/npfs.h @@ -1,10 +1,8 @@ -/* $Id: npfs.h,v 1.12 2002/09/07 15:12:02 chorns Exp $ */ +/* $Id: npfs.h,v 1.13 2002/09/08 10:22:11 chorns Exp $ */ #ifndef __SERVICES_FS_NP_NPFS_H #define __SERVICES_FS_NP_NPFS_H -#define NTOS_KERNEL_MODE -#include typedef struct { diff --git a/reactos/drivers/fs/np/npfs.rc b/reactos/drivers/fs/np/npfs.rc index d8151ae06aa..d0697996046 100644 --- a/reactos/drivers/fs/np/npfs.rc +++ b/reactos/drivers/fs/np/npfs.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/fs/np/rw.c b/reactos/drivers/fs/np/rw.c index 8e62ff328c9..e722e9d3936 100644 --- a/reactos/drivers/fs/np/rw.c +++ b/reactos/drivers/fs/np/rw.c @@ -1,4 +1,4 @@ -/* $Id: rw.c,v 1.7 2002/09/07 15:12:02 chorns Exp $ +/* $Id: rw.c,v 1.8 2002/09/08 10:22:11 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,6 +9,7 @@ /* INCLUDES ******************************************************************/ +#include #include "npfs.h" #define NDEBUG diff --git a/reactos/drivers/fs/np/volume.c b/reactos/drivers/fs/np/volume.c index 9d95d49145c..23c26b23014 100644 --- a/reactos/drivers/fs/np/volume.c +++ b/reactos/drivers/fs/np/volume.c @@ -1,4 +1,4 @@ -/* $Id: volume.c,v 1.3 2002/09/07 15:12:02 chorns Exp $ +/* $Id: volume.c,v 1.4 2002/09/08 10:22:11 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,6 +9,7 @@ /* INCLUDES *****************************************************************/ +#include #include #define NDEBUG diff --git a/reactos/drivers/fs/ntfs/dirctl.c b/reactos/drivers/fs/ntfs/dirctl.c index 5082cda7a4d..ab15cde4120 100644 --- a/reactos/drivers/fs/ntfs/dirctl.c +++ b/reactos/drivers/fs/ntfs/dirctl.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dirctl.c,v 1.2 2002/09/07 15:12:02 chorns Exp $ +/* $Id: dirctl.c,v 1.3 2002/09/08 10:22:11 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -494,14 +494,14 @@ NtfsQueryDirectory(PDEVICE_OBJECT DeviceObject, PCCB Ccb; FCB TempFcb; BOOLEAN First = FALSE; - PEXTENDED_IO_STACK_LOCATION Stack; + PIO_STACK_LOCATION Stack; PFILE_OBJECT FileObject; NTSTATUS Status = STATUS_SUCCESS; DPRINT1("NtfsQueryDirectory() called\n"); DeviceExtension = DeviceObject->DeviceExtension; - Stack = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp); + Stack = IoGetCurrentIrpStackLocation(Irp); FileObject = Stack->FileObject; Ccb = (PCCB)FileObject->FsContext2; diff --git a/reactos/drivers/fs/ntfs/fcb.c b/reactos/drivers/fs/ntfs/fcb.c index bd34ebe1895..8e4a05b5494 100644 --- a/reactos/drivers/fs/ntfs/fcb.c +++ b/reactos/drivers/fs/ntfs/fcb.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: fcb.c,v 1.2 2002/09/07 15:12:02 chorns Exp $ +/* $Id: fcb.c,v 1.3 2002/09/08 10:22:11 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -235,7 +235,7 @@ NtfsFCBInitializeCache(PVCB Vcb, FileObject->Flags = FileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ; - FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers; + FileObject->SectionObjectPointers = &Fcb->SectionObjectPointers; FileObject->FsContext = (PVOID) &Fcb->RFCB; FileObject->FsContext2 = newCCB; newCCB->Fcb = Fcb; @@ -273,9 +273,9 @@ NtfsMakeRootFCB(PDEVICE_EXTENSION Vcb) // Fcb->Entry.FileFlags = 0x02; // FILE_ATTRIBUTE_DIRECTORY; Fcb->RefCount = 1; Fcb->DirIndex = 0; - Fcb->RFCB.FileSize.QuadPart = PAGE_SIZE;//Vcb->CdInfo.RootSize; - Fcb->RFCB.ValidDataLength.QuadPart = PAGE_SIZE;//Vcb->CdInfo.RootSize; - Fcb->RFCB.AllocationSize.QuadPart = PAGE_SIZE;//Vcb->CdInfo.RootSize; + Fcb->RFCB.FileSize.QuadPart = PAGESIZE;//Vcb->CdInfo.RootSize; + Fcb->RFCB.ValidDataLength.QuadPart = PAGESIZE;//Vcb->CdInfo.RootSize; + Fcb->RFCB.AllocationSize.QuadPart = PAGESIZE;//Vcb->CdInfo.RootSize; NtfsFCBInitializeCache(Vcb, Fcb); NtfsAddFCBToTable(Vcb, Fcb); @@ -408,7 +408,7 @@ NtfsAttachFCBToFileObject(PDEVICE_EXTENSION Vcb, FileObject->Flags = FileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ; - FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers; + FileObject->SectionObjectPointers = &Fcb->SectionObjectPointers; FileObject->FsContext = (PVOID)&Fcb->RFCB; FileObject->FsContext2 = newCCB; newCCB->Fcb = Fcb; diff --git a/reactos/drivers/fs/ntfs/fsctl.c b/reactos/drivers/fs/ntfs/fsctl.c index 33a4fe76b85..c1d4601cc2d 100644 --- a/reactos/drivers/fs/ntfs/fsctl.c +++ b/reactos/drivers/fs/ntfs/fsctl.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: fsctl.c,v 1.3 2002/09/07 15:12:03 chorns Exp $ +/* $Id: fsctl.c,v 1.4 2002/09/08 10:22:11 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -277,7 +277,7 @@ NtfsMountVolume(PDEVICE_OBJECT DeviceObject, DeviceExt->StreamFileObject->Flags = DeviceExt->StreamFileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ; DeviceExt->StreamFileObject->FsContext = (PVOID)&Fcb->RFCB; DeviceExt->StreamFileObject->FsContext2 = Ccb; - DeviceExt->StreamFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers; + DeviceExt->StreamFileObject->SectionObjectPointers = &Fcb->SectionObjectPointers; DeviceExt->StreamFileObject->PrivateCacheMap = NULL; DeviceExt->StreamFileObject->Vpb = DeviceExt->Vpb; Ccb->Fcb = Fcb; diff --git a/reactos/drivers/fs/ntfs/ntfs.h b/reactos/drivers/fs/ntfs/ntfs.h index 884e44e3564..3ea321d38ed 100644 --- a/reactos/drivers/fs/ntfs/ntfs.h +++ b/reactos/drivers/fs/ntfs/ntfs.h @@ -1,14 +1,14 @@ #ifndef NTFS_H #define NTFS_H -#define NTOS_KERNEL_MODE -#include #include #define CACHEPAGESIZE(pDeviceExt) \ - ((pDeviceExt)->NtfsInfo.BytesPerCluster > PAGE_SIZE ? \ - (pDeviceExt)->NtfsInfo.BytesPerCluster : PAGE_SIZE) + ((pDeviceExt)->NtfsInfo.BytesPerCluster > PAGESIZE ? \ + (pDeviceExt)->NtfsInfo.BytesPerCluster : PAGESIZE) + +#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) @@ -118,6 +118,8 @@ typedef struct _CCB ULONG LastOffset; } CCB, *PCCB; +#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) + #define TAG_CCB TAG('I', 'C', 'C', 'B') typedef struct diff --git a/reactos/drivers/fs/ntfs/ntfs.rc b/reactos/drivers/fs/ntfs/ntfs.rc index 99ee0b105a9..ab52053d7d0 100644 --- a/reactos/drivers/fs/ntfs/ntfs.rc +++ b/reactos/drivers/fs/ntfs/ntfs.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/fs/vfat/create.c b/reactos/drivers/fs/vfat/create.c index 2d8d83120f7..33a8c6f3042 100644 --- a/reactos/drivers/fs/vfat/create.c +++ b/reactos/drivers/fs/vfat/create.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: create.c,v 1.45 2002/09/07 15:12:03 chorns Exp $ +/* $Id: create.c,v 1.46 2002/09/08 10:22:12 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: services/fs/vfat/create.c @@ -38,7 +38,7 @@ /* GLOBALS *******************************************************************/ -#define ENTRIES_PER_PAGE (PAGE_SIZE / sizeof (FATDirEntry)) +#define ENTRIES_PER_PAGE (PAGESIZE / sizeof (FATDirEntry)) /* FUNCTIONS *****************************************************************/ @@ -175,7 +175,7 @@ GetEntryName(PVOID *pContext, Offset = 0; CcUnpinData(*pContext); FileOffset.QuadPart = *pIndex * sizeof(FATDirEntry); - if(!CcMapData(FileObject, &FileOffset, PAGE_SIZE, TRUE, pContext, Block)) + if(!CcMapData(FileObject, &FileOffset, PAGESIZE, TRUE, pContext, Block)) { *pContext = NULL; return STATUS_NO_MORE_ENTRIES; @@ -204,7 +204,7 @@ GetEntryName(PVOID *pContext, Offset = 0; CcUnpinData(*pContext); FileOffset.QuadPart = *pIndex * sizeof(FATDirEntry); - if(!CcMapData(FileObject, &FileOffset, PAGE_SIZE, TRUE, pContext, Block)) + if(!CcMapData(FileObject, &FileOffset, PAGESIZE, TRUE, pContext, Block)) { *pContext = NULL; return STATUS_NO_MORE_ENTRIES; @@ -263,7 +263,7 @@ ReadVolumeLabel (PDEVICE_EXTENSION DeviceExt, PVPB Vpb) } FileOffset.u.HighPart = 0; FileOffset.u.LowPart = (DirIndex - Offset) * sizeof(FATDirEntry); - if (!CcMapData(pFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context, (PVOID*)&Entry)) + if (!CcMapData(pFcb->FileObject, &FileOffset, PAGESIZE, TRUE, &Context, (PVOID*)&Entry)) { Context = NULL; break; @@ -400,7 +400,7 @@ FindFile (PDEVICE_EXTENSION DeviceExt, CcUnpinData(Context); } FileOffset.QuadPart = (DirIndex - Offset) * sizeof(FATDirEntry); - if (!CcMapData(Parent->FileObject, &FileOffset, PAGE_SIZE, TRUE, + if (!CcMapData(Parent->FileObject, &FileOffset, PAGESIZE, TRUE, &Context, (PVOID*)&block)) { Context = NULL; @@ -699,7 +699,7 @@ VfatCreateFile (PDEVICE_OBJECT DeviceObject, PIRP Irp) } memset(pCcb, 0, sizeof(VFATCCB)); FileObject->Flags |= FO_FCB_IS_VALID; - FileObject->SectionObjectPointer = &pFcb->SectionObjectPointers; + FileObject->SectionObjectPointers = &pFcb->SectionObjectPointers; FileObject->FsContext = (PVOID) &pFcb->RFCB; FileObject->FsContext2 = pCcb; pCcb->pFcb = pFcb; diff --git a/reactos/drivers/fs/vfat/dir.c b/reactos/drivers/fs/vfat/dir.c index ffb23be318e..dac049d85d3 100644 --- a/reactos/drivers/fs/vfat/dir.c +++ b/reactos/drivers/fs/vfat/dir.c @@ -1,5 +1,5 @@ /* - * $Id: dir.c,v 1.25 2002/09/07 15:12:03 chorns Exp $ + * $Id: dir.c,v 1.26 2002/09/08 10:22:12 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -20,7 +20,7 @@ // function like DosDateTimeToFileTime -BOOL FsdDosDateTimeToFileTime (WORD wDosDate, WORD wDosTime, LARGE_INTEGER * FileTime) +BOOL FsdDosDateTimeToFileTime (WORD wDosDate, WORD wDosTime, TIME * FileTime) { PDOSTIME pdtime = (PDOSTIME) & wDosTime; PDOSDATE pddate = (PDOSDATE) & wDosDate; @@ -46,7 +46,7 @@ BOOL FsdDosDateTimeToFileTime (WORD wDosDate, WORD wDosTime, LARGE_INTEGER * Fil // function like FileTimeToDosDateTime BOOL -FsdFileTimeToDosDateTime (LARGE_INTEGER * FileTime, WORD * pwDosDate, WORD * pwDosTime) +FsdFileTimeToDosDateTime (TIME * FileTime, WORD * pwDosDate, WORD * pwDosTime) { PDOSTIME pdtime = (PDOSTIME) pwDosTime; PDOSDATE pddate = (PDOSDATE) pwDosDate; @@ -235,11 +235,9 @@ NTSTATUS DoQuery (PVFAT_IRP_CONTEXT IrpContext) VFATFCB tmpFcb; PVFATCCB pCcb; BOOLEAN First = FALSE; - PEXTENDED_IO_STACK_LOCATION IoStack; pCcb = (PVFATCCB) IrpContext->FileObject->FsContext2; pFcb = pCcb->pFcb; - IoStack = (PEXTENDED_IO_STACK_LOCATION)IrpContext->Stack; if (!ExAcquireResourceSharedLite(&pFcb->MainResource, IrpContext->Flags & IRPCONTEXT_CANWAIT)) { @@ -247,11 +245,11 @@ NTSTATUS DoQuery (PVFAT_IRP_CONTEXT IrpContext) } // Obtain the callers parameters - BufferLength = IoStack->Parameters.QueryDirectory.Length; - pSearchPattern = IoStack->Parameters.QueryDirectory.FileName; + BufferLength = IrpContext->Stack->Parameters.QueryDirectory.Length; + pSearchPattern = IrpContext->Stack->Parameters.QueryDirectory.FileName; FileInformationClass = - IoStack->Parameters.QueryDirectory.FileInformationClass; - FileIndex = IoStack->Parameters.QueryDirectory.FileIndex; + IrpContext->Stack->Parameters.QueryDirectory.FileInformationClass; + FileIndex = IrpContext->Stack->Parameters.QueryDirectory.FileIndex; if (pSearchPattern) { if (!pCcb->DirectorySearchPattern) diff --git a/reactos/drivers/fs/vfat/direntry.c b/reactos/drivers/fs/vfat/direntry.c index 210c72cc9af..83fc9b81fc5 100644 --- a/reactos/drivers/fs/vfat/direntry.c +++ b/reactos/drivers/fs/vfat/direntry.c @@ -1,4 +1,4 @@ -/* $Id: direntry.c,v 1.7 2002/09/07 15:12:03 chorns Exp $ +/* $Id: direntry.c,v 1.8 2002/09/08 10:22:12 chorns Exp $ * * * FILE: DirEntry.c @@ -20,8 +20,8 @@ #include "vfat.h" -#define CACHEPAGESIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGE_SIZE ? \ - (pDeviceExt)->FatInfo.BytesPerCluster : PAGE_SIZE) +#define CACHEPAGESIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGESIZE ? \ + (pDeviceExt)->FatInfo.BytesPerCluster : PAGESIZE) #define ENTRIES_PER_CACHEPAGE(pDeviceExt) (ENTRIES_PER_SECTOR * \ (CACHEPAGESIZE(pDeviceExt) / ((pDeviceExt)->FatInfo.BytesPerSector))) diff --git a/reactos/drivers/fs/vfat/dirwr.c b/reactos/drivers/fs/vfat/dirwr.c index 4aefbceba30..3f2752718cc 100644 --- a/reactos/drivers/fs/vfat/dirwr.c +++ b/reactos/drivers/fs/vfat/dirwr.c @@ -1,4 +1,4 @@ -/* $Id: dirwr.c,v 1.29 2002/09/07 15:12:03 chorns Exp $ +/* $Id: dirwr.c,v 1.30 2002/09/08 10:22:12 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -427,7 +427,7 @@ VfatAddEntry (PDEVICE_EXTENSION DeviceExt, /* set dates and times */ KeQuerySystemTime (&SystemTime); ExSystemTimeToLocalTime (&SystemTime, &LocalTime); - FsdFileTimeToDosDateTime ((LARGE_INTEGER *) & LocalTime, &pEntry->CreationDate, + FsdFileTimeToDosDateTime ((TIME *) & LocalTime, &pEntry->CreationDate, &pEntry->CreationTime); pEntry->UpdateDate = pEntry->CreationDate; pEntry->UpdateTime = pEntry->CreationTime; @@ -612,23 +612,23 @@ delEntry (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT pFileObject) Offset.u.HighPart = 0; for (i = startEntry; i <= Entry; i++) { - if (Context == NULL || ((i * sizeof(FATDirEntry)) % PAGE_SIZE) == 0) + if (Context == NULL || ((i * sizeof(FATDirEntry)) % PAGESIZE) == 0) { if (Context) { CcSetDirtyPinnedData(Context, NULL); CcUnpinData(Context); } - Offset.u.LowPart = (i * sizeof(FATDirEntry) / PAGE_SIZE) * PAGE_SIZE; - CcMapData (pDirFcb->FileObject, &Offset, PAGE_SIZE, TRUE, + Offset.u.LowPart = (i * sizeof(FATDirEntry) / PAGESIZE) * PAGESIZE; + CcMapData (pDirFcb->FileObject, &Offset, PAGESIZE, TRUE, &Context, (PVOID*)&pDirEntry); } - pDirEntry[i % (PAGE_SIZE / sizeof(FATDirEntry))].Filename[0] = 0xe5; + pDirEntry[i % (PAGESIZE / sizeof(FATDirEntry))].Filename[0] = 0xe5; if (i == Entry) { CurrentCluster = vfatDirEntryGetFirstCluster (DeviceExt, - &pDirEntry[i % (PAGE_SIZE / sizeof(FATDirEntry))]); + &pDirEntry[i % (PAGESIZE / sizeof(FATDirEntry))]); } } if (Context) diff --git a/reactos/drivers/fs/vfat/fat.c b/reactos/drivers/fs/vfat/fat.c index 03fe0e83851..b06878cc423 100644 --- a/reactos/drivers/fs/vfat/fat.c +++ b/reactos/drivers/fs/vfat/fat.c @@ -1,5 +1,5 @@ /* - * $Id: fat.c,v 1.38 2002/09/07 15:12:03 chorns Exp $ + * $Id: fat.c,v 1.39 2002/09/08 10:22:12 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -24,8 +24,8 @@ #define ROUND_DOWN(N, S) ((N) - ((N) % (S))) -#define CACHEPAGE_SIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGE_SIZE ? \ - (pDeviceExt)->FatInfo.BytesPerCluster : PAGE_SIZE) +#define CACHEPAGESIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGESIZE ? \ + (pDeviceExt)->FatInfo.BytesPerCluster : PAGESIZE) /* FUNCTIONS ****************************************************************/ @@ -45,7 +45,7 @@ Fat32GetNextCluster(PDEVICE_EXTENSION DeviceExt, PVOID Context; LARGE_INTEGER Offset; - ChunkSize = CACHEPAGE_SIZE(DeviceExt); + ChunkSize = CACHEPAGESIZE(DeviceExt); FATOffset = CurrentCluster * sizeof(ULONG); Offset.QuadPart = ROUND_DOWN(FATOffset, ChunkSize); if(!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress)) @@ -75,7 +75,7 @@ Fat16GetNextCluster(PDEVICE_EXTENSION DeviceExt, PVOID Context; LARGE_INTEGER Offset; - ChunkSize = CACHEPAGE_SIZE(DeviceExt); + ChunkSize = CACHEPAGESIZE(DeviceExt); FATOffset = CurrentCluster * 2; Offset.QuadPart = ROUND_DOWN(FATOffset, ChunkSize); if(!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress)) @@ -150,7 +150,7 @@ FAT16FindAvailableCluster(PDEVICE_EXTENSION DeviceExt, LARGE_INTEGER Offset; PUSHORT Block; - ChunkSize = CACHEPAGE_SIZE(DeviceExt); + ChunkSize = CACHEPAGESIZE(DeviceExt); FatLength = (DeviceExt->FatInfo.NumberOfClusters +2 ) * 2; *Cluster = 0; StartCluster = DeviceExt->LastAvailableCluster; @@ -266,7 +266,7 @@ FAT32FindAvailableCluster (PDEVICE_EXTENSION DeviceExt, PULONG Cluster) LARGE_INTEGER Offset; PULONG Block; - ChunkSize = CACHEPAGE_SIZE(DeviceExt); + ChunkSize = CACHEPAGESIZE(DeviceExt); FatLength = (DeviceExt->FatInfo.NumberOfClusters + 2) * 4; *Cluster = 0; StartCluster = DeviceExt->LastAvailableCluster; @@ -374,7 +374,7 @@ FAT16CountAvailableClusters(PDEVICE_EXTENSION DeviceExt) LARGE_INTEGER Offset; ULONG FatLength; - ChunkSize = CACHEPAGE_SIZE(DeviceExt); + ChunkSize = CACHEPAGESIZE(DeviceExt); FatLength = (DeviceExt->FatInfo.NumberOfClusters + 2) * 2; for (i = 4; i< FatLength; i += 2, Block++) @@ -421,7 +421,7 @@ FAT32CountAvailableClusters(PDEVICE_EXTENSION DeviceExt) LARGE_INTEGER Offset; ULONG FatLength; - ChunkSize = CACHEPAGE_SIZE(DeviceExt); + ChunkSize = CACHEPAGESIZE(DeviceExt); FatLength = (DeviceExt->FatInfo.NumberOfClusters + 2) * 4; for (i = 8; i< FatLength; i += 4, Block++) @@ -542,7 +542,7 @@ FAT16WriteCluster(PDEVICE_EXTENSION DeviceExt, LARGE_INTEGER Offset; PUSHORT Cluster; - ChunkSize = CACHEPAGE_SIZE(DeviceExt); + ChunkSize = CACHEPAGESIZE(DeviceExt); FATOffset = ClusterToWrite * 2; Offset.QuadPart = ROUND_DOWN(FATOffset, ChunkSize); if(!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress)) @@ -577,7 +577,7 @@ FAT32WriteCluster(PDEVICE_EXTENSION DeviceExt, LARGE_INTEGER Offset; PULONG Cluster; - ChunkSize = CACHEPAGE_SIZE(DeviceExt); + ChunkSize = CACHEPAGESIZE(DeviceExt); FATOffset = (ClusterToWrite * 4); Offset.QuadPart = ROUND_DOWN(FATOffset, ChunkSize); diff --git a/reactos/drivers/fs/vfat/fcb.c b/reactos/drivers/fs/vfat/fcb.c index e2bb86b9b49..4342b42d87a 100644 --- a/reactos/drivers/fs/vfat/fcb.c +++ b/reactos/drivers/fs/vfat/fcb.c @@ -1,4 +1,4 @@ -/* $Id: fcb.c,v 1.19 2002/09/07 15:12:03 chorns Exp $ +/* $Id: fcb.c,v 1.20 2002/09/08 10:22:12 chorns Exp $ * * * FILE: fcb.c @@ -21,9 +21,8 @@ #include "vfat.h" /* -------------------------------------------------------- DEFINES */ -#ifndef TAG + #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) -#endif #define TAG_FCB TAG('V', 'F', 'C', 'B') #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) @@ -179,7 +178,7 @@ vfatFCBInitializeCacheFromVolume (PVCB vcb, PVFATFCB fcb) fileObject->Flags = fileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ; - fileObject->SectionObjectPointer = &fcb->SectionObjectPointers; + fileObject->SectionObjectPointers = &fcb->SectionObjectPointers; fileObject->FsContext = (PVOID) &fcb->RFCB; fileObject->FsContext2 = newCCB; newCCB->pFcb = fcb; @@ -188,8 +187,8 @@ vfatFCBInitializeCacheFromVolume (PVCB vcb, PVFATFCB fcb) fcb->pDevExt = vcb; - fileCacheQuantum = (vcb->FatInfo.BytesPerCluster >= PAGE_SIZE) ? - vcb->FatInfo.BytesPerCluster : PAGE_SIZE; + fileCacheQuantum = (vcb->FatInfo.BytesPerCluster >= PAGESIZE) ? + vcb->FatInfo.BytesPerCluster : PAGESIZE; status = CcRosInitializeFileCache (fileObject, &fcb->RFCB.Bcb, @@ -352,13 +351,12 @@ vfatAttachFCBToFileObject (PDEVICE_EXTENSION vcb, fileObject->Flags = fileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ; - fileObject->SectionObjectPointer = &fcb->SectionObjectPointers; + fileObject->SectionObjectPointers = &fcb->SectionObjectPointers; fileObject->FsContext = (PVOID) &fcb->RFCB; fileObject->FsContext2 = newCCB; newCCB->pFcb = fcb; newCCB->PtrFileObject = fileObject; fcb->pDevExt = vcb; - DPRINT ("file open: fcb:%x file size: %d\n", fcb, fcb->entry.FileSize); return STATUS_SUCCESS; diff --git a/reactos/drivers/fs/vfat/finfo.c b/reactos/drivers/fs/vfat/finfo.c index a1006d80145..0993a18160c 100644 --- a/reactos/drivers/fs/vfat/finfo.c +++ b/reactos/drivers/fs/vfat/finfo.c @@ -1,4 +1,4 @@ -/* $Id: finfo.c,v 1.19 2002/09/07 15:12:03 chorns Exp $ +/* $Id: finfo.c,v 1.20 2002/09/08 10:22:12 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -463,7 +463,7 @@ VfatSetAllocationSizeInformation(PFILE_OBJECT FileObject, Fcb->RFCB.FileSize.QuadPart = NewSize; Fcb->RFCB.ValidDataLength.QuadPart = NewSize; - if (FileObject->SectionObjectPointer->SharedCacheMap != NULL) + if (FileObject->SectionObjectPointers->SharedCacheMap != NULL) { CcSetFileSizes(FileObject, (PCC_FILE_SIZES)&Fcb->RFCB.AllocationSize); } diff --git a/reactos/drivers/fs/vfat/fsctl.c b/reactos/drivers/fs/vfat/fsctl.c index dd24a9e5cd5..d115b18d120 100644 --- a/reactos/drivers/fs/vfat/fsctl.c +++ b/reactos/drivers/fs/vfat/fsctl.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: fsctl.c,v 1.9 2002/09/07 15:12:03 chorns Exp $ +/* $Id: fsctl.c,v 1.10 2002/09/08 10:22:12 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -27,18 +27,17 @@ /* INCLUDES *****************************************************************/ #include -#include #include -//#define NDEBUG +#define NDEBUG #include #include "vfat.h" /* FUNCTIONS ****************************************************************/ -#define CACHEPAGESIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGE_SIZE ? \ - (pDeviceExt)->FatInfo.BytesPerCluster : PAGE_SIZE) +#define CACHEPAGESIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGESIZE ? \ + (pDeviceExt)->FatInfo.BytesPerCluster : PAGESIZE) static NTSTATUS @@ -182,14 +181,14 @@ VfatMountDevice(PDEVICE_EXTENSION DeviceExt, return(Status); } - if (DeviceExt->FatInfo.BytesPerCluster >= PAGE_SIZE && - (DeviceExt->FatInfo.BytesPerCluster % PAGE_SIZE) != 0) + if (DeviceExt->FatInfo.BytesPerCluster >= PAGESIZE && + (DeviceExt->FatInfo.BytesPerCluster % PAGESIZE) != 0) { DbgPrint("(%s:%d) Invalid cluster size\n", __FILE__, __LINE__); KeBugCheck(0); } - else if (DeviceExt->FatInfo.BytesPerCluster < PAGE_SIZE && - (PAGE_SIZE % DeviceExt->FatInfo.BytesPerCluster) != 0) + else if (DeviceExt->FatInfo.BytesPerCluster < PAGESIZE && + (PAGESIZE % DeviceExt->FatInfo.BytesPerCluster) != 0) { DbgPrint("(%s:%d) Invalid cluster size2\n", __FILE__, __LINE__); KeBugCheck(0); @@ -304,7 +303,7 @@ VfatMount (PVFAT_IRP_CONTEXT IrpContext) DeviceExt->FATFileObject->Flags = DeviceExt->FATFileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ; DeviceExt->FATFileObject->FsContext = (PVOID) &Fcb->RFCB; DeviceExt->FATFileObject->FsContext2 = Ccb; - DeviceExt->FATFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers; + DeviceExt->FATFileObject->SectionObjectPointers = &Fcb->SectionObjectPointers; DeviceExt->FATFileObject->PrivateCacheMap = NULL; DeviceExt->FATFileObject->Vpb = DeviceObject->Vpb; Ccb->pFcb = Fcb; @@ -324,7 +323,7 @@ VfatMount (PVFAT_IRP_CONTEXT IrpContext) } else { - Status = CcRosInitializeFileCache(DeviceExt->FATFileObject, &Fcb->RFCB.Bcb, 2 * PAGE_SIZE); + Status = CcRosInitializeFileCache(DeviceExt->FATFileObject, &Fcb->RFCB.Bcb, 2 * PAGESIZE); } if (!NT_SUCCESS (Status)) { diff --git a/reactos/drivers/fs/vfat/rw.c b/reactos/drivers/fs/vfat/rw.c index 9364a127650..ddd317bc087 100644 --- a/reactos/drivers/fs/vfat/rw.c +++ b/reactos/drivers/fs/vfat/rw.c @@ -1,5 +1,5 @@ -/* $Id: rw.c,v 1.47 2002/09/07 15:12:03 chorns Exp $ +/* $Id: rw.c,v 1.48 2002/09/08 10:22:12 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -696,9 +696,9 @@ VfatRead(PVFAT_IRP_CONTEXT IrpContext) { ULONG CacheSize; CacheSize = IrpContext->DeviceExt->FatInfo.BytesPerCluster; - if (CacheSize < PAGE_SIZE) + if (CacheSize < PAGESIZE) { - CacheSize = PAGE_SIZE; + CacheSize = PAGESIZE; } CcRosInitializeFileCache(IrpContext->FileObject, &Fcb->RFCB.Bcb, CacheSize); } @@ -967,9 +967,9 @@ NTSTATUS VfatWrite (PVFAT_IRP_CONTEXT IrpContext) { ULONG CacheSize; CacheSize = IrpContext->DeviceExt->FatInfo.BytesPerCluster; - if (CacheSize < PAGE_SIZE) + if (CacheSize < PAGESIZE) { - CacheSize = PAGE_SIZE; + CacheSize = PAGESIZE; } CcRosInitializeFileCache(IrpContext->FileObject, &Fcb->RFCB.Bcb, CacheSize); } diff --git a/reactos/drivers/fs/vfat/vfat.h b/reactos/drivers/fs/vfat/vfat.h index 0c805d4054f..e744e9e0ca9 100644 --- a/reactos/drivers/fs/vfat/vfat.h +++ b/reactos/drivers/fs/vfat/vfat.h @@ -1,7 +1,6 @@ -/* $Id: vfat.h,v 1.46 2002/09/07 15:12:03 chorns Exp $ */ +/* $Id: vfat.h,v 1.47 2002/09/08 10:22:13 chorns Exp $ */ -#define NTOS_KERNEL_MODE -#include +#include #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) #define ROUND_DOWN(N, S) ((N) - ((N) % (S))) @@ -198,9 +197,7 @@ typedef struct _VFATCCB } VFATCCB, *PVFATCCB; -#ifndef TAG #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) -#endif #define TAG_CCB TAG('V', 'C', 'C', 'B') @@ -273,9 +270,9 @@ NTSTATUS VfatDirectoryControl (PVFAT_IRP_CONTEXT); BOOL FsdDosDateTimeToFileTime (WORD wDosDate, WORD wDosTime, - LARGE_INTEGER *FileTime); + TIME *FileTime); -BOOL FsdFileTimeToDosDateTime (LARGE_INTEGER *FileTime, +BOOL FsdFileTimeToDosDateTime (TIME *FileTime, WORD *pwDosDate, WORD *pwDosTime); diff --git a/reactos/drivers/fs/vfat/vfatfs.rc b/reactos/drivers/fs/vfat/vfatfs.rc index 03180846911..82830c507d6 100644 --- a/reactos/drivers/fs/vfat/vfatfs.rc +++ b/reactos/drivers/fs/vfat/vfatfs.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/fs/vfat/volume.c b/reactos/drivers/fs/vfat/volume.c index 8b6ebc87c9e..e84d3769235 100644 --- a/reactos/drivers/fs/vfat/volume.c +++ b/reactos/drivers/fs/vfat/volume.c @@ -1,4 +1,4 @@ -/* $Id: volume.c,v 1.16 2002/09/07 15:12:03 chorns Exp $ +/* $Id: volume.c,v 1.17 2002/09/08 10:22:13 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -245,7 +245,6 @@ NTSTATUS VfatSetVolumeInformation(PVFAT_IRP_CONTEXT IrpContext) NTSTATUS Status = STATUS_SUCCESS; PVOID SystemBuffer; ULONG BufferLength; - PEXTENDED_IO_STACK_LOCATION IoStack; /* PRECONDITION */ assert(IrpContext); @@ -257,9 +256,8 @@ NTSTATUS VfatSetVolumeInformation(PVFAT_IRP_CONTEXT IrpContext) return VfatQueueRequest (IrpContext); } - IoStack = (PEXTENDED_IO_STACK_LOCATION)IrpContext->Stack; - FsInformationClass = IoStack->Parameters.SetVolume.FsInformationClass; - BufferLength = IoStack->Parameters.SetVolume.Length; + FsInformationClass = IrpContext->Stack->Parameters.SetVolume.FsInformationClass; + BufferLength = IrpContext->Stack->Parameters.SetVolume.Length; SystemBuffer = IrpContext->Irp->AssociatedIrp.SystemBuffer; DPRINT1("FsInformationClass %d\n", FsInformationClass); diff --git a/reactos/drivers/input/keyboard/keyboard.c b/reactos/drivers/input/keyboard/keyboard.c index c45e4193608..4848bd4eb09 100644 --- a/reactos/drivers/input/keyboard/keyboard.c +++ b/reactos/drivers/input/keyboard/keyboard.c @@ -9,13 +9,13 @@ /* INCLUDES ****************************************************************/ -#define NTOS_KERNEL_MODE -#include +#include +#include #include +#include + #include #include -#include -#include #define NDEBUG #include diff --git a/reactos/drivers/input/keyboard/keyboard.h b/reactos/drivers/input/keyboard/keyboard.h index 0e7d3c573cd..18885ceac13 100644 --- a/reactos/drivers/input/keyboard/keyboard.h +++ b/reactos/drivers/input/keyboard/keyboard.h @@ -1,6 +1,5 @@ #ifndef _KEYBOARD_H_ #define _KEYBOARD_H_ - #include #include diff --git a/reactos/drivers/input/keyboard/keyboard.rc b/reactos/drivers/input/keyboard/keyboard.rc index e17b8a71509..8095fc3e48c 100644 --- a/reactos/drivers/input/keyboard/keyboard.rc +++ b/reactos/drivers/input/keyboard/keyboard.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/input/mouclass/mouclass.c b/reactos/drivers/input/mouclass/mouclass.c index dae4ec3b652..a4e65d0a8c4 100644 --- a/reactos/drivers/input/mouclass/mouclass.c +++ b/reactos/drivers/input/mouclass/mouclass.c @@ -90,15 +90,13 @@ NTSTATUS ConnectMousePortDriver(PDEVICE_OBJECT ClassDeviceObject) PDEVICE_OBJECT PortDeviceObject = NULL; PFILE_OBJECT FileObject = NULL; NTSTATUS status; - UNICODE_STRING PortName; + UNICODE_STRING PortName = UNICODE_STRING_INITIALIZER(L"\\Device\\Mouse"); IO_STATUS_BLOCK ioStatus; KEVENT event; PIRP irp; CLASS_INFORMATION ClassInformation; PDEVICE_EXTENSION DeviceExtension = ClassDeviceObject->DeviceExtension; - RtlInitUnicodeString(&PortName, L"\\Device\\Mouse"); - DeviceExtension->GDIInformation.CallBack = NULL; // Get the port driver's DeviceObject @@ -264,11 +262,8 @@ NTSTATUS STDCALL DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) { PDEVICE_OBJECT DeviceObject; - UNICODE_STRING DeviceName; - UNICODE_STRING SymlinkName; - - RtlInitUnicodeString(&DeviceName, L"\\Device\\MouseClass"); - RtlInitUnicodeString(&SymlinkName, L"\\??\\MouseClass"); + UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Device\\MouseClass"); + UNICODE_STRING SymlinkName = UNICODE_STRING_INITIALIZER(L"\\??\\MouseClass"); DriverObject->MajorFunction[IRP_MJ_CREATE] = MouseClassDispatch; // DriverObject->MajorFunction[IRP_MJ_CLOSE] = MouseClassDispatch; diff --git a/reactos/drivers/input/mouclass/mouclass.rc b/reactos/drivers/input/mouclass/mouclass.rc index bc598494921..e080d187c7f 100644 --- a/reactos/drivers/input/mouclass/mouclass.rc +++ b/reactos/drivers/input/mouclass/mouclass.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/input/psaux/psaux.c b/reactos/drivers/input/psaux/psaux.c index e020c1b8fc2..e8bd4b035fe 100644 --- a/reactos/drivers/input/psaux/psaux.c +++ b/reactos/drivers/input/psaux/psaux.c @@ -171,8 +171,8 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = PS2MouseInternalDeviceControl; DriverObject->DriverStartIo = PS2MouseStartIo; - RtlInitUnicodeString(&DeviceName, - L"\\Device\\Mouse"); // FIXME: find correct device name + RtlInitUnicodeStringFromLiteral(&DeviceName, + L"\\Device\\Mouse"); // FIXME: find correct device name IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION), &DeviceName, @@ -182,8 +182,8 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) &DeviceObject); DeviceObject->Flags = DeviceObject->Flags | DO_BUFFERED_IO; - RtlInitUnicodeString(&SymlinkName, - L"\\??\\Mouse"); // FIXME: find correct device name + RtlInitUnicodeStringFromLiteral(&SymlinkName, + L"\\??\\Mouse"); // FIXME: find correct device name IoCreateSymbolicLink(&SymlinkName, &DeviceName); DeviceExtension = DeviceObject->DeviceExtension; diff --git a/reactos/drivers/input/psaux/psaux.rc b/reactos/drivers/input/psaux/psaux.rc index 07085348f91..c7383c0494b 100644 --- a/reactos/drivers/input/psaux/psaux.rc +++ b/reactos/drivers/input/psaux/psaux.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/lib/bzip2/bzlib.c b/reactos/drivers/lib/bzip2/bzlib.c index b68477d1783..e43de27683a 100644 --- a/reactos/drivers/lib/bzip2/bzlib.c +++ b/reactos/drivers/lib/bzip2/bzlib.c @@ -75,7 +75,7 @@ #ifdef BZ_DECOMPRESS_ONLY #define __NTDRIVER__ -#include +#include #include #endif diff --git a/reactos/drivers/net/afd/afd.rc b/reactos/drivers/net/afd/afd.rc index 4af0d094241..65281ec0c6c 100644 --- a/reactos/drivers/net/afd/afd.rc +++ b/reactos/drivers/net/afd/afd.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/net/afd/include/afd.h b/reactos/drivers/net/afd/include/afd.h index 461a0505579..1dc02f0e0c5 100644 --- a/reactos/drivers/net/afd/include/afd.h +++ b/reactos/drivers/net/afd/include/afd.h @@ -7,11 +7,10 @@ #ifndef __AFD_H #define __AFD_H -#define NTOS_KERNEL_MODE -#include -#include -#include #include +#include +#include +#include #include #include @@ -36,6 +35,21 @@ typedef struct _AFDCCB { /* Flags for CCB structure */ #define CCB_CLEANED 0x00000001 +/* Borrowed from http://www.acc.umu.se/~bosse/ntifs.h by Bo Branten */ +typedef struct _FSRTL_COMMON_FCB_HEADER { + CSHORT NodeTypeCode; + CSHORT NodeByteSize; + UCHAR Flags; + UCHAR IsFastIoPossible; + UCHAR Flags2; + UCHAR Reserved; + PERESOURCE Resource; + PERESOURCE PagingIoResource; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER FileSize; + LARGE_INTEGER ValidDataLength; +} FSRTL_COMMON_FCB_HEADER, *PFSRTL_COMMON_FCB_HEADER; + typedef struct _FsdNTRequiredFCB { FSRTL_COMMON_FCB_HEADER CommonFCBHeader; SECTION_OBJECT_POINTERS SectionObject; diff --git a/reactos/drivers/net/afd/include/debug.h b/reactos/drivers/net/afd/include/debug.h index 24ab1f42d1a..dc1fe317f48 100644 --- a/reactos/drivers/net/afd/include/debug.h +++ b/reactos/drivers/net/afd/include/debug.h @@ -66,7 +66,6 @@ extern DWORD DebugTraceLevel; #endif /* DBG */ -#undef assert #define assert(x) ASSERT(x) #define assert_km(x) ASSERT_KM(x) diff --git a/reactos/drivers/net/dd/ne2000/include/debug.h b/reactos/drivers/net/dd/ne2000/include/debug.h index b0122f9bbe6..5b96c6fb9cc 100644 --- a/reactos/drivers/net/dd/ne2000/include/debug.h +++ b/reactos/drivers/net/dd/ne2000/include/debug.h @@ -9,9 +9,6 @@ #ifndef __DEBUG_H #define __DEBUG_H -#undef assert -#undef ASSERT - #define NORMAL_MASK 0x000000FF #define SPECIAL_MASK 0xFFFFFF00 #define MIN_TRACE 0x00000001 diff --git a/reactos/drivers/net/dd/ne2000/include/ne2000.h b/reactos/drivers/net/dd/ne2000/include/ne2000.h index 1432b35ab6f..b630afe075c 100644 --- a/reactos/drivers/net/dd/ne2000/include/ne2000.h +++ b/reactos/drivers/net/dd/ne2000/include/ne2000.h @@ -7,7 +7,16 @@ #ifndef __NE2000_H #define __NE2000_H -#include +#ifdef _MSC_VER + +#ifndef ULONG_PTR +#define ULONG ULONG_PTR +#endif + +#include +#else +#include +#endif #include <8390.h> #include diff --git a/reactos/drivers/net/dd/ne2000/ne2000.rc b/reactos/drivers/net/dd/ne2000/ne2000.rc index 6fa2e88b8a0..d345102f38b 100644 --- a/reactos/drivers/net/dd/ne2000/ne2000.rc +++ b/reactos/drivers/net/dd/ne2000/ne2000.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/net/ndis/Makefile b/reactos/drivers/net/ndis/Makefile index 1dbab6f7680..7bea96002bb 100644 --- a/reactos/drivers/net/ndis/Makefile +++ b/reactos/drivers/net/ndis/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.14 2002/09/07 15:12:05 chorns Exp $ +# $Id: Makefile,v 1.15 2002/09/08 10:22:16 chorns Exp $ PATH_TO_TOP = ../../.. @@ -6,7 +6,7 @@ TARGET_TYPE = export_driver TARGET_NAME = ndis -TARGET_CFLAGS = -I./include -D_NDIS_ -DBINARY_COMPATIBLE=1 +TARGET_CFLAGS = -I./include -DNDIS_WRAPPER -DBINARY_COMPATIBLE=1 TARGET_OBJECTS = \ ndis/main.o \ diff --git a/reactos/drivers/net/ndis/include/debug.h b/reactos/drivers/net/ndis/include/debug.h index 5deccf45cf9..fbe3f8865f9 100644 --- a/reactos/drivers/net/ndis/include/debug.h +++ b/reactos/drivers/net/ndis/include/debug.h @@ -21,9 +21,6 @@ #define DEBUG_PACKET 0x00000800 #define DEBUG_ULTRA 0xFFFFFFFF -#undef ASSERT -#undef assert - #ifdef DBG extern DWORD DebugTraceLevel; @@ -49,6 +46,10 @@ extern DWORD DebugTraceLevel; #endif /* _MSC_VER */ +#ifdef ASSERT +#undef ASSERT +#endif + #ifdef NASSERT #define ASSERT(x) #else /* NASSERT */ @@ -66,7 +67,6 @@ extern DWORD DebugTraceLevel; #endif /* DBG */ -#undef assert #define assert(x) ASSERT(x) #define assert_irql(x) ASSERT_IRQL(x) diff --git a/reactos/drivers/net/ndis/include/miniport.h b/reactos/drivers/net/ndis/include/miniport.h index 83cbafe6f6c..1ae54f05028 100644 --- a/reactos/drivers/net/ndis/include/miniport.h +++ b/reactos/drivers/net/ndis/include/miniport.h @@ -10,7 +10,6 @@ #include -#define ETH_LENGTH_OF_ADDRESS 6 typedef struct _HARDWARE_ADDRESS { union { diff --git a/reactos/drivers/net/ndis/include/ndissys.h b/reactos/drivers/net/ndis/include/ndissys.h index ec0a0a7a360..40828718c31 100644 --- a/reactos/drivers/net/ndis/include/ndissys.h +++ b/reactos/drivers/net/ndis/include/ndissys.h @@ -12,11 +12,40 @@ #define NDIS50 1 /* Use NDIS 5.0 structures by default */ +#ifdef _MSC_VER +#include +#include +#include +#include +#else /* _MSC_VER */ #include -#include +#include +#endif /* _MSC_VER */ #include + +#ifndef _MSC_VER +/* FIXME: The following should be moved to ntddk.h */ + +/* + * ULONG MmGetMdlByteCount( + * IN PMDL Mdl) + */ +#define MmGetMdlByteCount(Mdl) \ + ((Mdl)->ByteCount) + +#endif + + +/* Exported functions */ +#ifdef _MSC_VER +#define EXPORT __declspec(dllexport) +#else +#define EXPORT STDCALL +#endif + + #ifdef DBG #define DEBUG_REFCHECK(Object) { \ diff --git a/reactos/drivers/net/ndis/include/protocol.h b/reactos/drivers/net/ndis/include/protocol.h index 06c9e49a515..583d1860522 100644 --- a/reactos/drivers/net/ndis/include/protocol.h +++ b/reactos/drivers/net/ndis/include/protocol.h @@ -25,7 +25,7 @@ typedef struct _PROTOCOL_BINDING { typedef struct _ADAPTER_BINDING { - NDIS_OPEN_BLOCK NdisOpenBlock; /* NDIS defined fields */ + NDIS_OPEN_BLOCK NdisOpenBlock; /* NDIS defined fields */ LIST_ENTRY ListEntry; /* Entry on global list */ LIST_ENTRY ProtocolListEntry; /* Entry on protocol binding adapter list */ diff --git a/reactos/drivers/net/ndis/ndis.rc b/reactos/drivers/net/ndis/ndis.rc index 8bea6714acb..2ea36d0d0fd 100644 --- a/reactos/drivers/net/ndis/ndis.rc +++ b/reactos/drivers/net/ndis/ndis.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/net/ndis/ndis/40gone.c b/reactos/drivers/net/ndis/ndis/40gone.c index a7d2adcb64f..64e4cd51b6b 100644 --- a/reactos/drivers/net/ndis/ndis/40gone.c +++ b/reactos/drivers/net/ndis/ndis/40gone.c @@ -9,28 +9,9 @@ */ #include -#define FDDI_LENGTH_OF_LONG_ADDRESS 6 -#define FDDI_LENGTH_OF_SHORT_ADDRESS 2 - -DECLARE_UNKNOWN_PROTOTYPE(FDDI_ADDRESS_CHANGE) -DECLARE_UNKNOWN_PROTOTYPE(FDDI_FILTER_CHANGE) -DECLARE_UNKNOWN_PROTOTYPE(FDDI_DEFERRED_CLOSE) - - -#define TR_LENGTH_OF_FUNCTIONAL 4 -#define TR_LENGTH_OF_ADDRESS 6 - -DECLARE_UNKNOWN_PROTOTYPE(TR_ADDRESS_CHANGE) -DECLARE_UNKNOWN_PROTOTYPE(TR_GROUP_CHANGE) -DECLARE_UNKNOWN_PROTOTYPE(TR_FILTER_CHANGE) -DECLARE_UNKNOWN_PROTOTYPE(TR_DEFERRED_CLOSE) - - -DECLARE_UNKNOWN_STRUCT(ARC_FILTER) - VOID -STDCALL +EXPORT ArcFilterDprIndicateReceive( IN PARC_FILTER Filter, IN PUCHAR pRawHeader, @@ -42,7 +23,7 @@ ArcFilterDprIndicateReceive( VOID -STDCALL +EXPORT ArcFilterDprIndicateReceiveComplete( IN PARC_FILTER Filter) { @@ -51,7 +32,7 @@ ArcFilterDprIndicateReceiveComplete( NDIS_STATUS -STDCALL +EXPORT EthChangeFilterAddresses( IN PETH_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle, @@ -67,7 +48,7 @@ EthChangeFilterAddresses( BOOLEAN -STDCALL +EXPORT EthCreateFilter( IN UINT MaximumMulticastAddresses, IN ETH_ADDRESS_CHANGE AddressChangeAction, @@ -84,7 +65,7 @@ EthCreateFilter( VOID -STDCALL +EXPORT EthDeleteFilter( IN PETH_FILTER Filter) { @@ -93,7 +74,7 @@ EthDeleteFilter( NDIS_STATUS -STDCALL +EXPORT EthDeleteFilterOpenAdapter( IN PETH_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle, @@ -106,7 +87,7 @@ EthDeleteFilterOpenAdapter( NDIS_STATUS -STDCALL +EXPORT EthFilterAdjust( IN PETH_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle, @@ -121,7 +102,7 @@ EthFilterAdjust( VOID -STDCALL +EXPORT EthFilterIndicateReceive( IN PETH_FILTER Filter, IN NDIS_HANDLE MacReceiveContext, @@ -137,7 +118,7 @@ EthFilterIndicateReceive( VOID -STDCALL +EXPORT EthFilterIndicateReceiveComplete( IN PETH_FILTER Filter) { @@ -146,7 +127,7 @@ EthFilterIndicateReceiveComplete( BOOLEAN -STDCALL +EXPORT EthNoteFilterOpenAdapter( IN PETH_FILTER Filter, IN NDIS_HANDLE MacBindingHandle, @@ -160,7 +141,7 @@ EthNoteFilterOpenAdapter( UINT -STDCALL +EXPORT EthNumberOfOpenFilterAddresses( IN PETH_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle) @@ -172,7 +153,7 @@ EthNumberOfOpenFilterAddresses( VOID -STDCALL +EXPORT EthQueryGlobalFilterAddresses ( OUT PNDIS_STATUS Status, IN PETH_FILTER Filter, @@ -185,7 +166,7 @@ EthQueryGlobalFilterAddresses ( VOID -STDCALL +EXPORT EthQueryOpenFilterAddresses( OUT PNDIS_STATUS Status, IN PETH_FILTER Filter, @@ -199,7 +180,7 @@ EthQueryOpenFilterAddresses( BOOLEAN -STDCALL +EXPORT EthShouldAddressLoopBack( IN PETH_FILTER Filter, IN CHAR Address [ETH_LENGTH_OF_ADDRESS]) @@ -211,7 +192,7 @@ EthShouldAddressLoopBack( NDIS_STATUS -STDCALL +EXPORT FddiChangeFilterLongAddresses( IN PFDDI_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle, @@ -227,7 +208,7 @@ FddiChangeFilterLongAddresses( NDIS_STATUS -STDCALL +EXPORT FddiChangeFilterShortAddresses( IN PFDDI_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle, @@ -243,7 +224,7 @@ FddiChangeFilterShortAddresses( BOOLEAN -STDCALL +EXPORT FddiCreateFilter( IN UINT MaximumMulticastLongAddresses, IN UINT MaximumMulticastShortAddresses, @@ -262,7 +243,7 @@ FddiCreateFilter( VOID -STDCALL +EXPORT FddiDeleteFilter( IN PFDDI_FILTER Filter) { @@ -271,7 +252,7 @@ FddiDeleteFilter( NDIS_STATUS -STDCALL +EXPORT FddiDeleteFilterOpenAdapter( IN PFDDI_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle, @@ -284,7 +265,7 @@ FddiDeleteFilterOpenAdapter( NDIS_STATUS -STDCALL +EXPORT FddiFilterAdjust( IN PFDDI_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle, @@ -299,7 +280,7 @@ FddiFilterAdjust( VOID -STDCALL +EXPORT FddiFilterIndicateReceive( IN PFDDI_FILTER Filter, IN NDIS_HANDLE MacReceiveContext, @@ -316,7 +297,7 @@ FddiFilterIndicateReceive( VOID -STDCALL +EXPORT FddiFilterIndicateReceiveComplete( IN PFDDI_FILTER Filter) { @@ -325,7 +306,7 @@ FddiFilterIndicateReceiveComplete( BOOLEAN -STDCALL +EXPORT FddiNoteFilterOpenAdapter( IN PFDDI_FILTER Filter, IN NDIS_HANDLE MacBindingHandle, @@ -339,7 +320,7 @@ FddiNoteFilterOpenAdapter( UINT -STDCALL +EXPORT FddiNumberOfOpenFilterLongAddresses( IN PFDDI_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle) @@ -351,7 +332,7 @@ FddiNumberOfOpenFilterLongAddresses( UINT -STDCALL +EXPORT FddiNumberOfOpenFilterShortAddresses( IN PFDDI_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle) @@ -363,7 +344,7 @@ FddiNumberOfOpenFilterShortAddresses( VOID -STDCALL +EXPORT FddiQueryGlobalFilterLongAddresses( OUT PNDIS_STATUS Status, IN PFDDI_FILTER Filter, @@ -376,7 +357,7 @@ FddiQueryGlobalFilterLongAddresses( VOID -STDCALL +EXPORT FddiQueryGlobalFilterShortAddresses( OUT PNDIS_STATUS Status, IN PFDDI_FILTER Filter, @@ -389,7 +370,7 @@ FddiQueryGlobalFilterShortAddresses( VOID -STDCALL +EXPORT FddiQueryOpenFilterLongAddresses( OUT PNDIS_STATUS Status, IN PFDDI_FILTER Filter, @@ -403,7 +384,7 @@ FddiQueryOpenFilterLongAddresses( VOID -STDCALL +EXPORT FddiQueryOpenFilterShortAddresses( OUT PNDIS_STATUS Status, IN PFDDI_FILTER Filter, @@ -417,7 +398,7 @@ FddiQueryOpenFilterShortAddresses( BOOLEAN -STDCALL +EXPORT FddiShouldAddressLoopBack( IN PFDDI_FILTER Filter, IN CHAR Address [], @@ -430,7 +411,7 @@ FddiShouldAddressLoopBack( VOID -STDCALL +EXPORT NdisAllocateDmaChannel( OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE NdisDmaHandle, @@ -443,7 +424,7 @@ NdisAllocateDmaChannel( VOID -STDCALL +EXPORT NdisAllocateSharedMemory( IN NDIS_HANDLE NdisAdapterHandle, IN ULONG Length, @@ -456,7 +437,7 @@ NdisAllocateSharedMemory( VOID -STDCALL +EXPORT NdisCompleteBufferPhysicalMapping( IN NDIS_HANDLE NdisAdapterHandle, IN PNDIS_BUFFER Buffer, @@ -467,7 +448,7 @@ NdisCompleteBufferPhysicalMapping( VOID -STDCALL +EXPORT NdisCompleteRequest( IN NDIS_HANDLE NdisBindingContext, IN PNDIS_REQUEST NdisRequest, @@ -478,7 +459,7 @@ NdisCompleteRequest( VOID -STDCALL +EXPORT NdisCompleteReset( IN NDIS_HANDLE NdisBindingContext, IN NDIS_STATUS Status) @@ -488,7 +469,7 @@ NdisCompleteReset( VOID -STDCALL +EXPORT NdisCompleteSend( IN NDIS_HANDLE NdisBindingContext, IN PNDIS_PACKET Packet, @@ -499,7 +480,7 @@ NdisCompleteSend( VOID -STDCALL +EXPORT NdisCompleteTransferData( IN NDIS_HANDLE NdisBindingContext, IN PNDIS_PACKET Packet, @@ -511,7 +492,7 @@ NdisCompleteTransferData( VOID -STDCALL +EXPORT NdisIndicateReceive( OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingContext, @@ -527,7 +508,7 @@ NdisIndicateReceive( VOID -STDCALL +EXPORT NdisIndicateReceiveComplete( IN NDIS_HANDLE NdisBindingContext) { @@ -536,7 +517,7 @@ NdisIndicateReceiveComplete( VOID -STDCALL +EXPORT NdisIndicateStatus( IN NDIS_HANDLE NdisBindingContext, IN NDIS_STATUS GeneralStatus, @@ -548,7 +529,7 @@ NdisIndicateStatus( VOID -STDCALL +EXPORT NdisIndicateStatusComplete( IN NDIS_HANDLE NdisBindingContext) { @@ -557,7 +538,7 @@ NdisIndicateStatusComplete( NDIS_STATUS -STDCALL +EXPORT NdisPciAssignResources( IN NDIS_HANDLE NdisMacHandle, IN NDIS_HANDLE NdisWrapperHandle, @@ -572,7 +553,7 @@ NdisPciAssignResources( VOID -STDCALL +EXPORT NdisReadBindingInformation ( OUT PNDIS_STATUS Status, OUT PNDIS_STRING * Binding, @@ -583,7 +564,7 @@ NdisReadBindingInformation ( ULONG -STDCALL +EXPORT NdisReadDmaCounter( IN NDIS_HANDLE NdisDmaHandle) { @@ -594,7 +575,7 @@ NdisReadDmaCounter( VOID -STDCALL +EXPORT NdisStartBufferPhysicalMapping( IN NDIS_HANDLE NdisAdapterHandle, IN PNDIS_BUFFER Buffer, @@ -608,7 +589,7 @@ NdisStartBufferPhysicalMapping( BOOLEAN -STDCALL +EXPORT NdisSynchronizeWithInterrupt( IN PNDIS_INTERRUPT Interrupt, IN PVOID SynchronizeFunction, @@ -621,7 +602,7 @@ NdisSynchronizeWithInterrupt( VOID -STDCALL +EXPORT NdisUnmapIoSpace( IN NDIS_HANDLE NdisAdapterHandle, IN PVOID VirtualAddress, @@ -632,7 +613,7 @@ NdisUnmapIoSpace( NDIS_STATUS -STDCALL +EXPORT TrChangeFunctionalAddress( IN PTR_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle, @@ -647,7 +628,7 @@ TrChangeFunctionalAddress( NDIS_STATUS -STDCALL +EXPORT TrChangeGroupAddress( IN PTR_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle, @@ -662,7 +643,7 @@ TrChangeGroupAddress( BOOLEAN -STDCALL +EXPORT TrCreateFilter( IN TR_ADDRESS_CHANGE AddressChangeAction, IN TR_GROUP_CHANGE GroupChangeAction, @@ -679,7 +660,7 @@ TrCreateFilter( VOID -STDCALL +EXPORT TrDeleteFilter( IN PTR_FILTER Filter) { @@ -688,7 +669,7 @@ TrDeleteFilter( NDIS_STATUS -STDCALL +EXPORT TrDeleteFilterOpenAdapter ( IN PTR_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle, @@ -701,7 +682,7 @@ TrDeleteFilterOpenAdapter ( NDIS_STATUS -STDCALL +EXPORT TrFilterAdjust( IN PTR_FILTER Filter, IN NDIS_HANDLE NdisFilterHandle, @@ -716,7 +697,7 @@ TrFilterAdjust( VOID -STDCALL +EXPORT TrFilterIndicateReceive( IN PTR_FILTER Filter, IN NDIS_HANDLE MacReceiveContext, @@ -731,7 +712,7 @@ TrFilterIndicateReceive( VOID -STDCALL +EXPORT TrFilterIndicateReceiveComplete( IN PTR_FILTER Filter) { @@ -740,7 +721,7 @@ TrFilterIndicateReceiveComplete( BOOLEAN -STDCALL +EXPORT TrNoteFilterOpenAdapter( IN PTR_FILTER Filter, IN NDIS_HANDLE MacBindingHandle, @@ -754,7 +735,7 @@ TrNoteFilterOpenAdapter( BOOLEAN -STDCALL +EXPORT TrShouldAddressLoopBack( IN PTR_FILTER Filter, IN CHAR DestinationAddress [TR_LENGTH_OF_ADDRESS], diff --git a/reactos/drivers/net/ndis/ndis/50gone.c b/reactos/drivers/net/ndis/ndis/50gone.c index 9e476859dc7..1f1a4b5bc84 100644 --- a/reactos/drivers/net/ndis/ndis/50gone.c +++ b/reactos/drivers/net/ndis/ndis/50gone.c @@ -11,7 +11,7 @@ VOID -STDCALL +EXPORT NdisCompleteCloseAdapter( IN NDIS_HANDLE NdisBindingContext, IN NDIS_STATUS Status) @@ -27,7 +27,7 @@ NdisCompleteCloseAdapter( VOID -STDCALL +EXPORT NdisCompleteOpenAdapter( IN NDIS_HANDLE NdisBindingContext, IN NDIS_STATUS Status, @@ -44,7 +44,7 @@ NdisCompleteOpenAdapter( NDIS_STATUS -STDCALL +EXPORT NdisDeregisterAdapter( IN NDIS_HANDLE NdisAdapterHandle) /* @@ -61,7 +61,7 @@ NdisDeregisterAdapter( VOID -STDCALL +EXPORT NdisDeregisterAdapterShutdownHandler( IN NDIS_HANDLE NdisAdapterHandle) /* @@ -76,7 +76,7 @@ NdisDeregisterAdapterShutdownHandler( VOID -STDCALL +EXPORT NdisDeregisterMac( OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisMacHandle) @@ -92,7 +92,7 @@ NdisDeregisterMac( VOID -STDCALL +EXPORT NdisFreeDmaChannel( IN PNDIS_HANDLE NdisDmaHandle) /* @@ -107,7 +107,7 @@ NdisFreeDmaChannel( VOID -STDCALL +EXPORT NdisFreeSharedMemory( IN NDIS_HANDLE NdisAdapterHandle, IN ULONG Length, @@ -126,7 +126,7 @@ NdisFreeSharedMemory( NDIS_STATUS -STDCALL +EXPORT NdisIMQueueMiniportCallback( IN NDIS_HANDLE MiniportAdapterHandle, IN W_MINIPORT_CALLBACK CallbackRoutine, @@ -145,7 +145,7 @@ NdisIMQueueMiniportCallback( VOID -STDCALL +EXPORT NdisIMRevertBack( IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_HANDLE SwitchHandle) @@ -161,7 +161,7 @@ NdisIMRevertBack( BOOLEAN -STDCALL +EXPORT NdisIMSwitchToMiniport( IN NDIS_HANDLE MiniportAdapterHandle, OUT PNDIS_HANDLE SwitchHandle) @@ -179,7 +179,7 @@ NdisIMSwitchToMiniport( VOID -STDCALL +EXPORT NdisInitializeInterrupt( OUT PNDIS_STATUS Status, IN OUT PNDIS_INTERRUPT Interrupt, @@ -203,7 +203,7 @@ NdisInitializeInterrupt( VOID -STDCALL +EXPORT NdisMapIoSpace( OUT PNDIS_STATUS Status, OUT PVOID *VirtualAddress, @@ -222,7 +222,7 @@ NdisMapIoSpace( VOID -STDCALL +EXPORT NdisOverrideBusNumber( IN NDIS_HANDLE WrapperConfigurationContext, IN NDIS_HANDLE MiniportAdapterHandle OPTIONAL, @@ -239,7 +239,7 @@ NdisOverrideBusNumber( NDIS_STATUS -STDCALL +EXPORT NdisQueryReceiveInformation( IN NDIS_HANDLE NdisBindingHandle, IN NDIS_HANDLE MacContext, @@ -262,7 +262,7 @@ NdisQueryReceiveInformation( VOID -STDCALL +EXPORT NdisReadMcaPosInformation( OUT PNDIS_STATUS Status, IN NDIS_HANDLE WrapperConfigurationContext, @@ -280,7 +280,7 @@ NdisReadMcaPosInformation( NDIS_STATUS -STDCALL +EXPORT NdisRegisterAdapter( OUT PNDIS_HANDLE NdisAdapterHandle, IN NDIS_HANDLE NdisMacHandle, @@ -302,7 +302,7 @@ NdisRegisterAdapter( VOID -STDCALL +EXPORT NdisRegisterAdapterShutdownHandler( IN NDIS_HANDLE NdisAdapterHandle, IN PVOID ShutdownContext, @@ -319,7 +319,7 @@ NdisRegisterAdapterShutdownHandler( VOID -STDCALL +EXPORT NdisRegisterMac( OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE NdisMacHandle, @@ -339,7 +339,7 @@ NdisRegisterMac( VOID -STDCALL +EXPORT NdisReleaseAdapterResources( IN NDIS_HANDLE NdisAdapterHandle) /* @@ -354,7 +354,7 @@ NdisReleaseAdapterResources( VOID -STDCALL +EXPORT NdisRemoveInterrupt( IN PNDIS_INTERRUPT Interrupt) /* @@ -369,7 +369,7 @@ NdisRemoveInterrupt( VOID -STDCALL +EXPORT NdisSetupDmaTransfer( OUT PNDIS_STATUS Status, IN PNDIS_HANDLE NdisDmaHandle, @@ -388,10 +388,8 @@ NdisSetupDmaTransfer( } -#undef NdisUpdateSharedMemory - VOID -STDCALL +EXPORT NdisUpdateSharedMemory( IN NDIS_HANDLE NdisAdapterHandle, IN ULONG Length, diff --git a/reactos/drivers/net/ndis/ndis/buffer.c b/reactos/drivers/net/ndis/ndis/buffer.c index 10d2e4baec6..fdaf4b2aa3b 100644 --- a/reactos/drivers/net/ndis/ndis/buffer.c +++ b/reactos/drivers/net/ndis/ndis/buffer.c @@ -9,7 +9,7 @@ */ #include -#define PAGE_ROUND_DOWN(x) (((ULONG)x)&(~0xfff)) + __inline ULONG SkipToOffset( PNDIS_BUFFER Buffer, @@ -239,7 +239,7 @@ UINT CopyPacketToBufferChain( return 0; /* Skip SrcOffset bytes in the source packet */ - NdisGetFirstBufferFromPacket((PNDIS_PACKET)SrcPacket, &SrcBuffer, (PVOID*)&SrcData, &SrcSize, &Total); + NdisGetFirstBufferFromPacket(SrcPacket, &SrcBuffer, (PVOID)&SrcData, &SrcSize, &Total); if (SkipToOffset(SrcBuffer, SrcOffset, &SrcData, &SrcSize) == -1) return 0; @@ -288,10 +288,8 @@ UINT CopyPacketToBufferChain( -#undef NdisAdjustBufferLength - VOID -STDCALL +EXPORT NdisAdjustBufferLength( IN PNDIS_BUFFER Buffer, IN UINT Length) @@ -305,10 +303,9 @@ NdisAdjustBufferLength( Buffer->ByteCount = Length; } -#undef NDIS_BUFFER_TO_SPAN_PAGES ULONG -STDCALL +EXPORT NDIS_BUFFER_TO_SPAN_PAGES( IN PNDIS_BUFFER Buffer) /* @@ -327,7 +324,7 @@ NDIS_BUFFER_TO_SPAN_PAGES( VOID -STDCALL +EXPORT NdisAllocateBuffer( OUT PNDIS_STATUS Status, OUT PNDIS_BUFFER * Buffer, @@ -394,7 +391,7 @@ NdisAllocateBuffer( VOID -STDCALL +EXPORT NdisAllocateBufferPool( OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE PoolHandle, @@ -440,7 +437,7 @@ NdisAllocateBufferPool( VOID -STDCALL +EXPORT NdisAllocatePacket( OUT PNDIS_STATUS Status, OUT PNDIS_PACKET * Packet, @@ -481,7 +478,7 @@ NdisAllocatePacket( VOID -STDCALL +EXPORT NdisAllocatePacketPool( OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE PoolHandle, @@ -534,7 +531,7 @@ NdisAllocatePacketPool( VOID -STDCALL +EXPORT NdisAllocatePacketPoolEx( OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE PoolHandle, @@ -552,10 +549,8 @@ NdisAllocatePacketPoolEx( } -#undef NdisBufferLength - ULONG -STDCALL +EXPORT NdisBufferLength( IN PNDIS_BUFFER Buffer) /* @@ -574,7 +569,7 @@ NdisBufferLength( PVOID -STDCALL +EXPORT NdisBufferVirtualAddress( IN PNDIS_BUFFER Buffer) /* @@ -591,7 +586,7 @@ NdisBufferVirtualAddress( VOID -STDCALL +EXPORT NdisCopyBuffer( OUT PNDIS_STATUS Status, OUT PNDIS_BUFFER *Buffer, @@ -615,7 +610,7 @@ NdisCopyBuffer( VOID -STDCALL +EXPORT NdisCopyFromPacketToPacket( IN PNDIS_PACKET Destination, IN UINT DestinationOffset, @@ -643,12 +638,12 @@ NdisCopyFromPacketToPacket( *BytesCopied = 0; /* Skip DestinationOffset bytes in the destination packet */ - NdisGetFirstBufferFromPacket(Destination, &DstBuffer, (PVOID*)&DstData, &DstSize, &Total); + NdisGetFirstBufferFromPacket(Destination, &DstBuffer, (PVOID)&DstData, &DstSize, &Total); if (SkipToOffset(DstBuffer, DestinationOffset, &DstData, &DstSize) == -1) return; /* Skip SourceOffset bytes in the source packet */ - NdisGetFirstBufferFromPacket(Source, &SrcBuffer, (PVOID*)&SrcData, &SrcSize, &Total); + NdisGetFirstBufferFromPacket(Source, &SrcBuffer, (PVOID)&SrcData, &SrcSize, &Total); if (SkipToOffset(SrcBuffer, SourceOffset, &SrcData, &SrcSize) == -1) return; @@ -697,7 +692,7 @@ NdisCopyFromPacketToPacket( VOID -STDCALL +EXPORT NdisDprAllocatePacket( OUT PNDIS_STATUS Status, OUT PNDIS_PACKET *Packet, @@ -714,7 +709,7 @@ NdisDprAllocatePacket( VOID -STDCALL +EXPORT NdisDprAllocatePacketNonInterlocked( OUT PNDIS_STATUS Status, OUT PNDIS_PACKET *Packet, @@ -732,7 +727,7 @@ NdisDprAllocatePacketNonInterlocked( VOID -STDCALL +EXPORT NdisDprFreePacket( IN PNDIS_PACKET Packet) /* @@ -745,7 +740,7 @@ NdisDprFreePacket( VOID -STDCALL +EXPORT NdisDprFreePacketNonInterlocked( IN PNDIS_PACKET Packet) /* @@ -758,7 +753,7 @@ NdisDprFreePacketNonInterlocked( VOID -STDCALL +EXPORT NdisFreeBufferPool( IN NDIS_HANDLE PoolHandle) /* @@ -772,7 +767,7 @@ NdisFreeBufferPool( VOID -STDCALL +EXPORT NdisFreePacketPool( IN NDIS_HANDLE PoolHandle) /* @@ -786,7 +781,7 @@ NdisFreePacketPool( VOID -STDCALL +EXPORT NdisFreeBuffer( IN PNDIS_BUFFER Buffer) /* @@ -811,7 +806,7 @@ NdisFreeBuffer( VOID -STDCALL +EXPORT NdisFreePacket( IN PNDIS_PACKET Packet) /* @@ -831,10 +826,8 @@ NdisFreePacket( } -#undef NdisGetBufferPhysicalArraySize - VOID -STDCALL +EXPORT NdisGetBufferPhysicalArraySize( IN PNDIS_BUFFER Buffer, OUT PUINT ArraySize) @@ -849,10 +842,8 @@ NdisGetBufferPhysicalArraySize( } -#undef NdisGetFirstBufferFromPacket - VOID -STDCALL +EXPORT NdisGetFirstBufferFromPacket( IN PNDIS_PACKET _Packet, OUT PNDIS_BUFFER *_FirstBuffer, @@ -891,7 +882,7 @@ NdisGetFirstBufferFromPacket( VOID -STDCALL +EXPORT NdisReturnPackets( IN PNDIS_PACKET *PacketsToReturn, IN UINT NumberOfPackets) @@ -907,7 +898,7 @@ NdisReturnPackets( UINT -STDCALL +EXPORT NdisPacketPoolUsage( IN NDIS_HANDLE PoolHandle) /* @@ -923,10 +914,8 @@ NdisPacketPoolUsage( } -#undef NdisQueryBuffer - VOID -STDCALL +EXPORT NdisQueryBuffer( IN PNDIS_BUFFER Buffer, OUT PVOID *VirtualAddress OPTIONAL, @@ -947,10 +936,8 @@ NdisQueryBuffer( } -#undef NdisQueryBufferOffset - VOID -STDCALL +EXPORT NdisQueryBufferOffset( IN PNDIS_BUFFER Buffer, OUT PUINT Offset, @@ -961,10 +948,8 @@ NdisQueryBufferOffset( } -#undef NdisUnchainBufferAtBack - VOID -STDCALL +EXPORT NdisUnchainBufferAtBack( IN OUT PNDIS_PACKET Packet, OUT PNDIS_BUFFER *Buffer) @@ -1008,10 +993,8 @@ NdisUnchainBufferAtBack( } -#undef NdisUnchainBufferAtFront - VOID -STDCALL +EXPORT NdisUnchainBufferAtFront( IN OUT PNDIS_PACKET Packet, OUT PNDIS_BUFFER *Buffer) diff --git a/reactos/drivers/net/ndis/ndis/cl.c b/reactos/drivers/net/ndis/ndis/cl.c index a5fbcd490d3..7a24f74458c 100644 --- a/reactos/drivers/net/ndis/ndis/cl.c +++ b/reactos/drivers/net/ndis/ndis/cl.c @@ -9,8 +9,9 @@ */ #include + NDIS_STATUS -STDCALL +EXPIMP NdisClAddParty( IN NDIS_HANDLE NdisVcHandle, IN NDIS_HANDLE ProtocolPartyContext, @@ -30,7 +31,7 @@ NdisClAddParty( NDIS_STATUS -STDCALL +EXPIMP NdisClCloseAddressFamily( IN NDIS_HANDLE NdisAfHandle) /* @@ -47,7 +48,7 @@ NdisClCloseAddressFamily( NDIS_STATUS -STDCALL +EXPIMP NdisClCloseCall( IN NDIS_HANDLE NdisVcHandle, IN NDIS_HANDLE NdisPartyHandle OPTIONAL, @@ -67,7 +68,7 @@ NdisClCloseCall( NDIS_STATUS -STDCALL +EXPIMP NdisClDeregisterSap( IN NDIS_HANDLE NdisSapHandle) /* @@ -84,7 +85,7 @@ NdisClDeregisterSap( NDIS_STATUS -STDCALL +EXPIMP NdisClDropParty( IN NDIS_HANDLE NdisPartyHandle, IN PVOID Buffer OPTIONAL, @@ -103,7 +104,7 @@ NdisClDropParty( VOID -STDCALL +EXPIMP NdisClIncomingCallComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisVcHandle, @@ -120,7 +121,7 @@ NdisClIncomingCallComplete( NDIS_STATUS -STDCALL +EXPIMP NdisClMakeCall( IN NDIS_HANDLE NdisVcHandle, IN OUT PCO_CALL_PARAMETERS CallParameters, @@ -140,7 +141,7 @@ NdisClMakeCall( NDIS_STATUS -STDCALL +EXPIMP NdisClModifyCallQoS( IN NDIS_HANDLE NdisVcHandle, IN PCO_CALL_PARAMETERS CallParameters) @@ -158,7 +159,7 @@ NdisClModifyCallQoS( NDIS_STATUS -STDCALL +EXPIMP NdisClOpenAddressFamily( IN NDIS_HANDLE NdisBindingHandle, IN PCO_ADDRESS_FAMILY AddressFamily, @@ -180,7 +181,7 @@ NdisClOpenAddressFamily( NDIS_STATUS -STDCALL +EXPIMP NdisClRegisterSap( IN NDIS_HANDLE NdisAfHandle, IN NDIS_HANDLE ProtocolSapContext, diff --git a/reactos/drivers/net/ndis/ndis/cm.c b/reactos/drivers/net/ndis/ndis/cm.c index de72eca2553..d6e0ca9fa1d 100644 --- a/reactos/drivers/net/ndis/ndis/cm.c +++ b/reactos/drivers/net/ndis/ndis/cm.c @@ -11,7 +11,7 @@ NDIS_STATUS -STDCALL +EXPORT NdisCmActivateVc( IN NDIS_HANDLE NdisVcHandle, IN OUT PCO_CALL_PARAMETERS CallParameters) @@ -29,7 +29,7 @@ NdisCmActivateVc( VOID -STDCALL +EXPORT NdisCmAddPartyComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisPartyHandle, @@ -47,7 +47,7 @@ NdisCmAddPartyComplete( VOID -STDCALL +EXPORT NdisCmCloseAddressFamilyComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisAfHandle) @@ -63,7 +63,7 @@ NdisCmCloseAddressFamilyComplete( VOID -STDCALL +EXPORT NdisCmCloseCallComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisVcHandle, @@ -80,7 +80,7 @@ NdisCmCloseCallComplete( NDIS_STATUS -STDCALL +EXPORT NdisCmDeactivateVc( IN NDIS_HANDLE NdisVcHandle) /* @@ -97,7 +97,7 @@ NdisCmDeactivateVc( VOID -STDCALL +EXPORT NdisCmDeregisterSapComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisSapHandle) @@ -113,7 +113,7 @@ NdisCmDeregisterSapComplete( VOID -STDCALL +EXPORT NdisCmDispatchCallConnected( IN NDIS_HANDLE NdisVcHandle) /* @@ -128,7 +128,7 @@ NdisCmDispatchCallConnected( NDIS_STATUS -STDCALL +EXPORT NdisCmDispatchIncomingCall( IN NDIS_HANDLE NdisSapHandle, IN NDIS_HANDLE NdisVcHandle, @@ -147,7 +147,7 @@ NdisCmDispatchIncomingCall( VOID -STDCALL +EXPORT NdisCmDispatchIncomingCallQoSChange( IN NDIS_HANDLE NdisVcHandle, IN PCO_CALL_PARAMETERS CallParameters) @@ -163,7 +163,7 @@ NdisCmDispatchIncomingCallQoSChange( VOID -STDCALL +EXPORT NdisCmDispatchIncomingCloseCall( IN NDIS_STATUS CloseStatus, IN NDIS_HANDLE NdisVcHandle, @@ -181,7 +181,7 @@ NdisCmDispatchIncomingCloseCall( VOID -STDCALL +EXPORT NdisCmDispatchIncomingDropParty( IN NDIS_STATUS DropStatus, IN NDIS_HANDLE NdisPartyHandle, @@ -199,7 +199,7 @@ NdisCmDispatchIncomingDropParty( VOID -STDCALL +EXPORT NdisCmDropPartyComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisPartyHandle) @@ -215,7 +215,7 @@ NdisCmDropPartyComplete( VOID -STDCALL +EXPORT NdisCmMakeCallComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisVcHandle, @@ -234,7 +234,7 @@ NdisCmMakeCallComplete( VOID -STDCALL +EXPORT NdisCmModifyCallQoSComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisVcHandle, @@ -251,7 +251,7 @@ NdisCmModifyCallQoSComplete( VOID -STDCALL +EXPORT NdisCmOpenAddressFamilyComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisAfHandle, @@ -268,7 +268,7 @@ NdisCmOpenAddressFamilyComplete( NDIS_STATUS -STDCALL +EXPORT NdisCmRegisterAddressFamily( IN NDIS_HANDLE NdisBindingHandle, IN PCO_ADDRESS_FAMILY AddressFamily, @@ -288,7 +288,7 @@ NdisCmRegisterAddressFamily( VOID -STDCALL +EXPORT NdisCmRegisterSapComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisSapHandle, @@ -306,7 +306,7 @@ NdisCmRegisterSapComplete( NDIS_STATUS -STDCALL +EXPORT NdisMCmActivateVc( IN NDIS_HANDLE NdisVcHandle, IN PCO_CALL_PARAMETERS CallParameters) @@ -324,7 +324,7 @@ NdisMCmActivateVc( NDIS_STATUS -STDCALL +EXPORT NdisMCmCreateVc( IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_HANDLE NdisAfHandle, @@ -344,7 +344,7 @@ NdisMCmCreateVc( NDIS_STATUS -STDCALL +EXPORT NdisMCmDeactivateVc( IN NDIS_HANDLE NdisVcHandle) /* @@ -361,7 +361,7 @@ NdisMCmDeactivateVc( NDIS_STATUS -STDCALL +EXPORT NdisMCmDeleteVc( IN NDIS_HANDLE NdisVcHandle) /* @@ -378,7 +378,7 @@ NdisMCmDeleteVc( NDIS_STATUS -STDCALL +EXPORT NdisMCmRegisterAddressFamily( IN NDIS_HANDLE MiniportAdapterHandle, IN PCO_ADDRESS_FAMILY AddressFamily, @@ -397,7 +397,7 @@ NdisMCmRegisterAddressFamily( } NDIS_STATUS -STDCALL +EXPORT NdisMCmRequest( IN NDIS_HANDLE NdisAfHandle, IN NDIS_HANDLE NdisVcHandle OPTIONAL, diff --git a/reactos/drivers/net/ndis/ndis/co.c b/reactos/drivers/net/ndis/ndis/co.c index 00a914f5283..c560cc42e96 100644 --- a/reactos/drivers/net/ndis/ndis/co.c +++ b/reactos/drivers/net/ndis/ndis/co.c @@ -11,7 +11,7 @@ NDIS_STATUS -STDCALL +EXPORT NdisCoCreateVc( IN NDIS_HANDLE NdisBindingHandle, IN NDIS_HANDLE NdisAfHandle OPTIONAL, @@ -31,7 +31,7 @@ NdisCoCreateVc( NDIS_STATUS -STDCALL +EXPORT NdisCoDeleteVc( IN NDIS_HANDLE NdisVcHandle) /* @@ -48,7 +48,7 @@ NdisCoDeleteVc( NDIS_STATUS -STDCALL +EXPORT NdisCoRequest( IN NDIS_HANDLE NdisBindingHandle, IN NDIS_HANDLE NdisAfHandle OPTIONAL, @@ -69,7 +69,7 @@ NdisCoRequest( VOID -STDCALL +EXPORT NdisCoRequestComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisAfHandle, @@ -88,7 +88,7 @@ NdisCoRequestComplete( VOID -STDCALL +EXPORT NdisCoSendPackets( IN NDIS_HANDLE NdisVcHandle, IN PPNDIS_PACKET PacketArray, @@ -106,7 +106,7 @@ NdisCoSendPackets( VOID -STDCALL +EXPORT NdisMCoActivateVcComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisVcHandle, @@ -123,7 +123,7 @@ NdisMCoActivateVcComplete( VOID -STDCALL +EXPORT NdisMCoDeactivateVcComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisVcHandle) @@ -139,7 +139,7 @@ NdisMCoDeactivateVcComplete( VOID -STDCALL +EXPORT NdisMCoIndicateReceivePacket( IN NDIS_HANDLE NdisVcHandle, IN PPNDIS_PACKET PacketArray, @@ -156,7 +156,7 @@ NdisMCoIndicateReceivePacket( VOID -STDCALL +EXPORT NdisMCoIndicateStatus( IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_HANDLE NdisVcHandle OPTIONAL, @@ -175,7 +175,7 @@ NdisMCoIndicateStatus( VOID -STDCALL +EXPORT NdisMCoReceiveComplete( IN NDIS_HANDLE MiniportAdapterHandle) /* @@ -190,7 +190,7 @@ NdisMCoReceiveComplete( VOID -STDCALL +EXPORT NdisMCoRequestComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE MiniportAdapterHandle, @@ -207,7 +207,7 @@ NdisMCoRequestComplete( VOID -STDCALL +EXPORT NdisMCoSendComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisVcHandle, diff --git a/reactos/drivers/net/ndis/ndis/control.c b/reactos/drivers/net/ndis/ndis/control.c index 7552638cfd6..3947bc520d3 100644 --- a/reactos/drivers/net/ndis/ndis/control.c +++ b/reactos/drivers/net/ndis/ndis/control.c @@ -10,7 +10,7 @@ #include VOID -STDCALL +EXPORT NdisReinitializePacket( IN OUT PNDIS_PACKET Packet) { @@ -19,7 +19,7 @@ NdisReinitializePacket( } VOID -STDCALL +EXPORT NdisAcquireReadWriteLock( IN PNDIS_RW_LOCK Lock, IN BOOLEAN fWrite, @@ -34,10 +34,9 @@ NdisAcquireReadWriteLock( UNIMPLEMENTED } -#undef NdisAcquireSpinLock VOID -STDCALL +EXPORT NdisAcquireSpinLock( IN PNDIS_SPIN_LOCK SpinLock) /* @@ -49,10 +48,9 @@ NdisAcquireSpinLock( UNIMPLEMENTED } -#undef NdisAllocateSpinLock VOID -STDCALL +EXPORT NdisAllocateSpinLock( IN PNDIS_SPIN_LOCK SpinLock) /* @@ -64,10 +62,9 @@ NdisAllocateSpinLock( UNIMPLEMENTED } -#undef NdisDprAcquireSpinLock VOID -STDCALL +EXPORT NdisDprAcquireSpinLock( IN PNDIS_SPIN_LOCK SpinLock) /* @@ -79,10 +76,9 @@ NdisDprAcquireSpinLock( UNIMPLEMENTED } -#undef NdisDprReleaseSpinLock VOID -STDCALL +EXPORT NdisDprReleaseSpinLock( IN PNDIS_SPIN_LOCK SpinLock) /* @@ -95,10 +91,8 @@ NdisDprReleaseSpinLock( } -#undef NdisFreeSpinLock - VOID -STDCALL +EXPORT NdisFreeSpinLock( IN PNDIS_SPIN_LOCK SpinLock) /* @@ -112,7 +106,7 @@ NdisFreeSpinLock( VOID -STDCALL +EXPORT NdisGetCurrentProcessorCpuUsage( PULONG pCpuUsage) /* @@ -126,7 +120,7 @@ NdisGetCurrentProcessorCpuUsage( VOID -STDCALL +EXPORT NdisInitializeEvent( IN PNDIS_EVENT Event) /* @@ -139,10 +133,8 @@ NdisInitializeEvent( } -#undef NdisReleaseSpinLock - VOID -STDCALL +EXPORT NdisReleaseSpinLock( IN PNDIS_SPIN_LOCK SpinLock) /* @@ -156,7 +148,7 @@ NdisReleaseSpinLock( VOID -STDCALL +EXPORT NdisResetEvent( IN PNDIS_EVENT Event) /* @@ -170,7 +162,7 @@ NdisResetEvent( VOID -STDCALL +EXPORT NdisSetEvent( IN PNDIS_EVENT Event) /* @@ -184,7 +176,7 @@ NdisSetEvent( BOOLEAN -STDCALL +EXPORT NdisWaitEvent( IN PNDIS_EVENT Event, IN UINT MsToWait) diff --git a/reactos/drivers/net/ndis/ndis/hardware.c b/reactos/drivers/net/ndis/ndis/hardware.c index 09a0eade788..8fcbb80e46b 100644 --- a/reactos/drivers/net/ndis/ndis/hardware.c +++ b/reactos/drivers/net/ndis/ndis/hardware.c @@ -11,7 +11,7 @@ ULONG -STDCALL +EXPORT NdisImmediateReadPciSlotInformation( IN NDIS_HANDLE WrapperConfigurationContext, IN ULONG SlotNumber, @@ -26,7 +26,7 @@ NdisImmediateReadPciSlotInformation( ULONG -STDCALL +EXPORT NdisImmediateWritePciSlotInformation( IN NDIS_HANDLE WrapperConfigurationContext, IN ULONG SlotNumber, @@ -41,7 +41,7 @@ NdisImmediateWritePciSlotInformation( NDIS_STATUS -STDCALL +EXPORT NdisMPciAssignResources( IN NDIS_HANDLE MiniportHandle, IN ULONG SlotNumber, @@ -54,7 +54,7 @@ NdisMPciAssignResources( VOID -STDCALL +EXPORT NdisMQueryAdapterResources( OUT PNDIS_STATUS Status, IN NDIS_HANDLE WrapperConfigurationContext, @@ -66,7 +66,7 @@ NdisMQueryAdapterResources( NDIS_STATUS -STDCALL +EXPORT NdisQueryMapRegisterCount( IN NDIS_INTERFACE_TYPE BusType, OUT PUINT MapRegisterCount) @@ -78,7 +78,7 @@ NdisQueryMapRegisterCount( VOID -STDCALL +EXPORT NdisReadEisaSlotInformation( OUT PNDIS_STATUS Status, IN NDIS_HANDLE WrapperConfigurationContext, @@ -90,7 +90,7 @@ NdisReadEisaSlotInformation( VOID -STDCALL +EXPORT NdisReadEisaSlotInformationEx( OUT PNDIS_STATUS Status, IN NDIS_HANDLE WrapperConfigurationContext, @@ -103,7 +103,7 @@ NdisReadEisaSlotInformationEx( ULONG -STDCALL +EXPORT NdisReadPciSlotInformation( IN NDIS_HANDLE NdisAdapterHandle, IN ULONG SlotNumber, @@ -118,7 +118,7 @@ NdisReadPciSlotInformation( ULONG -STDCALL +EXPORT NdisWritePciSlotInformation( IN NDIS_HANDLE NdisAdapterHandle, IN ULONG SlotNumber, diff --git a/reactos/drivers/net/ndis/ndis/io.c b/reactos/drivers/net/ndis/ndis/io.c index b580adbb7f1..8ba5b984297 100644 --- a/reactos/drivers/net/ndis/ndis/io.c +++ b/reactos/drivers/net/ndis/ndis/io.c @@ -85,7 +85,7 @@ BOOLEAN STDCALL ServiceRoutine( VOID -STDCALL +EXPORT NdisCompleteDmaTransfer( OUT PNDIS_STATUS Status, IN PNDIS_HANDLE NdisDmaHandle, @@ -99,7 +99,7 @@ NdisCompleteDmaTransfer( VOID -STDCALL +EXPORT NdisFlushBuffer( IN PNDIS_BUFFER Buffer, IN BOOLEAN WriteToDevice) @@ -109,7 +109,7 @@ NdisFlushBuffer( ULONG -STDCALL +EXPORT NdisGetCacheFillSize( VOID) { @@ -120,7 +120,7 @@ NdisGetCacheFillSize( VOID -STDCALL +EXPORT NdisImmediateReadPortUchar( IN NDIS_HANDLE WrapperConfigurationContext, IN ULONG Port, @@ -131,7 +131,7 @@ NdisImmediateReadPortUchar( VOID -STDCALL +EXPORT NdisImmediateReadPortUlong( IN NDIS_HANDLE WrapperConfigurationContext, IN ULONG Port, @@ -142,7 +142,7 @@ NdisImmediateReadPortUlong( VOID -STDCALL +EXPORT NdisImmediateReadPortUshort( IN NDIS_HANDLE WrapperConfigurationContext, IN ULONG Port, @@ -153,7 +153,7 @@ NdisImmediateReadPortUshort( VOID -STDCALL +EXPORT NdisImmediateWritePortUchar( IN NDIS_HANDLE WrapperConfigurationContext, IN ULONG Port, @@ -164,7 +164,7 @@ NdisImmediateWritePortUchar( VOID -STDCALL +EXPORT NdisImmediateWritePortUlong( IN NDIS_HANDLE WrapperConfigurationContext, IN ULONG Port, @@ -175,7 +175,7 @@ NdisImmediateWritePortUlong( VOID -STDCALL +EXPORT NdisImmediateWritePortUshort( IN NDIS_HANDLE WrapperConfigurationContext, IN ULONG Port, @@ -186,7 +186,7 @@ NdisImmediateWritePortUshort( NDIS_STATUS -STDCALL +EXPORT NdisMAllocateMapRegisters( IN NDIS_HANDLE MiniportAdapterHandle, IN UINT DmaChannel, @@ -201,7 +201,7 @@ NdisMAllocateMapRegisters( VOID -STDCALL +EXPORT NdisMCompleteDmaTransfer( OUT PNDIS_STATUS Status, IN PNDIS_HANDLE MiniportDmaHandle, @@ -215,7 +215,7 @@ NdisMCompleteDmaTransfer( VOID -STDCALL +EXPORT NdisMDeregisterDmaChannel( IN PNDIS_HANDLE MiniportDmaHandle) { @@ -224,7 +224,7 @@ NdisMDeregisterDmaChannel( VOID -STDCALL +EXPORT NdisMDeregisterInterrupt( IN PNDIS_MINIPORT_INTERRUPT Interrupt) /* @@ -238,7 +238,7 @@ NdisMDeregisterInterrupt( VOID -STDCALL +EXPORT NdisMDeregisterIoPortRange( IN NDIS_HANDLE MiniportAdapterHandle, IN UINT InitialPort, @@ -260,7 +260,7 @@ NdisMDeregisterIoPortRange( VOID -STDCALL +EXPORT NdisMFreeMapRegisters( IN NDIS_HANDLE MiniportAdapterHandle) { @@ -269,7 +269,7 @@ NdisMFreeMapRegisters( NDIS_STATUS -STDCALL +EXPORT NdisMMapIoSpace( OUT PVOID *VirtualAddress, IN NDIS_HANDLE MiniportAdapterHandle, @@ -283,7 +283,7 @@ NdisMMapIoSpace( ULONG -STDCALL +EXPORT NdisMReadDmaCounter( IN NDIS_HANDLE MiniportDmaHandle) { @@ -294,7 +294,7 @@ NdisMReadDmaCounter( NDIS_STATUS -STDCALL +EXPORT NdisMRegisterDmaChannel( OUT PNDIS_HANDLE MiniportDmaHandle, IN NDIS_HANDLE MiniportAdapterHandle, @@ -310,7 +310,7 @@ NdisMRegisterDmaChannel( NDIS_STATUS -STDCALL +EXPORT NdisMRegisterInterrupt( OUT PNDIS_MINIPORT_INTERRUPT Interrupt, IN NDIS_HANDLE MiniportAdapterHandle, @@ -395,7 +395,7 @@ NdisMRegisterInterrupt( NDIS_STATUS -STDCALL +EXPORT NdisMRegisterIoPortRange( OUT PVOID *PortOffset, IN NDIS_HANDLE MiniportAdapterHandle, @@ -441,7 +441,7 @@ NdisMRegisterIoPortRange( VOID -STDCALL +EXPORT NdisMSetupDmaTransfer( OUT PNDIS_STATUS Status, IN PNDIS_HANDLE MiniportDmaHandle, @@ -455,7 +455,7 @@ NdisMSetupDmaTransfer( VOID -STDCALL +EXPORT NdisMUnmapIoSpace( IN NDIS_HANDLE MiniportAdapterHandle, IN PVOID VirtualAddress, diff --git a/reactos/drivers/net/ndis/ndis/main.c b/reactos/drivers/net/ndis/ndis/main.c index eee48463922..4188cf762bd 100644 --- a/reactos/drivers/net/ndis/ndis/main.c +++ b/reactos/drivers/net/ndis/ndis/main.c @@ -20,9 +20,7 @@ DWORD DebugTraceLevel = MIN_TRACE; #endif /* DBG */ -VOID -STDCALL -MainUnload( +VOID MainUnload( PDRIVER_OBJECT DriverObject) /* * FUNCTION: Unloads the driver @@ -35,7 +33,9 @@ MainUnload( NTSTATUS +#ifndef _MSC_VER STDCALL +#endif DriverEntry( PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) @@ -59,8 +59,11 @@ DriverEntry( InitializeListHead(&AdapterListHead); KeInitializeSpinLock(&AdapterListLock); +#ifdef _MSC_VER DriverObject->DriverUnload = MainUnload; - //DriverObject->DriverUnload = (PDRIVER_UNLOAD)MainUnload; +#else + DriverObject->DriverUnload = (PDRIVER_UNLOAD)MainUnload; +#endif return STATUS_SUCCESS; } diff --git a/reactos/drivers/net/ndis/ndis/memory.c b/reactos/drivers/net/ndis/ndis/memory.c index e525fe7dca1..f4facd2016b 100644 --- a/reactos/drivers/net/ndis/ndis/memory.c +++ b/reactos/drivers/net/ndis/ndis/memory.c @@ -11,7 +11,7 @@ NDIS_STATUS -STDCALL +EXPORT NdisAllocateMemoryWithTag( OUT PVOID *VirtualAddress, IN UINT Length, @@ -29,10 +29,8 @@ NdisAllocateMemoryWithTag( } -#undef NdisCreateLookaheadBufferFromSharedMemory - VOID -STDCALL +EXPORT NdisCreateLookaheadBufferFromSharedMemory( IN PVOID pSharedMemory, IN UINT LookaheadLength, @@ -42,10 +40,8 @@ NdisCreateLookaheadBufferFromSharedMemory( } -#undef NdisDestroyLookaheadBufferFromSharedMemory - VOID -STDCALL +EXPORT NdisDestroyLookaheadBufferFromSharedMemory( IN PVOID pLookaheadBuffer) { @@ -53,10 +49,8 @@ NdisDestroyLookaheadBufferFromSharedMemory( } -#undef NdisMoveFromMappedMemory - VOID -STDCALL +EXPORT NdisMoveFromMappedMemory( OUT PVOID Destination, IN PVOID Source, @@ -66,10 +60,8 @@ NdisMoveFromMappedMemory( } -#undef NdisMoveMappedMemory - VOID -STDCALL +EXPORT NdisMoveMappedMemory( OUT PVOID Destination, IN PVOID Source, @@ -79,10 +71,8 @@ NdisMoveMappedMemory( } -#undef NdisMoveToMappedMemory - VOID -STDCALL +EXPORT NdisMoveToMappedMemory( OUT PVOID Destination, IN PVOID Source, @@ -92,10 +82,8 @@ NdisMoveToMappedMemory( } -#undef NdisMUpdateSharedMemory - VOID -STDCALL +EXPORT NdisMUpdateSharedMemory( IN NDIS_HANDLE MiniportAdapterHandle, IN ULONG Length, @@ -107,7 +95,7 @@ NdisMUpdateSharedMemory( NDIS_STATUS -STDCALL +EXPORT NdisAllocateMemory( OUT PVOID *VirtualAddress, IN UINT Length, @@ -148,7 +136,7 @@ NdisAllocateMemory( VOID -STDCALL +EXPORT NdisFreeMemory( IN PVOID VirtualAddress, IN UINT Length, @@ -177,7 +165,7 @@ NdisFreeMemory( VOID -STDCALL +EXPORT NdisImmediateReadSharedMemory( IN NDIS_HANDLE WrapperConfigurationContext, IN ULONG SharedMemoryAddress, @@ -188,7 +176,7 @@ NdisImmediateReadSharedMemory( VOID -STDCALL +EXPORT NdisImmediateWriteSharedMemory( IN NDIS_HANDLE WrapperConfigurationContext, IN ULONG SharedMemoryAddress, @@ -200,7 +188,7 @@ NdisImmediateWriteSharedMemory( VOID -STDCALL +EXPORT NdisMAllocateSharedMemory( IN NDIS_HANDLE MiniportAdapterHandle, IN ULONG Length, @@ -213,7 +201,7 @@ NdisMAllocateSharedMemory( NDIS_STATUS -STDCALL +EXPORT NdisMAllocateSharedMemoryAsync( IN NDIS_HANDLE MiniportAdapterHandle, IN ULONG Length, @@ -227,7 +215,7 @@ NdisMAllocateSharedMemoryAsync( VOID -STDCALL +EXPORT NdisMFreeSharedMemory( IN NDIS_HANDLE MiniportAdapterHandle, IN ULONG Length, diff --git a/reactos/drivers/net/ndis/ndis/miniport.c b/reactos/drivers/net/ndis/ndis/miniport.c index fa3b8f2f8d8..3b1a69d0a0b 100644 --- a/reactos/drivers/net/ndis/ndis/miniport.c +++ b/reactos/drivers/net/ndis/ndis/miniport.c @@ -7,13 +7,13 @@ * REVISIONS: * CSH 01/08-2000 Created */ -#include #include #include #ifdef DBG #include #endif /* DBG */ + /* Number of media we know */ #define MEDIA_ARRAY_SIZE 15 @@ -142,8 +142,8 @@ MiniIndicateData( KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); - (*AdapterBinding->ProtocolBinding->Chars.ReceiveHandler)( - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext, + (*AdapterBinding->ProtocolBinding->Chars.u4.ReceiveHandler)( + AdapterBinding->NdisOpenBlock.ProtocolBindingContext, MacReceiveContext, HeaderBuffer, HeaderBufferSize, @@ -187,7 +187,7 @@ MiniEthReceiveComplete( KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); (*AdapterBinding->ProtocolBinding->Chars.ReceiveCompleteHandler)( - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext); + AdapterBinding->NdisOpenBlock.ProtocolBindingContext); KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); @@ -260,8 +260,8 @@ MiniSendComplete( AdapterBinding = (PADAPTER_BINDING)Packet->Reserved[0]; - (*AdapterBinding->ProtocolBinding->Chars.SendCompleteHandler)( - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext, + (*AdapterBinding->ProtocolBinding->Chars.u2.SendCompleteHandler)( + AdapterBinding->NdisOpenBlock.ProtocolBindingContext, Packet, Status); } @@ -287,8 +287,8 @@ MiniTransferDataComplete( NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); - (*AdapterBinding->ProtocolBinding->Chars.TransferDataCompleteHandler)( - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext, + (*AdapterBinding->ProtocolBinding->Chars.u3.TransferDataCompleteHandler)( + AdapterBinding->NdisOpenBlock.ProtocolBindingContext, Packet, Status, BytesTransferred); @@ -493,11 +493,9 @@ MiniQueueWorkItem( } else { Item = ExAllocatePool(NonPagedPool, sizeof(NDIS_MINIPORT_WORK_ITEM)); if (Item) { -#if 0 /* Set flag so we know that the buffer should be freed when work item is dequeued */ Item->Allocated = TRUE; -#endif } else { NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); return NDIS_STATUS_RESOURCES; @@ -506,9 +504,8 @@ MiniQueueWorkItem( Item->WorkItemType = WorkItemType; Item->WorkItemContext = WorkItemContext; -#if 0 Item->Initiator = Initiator; -#endif + Item->Link.Next = NULL; if (!Adapter->WorkQueueHead) { Adapter->WorkQueueHead = Item; @@ -554,12 +551,9 @@ MiniDequeueWorkItem( *WorkItemType = Item->WorkItemType; *WorkItemContext = Item->WorkItemContext; -#if 0 *Initiator = Item->Initiator; + if (Item->Allocated) { -#else - if (TRUE) { -#endif ExFreePool(Item); } else { Adapter->WorkQueueLevel--; @@ -716,7 +710,7 @@ VOID STDCALL MiniportDpc( VOID -STDCALL +EXPORT NdisMCloseLog( IN NDIS_HANDLE LogHandle) { @@ -725,7 +719,7 @@ NdisMCloseLog( NDIS_STATUS -STDCALL +EXPORT NdisMCreateLog( IN NDIS_HANDLE MiniportAdapterHandle, IN UINT Size, @@ -738,7 +732,7 @@ NdisMCreateLog( VOID -STDCALL +EXPORT NdisMDeregisterAdapterShutdownHandler( IN NDIS_HANDLE MiniportHandle) { @@ -747,7 +741,7 @@ NdisMDeregisterAdapterShutdownHandler( VOID -STDCALL +EXPORT NdisMFlushLog( IN NDIS_HANDLE LogHandle) { @@ -755,10 +749,8 @@ NdisMFlushLog( } -#undef NdisMIndicateStatus - VOID -STDCALL +EXPORT NdisMIndicateStatus( IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_STATUS GeneralStatus, @@ -769,10 +761,8 @@ NdisMIndicateStatus( } -#undef NdisMIndicateStatusComplete - VOID -STDCALL +EXPORT NdisMIndicateStatusComplete( IN NDIS_HANDLE MiniportAdapterHandle) { @@ -781,7 +771,7 @@ NdisMIndicateStatusComplete( VOID -STDCALL +EXPORT NdisInitializeWrapper( OUT PNDIS_HANDLE NdisWrapperHandle, IN PVOID SystemSpecific1, @@ -826,10 +816,8 @@ NdisInitializeWrapper( } -#undef NdisMQueryInformationComplete - VOID -STDCALL +EXPORT NdisMQueryInformationComplete( IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_STATUS Status) @@ -840,14 +828,14 @@ NdisMQueryInformationComplete( NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); (*AdapterBinding->ProtocolBinding->Chars.RequestCompleteHandler)( - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext, + AdapterBinding->NdisOpenBlock.ProtocolBindingContext, Adapter->NdisMiniportBlock.MediaRequest, Status); } VOID -STDCALL +EXPORT NdisMRegisterAdapterShutdownHandler( IN NDIS_HANDLE MiniportHandle, IN PVOID ShutdownContext, @@ -954,7 +942,7 @@ DoQueries( NDIS_STATUS -STDCALL +EXPORT NdisMRegisterMiniport( IN NDIS_HANDLE NdisWrapperHandle, IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics, @@ -984,15 +972,15 @@ NdisMRegisterMiniport( switch (MiniportCharacteristics->MajorNdisVersion) { case 0x03: - MinSize = sizeof(NDIS30_MINIPORT_CHARACTERISTICS); + MinSize = sizeof(NDIS30_MINIPORT_CHARACTERISTICS_S); break; case 0x04: - MinSize = sizeof(NDIS40_MINIPORT_CHARACTERISTICS); + MinSize = sizeof(NDIS40_MINIPORT_CHARACTERISTICS_S); break; case 0x05: - MinSize = sizeof(NDIS50_MINIPORT_CHARACTERISTICS); + MinSize = sizeof(NDIS50_MINIPORT_CHARACTERISTICS_S); break; default: @@ -1042,7 +1030,7 @@ NdisMRegisterMiniport( /* Create the device object for this adapter */ /* FIXME: Use GUIDs */ - RtlInitUnicodeString(&Adapter->DeviceName, L"\\Device\\ne2000"); + RtlInitUnicodeStringFromLiteral(&Adapter->DeviceName, L"\\Device\\ne2000"); Status = IoCreateDevice(Miniport->DriverObject, 0, &Adapter->DeviceName, @@ -1109,11 +1097,11 @@ NdisMRegisterMiniport( AddressOID = OID_802_3_CURRENT_ADDRESS; Adapter->AddressLength = ETH_LENGTH_OF_ADDRESS; - Adapter->NdisMiniportBlock.FilterDbs.EthDB = ExAllocatePool(NonPagedPool, + Adapter->NdisMiniportBlock.FilterDbs.u.EthDB = ExAllocatePool(NonPagedPool, sizeof(ETH_FILTER)); - if (Adapter->NdisMiniportBlock.FilterDbs.EthDB) { - RtlZeroMemory(Adapter->NdisMiniportBlock.FilterDbs.EthDB, sizeof(ETH_FILTER)); - Adapter->NdisMiniportBlock.FilterDbs.EthDB->Miniport = (PNDIS_MINIPORT_BLOCK)Adapter; + if (Adapter->NdisMiniportBlock.FilterDbs.u.EthDB) { + RtlZeroMemory(Adapter->NdisMiniportBlock.FilterDbs.u.EthDB, sizeof(ETH_FILTER)); + Adapter->NdisMiniportBlock.FilterDbs.u.EthDB->Miniport = (PNDIS_MINIPORT_BLOCK)Adapter; } else MemError = TRUE; break; @@ -1154,7 +1142,7 @@ NdisMRegisterMiniport( VOID -STDCALL +EXPORT NdisMResetComplete( IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_STATUS Status, @@ -1167,7 +1155,7 @@ NdisMResetComplete( VOID -STDCALL +EXPORT NdisMSendComplete( IN NDIS_HANDLE MiniportAdapterHandle, IN PNDIS_PACKET Packet, @@ -1188,7 +1176,7 @@ NdisMSendComplete( VOID -STDCALL +EXPORT NdisMSendResourcesAvailable( IN NDIS_HANDLE MiniportAdapterHandle) { @@ -1197,7 +1185,7 @@ NdisMSendResourcesAvailable( VOID -STDCALL +EXPORT NdisMTransferDataComplete( IN NDIS_HANDLE MiniportAdapterHandle, IN PNDIS_PACKET Packet, @@ -1211,10 +1199,8 @@ NdisMTransferDataComplete( } -#undef NdisMSetInformationComplete - VOID -STDCALL +EXPORT NdisMSetInformationComplete( IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_STATUS Status) @@ -1225,16 +1211,14 @@ NdisMSetInformationComplete( NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); (*AdapterBinding->ProtocolBinding->Chars.RequestCompleteHandler)( - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext, + AdapterBinding->NdisOpenBlock.ProtocolBindingContext, Adapter->NdisMiniportBlock.MediaRequest, Status); } -#undef NdisMSetAttributes - VOID -STDCALL +EXPORT NdisMSetAttributes( IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_HANDLE MiniportAdapterContext, @@ -1261,7 +1245,7 @@ NdisMSetAttributes( VOID -STDCALL +EXPORT NdisMSetAttributesEx( IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_HANDLE MiniportAdapterContext, @@ -1284,7 +1268,7 @@ NdisMSetAttributesEx( VOID -STDCALL +EXPORT NdisMSleep( IN ULONG MicrosecondsToSleep) { @@ -1293,7 +1277,7 @@ NdisMSleep( BOOLEAN -STDCALL +EXPORT NdisMSynchronizeWithInterrupt( IN PNDIS_MINIPORT_INTERRUPT Interrupt, IN PVOID SynchronizeFunction, @@ -1306,7 +1290,7 @@ NdisMSynchronizeWithInterrupt( NDIS_STATUS -STDCALL +EXPORT NdisMWriteLogData( IN NDIS_HANDLE LogHandle, IN PVOID LogBuffer, @@ -1319,7 +1303,7 @@ NdisMWriteLogData( VOID -STDCALL +EXPORT NdisTerminateWrapper( IN NDIS_HANDLE NdisWrapperHandle, IN PVOID SystemSpecific) diff --git a/reactos/drivers/net/ndis/ndis/protocol.c b/reactos/drivers/net/ndis/ndis/protocol.c index 7a395dff320..60937e6d35a 100644 --- a/reactos/drivers/net/ndis/ndis/protocol.c +++ b/reactos/drivers/net/ndis/ndis/protocol.c @@ -294,7 +294,7 @@ ProTransferData( VOID -STDCALL +EXPORT NdisCloseAdapter( OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle) @@ -327,7 +327,7 @@ NdisCloseAdapter( VOID -STDCALL +EXPORT NdisDeregisterProtocol( OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisProtocolHandle) @@ -357,7 +357,7 @@ NdisDeregisterProtocol( VOID -STDCALL +EXPORT NdisOpenAdapter( OUT PNDIS_STATUS Status, OUT PNDIS_STATUS OpenErrorStatus, @@ -428,18 +428,18 @@ NdisOpenAdapter( AdapterBinding->ProtocolBinding = Protocol; AdapterBinding->Adapter = Adapter; - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext = ProtocolBindingContext; + AdapterBinding->NdisOpenBlock.ProtocolBindingContext = ProtocolBindingContext; /* Set fields required by some NDIS macros */ - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.BindingHandle = (NDIS_HANDLE)AdapterBinding; + AdapterBinding->NdisOpenBlock.MacBindingHandle = (NDIS_HANDLE)AdapterBinding; /* Set handlers (some NDIS macros require these) */ - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.RequestHandler = ProRequest; - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ResetHandler = ProReset; - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.SendHandler = ProSend; - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.SendPacketsHandler = ProSendPackets; - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.TransferDataHandler = ProTransferData; + AdapterBinding->NdisOpenBlock.RequestHandler = ProRequest; + AdapterBinding->NdisOpenBlock.ResetHandler = ProReset; + AdapterBinding->NdisOpenBlock.u1.SendHandler = ProSend; + AdapterBinding->NdisOpenBlock.SendPacketsHandler = ProSendPackets; + AdapterBinding->NdisOpenBlock.TransferDataHandler = ProTransferData; /* Put on protocol's bound adapters list */ ExInterlockedInsertTailList(&Protocol->AdapterListHead, @@ -458,7 +458,7 @@ NdisOpenAdapter( VOID -STDCALL +EXPORT NdisRegisterProtocol( OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE NdisProtocolHandle, @@ -481,15 +481,15 @@ NdisRegisterProtocol( switch (ProtocolCharacteristics->MajorNdisVersion) { case 0x03: - MinSize = sizeof(NDIS30_PROTOCOL_CHARACTERISTICS); + MinSize = sizeof(NDIS30_PROTOCOL_CHARACTERISTICS_S); break; case 0x04: - MinSize = sizeof(NDIS40_PROTOCOL_CHARACTERISTICS); + MinSize = sizeof(NDIS40_PROTOCOL_CHARACTERISTICS_S); break; case 0x05: - MinSize = sizeof(NDIS50_PROTOCOL_CHARACTERISTICS); + MinSize = sizeof(NDIS50_PROTOCOL_CHARACTERISTICS_S); break; default: @@ -540,7 +540,7 @@ NdisRegisterProtocol( VOID -STDCALL +EXPORT NdisRequest( OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle, @@ -558,7 +558,7 @@ NdisRequest( VOID -STDCALL +EXPORT NdisReset( OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle) @@ -568,7 +568,7 @@ NdisReset( VOID -STDCALL +EXPORT NdisSend( OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle, @@ -586,7 +586,7 @@ NdisSend( VOID -STDCALL +EXPORT NdisSendPackets( IN NDIS_HANDLE NdisBindingHandle, IN PPNDIS_PACKET PacketArray, @@ -597,7 +597,7 @@ NdisSendPackets( VOID -STDCALL +EXPORT NdisTransferData( OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle, diff --git a/reactos/drivers/net/ndis/ndis/string.c b/reactos/drivers/net/ndis/ndis/string.c index 8844320dc8c..bd9fbb8183c 100644 --- a/reactos/drivers/net/ndis/ndis/string.c +++ b/reactos/drivers/net/ndis/ndis/string.c @@ -11,7 +11,7 @@ NDIS_STATUS -STDCALL +EXPORT NdisAnsiStringToUnicodeString( IN OUT PNDIS_STRING DestinationString, IN PNDIS_ANSI_STRING SourceString) @@ -28,10 +28,8 @@ NdisAnsiStringToUnicodeString( } -#undef NdisEqualString - BOOLEAN -STDCALL +EXPORT NdisEqualString( IN PNDIS_STRING String1, IN PNDIS_STRING String2, @@ -45,14 +43,14 @@ NdisEqualString( */ { return RtlEqualUnicodeString( - (CONST UNICODE_STRING*)String1, - (CONST UNICODE_STRING*)String2, + (PUNICODE_STRING)String1, + (PUNICODE_STRING)String2, CaseInsensitive); } VOID -STDCALL +EXPORT NdisInitAnsiString( IN OUT PNDIS_ANSI_STRING DestinationString, IN PCSTR SourceString) @@ -70,7 +68,7 @@ NdisInitAnsiString( VOID -STDCALL +EXPORT NdisInitializeString( IN OUT PNDIS_STRING DestinationString, IN PUCHAR SourceString) @@ -95,7 +93,7 @@ NdisInitializeString( VOID -STDCALL +EXPORT NdisInitUnicodeString( IN OUT PNDIS_STRING DestinationString, IN PCWSTR SourceString) @@ -113,7 +111,7 @@ NdisInitUnicodeString( NDIS_STATUS -STDCALL +EXPORT NdisUnicodeStringToAnsiString( IN OUT PNDIS_ANSI_STRING DestinationString, IN PNDIS_STRING SourceString) @@ -132,7 +130,7 @@ NdisUnicodeStringToAnsiString( NTSTATUS -STDCALL +EXPORT NdisUpcaseUnicodeString( OUT PUNICODE_STRING DestinationString, IN PUNICODE_STRING SourceString) diff --git a/reactos/drivers/net/ndis/ndis/stubs.c b/reactos/drivers/net/ndis/ndis/stubs.c index 97cc312a38b..76c2eb2cef1 100644 --- a/reactos/drivers/net/ndis/ndis/stubs.c +++ b/reactos/drivers/net/ndis/ndis/stubs.c @@ -11,7 +11,7 @@ VOID -STDCALL +EXPORT NdisCompleteBindAdapter( IN NDIS_HANDLE BindAdapterContext, IN NDIS_STATUS Status, @@ -22,7 +22,7 @@ NdisCompleteBindAdapter( VOID -STDCALL +EXPORT NdisCompleteQueryStatistics( IN NDIS_HANDLE NdisAdapterHandle, IN PNDIS_REQUEST NdisRequest, @@ -33,7 +33,7 @@ NdisCompleteQueryStatistics( VOID -STDCALL +EXPORT NdisCompleteUnbindAdapter( IN NDIS_HANDLE UnbindAdapterContext, IN NDIS_STATUS Status) @@ -41,20 +41,18 @@ NdisCompleteUnbindAdapter( UNIMPLEMENTED } -#undef NdisInitializeListHead VOID -STDCALL +EXPORT NdisInitializeListHead( IN PLIST_ENTRY ListHead) { UNIMPLEMENTED } -#undef NdisInterlockedAddUlong VOID -STDCALL +EXPORT NdisInterlockedAddUlong ( IN PULONG Addend, IN ULONG Increment, @@ -63,10 +61,9 @@ NdisInterlockedAddUlong ( UNIMPLEMENTED } -#undef NdisInterlockedInsertHeadList PLIST_ENTRY -STDCALL +EXPORT NdisInterlockedInsertHeadList( IN PLIST_ENTRY ListHead, IN PLIST_ENTRY ListEntry, @@ -78,10 +75,8 @@ NdisInterlockedInsertHeadList( } -#undef NdisInterlockedInsertTailList - PLIST_ENTRY -STDCALL +EXPORT NdisInterlockedInsertTailList( IN PLIST_ENTRY ListHead, IN PLIST_ENTRY ListEntry, @@ -92,10 +87,9 @@ NdisInterlockedInsertTailList( return NULL; } -#undef NdisInterlockedRemoveHeadList PLIST_ENTRY -STDCALL +EXPORT NdisInterlockedRemoveHeadList( IN PLIST_ENTRY ListHead, IN PNDIS_SPIN_LOCK SpinLock) @@ -107,7 +101,7 @@ NdisInterlockedRemoveHeadList( VOID -STDCALL +EXPORT NdisMCompleteBufferPhysicalMapping( IN NDIS_HANDLE MiniportAdapterHandle, IN PNDIS_BUFFER Buffer, @@ -117,7 +111,7 @@ NdisMCompleteBufferPhysicalMapping( VOID -STDCALL +EXPORT NdisMStartBufferPhysicalMapping( IN NDIS_HANDLE MiniportAdapterHandle, IN PNDIS_BUFFER Buffer, @@ -131,7 +125,7 @@ NdisMStartBufferPhysicalMapping( VOID -STDCALL +EXPORT NdisMapFile( OUT PNDIS_STATUS Status, OUT PVOID * MappedBuffer, @@ -142,7 +136,7 @@ NdisMapFile( VOID -STDCALL +EXPORT NdisWriteConfiguration( OUT PNDIS_STATUS Status, IN NDIS_HANDLE WrapperConfigurationContext, @@ -154,19 +148,19 @@ NdisWriteConfiguration( VOID -CDECL +EXPORT NdisWriteErrorLogEntry( IN NDIS_HANDLE NdisAdapterHandle, IN NDIS_ERROR_CODE ErrorCode, IN ULONG NumberOfErrorValues, - IN ...) + /* IN ULONG */ ...) { UNIMPLEMENTED } VOID -STDCALL +EXPORT NdisCloseConfiguration( IN NDIS_HANDLE ConfigurationHandle) { @@ -175,7 +169,7 @@ NdisCloseConfiguration( VOID -STDCALL +EXPORT NdisCloseFile( IN NDIS_HANDLE FileHandle) { @@ -184,7 +178,7 @@ NdisCloseFile( NDIS_STATUS -STDCALL +EXPORT NdisIMDeInitializeDeviceInstance( IN NDIS_HANDLE NdisMiniportHandle) { @@ -193,10 +187,9 @@ NdisIMDeInitializeDeviceInstance( return NDIS_STATUS_FAILURE; } -#undef NdisIMInitializeDeviceInstance NDIS_STATUS -STDCALL +EXPORT NdisIMInitializeDeviceInstance( IN NDIS_HANDLE DriverHandle, IN PNDIS_STRING DeviceInstance) @@ -208,7 +201,7 @@ NdisIMInitializeDeviceInstance( NDIS_STATUS -STDCALL +EXPORT NdisIMRegisterLayeredMiniport( IN NDIS_HANDLE NdisWrapperHandle, IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics, @@ -222,7 +215,7 @@ NdisIMRegisterLayeredMiniport( VOID -STDCALL +EXPORT NdisMWanIndicateReceive( OUT PNDIS_STATUS Status, IN NDIS_HANDLE MiniportAdapterHandle, @@ -235,7 +228,7 @@ NdisMWanIndicateReceive( VOID -STDCALL +EXPORT NdisMWanIndicateReceiveComplete( IN NDIS_HANDLE MiniportAdapterHandle) { @@ -244,7 +237,7 @@ NdisMWanIndicateReceiveComplete( VOID -STDCALL +EXPORT NdisMWanSendComplete( IN NDIS_HANDLE MiniportAdapterHandle, IN PNDIS_WAN_PACKET Packet, @@ -255,7 +248,7 @@ NdisMWanSendComplete( VOID -STDCALL +EXPORT NdisOpenConfiguration( OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE ConfigurationHandle, @@ -272,7 +265,7 @@ NdisOpenConfigurationKeyByName VOID -STDCALL +EXPORT NdisOpenFile( OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE FileHandle, @@ -289,7 +282,7 @@ NdisOpenGlobalConfiguration */ VOID -STDCALL +EXPORT NdisOpenProtocolConfiguration( OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE ConfigurationHandle, @@ -300,7 +293,7 @@ NdisOpenProtocolConfiguration( VOID -STDCALL +EXPORT NdisReadConfiguration( OUT PNDIS_STATUS Status, OUT PNDIS_CONFIGURATION_PARAMETER * ParameterValue, @@ -313,7 +306,7 @@ NdisReadConfiguration( VOID -STDCALL +EXPORT NdisReadNetworkAddress( OUT PNDIS_STATUS Status, OUT PVOID * NetworkAddress, @@ -326,7 +319,7 @@ NdisReadNetworkAddress( #if 0 VOID -STDCALL +EXPORT NdisRegisterTdiCallBack( IN TDI_REGISTER_CALLBACK RegsterCallback) { @@ -342,7 +335,7 @@ NdisScheduleWorkItem #if 0 VOID -STDCALL +EXPORT NdisSetProtocolFilter( OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle, @@ -359,7 +352,7 @@ NdisSetProtocolFilter( CCHAR -STDCALL +EXPORT NdisSystemProcessorCount( VOID) { @@ -368,7 +361,7 @@ NdisSystemProcessorCount( VOID -STDCALL +EXPORT NdisUnmapFile( IN NDIS_HANDLE FileHandle) { @@ -391,7 +384,7 @@ NdisWriteEventLogEntry /* NDIS 5.0 extensions */ VOID -STDCALL +EXPORT NdisCompletePnPEvent( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle, @@ -406,10 +399,9 @@ NdisCompletePnPEvent( UNIMPLEMENTED } -typedef PVOID PATM_ADDRESS; VOID -STDCALL +EXPORT NdisConvertStringToAtmAddress( OUT PNDIS_STATUS Status, IN PNDIS_STRING String, @@ -426,7 +418,7 @@ NdisConvertStringToAtmAddress( VOID -STDCALL +EXPORT NdisGetCurrentProcessorCounts( OUT PULONG pIdleCount, OUT PULONG pKernelAndUser, @@ -443,7 +435,7 @@ NdisGetCurrentProcessorCounts( VOID -STDCALL +EXPORT NdisGetDriverHandle( IN PNDIS_HANDLE NdisBindingHandle, OUT PNDIS_HANDLE NdisDriverHandle) @@ -459,7 +451,7 @@ NdisGetDriverHandle( PNDIS_PACKET -STDCALL +EXPORT NdisGetReceivedPacket( IN PNDIS_HANDLE NdisBindingHandle, IN PNDIS_HANDLE MacContext) @@ -477,7 +469,7 @@ NdisGetReceivedPacket( VOID -STDCALL +EXPORT NdisGetSystemUptime( OUT PULONG pSystemUpTime) /* @@ -492,7 +484,7 @@ NdisGetSystemUptime( VOID -STDCALL +EXPORT NdisInitializeReadWriteLock( IN PNDIS_RW_LOCK Lock) /* @@ -505,10 +497,9 @@ NdisInitializeReadWriteLock( UNIMPLEMENTED } -#undef NdisInterlockedDecrement LONG -STDCALL +EXPORT NdisInterlockedDecrement( IN PLONG Addend) /* @@ -523,10 +514,9 @@ NdisInterlockedDecrement( return 0; } -#undef NdisInterlockedIncrement LONG -STDCALL +EXPORT NdisInterlockedIncrement( IN PLONG Addend) /* @@ -543,7 +533,7 @@ NdisInterlockedIncrement( PSINGLE_LIST_ENTRY -STDCALL +EXPORT NdisInterlockedPopEntrySList( IN PSLIST_HEADER ListHead, IN PKSPIN_LOCK Lock) @@ -561,7 +551,7 @@ NdisInterlockedPopEntrySList( PSINGLE_LIST_ENTRY -STDCALL +EXPORT NdisInterlockedPushEntrySList( IN PSLIST_HEADER ListHead, IN PSINGLE_LIST_ENTRY ListEntry, @@ -580,7 +570,7 @@ NdisInterlockedPushEntrySList( NDIS_STATUS -STDCALL +EXPORT NdisMDeregisterDevice( IN NDIS_HANDLE NdisDeviceHandle) /* @@ -597,7 +587,7 @@ NdisMDeregisterDevice( VOID -STDCALL +EXPORT NdisMGetDeviceProperty( IN NDIS_HANDLE MiniportAdapterHandle, IN OUT PDEVICE_OBJECT *PhysicalDeviceObject OPTIONAL, @@ -617,7 +607,7 @@ NdisMGetDeviceProperty( NDIS_STATUS -STDCALL +EXPORT NdisMInitializeScatterGatherDma( IN NDIS_HANDLE MiniportAdapterHandle, IN BOOLEAN Dma64BitAddresses, @@ -636,7 +626,7 @@ NdisMInitializeScatterGatherDma( NDIS_STATUS -STDCALL +EXPORT NdisMPromoteMiniport( IN NDIS_HANDLE MiniportAdapterHandle) /* @@ -653,7 +643,7 @@ NdisMPromoteMiniport( NDIS_STATUS -STDCALL +EXPORT NdisMQueryAdapterInstanceName( OUT PNDIS_STRING AdapterInstanceName, IN NDIS_HANDLE MiniportAdapterHandle) @@ -671,7 +661,7 @@ NdisMQueryAdapterInstanceName( NDIS_STATUS -STDCALL +EXPORT NdisMRegisterDevice( IN NDIS_HANDLE NdisWrapperHandle, IN PNDIS_STRING DeviceName, @@ -693,7 +683,7 @@ NdisMRegisterDevice( VOID -STDCALL +EXPORT NdisMRegisterUnloadHandler( IN NDIS_HANDLE NdisWrapperHandle, IN PDRIVER_UNLOAD UnloadHandler) @@ -709,7 +699,7 @@ NdisMRegisterUnloadHandler( NDIS_STATUS -STDCALL +EXPORT NdisMRemoveMiniport( IN NDIS_HANDLE MiniportAdapterHandle) /* @@ -726,7 +716,7 @@ NdisMRemoveMiniport( NDIS_STATUS -STDCALL +EXPORT NdisMSetMiniportSecondary( IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_HANDLE PrimaryMiniportAdapterHandle) @@ -744,7 +734,7 @@ NdisMSetMiniportSecondary( VOID -STDCALL +EXPORT NdisOpenConfigurationKeyByIndex( OUT PNDIS_STATUS Status, IN NDIS_HANDLE ConfigurationHandle, @@ -763,7 +753,7 @@ NdisOpenConfigurationKeyByIndex( VOID -STDCALL +EXPORT NdisOpenConfigurationKeyByName( OUT PNDIS_STATUS Status, IN NDIS_HANDLE ConfigurationHandle, @@ -781,7 +771,7 @@ NdisOpenConfigurationKeyByName( NDIS_STATUS -STDCALL +EXPORT NdisQueryAdapterInstanceName( OUT PNDIS_STRING AdapterInstanceName, IN NDIS_HANDLE NdisBindingHandle) @@ -799,7 +789,7 @@ NdisQueryAdapterInstanceName( VOID -STDCALL +EXPORT NdisQueryBufferSafe( IN PNDIS_BUFFER Buffer, OUT PVOID *VirtualAddress OPTIONAL, @@ -817,7 +807,7 @@ NdisQueryBufferSafe( ULONG -STDCALL +EXPORT NdisReadPcmciaAttributeMemory( IN NDIS_HANDLE NdisAdapterHandle, IN ULONG Offset, @@ -837,7 +827,7 @@ NdisReadPcmciaAttributeMemory( VOID -STDCALL +EXPORT NdisReleaseReadWriteLock( IN PNDIS_RW_LOCK Lock, IN PLOCK_STATE LockState) @@ -853,7 +843,7 @@ NdisReleaseReadWriteLock( NDIS_STATUS -STDCALL +EXPORT NdisWriteEventLogEntry( IN PVOID LogHandle, IN NDIS_STATUS EventCode, @@ -876,7 +866,7 @@ NdisWriteEventLogEntry( ULONG -STDCALL +EXPORT NdisWritePcmciaAttributeMemory( IN NDIS_HANDLE NdisAdapterHandle, IN ULONG Offset, @@ -898,7 +888,7 @@ NdisWritePcmciaAttributeMemory( /* NDIS 5.0 extensions for intermediate drivers */ VOID -STDCALL +EXPORT NdisIMAssociateMiniport( IN NDIS_HANDLE DriverHandle, IN NDIS_HANDLE ProtocolHandle) @@ -914,7 +904,7 @@ NdisIMAssociateMiniport( NDIS_STATUS -STDCALL +EXPORT NdisIMCancelInitializeDeviceInstance( IN NDIS_HANDLE DriverHandle, IN PNDIS_STRING DeviceInstance) @@ -932,7 +922,7 @@ NdisIMCancelInitializeDeviceInstance( VOID -STDCALL +EXPORT NdisIMCopySendCompletePerPacketInfo( IN PNDIS_PACKET DstPacket, IN PNDIS_PACKET SrcPacket) @@ -948,7 +938,7 @@ NdisIMCopySendCompletePerPacketInfo( VOID -STDCALL +EXPORT NdisIMCopySendPerPacketInfo( IN PNDIS_PACKET DstPacket, IN PNDIS_PACKET SrcPacket) @@ -964,7 +954,7 @@ NdisIMCopySendPerPacketInfo( VOID -STDCALL +EXPORT NdisIMDeregisterLayeredMiniport( IN NDIS_HANDLE DriverHandle) /* @@ -979,7 +969,7 @@ NdisIMDeregisterLayeredMiniport( NDIS_HANDLE -STDCALL +EXPORT NdisIMGetBindingContext( IN NDIS_HANDLE NdisBindingHandle) /* @@ -996,7 +986,7 @@ NdisIMGetBindingContext( NDIS_HANDLE -STDCALL +EXPORT NdisIMGetDeviceContext( IN NDIS_HANDLE MiniportAdapterHandle) /* @@ -1013,7 +1003,7 @@ NdisIMGetDeviceContext( NDIS_STATUS -STDCALL +EXPORT NdisIMInitializeDeviceInstanceEx( IN NDIS_HANDLE DriverHandle, IN PNDIS_STRING DriverInstance, diff --git a/reactos/drivers/net/ndis/ndis/time.c b/reactos/drivers/net/ndis/ndis/time.c index f195663ea8f..95b0416e7a6 100644 --- a/reactos/drivers/net/ndis/ndis/time.c +++ b/reactos/drivers/net/ndis/ndis/time.c @@ -11,17 +11,16 @@ VOID -STDCALL +EXPORT NdisCancelTimer( IN PNDIS_TIMER Timer, OUT PBOOLEAN TimerCancelled) { } -#undef NdisGetCurrentSystemTime VOID -STDCALL +EXPORT NdisGetCurrentSystemTime ( IN OUT PLONGLONG pSystemTime) { @@ -29,7 +28,7 @@ NdisGetCurrentSystemTime ( VOID -STDCALL +EXPORT NdisInitializeTimer( IN OUT PNDIS_TIMER Timer, IN PNDIS_TIMER_FUNCTION TimerFunction, @@ -39,7 +38,7 @@ NdisInitializeTimer( VOID -STDCALL +EXPORT NdisMCancelTimer( IN PNDIS_MINIPORT_TIMER Timer, OUT PBOOLEAN TimerCancelled) @@ -48,7 +47,7 @@ NdisMCancelTimer( VOID -STDCALL +EXPORT NdisMInitializeTimer( IN OUT PNDIS_MINIPORT_TIMER Timer, IN NDIS_HANDLE MiniportAdapterHandle, @@ -59,7 +58,7 @@ NdisMInitializeTimer( VOID -STDCALL +EXPORT NdisMSetPeriodicTimer( IN PNDIS_MINIPORT_TIMER Timer, IN UINT MillisecondsPeriod) @@ -68,7 +67,7 @@ NdisMSetPeriodicTimer( VOID -STDCALL +EXPORT NdisMSetTimer( IN PNDIS_MINIPORT_TIMER Timer, IN UINT MillisecondsToDelay) @@ -77,7 +76,7 @@ NdisMSetTimer( VOID -STDCALL +EXPORT NdisSetTimer( IN PNDIS_TIMER Timer, IN UINT MillisecondsToDelay) diff --git a/reactos/drivers/net/tcpip/datalink/lan.c b/reactos/drivers/net/tcpip/datalink/lan.c index 0d99b7a17ef..1af32e93fcd 100644 --- a/reactos/drivers/net/tcpip/datalink/lan.c +++ b/reactos/drivers/net/tcpip/datalink/lan.c @@ -935,9 +935,9 @@ NTSTATUS LANRegisterProtocol( ProtChars.CloseAdapterCompleteHandler = ProtocolCloseAdapterComplete; ProtChars.ResetCompleteHandler = ProtocolResetComplete; ProtChars.RequestCompleteHandler = ProtocolRequestComplete; - ProtChars.SendCompleteHandler = ProtocolSendComplete; - ProtChars.TransferDataCompleteHandler = ProtocolTransferDataComplete; - ProtChars.ReceiveHandler = ProtocolReceive; + ProtChars.u2.SendCompleteHandler = ProtocolSendComplete; + ProtChars.u3.TransferDataCompleteHandler = ProtocolTransferDataComplete; + ProtChars.u4.ReceiveHandler = ProtocolReceive; ProtChars.ReceiveCompleteHandler = ProtocolReceiveComplete; ProtChars.StatusHandler = ProtocolStatus; ProtChars.StatusCompleteHandler = ProtocolStatusComplete; diff --git a/reactos/drivers/net/tcpip/include/debug.h b/reactos/drivers/net/tcpip/include/debug.h index fa862a51d0f..768907efc7f 100644 --- a/reactos/drivers/net/tcpip/include/debug.h +++ b/reactos/drivers/net/tcpip/include/debug.h @@ -9,9 +9,6 @@ #ifndef __DEBUG_H #define __DEBUG_H -#undef assert -#undef ASSERT - #define NORMAL_MASK 0x000000FF #define SPECIAL_MASK 0xFFFFFF00 #define MIN_TRACE 0x00000001 diff --git a/reactos/drivers/net/tcpip/include/ip.h b/reactos/drivers/net/tcpip/include/ip.h index 7e41a6e4d81..7c8be7189a4 100644 --- a/reactos/drivers/net/tcpip/include/ip.h +++ b/reactos/drivers/net/tcpip/include/ip.h @@ -184,7 +184,7 @@ typedef VOID (*IP_PROTOCOL_HANDLER)( #define LOOPBACK_ADDRMASK_IPv4 ((IPv4_RAW_ADDRESS)DH2N(0xFFFFFF00)) /* Protocol definitions */ -//#define IPPROTO_RAW 0 /* Raw IP */ +#define IPPROTO_RAW 0 /* Raw IP */ #define IPPROTO_ICMP 1 /* Internet Control Message Protocol */ #define IPPROTO_IGMP 2 /* Internet Group Management Protocol */ #define IPPROTO_TCP 6 /* Transmission Control Protocol */ diff --git a/reactos/drivers/net/tcpip/include/tcpip.h b/reactos/drivers/net/tcpip/include/tcpip.h index 6a4de2ccdf9..20876f50ebe 100644 --- a/reactos/drivers/net/tcpip/include/tcpip.h +++ b/reactos/drivers/net/tcpip/include/tcpip.h @@ -23,9 +23,9 @@ #include #else #include -#include -#include -#include +#include +#include +#include #endif #include diff --git a/reactos/drivers/net/tcpip/tcpip.rc b/reactos/drivers/net/tcpip/tcpip.rc index 30667d8cb9e..6f31df8ae57 100644 --- a/reactos/drivers/net/tcpip/tcpip.rc +++ b/reactos/drivers/net/tcpip/tcpip.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/net/tcpip/tcpip/main.c b/reactos/drivers/net/tcpip/tcpip/main.c index b588cd1626b..20cadbe3301 100644 --- a/reactos/drivers/net/tcpip/tcpip/main.c +++ b/reactos/drivers/net/tcpip/tcpip/main.c @@ -717,7 +717,7 @@ DriverEntry( /* FIXME: Create symbolic links in Win32 namespace */ /* Create IP device object */ - RtlInitUnicodeString(&strDeviceName, DD_IP_DEVICE_NAME); + RtlInitUnicodeStringFromLiteral(&strDeviceName, DD_IP_DEVICE_NAME); Status = IoCreateDevice(DriverObject, 0, &strDeviceName, FILE_DEVICE_NETWORK, 0, FALSE, &IPDeviceObject); if (!NT_SUCCESS(Status)) { @@ -726,7 +726,7 @@ DriverEntry( } /* Create RawIP device object */ - RtlInitUnicodeString(&strDeviceName, DD_RAWIP_DEVICE_NAME); + RtlInitUnicodeStringFromLiteral(&strDeviceName, DD_RAWIP_DEVICE_NAME); Status = IoCreateDevice(DriverObject, 0, &strDeviceName, FILE_DEVICE_NETWORK, 0, FALSE, &RawIPDeviceObject); if (!NT_SUCCESS(Status)) { @@ -736,7 +736,7 @@ DriverEntry( } /* Create UDP device object */ - RtlInitUnicodeString(&strDeviceName, DD_UDP_DEVICE_NAME); + RtlInitUnicodeStringFromLiteral(&strDeviceName, DD_UDP_DEVICE_NAME); Status = IoCreateDevice(DriverObject, 0, &strDeviceName, FILE_DEVICE_NETWORK, 0, FALSE, &UDPDeviceObject); if (!NT_SUCCESS(Status)) { @@ -746,7 +746,7 @@ DriverEntry( } /* Create TCP device object */ - RtlInitUnicodeString(&strDeviceName, DD_TCP_DEVICE_NAME); + RtlInitUnicodeStringFromLiteral(&strDeviceName, DD_TCP_DEVICE_NAME); Status = IoCreateDevice(DriverObject, 0, &strDeviceName, FILE_DEVICE_NETWORK, 0, FALSE, &TCPDeviceObject); if (!NT_SUCCESS(Status)) { diff --git a/reactos/drivers/net/tdi/cte/string.c b/reactos/drivers/net/tdi/cte/string.c index 66ae338188f..6926c7c80e6 100644 --- a/reactos/drivers/net/tdi/cte/string.c +++ b/reactos/drivers/net/tdi/cte/string.c @@ -1,7 +1,7 @@ -/* $Id: string.c,v 1.2 2002/09/07 15:12:06 chorns Exp $ +/* $Id: string.c,v 1.3 2002/09/08 10:22:19 chorns Exp $ * */ -#include +#include BOOLEAN STDCALL diff --git a/reactos/drivers/net/tdi/cte/stubs.c b/reactos/drivers/net/tdi/cte/stubs.c index c17429de3cb..ab6f8b0816a 100644 --- a/reactos/drivers/net/tdi/cte/stubs.c +++ b/reactos/drivers/net/tdi/cte/stubs.c @@ -1,7 +1,7 @@ -/* $Id: stubs.c,v 1.3 2002/09/07 15:12:06 chorns Exp $ +/* $Id: stubs.c,v 1.4 2002/09/08 10:22:19 chorns Exp $ * */ -#include +#include NTSTATUS diff --git a/reactos/drivers/net/tdi/misc/main.c b/reactos/drivers/net/tdi/misc/main.c index f7626d76c07..17481360954 100644 --- a/reactos/drivers/net/tdi/misc/main.c +++ b/reactos/drivers/net/tdi/misc/main.c @@ -1,8 +1,8 @@ -/* $Id: main.c,v 1.3 2002/09/07 15:12:07 chorns Exp $ +/* $Id: main.c,v 1.4 2002/09/08 10:22:19 chorns Exp $ * * DESCRIPTION: Entry point for TDI.SYS */ -#include +#include NTSTATUS STDCALL diff --git a/reactos/drivers/net/tdi/misc/tdi.rc b/reactos/drivers/net/tdi/misc/tdi.rc index 48e38e93f63..fdbc76ae3cd 100644 --- a/reactos/drivers/net/tdi/misc/tdi.rc +++ b/reactos/drivers/net/tdi/misc/tdi.rc @@ -1,5 +1,5 @@ -/* $Id: tdi.rc,v 1.2 2002/09/07 15:12:07 chorns Exp $ */ -#include +/* $Id: tdi.rc,v 1.3 2002/09/08 10:22:19 chorns Exp $ */ +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/net/tdi/tdi/dereg.c b/reactos/drivers/net/tdi/tdi/dereg.c index a54c9167a5e..047614ae7cf 100644 --- a/reactos/drivers/net/tdi/tdi/dereg.c +++ b/reactos/drivers/net/tdi/tdi/dereg.c @@ -1,8 +1,8 @@ -/* $Id: dereg.c,v 1.3 2002/09/07 15:12:07 chorns Exp $ +/* $Id: dereg.c,v 1.4 2002/09/08 10:22:20 chorns Exp $ * */ -#include -#include +#include +#include /* De-/Register Action IDs for TdiDeRegister */ diff --git a/reactos/drivers/net/tdi/tdi/handler.c b/reactos/drivers/net/tdi/tdi/handler.c index f78f15609f4..580ba0e54c0 100644 --- a/reactos/drivers/net/tdi/tdi/handler.c +++ b/reactos/drivers/net/tdi/tdi/handler.c @@ -1,9 +1,9 @@ -/* $Id: handler.c,v 1.3 2002/09/07 15:12:07 chorns Exp $ +/* $Id: handler.c,v 1.4 2002/09/08 10:22:20 chorns Exp $ * * DESCRIPTION: Default TDI event handlers. */ -#include -#include +#include +#include /* ClientEventChainedReceiveDatagram */ diff --git a/reactos/drivers/net/tdi/tdi/obsolete.c b/reactos/drivers/net/tdi/tdi/obsolete.c index 0f4881247b7..bba0ab5f36a 100644 --- a/reactos/drivers/net/tdi/tdi/obsolete.c +++ b/reactos/drivers/net/tdi/tdi/obsolete.c @@ -1,7 +1,8 @@ -/* $Id: obsolete.c,v 1.4 2002/09/07 15:12:07 chorns Exp $ +/* $Id: obsolete.c,v 1.5 2002/09/08 10:22:20 chorns Exp $ * */ -#include + +#include VOID STDCALL diff --git a/reactos/drivers/net/tdi/tdi/stubs.c b/reactos/drivers/net/tdi/tdi/stubs.c index 4f9d4b27ccf..0fb57f35cae 100644 --- a/reactos/drivers/net/tdi/tdi/stubs.c +++ b/reactos/drivers/net/tdi/tdi/stubs.c @@ -1,9 +1,9 @@ -/* $Id: stubs.c,v 1.5 2002/09/07 15:12:07 chorns Exp $ +/* $Id: stubs.c,v 1.6 2002/09/08 10:22:20 chorns Exp $ * */ -#include -#include +#include +#include VOID STDCALL diff --git a/reactos/drivers/net/tditest/include/debug.h b/reactos/drivers/net/tditest/include/debug.h index 1e7213b1e7e..ee80cc3bc14 100644 --- a/reactos/drivers/net/tditest/include/debug.h +++ b/reactos/drivers/net/tditest/include/debug.h @@ -9,9 +9,6 @@ #ifndef __DEBUG_H #define __DEBUG_H -#undef assert -#undef ASSERT - #define NORMAL_MASK 0x000000FF #define SPECIAL_MASK 0xFFFFFF00 #define MIN_TRACE 0x00000001 diff --git a/reactos/drivers/net/tditest/include/tditest.h b/reactos/drivers/net/tditest/include/tditest.h index 5f8832cdb1a..95a22080ab2 100644 --- a/reactos/drivers/net/tditest/include/tditest.h +++ b/reactos/drivers/net/tditest/include/tditest.h @@ -15,8 +15,8 @@ #include #else #include -#include -#include +#include +#include #endif #include diff --git a/reactos/drivers/net/tditest/tditest.rc b/reactos/drivers/net/tditest/tditest.rc index 88ff25c7107..37601b26e1f 100644 --- a/reactos/drivers/net/tditest/tditest.rc +++ b/reactos/drivers/net/tditest/tditest.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/net/wshtcpip/debug.h b/reactos/drivers/net/wshtcpip/debug.h index 3a7c42d74ef..ec9e995b2b0 100644 --- a/reactos/drivers/net/wshtcpip/debug.h +++ b/reactos/drivers/net/wshtcpip/debug.h @@ -9,9 +9,6 @@ #ifndef __DEBUG_H #define __DEBUG_H -#undef assert -#undef ASSERT - #define NORMAL_MASK 0x000000FF #define SPECIAL_MASK 0xFFFFFF00 #define MIN_TRACE 0x00000001 diff --git a/reactos/drivers/net/wshtcpip/makefile b/reactos/drivers/net/wshtcpip/makefile index 3ee28db3039..50ce2a75b25 100644 --- a/reactos/drivers/net/wshtcpip/makefile +++ b/reactos/drivers/net/wshtcpip/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.8 2002/09/07 15:12:08 chorns Exp $ +# $Id: makefile,v 1.9 2002/09/08 10:22:21 chorns Exp $ PATH_TO_TOP = ../../.. @@ -6,7 +6,7 @@ TARGET_TYPE = dynlink TARGET_NAME = wshtcpip -TARGET_BASE = 0x77200000 +TARGET_BASE = 0x777c0000 TARGET_CFLAGS = -DUNICODE diff --git a/reactos/drivers/net/wshtcpip/wshtcpip.c b/reactos/drivers/net/wshtcpip/wshtcpip.c index 956ff310448..84d316d4c86 100644 --- a/reactos/drivers/net/wshtcpip/wshtcpip.c +++ b/reactos/drivers/net/wshtcpip/wshtcpip.c @@ -162,7 +162,7 @@ INT EXPORT WSHGetWSAProtocolInfo( IN LPWSTR ProviderName, - OUT LPWSAPROTOCOL_INFOW* ProtocolInfo, + OUT LPWSAPROTOCOL_INFOW *ProtocolInfo, OUT LPDWORD ProtocolInfoEntries) { UNIMPLEMENTED @@ -292,18 +292,18 @@ WSHOpenSocket2( switch (*SocketType) { case SOCK_STREAM: - RtlInitUnicodeString(&String, DD_TCP_DEVICE_NAME); + RtlInitUnicodeStringFromLiteral(&String, DD_TCP_DEVICE_NAME); break; case SOCK_DGRAM: - RtlInitUnicodeString(&String, DD_UDP_DEVICE_NAME); + RtlInitUnicodeStringFromLiteral(&String, DD_UDP_DEVICE_NAME); break; case SOCK_RAW: if ((*Protocol < 0) || (*Protocol > 255)) return WSAEINVAL; - RtlInitUnicodeString(&String, DD_RAW_IP_DEVICE_NAME); + RtlInitUnicodeStringFromLiteral(&String, DD_RAW_IP_DEVICE_NAME); break; default: diff --git a/reactos/drivers/net/wshtcpip/wshtcpip.rc b/reactos/drivers/net/wshtcpip/wshtcpip.rc index 80a24434232..ec734e417a4 100644 --- a/reactos/drivers/net/wshtcpip/wshtcpip.rc +++ b/reactos/drivers/net/wshtcpip/wshtcpip.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/storage/atapi/atapi.rc b/reactos/drivers/storage/atapi/atapi.rc index 1ab499fc152..407833ab9a6 100644 --- a/reactos/drivers/storage/atapi/atapi.rc +++ b/reactos/drivers/storage/atapi/atapi.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/storage/cdrom/cdrom.c b/reactos/drivers/storage/cdrom/cdrom.c index 463798e6a7e..af7341209dd 100644 --- a/reactos/drivers/storage/cdrom/cdrom.c +++ b/reactos/drivers/storage/cdrom/cdrom.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: cdrom.c,v 1.13 2002/09/07 15:12:08 chorns Exp $ +/* $Id: cdrom.c,v 1.14 2002/09/08 10:22:22 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -34,10 +34,10 @@ /* INCLUDES *****************************************************************/ #include -#include -#include -#include + +#include "../include/scsi.h" #include "../include/class2.h" +#include "../include/ntddscsi.h" #define NDEBUG #include @@ -253,13 +253,13 @@ CdromClassFindDevices(IN PDRIVER_OBJECT DriverObject, RegistryPath, PortDeviceObject, PortNumber, - ConfigInfo->CdRomCount, + ConfigInfo->CDRomCount, PortCapabilities, UnitInfo, InitializationData); if (NT_SUCCESS(Status)) { - ConfigInfo->CdRomCount++; + ConfigInfo->CDRomCount++; FoundDevice = TRUE; } } diff --git a/reactos/drivers/storage/cdrom/cdrom.rc b/reactos/drivers/storage/cdrom/cdrom.rc index 56306083c75..87a1ca0859c 100644 --- a/reactos/drivers/storage/cdrom/cdrom.rc +++ b/reactos/drivers/storage/cdrom/cdrom.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/storage/class2/class2.c b/reactos/drivers/storage/class2/class2.c index 6dc91627c78..0b0d3799468 100644 --- a/reactos/drivers/storage/class2/class2.c +++ b/reactos/drivers/storage/class2/class2.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: class2.c,v 1.23 2002/09/07 15:12:09 chorns Exp $ +/* $Id: class2.c,v 1.24 2002/09/08 10:22:22 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -33,9 +33,7 @@ /* INCLUDES *****************************************************************/ #include -#include -#include -#include +#include "../include/scsi.h" #include "../include/class2.h" #define NDEBUG @@ -44,8 +42,6 @@ #define VERSION "0.0.1" -#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) - #define TAG_SRBT TAG('S', 'r', 'b', 'T') #define INQUIRY_DATA_SIZE 2048 @@ -410,6 +406,7 @@ ScsiClassCreateDeviceObject(IN PDRIVER_OBJECT DriverObject, } RtlFreeUnicodeString(&DeviceName); + return(Status); } @@ -1537,11 +1534,11 @@ ScsiClassReadWrite(IN PDEVICE_OBJECT DeviceObject, /* Adjust the maximum transfer length */ CurrentTransferPages = DeviceExtension->PortCapabilities->MaximumPhysicalPages; - if (MaximumTransferLength > CurrentTransferPages * PAGE_SIZE) - MaximumTransferLength = CurrentTransferPages * PAGE_SIZE; + if (MaximumTransferLength > CurrentTransferPages * PAGESIZE) + MaximumTransferLength = CurrentTransferPages * PAGESIZE; if (MaximumTransferLength == 0) - MaximumTransferLength = PAGE_SIZE; + MaximumTransferLength = PAGESIZE; IoMarkIrpPending(Irp); diff --git a/reactos/drivers/storage/class2/class2.rc b/reactos/drivers/storage/class2/class2.rc index 4c1614562a2..99c18756e4f 100644 --- a/reactos/drivers/storage/class2/class2.rc +++ b/reactos/drivers/storage/class2/class2.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/storage/disk/disk.c b/reactos/drivers/storage/disk/disk.c index 84f318c9aa9..106418428ab 100644 --- a/reactos/drivers/storage/disk/disk.c +++ b/reactos/drivers/storage/disk/disk.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: disk.c,v 1.17 2002/09/07 15:12:09 chorns Exp $ +/* $Id: disk.c,v 1.18 2002/09/08 10:22:22 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -27,11 +27,11 @@ /* INCLUDES *****************************************************************/ -#define NTOS_KERNEL_MODE -#include -#include -#include +#include + +#include "../include/scsi.h" #include "../include/class2.h" +#include "../include/ntddscsi.h" #define NDEBUG #include diff --git a/reactos/drivers/storage/disk/disk.rc b/reactos/drivers/storage/disk/disk.rc index a0f7772984f..5a97ec3a32a 100644 --- a/reactos/drivers/storage/disk/disk.rc +++ b/reactos/drivers/storage/disk/disk.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/drivers/storage/include/class2.h b/reactos/drivers/storage/include/class2.h index db98f17e0fa..7c351342698 100644 --- a/reactos/drivers/storage/include/class2.h +++ b/reactos/drivers/storage/include/class2.h @@ -1,4 +1,4 @@ -/* $Id: class2.h,v 1.5 2002/09/07 15:12:09 chorns Exp $ +/* $Id: class2.h,v 1.6 2002/09/08 10:22:23 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -10,10 +10,8 @@ #ifndef __STORAGE_INCLUDE_CLASS2_H #define __STORAGE_INCLUDE_CLASS2_H -#include -#include -#include -#include +#include "ntddscsi.h" +#include "srb.h" #define MAXIMUM_RETRIES 4 @@ -215,4 +213,4 @@ ScsiClassSplitRequest(PDEVICE_OBJECT DeviceObject, #endif /* __STORAGE_INCLUDE_CLASS2_H */ -/* EOF */ +/* EOF */ \ No newline at end of file diff --git a/reactos/drivers/storage/include/ntddscsi.h b/reactos/drivers/storage/include/ntddscsi.h index 5db4551e5d3..88f1ef6a7fc 100644 --- a/reactos/drivers/storage/include/ntddscsi.h +++ b/reactos/drivers/storage/include/ntddscsi.h @@ -1,4 +1,4 @@ -/* $Id: ntddscsi.h,v 1.4 2002/09/07 15:12:09 chorns Exp $ +/* $Id: ntddscsi.h,v 1.5 2002/09/08 10:22:23 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -89,4 +89,4 @@ typedef struct _SCSI_ADDRESS #endif /* __STORAGE_INCLUDE_NTDDSCSI_H */ -/* EOF */ +/* EOF */ \ No newline at end of file diff --git a/reactos/drivers/storage/include/scsi.h b/reactos/drivers/storage/include/scsi.h index 950f1fce83c..3bea1ec235c 100644 --- a/reactos/drivers/storage/include/scsi.h +++ b/reactos/drivers/storage/include/scsi.h @@ -1,4 +1,4 @@ -/* $Id: scsi.h,v 1.5 2002/09/07 15:12:09 chorns Exp $ +/* $Id: scsi.h,v 1.6 2002/09/08 10:22:23 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -844,18 +844,6 @@ typedef struct _SENSE_DATA #define SCSI_SENSEQ_END_OF_MEDIA_DETECTED 0x02 #define SCSI_SENSEQ_BEGINNING_OF_MEDIA_DETECTED 0x04 - - - - - - - - - - - - /* SCSI IO Device Control Codes */ #define FILE_DEVICE_SCSI 0x0000001b @@ -1315,4 +1303,4 @@ typedef struct _FOUR_BYTE #endif /* __STORAGE_INCLUDE_SCSI_H */ -/* EOF */ +/* EOF */ \ No newline at end of file diff --git a/reactos/drivers/storage/include/srb.h b/reactos/drivers/storage/include/srb.h index 161abfc3280..f60dadabd27 100644 --- a/reactos/drivers/storage/include/srb.h +++ b/reactos/drivers/storage/include/srb.h @@ -1,4 +1,4 @@ -/* $Id: srb.h,v 1.6 2002/09/07 15:12:09 chorns Exp $ +/* $Id: srb.h,v 1.7 2002/09/08 10:22:23 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -531,4 +531,4 @@ ScsiPortWriteRegisterUshort(IN PUSHORT Register, #endif /* __STORAGE_INCLUDE_SRB_H */ -/* EOF */ +/* EOF */ \ No newline at end of file diff --git a/reactos/drivers/storage/scsiport/scsiport.c b/reactos/drivers/storage/scsiport/scsiport.c index d4f32564171..a2c6908c099 100644 --- a/reactos/drivers/storage/scsiport/scsiport.c +++ b/reactos/drivers/storage/scsiport/scsiport.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: scsiport.c,v 1.19 2002/09/07 15:12:10 chorns Exp $ +/* $Id: scsiport.c,v 1.20 2002/09/08 10:22:23 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -28,9 +28,9 @@ /* INCLUDES *****************************************************************/ #include -#include -#include -#include +#include "../include/srb.h" +#include "../include/scsi.h" +#include "../include/ntddscsi.h" #define NDEBUG #include @@ -247,7 +247,6 @@ ScsiPortCompleteRequest(IN PVOID HwDeviceExtension, UNIMPLEMENTED; } -#undef ScsiPortConvertPhysicalAddressToUlong ULONG STDCALL ScsiPortConvertPhysicalAddressToUlong(IN SCSI_PHYSICAL_ADDRESS Address) @@ -1160,12 +1159,12 @@ ScsiPortCreatePortDevice(IN PDRIVER_OBJECT DriverObject, PortCapabilities->MaximumTransferLength = PortDeviceExtension->PortConfig.MaximumTransferLength; PortCapabilities->MaximumPhysicalPages = - PortCapabilities->MaximumTransferLength / PAGE_SIZE; + PortCapabilities->MaximumTransferLength / PAGESIZE; PortCapabilities->SupportedAsynchronousEvents = 0; /* FIXME */ PortCapabilities->AlignmentMask = PortDeviceExtension->PortConfig.AlignmentMask; PortCapabilities->TaggedQueuing = - PortDeviceExtension->PortConfig.TaggedQueueing; + PortDeviceExtension->PortConfig.TaggedQueuing; PortCapabilities->AdapterScansDown = PortDeviceExtension->PortConfig.AdapterScansDown; PortCapabilities->AdapterUsesPio = TRUE; /* FIXME */ diff --git a/reactos/drivers/storage/scsiport/scsiport.rc b/reactos/drivers/storage/scsiport/scsiport.rc index 72732301fb1..8450f6f00b0 100644 --- a/reactos/drivers/storage/scsiport/scsiport.rc +++ b/reactos/drivers/storage/scsiport/scsiport.rc @@ -1,4 +1,5 @@ -#include + +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/hal/hal/Makefile b/reactos/hal/hal/Makefile index 324261c98a0..94d60cf0b70 100644 --- a/reactos/hal/hal/Makefile +++ b/reactos/hal/hal/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 2002/09/07 15:12:10 chorns Exp $ +# $Id: Makefile,v 1.3 2002/09/08 10:22:24 chorns Exp $ PATH_TO_TOP = ../.. @@ -6,7 +6,7 @@ TARGET_TYPE = driver_library TARGET_ASFLAGS = -D__NTHAL__ -I$(PATH_TO_TOP)/ntoskrnl/include -TARGET_CFLAGS = -D__NTHAL__ -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/ntoskrnl/include +TARGET_CFLAGS = -D__NTHAL__ -I$(PATH_TO_TOP)/ntoskrnl/include TARGET_NAME = hal diff --git a/reactos/hal/hal/hal.c b/reactos/hal/hal/hal.c index c15199b54f9..72064c86c20 100644 --- a/reactos/hal/hal/hal.c +++ b/reactos/hal/hal/hal.c @@ -1,4 +1,4 @@ -/* $Id: hal.c,v 1.4 2002/09/07 15:12:10 chorns Exp $ +/* $Id: hal.c,v 1.5 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,8 +11,7 @@ /* INCLUDES ******************************************************************/ -#define NTOS_KERNEL_MODE -#include +#include #include #define NDEBUG @@ -20,7 +19,7 @@ /* DATA **********************************************************************/ -ULONG KdComPortInUse = 0; +ULONG EXPORTED KdComPortInUse = 0; /* FUNCTIONS *****************************************************************/ @@ -622,20 +621,6 @@ KdPortInitialize( } -BOOLEAN -STDCALL -KdPortInitializeEx ( - PKD_PORT_INFORMATION PortInformation, - DWORD Unknown1, - DWORD Unknown2 - ) -{ - UNIMPLEMENTED; - - return TRUE; -} - - BOOLEAN STDCALL KdPortPollByte( diff --git a/reactos/hal/hal/hal.rc b/reactos/hal/hal/hal.rc index 59bec89d530..2d3e9ffa137 100644 --- a/reactos/hal/hal/hal.rc +++ b/reactos/hal/hal/hal.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/hal/halx86/Makefile b/reactos/hal/halx86/Makefile index be6f4a337ec..37286d2e28f 100644 --- a/reactos/hal/halx86/Makefile +++ b/reactos/hal/halx86/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 2002/09/07 15:12:10 chorns Exp $ +# $Id: Makefile,v 1.5 2002/09/08 10:22:24 chorns Exp $ PATH_TO_TOP = ../.. @@ -22,9 +22,9 @@ TARGET_DEFNAME = ../hal/hal TARGET_LIBPATH = . -TARGET_ASFLAGS = -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/ntoskrnl/include +TARGET_ASFLAGS = -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/ntoskrnl/include -D__ASM__ -TARGET_CFLAGS = -I./include -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/ntoskrnl/include +TARGET_CFLAGS = -I./include -I$(PATH_TO_TOP)/ntoskrnl/include -g TARGET_NAME_UP = halx86up @@ -94,6 +94,6 @@ include $(TOOLS_PATH)/helper.mk # # Include automatic dependancy tracking # -# include $(TOOLS_PATH)/depend.mk +include $(TOOLS_PATH)/depend.mk # EOF diff --git a/reactos/hal/halx86/adapter.c b/reactos/hal/halx86/adapter.c index 07b28f6340c..601080d64e3 100644 --- a/reactos/hal/halx86/adapter.c +++ b/reactos/hal/halx86/adapter.c @@ -1,4 +1,4 @@ -/* $Id: adapter.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: adapter.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,10 @@ /* INCLUDES *****************************************************************/ -#include - -#define NDEBUG +#include +#include #include - +#include /* FUNCTIONS *****************************************************************/ @@ -34,7 +33,7 @@ HalAllocateAdapterChannel(PADAPTER_OBJECT AdapterObject, LARGE_INTEGER MaxAddress; MaxAddress.QuadPart = 0x1000000; - Buffer = MmAllocateContiguousAlignedMemory( NumberOfMapRegisters * PAGE_SIZE, + Buffer = MmAllocateContiguousAlignedMemory( NumberOfMapRegisters * PAGESIZE, MaxAddress, 0x10000 ); if( !Buffer ) diff --git a/reactos/hal/halx86/beep.c b/reactos/hal/halx86/beep.c index a3393d5d38d..a0d8bfc1c01 100644 --- a/reactos/hal/halx86/beep.c +++ b/reactos/hal/halx86/beep.c @@ -10,7 +10,7 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG #include diff --git a/reactos/hal/halx86/bios32.c b/reactos/hal/halx86/bios32.c index b8ab576ffe3..4668367610b 100644 --- a/reactos/hal/halx86/bios32.c +++ b/reactos/hal/halx86/bios32.c @@ -14,10 +14,9 @@ /* INCLUDES ***************************************************************/ -#include - -#define NDEBUG -#include +#include +#include +#include /* TYPES ******************************************************************/ diff --git a/reactos/hal/halx86/bus.c b/reactos/hal/halx86/bus.c index 18d97b2965c..4bcd6616b51 100644 --- a/reactos/hal/halx86/bus.c +++ b/reactos/hal/halx86/bus.c @@ -1,4 +1,4 @@ -/* $Id: bus.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: bus.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -15,12 +15,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define TAG_BUS TAG('B', 'U', 'S', 'H') diff --git a/reactos/hal/halx86/display.c b/reactos/hal/halx86/display.c index f0dddc99923..697c88c5446 100644 --- a/reactos/hal/halx86/display.c +++ b/reactos/hal/halx86/display.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: display.c,v 1.3 2002/09/07 15:12:10 chorns Exp $ +/* $Id: display.c,v 1.4 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -27,11 +27,8 @@ * Created 08/10/99 */ -#include - -#define NDEBUG -#include - +#include +#include #define SCREEN_SYNCHRONIZATION diff --git a/reactos/hal/halx86/dma.c b/reactos/hal/halx86/dma.c index 8ab8ae4d246..f7bdc097ebc 100644 --- a/reactos/hal/halx86/dma.c +++ b/reactos/hal/halx86/dma.c @@ -1,4 +1,4 @@ -/* $Id: dma.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: dma.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,17 +11,16 @@ /* INCLUDES *****************************************************************/ +#include + +#include #include -#define NDEBUG -#include - - ADAPTER_OBJECT AdapterObjects[] = { - { 0, (PVOID)0x87, (PVOID)0x1, (PVOID)0x0, 0, NULL }, - { 1, (PVOID)0x83, (PVOID)0x3, (PVOID)0x2, 0, NULL }, - { 2, (PVOID)0x81, (PVOID)0x5, (PVOID)0x4, 0, NULL }, - { 3, (PVOID)0x82, (PVOID)0x7, (PVOID)0x6, 0, NULL } }; + { 0, (PVOID)0x87, (PVOID)0x1, (PVOID)0x0, { 0 }, NULL }, + { 1, (PVOID)0x83, (PVOID)0x3, (PVOID)0x2, { 0 }, NULL }, + { 2, (PVOID)0x81, (PVOID)0x5, (PVOID)0x4, { 0 }, NULL }, + { 3, (PVOID)0x82, (PVOID)0x7, (PVOID)0x6, { 0 }, NULL } }; /* FUNCTIONS *****************************************************************/ @@ -96,7 +95,7 @@ HalGetAdapter (PDEVICE_DESCRIPTION DeviceDescription, return NULL; if( DeviceDescription->AutoInitialize ) return NULL; - if( DeviceDescription->Dma32BitAddresses ) + if( DeviceDescription->Dma32BitAddress ) return NULL; if( DeviceDescription->InterfaceType != Isa ) return NULL; diff --git a/reactos/hal/halx86/drive.c b/reactos/hal/halx86/drive.c index 58e036e2125..71eab0400f4 100644 --- a/reactos/hal/halx86/drive.c +++ b/reactos/hal/halx86/drive.c @@ -1,4 +1,4 @@ -/* $Id: drive.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: drive.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,9 +11,7 @@ /* INCLUDES *****************************************************************/ -#include - -#define NDEBUG +#include #include /* FUNCTIONS *****************************************************************/ @@ -24,7 +22,7 @@ IoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, OUT PUCHAR NtSystemPath, OUT PSTRING NtSystemPathString) { - HalDispatchTable->HalIoAssignDriveLetters(LoaderBlock, + HalDispatchTable.HalIoAssignDriveLetters(LoaderBlock, NtDeviceName, NtSystemPath, NtSystemPathString); diff --git a/reactos/hal/halx86/enum.c b/reactos/hal/halx86/enum.c index ab3e7af9176..c5147cd53f4 100644 --- a/reactos/hal/halx86/enum.c +++ b/reactos/hal/halx86/enum.c @@ -1,4 +1,4 @@ -/* $Id: enum.c,v 1.4 2002/09/07 15:12:10 chorns Exp $ +/* $Id: enum.c,v 1.5 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - VOID HalpStartEnumerator (VOID) { diff --git a/reactos/hal/halx86/fmutex.c b/reactos/hal/halx86/fmutex.c index 14f93d6f76c..9254dc86514 100644 --- a/reactos/hal/halx86/fmutex.c +++ b/reactos/hal/halx86/fmutex.c @@ -1,4 +1,4 @@ -/* $Id: fmutex.c,v 1.4 2002/09/07 15:12:10 chorns Exp $ +/* $Id: fmutex.c,v 1.5 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,12 +12,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID FASTCALL diff --git a/reactos/hal/halx86/halinit.c b/reactos/hal/halx86/halinit.c index 72a64c74131..327aef5fb2b 100644 --- a/reactos/hal/halx86/halinit.c +++ b/reactos/hal/halx86/halinit.c @@ -1,4 +1,4 @@ -/* $Id: halinit.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: halinit.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,10 @@ /* INCLUDES *****************************************************************/ +#include +#include #include - -#define NDEBUG -#include - +#include #ifdef MP #include diff --git a/reactos/hal/halx86/halx86mp.rc b/reactos/hal/halx86/halx86mp.rc index b786e81c7d2..4021685b9ef 100644 --- a/reactos/hal/halx86/halx86mp.rc +++ b/reactos/hal/halx86/halx86mp.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/hal/halx86/halx86up.rc b/reactos/hal/halx86/halx86up.rc index b37b96e5e5b..75e1a48ad86 100644 --- a/reactos/hal/halx86/halx86up.rc +++ b/reactos/hal/halx86/halx86up.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/hal/halx86/include/hal.h b/reactos/hal/halx86/include/hal.h index 9738e0791a4..704c2b3cf10 100644 --- a/reactos/hal/halx86/include/hal.h +++ b/reactos/hal/halx86/include/hal.h @@ -5,17 +5,8 @@ #ifndef __INTERNAL_HAL_HAL_H #define __INTERNAL_HAL_HAL_H -#define NTOSAPI extern -#include -#include -#include -#include - -/* We need to override these and use DECL_IMPORT to get the right _imp_Xxx - symbol names */ -extern DECL_IMPORT PHAL_DISPATCH_TABLE HalDispatchTable; -extern DECL_IMPORT PHAL_PRIVATE_DISPATCH_TABLE HalPrivateDispatchTable; - +//#include +//#include /* * FUNCTION: Probes for a BIOS32 extension @@ -44,4 +35,14 @@ VOID HalpInitPciBus (VOID); /* enum.c */ VOID HalpStartEnumerator (VOID); +struct _ADAPTER_OBJECT { + int Channel; + PVOID PagePort; + PVOID CountPort; + PVOID OffsetPort; + KSPIN_LOCK SpinLock; + PVOID Buffer; + BOOLEAN Inuse; +}; + #endif /* __INTERNAL_HAL_HAL_H */ diff --git a/reactos/hal/halx86/irql.c b/reactos/hal/halx86/irql.c index f9668679f83..a18a5aa6cec 100644 --- a/reactos/hal/halx86/irql.c +++ b/reactos/hal/halx86/irql.c @@ -8,12 +8,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS ******************************************************************/ #define NR_IRQS (16) @@ -24,6 +26,8 @@ */ static KIRQL CurrentIrql = HIGH_LEVEL; +extern IMPORTED ULONG DpcQueueSize; + static ULONG HalpPendingInterruptCount[NR_IRQS]; #define DIRQL_TO_IRQ(x) (PROFILE_LEVEL - x) diff --git a/reactos/hal/halx86/isa.c b/reactos/hal/halx86/isa.c index 0324758ea98..d872c673008 100644 --- a/reactos/hal/halx86/isa.c +++ b/reactos/hal/halx86/isa.c @@ -1,4 +1,4 @@ -/* $Id: isa.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: isa.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,10 +11,8 @@ /* INCLUDES ***************************************************************/ -#include - -#define NDEBUG -#include +#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/hal/halx86/kdbg.c b/reactos/hal/halx86/kdbg.c index bcb0121bafa..a968e38a8ab 100644 --- a/reactos/hal/halx86/kdbg.c +++ b/reactos/hal/halx86/kdbg.c @@ -1,4 +1,4 @@ -/* $Id: kdbg.c,v 1.5 2002/09/07 15:12:10 chorns Exp $ +/* $Id: kdbg.c,v 1.6 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,7 +12,7 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG #include @@ -65,7 +65,7 @@ /* GLOBAL VARIABLES *********************************************************/ -ULONG KdComPortInUse = 0; +ULONG EXPORTED KdComPortInUse = 0; /* STATIC VARIABLES *********************************************************/ diff --git a/reactos/hal/halx86/mbr.c b/reactos/hal/halx86/mbr.c index eceda640a3f..5dc30a9e203 100644 --- a/reactos/hal/halx86/mbr.c +++ b/reactos/hal/halx86/mbr.c @@ -10,15 +10,13 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ -VOID FASTCALL HalExamineMBR(PDEVICE_OBJECT DeviceObject, +VOID HalExamineMBR(PDEVICE_OBJECT DeviceObject, ULONG SectorSize, ULONG MBRTypeIdentifier, PVOID Buffer) diff --git a/reactos/hal/halx86/misc.c b/reactos/hal/halx86/misc.c index 871c292cf1f..71fa8d58ad2 100644 --- a/reactos/hal/halx86/misc.c +++ b/reactos/hal/halx86/misc.c @@ -1,4 +1,4 @@ -/* $Id: misc.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: misc.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,12 +9,9 @@ /* INCLUDES *****************************************************************/ +#include #include -#define NDEBUG -#include - - /* FUNCTIONS ****************************************************************/ VOID STDCALL diff --git a/reactos/hal/halx86/mp.c b/reactos/hal/halx86/mp.c index 6a5d20463bf..49055489706 100644 --- a/reactos/hal/halx86/mp.c +++ b/reactos/hal/halx86/mp.c @@ -1,4 +1,4 @@ -/* $Id: mp.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: mp.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -14,14 +14,22 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - #ifdef MP +#include +#include + +#include +#include +#include +#include + /* Address of area to be used for communication between Application Processors (APs) and the BootStrap Processor (BSP) diff --git a/reactos/hal/halx86/mpsirql.c b/reactos/hal/halx86/mpsirql.c index 604dd60aeae..182d6b91270 100644 --- a/reactos/hal/halx86/mpsirql.c +++ b/reactos/hal/halx86/mpsirql.c @@ -11,12 +11,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS ******************************************************************/; extern IMPORTED ULONG DpcQueueSize; diff --git a/reactos/hal/halx86/pci.c b/reactos/hal/halx86/pci.c index 4d80f7a9887..000f12bca86 100644 --- a/reactos/hal/halx86/pci.c +++ b/reactos/hal/halx86/pci.c @@ -1,4 +1,4 @@ -/* $Id: pci.c,v 1.3 2002/09/07 15:12:10 chorns Exp $ +/* $Id: pci.c,v 1.4 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -18,7 +18,8 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include diff --git a/reactos/hal/halx86/perfcnt.c b/reactos/hal/halx86/perfcnt.c index f79d1f8bc96..e8644ece0cd 100644 --- a/reactos/hal/halx86/perfcnt.c +++ b/reactos/hal/halx86/perfcnt.c @@ -1,4 +1,4 @@ -/* $Id: perfcnt.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: perfcnt.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,11 +13,7 @@ /* INCLUDES ***************************************************************/ -#include - -#define NDEBUG -#include - +#include /* FUNCTIONS **************************************************************/ diff --git a/reactos/hal/halx86/portio.c b/reactos/hal/halx86/portio.c index fbb9fd6503a..7825d4018bf 100644 --- a/reactos/hal/halx86/portio.c +++ b/reactos/hal/halx86/portio.c @@ -1,4 +1,4 @@ -/* $Id: portio.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: portio.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,10 +9,7 @@ * Created 18/10/99 */ -#include - -#define NDEBUG -#include +#include /* FUNCTIONS ****************************************************************/ diff --git a/reactos/hal/halx86/pwroff.c b/reactos/hal/halx86/pwroff.c index cf6a63caa75..cddd9fb0489 100644 --- a/reactos/hal/halx86/pwroff.c +++ b/reactos/hal/halx86/pwroff.c @@ -1,4 +1,4 @@ -/* $Id: pwroff.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: pwroff.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * FILE : reactos/hal/x86/apm.c * DESCRIPTION: Turn CPU off... @@ -9,12 +9,6 @@ * 1999-12-26 */ -#include - -#define NDEBUG -#include - - #define APM_FUNCTION_AVAILABLE 0x5300 #define APM_FUNCTION_CONNREAL 0x5301 #define APM_FUNCTION_POWEROFF 0x5307 diff --git a/reactos/hal/halx86/reboot.c b/reactos/hal/halx86/reboot.c index 553336d9407..9aef1d906c4 100644 --- a/reactos/hal/halx86/reboot.c +++ b/reactos/hal/halx86/reboot.c @@ -1,4 +1,4 @@ -/* $Id: reboot.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: reboot.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,10 +9,9 @@ * Created 11/10/99 */ -#include -#define NDEBUG -#include +#include +#include static VOID diff --git a/reactos/hal/halx86/spinlock.c b/reactos/hal/halx86/spinlock.c index f7458e503de..05d9bcd2568 100644 --- a/reactos/hal/halx86/spinlock.c +++ b/reactos/hal/halx86/spinlock.c @@ -1,4 +1,4 @@ -/* $Id: spinlock.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: spinlock.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -17,12 +17,10 @@ /* INCLUDES ****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS ***************************************************************/ VOID STDCALL diff --git a/reactos/hal/halx86/sysbus.c b/reactos/hal/halx86/sysbus.c index 1777c99e943..a2152746308 100644 --- a/reactos/hal/halx86/sysbus.c +++ b/reactos/hal/halx86/sysbus.c @@ -1,4 +1,4 @@ -/* $Id: sysbus.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: sysbus.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,10 +11,8 @@ /* INCLUDES *****************************************************************/ -#include - -#define NDEBUG -#include +#include +#include /* FUNCTIONS ****************************************************************/ diff --git a/reactos/hal/halx86/sysinfo.c b/reactos/hal/halx86/sysinfo.c index 376cbcc21ba..5d04be8449c 100644 --- a/reactos/hal/halx86/sysinfo.c +++ b/reactos/hal/halx86/sysinfo.c @@ -10,12 +10,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID HalQuerySystemInformation() diff --git a/reactos/hal/halx86/time.c b/reactos/hal/halx86/time.c index 8e020d95652..57a4015a955 100644 --- a/reactos/hal/halx86/time.c +++ b/reactos/hal/halx86/time.c @@ -8,12 +8,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* MACROS and CONSTANTS ******************************************************/ /* macro BCD_INT : convert bcd to int */ diff --git a/reactos/hal/halx86/udelay.c b/reactos/hal/halx86/udelay.c index 94dd8674947..8fce2071901 100644 --- a/reactos/hal/halx86/udelay.c +++ b/reactos/hal/halx86/udelay.c @@ -20,7 +20,7 @@ * MA 02139, USA. * */ -/* $Id: udelay.c,v 1.2 2002/09/07 15:12:10 chorns Exp $ +/* $Id: udelay.c,v 1.3 2002/09/08 10:22:25 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/hal/x86/udelay.c @@ -32,12 +32,11 @@ /* INCLUDES ***************************************************************/ -#include +#include #define NDEBUG #include - /* GLOBALS ******************************************************************/ static unsigned int delay_count = 1; diff --git a/reactos/iface/native/sysfuncs.lst b/reactos/iface/native/sysfuncs.lst index 035ab4e3628..a1a1de9c71f 100644 --- a/reactos/iface/native/sysfuncs.lst +++ b/reactos/iface/native/sysfuncs.lst @@ -1,13 +1,13 @@ NtAcceptConnectPort ZwAcceptConnectPort 24 NtAccessCheck ZwAccessCheck 32 NtAccessCheckAndAuditAlarm ZwAccessCheckAndAuditAlarm 44 -NtAddAtom ZwAddAtom 12 +NtAddAtom ZwAddAtom 8 NtAdjustGroupsToken ZwAdjustGroupsToken 24 NtAdjustPrivilegesToken ZwAdjustPrivilegesToken 24 NtAlertResumeThread ZwAlertResumeThread 8 NtAlertThread ZwAlertThread 4 NtAllocateLocallyUniqueId ZwAllocateLocallyUniqueId 4 -NtAllocateUuids ZwAllocateUuids 16 +NtAllocateUuids ZwAllocateUuids 12 NtAllocateVirtualMemory ZwAllocateVirtualMemory 24 NtCallbackReturn ZwCallbackReturn 12 NtCancelIoFile ZwCancelIoFile 8 @@ -51,7 +51,7 @@ NtDuplicateToken ZwDuplicateToken 24 NtEnumerateKey ZwEnumerateKey 24 NtEnumerateValueKey ZwEnumerateValueKey 24 NtExtendSection ZwExtendSection 8 -NtFindAtom ZwFindAtom 12 +NtFindAtom ZwFindAtom 8 NtFlushBuffersFile ZwFlushBuffersFile 8 NtFlushInstructionCache ZwFlushInstructionCache 12 NtFlushKey ZwFlushKey 4 diff --git a/reactos/include/ascii.h b/reactos/include/ascii.h new file mode 100644 index 00000000000..b801316ec62 --- /dev/null +++ b/reactos/include/ascii.h @@ -0,0 +1,2997 @@ +/* + ASCIIFunctions.h + + Declarations for all the Win32 ASCII Functions + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + + This file is part of the Windows32 API Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + If you are interested in a warranty or support for this source code, + contact Scott Christley for more information. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNU_H_WINDOWS32_ASCIIFUNCTIONS +#define _GNU_H_WINDOWS32_ASCIIFUNCTIONS + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +WINBOOL +STDCALL +GetBinaryTypeA( + LPCSTR lpApplicationName, + LPDWORD lpBinaryType + ); + +DWORD +STDCALL +GetShortPathNameA( + LPCSTR lpszLongPath, + LPSTR lpszShortPath, + DWORD cchBuffer + ); + +LPSTR +STDCALL +GetEnvironmentStringsA( + VOID + ); + +WINBOOL +STDCALL +FreeEnvironmentStringsA( + LPSTR + ); + +DWORD +STDCALL +FormatMessageA( + DWORD dwFlags, + LPCVOID lpSource, + DWORD dwMessageId, + DWORD dwLanguageId, + LPSTR lpBuffer, + DWORD nSize, + va_list *Arguments + ); + +HANDLE +STDCALL +CreateMailslotA( + LPCSTR lpName, + DWORD nMaxMessageSize, + DWORD lReadTimeout, + LPSECURITY_ATTRIBUTES lpSecurityAttributes + ); + +int +STDCALL +lstrcmpA( + LPCSTR lpString1, + LPCSTR lpString2 + ); + +int +STDCALL +lstrcmpiA( + LPCSTR lpString1, + LPCSTR lpString2 + ); + +LPSTR +STDCALL +lstrcpynA( + LPSTR lpString1, + LPCSTR lpString2, + int iMaxLength + ); + +LPSTR +STDCALL +lstrcpyA( + LPSTR lpString1, + LPCSTR lpString2 + ); + +LPSTR +STDCALL +lstrcatA( + LPSTR lpString1, + LPCSTR lpString2 + ); + +int +STDCALL +lstrlenA( + LPCSTR lpString + ); + +HANDLE +STDCALL +CreateMutexA( + LPSECURITY_ATTRIBUTES lpMutexAttributes, + WINBOOL bInitialOwner, + LPCSTR lpName + ); + +HANDLE +STDCALL +OpenMutexA( + DWORD dwDesiredAccess, + WINBOOL bInheritHandle, + LPCSTR lpName + ); + +HANDLE +STDCALL +CreateEventA( + LPSECURITY_ATTRIBUTES lpEventAttributes, + WINBOOL bManualReset, + WINBOOL bInitialState, + LPCSTR lpName + ); + +HANDLE +STDCALL +OpenEventA( + DWORD dwDesiredAccess, + WINBOOL bInheritHandle, + LPCSTR lpName + ); + +HANDLE +STDCALL +CreateSemaphoreA( + LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, + LONG lInitialCount, + LONG lMaximumCount, + LPCSTR lpName + ); + +HANDLE +STDCALL +OpenSemaphoreA( + DWORD dwDesiredAccess, + WINBOOL bInheritHandle, + LPCSTR lpName + ); + +HANDLE +STDCALL +CreateFileMappingA( + HANDLE hFile, + LPSECURITY_ATTRIBUTES lpFileMappingAttributes, + DWORD flProtect, + DWORD dwMaximumSizeHigh, + DWORD dwMaximumSizeLow, + LPCSTR lpName + ); + +HANDLE +STDCALL +OpenFileMappingA( + DWORD dwDesiredAccess, + WINBOOL bInheritHandle, + LPCSTR lpName + ); + +DWORD +STDCALL +GetLogicalDriveStringsA( + DWORD nBufferLength, + LPSTR lpBuffer + ); + +HINSTANCE +STDCALL +LoadLibraryA( + LPCSTR lpLibFileName + ); + +HINSTANCE +STDCALL +LoadLibraryExA( + LPCSTR lpLibFileName, + HANDLE hFile, + DWORD dwFlags + ); + +DWORD +STDCALL +GetModuleFileNameA( + HINSTANCE hModule, + LPSTR lpFilename, + DWORD nSize + ); + +HMODULE +STDCALL +GetModuleHandleA( + LPCSTR lpModuleName + ); + +VOID +STDCALL +FatalAppExitA( + UINT uAction, + LPCSTR lpMessageText + ); + +LPSTR +STDCALL +GetCommandLineA( + VOID + ); + +DWORD +STDCALL +GetEnvironmentVariableA( + LPCSTR lpName, + LPSTR lpBuffer, + DWORD nSize + ); + +WINBOOL +STDCALL +SetEnvironmentVariableA( + LPCSTR lpName, + LPCSTR lpValue + ); + +DWORD +STDCALL +ExpandEnvironmentStringsA( + LPCSTR lpSrc, + LPSTR lpDst, + DWORD nSize + ); + +VOID +STDCALL +OutputDebugStringA( + LPCSTR lpOutputString + ); + +HRSRC +STDCALL +FindResourceA( + HINSTANCE hModule, + LPCSTR lpName, + LPCSTR lpType + ); + +HRSRC +STDCALL +FindResourceExA( + HINSTANCE hModule, + LPCSTR lpType, + LPCSTR lpName, + WORD wLanguage + ); + +WINBOOL +STDCALL +EnumResourceTypesA( + HINSTANCE hModule, + ENUMRESTYPEPROC lpEnumFunc, + LONG lParam + ); + +WINBOOL +STDCALL +EnumResourceNamesA( + HINSTANCE hModule, + LPCSTR lpType, + ENUMRESNAMEPROC lpEnumFunc, + LONG lParam + ); + +WINBOOL +STDCALL +EnumResourceLanguagesA( + HINSTANCE hModule, + LPCSTR lpType, + LPCSTR lpName, + ENUMRESLANGPROC lpEnumFunc, + LONG lParam + ); + +HANDLE +STDCALL +BeginUpdateResourceA( + LPCSTR pFileName, + WINBOOL bDeleteExistingResources + ); + +WINBOOL +STDCALL +UpdateResourceA( + HANDLE hUpdate, + LPCSTR lpType, + LPCSTR lpName, + WORD wLanguage, + LPVOID lpData, + DWORD cbData + ); + +WINBOOL +STDCALL +EndUpdateResourceA( + HANDLE hUpdate, + WINBOOL fDiscard + ); + +ATOM +STDCALL +GlobalAddAtomA( + LPCSTR lpString + ); + +ATOM +STDCALL +GlobalFindAtomA( + LPCSTR lpString + ); + +UINT +STDCALL +GlobalGetAtomNameA( + ATOM nAtom, + LPSTR lpBuffer, + int nSize + ); + +ATOM +STDCALL +AddAtomA( + LPCSTR lpString + ); + +ATOM +STDCALL +FindAtomA( + LPCSTR lpString + ); + +UINT +STDCALL +GetAtomNameA( + ATOM nAtom, + LPSTR lpBuffer, + int nSize + ); + +UINT +STDCALL +GetProfileIntA( + LPCSTR lpAppName, + LPCSTR lpKeyName, + INT nDefault + ); + +DWORD +STDCALL +GetProfileStringA( + LPCSTR lpAppName, + LPCSTR lpKeyName, + LPCSTR lpDefault, + LPSTR lpReturnedString, + DWORD nSize + ); + +WINBOOL +STDCALL +WriteProfileStringA( + LPCSTR lpAppName, + LPCSTR lpKeyName, + LPCSTR lpString + ); + +DWORD +STDCALL +GetProfileSectionA( + LPCSTR lpAppName, + LPSTR lpReturnedString, + DWORD nSize + ); + +WINBOOL +STDCALL +WriteProfileSectionA( + LPCSTR lpAppName, + LPCSTR lpString + ); + +UINT +STDCALL +GetPrivateProfileIntA( + LPCSTR lpAppName, + LPCSTR lpKeyName, + INT nDefault, + LPCSTR lpFileName + ); + +DWORD +STDCALL +GetPrivateProfileStringA( + LPCSTR lpAppName, + LPCSTR lpKeyName, + LPCSTR lpDefault, + LPSTR lpReturnedString, + DWORD nSize, + LPCSTR lpFileName + ); + +WINBOOL +STDCALL +WritePrivateProfileStringA( + LPCSTR lpAppName, + LPCSTR lpKeyName, + LPCSTR lpString, + LPCSTR lpFileName + ); + +DWORD +STDCALL +GetPrivateProfileSectionA( + LPCSTR lpAppName, + LPSTR lpReturnedString, + DWORD nSize, + LPCSTR lpFileName + ); + +WINBOOL +STDCALL +WritePrivateProfileSectionA( + LPCSTR lpAppName, + LPCSTR lpString, + LPCSTR lpFileName + ); + +UINT +STDCALL +GetDriveTypeA( + LPCSTR lpRootPathName + ); + +UINT +STDCALL +GetSystemDirectoryA( + LPSTR lpBuffer, + UINT uSize + ); + +DWORD +STDCALL +GetTempPathA( + DWORD nBufferLength, + LPSTR lpBuffer + ); + +UINT +STDCALL +GetTempFileNameA( + LPCSTR lpPathName, + LPCSTR lpPrefixString, + UINT uUnique, + LPSTR lpTempFileName + ); + +UINT +STDCALL +GetWindowsDirectoryA( + LPSTR lpBuffer, + UINT uSize + ); + +WINBOOL +STDCALL +SetCurrentDirectoryA( + LPCSTR lpPathName + ); + +DWORD +STDCALL +GetCurrentDirectoryA( + DWORD nBufferLength, + LPSTR lpBuffer + ); + +WINBOOL +STDCALL +GetDiskFreeSpaceA( + LPCSTR lpRootPathName, + LPDWORD lpSectorsPerCluster, + LPDWORD lpBytesPerSector, + LPDWORD lpNumberOfFreeClusters, + LPDWORD lpTotalNumberOfClusters + ); + +WINBOOL +STDCALL +GetDiskFreeSpaceExA( + LPCSTR lpDirectoryName, + PULARGE_INTEGER lpFreeBytesAvailableToCaller, + PULARGE_INTEGER lpTotalNumberOfBytes, + PULARGE_INTEGER lpTotalNumberOfFreeBytes + ); + +WINBOOL +STDCALL +CreateDirectoryA( + LPCSTR lpPathName, + LPSECURITY_ATTRIBUTES lpSecurityAttributes + ); + +WINBOOL +STDCALL +CreateDirectoryExA( + LPCSTR lpTemplateDirectory, + LPCSTR lpNewDirectory, + LPSECURITY_ATTRIBUTES lpSecurityAttributes + ); + +WINBOOL +STDCALL +RemoveDirectoryA( + LPCSTR lpPathName + ); + +DWORD +STDCALL +GetFullPathNameA( + LPCSTR lpFileName, + DWORD nBufferLength, + LPSTR lpBuffer, + LPSTR *lpFilePart + ); + +WINBOOL +STDCALL +DefineDosDeviceA( + DWORD dwFlags, + LPCSTR lpDeviceName, + LPCSTR lpTargetPath + ); + +DWORD +STDCALL +QueryDosDeviceA( + LPCSTR lpDeviceName, + LPSTR lpTargetPath, + DWORD ucchMax + ); + +HANDLE +STDCALL +CreateFileA( + LPCSTR lpFileName, + DWORD dwDesiredAccess, + DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD dwCreationDisposition, + DWORD dwFlagsAndAttributes, + HANDLE hTemplateFile + ); + +WINBOOL +STDCALL +SetFileAttributesA( + LPCSTR lpFileName, + DWORD dwFileAttributes + ); + +DWORD +STDCALL +GetFileAttributesA( + LPCSTR lpFileName + ); + +DWORD +STDCALL +GetCompressedFileSizeA( + LPCSTR lpFileName, + LPDWORD lpFileSizeHigh + ); + +WINBOOL +STDCALL +DeleteFileA( + LPCSTR lpFileName + ); + +DWORD +STDCALL +SearchPathA( + LPCSTR lpPath, + LPCSTR lpFileName, + LPCSTR lpExtension, + DWORD nBufferLength, + LPSTR lpBuffer, + LPSTR *lpFilePart + ); + +WINBOOL +STDCALL +CopyFileA( + LPCSTR lpExistingFileName, + LPCSTR lpNewFileName, + WINBOOL bFailIfExists + ); + +WINBOOL +STDCALL +MoveFileA( + LPCSTR lpExistingFileName, + LPCSTR lpNewFileName + ); + +WINBOOL +STDCALL +MoveFileExA( + LPCSTR lpExistingFileName, + LPCSTR lpNewFileName, + DWORD dwFlags + ); + +HANDLE +STDCALL +CreateNamedPipeA( + LPCSTR lpName, + DWORD dwOpenMode, + DWORD dwPipeMode, + DWORD nMaxInstances, + DWORD nOutBufferSize, + DWORD nInBufferSize, + DWORD nDefaultTimeOut, + LPSECURITY_ATTRIBUTES lpSecurityAttributes + ); + +WINBOOL +STDCALL +GetNamedPipeHandleStateA( + HANDLE hNamedPipe, + LPDWORD lpState, + LPDWORD lpCurInstances, + LPDWORD lpMaxCollectionCount, + LPDWORD lpCollectDataTimeout, + LPSTR lpUserName, + DWORD nMaxUserNameSize + ); + +WINBOOL +STDCALL +CallNamedPipeA( + LPCSTR lpNamedPipeName, + LPVOID lpInBuffer, + DWORD nInBufferSize, + LPVOID lpOutBuffer, + DWORD nOutBufferSize, + LPDWORD lpBytesRead, + DWORD nTimeOut + ); + +WINBOOL +STDCALL +WaitNamedPipeA( + LPCSTR lpNamedPipeName, + DWORD nTimeOut + ); + +WINBOOL +STDCALL +SetVolumeLabelA( + LPCSTR lpRootPathName, + LPCSTR lpVolumeName + ); + +WINBOOL +STDCALL +GetVolumeInformationA( + LPCSTR lpRootPathName, + LPSTR lpVolumeNameBuffer, + DWORD nVolumeNameSize, + LPDWORD lpVolumeSerialNumber, + LPDWORD lpMaximumComponentLength, + LPDWORD lpFileSystemFlags, + LPSTR lpFileSystemNameBuffer, + DWORD nFileSystemNameSize + ); + +WINBOOL +STDCALL +ClearEventLogA ( + HANDLE hEventLog, + LPCSTR lpBackupFileName + ); + +WINBOOL +STDCALL +BackupEventLogA ( + HANDLE hEventLog, + LPCSTR lpBackupFileName + ); + +HANDLE +STDCALL +OpenEventLogA ( + LPCSTR lpUNCServerName, + LPCSTR lpSourceName + ); + +HANDLE +STDCALL +RegisterEventSourceA ( + LPCSTR lpUNCServerName, + LPCSTR lpSourceName + ); + +HANDLE +STDCALL +OpenBackupEventLogA ( + LPCSTR lpUNCServerName, + LPCSTR lpFileName + ); + +WINBOOL +STDCALL +ReadEventLogA ( + HANDLE hEventLog, + DWORD dwReadFlags, + DWORD dwRecordOffset, + LPVOID lpBuffer, + DWORD nNumberOfBytesToRead, + DWORD *pnBytesRead, + DWORD *pnMinNumberOfBytesNeeded + ); + +WINBOOL +STDCALL +ReportEventA ( + HANDLE hEventLog, + WORD wType, + WORD wCategory, + DWORD dwEventID, + PSID lpUserSid, + WORD wNumStrings, + DWORD dwDataSize, + LPCSTR *lpStrings, + LPVOID lpRawData + ); + +WINBOOL +STDCALL +AccessCheckAndAuditAlarmA ( + LPCSTR SubsystemName, + LPVOID HandleId, + LPSTR ObjectTypeName, + LPSTR ObjectName, + PSECURITY_DESCRIPTOR SecurityDescriptor, + DWORD DesiredAccess, + PGENERIC_MAPPING GenericMapping, + WINBOOL ObjectCreation, + LPDWORD GrantedAccess, + LPBOOL AccessStatus, + LPBOOL pfGenerateOnClose + ); + +WINBOOL +STDCALL +ObjectOpenAuditAlarmA ( + LPCSTR SubsystemName, + LPVOID HandleId, + LPSTR ObjectTypeName, + LPSTR ObjectName, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + HANDLE ClientToken, + DWORD DesiredAccess, + DWORD GrantedAccess, + PPRIVILEGE_SET Privileges, + WINBOOL ObjectCreation, + WINBOOL AccessGranted, + LPBOOL GenerateOnClose + ); + +WINBOOL +STDCALL +ObjectPrivilegeAuditAlarmA ( + LPCSTR SubsystemName, + LPVOID HandleId, + HANDLE ClientToken, + DWORD DesiredAccess, + PPRIVILEGE_SET Privileges, + WINBOOL AccessGranted + ); + +WINBOOL +STDCALL +ObjectCloseAuditAlarmA ( + LPCSTR SubsystemName, + LPVOID HandleId, + WINBOOL GenerateOnClose + ); + +WINBOOL +STDCALL +PrivilegedServiceAuditAlarmA ( + LPCSTR SubsystemName, + LPCSTR ServiceName, + HANDLE ClientToken, + PPRIVILEGE_SET Privileges, + WINBOOL AccessGranted + ); + +WINBOOL +STDCALL +SetFileSecurityA ( + LPCSTR lpFileName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor + ); + +WINBOOL +STDCALL +GetFileSecurityA ( + LPCSTR lpFileName, + SECURITY_INFORMATION RequestedInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD nLength, + LPDWORD lpnLengthNeeded + ); + +HANDLE +STDCALL +FindFirstChangeNotificationA( + LPCSTR lpPathName, + WINBOOL bWatchSubtree, + DWORD dwNotifyFilter + ); + +WINBOOL +STDCALL +IsBadStringPtrA( + LPCSTR lpsz, + UINT ucchMax + ); + +WINBOOL +STDCALL +LookupAccountSidA( + LPCSTR lpSystemName, + PSID Sid, + LPSTR Name, + LPDWORD cbName, + LPSTR ReferencedDomainName, + LPDWORD cbReferencedDomainName, + PSID_NAME_USE peUse + ); + +WINBOOL +STDCALL +LookupAccountNameA( + LPCSTR lpSystemName, + LPCSTR lpAccountName, + PSID Sid, + LPDWORD cbSid, + LPSTR ReferencedDomainName, + LPDWORD cbReferencedDomainName, + PSID_NAME_USE peUse + ); + +WINBOOL +STDCALL +LookupPrivilegeValueA( + LPCSTR lpSystemName, + LPCSTR lpName, + PLUID lpLuid + ); + +WINBOOL +STDCALL +LookupPrivilegeNameA( + LPCSTR lpSystemName, + PLUID lpLuid, + LPSTR lpName, + LPDWORD cbName + ); + +WINBOOL +STDCALL +LookupPrivilegeDisplayNameA( + LPCSTR lpSystemName, + LPCSTR lpName, + LPSTR lpDisplayName, + LPDWORD cbDisplayName, + LPDWORD lpLanguageId + ); + +WINBOOL +STDCALL +BuildCommDCBA( + LPCSTR lpDef, + LPDCB lpDCB + ); + +WINBOOL +STDCALL +BuildCommDCBAndTimeoutsA( + LPCSTR lpDef, + LPDCB lpDCB, + LPCOMMTIMEOUTS lpCommTimeouts + ); + +WINBOOL +STDCALL +CommConfigDialogA( + LPCSTR lpszName, + HWND hWnd, + LPCOMMCONFIG lpCC + ); + +WINBOOL +STDCALL +GetDefaultCommConfigA( + LPCSTR lpszName, + LPCOMMCONFIG lpCC, + LPDWORD lpdwSize + ); + +WINBOOL +STDCALL +SetDefaultCommConfigA( + LPCSTR lpszName, + LPCOMMCONFIG lpCC, + DWORD dwSize + ); + +WINBOOL +STDCALL +GetComputerNameA ( + LPSTR lpBuffer, + LPDWORD nSize + ); + +WINBOOL +STDCALL +SetComputerNameA ( + LPCSTR lpComputerName + ); + +WINBOOL +STDCALL +GetUserNameA ( + LPSTR lpBuffer, + LPDWORD nSize + ); + +int +STDCALL +wvsprintfA( + LPSTR, + LPCSTR, + va_list arglist); + +int +CDECL +wsprintfA(LPSTR, LPCSTR, ...); + +HKL +STDCALL +LoadKeyboardLayoutA( + LPCSTR pwszKLID, + UINT Flags); + +WINBOOL +STDCALL +GetKeyboardLayoutNameA( + LPSTR pwszKLID); + +HDESK +STDCALL +CreateDesktopA( + LPCSTR lpszDesktop, + LPCSTR lpszDevice, + LPDEVMODEA pDevmode, + DWORD dwFlags, + ACCESS_MASK dwDesiredAccess, + LPSECURITY_ATTRIBUTES lpsa); + +HDESK +STDCALL +OpenDesktopA( + LPSTR lpszDesktop, + DWORD dwFlags, + WINBOOL fInherit, + DWORD dwDesiredAccess); + +WINBOOL +STDCALL +EnumDesktopsA( + HWINSTA hwinsta, + DESKTOPENUMPROC lpEnumFunc, + LPARAM lParam); + +HWINSTA +STDCALL +CreateWindowStationA( + LPSTR lpwinsta, + DWORD dwReserved, + DWORD dwDesiredAccess, + LPSECURITY_ATTRIBUTES lpsa); + +HANDLE STDCALL CreateWaitableTimerA( LPSECURITY_ATTRIBUTES Attributes, + BOOL ManualReset, + LPCTSTR Name ); + +HWINSTA +STDCALL +OpenWindowStationA( + LPSTR lpszWinSta, + WINBOOL fInherit, + DWORD dwDesiredAccess); + +WINBOOL +STDCALL +EnumWindowStationsA( + ENUMWINDOWSTATIONPROC lpEnumFunc, + LPARAM lParam); + +WINBOOL +STDCALL +GetUserObjectInformationA( + HANDLE hObj, + int nIndex, + PVOID pvInfo, + DWORD nLength, + LPDWORD lpnLengthNeeded); + +WINBOOL +STDCALL +SetUserObjectInformationA( + HANDLE hObj, + int nIndex, + PVOID pvInfo, + DWORD nLength); + +UINT +STDCALL +RegisterWindowMessageA( + LPCSTR lpString); + +WINBOOL +STDCALL +GetMessageA( + LPMSG lpMsg, + HWND hWnd , + UINT wMsgFilterMin, + UINT wMsgFilterMax); + +LRESULT +STDCALL +DispatchMessageA( + CONST MSG *lpMsg); + +WINBOOL +STDCALL +PeekMessageA( + LPMSG lpMsg, + HWND hWnd , + UINT wMsgFilterMin, + UINT wMsgFilterMax, + UINT wRemoveMsg); + +LRESULT +STDCALL +SendMessageA( + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +LRESULT +STDCALL +SendMessageTimeoutA( + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam, + UINT fuFlags, + UINT uTimeout, + PDWORD_PTR lpdwResult); + +WINBOOL +STDCALL +SendNotifyMessageA( + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +WINBOOL +STDCALL +SendMessageCallbackA( + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam, + SENDASYNCPROC lpResultCallBack, + ULONG_PTR dwData); + +WINBOOL +STDCALL +PostMessageA( + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +WINBOOL +STDCALL +PostThreadMessageA( + DWORD idThread, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +LRESULT +STDCALL +DefWindowProcA( + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +LRESULT +STDCALL +CallWindowProcA( + WNDPROC lpPrevWndFunc, + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +ATOM +STDCALL +RegisterClassA( + CONST WNDCLASS *lpWndClass); + +WINBOOL +STDCALL +UnregisterClassA( + LPCSTR lpClassName, + HINSTANCE hInstance); + +WINBOOL +STDCALL +GetClassInfoA( + HINSTANCE hInstance , + LPCSTR lpClassName, + LPWNDCLASS lpWndClass); + +ATOM +STDCALL +RegisterClassExA(CONST WNDCLASSEX *); + +WINBOOL +STDCALL +GetClassInfoExA(HINSTANCE, LPCSTR, LPWNDCLASSEX); + +HWND +STDCALL +CreateWindowExA( + DWORD dwExStyle, + LPCSTR lpClassName, + LPCSTR lpWindowName, + DWORD dwStyle, + int X, + int Y, + int nWidth, + int nHeight, + HWND hWndParent , + HMENU hMenu, + HINSTANCE hInstance, + LPVOID lpParam); + +HWND +STDCALL +CreateDialogParamA( + HINSTANCE hInstance, + LPCSTR lpTemplateName, + HWND hWndParent , + DLGPROC lpDialogFunc, + LPARAM dwInitParam); + +HWND +STDCALL +CreateDialogIndirectParamA( + HINSTANCE hInstance, + LPCDLGTEMPLATE lpTemplate, + HWND hWndParent, + DLGPROC lpDialogFunc, + LPARAM dwInitParam); + +int +STDCALL +DialogBoxParamA( + HINSTANCE hInstance, + LPCSTR lpTemplateName, + HWND hWndParent , + DLGPROC lpDialogFunc, + LPARAM dwInitParam); + +int +STDCALL +DialogBoxIndirectParamA( + HINSTANCE hInstance, + LPCDLGTEMPLATE hDialogTemplate, + HWND hWndParent , + DLGPROC lpDialogFunc, + LPARAM dwInitParam); + +WINBOOL +STDCALL +SetDlgItemTextA( + HWND hDlg, + int nIDDlgItem, + LPCSTR lpString); + +UINT +STDCALL +GetDlgItemTextA( + HWND hDlg, + int nIDDlgItem, + LPSTR lpString, + int nMaxCount); + +LRESULT +STDCALL +SendDlgItemMessageA( + HWND hDlg, + int nIDDlgItem, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +LRESULT +STDCALL +DefDlgProcA( + HWND hDlg, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +WINBOOL +STDCALL +CallMsgFilterA( + LPMSG lpMsg, + int nCode); + +UINT +STDCALL +RegisterClipboardFormatA( + LPCSTR lpszFormat); + +int +STDCALL +GetClipboardFormatNameA( + UINT format, + LPSTR lpszFormatName, + int cchMaxCount); + +WINBOOL +STDCALL +CharToOemA( + LPCSTR lpszSrc, + LPSTR lpszDst); + +WINBOOL +STDCALL +OemToCharA( + LPCSTR lpszSrc, + LPSTR lpszDst); + +WINBOOL +STDCALL +CharToOemBuffA( + LPCSTR lpszSrc, + LPSTR lpszDst, + DWORD cchDstLength); + +WINBOOL +STDCALL +OemToCharBuffA( + LPCSTR lpszSrc, + LPSTR lpszDst, + DWORD cchDstLength); + +LPSTR +STDCALL +CharUpperA( + LPSTR lpsz); + +DWORD +STDCALL +CharUpperBuffA( + LPSTR lpsz, + DWORD cchLength); + +LPSTR +STDCALL +CharLowerA( + LPSTR lpsz); + +DWORD +STDCALL +CharLowerBuffA( + LPSTR lpsz, + DWORD cchLength); + +LPSTR +STDCALL +CharNextA( + LPCSTR lpsz); + +LPSTR +STDCALL +CharPrevA( + LPCSTR lpszStart, + LPCSTR lpszCurrent); + +WINBOOL +STDCALL +IsCharAlphaA( + CHAR ch); + +WINBOOL +STDCALL +IsCharAlphaNumericA( + CHAR ch); + +WINBOOL +STDCALL +IsCharUpperA( + CHAR ch); + +WINBOOL +STDCALL +IsCharLowerA( + CHAR ch); + +int +STDCALL +GetKeyNameTextA( + LONG lParam, + LPSTR lpString, + int nSize + ); + +SHORT +STDCALL +VkKeyScanA( + CHAR ch); + +SHORT +STDCALL VkKeyScanExA( + CHAR ch, + HKL dwhkl); + +UINT +STDCALL +MapVirtualKeyA( + UINT uCode, + UINT uMapType); + +UINT +STDCALL +MapVirtualKeyExA( + UINT uCode, + UINT uMapType, + HKL dwhkl); + +HACCEL +STDCALL +LoadAcceleratorsA( + HINSTANCE hInstance, + LPCSTR lpTableName); + +HACCEL +STDCALL +CreateAcceleratorTableA( + LPACCEL, int); + +int +STDCALL +CopyAcceleratorTableA( + HACCEL hAccelSrc, + LPACCEL lpAccelDst, + int cAccelEntries); + +int +STDCALL +TranslateAcceleratorA( + HWND hWnd, + HACCEL hAccTable, + LPMSG lpMsg); + +HMENU +STDCALL +LoadMenuA( + HINSTANCE hInstance, + LPCSTR lpMenuName); + +HMENU +STDCALL +LoadMenuIndirectA( + CONST MENUTEMPLATE *lpMenuTemplate); + +WINBOOL +STDCALL +ChangeMenuA( + HMENU hMenu, + UINT cmd, + LPCSTR lpszNewItem, + UINT cmdInsert, + UINT flags); + +int +STDCALL +GetMenuStringA( + HMENU hMenu, + UINT uIDItem, + LPSTR lpString, + int nMaxCount, + UINT uFlag); + +WINBOOL +STDCALL +InsertMenuA( + HMENU hMenu, + UINT uPosition, + UINT uFlags, + UINT uIDNewItem, + LPCSTR lpNewItem + ); + +WINBOOL +STDCALL +AppendMenuA( + HMENU hMenu, + UINT uFlags, + UINT uIDNewItem, + LPCSTR lpNewItem + ); + +WINBOOL +STDCALL +ModifyMenuA( + HMENU hMnu, + UINT uPosition, + UINT uFlags, + UINT uIDNewItem, + LPCSTR lpNewItem + ); + +WINBOOL +STDCALL +InsertMenuItemA( + HMENU, + UINT, + WINBOOL, + LPCMENUITEMINFO + ); + +WINBOOL +STDCALL +GetMenuItemInfoA( + HMENU, + UINT, + WINBOOL, + LPMENUITEMINFO + ); + +WINBOOL +STDCALL +SetMenuItemInfoA( + HMENU hMenu, + UINT uItem, + WINBOOL fByPosition, + LPMENUITEMINFO lpmii); + +int +STDCALL +DrawTextA( + HDC hDC, + LPCSTR lpString, + int nCount, + LPRECT lpRect, + UINT uFormat); + +int +STDCALL +DrawTextExA(HDC, LPSTR, int, LPRECT, UINT, LPDRAWTEXTPARAMS); + +WINBOOL +STDCALL +GrayStringA( + HDC hDC, + HBRUSH hBrush, + GRAYSTRINGPROC lpOutputFunc, + LPARAM lpData, + int nCount, + int X, + int Y, + int nWidth, + int nHeight); + +WINBOOL +STDCALL +DrawStateA(HDC, HBRUSH, DRAWSTATEPROC, LPARAM, WPARAM, int, int, int, int, UINT); + +LONG +STDCALL +TabbedTextOutA( + HDC hDC, + int X, + int Y, + LPCSTR lpString, + int nCount, + int nTabPositions, + LPINT lpnTabStopPositions, + int nTabOrigin); + +DWORD +STDCALL +GetTabbedTextExtentA( + HDC hDC, + LPCSTR lpString, + int nCount, + int nTabPositions, + LPINT lpnTabStopPositions); + +WINBOOL +STDCALL +SetPropA( + HWND hWnd, + LPCSTR lpString, + HANDLE hData); + +HANDLE +STDCALL +GetPropA( + HWND hWnd, + LPCSTR lpString); + +HANDLE +STDCALL +RemovePropA( + HWND hWnd, + LPCSTR lpString); + +int +STDCALL +EnumPropsExA( + HWND hWnd, + PROPENUMPROCEX lpEnumFunc, + LPARAM lParam); + +int +STDCALL +EnumPropsA( + HWND hWnd, + PROPENUMPROC lpEnumFunc); + +WINBOOL +STDCALL +SetWindowTextA( + HWND hWnd, + LPCSTR lpString); + +int +STDCALL +GetWindowTextA( + HWND hWnd, + LPSTR lpString, + int nMaxCount); + +int +STDCALL +GetWindowTextLengthA( + HWND hWnd); + +int +STDCALL +MessageBoxA( + HWND hWnd , + LPCSTR lpText, + LPCSTR lpCaption, + UINT uType); + +int +STDCALL +MessageBoxExA( + HWND hWnd , + LPCSTR lpText, + LPCSTR lpCaption, + UINT uType, + WORD wLanguageId); + +int +STDCALL +MessageBoxIndirectA(LPMSGBOXPARAMS); + +LONG +STDCALL +GetWindowLongA( + HWND hWnd, + int nIndex); + +LONG +STDCALL +SetWindowLongA( + HWND hWnd, + int nIndex, + LONG dwNewLong); + +DWORD +STDCALL +GetClassLongA( + HWND hWnd, + int nIndex); + +DWORD +STDCALL +SetClassLongA( + HWND hWnd, + int nIndex, + LONG dwNewLong); + +HWND +STDCALL +FindWindowA( + LPCSTR lpClassName , + LPCSTR lpWindowName); + +HWND +STDCALL +FindWindowExA(HWND, HWND, LPCSTR, LPCSTR); + +int +STDCALL +GetClassNameA( + HWND hWnd, + LPSTR lpClassName, + int nMaxCount); + +HHOOK +STDCALL +SetWindowsHookExA( + int idHook, + HOOKPROC lpfn, + HINSTANCE hmod, + DWORD dwThreadId); + +HBITMAP +STDCALL +LoadBitmapA( + HINSTANCE hInstance, + LPCSTR lpBitmapName); + +HCURSOR +STDCALL +LoadCursorA( + HINSTANCE hInstance, + LPCSTR lpCursorName); + +HCURSOR +STDCALL +LoadCursorFromFileA( + LPCSTR lpFileName); + +HICON +STDCALL +LoadIconA( + HINSTANCE hInstance, + LPCSTR lpIconName); + +HANDLE +STDCALL +LoadImageA( + HINSTANCE, + LPCSTR, + UINT, + int, + int, + UINT); + +int +STDCALL +LoadStringA( + HINSTANCE hInstance, + UINT uID, + LPSTR lpBuffer, + int nBufferMax); + +int +STDCALL +DlgDirListA( + HWND hDlg, + LPSTR lpPathSpec, + int nIDListBox, + int nIDStaticPath, + UINT uFileType); + +WINBOOL +STDCALL +DlgDirSelectExA( + HWND hDlg, + LPSTR lpString, + int nCount, + int nIDListBox); + +int +STDCALL +DlgDirListComboBoxA( + HWND hDlg, + LPSTR lpPathSpec, + int nIDComboBox, + int nIDStaticPath, + UINT uFiletype); + +WINBOOL +STDCALL +DlgDirSelectComboBoxExA( + HWND hDlg, + LPSTR lpString, + int nCount, + int nIDComboBox); + +LRESULT +STDCALL +DefFrameProcA( + HWND hWnd, + HWND hWndMDIClient , + UINT uMsg, + WPARAM wParam, + LPARAM lParam); + +LRESULT +STDCALL +DefMDIChildProcA( + HWND hWnd, + UINT uMsg, + WPARAM wParam, + LPARAM lParam); + +HWND +STDCALL +CreateMDIWindowA( + LPCSTR lpClassName, + LPCSTR lpWindowName, + DWORD dwStyle, + int X, + int Y, + int nWidth, + int nHeight, + HWND hWndParent, + HINSTANCE hInstance, + LPARAM lParam + ); + +WINBOOL +STDCALL +WinHelpA( + HWND hWndMain, + LPCSTR lpszHelp, + UINT uCommand, + DWORD dwData + ); + +LONG +STDCALL +ChangeDisplaySettingsA( + LPDEVMODEA lpDevMode, + DWORD dwFlags); + +WINBOOL +STDCALL +EnumDisplaySettingsA( + LPCSTR lpszDeviceName, + DWORD iModeNum, + LPDEVMODEA lpDevMode); + +WINBOOL +STDCALL +SystemParametersInfoA( + UINT uiAction, + UINT uiParam, + PVOID pvParam, + UINT fWinIni); + +int +STDCALL +AddFontResourceA(LPCSTR); + +HMETAFILE +STDCALL +CopyMetaFileA(HMETAFILE, LPCSTR); + +HFONT +STDCALL +CreateFontIndirectA(CONST LOGFONT *); + +HDC +STDCALL +CreateICA(LPCSTR, LPCSTR , LPCSTR , CONST DEVMODEA *); + +HDC +STDCALL +CreateMetaFileA(LPCSTR); + +WINBOOL +STDCALL +CreateScalableFontResourceA(DWORD, LPCSTR, LPCSTR, LPCSTR); + +int +STDCALL +DeviceCapabilitiesA(LPCSTR, LPCSTR, WORD, + LPSTR, CONST DEVMODEA *); + +int +STDCALL +EnumFontFamiliesExA(HDC, LPLOGFONT, FONTENUMEXPROC, LPARAM,DWORD); + +int +STDCALL +EnumFontFamiliesA(HDC, LPCSTR, FONTENUMPROC, LPARAM); + +int +STDCALL +EnumFontsA(HDC, LPCSTR, ENUMFONTSPROC, LPARAM); + +WINBOOL +STDCALL +GetCharWidthA(HDC, UINT, UINT, LPINT); + +WINBOOL +STDCALL +GetCharWidth32A(HDC, UINT, UINT, LPINT); + +WINBOOL +STDCALL +GetCharWidthFloatA(HDC, UINT, UINT, PFLOAT); + +WINBOOL +STDCALL +GetCharABCWidthsA(HDC, UINT, UINT, LPABC); + +WINBOOL +STDCALL +GetCharABCWidthsFloatA(HDC, UINT, UINT, LPABCFLOAT); +DWORD +STDCALL +GetGlyphOutlineA(HDC, UINT, UINT, LPGLYPHMETRICS, DWORD, LPVOID, CONST MAT2 *); + +HMETAFILE +STDCALL +GetMetaFileA(LPCSTR); + +UINT +STDCALL +GetOutlineTextMetricsA(HDC, UINT, LPOUTLINETEXTMETRIC); + +WINBOOL +STDCALL +GetTextExtentPointA( + HDC, + LPCSTR, + int, + LPSIZE + ); + +WINBOOL +STDCALL +GetTextExtentPoint32A( + HDC, + LPCSTR, + int, + LPSIZE + ); + +WINBOOL +STDCALL +GetTextExtentExPointA( + HDC, + LPCSTR, + int, + int, + LPINT, + LPINT, + LPSIZE + ); + +DWORD +STDCALL +GetCharacterPlacementA(HDC, LPCSTR, int, int, LPGCP_RESULTS, DWORD); + +HDC +STDCALL +ResetDCA(HDC, CONST DEVMODEA *); + +WINBOOL +STDCALL +RemoveFontResourceA(LPCSTR); + +HENHMETAFILE +STDCALL +CopyEnhMetaFileA(HENHMETAFILE, LPCSTR); + +HDC +STDCALL +CreateEnhMetaFileA(HDC, LPCSTR, CONST RECT *, LPCSTR); + +HENHMETAFILE +STDCALL +GetEnhMetaFileA(LPCSTR); + +UINT +STDCALL +GetEnhMetaFileDescriptionA(HENHMETAFILE, UINT, LPSTR ); + +WINBOOL +STDCALL +GetTextMetricsA(HDC, LPTEXTMETRIC); + +int +STDCALL +StartDocA(HDC, CONST DOCINFO *); + +int +STDCALL +GetObjectA(HGDIOBJ, int, LPVOID); + +WINBOOL +STDCALL +TextOutA(HDC, int, int, LPCSTR, int); + +WINBOOL +STDCALL +ExtTextOutA(HDC, int, int, UINT, CONST RECT *,LPCSTR, UINT, CONST INT *); + +WINBOOL +STDCALL +PolyTextOutA(HDC, CONST POLYTEXT *, int); + +int +STDCALL +GetTextFaceA(HDC, int, LPSTR); + +DWORD +STDCALL +GetKerningPairsA(HDC, DWORD, LPKERNINGPAIR); + +HCOLORSPACE +STDCALL +CreateColorSpaceA(LPLOGCOLORSPACE); + +WINBOOL +STDCALL +GetLogColorSpaceA(HCOLORSPACE,LPLOGCOLORSPACE,DWORD); + +WINBOOL +STDCALL +GetICMProfileA(HDC,DWORD,LPSTR); + +WINBOOL +STDCALL +SetICMProfileA(HDC,LPSTR); + +WINBOOL +STDCALL +UpdateICMRegKeyA(DWORD, DWORD, LPSTR, UINT); + +int +STDCALL +EnumICMProfilesA(HDC,ICMENUMPROC,LPARAM); + +int +STDCALL +PropertySheetA(LPCPROPSHEETHEADER lppsph); + +HIMAGELIST +STDCALL +ImageList_LoadImageA(HINSTANCE hi, LPCSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags); + +HWND +STDCALL +CreateStatusWindowA(LONG style, LPCSTR lpszText, HWND hwndParent, UINT wID); + +void +STDCALL +DrawStatusTextA(HDC hDC, LPRECT lprc, LPCSTR pszText, UINT uFlags); + +WINBOOL +STDCALL +GetOpenFileNameA(LPOPENFILENAME); + +WINBOOL +STDCALL +GetSaveFileNameA(LPOPENFILENAME); + +short +STDCALL +GetFileTitleA(LPCSTR, LPSTR, WORD); + +WINBOOL +STDCALL +ChooseColorA(LPCHOOSECOLOR); + +HWND +STDCALL +FindTextA(LPFINDREPLACE); + +HWND +STDCALL +ReplaceTextA(LPFINDREPLACE); + +WINBOOL +STDCALL +ChooseFontA(LPCHOOSEFONT); + +WINBOOL +STDCALL +PrintDlgA(LPPRINTDLG); + +WINBOOL +STDCALL +PageSetupDlgA( LPPAGESETUPDLG ); + +WINBOOL +STDCALL +CreateProcessA( + LPCSTR lpApplicationName, + LPSTR lpCommandLine, + LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, + WINBOOL bInheritHandles, + DWORD dwCreationFlags, + LPVOID lpEnvironment, + LPCSTR lpCurrentDirectory, + LPSTARTUPINFOA lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation + ); + +VOID +STDCALL +GetStartupInfoA( + LPSTARTUPINFOA lpStartupInfo + ); + +WINBASEAPI +HANDLE +WINAPI +FindFirstFileExA ( + LPCSTR lpFileName, + FINDEX_INFO_LEVELS fInfoLevelId, + LPVOID lpFindFileData, + FINDEX_SEARCH_OPS fSearchOp, + LPVOID lpSearchFilter, + DWORD dwAdditionalFlags + ); + +HANDLE +STDCALL +FindFirstFileA( + LPCSTR lpFileName, + LPWIN32_FIND_DATA lpFindFileData + ); + +WINBOOL +STDCALL +FindNextFileA( + HANDLE hFindFile, + LPWIN32_FIND_DATA lpFindFileData + ); + +WINBOOL +STDCALL +GetVersionExA( + LPOSVERSIONINFO lpVersionInformation + ); + +#define CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y,\ +nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)\ +CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y,\ +nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) + +#define CreateDialogA(hInstance, lpName, hWndParent, lpDialogFunc) \ +CreateDialogParamA(hInstance, lpName, hWndParent, lpDialogFunc, 0L) + +#define CreateDialogIndirectA(hInstance, lpTemplate, hWndParent, lpDialogFunc) \ +CreateDialogIndirectParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L) + +#define DialogBoxA(hInstance, lpTemplate, hWndParent, lpDialogFunc) \ +DialogBoxParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L) + +#define DialogBoxIndirectA(hInstance, lpTemplate, hWndParent, lpDialogFunc) \ +DialogBoxIndirectParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L) + +HDC +STDCALL +CreateDCA(LPCSTR, LPCSTR , LPCSTR , CONST DEVMODEA *); + +DWORD +STDCALL +VerInstallFileA( + DWORD uFlags, + LPSTR szSrcFileName, + LPSTR szDestFileName, + LPSTR szSrcDir, + LPSTR szDestDir, + LPSTR szCurDir, + LPSTR szTmpFile, + PUINT lpuTmpFileLen + ); + +DWORD +STDCALL +GetFileVersionInfoSizeA( + LPSTR lptstrFilename, + LPDWORD lpdwHandle + ); + +WINBOOL +STDCALL +GetFileVersionInfoA( + LPSTR lptstrFilename, + DWORD dwHandle, + DWORD dwLen, + LPVOID lpData + ); + +DWORD +STDCALL +VerLanguageNameA( + DWORD wLang, + LPSTR szLang, + DWORD nSize + ); + +WINBOOL +STDCALL +VerQueryValueA( + const LPVOID pBlock, + LPSTR lpSubBlock, + LPVOID * lplpBuffer, + PUINT puLen + ); + +DWORD +STDCALL +VerFindFileA( + DWORD uFlags, + LPSTR szFileName, + LPSTR szWinDir, + LPSTR szAppDir, + LPSTR szCurDir, + PUINT lpuCurDirLen, + LPSTR szDestDir, + PUINT lpuDestDirLen + ); + +LONG +STDCALL +RegConnectRegistryA ( + LPSTR lpMachineName, + HKEY hKey, + PHKEY phkResult + ); + +LONG +STDCALL +RegCreateKeyA ( + HKEY hKey, + LPCSTR lpSubKey, + PHKEY phkResult + ); + +LONG +STDCALL +RegCreateKeyExA ( + HKEY hKey, + LPCSTR lpSubKey, + DWORD Reserved, + LPSTR lpClass, + DWORD dwOptions, + REGSAM samDesired, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, + PHKEY phkResult, + LPDWORD lpdwDisposition + ); + +LONG +STDCALL +RegDeleteKeyA ( + HKEY hKey, + LPCSTR lpSubKey + ); + +LONG +STDCALL +RegDeleteValueA ( + HKEY hKey, + LPCSTR lpValueName + ); + +LONG +STDCALL +RegEnumKeyA ( + HKEY hKey, + DWORD dwIndex, + LPSTR lpName, + DWORD cbName + ); + +LONG +STDCALL +RegEnumKeyExA ( + HKEY hKey, + DWORD dwIndex, + LPSTR lpName, + LPDWORD lpcbName, + LPDWORD lpReserved, + LPSTR lpClass, + LPDWORD lpcbClass, + PFILETIME lpftLastWriteTime + ); + +LONG +STDCALL +RegEnumValueA ( + HKEY hKey, + DWORD dwIndex, + LPSTR lpValueName, + LPDWORD lpcbValueName, + LPDWORD lpReserved, + LPDWORD lpType, + LPBYTE lpData, + LPDWORD lpcbData + ); + +LONG +STDCALL +RegLoadKeyA ( + HKEY hKey, + LPCSTR lpSubKey, + LPCSTR lpFile + ); + +LONG +STDCALL +RegOpenKeyA ( + HKEY hKey, + LPCSTR lpSubKey, + PHKEY phkResult + ); + +LONG +STDCALL +RegOpenKeyExA ( + HKEY hKey, + LPCSTR lpSubKey, + DWORD ulOptions, + REGSAM samDesired, + PHKEY phkResult + ); + +LONG +STDCALL +RegQueryInfoKeyA ( + HKEY hKey, + LPSTR lpClass, + LPDWORD lpcbClass, + LPDWORD lpReserved, + LPDWORD lpcSubKeys, + LPDWORD lpcbMaxSubKeyLen, + LPDWORD lpcbMaxClassLen, + LPDWORD lpcValues, + LPDWORD lpcbMaxValueNameLen, + LPDWORD lpcbMaxValueLen, + LPDWORD lpcbSecurityDescriptor, + PFILETIME lpftLastWriteTime + ); + +LONG +STDCALL +RegQueryValueA ( + HKEY hKey, + LPCSTR lpSubKey, + LPSTR lpValue, + PLONG lpcbValue + ); + +LONG +STDCALL +RegQueryMultipleValuesA ( + HKEY hKey, + PVALENT val_list, + DWORD num_vals, + LPSTR lpValueBuf, + LPDWORD ldwTotsize + ); + +LONG +STDCALL +RegQueryValueExA ( + HKEY hKey, + LPSTR lpValueName, + LPDWORD lpReserved, + LPDWORD lpType, + LPBYTE lpData, + LPDWORD lpcbData + ); + +LONG +STDCALL +RegReplaceKeyA ( + HKEY hKey, + LPCSTR lpSubKey, + LPCSTR lpNewFile, + LPCSTR lpOldFile + ); + +LONG +STDCALL +RegRestoreKeyA ( + HKEY hKey, + LPCSTR lpFile, + DWORD dwFlags + ); + +LONG +STDCALL +RegSaveKeyA ( + HKEY hKey, + LPCSTR lpFile, + LPSECURITY_ATTRIBUTES lpSecurityAttributes + ); + +LONG +STDCALL +RegSetValueA ( + HKEY hKey, + LPCSTR lpSubKey, + DWORD dwType, + LPCSTR lpData, + DWORD cbData + ); + +LONG +STDCALL +RegSetValueExA ( + HKEY hKey, + LPCSTR lpValueName, + DWORD Reserved, + DWORD dwType, + CONST BYTE* lpData, + DWORD cbData + ); + +LONG +STDCALL +RegUnLoadKeyA ( + HKEY hKey, + LPCSTR lpSubKey + ); + +WINBOOL +STDCALL +InitiateSystemShutdownA( + LPSTR lpMachineName, + LPSTR lpMessage, + DWORD dwTimeout, + WINBOOL bForceAppsClosed, + WINBOOL bRebootAfterShutdown + ); + +WINBOOL +STDCALL +AbortSystemShutdownA( + LPSTR lpMachineName + ); + +int +STDCALL +CompareStringA( + LCID Locale, + DWORD dwCmpFlags, + LPCSTR lpString1, + int cchCount1, + LPCSTR lpString2, + int cchCount2); + +int +STDCALL +LCMapStringA( + LCID Locale, + DWORD dwMapFlags, + LPCSTR lpSrcStr, + int cchSrc, + LPSTR lpDestStr, + int cchDest); + +int +STDCALL +GetLocaleInfoA( + LCID Locale, + LCTYPE LCType, + LPSTR lpLCData, + int cchData); + +WINBOOL +STDCALL +SetLocaleInfoA( + LCID Locale, + LCTYPE LCType, + LPCSTR lpLCData); + +int +STDCALL +GetTimeFormatA( + LCID Locale, + DWORD dwFlags, + CONST SYSTEMTIME *lpTime, + LPCSTR lpFormat, + LPSTR lpTimeStr, + int cchTime); + +int +STDCALL +GetDateFormatA( + LCID Locale, + DWORD dwFlags, + CONST SYSTEMTIME *lpDate, + LPCSTR lpFormat, + LPSTR lpDateStr, + int cchDate); + +int +STDCALL +GetNumberFormatA( + LCID Locale, + DWORD dwFlags, + LPCSTR lpValue, + CONST NUMBERFMT *lpFormat, + LPSTR lpNumberStr, + int cchNumber); + +int +STDCALL +GetCurrencyFormatA( + LCID Locale, + DWORD dwFlags, + LPCSTR lpValue, + CONST CURRENCYFMT *lpFormat, + LPSTR lpCurrencyStr, + int cchCurrency); + +WINBOOL +STDCALL +EnumCalendarInfoA( + CALINFO_ENUMPROC lpCalInfoEnumProc, + LCID Locale, + CALID Calendar, + CALTYPE CalType); + +WINBOOL +STDCALL +EnumTimeFormatsA( + TIMEFMT_ENUMPROC lpTimeFmtEnumProc, + LCID Locale, + DWORD dwFlags); + +WINBOOL +STDCALL +EnumDateFormatsA( + DATEFMT_ENUMPROC lpDateFmtEnumProc, + LCID Locale, + DWORD dwFlags); + +WINBOOL +STDCALL +GetStringTypeExA( + LCID Locale, + DWORD dwInfoType, + LPCSTR lpSrcStr, + int cchSrc, + LPWORD lpCharType); + +WINBOOL +STDCALL +GetStringTypeA( + LCID Locale, + DWORD dwInfoType, + LPCSTR lpSrcStr, + int cchSrc, + LPWORD lpCharType); + + +int +STDCALL +FoldStringA( + DWORD dwMapFlags, + LPCSTR lpSrcStr, + int cchSrc, + LPSTR lpDestStr, + int cchDest); + +WINBOOL +STDCALL +EnumSystemLocalesA( + LOCALE_ENUMPROC lpLocaleEnumProc, + DWORD dwFlags); + +WINBOOL +STDCALL +EnumSystemCodePagesA( + CODEPAGE_ENUMPROC lpCodePageEnumProc, + DWORD dwFlags); + +WINBOOL +STDCALL +PeekConsoleInputA( + HANDLE hConsoleInput, + PINPUT_RECORD lpBuffer, + DWORD nLength, + LPDWORD lpNumberOfEventsRead + ); + +WINBOOL +STDCALL +ReadConsoleInputA( + HANDLE hConsoleInput, + PINPUT_RECORD lpBuffer, + DWORD nLength, + LPDWORD lpNumberOfEventsRead + ); + +WINBOOL +STDCALL +WriteConsoleInputA( + HANDLE hConsoleInput, + CONST INPUT_RECORD *lpBuffer, + DWORD nLength, + LPDWORD lpNumberOfEventsWritten + ); + +WINBOOL +STDCALL +ReadConsoleOutputA( + HANDLE hConsoleOutput, + PCHAR_INFO lpBuffer, + COORD dwBufferSize, + COORD dwBufferCoord, + PSMALL_RECT lpReadRegion + ); + +WINBOOL +STDCALL +WriteConsoleOutputA( + HANDLE hConsoleOutput, + CONST CHAR_INFO *lpBuffer, + COORD dwBufferSize, + COORD dwBufferCoord, + PSMALL_RECT lpWriteRegion + ); + +WINBOOL +STDCALL +ReadConsoleOutputCharacterA( + HANDLE hConsoleOutput, + LPSTR lpCharacter, + DWORD nLength, + COORD dwReadCoord, + LPDWORD lpNumberOfCharsRead + ); + +WINBOOL +STDCALL +WriteConsoleOutputCharacterA( + HANDLE hConsoleOutput, + LPCSTR lpCharacter, + DWORD nLength, + COORD dwWriteCoord, + LPDWORD lpNumberOfCharsWritten + ); + +WINBOOL +STDCALL +FillConsoleOutputCharacterA( + HANDLE hConsoleOutput, + CHAR cCharacter, + DWORD nLength, + COORD dwWriteCoord, + LPDWORD lpNumberOfCharsWritten + ); + +WINBOOL +STDCALL +ScrollConsoleScreenBufferA( + HANDLE hConsoleOutput, + CONST SMALL_RECT *lpScrollRectangle, + CONST SMALL_RECT *lpClipRectangle, + COORD dwDestinationOrigin, + CONST CHAR_INFO *lpFill + ); + +DWORD +STDCALL +GetConsoleTitleA( + LPSTR lpConsoleTitle, + DWORD nSize + ); + +WINBOOL +STDCALL +SetConsoleTitleA( + LPCSTR lpConsoleTitle + ); + +WINBOOL +STDCALL +ReadConsoleA( + HANDLE hConsoleInput, + LPVOID lpBuffer, + DWORD nNumberOfCharsToRead, + LPDWORD lpNumberOfCharsRead, + LPVOID lpReserved + ); + +WINBOOL +STDCALL +WriteConsoleA( + HANDLE hConsoleOutput, + CONST VOID *lpBuffer, + DWORD nNumberOfCharsToWrite, + LPDWORD lpNumberOfCharsWritten, + LPVOID lpReserved + ); + +DWORD STDCALL +WNetAddConnectionA( + LPCSTR lpRemoteName, + LPCSTR lpPassword, + LPCSTR lpLocalName + ); + +DWORD STDCALL +WNetAddConnection2A( + LPNETRESOURCE lpNetResource, + LPCSTR lpPassword, + LPCSTR lpUserName, + DWORD dwFlags + ); + +DWORD STDCALL +WNetAddConnection3A( + HWND hwndOwner, + LPNETRESOURCE lpNetResource, + LPCSTR lpPassword, + LPCSTR lpUserName, + DWORD dwFlags + ); + +DWORD STDCALL +WNetCancelConnectionA( + LPCSTR lpName, + WINBOOL fForce + ); + +DWORD STDCALL +WNetCancelConnection2A( + LPCSTR lpName, + DWORD dwFlags, + WINBOOL fForce + ); + +DWORD STDCALL +WNetGetConnectionA( + LPCSTR lpLocalName, + LPSTR lpRemoteName, + LPDWORD lpnLength + ); + +DWORD STDCALL +WNetUseConnectionA( + HWND hwndOwner, + LPNETRESOURCE lpNetResource, + LPCSTR lpUserID, + LPCSTR lpPassword, + DWORD dwFlags, + LPSTR lpAccessName, + LPDWORD lpBufferSize, + LPDWORD lpResult + ); + +DWORD STDCALL +WNetSetConnectionA( + LPCSTR lpName, + DWORD dwProperties, + LPVOID pvValues + ); + +DWORD STDCALL +WNetConnectionDialog1A( + LPCONNECTDLGSTRUCT lpConnDlgStruct + ); + +DWORD STDCALL +WNetDisconnectDialog1A( + LPDISCDLGSTRUCT lpConnDlgStruct + ); + +DWORD STDCALL +WNetOpenEnumA( + DWORD dwScope, + DWORD dwType, + DWORD dwUsage, + LPNETRESOURCE lpNetResource, + LPHANDLE lphEnum + ); + +DWORD STDCALL +WNetEnumResourceA( + HANDLE hEnum, + LPDWORD lpcCount, + LPVOID lpBuffer, + LPDWORD lpBufferSize + ); + +DWORD STDCALL +WNetGetUniversalNameA( + LPCSTR lpLocalPath, + DWORD dwInfoLevel, + LPVOID lpBuffer, + LPDWORD lpBufferSize + ); + +DWORD STDCALL +WNetGetUserA( + LPCSTR lpName, + LPSTR lpUserName, + LPDWORD lpnLength + ); + +DWORD STDCALL +WNetGetProviderNameA( + DWORD dwNetType, + LPSTR lpProviderName, + LPDWORD lpBufferSize + ); + +DWORD STDCALL +WNetGetNetworkInformationA( + LPCSTR lpProvider, + LPNETINFOSTRUCT lpNetInfoStruct + ); + +DWORD STDCALL +WNetGetLastErrorA( + LPDWORD lpError, + LPSTR lpErrorBuf, + DWORD nErrorBufSize, + LPSTR lpNameBuf, + DWORD nNameBufSize + ); + +DWORD STDCALL +MultinetGetConnectionPerformanceA( + LPNETRESOURCE lpNetResource, + LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct + ); + +WINBOOL +STDCALL +ChangeServiceConfigA( + SC_HANDLE hService, + DWORD dwServiceType, + DWORD dwStartType, + DWORD dwErrorControl, + LPCSTR lpBinaryPathName, + LPCSTR lpLoadOrderGroup, + LPDWORD lpdwTagId, + LPCSTR lpDependencies, + LPCSTR lpServiceStartName, + LPCSTR lpPassword, + LPCSTR lpDisplayName + ); + +SC_HANDLE +STDCALL +CreateServiceA( + SC_HANDLE hSCManager, + LPCSTR lpServiceName, + LPCSTR lpDisplayName, + DWORD dwDesiredAccess, + DWORD dwServiceType, + DWORD dwStartType, + DWORD dwErrorControl, + LPCSTR lpBinaryPathName, + LPCSTR lpLoadOrderGroup, + LPDWORD lpdwTagId, + LPCSTR lpDependencies, + LPCSTR lpServiceStartName, + LPCSTR lpPassword + ); + +WINBOOL +STDCALL +EnumDependentServicesA( + SC_HANDLE hService, + DWORD dwServiceState, + LPENUM_SERVICE_STATUSA lpServices, + DWORD cbBufSize, + LPDWORD pcbBytesNeeded, + LPDWORD lpServicesReturned + ); + +WINBOOL +STDCALL +EnumServicesStatusA( + SC_HANDLE hSCManager, + DWORD dwServiceType, + DWORD dwServiceState, + LPENUM_SERVICE_STATUSA lpServices, + DWORD cbBufSize, + LPDWORD pcbBytesNeeded, + LPDWORD lpServicesReturned, + LPDWORD lpResumeHandle + ); + +WINBOOL +STDCALL +GetServiceKeyNameA( + SC_HANDLE hSCManager, + LPCSTR lpDisplayName, + LPSTR lpServiceName, + LPDWORD lpcchBuffer + ); + +WINBOOL +STDCALL +GetServiceDisplayNameA( + SC_HANDLE hSCManager, + LPCSTR lpServiceName, + LPSTR lpDisplayName, + LPDWORD lpcchBuffer + ); + +SC_HANDLE +STDCALL +OpenSCManagerA( + LPCSTR lpMachineName, + LPCSTR lpDatabaseName, + DWORD dwDesiredAccess + ); + +SC_HANDLE +STDCALL +OpenServiceA( + SC_HANDLE hSCManager, + LPCSTR lpServiceName, + DWORD dwDesiredAccess + ); + +WINBOOL +STDCALL +QueryServiceConfigA( + SC_HANDLE hService, + LPQUERY_SERVICE_CONFIGA lpServiceConfig, + DWORD cbBufSize, + LPDWORD pcbBytesNeeded + ); + +WINBOOL +STDCALL +QueryServiceLockStatusA( + SC_HANDLE hSCManager, + LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus, + DWORD cbBufSize, + LPDWORD pcbBytesNeeded + ); + +SERVICE_STATUS_HANDLE +STDCALL +RegisterServiceCtrlHandlerA( + LPCSTR lpServiceName, + LPHANDLER_FUNCTION lpHandlerProc + ); + +WINBOOL +STDCALL +StartServiceCtrlDispatcherA( + LPSERVICE_TABLE_ENTRYA lpServiceStartTable + ); + +WINBOOL +STDCALL +StartServiceA( + SC_HANDLE hService, + DWORD dwNumServiceArgs, + LPCSTR *lpServiceArgVectors + ); + +/* Extensions to OpenGL */ + +WINBOOL STDCALL +wglUseFontBitmapsA(HDC, DWORD, DWORD, DWORD); + +WINBOOL STDCALL +wglUseFontOutlinesA(HDC, DWORD, DWORD, DWORD, FLOAT, + FLOAT, int, LPGLYPHMETRICSFLOAT); + +/* ------------------------------------- */ +/* From shellapi.h in old Cygnus headers */ + +unsigned int WINAPI +DragQueryFileA(HDROP, unsigned int, char *, unsigned int); + +HICON WINAPI +ExtractAssociatedIconA (HINSTANCE, char *, WORD *); + +HICON WINAPI +ExtractIconA (HINSTANCE, const char *, unsigned int); + +HINSTANCE WINAPI +FindExecutableA (const char *, const char *, char *); + +int WINAPI +ShellAboutA (HWND, const char *, const char *, HICON); + +HINSTANCE WINAPI +ShellExecuteA (HWND, const char *, const char *, char *, const char *, int); + +/* end of stuff from shellapi.h in old Cygnus headers */ +/* -------------------------------------------------- */ +/* From ddeml.h in old Cygnus headers */ + +HSZ WINAPI +DdeCreateStringHandleA (DWORD, char *, int); + +UINT WINAPI +DdeInitializeA (DWORD *, CALLB, DWORD, DWORD); + +DWORD WINAPI +DdeQueryStringA (DWORD, HSZ, char *, DWORD, int); + +/* end of stuff from ddeml.h in old Cygnus headers */ +/* ----------------------------------------------- */ + +WINBOOL STDCALL LogonUserA (LPSTR, LPSTR, LPSTR, DWORD, DWORD, HANDLE *); +WINBOOL STDCALL CreateProcessAsUserA (HANDLE, LPCTSTR, LPTSTR, + SECURITY_ATTRIBUTES*, SECURITY_ATTRIBUTES*, WINBOOL, DWORD, LPVOID, + LPCTSTR, STARTUPINFOA*, PROCESS_INFORMATION*); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _GNU_H_WINDOWS32_ASCIIFUNCTIONS */ diff --git a/reactos/include/base.h b/reactos/include/base.h new file mode 100644 index 00000000000..d57906e5378 --- /dev/null +++ b/reactos/include/base.h @@ -0,0 +1,493 @@ +/* + Base.h + + Base definitions + + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + + Author: Scott Christley + + This file is part of the Windows32 API Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + If you are interested in a warranty or support for this source code, + contact Scott Christley for more information. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNU_H_WINDOWS32_BASE +#define _GNU_H_WINDOWS32_BASE + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#ifndef NULL +#ifdef __cplusplus +#define NULL (0) +#else +#define NULL ((void *)0) +#endif +#endif /* !NULL */ + +#include + +/* Check VOID before defining CHAR, SHORT, and LONG */ +#ifndef VOID +#define VOID void +typedef char CHAR; +typedef short SHORT; +typedef long LONG; +#endif + + +#define CONST const + +#ifdef i386 +#define STDCALL __attribute__ ((stdcall)) +#define CDECL __attribute((cdecl)) +#define CALLBACK WINAPI +#define PASCAL WINAPI +#else +#define STDCALL +#define CDECL +#define CALLBACK +#define PASCAL +#endif +#define WINAPI STDCALL +#define APIENTRY STDCALL +#define WINGDIAPI + + + +#ifdef UNICODE +typedef unsigned short *LPTCH; +typedef unsigned short *LPTSTR; +#else +typedef char *LPTCH; +typedef char *LPTSTR; +#endif /* UNICODE */ + +#ifndef RC_INVOKED + +/* typedef ACMDRIVERENUMCB; +typedef ACMDRIVERPROC; +typedef ACMFILERCHOOSEHOOKPROC; +typedef ACMFILTERENUMCB; +typedef ACMFILTERTAGENUMCB; +typedef ACMFORMATCHOOSEHOOKPROC; +typedef ACMFORMATENUMCB; +typedef ACMFORMATTAGENUMCB; +typedef APPLET_PROC; +*/ +/* Changed from BOOL to WINBOOL to avoid Objective-C conflict */ +typedef unsigned long CALTYPE; +typedef unsigned long CALID; +typedef unsigned long COLORREF; + +/* +typedef CTRYID; +typedef DLGPROC; +*/ +typedef double DWORDLONG, *PDWORDLONG; +/* +typedef EDITWORDBREAKPROC; +typedef ENHMFENUMPROC; +typedef ENUMRESLANGPROC; +typedef ENUMRESNAMEPROC; +typedef ENUMRESTYPEPROC; +*/ +typedef float FLOAT; +/* typedef GLOBALHANDLE; */ +typedef HANDLE HACCEL; +typedef HANDLE HBITMAP; +typedef HANDLE HBRUSH; +typedef HANDLE HCOLORSPACE; +typedef HANDLE HCONV; +typedef HANDLE HCONVLIST; +typedef HANDLE HCURSOR; +typedef HANDLE HDBC; +typedef HANDLE HDC; +typedef HANDLE HDDEDATA; +typedef HANDLE HDESK; +typedef HANDLE HDROP; +typedef HANDLE HDWP; +typedef HANDLE HENHMETAFILE; +typedef HANDLE HENV; +typedef int HFILE; +typedef HANDLE HFONT; +typedef HANDLE HGDIOBJ; +typedef HANDLE HGLOBAL; +typedef HANDLE HGLRC; +typedef HANDLE HHOOK; +typedef HANDLE HICON; +typedef HANDLE HIMAGELIST; +typedef HANDLE HINSTANCE; +typedef HANDLE HKEY, *PHKEY; +typedef HANDLE HKL; +typedef HANDLE HLOCAL; +typedef HANDLE HMENU; +typedef HANDLE HMETAFILE; +typedef HANDLE HMODULE; +typedef HANDLE HPALETTE; +typedef HANDLE HPEN; +typedef HANDLE HRASCONN; +typedef long HRESULT; +typedef HANDLE HRGN; +typedef HANDLE HRSRC; +typedef HANDLE HSTMT; +typedef HANDLE HSZ; +typedef HANDLE HWINSTA; +typedef HANDLE HWND; +typedef unsigned short LANGID; +//typedef DWORD LCID; +typedef DWORD LCTYPE; +/* typedef LOCALHANDLE */ +typedef unsigned short *LP; +typedef long LPARAM; +typedef int WINBOOL; +typedef WINBOOL *LPBOOL; +typedef CONST CHAR *LPCCH; +typedef CHAR *LPCH; +typedef COLORREF *LPCOLORREF; + +#ifdef UNICODE +typedef const unsigned short *LPCTSTR; +#else +typedef const char *LPCTSTR; +#endif /* UNICODE */ + +typedef const unsigned short *LPCWCH; +typedef DWORD *LPDWORD; +/* typedef LPFRHOOKPROC; */ +typedef HANDLE *LPHANDLE; +/* typedef LPHANDLER_FUNCTION; */ +typedef PINT LPINT; +typedef PLONG LPLONG; + +typedef long LRESULT; +typedef unsigned short *LPWCH; +typedef unsigned short *LPWORD; +/* typedef NPSTR; */ +typedef unsigned short *NWPSTR; +typedef WINBOOL *PWINBOOL; +typedef const CHAR *PCCH; +typedef const char *PCSTR; +typedef const unsigned short *PCWCH; +/* typedef PHKEY; */ +/* typedef LCID *PLCID; */ +typedef short *PSHORT; +/* typedef PSID; */ +typedef char *PSTR; +typedef char *PSZ; + +#ifdef UNICODE +typedef unsigned short *PTBYTE; +typedef unsigned short *PTCH; +typedef unsigned short *PTCHAR; +typedef unsigned short *PTSTR; +#else +typedef unsigned char *PTBYTE; +typedef char *PTCH; +typedef char *PTCHAR; +typedef char *PTSTR; +#endif /* UNICODE */ + +/* + typedef PWSTR; + */ +typedef DWORD REGSAM; + + +typedef short RETCODE; + +typedef HANDLE SC_HANDLE; +typedef LPVOID SC_LOCK; +typedef SC_HANDLE *LPSC_HANDLE; +typedef DWORD SERVICE_STATUS_HANDLE; +/* typedef SPHANDLE; */ + +#ifdef UNICODE +typedef unsigned short TBYTE; +#ifndef _TCHAR_DEFINED +#define _TCHAR_DEFINED +typedef unsigned short TCHAR; +#endif /* _TCHAR_DEFINED */ +typedef unsigned short BCHAR; +#else +typedef unsigned char TBYTE; +#ifndef _TCHAR_DEFINED +#define _TCHAR_DEFINED +typedef char TCHAR; +#endif /* _TCHAR_DEFINED */ +typedef BYTE BCHAR; +#endif /* UNICODE */ + +typedef unsigned int WPARAM; +/* typedef YIELDPROC; */ + +/* Only use __stdcall under WIN32 compiler */ + +#define _export + +/* + Enumerations +*/ + + +#define RASCS_DONE 0x2000 +#define RASCS_PAUSED 0x1000 +typedef enum _RASCONNSTATE { + RASCS_OpenPort = 0, + RASCS_PortOpened, + RASCS_ConnectDevice, + RASCS_DeviceConnected, + RASCS_AllDevicesConnected, + RASCS_Authenticate, + RASCS_AuthNotify, + RASCS_AuthRetry, + RASCS_AuthCallback, + RASCS_AuthChangePassword, + RASCS_AuthProject, + RASCS_AuthLinkSpeed, + RASCS_AuthAck, + RASCS_ReAuthenticate, + RASCS_Authenticated, + RASCS_PrepareForCallback, + RASCS_WaitForModemReset, + RASCS_WaitForCallback, + RASCS_Projected, + + RASCS_StartAuthentication, + RASCS_CallbackComplete, + RASCS_LogonNetwork, + + RASCS_Interactive = RASCS_PAUSED, + RASCS_RetryAuthentication, + RASCS_CallbackSetByCaller, + RASCS_PasswordExpired, + + RASCS_Connected = RASCS_DONE, + RASCS_Disconnected +} RASCONNSTATE ; + +typedef enum _RASPROJECTION { + RASP_Amb = 0x10000, + RASP_PppNbf = 0x803F, + RASP_PppIpx = 0x802B, + RASP_PppIp = 0x8021 +} RASPROJECTION ; + +typedef enum _SID_NAME_USE { + SidTypeUser = 1, + SidTypeGroup, + SidTypeDomain, + SidTypeAlias, + SidTypeWellKnownGroup, + SidTypeDeletedAccount, + SidTypeInvalid, + SidTypeUnknown +} SID_NAME_USE, *PSID_NAME_USE; + +#endif /* ! defined (RC_INVOKED) */ + +/* + Macros +*/ +#define FORWARD_WM_NOTIFY(hwnd, idFrom, pnmhdr, fn) (void)(fn)((hwnd), WM_NOTIFY, (WPARAM)(int)(id), (LPARAM)(NMHDR FAR*)(pnmhdr)) + +#define GetBValue(rgb) ((BYTE) ((rgb) >> 16)) +#define GetGValue(rgb) ((BYTE) (((WORD) (rgb)) >> 8)) +#define GetRValue(rgb) ((BYTE) (rgb)) +#define RGB(r, g ,b) ((DWORD) (((BYTE) (r) | ((WORD) (g) << 8)) | (((DWORD) (BYTE) (b)) << 16))) + +#define HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn) (fn)((hwnd), (int)(wParam), (NMHDR FAR*)(lParam)) + +#define HIBYTE(w) ((BYTE) (((WORD) (w) >> 8) & 0xFF)) +#define HIWORD(l) ((WORD) (((DWORD) (l) >> 16) & 0xFFFF)) +#define SHIWORD(l) ((INT16) (((DWORD) (l) >> 16) & 0xFFFF)) +#define LOBYTE(w) ((BYTE) (w)) +#define LOWORD(l) ((WORD) (l)) +#define SLOWORD(l) ((INT16) (l)) +#define MAKELONG(a, b) ((LONG) (((WORD) (a)) | ((DWORD) ((WORD) (b))) << 16)) +#define MAKEWORD(a, b) ((WORD) (((BYTE) (a)) | ((WORD) ((BYTE) (b))) << 8)) + +/* original Cygnus headers also had the following defined: */ +#define SEXT_HIWORD(l) ((((int)l) >> 16)) +#define ZEXT_HIWORD(l) ((((unsigned int)l) >> 16)) +#define SEXT_LOWORD(l) ((int)(short)l) + +#define INDEXTOOVERLAYMASK(i) ((i) << 8) +#define INDEXTOSTATEIMAGEMASK(i) ((i) << 12) + +#define MAKEINTATOM(i) (LPTSTR) ((DWORD) ((WORD) (i))) +#define MAKEINTRESOURCE(i) (LPTSTR) ((DWORD) ((WORD) (i))) + +#define MAKELANGID(p, s) ((((WORD) (s)) << 10) | (WORD) (p)) +#define PRIMARYLANGID(lgid) ((WORD )(lgid) & 0x3ff) +#define SUBLANGID(lgid) ((WORD )(lgid) >> 10) + +#define LANGIDFROMLCID(lcid) ((WORD) (lcid)) +#define SORTIDFROMLCID(lcid) ((WORD )((((DWORD)(lcid)) & 0x000FFFFF) >> 16)) +#define MAKELCID(lgid, srtid) ((DWORD)((((DWORD)((WORD)(srtid))) << 16) | ((DWORD)((WORD)(lgid))))) +#define MAKELPARAM(l, h) ((LPARAM) MAKELONG(l, h)) +#define MAKELRESULT(l, h) ((LRESULT) MAKELONG(l, h)) +#define MAKEPOINTS(l) (*((POINTS FAR *) & (l))) +#define MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore)) +#define MAKEWPARAM(l, h) ((WPARAM) MAKELONG(l, h)) + + +#define PALETTEINDEX(i) ((COLORREF) (0x01000000 | (DWORD) (WORD) (i))) +#define PALETTERGB(r, g, b) (0x02000000 | RGB(r, g, b)) +#define POINTSTOPOINT(pt, pts) {(pt).x = (SHORT) LOWORD(pts); (pt).y = (SHORT) HIWORD(pts);} +#define POINTTOPOINTS(pt) (MAKELONG((short) ((pt).x), (short) ((pt).y))) + +#define INDEXTOOVERLAYMASK(i) ((i) << 8) +#define INDEXTOSTATEIMAGEMASK(i) ((i) << 12) + +#ifdef UNICODE +#define _T(quote) L##quote +#define TEXT(quote) L##quote +#else +#define _T(quote) quote +#define TEXT(quote) quote +#endif + +#ifndef RC_INVOKED + +/* + Definitions for callback procedures +*/ +typedef int CALLBACK (*BFFCALLBACK) (HWND, UINT, LPARAM, LPARAM); +typedef UINT CALLBACK (*LPCCHOOKPROC) (HWND, UINT, WPARAM, LPARAM); +typedef UINT CALLBACK (*LPCFHOOKPROC) (HWND, UINT, WPARAM, LPARAM); +typedef DWORD CALLBACK (*EDITSTREAMCALLBACK) (DWORD, LPBYTE, LONG, LONG); +typedef UINT CALLBACK (*LPFRHOOKPROC) (HWND, UINT, WPARAM, LPARAM); +typedef UINT CALLBACK (*LPOFNHOOKPROC) (HWND, UINT, WPARAM, LPARAM); +typedef UINT CALLBACK (*LPPRINTHOOKPROC) (HWND, UINT, WPARAM, LPARAM); +typedef UINT CALLBACK (*LPSETUPHOOKPROC) (HWND, UINT, WPARAM, LPARAM); +typedef WINBOOL CALLBACK (*DLGPROC) (HWND, UINT, WPARAM, LPARAM); +typedef int CALLBACK (*PFNPROPSHEETCALLBACK) (HWND, UINT, LPARAM); +typedef VOID CALLBACK (*LPSERVICE_MAIN_FUNCTION) (DWORD, LPTSTR); +typedef int CALLBACK (*PFNTVCOMPARE) (LPARAM, LPARAM, LPARAM); +typedef LRESULT CALLBACK (*WNDPROC) (HWND, UINT, WPARAM, LPARAM); +typedef int CALLBACK (*FARPROC)(void); +typedef FARPROC PROC; +typedef WINBOOL CALLBACK (*ENUMRESTYPEPROC) (HANDLE, LPTSTR, LONG); +typedef WINBOOL CALLBACK (*ENUMRESNAMEPROC) (HANDLE, LPCTSTR, LPTSTR, LONG); +typedef WINBOOL CALLBACK (*ENUMRESLANGPROC) (HANDLE, LPCTSTR, LPCTSTR, WORD, LONG); +typedef FARPROC DESKTOPENUMPROC; +typedef WINBOOL CALLBACK (*ENUMWINDOWSPROC) (HWND, LPARAM); +typedef WINBOOL CALLBACK (*ENUMWINDOWSTATIONPROC) (LPTSTR, LPARAM); +typedef VOID CALLBACK (*SENDASYNCPROC) (HWND, UINT, DWORD, LRESULT); +typedef VOID CALLBACK (*TIMERPROC) (HWND, UINT, UINT, DWORD); +typedef FARPROC GRAYSTRINGPROC; +typedef WINBOOL CALLBACK (*DRAWSTATEPROC) (HDC, LPARAM, WPARAM, int, int); +typedef WINBOOL CALLBACK (*PROPENUMPROCEX) (HWND, LPCTSTR, HANDLE, DWORD); +typedef WINBOOL CALLBACK (*PROPENUMPROC) (HWND, LPCTSTR, HANDLE); +typedef LRESULT CALLBACK (*HOOKPROC) (int, WPARAM, LPARAM); +typedef VOID CALLBACK (*ENUMOBJECTSPROC) (LPVOID, LPARAM); +typedef VOID CALLBACK (*LINEDDAPROC) (int, int, LPARAM); +typedef WINBOOL CALLBACK (*ABORTPROC) (HDC, int); +typedef UINT CALLBACK (*LPPAGEPAINTHOOK) (HWND, UINT, WPARAM, LPARAM ); +typedef UINT CALLBACK (*LPPAGESETUPHOOK) (HWND, UINT, WPARAM, LPARAM ); +typedef int CALLBACK (*ICMENUMPROC) (LPTSTR, LPARAM); +typedef LONG (*EDITWORDBREAKPROCEX) (char *, LONG, BYTE, INT); +typedef int CALLBACK (*PFNLVCOMPARE) (LPARAM, LPARAM, LPARAM); +typedef WINBOOL CALLBACK (*LOCALE_ENUMPROC) (LPTSTR); +typedef WINBOOL CALLBACK (*CODEPAGE_ENUMPROC) (LPTSTR); +typedef WINBOOL CALLBACK (*DATEFMT_ENUMPROC) (LPTSTR); +typedef WINBOOL CALLBACK (*TIMEFMT_ENUMPROC) (LPTSTR); +typedef WINBOOL CALLBACK (*CALINFO_ENUMPROC) (LPTSTR); +typedef WINBOOL CALLBACK (*PHANDLER_ROUTINE) (DWORD); +typedef VOID CALLBACK (*LPHANDLER_FUNCTION) (DWORD); +typedef UINT CALLBACK (*PFNGETPROFILEPATH) (LPCTSTR, LPSTR, UINT); +typedef UINT CALLBACK (*PFNRECONCILEPROFILE) (LPCTSTR, LPCTSTR, DWORD); +typedef WINBOOL CALLBACK (*PFNPROCESSPOLICIES) (HWND, LPCTSTR, LPCTSTR, LPCTSTR, DWORD); + +#define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0} +#define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1} +#define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2} +#define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3} +#define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4} +#define SECURITY_NT_AUTHORITY {0,0,0,0,0,5} + +#define SE_CREATE_TOKEN_NAME TEXT("SeCreateTokenPrivilege") +#define SE_ASSIGNPRIMARYTOKEN_NAME TEXT("SeAssignPrimaryTokenPrivilege") +#define SE_LOCK_MEMORY_NAME TEXT("SeLockMemoryPrivilege") +#define SE_INCREASE_QUOTA_NAME TEXT("SeIncreaseQuotaPrivilege") +#define SE_UNSOLICITED_INPUT_NAME TEXT("SeUnsolicitedInputPrivilege") +#define SE_MACHINE_ACCOUNT_NAME TEXT("SeMachineAccountPrivilege") +#define SE_TCB_NAME TEXT("SeTcbPrivilege") +#define SE_SECURITY_NAME TEXT("SeSecurityPrivilege") +#define SE_TAKE_OWNERSHIP_NAME TEXT("SeTakeOwnershipPrivilege") +#define SE_LOAD_DRIVER_NAME TEXT("SeLoadDriverPrivilege") +#define SE_SYSTEM_PROFILE_NAME TEXT("SeSystemProfilePrivilege") +#define SE_SYSTEMTIME_NAME TEXT("SeSystemtimePrivilege") +#define SE_PROF_SINGLE_PROCESS_NAME TEXT("SeProfileSingleProcessPrivilege") +#define SE_INC_BASE_PRIORITY_NAME TEXT("SeIncreaseBasePriorityPrivilege") +#define SE_CREATE_PAGEFILE_NAME TEXT("SeCreatePagefilePrivilege") +#define SE_CREATE_PERMANENT_NAME TEXT("SeCreatePermanentPrivilege") +#define SE_BACKUP_NAME TEXT("SeBackupPrivilege") +#define SE_RESTORE_NAME TEXT("SeRestorePrivilege") +#define SE_SHUTDOWN_NAME TEXT("SeShutdownPrivilege") +#define SE_DEBUG_NAME TEXT("SeDebugPrivilege") +#define SE_AUDIT_NAME TEXT("SeAuditPrivilege") +#define SE_SYSTEM_ENVIRONMENT_NAME TEXT("SeSystemEnvironmentPrivilege") +#define SE_CHANGE_NOTIFY_NAME TEXT("SeChangeNotifyPrivilege") +#define SE_REMOTE_SHUTDOWN_NAME TEXT("SeRemoteShutdownPrivilege") + +#define SERVICES_ACTIVE_DATABASEW L"ServicesActive" +#define SERVICES_FAILED_DATABASEW L"ServicesFailed" +#define SERVICES_ACTIVE_DATABASEA "ServicesActive" +#define SERVICES_FAILED_DATABASEA "ServicesFailed" +#define SC_GROUP_IDENTIFIERW L'+' +#define SC_GROUP_IDENTIFIERA '+' + +#ifdef UNICODE +#define SERVICES_ACTIVE_DATABASE SERVICES_ACTIVE_DATABASEW +#define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEW +#define SC_GROUP_IDENTIFIER SC_GROUP_IDENTIFIERW +#else +#define SERVICES_ACTIVE_DATABASE SERVICES_ACTIVE_DATABASEA +#define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEA +#define SC_GROUP_IDENTIFIER SC_GROUP_IDENTIFIERA +#endif /* UNICODE */ + +/* ---------------------------------- */ +/* From ddeml.h in old Cygnus headers */ + +typedef void (*CALLB) (void); +typedef CALLB PFNCALLBACK; + + +/* End of stuff from ddeml.h in old Cygnus headers */ +/* ----------------------------------------------- */ + +typedef FARPROC WNDENUMPROC; +typedef FARPROC MFENUMPROC; +typedef FARPROC ENHMFENUMPROC; +typedef DWORD CCSTYLE, *PCCSTYLE, *LPCCSTYLE; +typedef DWORD CCSTYLEFLAGA, *PCCSTYLEFLAGA, *LPCCSTYLEFLAGA; +#define DECLARE_HANDLE(s) typedef HANDLE s + +#endif /* ! defined (RC_INVOKED) */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _GNU_H_WINDOWS32_BASE */ diff --git a/reactos/include/crtdll/mbstring.h b/reactos/include/crtdll/mbstring.h index cc49c6b7dfe..c0dd47453ea 100644 --- a/reactos/include/crtdll/mbstring.h +++ b/reactos/include/crtdll/mbstring.h @@ -19,7 +19,7 @@ unsigned int _mbbtombc(unsigned int c); unsigned int _mbctombb(unsigned int c); unsigned char * _mbscat(unsigned char *dst, const unsigned char *src); -unsigned char * _mbschr(const unsigned char *str, unsigned int c); +unsigned char * _mbschr(unsigned char *str, unsigned char* c); int _mbscmp(const unsigned char *, const unsigned char *); int _mbscoll(const unsigned char *, const unsigned char *); unsigned char * _mbscpy(unsigned char *, const unsigned char *); @@ -62,7 +62,7 @@ unsigned char * _mbsset(unsigned char *, unsigned int); size_t _mbsspn(const unsigned char *, const unsigned char *); unsigned char * _mbsstr(const unsigned char *, const unsigned char *); -unsigned char * _mbstok(unsigned char *, const unsigned char *); +unsigned char * _mbstok(unsigned char *, unsigned char *); unsigned char * _mbslwr(unsigned char *str); unsigned char * _mbsupr(unsigned char *str); diff --git a/reactos/include/csrss/csrss.h b/reactos/include/csrss/csrss.h index f7cc3781c4b..c7264823052 100644 --- a/reactos/include/csrss/csrss.h +++ b/reactos/include/csrss/csrss.h @@ -1,8 +1,10 @@ #ifndef __INCLUDE_CSRSS_CSRSS_H #define __INCLUDE_CSRSS_CSRSS_H -#define NTOS_USER_MODE -#include +#include +#include +#include +#include #define CSR_PRIORITY_CLASS_NORMAL (0x10) #define CSR_PRIORITY_CLASS_IDLE (0x20) @@ -261,7 +263,7 @@ typedef struct #define CSRSS_MAX_WRITE_CONSOLE_REQUEST \ (MAX_MESSAGE_DATA - sizeof(ULONG) - sizeof(CSRSS_WRITE_CONSOLE_REQUEST)) -#define CSRSS_MAX_SET_TITLE_REQUEST (MAX_MESSAGE_DATA - sizeof( HANDLE ) - sizeof( DWORD ) - sizeof( ULONG ) - sizeof( LPC_MESSAGE )) +#define CSRSS_MAX_SET_TITLE_REQUEST (MAX_MESSAGE_DATA - sizeof( HANDLE ) - sizeof( DWORD ) - sizeof( ULONG ) - sizeof( LPC_MESSAGE_HEADER )) #define CSRSS_MAX_WRITE_CONSOLE_OUTPUT_CHAR (MAX_MESSAGE_DATA - sizeof( ULONG ) - sizeof( CSRSS_WRITE_CONSOLE_OUTPUT_CHAR_REQUEST )) @@ -304,11 +306,11 @@ typedef struct /* Keep in sync with definition below. */ -#define CSRSS_REQUEST_HEADER_SIZE (sizeof(LPC_MESSAGE) + sizeof(ULONG)) +#define CSRSS_REQUEST_HEADER_SIZE (sizeof(LPC_MESSAGE_HEADER) + sizeof(ULONG)) typedef struct { - LPC_MESSAGE Header; + LPC_MESSAGE_HEADER Header; ULONG Type; union { @@ -342,7 +344,7 @@ typedef struct typedef struct { - LPC_MESSAGE Header; + LPC_MESSAGE_HEADER Header; NTSTATUS Status; union { diff --git a/reactos/include/debug.h b/reactos/include/debug.h index d23206b616f..75d87989b97 100644 --- a/reactos/include/debug.h +++ b/reactos/include/debug.h @@ -16,9 +16,6 @@ #ifndef __INTERNAL_DEBUG #define __INTERNAL_DEBUG -#undef assert -#undef ASSERT - #define UNIMPLEMENTED do {DbgPrint("%s at %s:%d is unimplemented, have a nice day\n",__FUNCTION__,__FILE__,__LINE__); for(;;); } while(0); /* FIXME: should probably remove this later */ diff --git a/reactos/include/defines.h b/reactos/include/defines.h new file mode 100644 index 00000000000..a1defe1f50f --- /dev/null +++ b/reactos/include/defines.h @@ -0,0 +1,4724 @@ +/* + Defines.h + + Windows32 API definitions + + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + + Author: Scott Christley + + This file is part of the Windows32 API Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + If you are interested in a warranty or support for this source code, + contact Scott Christley for more information. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +/* WARNING: This file is automatically generated. */ + +#ifndef _GNU_H_WINDOWS32_DEFINES +#define _GNU_H_WINDOWS32_DEFINES + +#ifndef RC_INVOKED +#include +#include +#endif + +#define WINBASEAPI + + + +#ifndef WIN32_NO_STATUS +//#define STATUS_WAIT_0 (0x00000000L) +//#define STATUS_ABANDONED_WAIT_0 (0x00000080L) +//#define STATUS_USER_APC (0x000000C0L) +//#define STATUS_TIMEOUT (0x00000102L) +//#define STATUS_PENDING (0x00000103L) +#endif /* WIN32_NO_STATUS */ + +#define GA_PARENT (1) +#define GA_ROOT (2) +#define GA_ROOTOWNER (3) + +/* CreateFile, GetFileAttributes, SetFileAttributes */ + +#define SECURITY_ANONYMOUS (0) +#define SECURITY_IDENTIFICATION (65536) +#define SECURITY_IMPERSONATION (131072) +#define SECURITY_DELEGATION (196608) +#define SECURITY_CONTEXT_TRACKING (262144) +#define SECURITY_EFFECTIVE_ONLY (524288) +#define SECURITY_SQOS_PRESENT (1048576) + + + + +#ifndef WIN32_LEAN_AND_MEAN + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#define MAX_PATH (260) +#define UNICODE_NULL ((WCHAR)0) +#define LF_FACESIZE (32) +#define LF_FULLFACESIZE (64) +#define ELF_VENDOR_SIZE (4) +#define MAX_DEFAULTCHAR (2) +#define MAX_LEADBYTES (12) +#define MENU_TEXT_LEN (40) +#define MAX_LANA (254) +#define NCBNAMSZ (16) +#define NETBIOS_NAME_LEN (16) +#define OFS_MAXPATHNAME (128) +#define MAX_TAB_STOPS (32) +#define RAS_MaxCallbackNumber (128) +#define RAS_MaxDeviceName (128) +#define RAS_MaxDeviceType (16) +#define RAS_MaxEntryName (256) +#define RAS_MaxIpAddress (15) +#define RAS_MaxIpxAddress (21) +#define RAS_MaxPhoneNumber (128) +#define UNLEN (256) +#define PWLEN (256) +#define CNLEN (15) +#define DNLEN (15) +/* Unsigned types max */ +#define MAXDWORD (0xFFFFFFFF) +#define MAXWORD (0xFFFF) +#define MAXBYTE (0xFF) +/* Signed types max/min */ +#define MINCHAR (0x80) +#define MAXCHAR (0x7F) +#define MINSHORT (0x8000) +#define MAXSHORT (0x7FFF) +#define MINLONG (0x80000000) +#define MAXLONG (0x7FFFFFFF) + +/* _llseek */ +#define FILE_BEGIN (0) +#define FILE_CURRENT (1) +#define FILE_END (2) + +/* _lopen, LZOpenFile, OpenFile */ +#define OF_READ (0) +#define OF_READWRITE (2) +#define OF_WRITE (1) +#define OF_SHARE_COMPAT (0) +#define OF_SHARE_DENY_NONE (64) +#define OF_SHARE_DENY_READ (48) +#define OF_SHARE_DENY_WRITE (32) +#define OF_SHARE_EXCLUSIVE (16) +#define OF_CANCEL (2048) +#define OF_CREATE (4096) +#define OF_DELETE (512) +#define OF_EXIST (16384) +#define OF_PARSE (256) +#define OF_PROMPT (8192) +#define OF_REOPEN (32768) +#define OF_VERIFY (1024) + +/* ActivateKeyboardLayout, LoadKeyboardLayout */ +#define HKL_NEXT (1) +#define HKL_PREV (0) +#define KLF_REORDER (8) +#define KLF_UNLOADPREVIOUS (4) +#define KLF_ACTIVATE (1) +#define KLF_NOTELLSHELL (128) +#define KLF_REPLACELANG (16) +#define KLF_SUBSTITUTE_OK (2) + +/* AppendMenu */ +#define MF_BITMAP (0x4L) +#define MF_DISABLED (0x2L) +#define MF_ENABLED (0L) +#define MF_GRAYED (0x1L) +#define MF_HELP (0x4000L) +#define MF_MENUBARBREAK (0x20L) +#define MF_MENUBREAK (0x40L) +#define MF_MOUSESELECT (0x8000L) +#define MF_OWNERDRAW (0x100L) +#define MF_POPUP (0x10L) +#define MF_SEPARATOR (0x800L) +#define MF_STRING (0L) +#define MF_SYSMENU (0x2000L) +#define MF_USECHECKBITMAPS (0x200L) + +/* Ternary Raster Operations - BitBlt */ +#define BLACKNESS 0x00000042 +#define NOTSRCERASE 0x001100A6 +#define NOTSRCCOPY 0x00330008 +#define SRCERASE 0x00440328 +#define DSTINVERT 0x00550009 +#define PATINVERT 0x005A0049 +#define SRCINVERT 0x00660046 +#define SRCAND 0x008800C6 +#define MERGEPAINT 0x00BB0226 +#define MERGECOPY 0x00C000CA +#define SRCCOPY 0x00CC0020 +#define SRCPAINT 0x00EE0086 +#define PATCOPY 0x00F00021 +#define PATPAINT 0x00FB0A09 +#define WHITENESS 0x00FF0062 + +/* Binary Raster Operations */ +#define R2_BLACK (1) +#define R2_COPYPEN (13) +#define R2_MASKNOTPEN (3) +#define R2_MASKPEN (9) +#define R2_MASKPENNOT (5) +#define R2_MERGENOTPEN (12) +#define R2_MERGEPEN (15) +#define R2_MERGEPENNOT (14) +#define R2_NOP (11) +#define R2_NOT (6) +#define R2_NOTCOPYPEN (4) +#define R2_NOTMASKPEN (8) +#define R2_NOTMERGEPEN (2) +#define R2_NOTXORPEN (10) +#define R2_WHITE (16) +#define R2_XORPEN (7) + +/* BroadcastSystemMessage */ +#define BSF_FLUSHDISK (4) +#define BSF_FORCEIFHUNG (32) +#define BSF_IGNORECURRENTTASK (2) +#define BSF_NOHANG (8) +#define BSF_POSTMESSAGE (16) +#define BSF_QUERY (1) +#define BSM_ALLCOMPONENTS (0) +#define BSM_APPLICATIONS (8) +#define BSM_INSTALLABLEDRIVERS (4) +#define BSM_NETDRIVER (2) +#define BSM_VXDS (1) +#define BROADCAST_QUERY_DENY (1112363332) + +/* BrowseCallbackProc */ + +/* CallNamedPipe */ +#define NMPWAIT_NOWAIT (1) +#define NMPWAIT_WAIT_FOREVER (-1) +#define NMPWAIT_USE_DEFAULT_WAIT (0) + +/* CascadeWindows, TileWindows */ +#define MDITILE_SKIPDISABLED (2) +#define MDITILE_HORIZONTAL (1) +#define MDITILE_VERTICAL (0) + +/* CBTProc */ +#define HCBT_ACTIVATE (5) +#define HCBT_CLICKSKIPPED (6) +#define HCBT_CREATEWND (3) +#define HCBT_DESTROYWND (4) +#define HCBT_KEYSKIPPED (7) +#define HCBT_MINMAX (1) +#define HCBT_MOVESIZE (0) +#define HCBT_QS (2) +#define HCBT_SETFOCUS (9) +#define HCBT_SYSCOMMAND (8) + +/* ChangeDisplaySettings */ +#define DM_BITSPERPEL (0x40000L) +#define DM_PELSWIDTH (0x80000L) +#define DM_PELSHEIGHT (0x100000L) +#define DM_DISPLAYFLAGS (0x200000L) +#define DM_DISPLAYFREQUENCY (0x400000L) +#define CDS_UPDATEREGISTRY (1) +#define CDS_TEST (2) +#define DISP_CHANGE_SUCCESSFUL (0) +#define DISP_CHANGE_RESTART (1) +#define DISP_CHANGE_BADFLAGS (-4) +#define DISP_CHANGE_FAILED (-1) +#define DISP_CHANGE_BADMODE (-2) +#define DISP_CHANGE_NOTUPDATED (-3) + +/* ChangeServiceConfig */ +#define SERVICE_NO_CHANGE (-1) +#define SERVICE_KERNEL_DRIVER (1) +#define SERVICE_FILE_SYSTEM_DRIVER (2) +#define SERVICE_RECOGNIZER_DRIVER (8) +#define SERVICE_WIN32_OWN_PROCESS (16) +#define SERVICE_WIN32_SHARE_PROCESS (32) +#define SERVICE_INTERACTIVE_PROCESS (256) +#define SERVICE_BOOT_START (0) +#define SERVICE_SYSTEM_START (1) +#define SERVICE_AUTO_START (2) +#define SERVICE_DEMAND_START (3) +#define SERVICE_DISABLED (4) + +/* SERVICE_STATUS structure */ +#define SERVICE_STOPPED (1) +#define SERVICE_START_PENDING (2) +#define SERVICE_STOP_PENDING (3) +#define SERVICE_RUNNING (4) +#define SERVICE_CONTINUE_PENDING (5) +#define SERVICE_PAUSE_PENDING (6) +#define SERVICE_PAUSED (7) +#define SERVICE_ACCEPT_STOP (1) +#define SERVICE_ACCEPT_PAUSE_CONTINUE (2) +#define SERVICE_ACCEPT_SHUTDOWN (4) + +/* CheckDlgButton */ +#define BST_CHECKED (1) +#define BST_INDETERMINATE (2) +#define BST_UNCHECKED (0) +#define BST_FOCUS (8) +#define BST_PUSHED (4) + +/* CheckMenuItem, HiliteMenuItem */ +#define MF_BYCOMMAND (0L) +#define MF_BYPOSITION (0x400L) +#define MF_CHECKED (0x8L) +#define MF_UNCHECKED (0L) +#define MF_HILITE (0x80L) +#define MF_UNHILITE (0L) + +/* ChildWindowFromPointEx */ +#define CWP_ALL (0) +#define CWP_SKIPINVISIBLE (1) +#define CWP_SKIPDISABLED (2) +#define CWP_SKIPTRANSPARENT (4) + +/* ClearCommError */ +#define CE_BREAK (16) +#define CE_DNS (2048) +#define CE_FRAME (8) +#define CE_IOE (1024) +#define CE_MODE (32768) +#define CE_OOP (4096) +#define CE_OVERRUN (2) +#define CE_PTO (512) +#define CE_RXOVER (1) +#define CE_RXPARITY (4) +#define CE_TXFULL (256) + +/* ChooseMatchToTarget */ + +/* CombineRgn */ +#define RGN_AND (1) +#define RGN_COPY (5) +#define RGN_DIFF (4) +#define RGN_OR (2) +#define RGN_XOR (3) +#define NULLREGION (1) +#define SIMPLEREGION (2) +#define COMPLEXREGION (3) +#define ERROR (0) + +/* CommonDlgExtendedError */ +#define CDERR_DIALOGFAILURE (0xffff) +#define CDERR_FINDRESFAILURE (6) +#define CDERR_INITIALIZATION (2) +#define CDERR_LOADRESFAILURE (7) +#define CDERR_LOADSTRFAILURE (5) +#define CDERR_LOCKRESFAILURE (8) +#define CDERR_MEMALLOCFAILURE (9) +#define CDERR_MEMLOCKFAILURE (10) +#define CDERR_NOHINSTANCE (4) +#define CDERR_NOHOOK (11) +#define CDERR_NOTEMPLATE (3) +#define CDERR_REGISTERMSGFAIL (12) +#define CDERR_STRUCTSIZE (1) +#define PDERR_CREATEICFAILURE (0x1000 + 10) +#define PDERR_DEFAULTDIFFERENT (0x1000 + 12) +#define PDERR_DNDMMISMATCH (0x1000 + 9) +#define PDERR_GETDEVMODEFAIL (0x1000 + 5) +#define PDERR_INITFAILURE (0x1000 + 6) +#define PDERR_LOADDRVFAILURE (0x1000 + 4) +#define PDERR_NODEFAULTPRN (0x1000 + 8) +#define PDERR_NODEVICES (0x1000 + 7) +#define PDERR_PARSEFAILURE (0x1000 + 2) +#define PDERR_PRINTERNOTFOUND (0x1000 + 11) +#define PDERR_RETDEFFAILURE (0x1000 + 3) +#define PDERR_SETUPFAILURE (0x1000 + 1) +#define CFERR_MAXLESSTHANMIN (0x2000 + 2) +#define CFERR_NOFONTS (0x2000 + 1) +#define FNERR_BUFFERTOOSMALL (0x3000 + 3) +#define FNERR_INVALIDFILENAME (0x3000 + 2) +#define FNERR_SUBCLASSFAILURE (0x3000 + 1) +#define FRERR_BUFFERLENGTHZERO (0x4000 + 1) + +/* CompareString, LCMapString */ +#define LOCALE_SYSTEM_DEFAULT (0x800L) +#define LOCALE_USER_DEFAULT (0x400L) +#define NORM_IGNORECASE (1) +#define NORM_IGNOREKANATYPE (65536) +#define NORM_IGNORENONSPACE (2) +#define NORM_IGNORESYMBOLS (4) +#define NORM_IGNOREWIDTH (131072) +#define SORT_STRINGSORT (4096) +#define LCMAP_BYTEREV (2048) +#define LCMAP_FULLWIDTH (8388608) +#define LCMAP_HALFWIDTH (4194304) +#define LCMAP_HIRAGANA (1048576) +#define LCMAP_KATAKANA (2097152) +#define LCMAP_LOWERCASE (256) +#define LCMAP_SORTKEY (1024) +#define LCMAP_UPPERCASE (512) + +/* ContinueDebugEvent */ +#define DBG_CONTINUE (0x10002L) +#define DBG_CONTROL_BREAK (0x40010008L) +#define DBG_CONTROL_C (0x40010005L) +#define DBG_EXCEPTION_NOT_HANDLED (0x80010001L) +#define DBG_TERMINATE_THREAD (0x40010003L) +#define DBG_TERMINATE_PROCESS (0x40010004L) + +/* ControlService */ +#define SERVICE_CONTROL_STOP (1) +#define SERVICE_CONTROL_PAUSE (2) +#define SERVICE_CONTROL_CONTINUE (3) +#define SERVICE_CONTROL_INTERROGATE (4) +#define SERVICE_CONTROL_SHUTDOWN (5) + +/* CopyImage, LoadImage */ +#define IMAGE_BITMAP (0) +#define IMAGE_CURSOR (2) +#define IMAGE_ENHMETAFILE (1) +#define IMAGE_ICON (1) +#define LR_COPYDELETEORG (8) +#define LR_COPYRETURNORG (4) +#define LR_MONOCHROME (1) +#define LR_CREATEDIBSECTION (8192) +#define LR_DEFAULTSIZE (64) + +/* CreateDesktop */ +#define DF_ALLOWOTHERACCOUNTHOOK (0x1L) +#define DESKTOP_CREATEMENU (0x4L) +#define DESKTOP_CREATEWINDOW (0x2L) +#define DESKTOP_ENUMERATE (0x40L) +#define DESKTOP_HOOKCONTROL (0x8L) +#define DESKTOP_JOURNALPLAYBACK (0x20L) +#define DESKTOP_JOURNALRECORD (0x10L) +#define DESKTOP_READOBJECTS (0x1L) +#define DESKTOP_SWITCHDESKTOP (0x100L) +#define DESKTOP_WRITEOBJECTS (0x80L) +#define WSF_VISIBLE (0x1L) + +/* CreateDIBitmap */ +#define CBM_INIT (0x4L) +#define DIB_PAL_COLORS (1) +#define DIB_RGB_COLORS (0) + +/* CreateFileMapping, VirtualAlloc, VirtualFree, VirtualProtect */ + +/* CreateFont */ +#define FW_DONTCARE (0) +#define FW_THIN (100) +#define FW_EXTRALIGHT (200) +#define FW_LIGHT (300) +#define FW_NORMAL (400) +#define FW_REGULAR FW_NORMAL +#define FW_MEDIUM (500) +#define FW_SEMIBOLD (600) +#define FW_BOLD (700) +#define FW_EXTRABOLD (800) +#define FW_HEAVY (900) +#define ANSI_CHARSET (0) +#define DEFAULT_CHARSET (1) +#define SYMBOL_CHARSET (2) +#define SHIFTJIS_CHARSET (128) +#define HANGEUL_CHARSET (129) +#define GB2312_CHARSET (134) +#define CHINESEBIG5_CHARSET (136) +#define GREEK_CHARSET (161) +#define TURKISH_CHARSET (162) +#define HEBREW_CHARSET (177) +#define ARABIC_CHARSET (178) +#define BALTIC_CHARSET (186) +#define RUSSIAN_CHARSET (204) +#define THAI_CHARSET (222) +#define EASTEUROPE_CHARSET (238) +#define OEM_CHARSET (255) +#define OUT_DEFAULT_PRECIS (0) +#define OUT_STRING_PRECIS (1) +#define OUT_CHARACTER_PRECIS (2) +#define OUT_STROKE_PRECIS (3) +#define OUT_TT_PRECIS (4) +#define OUT_DEVICE_PRECIS (5) +#define OUT_RASTER_PRECIS (6) +#define OUT_TT_ONLY_PRECIS (7) +#define OUT_OUTLINE_PRECIS (8) +#define CLIP_DEFAULT_PRECIS (0) +#define CLIP_CHARACTER_PRECIS (1) +#define CLIP_STROKE_PRECIS (2) +#define CLIP_MASK (15) +#define CLIP_LH_ANGLES (16) +#define CLIP_TT_ALWAYS (32) +#define CLIP_EMBEDDED (128) +#define DEFAULT_QUALITY (0) +#define DRAFT_QUALITY (1) +#define PROOF_QUALITY (2) +#define DEFAULT_PITCH (0) +#define FIXED_PITCH (1) +#define VARIABLE_PITCH (2) +#define FF_DECORATIVE (80) +#define FF_DONTCARE (0) +#define FF_MODERN (48) +#define FF_ROMAN (16) +#define FF_SCRIPT (64) +#define FF_SWISS (32) + +/* CreateHatchBrush */ +#define HS_BDIAGONAL (3) +#define HS_CROSS (4) +#define HS_DIAGCROSS (5) +#define HS_FDIAGONAL (2) +#define HS_HORIZONTAL (0) +#define HS_VERTICAL (1) + +/* CreateIconFromResourceEx */ +#define LR_DEFAULTCOLOR (0) +#define LR_LOADREALSIZE (128) +#define LR_MONOCHROME (1) + +/* CreateMailslot, GetMailslotInfo */ +#define MAILSLOT_WAIT_FOREVER (0xffffffffL) +#define MAILSLOT_NO_MESSAGE (0xffffffffL) + +/* CreateMappedBitmap */ +#define CMB_MASKED (2) + +/* CreateNamedPipe */ +#define PIPE_ACCESS_DUPLEX (3) +#define PIPE_ACCESS_INBOUND (1) +#define PIPE_ACCESS_OUTBOUND (2) +#define WRITE_DAC (0x40000L) +#define WRITE_OWNER (0x80000L) +#define ACCESS_SYSTEM_SECURITY (0x1000000L) +#define PIPE_TYPE_BYTE (0) +#define PIPE_TYPE_MESSAGE (4) +#define PIPE_READMODE_BYTE (0) +#define PIPE_READMODE_MESSAGE (2) +#define PIPE_WAIT (0) +#define PIPE_NOWAIT (1) +#define PIPE_UNLIMITED_INSTANCES (255) + +/* CreatePen, ExtCreatePen */ +#define PS_GEOMETRIC (65536) +#define PS_COSMETIC (0) +#define PS_ALTERNATE (8) +#define PS_SOLID (0) +#define PS_DASH (1) +#define PS_DOT (2) +#define PS_DASHDOT (3) +#define PS_DASHDOTDOT (4) +#define PS_NULL (5) +#define PS_USERSTYLE (7) +#define PS_INSIDEFRAME (6) +#define PS_ENDCAP_ROUND (0) +#define PS_ENDCAP_SQUARE (256) +#define PS_ENDCAP_FLAT (512) +#define PS_JOIN_BEVEL (4096) +#define PS_JOIN_MITER (8192) +#define PS_JOIN_ROUND (0) +#define PS_STYLE_MASK (15) +#define PS_ENDCAP_MASK (3840) +#define PS_TYPE_MASK (983040) + +/* CreatePolygonRgn */ +#define ALTERNATE (1) +#define WINDING (2) + + +/* CreateService */ +#define SERVICE_ALL_ACCESS (0xf01ffL) +#define SERVICE_CHANGE_CONFIG (2) +#define SERVICE_ENUMERATE_DEPENDENTS (8) +#define SERVICE_INTERROGATE (128) +#define SERVICE_PAUSE_CONTINUE (64) +#define SERVICE_QUERY_CONFIG (1) +#define SERVICE_QUERY_STATUS (4) +#define SERVICE_START (16) +#define SERVICE_STOP (32) +#define SERVICE_USER_DEFINED_CONTROL (256) +#define SERVICE_WIN32_OWN_PROCESS (16) +#define SERVICE_WIN32_SHARE_PROCESS (32) +#define SERVICE_KERNEL_DRIVER (1) +#define SERVICE_FILE_SYSTEM_DRIVER (2) +#define SERVICE_INTERACTIVE_PROCESS (256) +#define SERVICE_BOOT_START (0) +#define SERVICE_SYSTEM_START (1) +#define SERVICE_AUTO_START (2) +#define SERVICE_DEMAND_START (3) +#define SERVICE_DISABLED (4) +#define SERVICE_ERROR_IGNORE (0) +#define SERVICE_ERROR_NORMAL (1) +#define SERVICE_ERROR_SEVERE (2) +#define SERVICE_ERROR_CRITICAL (3) + +/* CreateTapePartition, WriteTapemark */ +#define TAPE_FIXED_PARTITIONS (0L) +#define TAPE_INITIATOR_PARTITIONS (0x2L) +#define TAPE_SELECT_PARTITIONS (0x1L) +#define TAPE_FILEMARKS (0x1L) +#define TAPE_LONG_FILEMARKS (0x3L) +#define TAPE_SETMARKS (0L) +#define TAPE_SHORT_FILEMARKS (0x2L) + +/* CreateWindow */ +#define CW_USEDEFAULT (0x80000000) +#define WS_BORDER (0x800000L) +#define WS_CAPTION (0xc00000L) +#define WS_CHILD (0x40000000L) +#define WS_CHILDWINDOW (0x40000000L) +#define WS_CLIPCHILDREN (0x2000000L) +#define WS_CLIPSIBLINGS (0x4000000L) +#define WS_DISABLED (0x8000000L) +#define WS_DLGFRAME (0x400000L) +#define WS_GROUP (0x20000L) +#define WS_HSCROLL (0x100000L) +#define WS_ICONIC (0x20000000L) +#define WS_MAXIMIZE (0x1000000L) +#define WS_MAXIMIZEBOX (0x10000L) +#define WS_MINIMIZE (0x20000000L) +#define WS_MINIMIZEBOX (0x20000L) +#define WS_OVERLAPPED (0L) +#define WS_OVERLAPPEDWINDOW (0xcf0000L) +#define WS_POPUP (0x80000000L) +#define WS_POPUPWINDOW (0x80880000L) +#define WS_SIZEBOX (0x40000L) +#define WS_SYSMENU (0x80000L) +#define WS_TABSTOP (0x10000L) +#define WS_THICKFRAME (0x40000L) +#define WS_TILED (0L) +#define WS_TILEDWINDOW (0xcf0000L) +#define WS_VISIBLE (0x10000000L) +#define WS_VSCROLL (0x200000L) +#define MDIS_ALLCHILDSTYLES (0x1) +#define BS_3STATE (0x5L) +#define BS_AUTO3STATE (0x6L) +#define BS_AUTOCHECKBOX (0x3L) +#define BS_AUTORADIOBUTTON (0x9L) +#define BS_BITMAP (0x80L) +#define BS_BOTTOM (0x800L) +#define BS_CENTER (0x300L) +#define BS_CHECKBOX (0x2L) +#define BS_DEFPUSHBUTTON (0x1L) +#define BS_GROUPBOX (0x7L) +#define BS_ICON (0x40L) +#define BS_LEFT (0x100L) +#define BS_LEFTTEXT (0x20L) +#define BS_MULTILINE (0x2000L) +#define BS_NOTIFY (0x4000L) +#define BS_OWNERDRAW (0xbL) +#define BS_PUSHBUTTON (0L) +#define BS_PUSHLIKE (0x1000L) +#define BS_RADIOBUTTON (0x4L) +#define BS_RIGHT (0x200L) +#define BS_RIGHTBUTTON (0x20L) +#define BS_TEXT (0L) +#define BS_TOP (0x400L) +#define BS_USERBUTTON (0x8L) +#define BS_VCENTER (0xc00L) +#define CBS_AUTOHSCROLL (0x40L) +#define CBS_DISABLENOSCROLL (0x800L) +#define CBS_DROPDOWN (0x2L) +#define CBS_DROPDOWNLIST (0x3L) +#define CBS_HASSTRINGS (0x200L) +#define CBS_LOWERCASE (0x4000L) +#define CBS_NOINTEGRALHEIGHT (0x400L) +#define CBS_OEMCONVERT (0x80L) +#define CBS_OWNERDRAWFIXED (0x10L) +#define CBS_OWNERDRAWVARIABLE (0x20L) +#define CBS_SIMPLE (0x1L) +#define CBS_SORT (0x100L) +#define CBS_UPPERCASE (0x2000L) +#define ES_AUTOHSCROLL (0x80L) +#define ES_AUTOVSCROLL (0x40L) +#define ES_CENTER (0x1L) +#define ES_LEFT (0L) +#define ES_LOWERCASE (0x10L) +#define ES_MULTILINE (0x4L) +#define ES_NOHIDESEL (0x100L) +#define ES_NUMBER (0x2000L) +#define ES_OEMCONVERT (0x400L) +#define ES_PASSWORD (0x20L) +#define ES_READONLY (0x800L) +#define ES_RIGHT (0x2L) +#define ES_UPPERCASE (0x8L) +#define ES_WANTRETURN (0x1000L) +#define LBS_DISABLENOSCROLL (0x1000L) +#define LBS_EXTENDEDSEL (0x800L) +#define LBS_HASSTRINGS (0x40L) +#define LBS_MULTICOLUMN (0x200L) +#define LBS_MULTIPLESEL (0x8L) +#define LBS_NODATA (0x2000L) +#define LBS_NOINTEGRALHEIGHT (0x100L) +#define LBS_NOREDRAW (0x4L) +#define LBS_NOSEL (0x4000L) +#define LBS_NOTIFY (0x1L) +#define LBS_OWNERDRAWFIXED (0x10L) +#define LBS_OWNERDRAWVARIABLE (0x20L) +#define LBS_SORT (0x2L) +#define LBS_STANDARD (0xa00003L) +#define LBS_USETABSTOPS (0x80L) +#define LBS_WANTKEYBOARDINPUT (0x400L) +#define SBS_BOTTOMALIGN (0x4L) +#define SBS_HORZ (0L) +#define SBS_LEFTALIGN (0x2L) +#define SBS_RIGHTALIGN (0x4L) +#define SBS_SIZEBOX (0x8L) +#define SBS_SIZEBOXBOTTOMRIGHTALIGN (0x4L) +#define SBS_SIZEBOXTOPLEFTALIGN (0x2L) +#define SBS_SIZEGRIP (0x10L) +#define SBS_TOPALIGN (0x2L) +#define SBS_VERT (0x1L) +#define SS_BITMAP (0xeL) +#define SS_BLACKFRAME (0x7L) +#define SS_BLACKRECT (0x4L) +#define SS_CENTER (0x1L) +#define SS_CENTERIMAGE (0x200L) +#define SS_ENHMETAFILE (0xfL) +#define SS_ETCHEDFRAME (0x12L) +#define SS_ETCHEDHORZ (0x10L) +#define SS_ETCHEDVERT (0x11L) +#define SS_GRAYFRAME (0x8L) +#define SS_GRAYRECT (0x5L) +#define SS_ICON (0x3L) +#define SS_LEFT (0L) +#define SS_LEFTNOWORDWRAP (0xcL) +#define SS_NOPREFIX (0x80L) +#define SS_NOTIFY (0x100L) +#define SS_OWNERDRAW (0xdL) +#define SS_REALSIZEIMAGE (0x800L) +#define SS_RIGHT (0x2L) +#define SS_RIGHTJUST (0x400L) +#define SS_SIMPLE (0xbL) +#define SS_SUNKEN (0x1000L) +#define SS_USERITEM (0xaL) +#define SS_WHITEFRAME (0x9L) +#define SS_WHITERECT (0x6L) +#define DS_3DLOOK (0x4L) +#define DS_ABSALIGN (0x1L) +#define DS_CENTER (0x800L) +#define DS_CENTERMOUSE (0x1000L) +#define DS_CONTEXTHELP (0x2000L) +#define DS_CONTROL (0x400L) +#define DS_FIXEDSYS (0x8L) +#define DS_LOCALEDIT (0x20L) +#define DS_MODALFRAME (0x80L) +#define DS_NOFAILCREATE (0x10L) +#define DS_NOIDLEMSG (0x100L) +#define DS_SETFONT (0x40L) +#define DS_SETFOREGROUND (0x200L) +#define DS_SYSMODAL (0x2L) + +/* CreateWindowEx */ +#define WS_EX_ACCEPTFILES (0x10L) +#define WS_EX_APPWINDOW (0x40000L) +#define WS_EX_CLIENTEDGE (0x200L) +#define WS_EX_CONTEXTHELP (0x400L) +#define WS_EX_CONTROLPARENT (0x10000L) +#define WS_EX_DLGMODALFRAME (0x1L) +#define WS_EX_LEFT (0L) +#define WS_EX_LEFTSCROLLBAR (0x4000L) +#define WS_EX_LTRREADING (0L) +#define WS_EX_MDICHILD (0x40L) +#define WS_EX_NOPARENTNOTIFY (0x4L) +#define WS_EX_OVERLAPPEDWINDOW (0x300L) +#define WS_EX_PALETTEWINDOW (0x188L) +#define WS_EX_RIGHT (0x1000L) +#define WS_EX_RIGHTSCROLLBAR (0L) +#define WS_EX_RTLREADING (0x2000L) +#define WS_EX_STATICEDGE (0x20000L) +#define WS_EX_TOOLWINDOW (0x80L) +#define WS_EX_TOPMOST (0x8L) +#define WS_EX_TRANSPARENT (0x20L) +#define WS_EX_WINDOWEDGE (0x100L) + +/* CreateWindowStation */ +#define WINSTA_ACCESSCLIPBOARD (0x4L) +#define WINSTA_ACCESSGLOBALATOMS (0x20L) +#define WINSTA_CREATEDESKTOP (0x8L) +#define WINSTA_ENUMDESKTOPS (0x1L) +#define WINSTA_ENUMERATE (0x100L) +#define WINSTA_EXITWINDOWS (0x40L) +#define WINSTA_READATTRIBUTES (0x2L) +#define WINSTA_READSCREEN (0x200L) +#define WINSTA_WRITEATTRIBUTES (0x10L) + +/* DdeCallback */ + +/* DdeClientTransaction */ + +/* DdeEnableCallback */ + +/* DdeGetLastError */ + +/* DdeInitialize */ + +/* DdeNameService */ + +/* DebugProc */ +#define WH_CALLWNDPROC (4) +#define WH_CALLWNDPROCRET (12) +#define WH_CBT (5) +#define WH_DEBUG (9) +#define WH_GETMESSAGE (3) +#define WH_JOURNALPLAYBACK (1) +#define WH_JOURNALRECORD (0) +#define WH_KEYBOARD (2) +#define WH_MOUSE (7) +#define WH_MSGFILTER (-1) +#define WH_SHELL (10) +#define WH_SYSMSGFILTER (6) +#define WH_MSGFILTER (-1) +#define WH_FOREGROUNDIDLE (11) + +/* DefineDosDevice */ +#define DDD_RAW_TARGET_PATH (1) +#define DDD_REMOVE_DEFINITION (2) +#define DDD_EXACT_MATCH_ON_REMOVE (4) + +/* DeviceCapbilities */ +#define DC_BINNAMES (12) +#define DC_BINS (6) +#define DC_COPIES (18) +#define DC_DRIVER (11) +#define DC_DATATYPE_PRODUCED (21) +#define DC_DUPLEX (7) +#define DC_EMF_COMPLIANT (20) +#define DC_ENUMRESOLUTIONS (13) +#define DC_EXTRA (9) +#define DC_FIELDS (1) +#define DC_FILEDEPENDENCIES (14) +#define DC_MAXEXTENT (5) +#define DC_MINEXTENT (4) +#define DC_ORIENTATION (17) +#define DC_PAPERNAMES (16) +#define DC_PAPERS (2) +#define DC_PAPERSIZE (3) +#define DC_SIZE (8) +#define DC_TRUETYPE (15) +#define DCTT_BITMAP (0x1L) +#define DCTT_DOWNLOAD (0x2L) +#define DCTT_SUBDEV (0x4L) +#define DC_VERSION (10) +#define DC_BINADJUST (19) +#define DC_DATATYPE_PRODUCED (21) + +/* DeviceIoControl */ + +/* DlgDirList */ +#define DDL_ARCHIVE (32) +#define DDL_DIRECTORY (16) +#define DDL_DRIVES (16384) +#define DDL_EXCLUSIVE (32768) +#define DDL_HIDDEN (2) +#define DDL_READONLY (1) +#define DDL_READWRITE (0) +#define DDL_SYSTEM (4) +#define DDL_POSTMSGS (8192) + +/* DllEntryPoint */ +#define DLL_PROCESS_ATTACH (1) +#define DLL_THREAD_ATTACH (2) +#define DLL_PROCESS_DETACH (0) +#define DLL_THREAD_DETACH (3) + +/* DocumentProperties */ +#define DM_IN_BUFFER (8) +#define DM_MODIFY (8) +#define DM_IN_PROMPT (4) +#define DM_PROMPT (4) +#define DM_OUT_BUFFER (2) +#define DM_COPY (2) +#define DM_UPDATE (1) + +/* DrawAnimatedRects */ +#define IDANI_OPEN (1) +#define IDANI_CLOSE (2) + +/* DrawCaption */ +#define DC_ACTIVE (1) +#define DC_SMALLCAP (2) + +/* DrawEdge */ +#define BDR_RAISEDINNER (4) +#define BDR_SUNKENINNER (8) +#define BDR_RAISEDOUTER (1) +#define BDR_SUNKENOUTER (1) +#define EDGE_BUMP (9) +#define EDGE_ETCHED (6) +#define EDGE_RAISED (5) +#define EDGE_SUNKEN (10) +#define BF_ADJUST (8192) +#define BF_BOTTOM (8) +#define BF_BOTTOMLEFT (9) +#define BF_BOTTOMRIGHT (12) +#define BF_DIAGONAL (16) +#define BF_DIAGONAL_ENDBOTTOMLEFT (25) +#define BF_DIAGONAL_ENDBOTTOMRIGHT (28) +#define BF_DIAGONAL_ENDTOPLEFT (19) +#define BF_DIAGONAL_ENDTOPRIGHT (22) +#define BF_FLAT (16384) +#define BF_LEFT (1) +#define BF_MIDDLE (2048) +#define BF_MONO (32768) +#define BF_RECT (15) +#define BF_RIGHT (4) +#define BF_SOFT (4096) +#define BF_TOP (2) +#define BF_TOPLEFT (3) +#define BF_TOPRIGHT (6) + +/* DrawFrameControl */ +#define DFC_BUTTON (4) +#define DFC_CAPTION (1) +#define DFC_MENU (2) +#define DFC_SCROLL (3) +#define DFCS_BUTTON3STATE (8) +#define DFCS_BUTTONCHECK (0) +#define DFCS_BUTTONPUSH (16) +#define DFCS_BUTTONRADIO (4) +#define DFCS_BUTTONRADIOIMAGE (1) +#define DFCS_BUTTONRADIOMASK (2) +#define DFCS_CAPTIONCLOSE (0) +#define DFCS_CAPTIONHELP (4) +#define DFCS_CAPTIONMAX (2) +#define DFCS_CAPTIONMIN (1) +#define DFCS_CAPTIONRESTORE (3) +#define DFCS_MENUARROW (0) +#define DFCS_MENUBULLET (2) +#define DFCS_MENUCHECK (1) +#define DFCS_SCROLLCOMBOBOX (5) +#define DFCS_SCROLLDOWN (1) +#define DFCS_SCROLLLEFT (2) +#define DFCS_SCROLLRIGHT (3) +#define DFCS_SCROLLSIZEGRIP (8) +#define DFCS_SCROLLUP (0) +#define DFCS_ADJUSTRECT (8192) +#define DFCS_CHECKED (1024) +#define DFCS_FLAT (16384) +#define DFCS_INACTIVE (256) +#define DFCS_MONO (32768) +#define DFCS_PUSHED (512) + +/* DrawIconEx */ +#define DI_COMPAT (4) +#define DI_DEFAULTSIZE (8) +#define DI_IMAGE (2) +#define DI_MASK (1) +#define DI_NORMAL (3) + +/* DrawState */ +#define DST_BITMAP (4) +#define DST_COMPLEX (0) +#define DST_ICON (3) +#define DST_PREFIXTEXT (2) +#define DST_TEXT (1) +#define DSS_NORMAL (0) +#define DSS_UNION (16) +#define DSS_DISABLED (32) +#define DSS_MONO (128) + +/* DrawStatusText */ +#define SBT_NOBORDERS (256) +#define SBT_OWNERDRAW (4096) +#define SBT_POPOUT (512) +#define SBT_RTLREADING (1024) + +/* DrawText, DrawTextEx */ +#define DT_BOTTOM (8) +#define DT_CALCRECT (1024) +#define DT_CENTER (1) +#define DT_EDITCONTROL (8192) +#define DT_END_ELLIPSIS (32768) +#define DT_PATH_ELLIPSIS (16384) +#define DT_EXPANDTABS (64) +#define DT_EXTERNALLEADING (512) +#define DT_LEFT (0) +#define DT_MODIFYSTRING (65536) +#define DT_NOCLIP (256) +#define DT_NOPREFIX (2048) +#define DT_RIGHT (2) +#define DT_RTLREADING (131072) +#define DT_SINGLELINE (32) +#define DT_TABSTOP (128) +#define DT_TOP (0) +#define DT_VCENTER (4) +#define DT_WORDBREAK (16) +#define DT_INTERNAL (4096) + + +/* EditWordBreakProc */ +#define WB_ISDELIMITER (2) +#define WB_LEFT (0) +#define WB_RIGHT (1) + +/* EnableScrollBar */ +#define SB_BOTH (3) +#define SB_CTL (2) +#define SB_HORZ (0) +#define SB_VERT (1) +#define ESB_DISABLE_BOTH (3) +#define ESB_DISABLE_DOWN (2) +#define ESB_DISABLE_LEFT (1) +#define ESB_DISABLE_LTUP (1) +#define ESB_DISABLE_RIGHT (2) +#define ESB_DISABLE_RTDN (2) +#define ESB_DISABLE_UP (1) +#define ESB_ENABLE_BOTH (0) + +/* Scroll Bar notifications*/ +#define SB_LINEUP (0) +#define SB_LINEDOWN (1) +#define SB_LINELEFT (0) +#define SB_LINERIGHT (1) +#define SB_PAGEUP (2) +#define SB_PAGEDOWN (3) +#define SB_PAGELEFT (2) +#define SB_PAGERIGHT (3) +#define SB_THUMBPOSITION (4) +#define SB_THUMBTRACK (5) +#define SB_ENDSCROLL (8) +#define SB_LEFT (6) +#define SB_RIGHT (7) +#define SB_BOTTOM (7) +#define SB_TOP (6) + +/* EnumCalendarInfo */ +#define ENUM_ALL_CALENDARS (-1) + +/* EnumDateFormats */ +#define DATE_SHORTDATE (1) +#define DATE_LONGDATE (2) + +/* EnumDependentServices */ +#define SERVICE_ACTIVE (1) +#define SERVICE_INACTIVE (2) + +/* EnumFontFamExProc */ +#define DEVICE_FONTTYPE (2) +#define RASTER_FONTTYPE (1) +#define TRUETYPE_FONTTYPE (4) + +/* EnumObjects, GetCurrentObject, GetObjectType */ +#define OBJ_BRUSH (2) +#define OBJ_PEN (1) +#define OBJ_PAL (5) +#define OBJ_FONT (6) +#define OBJ_BITMAP (7) +#define OBJ_EXTPEN (11) +#define OBJ_REGION (8) +#define OBJ_DC (3) +#define OBJ_MEMDC (10) +#define OBJ_METAFILE (9) +#define OBJ_METADC (4) +#define OBJ_ENHMETAFILE (13) +#define OBJ_ENHMETADC (12) + +/* EnumPrinters */ + +/* EnumProtocols */ + +/* EnumResLangProc */ +#define RT_ACCELERATOR (MAKEINTRESOURCE(9)) +#define RT_BITMAP (MAKEINTRESOURCE(2)) +#define RT_DIALOG (MAKEINTRESOURCE(5)) +#define RT_FONT (MAKEINTRESOURCE(8)) +#define RT_FONTDIR (MAKEINTRESOURCE(7)) +#define RT_MENU (MAKEINTRESOURCE(4)) +#define RT_RCDATA (MAKEINTRESOURCE(10)) +#define RT_STRING (MAKEINTRESOURCE(6)) +#define RT_MESSAGETABLE (MAKEINTRESOURCE(11)) +#define RT_CURSOR (MAKEINTRESOURCE(1)) +#define RT_GROUP_CURSOR (MAKEINTRESOURCE(12)) +#define RT_ICON (MAKEINTRESOURCE(3)) +#define RT_GROUP_ICON (MAKEINTRESOURCE(13)) +#define RT_VERSION (MAKEINTRESOURCE(16)) + +/* EnumServicesStatus */ +#define SERVICE_WIN32 (48) +#define SERVICE_DRIVER (11) + +/* EnumSystemCodePages */ +#define CP_INSTALLED (1) +#define CP_SUPPORTED (2) + +/* EnumSystemLocales */ +#define LCID_INSTALLED (1) +#define LCID_SUPPORTED (2) + +/* EraseTape */ +#define TAPE_ERASE_LONG (0x1L) +#define TAPE_ERASE_SHORT (0L) + +/* Escape */ +#define SP_ERROR (-1) +#define SP_OUTOFDISK (-4) +#define SP_OUTOFMEMORY (-5) +#define SP_USERABORT (-3) +#define PHYSICALWIDTH (110) +#define PHYSICALHEIGHT (111) +#define PHYSICALOFFSETX (112) +#define PHYSICALOFFSETY (113) +#define SCALINGFACTORX (114) +#define SCALINGFACTORY (115) +#define QUERYESCSUPPORT (8) +#define ABORTDOC (2) +#define ENDDOC (11) +#define GETPHYSPAGESIZE (12) +#define GETPRINTINGOFFSET (13) +#define GETSCALINGFACTOR (14) +#define NEWFRAME (1) +#define NEXTBAND (3) +#define PASSTHROUGH (19) +#define SETABORTPROC (9) +#define STARTDOC (10) + +/* EscapeCommFunction */ +#define CLRDTR (6) +#define CLRRTS (4) +#define SETDTR (5) +#define SETRTS (3) +#define SETXOFF (1) +#define SETXON (2) +#define SETBREAK (8) +#define CLRBREAK (9) + +/* ExitWindowsEx */ +#define EWX_FORCE (4) +#define EWX_LOGOFF (0) +#define EWX_POWEROFF (8) +#define EWX_REBOOT (2) +#define EWX_SHUTDOWN (1) + +/* ExtFloodFill */ +#define FLOODFILLBORDER (0) +#define FLOODFILLSURFACE (1) + +/* ExtTextOut */ +#define ETO_CLIPPED (4) +#define ETO_GLYPH_INDEX (16) +#define ETO_OPAQUE (2) +#define ETO_RTLREADING (128) + +/* FillConsoleOutputAttribute */ +#define FOREGROUND_BLUE (1) +#define FOREGROUND_GREEN (2) +#define FOREGROUND_RED (4) +#define FOREGROUND_INTENSITY (8) +#define BACKGROUND_BLUE (16) +#define BACKGROUND_GREEN (32) +#define BACKGROUND_RED (64) +#define BACKGROUND_INTENSITY (128) + +/* FindFirstChangeNotification */ +#define FILE_NOTIFY_CHANGE_FILE_NAME (1) +#define FILE_NOTIFY_CHANGE_DIR_NAME (2) +#define FILE_NOTIFY_CHANGE_ATTRIBUTES (4) +#define FILE_NOTIFY_CHANGE_SIZE (8) +#define FILE_NOTIFY_CHANGE_LAST_WRITE (16) +#define FILE_NOTIFY_CHANGE_SECURITY (256) + +/* FindFirstPrinterChangeNotification */ + +/* FindNextPrinterNotification */ + +/* FMExtensionProc */ + +/* FoldString */ +#define MAP_FOLDCZONE (16) +#define MAP_FOLDDIGITS (128) +#define MAP_PRECOMPOSED (32) +#define MAP_COMPOSITE (64) + +/* ForegroundIdleProc */ +#define HC_ACTION (0) + +/* FormatMessage */ +#define FORMAT_MESSAGE_ALLOCATE_BUFFER (256) +#define FORMAT_MESSAGE_IGNORE_INSERTS (512) +#define FORMAT_MESSAGE_FROM_STRING (1024) +#define FORMAT_MESSAGE_FROM_HMODULE (2048) +#define FORMAT_MESSAGE_FROM_SYSTEM (4096) +#define FORMAT_MESSAGE_ARGUMENT_ARRAY (8192) +#define FORMAT_MESSAGE_MAX_WIDTH_MASK (255) + +/* GdiComment */ +#define GDICOMMENT_WINDOWS_METAFILE (-2147483647) +#define GDICOMMENT_BEGINGROUP (2) +#define GDICOMMENT_ENDGROUP (3) +#define GDICOMMENT_MULTIFORMATS (1073741828) +#define GDICOMMENT_IDENTIFIER (1128875079) + +/* GenerateConsoleCtrlEvent, HandlerRoutine */ +#define CTRL_C_EVENT (0) +#define CTRL_BREAK_EVENT (1) +#define CTRL_CLOSE_EVENT (2) +#define CTRL_LOGOFF_EVENT (5) +#define CTRL_SHUTDOWN_EVENT (6) + +/* GetAddressByName */ + +/* GetArcDirection */ +#define AD_COUNTERCLOCKWISE (1) +#define AD_CLOCKWISE (2) + +/* GetBinaryTypes */ +#define SCS_32BIT_BINARY (0) +#define SCS_DOS_BINARY (1) +#define SCS_OS216_BINARY (5) +#define SCS_PIF_BINARY (3) +#define SCS_POSIX_BINARY (4) +#define SCS_WOW_BINARY (2) + +/* GetBoundsRect, SetBoundsRect */ +#define DCB_DISABLE (8) +#define DCB_ENABLE (4) +#define DCB_RESET (1) +#define DCB_SET (3) +#define DCB_ACCUMULATE (2) + +/* GetCharacterPlacement, GetFontLanguageInfo */ +#define GCP_DBCS (1) +#define GCP_ERROR (0x8000) +#define GCP_CLASSIN (0x80000L) +#define GCP_DIACRITIC (256) +#define GCP_DISPLAYZWG (0x400000L) +#define GCP_GLYPHSHAPE (16) +#define GCP_JUSTIFY (0x10000L) +#define GCP_JUSTIFYIN (0x200000L) +#define GCP_KASHIDA (1024) +#define GCP_LIGATE (32) +#define GCP_MAXEXTENT (0x100000L) +#define GCP_NEUTRALOVERRIDE (0x2000000L) +#define GCP_NUMERICOVERRIDE (0x1000000L) +#define GCP_NUMERICSLATIN (0x4000000L) +#define GCP_NUMERICSLOCAL (0x8000000L) +#define GCP_REORDER (2) +#define GCP_SYMSWAPOFF (0x800000L) +#define GCP_USEKERNING (8) +#define FLI_GLYPHS (0x40000L) +#define FLI_MASK (0x103b) + +/* GetClassLong, GetClassWord */ +#define GCW_ATOM (-32) +#define GCL_CBCLSEXTRA (-20) +#define GCL_CBWNDEXTRA (-18) +#define GCL_HBRBACKGROUND (-10) +#define GCL_HCURSOR (-12) +#define GCL_HICON (-14) +#define GCL_HICONSM (-34) +#define GCL_HMODULE (-16) +#define GCL_MENUNAME (-8) +#define GCL_STYLE (-26) +#define GCL_WNDPROC (-24) + +/* GetClipboardFormat, SetClipboardData */ +#define CF_BITMAP (2) +#define CF_DIB (8) +#define CF_PALETTE (9) +#define CF_ENHMETAFILE (14) +#define CF_METAFILEPICT (3) +#define CF_OEMTEXT (7) +#define CF_TEXT (1) +#define CF_UNICODETEXT (13) +#define CF_DIF (5) +#define CF_DSPBITMAP (130) +#define CF_DSPENHMETAFILE (142) +#define CF_DSPMETAFILEPICT (131) +#define CF_DSPTEXT (129) +#define CF_GDIOBJFIRST (768) +#define CF_GDIOBJLAST (1023) +#define CF_HDROP (15) +#define CF_LOCALE (16) +#define CF_OWNERDISPLAY (128) +#define CF_PENDATA (10) +#define CF_PRIVATEFIRST (512) +#define CF_PRIVATELAST (767) +#define CF_RIFF (11) +#define CF_SYLK (4) +#define CF_WAVE (12) +#define CF_TIFF (6) + +/* GetCommMask */ +#define EV_BREAK (64) +#define EV_CTS (8) +#define EV_DSR (16) +#define EV_ERR (128) +#define EV_EVENT1 (2048) +#define EV_EVENT2 (4096) +#define EV_PERR (512) +#define EV_RING (256) +#define EV_RLSD (32) +#define EV_RX80FULL (1024) +#define EV_RXCHAR (1) +#define EV_RXFLAG (2) +#define EV_TXEMPTY (4) + +/* GetCommModemStatus */ +#define MS_CTS_ON (0x10L) +#define MS_DSR_ON (0x20L) +#define MS_RING_ON (0x40L) +#define MS_RLSD_ON (0x80L) + +/* GetComputerName */ +#define MAX_COMPUTERNAME_LENGTH (15) + + +/* GetCPInfo */ +#define CP_ACP (0) +#define CP_MACCP (2) +#define CP_OEMCP (1) +#define CP_THREAD_ACP 3 //ACP Current thread's ANSI code page +#define CP_SYMBOL 42 //Symbol code page (42) +#define CP_UTF7 65000 //Translate using UTF-7 +#define CP_UTF8 65001 //Translate using UTF-8 + +/* GetDateFormat */ +#define DATE_SHORTDATE (1) +#define DATE_LONGDATE (2) +#define DATE_USE_ALT_CALENDAR (4) + +/* GetDCEx */ +#define DCX_WINDOW (0x1L) +#define DCX_CACHE (0x2L) +#define DCX_PARENTCLIP (0x20L) +#define DCX_CLIPSIBLINGS (0x10L) +#define DCX_CLIPCHILDREN (0x8L) +#define DCX_NORESETATTRS (0x4L) +#define DCX_LOCKWINDOWUPDATE (0x400L) +#define DCX_EXCLUDERGN (0x40L) +#define DCX_INTERSECTRGN (0x80L) +#define DCX_VALIDATE (0x200000L) +#define DCX_USESTYLE (0x00010000L) +#define DCX_NORECOMPUTE (0x00100000L) +#define DCX_EXCLUDEUPDATE (0x00000100L) +#define DCX_INTERSECTUPDATE (0x00000200L) + +/* GetDeviceCaps */ +#define DRIVERVERSION (0) +#define TECHNOLOGY (2) +#define DT_PLOTTER (0) +#define DT_RASDISPLAY (1) +#define DT_RASPRINTER (2) +#define DT_RASCAMERA (3) +#define DT_CHARSTREAM (4) +#define DT_METAFILE (5) +#define DT_DISPFILE (6) +#define HORZSIZE (4) +#define VERTSIZE (6) +#define HORZRES (8) +#define VERTRES (10) +#define LOGPIXELSX (88) +#define LOGPIXELSY (90) +#define BITSPIXEL (12) +#define PLANES (14) +#define NUMBRUSHES (16) +#define NUMPENS (18) +#define NUMFONTS (22) +#define NUMCOLORS (24) +#define ASPECTX (40) +#define ASPECTY (42) +#define ASPECTXY (44) +#define PDEVICESIZE (26) +#define CLIPCAPS (36) +#define SIZEPALETTE (104) +#define NUMRESERVED (106) +#define COLORRES (108) +#define PHYSICALWIDTH (110) +#define PHYSICALHEIGHT (111) +#define PHYSICALOFFSETX (112) +#define PHYSICALOFFSETY (113) +#define SCALINGFACTORX (114) +#define SCALINGFACTORY (115) +#define VREFRESH (116) +#define DESKTOPHORZRES (118) +#define DESKTOPVERTRES (117) +#define BLTALIGNMENT (119) +#define RASTERCAPS (38) +#define RC_BANDING (2) +#define RC_BITBLT (1) +#define RC_BITMAP64 (8) +#define RC_DI_BITMAP (128) +#define RC_DIBTODEV (512) +#define RC_FLOODFILL (4096) +#define RC_GDI20_OUTPUT (16) +#define RC_PALETTE (256) +#define RC_SCALING (4) +#define RC_STRETCHBLT (2048) +#define RC_STRETCHDIB (8192) +#define CURVECAPS (28) +#define CC_NONE (0) +#define CC_CIRCLES (1) +#define CC_PIE (2) +#define CC_CHORD (4) +#define CC_ELLIPSES (8) +#define CC_WIDE (16) +#define CC_STYLED (32) +#define CC_WIDESTYLED (64) +#define CC_INTERIORS (128) +#define CC_ROUNDRECT (256) +#define LINECAPS (30) +#define LC_NONE (0) +#define LC_POLYLINE (2) +#define LC_MARKER (4) +#define LC_POLYMARKER (8) +#define LC_WIDE (16) +#define LC_STYLED (32) +#define LC_WIDESTYLED (64) +#define LC_INTERIORS (128) +#define POLYGONALCAPS (32) +#define PC_NONE (0) +#define PC_POLYGON (1) +#define PC_RECTANGLE (2) +#define PC_WINDPOLYGON (4) +#define PC_SCANLINE (8) +#define PC_WIDE (16) +#define PC_STYLED (32) +#define PC_WIDESTYLED (64) +#define PC_INTERIORS (128) +#define TEXTCAPS (34) +#define TC_OP_CHARACTER (1) +#define TC_OP_STROKE (2) +#define TC_CP_STROKE (4) +#define TC_CR_90 (8) +#define TC_CR_ANY (16) +#define TC_SF_X_YINDEP (32) +#define TC_SA_DOUBLE (64) +#define TC_SA_INTEGER (128) +#define TC_SA_CONTIN (256) +#define TC_EA_DOUBLE (512) +#define TC_IA_ABLE (1024) +#define TC_UA_ABLE (2048) +#define TC_SO_ABLE (4096) +#define TC_RA_ABLE (8192) +#define TC_VA_ABLE (16384) +#define TC_RESERVED (32768) +#define TC_SCROLLBLT (65536) +#define PC_PATHS (512) + +/* GetDriveType */ +#define DRIVE_REMOVABLE (2) +#define DRIVE_FIXED (3) +#define DRIVE_REMOTE (4) +#define DRIVE_CDROM (5) +#define DRIVE_RAMDISK (6) +#define DRIVE_UNKNOWN (0) +#define DRIVE_NO_ROOT_DIR (1) + +/* GetExceptionCode */ +#define EXCEPTION_ACCESS_VIOLATION (0xc0000005L) +#define EXCEPTION_BREAKPOINT (0x80000003L) +#define EXCEPTION_DATATYPE_MISALIGNMENT (0x80000002L) +#define EXCEPTION_SINGLE_STEP (0x80000004L) +#define EXCEPTION_ARRAY_BOUNDS_EXCEEDED (0xc000008cL) +#define EXCEPTION_FLT_DENORMAL_OPERAND (0xc000008dL) +#define EXCEPTION_FLT_DIVIDE_BY_ZERO (0xc000008eL) +#define EXCEPTION_FLT_INEXACT_RESULT (0xc000008fL) +#define EXCEPTION_FLT_INVALID_OPERATION (0xc0000090L) +#define EXCEPTION_FLT_OVERFLOW (0xc0000091L) +#define EXCEPTION_FLT_STACK_CHECK (0xc0000092L) +#define EXCEPTION_FLT_UNDERFLOW (0xc0000093L) +#define EXCEPTION_INT_DIVIDE_BY_ZERO (0xc0000094L) +#define EXCEPTION_INT_OVERFLOW (0xc0000095L) +#define EXCEPTION_INVALID_HANDLE (0xc0000008L) +#define EXCEPTION_PRIV_INSTRUCTION (0xc0000096L) +#define EXCEPTION_NONCONTINUABLE_EXCEPTION (0xc0000025L) +#define EXCEPTION_NONCONTINUABLE (0x1) +#define EXCEPTION_STACK_OVERFLOW (0xc00000fdL) +#define EXCEPTION_INVALID_DISPOSITION (0xc0000026L) + +/* GetFileType */ +#define FILE_TYPE_UNKNOWN (0) +#define FILE_TYPE_DISK (1) +#define FILE_TYPE_CHAR (2) +#define FILE_TYPE_PIPE (3) + +/* GetGlyphOutline */ +#define GGO_BITMAP (1) +#define GGO_NATIVE (2) +#define GGO_METRICS (0) +#define GGO_GRAY2_BITMAP (4) +#define GGO_GRAY4_BITMAP (5) +#define GGO_GRAY8_BITMAP (6) +#define GDI_ERROR (0xffffffffL) + +/* GetGraphicsMode */ +#define GM_COMPATIBLE (1) +#define GM_ADVANCED (2) + +/* GetHandleInformation */ +#define HANDLE_FLAG_INHERIT (1) +#define HANDLE_FLAG_PROTECT_FROM_CLOSE (2) + +/* GetIconInfo */ +#define IDC_ARROW (MAKEINTRESOURCE(32512)) +#define IDC_IBEAM (MAKEINTRESOURCE(32513)) +#define IDC_WAIT (MAKEINTRESOURCE(32514)) +#define IDC_CROSS (MAKEINTRESOURCE(32515)) +#define IDC_UPARROW (MAKEINTRESOURCE(32516)) +#define IDC_SIZENWSE (MAKEINTRESOURCE(32642)) +#define IDC_SIZENESW (MAKEINTRESOURCE(32643)) +#define IDC_SIZEWE (MAKEINTRESOURCE(32644)) +#define IDC_SIZENS (MAKEINTRESOURCE(32645)) +#define IDC_SIZEALL (MAKEINTRESOURCE(32646)) +#define IDC_NO (MAKEINTRESOURCE(32648)) +#define IDC_APPSTARTING (MAKEINTRESOURCE(32650)) +#define IDC_HELP (MAKEINTRESOURCE(32651)) +#define IDI_APPLICATION (MAKEINTRESOURCE(32512)) +#define IDI_HAND (MAKEINTRESOURCE(32513)) +#define IDI_QUESTION (MAKEINTRESOURCE(32514)) +#define IDI_EXCLAMATION (MAKEINTRESOURCE(32515)) +#define IDI_ASTERISK (MAKEINTRESOURCE(32516)) +#define IDI_WINLOGO (MAKEINTRESOURCE(32517)) +#define IDC_SIZE (MAKEINTRESOURCE(32640)) +#define IDC_ICON (MAKEINTRESOURCE(32641)) + +/* GetMapMode */ +#define MM_ANISOTROPIC (8) +#define MM_HIENGLISH (5) +#define MM_HIMETRIC (3) +#define MM_ISOTROPIC (7) +#define MM_LOENGLISH (4) +#define MM_LOMETRIC (2) +#define MM_TEXT (1) +#define MM_TWIPS (6) + +/* GetMenuDefaultItem */ +#define GMDI_GOINTOPOPUPS (0x2L) +#define GMDI_USEDISABLED (0x1L) + +/* PeekMessage */ +#define PM_NOREMOVE (0) +#define PM_REMOVE (1) +#define PM_NOYIELD (2) + +/* GetNamedPipeHandleState */ +#define PIPE_NOWAIT (1) +#define PIPE_READMODE_MESSAGE (2) + +/* GetNamedPipeInfo */ +#define PIPE_CLIENT_END (0) +#define PIPE_SERVER_END (1) +#define PIPE_TYPE_MESSAGE (4) + +/* GetNextWindow, GetWindow */ +#define GW_HWNDNEXT (2) +#define GW_HWNDPREV (3) +#define GW_CHILD (5) +#define GW_HWNDFIRST (0) +#define GW_HWNDLAST (1) +#define GW_OWNER (4) + +/* GetPath */ +#define PT_MOVETO (6) +#define PT_LINETO (2) +#define PT_BEZIERTO (4) +#define PT_CLOSEFIGURE (1) + +/* GetProcessShutdownParameters */ +#define SHUTDOWN_NORETRY (1) + +/* GetQueueStatus */ +#define QS_ALLEVENTS (191) +#define QS_ALLINPUT (255) +#define QS_HOTKEY (128) +#define QS_INPUT (7) +#define QS_KEY (1) +#define QS_MOUSE (6) +#define QS_MOUSEBUTTON (4) +#define QS_MOUSEMOVE (2) +#define QS_PAINT (32) +#define QS_POSTMESSAGE (8) +#define QS_SENDMESSAGE (64) +#define QS_TIMER (16) + +/* GetScrollInfo, SetScrollInfo */ +#define SIF_ALL (23) +#define SIF_PAGE (2) +#define SIF_POS (4) +#define SIF_RANGE (1) +#define SIF_DISABLENOSCROLL (8) + +/* GetStdHandle */ +#define STD_INPUT_HANDLE (DWORD)(-10) +#define STD_OUTPUT_HANDLE (DWORD)(-11) +#define STD_ERROR_HANDLE (DWORD)(-12) + +/* GetStockObject */ +#define BLACK_BRUSH (4) +#define DKGRAY_BRUSH (3) +#define GRAY_BRUSH (2) +#define HOLLOW_BRUSH (5) +#define LTGRAY_BRUSH (1) +#define NULL_BRUSH (5) +#define WHITE_BRUSH (0) +#define BLACK_PEN (7) +#define NULL_PEN (8) +#define WHITE_PEN (6) +#define ANSI_FIXED_FONT (11) +#define ANSI_VAR_FONT (12) +#define DEVICE_DEFAULT_FONT (14) +#define DEFAULT_GUI_FONT (17) +#define OEM_FIXED_FONT (10) +#define SYSTEM_FONT (13) +#define SYSTEM_FIXED_FONT (16) +#define DEFAULT_PALETTE (15) + +/* GetStringTypeA */ +#define CT_CTYPE1 (1) +#define CT_CTYPE2 (2) +#define CT_CTYPE3 (4) +#define C1_UPPER (1) +#define C1_LOWER (2) +#define C1_DIGIT (4) +#define C1_SPACE (8) +#define C1_PUNCT (16) +#define C1_CNTRL (32) +#define C1_BLANK (64) +#define C1_XDIGIT (128) +#define C1_ALPHA (256) +#define C2_LEFTTORIGHT (1) +#define C2_RIGHTTOLEFT (2) +#define C2_EUROPENUMBER (3) +#define C2_EUROPESEPARATOR (4) +#define C2_EUROPETERMINATOR (5) +#define C2_ARABICNUMBER (6) +#define C2_COMMONSEPARATOR (7) +#define C2_BLOCKSEPARATOR (8) +#define C2_SEGMENTSEPARATOR (9) +#define C2_WHITESPACE (10) +#define C2_OTHERNEUTRAL (11) +#define C2_NOTAPPLICABLE (0) +#define C3_NONSPACING (1) +#define C3_DIACRITIC (2) +#define C3_VOWELMARK (4) +#define C3_SYMBOL (8) +#define C3_KATAKANA (16) +#define C3_HIRAGANA (32) +#define C3_HALFWIDTH (64) +#define C3_FULLWIDTH (128) +#define C3_IDEOGRAPH (256) +#define C3_KASHIDA (512) +#define C3_ALPHA (32768) +#define C3_NOTAPPLICABLE (0) + +/* GetSysColor */ +#define COLOR_3DDKSHADOW (21) +#define COLOR_3DFACE (15) +#define COLOR_3DHILIGHT (20) +#define COLOR_3DLIGHT (22) +#define COLOR_BTNHILIGHT (20) +#define COLOR_3DSHADOW (16) +#define COLOR_ACTIVEBORDER (10) +#define COLOR_ACTIVECAPTION (2) +#define COLOR_APPWORKSPACE (12) +#define COLOR_BACKGROUND (1) +#define COLOR_DESKTOP (1) +#define COLOR_BTNFACE (15) +#define COLOR_BTNHIGHLIGHT (20) +#define COLOR_BTNSHADOW (16) +#define COLOR_BTNTEXT (18) +#define COLOR_CAPTIONTEXT (9) +#define COLOR_GRAYTEXT (17) +#define COLOR_HIGHLIGHT (13) +#define COLOR_HIGHLIGHTTEXT (14) +#define COLOR_INACTIVEBORDER (11) +#define COLOR_INACTIVECAPTION (3) +#define COLOR_INACTIVECAPTIONTEXT (19) +#define COLOR_INFOBK (24) +#define COLOR_INFOTEXT (23) +#define COLOR_MENU (4) +#define COLOR_MENUTEXT (7) +#define COLOR_SCROLLBAR (0) +#define COLOR_WINDOW (5) +#define COLOR_WINDOWFRAME (6) +#define COLOR_WINDOWTEXT (8) + +/* GetSystemMetrics */ +#define SM_CYMIN (29) +#define SM_CXMIN (28) +#define SM_ARRANGE (56) +#define SM_CLEANBOOT (67) +/* The right value for SM_CEMETRICS for NT 3.5 is 75. For Windows 95 + and NT 4.0, it is 76. The meaning is undocumented, anyhow. */ +#define SM_CMETRICS (76) +#define SM_CMOUSEBUTTONS (43) +#define SM_CXBORDER (5) +#define SM_CYBORDER (6) +#define SM_CXCURSOR (13) +#define SM_CYCURSOR (14) +#define SM_CXDLGFRAME (7) +#define SM_CYDLGFRAME (8) +#define SM_CXDOUBLECLK (36) +#define SM_CYDOUBLECLK (37) +#define SM_CXDRAG (68) +#define SM_CYDRAG (69) +#define SM_CXEDGE (45) +#define SM_CYEDGE (46) +#define SM_CXFIXEDFRAME (7) +#define SM_CYFIXEDFRAME (8) +#define SM_CXFRAME (32) +#define SM_CYFRAME (33) +#define SM_CXFULLSCREEN (16) +#define SM_CYFULLSCREEN (17) +#define SM_CXHSCROLL (21) +#define SM_CYHSCROLL (3) +#define SM_CXHTHUMB (10) +#define SM_CXICON (11) +#define SM_CYICON (12) +#define SM_CXICONSPACING (38) +#define SM_CYICONSPACING (39) +#define SM_CXMAXIMIZED (61) +#define SM_CYMAXIMIZED (62) +#define SM_CXMAXTRACK (59) +#define SM_CYMAXTRACK (60) +#define SM_CXMENUCHECK (71) +#define SM_CYMENUCHECK (72) +#define SM_CXMENUSIZE (54) +#define SM_CYMENUSIZE (55) +#define SM_CXMINIMIZED (57) +#define SM_CYMINIMIZED (58) +#define SM_CXMINSPACING (47) +#define SM_CYMINSPACING (48) +#define SM_CXMINTRACK (34) +#define SM_CYMINTRACK (35) +#define SM_CXSCREEN (0) +#define SM_CYSCREEN (1) +#define SM_CXSIZE (30) +#define SM_CYSIZE (31) +#define SM_CXSIZEFRAME (32) +#define SM_CYSIZEFRAME (33) +#define SM_CXSMICON (49) +#define SM_CYSMICON (50) +#define SM_CXSMSIZE (52) +#define SM_CYSMSIZE (53) +#define SM_CXVSCROLL (2) +#define SM_CYHSCROLL (3) +#define SM_CXHSCROLL (21) +#define SM_CYVSCROLL (20) +#define SM_CYVTHUMB (9) +#define SM_CYCAPTION (4) +#define SM_CYKANJIWINDOW (18) +#define SM_CYMENU (15) +#define SM_CYSMCAPTION (51) +#define SM_DBCSENABLED (42) +#define SM_DEBUG (22) +#define SM_MENUDROPALIGNMENT (40) +#define SM_MIDEASTENABLED (74) +#define SM_MOUSEPRESENT (19) +#define SM_MOUSEWHEELPRESENT (75) +#define SM_NETWORK (63) +#define SM_PENWINDOWS (41) +#define SM_SECURE (44) +#define SM_SHOWSOUNDS (70) +#define SM_SLOWMACHINE (73) +#define SM_SWAPBUTTON (23) +#define ARW_BOTTOMLEFT (0L) +#define ARW_BOTTOMRIGHT (0x1L) +#define ARW_HIDE (0x8L) +#define ARW_TOPLEFT (0x2L) +#define ARW_TOPRIGHT (0x3L) +#define ARW_DOWN (0x4L) +#define ARW_LEFT (0L) +#define ARW_RIGHT (0L) +#define ARW_UP (0x4L) + +/* GetSystemPaletteUse */ +#define SYSPAL_NOSTATIC (2) +#define SYSPAL_STATIC (1) +#define SYSPAL_ERROR (0) + +/* GetTapeParameters, SetTapeParameters */ +#define GET_TAPE_MEDIA_INFORMATION (0) +#define GET_TAPE_DRIVE_INFORMATION (1) +#define SET_TAPE_MEDIA_INFORMATION (0) +#define SET_TAPE_DRIVE_INFORMATION (1) + +/* GetTapePosition */ +#define TAPE_ABSOLUTE_POSITION (0L) +#define TAPE_LOGICAL_POSITION (0x1L) + +/* GetTextAlign */ +#define TA_BASELINE (24) +#define TA_BOTTOM (8) +#define TA_TOP (0) +#define TA_CENTER (6) +#define TA_LEFT (0) +#define TA_RIGHT (2) +#define TA_RTLREADING (256) +#define TA_NOUPDATECP (0) +#define TA_UPDATECP (1) +#define VTA_BASELINE (24) +#define VTA_CENTER (6) + +/* GetThreadPriority */ +#define TLS_MINIMUM_AVAILABLE (64) + +/* GetTimeFormat */ +#define TIME_NOMINUTESORSECONDS (1) +#define TIME_NOSECONDS (2) +#define TIME_NOTIMEMARKER (4) +#define TIME_FORCE24HOURFORMAT (8) + +/* GetTimeZoneInformation */ +#define TIME_ZONE_ID_INVALID ((DWORD) -1) +#define TIME_ZONE_ID_UNKNOWN (0) +#define TIME_ZONE_ID_STANDARD (1) +#define TIME_ZONE_ID_DAYLIGHT (2) + +/* GetUserObjectInformation */ +#define UOI_FLAGS (1) +#define UOI_NAME (2) +#define UOI_TYPE (3) + +/* GetWindowLong */ +#define GWL_EXSTYLE (-20) +#define GWL_STYLE (-16) +#define GWL_WNDPROC (-4) +#define GWL_HINSTANCE (-6) +#define GWL_HWNDPARENT (-8) +#define GWL_ID (-12) +#define GWL_USERDATA (-21) +#define DWL_DLGPROC (4) +#define DWL_MSGRESULT (0) +#define DWL_USER (8) + +/* GlobalAlloc, GlobalFlags */ +#define GMEM_FIXED (0) +#define GMEM_MOVEABLE (2) +#define GPTR (64) +#define GHND (66) +#define GMEM_DDESHARE (8192) +#define GMEM_DISCARDABLE (256) +#define GMEM_LOWER (4096) +#define GMEM_NOCOMPACT (16) +#define GMEM_NODISCARD (32) +#define GMEM_NOT_BANKED (4096) +#define GMEM_NOTIFY (16384) +#define GMEM_SHARE (8192) +#define GMEM_ZEROINIT (64) +#define GMEM_DISCARDED (16384) +#define GMEM_INVALID_HANDLE (32768) +#define GMEM_LOCKCOUNT (255) + +/* ImageList_Create */ +#define ILC_COLOR (0) +#define ILC_COLOR4 (4) +#define ILC_COLOR8 (8) +#define ILC_COLOR16 (16) +#define ILC_COLOR24 (24) +#define ILC_COLOR32 (32) +#define ILC_COLORDDB (254) +#define ILC_MASK (1) +#define ILC_PALETTE (2048) + +/* ImageList_Draw, ImageList_DrawEx */ +#define ILD_BLEND25 (2) +#define ILD_BLEND50 (4) +#define ILD_SELECTED (4) +#define ILD_BLEND (4) +#define ILD_FOCUS (2) +#define ILD_MASK (16) +#define ILD_NORMAL (0) +#define ILD_TRANSPARENT (1) +#define CLR_NONE (0xffffffffL) +#define CLR_DEFAULT (0xff000000L) + +/* ImageList_LoadImage */ +#define LR_DEFAULTCOLOR (0) +#define LR_LOADFROMFILE (16) +#define LR_LOADMAP3DCOLORS (4096) +#define LR_LOADTRANSPARENT (32) +#define LR_MONOCHROME (1) + +/* ImmConfigureIME */ +#define IME_CONFIG_GENERAL (1) +#define IME_CONFIG_REGISTERWORD (2) +#define IME_CONFIG_SELECTDICTIONARY (3) + +/* ImmGetConversionList */ +#define GCL_CONVERSION (1) +#define GCL_REVERSECONVERSION (2) +#define GCL_REVERSE_LENGTH (3) + +/* ImmGetGuideLine */ +#define GGL_LEVEL (1) +#define GGL_INDEX (2) +#define GGL_STRING (3) +#define GGL_PRIVATE (4) +#define GL_LEVEL_ERROR (2) +#define GL_LEVEL_FATAL (1) +#define GL_LEVEL_INFORMATION (4) +#define GL_LEVEL_NOGUIDELINE (0) +#define GL_LEVEL_WARNING (3) +#define GL_ID_CANNOTSAVE (17) +#define GL_ID_NOCONVERT (32) +#define GL_ID_NODICTIONARY (16) +#define GL_ID_NOMODULE (1) +#define GL_ID_READINGCONFLICT (35) +#define GL_ID_TOOMANYSTROKE (34) +#define GL_ID_TYPINGERROR (33) +#define GL_ID_UNKNOWN (0) +#define GL_ID_INPUTREADING (36) +#define GL_ID_INPUTRADICAL (37) +#define GL_ID_INPUTCODE (38) +#define GL_ID_CHOOSECANDIDATE (40) +#define GL_ID_REVERSECONVERSION (41) + +/* ImmGetProperty */ +#define IGP_PROPERTY (4) +#define IGP_CONVERSION (8) +#define IGP_SENTENCE (12) +#define IGP_UI (16) +#define IGP_SETCOMPSTR (20) +#define IGP_SELECT (24) +#define IME_PROP_AT_CARET (65536) +#define IME_PROP_SPECIAL_UI (131072) +#define IME_PROP_CANDLIST_START_FROM_1 (262144) +#define IME_PROP_UNICODE (524288) +#define UI_CAP_2700 (1) +#define UI_CAP_ROT90 (2) +#define UI_CAP_ROTANY (4) +#define SCS_CAP_COMPSTR (1) +#define SCS_CAP_MAKEREAD (2) +#define SELECT_CAP_CONVERSION (1) +#define SELECT_CAP_SENTENCE (2) + +/* ImmNotifyIME */ +#define NI_CHANGECANDIDATELIST (19) +#define NI_CLOSECANDIDATE (17) +#define NI_COMPOSITIONSTR (21) +#define NI_OPENCANDIDATE (16) +#define NI_SELECTCANDIDATESTR (18) +#define NI_SETCANDIDATE_PAGESIZE (23) +#define NI_SETCANDIDATE_PAGESTART (22) +#define CPS_CANCEL (4) +#define CPS_COMPLETE (1) +#define CPS_CONVERT (2) +#define CPS_REVERT (3) + +/* ImmSetCompositionString */ +#define SCS_SETSTR (9) +#define SCS_CHANGEATTR (18) +#define SCS_CHANGECLAUSE (36) + +/* ImmUnregisterWord */ +#define IME_REGWORD_STYLE_EUDC (1) +#define IME_REGWORD_STYLE_USER_FIRST 0x80000000 +#define IME_REGWORD_STYLE_USER_LAST (-1) + +/* InitializeSecurityDescriptor */ +#define SECURITY_DESCRIPTOR_REVISION (1) + +/* IsTextUnicode */ +#define IS_TEXT_UNICODE_ASCII16 (1) +#define IS_TEXT_UNICODE_REVERSE_ASCII16 (16) +#define IS_TEXT_UNICODE_STATISTICS (2) +#define IS_TEXT_UNICODE_REVERSE_STATISTICS (32) +#define IS_TEXT_UNICODE_CONTROLS (4) +#define IS_TEXT_UNICODE_REVERSE_CONTROLS (64) +#define IS_TEXT_UNICODE_SIGNATURE (8) +#define IS_TEXT_UNICODE_REVERSE_SIGNATURE (128) +#define IS_TEXT_UNICODE_ILLEGAL_CHARS (256) +#define IS_TEXT_UNICODE_ODD_LENGTH (512) +#define IS_TEXT_UNICODE_NULL_BYTES (4096) +#define IS_TEXT_UNICODE_UNICODE_MASK (15) +#define IS_TEXT_UNICODE_REVERSE_MASK (240) +#define IS_TEXT_UNICODE_NOT_UNICODE_MASK (3840) +#define IS_TEXT_UNICODE_NOT_ASCII_MASK (61440) + +/* JournalPlaybackProc, KeyboardProc */ +#define HC_GETNEXT (1) +#define HC_SKIP (2) +#define HC_SYSMODALOFF (5) +#define HC_SYSMODALON (4) +#define HC_NOREMOVE (3) + +/* keybd_event */ +#define KEYEVENTF_EXTENDEDKEY (1) +#define KEYEVENTF_KEYUP (2) + +/* LoadBitmap */ +#define OBM_BTNCORNERS (32758) +#define OBM_BTSIZE (32761) +#define OBM_CHECK (32760) +#define OBM_CHECKBOXES (32759) +#define OBM_CLOSE (32754) +#define OBM_COMBO (32738) +#define OBM_DNARROW (32752) +#define OBM_DNARROWD (32742) +#define OBM_DNARROWI (32736) +#define OBM_LFARROW (32750) +#define OBM_LFARROWI (32734) +#define OBM_LFARROWD (32740) +#define OBM_MNARROW (32739) +#define OBM_OLD_CLOSE (32767) +#define OBM_OLD_DNARROW (32764) +#define OBM_OLD_LFARROW (32762) +#define OBM_OLD_REDUCE (32757) +#define OBM_OLD_RESTORE (32755) +#define OBM_OLD_RGARROW (32763) +#define OBM_OLD_UPARROW (32765) +#define OBM_OLD_ZOOM (32756) +#define OBM_REDUCE (32749) +#define OBM_REDUCED (32746) +#define OBM_RESTORE (32747) +#define OBM_RESTORED (32744) +#define OBM_RGARROW (32751) +#define OBM_RGARROWD (32741) +#define OBM_RGARROWI (32735) +#define OBM_SIZE (32766) +#define OBM_UPARROW (32753) +#define OBM_UPARROWD (32743) +#define OBM_UPARROWI (32737) +#define OBM_ZOOM (32748) +#define OBM_ZOOMD (32745) + +/* LoadLibraryEx */ +#define DONT_RESOLVE_DLL_REFERENCES (1) +#define LOAD_LIBRARY_AS_DATAFILE (2) +#define LOAD_WITH_ALTERED_SEARCH_PATH (8) + +/* LocalAlloc, LocalFlags */ +#define LPTR (64) +#define LHND (66) +#define NONZEROLHND (2) +#define NONZEROLPTR (0) +#define LMEM_NONZEROLHND (2) +#define LMEM_NONZEROLPTR (0) +#define LMEM_FIXED (0) +#define LMEM_MOVEABLE (2) +#define LMEM_NOCOMPACT (16) +#define LMEM_NODISCARD (32) +#define LMEM_ZEROINIT (64) +#define LMEM_MODIFY (128) +#define LMEM_LOCKCOUNT (255) +#define LMEM_DISCARDABLE (3840) +#define LMEM_DISCARDED (16384) +#define LMEM_INVALID_HANDLE (32768) + +/* LockFileEx */ +#define LOCKFILE_FAIL_IMMEDIATELY (1) +#define LOCKFILE_EXCLUSIVE_LOCK (2) + +/* LogonUser */ + +/* LZCopy, LZInit, LZRead */ + +/* MessageBeep, MessageBox */ +#define MB_USERICON (0x80L) +#define MB_ICONASTERISK (0x40L) +#define MB_ICONEXCLAMATION (0x30L) +#define MB_ICONWARNING (0x30L) +#define MB_ICONERROR (0x10L) +#define MB_ICONHAND (0x10L) +#define MB_ICONQUESTION (0x20L) +#define MB_OK (0L) +#define MB_ABORTRETRYIGNORE (0x2L) +#define MB_APPLMODAL (0L) +#define MB_DEFAULT_DESKTOP_ONLY (0x20000L) +#define MB_HELP (0x4000L) +#define MB_RIGHT (0x80000L) +#define MB_RTLREADING (0x100000L) +#define MB_TOPMOST (0x40000L) +#define MB_DEFBUTTON1 (0L) +#define MB_DEFBUTTON2 (0x100L) +#define MB_DEFBUTTON3 (0x200L) +#define MB_DEFBUTTON4 (0x300L) +#define MB_ICONINFORMATION (0x40L) +#define MB_ICONSTOP (0x10L) +#define MB_OKCANCEL (0x1L) +#define MB_RETRYCANCEL (0x5L) +#define MB_SERVICE_NOTIFICATION (0x40000L) +#define MB_SETFOREGROUND (0x10000L) +#define MB_SYSTEMMODAL (0x1000L) +#define MB_TASKMODAL (0x2000L) +#define MB_YESNO (0x4L) +#define MB_YESNOCANCEL (0x3L) +#define IDABORT (3) +#define IDCANCEL (2) +#define IDCLOSE (8) +#define IDHELP (9) +#define IDIGNORE (5) +#define IDNO (7) +#define IDOK (1) +#define IDRETRY (4) +#define IDYES (6) + +/* MessageProc */ +#define MSGF_DIALOGBOX (0) +#define MSGF_MENU (2) +#define MSGF_NEXTWINDOW (6) +#define MSGF_SCROLLBAR (5) +#define MSGF_MAINLOOP (8) +#define MSGF_USER (4096) + +/* ModifyWorldTransform */ +#define MWT_IDENTITY (1) +#define MWT_LEFTMULTIPLY (2) +#define MWT_RIGHTMULTIPLY (3) + +/* mouse_event */ +#define MOUSEEVENTF_ABSOLUTE (32768) +#define MOUSEEVENTF_MOVE (1) +#define MOUSEEVENTF_LEFTDOWN (2) +#define MOUSEEVENTF_LEFTUP (4) +#define MOUSEEVENTF_RIGHTDOWN (8) +#define MOUSEEVENTF_RIGHTUP (16) +#define MOUSEEVENTF_MIDDLEDOWN (32) +#define MOUSEEVENTF_MIDDLEUP (64) + +/* MoveFileEx */ +#define MOVEFILE_REPLACE_EXISTING (1) +#define MOVEFILE_COPY_ALLOWED (2) +#define MOVEFILE_DELAY_UNTIL_REBOOT (4) + +/* MsgWaitForMultipleObjects, WaitForMultipleObjectsEx */ +#define WAIT_OBJECT_0 (0L) +#define WAIT_ABANDONED_0 (0x80L) +#define WAIT_TIMEOUT (0x102L) +#define WAIT_IO_COMPLETION (0xc0L) +#define WAIT_ABANDONED (0x80L) +#define WAIT_FAILED (0xffffffffL) +#define MAXIMUM_WAIT_OBJECTS (0x40) +#define MAXIMUM_SUSPEND_COUNT (0x7f) + +/* MultiByteToWideChar */ +#define MB_PRECOMPOSED (1) +#define MB_COMPOSITE (2) +#define MB_ERR_INVALID_CHARS (8) +#define MB_USEGLYPHCHARS (4) + +/* NDdeSetTrustedShare */ + +/* NetAccessCheck */ + +/* NetServerEnum */ + +/* NetServiceControl */ + +/* NetUserEnum */ + +/* OpenProcessToken */ + +/* OpenSCManager */ +#define SC_MANAGER_ALL_ACCESS (0xf003fL) +#define SC_MANAGER_CONNECT (1) +#define SC_MANAGER_CREATE_SERVICE (2) +#define SC_MANAGER_ENUMERATE_SERVICE (4) +#define SC_MANAGER_LOCK (8) +#define SC_MANAGER_QUERY_LOCK_STATUS (16) +#define SC_MANAGER_MODIFY_BOOT_CONFIG (32) + +/* PostMessage */ +#define HWND_BROADCAST ((HWND)0xFFFF) + +/* PrepareTape */ +#define TAPE_FORMAT (0x5L) +#define TAPE_LOAD (0L) +#define TAPE_LOCK (0x3L) +#define TAPE_TENSION (0x2L) +#define TAPE_UNLOAD (0x1L) +#define TAPE_UNLOCK (0x4L) + +/* PropertySheet */ +#define IS_PSREBOOTSYSTEM (3) +#define IS_PSRESTARTWINDOWS (2) + +/* PropSheetPageProc */ +#define PSPCB_CREATE (2) +#define PSPCB_RELEASE (1) + +/* PurgeComm */ +#define PURGE_TXABORT (1) +#define PURGE_RXABORT (2) +#define PURGE_TXCLEAR (4) +#define PURGE_RXCLEAR (8) + +/* QueryServiceObjectSecurity */ +#define OWNER_SECURITY_INFORMATION (0x1L) +#define GROUP_SECURITY_INFORMATION (0x2L) +#define DACL_SECURITY_INFORMATION (0x4L) +#define SACL_SECURITY_INFORMATION (0x8L) + +/* ReadEventLog, ReportEvent */ +#define EVENTLOG_FORWARDS_READ (4) +#define EVENTLOG_BACKWARDS_READ (8) +#define EVENTLOG_SEEK_READ (2) +#define EVENTLOG_SEQUENTIAL_READ (1) +#define EVENTLOG_ERROR_TYPE (1) +#define EVENTLOG_WARNING_TYPE (2) +#define EVENTLOG_INFORMATION_TYPE (4) +#define EVENTLOG_AUDIT_SUCCESS (8) +#define EVENTLOG_AUDIT_FAILURE (16) + +/* RedrawWindow */ +#define RDW_ERASE (4) +#define RDW_FRAME (1024) +#define RDW_INTERNALPAINT (2) +#define RDW_INVALIDATE (1) +#define RDW_NOERASE (32) +#define RDW_NOFRAME (2048) +#define RDW_NOINTERNALPAINT (16) +#define RDW_VALIDATE (8) +#define RDW_ERASENOW (512) +#define RDW_UPDATENOW (256) +#define RDW_ALLCHILDREN (128) +#define RDW_NOCHILDREN (64) + +/* RegCreateKey */ +#define HKEY_CLASSES_ROOT ((HKEY)0x80000000) +#define HKEY_CURRENT_USER ((HKEY)0x80000001) +#define HKEY_LOCAL_MACHINE ((HKEY)0x80000002) +#define HKEY_USERS ((HKEY)0x80000003) +#define HKEY_PERFORMANCE_DATA ((HKEY)0x80000004) +#define HKEY_CURRENT_CONFIG ((HKEY)0x80000005) +#define HKEY_DYN_DATA ((HKEY)0x00000006) + +/* RegCreateKeyEx */ + +/* RegEnumValue */ + +/* RegisterHotKey */ +#define MOD_ALT (1) +#define MOD_CONTROL (2) +#define MOD_SHIFT (4) +#define MOD_WIN (8) +#define IDHOT_SNAPDESKTOP (-2) +#define IDHOT_SNAPWINDOW (-1) + +/* RegNotifyChangeKeyValue */ +#define REG_NOTIFY_CHANGE_NAME (0x1L) +#define REG_NOTIFY_CHANGE_ATTRIBUTES (0x2L) +#define REG_NOTIFY_CHANGE_LAST_SET (0x4L) +#define REG_NOTIFY_CHANGE_SECURITY (0x8L) + +/* ScrollWindowEx */ +#define SW_ERASE (4) +#define SW_INVALIDATE (2) +#define SW_SCROLLCHILDREN (1) + +/* SendMessageTimeout */ +#define SMTO_ABORTIFHUNG (2) +#define SMTO_BLOCK (1) +#define SMTO_NORMAL (0) + +/* SetBkMode */ +#define OPAQUE (2) +#define TRANSPARENT (1) + +/* SetDebugErrorLevel */ +#define SLE_ERROR (1) +#define SLE_MINORERROR (2) +#define SLE_WARNING (3) + +/* SetErrorMode */ +#define SEM_FAILCRITICALERRORS (1) +#define SEM_NOALIGNMENTFAULTEXCEPT (4) +#define SEM_NOGPFAULTERRORBOX (2) +#define SEM_NOOPENFILEERRORBOX (32768) + +/* SetICMMode */ +#define ICM_ON (2) +#define ICM_OFF (1) +#define ICM_QUERY (3) + +/* SetJob */ + +/* Locale Information */ +#define LOCALE_ILANGUAGE (1) +#define LOCALE_SLANGUAGE (2) +#define LOCALE_SENGLANGUAGE (4097) +#define LOCALE_SABBREVLANGNAME (3) +#define LOCALE_SNATIVELANGNAME (4) +#define LOCALE_ICOUNTRY (5) +#define LOCALE_SCOUNTRY (6) +#define LOCALE_SENGCOUNTRY (4098) +#define LOCALE_SABBREVCTRYNAME (7) +#define LOCALE_SNATIVECTRYNAME (8) +#define LOCALE_IDEFAULTLANGUAGE (9) +#define LOCALE_IDEFAULTCOUNTRY (10) +#define LOCALE_IDEFAULTANSICODEPAGE (4100) +#define LOCALE_IDEFAULTCODEPAGE (11) +#define LOCALE_SLIST (12) +#define LOCALE_IMEASURE (13) +#define LOCALE_SDECIMAL (14) +#define LOCALE_STHOUSAND (15) +#define LOCALE_SGROUPING (16) +#define LOCALE_IDIGITS (17) +#define LOCALE_ILZERO (18) +#define LOCALE_INEGNUMBER (4112) +#define LOCALE_SCURRENCY (20) +#define LOCALE_SMONDECIMALSEP (22) +#define LOCALE_SMONTHOUSANDSEP (23) +#define LOCALE_SMONGROUPING (24) +#define LOCALE_ICURRDIGITS (25) +#define LOCALE_ICURRENCY (27) +#define LOCALE_INEGCURR (28) +#define LOCALE_SDATE (29) +#define LOCALE_STIME (30) +#define LOCALE_STIMEFORMAT (4099) +#define LOCALE_SSHORTDATE (31) +#define LOCALE_SLONGDATE (32) +#define LOCALE_IDATE (33) +#define LOCALE_ILDATE (34) +#define LOCALE_ITIME (35) +#define LOCALE_ITLZERO (37) +#define LOCALE_IDAYLZERO (38) +#define LOCALE_IMONLZERO (39) +#define LOCALE_S1159 (40) +#define LOCALE_S2359 (41) +#define LOCALE_ICALENDARTYPE (4105) +#define LOCALE_IOPTIONALCALENDAR (4107) +#define LOCALE_IFIRSTDAYOFWEEK (4108) +#define LOCALE_IFIRSTWEEKOFYEAR (4109) +#define LOCALE_SDAYNAME1 (42) +#define LOCALE_SDAYNAME2 (43) +#define LOCALE_SDAYNAME3 (44) +#define LOCALE_SDAYNAME4 (45) +#define LOCALE_SDAYNAME5 (46) +#define LOCALE_SDAYNAME6 (47) +#define LOCALE_SDAYNAME7 (48) +#define LOCALE_SABBREVDAYNAME1 (49) +#define LOCALE_SABBREVDAYNAME2 (50) +#define LOCALE_SABBREVDAYNAME3 (51) +#define LOCALE_SABBREVDAYNAME4 (52) +#define LOCALE_SABBREVDAYNAME5 (53) +#define LOCALE_SABBREVDAYNAME6 (54) +#define LOCALE_SABBREVDAYNAME7 (55) +#define LOCALE_SMONTHNAME1 (56) +#define LOCALE_SMONTHNAME2 (57) +#define LOCALE_SMONTHNAME3 (58) +#define LOCALE_SMONTHNAME4 (59) +#define LOCALE_SMONTHNAME5 (60) +#define LOCALE_SMONTHNAME6 (61) +#define LOCALE_SMONTHNAME7 (62) +#define LOCALE_SMONTHNAME8 (63) +#define LOCALE_SMONTHNAME9 (64) +#define LOCALE_SMONTHNAME10 (65) +#define LOCALE_SMONTHNAME11 (66) +#define LOCALE_SMONTHNAME12 (67) +#define LOCALE_SMONTHNAME13 (4110) +#define LOCALE_SABBREVMONTHNAME1 (68) +#define LOCALE_SABBREVMONTHNAME2 (69) +#define LOCALE_SABBREVMONTHNAME3 (70) +#define LOCALE_SABBREVMONTHNAME4 (71) +#define LOCALE_SABBREVMONTHNAME5 (72) +#define LOCALE_SABBREVMONTHNAME6 (73) +#define LOCALE_SABBREVMONTHNAME7 (74) +#define LOCALE_SABBREVMONTHNAME8 (75) +#define LOCALE_SABBREVMONTHNAME9 (76) +#define LOCALE_SABBREVMONTHNAME10 (77) +#define LOCALE_SABBREVMONTHNAME11 (78) +#define LOCALE_SABBREVMONTHNAME12 (79) +#define LOCALE_SABBREVMONTHNAME13 (4111) +#define LOCALE_SPOSITIVESIGN (80) +#define LOCALE_SNEGATIVESIGN (81) +#define LOCALE_IPOSSIGNPOSN (82) +#define LOCALE_INEGSIGNPOSN (83) +#define LOCALE_IPOSSYMPRECEDES (84) +#define LOCALE_IPOSSEPBYSPACE (85) +#define LOCALE_INEGSYMPRECEDES (86) +#define LOCALE_INEGSEPBYSPACE (87) +#define LOCALE_NOUSEROVERRIDE (0x80000000) + +/* Calendar Type Information */ +#define CAL_ICALINTVALUE (1) +#define CAL_IYEAROFFSETRANGE (3) +#define CAL_SABBREVDAYNAME1 (14) +#define CAL_SABBREVDAYNAME2 (15) +#define CAL_SABBREVDAYNAME3 (16) +#define CAL_SABBREVDAYNAME4 (17) +#define CAL_SABBREVDAYNAME5 (18) +#define CAL_SABBREVDAYNAME6 (19) +#define CAL_SABBREVDAYNAME7 (20) +#define CAL_SABBREVMONTHNAME1 (34) +#define CAL_SABBREVMONTHNAME2 (35) +#define CAL_SABBREVMONTHNAME3 (36) +#define CAL_SABBREVMONTHNAME4 (37) +#define CAL_SABBREVMONTHNAME5 (38) +#define CAL_SABBREVMONTHNAME6 (39) +#define CAL_SABBREVMONTHNAME7 (40) +#define CAL_SABBREVMONTHNAME8 (41) +#define CAL_SABBREVMONTHNAME9 (42) +#define CAL_SABBREVMONTHNAME10 (43) +#define CAL_SABBREVMONTHNAME11 (44) +#define CAL_SABBREVMONTHNAME12 (45) +#define CAL_SABBREVMONTHNAME13 (46) +#define CAL_SCALNAME (2) +#define CAL_SDAYNAME1 (7) +#define CAL_SDAYNAME2 (8) +#define CAL_SDAYNAME3 (9) +#define CAL_SDAYNAME4 (10) +#define CAL_SDAYNAME5 (11) +#define CAL_SDAYNAME6 (12) +#define CAL_SDAYNAME7 (13) +#define CAL_SERASTRING (4) +#define CAL_SLONGDATE (6) +#define CAL_SMONTHNAME1 (21) +#define CAL_SMONTHNAME2 (22) +#define CAL_SMONTHNAME3 (23) +#define CAL_SMONTHNAME4 (24) +#define CAL_SMONTHNAME5 (25) +#define CAL_SMONTHNAME6 (26) +#define CAL_SMONTHNAME7 (27) +#define CAL_SMONTHNAME8 (28) +#define CAL_SMONTHNAME9 (29) +#define CAL_SMONTHNAME10 (30) +#define CAL_SMONTHNAME11 (31) +#define CAL_SMONTHNAME12 (32) +#define CAL_SMONTHNAME13 (33) +#define CAL_SSHORTDATE (5) + +/* SetProcessWorkingSetSize */ + +/* SetPrinter */ + +/* SetService */ + +/* SetStretchBltMode */ +#define BLACKONWHITE (1) +#define COLORONCOLOR (3) +#define HALFTONE (4) +#define STRETCH_ANDSCANS (1) +#define STRETCH_DELETESCANS (3) +#define STRETCH_HALFTONE (4) +#define STRETCH_ORSCANS (2) +#define WHITEONBLACK (2) + +/* SetSystemCursor */ +#define OCR_NORMAL (32512) +#define OCR_IBEAM (32513) +#define OCR_WAIT (32514) +#define OCR_CROSS (32515) +#define OCR_UP (32516) +#define OCR_SIZE (32640) +#define OCR_ICON (32641) +#define OCR_SIZENWSE (32642) +#define OCR_SIZENESW (32643) +#define OCR_SIZEWE (32644) +#define OCR_SIZENS (32645) +#define OCR_SIZEALL (32646) +#define OCR_NO (32648) +#define OCR_APPSTARTING (32650) + +/* SetTapePosition */ +#define TAPE_ABSOLUTE_BLOCK (0x1L) +#define TAPE_LOGICAL_BLOCK (0x2L) +#define TAPE_REWIND (0L) +#define TAPE_SPACE_END_OF_DATA (0x4L) +#define TAPE_SPACE_FILEMARKS (0x6L) +#define TAPE_SPACE_RELATIVE_BLOCKS (0x5L) +#define TAPE_SPACE_SEQUENTIAL_FMKS (0x7L) +#define TAPE_SPACE_SEQUENTIAL_SMKS (0x9L) +#define TAPE_SPACE_SETMARKS (0x8L) + +/* SetUnhandledExceptionFilter */ +#define EXCEPTION_EXECUTE_HANDLER (1) +#define EXCEPTION_CONTINUE_EXECUTION (-1) +#define EXCEPTION_CONTINUE_SEARCH (0) + +/* SetWindowPos, DeferWindowPos */ +#define HWND_BOTTOM ((HWND)1) +#define HWND_NOTOPMOST ((HWND)-2) +#define HWND_TOP ((HWND)0) +#define HWND_TOPMOST ((HWND)-1) +#define SWP_DRAWFRAME (32) +#define SWP_FRAMECHANGED (32) +#define SWP_HIDEWINDOW (128) +#define SWP_NOACTIVATE (16) +#define SWP_NOCOPYBITS (256) +#define SWP_NOMOVE (2) +#define SWP_NOSIZE (1) +#define SWP_NOREDRAW (8) +#define SWP_NOZORDER (4) +#define SWP_SHOWWINDOW (64) +#define SWP_NOOWNERZORDER (512) +#define SWP_NOREPOSITION (512) +#define SWP_NOSENDCHANGING (1024) + +/* SHAddToRecentDocs */ + +/* SHAppBarMessage */ + +/* SHChangeNotify */ + +/* ShellProc */ +#define HSHELL_ACTIVATESHELLWINDOW (3) +#define HSHELL_GETMINRECT (5) +#define HSHELL_LANGUAGE (8) +#define HSHELL_REDRAW (6) +#define HSHELL_TASKMAN (7) +#define HSHELL_WINDOWACTIVATED (4) +#define HSHELL_WINDOWCREATED (1) +#define HSHELL_WINDOWDESTROYED (2) + +/* SHGetFileInfo */ + +/* SHGetSpecialFolderLocation */ + +/* ShowWindow */ +#define SW_HIDE (0) +#define SW_MAXIMIZE (3) +#define SW_MINIMIZE (6) +#define SW_NORMAL (1) +#define SW_RESTORE (9) +#define SW_SHOW (5) +#define SW_SHOWDEFAULT (10) +#define SW_SHOWMAXIMIZED (3) +#define SW_SHOWMINIMIZED (2) +#define SW_SHOWMINNOACTIVE (7) +#define SW_SHOWNA (8) +#define SW_SHOWNOACTIVATE (4) +#define SW_SHOWNORMAL (1) +#define WPF_RESTORETOMAXIMIZED (2) +#define WPF_SETMINPOSITION (1) + +/* Sleep */ +#define INFINITE 0xFFFFFFFF + +/* SystemParametersInfo */ +#define SPI_GETACCESSTIMEOUT (60) +#define SPI_GETANIMATION (72) +#define SPI_GETBEEP (1) +#define SPI_GETBORDER (5) +#define SPI_GETDEFAULTINPUTLANG (89) +#define SPI_GETDRAGFULLWINDOWS (38) +#define SPI_GETFASTTASKSWITCH (35) +#define SPI_GETFILTERKEYS (50) +#define SPI_GETFONTSMOOTHING (74) +#define SPI_GETGRIDGRANULARITY (18) +#define SPI_GETHIGHCONTRAST (66) +#define SPI_GETICONMETRICS (45) +#define SPI_GETICONTITLELOGFONT (31) +#define SPI_GETICONTITLEWRAP (25) +#define SPI_GETKEYBOARDDELAY (22) +#define SPI_GETKEYBOARDPREF (68) +#define SPI_GETKEYBOARDSPEED (10) +#define SPI_GETLOWPOWERACTIVE (83) +#define SPI_GETLOWPOWERTIMEOUT (79) +#define SPI_GETMENUDROPALIGNMENT (27) +#define SPI_GETMINIMIZEDMETRICS (43) +#define SPI_GETMOUSE (3) +#define SPI_GETMOUSEKEYS (54) +#define SPI_GETMOUSETRAILS (94) +#define SPI_GETNONCLIENTMETRICS (41) +#define SPI_GETPOWEROFFACTIVE (84) +#define SPI_GETPOWEROFFTIMEOUT (80) +#define SPI_GETSCREENREADER (70) +#define SPI_GETSCREENSAVEACTIVE (16) +#define SPI_GETSCREENSAVETIMEOUT (14) +#define SPI_GETSERIALKEYS (62) +#define SPI_GETSHOWSOUNDS (56) +#define SPI_GETSOUNDSENTRY (64) +#define SPI_GETSTICKYKEYS (58) +#define SPI_GETTOGGLEKEYS (52) +#define SPI_GETWINDOWSEXTENSION (92) +#define SPI_GETWORKAREA (48) +#define SPI_ICONHORIZONTALSPACING (13) +#define SPI_ICONVERTICALSPACING (24) +#define SPI_LANGDRIVER (12) +#define SPI_SCREENSAVERRUNNING (97) +#define SPI_SETACCESSTIMEOUT (61) +#define SPI_SETANIMATION (73) +#define SPI_SETBEEP (2) +#define SPI_SETBORDER (6) +#define SPI_SETDEFAULTINPUTLANG (90) +#define SPI_SETDESKPATTERN (21) +#define SPI_SETDESKWALLPAPER (20) +#define SPI_SETDOUBLECLICKTIME (32) +#define SPI_SETDOUBLECLKHEIGHT (30) +#define SPI_SETDOUBLECLKWIDTH (29) +#define SPI_SETDRAGFULLWINDOWS (37) +#define SPI_SETDRAGHEIGHT (77) +#define SPI_SETDRAGWIDTH (76) +#define SPI_SETFASTTASKSWITCH (36) +#define SPI_SETFILTERKEYS (51) +#define SPI_SETFONTSMOOTHING (75) +#define SPI_SETGRIDGRANULARITY (19) +#define SPI_SETHANDHELD (78) +#define SPI_SETHIGHCONTRAST (67) +#define SPI_SETICONMETRICS (46) +#define SPI_SETICONTITLELOGFONT (34) +#define SPI_SETICONTITLEWRAP (26) +#define SPI_SETKEYBOARDDELAY (23) +#define SPI_SETKEYBOARDPREF (69) +#define SPI_SETKEYBOARDSPEED (11) +#define SPI_SETLANGTOGGLE (91) +#define SPI_SETLOWPOWERACTIVE (85) +#define SPI_SETLOWPOWERTIMEOUT (81) +#define SPI_SETMENUDROPALIGNMENT (28) +#define SPI_SETMINIMIZEDMETRICS (44) +#define SPI_SETMOUSE (4) +#define SPI_SETMOUSEBUTTONSWAP (33) +#define SPI_SETMOUSEKEYS (55) +#define SPI_SETMOUSETRAILS (93) +#define SPI_SETNONCLIENTMETRICS (42) +#define SPI_SETPENWINDOWS (49) +#define SPI_SETPOWEROFFACTIVE (86) +#define SPI_SETPOWEROFFTIMEOUT (82) +#define SPI_SETSCREENREADER (71) +#define SPI_SETSCREENSAVEACTIVE (17) +#define SPI_SETSCREENSAVETIMEOUT (15) +#define SPI_SETSERIALKEYS (63) +#define SPI_SETSHOWSOUNDS (57) +#define SPI_SETSOUNDSENTRY (65) +#define SPI_SETSTICKYKEYS (59) +#define SPI_SETTOGGLEKEYS (53) +#define SPI_SETWORKAREA (47) +#define SPIF_UPDATEINIFILE (1) +#define SPIF_SENDWININICHANGE (2) +#define SPIF_SENDCHANGE (2) + +/* TrackPopupMenu, TrackPopMenuEx */ +#define TPM_CENTERALIGN (0x4L) +#define TPM_LEFTALIGN (0L) +#define TPM_RIGHTALIGN (0x8L) +#define TPM_LEFTBUTTON (0L) +#define TPM_RIGHTBUTTON (0x2L) +#define TPM_HORIZONTAL (0L) +#define TPM_VERTICAL (0x40L) + +/* TranslateCharsetInfo */ +#define TCI_SRCCHARSET (1) +#define TCI_SRCCODEPAGE (2) +#define TCI_SRCFONTSIG (3) + +/* VerFindFile */ +#define VFFF_ISSHAREDFILE (1) +#define VFF_CURNEDEST (1) +#define VFF_FILEINUSE (2) +#define VFF_BUFFTOOSMALL (4) + +/* VerInstallFile */ +#define VIFF_FORCEINSTALL (1) +#define VIFF_DONTDELETEOLD (2) +#define VIF_TEMPFILE (0x1L) +#define VIF_MISMATCH (0x2L) +#define VIF_SRCOLD (0x4L) +#define VIF_DIFFLANG (0x8L) +#define VIF_DIFFCODEPG (0x10L) +#define VIF_DIFFTYPE (0x20L) +#define VIF_WRITEPROT (0x40L) +#define VIF_FILEINUSE (0x80L) +#define VIF_OUTOFSPACE (0x100L) +#define VIF_ACCESSVIOLATION (0x200L) +#define VIF_SHARINGVIOLATION (0x400L) +#define VIF_CANNOTCREATE (0x800L) +#define VIF_CANNOTDELETE (0x1000L) +#define VIF_CANNOTDELETECUR (0x4000L) +#define VIF_CANNOTRENAME (0x2000L) +#define VIF_OUTOFMEMORY (0x8000L) +#define VIF_CANNOTREADSRC (0x10000L) +#define VIF_CANNOTREADDST (0x20000L) +#define VIF_BUFFTOOSMALL (0x40000L) + +/* WideCharToMultiByte */ +#define WC_COMPOSITECHECK (512) +#define WC_DISCARDNS (16) +#define WC_SEPCHARS (32) +#define WC_DEFAULTCHAR (64) + +/* WinHelp */ +#define HELP_COMMAND (0x102L) +#define HELP_CONTENTS (0x3L) +#define HELP_CONTEXT (0x1L) +#define HELP_CONTEXTPOPUP (0x8L) +#define HELP_FORCEFILE (0x9L) +#define HELP_HELPONHELP (0x4L) +#define HELP_INDEX (0x3L) +#define HELP_KEY (0x101L) +#define HELP_MULTIKEY (0x201L) +#define HELP_SETWINPOS (0x0203L) +#define HELP_PARTIALKEY (0x105L) +#define HELP_QUIT (0x2L) +#define HELP_SETCONTENTS (0x5L) +#define HELP_SETINDEX (0x5L) +#define HELP_CONTEXTMENU (0xa) +#define HELP_FINDER (0xb) +#define HELP_WM_HELP (0xc) +#define HELP_TCARD (0x8000) +#define HELP_TCARD_DATA (0x10) +#define HELP_TCARD_OTHER_CALLER (0x11) + +/* WNetAddConnectino2 */ +#define CONNECT_UPDATE_PROFILE (1) + +/* WNetConnectionDialog, WNetDisconnectDialog, WNetOpenEnum */ +#define RESOURCETYPE_DISK (1) +#define RESOURCETYPE_PRINT (2) +#define RESOURCETYPE_ANY (0) +#define RESOURCE_CONNECTED (1) +#define RESOURCE_GLOBALNET (2) +#define RESOURCE_REMEMBERED (3) +#define RESOURCEUSAGE_CONNECTABLE (1) +#define RESOURCEUSAGE_CONTAINER (2) + +/* WNetGetResourceInformation, WNetGetResourceParent */ +#define WN_BAD_NETNAME (0x43L) +#define WN_EXTENDED_ERROR (0x4b8L) +#define WN_MORE_DATA (0xeaL) +#define WN_NO_NETWORK (0x4c6L) +#define WN_SUCCESS (0L) +#define WN_ACCESS_DENIED (0x5L) +#define WN_BAD_PROVIDER (0x4b4L) +#define WN_NOT_AUTHENTICATED (0x4dcL) + +/* WNetGetUniversalName */ +#define UNIVERSAL_NAME_INFO_LEVEL (1) +#define REMOTE_NAME_INFO_LEVEL (2) + +/* GetExitCodeThread */ +#define STILL_ACTIVE (0x103L) + +/* COMMPROP structure */ +#define SP_SERIALCOMM (0x1L) +#define BAUD_075 (0x1L) +#define BAUD_110 (0x2L) +#define BAUD_134_5 (0x4L) +#define BAUD_150 (0x8L) +#define BAUD_300 (0x10L) +#define BAUD_600 (0x20L) +#define BAUD_1200 (0x40L) +#define BAUD_1800 (0x80L) +#define BAUD_2400 (0x100L) +#define BAUD_4800 (0x200L) +#define BAUD_7200 (0x400L) +#define BAUD_9600 (0x800L) +#define BAUD_14400 (0x1000L) +#define BAUD_19200 (0x2000L) +#define BAUD_38400 (0x4000L) +#define BAUD_56K (0x8000L) +#define BAUD_57600 (0x40000L) +#define BAUD_115200 (0x20000L) +#define BAUD_128K (0x10000L) +#define BAUD_USER (0x10000000L) +#define PST_FAX (0x21L) +#define PST_LAT (0x101L) +#define PST_MODEM (0x6L) +#define PST_NETWORK_BRIDGE (0x100L) +#define PST_PARALLELPORT (0x2L) +#define PST_RS232 (0x1L) +#define PST_RS422 (0x3L) +#define PST_RS423 (0x4L) +#define PST_RS449 (0x5L) +#define PST_SCANNER (0x22L) +#define PST_TCPIP_TELNET (0x102L) +#define PST_UNSPECIFIED (0L) +#define PST_X25 (0x103L) +#define PCF_16BITMODE (0x200L) +#define PCF_DTRDSR (0x1L) +#define PCF_INTTIMEOUTS (0x80L) +#define PCF_PARITY_CHECK (0x8L) +#define PCF_RLSD (0x4L) +#define PCF_RTSCTS (0x2L) +#define PCF_SETXCHAR (0x20L) +#define PCF_SPECIALCHARS (0x100L) +#define PCF_TOTALTIMEOUTS (0x40L) +#define PCF_XONXOFF (0x10L) +#define SP_BAUD (0x2L) +#define SP_DATABITS (0x4L) +#define SP_HANDSHAKING (0x10L) +#define SP_PARITY (0x1L) +#define SP_PARITY_CHECK (0x20L) +#define SP_RLSD (0x40L) +#define SP_STOPBITS (0x8L) +#define DATABITS_5 (1) +#define DATABITS_6 (2) +#define DATABITS_7 (4) +#define DATABITS_8 (8) +#define DATABITS_16 (16) +#define DATABITS_16X (32) +#define STOPBITS_10 (1) +#define STOPBITS_15 (2) +#define STOPBITS_20 (4) +#define PARITY_NONE (256) +#define PARITY_ODD (512) +#define PARITY_EVEN (1024) +#define PARITY_MARK (2048) +#define PARITY_SPACE (4096) +#define COMMPROP_INITIALIZED (0xe73cf52eL) + +/* DCB structure */ +#define CBR_110 (110) +#define CBR_300 (300) +#define CBR_600 (600) +#define CBR_1200 (1200) +#define CBR_2400 (2400) +#define CBR_4800 (4800) +#define CBR_9600 (9600) +#define CBR_14400 (14400) +#define CBR_19200 (19200) +#define CBR_38400 (38400) +#define CBR_56000 (56000) +#define CBR_57600 (57600) +#define CBR_115200 (115200) +#define CBR_128000 (128000) +#define CBR_256000 (256000) +#define DTR_CONTROL_DISABLE (0) +#define DTR_CONTROL_ENABLE (1) +#define DTR_CONTROL_HANDSHAKE (2) +#define RTS_CONTROL_DISABLE (0) +#define RTS_CONTROL_ENABLE (1) +#define RTS_CONTROL_HANDSHAKE (2) +#define RTS_CONTROL_TOGGLE (3) +#define EVENPARITY (2) +#define MARKPARITY (3) +#define NOPARITY (0) +#define ODDPARITY (1) +#define SPACEPARITY (4) +#define ONESTOPBIT (0) +#define ONE5STOPBITS (1) +#define TWOSTOPBITS (2) + +/* Debugging events */ +#define CREATE_PROCESS_DEBUG_EVENT (3) +#define CREATE_THREAD_DEBUG_EVENT (2) +#define EXCEPTION_DEBUG_EVENT (1) +#define EXIT_PROCESS_DEBUG_EVENT (5) +#define EXIT_THREAD_DEBUG_EVENT (4) +#define LOAD_DLL_DEBUG_EVENT (6) +#define OUTPUT_DEBUG_STRING_EVENT (8) +#define UNLOAD_DLL_DEBUG_EVENT (7) +#define RIP_EVENT (9) + +/* PROCESS_HEAP_ENTRY structure */ +#define PROCESS_HEAP_REGION (1) +#define PROCESS_HEAP_UNCOMMITTED_RANGE (2) +#define PROCESS_HEAP_ENTRY_BUSY (4) +#define PROCESS_HEAP_ENTRY_MOVEABLE (16) +#define PROCESS_HEAP_ENTRY_DDESHARE (32) + +/* Win32s */ +#define HINSTANCE_ERROR (32) + +/* WIN32_STREAM_ID structure */ +#define BACKUP_DATA (1) +#define BACKUP_EA_DATA (2) +#define BACKUP_SECURITY_DATA (3) +#define BACKUP_ALTERNATE_DATA (4) +#define BACKUP_LINK (5) +#define STREAM_MODIFIED_WHEN_READ (1) +#define STREAM_CONTAINS_SECURITY (2) + +/* STARTUPINFO structure */ +#define STARTF_USESHOWWINDOW (1) +#define STARTF_USEPOSITION (4) +#define STARTF_USESIZE (2) +#define STARTF_USECOUNTCHARS (8) +#define STARTF_USEFILLATTRIBUTE (16) +#define STARTF_RUNFULLSCREEN (32) +#define STARTF_FORCEONFEEDBACK (64) +#define STARTF_FORCEOFFFEEDBACK (128) +#define STARTF_USESTDHANDLES (256) +#define STARTF_USEHOTKEY (512) + +/* OSVERSIONINFO structure */ +#define VER_PLATFORM_WIN32s (0) +#define VER_PLATFORM_WIN32_WINDOWS (1) +#define VER_PLATFORM_WIN32_NT (2) + +/* PROPSHEETPAGE structure */ +#define MAXPROPPAGES (100) +#define PSP_DEFAULT (0) +#define PSP_DLGINDIRECT (1) +#define PSP_HASHELP (32) +#define PSP_USECALLBACK (128) +#define PSP_USEHICON (2) +#define PSP_USEICONID (4) +#define PSP_USEREFPARENT (64) +#define PSP_USETITLE (8) +#define PSP_RTLREADING (16) + +/* PROPSHEETHEADER structure */ +#define PSH_DEFAULT (0) +#define PSH_HASHELP (512) +#define PSH_MODELESS (1024) +#define PSH_NOAPPLYNOW (128) +#define PSH_PROPSHEETPAGE (8) +#define PSH_PROPTITLE (1) +#define PSH_USECALLBACK (256) +#define PSH_USEHICON (2) +#define PSH_USEICONID (4) +#define PSH_USEPSTARTPAGE (64) +#define PSH_WIZARD (32) +#define PSH_RTLREADING (2048) +#define PSCB_INITIALIZED (1) +#define PSCB_PRECREATE (2) + +/* PSN_APPLY message */ +#define PSNRET_NOERROR (0) +#define PSNRET_INVALID_NOCHANGEPAGE (2) + +/* Property Sheet */ +#define PSBTN_APPLYNOW (4) +#define PSBTN_BACK (0) +#define PSBTN_CANCEL (5) +#define PSBTN_FINISH (2) +#define PSBTN_HELP (6) +#define PSBTN_NEXT (1) +#define PSBTN_OK (3) +#define PSWIZB_BACK (1) +#define PSWIZB_NEXT (2) +#define PSWIZB_FINISH (4) +#define PSWIZB_DISABLEDFINISH (8) +#define ID_PSREBOOTSYSTEM (3) +#define ID_PSRESTARTWINDOWS (2) +#define WIZ_BODYCX (184) +#define WIZ_BODYX (92) +#define WIZ_CXBMP (80) +#define WIZ_CXDLG (276) +#define WIZ_CYDLG (140) + +/* VX_FIXEDFILEINFO structure */ +#define VS_FILE_INFO (MAKEINTRESOURCE(16)) +#define VS_VERSION_INFO (1) +#define VS_FF_DEBUG (0x1L) +#define VS_FF_INFOINFERRED (0x10L) +#define VS_FF_PATCHED (0x4L) +#define VS_FF_PRERELEASE (0x2L) +#define VS_FF_PRIVATEBUILD (0x8L) +#define VS_FF_SPECIALBUILD (0x20L) +#define VOS_UNKNOWN (0L) +#define VOS_DOS (0x10000L) +#define VOS_OS216 (0x20000L) +#define VOS_OS232 (0x30000L) +#define VOS_NT (0x40000L) +#define VOS_DOS_WINDOWS16 (0x10001L) +#define VOS_DOS_WINDOWS32 (0x10004L) +#define VOS_OS216_PM16 (0x20002L) +#define VOS_OS232_PM32 (0x30003L) +#define VOS_NT_WINDOWS32 (0x40004L) +#define VFT_UNKNOWN (0L) +#define VFT_APP (0x1L) +#define VFT_DLL (0x2L) +#define VFT_DRV (0x3L) +#define VFT_FONT (0x4L) +#define VFT_VXD (0x5L) +#define VFT_STATIC_LIB (0x7L) +#define VFT2_UNKNOWN (0L) +#define VFT2_DRV_PRINTER (0x1L) +#define VFT2_DRV_KEYBOARD (0x2L) +#define VFT2_DRV_LANGUAGE (0x3L) +#define VFT2_DRV_DISPLAY (0x4L) +#define VFT2_DRV_MOUSE (0x5L) +#define VFT2_DRV_NETWORK (0x6L) +#define VFT2_DRV_SYSTEM (0x7L) +#define VFT2_DRV_INSTALLABLE (0x8L) +#define VFT2_DRV_SOUND (0x9L) +#define VFT2_FONT_RASTER (0x1L) +#define VFT2_FONT_VECTOR (0x2L) +#define VFT2_FONT_TRUETYPE (0x3L) + +/* PANOSE structure */ +#define PAN_ANY (0) +#define PAN_NO_FIT (1) +#define PAN_FAMILY_TEXT_DISPLAY (2) +#define PAN_FAMILY_SCRIPT (3) +#define PAN_FAMILY_DECORATIVE (4) +#define PAN_FAMILY_PICTORIAL (5) +#define PAN_SERIF_COVE (2) +#define PAN_SERIF_OBTUSE_COVE (3) +#define PAN_SERIF_SQUARE_COVE (4) +#define PAN_SERIF_OBTUSE_SQUARE_COVE (5) +#define PAN_SERIF_SQUARE (6) +#define PAN_SERIF_THIN (7) +#define PAN_SERIF_BONE (8) +#define PAN_SERIF_EXAGGERATED (9) +#define PAN_SERIF_TRIANGLE (10) +#define PAN_SERIF_NORMAL_SANS (11) +#define PAN_SERIF_OBTUSE_SANS (12) +#define PAN_SERIF_PERP_SANS (13) +#define PAN_SERIF_FLARED (14) +#define PAN_SERIF_ROUNDED (15) +#define PAN_WEIGHT_VERY_LIGHT (2) +#define PAN_WEIGHT_LIGHT (3) +#define PAN_WEIGHT_THIN (4) +#define PAN_WEIGHT_BOOK (5) +#define PAN_WEIGHT_MEDIUM (6) +#define PAN_WEIGHT_DEMI (7) +#define PAN_WEIGHT_BOLD (8) +#define PAN_WEIGHT_HEAVY (9) +#define PAN_WEIGHT_BLACK (10) +#define PAN_WEIGHT_NORD (11) +#define PAN_PROP_OLD_STYLE (2) +#define PAN_PROP_MODERN (3) +#define PAN_PROP_EVEN_WIDTH (4) +#define PAN_PROP_EXPANDED (5) +#define PAN_PROP_CONDENSED (6) +#define PAN_PROP_VERY_EXPANDED (7) +#define PAN_PROP_VERY_CONDENSED (8) +#define PAN_PROP_MONOSPACED (9) +#define PAN_CONTRAST_NONE (2) +#define PAN_CONTRAST_VERY_LOW (3) +#define PAN_CONTRAST_LOW (4) +#define PAN_CONTRAST_MEDIUM_LOW (5) +#define PAN_CONTRAST_MEDIUM (6) +#define PAN_CONTRAST_MEDIUM_HIGH (7) +#define PAN_CONTRAST_HIGH (8) +#define PAN_CONTRAST_VERY_HIGH (9) +#define PAN_STROKE_GRADUAL_DIAG (2) +#define PAN_STROKE_GRADUAL_TRAN (3) +#define PAN_STROKE_GRADUAL_VERT (4) +#define PAN_STROKE_GRADUAL_HORZ (5) +#define PAN_STROKE_RAPID_VERT (6) +#define PAN_STROKE_RAPID_HORZ (7) +#define PAN_STROKE_INSTANT_VERT (8) +#define PAN_STRAIGHT_ARMS_HORZ (2) +#define PAN_STRAIGHT_ARMS_WEDGE (3) +#define PAN_STRAIGHT_ARMS_VERT (4) +#define PAN_STRAIGHT_ARMS_SINGLE_SERIF (5) +#define PAN_STRAIGHT_ARMS_DOUBLE_SERIF (6) +#define PAN_BENT_ARMS_HORZ (7) +#define PAN_BENT_ARMS_VERT (9) +#define PAN_BENT_ARMS_WEDGE (8) +#define PAN_BENT_ARMS_SINGLE_SERIF (10) +#define PAN_BENT_ARMS_DOUBLE_SERIF (11) +#define PAN_LETT_NORMAL_CONTACT (2) +#define PAN_LETT_NORMAL_WEIGHTED (3) +#define PAN_LETT_NORMAL_BOXED (4) +#define PAN_LETT_NORMAL_FLATTENED (5) +#define PAN_LETT_NORMAL_ROUNDED (6) +#define PAN_LETT_NORMAL_OFF_CENTER (7) +#define PAN_LETT_NORMAL_SQUARE (8) +#define PAN_LETT_OBLIQUE_CONTACT (9) +#define PAN_LETT_OBLIQUE_WEIGHTED (10) +#define PAN_LETT_OBLIQUE_BOXED (11) +#define PAN_LETT_OBLIQUE_FLATTENED (12) +#define PAN_LETT_OBLIQUE_ROUNDED (13) +#define PAN_LETT_OBLIQUE_OFF_CENTER (14) +#define PAN_LETT_OBLIQUE_SQUARE (15) +#define PAN_MIDLINE_STANDARD_TRIMMED (2) +#define PAN_MIDLINE_STANDARD_POINTED (3) +#define PAN_MIDLINE_STANDARD_SERIFED (4) +#define PAN_MIDLINE_HIGH_TRIMMED (5) +#define PAN_MIDLINE_HIGH_POINTED (6) +#define PAN_MIDLINE_HIGH_SERIFED (7) +#define PAN_MIDLINE_CONSTANT_TRIMMED (8) +#define PAN_MIDLINE_CONSTANT_POINTED (9) +#define PAN_MIDLINE_CONSTANT_SERIFED (10) +#define PAN_MIDLINE_LOW_TRIMMED (11) +#define PAN_MIDLINE_LOW_POINTED (12) +#define PAN_MIDLINE_LOW_SERIFED (13) +#define PAN_XHEIGHT_CONSTANT_SMALL (2) +#define PAN_XHEIGHT_CONSTANT_STD (3) +#define PAN_XHEIGHT_CONSTANT_LARGE (4) +#define PAN_XHEIGHT_DUCKING_SMALL (5) +#define PAN_XHEIGHT_DUCKING_STD (6) +#define PAN_XHEIGHT_DUCKING_LARGE (7) + +/* PALETTENTRY structure */ +#define PC_EXPLICIT (2) +#define PC_NOCOLLAPSE (4) +#define PC_RESERVED (1) + +/* LOGBRUSH structure */ +#define BS_DIBPATTERN (5) +#define BS_DIBPATTERN8X8 (8) +#define BS_DIBPATTERNPT (6) +#define BS_HATCHED (2) +#define BS_HOLLOW (1) +#define BS_NULL (1) +#define BS_PATTERN (3) +#define BS_PATTERN8X8 (7) +#define BS_SOLID (0) + +/* DEVMODE structure */ +#define DM_ORIENTATION (0x1L) +#define DM_PAPERSIZE (0x2L) +#define DM_PAPERLENGTH (0x4L) +#define DM_PAPERWIDTH (0x8L) +#define DM_SCALE (0x10L) +#define DM_COPIES (0x100L) +#define DM_DEFAULTSOURCE (0x200L) +#define DM_PRINTQUALITY (0x400L) +#define DM_COLOR (0x800L) +#define DM_DUPLEX (0x1000L) +#define DM_YRESOLUTION (0x2000L) +#define DM_TTOPTION (0x4000L) +#define DM_COLLATE (0x8000L) +#define DM_FORMNAME (0x10000L) +#define DM_LOGPIXELS (0x20000L) +#define DM_BITSPERPEL (0x40000L) +#define DM_PELSWIDTH (0x80000L) +#define DM_PELSHEIGHT (0x100000L) +#define DM_DISPLAYFLAGS (0x200000L) +#define DM_DISPLAYFREQUENCY (0x400000L) +#define DM_ICMMETHOD (0x800000L) +#define DM_ICMINTENT (0x1000000L) +#define DM_MEDIATYPE (0x2000000L) +#define DM_DITHERTYPE (0x4000000L) +#define DMORIENT_LANDSCAPE (2) +#define DMORIENT_PORTRAIT (1) +#define DMPAPER_LETTER (1) +#define DMPAPER_LEGAL (5) +#define DMPAPER_A4 (9) +#define DMPAPER_CSHEET (24) +#define DMPAPER_DSHEET (25) +#define DMPAPER_ESHEET (26) +#define DMPAPER_LETTERSMALL (2) +#define DMPAPER_TABLOID (3) +#define DMPAPER_LEDGER (4) +#define DMPAPER_STATEMENT (6) +#define DMPAPER_EXECUTIVE (7) +#define DMPAPER_A3 (8) +#define DMPAPER_A4SMALL (10) +#define DMPAPER_A5 (11) +#define DMPAPER_B4 (12) +#define DMPAPER_B5 (13) +#define DMPAPER_FOLIO (14) +#define DMPAPER_QUARTO (15) +#define DMPAPER_10X14 (16) +#define DMPAPER_11X17 (17) +#define DMPAPER_NOTE (18) +#define DMPAPER_ENV_9 (19) +#define DMPAPER_ENV_10 (20) +#define DMPAPER_ENV_11 (21) +#define DMPAPER_ENV_12 (22) +#define DMPAPER_ENV_14 (23) +#define DMPAPER_ENV_DL (27) +#define DMPAPER_ENV_C5 (28) +#define DMPAPER_ENV_C3 (29) +#define DMPAPER_ENV_C4 (30) +#define DMPAPER_ENV_C6 (31) +#define DMPAPER_ENV_C65 (32) +#define DMPAPER_ENV_B4 (33) +#define DMPAPER_ENV_B5 (34) +#define DMPAPER_ENV_B6 (35) +#define DMPAPER_ENV_ITALY (36) +#define DMPAPER_ENV_MONARCH (37) +#define DMPAPER_ENV_PERSONAL (38) +#define DMPAPER_FANFOLD_US (39) +#define DMPAPER_FANFOLD_STD_GERMAN (40) +#define DMPAPER_FANFOLD_LGL_GERMAN (41) +#define DMRES_HIGH (-4) +#define DMRES_MEDIUM (-3) +#define DMRES_LOW (-2) +#define DMRES_DRAFT (-1) +#define DMCOLOR_COLOR (2) +#define DMCOLOR_MONOCHROME (1) +#define DMDUP_SIMPLEX (1) +#define DMDUP_HORIZONTAL (3) +#define DMDUP_VERTICAL (2) +#define DMTT_BITMAP (1) +#define DMTT_DOWNLOAD (2) +#define DMTT_SUBDEV (3) +#define DMCOLLATE_TRUE (1) +#define DMCOLLATE_FALSE (0) +#define DM_GRAYSCALE (1) +#define DM_INTERLACED (2) +#define DMICMMETHOD_NONE (1) +#define DMICMMETHOD_SYSTEM (2) +#define DMICMMETHOD_DRIVER (3) +#define DMICMMETHOD_DEVICE (4) +#define DMICMMETHOD_USER (256) +#define DMICM_SATURATE (1) +#define DMICM_CONTRAST (2) +#define DMICM_COLORMETRIC (3) +#define DMICM_USER (256) +#define DMMEDIA_STANDARD (1) +#define DMMEDIA_GLOSSY (3) +#define DMMEDIA_TRANSPARENCY (2) +#define DMMEDIA_USER (256) +#define DMDITHER_NONE (1) +#define DMDITHER_COARSE (2) +#define DMDITHER_FINE (3) +#define DMDITHER_LINEART (4) +#define DMDITHER_GRAYSCALE (10) +#define DMDITHER_USER (256) + +/* RGNDATAHEADER structure */ +#define RDH_RECTANGLES (1) + +/* TTPOLYGONHEADER structure */ +#define TT_POLYGON_TYPE (24) + +/* TTPOLYCURVE structure */ +#define TT_PRIM_LINE (1) +#define TT_PRIM_QSPLINE (2) + +/* GCP_RESULTS structure */ +#define GCPCLASS_ARABIC (2) +#define GCPCLASS_HEBREW (2) +#define GCPCLASS_LATIN (1) +#define GCPCLASS_LATINNUMBER (5) +#define GCPCLASS_LOCALNUMBER (4) +#define GCPCLASS_LATINNUMERICSEPARATOR (7) +#define GCPCLASS_LATINNUMERICTERMINATOR (6) +#define GCPCLASS_NEUTRAL (3) +#define GCPCLASS_NUMERICSEPARATOR (8) +#define GCPCLASS_PREBOUNDLTR (128) +#define GCPCLASS_PREBOUNDRTL (64) +#define GCPCLASS_POSTBOUNDLTR (32) +#define GCPCLASS_POSTBOUNDRTL (16) +#define GCPGLYPH_LINKBEFORE (32768) +#define GCPGLYPH_LINKAFTER (16384) + +/* RASTERIZER_STATUS structure */ +#define TT_AVAILABLE (1) +#define TT_ENABLED (2) + +/* COLORADJUSTMENT structure */ +#define CA_NEGATIVE (1) +#define CA_LOG_FILTER (2) +#define ILLUMINANT_DEVICE_DEFAULT (0) +#define ILLUMINANT_A (1) +#define ILLUMINANT_B (2) +#define ILLUMINANT_C (3) +#define ILLUMINANT_D50 (4) +#define ILLUMINANT_D55 (5) +#define ILLUMINANT_D65 (6) +#define ILLUMINANT_D75 (7) +#define ILLUMINANT_F2 (8) +#define ILLUMINANT_TUNGSTEN (1) +#define ILLUMINANT_DAYLIGHT (3) +#define ILLUMINANT_FLUORESCENT (8) +#define ILLUMINANT_NTSC (3) + +/* DOCINFO structure */ +#define DI_APPBANDING (1) + +/* EMRMETAHEADER structure */ +#define EMR_HEADER (1) +#define ENHMETA_SIGNATURE (1179469088) + +/* RTF event masks */ +#define ENM_CHANGE (1) +#define ENM_CORRECTTEXT (4194304) +#define ENM_DROPFILES (1048576) +#define ENM_KEYEVENTS (65536) +#define ENM_MOUSEEVENTS (131072) +#define ENM_PROTECTED (2097152) +#define ENM_REQUESTRESIZE (262144) +#define ENM_SCROLL (4) +#define ENM_SELCHANGE (524288) +#define ENM_UPDATE (2) +#define ENM_NONE (0) + +/* RTF styles */ +#define ES_DISABLENOSCROLL (8192) +#define ES_EX_NOCALLOLEINIT (16777216) +#define ES_NOIME (524288) +#define ES_SAVESEL (32768) +#define ES_SELFIME (262144) +#define ES_SUNKEN (16384) +#define ES_VERTICAL (4194304) +#define ES_SELECTIONBAR (16777216) + +/* EM_SETOPTIONS message */ +#define ECOOP_SET (1) +#define ECOOP_OR (2) +#define ECOOP_AND (3) +#define ECOOP_XOR (4) +#define ECO_AUTOWORDSELECTION (1) +#define ECO_AUTOVSCROLL (64) +#define ECO_AUTOHSCROLL (128) +#define ECO_NOHIDESEL (256) +#define ECO_READONLY (2048) +#define ECO_WANTRETURN (4096) +#define ECO_SAVESEL (32768) +#define ECO_SELECTIONBAR (16777216) +#define ECO_VERTICAL (4194304) + +/* EM_SETCHARFORMAT message */ +#define SCF_WORD (2) +#define SCF_SELECTION (1) + +/* EM_STREAMOUT message */ +#define SF_TEXT (1) +#define SF_RTF (2) +#define SF_RTFNOOBJS (3) +#define SF_TEXTIZED (4) +#define SFF_SELECTION (32768) +#define SFF_PLAINRTF (16384) + +/* EM_FINDWORDBREAK message */ +#define WB_CLASSIFY (3) +#define WB_ISDELIMITER (2) +#define WB_LEFT (0) +#define WB_LEFTBREAK (6) +#define WB_PREVBREAK (6) +#define WB_MOVEWORDLEFT (4) +#define WB_MOVEWORDPREV (4) +#define WB_MOVEWORDRIGHT (5) +#define WB_MOVEWORDNEXT (5) +#define WB_RIGHT (1) +#define WB_RIGHTBREAK (7) +#define WB_NEXTBREAK (7) + +/* EM_GETPUNCTUATION message */ +#define PC_LEADING (2) +#define PC_FOLLOWING (1) +#define PC_DELIMITER (4) +#define PC_OVERFLOW (3) + +/* EM_SETWORDWRAPMODE message */ +#define WBF_WORDWRAP (16) +#define WBF_WORDBREAK (32) +#define WBF_OVERFLOW (64) +#define WBF_LEVEL1 (128) +#define WBF_LEVEL2 (256) +#define WBF_CUSTOM (512) +#define WBF_BREAKAFTER (64) +#define WBF_BREAKLINE (32) +#define WBF_ISWHITE (16) + +/* CHARFORMAT structure */ +#define CFM_BOLD (1) +#define CFM_COLOR (1073741824) +#define CFM_FACE (536870912) +#define CFM_ITALIC (2) +#define CFM_OFFSET (268435456) +#define CFM_PROTECTED (16) +#define CFM_SIZE (0x80000000) +#define CFM_STRIKEOUT (8) +#define CFM_UNDERLINE (4) +#define CFE_AUTOCOLOR (1073741824) +#define CFE_BOLD (1) +#define CFE_ITALIC (2) +#define CFE_STRIKEOUT (8) +#define CFE_UNDERLINE (4) +#define CFE_PROTECTED (16) + +/* PARAFORMAT structure */ +#define PFM_ALIGNMENT (8) +#define PFM_NUMBERING (32) +#define PFM_OFFSET (4) +#define PFM_OFFSETINDENT (0x80000000) +#define PFM_RIGHTINDENT (2) +#define PFM_STARTINDENT (1) +#define PFM_TABSTOPS (16) +#define PFN_BULLET (1) +#define PFA_LEFT (1) +#define PFA_RIGHT (2) +#define PFA_CENTER (3) + +/* SELCHANGE structure */ +#define SEL_EMPTY (0) +#define SEL_TEXT (1) +#define SEL_OBJECT (2) +#define SEL_MULTICHAR (4) +#define SEL_MULTIOBJECT (8) + +/* RTF clipboard formats */ +#define CF_RTF "Rich Text Format" +#define CF_RETEXTOBJ "RichEdit Text and Objects" + +/* DRAWITEMSTRUCT structure */ +#define ODT_BUTTON (4) +#define ODT_COMBOBOX (3) +#define ODT_LISTBOX (2) +#define ODT_LISTVIEW (102) +#define ODT_MENU (1) +#define ODT_STATIC (5) +#define ODT_TAB (101) +#define ODT_HEADER (100) +#define ODA_DRAWENTIRE (1) +#define ODA_FOCUS (4) +#define ODA_SELECT (2) +#define ODS_CHECKED (8) +#define ODS_COMBOBOXEDIT (4096) +#define ODS_DEFAULT (32) +#define ODS_DISABLED (4) +#define ODS_FOCUS (16) +#define ODS_GRAYED (2) +#define ODS_SELECTED (1) + +/* Common control window classes */ +#define ANIMATE_CLASSW L"SysAnimate32" +#define HOTKEY_CLASSW L"msctls_hotkey32" +#define PROGRESS_CLASSW L"msctls_progress32" +#define STATUSCLASSNAMEW L"msctls_statusbar32" +#define TOOLBARCLASSNAMEW L"ToolbarWindow32" +#define TOOLTIPS_CLASSW L"tooltips_class32" +#define TRACKBAR_CLASSW L"msctls_trackbar32" +#define UPDOWN_CLASSW L"msctls_updown32" +#define WC_HEADERW L"SysHeader32" +#define WC_LISTVIEWW L"SysListView32" +#define WC_TABCONTROLW L"SysTabControl32" +#define WC_TREEVIEWW L"SysTreeView32" + +/* Common control styles */ +#define CCS_ADJUSTABLE (0x20L) +#define CCS_BOTTOM (0x3L) +#define CCS_NODIVIDER (0x40L) +#define CCS_NOMOVEY (0x2L) +#define CCS_NOPARENTALIGN (0x8L) +#define CCS_NORESIZE (0x4L) +#define CCS_TOP (0x1L) +#define ANIMATE_CLASSA "SysAnimate32" +#define HOTKEY_CLASSA "msctls_hotkey32" +#define PROGRESS_CLASSA "msctls_progress32" +#define STATUSCLASSNAMEA "msctls_statusbar32" +#define TOOLBARCLASSNAMEA "ToolbarWindow32" +#define TOOLTIPS_CLASSA "tooltips_class32" +#define TRACKBAR_CLASSA "msctls_trackbar32" +#define UPDOWN_CLASSA "msctls_updown32" +#define WC_HEADERA "SysHeader32" +#define WC_LISTVIEWA "SysListView32" +#define WC_TABCONTROLA "SysTabControl32" +#define WC_TREEVIEWA "SysTreeView32" +#ifdef UNICODE +#define ANIMATE_CLASS ANIMATE_CLASSW +#define HOTKEY_CLASS HOTKEY_CLASSW +#define PROGRESS_CLASS PROGRESS_CLASSW +#define STATUSCLASSNAME STATUSCLASSNAMEW +#define TOOLBARCLASSNAME TOOLBARCLASSNAMEW +#define TOOLTIPS_CLASS TOOLTIPS_CLASSW +#define TRACKBAR_CLASS TRACKBAR_CLASSW +#define UPDOWN_CLASS UPDOWN_CLASSW +#define WC_HEADER WC_HEADERW +#define WC_LISTVIEW WC_LISTVIEWW +#define WC_TABCONTROL WC_TABCONTROLW +#define WC_TREEVIEW WC_TREEVIEWW +#else +#define ANIMATE_CLASS ANIMATE_CLASSA +#define HOTKEY_CLASS HOTKEY_CLASSA +#define PROGRESS_CLASS PROGRESS_CLASSA +#define STATUSCLASSNAME STATUSCLASSNAMEA +#define TOOLBARCLASSNAME TOOLBARCLASSNAMEA +#define TOOLTIPS_CLASS TOOLTIPS_CLASSA +#define TRACKBAR_CLASS TRACKBAR_CLASSA +#define UPDOWN_CLASS UPDOWN_CLASSA +#define WC_HEADER WC_HEADERA +#define WC_LISTVIEW WC_LISTVIEWA +#define WC_TABCONTROL WC_TABCONTROLA +#define WC_TREEVIEW WC_TREEVIEWA +#endif /* UNICODE */ + +/* Header control styles */ +#define HDS_BUTTONS (2) +#define HDS_HIDDEN (8) +#define HDS_HORZ (0) + +/* HD_ITEM structure */ +#define HDI_BITMAP (16) +#define HDI_FORMAT (4) +#define HDI_HEIGHT (1) +#define HDI_LPARAM (8) +#define HDI_TEXT (2) +#define HDI_WIDTH (1) +#define HDF_CENTER (2) +#define HDF_LEFT (0) +#define HDF_RIGHT (1) +#define HDF_RTLREADING (4) +#define HDF_BITMAP (8192) +#define HDF_OWNERDRAW (32768) +#define HDF_STRING (16384) +#define HDF_JUSTIFYMASK (3) + +/* HD_HITTESTINFO structure */ +#define HHT_NOWHERE (1) +#define HHT_ONDIVIDER (4) +#define HHT_ONDIVOPEN (8) +#define HHT_ONHEADER (2) +#define HHT_TOLEFT (2048) +#define HHT_TORIGHT (1024) + +/* TBADDBITMAP structure */ +#define HINST_COMMCTRL ((HINSTANCE)-1) +#define IDB_STD_LARGE_COLOR (1) +#define IDB_STD_SMALL_COLOR (0) +#define IDB_VIEW_LARGE_COLOR (5) +#define IDB_VIEW_SMALL_COLOR (4) +#define STD_COPY (1) +#define STD_CUT (0) +#define STD_DELETE (5) +#define STD_FILENEW (6) +#define STD_FILEOPEN (7) +#define STD_FILESAVE (8) +#define STD_FIND (12) +#define STD_HELP (11) +#define STD_PASTE (2) +#define STD_PRINT (14) +#define STD_PRINTPRE (9) +#define STD_PROPERTIES (10) +#define STD_REDOW (4) +#define STD_REPLACE (13) +#define STD_UNDO (3) +#define VIEW_LARGEICONS (0) +#define VIEW_SMALLICONS (1) +#define VIEW_LIST (2) +#define VIEW_DETAILS (3) +#define VIEW_SORTNAME (4) +#define VIEW_SORTSIZE (5) +#define VIEW_SORTDATE (6) +#define VIEW_SORTTYPE (7) + +/* Toolbar styles */ +#define TBSTYLE_ALTDRAG (1024) +#define TBSTYLE_TOOLTIPS (256) +#define TBSTYLE_WRAPABLE (512) +#define TBSTYLE_BUTTON (0) +#define TBSTYLE_CHECK (2) +#define TBSTYLE_CHECKGROUP (6) +#define TBSTYLE_GROUP (4) +#define TBSTYLE_SEP (1) + +/* Toolbar states */ +#define TBSTATE_CHECKED (1) +#define TBSTATE_ENABLED (4) +#define TBSTATE_HIDDEN (8) +#define TBSTATE_INDETERMINATE (16) +#define TBSTATE_PRESSED (2) +#define TBSTATE_WRAP (32) + +/* Tooltip styles */ +#define TTS_ALWAYSTIP (1) +#define TTS_NOPREFIX (2) + +/* TOOLINFO structure */ +#define TTF_IDISHWND (1) +#define TTF_CENTERTIP (2) +#define TTF_RTLREADING (4) +#define TTF_SUBCLASS (16) + +/* TTM_SETDELAYTIME message */ +#define TTDT_AUTOMATIC (0) +#define TTDT_AUTOPOP (2) +#define TTDT_INITIAL (3) +#define TTDT_RESHOW (1) + +/* Status window */ +#define SBARS_SIZEGRIP (256) +#define SBARS_SIZEGRIP (256) + +/* DL_DRAGGING message */ +#define DL_MOVECURSOR (3) +#define DL_COPYCURSOR (2) +#define DL_STOPCURSOR (1) + +/* Up-down control styles */ +#define UDS_ALIGNLEFT (8) +#define UDS_ALIGNRIGHT (4) +#define UDS_ARROWKEYS (32) +#define UDS_AUTOBUDDY (16) +#define UDS_HORZ (64) +#define UDS_NOTHOUSANDS (128) +#define UDS_SETBUDDYINT (2) +#define UDS_WRAP (1) + +/* UDM_SETRANGE message */ +#define UD_MAXVAL (32767) +#define UD_MINVAL (-32767) + +/* HKM_GETHOTKEY message */ +#define HOTKEYF_ALT (4) +#define HOTKEYF_CONTROL (2) +#define HOTKEYF_EXT (8) +#define HOTKEYF_SHIFT (1) + +/* HKM_SETRULES message */ +#define HKCOMB_A (8) +#define HKCOMB_C (4) +#define HKCOMB_CA (64) +#define HKCOMB_NONE (1) +#define HKCOMB_S (2) +#define HKCOMB_SA (32) +#define HKCOMB_SC (16) +#define HKCOMB_SCA (128) + +/* Trackbar styles */ +#define TBS_HORZ (0) +#define TBS_VERT (2) +#define TBS_AUTOTICKS (1) +#define TBS_NOTICKS (16) +#define TBS_TOP (4) +#define TBS_BOTTOM (0) +#define TBS_LEFT (4) +#define TBS_RIGHT (0) +#define TBS_BOTH (8) +#define TBS_ENABLESELRANGE (32) +#define TBS_FIXEDLENGTH (64) +#define TBS_NOTHUMB (128) +#define TB_BOTTOM (7) +#define TB_ENDTRACK (8) +#define TB_LINEDOWN (1) +#define TB_LINEUP (0) +#define TB_PAGEDOWN (3) +#define TB_PAGEUP (2) +#define TB_THUMBPOSITION (4) +#define TB_THUMBTRACK (5) +#define TB_TOP (6) + +/* List view styles */ +#define LVS_ALIGNLEFT (2048) +#define LVS_ALIGNTOP (0) +#define LVS_AUTOARRANGE (256) +#define LVS_EDITLABELS (512) +#define LVS_ICON (0) +#define LVS_LIST (3) +#define LVS_NOCOLUMNHEADER (16384) +#define LVS_NOLABELWRAP (128) +#define LVS_NOSCROLL (8192) +#define LVS_NOSORTHEADER (32768) +#define LVS_OWNERDRAWFIXED (1024) +#define LVS_REPORT (1) +#define LVS_SHAREIMAGELISTS (64) +#define LVS_SHOWSELALWAYS (8) +#define LVS_SINGLESEL (4) +#define LVS_SMALLICON (2) +#define LVS_SORTASCENDING (16) +#define LVS_SORTDESCENDING (32) +#define LVS_TYPESTYLEMASK (64512) +#define LVSIL_NORMAL (0) +#define LVSIL_SMALL (1) +#define LVSIL_STATE (2) +#define LVIS_CUT (4) +#define LVIS_DROPHILITED (8) +#define LVIS_FOCUSED (1) +#define LVIS_SELECTED (2) +#define LVIS_OVERLAYMASK (3840) +#define LVIS_STATEIMAGEMASK (61440) +#define LPSTR_TEXTCALLBACKW ((LPWSTR)-1L) +#define LPSTR_TEXTCALLBACKA ((LPSTR)-1L) +#ifdef UNICODE +#define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKW +#else +#define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKA +#endif /* UNICODE */ + +/* LV_ITEM structure */ +#define LVIF_TEXT (1) +#define LVIF_IMAGE (2) +#define LVIF_PARAM (4) +#define LVIF_STATE (8) +#define LVIF_DI_SETITEM (4096) + +/* LVM_GETNEXTITEM structure */ +#define LVNI_ABOVE (256) +#define LVNI_ALL (0) +#define LVNI_BELOW (512) +#define LVNI_TOLEFT (1024) +#define LVNI_TORIGHT (2048) +#define LVNI_CUT (4) +#define LVNI_DROPHILITED (8) +#define LVNI_FOCUSED (1) +#define LVNI_SELECTED (2) + +/* LV_FINDINFO structure */ +#define LVFI_PARAM (1) +#define LVFI_PARTIAL (8) +#define LVFI_STRING (2) +#define LVFI_WRAP (32) +#define LVFI_NEARESTXY (64) + +/* LV_HITTESTINFO structure */ +#define LVHT_ABOVE (8) +#define LVHT_BELOW (16) +#define LVHT_NOWHERE (1) +#define LVHT_ONITEMICON (2) +#define LVHT_ONITEMLABEL (4) +#define LVHT_ONITEMSTATEICON (8) +#define LVHT_TOLEFT (64) +#define LVHT_TORIGHT (32) + +/* LV_COLUMN structure */ +#define LVCF_FMT (1) +#define LVCF_SUBITEM (8) +#define LVCF_TEXT (4) +#define LVCF_WIDTH (2) +#define LVCFMT_CENTER (2) +#define LVCFMT_LEFT (0) +#define LVCFMT_RIGHT (1) + +/* ListView_GetItemRect */ +#define LVIR_BOUNDS (0) +#define LVIR_ICON (1) +#define LVIR_LABEL (2) +#define LVIR_SELECTBOUNDS (3) + +/* LVM_ARRANGE message */ +#define LVA_ALIGNLEFT (1) +#define LVA_ALIGNTOP (2) +#define LVA_DEFAULT (0) +#define LVA_SNAPTOGRID (5) + +/* LVM_SETCOLUMNWIDTH message */ +#define LVSCW_AUTOSIZE (-1) +#define LVSCW_AUTOSIZE_USEHEADER (-2) + +/* Tree View styles */ +#define TVS_DISABLEDRAGDROP (16) +#define TVS_EDITLABELS (8) +#define TVS_HASBUTTONS (1) +#define TVS_HASLINES (2) +#define TVS_LINESATROOT (4) +#define TVS_SHOWSELALWAYS (32) + +/* Tree View states */ +#define TVIS_BOLD (16) +#define TVIS_CUT (4) +#define TVIS_DROPHILITED (8) +#define TVIS_EXPANDED (32) +#define TVIS_EXPANDEDONCE (64) +#define TVIS_FOCUSED (1) +#define TVIS_OVERLAYMASK (3840) +#define TVIS_SELECTED (2) +#define TVIS_STATEIMAGEMASK (61440) +#define TVIS_USERMASK (61440) + +/* TV_ITEM structure */ +#define TVIF_CHILDREN (64) +#define TVIF_HANDLE (16) +#define TVIF_IMAGE (2) +#define TVIF_PARAM (4) +#define TVIF_SELECTEDIMAGE (32) +#define TVIF_STATE (8) +#define TVIF_TEXT (1) +#define I_CHILDRENCALLBACK (-1) +#define I_IMAGECALLBACK (-1) + +/* TV_INSERTSTRUCT structure */ +#define TVI_ROOT ((HTREEITEM)0xFFFF0000) +#define TVI_FIRST ((HTREEITEM)0xFFFF0001) +#define TVI_LAST ((HTREEITEM)0xFFFF0002) +#define TVI_SORT ((HTREEITEM)0xFFFF0003) + +/* TV_HITTESTINFO structure */ +#define TVHT_ABOVE (256) +#define TVHT_BELOW (512) +#define TVHT_NOWHERE (1) +#define TVHT_ONITEM (70) +#define TVHT_ONITEMBUTTON (16) +#define TVHT_ONITEMICON (2) +#define TVHT_ONITEMINDENT (8) +#define TVHT_ONITEMLABEL (4) +#define TVHT_ONITEMRIGHT (32) +#define TVHT_ONITEMSTATEICON (64) +#define TVHT_TOLEFT (2048) +#define TVHT_TORIGHT (1024) + +/* TVM_EXPAND message */ +#define TVE_COLLAPSE (1) +#define TVE_COLLAPSERESET (32768) +#define TVE_EXPAND (2) +#define TVE_TOGGLE (3) + +/* TVM_GETIMAGELIST message */ +#define TVSIL_NORMAL (0) +#define TVSIL_STATE (2) + +/* TVM_GETNEXTITEM message */ +#define TVGN_CARET (9) +#define TVGN_CHILD (4) +#define TVGN_DROPHILITE (8) +#define TVGN_FIRSTVISIBLE (5) +#define TVGN_NEXT (1) +#define TVGN_NEXTVISIBLE (6) +#define TVGN_PARENT (3) +#define TVGN_PREVIOUS (2) +#define TVGN_PREVIOUSVISIBLE (7) +#define TVGN_ROOT (0) + +/* TVN_SELCHANGED message */ +#define TVC_BYKEYBOARD (2) +#define TVC_BYMOUSE (1) +#define TVC_UNKNOWN (0) + +/* Tab control styles */ +#define TCS_BUTTONS (256) +#define TCS_FIXEDWIDTH (1024) +#define TCS_FOCUSNEVER (32768) +#define TCS_FOCUSONBUTTONDOWN (4096) +#define TCS_FORCEICONLEFT (16) +#define TCS_FORCELABELLEFT (32) +#define TCS_MULTILINE (512) +#define TCS_OWNERDRAWFIXED (8192) +#define TCS_RAGGEDRIGHT (2048) +#define TCS_RIGHTJUSTIFY (0) +#define TCS_SINGLELINE (0) +#define TCS_TABS (0) +#define TCS_TOOLTIPS (16384) + +/* TC_ITEM structure */ +#define TCIF_TEXT (1) +#define TCIF_IMAGE (2) +#define TCIF_PARAM (8) +#define TCIF_RTLREADING (4) + +/* TC_HITTESTINFO structure */ +#define TCHT_NOWHERE (1) +#define TCHT_ONITEM (6) +#define TCHT_ONITEMICON (2) +#define TCHT_ONITEMLABEL (4) + +/* Animation control styles */ +#define ACS_AUTOPLAY (4) +#define ACS_CENTER (1) +#define ACS_TRANSPARENT (2) + +/* MODEMDEVCAPS structure */ +#define DIALOPTION_BILLING (64) +#define DIALOPTION_QUIET (128) +#define DIALOPTION_DIALTONE (256) +#define MDMVOLFLAG_LOW (1) +#define MDMVOLFLAG_MEDIUM (2) +#define MDMVOLFLAG_HIGH (4) +#define MDMVOL_LOW (0) +#define MDMVOL_MEDIUM (1) +#define MDMVOL_HIGH (2) +#define MDMSPKRFLAG_OFF (1) +#define MDMSPKRFLAG_DIAL (2) +#define MDMSPKRFLAG_ON (4) +#define MDMSPKRFLAG_CALLSETUP (8) +#define MDMSPKR_OFF (0) +#define MDMSPKR_DIAL (1) +#define MDMSPKR_ON (2) +#define MDMSPKR_CALLSETUP (3) +#define MDM_BLIND_DIAL (512) +#define MDM_CCITT_OVERRIDE (64) +#define MDM_CELLULAR (8) +#define MDM_COMPRESSION (1) +#define MDM_ERROR_CONTROL (2) +#define MDM_FLOWCONTROL_HARD (16) +#define MDM_FLOWCONTROL_SOFT (32) +#define MDM_FORCED_EC (4) +#define MDM_SPEED_ADJUST (128) +#define MDM_TONE_DIAL (256) +#define MDM_V23_OVERRIDE (1024) + +/* Languages */ +#define LANG_BULGARIAN (2) +#define LANG_CHINESE (4) +#define LANG_CROATIAN (26) +#define LANG_CZECH (5) +#define LANG_DANISH (6) +#define LANG_DUTCH (19) +#define LANG_ENGLISH (9) +#define LANG_FINNISH (11) +#define LANG_FRENCH (12) +#define LANG_GERMAN (7) +#define LANG_GREEK (8) +#define LANG_HUNGARIAN (14) +#define LANG_ICELANDIC (15) +#define LANG_ITALIAN (16) +#define LANG_JAPANESE (17) +#define LANG_KOREAN (18) +#define LANG_NEUTRAL (0) +#define LANG_NORWEGIAN (20) +#define LANG_POLISH (21) +#define LANG_PORTUGUESE (22) +#define LANG_ROMANIAN (24) +#define LANG_RUSSIAN (25) +#define LANG_SLOVAK (27) +#define LANG_SLOVENIAN (36) +#define LANG_SPANISH (10) +#define LANG_SWEDISH (29) +#define LANG_TURKISH (31) +#define SUBLANG_CHINESE_SIMPLIFIED (2) +#define SUBLANG_CHINESE_TRADITIONAL (1) +#define SUBLANG_CHINESE_HONGKONG (3) +#define SUBLANG_CHINESE_SINGAPORE (4) +#define SUBLANG_DEFAULT (1) +#define SUBLANG_DUTCH (1) +#define SUBLANG_DUTCH_BELGIAN (2) +#define SUBLANG_ENGLISH_AUS (3) +#define SUBLANG_ENGLISH_CAN (4) +#define SUBLANG_ENGLISH_EIRE (6) +#define SUBLANG_ENGLISH_NZ (5) +#define SUBLANG_ENGLISH_UK (2) +#define SUBLANG_ENGLISH_US (1) +#define SUBLANG_FRENCH (1) +#define SUBLANG_FRENCH_BELGIAN (2) +#define SUBLANG_FRENCH_CANADIAN (3) +#define SUBLANG_FRENCH_SWISS (4) +#define SUBLANG_GERMAN (1) +#define SUBLANG_GERMAN_AUSTRIAN (3) +#define SUBLANG_GERMAN_SWISS (2) +#define SUBLANG_ITALIAN (1) +#define SUBLANG_ITALIAN_SWISS (2) +#define SUBLANG_NEUTRAL (0) +#define SUBLANG_NORWEGIAN_BOKMAL (1) +#define SUBLANG_NORWEGIAN_NYNORSK (2) +#define SUBLANG_PORTUGUESE (2) +#define SUBLANG_PORTUGUESE_BRAZILIAN (1) +#define SUBLANG_SPANISH (1) +#define SUBLANG_SPANISH_MEXICAN (2) +#define SUBLANG_SPANISH_MODERN (3) +#define SUBLANG_SYS_DEFAULT (2) +#define NLS_VALID_LOCALE_MASK (1048575) +#define SORT_DEFAULT (0) +#define SORT_JAPANESE_XJIS (0) +#define SORT_JAPANESE_UNICODE (1) +#define SORT_CHINESE_BIG5 (0) +#define SORT_CHINESE_UNICODE (1) +#define SORT_KOREAN_KSC (0) +#define SORT_KOREAN_UNICODE (1) + +/* SYSTEM_INFO structure */ +#define PROCESSOR_INTEL_386 (386) +#define PROCESSOR_INTEL_486 (486) +#define PROCESSOR_INTEL_PENTIUM (586) +#define PROCESSOR_MIPS_R4000 (4000) +#define PROCESSOR_ALPHA_21064 (21064) + +/* TAPE_GET_DRIVE_PARAMETERS structure */ +#define TAPE_DRIVE_COMPRESSION (131072) +#define TAPE_DRIVE_ECC (65536) +#define TAPE_DRIVE_ERASE_BOP_ONLY (64) +#define TAPE_DRIVE_ERASE_LONG (32) +#define TAPE_DRIVE_ERASE_IMMEDIATE (128) +#define TAPE_DRIVE_ERASE_SHORT (16) +#define TAPE_DRIVE_FIXED (1) +#define TAPE_DRIVE_FIXED_BLOCK (1024) +#define TAPE_DRIVE_INITIATOR (4) +#define TAPE_DRIVE_PADDING (262144) +#define TAPE_DRIVE_GET_ABSOLUTE_BLK (1048576) +#define TAPE_DRIVE_GET_LOGICAL_BLK (2097152) +#define TAPE_DRIVE_REPORT_SMKS (524288) +#define TAPE_DRIVE_SELECT (2) +#define TAPE_DRIVE_SET_EOT_WZ_SIZE (4194304) +#define TAPE_DRIVE_TAPE_CAPACITY (256) +#define TAPE_DRIVE_TAPE_REMAINING (512) +#define TAPE_DRIVE_VARIABLE_BLOCK (2048) +#define TAPE_DRIVE_WRITE_PROTECT (4096) +#define TAPE_DRIVE_ABS_BLK_IMMED (-2147475456) +#define TAPE_DRIVE_ABSOLUTE_BLK (-2147479552) +#define TAPE_DRIVE_END_OF_DATA (-2147418112) +#define TAPE_DRIVE_FILEMARKS (-2147221504) +#define TAPE_DRIVE_LOAD_UNLOAD (-2147483647) +#define TAPE_DRIVE_LOAD_UNLD_IMMED (-2147483616) +#define TAPE_DRIVE_LOCK_UNLOCK (-2147483644) +#define TAPE_DRIVE_LOCK_UNLK_IMMED (-2147483520) +#define TAPE_DRIVE_LOG_BLK_IMMED (-2147450880) +#define TAPE_DRIVE_LOGICAL_BLK (-2147467264) +#define TAPE_DRIVE_RELATIVE_BLKS (-2147352576) +#define TAPE_DRIVE_REVERSE_POSITION (-2143289344) +#define TAPE_DRIVE_REWIND_IMMEDIATE (-2147483640) +#define TAPE_DRIVE_SEQUENTIAL_FMKS (-2146959360) +#define TAPE_DRIVE_SEQUENTIAL_SMKS (-2145386496) +#define TAPE_DRIVE_SET_BLOCK_SIZE (-2147483632) +#define TAPE_DRIVE_SET_COMPRESSION (-2147483136) +#define TAPE_DRIVE_SET_ECC (-2147483392) +#define TAPE_DRIVE_SET_PADDING (-2147482624) +#define TAPE_DRIVE_SET_REPORT_SMKS (-2147481600) +#define TAPE_DRIVE_SETMARKS (-2146435072) +#define TAPE_DRIVE_SPACE_IMMEDIATE (-2139095040) +#define TAPE_DRIVE_TENSION (-2147483646) +#define TAPE_DRIVE_TENSION_IMMED (-2147483584) +#define TAPE_DRIVE_WRITE_FILEMARKS (-2113929216) +#define TAPE_DRIVE_WRITE_LONG_FMKS (-2013265920) +#define TAPE_DRIVE_WRITE_MARK_IMMED (-1879048192) +#define TAPE_DRIVE_WRITE_SETMARKS (-2130706432) +#define TAPE_DRIVE_WRITE_SHORT_FMKS (-2080374784) + +/* OPENFILENAME structure */ +#define OFN_ALLOWMULTISELECT (0x200) +#define OFN_CREATEPROMPT (0x2000) +#define OFN_ENABLEHOOK (0x20) +#define OFN_ENABLETEMPLATE (0x40) +#define OFN_ENABLETEMPLATEHANDLE (0x80) +#define OFN_EXPLORER (0x80000) +#define OFN_EXTENSIONDIFFERENT (0x400) +#define OFN_FILEMUSTEXIST (0x1000) +#define OFN_HIDEREADONLY (0x4) +#define OFN_LONGNAMES (0x200000) +#define OFN_NOCHANGEDIR (0x8) +#define OFN_NODEREFERENCELINKS (0x100000) +#define OFN_NOLONGNAMES (0x40000) +#define OFN_NONETWORKBUTTON (0x20000) +#define OFN_NOREADONLYRETURN (0x8000) +#define OFN_NOTESTFILECREATE (0x10000) +#define OFN_NOVALIDATE (0x100) +#define OFN_OVERWRITEPROMPT (0x2) +#define OFN_PATHMUSTEXIST (0x800) +#define OFN_READONLY (0x1) +#define OFN_SHAREAWARE (0x4000) +#define OFN_SHOWHELP (0x10) + +/* SHAREVISTRING message */ +#define OFN_SHAREFALLTHROUGH (0x2) +#define OFN_SHARENOWARN (0x1) +#define OFN_SHAREWARN (0) + +/* Open/Save notifications */ +#define CDN_INITDONE (0xfffffda7) +#define CDN_SELCHANGE (0xfffffda6) +#define CDN_FOLDERCHANGE (0xfffffda5) +#define CDN_SHAREVIOLATION (0xfffffda4) +#define CDN_HELP (0xfffffda3) +#define CDN_FILEOK (0xfffffda2) +#define CDN_TYPECHANGE (0xfffffda1) + +/* Open/Save messages */ +#define CDM_GETFILEPATH (0x465) +#define CDM_GETFOLDERIDLIST (0x467) +#define CDM_GETFOLDERPATH (0x466) +#define CDM_GETSPEC (0x464) +#define CDM_HIDECONTROL (0x469) +#define CDM_SETCONTROLTEXT (0x468) +#define CDM_SETDEFEXT (0x46a) + +/* CHOOSECOLOR structure */ +#define CC_ENABLEHOOK (0x10) +#define CC_ENABLETEMPLATE (0x20) +#define CC_ENABLETEMPLATEHANDLE (0x40) +#define CC_FULLOPEN (0x2) +#define CC_PREVENTFULLOPEN (0x4) +#define CC_RGBINIT (0x1) +#define CC_SHOWHELP (0x8) +#define CC_SOLIDCOLOR (0x80) + +/* FINDREPLACE structure */ +#define FR_DIALOGTERM (0x40) +#define FR_DOWN (0x1) +#define FR_ENABLEHOOK (0x100) +#define FR_ENABLETEMPLATE (0x200) +#define FR_ENABLETEMPLATEHANDLE (0x2000) +#define FR_FINDNEXT (0x8) +#define FR_HIDEUPDOWN (0x4000) +#define FR_HIDEMATCHCASE (0x8000) +#define FR_HIDEWHOLEWORD (0x10000) +#define FR_MATCHCASE (0x4) +#define FR_NOMATCHCASE (0x800) +#define FR_NOUPDOWN (0x400) +#define FR_NOWHOLEWORD (0x1000) +#define FR_REPLACE (0x10) +#define FR_REPLACEALL (0x20) +#define FR_SHOWHELP (0x80) +#define FR_WHOLEWORD (0x2) + +/* CHOOSEFONT structure */ +#define CF_APPLY (0x200L) +#define CF_ANSIONLY (0x400L) +#define CF_BOTH (0x3) +#define CF_TTONLY (0x40000L) +#define CF_EFFECTS (0x100L) +#define CF_ENABLEHOOK (0x8L) +#define CF_ENABLETEMPLATE (0x10L) +#define CF_ENABLETEMPLATEHANDLE (0x20L) +#define CF_FIXEDPITCHONLY (0x4000L) +#define CF_FORCEFONTEXIST (0x10000L) +#define CF_INITTOLOGFONTSTRUCT (0x40L) +#define CF_LIMITSIZE (0x2000L) +#define CF_NOOEMFONTS (0x800L) +#define CF_NOFACESEL (0x80000L) +#define CF_NOSCRIPTSEL (0x800000L) +#define CF_NOSTYLESEL (0x100000L) +#define CF_NOSIZESEL (0x200000L) +#define CF_NOSIMULATIONS (0x1000L) +#define CF_NOVECTORFONTS (0x800L) +#define CF_NOVERTFONTS (0x1000000L) +#define CF_PRINTERFONTS (0x2) +#define CF_SCALABLEONLY (0x20000L) +#define CF_SCREENFONTS (0x1) +#define CF_SCRIPTSONLY (0x400L) +#define CF_SELECTSCRIPT (0x400000L) +#define CF_SHOWHELP (0x4L) +#define CF_USESTYLE (0x80L) +#define CF_WYSIWYG (0x8000L) +#define BOLD_FONTTYPE (0x100) +#define ITALIC_FONTTYPE (0x200) +#define PRINTER_FONTTYPE (0x4000) +#define REGULAR_FONTTYPE (0x400) +#define SCREEN_FONTTYPE (0x2000) +#define SIMULATED_FONTTYPE (0x8000) + +/* Common dialog messages */ +#define COLOROKSTRINGW L"commdlg_ColorOK" +#define FILEOKSTRINGW L"commdlg_FileNameOK" +#define FINDMSGSTRINGW L"commdlg_FindReplace" +#define HELPMSGSTRINGW L"commdlg_help" +#define LBSELCHSTRINGW L"commdlg_LBSelChangedNotify" +#define SETRGBSTRINGW L"commdlg_SetRGBColor" +#define SHAREVISTRINGW L"commdlg_ShareViolation" +#define COLOROKSTRINGA "commdlg_ColorOK" +#define FILEOKSTRINGA "commdlg_FileNameOK" +#define FINDMSGSTRINGA "commdlg_FindReplace" +#define HELPMSGSTRINGA "commdlg_help" +#define LBSELCHSTRINGA "commdlg_LBSelChangedNotify" +#define SETRGBSTRINGA "commdlg_SetRGBColor" +#define SHAREVISTRINGA "commdlg_ShareViolation" +#ifdef UNICODE +#define COLOROKSTRING COLOROKSTRINGW +#define FILEOKSTRING FILEOKSTRINGW +#define FINDMSGSTRING FINDMSGSTRINGW +#define HELPMSGSTRING HELPMSGSTRINGW +#define LBSELCHSTRING LBSELCHSTRINGW +#define SETRGBSTRING SETRGBSTRINGW +#define SHAREVISTRING SHAREVISTRINGW +#else +#define COLOROKSTRING COLOROKSTRINGA +#define FILEOKSTRING FILEOKSTRINGA +#define FINDMSGSTRING FINDMSGSTRINGA +#define HELPMSGSTRING HELPMSGSTRINGA +#define LBSELCHSTRING LBSELCHSTRINGA +#define SETRGBSTRING SETRGBSTRINGA +#define SHAREVISTRING SHAREVISTRINGA +#endif + +/* LBSELCHSTRING message */ +#define CD_LBSELCHANGE (0) +#define CD_LBSELADD (2) +#define CD_LBSELSUB (1) +#define CD_LBSELNOITEMS (-1) + +/* DEVNAMES structure */ +#define DN_DEFAULTPRN (1) + +/* PRINTDLG structure */ +#define PD_ALLPAGES (0) +#define PD_COLLATE (16) +#define PD_DISABLEPRINTTOFILE (524288) +#define PD_ENABLEPRINTHOOK (4096) +#define PD_ENABLEPRINTTEMPLATE (16384) +#define PD_ENABLEPRINTTEMPLATEHANDLE (65536) +#define PD_ENABLESETUPHOOK (8192) +#define PD_ENABLESETUPTEMPLATE (32768) +#define PD_ENABLESETUPTEMPLATEHANDLE (131072) +#define PD_HIDEPRINTTOFILE (1048576) +#define PD_NOPAGENUMS (8) +#define PD_NOSELECTION (4) +#define PD_NOWARNING (128) +#define PD_PAGENUMS (2) +#define PD_PRINTSETUP (64) +#define PD_PRINTTOFILE (32) +#define PD_RETURNDC (256) +#define PD_RETURNDEFAULT (1024) +#define PD_RETURNIC (512) +#define PD_SELECTION (1) +#define PD_SHOWHELP (2048) +#define PD_USEDEVMODECOPIES (262144) +#define PD_USEDEVMODECOPIESANDCOLLATE (262144) + +/* PAGESETUPDLG structure */ +#define PSD_DEFAULTMINMARGINS (0) +#define PSD_DISABLEMARGINS (16) +#define PSD_DISABLEORIENTATION (256) +#define PSD_DISABLEPAGEPAINTING (524288) +#define PSD_DISABLEPAPER (512) +#define PSD_DISABLEPRINTER (32) +#define PSD_ENABLEPAGEPAINTHOOK (262144) +#define PSD_ENABLEPAGESETUPHOOK (8192) +#define PSD_ENABLEPAGESETUPTEMPLATE (32768) +#define PSD_ENABLEPAGESETUPTEMPLATEHANDLE (131072) +#define PSD_INHUNDREDTHSOFMILLIMETERS (8) +#define PSD_INTHOUSANDTHSOFINCHES (4) +#define PSD_INWININIINTLMEASURE (0) +#define PSD_MARGINS (2) +#define PSD_MINMARGINS (1) +#define PSD_NOWARNING (128) +#define PSD_RETURNDEFAULT (1024) +#define PSD_SHOWHELP (2048) + +/* WM_SHOWWINDOW message */ +#define SW_OTHERUNZOOM (4) +#define SW_OTHERZOOM (2) +#define SW_PARENTCLOSING (1) +#define SW_PARENTOPENING (3) + +/* ImmGetVirtualKey */ +#define VK_PROCESSKEY (229) + +/* Keystroke Message Flags */ +#define KF_ALTDOWN (8192) +#define KF_DLGMODE (2048) +#define KF_EXTENDED (256) +#define KF_MENUMODE (4096) +#define KF_REPEAT (16384) +#define KF_UP (32768) + +/* GetKeyboardLayoutName */ +#define KL_NAMELENGTH (9) + +/* WM_ACTIVATE message */ +#define WA_ACTIVE (1) +#define WA_CLICKACTIVE (2) +#define WA_INACTIVE (0) + +/* WM_ACTIVATE message */ +#define PWR_CRITICALRESUME (3) +#define PWR_SUSPENDREQUEST (1) +#define PWR_SUSPENDRESUME (2) +#define PWR_FAIL (-1) +#define PWR_OK (1) + +/* WM_NOTIFYFORMAT message */ +#define NF_QUERY (3) +#define NF_REQUERY (4) +#define NFR_ANSI (1) +#define NFR_UNICODE (2) + +/* WM_SIZING message */ +#define WMSZ_BOTTOM (6) +#define WMSZ_BOTTOMLEFT (7) +#define WMSZ_BOTTOMRIGHT (8) +#define WMSZ_LEFT (1) +#define WMSZ_RIGHT (2) +#define WMSZ_TOP (3) +#define WMSZ_TOPLEFT (4) +#define WMSZ_TOPRIGHT (5) + +/* WM_MOUSEACTIVATE message */ +#define MA_ACTIVATE (1) +#define MA_ACTIVATEANDEAT (2) +#define MA_NOACTIVATE (3) +#define MA_NOACTIVATEANDEAT (4) + +/* WM_SIZE message */ +#define SIZE_MAXHIDE (4) +#define SIZE_MAXIMIZED (2) +#define SIZE_MAXSHOW (3) +#define SIZE_MINIMIZED (1) +#define SIZE_RESTORED (0) + +/* WM_NCCALCSIZE message */ +#define WVR_ALIGNTOP (16) +#define WVR_ALIGNLEFT (32) +#define WVR_ALIGNBOTTOM (64) +#define WVR_ALIGNRIGHT (128) +#define WVR_HREDRAW (256) +#define WVR_VREDRAW (512) +#define WVR_REDRAW (768) +#define WVR_VALIDRECTS (1024) + +/* WM_NCHITTEST message */ +#define HTBOTTOM (15) +#define HTBOTTOMLEFT (16) +#define HTBOTTOMRIGHT (17) +#define HTCAPTION (2) +#define HTCLIENT (1) +#define HTERROR (-2) +#define HTGROWBOX (4) +#define HTHSCROLL (6) +#define HTLEFT (10) +#define HTMENU (5) +#define HTNOWHERE (0) +#define HTREDUCE (8) +#define HTRIGHT (11) +#define HTSIZE (4) +#define HTSYSMENU (3) +#define HTTOP (12) +#define HTTOPLEFT (13) +#define HTTOPRIGHT (14) +#define HTTRANSPARENT (-1) +#define HTVSCROLL (7) +#define HTZOOM (9) + +/* Mouse messages */ +#define MK_CONTROL (8) +#define MK_LBUTTON (1) +#define MK_MBUTTON (16) +#define MK_RBUTTON (2) +#define MK_SHIFT (4) + +/* WNDCLASS structure */ +#define CS_BYTEALIGNCLIENT (4096) +#define CS_BYTEALIGNWINDOW (8192) +#define CS_CLASSDC (64) +#define CS_DBLCLKS (8) +#define CS_GLOBALCLASS (16384) +#define CS_HREDRAW (2) +#define CS_KEYCVTWINDOW (4) +#define CS_NOCLOSE (512) +#define CS_NOKEYCVT (256) +#define CS_OWNDC (32) +#define CS_PARENTDC (128) +#define CS_SAVEBITS (2048) +#define CS_VREDRAW (1) +#define DLGWINDOWEXTRA (30) + +/* ACCEL structure */ +#define FALT (16) +#define FCONTROL (8) +#define FNOINVERT (2) +#define FSHIFT (4) +#define FVIRTKEY (1) + +/* MENUITEMINFO structure */ +#define MIIM_CHECKMARKS (8) +#define MIIM_DATA (32) +#define MIIM_ID (2) +#define MIIM_STATE (1) +#define MIIM_SUBMENU (4) +#define MIIM_TYPE (16) +#define MFT_BITMAP (0x4L) +#define MFT_MENUBARBREAK (0x20L) +#define MFT_MENUBREAK (0x40L) +#define MFT_OWNERDRAW (0x100L) +#define MFT_RADIOCHECK (0x200L) +#define MFT_RIGHTJUSTIFY (0x4000L) +#define MFT_SEPARATOR (0x800L) +#define MFT_STRING (0L) +#define MFS_CHECKED (0x8L) +#define MFS_DEFAULT (0x1000L) +#define MFS_DISABLED (0x3L) +#define MFS_ENABLED (0L) +#define MFS_GRAYED (0x3L) +#define MFS_HILITE (0x80L) +#define MFS_UNCHECKED (0L) +#define MFS_UNHILITE (0L) + +/* SERIALKEYS structure */ +#define SERKF_AVAILABLE (2) +#define SERKF_INDICATOR (4) +#define SERKF_SERIALKEYSON (1) + +/* FILTERKEYS structure */ +#define FKF_AVAILABLE (2) +#define FKF_CLICKON (64) +#define FKF_FILTERKEYSON (1) +#define FKF_HOTKEYACTIVE (4) +#define FKF_HOTKEYSOUND (16) +#define FKF_CONFIRMHOTKEY (8) +#define FKF_INDICATOR (32) + +/* HELPINFO structure */ +#define HELPINFO_MENUITEM (2) +#define HELPINFO_WINDOW (1) + +/* WM_PRINT message */ +#define PRF_CHECKVISIBLE (0x1L) +#define PRF_CHILDREN (0x10L) +#define PRF_CLIENT (0x4L) +#define PRF_ERASEBKGND (0x8L) +#define PRF_NONCLIENT (0x2L) +#define PRF_OWNED (0x20L) + +/* MapWindowPoints */ +#define HWND_DESKTOP ((HWND)0) + +/* WM_SYSCOMMAND message */ +#define SC_CLOSE (61536) +#define SC_CONTEXTHELP (61824) +#define SC_DEFAULT (61792) +#define SC_HOTKEY (61776) +#define SC_HSCROLL (61568) +#define SC_KEYMENU (61696) +#define SC_MAXIMIZE (61488) +#define SC_ZOOM (61488) +#define SC_MINIMIZE (61472) +#define SC_ICON (61472) +#define SC_MONITORPOWER (61808) +#define SC_MOUSEMENU (61584) +#define SC_MOVE (61456) +#define SC_NEXTWINDOW (61504) +#define SC_PREVWINDOW (61520) +#define SC_RESTORE (61728) +#define SC_SCREENSAVE (61760) +#define SC_SIZE (61440) +#define SC_TASKLIST (61744) +#define SC_VSCROLL (61552) + +/* DM_GETDEFID message */ +#define DC_HASDEFID (21323) + +/* WM_GETDLGCODE message */ +#define DLGC_BUTTON (8192) +#define DLGC_DEFPUSHBUTTON (16) +#define DLGC_HASSETSEL (8) +#define DLGC_RADIOBUTTON (64) +#define DLGC_STATIC (256) +#define DLGC_UNDEFPUSHBUTTON (32) +#define DLGC_WANTALLKEYS (4) +#define DLGC_WANTARROWS (1) +#define DLGC_WANTCHARS (128) +#define DLGC_WANTMESSAGE (4) +#define DLGC_WANTTAB (2) + +/* EM_SETMARGINS message */ +#define EC_LEFTMARGIN (1) +#define EC_RIGHTMARGIN (2) +#define EC_USEFONTINFO (65535) + +/* LB_SETCOUNT message */ +#define LB_ERR (-1) +#define LB_ERRSPACE (-2) +#define LB_OKAY (0) + +/* CB_DIR message */ +#define CB_ERR (-1) +#define CB_ERRSPACE (-2) + +/* WM_IME_CONTROL message */ +#define IMC_GETCANDIDATEPOS (7) +#define IMC_GETCOMPOSITIONFONT (9) +#define IMC_GETCOMPOSITIONWINDOW (11) +#define IMC_GETSTATUSWINDOWPOS (15) +#define IMC_CLOSESTATUSWINDOW (33) +#define IMC_OPENSTATUSWINDOW (34) +#define IMC_SETCANDIDATEPOS (8) +#define IMC_SETCOMPOSITIONFONT (10) +#define IMC_SETCOMPOSITIONWINDOW (12) +#define IMC_SETSTATUSWINDOWPOS (16) + +/* WM_IME_CONTROL message */ +#define IMN_CHANGECANDIDATE (3) +#define IMN_CLOSECANDIDATE (4) +#define IMN_CLOSESTATUSWINDOW (1) +#define IMN_GUIDELINE (13) +#define IMN_OPENCANDIDATE (5) +#define IMN_OPENSTATUSWINDOW (2) +#define IMN_SETCANDIDATEPOS (9) +#define IMN_SETCOMPOSITIONFONT (10) +#define IMN_SETCOMPOSITIONWINDOW (11) +#define IMN_SETCONVERSIONMODE (6) +#define IMN_SETOPENSTATUS (8) +#define IMN_SETSENTENCEMODE (7) +#define IMN_SETSTATUSWINDOWPOS (12) +#define IMN_PRIVATE (14) + +/* STICKYKEYS structure */ +#define SKF_AUDIBLEFEEDBACK (64) +#define SKF_AVAILABLE (2) +#define SKF_CONFIRMHOTKEY (8) +#define SKF_HOTKEYACTIVE (4) +#define SKF_HOTKEYSOUND (16) +#define SKF_INDICATOR (32) +#define SKF_STICKYKEYSON (1) +#define SKF_TRISTATE (128) +#define SKF_TWOKEYSOFF (256) + +/* MOUSEKEYS structure */ +#define MKF_AVAILABLE (2) +#define MKF_CONFIRMHOTKEY (8) +#define MKF_HOTKEYACTIVE (4) +#define MKF_HOTKEYSOUND (16) +#define MKF_INDICATOR (32) +#define MKF_MOUSEKEYSON (1) +#define MKF_MODIFIERS (64) +#define MKF_REPLACENUMBERS (128) + +/* SOUNDSENTRY structure */ +#define SSF_AVAILABLE (2) +#define SSF_SOUNDSENTRYON (1) +#define SSTF_BORDER (2) +#define SSTF_CHARS (1) +#define SSTF_DISPLAY (3) +#define SSTF_NONE (0) +#define SSGF_DISPLAY (3) +#define SSGF_NONE (0) +#define SSWF_CUSTOM (4) +#define SSWF_DISPLAY (3) +#define SSWF_NONE (0) +#define SSWF_TITLE (1) +#define SSWF_WINDOW (2) + +/* ACCESSTIMEOUT structure */ +#define ATF_ONOFFFEEDBACK (2) +#define ATF_TIMEOUTON (1) + +/* HIGHCONTRAST structure */ +#define HCF_AVAILABLE (2) +#define HCF_CONFIRMHOTKEY (8) +#define HCF_HIGHCONTRASTON (1) +#define HCF_HOTKEYACTIVE (4) +#define HCF_HOTKEYAVAILABLE (64) +#define HCF_HOTKEYSOUND (16) +#define HCF_INDICATOR (32) + +/* TOGGLEKEYS structure */ +#define TKF_AVAILABLE (2) +#define TKF_CONFIRMHOTKEY (8) +#define TKF_HOTKEYACTIVE (4) +#define TKF_HOTKEYSOUND (16) +#define TKF_TOGGLEKEYSON (1) + +/* Installable Policy */ +#define PP_DISPLAYERRORS (1) + +/* SERVICE_INFO structure */ +#define RESOURCEDISPLAYTYPE_DOMAIN (1) +#define RESOURCEDISPLAYTYPE_FILE (4) +#define RESOURCEDISPLAYTYPE_GENERIC (0) +#define RESOURCEDISPLAYTYPE_GROUP (5) +#define RESOURCEDISPLAYTYPE_SERVER (2) +#define RESOURCEDISPLAYTYPE_SHARE (3) + +/* BITMAPINFOHEADER structure */ +#define BI_RGB (0L) +#define BI_RLE8 (1L) +#define BI_RLE4 (2L) +#define BI_BITFIELDS (3L) + +/* Extensions to OpenGL */ + +/* ChoosePixelFormat */ +#define PFD_DRAW_TO_WINDOW (0x4) +#define PFD_DRAW_TO_BITMAP (0x8) +#define PFD_SUPPORT_GDI (0x10) +#define PFD_SUPPORT_OPENGL (0x20) +#define PFD_DOUBLEBUFFER (0x1) +#define PFD_STEREO (0x2) +#define PFD_DOUBLEBUFFER_DONTCARE (0x40000000) +#define PFD_STEREO_DONTCARE (0x80000000) +#define PFD_TYPE_RGBA (0) +#define PFD_TYPE_COLORINDEX (1) +#define PFD_MAIN_PLANE (0) +#define PFD_OVERLAY_PLANE (1) +#define PFD_UNDERLAY_PLANE (-1) + +/* wglUseFontOutlines */ +#define WGL_FONT_LINES (0) +#define WGL_FONT_POLYGONS (1) + +/* LAYERPLANEDESCRIPTOR structure */ + +/* PIXELFORMATDESCRIPTOR structure */ +#define PFD_GENERIC_FORMAT (0x40) +#define PFD_NEED_PALETTE (0x80) +#define PFD_NEED_SYSTEM_PALETTE (0x100) +#define PFD_SWAP_COPY (0x400) +#define PFD_SWAP_EXCHANGE (0x200) + +/* TEXTMETRIC structure */ +#define TMPF_FIXED_PITCH (0x1) +#define TMPF_VECTOR (0x2) +#define TMPF_TRUETYPE (0x4) +#define TMPF_DEVICE (0x8) + +/* --------------------- old stuff, need to organize! --------------- */ + +/* BEGINNING of windowsx.h stuff from old headers: */ +#define __CRACK_VOID_F(fn,args) (void)(fn args) +#define __CRACK_BOOL_F(fn,args) (BOOL)(fn args) +#define __CRACK_HMENU_F(fn,args) (HMENU)(fn args) +#define __CRACK_HWND_F(fn,args) (HWND)(fn args) +#define __CRACK_LONG_F(fn, args) (LRESULT)(fn args) +#define __CRACK_ZERO_F(fn, args) (fn args,0) +#define GetFirstChild(h) GetTopWindow(h) +#define GetNextSibling(h) GetWindow(h, GW_HWNDNEXT) +#define GetWindowID(h) GetDlgCtrlID(h) +#define SubclassWindow(h, p) (SetWindowLong(h, GWL_WNDPROC, p)) + +#define GET_WM_COMMAND_CMD(w, l) HIWORD(w) +#define GET_WM_COMMAND_ID(w, l) LOWORD(w) +#define GET_WM_CTLCOLOR_HDC(w, l, msg) (HDC)(w) +#define GET_WM_CTLCOLOR_HWND(w, l, msg) (HWND)(l) +#define GET_WM_HSCROLL_CODE(w, l) LOWORD(w) +#define GET_WM_HSCROLL_HWND(w, l) (HWND)(l) +#define GET_WM_HSCROLL_POS(w, l) HIWORD(w) +#define GET_WM_MDIACTIVATE_FACTIVATE(h, a, b) (b == (LONG)h) +#define GET_WM_MDIACTIVATE_HWNDACTIVATE(a, b) (HWND)(b) +#define GET_WM_MDIACTIVATE_HWNDDEACT(a, b) (HWND)(a) +#define GET_WM_VSCROLL_CODE(w, l) LOWORD(w) +#define GET_WM_VSCROLL_HWND(w, l) (HWND)(l) +#define GET_WM_VSCROLL_POS(w, l) HIWORD(w) + +#define FORWARD_WM_CLOSE(h, fn) __CRACK_VOID_F(fn,(h, WM_CLOSE, 0, 0)) +#define FORWARD_WM_COMMAND(h, id, c, n, fn) __CRACK_VOID_F(fn,(h, WM_COMMAND, MAKEWPARAM(id,n), (LPARAM)c)) +#define FORWARD_WM_CREATE(h, p, fn) __CRACK_BOOL_F(fn,(h, WM_CREATE, 0, (LPARAM)p)) +#define FORWARD_WM_DESTROY(h, fn) __CRACK_VOID_F(fn,(h, WM_DESTROY, 0, 0)) +#define FORWARD_WM_ENABLE(h, e, fn) __CRACK_VOID_F(fn,(h, WM_ENABLE, (WPARAM)e, 0)) +#define FORWARD_WM_INITDIALOG(h, c, l, fn) __CRACK_BOOL_F(fn,(h, WM_INITDIALOG, (WPARAM)c, l)) +#define FORWARD_WM_MDICASCADE(h, c, fn) __CRACK_BOOL_F(fn,(h, WM_MDICASCADE, (WPARAM)c, 0)) +#define FORWARD_WM_MDIDESTROY(h, d, fn) __CRACK_VOID_F(fn,(h, WM_MDIDESTROY, (WPARAM)d, 0)) +#define FORWARD_WM_MDIGETACTIVE(h, fn) __CRACK_HWND_F(fn,(h, WM_MDIGETACTIVE, 0, 0)) +#define FORWARD_WM_MDIICONARRANGE(h, fn) __CRACK_VOID_F(fn,(h, WM_MDIICONARRANGE, 0, 0)) +#define FORWARD_WM_MDISETMENU(h, fr, hf, hw, fn) __CRACK_HMENU_F(fn,(h, WM_MDISETMENU, (WPARAM)((fr) ? (hf) : 0), (LPARAM)(hw))) +#define FORWARD_WM_MDITILE(h, c, fn) __CRACK_BOOL_F(fn,(h, WM_MDITILE, (WPARAM)(c), 0)) +#define FORWARD_WM_PAINT(h, fn) __CRACK_VOID_F(fn,(h, WM_PAINT, 0, 0)) +#define FORWARD_WM_QUERYENDSESSION(h, fn) __CRACK_BOOL_F(fn,(h, WM_QUERYENDSESSION, 0, 0)) +#define FORWARD_WM_SIZE(h, state, cx, cy, fn) __CRACK_VOID_F(fn,(h, WM_SIZE, (WPARAM)state, MAKELPARAM(cx, cy))) +#define FORWARD_WM_SYSCOMMAND(h, c, x, y, fn) __CRACK_VOID_F(fn,(h, WM_SYSCOMMAND, (WPARAM)c, MAKELPARAM(x, y))) + +#define HANDLE_WM_CLOSE(h, w, l, fn) __CRACK_ZERO_F(fn,(h)); +#define HANDLE_WM_COMMAND(h, w, l, fn) __CRACK_ZERO_F(fn,(h, SEXT_LOWORD(w), (HWND)l, HIWORD(w))) +#define HANDLE_WM_CREATE(h, w, l, fn) (LRESULT)((fn(h, (CREATESTRUCT *)l)) ? 0 : -1) +#define HANDLE_WM_DESTROY(h, w, l, fn) __CRACK_ZERO_F(fn,(h)) +#define HANDLE_WM_ENABLE(h, w, l, fn) __CRACK_ZERO_F(fn,(h, (BOOL)w)) +#define HANDLE_WM_INITDIALOG(h, w, l, fn) __CRACK_LONG_F(fn,(h, (HWND)w, l)) +#define HANDLE_WM_MDICASCADE(h, w, l, fn) __CRACK_LONG_F(fn, (h, (UINT)w) +#define HANDLE_WM_MDIDESTROY(h, w, l, fn) __CRACK_ZERO_F(fn,(h, (HWND)w)) +#define HANDLE_WM_MDIGETACTIVE(h, w, l, fn) __CRACK_LONG_F(fn,(h)) +#define HANDLE_WM_MDIICONARRANGE(h, w, l, fn) __CRACK_ZERO_F(fn,(h)) +#define HANDLE_WM_MDISETMENU(h, w, l, fn) __CRACK_LONG_F(fn,(h, (BOOL)w, (HMENU)w, (HMENU)l) +#define HANDLE_WM_MDITILE(h, w, l, fn) __CRACK_LONG_F(fn,(h, (UINT)w)) +#define HANDLE_WM_PAINT(h, w, l, fn) __CRACK_ZERO_F(fn,(h)) +#define HANDLE_WM_QUERYENDSESSION(h, w, l, fn) MAKELRESULT(fn(h), 0) +#define HANDLE_WM_SIZE(h, w, l, fn) __CRACK_ZERO_F(fn,(h, (UINT)w, SEXT_LOWORD(l), SEXT_HIWORD(l))) +#define HANDLE_WM_SYSCOMMAND(h, w, l, fn) __CRACK_ZERO_F(fn,(h, (UINT)w, SEXT_LOWORD(l), SEXT_HIWORD(l))) + +/* Totally disgusting! get wParam and lParam from the environment ! */ +#define HANDLE_MSG(h, message, fn) case message: return HANDLE_##message(h, wParam, lParam, fn) + +/* END OF windowsx.h stuff from old headers */ +/* ------------------------------------------------------------------ */ +/* BEGINNING of shellapi.h stuff from old headers */ + +#define SE_ERR_SHARE 26 +#define SE_ERR_ASSOCINCOMPLETE 27 +#define SE_ERR_DDETIMEOUT 28 +#define SE_ERR_DDEFAIL 29 +#define SE_ERR_DDEBUSY 30 +#define SE_ERR_NOASSOC 31 + +/* END OF shellapi.h stuff from old headers */ +/* ------------------------------------------------------------------ */ +/* From ddeml.h in old Cygnus headers */ + +#define XCLASS_BOOL 0x1000 +#define XCLASS_DATA 0x2000 +#define XCLASS_FLAGS 0x4000 +#define XCLASS_MASK 0xfc00 +#define XCLASS_NOTIFICATION 0x8000 +#define XTYPF_NOBLOCK 0x0002 +#define XTYP_ADVDATA 0x4010 +#define XTYP_ADVREQ 0x2022 +#define XTYP_ADVSTART 0x1030 +#define XTYP_ADVSTOP 0x8040 +#define XTYP_CONNECT 0x1062 +#define XTYP_CONNECT_CONFIRM 0x8072 +#define XTYP_DISCONNECT 0x80c2 +#define XTYP_EXECUTE 0x4050 +#define XTYP_POKE 0x4090 +#define XTYP_REQUEST 0x20b0 +#define XTYP_WILDCONNECT 0x20E2 +#define XTYP_REGISTER 0x80A2 +#define XTYP_ERROR 0x8002 +#define XTYP_XACT_COMPLETE 0x8080 +#define XTYP_UNREGISTER 0x80D2 + +#define DMLERR_DLL_USAGE 0x4004 +#define DMLERR_INVALIDPARAMETER 0x4006 +#define DMLERR_NOTPROCESSED 0x4009 +#define DMLERR_POSTMSG_FAILED 0x400c +#define DMLERR_SERVER_DIED 0x400e +#define DMLERR_SYS_ERROR 0x400f +#define DMLERR_BUSY 0x4001 +#define DMLERR_DATAACKTIMEOUT 0x4002 +#define DMLERR_ADVACKTIMEOUT 0x4000 +#define DMLERR_DLL_NOT_INITIALIZED 0x4003 +#define DMLERR_LOW_MEMORY 0x4007 +#define DMLERR_MEMORY_ERROR 0x4008 +#define DMLERR_POKEACKTIMEOUT 0x400b +#define DMLERR_NO_CONV_ESTABLISHED 0x400a +#define DMLERR_REENTRANCY 0x400d +#define DMLERR_UNFOUND_QUEUE_ID 0x4011 +#define DMLERR_UNADVACKTIMEOUT 0x4010 +#define DMLERR_EXECACKTIMEOUT 0x4005 +#define DDE_FACK 0x8000 +#define DDE_FNOTPROCESSED 0x0000 + +#define DNS_REGISTER 0x0001 +#define DNS_UNREGISTER 0x0002 +#define CP_WINANSI 1004 +#define CP_WINUNICODE 1200 +#define EXPENTRY CALLBACK +#define APPCLASS_STANDARD 0x00000000 + +/* End of stuff from ddeml.h in old Cygnus headers */ +/* ----------------------------------------------- */ + +#define BKMODE_LAST (2) + +#define CTLCOLOR_MSGBOX (0) +#define CTLCOLOR_EDIT (1) +#define CTLCOLOR_LISTBOX (2) +#define CTLCOLOR_BTN (3) +#define CTLCOLOR_DLG (4) +#define CTLCOLOR_SCROLLBAR (5) +#define CTLCOLOR_STATIC (6) +#define CTLCOLOR_MAX (7) + +#define META_SETMAPMODE (0x0103L) +#define META_SETWINDOWORG (0x020BL) +#define META_SETWINDOWEXT (0x020CL) + +#define POLYFILL_LAST (2) + + +#define EXCEPTION_CTRL_C + +#define PROCESSOR_ARCHITECTURE_INTEL 0 +#define PROCESSOR_ARCHITECTURE_MIPS 1 +#define PROCESSOR_ARCHITECTURE_ALPHA 2 +#define PROCESSOR_ARCHITECTURE_PPC 3 + +#define FreeModule(h) FreeLibrary(h) +#define MakeProcInstance(p,i) (p) +#define FreeProcInstance(p) (p) + +#define _fmemcpy memcpy + +/* Used by wxwindows. */ +#define SIZEFULLSCREEN SIZE_MAXIMIZED +#define SIZENORMAL SIZE_RESTORED +#define SIZEICONIC SIZE_MINIMIZED +#define NPLOGPALETTE PLOGPALETTE + +/* In the old winnt.h */ +#if 0 +#ifdef __ANAL__ +#define DECLARE_HANDLE(h) struct h##__ { int dummy; }; typedef struct h##__ *h +#else +#define DECLARE_HANDLE(h) typedef void *h +#endif +DECLARE_HANDLE(HANDLE); +#endif + +#ifdef __PPC__ +#define CONTEXT_CONTROL 1L +#define CONTEXT_FLOATING_POINT 2L +#define CONTEXT_INTEGER 4L +#define CONTEXT_DEBUG_REGISTERS 8L + +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) +#define CONTEXT_DEBUGGER (CONTEXT_FULL) + +#else /* x86 */ +/* The doc refered me to winnt.h, so I had to look... */ +#define SIZE_OF_80387_REGISTERS 80 + +/* Values for contextflags */ +#define CONTEXT_i386 0x10000 +#define CONTEXT_CONTROL (CONTEXT_i386 | 1) +#define CONTEXT_INTEGER (CONTEXT_i386 | 2) +#define CONTEXT_SEGMENTS (CONTEXT_i386 | 4) +#define CONTEXT_FLOATING_POINT (CONTEXT_i386 | 8) +#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386 | 0x10) +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS) + +/* our own invention */ +#define FLAG_TRACE_BIT 0x100 +#define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT) + +#endif + +#define ASCIICHAR AsciiChar +#define FAR + +#define FILTER_TEMP_DUPLICATE_ACCOUNT (0x0001) +#define FILTER_NORMAL_ACCOUNT (0x0002) +#define FILTER_INTERDOMAIN_TRUST_ACCOUNT (0x0008) +#define FILTER_WORKSTATION_TRUST_ACCOUNT (0x0010) +#define FILTER_SERVER_TRUST_ACCOUNT (0x0020) + +#define LOGON32_LOGON_INTERACTIVE (0x02) +#define LOGON32_LOGON_BATCH (0x04) +#define LOGON32_LOGON_SERVICE (0x05) +#define LOGON32_PROVIDER_DEFAULT (0x00) +#define LOGON32_PROVIDER_WINNT35 (0x01) + +#define QID_SYNC 0xFFFFFFFF + + +/* To mark direction in formal parameters list */ + +#ifndef IN +#define IN +#endif +#ifndef OUT +#define OUT +#endif +#ifndef OPTIONAL +#define OPTIONAL +#endif + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* WIN32_LEAN_AND_MEAN */ + +#endif /* _GNU_H_WINDOWS32_DEFINES */ diff --git a/reactos/include/devices.h b/reactos/include/devices.h new file mode 100644 index 00000000000..ada5eb8c768 --- /dev/null +++ b/reactos/include/devices.h @@ -0,0 +1,16 @@ +typedef struct +{ + LPSTR LeftVolumeName; + LPSTR RightVolumeName; + ULONG DefaultVolume; + ULONG Type; + ULONG DeviceType; + char Key[4]; + LPSTR PrototypeName; + PVOID DeferredRoutine; + PVOID ExclusionRoutine; + PVOID DispatchRoutine; + PVOID DevCapsRoutine; + PVOID HwSetVolume; + ULONG IoMethod; +}SOUND_DEVICE_INIT; diff --git a/reactos/include/errors.h b/reactos/include/errors.h new file mode 100644 index 00000000000..fbb40233b2d --- /dev/null +++ b/reactos/include/errors.h @@ -0,0 +1,1163 @@ +/* + Errors.h + + Windows32 API error codes + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + + This file is part of the Windows32 API Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + If you are interested in a warranty or support for this source code, + contact Scott Christley for more information. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNU_H_WINDOWS32_ERROR +#define _GNU_H_WINDOWS32_ERROR + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +// +// Return Code macros +// +#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0) +#define FAILED(Status) ((HRESULT)(Status)<0) + +// +// Success Codes +// +#define S_OK 0x00000000L +#define S_FALSE 0x00000001L + +/* Numerical order */ + +#define LZERROR_UNKNOWNALG (-8) +#define LZERROR_BADVALUE (-7) +#define LZERROR_GLOBLOCK (-6) +#define LZERROR_GLOBALLOC (-5) +#define LZERROR_WRITE (-4) +#define LZERROR_READ (-3) +#define LZERROR_BADOUTHANDLE (-2) +#define LZERROR_BADINHANDLE (-1) +#define NO_ERROR 0L +#define ERROR_SUCCESS 0L +#define ERROR_INVALID_FUNCTION 1L +#define ERROR_FILE_NOT_FOUND 2L +#define ERROR_PATH_NOT_FOUND 3L +#define ERROR_TOO_MANY_OPEN_FILES 4L +#define ERROR_ACCESS_DENIED 5L +#define ERROR_INVALID_HANDLE 6L +#define ERROR_ARENA_TRASHED 7L +#define ERROR_NOT_ENOUGH_MEMORY 8L +#define ERROR_INVALID_BLOCK 9L +#define ERROR_BAD_ENVIRONMENT 10L +#define ERROR_BAD_FORMAT 11L +#define ERROR_INVALID_ACCESS 12L +#define ERROR_INVALID_DATA 13L +#define ERROR_OUTOFMEMORY 14L +#define ERROR_INVALID_DRIVE 15L +#define ERROR_CURRENT_DIRECTORY 16L +#define ERROR_NOT_SAME_DEVICE 17L +#define ERROR_NO_MORE_FILES 18L +#define ERROR_WRITE_PROTECT 19L +#define ERROR_BAD_UNIT 20L +#define ERROR_NOT_READY 21L +#define ERROR_BAD_COMMAND 22L +#define ERROR_CRC 23L +#define ERROR_BAD_LENGTH 24L +#define ERROR_SEEK 25L +#define ERROR_NOT_DOS_DISK 26L +#define ERROR_SECTOR_NOT_FOUND 27L +#define ERROR_OUT_OF_PAPER 28L +#define ERROR_WRITE_FAULT 29L +#define ERROR_READ_FAULT 30L +#define ERROR_GEN_FAILURE 31L +#define ERROR_SHARING_VIOLATION 32L +#define ERROR_LOCK_VIOLATION 33L +#define ERROR_WRONG_DISK 34L +#define ERROR_SHARING_BUFFER_EXCEEDED 36L +#define ERROR_HANDLE_EOF 38L +#define ERROR_HANDLE_DISK_FULL 39L +#define ERROR_NOT_SUPPORTED 50L +#define ERROR_REM_NOT_LIST 51L +#define ERROR_DUP_NAME 52L +#define ERROR_BAD_NETPATH 53L +#define ERROR_NETWORK_BUSY 54L +#define ERROR_DEV_NOT_EXIST 55L +#define ERROR_TOO_MANY_CMDS 56L +#define ERROR_ADAP_HDW_ERR 57L +#define ERROR_BAD_NET_RESP 58L +#define ERROR_UNEXP_NET_ERR 59L +#define ERROR_BAD_REM_ADAP 60L +#define ERROR_PRINTQ_FULL 61L +#define ERROR_NO_SPOOL_SPACE 62L +#define ERROR_PRINT_CANCELLED 63L +#define ERROR_NETNAME_DELETED 64L +#define ERROR_NETWORK_ACCESS_DENIED 65L +#define ERROR_BAD_DEV_TYPE 66L +#define ERROR_BAD_NET_NAME 67L +#define ERROR_TOO_MANY_NAMES 68L +#define ERROR_TOO_MANY_SESS 69L +#define ERROR_SHARING_PAUSED 70L +#define ERROR_REQ_NOT_ACCEP 71L +#define ERROR_REDIR_PAUSED 72L +#define ERROR_FILE_EXISTS 80L +#define ERROR_CANNOT_MAKE 82L +#define ERROR_FAIL_I24 83L +#define ERROR_OUT_OF_STRUCTURES 84L +#define ERROR_ALREADY_ASSIGNED 85L +#define ERROR_INVALID_PASSWORD 86L +#define ERROR_INVALID_PARAMETER 87L +#define ERROR_NET_WRITE_FAULT 88L +#define ERROR_NO_PROC_SLOTS 89L +#define ERROR_TOO_MANY_SEMAPHORES 100L +#define ERROR_EXCL_SEM_ALREADY_OWNED 101L +#define ERROR_SEM_IS_SET 102L +#define ERROR_TOO_MANY_SEM_REQUESTS 103L +#define ERROR_INVALID_AT_INTERRUPT_TIME 104L +#define ERROR_SEM_OWNER_DIED 105L +#define ERROR_SEM_USER_LIMIT 106L +#define ERROR_DISK_CHANGE 107L +#define ERROR_DRIVE_LOCKED 108L +#define ERROR_BROKEN_PIPE 109L +#define ERROR_OPEN_FAILED 110L +#define ERROR_BUFFER_OVERFLOW 111L +#define ERROR_DISK_FULL 112L +#define ERROR_NO_MORE_SEARCH_HANDLES 113L +#define ERROR_INVALID_TARGET_HANDLE 114L +#define ERROR_INVALID_CATEGORY 117L +#define ERROR_INVALID_VERIFY_SWITCH 118L +#define ERROR_BAD_DRIVER_LEVEL 119L +#define ERROR_CALL_NOT_IMPLEMENTED 120L +#define ERROR_SEM_TIMEOUT 121L +#define ERROR_INSUFFICIENT_BUFFER 122L +#define ERROR_INVALID_NAME 123L +#define ERROR_INVALID_LEVEL 124L +#define ERROR_NO_VOLUME_LABEL 125L +#define ERROR_MOD_NOT_FOUND 126L +#define ERROR_PROC_NOT_FOUND 127L +#define ERROR_WAIT_NO_CHILDREN 128L +#define ERROR_CHILD_NOT_COMPLETE 129L +#define ERROR_DIRECT_ACCESS_HANDLE 130L +#define ERROR_NEGATIVE_SEEK 131L +#define ERROR_SEEK_ON_DEVICE 132L +#define ERROR_IS_JOIN_TARGET 133L +#define ERROR_IS_JOINED 134L +#define ERROR_IS_SUBSTED 135L +#define ERROR_NOT_JOINED 136L +#define ERROR_NOT_SUBSTED 137L +#define ERROR_JOIN_TO_JOIN 138L +#define ERROR_SUBST_TO_SUBST 139L +#define ERROR_JOIN_TO_SUBST 140L +#define ERROR_SUBST_TO_JOIN 141L +#define ERROR_BUSY_DRIVE 142L +#define ERROR_SAME_DRIVE 143L +#define ERROR_DIR_NOT_ROOT 144L +#define ERROR_DIR_NOT_EMPTY 145L +#define ERROR_IS_SUBST_PATH 146L +#define ERROR_IS_JOIN_PATH 147L +#define ERROR_PATH_BUSY 148L +#define ERROR_IS_SUBST_TARGET 149L +#define ERROR_SYSTEM_TRACE 150L +#define ERROR_INVALID_EVENT_COUNT 151L +#define ERROR_TOO_MANY_MUXWAITERS 152L +#define ERROR_INVALID_LIST_FORMAT 153L +#define ERROR_LABEL_TOO_LONG 154L +#define ERROR_TOO_MANY_TCBS 155L +#define ERROR_SIGNAL_REFUSED 156L +#define ERROR_DISCARDED 157L +#define ERROR_NOT_LOCKED 158L +#define ERROR_BAD_THREADID_ADDR 159L +#define ERROR_BAD_ARGUMENTS 160L +#define ERROR_BAD_PATHNAME 161L +#define ERROR_SIGNAL_PENDING 162L +#define ERROR_MAX_THRDS_REACHED 164L +#define ERROR_LOCK_FAILED 167L +#define ERROR_BUSY 170L +#define ERROR_CANCEL_VIOLATION 173L +#define ERROR_ATOMIC_LOCKS_NOT_SUPPORTED 174L +#define ERROR_INVALID_SEGMENT_NUMBER 180L +#define ERROR_INVALID_ORDINAL 182L +#define ERROR_ALREADY_EXISTS 183L +#define ERROR_INVALID_FLAG_NUMBER 186L +#define ERROR_SEM_NOT_FOUND 187L +#define ERROR_INVALID_STARTING_CODESEG 188L +#define ERROR_INVALID_STACKSEG 189L +#define ERROR_INVALID_MODULETYPE 190L +#define ERROR_INVALID_EXE_SIGNATURE 191L +#define ERROR_EXE_MARKED_INVALID 192L +#define ERROR_BAD_EXE_FORMAT 193L +#define ERROR_ITERATED_DATA_EXCEEDS_64k 194L +#define ERROR_INVALID_MINALLOCSIZE 195L +#define ERROR_DYNLINK_FROM_INVALID_RING 196L +#define ERROR_IOPL_NOT_ENABLED 197L +#define ERROR_INVALID_SEGDPL 198L +#define ERROR_AUTODATASEG_EXCEEDS_64k 199L +#define ERROR_RING2SEG_MUST_BE_MOVABLE 200L +#define ERROR_RELOC_CHAIN_XEEDS_SEGLIM 201L +#define ERROR_INFLOOP_IN_RELOC_CHAIN 202L +#define ERROR_ENVVAR_NOT_FOUND 203L +#define ERROR_NO_SIGNAL_SENT 205L +#define ERROR_FILENAME_EXCED_RANGE 206L +#define ERROR_RING2_STACK_IN_USE 207L +#define ERROR_META_EXPANSION_TOO_LONG 208L +#define ERROR_INVALID_SIGNAL_NUMBER 209L +#define ERROR_THREAD_1_INACTIVE 210L +#define ERROR_LOCKED 212L +#define ERROR_TOO_MANY_MODULES 214L +#define ERROR_NESTING_NOT_ALLOWED 215L +#define ERROR_BAD_PIPE 230L +#define ERROR_PIPE_BUSY 231L +#define ERROR_NO_DATA 232L +#define ERROR_PIPE_NOT_CONNECTED 233L +#define ERROR_MORE_DATA 234L +#define ERROR_VC_DISCONNECTED 240L +#define ERROR_INVALID_EA_NAME 254L +#define ERROR_EA_LIST_INCONSISTENT 255L +#define ERROR_NO_MORE_ITEMS 259L +#define ERROR_CANNOT_COPY 266L +#define ERROR_DIRECTORY 267L +#define ERROR_EAS_DIDNT_FIT 275L +#define ERROR_EA_FILE_CORRUPT 276L +#define ERROR_EA_TABLE_FULL 277L +#define ERROR_INVALID_EA_HANDLE 278L +#define ERROR_EAS_NOT_SUPPORTED 282L +#define ERROR_NOT_OWNER 288L +#define ERROR_TOO_MANY_POSTS 298L +#define ERROR_PARTIAL_COPY 299L +#define ERROR_MR_MID_NOT_FOUND 317L +#define ERROR_INVALID_ADDRESS 487L +#define ERROR_ARITHMETIC_OVERFLOW 534L +#define ERROR_PIPE_CONNECTED 535L +#define ERROR_PIPE_LISTENING 536L +#define ERROR_EA_ACCESS_DENIED 994L +#define ERROR_OPERATION_ABORTED 995L +#define ERROR_IO_INCOMPLETE 996L +#define ERROR_IO_PENDING 997L +#define ERROR_NOACCESS 998L +#define ERROR_SWAPERROR 999L +#define ERROR_STACK_OVERFLOW 1001L +#define ERROR_INVALID_MESSAGE 1002L +#define ERROR_CAN_NOT_COMPLETE 1003L +#define ERROR_INVALID_FLAGS 1004L +#define ERROR_UNRECOGNIZED_VOLUME 1005L +#define ERROR_FILE_INVALID 1006L +#define ERROR_FULLSCREEN_MODE 1007L +#define ERROR_NO_TOKEN 1008L +#define ERROR_BADDB 1009L +#define ERROR_BADKEY 1010L +#define ERROR_CANTOPEN 1011L +#define ERROR_CANTREAD 1012L +#define ERROR_CANTWRITE 1013L +#define ERROR_REGISTRY_RECOVERED 1014L +#define ERROR_REGISTRY_CORRUPT 1015L +#define ERROR_REGISTRY_IO_FAILED 1016L +#define ERROR_NOT_REGISTRY_FILE 1017L +#define ERROR_KEY_DELETED 1018L +#define ERROR_NO_LOG_SPACE 1019L +#define ERROR_KEY_HAS_CHILDREN 1020L +#define ERROR_CHILD_MUST_BE_VOLATILE 1021L +#define ERROR_NOTIFY_ENUM_DIR 1022L +#define ERROR_DEPENDENT_SERVICES_RUNNING 1051L +#define ERROR_INVALID_SERVICE_CONTROL 1052L +#define ERROR_SERVICE_REQUEST_TIMEOUT 1053L +#define ERROR_SERVICE_NO_THREAD 1054L +#define ERROR_SERVICE_DATABASE_LOCKED 1055L +#define ERROR_SERVICE_ALREADY_RUNNING 1056L +#define ERROR_INVALID_SERVICE_ACCOUNT 1057L +#define ERROR_SERVICE_DISABLED 1058L +#define ERROR_CIRCULAR_DEPENDENCY 1059L +#define ERROR_SERVICE_DOES_NOT_EXIST 1060L +#define ERROR_SERVICE_CANNOT_ACCEPT_CTRL 1061L +#define ERROR_SERVICE_NOT_ACTIVE 1062L +#define ERROR_FAILED_SERVICE_CONTROLLER_CONNECT 1063L +#define ERROR_EXCEPTION_IN_SERVICE 1064L +#define ERROR_DATABASE_DOES_NOT_EXIST 1065L +#define ERROR_SERVICE_SPECIFIC_ERROR 1066L +#define ERROR_PROCESS_ABORTED 1067L +#define ERROR_SERVICE_DEPENDENCY_FAIL 1068L +#define ERROR_SERVICE_LOGON_FAILED 1069L +#define ERROR_SERVICE_START_HANG 1070L +#define ERROR_INVALID_SERVICE_LOCK 1071L +#define ERROR_SERVICE_MARKED_FOR_DELETE 1072L +#define ERROR_SERVICE_EXISTS 1073L +#define ERROR_ALREADY_RUNNING_LKG 1074L +#define ERROR_SERVICE_DEPENDENCY_DELETED 1075L +#define ERROR_BOOT_ALREADY_ACCEPTED 1076L +#define ERROR_SERVICE_NEVER_STARTED 1077L +#define ERROR_DUPLICATE_SERVICE_NAME 1078L +#define ERROR_END_OF_MEDIA 1100L +#define ERROR_FILEMARK_DETECTED 1101L +#define ERROR_BEGINNING_OF_MEDIA 1102L +#define ERROR_SETMARK_DETECTED 1103L +#define ERROR_NO_DATA_DETECTED 1104L +#define ERROR_PARTITION_FAILURE 1105L +#define ERROR_INVALID_BLOCK_LENGTH 1106L +#define ERROR_DEVICE_NOT_PARTITIONED 1107L +#define ERROR_UNABLE_TO_LOCK_MEDIA 1108L +#define ERROR_UNABLE_TO_UNLOAD_MEDIA 1109L +#define ERROR_MEDIA_CHANGED 1110L +#define ERROR_BUS_RESET 1111L +#define ERROR_NO_MEDIA_IN_DRIVE 1112L +#define ERROR_NO_UNICODE_TRANSLATION 1113L +#define ERROR_DLL_INIT_FAILED 1114L +#define ERROR_SHUTDOWN_IN_PROGRESS 1115L +#define ERROR_NO_SHUTDOWN_IN_PROGRESS 1116L +#define ERROR_IO_DEVICE 1117L +#define ERROR_SERIAL_NO_DEVICE 1118L +#define ERROR_IRQ_BUSY 1119L +#define ERROR_MORE_WRITES 1120L +#define ERROR_COUNTER_TIMEOUT 1121L +#define ERROR_FLOPPY_ID_MARK_NOT_FOUND 1122L +#define ERROR_FLOPPY_WRONG_CYLINDER 1123L +#define ERROR_FLOPPY_UNKNOWN_ERROR 1124L +#define ERROR_FLOPPY_BAD_REGISTERS 1125L +#define ERROR_DISK_RECALIBRATE_FAILED 1126L +#define ERROR_DISK_OPERATION_FAILED 1127L +#define ERROR_DISK_RESET_FAILED 1128L +#define ERROR_EOM_OVERFLOW 1129L +#define ERROR_NOT_ENOUGH_SERVER_MEMORY 1130L +#define ERROR_POSSIBLE_DEADLOCK 1131L +#define ERROR_MAPPED_ALIGNMENT 1132L +#define ERROR_SET_POWER_STATE_VETOED 1140L +#define ERROR_SET_POWER_STATE_FAILED 1141L +#define ERROR_TOO_MANY_LINKS 1142L +#define ERROR_OLD_WIN_VERSION 1150L +#define ERROR_APP_WRONG_OS 1151L +#define ERROR_SINGLE_INSTANCE_APP 1152L +#define ERROR_RMODE_APP 1153L +#define ERROR_INVALID_DLL 1154L +#define ERROR_NO_ASSOCIATION 1155L +#define ERROR_DDE_FAIL 1156L +#define ERROR_DLL_NOT_FOUND 1157L +#define ERROR_BAD_DEVICE 1200L +#define ERROR_CONNECTION_UNAVAIL 1201L +#define ERROR_DEVICE_ALREADY_REMEMBERED 1202L +#define ERROR_NO_NET_OR_BAD_PATH 1203L +#define ERROR_BAD_PROVIDER 1204L +#define ERROR_CANNOT_OPEN_PROFILE 1205L +#define ERROR_BAD_PROFILE 1206L +#define ERROR_NOT_CONTAINER 1207L +#define ERROR_EXTENDED_ERROR 1208L +#define ERROR_INVALID_GROUPNAME 1209L +#define ERROR_INVALID_COMPUTERNAME 1210L +#define ERROR_INVALID_EVENTNAME 1211L +#define ERROR_INVALID_DOMAINNAME 1212L +#define ERROR_INVALID_SERVICENAME 1213L +#define ERROR_INVALID_NETNAME 1214L +#define ERROR_INVALID_SHARENAME 1215L +#define ERROR_INVALID_PASSWORDNAME 1216L +#define ERROR_INVALID_MESSAGENAME 1217L +#define ERROR_INVALID_MESSAGEDEST 1218L +#define ERROR_SESSION_CREDENTIAL_CONFLICT 1219L +#define ERROR_REMOTE_SESSION_LIMIT_EXCEEDED 1220L +#define ERROR_DUP_DOMAINNAME 1221L +#define ERROR_NO_NETWORK 1222L +#define ERROR_CANCELLED 1223L +#define ERROR_USER_MAPPED_FILE 1224L +#define ERROR_CONNECTION_REFUSED 1225L +#define ERROR_GRACEFUL_DISCONNECT 1226L +#define ERROR_ADDRESS_ALREADY_ASSOCIATED 1227L +#define ERROR_ADDRESS_NOT_ASSOCIATED 1228L +#define ERROR_CONNECTION_INVALID 1229L +#define ERROR_CONNECTION_ACTIVE 1230L +#define ERROR_NETWORK_UNREACHABLE 1231L +#define ERROR_HOST_UNREACHABLE 1232L +#define ERROR_PROTOCOL_UNREACHABLE 1233L +#define ERROR_PORT_UNREACHABLE 1234L +#define ERROR_REQUEST_ABORTED 1235L +#define ERROR_CONNECTION_ABORTED 1236L +#define ERROR_RETRY 1237L +#define ERROR_CONNECTION_COUNT_LIMIT 1238L +#define ERROR_LOGIN_TIME_RESTRICTION 1239L +#define ERROR_LOGIN_WKSTA_RESTRICTION 1240L +#define ERROR_INCORRECT_ADDRESS 1241L +#define ERROR_ALREADY_REGISTERED 1242L +#define ERROR_SERVICE_NOT_FOUND 1243L +#define ERROR_NOT_AUTHENTICATED 1244L +#define ERROR_NOT_LOGGED_ON 1245L +#define ERROR_CONTINUE 1246L +#define ERROR_ALREADY_INITIALIZED 1247L +#define ERROR_NO_MORE_DEVICES 1248L +#define ERROR_NOT_ALL_ASSIGNED 1300L +#define ERROR_SOME_NOT_MAPPED 1301L +#define ERROR_NO_QUOTAS_FOR_ACCOUNT 1302L +#define ERROR_LOCAL_USER_SESSION_KEY 1303L +#define ERROR_NULL_LM_PASSWORD 1304L +#define ERROR_UNKNOWN_REVISION 1305L +#define ERROR_REVISION_MISMATCH 1306L +#define ERROR_INVALID_OWNER 1307L +#define ERROR_INVALID_PRIMARY_GROUP 1308L +#define ERROR_NO_IMPERSONATION_TOKEN 1309L +#define ERROR_CANT_DISABLE_MANDATORY 1310L +#define ERROR_NO_LOGON_SERVERS 1311L +#define ERROR_NO_SUCH_LOGON_SESSION 1312L +#define ERROR_NO_SUCH_PRIVILEGE 1313L +#define ERROR_PRIVILEGE_NOT_HELD 1314L +#define ERROR_INVALID_ACCOUNT_NAME 1315L +#define ERROR_USER_EXISTS 1316L +#define ERROR_NO_SUCH_USER 1317L +#define ERROR_GROUP_EXISTS 1318L +#define ERROR_NO_SUCH_GROUP 1319L +#define ERROR_MEMBER_IN_GROUP 1320L +#define ERROR_MEMBER_NOT_IN_GROUP 1321L +#define ERROR_LAST_ADMIN 1322L +#define ERROR_WRONG_PASSWORD 1323L +#define ERROR_ILL_FORMED_PASSWORD 1324L +#define ERROR_PASSWORD_RESTRICTION 1325L +#define ERROR_LOGON_FAILURE 1326L +#define ERROR_ACCOUNT_RESTRICTION 1327L +#define ERROR_INVALID_LOGON_HOURS 1328L +#define ERROR_INVALID_WORKSTATION 1329L +#define ERROR_PASSWORD_EXPIRED 1330L +#define ERROR_ACCOUNT_DISABLED 1331L +#define ERROR_NONE_MAPPED 1332L +#define ERROR_TOO_MANY_LUIDS_REQUESTED 1333L +#define ERROR_LUIDS_EXHAUSTED 1334L +#define ERROR_INVALID_SUB_AUTHORITY 1335L +#define ERROR_INVALID_ACL 1336L +#define ERROR_INVALID_SID 1337L +#define ERROR_INVALID_SECURITY_DESCR 1338L +#define ERROR_BAD_INHERITANCE_ACL 1340L +#define ERROR_SERVER_DISABLED 1341L +#define ERROR_SERVER_NOT_DISABLED 1342L +#define ERROR_INVALID_ID_AUTHORITY 1343L +#define ERROR_ALLOTTED_SPACE_EXCEEDED 1344L +#define ERROR_INVALID_GROUP_ATTRIBUTES 1345L +#define ERROR_BAD_IMPERSONATION_LEVEL 1346L +#define ERROR_CANT_OPEN_ANONYMOUS 1347L +#define ERROR_BAD_VALIDATION_CLASS 1348L +#define ERROR_BAD_TOKEN_TYPE 1349L +#define ERROR_NO_SECURITY_ON_OBJECT 1350L +#define ERROR_CANT_ACCESS_DOMAIN_INFO 1351L +#define ERROR_INVALID_SERVER_STATE 1352L +#define ERROR_INVALID_DOMAIN_STATE 1353L +#define ERROR_INVALID_DOMAIN_ROLE 1354L +#define ERROR_NO_SUCH_DOMAIN 1355L +#define ERROR_DOMAIN_EXISTS 1356L +#define ERROR_DOMAIN_LIMIT_EXCEEDED 1357L +#define ERROR_INTERNAL_DB_CORRUPTION 1358L +#define ERROR_INTERNAL_ERROR 1359L +#define ERROR_GENERIC_NOT_MAPPED 1360L +#define ERROR_BAD_DESCRIPTOR_FORMAT 1361L +#define ERROR_NOT_LOGON_PROCESS 1362L +#define ERROR_LOGON_SESSION_EXISTS 1363L +#define ERROR_NO_SUCH_PACKAGE 1364L +#define ERROR_BAD_LOGON_SESSION_STATE 1365L +#define ERROR_LOGON_SESSION_COLLISION 1366L +#define ERROR_INVALID_LOGON_TYPE 1367L +#define ERROR_CANNOT_IMPERSONATE 1368L +#define ERROR_RXACT_INVALID_STATE 1369L +#define ERROR_RXACT_COMMIT_FAILURE 1370L +#define ERROR_SPECIAL_ACCOUNT 1371L +#define ERROR_SPECIAL_GROUP 1372L +#define ERROR_SPECIAL_USER 1373L +#define ERROR_MEMBERS_PRIMARY_GROUP 1374L +#define ERROR_TOKEN_ALREADY_IN_USE 1375L +#define ERROR_NO_SUCH_ALIAS 1376L +#define ERROR_MEMBER_NOT_IN_ALIAS 1377L +#define ERROR_MEMBER_IN_ALIAS 1378L +#define ERROR_ALIAS_EXISTS 1379L +#define ERROR_LOGON_NOT_GRANTED 1380L +#define ERROR_TOO_MANY_SECRETS 1381L +#define ERROR_SECRET_TOO_LONG 1382L +#define ERROR_INTERNAL_DB_ERROR 1383L +#define ERROR_TOO_MANY_CONTEXT_IDS 1384L +#define ERROR_LOGON_TYPE_NOT_GRANTED 1385L +#define ERROR_NT_CROSS_ENCRYPTION_REQUIRED 1386L +#define ERROR_NO_SUCH_MEMBER 1387L +#define ERROR_INVALID_MEMBER 1388L +#define ERROR_TOO_MANY_SIDS 1389L +#define ERROR_LM_CROSS_ENCRYPTION_REQUIRED 1390L +#define ERROR_NO_INHERITANCE 1391L +#define ERROR_FILE_CORRUPT 1392L +#define ERROR_DISK_CORRUPT 1393L +#define ERROR_NO_USER_SESSION_KEY 1394L +#define ERROR_LICENSE_QUOTA_EXCEEDED 1395L +#define ERROR_INVALID_WINDOW_HANDLE 1400L +#define ERROR_INVALID_MENU_HANDLE 1401L +#define ERROR_INVALID_CURSOR_HANDLE 1402L +#define ERROR_INVALID_ACCEL_HANDLE 1403L +#define ERROR_INVALID_HOOK_HANDLE 1404L +#define ERROR_INVALID_DWP_HANDLE 1405L +#define ERROR_TLW_WITH_WSCHILD 1406L +#define ERROR_CANNOT_FIND_WND_CLASS 1407L +#define ERROR_WINDOW_OF_OTHER_THREAD 1408L +#define ERROR_HOTKEY_ALREADY_REGISTERED 1409L +#define ERROR_CLASS_ALREADY_EXISTS 1410L +#define ERROR_CLASS_DOES_NOT_EXIST 1411L +#define ERROR_CLASS_HAS_WINDOWS 1412L +#define ERROR_INVALID_INDEX 1413L +#define ERROR_INVALID_ICON_HANDLE 1414L +#define ERROR_PRIVATE_DIALOG_INDEX 1415L +#define ERROR_LISTBOX_ID_NOT_FOUND 1416L +#define ERROR_NO_WILDCARD_CHARACTERS 1417L +#define ERROR_CLIPBOARD_NOT_OPEN 1418L +#define ERROR_HOTKEY_NOT_REGISTERED 1419L +#define ERROR_WINDOW_NOT_DIALOG 1420L +#define ERROR_CONTROL_ID_NOT_FOUND 1421L +#define ERROR_INVALID_COMBOBOX_MESSAGE 1422L +#define ERROR_WINDOW_NOT_COMBOBOX 1423L +#define ERROR_INVALID_EDIT_HEIGHT 1424L +#define ERROR_DC_NOT_FOUND 1425L +#define ERROR_INVALID_HOOK_FILTER 1426L +#define ERROR_INVALID_FILTER_PROC 1427L +#define ERROR_HOOK_NEEDS_HMOD 1428L +#define ERROR_GLOBAL_ONLY_HOOK 1429L +#define ERROR_JOURNAL_HOOK_SET 1430L +#define ERROR_HOOK_NOT_INSTALLED 1431L +#define ERROR_INVALID_LB_MESSAGE 1432L +#define ERROR_SETCOUNT_ON_BAD_LB 1433L +#define ERROR_LB_WITHOUT_TABSTOPS 1434L +#define ERROR_DESTROY_OBJECT_OF_OTHER_THREAD 1435L +#define ERROR_CHILD_WINDOW_MENU 1436L +#define ERROR_NO_SYSTEM_MENU 1437L +#define ERROR_INVALID_MSGBOX_STYLE 1438L +#define ERROR_INVALID_SPI_VALUE 1439L +#define ERROR_SCREEN_ALREADY_LOCKED 1440L +#define ERROR_HWNDS_HAVE_DIFF_PARENT 1441L +#define ERROR_NOT_CHILD_WINDOW 1442L +#define ERROR_INVALID_GW_COMMAND 1443L +#define ERROR_INVALID_THREAD_ID 1444L +#define ERROR_NON_MDICHILD_WINDOW 1445L +#define ERROR_POPUP_ALREADY_ACTIVE 1446L +#define ERROR_NO_SCROLLBARS 1447L +#define ERROR_INVALID_SCROLLBAR_RANGE 1448L +#define ERROR_INVALID_SHOWWIN_COMMAND 1449L +#define ERROR_NO_SYSTEM_RESOURCES 1450L +#define ERROR_NONPAGED_SYSTEM_RESOURCES 1451L +#define ERROR_PAGED_SYSTEM_RESOURCES 1452L +#define ERROR_WORKING_SET_QUOTA 1453L +#define ERROR_PAGEFILE_QUOTA 1454L +#define ERROR_COMMITMENT_LIMIT 1455L +#define ERROR_MENU_ITEM_NOT_FOUND 1456L +#define ERROR_EVENTLOG_FILE_CORRUPT 1500L +#define ERROR_EVENTLOG_CANT_START 1501L +#define ERROR_LOG_FILE_FULL 1502L +#define ERROR_EVENTLOG_FILE_CHANGED 1503L +#define RPC_S_INVALID_STRING_BINDING 1700L +#define RPC_S_WRONG_KIND_OF_BINDING 1701L +#define RPC_S_INVALID_BINDING 1702L +#define RPC_S_PROTSEQ_NOT_SUPPORTED 1703L +#define RPC_S_INVALID_RPC_PROTSEQ 1704L +#define RPC_S_INVALID_STRING_UUID 1705L +#define RPC_S_INVALID_ENDPOINT_FORMAT 1706L +#define RPC_S_INVALID_NET_ADDR 1707L +#define RPC_S_NO_ENDPOINT_FOUND 1708L +#define RPC_S_INVALID_TIMEOUT 1709L +#define RPC_S_OBJECT_NOT_FOUND 1710L +#define RPC_S_ALREADY_REGISTERED 1711L +#define RPC_S_TYPE_ALREADY_REGISTERED 1712L +#define RPC_S_ALREADY_LISTENING 1713L +#define RPC_S_NO_PROTSEQS_REGISTERED 1714L +#define RPC_S_NOT_LISTENING 1715L +#define RPC_S_UNKNOWN_MGR_TYPE 1716L +#define RPC_S_UNKNOWN_IF 1717L +#define RPC_S_NO_BINDINGS 1718L +#define RPC_S_NO_PROTSEQS 1719L +#define RPC_S_CANT_CREATE_ENDPOINT 1720L +#define RPC_S_OUT_OF_RESOURCES 1721L +#define RPC_S_SERVER_UNAVAILABLE 1722L +#define RPC_S_SERVER_TOO_BUSY 1723L +#define RPC_S_INVALID_NETWORK_OPTIONS 1724L +#define RPC_S_NO_CALL_ACTIVE 1725L +#define RPC_S_CALL_FAILED 1726L +#define RPC_S_CALL_FAILED_DNE 1727L +#define RPC_S_PROTOCOL_ERROR 1728L +#define RPC_S_UNSUPPORTED_TRANS_SYN 1730L +#define RPC_S_UNSUPPORTED_TYPE 1732L +#define RPC_S_INVALID_TAG 1733L +#define RPC_S_INVALID_BOUND 1734L +#define RPC_S_NO_ENTRY_NAME 1735L +#define RPC_S_INVALID_NAME_SYNTAX 1736L +#define RPC_S_UNSUPPORTED_NAME_SYNTAX 1737L +#define RPC_S_UUID_NO_ADDRESS 1739L +#define RPC_S_DUPLICATE_ENDPOINT 1740L +#define RPC_S_UNKNOWN_AUTHN_TYPE 1741L +#define RPC_S_MAX_CALLS_TOO_SMALL 1742L +#define RPC_S_STRING_TOO_LONG 1743L +#define RPC_S_PROTSEQ_NOT_FOUND 1744L +#define RPC_S_PROCNUM_OUT_OF_RANGE 1745L +#define RPC_S_BINDING_HAS_NO_AUTH 1746L +#define RPC_S_UNKNOWN_AUTHN_SERVICE 1747L +#define RPC_S_UNKNOWN_AUTHN_LEVEL 1748L +#define RPC_S_INVALID_AUTH_IDENTITY 1749L +#define RPC_S_UNKNOWN_AUTHZ_SERVICE 1750L +#define EPT_S_INVALID_ENTRY 1751L +#define EPT_S_CANT_PERFORM_OP 1752L +#define EPT_S_NOT_REGISTERED 1753L +#define RPC_S_NOTHING_TO_EXPORT 1754L +#define RPC_S_INCOMPLETE_NAME 1755L +#define RPC_S_INVALID_VERS_OPTION 1756L +#define RPC_S_NO_MORE_MEMBERS 1757L +#define RPC_S_NOT_ALL_OBJS_UNEXPORTED 1758L +#define RPC_S_INTERFACE_NOT_FOUND 1759L +#define RPC_S_ENTRY_ALREADY_EXISTS 1760L +#define RPC_S_ENTRY_NOT_FOUND 1761L +#define RPC_S_NAME_SERVICE_UNAVAILABLE 1762L +#define RPC_S_INVALID_NAF_ID 1763L +#define RPC_S_CANNOT_SUPPORT 1764L +#define RPC_S_NO_CONTEXT_AVAILABLE 1765L +#define RPC_S_INTERNAL_ERROR 1766L +#define RPC_S_ZERO_DIVIDE 1767L +#define RPC_S_ADDRESS_ERROR 1768L +#define RPC_S_FP_DIV_ZERO 1769L +#define RPC_S_FP_UNDERFLOW 1770L +#define RPC_S_FP_OVERFLOW 1771L +#define RPC_X_NO_MORE_ENTRIES 1772L +#define RPC_X_SS_CHAR_TRANS_OPEN_FAIL 1773L +#define RPC_X_SS_CHAR_TRANS_SHORT_FILE 1774L +#define RPC_X_SS_IN_NULL_CONTEXT 1775L +#define RPC_X_SS_CONTEXT_DAMAGED 1777L +#define RPC_X_SS_HANDLES_MISMATCH 1778L +#define RPC_X_SS_CANNOT_GET_CALL_HANDLE 1779L +#define RPC_X_NULL_REF_POINTER 1780L +#define RPC_X_ENUM_VALUE_OUT_OF_RANGE 1781L +#define RPC_X_BYTE_COUNT_TOO_SMALL 1782L +#define RPC_X_BAD_STUB_DATA 1783L +#define ERROR_INVALID_USER_BUFFER 1784L +#define ERROR_UNRECOGNIZED_MEDIA 1785L +#define ERROR_NO_TRUST_LSA_SECRET 1786L +#define ERROR_NO_TRUST_SAM_ACCOUNT 1787L +#define ERROR_TRUSTED_DOMAIN_FAILURE 1788L +#define ERROR_TRUSTED_RELATIONSHIP_FAILURE 1789L +#define ERROR_TRUST_FAILURE 1790L +#define RPC_S_CALL_IN_PROGRESS 1791L +#define ERROR_NETLOGON_NOT_STARTED 1792L +#define ERROR_ACCOUNT_EXPIRED 1793L +#define ERROR_REDIRECTOR_HAS_OPEN_HANDLES 1794L +#define ERROR_PRINTER_DRIVER_ALREADY_INSTALLED 1795L +#define ERROR_UNKNOWN_PORT 1796L +#define ERROR_UNKNOWN_PRINTER_DRIVER 1797L +#define ERROR_UNKNOWN_PRINTPROCESSOR 1798L +#define ERROR_INVALID_SEPARATOR_FILE 1799L +#define ERROR_INVALID_PRIORITY 1800L +#define ERROR_INVALID_PRINTER_NAME 1801L +#define ERROR_PRINTER_ALREADY_EXISTS 1802L +#define ERROR_INVALID_PRINTER_COMMAND 1803L +#define ERROR_INVALID_DATATYPE 1804L +#define ERROR_INVALID_ENVIRONMENT 1805L +#define RPC_S_NO_MORE_BINDINGS 1806L +#define ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT 1807L +#define ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT 1808L +#define ERROR_NOLOGON_SERVER_TRUST_ACCOUNT 1809L +#define ERROR_DOMAIN_TRUST_INCONSISTENT 1810L +#define ERROR_SERVER_HAS_OPEN_HANDLES 1811L +#define ERROR_RESOURCE_DATA_NOT_FOUND 1812L +#define ERROR_RESOURCE_TYPE_NOT_FOUND 1813L +#define ERROR_RESOURCE_NAME_NOT_FOUND 1814L +#define ERROR_RESOURCE_LANG_NOT_FOUND 1815L +#define ERROR_NOT_ENOUGH_QUOTA 1816L +#define RPC_S_NO_INTERFACES 1817L +#define RPC_S_CALL_CANCELLED 1818L +#define RPC_S_BINDING_INCOMPLETE 1819L +#define RPC_S_COMM_FAILURE 1820L +#define RPC_S_UNSUPPORTED_AUTHN_LEVEL 1821L +#define RPC_S_NO_PRINC_NAME 1822L +#define RPC_S_NOT_RPC_ERROR 1823L +#define RPC_S_UUID_LOCAL_ONLY 1824L +#define RPC_S_SEC_PKG_ERROR 1825L +#define RPC_S_NOT_CANCELLED 1826L +#define RPC_X_INVALID_ES_ACTION 1827L +#define RPC_X_WRONG_ES_VERSION 1828L +#define RPC_X_WRONG_STUB_VERSION 1829L +#define RPC_X_INVALID_PIPE_OBJECT 1830L +#define RPC_X_WRONG_PIPE_ORDER 1831L +#define RPC_X_WRONG_PIPE_VERSION 1832L +#define RPC_S_GROUP_MEMBER_NOT_FOUND 1898L +#define EPT_S_CANT_CREATE 1899L +#define RPC_S_INVALID_OBJECT 1900L +#define ERROR_INVALID_TIME 1901L +#define ERROR_INVALID_FORM_NAME 1902L +#define ERROR_INVALID_FORM_SIZE 1903L +#define ERROR_ALREADY_WAITING 1904L +#define ERROR_PRINTER_DELETED 1905L +#define ERROR_INVALID_PRINTER_STATE 1906L +#define ERROR_PASSWORD_MUST_CHANGE 1907L +#define ERROR_DOMAIN_CONTROLLER_NOT_FOUND 1908L +#define ERROR_ACCOUNT_LOCKED_OUT 1909L +#define OR_INVALID_OXID 1910L +#define OR_INVALID_OID 1911L +#define OR_INVALID_SET 1912L +#define RPC_S_SEND_INCOMPLETE 1913L +#define ERROR_INVALID_PIXEL_FORMAT 2000L +#define ERROR_BAD_DRIVER 2001L +#define ERROR_INVALID_WINDOW_STYLE 2002L +#define ERROR_METAFILE_NOT_SUPPORTED 2003L +#define ERROR_TRANSFORM_NOT_SUPPORTED 2004L +#define ERROR_CLIPPING_NOT_SUPPORTED 2005L +#define ERROR_BAD_USERNAME 2202L +#define ERROR_NOT_CONNECTED 2250L +#define ERROR_OPEN_FILES 2401L +#define ERROR_ACTIVE_CONNECTIONS 2402L +#define ERROR_DEVICE_IN_USE 2404L +#define ERROR_UNKNOWN_PRINT_MONITOR 3000L +#define ERROR_PRINTER_DRIVER_IN_USE 3001L +#define ERROR_SPOOL_FILE_NOT_FOUND 3002L +#define ERROR_SPL_NO_STARTDOC 3003L +#define ERROR_SPL_NO_ADDJOB 3004L +#define ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED 3005L +#define ERROR_PRINT_MONITOR_ALREADY_INSTALLED 3006L +#define ERROR_WINS_INTERNAL 4000L +#define ERROR_CAN_NOT_DEL_LOCAL_WINS 4001L +#define ERROR_STATIC_INIT 4002L +#define ERROR_INC_BACKUP 4003L +#define ERROR_FULL_BACKUP 4004L +#define ERROR_REC_NON_EXISTENT 4005L +#define ERROR_RPL_NOT_ALLOWED 4006L +#define ERROR_NO_BROWSER_SERVERS_FOUND 6118L + + +/* HRESULT values for OLE, SHELL and other Interface stuff */ +/* the codes 4000-40ff are reserved for OLE */ +#define NOERROR 0L + +#define E_PENDING 0x8000000AL + + +#define E_NOTIMPL 0x80004001L +#define E_NOINTERFACE 0x80004002L +#define E_POINTER 0x80004003L +#define E_ABORT 0x80004004L +#define E_FAIL 0x80004005L +/* FIXME: E_UNSPEC is not a standard value but it is used by + * FileMoniker, IOleLink and DoDragDrop as a return value. + */ +#define E_UNSPEC E_FAIL + + +#define CO_E_INIT_TLS 0x80004006L +#define CO_E_INIT_SHARED_ALLOCATOR 0x80004007L +#define CO_E_INIT_MEMORY_ALLOCATOR 0x80004008L +#define CO_E_INIT_CLASS_CACHE 0x80004009L +#define CO_E_INIT_RPC_CHANNEL 0x8000400AL +#define CO_E_INIT_TLS_SET_CHANNEL_CONTROL 0x8000400BL +#define CO_E_INIT_TLS_CHANNEL_CONTROL 0x8000400CL +#define CO_E_INIT_UNACCEPTED_USER_ALLOCATOR 0x8000400DL +#define CO_E_INIT_SCM_MUTEX_EXISTS 0x8000400EL +#define CO_E_INIT_SCM_FILE_MAPPING_EXISTS 0x8000400FL +#define CO_E_INIT_SCM_MAP_VIEW_OF_FILE 0x80004010L +#define CO_E_INIT_SCM_EXEC_FAILURE 0x80004011L +#define CO_E_INIT_ONLY_SINGLE_THREADED 0x80004012L + +#define E_UNEXPECTED 0x8000FFFFL + +#define RPC_E_CALL_REJECTED 0x80010001L +#define RPC_E_CALL_CANCELED 0x80010002L +#define RPC_E_CANTPOST_INSENDCALL 0x80010003L +#define RPC_E_CANTCALLOUT_INASYNCCALL 0x80010004L +#define RPC_E_CANTCALLOUT_INEXTERNALCALL 0x80010005L +#define RPC_E_CONNECTION_TERMINATED 0x80010006L +#define RPC_E_SERVER_DIED 0x80010007L +#define RPC_E_CLIENT_DIED 0x80010008L +#define RPC_E_INVALID_DATAPACKET 0x80010009L +#define RPC_E_CANTTRANSMIT_CALL 0x8001000AL +#define RPC_E_CLIENT_CANTMARSHAL_DATA 0x8001000BL +#define RPC_E_CLIENT_CANTUNMARSHAL_DATA 0x8001000CL +#define RPC_E_SERVER_CANTMARSHAL_DATA 0x8001000DL +#define RPC_E_SERVER_CANTUNMARSHAL_DATA 0x8001000EL +#define RPC_E_INVALID_DATA 0x8001000FL +#define RPC_E_INVALID_PARAMETER 0x80010010L +#define RPC_E_CANTCALLOUT_AGAIN 0x80010011L +#define RPC_E_SERVER_DIED_DNE 0x80010012L +#define RPC_E_SYS_CALL_FAILED 0x80010100L +#define RPC_E_OUT_OF_RESOURCES 0x80010101L +#define RPC_E_ATTEMPTED_MULTITHREAD 0x80010102L +#define RPC_E_NOT_REGISTERED 0x80010103L +#define RPC_E_FAULT 0x80010104L +#define RPC_E_SERVERFAULT 0x80010105L +#define RPC_E_CHANGED_MODE 0x80010106L +#define RPC_E_INVALIDMETHOD 0x80010107L +#define RPC_E_DISCONNECTED 0x80010108L +#define RPC_E_RETRY 0x80010109L +#define RPC_E_SERVERCALL_RETRYLATER 0x8001010AL +#define RPC_E_SERVERCALL_REJECTED 0x8001010BL +#define RPC_E_INVALID_CALLDATA 0x8001010CL +#define RPC_E_CANTCALLOUT_ININPUTSYNCCALL 0x8001010DL +#define RPC_E_WRONG_THREAD 0x8001010EL +#define RPC_E_THREAD_NOT_INIT 0x8001010FL +#define RPC_E_VERSION_MISMATCH 0x80010110L +#define RPC_E_INVALID_HEADER 0x80010111L +#define RPC_E_INVALID_EXTENSION 0x80010112L +#define RPC_E_INVALID_IPID 0x80010113L +#define RPC_E_INVALID_OBJECT 0x80010114L +#define RPC_S_CALLPENDING 0x80010115L +#define RPC_S_WAITONTIMER 0x80010116L +#define RPC_E_CALL_COMPLETE 0x80010117L +#define RPC_E_UNSECURE_CALL 0x80010118L +#define RPC_E_TOO_LATE 0x80010119L +#define RPC_E_NO_GOOD_SECURITY_PACKAGES 0x8001011AL +#define RPC_E_ACCESS_DENIED 0x8001011BL +#define RPC_E_REMOTE_DISABLED 0x8001011CL +#define RPC_E_INVALID_OBJREF 0x8001011DL +#define RPC_E_NO_CONTEXT 0x8001011EL +#define RPC_E_TIMEOUT 0x8001011FL +#define RPC_E_NO_SYNC 0x80010120L +#define RPC_E_UNEXPECTED 0x8001FFFFL + +#define DISP_E_UNKNOWNINTERFACE 0x80020001L +#define DISP_E_MEMBERNOTFOUND 0x80020003L +#define DISP_E_PARAMNOTFOUND 0x80020004L +#define DISP_E_TYPEMISMATCH 0x80020005L +#define DISP_E_UNKNOWNNAME 0x80020006L +#define DISP_E_NONAMEDARGS 0x80020007L +#define DISP_E_BADVARTYPE 0x80020008L +#define DISP_E_EXCEPTION 0x80020009L +#define DISP_E_OVERFLOW 0x8002000AL +#define DISP_E_BADINDEX 0x8002000BL +#define DISP_E_UNKNOWNLCID 0x8002000CL +#define DISP_E_ARRAYISLOCKED 0x8002000DL +#define DISP_E_BADPARAMCOUNT 0x8002000EL +#define DISP_E_PARAMNOTOPTIONAL 0x8002000FL +#define DISP_E_BADCALLEE 0x80020010L +#define DISP_E_NOTACOLLECTION 0x80020011L +#define DISP_E_DIVBYZERO 0x80020012L + +#define TYPE_E_BUFFERTOOSMALL 0x80028016L +#define TYPE_E_FIELDNOTFOUND 0x80028017L +#define TYPE_E_INVDATAREAD 0x80028018L +#define TYPE_E_UNSUPFORMAT 0x80028019L +#define TYPE_E_REGISTRYACCESS 0x8002801CL +#define TYPE_E_LIBNOTREGISTERED 0x8002801DL +#define TYPE_E_UNDEFINEDTYPE 0x80028027L +#define TYPE_E_QUALIFIEDNAMEDISALLOWED 0x80028028L +#define TYPE_E_INVALIDSTATE 0x80028029L +#define TYPE_E_WRONGTYPEKIND 0x8002802AL +#define TYPE_E_ELEMENTNOTFOUND 0x8002802BL +#define TYPE_E_AMBIGUOUSNAME 0x8002802CL +#define TYPE_E_NAMECONFLICT 0x8002802DL +#define TYPE_E_UNKNOWNLCID 0x8002802EL +#define TYPE_E_DLLFUNCTIONNOTFOUND 0x8002802FL +#define TYPE_E_BADMODULEKIND 0x800288BDL +#define TYPE_E_SIZETOOBIG 0x800288C5L +#define TYPE_E_DUPLICATEID 0x800288C6L +#define TYPE_E_INVALIDID 0x800288CFL +#define TYPE_E_TYPEMISMATCH 0x80028CA0L +#define TYPE_E_OUTOFBOUNDS 0x80028CA1L +#define TYPE_E_IOERROR 0x80028CA2L +#define TYPE_E_CANTCREATETMPFILE 0x80028CA3L +#define TYPE_E_CANTLOADLIBRARY 0x80029C4AL +#define TYPE_E_INCONSISTENTPROPFUNCS 0x80029C83L +#define TYPE_E_CIRCULARTYPE 0x80029C84L + +#define STG_S_CONVERTED 0x00030200L +#define STG_S_BLOCK 0x00030201L +#define STG_S_RETRYNOW 0x00030202L +#define STG_S_MONITORING 0x00030203L +#define STG_S_MULTIPLEOPENS 0x00030204L +#define STG_S_CONSOLIDATIONFAILED 0x00030205L +#define STG_S_CANNOTCONSOLIDATE 0x00030206L + +#define STG_E_INVALIDFUNCTION 0x80030001L +#define STG_E_FILENOTFOUND 0x80030002L +#define STG_E_PATHNOTFOUND 0x80030003L +#define STG_E_TOOMANYOPENFILES 0x80030004L +#define STG_E_ACCESSDENIED 0x80030005L +#define STG_E_INVALIDHANDLE 0x80030006L +#define STG_E_INSUFFICIENTMEMORY 0x80030008L +#define STG_E_INVALIDPOINTER 0x80030009L +#define STG_E_NOMOREFILES 0x80030012L +#define STG_E_DISKISWRITEPROTECTED 0x80030013L +#define STG_E_SEEKERROR 0x80030019L +#define STG_E_WRITEFAULT 0x8003001DL +#define STG_E_READFAULT 0x8003001EL +#define STG_E_SHAREVIOLATION 0x80030020L +#define STG_E_LOCKVIOLATION 0x80030021L +#define STG_E_FILEALREADYEXISTS 0x80030050L +#define STG_E_INVALIDPARAMETER 0x80030057L +#define STG_E_MEDIUMFULL 0x80030070L +#define STG_E_ABNORMALAPIEXIT 0x800300FAL +#define STG_E_INVALIDHEADER 0x800300FBL +#define STG_E_INVALIDNAME 0x800300FCL +#define STG_E_UNKNOWN 0x800300FDL +#define STG_E_UNIMPLEMENTEDFUNCTION 0x800300FEL +#define STG_E_INVALIDFLAG 0x800300FFL +#define STG_E_INUSE 0x80030100L +#define STG_E_NOTCURRENT 0x80030101L +#define STG_E_REVERTED 0x80030102L +#define STG_E_CANTSAVE 0x80030103L +#define STG_E_OLDFORMAT 0x80030104L +#define STG_E_OLDDLL 0x80030105L +#define STG_E_SHAREREQUIRED 0x80030106L +#define STG_E_NOTFILEBASEDSTORAGE 0x80030107L +#define STG_E_EXTANTMARSHALLINGS 0x80030108L + +#define OLE_S_FIRST 0x00040000L +#define OLE_S_USEREG 0x00040000L +#define OLE_S_STATIC 0x00040001L +#define OLE_S_MAC_CLIPFORMAT 0x00040002L +#define OLE_S_LAST 0x000400FFL + +#define OLE_E_FIRST 0x80040000L +#define OLE_E_OLEVERB 0x80040000L +#define OLE_E_ADVF 0x80040001L +#define OLE_E_ENUM_NOMORE 0x80040002L +#define OLE_E_ADVISENOTSUPPORTED 0x80040003L +#define OLE_E_NOCONNECTION 0x80040004L +#define OLE_E_NOTRUNNING 0x80040005L +#define OLE_E_NOCACHE 0x80040006L +#define OLE_E_BLANK 0x80040007L +#define OLE_E_CLASSDIFF 0x80040008L +#define OLE_E_CANT_GETMONIKER 0x80040009L +#define OLE_E_CANT_BINDTOSOURCE 0x8004000AL +#define OLE_E_STATIC 0x8004000BL +#define OLE_E_PROMPTSAVECANCELLED 0x8004000CL +#define OLE_E_INVALIDRECT 0x8004000DL +#define OLE_E_WRONGCOMPOBJ 0x8004000EL +#define OLE_E_INVALIDHWND 0x8004000FL +#define OLE_E_NOT_INPLACEACTIVE 0x80040010L +#define OLE_E_CANTCONVERT 0x80040011L +#define OLE_E_NOSTORAGE 0x80040012L +#define DV_E_FORMATETC 0x80040064L +#define DV_E_DVTARGETDEVICE 0x80040065L +#define DV_E_STGMEDIUM 0x80040066L +#define DV_E_STATDATA 0x80040067L +#define DV_E_LINDEX 0x80040068L +#define DV_E_TYMED 0x80040069L +#define DV_E_CLIPFORMAT 0x8004006AL +#define DV_E_DVASPECT 0x8004006BL +#define DV_E_DVTARGETDEVICE_SIZE 0x8004006CL +#define DV_E_NOIVIEWOBJECT 0x8004006DL +#define OLE_E_LAST 0x800400FFL + +#define DRAGDROP_S_FIRST 0x00040100L +#define DRAGDROP_S_DROP 0x00040100L +#define DRAGDROP_S_CANCEL 0x00040101L +#define DRAGDROP_S_USEDEFAULTCURSORS 0x00040102L +#define DRAGDROP_S_LAST 0x0004010FL + +#define DRAGDROP_E_FIRST 0x80040100L +#define DRAGDROP_E_NOTREGISTERED 0x80040100L +#define DRAGDROP_E_ALREADYREGISTERED 0x80040101L +#define DRAGDROP_E_INVALIDHWND 0x80040102L +#define DRAGDROP_E_LAST 0x8004010FL + + +#define CLASSFACTORY_S_FIRST 0x00040110L +#define CLASSFACTORY_S_LAST 0x0004011FL + +#define CLASSFACTORY_E_FIRST 0x80040110L +#define CLASS_E_NOAGGREGATION 0x80040110L +#define CLASS_E_CLASSNOTAVAILABLE 0x80040111L +#define CLASS_E_NOTLICENSED 0x80040112L +#define CLASSFACTORY_E_LAST 0x8004011FL + +#define MARSHAL_S_FIRST 0x00040120L +#define MARSHAL_S_LAST 0x0004012FL + +#define MARSHAL_E_FIRST 0x80040120L +#define MARSHAL_E_LAST 0x8004012FL + +#define DATA_S_FIRST 0x00040130L +#define DATA_S_SAMEFORMATETC 0x00040130L +#define DATA_S_LAST 0x0004013FL + +#define DATA_E_FIRST 0x80040130L +#define DATA_E_LAST 0x8004013FL + +#define VIEW_S_FIRST 0x00040140L +#define VIEW_S_ALREADY_FROZEN 0x00040140L +#define VIEW_S_LAST 0x0004014FL + +#define VIEW_E_FIRST 0x80040140L +#define VIEW_E_DRAW 0x80040140L +#define VIEW_E_LAST 0x8004014FL + +#define REGDB_S_FIRST 0x00040150L +#define REGDB_S_LAST 0x0004015FL + +#define REGDB_E_FIRST 0x80040150L +#define REGDB_E_READREGDB 0x80040150L +#define REGDB_E_WRITEREGDB 0x80040151L +#define REGDB_E_KEYMISSING 0x80040152L +#define REGDB_E_INVALIDVALUE 0x80040153L +#define REGDB_E_CLASSNOTREG 0x80040154L +#define REGDB_E_IIDNOTREG 0x80040155L +#define REGDB_E_LAST 0x8004015FL + +#define CACHE_S_FIRST 0x00040170L +#define CACHE_S_FORMATETC_NOTSUPPORTED 0x00040170L +#define CACHE_S_SAMECACHE 0x00040171L +#define CACHE_S_SOMECACHES_NOTUPDATED 0x00040172L +#define CACHE_S_LAST 0x0004017FL + +#define CACHE_E_FIRST 0x80040170L +#define CACHE_E_NOCACHE_UPDATED 0x80040170L +#define CACHE_E_LAST 0x8004017FL + +#define OLEOBJ_S_FIRST 0x00040180L +#define OLEOBJ_S_INVALIDVERB 0x00040180L +#define OLEOBJ_S_CANNOT_DOVERB_NOW 0x00040181L +#define OLEOBJ_S_INVALIDHWND 0x00040182L +#define OLEOBJ_S_LAST 0x0004018FL + +#define OLEOBJ_E_FIRST 0x80040180L +#define OLEOBJ_E_NOVERBS 0x80040180L +#define OLEOBJ_E_INVALIDVERB 0x80040181L +#define OLEOBJ_E_LAST 0x8004018FL + +#define CLIENTSITE_S_FIRST 0x00040190L +#define CLIENTSITE_S_LAST 0x0004019FL + +#define CLIENTSITE_E_FIRST 0x80040190L +#define CLIENTSITE_E_LAST 0x8004019FL + +#define INPLACE_S_FIRST 0x000401A0L +#define INPLACE_S_TRUNCATED 0x000401A0L +#define INPLACE_S_LAST 0x000401AFL + +#define INPLACE_E_FIRST 0x800401A0L +#define INPLACE_E_NOTUNDOABLE 0x800401A0L +#define INPLACE_E_NOTOOLSPACE 0x800401A1L +#define INPLACE_E_LAST 0x800401AFL + +#define ENUM_S_FIRST 0x000401B0L +#define ENUM_S_LAST 0x000401BFL + +#define ENUM_E_FIRST 0x800401B0L +#define ENUM_E_LAST 0x800401BFL + +#define CONVERT10_S_FIRST 0x000401C0L +#define CONVERT10_S_NO_PRESENTATION 0x000401C0L +#define CONVERT10_S_LAST 0x000401CFL + +#define CONVERT10_E_FIRST 0x800401C0L +#define CONVERT10_E_OLESTREAM_GET 0x800401C0L +#define CONVERT10_E_OLESTREAM_PUT 0x800401C1L +#define CONVERT10_E_OLESTREAM_FMT 0x800401C2L +#define CONVERT10_E_OLESTREAM_BITMAP_TO_DIB 0x800401C3L +#define CONVERT10_E_STG_FMT 0x800401C4L +#define CONVERT10_E_STG_NO_STD_STREAM 0x800401C5L +#define CONVERT10_E_STG_DIB_TO_BITMAP 0x800401C6L +#define CONVERT10_E_LAST 0x800401CFL + +#define CLIPBRD_S_FIRST 0x000401D0L +#define CLIPBRD_S_LAST 0x000401DFL + +#define CLIPBRD_E_FIRST 0x800401D0L +#define CLIPBRD_E_LAST 0x800401DFL +#define CLIPBRD_E_CANT_OPEN 0x800401D0L +#define CLIPBRD_E_CANT_EMPTY 0x800401D1L +#define CLIPBRD_E_CANT_SET 0x800401D2L +#define CLIPBRD_E_BAD_DATA 0x800401D3L +#define CLIPBRD_E_CANT_CLOSE 0x800401D4L + +#define MK_S_FIRST 0x000401E0L +#define MK_S_REDUCED_TO_SELF 0x000401E2L +#define MK_S_ME 0x000401E4L +#define MK_S_HIM 0x000401E5L +#define MK_S_US 0x000401E6L +#define MK_S_MONIKERALREADYREGISTERED 0x000401E7L +#define MK_S_LAST 0x000401EFL + +#define MK_E_FIRST 0x800401E0L +#define MK_E_CONNECTMANUALLY 0x800401E0L +#define MK_E_EXCEEDEDDEADLINE 0x800401E1L +#define MK_E_NEEDGENERIC 0x800401E2L +#define MK_E_UNAVAILABLE 0x800401E3L +#define MK_E_SYNTAX 0x800401E4L +#define MK_E_NOOBJECT 0x800401E5L +#define MK_E_INVALIDEXTENSION 0x800401E6L +#define MK_E_INTERMEDIATEINTERFACENOTSUPPORTED 0x800401E7L +#define MK_E_NOTBINDABLE 0x800401E8L +#define MK_E_NOTBOUND 0x800401E9L +#define MK_E_CANTOPENFILE 0x800401EAL +#define MK_E_MUSTBOTHERUSER 0x800401EBL +#define MK_E_NOINVERSE 0x800401ECL +#define MK_E_NOSTORAGE 0x800401EDL +#define MK_E_NOPREFIX 0x800401EEL +#define MK_E_ENUMERATION_FAILED 0x800401EFL +#define MK_E_LAST 0x800401EFL + +#define CO_S_FIRST 0x000401F0L +#define CO_S_LAST 0x000401FFL + +#define CO_E_FIRST 0x800401F0L +#define CO_E_NOTINITIALIZED 0x800401F0L +#define CO_E_ALREADYINITIALIZED 0x800401F1L +#define CO_E_CANTDETERMINECLASS 0x800401F2L +#define CO_E_CLASSSTRING 0x800401F3L +#define CO_E_IIDSTRING 0x800401F4L +#define CO_E_APPNOTFOUND 0x800401F5L +#define CO_E_APPSINGLEUSE 0x800401F6L +#define CO_E_ERRORINAPP 0x800401F7L +#define CO_E_DLLNOTFOUND 0x800401F8L +#define CO_E_ERRORINDLL 0x800401F9L +#define CO_E_WRONGOSFORAPP 0x800401FAL +#define CO_E_OBJNOTREG 0x800401FBL +#define CO_E_OBJISREG 0x800401FCL +#define CO_E_OBJNOTCONNECTED 0x800401FDL +#define CO_E_APPDIDNTREG 0x800401FEL +#define CO_E_RELEASED 0x800401FFL +#define CO_E_LAST 0x800401FFL +#define CO_E_FAILEDTOIMPERSONATE 0x80040200L +#define CO_E_FAILEDTOGETSECCTX 0x80040201L +#define CO_E_FAILEDTOOPENTHREADTOKEN 0x80040202L +#define CO_E_FAILEDTOGETTOKENINFO 0x80040203L +#define CO_E_TRUSTEEDOESNTMATCHCLIENT 0x80040204L +#define CO_E_FAILEDTOQUERYCLIENTBLANKET 0x80040205L +#define CO_E_FAILEDTOSETDACL 0x80040206L +#define CO_E_ACCESSCHECKFAILED 0x80040207L +#define CO_E_NETACCESSAPIFAILED 0x80040208L +#define CO_E_WRONGTRUSTEENAMESYNTAX 0x80040209L +#define CO_E_INVALIDSID 0x8004020AL +#define CO_E_CONVERSIONFAILED 0x8004020BL +#define CO_E_NOMATCHINGSIDFOUND 0x8004020CL +#define CO_E_LOOKUPACCSIDFAILED 0x8004020DL +#define CO_E_NOMATCHINGNAMEFOUND 0x8004020EL +#define CO_E_LOOKUPACCNAMEFAILED 0x8004020FL +#define CO_E_SETSERLHNDLFAILED 0x80040210L +#define CO_E_FAILEDTOGETWINDIR 0x80040211L +#define CO_E_PATHTOOLONG 0x80040212L +#define CO_E_FAILEDTOGENUUID 0x80040213L +#define CO_E_FAILEDTOCREATEFILE 0x80040214L +#define CO_E_FAILEDTOCLOSEHANDLE 0x80040215L +#define CO_E_EXCEEDSYSACLLIMIT 0x80040216L +#define CO_E_ACESINWRONGORDER 0x80040217L +#define CO_E_INCOMPATIBLESTREAMVERSION 0x80040218L +#define CO_E_FAILEDTOOPENPROCESSTOKEN 0x80040219L +#define CO_E_DECODEFAILED 0x8004021AL +#define CO_E_ACNOTINITIALIZED 0x8004021BL + +#define E_ACCESSDENIED 0x80070005L +#define E_HANDLE 0x80070006L +#define E_OUTOFMEMORY 0x8007000EL +#define E_INVALIDARG 0x80070057L + +#define CO_S_NOTALLINTERFACES 0x00080012L + +#define CO_E_CLASS_CREATE_FAILED 0x80080001L +#define CO_E_SCM_ERROR 0x80080002L +#define CO_E_SCM_RPC_FAILURE 0x80080003L +#define CO_E_BAD_PATH 0x80080004L +#define CO_E_SERVER_EXEC_FAILURE 0x80080005L +#define CO_E_OBJSRV_RPC_FAILURE 0x80080006L +#define MK_E_NO_NORMALIZED 0x80080007L +#define CO_E_SERVER_STOPPING 0x80080008L +#define MEM_E_INVALID_ROOT 0x80080009L +#define MEM_E_INVALID_LINK 0x80080010L +#define MEM_E_INVALID_SIZE 0x80080011L + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _GNU_H_WINDOWS32_ERROR */ diff --git a/reactos/include/excpt.h b/reactos/include/excpt.h new file mode 100644 index 00000000000..4047ef2eb34 --- /dev/null +++ b/reactos/include/excpt.h @@ -0,0 +1,121 @@ +/* + * excpt.h + * + * Support for operating system level structured exception handling. + * + * NOTE: This is very preliminary stuff. I am also pretty sure it is + * completely Intel specific. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * Based on code by Mikey + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.3 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:26 $ + * + */ + +#ifndef _EXCPT_H_ +#define _EXCPT_H_ + +#ifndef __STRICT_ANSI__ + +#include + +/* + * NOTE: The constants structs and typedefs below should be defined in the + * Win32 API headers. + */ +#define EH_NONCONTINUABLE 0x01 +#define EH_UNWINDING 0x02 +#define EH_EXIT_UNWIND 0x04 +#define EH_STACK_INVALID 0x08 +#define EH_NESTED_CALL 0x10 + +#ifndef RC_INVOKED + +typedef enum { + ExceptionContinueExecution, + ExceptionContinueSearch, + ExceptionNestedException, + ExceptionCollidedUnwind +} EXCEPTION_DISPOSITION; + + +/* + * End of stuff that should be in the Win32 API files. + */ + + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The type of function that is expected as an exception handler to be + * installed with _try1. + */ +typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER) + (struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); + +/* + * This is not entirely necessary, but it is the structure installed by + * the _try1 primitive below. + */ +typedef struct _EXCEPTION_REGISTRATION +{ + struct _EXCEPTION_REGISTRATION* prev; + PEXCEPTION_HANDLER handler; +} EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION; + +typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD; +typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD; + +/* + * A macro which installs the supplied exception handler. + * Push the pointer to the new handler onto the stack, + * then push the pointer to the old registration structure (at fs:0) + * onto the stack, then put a pointer to the new registration + * structure (i.e. the current stack pointer) at fs:0. + */ +#define __try1(pHandler) \ + __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler)); + + +/* + * A macro which (dispite its name) *removes* an installed + * exception handler. Should be used only in conjunction with the above + * install routine __try1. + * Move the pointer to the old reg. struct (at the current stack + * position) to fs:0, replacing the pointer we installed above, + * then add 8 to the stack pointer to get rid of the space we + * used when we pushed on our new reg. struct above. Notice that + * the stack must be in the exact state at this point that it was + * after we did _try1 or this will smash things. + */ +#define __except1 \ + __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \ + : : : "%eax"); + +#ifdef __cplusplus +} +#endif + +#endif /* Not RC_INVOKED */ + +#endif /* Not strict ANSI */ + +#endif /* _EXCPT_H_ not defined */ diff --git a/reactos/include/funcs.h b/reactos/include/funcs.h new file mode 100644 index 00000000000..6c3efb2bfa2 --- /dev/null +++ b/reactos/include/funcs.h @@ -0,0 +1,7590 @@ +/* + Functions.h + + Declarations for all the Windows32 API Functions + + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + + Author: Scott Christley + + This file is part of the Windows32 API Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + If you are interested in a warranty or support for this source code, + contact Scott Christley for more information. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNU_H_WINDOWS32_FUNCTIONS +#define _GNU_H_WINDOWS32_FUNCTIONS + +#ifndef WIN32_LEAN_AND_MEAN + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* These functions were a real pain, having to figure out which + had Unicode/Ascii versions and which did not */ + +#ifndef UNICODE_ONLY +#include +#endif /* !UNICODE_ONLY */ + +#ifndef ANSI_ONLY +#include +#endif /* !ANSI_ONLY */ + +/* Define the approprate declaration based upon UNICODE or ASCII */ + +/* UNICODE */ +#ifdef UNICODE + +#define RegConnectRegistry RegConnectRegistryW +#define RegCreateKey RegCreateKeyW +#define RegCreateKeyEx RegCreateKeyExW +#define RegDeleteKey RegDeleteKeyW +#define RegDeleteValue RegDeleteValueW +#define RegEnumKey RegEnumKeyW +#define RegEnumKeyEx RegEnumKeyExW +#define RegEnumValue RegEnumValueW +#define RegLoadKey RegLoadKeyW +#define RegOpenKey RegOpenKeyW +#define RegOpenKeyEx RegOpenKeyExW +#define RegQueryInfoKey RegQueryInfoKeyW +#define RegQueryValue RegQueryValueW +#define RegQueryMultipleValues RegQueryMultipleValuesW +#define RegQueryValueEx RegQueryValueExW +#define RegReplaceKey RegReplaceKeyW +#define RegRestoreKey RegRestoreKeyW +#define RegSaveKey RegSaveKeyW +#define RegSetValue RegSetValueW +#define RegSetValueEx RegSetValueExW +#define AbortSystemShutdown AbortSystemShutdownW +#define InitiateSystemShutdown InitiateSystemShutdownW +#define RegUnLoadKey RegUnLoadKeyW +#define SetProp SetPropW +#define GetProp GetPropW +#define RemoveProp RemovePropW +#define EnumPropsEx EnumPropsExW +#define EnumProps EnumPropsW +#define SetWindowText SetWindowTextW +#define GetWindowText GetWindowTextW +#define GetWindowTextLength GetWindowTextLengthW +#define MessageBox MessageBoxW +#define MessageBoxEx MessageBoxExW +#define MessageBoxIndirect MessageBoxIndirectW +#define GetWindowLong GetWindowLongW +#define SetWindowLong SetWindowLongW +#define GetClassLong GetClassLongW +#define SetClassLong SetClassLongW +#define FindWindow FindWindowW +#define FindWindowEx FindWindowExW +#define GetClassName GetClassNameW +#define SetWindowsHookEx SetWindowsHookExW +#define LoadBitmap LoadBitmapW +#define LoadCursor LoadCursorW +#define LoadCursorFromFile LoadCursorFromFileW +#define LoadIcon LoadIconW +#define LoadImage LoadImageW +#define LoadString LoadStringW +#define IsDialogMessage IsDialogMessageW +#define DlgDirList DlgDirListW +#define DlgDirSelectEx DlgDirSelectExW +#define DlgDirListComboBox DlgDirListComboBoxW +#define DlgDirSelectComboBoxEx DlgDirSelectComboBoxExW +#define DefFrameProc DefFrameProcW +#define DefMDIChildProc DefMDIChildProcW +#define CreateMDIWindow CreateMDIWindowW +#define WinHelp WinHelpW +#define ChangeDisplaySettings ChangeDisplaySettingsW +#define EnumDisplaySettings EnumDisplaySettingsW +#define SystemParametersInfo SystemParametersInfoW +#define AddFontResource AddFontResourceW +#define CopyMetaFile CopyMetaFileW +#define CreateDC CreateDCW +#define CreateFontIndirect CreateFontIndirectW +#define CreateFont CreateFontW +#define CreateIC CreateICW +#define CreateMetaFile CreateMetaFileW +#define CreateScalableFontResource CreateScalableFontResourceW +#define DeviceCapabilities DeviceCapabilitiesW +#define EnumFontFamiliesEx EnumFontFamiliesExW +#define EnumFontFamilies EnumFontFamiliesW +#define EnumFonts EnumFontsW +#define GetCharWidth GetCharWidthW +#define GetCharWidth32 GetCharWidth32W +#define GetCharWidthFloat GetCharWidthFloatW +#define GetCharABCWidths GetCharABCWidthsW +#define GetCharABCWidthsFloat GetCharABCWidthsFloatW +#define GetGlyphOutline GetGlyphOutlineW +#define GetMetaFile GetMetaFileW +#define GetOutlineTextMetrics GetOutlineTextMetricsW +#define GetTextExtentPoint GetTextExtentPointW +#define GetTextExtentPoint32 GetTextExtentPoint32W +#define GetTextExtentExPoint GetTextExtentExPointW +#define GetCharacterPlacement GetCharacterPlacementW +#define ResetDC ResetDCW +#define RemoveFontResource RemoveFontResourceW +#define CopyEnhMetaFile CopyEnhMetaFileW +#define CreateEnhMetaFile CreateEnhMetaFileW +#define GetEnhMetaFile GetEnhMetaFileW +#define GetEnhMetaFileDescription GetEnhMetaFileDescriptionW +#define GetTextMetrics GetTextMetricsW +#define StartDoc StartDocW +#define GetObject GetObjectW +#define TextOut TextOutW +#define ExtTextOut ExtTextOutW +#define PolyTextOut PolyTextOutW +#define GetTextFace GetTextFaceW +#define GetKerningPairs GetKerningPairsW +#define GetLogColorSpace GetLogColorSpaceW +#define CreateColorSpace CreateColorSpaceW +#define GetICMProfile GetICMProfileW +#define SetICMProfile SetICMProfileW +#define UpdateICMRegKey UpdateICMRegKeyW +#define EnumICMProfiles EnumICMProfilesW +#define CreatePropertySheetPage CreatePropertySheetPageW +#define PropertySheet PropertySheetW +#define ImageList_LoadImage ImageList_LoadImageW +#define CreateStatusWindow CreateStatusWindowW +#define DrawStatusText DrawStatusTextW +#define GetOpenFileName GetOpenFileNameW +#define GetSaveFileName GetSaveFileNameW +#define GetFileTitle GetFileTitleW +#define ChooseColor ChooseColorW +#define FindText FindTextW +#define ReplaceText ReplaceTextW +#define ChooseFont ChooseFontW +#define PrintDlg PrintDlgW +#define PageSetupDlg PageSetupDlgW +#define DefWindowProc DefWindowProcW +#define CallWindowProc CallWindowProcW +#define RegisterClass RegisterClassW +#define UnregisterClass UnregisterClassW +#define GetClassInfo GetClassInfoW +#define RegisterClassEx RegisterClassExW +#define GetClassInfoEx GetClassInfoExW +#define CreateWindowEx CreateWindowExW +#define CreateWindow CreateWindowW +#define CreateDialogParam CreateDialogParamW +#define CreateDialogIndirectParam CreateDialogIndirectParamW +#define CreateDialog CreateDialogW +#define CreateDialogIndirect CreateDialogIndirectW +#define DialogBoxParam DialogBoxParamW +#define DialogBoxIndirectParam DialogBoxIndirectParamW +#define DialogBox DialogBoxW +#define DialogBoxIndirect DialogBoxIndirectW +#define RegisterClipboardFormat RegisterClipboardFormatW +#define SetDlgItemText SetDlgItemTextW +#define GetDlgItemText GetDlgItemTextW +#define SendDlgItemMessage SendDlgItemMessageW +#define DefDlgProc DefDlgProcW +#define CallMsgFilter CallMsgFilterW +#define GetClipboardFormatName GetClipboardFormatNameW +#define CharToOem CharToOemW +#define OemToChar OemToCharW +#define CharToOemBuff CharToOemBuffW +#define OemToCharBuff OemToCharBuffW +#define CharUpper CharUpperW +#define CharUpperBuff CharUpperBuffW +#define CharLower CharLowerW +#define CharLowerBuff CharLowerBuffW +#define CharNext CharNextW +#define CharPrev CharPrevW +#define IsCharAlpha IsCharAlphaW +#define IsCharAlphaNumeric IsCharAlphaNumericW +#define IsCharUpper IsCharUpperW +#define IsCharLower IsCharLowerW +#define GetKeyNameText GetKeyNameTextW +#define VkKeyScan VkKeyScanW +#define VkKeyScanEx VkKeyScanExW +#define MapVirtualKey MapVirtualKeyW +#define MapVirtualKeyEx MapVirtualKeyExW +#define LoadAccelerators LoadAcceleratorsW +#define CreateAcceleratorTable CreateAcceleratorTableW +#define CopyAcceleratorTable CopyAcceleratorTableW +#define TranslateAccelerator TranslateAcceleratorW +#define LoadMenu LoadMenuW +#define LoadMenuIndirect LoadMenuIndirectW +#define ChangeMenu ChangeMenuW +#define GetMenuString GetMenuStringW +#define InsertMenu InsertMenuW +#define AppendMenu AppendMenuW +#define ModifyMenu ModifyMenuW +#define InsertMenuItem InsertMenuItemW +#define GetMenuItemInfo GetMenuItemInfoW +#define SetMenuItemInfo SetMenuItemInfoW +#define DrawText DrawTextW +#define DrawTextEx DrawTextExW +#define GrayString GrayStringW +#define DrawState DrawStateW +#define TabbedTextOut TabbedTextOutW +#define GetTabbedTextExtent GetTabbedTextExtentW +#define GetVersionEx GetVersionExW +#define wvsprintf wvsprintfW +#define wsprintf wsprintfW +#define LoadKeyboardLayout LoadKeyboardLayoutW +#define GetKeyboardLayoutName GetKeyboardLayoutNameW +#define CreateDesktop CreateDesktopW +#define OpenDesktop OpenDesktopW +#define EnumDesktops EnumDesktopsW +#define CreateWindowStation CreateWindowStationW +#define OpenWindowStation OpenWindowStationW +#define EnumWindowStations EnumWindowStationsW +#define IsBadStringPtr IsBadStringPtrW +#define LookupAccountSid LookupAccountSidW +#define LookupAccountName LookupAccountNameW +#define LookupPrivilegeValue LookupPrivilegeValueW +#define LookupPrivilegeName LookupPrivilegeNameW +#define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameW +#define BuildCommDCB BuildCommDCBW +#define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsW +#define CommConfigDialog CommConfigDialogW +#define GetDefaultCommConfig GetDefaultCommConfigW +#define SetDefaultCommConfig SetDefaultCommConfigW +#define GetComputerName GetComputerNameW +#define SetComputerName SetComputerNameW +#define GetUserName GetUserNameW +#define CreateMailslot CreateMailslotW +#define FormatMessage FormatMessageW +#define GetEnvironmentStrings GetEnvironmentStringsW +#define FreeEnvironmentStrings FreeEnvironmentStringsW +#define lstrcmp lstrcmpW +#define lstrcmpi lstrcmpiW +#define lstrcpyn lstrcpynW +#define lstrcpy lstrcpyW +#define lstrcat lstrcatW +#define lstrlen lstrlenW +#define GetBinaryType GetBinaryTypeW +#define GetShortPathName GetShortPathNameW +#define SetFileSecurity SetFileSecurityW +#define GetFileSecurity GetFileSecurityW +#define FindFirstChangeNotification FindFirstChangeNotificationW +#define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmW +#define ObjectOpenAuditAlarm ObjectOpenAuditAlarmW +#define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmW +#define ObjectCloseAuditAlarm ObjectCloseAuditAlarmW +#define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmW +#define OpenEventLog OpenEventLogW +#define RegisterEventSource RegisterEventSourceW +#define OpenBackupEventLog OpenBackupEventLogW +#define ReadEventLog ReadEventLogW +#define ReportEvent ReportEventW +#define CreateProcess CreateProcessW +#define FatalAppExit FatalAppExitW +#define GetStartupInfo GetStartupInfoW +#define GetEnvironmentVariable GetEnvironmentVariableW +#define GetCommandLine GetCommandLineW +#define SetEnvironmentVariable SetEnvironmentVariableW +#define ExpandEnvironmentStrings ExpandEnvironmentStringsW +#define OutputDebugString OutputDebugStringW +#define FindResource FindResourceW +#define FindResourceEx FindResourceExW +#define EnumResourceTypes EnumResourceTypesW +#define EnumResourceNames EnumResourceNamesW +#define EnumResourceLanguages EnumResourceLanguagesW +#define BeginUpdateResource BeginUpdateResourceW +#define UpdateResource UpdateResourceW +#define EndUpdateResource EndUpdateResourceW +#define GlobalAddAtom GlobalAddAtomW +#define GlobalFindAtom GlobalFindAtomW +#define GlobalGetAtomName GlobalGetAtomNameW +#define AddAtom AddAtomW +#define FindAtom FindAtomW +#define GetAtomName GetAtomNameW +#define GetProfileInt GetProfileIntW +#define GetProfileString GetProfileStringW +#define WriteProfileString WriteProfileStringW +#define GetProfileSection GetProfileSectionW +#define WriteProfileSection WriteProfileSectionW +#define GetPrivateProfileInt GetPrivateProfileIntW +#define GetPrivateProfileString GetPrivateProfileStringW +#define WritePrivateProfileString WritePrivateProfileStringW +#define GetPrivateProfileSection GetPrivateProfileSectionW +#define WritePrivateProfileSection WritePrivateProfileSectionW +#define GetDriveType GetDriveTypeW +#define GetSystemDirectory GetSystemDirectoryW +#define GetTempPath GetTempPathW +#define GetTempFileName GetTempFileNameW +#define GetWindowsDirectory GetWindowsDirectoryW +#define SetCurrentDirectory SetCurrentDirectoryW +#define GetCurrentDirectory GetCurrentDirectoryW +#define GetDiskFreeSpace GetDiskFreeSpaceW +#define GetDiskFreeSpaceEx GetDiskFreeSpaceExW +#define CreateDirectory CreateDirectoryW +#define CreateDirectoryEx CreateDirectoryExW +#define RemoveDirectory RemoveDirectoryW +#define GetFullPathName GetFullPathNameW +#define DefineDosDevice DefineDosDeviceW +#define QueryDosDevice QueryDosDeviceW +#define CreateFile CreateFileW +#define SetFileAttributes SetFileAttributesW +#define GetFileAttributes GetFileAttributesW +#define GetCompressedFileSize GetCompressedFileSizeW +#define DeleteFile DeleteFileW +#define FindFirstFileEx FindFirstFileExW +#define FindFirstFile FindFirstFileW +#define FindNextFile FindNextFileW +#define SearchPath SearchPathW +#define CopyFile CopyFileW +#define MoveFile MoveFileW +#define MoveFileEx MoveFileExW +#define CreateNamedPipe CreateNamedPipeW +#define GetNamedPipeHandleState GetNamedPipeHandleStateW +#define CallNamedPipe CallNamedPipeW +#define WaitNamedPipe WaitNamedPipeW +#define SetVolumeLabel SetVolumeLabelW +#define GetVolumeInformation GetVolumeInformationW +#define ClearEventLog ClearEventLogW +#define BackupEventLog BackupEventLogW +#define CreateMutex CreateMutexW +#define OpenMutex OpenMutexW +#define CreateEvent CreateEventW +#define OpenEvent OpenEventW +#define CreateSemaphore CreateSemaphoreW +#define OpenSemaphore OpenSemaphoreW +#define CreateFileMapping CreateFileMappingW +#define OpenFileMapping OpenFileMappingW +#define GetLogicalDriveStrings GetLogicalDriveStringsW +#define LoadLibrary LoadLibraryW +#define LoadLibraryEx LoadLibraryExW +#define GetModuleFileName GetModuleFileNameW +#define GetModuleHandle GetModuleHandleW +#define GetUserObjectInformation GetUserObjectInformationW +#define SetUserObjectInformation SetUserObjectInformationW +#define RegisterWindowMessage RegisterWindowMessageW +#define GetMessage GetMessageW +#define DispatchMessage DispatchMessageW +#define PeekMessage PeekMessageW +#define SendMessage SendMessageW +#define SendMessageTimeout SendMessageTimeoutW +#define SendNotifyMessage SendNotifyMessageW +#define SendMessageCallback SendMessageCallbackW +#define PostMessage PostMessageW +#define PostThreadMessage PostThreadMessageW +#define VerFindFile VerFindFileW +#define VerInstallFile VerInstallFileW +#define GetFileVersionInfoSize GetFileVersionInfoSizeW +#define GetFileVersionInfo GetFileVersionInfoW +#define VerLanguageName VerLanguageNameW +#define VerQueryValue VerQueryValueW +#define CompareString CompareStringW +#define LCMapString LCMapStringW +#define GetLocaleInfo GetLocaleInfoW +#define SetLocaleInfo SetLocaleInfoW +#define GetTimeFormat GetTimeFormatW +#define GetDateFormat GetDateFormatW +#define GetNumberFormat GetNumberFormatW +#define GetCurrencyFormat GetCurrencyFormatW +#define EnumCalendarInfo EnumCalendarInfoW +#define EnumTimeFormats EnumTimeFormatsW +#define FoldString FoldStringW +#define EnumSystemCodePages EnumSystemCodePagesW +#define EnumSystemLocales EnumSystemLocalesW +#define GetStringTypeEx GetStringTypeExW +#define EnumDateFormats EnumDateFormatsW +#define GetConsoleTitle GetConsoleTitleW +#define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferW +#define SetConsoleTitle SetConsoleTitleW +#define ReadConsole ReadConsoleW +#define WriteConsole WriteConsoleW +#define PeekConsoleInput PeekConsoleInputW +#define ReadConsoleInput ReadConsoleInputW +#define WriteConsoleInput WriteConsoleInputW +#define ReadConsoleOutput ReadConsoleOutputW +#define WriteConsoleOutput WriteConsoleOutputW +#define ReadConsoleOutputCharacter ReadConsoleOutputCharacterW +#define WriteConsoleOutputCharacter WriteConsoleOutputCharacterW +#define FillConsoleOutputCharacter FillConsoleOutputCharacterW +#define WNetGetProviderName WNetGetProviderNameW +#define WNetGetNetworkInformation WNetGetNetworkInformationW +#define WNetGetLastError WNetGetLastErrorW +#define MultinetGetConnectionPerformance MultinetGetConnectionPerformanceW +#define WNetConnectionDialog1 WNetConnectionDialog1W +#define WNetDisconnectDialog1 WNetDisconnectDialog1W +#define WNetOpenEnum WNetOpenEnumW +#define WNetEnumResource WNetEnumResourceW +#define WNetGetUniversalName WNetGetUniversalNameW +#define WNetGetUser WNetGetUserW +#define WNetAddConnection WNetAddConnectionW +#define WNetAddConnection2 WNetAddConnection2W +#define WNetAddConnection3 WNetAddConnection3W +#define WNetCancelConnection WNetCancelConnectionW +#define WNetCancelConnection2 WNetCancelConnection2W +#define WNetGetConnection WNetGetConnectionW +#define WNetUseConnection WNetUseConnectionW +#define WNetSetConnection WNetSetConnectionW +#define CreateService CreateServiceW +#define ChangeServiceConfig ChangeServiceConfigW +#define EnumDependentServices EnumDependentServicesW +#define EnumServicesStatus EnumServicesStatusW +#define GetServiceKeyName GetServiceKeyNameW +#define GetServiceDisplayName GetServiceDisplayNameW +#define OpenSCManager OpenSCManagerW +#define OpenService OpenServiceW +#define QueryServiceConfig QueryServiceConfigW +#define QueryServiceLockStatus QueryServiceLockStatusW +#define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerW +#define StartServiceCtrlDispatcher StartServiceCtrlDispatcherW +#define StartService StartServiceW +#define DragQueryFile DragQueryFileW +#define ExtractAssociatedIcon ExtractAssociatedIconW +#define ExtractIcon ExtractIconW +#define FindExecutable FindExecutableW +#define ShellAbout ShellAboutW +#define ShellExecute ShellExecuteW +#define DdeCreateStringHandle DdeCreateStringHandleW +#define DdeInitialize DdeInitializeW +#define DdeQueryString DdeQueryStringW +#define LogonUser LogonUserW +#define CreateProcessAsUser CreateProcessAsUserW + +/* ASCII */ +#else + +#define RegConnectRegistry RegConnectRegistryA +#define RegCreateKey RegCreateKeyA +#define RegCreateKeyEx RegCreateKeyExA +#define RegDeleteKey RegDeleteKeyA +#define RegDeleteValue RegDeleteValueA +#define RegEnumKey RegEnumKeyA +#define RegEnumKeyEx RegEnumKeyExA +#define RegEnumValue RegEnumValueA +#define RegLoadKey RegLoadKeyA +#define RegOpenKey RegOpenKeyA +#define RegOpenKeyEx RegOpenKeyExA +#define RegQueryInfoKey RegQueryInfoKeyA +#define RegQueryValue RegQueryValueA +#define RegQueryMultipleValues RegQueryMultipleValuesA +#define RegQueryValueEx RegQueryValueExA +#define RegReplaceKey RegReplaceKeyA +#define RegRestoreKey RegRestoreKeyA +#define RegSaveKey RegSaveKeyA +#define RegSetValue RegSetValueA +#define RegSetValueEx RegSetValueExA +#define AbortSystemShutdown AbortSystemShutdownA +#define InitiateSystemShutdown InitiateSystemShutdownA +#define RegUnLoadKey RegUnLoadKeyA +#define LoadIcon LoadIconA +#define LoadImage LoadImageA +#define LoadString LoadStringA +#define IsDialogMessage IsDialogMessageA +#define DlgDirList DlgDirListA +#define DlgDirSelectEx DlgDirSelectExA +#define DlgDirListComboBox DlgDirListComboBoxA +#define DlgDirSelectComboBoxEx DlgDirSelectComboBoxExA +#define DefFrameProc DefFrameProcA +#define DefMDIChildProc DefMDIChildProcA +#define CreateMDIWindow CreateMDIWindowA +#define WinHelp WinHelpA +#define ChangeDisplaySettings ChangeDisplaySettingsA +#define EnumDisplaySettings EnumDisplaySettingsA +#define SystemParametersInfo SystemParametersInfoA +#define GetWindowLong GetWindowLongA +#define SetWindowLong SetWindowLongA +#define GetClassLong GetClassLongA +#define SetClassLong SetClassLongA +#define FindWindow FindWindowA +#define FindWindowEx FindWindowExA +#define GetClassName GetClassNameA +#define SetWindowsHookEx SetWindowsHookExA +#define LoadBitmap LoadBitmapA +#define LoadCursor LoadCursorA +#define LoadCursorFromFile LoadCursorFromFileA +#define SetProp SetPropA +#define GetProp GetPropA +#define RemoveProp RemovePropA +#define EnumPropsEx EnumPropsExA +#define EnumProps EnumPropsA +#define SetWindowText SetWindowTextA +#define GetWindowText GetWindowTextA +#define GetWindowTextLength GetWindowTextLengthA +#define MessageBox MessageBoxA +#define MessageBoxEx MessageBoxExA +#define MessageBoxIndirect MessageBoxIndirectA +#define AddFontResource AddFontResourceA +#define CopyMetaFile CopyMetaFileA +#define CreateDC CreateDCA +#define CreateFontIndirect CreateFontIndirectA +#define CreateFont CreateFontA +#define CreateIC CreateICA +#define CreateMetaFile CreateMetaFileA +#define CreateScalableFontResource CreateScalableFontResourceA +#define DeviceCapabilities DeviceCapabilitiesA +#define EnumFontFamiliesEx EnumFontFamiliesExA +#define EnumFontFamilies EnumFontFamiliesA +#define EnumFonts EnumFontsA +#define GetCharWidth GetCharWidthA +#define GetCharWidth32 GetCharWidth32A +#define GetCharWidthFloat GetCharWidthFloatA +#define GetCharABCWidths GetCharABCWidthsA +#define GetCharABCWidthsFloat GetCharABCWidthsFloatA +#define GetGlyphOutline GetGlyphOutlineA +#define GetMetaFile GetMetaFileA +#define GetOutlineTextMetrics GetOutlineTextMetricsA +#define GetTextExtentPoint GetTextExtentPointA +#define GetTextExtentPoint32 GetTextExtentPoint32A +#define GetTextExtentExPoint GetTextExtentExPointA +#define GetCharacterPlacement GetCharacterPlacementA +#define ResetDC ResetDCA +#define RemoveFontResource RemoveFontResourceA +#define CopyEnhMetaFile CopyEnhMetaFileA +#define CreateEnhMetaFile CreateEnhMetaFileA +#define GetEnhMetaFile GetEnhMetaFileA +#define GetEnhMetaFileDescription GetEnhMetaFileDescriptionA +#define GetTextMetrics GetTextMetricsA +#define StartDoc StartDocA +#define GetObject GetObjectA +#define TextOut TextOutA +#define ExtTextOut ExtTextOutA +#define PolyTextOut PolyTextOutA +#define GetTextFace GetTextFaceA +#define GetKerningPairs GetKerningPairsA +#define GetLogColorSpace GetLogColorSpaceA +#define CreateColorSpace CreateColorSpaceA +#define GetICMProfile GetICMProfileA +#define SetICMProfile SetICMProfileA +#define UpdateICMRegKey UpdateICMRegKeyA +#define EnumICMProfiles EnumICMProfilesA +#define CreatePropertySheetPage CreatePropertySheetPageA +#define PropertySheet PropertySheetA +#define ImageList_LoadImage ImageList_LoadImageA +#define CreateStatusWindow CreateStatusWindowA +#define DrawStatusText DrawStatusTextA +#define GetOpenFileName GetOpenFileNameA +#define GetSaveFileName GetSaveFileNameA +#define GetFileTitle GetFileTitleA +#define ChooseColor ChooseColorA +#define FindText FindTextA +#define ReplaceText ReplaceTextA +#define ChooseFont ChooseFontA +#define PrintDlg PrintDlgA +#define PageSetupDlg PageSetupDlgA +#define DefWindowProc DefWindowProcA +#define CallWindowProc CallWindowProcA +#define RegisterClass RegisterClassA +#define UnregisterClass UnregisterClassA +#define GetClassInfo GetClassInfoA +#define RegisterClassEx RegisterClassExA +#define GetClassInfoEx GetClassInfoExA +#define CreateWindowEx CreateWindowExA +#define CreateWindow CreateWindowA +#define CreateDialogParam CreateDialogParamA +#define CreateDialogIndirectParam CreateDialogIndirectParamA +#define CreateDialog CreateDialogA +#define CreateDialogIndirect CreateDialogIndirectA +#define CreateWaitableTimer CreateWaitableTimerA +#define DialogBoxParam DialogBoxParamA +#define DialogBoxIndirectParam DialogBoxIndirectParamA +#define DialogBox DialogBoxA +#define DialogBoxIndirect DialogBoxIndirectA +#define RegisterClipboardFormat RegisterClipboardFormatA +#define SetDlgItemText SetDlgItemTextA +#define GetDlgItemText GetDlgItemTextA +#define SendDlgItemMessage SendDlgItemMessageA +#define DefDlgProc DefDlgProcA +#define CallMsgFilter CallMsgFilterA +#define GetClipboardFormatName GetClipboardFormatNameA +#define CharToOem CharToOemA +#define OemToChar OemToCharA +#define CharToOemBuff CharToOemBuffA +#define OemToCharBuff OemToCharBuffA +#define CharUpper CharUpperA +#define CharUpperBuff CharUpperBuffA +#define CharLower CharLowerA +#define CharLowerBuff CharLowerBuffA +#define CharNext CharNextA +#define CharPrev CharPrevA +#define IsCharAlpha IsCharAlphaA +#define IsCharAlphaNumeric IsCharAlphaNumericA +#define IsCharUpper IsCharUpperA +#define IsCharLower IsCharLowerA +#define GetKeyNameText GetKeyNameTextA +#define VkKeyScan VkKeyScanA +#define VkKeyScanEx VkKeyScanExA +#define MapVirtualKey MapVirtualKeyA +#define MapVirtualKeyEx MapVirtualKeyExA +#define LoadAccelerators LoadAcceleratorsA +#define CreateAcceleratorTable CreateAcceleratorTableA +#define CopyAcceleratorTable CopyAcceleratorTableA +#define TranslateAccelerator TranslateAcceleratorA +#define LoadMenu LoadMenuA +#define LoadMenuIndirect LoadMenuIndirectA +#define ChangeMenu ChangeMenuA +#define GetMenuString GetMenuStringA +#define InsertMenu InsertMenuA +#define AppendMenu AppendMenuA +#define ModifyMenu ModifyMenuA +#define InsertMenuItem InsertMenuItemA +#define GetMenuItemInfo GetMenuItemInfoA +#define SetMenuItemInfo SetMenuItemInfoA +#define DrawText DrawTextA +#define DrawTextEx DrawTextExA +#define GrayString GrayStringA +#define DrawState DrawStateA +#define TabbedTextOut TabbedTextOutA +#define GetTabbedTextExtent GetTabbedTextExtentA +#define GetVersionEx GetVersionExA +#define wvsprintf wvsprintfA +#define wsprintf wsprintfA +#define LoadKeyboardLayout LoadKeyboardLayoutA +#define GetKeyboardLayoutName GetKeyboardLayoutNameA +#define CreateDesktop CreateDesktopA +#define OpenDesktop OpenDesktopA +#define EnumDesktops EnumDesktopsA +#define CreateWindowStation CreateWindowStationA +#define OpenWindowStation OpenWindowStationA +#define EnumWindowStations EnumWindowStationsA +#define IsBadStringPtr IsBadStringPtrA +#define LookupAccountSid LookupAccountSidA +#define LookupAccountName LookupAccountNameA +#define LookupPrivilegeValue LookupPrivilegeValueA +#define LookupPrivilegeName LookupPrivilegeNameA +#define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameA +#define BuildCommDCB BuildCommDCBA +#define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsA +#define CommConfigDialog CommConfigDialogA +#define GetDefaultCommConfig GetDefaultCommConfigA +#define SetDefaultCommConfig SetDefaultCommConfigA +#define GetComputerName GetComputerNameA +#define SetComputerName SetComputerNameA +#define GetUserName GetUserNameA +#define CreateMailslot CreateMailslotA +#define FormatMessage FormatMessageA +#define GetEnvironmentStrings GetEnvironmentStringsA +#define FreeEnvironmentStrings FreeEnvironmentStringsA +#define lstrcmp lstrcmpA +#define lstrcmpi lstrcmpiA +#define lstrcpyn lstrcpynA +#define lstrcpy lstrcpyA +#define lstrcat lstrcatA +#define lstrlen lstrlenA +#define GetBinaryType GetBinaryTypeA +#define GetShortPathName GetShortPathNameA +#define SetFileSecurity SetFileSecurityA +#define GetFileSecurity GetFileSecurityA +#define FindFirstChangeNotification FindFirstChangeNotificationA +#define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmA +#define ObjectOpenAuditAlarm ObjectOpenAuditAlarmA +#define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmA +#define ObjectCloseAuditAlarm ObjectCloseAuditAlarmA +#define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmA +#define OpenEventLog OpenEventLogA +#define RegisterEventSource RegisterEventSourceA +#define OpenBackupEventLog OpenBackupEventLogA +#define ReadEventLog ReadEventLogA +#define ReportEvent ReportEventA +#define CreateProcess CreateProcessA +#define FatalAppExit FatalAppExitA +#define GetStartupInfo GetStartupInfoA +#define GetCommandLine GetCommandLineA +#define GetEnvironmentVariable GetEnvironmentVariableA +#define SetEnvironmentVariable SetEnvironmentVariableA +#define ExpandEnvironmentStrings ExpandEnvironmentStringsA +#define OutputDebugString OutputDebugStringA +#define FindResource FindResourceA +#define FindResourceEx FindResourceExA +#define EnumResourceTypes EnumResourceTypesA +#define EnumResourceNames EnumResourceNamesA +#define EnumResourceLanguages EnumResourceLanguagesA +#define BeginUpdateResource BeginUpdateResourceA +#define UpdateResource UpdateResourceA +#define EndUpdateResource EndUpdateResourceA +#define GlobalAddAtom GlobalAddAtomA +#define GlobalFindAtom GlobalFindAtomA +#define GlobalGetAtomName GlobalGetAtomNameA +#define AddAtom AddAtomA +#define FindAtom FindAtomA +#define GetProfileInt GetProfileIntA +#define GetAtomName GetAtomNameA +#define GetProfileString GetProfileStringA +#define WriteProfileString WriteProfileStringA +#define GetProfileSection GetProfileSectionA +#define WriteProfileSection WriteProfileSectionA +#define GetPrivateProfileInt GetPrivateProfileIntA +#define GetPrivateProfileString GetPrivateProfileStringA +#define WritePrivateProfileString WritePrivateProfileStringA +#define GetPrivateProfileSection GetPrivateProfileSectionA +#define WritePrivateProfileSection WritePrivateProfileSectionA +#define GetDriveType GetDriveTypeA +#define GetSystemDirectory GetSystemDirectoryA +#define GetTempPath GetTempPathA +#define GetTempFileName GetTempFileNameA +#define GetWindowsDirectory GetWindowsDirectoryA +#define SetCurrentDirectory SetCurrentDirectoryA +#define GetCurrentDirectory GetCurrentDirectoryA +#define GetDiskFreeSpace GetDiskFreeSpaceA +#define GetDiskFreeSpaceEx GetDiskFreeSpaceExA +#define CreateDirectory CreateDirectoryA +#define CreateDirectoryEx CreateDirectoryExA +#define RemoveDirectory RemoveDirectoryA +#define GetFullPathName GetFullPathNameA +#define DefineDosDevice DefineDosDeviceA +#define QueryDosDevice QueryDosDeviceA +#define CreateFile CreateFileA +#define SetFileAttributes SetFileAttributesA +#define GetFileAttributes GetFileAttributesA +#define GetCompressedFileSize GetCompressedFileSizeA +#define DeleteFile DeleteFileA +#define FindFirstFileEx FindFirstFileExA +#define FindFirstFile FindFirstFileA +#define FindNextFile FindNextFileA +#define SearchPath SearchPathA +#define CopyFile CopyFileA +#define MoveFile MoveFileA +#define MoveFileEx MoveFileExA +#define CreateNamedPipe CreateNamedPipeA +#define GetNamedPipeHandleState GetNamedPipeHandleStateA +#define CallNamedPipe CallNamedPipeA +#define WaitNamedPipe WaitNamedPipeA +#define SetVolumeLabel SetVolumeLabelA +#define GetVolumeInformation GetVolumeInformationA +#define ClearEventLog ClearEventLogA +#define BackupEventLog BackupEventLogA +#define CreateMutex CreateMutexA +#define OpenMutex OpenMutexA +#define CreateEvent CreateEventA +#define OpenEvent OpenEventA +#define CreateSemaphore CreateSemaphoreA +#define OpenSemaphore OpenSemaphoreA +#define CreateFileMapping CreateFileMappingA +#define OpenFileMapping OpenFileMappingA +#define GetLogicalDriveStrings GetLogicalDriveStringsA +#define LoadLibrary LoadLibraryA +#define LoadLibraryEx LoadLibraryExA +#define GetModuleFileName GetModuleFileNameA +#define GetModuleHandle GetModuleHandleA +#define GetUserObjectInformation GetUserObjectInformationA +#define SetUserObjectInformation SetUserObjectInformationA +#define RegisterWindowMessage RegisterWindowMessageA +#define GetMessage GetMessageA +#define DispatchMessage DispatchMessageA +#define PeekMessage PeekMessageA +#define SendMessage SendMessageA +#define SendMessageTimeout SendMessageTimeoutA +#define SendNotifyMessage SendNotifyMessageA +#define SendMessageCallback SendMessageCallbackA +#define PostMessage PostMessageA +#define PostThreadMessage PostThreadMessageA +#define VerFindFile VerFindFileA +#define VerInstallFile VerInstallFileA +#define GetFileVersionInfoSize GetFileVersionInfoSizeA +#define GetFileVersionInfo GetFileVersionInfoA +#define VerLanguageName VerLanguageNameA +#define VerQueryValue VerQueryValueA +#define CompareString CompareStringA +#define LCMapString LCMapStringA +#define GetLocaleInfo GetLocaleInfoA +#define SetLocaleInfo SetLocaleInfoA +#define GetTimeFormat GetTimeFormatA +#define GetDateFormat GetDateFormatA +#define GetNumberFormat GetNumberFormatA +#define GetCurrencyFormat GetCurrencyFormatA +#define EnumCalendarInfo EnumCalendarInfoA +#define EnumTimeFormats EnumTimeFormatsA +#define FoldString FoldStringA +#define EnumSystemCodePages EnumSystemCodePagesA +#define EnumSystemLocales EnumSystemLocalesA +#define GetStringTypeEx GetStringTypeExA +#define EnumDateFormats EnumDateFormatsA +#define GetConsoleTitle GetConsoleTitleA +#define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferA +#define SetConsoleTitle SetConsoleTitleA +#define ReadConsole ReadConsoleA +#define WriteConsole WriteConsoleA +#define PeekConsoleInput PeekConsoleInputA +#define ReadConsoleInput ReadConsoleInputA +#define WriteConsoleInput WriteConsoleInputA +#define ReadConsoleOutput ReadConsoleOutputA +#define WriteConsoleOutput WriteConsoleOutputA +#define ReadConsoleOutputCharacter ReadConsoleOutputCharacterA +#define WriteConsoleOutputCharacter WriteConsoleOutputCharacterA +#define FillConsoleOutputCharacter FillConsoleOutputCharacterA +#define MultinetGetConnectionPerformance MultinetGetConnectionPerformanceA +#define WNetGetLastError WNetGetLastErrorA +#define WNetGetProviderName WNetGetProviderNameA +#define WNetGetNetworkInformation WNetGetNetworkInformationA +#define WNetConnectionDialog1 WNetConnectionDialog1A +#define WNetDisconnectDialog1 WNetDisconnectDialog1A +#define WNetOpenEnum WNetOpenEnumA +#define WNetEnumResource WNetEnumResourceA +#define WNetGetUniversalName WNetGetUniversalNameA +#define WNetGetUser WNetGetUserA +#define WNetAddConnection WNetAddConnectionA +#define WNetAddConnection2 WNetAddConnection2A +#define WNetAddConnection3 WNetAddConnection3A +#define WNetCancelConnection WNetCancelConnectionA +#define WNetCancelConnection2 WNetCancelConnection2A +#define WNetGetConnection WNetGetConnectionA +#define WNetUseConnection WNetUseConnectionA +#define WNetSetConnection WNetSetConnectionA +#define OpenService OpenServiceA +#define QueryServiceConfig QueryServiceConfigA +#define QueryServiceLockStatus QueryServiceLockStatusA +#define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerA +#define StartServiceCtrlDispatcher StartServiceCtrlDispatcherA +#define StartService StartServiceA +#define ChangeServiceConfig ChangeServiceConfigA +#define CreateService CreateServiceA +#define EnumDependentServices EnumDependentServicesA +#define EnumServicesStatus EnumServicesStatusA +#define GetServiceKeyName GetServiceKeyNameA +#define GetServiceDisplayName GetServiceDisplayNameA +#define OpenSCManager OpenSCManagerA +#define DragQueryFile DragQueryFileA +#define ExtractAssociatedIcon ExtractAssociatedIconA +#define ExtractIcon ExtractIconA +#define FindExecutable FindExecutableA +#define ShellAbout ShellAboutA +#define ShellExecute ShellExecuteA +#define DdeCreateStringHandle DdeCreateStringHandleA +#define DdeInitialize DdeInitializeA +#define DdeQueryString DdeQueryStringA +#define LogonUser LogonUserA +#define CreateProcessAsUser CreateProcessAsUserA + +#endif /* UNICODE and ASCII defines */ + +WINBOOL STDCALL AbnormalTermination(VOID); +int STDCALL AbortDoc(HDC); +WINBOOL STDCALL AbortPath(HDC); +WINBOOL STDCALL AbortPrinter(HANDLE); +WINBOOL CALLBACK AbortProc(HDC, int); +WINBOOL STDCALL AbortSystemShutdown(LPTSTR); +WINBOOL STDCALL AccessCheck( + PSECURITY_DESCRIPTOR pSecurityDescriptor, + HANDLE ClientToken, + DWORD DesiredAccess, + PGENERIC_MAPPING GenericMapping, + PPRIVILEGE_SET PrivilegeSet, + LPDWORD PrivilegeSetLength, + LPDWORD GrantedAccess, + LPBOOL AccessStatus + ); + +WINBOOL STDCALL AccessCheckAndAuditAlarm( + LPCTSTR SubsystemName, + LPVOID HandleId, + LPTSTR ObjectTypeName, + LPTSTR ObjectName, + PSECURITY_DESCRIPTOR SecurityDescriptor, + DWORD DesiredAccess, + PGENERIC_MAPPING GenericMapping, + WINBOOL ObjectCreation, + LPDWORD GrantedAccess, + LPBOOL AccessStatus, + LPBOOL pfGenerateOnClose + ); + +#ifndef __NTDRIVER__ +LONG +STDCALL +InterlockedIncrement( + LPLONG lpAddend + ); + +LONG +STDCALL +InterlockedDecrement( + LPLONG lpAddend + ); + +LONG +STDCALL +InterlockedExchange( + LPLONG Target, + LONG Value + ); + +PVOID +STDCALL +InterlockedCompareExchange( + PVOID *Destination, + PVOID Exchange, + PVOID Comperand + ); +#endif + +WINBOOL +STDCALL +FreeResource( + HGLOBAL hResData + ); + +LPVOID +STDCALL +LockResource( + HGLOBAL hResData + ); + +int +STDCALL +WinMain( + HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nShowCmd + ); + +WINBOOL +STDCALL +FreeLibrary( + HINSTANCE hLibModule + ); + + +VOID +STDCALL +FreeLibraryAndExitThread( + HMODULE hLibModule, + DWORD dwExitCode + ); + +WINBOOL +STDCALL +DisableThreadLibraryCalls( + HMODULE hLibModule + ); + +FARPROC +STDCALL +GetProcAddress( + HINSTANCE hModule, + LPCSTR lpProcName + ); + +DWORD +STDCALL +GetVersion( VOID ); + +HGLOBAL +STDCALL +GlobalAlloc( + UINT uFlags, + DWORD dwBytes + ); + +HGLOBAL +GlobalDiscard( + HGLOBAL hglbMem + ); + +HGLOBAL +STDCALL +GlobalReAlloc( + HGLOBAL hMem, + DWORD dwBytes, + UINT uFlags + ); + +DWORD +STDCALL +GlobalSize( + HGLOBAL hMem + ); + +UINT +STDCALL +GlobalFlags( + HGLOBAL hMem + ); + + +LPVOID +STDCALL +GlobalLock( + HGLOBAL hMem + ); + +HGLOBAL +STDCALL +GlobalHandle( + LPCVOID pMem + ); + + +WINBOOL +STDCALL +GlobalUnlock( + HGLOBAL hMem + ); + + +HGLOBAL +STDCALL +GlobalFree( + HGLOBAL hMem + ); + +UINT +STDCALL +GlobalCompact( + DWORD dwMinFree + ); + + +VOID +STDCALL +GlobalFix( + HGLOBAL hMem + ); + + +VOID +STDCALL +GlobalUnfix( + HGLOBAL hMem + ); + + +LPVOID +STDCALL +GlobalWire( + HGLOBAL hMem + ); + + +WINBOOL +STDCALL +GlobalUnWire( + HGLOBAL hMem + ); + + +VOID +STDCALL +GlobalMemoryStatus( + LPMEMORYSTATUS lpBuffer + ); + + +HLOCAL +STDCALL +LocalAlloc( + UINT uFlags, + UINT uBytes + ); + +HLOCAL +LocalDiscard( + HLOCAL hlocMem + ); + +HLOCAL +STDCALL +LocalReAlloc( + HLOCAL hMem, + UINT uBytes, + UINT uFlags + ); + + +LPVOID +STDCALL +LocalLock( + HLOCAL hMem + ); + + +HLOCAL +STDCALL +LocalHandle( + LPCVOID pMem + ); + + +WINBOOL +STDCALL +LocalUnlock( + HLOCAL hMem + ); + + +UINT +STDCALL +LocalSize( + HLOCAL hMem + ); + + +UINT +STDCALL +LocalFlags( + HLOCAL hMem + ); + + +HLOCAL +STDCALL +LocalFree( + HLOCAL hMem + ); + + +UINT +STDCALL +LocalShrink( + HLOCAL hMem, + UINT cbNewSize + ); + + +UINT +STDCALL +LocalCompact( + UINT uMinFree + ); + + +WINBOOL +STDCALL +FlushInstructionCache( + HANDLE hProcess, + LPCVOID lpBaseAddress, + DWORD dwSize + ); + + +LPVOID +STDCALL +VirtualAlloc( + LPVOID lpAddress, + DWORD dwSize, + DWORD flAllocationType, + DWORD flProtect + ); + + +WINBOOL +STDCALL +VirtualFree( + LPVOID lpAddress, + DWORD dwSize, + DWORD dwFreeType + ); + + +WINBOOL +STDCALL +VirtualProtect( + LPVOID lpAddress, + DWORD dwSize, + DWORD flNewProtect, + PDWORD lpflOldProtect + ); + + +DWORD +STDCALL +VirtualQuery( + LPCVOID lpAddress, + PMEMORY_BASIC_INFORMATION lpBuffer, + DWORD dwLength + ); + + +WINBOOL +STDCALL +VirtualProtectEx( + HANDLE hProcess, + LPVOID lpAddress, + DWORD dwSize, + DWORD flNewProtect, + PDWORD lpflOldProtect + ); + + +DWORD +STDCALL +VirtualQueryEx( + HANDLE hProcess, + LPCVOID lpAddress, + PMEMORY_BASIC_INFORMATION lpBuffer, + DWORD dwLength + ); + + +HANDLE +STDCALL +HeapCreate( + DWORD flOptions, + DWORD dwInitialSize, + DWORD dwMaximumSize + ); + +WINBOOL +STDCALL +HeapDestroy( + HANDLE hHeap + ); + +LPVOID +STDCALL +HeapAlloc( + HANDLE hHeap, + DWORD dwFlags, + DWORD dwBytes + ); + +LPVOID +STDCALL +HeapReAlloc( + HANDLE hHeap, + DWORD dwFlags, + LPVOID lpMem, + DWORD dwBytes + ); + +WINBOOL +STDCALL +HeapFree( + HANDLE hHeap, + DWORD dwFlags, + LPVOID lpMem + ); + +DWORD +STDCALL +HeapSize( + HANDLE hHeap, + DWORD dwFlags, + LPCVOID lpMem + ); + +WINBOOL +STDCALL +HeapValidate( + HANDLE hHeap, + DWORD dwFlags, + LPCVOID lpMem + ); + +UINT +STDCALL +HeapCompact( + HANDLE hHeap, + DWORD dwFlags + ); + +HANDLE +STDCALL +GetProcessHeap( VOID ); + +DWORD +STDCALL +GetProcessHeaps( + DWORD NumberOfHeaps, + PHANDLE ProcessHeaps + ); + +DWORD +STDCALL +GetProcessVersion ( + DWORD ProcessId + ); + +WINBOOL +STDCALL +HeapLock( + HANDLE hHeap + ); + +WINBOOL +STDCALL +HeapUnlock( + HANDLE hHeap + ); + +WINBOOL +STDCALL +HeapWalk( + HANDLE hHeap, + LPPROCESS_HEAP_ENTRY lpEntry + ); + +WINBOOL +STDCALL +GetProcessAffinityMask( + HANDLE hProcess, + LPDWORD lpProcessAffinityMask, + LPDWORD lpSystemAffinityMask + ); + +WINBOOL +STDCALL +GetProcessTimes( + HANDLE hProcess, + LPFILETIME lpCreationTime, + LPFILETIME lpExitTime, + LPFILETIME lpKernelTime, + LPFILETIME lpUserTime + ); + +WINBOOL +STDCALL +GetProcessWorkingSetSize( + HANDLE hProcess, + LPDWORD lpMinimumWorkingSetSize, + LPDWORD lpMaximumWorkingSetSize + ); + +WINBOOL +STDCALL +SetProcessWorkingSetSize( + HANDLE hProcess, + DWORD dwMinimumWorkingSetSize, + DWORD dwMaximumWorkingSetSize + ); + +HANDLE +STDCALL +OpenProcess( + DWORD dwDesiredAccess, + WINBOOL bInheritHandle, + DWORD dwProcessId + ); + +HANDLE +STDCALL +GetCurrentProcess( + VOID + ); + +DWORD +STDCALL +GetCurrentProcessId( + VOID + ); + +VOID +STDCALL +ExitProcess( + UINT uExitCode + ) __attribute__ ((noreturn)); + +WINBOOL +STDCALL +TerminateProcess( + HANDLE hProcess, + UINT uExitCode + ); + +WINBOOL +STDCALL +GetExitCodeProcess( + HANDLE hProcess, + LPDWORD lpExitCode + ); + +VOID +STDCALL +FatalExit( + int ExitCode + ); + +VOID +STDCALL +RaiseException( + DWORD dwExceptionCode, + DWORD dwExceptionFlags, + DWORD nNumberOfArguments, + CONST DWORD *lpArguments + ); + +LONG +STDCALL +UnhandledExceptionFilter( + struct _EXCEPTION_POINTERS *ExceptionInfo + ); + +/* + TODO: what is TOP_LEVEL_EXCEPTION_FILTER? +LPTOP_LEVEL_EXCEPTION_FILTER +STDCALL +SetUnhandledExceptionFilter( + LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter + ); +*/ + + +HANDLE +STDCALL +CreateThread( + LPSECURITY_ATTRIBUTES lpThreadAttributes, + DWORD dwStackSize, + LPTHREAD_START_ROUTINE lpStartAddress, + LPVOID lpParameter, + DWORD dwCreationFlags, + LPDWORD lpThreadId + ); + + +HANDLE +STDCALL +CreateRemoteThread( + HANDLE hProcess, + LPSECURITY_ATTRIBUTES lpThreadAttributes, + DWORD dwStackSize, + LPTHREAD_START_ROUTINE lpStartAddress, + LPVOID lpParameter, + DWORD dwCreationFlags, + LPDWORD lpThreadId + ); + + +HANDLE +STDCALL +GetCurrentThread( + VOID + ); + + +DWORD +STDCALL +GetCurrentThreadId( + VOID + ); + + +DWORD +STDCALL +SetThreadAffinityMask( + HANDLE hThread, + DWORD dwThreadAffinityMask + ); + + +WINBOOL +STDCALL +SetThreadPriority( + HANDLE hThread, + int nPriority + ); + + +int +STDCALL +GetThreadPriority( + HANDLE hThread + ); + + +WINBOOL +STDCALL +GetThreadTimes( + HANDLE hThread, + LPFILETIME lpCreationTime, + LPFILETIME lpExitTime, + LPFILETIME lpKernelTime, + LPFILETIME lpUserTime + ); + + +VOID +STDCALL +ExitThread( + DWORD dwExitCode + ); + + +WINBOOL +STDCALL +TerminateThread( + HANDLE hThread, + DWORD dwExitCode + ); + + +WINBOOL +STDCALL +GetExitCodeThread( + HANDLE hThread, + LPDWORD lpExitCode + ); + +WINBOOL +STDCALL +GetThreadSelectorEntry( + HANDLE hThread, + DWORD dwSelector, + LPLDT_ENTRY lpSelectorEntry + ); + + +DWORD +STDCALL +GetLastError( + VOID + ); + + +VOID +STDCALL +SetLastError( + DWORD dwErrCode + ); + + +WINBOOL +STDCALL +GetOverlappedResult( + HANDLE hFile, + LPOVERLAPPED lpOverlapped, + LPDWORD lpNumberOfBytesTransferred, + WINBOOL bWait + ); + + +HANDLE +STDCALL +CreateIoCompletionPort( + HANDLE FileHandle, + HANDLE ExistingCompletionPort, + DWORD CompletionKey, + DWORD NumberOfConcurrentThreads + ); + + +WINBOOL +STDCALL +GetQueuedCompletionStatus( + HANDLE CompletionPort, + LPDWORD lpNumberOfBytesTransferred, + LPDWORD lpCompletionKey, + LPOVERLAPPED *lpOverlapped, + DWORD dwMilliseconds + ); + +UINT +STDCALL +SetErrorMode( + UINT uMode + ); + + +WINBOOL +STDCALL +ReadProcessMemory( + HANDLE hProcess, + LPCVOID lpBaseAddress, + LPVOID lpBuffer, + DWORD nSize, + LPDWORD lpNumberOfBytesRead + ); + + +WINBOOL +STDCALL +WriteProcessMemory( + HANDLE hProcess, + LPVOID lpBaseAddress, + LPVOID lpBuffer, + DWORD nSize, + LPDWORD lpNumberOfBytesWritten + ); + + +WINBOOL +STDCALL +GetThreadContext( + HANDLE hThread, + LPCONTEXT lpContext + ); + + +WINBOOL +STDCALL +SetThreadContext( + HANDLE hThread, + CONST CONTEXT *lpContext + ); + + +DWORD +STDCALL +SuspendThread( + HANDLE hThread + ); + + +DWORD +STDCALL +ResumeThread( + HANDLE hThread + ); + + +VOID +STDCALL +DebugBreak( + VOID + ); + + +WINBOOL +STDCALL +WaitForDebugEvent( + LPDEBUG_EVENT lpDebugEvent, + DWORD dwMilliseconds + ); + + +WINBOOL +STDCALL +ContinueDebugEvent( + DWORD dwProcessId, + DWORD dwThreadId, + DWORD dwContinueStatus + ); + + +WINBOOL +STDCALL +DebugActiveProcess( + DWORD dwProcessId + ); + + +VOID +STDCALL +InitializeCriticalSection( + LPCRITICAL_SECTION lpCriticalSection + ); + + +VOID +STDCALL +EnterCriticalSection( + LPCRITICAL_SECTION lpCriticalSection + ); + + +VOID +STDCALL +LeaveCriticalSection( + LPCRITICAL_SECTION lpCriticalSection + ); + + +VOID +STDCALL +DeleteCriticalSection( + LPCRITICAL_SECTION lpCriticalSection + ); + + +WINBOOL +STDCALL +SetEvent( + HANDLE hEvent + ); + + +WINBOOL +STDCALL +ResetEvent( + HANDLE hEvent + ); + + +WINBOOL +STDCALL +PulseEvent( + HANDLE hEvent + ); + + +WINBOOL +STDCALL +ReleaseSemaphore( + HANDLE hSemaphore, + LONG lReleaseCount, + LPLONG lpPreviousCount + ); + + +WINBOOL +STDCALL +ReleaseMutex( + HANDLE hMutex + ); + + +DWORD +STDCALL +WaitForSingleObject( + HANDLE hHandle, + DWORD dwMilliseconds + ); + + +DWORD +STDCALL +WaitForMultipleObjects( + DWORD nCount, + CONST HANDLE *lpHandles, + WINBOOL bWaitAll, + DWORD dwMilliseconds + ); + + +VOID +STDCALL +Sleep( + DWORD dwMilliseconds + ); + + +HGLOBAL +STDCALL +LoadResource( + HINSTANCE hModule, + HRSRC hResInfo + ); + + +DWORD +STDCALL +SizeofResource( + HINSTANCE hModule, + HRSRC hResInfo + ); + + + +ATOM +STDCALL +GlobalDeleteAtom( + ATOM nAtom + ); + + +WINBOOL +STDCALL +InitAtomTable( + DWORD nSize + ); + + +ATOM +STDCALL +DeleteAtom( + ATOM nAtom + ); + + +UINT +STDCALL +SetHandleCount( + UINT uNumber + ); + + +DWORD +STDCALL +GetLogicalDrives( + VOID + ); + + +WINBOOL +STDCALL +LockFile( + HANDLE hFile, + DWORD dwFileOffsetLow, + DWORD dwFileOffsetHigh, + DWORD nNumberOfBytesToLockLow, + DWORD nNumberOfBytesToLockHigh + ); + + +WINBOOL +STDCALL +UnlockFile( + HANDLE hFile, + DWORD dwFileOffsetLow, + DWORD dwFileOffsetHigh, + DWORD nNumberOfBytesToUnlockLow, + DWORD nNumberOfBytesToUnlockHigh + ); + + +WINBOOL +STDCALL +LockFileEx( + HANDLE hFile, + DWORD dwFlags, + DWORD dwReserved, + DWORD nNumberOfBytesToLockLow, + DWORD nNumberOfBytesToLockHigh, + LPOVERLAPPED lpOverlapped + ); + +WINBOOL +STDCALL +UnlockFileEx( + HANDLE hFile, + DWORD dwReserved, + DWORD nNumberOfBytesToUnlockLow, + DWORD nNumberOfBytesToUnlockHigh, + LPOVERLAPPED lpOverlapped + ); + +WINBOOL +STDCALL +GetFileInformationByHandle( + HANDLE hFile, + LPBY_HANDLE_FILE_INFORMATION lpFileInformation + ); + + +DWORD +STDCALL +GetFileType( + HANDLE hFile + ); + + +DWORD +STDCALL +GetFileSize( + HANDLE hFile, + LPDWORD lpFileSizeHigh + ); + + +HANDLE +STDCALL +GetStdHandle( + DWORD nStdHandle + ); + + +WINBOOL +STDCALL +SetStdHandle( + DWORD nStdHandle, + HANDLE hHandle + ); + + +WINBOOL +STDCALL +WriteFile( + HANDLE hFile, + LPCVOID lpBuffer, + DWORD nNumberOfBytesToWrite, + LPDWORD lpNumberOfBytesWritten, + LPOVERLAPPED lpOverlapped + ); + + +WINBOOL +STDCALL +ReadFile( + HANDLE hFile, + LPVOID lpBuffer, + DWORD nNumberOfBytesToRead, + LPDWORD lpNumberOfBytesRead, + LPOVERLAPPED lpOverlapped + ); + + +WINBOOL +STDCALL +FlushFileBuffers( + HANDLE hFile + ); + + +WINBOOL +STDCALL +DeviceIoControl( + HANDLE hDevice, + DWORD dwIoControlCode, + LPVOID lpInBuffer, + DWORD nInBufferSize, + LPVOID lpOutBuffer, + DWORD nOutBufferSize, + LPDWORD lpBytesReturned, + LPOVERLAPPED lpOverlapped + ); + + +WINBOOL +STDCALL +SetEndOfFile( + HANDLE hFile + ); + + +DWORD +STDCALL +SetFilePointer( + HANDLE hFile, + LONG lDistanceToMove, + PLONG lpDistanceToMoveHigh, + DWORD dwMoveMethod + ); + + +WINBOOL +STDCALL +FindClose( + HANDLE hFindFile + ); + + +WINBOOL +STDCALL +GetFileTime( + HANDLE hFile, + LPFILETIME lpCreationTime, + LPFILETIME lpLastAccessTime, + LPFILETIME lpLastWriteTime + ); + + +WINBOOL +STDCALL +SetFileTime( + HANDLE hFile, + CONST FILETIME *lpCreationTime, + CONST FILETIME *lpLastAccessTime, + CONST FILETIME *lpLastWriteTime + ); + + +WINBOOL +STDCALL +CloseHandle( + HANDLE hObject + ); + + +WINBOOL +STDCALL +DuplicateHandle( + HANDLE hSourceProcessHandle, + HANDLE hSourceHandle, + HANDLE hTargetProcessHandle, + LPHANDLE lpTargetHandle, + DWORD dwDesiredAccess, + WINBOOL bInheritHandle, + DWORD dwOptions + ); + + +WINBOOL +STDCALL +GetHandleInformation( + HANDLE hObject, + LPDWORD lpdwFlags + ); + + +WINBOOL +STDCALL +SetHandleInformation( + HANDLE hObject, + DWORD dwMask, + DWORD dwFlags + ); + +DWORD +STDCALL +LoadModule( + LPCSTR lpModuleName, + LPVOID lpParameterBlock + ); + + +UINT +STDCALL +WinExec( + LPCSTR lpCmdLine, + UINT uCmdShow + ); + + +WINBOOL +STDCALL +ClearCommBreak( + HANDLE hFile + ); + + +WINBOOL +STDCALL +ClearCommError( + HANDLE hFile, + LPDWORD lpErrors, + LPCOMSTAT lpStat + ); + + +WINBOOL +STDCALL +SetupComm( + HANDLE hFile, + DWORD dwInQueue, + DWORD dwOutQueue + ); + + +WINBOOL +STDCALL +EscapeCommFunction( + HANDLE hFile, + DWORD dwFunc + ); + + +WINBOOL +STDCALL +GetCommConfig( + HANDLE hCommDev, + LPCOMMCONFIG lpCC, + LPDWORD lpdwSize + ); + + +WINBOOL +STDCALL +GetCommMask( + HANDLE hFile, + LPDWORD lpEvtMask + ); + + +WINBOOL +STDCALL +GetCommProperties( + HANDLE hFile, + LPCOMMPROP lpCommProp + ); + + +WINBOOL +STDCALL +GetCommModemStatus( + HANDLE hFile, + LPDWORD lpModemStat + ); + + +WINBOOL +STDCALL +GetCommState( + HANDLE hFile, + LPDCB lpDCB + ); + + +WINBOOL +STDCALL +GetCommTimeouts( + HANDLE hFile, + LPCOMMTIMEOUTS lpCommTimeouts + ); + + +WINBOOL +STDCALL +PurgeComm( + HANDLE hFile, + DWORD dwFlags + ); + + +WINBOOL +STDCALL +SetCommBreak( + HANDLE hFile + ); + + +WINBOOL +STDCALL +SetCommConfig( + HANDLE hCommDev, + LPCOMMCONFIG lpCC, + DWORD dwSize + ); + + +WINBOOL +STDCALL +SetCommMask( + HANDLE hFile, + DWORD dwEvtMask + ); + + +WINBOOL +STDCALL +SetCommState( + HANDLE hFile, + LPDCB lpDCB + ); + + +WINBOOL +STDCALL +SetCommTimeouts( + HANDLE hFile, + LPCOMMTIMEOUTS lpCommTimeouts + ); + + +WINBOOL +STDCALL +TransmitCommChar( + HANDLE hFile, + char cChar + ); + + +WINBOOL +STDCALL +WaitCommEvent( + HANDLE hFile, + LPDWORD lpEvtMask, + LPOVERLAPPED lpOverlapped + ); + + + +DWORD +STDCALL +SetTapePosition( + HANDLE hDevice, + DWORD dwPositionMethod, + DWORD dwPartition, + DWORD dwOffsetLow, + DWORD dwOffsetHigh, + WINBOOL bImmediate + ); + + +DWORD +STDCALL +GetTapePosition( + HANDLE hDevice, + DWORD dwPositionType, + LPDWORD lpdwPartition, + LPDWORD lpdwOffsetLow, + LPDWORD lpdwOffsetHigh + ); + + +DWORD +STDCALL +PrepareTape( + HANDLE hDevice, + DWORD dwOperation, + WINBOOL bImmediate + ); + +BOOL +STDCALL +ProcessIdToSessionId( + DWORD dwProcessId, + DWORD* pSessionId + ); + +DWORD +STDCALL +EraseTape( + HANDLE hDevice, + DWORD dwEraseType, + WINBOOL bImmediate + ); + + +DWORD +STDCALL +CreateTapePartition( + HANDLE hDevice, + DWORD dwPartitionMethod, + DWORD dwCount, + DWORD dwSize + ); + + +DWORD +STDCALL +WriteTapemark( + HANDLE hDevice, + DWORD dwTapemarkType, + DWORD dwTapemarkCount, + WINBOOL bImmediate + ); + + +DWORD +STDCALL +GetTapeStatus( + HANDLE hDevice + ); + + +DWORD +STDCALL +GetTapeParameters( + HANDLE hDevice, + DWORD dwOperation, + LPDWORD lpdwSize, + LPVOID lpTapeInformation + ); + +DWORD +STDCALL +SetTapeParameters( + HANDLE hDevice, + DWORD dwOperation, + LPVOID lpTapeInformation + ); + +WINBOOL +STDCALL +Beep( + DWORD dwFreq, + DWORD dwDuration + ); + + +VOID +STDCALL +OpenSound( + VOID + ); + + +VOID +STDCALL +CloseSound( + VOID + ); + + +VOID +STDCALL +StartSound( + VOID + ); + + +VOID +STDCALL +StopSound( + VOID + ); + + +DWORD +STDCALL +WaitSoundState( + DWORD nState + ); + + +DWORD +STDCALL +SyncAllVoices( + VOID + ); + + +DWORD +STDCALL +CountVoiceNotes( + DWORD nVoice + ); + + +LPDWORD +STDCALL +GetThresholdEvent( + VOID + ); + + +DWORD +STDCALL +GetThresholdStatus( + VOID + ); + + +DWORD +STDCALL +SetSoundNoise( + DWORD nSource, + DWORD nDuration + ); + + +DWORD +STDCALL +SetVoiceAccent( + DWORD nVoice, + DWORD nTempo, + DWORD nVolume, + DWORD nMode, + DWORD nPitch + ); + + +DWORD +STDCALL +SetVoiceEnvelope( + DWORD nVoice, + DWORD nShape, + DWORD nRepeat + ); + + +DWORD +STDCALL +SetVoiceNote( + DWORD nVoice, + DWORD nValue, + DWORD nLength, + DWORD nCdots + ); + + +DWORD +STDCALL +SetVoiceQueueSize( + DWORD nVoice, + DWORD nBytes + ); + + +DWORD +STDCALL +SetVoiceSound( + DWORD nVoice, + DWORD Frequency, + DWORD nDuration + ); + + +DWORD +STDCALL +SetVoiceThreshold( + DWORD nVoice, + DWORD nNotes + ); + + +int +STDCALL +MulDiv( + int nNumber, + int nNumerator, + int nDenominator + ); + + +VOID +STDCALL +GetSystemTime( + LPSYSTEMTIME lpSystemTime + ); + +VOID +STDCALL +GetSystemTimeAsFileTime ( + LPFILETIME lpSystemTimeAsFileTime + ); + +WINBOOL +STDCALL +SetSystemTime( + CONST SYSTEMTIME *lpSystemTime + ); + + +VOID +STDCALL +GetLocalTime( + LPSYSTEMTIME lpSystemTime + ); + + +WINBOOL +STDCALL +SetLocalTime( + CONST SYSTEMTIME *lpSystemTime + ); + + +VOID +STDCALL +GetSystemInfo( + LPSYSTEM_INFO lpSystemInfo + ); + +WINBOOL +STDCALL +SystemTimeToTzSpecificLocalTime( + LPTIME_ZONE_INFORMATION lpTimeZoneInformation, + LPSYSTEMTIME lpUniversalTime, + LPSYSTEMTIME lpLocalTime + ); + + +DWORD +STDCALL +GetTimeZoneInformation( + LPTIME_ZONE_INFORMATION lpTimeZoneInformation + ); + + +WINBOOL +STDCALL +SetTimeZoneInformation( + CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation + ); + +WINBOOL +STDCALL +SystemTimeToFileTime( + CONST SYSTEMTIME *lpSystemTime, + LPFILETIME lpFileTime + ); + + +WINBOOL +STDCALL +FileTimeToLocalFileTime( + CONST FILETIME *lpFileTime, + LPFILETIME lpLocalFileTime + ); + + +WINBOOL +STDCALL +LocalFileTimeToFileTime( + CONST FILETIME *lpLocalFileTime, + LPFILETIME lpFileTime + ); + + +WINBOOL +STDCALL +FileTimeToSystemTime( + CONST FILETIME *lpFileTime, + LPSYSTEMTIME lpSystemTime + ); + + +LONG +STDCALL +CompareFileTime( + CONST FILETIME *lpFileTime1, + CONST FILETIME *lpFileTime2 + ); + + +WINBOOL +STDCALL +FileTimeToDosDateTime( + CONST FILETIME *lpFileTime, + LPWORD lpFatDate, + LPWORD lpFatTime + ); + + +WINBOOL +STDCALL +DosDateTimeToFileTime( + WORD wFatDate, + WORD wFatTime, + LPFILETIME lpFileTime + ); + + +DWORD +STDCALL +GetTickCount( + VOID + ); + + +WINBOOL +STDCALL +SetSystemTimeAdjustment( + DWORD dwTimeAdjustment, + WINBOOL bTimeAdjustmentDisabled + ); + + +WINBOOL +STDCALL +GetSystemTimeAdjustment( + PDWORD lpTimeAdjustment, + PDWORD lpTimeIncrement, + PWINBOOL lpTimeAdjustmentDisabled + ); + + +WINBOOL +STDCALL +CreatePipe( + PHANDLE hReadPipe, + PHANDLE hWritePipe, + LPSECURITY_ATTRIBUTES lpPipeAttributes, + DWORD nSize + ); + + +WINBOOL +STDCALL +ConnectNamedPipe( + HANDLE hNamedPipe, + LPOVERLAPPED lpOverlapped + ); + + +WINBOOL +STDCALL +DisconnectNamedPipe( + HANDLE hNamedPipe + ); + + +WINBOOL +STDCALL +SetNamedPipeHandleState( + HANDLE hNamedPipe, + LPDWORD lpMode, + LPDWORD lpMaxCollectionCount, + LPDWORD lpCollectDataTimeout + ); + + +WINBOOL +STDCALL +GetNamedPipeInfo( + HANDLE hNamedPipe, + LPDWORD lpFlags, + LPDWORD lpOutBufferSize, + LPDWORD lpInBufferSize, + LPDWORD lpMaxInstances + ); + + +WINBOOL +STDCALL +PeekNamedPipe( + HANDLE hNamedPipe, + LPVOID lpBuffer, + DWORD nBufferSize, + LPDWORD lpBytesRead, + LPDWORD lpTotalBytesAvail, + LPDWORD lpBytesLeftThisMessage + ); + + +WINBOOL +STDCALL +TransactNamedPipe( + HANDLE hNamedPipe, + LPVOID lpInBuffer, + DWORD nInBufferSize, + LPVOID lpOutBuffer, + DWORD nOutBufferSize, + LPDWORD lpBytesRead, + LPOVERLAPPED lpOverlapped + ); + + + +WINBOOL +STDCALL +GetMailslotInfo( + HANDLE hMailslot, + LPDWORD lpMaxMessageSize, + LPDWORD lpNextSize, + LPDWORD lpMessageCount, + LPDWORD lpReadTimeout + ); + + +WINBOOL +STDCALL +SetMailslotInfo( + HANDLE hMailslot, + DWORD lReadTimeout + ); + + +LPVOID +STDCALL +MapViewOfFile( + HANDLE hFileMappingObject, + DWORD dwDesiredAccess, + DWORD dwFileOffsetHigh, + DWORD dwFileOffsetLow, + DWORD dwNumberOfBytesToMap + ); + + +WINBOOL +STDCALL +FlushViewOfFile( + LPCVOID lpBaseAddress, + DWORD dwNumberOfBytesToFlush + ); + + +WINBOOL +STDCALL +UnmapViewOfFile( + LPVOID lpBaseAddress + ); + +HFILE +STDCALL +OpenFile( + LPCSTR lpFileName, + LPOFSTRUCT lpReOpenBuff, + UINT uStyle + ); + + +HFILE +STDCALL +_lopen( + LPCSTR lpPathName, + int iReadWrite + ); + + +HFILE +STDCALL +_lcreat( + LPCSTR lpPathName, + int iAttribute + ); + + +UINT +STDCALL +_lread( + HFILE hFile, + LPVOID lpBuffer, + UINT uBytes + ); + + +UINT +STDCALL +_lwrite( + HFILE hFile, + LPCSTR lpBuffer, + UINT uBytes + ); + + +long +STDCALL +_hread( + HFILE hFile, + LPVOID lpBuffer, + long lBytes + ); + + +long +STDCALL +_hwrite( + HFILE hFile, + LPCSTR lpBuffer, + long lBytes + ); + + +HFILE +STDCALL +_lclose( + HFILE hFile + ); + + +LONG +STDCALL +_llseek( + HFILE hFile, + LONG lOffset, + int iOrigin + ); + + +WINBOOL +STDCALL +IsTextUnicode( + CONST LPVOID lpBuffer, + int cb, + LPINT lpi + ); + + +DWORD +STDCALL +TlsAlloc( + VOID + ); + +LPVOID +STDCALL +TlsGetValue( + DWORD dwTlsIndex + ); + + +WINBOOL +STDCALL +TlsSetValue( + DWORD dwTlsIndex, + LPVOID lpTlsValue + ); + + +WINBOOL +STDCALL +TlsFree( + DWORD dwTlsIndex + ); + +DWORD +STDCALL +SleepEx( + DWORD dwMilliseconds, + WINBOOL bAlertable + ); + + +DWORD +STDCALL +WaitForSingleObjectEx( + HANDLE hHandle, + DWORD dwMilliseconds, + WINBOOL bAlertable + ); + + +DWORD +STDCALL +WaitForMultipleObjectsEx( + DWORD nCount, + CONST HANDLE *lpHandles, + WINBOOL bWaitAll, + DWORD dwMilliseconds, + WINBOOL bAlertable + ); + + +WINBOOL +STDCALL +ReadFileEx( + HANDLE hFile, + LPVOID lpBuffer, + DWORD nNumberOfBytesToRead, + LPOVERLAPPED lpOverlapped, + LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine + ); + + +WINBOOL +STDCALL +WriteFileEx( + HANDLE hFile, + LPCVOID lpBuffer, + DWORD nNumberOfBytesToWrite, + LPOVERLAPPED lpOverlapped, + LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine + ); + + +WINBOOL +STDCALL +BackupRead( + HANDLE hFile, + LPBYTE lpBuffer, + DWORD nNumberOfBytesToRead, + LPDWORD lpNumberOfBytesRead, + WINBOOL bAbort, + WINBOOL bProcessSecurity, + LPVOID *lpContext + ); + + +WINBOOL +STDCALL +BackupSeek( + HANDLE hFile, + DWORD dwLowBytesToSeek, + DWORD dwHighBytesToSeek, + LPDWORD lpdwLowByteSeeked, + LPDWORD lpdwHighByteSeeked, + LPVOID *lpContext + ); + + +WINBOOL +STDCALL +BackupWrite( + HANDLE hFile, + LPBYTE lpBuffer, + DWORD nNumberOfBytesToWrite, + LPDWORD lpNumberOfBytesWritten, + WINBOOL bAbort, + WINBOOL bProcessSecurity, + LPVOID *lpContext + ); + +WINBOOL +STDCALL +SetProcessShutdownParameters( + DWORD dwLevel, + DWORD dwFlags + ); + + +WINBOOL +STDCALL +GetProcessShutdownParameters( + LPDWORD lpdwLevel, + LPDWORD lpdwFlags + ); + + +VOID +STDCALL +SetFileApisToOEM( VOID ); + + +VOID +STDCALL +SetFileApisToANSI( VOID ); + + +WINBOOL +STDCALL +AreFileApisANSI( VOID ); + +WINBOOL +STDCALL +CloseEventLog ( + HANDLE hEventLog + ); + + +WINBOOL +STDCALL +DeregisterEventSource ( + HANDLE hEventLog + ); + + +WINBOOL +STDCALL +NotifyChangeEventLog ( + HANDLE hEventLog, + HANDLE hEvent + ); + + +WINBOOL +STDCALL +GetNumberOfEventLogRecords ( + HANDLE hEventLog, + PDWORD NumberOfRecords + ); + + +WINBOOL +STDCALL +GetOldestEventLogRecord ( + HANDLE hEventLog, + PDWORD OldestRecord + ); + +WINBOOL +STDCALL +DuplicateToken( + HANDLE ExistingTokenHandle, + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, + PHANDLE DuplicateTokenHandle + ); + + +WINBOOL +STDCALL +GetKernelObjectSecurity ( + HANDLE Handle, + SECURITY_INFORMATION RequestedInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD nLength, + LPDWORD lpnLengthNeeded + ); + + +WINBOOL +STDCALL +ImpersonateNamedPipeClient( + HANDLE hNamedPipe + ); + + +WINBOOL +STDCALL +ImpersonateLoggedOnUser( + HANDLE hToken + ); + + +WINBOOL +STDCALL +ImpersonateSelf( + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel + ); + + + +WINBOOL +STDCALL +RevertToSelf ( + VOID + ); + + +WINBOOL +STDCALL +SetThreadToken ( + PHANDLE Thread, + HANDLE Token + ); + + +WINBOOL +STDCALL +AccessCheck ( + PSECURITY_DESCRIPTOR pSecurityDescriptor, + HANDLE ClientToken, + DWORD DesiredAccess, + PGENERIC_MAPPING GenericMapping, + PPRIVILEGE_SET PrivilegeSet, + LPDWORD PrivilegeSetLength, + LPDWORD GrantedAccess, + LPBOOL AccessStatus + ); + + + +WINBOOL +STDCALL +OpenProcessToken ( + HANDLE ProcessHandle, + DWORD DesiredAccess, + PHANDLE TokenHandle + ); + + + +WINBOOL +STDCALL +OpenThreadToken ( + HANDLE ThreadHandle, + DWORD DesiredAccess, + WINBOOL OpenAsSelf, + PHANDLE TokenHandle + ); + + + +WINBOOL +STDCALL +GetTokenInformation ( + HANDLE TokenHandle, + TOKEN_INFORMATION_CLASS TokenInformationClass, + LPVOID TokenInformation, + DWORD TokenInformationLength, + PDWORD ReturnLength + ); + + + +WINBOOL +STDCALL +SetTokenInformation ( + HANDLE TokenHandle, + TOKEN_INFORMATION_CLASS TokenInformationClass, + LPVOID TokenInformation, + DWORD TokenInformationLength + ); + + + +WINBOOL +STDCALL +AdjustTokenPrivileges ( + HANDLE TokenHandle, + WINBOOL DisableAllPrivileges, + PTOKEN_PRIVILEGES NewState, + DWORD BufferLength, + PTOKEN_PRIVILEGES PreviousState, + PDWORD ReturnLength + ); + + + +WINBOOL +STDCALL +AdjustTokenGroups ( + HANDLE TokenHandle, + WINBOOL ResetToDefault, + PTOKEN_GROUPS NewState, + DWORD BufferLength, + PTOKEN_GROUPS PreviousState, + PDWORD ReturnLength + ); + + + +WINBOOL +STDCALL +PrivilegeCheck ( + HANDLE ClientToken, + PPRIVILEGE_SET RequiredPrivileges, + LPBOOL pfResult + ); + + + +WINBOOL +STDCALL +IsValidSid ( + PSID pSid + ); + + + +WINBOOL +STDCALL +EqualSid ( + PSID pSid1, + PSID pSid2 + ); + + + +WINBOOL +STDCALL +EqualPrefixSid ( + PSID pSid1, + PSID pSid2 + ); + + + +DWORD +STDCALL +GetSidLengthRequired ( + UCHAR nSubAuthorityCount + ); + + + +WINBOOL +STDCALL +AllocateAndInitializeSid ( + PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, + BYTE nSubAuthorityCount, + DWORD nSubAuthority0, + DWORD nSubAuthority1, + DWORD nSubAuthority2, + DWORD nSubAuthority3, + DWORD nSubAuthority4, + DWORD nSubAuthority5, + DWORD nSubAuthority6, + DWORD nSubAuthority7, + PSID *pSid + ); + + +PVOID +STDCALL +FreeSid( + PSID pSid + ); + + +WINBOOL +STDCALL +InitializeSid ( + PSID Sid, + PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, + BYTE nSubAuthorityCount + ); + + + +PSID_IDENTIFIER_AUTHORITY +STDCALL +GetSidIdentifierAuthority ( + PSID pSid + ); + + + +PDWORD +STDCALL +GetSidSubAuthority ( + PSID pSid, + DWORD nSubAuthority + ); + + + +PUCHAR +STDCALL +GetSidSubAuthorityCount ( + PSID pSid + ); + + + +DWORD +STDCALL +GetLengthSid ( + PSID pSid + ); + + + +WINBOOL +STDCALL +CopySid ( + DWORD nDestinationSidLength, + PSID pDestinationSid, + PSID pSourceSid + ); + + + +WINBOOL +STDCALL +AreAllAccessesGranted ( + DWORD GrantedAccess, + DWORD DesiredAccess + ); + + + +WINBOOL +STDCALL +AreAnyAccessesGranted ( + DWORD GrantedAccess, + DWORD DesiredAccess + ); + + + +VOID +STDCALL +MapGenericMask ( + PDWORD AccessMask, + PGENERIC_MAPPING GenericMapping + ); + + + +WINBOOL +STDCALL +IsValidAcl ( + PACL pAcl + ); + + + +WINBOOL +STDCALL +InitializeAcl ( + PACL pAcl, + DWORD nAclLength, + DWORD dwAclRevision + ); + + + +WINBOOL +STDCALL +GetAclInformation ( + PACL pAcl, + LPVOID pAclInformation, + DWORD nAclInformationLength, + ACL_INFORMATION_CLASS dwAclInformationClass + ); + + + +WINBOOL +STDCALL +SetAclInformation ( + PACL pAcl, + LPVOID pAclInformation, + DWORD nAclInformationLength, + ACL_INFORMATION_CLASS dwAclInformationClass + ); + + + +WINBOOL +STDCALL +AddAce ( + PACL pAcl, + DWORD dwAceRevision, + DWORD dwStartingAceIndex, + LPVOID pAceList, + DWORD nAceListLength + ); + + + +WINBOOL +STDCALL +DeleteAce ( + PACL pAcl, + DWORD dwAceIndex + ); + + + +WINBOOL +STDCALL +GetAce ( + PACL pAcl, + DWORD dwAceIndex, + LPVOID *pAce + ); + + + +WINBOOL +STDCALL +AddAccessAllowedAce ( + PACL pAcl, + DWORD dwAceRevision, + DWORD AccessMask, + PSID pSid + ); + + + +WINBOOL +STDCALL +AddAccessDeniedAce ( + PACL pAcl, + DWORD dwAceRevision, + DWORD AccessMask, + PSID pSid + ); + + + +WINBOOL +STDCALL +AddAuditAccessAce( + PACL pAcl, + DWORD dwAceRevision, + DWORD dwAccessMask, + PSID pSid, + WINBOOL bAuditSuccess, + WINBOOL bAuditFailure + ); + + + +WINBOOL +STDCALL +FindFirstFreeAce ( + PACL pAcl, + LPVOID *pAce + ); + + + +WINBOOL +STDCALL +InitializeSecurityDescriptor ( + PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD dwRevision + ); + + + +WINBOOL +STDCALL +IsValidSecurityDescriptor ( + PSECURITY_DESCRIPTOR pSecurityDescriptor + ); + + + +DWORD +STDCALL +GetSecurityDescriptorLength ( + PSECURITY_DESCRIPTOR pSecurityDescriptor + ); + + + +WINBOOL +STDCALL +GetSecurityDescriptorControl ( + PSECURITY_DESCRIPTOR pSecurityDescriptor, + PSECURITY_DESCRIPTOR_CONTROL pControl, + LPDWORD lpdwRevision + ); + + + +WINBOOL +STDCALL +SetSecurityDescriptorDacl ( + PSECURITY_DESCRIPTOR pSecurityDescriptor, + WINBOOL bDaclPresent, + PACL pDacl, + WINBOOL bDaclDefaulted + ); + + + +WINBOOL +STDCALL +GetSecurityDescriptorDacl ( + PSECURITY_DESCRIPTOR pSecurityDescriptor, + LPBOOL lpbDaclPresent, + PACL *pDacl, + LPBOOL lpbDaclDefaulted + ); + + + +WINBOOL +STDCALL +SetSecurityDescriptorSacl ( + PSECURITY_DESCRIPTOR pSecurityDescriptor, + WINBOOL bSaclPresent, + PACL pSacl, + WINBOOL bSaclDefaulted + ); + + + +WINBOOL +STDCALL +GetSecurityDescriptorSacl ( + PSECURITY_DESCRIPTOR pSecurityDescriptor, + LPBOOL lpbSaclPresent, + PACL *pSacl, + LPBOOL lpbSaclDefaulted + ); + + + +WINBOOL +STDCALL +SetSecurityDescriptorOwner ( + PSECURITY_DESCRIPTOR pSecurityDescriptor, + PSID pOwner, + WINBOOL bOwnerDefaulted + ); + + + +WINBOOL +STDCALL +GetSecurityDescriptorOwner ( + PSECURITY_DESCRIPTOR pSecurityDescriptor, + PSID *pOwner, + LPBOOL lpbOwnerDefaulted + ); + + + +WINBOOL +STDCALL +SetSecurityDescriptorGroup ( + PSECURITY_DESCRIPTOR pSecurityDescriptor, + PSID pGroup, + WINBOOL bGroupDefaulted + ); + + + +WINBOOL +STDCALL +GetSecurityDescriptorGroup ( + PSECURITY_DESCRIPTOR pSecurityDescriptor, + PSID *pGroup, + LPBOOL lpbGroupDefaulted + ); + + + +WINBOOL +STDCALL +CreatePrivateObjectSecurity ( + PSECURITY_DESCRIPTOR ParentDescriptor, + PSECURITY_DESCRIPTOR CreatorDescriptor, + PSECURITY_DESCRIPTOR * NewDescriptor, + WINBOOL IsDirectoryObject, + HANDLE Token, + PGENERIC_MAPPING GenericMapping + ); + + + +WINBOOL +STDCALL +SetPrivateObjectSecurity ( + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR ModificationDescriptor, + PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, + PGENERIC_MAPPING GenericMapping, + HANDLE Token + ); + + + +WINBOOL +STDCALL +GetPrivateObjectSecurity ( + PSECURITY_DESCRIPTOR ObjectDescriptor, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR ResultantDescriptor, + DWORD DescriptorLength, + PDWORD ReturnLength + ); + + + +WINBOOL +STDCALL +DestroyPrivateObjectSecurity ( + PSECURITY_DESCRIPTOR * ObjectDescriptor + ); + + + +WINBOOL +STDCALL +MakeSelfRelativeSD ( + PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor, + PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor, + LPDWORD lpdwBufferLength + ); + + + +WINBOOL +STDCALL +MakeAbsoluteSD ( + PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor, + PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor, + LPDWORD lpdwAbsoluteSecurityDescriptorSize, + PACL pDacl, + LPDWORD lpdwDaclSize, + PACL pSacl, + LPDWORD lpdwSaclSize, + PSID pOwner, + LPDWORD lpdwOwnerSize, + PSID pPrimaryGroup, + LPDWORD lpdwPrimaryGroupSize + ); + + + +WINBOOL +STDCALL +SetKernelObjectSecurity ( + HANDLE Handle, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR SecurityDescriptor + ); + + +WINBOOL +STDCALL +FindNextChangeNotification( + HANDLE hChangeHandle + ); + + +WINBOOL +STDCALL +FindCloseChangeNotification( + HANDLE hChangeHandle + ); + + +WINBOOL +STDCALL +VirtualLock( + LPVOID lpAddress, + DWORD dwSize + ); + + +WINBOOL +STDCALL +VirtualUnlock( + LPVOID lpAddress, + DWORD dwSize + ); + + +LPVOID +STDCALL +MapViewOfFileEx( + HANDLE hFileMappingObject, + DWORD dwDesiredAccess, + DWORD dwFileOffsetHigh, + DWORD dwFileOffsetLow, + DWORD dwNumberOfBytesToMap, + LPVOID lpBaseAddress + ); + + +WINBOOL +STDCALL +SetPriorityClass( + HANDLE hProcess, + DWORD dwPriorityClass + ); + + +DWORD +STDCALL +GetPriorityClass( + HANDLE hProcess + ); + + +WINBOOL +STDCALL +IsBadReadPtr( + CONST VOID *lp, + UINT ucb + ); + + +WINBOOL +STDCALL +IsBadWritePtr( + LPVOID lp, + UINT ucb + ); + + +WINBOOL +STDCALL +IsBadHugeReadPtr( + CONST VOID *lp, + UINT ucb + ); + + +WINBOOL +STDCALL +IsBadHugeWritePtr( + LPVOID lp, + UINT ucb + ); + + +WINBOOL +STDCALL +IsBadCodePtr( + FARPROC lpfn + ); + +WINBOOL +STDCALL +AllocateLocallyUniqueId( + PLUID Luid + ); + + +WINBOOL +STDCALL +QueryPerformanceCounter( + LARGE_INTEGER *lpPerformanceCount + ); + + +WINBOOL +STDCALL +QueryPerformanceFrequency( + LARGE_INTEGER *lpFrequency + ); + +VOID +STDCALL +MoveMemory ( + PVOID Destination, + CONST VOID *Source, + DWORD Length + ); + +VOID +STDCALL +FillMemory ( + PVOID Destination, + DWORD Length, + BYTE Fill + ); + +VOID +STDCALL +ZeroMemory ( + PVOID Destination, + DWORD Length + ); + +/* The memory functions don't seem to be defined in the libraries, so + define macro versions as well. */ +#define MoveMemory(t, s, c) memmove ((t), (s), (c)) +#define FillMemory(p, c, v) memset ((p), (v), (c)) +#define ZeroMemory(p, c) memset ((p), 0, (c)) + +#ifdef WINNT351 +WINBOOL +STDCALL +ActivateKeyboardLayout( + HKL hkl, + UINT Flags); +#else +HKL +STDCALL +ActivateKeyboardLayout( + HKL hkl, + UINT Flags); +#endif /* WIN95 */ + + +int +STDCALL +ToUnicodeEx( + UINT wVirtKey, + UINT wScanCode, + PBYTE lpKeyState, + LPWSTR pwszBuff, + int cchBuff, + UINT wFlags, + HKL dwhkl); + + +WINBOOL +STDCALL +UnloadKeyboardLayout( + HKL hkl); + + +UINT +STDCALL +GetKeyboardLayoutList( + int nBuff, + HKL *lpList); + + +HKL +STDCALL +GetKeyboardLayout( + DWORD dwLayout + ); + + +HDESK +STDCALL +OpenInputDesktop( + DWORD dwFlags, + WINBOOL fInherit, + DWORD dwDesiredAccess); + +WINBOOL +STDCALL +EnumDesktopWindows( + HDESK hDesktop, + ENUMWINDOWSPROC lpfn, + LPARAM lParam); + + +WINBOOL +STDCALL +SwitchDesktop( + HDESK hDesktop); + + +WINBOOL +STDCALL +SetThreadDesktop( + HDESK hDesktop); + + +WINBOOL +STDCALL +CloseDesktop( + HDESK hDesktop); + + +HDESK +STDCALL +GetThreadDesktop( + DWORD dwThreadId); + + +WINBOOL +STDCALL +CloseWindowStation( + HWINSTA hWinSta); + + +WINBOOL +STDCALL +SetProcessWindowStation( + HWINSTA hWinSta); + + +HWINSTA +STDCALL +GetProcessWindowStation( + VOID); + + +WINBOOL +STDCALL +SetUserObjectSecurity( + HANDLE hObj, + PSECURITY_INFORMATION pSIRequested, + PSECURITY_DESCRIPTOR pSID); + + +WINBOOL +STDCALL +GetUserObjectSecurity( + HANDLE hObj, + PSECURITY_INFORMATION pSIRequested, + PSECURITY_DESCRIPTOR pSID, + DWORD nLength, + LPDWORD lpnLengthNeeded); + + +WINBOOL +STDCALL +TranslateMessage( + CONST MSG *lpMsg); + +WINBOOL +STDCALL +SetMessageQueue( + int cMessagesMax); + +WINBOOL +STDCALL +RegisterHotKey( + HWND hWnd , + int anID, + UINT fsModifiers, + UINT vk); + + +WINBOOL +STDCALL +UnregisterHotKey( + HWND hWnd, + int anID); + + +WINBOOL +STDCALL +ExitWindowsEx( + UINT uFlags, + DWORD dwReserved); + + +WINBOOL +STDCALL +SwapMouseButton( + WINBOOL fSwap); + + +DWORD +STDCALL +GetMessagePos( + VOID); + + +LONG +STDCALL +GetMessageTime( + VOID); + + +LPARAM +STDCALL +GetMessageExtraInfo( + VOID); + + +LPARAM +STDCALL +SetMessageExtraInfo( + LPARAM lParam); + + +long +STDCALL +BroadcastSystemMessage( + DWORD, + LPDWORD, + UINT, + WPARAM, + LPARAM); + +WINBOOL +STDCALL +AttachThreadInput( + DWORD idAttach, + DWORD idAttachTo, + WINBOOL fAttach); + + +WINBOOL +STDCALL +ReplyMessage( + LRESULT lResult); + + +WINBOOL +STDCALL +WaitMessage( + VOID); + + +DWORD +STDCALL +WaitForInputIdle( + HANDLE hProcess, + DWORD dwMilliseconds); + + +VOID +STDCALL +PostQuitMessage( + int nExitCode); + +WINBOOL +STDCALL +InSendMessage( + VOID); + + +UINT +STDCALL +GetDoubleClickTime( + VOID); + + +WINBOOL +STDCALL +SetDoubleClickTime( + UINT); + + +WINBOOL +STDCALL +IsWindow( + HWND hWnd); + + +WINBOOL +STDCALL +IsMenu( + HMENU hMenu); + + +WINBOOL +STDCALL +IsChild( + HWND hWndParent, + HWND hWnd); + + +WINBOOL +STDCALL +DestroyWindow( + HWND hWnd); + + +WINBOOL +STDCALL +ShowWindow( + HWND hWnd, + int nCmdShow); + + +WINBOOL +STDCALL +ShowWindowAsync( + HWND hWnd, + int nCmdShow); + + +WINBOOL +STDCALL +FlashWindow( + HWND hWnd, + WINBOOL bInvert); + + +WINBOOL +STDCALL +ShowOwnedPopups( + HWND hWnd, + WINBOOL fShow); + + +WINBOOL +STDCALL +OpenIcon( + HWND hWnd); + + +WINBOOL +STDCALL +CloseWindow( + HWND hWnd); + + +WINBOOL +STDCALL +MoveWindow( + HWND hWnd, + int X, + int Y, + int nWidth, + int nHeight, + WINBOOL bRepaint); + + +WINBOOL +STDCALL +SetWindowPos( + HWND hWnd, + HWND hWndInsertAfter , + int X, + int Y, + int cx, + int cy, + UINT uFlags); + + +WINBOOL +STDCALL +GetWindowPlacement( + HWND hWnd, + WINDOWPLACEMENT *lpwndpl); + + +WINBOOL +STDCALL +SetWindowPlacement( + HWND hWnd, + CONST WINDOWPLACEMENT *lpwndpl); + + +HDWP +STDCALL +BeginDeferWindowPos( + int nNumWindows); + + +HDWP +STDCALL +DeferWindowPos( + HDWP hWinPosInfo, + HWND hWnd, + HWND hWndInsertAfter, + int x, + int y, + int cx, + int cy, + UINT uFlags); + + +WINBOOL +STDCALL +EndDeferWindowPos( + HDWP hWinPosInfo); + + +WINBOOL +STDCALL +IsWindowVisible( + HWND hWnd); + + +WINBOOL +STDCALL +IsIconic( + HWND hWnd); + + +WINBOOL +STDCALL +AnyPopup( + VOID); + + +WINBOOL +STDCALL +BringWindowToTop( + HWND hWnd); + + +WINBOOL +STDCALL +IsZoomed( + HWND hWnd); + + +WINBOOL +STDCALL +EndDialog( + HWND hDlg, + int nResult); + + +HWND +STDCALL +GetDlgItem( + HWND hDlg, + int nIDDlgItem); + + +WINBOOL +STDCALL +SetDlgItemInt( + HWND hDlg, + int nIDDlgItem, + UINT uValue, + WINBOOL bSigned); + + +UINT +STDCALL +GetDlgItemInt( + HWND hDlg, + int nIDDlgItem, + WINBOOL *lpTranslated, + WINBOOL bSigned); + + +WINBOOL +STDCALL +CheckDlgButton( + HWND hDlg, + int nIDButton, + UINT uCheck); + + +WINBOOL +STDCALL +CheckRadioButton( + HWND hDlg, + int nIDFirstButton, + int nIDLastButton, + int nIDCheckButton); + + +UINT +STDCALL +IsDlgButtonChecked( + HWND hDlg, + int nIDButton); + + +HWND +STDCALL +GetNextDlgGroupItem( + HWND hDlg, + HWND hCtl, + WINBOOL bPrevious); + + +HWND +STDCALL +GetNextDlgTabItem( + HWND hDlg, + HWND hCtl, + WINBOOL bPrevious); + + +int +STDCALL +GetDlgCtrlID( + HWND hWnd); + + +LONG +STDCALL +GetDialogBaseUnits(VOID); + +WINBOOL +STDCALL +OpenClipboard( + HWND hWndNewOwner); + + +WINBOOL +STDCALL +CloseClipboard( + VOID); + + +HWND +STDCALL +GetClipboardOwner( + VOID); + + +HWND +STDCALL +SetClipboardViewer( + HWND hWndNewViewer); + + +HWND +STDCALL +GetClipboardViewer( + VOID); + + +WINBOOL +STDCALL +ChangeClipboardChain( + HWND hWndRemove, + HWND hWndNewNext); + + +HANDLE +STDCALL +SetClipboardData( + UINT uFormat, + HANDLE hMem); + + +HANDLE +STDCALL +GetClipboardData( + UINT uFormat); + + + +int +STDCALL +CountClipboardFormats( + VOID); + + +UINT +STDCALL +EnumClipboardFormats( + UINT format); + + +WINBOOL +STDCALL +EmptyClipboard( + VOID); + + +WINBOOL +STDCALL +IsClipboardFormatAvailable( + UINT format); + + +int +STDCALL +GetPriorityClipboardFormat( + UINT *paFormatPriorityList, + int cFormats); + + +HWND +STDCALL +GetOpenClipboardWindow( + VOID); + + +/* Despite the A these are ASCII functions! */ +LPSTR +STDCALL +CharNextExA( + WORD CodePage, + LPCSTR lpCurrentChar, + DWORD dwFlags); + + +LPSTR +STDCALL +CharPrevExA( + WORD CodePage, + LPCSTR lpStart, + LPCSTR lpCurrentChar, + DWORD dwFlags); + + +HWND +STDCALL +SetFocus( + HWND hWnd); + + +HWND +STDCALL +GetActiveWindow( + VOID); + + +HWND +STDCALL +GetFocus( + VOID); + + +UINT +STDCALL +GetKBCodePage( + VOID); + + +SHORT +STDCALL +GetKeyState( + int nVirtKey); + + +SHORT +STDCALL +GetAsyncKeyState( + int vKey); + + +WINBOOL +STDCALL +GetKeyboardState( + PBYTE lpKeyState); + + +WINBOOL +STDCALL +SetKeyboardState( + LPBYTE lpKeyState); + + +int +STDCALL +GetKeyboardType( + int nTypeFlag); + + +int +STDCALL +ToAscii( + UINT uVirtKey, + UINT uScanCode, + PBYTE lpKeyState, + LPWORD lpChar, + UINT uFlags); + + +int +STDCALL +ToAsciiEx( + UINT uVirtKey, + UINT uScanCode, + PBYTE lpKeyState, + LPWORD lpChar, + UINT uFlags, + HKL dwhkl); + + +int +STDCALL +ToUnicode( + UINT wVirtKey, + UINT wScanCode, + PBYTE lpKeyState, + LPWSTR pwszBuff, + int cchBuff, + UINT wFlags); + + +DWORD +STDCALL +OemKeyScan( + WORD wOemChar); + + +VOID +STDCALL +keybd_event( + BYTE bVk, + BYTE bScan, + DWORD dwFlags, + DWORD dwExtraInfo); + + +VOID +STDCALL +mouse_event( + DWORD dwFlags, + DWORD dx, + DWORD dy, + DWORD cButtons, + DWORD dwExtraInfo); + +WINBOOL +STDCALL +GetInputState( + VOID); + + +DWORD +STDCALL +GetQueueStatus( + UINT flags); + + +HWND +STDCALL +GetCapture( + VOID); + + +HWND +STDCALL +SetCapture( + HWND hWnd); + + +WINBOOL +STDCALL +ReleaseCapture( + VOID); + + +DWORD +STDCALL +MsgWaitForMultipleObjects( + DWORD nCount, + LPHANDLE pHandles, + WINBOOL fWaitAll, + DWORD dwMilliseconds, + DWORD dwWakeMask); + + +UINT +STDCALL +SetTimer( + HWND hWnd , + UINT nIDEvent, + UINT uElapse, + TIMERPROC lpTimerFunc); + + +WINBOOL +STDCALL +SetWaitableTimer(HANDLE hTimer, + const LARGE_INTEGER *pDueTime, + LONG lPeriod, + PTIMERAPCROUTINE pfnCompletionRoutine, + LPVOID lpArgToCompletionRoutine, + WINBOOL fResume); + + +WINBOOL +STDCALL +KillTimer( + HWND hWnd, + UINT uIDEvent); + + +WINBOOL +STDCALL +IsWindowUnicode( + HWND hWnd); + + +WINBOOL +STDCALL +EnableWindow( + HWND hWnd, + WINBOOL bEnable); + + +WINBOOL +STDCALL +IsWindowEnabled( + HWND hWnd); + + +WINBOOL +STDCALL +DestroyAcceleratorTable( + HACCEL hAccel); + +int +STDCALL +GetSystemMetrics( + int nIndex); + +HMENU +STDCALL +GetMenu( + HWND hWnd); + + +WINBOOL +STDCALL +SetMenu( + HWND hWnd, + HMENU hMenu); + + +WINBOOL +STDCALL +HiliteMenuItem( + HWND hWnd, + HMENU hMenu, + UINT uIDHiliteItem, + UINT uHilite); + + +UINT +STDCALL +GetMenuState( + HMENU hMenu, + UINT uId, + UINT uFlags); + + +WINBOOL +STDCALL +DrawMenuBar( + HWND hWnd); + + +HMENU +STDCALL +GetSystemMenu( + HWND hWnd, + WINBOOL bRevert); + + +HMENU +STDCALL +CreateMenu( + VOID); + + +HMENU +STDCALL +CreatePopupMenu( + VOID); + + +WINBOOL +STDCALL +DestroyMenu( + HMENU hMenu); + + +DWORD +STDCALL +CheckMenuItem( + HMENU hMenu, + UINT uIDCheckItem, + UINT uCheck); + + +WINBOOL +STDCALL +EnableMenuItem( + HMENU hMenu, + UINT uIDEnableItem, + UINT uEnable); + + +HMENU +STDCALL +GetSubMenu( + HMENU hMenu, + int nPos); + + +UINT +STDCALL +GetMenuItemID( + HMENU hMenu, + int nPos); + + +int +STDCALL +GetMenuItemCount( + HMENU hMenu); + +WINBOOL +STDCALL RemoveMenu( + HMENU hMenu, + UINT uPosition, + UINT uFlags); + + +WINBOOL +STDCALL +DeleteMenu( + HMENU hMenu, + UINT uPosition, + UINT uFlags); + + +WINBOOL +STDCALL +SetMenuItemBitmaps( + HMENU hMenu, + UINT uPosition, + UINT uFlags, + HBITMAP hBitmapUnchecked, + HBITMAP hBitmapChecked); + + +LONG +STDCALL +GetMenuCheckMarkDimensions( + VOID); + + +WINBOOL +STDCALL +TrackPopupMenu( + HMENU hMenu, + UINT uFlags, + int x, + int y, + int nReserved, + HWND hWnd, + CONST RECT *prcRect); + +UINT +STDCALL +GetMenuDefaultItem( + HMENU hMenu, + UINT fByPos, + UINT gmdiFlags); + +WINBOOL +STDCALL +SetMenuDefaultItem( + HMENU hMenu, + UINT uItem, + UINT fByPos); + +WINBOOL +STDCALL +GetMenuItemRect(HWND hWnd, + HMENU hMenu, + UINT uItem, + LPRECT lprcItem); + +int +STDCALL +MenuItemFromPoint(HWND hWnd, + HMENU hMenu, + POINT ptScreen); + + +DWORD +STDCALL +DragObject(HWND, HWND, UINT, DWORD, HCURSOR); + + +WINBOOL +STDCALL +DragDetect(HWND hwnd, + POINT pt); + + +WINBOOL +STDCALL +DrawIcon( + HDC hDC, + int X, + int Y, + HICON hIcon); + +WINBOOL +STDCALL +UpdateWindow( + HWND hWnd); + + +HWND +STDCALL +SetActiveWindow( + HWND hWnd); + + +HWND +STDCALL +GetForegroundWindow( + VOID); + +WINBOOL +STDCALL +PaintDesktop(HDC hdc); + + +WINBOOL +STDCALL +SetForegroundWindow( + HWND hWnd); + + +HWND +STDCALL +WindowFromDC( + HDC hDC); + + +HDC +STDCALL +GetDC( + HWND hWnd); + + +HDC +STDCALL +GetDCEx( + HWND hWnd , + HRGN hrgnClip, + DWORD flags); + + +HDC +STDCALL +GetWindowDC( + HWND hWnd); + + +int +STDCALL +ReleaseDC( + HWND hWnd, + HDC hDC); + + +HDC +STDCALL +BeginPaint( + HWND hWnd, + LPPAINTSTRUCT lpPaint); + + +WINBOOL +STDCALL +EndPaint( + HWND hWnd, + CONST PAINTSTRUCT *lpPaint); + + +WINBOOL +STDCALL +GetUpdateRect( + HWND hWnd, + LPRECT lpRect, + WINBOOL bErase); + + +int +STDCALL +GetUpdateRgn( + HWND hWnd, + HRGN hRgn, + WINBOOL bErase); + + +int +STDCALL +SetWindowRgn( + HWND hWnd, + HRGN hRgn, + WINBOOL bRedraw); + + +int +STDCALL +GetWindowRgn( + HWND hWnd, + HRGN hRgn); + + +int +STDCALL +ExcludeUpdateRgn( + HDC hDC, + HWND hWnd); + + +WINBOOL +STDCALL +InvalidateRect( + HWND hWnd , + CONST RECT *lpRect, + WINBOOL bErase); + + +WINBOOL +STDCALL +ValidateRect( + HWND hWnd , + CONST RECT *lpRect); + + +WINBOOL +STDCALL +InvalidateRgn( + HWND hWnd, + HRGN hRgn, + WINBOOL bErase); + + +WINBOOL +STDCALL +ValidateRgn( + HWND hWnd, + HRGN hRgn); + + +WINBOOL +STDCALL +RedrawWindow( + HWND hWnd, + CONST RECT *lprcUpdate, + HRGN hrgnUpdate, + UINT flags); + + +WINBOOL +STDCALL +LockWindowUpdate( + HWND hWndLock); + + +WINBOOL +STDCALL +ScrollWindow( + HWND hWnd, + int XAmount, + int YAmount, + CONST RECT *lpRect, + CONST RECT *lpClipRect); + + +WINBOOL +STDCALL +ScrollDC( + HDC hDC, + int dx, + int dy, + CONST RECT *lprcScroll, + CONST RECT *lprcClip , + HRGN hrgnUpdate, + LPRECT lprcUpdate); + + +int +STDCALL +ScrollWindowEx( + HWND hWnd, + int dx, + int dy, + CONST RECT *prcScroll, + CONST RECT *prcClip , + HRGN hrgnUpdate, + LPRECT prcUpdate, + UINT flags); + + +int +STDCALL +SetScrollPos( + HWND hWnd, + int nBar, + int nPos, + WINBOOL bRedraw); + + +int +STDCALL +GetScrollPos( + HWND hWnd, + int nBar); + + +WINBOOL +STDCALL +SetScrollRange( + HWND hWnd, + int nBar, + int nMinPos, + int nMaxPos, + WINBOOL bRedraw); + + +WINBOOL +STDCALL +GetScrollRange( + HWND hWnd, + int nBar, + LPINT lpMinPos, + LPINT lpMaxPos); + + +WINBOOL +STDCALL +ShowScrollBar( + HWND hWnd, + int wBar, + WINBOOL bShow); + + +WINBOOL +STDCALL +EnableScrollBar( + HWND hWnd, + UINT wSBflags, + UINT wArrows); + + +WINBOOL +STDCALL +GetClientRect( + HWND hWnd, + LPRECT lpRect); + + +WINBOOL +STDCALL +GetWindowRect( + HWND hWnd, + LPRECT lpRect); + + +WINBOOL +STDCALL +AdjustWindowRect( + LPRECT lpRect, + DWORD dwStyle, + WINBOOL bMenu); + + +WINBOOL +STDCALL +AdjustWindowRectEx( + LPRECT lpRect, + DWORD dwStyle, + WINBOOL bMenu, + DWORD dwExStyle); + +WINBOOL +STDCALL +SetWindowContextHelpId(HWND, DWORD); + +DWORD +STDCALL +GetWindowContextHelpId(HWND); + +WINBOOL +STDCALL +SetMenuContextHelpId(HMENU, DWORD); + +DWORD +STDCALL +GetMenuContextHelpId(HMENU); + + +WINBOOL +STDCALL +MessageBeep( + UINT uType); + + +int +STDCALL +ShowCursor( + WINBOOL bShow); + + +WINBOOL +STDCALL +SetCursorPos( + int X, + int Y); + + +HCURSOR +STDCALL +SetCursor( + HCURSOR hCursor); + + +WINBOOL +STDCALL +GetCursorPos( + LPPOINT lpPoint); + + +WINBOOL +STDCALL +ClipCursor( + CONST RECT *lpRect); + + +WINBOOL +STDCALL +GetClipCursor( + LPRECT lpRect); + + +HCURSOR +STDCALL +GetCursor( + VOID); + + +WINBOOL +STDCALL +CreateCaret( + HWND hWnd, + HBITMAP hBitmap , + int nWidth, + int nHeight); + + +UINT +STDCALL +GetCaretBlinkTime( + VOID); + + +WINBOOL +STDCALL +SetCaretBlinkTime( + UINT uMSeconds); + + +WINBOOL +STDCALL +DestroyCaret( + VOID); + + +WINBOOL +STDCALL +HideCaret( + HWND hWnd); + + +WINBOOL +STDCALL +ShowCaret( + HWND hWnd); + + +WINBOOL +STDCALL +SetCaretPos( + int X, + int Y); + + +WINBOOL +STDCALL +GetCaretPos( + LPPOINT lpPoint); + + +WINBOOL +STDCALL +ClientToScreen( + HWND hWnd, + LPPOINT lpPoint); + + +WINBOOL +STDCALL +ScreenToClient( + HWND hWnd, + LPPOINT lpPoint); + + +int +STDCALL +MapWindowPoints( + HWND hWndFrom, + HWND hWndTo, + LPPOINT lpPoints, + UINT cPoints); + + +HWND +STDCALL +WindowFromPoint( + POINT Point); + + +HWND +STDCALL +ChildWindowFromPoint( + HWND hWndParent, + POINT Point); + + +DWORD +STDCALL +GetSysColor( + int nIndex); + + +HBRUSH +STDCALL +GetSysColorBrush( + int nIndex); + + +WINBOOL +STDCALL +SetSysColors( + int cElements, + CONST INT * lpaElements, + CONST COLORREF * lpaRgbValues); + + +WINBOOL +STDCALL +DrawFocusRect( + HDC hDC, + CONST RECT * lprc); + + +int +STDCALL +FillRect( + HDC hDC, + CONST RECT *lprc, + HBRUSH hbr); + + +int +STDCALL +FrameRect( + HDC hDC, + CONST RECT *lprc, + HBRUSH hbr); + + +WINBOOL +STDCALL +InvertRect( + HDC hDC, + CONST RECT *lprc); + + +WINBOOL +STDCALL +SetRect( + LPRECT lprc, + int xLeft, + int yTop, + int xRight, + int yBottom); + + +WINBOOL +STDCALL +SetRectEmpty( + LPRECT lprc); + + +WINBOOL +STDCALL +CopyRect( + LPRECT lprcDst, + CONST RECT *lprcSrc); + + +WINBOOL +STDCALL +InflateRect( + LPRECT lprc, + int dx, + int dy); + + +WINBOOL +STDCALL +IntersectRect( + LPRECT lprcDst, + CONST RECT *lprcSrc1, + CONST RECT *lprcSrc2); + + +WINBOOL +STDCALL +UnionRect( + LPRECT lprcDst, + CONST RECT *lprcSrc1, + CONST RECT *lprcSrc2); + + +WINBOOL +STDCALL +SubtractRect( + LPRECT lprcDst, + CONST RECT *lprcSrc1, + CONST RECT *lprcSrc2); + + +WINBOOL +STDCALL +OffsetRect( + LPRECT lprc, + int dx, + int dy); + + +WINBOOL +STDCALL +IsRectEmpty( + CONST RECT *lprc); + + +WINBOOL +STDCALL +EqualRect( + CONST RECT *lprc1, + CONST RECT *lprc2); + + +WINBOOL +STDCALL +PtInRect( + CONST RECT *lprc, + POINT pt); + + +WORD +STDCALL +GetWindowWord( + HWND hWnd, + int nIndex); + + +WORD +STDCALL +SetWindowWord( + HWND hWnd, + int nIndex, + WORD wNewWord); + + +WORD +STDCALL +GetClassWord( + HWND hWnd, + int nIndex); + + +WORD +STDCALL +SetClassWord( + HWND hWnd, + int nIndex, + WORD wNewWord); + +HWND +STDCALL +GetDesktopWindow( + VOID); + + +HWND +STDCALL +GetParent( + HWND hWnd); + + +HWND +STDCALL +SetParent( + HWND hWndChild, + HWND hWndNewParent); + + +WINBOOL +STDCALL +EnumChildWindows( + HWND hWndParent, + ENUMWINDOWSPROC lpEnumFunc, + LPARAM lParam); + + +WINBOOL +STDCALL +EnumWindows( + ENUMWINDOWSPROC lpEnumFunc, + LPARAM lParam); + + +WINBOOL +STDCALL +EnumThreadWindows( + DWORD dwThreadId, + ENUMWINDOWSPROC lpfn, + LPARAM lParam); + +HWND +STDCALL +GetTopWindow( + HWND hWnd); + + +DWORD +STDCALL +GetWindowThreadProcessId( + HWND hWnd, + LPDWORD lpdwProcessId); + + +HWND +STDCALL +GetLastActivePopup( + HWND hWnd); + + +HWND +STDCALL +GetWindow( + HWND hWnd, + UINT uCmd); + +WINBOOL +STDCALL +UnhookWindowsHook( + int nCode, + HOOKPROC pfnFilterProc); + +WINBOOL +STDCALL +UnhookWindowsHookEx( + HHOOK hhk); + + +LRESULT +STDCALL +CallNextHookEx( + HHOOK hhk, + int nCode, + WPARAM wParam, + LPARAM lParam); + + +WINBOOL +STDCALL +CheckMenuRadioItem(HMENU, UINT, UINT, UINT, UINT); + +HCURSOR +STDCALL +CreateCursor( + HINSTANCE hInst, + int xHotSpot, + int yHotSpot, + int nWidth, + int nHeight, + CONST VOID *pvANDPlane, + CONST VOID *pvXORPlane); + + +WINBOOL +STDCALL +DestroyCursor( + HCURSOR hCursor); + + +WINBOOL +STDCALL +SetSystemCursor( + HCURSOR hcur, + DWORD anID); + + +HICON +STDCALL +CreateIcon( + HINSTANCE hInstance, + int nWidth, + int nHeight, + BYTE cPlanes, + BYTE cBitsPixel, + CONST BYTE *lpbANDbits, + CONST BYTE *lpbXORbits); + + +WINBOOL +STDCALL +DestroyIcon( + HICON hIcon); + + +int +STDCALL +LookupIconIdFromDirectory( + PBYTE presbits, + WINBOOL fIcon); + + +int +STDCALL +LookupIconIdFromDirectoryEx( + PBYTE presbits, + WINBOOL fIcon, + int cxDesired, + int cyDesired, + UINT Flags); + + +HICON +STDCALL +CreateIconFromResource( + PBYTE presbits, + DWORD dwResSize, + WINBOOL fIcon, + DWORD dwVer); + + +HICON +STDCALL +CreateIconFromResourceEx( + PBYTE presbits, + DWORD dwResSize, + WINBOOL fIcon, + DWORD dwVer, + int cxDesired, + int cyDesired, + UINT Flags); + + +HICON +STDCALL +CopyImage( + HANDLE, + UINT, + int, + int, + UINT); + + +HICON +STDCALL +CreateIconIndirect( + PICONINFO piconinfo); + + +HICON +STDCALL +CopyIcon( + HICON hIcon); + + +WINBOOL +STDCALL +GetIconInfo( + HICON hIcon, + PICONINFO piconinfo); + + +WINBOOL +STDCALL +MapDialogRect( + HWND hDlg, + LPRECT lpRect); + +int +STDCALL +SetScrollInfo(HWND, int, LPCSCROLLINFO, WINBOOL); + +WINBOOL +STDCALL +GetScrollInfo(HWND, int, LPSCROLLINFO); + +WINBOOL +STDCALL +TranslateMDISysAccel( + HWND hWndClient, + LPMSG lpMsg); + + +UINT +STDCALL +ArrangeIconicWindows( + HWND hWnd); + +WORD +STDCALL +TileWindows(HWND hwndParent, UINT wHow, CONST RECT * lpRect, UINT cKids, const HWND *lpKids); + +WORD +STDCALL +CascadeWindows(HWND hwndParent, UINT wHow, CONST RECT * lpRect, UINT cKids, const HWND *lpKids); + + +VOID +STDCALL +SetLastErrorEx( + DWORD dwErrCode, + DWORD dwType + ); + + +VOID +STDCALL +SetDebugErrorLevel( + DWORD dwLevel + ); + +WINBOOL +STDCALL +DrawEdge(HDC hdc, LPRECT qrc, UINT edge, UINT grfFlags); + +WINBOOL STDCALL +DrawFrameControl(HDC, LPRECT, UINT, UINT); + +WINBOOL +STDCALL +DrawCaption( + HWND hwnd, + HDC hdc, + LPRECT lprc, + UINT uFlags); + +WINBOOL +STDCALL +DrawAnimatedRects(HWND hwnd, int idAni, CONST RECT * lprcFrom, CONST RECT * lprcTo); + +WINBOOL +STDCALL +TrackPopupMenuEx(HMENU, UINT, int, int, HWND, LPTPMPARAMS); + +HWND +STDCALL +ChildWindowFromPointEx(HWND, POINT, UINT); + +WINBOOL +STDCALL +DrawIconEx(HDC hdc, int xLeft, int yTop, + HICON hIcon, int cxWidth, int cyWidth, + UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags); + +WINBOOL +STDCALL +AnimatePalette(HPALETTE, UINT, UINT, CONST PALETTEENTRY *); + +WINBOOL +STDCALL +Arc(HDC, int, int, int, int, int, int, int, int); + +WINBOOL +STDCALL +BitBlt(HDC, int, int, int, int, HDC, int, int, DWORD); + +WINBOOL +STDCALL +CancelDC(HDC); + +WINBOOL +STDCALL +Chord(HDC, int, int, int, int, int, int, int, int); + +HMETAFILE +STDCALL +CloseMetaFile(HDC); + +int +STDCALL +CombineRgn(HRGN, HRGN, HRGN, int); + +HBITMAP +STDCALL +CreateBitmap(int, int, UINT, UINT, CONST VOID *); + +HBITMAP +STDCALL +CreateBitmapIndirect(CONST BITMAP *); + +HBRUSH +STDCALL +CreateBrushIndirect(CONST LOGBRUSH *); + +HBITMAP +STDCALL +CreateCompatibleBitmap(HDC, int, int); + +HBITMAP +STDCALL +CreateDiscardableBitmap(HDC, int, int); + +HDC +STDCALL +CreateCompatibleDC(HDC); + +HBITMAP +STDCALL +CreateDIBitmap(HDC, CONST BITMAPINFOHEADER *, DWORD, CONST VOID *, CONST BITMAPINFO *, UINT); + +HBRUSH +STDCALL +CreateDIBPatternBrush(HGLOBAL, UINT); + +HBRUSH +STDCALL +CreateDIBPatternBrushPt(CONST VOID *, UINT); + +HRGN +STDCALL +CreateEllipticRgn(int, int, int, int); + +HRGN +STDCALL +CreateEllipticRgnIndirect(CONST RECT *); + +HBRUSH +STDCALL +CreateHatchBrush(int, COLORREF); + +HPALETTE +STDCALL +CreatePalette(CONST LOGPALETTE *); + +HPEN +STDCALL +CreatePen(int, int, COLORREF); + +HPEN +STDCALL +CreatePenIndirect(CONST LOGPEN *); + +HRGN +STDCALL +CreatePolyPolygonRgn(CONST POINT *, CONST INT *, int, int); + +HBRUSH +STDCALL +CreatePatternBrush(HBITMAP); + +HRGN +STDCALL +CreateRectRgn(int, int, int, int); + +HRGN +STDCALL +CreateRectRgnIndirect(CONST RECT *); + +HRGN +STDCALL +CreateRoundRectRgn(int, int, int, int, int, int); + +HBRUSH +STDCALL +CreateSolidBrush(COLORREF); + +WINBOOL +STDCALL +DeleteDC(HDC); + +WINBOOL +STDCALL +DeleteMetaFile(HMETAFILE); + +WINBOOL +STDCALL +DeleteObject(HGDIOBJ); + +int +STDCALL +DrawEscape(HDC, int, int, LPCSTR); + +WINBOOL +STDCALL +Ellipse(HDC, int, int, int, int); + +int +STDCALL +EnumObjects(HDC, int, ENUMOBJECTSPROC, LPARAM); + +WINBOOL +STDCALL +EqualRgn(HRGN, HRGN); + +int +STDCALL +Escape(HDC, int, int, LPCSTR, LPVOID); + +int +STDCALL +ExtEscape(HDC, int, int, LPCSTR, int, LPSTR); + +int +STDCALL +ExcludeClipRect(HDC, int, int, int, int); + +HRGN +STDCALL +ExtCreateRegion(CONST XFORM *, DWORD, CONST RGNDATA *); + +WINBOOL +STDCALL +ExtFloodFill(HDC, int, int, COLORREF, UINT); + +WINBOOL +STDCALL +FillRgn(HDC, HRGN, HBRUSH); + +WINBOOL +STDCALL +FloodFill(HDC, int, int, COLORREF); + +WINBOOL +STDCALL +FrameRgn(HDC, HRGN, HBRUSH, int, int); + +WINBOOL +STDCALL +GdiDllInitialize (HANDLE, DWORD, LPVOID); + +VOID +STDCALL +GdiProcessSetup (VOID); + +int +STDCALL +GetROP2(HDC); + +WINBOOL +STDCALL +GetAspectRatioFilterEx(HDC, LPSIZE); + +COLORREF +STDCALL +GetBkColor(HDC); + +int +STDCALL +GetBkMode(HDC); + +LONG +STDCALL +GetBitmapBits(HBITMAP, LONG, LPVOID); + +WINBOOL +STDCALL +GetBitmapDimensionEx(HBITMAP, LPSIZE); + +UINT +STDCALL +GetBoundsRect(HDC, LPRECT, UINT); + +WINBOOL +STDCALL +GetBrushOrgEx(HDC, LPPOINT); + +int +STDCALL +GetClipBox(HDC, LPRECT); + +int +STDCALL +GetClipRgn(HDC, HRGN); + +int +STDCALL +GetMetaRgn(HDC, HRGN); + +HGDIOBJ +STDCALL +GetCurrentObject(HDC, UINT); + +WINBOOL +STDCALL +GetCurrentPositionEx(HDC, LPPOINT); + +int +STDCALL +GetDeviceCaps(HDC, int); + +int +STDCALL +GetDIBits(HDC, HBITMAP, UINT, UINT, LPVOID, LPBITMAPINFO, UINT); + +DWORD +STDCALL +GetFontData(HDC, DWORD, DWORD, LPVOID, DWORD); + +int +STDCALL +GetGraphicsMode(HDC); + +int +STDCALL +GetMapMode(HDC); + +UINT +STDCALL +GetMetaFileBitsEx(HMETAFILE, UINT, LPVOID); + +COLORREF +STDCALL +GetNearestColor(HDC, COLORREF); + +UINT +STDCALL +GetNearestPaletteIndex(HPALETTE, COLORREF); + +DWORD +STDCALL +GetObjectType(HGDIOBJ h); + +UINT +STDCALL +GetPaletteEntries(HPALETTE, UINT, UINT, LPPALETTEENTRY); + +COLORREF +STDCALL +GetPixel(HDC, int, int); + +int +STDCALL +GetPixelFormat(HDC); + +int +STDCALL +GetPolyFillMode(HDC); + +WINBOOL +STDCALL +GetRasterizerCaps(LPRASTERIZER_STATUS, UINT); + +DWORD +STDCALL +GetRegionData(HRGN, DWORD, LPRGNDATA); + +int +STDCALL +GetRgnBox(HRGN, LPRECT); + +HGDIOBJ +STDCALL +GetStockObject(int); + +int +STDCALL +GetStretchBltMode(HDC); + +UINT +STDCALL +GetSystemPaletteEntries(HDC, UINT, UINT, LPPALETTEENTRY); + +UINT +STDCALL +GetSystemPaletteUse(HDC); + +int +STDCALL +GetTextCharacterExtra(HDC); + +UINT +STDCALL +GetTextAlign(HDC); + +COLORREF +STDCALL +GetTextColor(HDC); + +int +STDCALL +GetTextCharset(HDC hdc); + +int +STDCALL +GetTextCharsetInfo(HDC hdc, LPFONTSIGNATURE lpSig, DWORD dwFlags); + +WINBOOL +STDCALL +TranslateCharsetInfo( DWORD *lpSrc, LPCHARSETINFO lpCs, DWORD dwFlags); + +DWORD +STDCALL +GetFontLanguageInfo( HDC ); + +WINBOOL +STDCALL +GetViewportExtEx(HDC, LPSIZE); + +WINBOOL +STDCALL +GetViewportOrgEx(HDC, LPPOINT); + +WINBOOL +STDCALL +GetWindowExtEx(HDC, LPSIZE); + +WINBOOL +STDCALL +GetWindowOrgEx(HDC, LPPOINT); + +int +STDCALL +IntersectClipRect(HDC, int, int, int, int); + +WINBOOL +STDCALL +InvertRgn(HDC, HRGN); + +WINBOOL +STDCALL +LineDDA(int, int, int, int, LINEDDAPROC, LPARAM); + +WINBOOL +STDCALL +LineTo(HDC, int, int); + +WINBOOL +STDCALL +MaskBlt(HDC, int, int, int, int, + HDC, int, int, HBITMAP, int, int, DWORD); + +WINBOOL +STDCALL +PlgBlt(HDC, CONST POINT *, HDC, int, int, int, + int, HBITMAP, int, int); + +int +STDCALL +OffsetClipRgn(HDC, int, int); + +int +STDCALL +OffsetRgn(HRGN, int, int); + +WINBOOL +STDCALL +PatBlt(HDC, int, int, int, int, DWORD); + +WINBOOL +STDCALL +Pie(HDC, int, int, int, int, int, int, int, int); + +WINBOOL +STDCALL +PlayMetaFile(HDC, HMETAFILE); + +WINBOOL +STDCALL +PaintRgn(HDC, HRGN); + +WINBOOL +STDCALL +PolyPolygon(HDC, CONST POINT *, CONST INT *, int); + +WINBOOL +STDCALL +PtInRegion(HRGN, int, int); + +WINBOOL +STDCALL +PtVisible(HDC, int, int); + +WINBOOL +STDCALL +RectInRegion(HRGN, CONST RECT *); + +WINBOOL +STDCALL +RectVisible(HDC, CONST RECT *); + +WINBOOL +STDCALL +Rectangle(HDC, int, int, int, int); + +WINBOOL +STDCALL +RestoreDC(HDC, int); + +UINT +STDCALL +RealizePalette(HDC); + +WINBOOL +STDCALL +RoundRect(HDC, int, int, int, int, int, int); + +WINBOOL +STDCALL +ResizePalette(HPALETTE, UINT); + +int +STDCALL +SaveDC(HDC); + +int +STDCALL +SelectClipRgn(HDC, HRGN); + +int +STDCALL +ExtSelectClipRgn(HDC, HRGN, int); + +int +STDCALL +SetMetaRgn(HDC); + +HGDIOBJ +STDCALL +SelectObject(HDC, HGDIOBJ); + +HPALETTE +STDCALL +SelectPalette(HDC, HPALETTE, WINBOOL); + +COLORREF +STDCALL +SetBkColor(HDC, COLORREF); + +int +STDCALL +SetBkMode(HDC, int); + +LONG +STDCALL +SetBitmapBits(HBITMAP, DWORD, CONST VOID *); + +UINT +STDCALL +SetBoundsRect(HDC, CONST RECT *, UINT); + +int +STDCALL +SetDIBits(HDC, HBITMAP, UINT, UINT, CONST VOID *, CONST BITMAPINFO *, UINT); + +int +STDCALL +SetDIBitsToDevice(HDC, int, int, DWORD, DWORD, int, + int, UINT, UINT, CONST VOID *, CONST BITMAPINFO *, UINT); + +DWORD +STDCALL +SetMapperFlags(HDC, DWORD); + +int +STDCALL +SetGraphicsMode(HDC hdc, int iMode); + +int +STDCALL +SetMapMode(HDC, int); + +HMETAFILE +STDCALL +SetMetaFileBitsEx(UINT, CONST BYTE *); + +UINT +STDCALL +SetPaletteEntries(HPALETTE, UINT, UINT, CONST PALETTEENTRY *); + +COLORREF +STDCALL +SetPixel(HDC, int, int, COLORREF); + +WINBOOL +STDCALL +SetPixelV(HDC, int, int, COLORREF); + +int +STDCALL +SetPolyFillMode(HDC, int); + +WINBOOL +STDCALL +StretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD); + +WINBOOL +STDCALL +SetRectRgn(HRGN, int, int, int, int); +int +STDCALL +StretchDIBits(HDC, int, int, int, int, int, int, int, int, CONST + VOID *, CONST BITMAPINFO *, UINT, DWORD); + +int +STDCALL +SetROP2(HDC, int); + +int +STDCALL +SetStretchBltMode(HDC, int); + +UINT +STDCALL +SetSystemPaletteUse(HDC, UINT); + +int +STDCALL +SetTextCharacterExtra(HDC, int); + +COLORREF +STDCALL +SetTextColor(HDC, COLORREF); + +UINT +STDCALL +SetTextAlign(HDC, UINT); + +WINBOOL +STDCALL +SetTextJustification(HDC, int, int); + +WINBOOL +STDCALL +UpdateColors(HDC); + +WINBOOL +STDCALL +PlayMetaFileRecord(HDC, LPHANDLETABLE, LPMETARECORD, UINT); + +WINBOOL +STDCALL +EnumMetaFile(HDC, HMETAFILE, ENUMMETAFILEPROC, LPARAM); + +HENHMETAFILE +STDCALL +CloseEnhMetaFile(HDC); + +WINBOOL +STDCALL +DeleteEnhMetaFile(HENHMETAFILE); + +WINBOOL +STDCALL +EnumEnhMetaFile(HDC, HENHMETAFILE, ENHMETAFILEPROC, + LPVOID, CONST RECT *); + +UINT +STDCALL +GetEnhMetaFileHeader(HENHMETAFILE, UINT, LPENHMETAHEADER ); + +UINT +STDCALL +GetEnhMetaFilePaletteEntries(HENHMETAFILE, UINT, LPPALETTEENTRY ); + +UINT +STDCALL +GetWinMetaFileBits(HENHMETAFILE, UINT, LPBYTE, INT, HDC); + +WINBOOL +STDCALL +PlayEnhMetaFile(HDC, HENHMETAFILE, CONST RECT *); + +WINBOOL +STDCALL +PlayEnhMetaFileRecord(HDC, LPHANDLETABLE, CONST ENHMETARECORD *, UINT); + +HENHMETAFILE +STDCALL +SetEnhMetaFileBits(UINT, CONST BYTE *); + +#if 0 +HENHMETAFILE +STDCALL +SetWinMetaFileBits(UINT, CONST BYTE *, HDC, CONST METAFILEPICT *); +#endif + +WINBOOL +STDCALL +GdiComment(HDC, UINT, CONST BYTE *); + +WINBOOL +STDCALL +AngleArc(HDC, int, int, DWORD, FLOAT, FLOAT); + +WINBOOL +STDCALL +PolyPolyline(HDC, CONST POINT *, CONST DWORD *, DWORD); + +WINBOOL +STDCALL +GetWorldTransform(HDC, LPXFORM); + +WINBOOL +STDCALL +SetWorldTransform(HDC, CONST XFORM *); + +WINBOOL +STDCALL +ModifyWorldTransform(HDC, CONST XFORM *, DWORD); + +WINBOOL +STDCALL +CombineTransform(LPXFORM, CONST XFORM *, CONST XFORM *); + +HBITMAP +STDCALL +CreateDIBSection(HDC, CONST BITMAPINFO *, UINT, VOID *, HANDLE, DWORD); + +UINT +STDCALL +GetDIBColorTable(HDC, UINT, UINT, RGBQUAD *); + +UINT +STDCALL +SetDIBColorTable(HDC, UINT, UINT, CONST RGBQUAD *); + +WINBOOL +STDCALL +SetColorAdjustment(HDC, CONST COLORADJUSTMENT *); + +WINBOOL +STDCALL +GetColorAdjustment(HDC, LPCOLORADJUSTMENT); + +HPALETTE +STDCALL +CreateHalftonePalette(HDC); + +int +STDCALL +EndDoc(HDC); + +int +STDCALL +StartPage(HDC); + +int +STDCALL +EndPage(HDC); + +int +STDCALL +AbortDoc(HDC); + +int +STDCALL +SetAbortProc(HDC, ABORTPROC); + +WINBOOL +STDCALL +AbortPath(HDC); + +WINBOOL +STDCALL +ArcTo(HDC, int, int, int, int, int, int,int, int); + +WINBOOL +STDCALL +BeginPath(HDC); + +WINBOOL +STDCALL +CloseFigure(HDC); + +WINBOOL +STDCALL +EndPath(HDC); + +WINBOOL +STDCALL +FillPath(HDC); + +WINBOOL +STDCALL +FlattenPath(HDC); + +int +STDCALL +GetPath(HDC, LPPOINT, LPBYTE, int); + +HRGN +STDCALL +PathToRegion(HDC); + +WINBOOL +STDCALL +PolyDraw(HDC, CONST POINT *, CONST BYTE *, int); + +WINBOOL +STDCALL +SelectClipPath(HDC, int); + +int +STDCALL +SetArcDirection(HDC, int); + +WINBOOL +STDCALL +SetMiterLimit(HDC, FLOAT, PFLOAT); + +WINBOOL +STDCALL +StrokeAndFillPath(HDC); + +WINBOOL +STDCALL +StrokePath(HDC); + +WINBOOL +STDCALL +WidenPath(HDC); + +HPEN +STDCALL +ExtCreatePen(DWORD, DWORD, CONST LOGBRUSH *, DWORD, CONST DWORD *); + +WINBOOL +STDCALL +GetMiterLimit(HDC, PFLOAT); + +int +STDCALL +GetArcDirection(HDC); + +WINBOOL +STDCALL +MoveToEx(HDC, int, int, LPPOINT); + +HRGN +STDCALL +CreatePolygonRgn(CONST POINT *, int, int); + +WINBOOL +STDCALL +DPtoLP(HDC, LPPOINT, int); + +WINBOOL +STDCALL +LPtoDP(HDC, LPPOINT, int); + +WINBOOL +STDCALL +Polygon(HDC, CONST POINT *, int); + +WINBOOL +STDCALL +Polyline(HDC, CONST POINT *, int); + +WINBOOL +STDCALL +PolyBezier(HDC, CONST POINT *, DWORD); + +WINBOOL +STDCALL +PolyBezierTo(HDC, CONST POINT *, DWORD); + +WINBOOL +STDCALL +PolylineTo(HDC, CONST POINT *, DWORD); + +WINBOOL +STDCALL +SetViewportExtEx(HDC, int, int, LPSIZE); + +WINBOOL +STDCALL +SetViewportOrgEx(HDC, int, int, LPPOINT); + +WINBOOL +STDCALL +SetWindowExtEx(HDC, int, int, LPSIZE); + +WINBOOL +STDCALL +SetWindowOrgEx(HDC, int, int, LPPOINT); + +WINBOOL +STDCALL +OffsetViewportOrgEx(HDC, int, int, LPPOINT); + +WINBOOL +STDCALL +OffsetWindowOrgEx(HDC, int, int, LPPOINT); + +WINBOOL +STDCALL +ScaleViewportExtEx(HDC, int, int, int, int, LPSIZE); + +WINBOOL +STDCALL +ScaleWindowExtEx(HDC, int, int, int, int, LPSIZE); + +WINBOOL +STDCALL +SetBitmapDimensionEx(HBITMAP, int, int, LPSIZE); + +WINBOOL +STDCALL +SetBrushOrgEx(HDC, int, int, LPPOINT); + +WINBOOL +STDCALL +GetDCOrgEx(HDC,LPPOINT); + +WINBOOL +STDCALL +FixBrushOrgEx(HDC,int,int,LPPOINT); + +WINBOOL +STDCALL +UnrealizeObject(HGDIOBJ); + +WINBOOL +STDCALL +GdiFlush(void); + +DWORD +STDCALL +GdiSetBatchLimit(DWORD); + +DWORD +STDCALL +GdiGetBatchLimit(void); + +int +STDCALL +SetICMMode(HDC, int); + +WINBOOL +STDCALL +CheckColorsInGamut(HDC,LPVOID,LPVOID,DWORD); + +HANDLE +STDCALL +GetColorSpace(HDC); + +WINBOOL +STDCALL +SetColorSpace(HDC,HCOLORSPACE); + +WINBOOL +STDCALL +DeleteColorSpace(HCOLORSPACE); + +WINBOOL +STDCALL +GetDeviceGammaRamp(HDC,LPVOID); + +WINBOOL +STDCALL +SetDeviceGammaRamp(HDC,LPVOID); + +WINBOOL +STDCALL +ColorMatchToTarget(HDC,HDC,DWORD); + +HPROPSHEETPAGE +STDCALL +CreatePropertySheetPageA(LPCPROPSHEETPAGE lppsp); + +WINBOOL +STDCALL +DestroyPropertySheetPage(HPROPSHEETPAGE hPSPage); + +void +STDCALL +InitCommonControls(void); + +#define ImageList_AddIcon(himl, hicon) ImageList_ReplaceIcon(himl, -1, hicon) + +HIMAGELIST +STDCALL +ImageList_Create(int cx, int cy, UINT flags, + int cInitial, int cGrow); + +WINBOOL +STDCALL +ImageList_Destroy(HIMAGELIST himl); + +int +STDCALL +ImageList_GetImageCount(HIMAGELIST himl); + +int +STDCALL +ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, + HBITMAP hbmMask); + +int +STDCALL +ImageList_ReplaceIcon(HIMAGELIST himl, int i, HICON hicon); + +COLORREF +STDCALL +ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk); + +COLORREF +STDCALL +ImageList_GetBkColor(HIMAGELIST himl); + +WINBOOL +STDCALL +ImageList_SetOverlayImage(HIMAGELIST himl, int iImage, + int iOverlay); + +WINBOOL +STDCALL +ImageList_Draw(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, UINT fStyle); + +WINBOOL +STDCALL +ImageList_Replace(HIMAGELIST himl, int i, HBITMAP hbmImage, HBITMAP hbmMask); + +int +STDCALL +ImageList_AddMasked(HIMAGELIST himl, HBITMAP hbmImage, COLORREF crMask); + +WINBOOL +STDCALL +ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle); + +WINBOOL +STDCALL +ImageList_Remove(HIMAGELIST himl, int i); + +HICON +STDCALL +ImageList_GetIcon(HIMAGELIST himl, int i, UINT flags); + +WINBOOL +STDCALL +ImageList_BeginDrag(HIMAGELIST himlTrack, int iTrack, int dxHotspot, int dyHotspot); + +void +STDCALL +ImageList_EndDrag(void); + +WINBOOL +STDCALL +ImageList_DragEnter(HWND hwndLock, int x, int y); + +WINBOOL +STDCALL +ImageList_DragLeave(HWND hwndLock); + +WINBOOL +STDCALL +ImageList_DragMove(int x, int y); + +WINBOOL +STDCALL +ImageList_SetDragCursorImage(HIMAGELIST himlDrag, int iDrag, int dxHotspot, int dyHotspot); + +WINBOOL +STDCALL +ImageList_DragShowNolock(WINBOOL fShow); + +HIMAGELIST +STDCALL +ImageList_GetDragImage(POINT * ppt,POINT * pptHotspot); + +WINBOOL +STDCALL +ImageList_GetIconSize(HIMAGELIST himl, int *cx, int *cy); + +WINBOOL +STDCALL +ImageList_SetIconSize(HIMAGELIST himl, int cx, int cy); + +WINBOOL +STDCALL +ImageList_GetImageInfo(HIMAGELIST himl, int i, IMAGEINFO * pImageInfo); + +HIMAGELIST +STDCALL +ImageList_Merge(HIMAGELIST himl1, int i1, HIMAGELIST himl2, int i2, int dx, int dy); + +HWND +STDCALL +CreateToolbarEx(HWND hwnd, DWORD ws, UINT wID, int nBitmaps, + HINSTANCE hBMInst, UINT wBMID, LPCTBBUTTON lpButtons, + int iNumButtons, int dxButton, int dyButton, + int dxBitmap, int dyBitmap, UINT uStructSize); + +HBITMAP +STDCALL +CreateMappedBitmap(HINSTANCE hInstance, int idBitmap, + UINT wFlags, LPCOLORMAP lpColorMap, + int iNumMaps); + + +void +STDCALL +MenuHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu, HINSTANCE hInst, HWND hwndStatus, UINT *lpwIDs); + +WINBOOL +STDCALL +ShowHideMenuCtl(HWND hWnd, UINT uFlags, LPINT lpInfo); + +void +STDCALL +GetEffectiveClientRect(HWND hWnd, LPRECT lprc, LPINT lpInfo); + +WINBOOL +STDCALL +MakeDragList(HWND hLB); + +void +STDCALL +DrawInsert(HWND handParent, HWND hLB, int nItem); + +int +STDCALL +LBItemFromPt(HWND hLB, POINT pt, WINBOOL bAutoScroll); + +HWND +STDCALL +CreateUpDownControl(DWORD dwStyle, int x, int y, int cx, int cy, + HWND hParent, int nID, HINSTANCE hInst, + HWND hBuddy, + int nUpper, int nLower, int nPos); + +DWORD +STDCALL +CommDlgExtendedError(VOID); + +/* Animation controls */ + +#define Animate_Create(hwndP, id, dwStyle, hInstance) CreateWindow(ANIMATE_CLASS, NULL, dwStyle, 0, 0, 0, 0, hwndP, (HMENU)(id), hInstance, NULL) + +#define Animate_Open(hwnd, szName) SendMessage(hwnd, ACM_OPEN, 0, (LPARAM)(LPTSTR)(szName)) + +#define Animate_Play(hwnd, from, to, rep) SendMessage(hwnd, ACM_PLAY, (WPARAM)(UINT)(rep), (LPARAM)MAKELONG(from, to)) + +#define Animate_Stop(hwnd) SendMessage(hwnd, ACM_STOP, 0, 0) + +#define Animate_Close(hwnd) Animate_Open(hwnd, NULL) + +#define Animate_Seek(hwnd, frame) Animate_Play(hwnd, frame, frame, 1) + +/* Property sheet macros */ + +#define PropSheet_AddPage(hPropSheetDlg, hpage) SendMessage(hPropSheetDlg, PSM_ADDPAGE, 0, (LPARAM)(HPROPSHEETPAGE)hpage) + +#define PropSheet_Apply(hPropSheetDlg) SendMessage(hPropSheetDlg, PSM_APPLY, 0, 0) + +#define PropSheet_CancelToClose(hPropSheetDlg) SendMessage(hPropSheetDlg, PSM_CANCELTOCLOSE, 0, 0) + +#define PropSheet_Changed(hPropSheetDlg, hwndPage) SendMessage(hPropSheetDlg, PSM_CHANGED, (WPARAM)(HWND)hwndPage, 0) + +#define PropSheet_GetCurrentPageHwnd(hDlg) SendMessage(hDlg, PSM_GETCURRENTPAGEHWND, 0, 0) + +#define PropSheet_GetTabControl(hPropSheetDlg) SendMessage(hPropSheetDlg, PSM_GETTABCONTROL, 0, 0) + +#define PropSheet_IsDialogMessage(hDlg, pMsg) SendMessage(hDlg, PSM_ISDIALOGMESSAGE, 0, (LPARAM)pMsg) + +#define PropSheet_PressButton(hPropSheetDlg, iButton) SendMessage(hPropSheetDlg, PSM_PRESSBUTTON, (WPARAM)(int)iButton, 0) + +#define PropSheet_QuerySiblings(hPropSheetDlg, param1, param2) SendMessage(hPropSheetDlg, PSM_QUERYSIBLINGS, (WPARAM)param1, (LPARAM)param2) + +#define PropSheet_RebootSystem(hPropSheetDlg) SendMessage(hPropSheetDlg, PSM_REBOOTSYSTEM, 0, 0) + +#define PropSheet_RemovePage(hPropSheetDlg, index, hpage) SendMessage(hPropSheetDlg, PSM_REMOVEPAGE, (WPARAM)(int)index, (LPARAM)(HPROPSHEETPAGE)hpage) + +#define PropSheet_RestartWindows(hPropSheetDlg) SendMessage(hPropSheetDlg, PSM_RESTARTWINDOWS, 0, 0) + +#define PropSheet_SetCurSel(hPropSheetDlg, hpage, index) SendMessage(hPropSheetDlg, PSM_SETCURSEL, (WPARAM)(int)index, (LPARAM)(HPROPSHEETPAGE)hpage) + +#define PropSheet_SetCurSelByID(hPropSheetDlg, id) SendMessage(hPropSheetDlg, PSM_SETCURSELID, 0, (LPARAM)(int)id) + +#define PropSheet_SetFinishText(hPropSheetDlg, lpszText) SendMessage(hPropSheetDlg, PSM_SETFINISHTEXT, 0, (LPARAM)(LPTSTR)lpszText) + +#define PropSheet_SetTitle(hPropSheetDlg, dwStyle, lpszText) SendMessage(hPropSheetDlg, PSM_SETTITLE, (WPARAM)(DWORD)dwStyle, (LPARAM)(LPCTSTR)lpszText) + +#define PropSheet_SetWizButtons(hPropSheetDlg, dwFlags) SendMessage(hPropSheetDlg, PSM_SETWIZBUTTONS, 0, (LPARAM)(DWORD)dwFlags) + +#define PropSheet_UnChanged(hPropSheetDlg, hwndPage) SendMessage(hPropSheetDlg, PSM_UNCHANGED, (WPARAM)(HWND)hwndPage, 0) + +/* Header control */ +#define Header_DeleteItem(hwndHD, index) (BOOL)SendMessage((hwndHD), HDM_DELETEITEM, (WPARAM)(int)(index), 0L) + +#define Header_GetItem(hwndHD, index, phdi) (BOOL)SendMessage((hwndHD), HDM_GETITEM, (WPARAM)(int)(index), (LPARAM)(HD_ITEM FAR*)(phdi)) + +#define Header_GetItemCount(hwndHD) (int)SendMessage((hwndHD), HDM_GETITEMCOUNT, 0, 0L) + +#define Header_InsertItem(hwndHD, index, phdi) (int)SendMessage((hwndHD), HDM_INSERTITEM, (WPARAM)(int)(index), (LPARAM)(const HD_ITEM FAR*)(phdi)) + +#define Header_Layout(hwndHD, playout) (BOOL)SendMessage((hwndHD), HDM_LAYOUT, 0, (LPARAM)(HD_LAYOUT FAR*)(playout)) + +#define Header_SetItem(hwndHD, index, phdi) (BOOL)SendMessage((hwndHD), HDM_SETITEM, (WPARAM)(int)(index), (LPARAM)(const HD_ITEM FAR*)(phdi)) + +/* List View */ +#define ListView_Arrange(hwndLV, code) SendMessage((hwndLV), LVM_ARRANGE, (WPARAM)(UINT)(code), 0) + +#define ListView_CreateDragImage(hwnd, i, lpptUpLeft) SendMessage((hwnd), LVM_CREATEDRAGIMAGE, (WPARAM)(int)(i), (LPARAM)(LPPOINT)(lpptUpLeft)) + +#define ListView_DeleteAllItems(hwnd) SendMessage(hwnd, LVM_DELETEALLITEMS, 0, 0) + +#define ListView_DeleteColumn(hwnd, iCol) SendMessage((hwnd), LVM_DELETECOLUMN, (WPARAM)(int)(iCol), 0) + +#define ListView_DeleteItem(hwnd, iItem) SendMessage(hwnd, LVM_DELETEITEM, (WPARAM)(int)iItem, 0) + +#define ListView_EditLabel(hwndLV, i) SendMessage((hwndLV), LVM_EDITLABEL, (WPARAM)(int)i, 0) + +#define ListView_EnsureVisible(hwndLV, i, fPartialOK) SendMessage(hwndLV, LVM_ENSUREVISIBLE, (WPARAM)(int)i, MAKELPARAM((fPartialOK), 0)) + +#define ListView_FindItem(hwnd, iStart, plvfi) SendMessage(hwnd, LVM_FINDITEM, (WPARAM)(int)iStart, (LPARAM)(const LV_FINDINFO *)plvfi) + +#define ListView_GetBkColor(hwnd) SendMessage((HWND)hwnd, LVM_GETBKCOLOR, 0, 0) + +#define ListView_GetCallbackMask(hwnd) SendMessage(hwnd, LVM_GETCALLBACKMASK, 0, 0) + +#define ListView_GetColumn(hwnd, iCol, pcol) SendMessage((hwnd), LVM_GETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(LV_COLUMN *)(pcol)) + +#define ListView_GetColumnWidth(hwnd, iCol) SendMessage((hwnd), LVM_GETCOLUMNWIDTH, (WPARAM)(int)(iCol), 0) + +#define ListView_GetCountPerPage(hwndLV) SendMessage((hwndLV), LVM_GETCOUNTPERPAGE, 0, 0) + +#define ListView_GetEditControl(hwndLV) SendMessage((hwndLV), LVM_GETEDITCONTROL, 0, 0) + +#define ListView_GetImageList(hwnd, iImageList) SendMessage(hwnd, LVM_GETIMAGELIST, (WPARAM)(INT)iImageList, 0) + +#define ListView_GetISearchString(hwndLV, lpsz) SendMessage((hwndLV), LVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz) + +#define ListView_GetItem(hwnd, pitem) SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM)(LV_ITEM *)(pitem)) + +#define ListView_GetItemCount(hwnd) SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0) + +#define ListView_GetItemPosition(hwndLV, i, ppt) SendMessage(hwndLV, LVM_GETITEMPOSITION, (WPARAM)(int)i, (LPARAM)(POINT *)ppt) + +#define ListView_GetItemRect(hwnd, i, prc, code) SendMessage(hwnd, LVM_GETITEMRECT, (WPARAM)(int)i, ((prc) ? (((RECT *)(prc))->left = (code), (LPARAM)(RECT *)(prc)) : (LPARAM)(RECT *)NULL)) + +#define ListView_GetItemSpacing(hwndLV, fSmall) SendMessage((hwndLV), LVM_GETITEMSPACING, fSmall, 0) + +#define ListView_GetItemState(hwndLV, i, mask) SendMessage((hwndLV), LVM_GETITEMSTATE, (WPARAM)i, (LPARAM)mask) + +#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_) { LV_ITEM _gnu_lvi;_gnu_lvi.iSubItem = iSubItem_;_gnu_lvi.cchTextMax = cchTextMax_;_gnu_lvi.pszText = pszText_;SendMessage((hwndLV), LVM_GETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM *)&_gnu_lvi);} + +#define ListView_GetNextItem(hwnd, iStart, flags) SendMessage(hwnd, LVM_GETNEXTITEM, (WPARAM)(int)iStart, (LPARAM)flags) + +#define ListView_GetOrigin(hwndLV, ppt) SendMessage((hwndLV), LVM_GETORIGIN, (WPARAM)0, (LPARAM)(POINT *)(ppt)) + +#define ListView_GetSelectedCount(hwndLV) SendMessage((hwndLV), LVM_GETSELECTEDCOUNT, 0, 0) + +#define ListView_GetStringWidth(hwndLV, psz) SendMessage(hwndLV, LVM_GETSTRINGWIDTH, 0, (LPARAM)(LPCTSTR)psz) + +#define ListView_GetTextBkColor(hwnd) SendMessage((hwnd), LVM_GETTEXTBKCOLOR, 0, 0) + +#define ListView_GetTextColor(hwnd) SendMessage((hwnd), LVM_GETTEXTCOLOR, 0, 0) + +#define ListView_GetTopIndex(hwndLV) SendMessage((hwndLV), LVM_GETTOPINDEX, 0, 0) + +#define ListView_GetViewRect(hwnd, prc) SendMessage((hwnd), LVM_GETVIEWRECT, 0, (LPARAM)(RECT *)(prc)) + +#define ListView_HitTest(hwndLV, pinfo) SendMessage(hwndLV, LVM_HITTEST, 0, (LPARAM)(LV_HITTESTINFO *)pinfo) + +#define ListView_InsertColumn(hwnd, iCol, pcol) SendMessage((hwnd), LVM_INSERTCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN *)(pcol)) + +#define ListView_InsertItem(hwnd, pitem) SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM)(const LV_ITEM *)pitem) + +#define ListView_RedrawItems(hwndLV, iFirst, iLast) SendMessage((hwndLV), LVM_REDRAWITEMS, (WPARAM)(int)iFirst, (LPARAM)(int)iLast) + +#define ListView_Scroll(hwndLV, dx, dy) SendMessage((hwndLV), LVM_SCROLL, (WPARAM)(int)dx, (LPARAM)(int)dy) + +#define ListView_SetBkColor(hwnd, clrBk) SendMessage(hwnd, LVM_SETBKCOLOR, 0, (LPARAM)(COLORREF)clrBk) + +#define ListView_SetCallbackMask(hwnd, mask) SendMessage(hwnd, LVM_SETCALLBACKMASK, (WPARAM)(UINT)(mask), 0) + +#define ListView_SetColumn(hwnd, iCol, pcol) SendMessage((hwnd), LVM_SETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN *)(pcol)) + +#define ListView_SetColumnWidth(hwnd, iCol, cx) SendMessage((hwnd), LVM_SETCOLUMNWIDTH, (WPARAM)(int)(iCol), MAKELPARAM((cx), 0)) + + +#define ListView_SetImageList(hwnd, himl, iImageList) SendMessage(hwnd, LVM_SETIMAGELIST, (WPARAM)(iImageList), (LPARAM)(UINT)(HIMAGELIST)(himl)) + +#define ListView_SetItem(hwnd, pitem) SendMessage(hwnd, LVM_SETITEM, 0, (LPARAM)(const LV_ITEM *)pitem) + +#define ListView_SetItemCount(hwndLV, cItems) SendMessage((hwndLV), LVM_SETITEMCOUNT, (WPARAM)cItems, 0) + +#define ListView_SetItemPosition(hwndLV, i, x, y) SendMessage(hwndLV, LVM_SETITEMPOSITION, (WPARAM)(int)(i), MAKELPARAM((x), (y))) + +#define ListView_SetItemPosition32(hwndLV, i, x, y) { POINT ptNewPos = {x,y}; SendMessage((hwndLV), LVM_SETITEMPOSITION32, (WPARAM)(int)(i), (LPARAM)&ptNewPos); } + +#define ListView_SetItemState(hwndLV, i, data, mask) { LV_ITEM _gnu_lvi; _gnu_lvi.stateMask = mask; _gnu_lvi.state = data; SendMessage((hwndLV), LVM_SETITEMSTATE, (WPARAM)i, (LPARAM)(LV_ITEM *)&_gnu_lvi);} + +#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_) { LV_ITEM _gnu_lvi; _gnu_lvi.iSubItem = iSubItem_; _gnu_lvi.pszText = pszText_; SendMessage((hwndLV), LVM_SETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM *)&_gnu_lvi);} + +#define ListView_SetTextBkColor(hwnd, clrTextBk) SendMessage((hwnd), LVM_SETTEXTBKCOLOR, 0, (LPARAM)(COLORREF)(clrTextBk)) + +#define ListView_SetTextColor(hwnd, clrText) SendMessage((hwnd), LVM_SETTEXTCOLOR, 0, (LPARAM)(COLORREF)(clrText)) + +#define ListView_SortItems(hwndLV, _pfnCompare, _lPrm) SendMessage((hwndLV), LVM_SORTITEMS, (WPARAM)(LPARAM)_lPrm, (LPARAM)(PFNLVCOMPARE)_pfnCompare) + +#define ListView_Update(hwndLV, i) SendMessage((hwndLV), LVM_UPDATE, (WPARAM)i, 0) + +/* Tree View */ +#define TreeView_InsertItem(hwnd, lpis) SendMessage((hwnd), TVM_INSERTITEM, 0, (LPARAM)(LPTV_INSERTSTRUCT)(lpis)) + +#define TreeView_DeleteItem(hwnd, hitem) SendMessage((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hitem)) + +#define TreeView_DeleteAllItems(hwnd) SendMessage((hwnd), TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT) + +#define TreeView_Expand(hwnd, hitem, code) SendMessage((hwnd), TVM_EXPAND, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem)) + +#define TreeView_GetItemRect(hwnd, hitem, prc, code) SendMessage((hwnd), TVM_GETITEMRECT, (WPARAM)(code), (LPARAM)(RECT *)(prc))) + +#define TreeView_GetCount(hwnd) SendMessage((hwnd), TVM_GETCOUNT, 0, 0) + +#define TreeView_GetIndent(hwnd) SendMessage((hwnd), TVM_GETINDENT, 0, 0) + +#define TreeView_SetIndent(hwnd, indent) SendMessage((hwnd), TVM_SETINDENT, (WPARAM)indent, 0) + +#define TreeView_GetImageList(hwnd, iImage) SendMessage((hwnd), TVM_GETIMAGELIST, iImage, 0) + +#define TreeView_SetImageList(hwnd, himl, iImage) SendMessage((hwnd), TVM_SETIMAGELIST, iImage, (LPARAM)(UINT)(HIMAGELIST)(himl)) + +#define TreeView_GetNextItem(hwnd, hitem, code) SendMessage((hwnd), TVM_GETNEXTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem)) + +#define TreeView_GetChild(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_CHILD) + +#define TreeView_GetNextSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_NEXT) + +#define TreeView_GetPrevSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUS) + +#define TreeView_GetParent(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PARENT) + +#define TreeView_GetFirstVisible(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_FIRSTVISIBLE) + +#define TreeView_GetNextVisible(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_NEXTVISIBLE) + +#define TreeView_GetPrevVisible(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUSVISIBLE) + +#define TreeView_GetSelection(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_CARET) + +#define TreeView_GetDropHilight(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_DROPHILITE) + +#define TreeView_GetRoot(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_ROOT) + +#define TreeView_Select(hwnd, hitem, code) SendMessage((hwnd), TVM_SELECTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem)) + + +#define TreeView_SelectItem(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_CARET) + +#define TreeView_SelectDropTarget(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_DROPHILITE) + +#define TreeView_SelectSetFirstVisible(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE) + +#define TreeView_GetItem(hwnd, pitem) SendMessage((hwnd), TVM_GETITEM, 0, (LPARAM)(TV_ITEM *)(pitem)) + +#define TreeView_SetItem(hwnd, pitem) SendMessage((hwnd), TVM_SETITEM, 0, (LPARAM)(const TV_ITEM *)(pitem)) + +#define TreeView_EditLabel(hwnd, hitem) SendMessage((hwnd), TVM_EDITLABEL, 0, (LPARAM)(HTREEITEM)(hitem)) + +#define TreeView_GetEditControl(hwnd) SendMessage((hwnd), TVM_GETEDITCONTROL, 0, 0) + +#define TreeView_GetVisibleCount(hwnd) SendMessage((hwnd), TVM_GETVISIBLECOUNT, 0, 0) + +#define TreeView_HitTest(hwnd, lpht) SendMessage((hwnd), TVM_HITTEST, 0, (LPARAM)(LPTV_HITTESTINFO)(lpht)) + +#define TreeView_CreateDragImage(hwnd, hitem) SendMessage((hwnd), TVM_CREATEDRAGIMAGE, 0, (LPARAM)(HTREEITEM)(hitem)) + +#define TreeView_SortChildren(hwnd, hitem, recurse) SendMessage((hwnd), TVM_SORTCHILDREN, (WPARAM)recurse, (LPARAM)(HTREEITEM)(hitem)) + +#define TreeView_EnsureVisible(hwnd, hitem) SendMessage((hwnd), TVM_ENSUREVISIBLE, 0, (LPARAM)(HTREEITEM)(hitem)) + +#define TreeView_SortChildrenCB(hwnd, psort, recurse) SendMessage((hwnd), TVM_SORTCHILDRENCB, (WPARAM)recurse, (LPARAM)(LPTV_SORTCB)(psort)) + +#define TreeView_EndEditLabelNow(hwnd, fCancel) SendMessage((hwnd), TVM_ENDEDITLABELNOW, (WPARAM)fCancel, 0) + +#define TreeView_GetISearchString(hwndTV, lpsz) SendMessage((hwndTV), TVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz) + + +/* Tab control */ +#define TabCtrl_GetImageList(hwnd) SendMessage((hwnd), TCM_GETIMAGELIST, 0, 0) + +#define TabCtrl_SetImageList(hwnd, himl) SendMessage((hwnd), TCM_SETIMAGELIST, 0, (LPARAM)(UINT)(HIMAGELIST)(himl)) + +#define TabCtrl_GetItemCount(hwnd) SendMessage((hwnd), TCM_GETITEMCOUNT, 0, 0) + +#define TabCtrl_GetItem(hwnd, iItem, pitem) SendMessage((hwnd), TCM_GETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM *)(pitem)) + +#define TabCtrl_SetItem(hwnd, iItem, pitem) SendMessage((hwnd), TCM_SETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM *)(pitem)) + +#define TabCtrl_InsertItem(hwnd, iItem, pitem) SendMessage((hwnd), TCM_INSERTITEM, (WPARAM)(int)iItem, (LPARAM)(const TC_ITEM *)(pitem)) + +#define TabCtrl_DeleteItem(hwnd, i) SendMessage((hwnd), TCM_DELETEITEM, (WPARAM)(int)(i), 0) + +#define TabCtrl_DeleteAllItems(hwnd) SendMessage((hwnd), TCM_DELETEALLITEMS, 0, 0) + +#define TabCtrl_GetItemRect(hwnd, i, prc) SendMessage((hwnd), TCM_GETITEMRECT, (WPARAM)(int)(i), (LPARAM)(RECT *)(prc)) + +#define TabCtrl_GetCurSel(hwnd) SendMessage((hwnd), TCM_GETCURSEL, 0, 0) + +#define TabCtrl_SetCurSel(hwnd, i) SendMessage((hwnd), TCM_SETCURSEL, (WPARAM)i, 0) + +#define TabCtrl_HitTest(hwndTC, pinfo) SendMessage((hwndTC), TCM_HITTEST, 0, (LPARAM)(TC_HITTESTINFO *)(pinfo)) + +#define TabCtrl_SetItemExtra(hwndTC, cb) SendMessage((hwndTC), TCM_SETITEMEXTRA, (WPARAM)(cb), 0) + +#define TabCtrl_AdjustRect(hwnd, bLarger, prc) SendMessage(hwnd, TCM_ADJUSTRECT, (WPARAM)(WINBOOL)bLarger, (LPARAM)(RECT *)prc) + +#define TabCtrl_SetItemSize(hwnd, x, y) SendMessage((hwnd), TCM_SETITEMSIZE, 0, MAKELPARAM(x,y)) + +#define TabCtrl_RemoveImage(hwnd, i) SendMessage((hwnd), TCM_REMOVEIMAGE, i, 0) + +#define TabCtrl_SetPadding(hwnd, cx, cy) SendMessage((hwnd), TCM_SETPADDING, 0, MAKELPARAM(cx, cy)) + +#define TabCtrl_GetRowCount(hwnd) SendMessage((hwnd), TCM_GETROWCOUNT, 0, 0) + +#define TabCtrl_GetToolTips(hwnd) SendMessage((hwnd), TCM_GETTOOLTIPS, 0, 0) + +#define TabCtrl_SetToolTips(hwnd, hwndTT) SendMessage((hwnd), TCM_SETTOOLTIPS, (WPARAM)hwndTT, 0) + +#define TabCtrl_GetCurFocus(hwnd) SendMessage((hwnd), TCM_GETCURFOCUS, 0, 0) + +#define TabCtrl_SetCurFocus(hwnd, i) SendMessage((hwnd),TCM_SETCURFOCUS, i, 0) + +#define CommDlg_OpenSave_GetSpecA(_hdlg, _psz, _cbmax) SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz) + +#define CommDlg_OpenSave_GetSpecW(_hdlg, _psz, _cbmax) SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz) + +#ifdef UNICODE +#define CommDlg_OpenSave_GetSpec CommDlg_OpenSave_GetSpecW +#else +#define CommDlg_OpenSave_GetSpec CommDlg_OpenSave_GetSpecA +#endif /* !UNICODE */ + +#define CommDlg_OpenSave_GetFilePathA(_hdlg, _psz, _cbmax) SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz) + +#define CommDlg_OpenSave_GetFilePathW(_hdlg, _psz, _cbmax) SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz) + +#ifdef UNICODE +#define CommDlg_OpenSave_GetFilePath CommDlg_OpenSave_GetFilePathW +#else +#define CommDlg_OpenSave_GetFilePath CommDlg_OpenSave_GetFilePathA +#endif /* !UNICODE */ + +#define CommDlg_OpenSave_GetFolderPathA(_hdlg, _psz, _cbmax) SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz) + +#define CommDlg_OpenSave_GetFolderPathW(_hdlg, _psz, _cbmax) SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz) + +#ifdef UNICODE +#define CommDlg_OpenSave_GetFolderPath CommDlg_OpenSave_GetFolderPathW +#else +#define CommDlg_OpenSave_GetFolderPath CommDlg_OpenSave_GetFolderPathA +#endif /* !UNICODE */ + +#define CommDlg_OpenSave_GetFolderIDList(_hdlg, _pidl, _cbmax) SNDMSG(_hdlg, CDM_GETFOLDERIDLIST, (WPARAM)_cbmax, (LPARAM)(LPVOID)_pidl) + +#define CommDlg_OpenSave_SetControlText(_hdlg, _id, _text) SNDMSG(_hdlg, CDM_SETCONTROLTEXT, (WPARAM)_id, (LPARAM)(LPSTR)_text) + +#define CommDlg_OpenSave_HideControl(_hdlg, _id) SNDMSG(_hdlg, CDM_HIDECONTROL, (WPARAM)_id, 0) + +#define CommDlg_OpenSave_SetDefExt(_hdlg, _pszext) SNDMSG(_hdlg, CDM_SETDEFEXT, 0, (LPARAM)(LPSTR)_pszext) + +LONG +STDCALL +RegCloseKey ( + HKEY hKey + ); + +LONG +STDCALL +RegSetKeySecurity ( + HKEY hKey, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor + ); + +LONG +STDCALL +RegFlushKey ( + HKEY hKey + ); + +LONG +STDCALL +RegGetKeySecurity ( + HKEY hKey, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + LPDWORD lpcbSecurityDescriptor + ); + +LONG +STDCALL +RegNotifyChangeKeyValue ( + HKEY hKey, + WINBOOL bWatchSubtree, + DWORD dwNotifyFilter, + HANDLE hEvent, + WINBOOL fAsynchronus + ); + +WINBOOL +STDCALL +IsValidCodePage( + UINT CodePage); + + +UINT +STDCALL +GetACP(void); + + +UINT +STDCALL +GetOEMCP(void); + + +WINBOOL +STDCALL +GetCPInfo(UINT, LPCPINFO); + + +WINBOOL +STDCALL +IsDBCSLeadByte( + BYTE TestChar); + + +WINBOOL +STDCALL +IsDBCSLeadByteEx( + UINT CodePage, + BYTE TestChar); + + +int +STDCALL +MultiByteToWideChar( + UINT CodePage, + DWORD dwFlags, + LPCSTR lpMultiByteStr, + int cchMultiByte, + LPWSTR lpWideCharStr, + int cchWideChar); + + +int +STDCALL +WideCharToMultiByte( + UINT CodePage, + DWORD dwFlags, + LPCWSTR lpWideCharStr, + int cchWideChar, + LPSTR lpMultiByteStr, + int cchMultiByte, + LPCSTR lpDefaultChar, + LPBOOL lpUsedDefaultChar); + +WINBOOL +STDCALL +IsValidLocale( + LCID Locale, + DWORD dwFlags); + + +LCID +STDCALL +ConvertDefaultLocale( + LCID Locale); + + +LCID +STDCALL +GetThreadLocale(void); + + +WINBOOL +STDCALL +SetThreadLocale( + LCID Locale + ); + + +LANGID +STDCALL +GetSystemDefaultLangID(void); + + +LANGID +STDCALL +GetUserDefaultLangID(void); + + +LCID +STDCALL +GetSystemDefaultLCID(void); + + +LCID +STDCALL +GetUserDefaultLCID(void); + + +WINBOOL +STDCALL +ReadConsoleOutputAttribute( + HANDLE hConsoleOutput, + LPWORD lpAttribute, + DWORD nLength, + COORD dwReadCoord, + LPDWORD lpNumberOfAttrsRead + ); + + +WINBOOL +STDCALL +WriteConsoleOutputAttribute( + HANDLE hConsoleOutput, + CONST WORD *lpAttribute, + DWORD nLength, + COORD dwWriteCoord, + LPDWORD lpNumberOfAttrsWritten + ); + + +WINBOOL +STDCALL +FillConsoleOutputAttribute( + HANDLE hConsoleOutput, + WORD wAttribute, + DWORD nLength, + COORD dwWriteCoord, + LPDWORD lpNumberOfAttrsWritten + ); + + +WINBOOL +STDCALL +GetConsoleMode( + HANDLE hConsoleHandle, + LPDWORD lpMode + ); + + +WINBOOL +STDCALL +GetNumberOfConsoleInputEvents( + HANDLE hConsoleInput, + LPDWORD lpNumberOfEvents + ); + + +WINBOOL +STDCALL +GetConsoleScreenBufferInfo( + HANDLE hConsoleOutput, + PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo + ); + + +COORD +STDCALL +GetLargestConsoleWindowSize( + HANDLE hConsoleOutput + ); + + +WINBOOL +STDCALL +GetConsoleCursorInfo( + HANDLE hConsoleOutput, + PCONSOLE_CURSOR_INFO lpConsoleCursorInfo + ); + + +WINBOOL +STDCALL +GetNumberOfConsoleMouseButtons( + LPDWORD lpNumberOfMouseButtons + ); + + +WINBOOL +STDCALL +SetConsoleMode( + HANDLE hConsoleHandle, + DWORD dwMode + ); + + +WINBOOL +STDCALL +SetConsoleActiveScreenBuffer( + HANDLE hConsoleOutput + ); + + +WINBOOL +STDCALL +FlushConsoleInputBuffer( + HANDLE hConsoleInput + ); + + +WINBOOL +STDCALL +SetConsoleScreenBufferSize( + HANDLE hConsoleOutput, + COORD dwSize + ); + + +WINBOOL +STDCALL +SetConsoleCursorPosition( + HANDLE hConsoleOutput, + COORD dwCursorPosition + ); + + +WINBOOL +STDCALL +SetConsoleCursorInfo( + HANDLE hConsoleOutput, + CONST CONSOLE_CURSOR_INFO *lpConsoleCursorInfo + ); + +WINBOOL +STDCALL +SetConsoleWindowInfo( + HANDLE hConsoleOutput, + WINBOOL bAbsolute, + CONST SMALL_RECT *lpConsoleWindow + ); + + +WINBOOL +STDCALL +SetConsoleTextAttribute( + HANDLE hConsoleOutput, + WORD wAttributes + ); + + +WINBOOL +STDCALL +SetConsoleCtrlHandler( + PHANDLER_ROUTINE HandlerRoutine, + WINBOOL Add + ); + + +WINBOOL +STDCALL +GenerateConsoleCtrlEvent( + DWORD dwCtrlEvent, + DWORD dwProcessGroupId + ); + + +WINBOOL +STDCALL +AllocConsole( VOID ); + + +WINBOOL +STDCALL +FreeConsole( VOID ); + + + +HANDLE +STDCALL +CreateConsoleScreenBuffer( + DWORD dwDesiredAccess, + DWORD dwShareMode, + CONST SECURITY_ATTRIBUTES *lpSecurityAttributes, + DWORD dwFlags, + LPVOID lpScreenBufferData + ); + + +UINT +STDCALL +GetConsoleCP( VOID ); + + +WINBOOL +STDCALL +SetConsoleCP( + UINT wCodePageID + ); + + +UINT +STDCALL +GetConsoleOutputCP( VOID ); + + +WINBOOL +STDCALL +SetConsoleOutputCP( + UINT wCodePageID + ); + +DWORD STDCALL +WNetConnectionDialog( + HWND hwnd, + DWORD dwType + ); + +DWORD STDCALL +WNetDisconnectDialog( + HWND hwnd, + DWORD dwType + ); + +DWORD STDCALL +WNetCloseEnum( + HANDLE hEnum + ); + +WINBOOL +STDCALL +CloseServiceHandle( + SC_HANDLE hSCObject + ); + + +WINBOOL +STDCALL +ControlService( + SC_HANDLE hService, + DWORD dwControl, + LPSERVICE_STATUS lpServiceStatus + ); + +WINBOOL +STDCALL +DeleteService( + SC_HANDLE hService + ); + +SC_LOCK +STDCALL +LockServiceDatabase( + SC_HANDLE hSCManager + ); + + +WINBOOL +STDCALL +NotifyBootConfigStatus( + WINBOOL BootAcceptable + ); + +WINBOOL +STDCALL +QueryServiceObjectSecurity( + SC_HANDLE hService, + SECURITY_INFORMATION dwSecurityInformation, + PSECURITY_DESCRIPTOR lpSecurityDescriptor, + DWORD cbBufSize, + LPDWORD pcbBytesNeeded + ); + + +WINBOOL +STDCALL +QueryServiceStatus( + SC_HANDLE hService, + LPSERVICE_STATUS lpServiceStatus + ); + +WINBOOL +STDCALL +SetServiceObjectSecurity( + SC_HANDLE hService, + SECURITY_INFORMATION dwSecurityInformation, + PSECURITY_DESCRIPTOR lpSecurityDescriptor + ); + + +WINBOOL +STDCALL +SetServiceStatus( + SERVICE_STATUS_HANDLE hServiceStatus, + LPSERVICE_STATUS lpServiceStatus + ); + +WINBOOL +STDCALL +UnlockServiceDatabase( + SC_LOCK ScLock + ); + +/* Extensions to OpenGL */ + +int STDCALL +ChoosePixelFormat(HDC, CONST PIXELFORMATDESCRIPTOR *); + +int STDCALL +DescribePixelFormat(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR); + +UINT STDCALL +GetEnhMetaFilePixelFormat(HENHMETAFILE, DWORD, + CONST PIXELFORMATDESCRIPTOR *); + +int STDCALL +GetPixelFormat(HDC); + +WINBOOL STDCALL +SetPixelFormat(HDC, int, CONST PIXELFORMATDESCRIPTOR *); + +WINBOOL STDCALL +SwapBuffers(HDC); + +HGLRC STDCALL +wglCreateContext(HDC); + +HGLRC STDCALL +wglCreateLayerContext(HDC, int); + +WINBOOL STDCALL +wglCopyContext(HGLRC, HGLRC, UINT); + +WINBOOL STDCALL +wglDeleteContext(HGLRC); + +WINBOOL STDCALL +wglDescribeLayerPlane(HDC, int, int, UINT, LPLAYERPLANEDESCRIPTOR); + +HGLRC STDCALL +wglGetCurrentContext(VOID); + +HDC STDCALL +wglGetCurrentDC(VOID); + +int STDCALL +wglGetLayerPaletteEntries(HDC, int, int, int, CONST COLORREF *); + +PROC STDCALL +wglGetProcAddress(LPCSTR); + +WINBOOL STDCALL +wglMakeCurrent(HDC, HGLRC); + +WINBOOL STDCALL +wglRealizeLayerPalette(HDC, int, WINBOOL); + +int STDCALL +wglSetLayerPaletteEntries(HDC, int, int, int, CONST COLORREF *); + +WINBOOL STDCALL +wglShareLists(HGLRC, HGLRC); + +WINBOOL STDCALL +wglSwapLayerBuffers(HDC, UINT); + +/* + Why are these different between ANSI and UNICODE? + There doesn't seem to be any difference. + */ + +#ifdef UNICODE +#define wglUseFontBitmaps wglUseFontBitmapsW +#define wglUseFontOutlines wglUseFontOutlinesW +#else +#define wglUseFontBitmaps wglUseFontBitmapsA +#define wglUseFontOutlines wglUseFontOutlinesA +#endif /* !UNICODE */ + +/* ------------------------------------- */ +/* From shellapi.h in old Cygnus headers */ + +WINBOOL WINAPI +DragQueryPoint (HDROP, LPPOINT); + +void WINAPI +DragFinish (HDROP); + +void WINAPI +DragAcceptFiles (HWND, WINBOOL); + +HICON WINAPI +DuplicateIcon (HINSTANCE, HICON); + +/* end of stuff from shellapi.h in old Cygnus headers */ +/* -------------------------------------------------- */ +/* From ddeml.h in old Cygnus headers */ + +HCONV WINAPI DdeConnect (DWORD, HSZ, HSZ, CONVCONTEXT *); +WINBOOL WINAPI DdeDisconnect (HCONV); +WINBOOL WINAPI DdeFreeDataHandle (HDDEDATA); +DWORD WINAPI DdeGetData (HDDEDATA, BYTE *, DWORD, DWORD); +UINT WINAPI DdeGetLastError (DWORD); +HDDEDATA WINAPI DdeNameService (DWORD, HSZ, HSZ, UINT); +WINBOOL WINAPI DdePostAdvise (DWORD, HSZ, HSZ); +HCONV WINAPI DdeReconnect (HCONV); +WINBOOL WINAPI DdeUninitialize (DWORD); +int WINAPI DdeCmpStringHandles (HSZ, HSZ); +HDDEDATA WINAPI DdeCreateDataHandle (DWORD, LPBYTE, DWORD, DWORD, HSZ, + UINT, UINT); + +/* end of stuff from ddeml.h in old Cygnus headers */ +/* ----------------------------------------------- */ + +DWORD STDCALL NetUserEnum (LPWSTR, DWORD, DWORD, LPBYTE*, DWORD, LPDWORD, + LPDWORD, LPDWORD); +DWORD STDCALL NetApiBufferFree (LPVOID); +DWORD STDCALL NetUserGetInfo (LPWSTR, LPWSTR, DWORD, LPBYTE); +DWORD STDCALL NetGetDCName (LPWSTR, LPWSTR, LPBYTE*); +DWORD STDCALL NetGroupEnum (LPWSTR, DWORD, LPBYTE*, DWORD, LPDWORD, + LPDWORD, LPDWORD); +DWORD STDCALL NetLocalGroupEnum (LPWSTR, DWORD, LPBYTE*, DWORD, LPDWORD, + LPDWORD, LPDWORD); + + +VOID CopyMemory(PVOID Destination, CONST VOID* Source, DWORD Length); + +DWORD STDCALL GetCurrentTime(VOID); + +void WINAPI +SHAddToRecentDocs (UINT, LPCVOID); + +LPITEMIDLIST WINAPI +SHBrowseForFolder (LPBROWSEINFO); + +void WINAPI +SHChangeNotify (LONG, UINT, LPCVOID, LPCVOID); + +int WINAPI +SHFileOperation (LPSHFILEOPSTRUCT); + +void WINAPI +SHFreeNameMappings (HANDLE); + +/* Define when SHELLFOLDER is defined. +HRESULT WINAPI +SHGetDataFromIDList (LPSHELLFOLDER, LPCITEMIDLIST, int, PVOID, int); + +HRESULT WINAPI +SHGetDesktopFolder (LPSHELLFOLDER); +*/ + +DWORD WINAPI +SHGetFileInfo (LPCTSTR, DWORD, SHFILEINFO FAR *, UINT, UINT); + +/* Define when IUnknown is defined. +HRESULT WINAPI +SHGetInstanceExplorer (IUnknown **); +*/ + +/* Define when MALLOC is defined. +HRESULT WINAPI +SHGetMalloc (LPMALLOC *); +*/ + +WINBOOL WINAPI +SHGetPathFromIDList (LPCITEMIDLIST, LPTSTR); + +HRESULT WINAPI +SHGetSpecialFolderLocation (HWND, int, LPITEMIDLIST *); + +/* Define when REFCLSID is defined. +HRESULT WINAPI +SHLoadInProc (REFCLSID); +*/ + +/* Win32 Fibers */ + +typedef +VOID (WINAPI *PFIBER_START_ROUTINE) ( + IN LPVOID lpFiberArgument + ); +typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE; + +LPVOID +STDCALL +ConvertThreadToFiber ( + LPVOID lpArgument + ); +LPVOID +STDCALL +CreateFiber ( + DWORD dwStackSize, + LPFIBER_START_ROUTINE lpStartAddress, + LPVOID lpArgument + ); +VOID +STDCALL +DeleteFiber( + LPVOID lpFiber + ); +PVOID +STDCALL +GetCurrentFiber ( + VOID + ); +PVOID +STDCALL +GetFiberData ( + VOID + ); +VOID +STDCALL +SwitchToFiber ( + LPVOID lpFiber + ); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* WIN32_LEAN_AND_MEAN */ + +#endif /* _GNU_H_WINDOWS32_FUNCTIONS */ diff --git a/reactos/include/in.h b/reactos/include/in.h new file mode 100644 index 00000000000..a6d0b8579ea --- /dev/null +++ b/reactos/include/in.h @@ -0,0 +1,491 @@ +unsigned int wavelength=3891; + +unsigned char wave[]={ +0x52,0x49,0x46,0x46,0x2b,0xf,0x0,0x0, +0x57,0x41,0x56,0x45,0x66,0x6d,0x74,0x20, +0x10,0x0,0x0,0x0,0x1,0x0,0x1,0x0, +0x22,0x56,0x0,0x0,0x22,0x56,0x0,0x0, +0x1,0x0,0x8,0x0,0x64,0x61,0x74,0x61, +0x7,0xf,0x0,0x0,0x80,0xce,0xb2,0x53, +0x2e,0x75,0xca,0xbb,0x5d,0x2c,0x6a,0xc4, +0xc2,0x68,0x2c,0x5f,0xbd,0xc8,0x74,0x2e, +0x51,0xad,0xd0,0x8a,0x36,0x3f,0x98,0xd2, +0xa2,0x46,0x33,0x81,0xcd,0xb5,0x58,0x2d, +0x67,0xbe,0xc8,0x78,0x30,0x49,0xa3,0xd2, +0x9b,0x43,0x34,0x80,0xcc,0xb9,0x60,0x2c, +0x5e,0xb6,0xce,0x89,0x39,0x3b,0x8b,0xce, +0xb4,0x5c,0x2d,0x5e,0xb6,0xce,0x89,0x39, +0x3a,0x8b,0xce,0xb7,0x62,0x2d,0x54,0xaa, +0xd1,0x9b,0x46,0x31,0x74,0xc2,0xc7,0x7b, +0x34,0x41,0x94,0xcf,0xb3,0x61,0x2e,0x53, +0xa6,0xd1,0xa3,0x4f,0x2e,0x65,0xb7,0xce, +0x90,0x41,0x33,0x78,0xc3,0xc8,0x83,0x3a, +0x38,0x80,0xc6,0xc4,0x7d,0x36,0x3c,0x86, +0xc9,0xc0,0x76,0x34,0x40,0x8d,0xcb,0xbe, +0x74,0x34,0x3e,0x87,0xc9,0xc1,0x78,0x36, +0x3b,0x83,0xc7,0xc4,0x7e,0x39,0x39,0x7d, +0xc2,0xc9,0x8a,0x42,0x32,0x6a,0xb6,0xce, +0x9c,0x4f,0x2e,0x5b,0xa8,0xd0,0xab,0x5d, +0x2f,0x49,0x94,0xcb,0xbe,0x78,0x39,0x38, +0x77,0xbd,0xcc,0x95,0x4a,0x2f,0x5c,0xa7, +0xcf,0xb0,0x68,0x33,0x40,0x83,0xc3,0xc9, +0x8e,0x47,0x30,0x5c,0xa6,0xcf,0xb2,0x6b, +0x34,0x3e,0x7e,0xbf,0xcc,0x99,0x51,0x2f, +0x4f,0x96,0xcb,0xc1,0x81,0x40,0x32,0x64, +0xab,0xcf,0xb0,0x6c,0x36,0x39,0x74,0xb7, +0xce,0xa7,0x61,0x32,0x40,0x80,0xbe,0xcc, +0x9d,0x56,0x30,0x48,0x88,0xc3,0xca,0x99, +0x54,0x30,0x47,0x88,0xc2,0xca,0x98,0x55, +0x30,0x47,0x87,0xc1,0xca,0x9a,0x58,0x31, +0x42,0x80,0xbb,0xcd,0xa5,0x63,0x34,0x3b, +0x73,0xb3,0xce,0xb1,0x6f,0x39,0x36,0x66, +0xa6,0xcc,0xbe,0x84,0x47,0x30,0x50,0x8f, +0xc4,0xc9,0x9b,0x5c,0x33,0x3f,0x77,0xb4, +0xce,0xb2,0x77,0x40,0x32,0x57,0x96,0xc6, +0xc7,0x99,0x5a,0x33,0x3e,0x73,0xb0,0xcd, +0xb7,0x7e,0x45,0x31,0x4e,0x88,0xbe,0xcc, +0xa9,0x6c,0x3b,0x34,0x5d,0x99,0xc7,0xc7, +0x99,0x5d,0x35,0x3a,0x69,0xa3,0xca,0xc3, +0x93,0x58,0x33,0x3c,0x6e,0xa8,0xcb,0xc0, +0x8f,0x54,0x33,0x3f,0x6f,0xa8,0xcb,0xc1, +0x91,0x58,0x34,0x3b,0x69,0xa3,0xc9,0xc5, +0x98,0x5f,0x37,0x38,0x61,0x99,0xc4,0xc9, +0xa5,0x6d,0x3e,0x33,0x52,0x88,0xba,0xcc, +0xb3,0x80,0x4b,0x32,0x44,0x76,0xac,0xca, +0xc2,0x96,0x5f,0x38,0x36,0x5b,0x91,0xbf, +0xcb,0xaf,0x7b,0x49,0x32,0x44,0x75,0xa9, +0xc9,0xc4,0x9d,0x68,0x3d,0x34,0x50,0x83, +0xb5,0xcb,0xbc,0x8f,0x59,0x37,0x38,0x5d, +0x91,0xbd,0xcb,0xb6,0x85,0x53,0x35,0x3a, +0x60,0x94,0xbe,0xcb,0xb3,0x83,0x51,0x34, +0x3c,0x62,0x95,0xbe,0xcb,0xb6,0x87,0x56, +0x37,0x39,0x5a,0x8c,0xb9,0xcb,0xbb,0x90, +0x5d,0x3a,0x35,0x52,0x80,0xb0,0xc9,0xc3, +0x9f,0x6e,0x44,0x33,0x43,0x6d,0x9f,0xc2, +0xc9,0xaf,0x81,0x53,0x37,0x39,0x57,0x85, +0xb2,0xc9,0xc2,0x9f,0x6e,0x45,0x34,0x41, +0x68,0x98,0xbe,0xca,0xb8,0x8e,0x61,0x3d, +0x34,0x49,0x72,0xa1,0xc2,0xc9,0xb2,0x88, +0x5a,0x3b,0x36,0x4e,0x7a,0xa6,0xc4,0xc8, +0xb0,0x85,0x59,0x3b,0x36,0x4d,0x76,0xa3, +0xc3,0xc9,0xb3,0x89,0x5d,0x3d,0x35,0x49, +0x70,0x9c,0xbe,0xc9,0xba,0x96,0x6a,0x44, +0x35,0x40,0x61,0x8d,0xb4,0xc8,0xc2,0xa4, +0x7a,0x51,0x38,0x38,0x4f,0x78,0xa2,0xc0, +0xc9,0xb8,0x93,0x68,0x45,0x35,0x3f,0x5f, +0x89,0xaf,0xc6,0xc6,0xad,0x86,0x5e,0x3f, +0x35,0x43,0x66,0x8f,0xb4,0xc7,0xc3,0xa9, +0x81,0x58,0x3d,0x36,0x46,0x67,0x8f,0xb4, +0xc7,0xc4,0xab,0x85,0x5d,0x3f,0x36,0x43, +0x63,0x8a,0xb0,0xc5,0xc6,0xb1,0x8e,0x66, +0x46,0x36,0x3c,0x56,0x7d,0xa2,0xbf,0xc8, +0xbc,0x9c,0x77,0x51,0x3a,0x37,0x48,0x69, +0x8f,0xb2,0xc5,0xc5,0xb2,0x8f,0x69,0x48, +0x37,0x3b,0x51,0x75,0x9b,0xba,0xc7,0xc1, +0xaa,0x86,0x62,0x44,0x37,0x3d,0x55,0x79, +0x9d,0xba,0xc7,0xc1,0xa8,0x85,0x61,0x44, +0x37,0x3c,0x54,0x75,0x99,0xb7,0xc6,0xc3, +0xae,0x8e,0x69,0x4a,0x39,0x3a,0x4c,0x6b, +0x8f,0xaf,0xc3,0xc6,0xb8,0x9c,0x79,0x57, +0x3f,0x37,0x41,0x59,0x7c,0x9e,0xb9,0xc6, +0xc2,0xad,0x8e,0x6c,0x4d,0x3b,0x38,0x46, +0x61,0x82,0xa4,0xbc,0xc7,0xc0,0xaa,0x8a, +0x68,0x4b,0x3a,0x39,0x48,0x62,0x84,0xa4, +0xbc,0xc6,0xc1,0xad,0x8d,0x6d,0x4f,0x3c, +0x38,0x44,0x5d,0x7d,0x9d,0xb6,0xc5,0xc4, +0xb5,0x99,0x79,0x5b,0x43,0x38,0x3d,0x50, +0x6c,0x8c,0xab,0xbf,0xc6,0xbf,0xaa,0x8d, +0x6e,0x52,0x3e,0x38,0x41,0x56,0x73,0x92, +0xae,0xc1,0xc6,0xbc,0xa5,0x87,0x6a,0x4f, +0x3d,0x39,0x41,0x57,0x73,0x92,0xad,0xbf, +0xc5,0xbe,0xa9,0x8d,0x70,0x53,0x40,0x39, +0x3f,0x50,0x6b,0x88,0xa5,0xba,0xc5,0xc2, +0xb3,0x9a,0x7e,0x61,0x49,0x3b,0x3a,0x46, +0x5b,0x78,0x94,0xae,0xbf,0xc5,0xbe,0xad, +0x93,0x77,0x5b,0x46,0x3b,0x3b,0x47,0x5b, +0x77,0x92,0xac,0xbe,0xc5,0xc0,0xb1,0x9a, +0x7e,0x63,0x4c,0x3e,0x3a,0x41,0x52,0x6a, +0x85,0x9f,0xb4,0xc1,0xc4,0xbc,0xab,0x93, +0x79,0x5f,0x4a,0x3d,0x3a,0x42,0x53,0x6a, +0x82,0x9c,0xb1,0xc0,0xc4,0xbf,0xb0,0x9a, +0x80,0x68,0x51,0x42,0x3a,0x3d,0x48,0x5c, +0x73,0x8d,0xa4,0xb7,0xc2,0xc3,0xbc,0xac, +0x96,0x7e,0x67,0x51,0x42,0x3b,0x3d,0x48, +0x5a,0x70,0x88,0x9f,0xb2,0xbf,0xc3,0xbf, +0xb3,0xa1,0x89,0x72,0x5c,0x4a,0x3e,0x3b, +0x3f,0x4c,0x5e,0x75,0x8a,0xa1,0xb3,0xbf, +0xc3,0xbf,0xb5,0xa3,0x8e,0x77,0x61,0x4e, +0x41,0x3b,0x3d,0x46,0x55,0x69,0x80,0x95, +0xa9,0xb8,0xc1,0xc3,0xbd,0xb0,0x9f,0x8a, +0x75,0x61,0x4e,0x42,0x3c,0x3d,0x44,0x52, +0x65,0x7a,0x8e,0xa2,0xb2,0xbd,0xc2,0xc0, +0xb8,0xaa,0x98,0x83,0x6f,0x5c,0x4c,0x41, +0x3c,0x3d,0x45,0x52,0x63,0x77,0x8b,0x9e, +0xaf,0xbb,0xc1,0xc1,0xbc,0xb1,0xa1,0x8f, +0x7b,0x67,0x56,0x48,0x3f,0x3c,0x3f,0x47, +0x54,0x65,0x77,0x8a,0x9d,0xad,0xb9,0xc0, +0xc2,0xbe,0xb5,0xa7,0x97,0x83,0x72,0x60, +0x50,0x45,0x3e,0x3d,0x40,0x49,0x56,0x66, +0x78,0x8a,0x9c,0xab,0xb7,0xbf,0xc1,0xbf, +0xb8,0xac,0x9d,0x8c,0x7b,0x6a,0x59,0x4c, +0x43,0x3d,0x3d,0x42,0x4b,0x57,0x67,0x79, +0x89,0x9a,0xa8,0xb5,0xbd,0xc1,0xc0,0xbb, +0xb1,0xa5,0x95,0x84,0x74,0x63,0x56,0x4a, +0x42,0x3e,0x3e,0x43,0x4b,0x57,0x66,0x75, +0x85,0x95,0xa4,0xb0,0xba,0xbf,0xc0,0xbe, +0xb7,0xad,0xa0,0x92,0x81,0x72,0x63,0x55, +0x4a,0x42,0x3e,0x3e,0x42,0x48,0x53,0x60, +0x6e,0x7e,0x8d,0x9b,0xa9,0xb4,0xbb,0xbf, +0xc0,0xbd,0xb7,0xad,0xa1,0x93,0x84,0x75, +0x67,0x5a,0x4f,0x46,0x40,0x3e,0x3f,0x44, +0x4b,0x56,0x63,0x71,0x80,0x8d,0x9a,0xa7, +0xb1,0xb9,0xbe,0xc0,0xbe,0xb9,0xb2,0xa7, +0x9c,0x8e,0x80,0x73,0x65,0x59,0x4f,0x47, +0x41,0x3f,0x3f,0x43,0x49,0x53,0x5d,0x69, +0x76,0x84,0x91,0x9e,0xa9,0xb3,0xba,0xbe, +0xbf,0xbe,0xba,0xb3,0xaa,0xa0,0x93,0x86, +0x7a,0x6d,0x60,0x55,0x4d,0x46,0x41,0x3f, +0x40,0x44,0x49,0x51,0x5c,0x66,0x72,0x80, +0x8b,0x97,0xa2,0xac,0xb4,0xba,0xbd,0xbe, +0xbd,0xb9,0xb4,0xab,0xa1,0x96,0x8b,0x80, +0x73,0x68,0x5d,0x52,0x4b,0x45,0x41,0x40, +0x41,0x44,0x49,0x50,0x58,0x63,0x6e,0x7a, +0x85,0x90,0x9b,0xa5,0xae,0xb5,0xba,0xbd, +0xbe,0xbd,0xba,0xb4,0xae,0xa5,0x9b,0x91, +0x85,0x7b,0x70,0x65,0x5b,0x53,0x4b,0x46, +0x42,0x41,0x41,0x43,0x47,0x4c,0x54,0x5d, +0x67,0x71,0x7c,0x86,0x90,0x9a,0xa3,0xac, +0xb3,0xb8,0xbb,0xbd,0xbd,0xbb,0xb7,0xb2, +0xac,0xa3,0x9b,0x91,0x87,0x7d,0x72,0x69, +0x5f,0x57,0x50,0x4a,0x45,0x42,0x41,0x42, +0x43,0x47,0x4c,0x53,0x5b,0x63,0x6c,0x76, +0x80,0x88,0x93,0x9c,0xa4,0xab,0xb1,0xb6, +0xba,0xbc,0xbd,0xbc,0xb9,0xb5,0xb0,0xaa, +0xa2,0x9a,0x91,0x87,0x80,0x76,0x6c,0x63, +0x5c,0x55,0x4e,0x49,0x45,0x43,0x42,0x42, +0x44,0x47,0x4b,0x50,0x57,0x5e,0x66,0x6f, +0x78,0x80,0x89,0x92,0x9a,0xa2,0xa8,0xae, +0xb4,0xb7,0xba,0xbc,0xbc,0xbb,0xb8,0xb5, +0xb0,0xab,0xa4,0x9d,0x95,0x8d,0x85,0x7c, +0x74,0x6c,0x64,0x5c,0x56,0x51,0x4c,0x48, +0x45,0x43,0x43,0x43,0x45,0x48,0x4b,0x50, +0x56,0x5d,0x63,0x6b,0x73,0x7b,0x82,0x8a, +0x92,0x99,0xa0,0xa7,0xac,0xb1,0xb5,0xb8, +0xba,0xbb,0xbb,0xba,0xb8,0xb4,0xb1,0xac, +0xa6,0xa0,0x9a,0x92,0x8b,0x83,0x7c,0x75, +0x6d,0x66,0x60,0x5a,0x54,0x4f,0x4b,0x48, +0x45,0x44,0x43,0x44,0x45,0x47,0x4a,0x4e, +0x53,0x58,0x5e,0x64,0x6b,0x72,0x79,0x80, +0x87,0x8d,0x94,0x9b,0xa1,0xa6,0xac,0xaf, +0xb3,0xb6,0xb8,0xba,0xba,0xba,0xb9,0xb7, +0xb4,0xb0,0xad,0xa8,0xa2,0x9d,0x97,0x90, +0x8a,0x83,0x7d,0x76,0x70,0x69,0x64,0x5d, +0x59,0x53,0x50,0x4c,0x49,0x47,0x45,0x44, +0x44,0x45,0x46,0x48,0x4b,0x4f,0x52,0x57, +0x5c,0x61,0x67,0x6c,0x72,0x79,0x80,0x85, +0x8b,0x91,0x96,0x9c,0xa2,0xa7,0xab,0xaf, +0xb2,0xb5,0xb7,0xb8,0xb9,0xb9,0xb9,0xb8, +0xb6,0xb4,0xb1,0xae,0xaa,0xa6,0xa1,0x9c, +0x96,0x91,0x8c,0x86,0x80,0x7a,0x75,0x6f, +0x6a,0x64,0x5f,0x5b,0x56,0x52,0x4f,0x4c, +0x4a,0x48,0x46,0x46,0x45,0x46,0x47,0x48, +0x4a,0x4c,0x4f,0x52,0x56,0x5a,0x5e,0x63, +0x68,0x6e,0x72,0x78,0x7d,0x82,0x88,0x8c, +0x92,0x97,0x9b,0xa0,0xa4,0xa8,0xac,0xaf, +0xb1,0xb3,0xb6,0xb7,0xb8,0xb8,0xb8,0xb7, +0xb6,0xb5,0xb3,0xb0,0xad,0xaa,0xa7,0xa3, +0x9f,0x9b,0x97,0x92,0x8c,0x87,0x82,0x7f, +0x7a,0x75,0x70,0x6b,0x66,0x62,0x5e,0x5a, +0x56,0x54,0x51,0x4e,0x4c,0x4a,0x49,0x47, +0x47,0x47,0x47,0x47,0x48,0x4a,0x4b,0x4d, +0x50,0x53,0x55,0x59,0x5d,0x61,0x64,0x68, +0x6d,0x71,0x76,0x7b,0x7f,0x82,0x87,0x8b, +0x90,0x95,0x98,0x9c,0xa0,0xa3,0xa7,0xaa, +0xad,0xaf,0xb1,0xb3,0xb4,0xb5,0xb6,0xb7, +0xb7,0xb6,0xb6,0xb5,0xb3,0xb2,0xb0,0xad, +0xab,0xa8,0xa5,0xa2,0x9e,0x9a,0x96,0x93, +0x8e,0x8a,0x86,0x81,0x7f,0x7a,0x76,0x72, +0x6d,0x6a,0x65,0x62,0x5e,0x5b,0x58,0x55, +0x53,0x50,0x4e,0x4c,0x4b,0x4a,0x49,0x48, +0x48,0x48,0x49,0x49,0x4a,0x4b,0x4d,0x4f, +0x51,0x54,0x56,0x59,0x5c,0x5f,0x63,0x66, +0x6a,0x6e,0x72,0x76,0x7a,0x7e,0x80,0x85, +0x89,0x8d,0x90,0x94,0x98,0x9c,0x9f,0xa2, +0xa5,0xa7,0xaa,0xac,0xae,0xb0,0xb2,0xb3, +0xb4,0xb5,0xb5,0xb5,0xb5,0xb5,0xb4,0xb3, +0xb2,0xb0,0xaf,0xad,0xab,0xa8,0xa6,0xa3, +0xa0,0x9d,0x9a,0x96,0x93,0x8f,0x8c,0x88, +0x84,0x80,0x7e,0x7a,0x76,0x72,0x6f,0x6b, +0x68,0x65,0x62,0x5f,0x5c,0x59,0x57,0x54, +0x52,0x50,0x4f,0x4d,0x4c,0x4b,0x4a,0x4a, +0x4a,0x4a,0x4a,0x4a,0x4b,0x4c,0x4d,0x4f, +0x50,0x52,0x54,0x56,0x59,0x5c,0x5e,0x61, +0x64,0x67,0x6a,0x6d,0x71,0x74,0x77,0x7b, +0x7f,0x81,0x84,0x88,0x8b,0x8e,0x92,0x95, +0x98,0x9b,0x9e,0xa1,0xa3,0xa5,0xa8,0xaa, +0xac,0xad,0xaf,0xb0,0xb1,0xb2,0xb3,0xb3, +0xb3,0xb3,0xb3,0xb3,0xb2,0xb2,0xb1,0xb0, +0xae,0xac,0xab,0xa9,0xa7,0xa4,0xa2,0xa0, +0x9d,0x9a,0x97,0x95,0x91,0x8f,0x8b,0x89, +0x85,0x82,0x80,0x7d,0x79,0x76,0x73,0x70, +0x6d,0x6a,0x68,0x65,0x62,0x5f,0x5d,0x5b, +0x59,0x56,0x55,0x53,0x51,0x50,0x4f,0x4e, +0x4d,0x4c,0x4c,0x4c,0x4b,0x4b,0x4c,0x4c, +0x4d,0x4e,0x4e,0x50,0x51,0x53,0x54,0x56, +0x58,0x5a,0x5b,0x5d,0x60,0x63,0x65,0x68, +0x6a,0x6d,0x70,0x73,0x76,0x78,0x7c,0x7f, +0x80,0x84,0x87,0x89,0x8c,0x8f,0x92,0x94, +0x97,0x99,0x9c,0x9e,0xa0,0xa2,0xa5,0xa6, +0xa8,0xaa,0xab,0xad,0xae,0xaf,0xaf,0xb0, +0xb1,0xb1,0xb2,0xb2,0xb2,0xb1,0xb1,0xb1, +0xb0,0xaf,0xae,0xad,0xac,0xab,0xa9,0xa8, +0xa5,0xa4,0xa2,0xa0,0x9e,0x9c,0x99,0x97, +0x95,0x92,0x90,0x8d,0x8b,0x88,0x86,0x82, +0x80,0x7e,0x7b,0x78,0x76,0x73,0x71,0x6e, +0x6c,0x69,0x67,0x65,0x63,0x60,0x5e,0x5d, +0x5b,0x59,0x57,0x56,0x54,0x53,0x52,0x51, +0x50,0x50,0x4f,0x4e,0x4e,0x4e,0x4d,0x4d, +0x4e,0x4e,0x4e,0x4f,0x4f,0x50,0x51,0x52, +0x53,0x54,0x56,0x57,0x58,0x5a,0x5c,0x5e, +0x60,0x62,0x63,0x65,0x67,0x6a,0x6c,0x6f, +0x71,0x73,0x75,0x78,0x7a,0x7d,0x7f,0x80, +0x83,0x85,0x88,0x8a,0x8c,0x8f,0x91,0x93, +0x95,0x97,0x99,0x9b,0x9d,0x9f,0xa1,0xa2, +0xa4,0xa5,0xa7,0xa8,0xa9,0xaa,0xab,0xac, +0xad,0xae,0xae,0xaf,0xaf,0xaf,0xaf,0xaf, +0xaf,0xaf,0xaf,0xae,0xae,0xad,0xad,0xac, +0xab,0xaa,0xa9,0xa8,0xa7,0xa5,0xa4,0xa3, +0xa1,0x9f,0x9e,0x9c,0x9a,0x98,0x96,0x95, +0x92,0x91,0x8e,0x8c,0x8a,0x88,0x86,0x84, +0x81,0x80,0x7e,0x7c,0x7a,0x78,0x75,0x73, +0x71,0x6f,0x6d,0x6b,0x6a,0x67,0x66,0x64, +0x63,0x61,0x5f,0x5e,0x5c,0x5b,0x5a,0x58, +0x57,0x56,0x55,0x54,0x53,0x53,0x52,0x51, +0x51,0x50,0x50,0x50,0x50,0x50,0x50,0x50, +0x50,0x50,0x51,0x51,0x52,0x53,0x53,0x54, +0x55,0x56,0x57,0x58,0x59,0x5a,0x5c,0x5d, +0x5f,0x60,0x61,0x63,0x64,0x66,0x68,0x69, +0x6c,0x6d,0x6f,0x71,0x73,0x74,0x77,0x78, +0x7a,0x7c,0x7e,0x80,0x81,0x83,0x84,0x87, +0x88,0x8a,0x8c,0x8e,0x8f,0x92,0x93,0x94, +0x96,0x98,0x99,0x9b,0x9d,0x9e,0x9f,0xa0, +0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9, +0xa9,0xaa,0xaa,0xab,0xac,0xac,0xac,0xac, +0xad,0xad,0xad,0xad,0xad,0xac,0xac,0xac, +0xac,0xab,0xab,0xaa,0xaa,0xa9,0xa8,0xa7, +0xa6,0xa6,0xa5,0xa4,0xa2,0xa1,0xa0,0x9f, +0x9e,0x9d,0x9b,0x99,0x98,0x97,0x95,0x94, +0x93,0x90,0x8f,0x8d,0x8c,0x8a,0x89,0x87, +0x86,0x83,0x82,0x80,0x80,0x7e,0x7c,0x7b, +0x79,0x78,0x76,0x75,0x72,0x71,0x6f,0x6e, +0x6c,0x6b,0x6a,0x68,0x67,0x66,0x64,0x63, +0x62,0x61,0x60,0x5e,0x5d,0x5c,0x5b,0x5a, +0x59,0x59,0x58,0x57,0x56,0x56,0x55,0x55, +0x54,0x54,0x54,0x53,0x53,0x53,0x53,0x53, +0x53,0x53,0x53,0x53,0x53,0x54,0x54,0x54, +0x55,0x55,0x56,0x56,0x56,0x57,0x58,0x59, +0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,0x60, +0x61,0x62,0x64,0x64,0x65,0x67,0x68,0x69, +0x6b,0x6c,0x6e,0x6f,0x70,0x71,0x73,0x74, +0x76,0x77,0x79,0x7a,0x7c,0x7d,0x7e,0x80, +0x80,0x82,0x83,0x85,0x86,0x88,0x89,0x8a, +0x8b,0x8d,0x8e,0x90,0x91,0x92,0x93,0x94, +0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d, +0x9e,0x9f,0xa0,0xa1,0xa2,0xa2,0xa3,0xa4, +0xa5,0xa5,0xa6,0xa6,0xa7,0xa7,0xa8,0xa8, +0xa8,0xa9,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa, +0xaa,0xa9,0xa9,0xa9,0xa9,0xa9,0xa9,0xa8, +0xa8,0xa8,0xa7,0xa7,0xa6,0xa6,0xa5,0xa4, +0xa4,0xa3,0xa2,0xa1,0xa1,0xa0,0x9f,0x9e, +0x9d,0x9d,0x9c,0x9a,0x99,0x99,0x97,0x96, +0x95,0x94,0x93,0x92,0x90,0x8f,0x8e,0x8d, +0x8c,0x8a,0x89,0x88,0x87,0x85,0x84,0x83, +0x81,0x80,0x80,0x7f,0x7d,0x7d,0x7b,0x7a, +0x78,0x77,0x76,0x75,0x74,0x73,0x71,0x70, +0x6f,0x6e,0x6c,0x6c,0x6b,0x69,0x68,0x68, +0x66,0x65,0x65,0x64,0x63,0x62,0x61,0x60, +0x5f,0x5f,0x5e,0x5d,0x5d,0x5c,0x5b,0x5b, +0x5a,0x5a,0x59,0x59,0x58,0x58,0x58,0x57, +0x57,0x57,0x57,0x57,0x56,0x56,0x56,0x56, +0x56,0x56,0x56,0x57,0x57,0x57,0x57,0x57, +0x58,0x58,0x58,0x59,0x59,0x5a,0x5a,0x5a, +0x5b,0x5c,0x5c,0x5d,0x5d,0x5e,0x5f,0x5f, +0x60,0x61,0x62,0x63,0x64,0x64,0x65,0x66, +0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e, +0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76, +0x77,0x78,0x7a,0x7b,0x7c,0x7d,0x7e,0x80, +0x80,0x81,0x81,0x83,0x84,0x85,0x86,0x87, +0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x96, +0x98,0x98,0x99,0x9a,0x9b,0x9b,0x9c,0x9d, +0x9d,0x9e,0x9f,0x9f,0xa0,0xa0,0xa1,0xa1, +0xa2,0xa2,0xa3,0xa3,0xa3,0xa4,0xa4,0xa4, +0xa5,0xa5,0xa5,0xa5,0xa5,0xa5,0xa6,0xa6, +0xa6,0xa6,0xa6,0xa6,0xa6,0xa5,0xa5,0xa5, +0xa5,0xa5,0xa5,0xa4,0xa4,0xa4,0xa3,0xa3, +0xa3,0xa2,0xa2,0xa1,0xa1,0xa0,0xa0,0x9f, +0x9f,0x9e,0x9e,0x9d,0x9d,0x9c,0x9b,0x9a, +0x9a,0x99,0x98,0x97,0x97,0x96,0x95,0x95, +0x93,0x93,0x92,0x91,0x90,0x8f,0x8e,0x8d, +0x8d,0x8c,0x8b,0x8a,0x89,0x88,0x87,0x86, +0x85,0x84,0x83,0x82,0x81,0x80,0x80,0x80, +0x7e,0x7e,0x7d,0x7c,0x7b,0x7a,0x79,0x78, +0x77,0x76,0x75,0x74,0x74,0x73,0x72,0x71, +0x70,0x70,0x6e,0x6e,0x6d,0x6c,0x6b,0x6a, +0x6a,0x69,0x68,0x67,0x67,0x66,0x65,0x65, +0x64,0x64,0x63,0x62,0x62,0x62,0x61,0x61, +0x60,0x60,0x5f,0x5f,0x5e,0x5e,0x5d,0x5d, +0x5d,0x5d,0x5c,0x5c,0x5c,0x5c,0x5b,0x5b, +0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b, +0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b, +0x5b,0x5c,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d, +0x5e,0x5e,0x5e,0x5f,0x5f,0x60,0x60,0x60, +0x61,0x61,0x62,0x62,0x63,0x63,0x64,0x64, +0x65,0x65,0x66,0x67,0x67,0x68,0x69,0x69, +0x6a,0x6b,0x6b,0x6c,0x6d,0x6d,0x6e,0x6f, +0x70,0x70,0x71,0x72,0x73,0x73,0x74,0x75, +0x76,0x77,0x77,0x78,0x79,0x7a,0x7b,0x7b, +0x7c,0x7d,0x7e,0x7e,0x80,0x80,0x80,0x81, +0x82,0x82,0x83,0x84,0x85,0x85,0x86,0x87, +0x88,0x88,0x89,0x8a,0x8b,0x8b,0x8c,0x8d, +0x8d,0x8e,0x8f,0x90,0x90,0x91,0x92,0x92, +0x93,0x93,0x94,0x95,0x95,0x96,0x96,0x97, +0x97,0x98,0x99,0x99,0x99,0x9a,0x9a,0x9b, +0x9b,0x9b,0x9c,0x9c,0x9d,0x9d,0x9d,0x9e, +0x9e,0x9e,0x9e,0x9f,0x9f,0x9f,0x9f,0xa0, +0xa0,0xa0,0xa0,0xa0,0xa0,0xa1,0xa1,0xa1, +0xa1,0xa1,0xa1,0xa1,0xa1,0xa1,0xa1,0xa1, +0xa1,0xa1,0xa1,0xa1,0xa0,0xa0,0xa0,0xa0, +0xa0,0xa0,0x9f,0x9f,0x9f,0x9f,0x9f,0x9e, +0x9e,0x9e,0x9d,0x9d,0x9d,0x9c,0x9c,0x9c, +0x9b,0x9b,0x9a,0x9a,0x9a,0x99,0x99,0x98, +0x98,0x97,0x97,0x96,0x96,0x95,0x95,0x94, +0x94,0x93,0x93,0x92,0x92,0x91,0x90,0x90, +0x8f,0x8f,0x8e,0x8d,0x8d,0x8c,0x8c,0x8b, +0x8a,0x8a,0x89,0x88,0x88,0x87,0x87,0x86, +0x85,0x85,0x84,0x83,0x83,0x82,0x81,0x81, +0x80,0x80,0x80,0x7f,0x7e,0x7e,0x7d,0x7d, +0x7c,0x7b,0x7a,0x7a,0x79,0x79,0x78,0x78, +0x77,0x76,0x75,0x75,0x74,0x74,0x73,0x73, +0x72,0x72,0x71,0x71,0x70,0x6f,0x6f,0x6e, +0x6e,0x6d,0x6d,0x6c,0x6c,0x6b,0x6b,0x6a, +0x6a,0x69,0x69,0x69,0x68,0x68,0x68,0x67, +0x67,0x66,0x66,0x65,0x65,0x65,0x65,0x64, +0x64,0x64,0x63,0x63,0x63,0x63,0x62,0x62, +0x62,0x62,0x62,0x61,0x61,0x61,0x61,0x61, +0x61,0x61,0x60,0x60,0x60,0x60,0x60,0x60, +0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, +0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x61, +0x61,0x61,0x61,0x61,0x61,0x62,0x62,0x62, +0x62,0x62,0x63,0x63,0x63,0x63,0x64,0x64, +0x64,0x64,0x65,0x65,0x65,0x66,0x66,0x66, +0x66,0x67,0x67,0x67,0x68,0x68,0x69,0x69, +0x69,0x6a,0x6a,0x6b,0x6b,0x6b,0x6c,0x6c, +0x6d,0x6d,0x6e,0x6e,0x6e,0x6f,0x6f,0x70, +0x70,0x71,0x71,0x72,0x72,0x73,0x73,0x74, +0x74,0x75,0x75,0x76,0x76,0x77,0x77,0x78, +0x78,0x79,0x79,0x7a,0x7a,0x7b,0x7b,0x7c, +0x7c,0x7d,0x7d,0x7e,0x7e,0x7f,0x80,0x80, +0x80,0x80,0x81,0x81,0x82,0x82,0x83,0x83, +0x84,0x84,0x84,0x85,0x85,0x86,0x86,0x87, +0x87,0x88,0x88,0x89,0x89,0x8a,0x8a,0x8b, +0x8b,0x8b,0x8c,0x8c,0x8d,0x8d,0x8e,0x8e, +0x8e,0x8e,0x8f,0x8f,0x90,0x90,0x91,0x91, +0x91,0x92,0x92,0x92,0x93,0x93,0x93,0x94, +0x94,0x94,0x94,0x95,0x95,0x95,0x96,0x96, +0x96,0x96,0x97,0x97,0x97,0x97,0x98,0x98, +0x98,0x98,0x98,0x99,0x99,0x99,0x99,0x99, +0x99,0x9a,0x9a,0x9a,0x9a,0x9a,0x9a,0x9a, +0x9a,0x9a,0x9a,0x9b,0x9b,0x9b,0x9b,0x9b, +0x9b,0x9b,0x9b,0x9b,0x9b,0x9b,0x9b,0x9b, +0x9b,0x9b,0x9b,0x9b,0x9b,0x9a,0x9a,0x9a, +0x9a,0x9a,0x9a,0x9a,0x9a,0x9a,0x9a,0x9a, +0x99,0x99,0x99,0x99,0x99,0x99,0x98,0x98, +0x98,0x98,0x98,0x98,0x97,0x97,0x97,0x97, +0x96,0x96,0x96,0x96,0x96,0x95,0x95,0x95, +0x94,0x94,0x94,0x94,0x94,0x93,0x93,0x93, +0x92,0x92,0x92,0x91,0x91,0x91,0x90,0x90, +0x90,0x90,0x8f,0x8f,0x8e,0x8e,0x8e,0x8e, +0x8d,0x8d,0x8c,0x8c,0x8c,0x8b,0x8b,0x8b, +0x8a,0x8a,0x89,0x89,0x89,0x89,0x88,0x88, +0x87,0x87,0x86,0x86,0x86,0x85,0x85,0x85, +0x84,0x84,0x84,0x83,0x83,0x82,0x82,0x82, +0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80, +0x7f,0x7f,0x7f,0x7e,0x7e,0x7d,0x7d,0x7d, +0x7c,0x7c,0x7b,0x7b,0x7b,0x7b,0x7a,0x7a, +0x79,0x79,0x79,0x78,0x78,0x77,0x77,0x77, +0x77,0x76,0x76,0x75,0x75,0x75,0x75,0x74, +0x74,0x74,0x73,0x73,0x73,0x72,0x72,0x72, +0x72,0x71,0x71,0x71,0x70,0x70,0x70,0x6f, +0x6f,0x6f,0x6f,0x6e,0x6e,0x6e,0x6e,0x6e, +0x6d,0x6d,0x6d,0x6d,0x6c,0x6c,0x6c,0x6c, +0x6c,0x6b,0x6b,0x6b,0x6b,0x6b,0x6a,0x6a, +0x6a,0x6a,0x6a,0x6a,0x6a,0x69,0x69,0x69, +0x69,0x69,0x69,0x69,0x69,0x68,0x68,0x68, +0x68,0x68,0x68,0x68,0x68,0x68,0x68,0x68, +0x68,0x67,0x67,0x67,0x67,0x67,0x67,0x67, +0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67, +0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67, +0x67,0x67,0x67,0x67,0x68,0x68,0x68,0x68, +0x68,0x68,0x68,0x68,0x68,0x68,0x68,0x68, +0x68,0x69,0x69,0x69,0x69,0x69,0x69,0x69, +0x69,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a, +0x6b,0x6b,0x6b,0x6b,0x6b,0x6b,0x6c,0x6c, +0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6d,0x6d, +0x6d,0x6e,0x6e,0x6e,0x6e,0x6e,0x6f,0x6f, +0x6f,0x6f,0x6f,0x70,0x70,0x70,0x70,0x71, +0x71,0x71,0x71,0x72,0x72,0x72,0x72,0x73, +0x73,0x73,0x73,0x73,0x74,0x74,0x74,0x74, +0x75,0x75,0x75,0x76,0x76,0x76,0x76,0x77, +0x77,0x77,0x77,0x77,0x78,0x78,0x79,0x79, +0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b, +0x7b,0x7b,0x7c,0x7c,0x7c,0x7c,0x7c,0x7d, +0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f, +0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +0x80,0x80,0x81,0x81,0x81,0x82,0x82,0x82, +0x82,0x82,0x83,0x83,0x83,0x83,0x84,0x84, +0x84,0x84,0x84,0x85,0x85,0x85,0x86,0x86, +0x86,0x86,0x87,0x87,0x87,0x87,0x87,0x88, +0x88,0x88,0x88,0x88,0x89,0x89,0x89,0x89, +0x89,0x89,0x8a,0x8a,0x8a,0x8a,0x8b,0x8b, +0x8b,0x8b,0x8b,0x8b,0x8b,0x8c,0x8c,0x8c, +0x8c,0x8d,0x8d,0x8d,0x8d,0x8d,0x8d,0x8d, +0x8d,0x8e,0x8e,0x8e,0x8e,0x8e,0x8e,0x8e, +0x8f,0x8f,0x8f,0x8f,0x8f,0x8f,0x8f,0x8f, +0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, +0x90,0x90,0x90,0x91,0x91,0x91,0x91,0x91, +0x91,0x91,0x91,0x91,0x91,0x91,0x91,0x91, +0x92,0x91,0x92,0x92,0x92,0x92,0x92,0x92, +0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92, +0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92, +0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92, +0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92, +0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92, +0x91,0x91,0x91,0x91,0x91,0x91,0x91,0x91, +0x91,0x91,0x91,0x91,0x91,0x91,0x91,0x91, +0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, +0x90,0x90,0x90,0x90,0x8f,0x8f,0x8f,0x8f, +0x8f,0x8f,0x8f,0x8f,0x8f,0x8e,0x8e,0x8e, +0x8e,0x8e,0x8e,0x8e,0x8e,0x8e,0x8d,0x8d, +0x8d,0x8d,0x8d,0x8d,0x8d,0x8d,0x8d,0x8c, +0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8b,0x8b, +0x8b,0x8b,0x8b,0x8b,0x8b,0x8a,0x8a,0x8a, +0x8a,0x8a,0x8a,0x8a,0x89,0x89,0x89,0x89, +0x89,0x89,0x88,0x88,0x88,0x88,0x88,0x88, +0x88,0x87,0x87,0x87,0x87,0x87,0x86,0x86, +0x86,0x86,0x86,0x86,0x86,0x86,0x85,0x85, +0x85,0x85,0x85,0x84,0x84,0x84,0x84,0x84, +0x84,0x84,0x84,0x83,0x83,0x83,0x83,0x83, +0x83,0x82,0x82,0x82,0x82,0x82,0x81,0x81, +0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80, +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f, +0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7d, +0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d, +0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d, +0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d, +0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7d, +0x7d,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e, +0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f, +0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80, +}; diff --git a/reactos/include/kernel32/error.h b/reactos/include/kernel32/error.h index 9806a6d1ced..de79ef87616 100644 --- a/reactos/include/kernel32/error.h +++ b/reactos/include/kernel32/error.h @@ -1,8 +1,8 @@ #ifndef _INCLUDE_KERNEL32_H #define _INCLUDE_KERNEL32_H -/* $Id: error.h,v 1.2 2002/09/07 15:12:16 chorns Exp $ */ +/* $Id: error.h,v 1.3 2002/09/08 10:22:30 chorns Exp $ */ #include -#define NTOS_USER_MODE +#define NTOS_MODE_USER #include DWORD STDCALL diff --git a/reactos/include/kernel32/heap.h b/reactos/include/kernel32/heap.h index d3a28b58025..6a1de987aa5 100644 --- a/reactos/include/kernel32/heap.h +++ b/reactos/include/kernel32/heap.h @@ -13,8 +13,7 @@ /* System library's private includes ***************************************/ -#define NTOS_USER_MODE -#include +#include /* definitions */ #define HEAP_ADMIN_SIZE (sizeof(HEAP_BLOCK)) diff --git a/reactos/include/kernel32/kernel32.h b/reactos/include/kernel32/kernel32.h index 088bd8214f2..1db3e0fc20c 100644 --- a/reactos/include/kernel32/kernel32.h +++ b/reactos/include/kernel32/kernel32.h @@ -33,7 +33,7 @@ extern WINBOOL bIsFileApiAnsi; extern HANDLE hProcessHeap; extern HANDLE hBaseDir; -extern RTL_CRITICAL_SECTION DllLock; +extern CRITICAL_SECTION DllLock; /* FUNCTION PROTOTYPES *******************************************************/ diff --git a/reactos/include/lsass/lsass.h b/reactos/include/lsass/lsass.h index aa42e230512..b5c303adcc9 100644 --- a/reactos/include/lsass/lsass.h +++ b/reactos/include/lsass/lsass.h @@ -1,4 +1,4 @@ -/* $Id: lsass.h,v 1.2 2002/09/07 15:12:16 chorns Exp $ +/* $Id: lsass.h,v 1.3 2002/09/08 10:22:30 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,9 +11,9 @@ #ifndef __INCLUDE_LSASS_LSASS_H #define __INCLUDE_LSASS_LSASS_H -#define NTOS_USER_MODE #include #include +#include #define LSASS_REQUEST_REGISTER_LOGON_PROCESS (1) #define LSASS_REQUEST_CALL_AUTHENTICATION_PACKAGE (2) @@ -69,7 +69,7 @@ typedef struct _LSASS_LOGON_USER_REQUEST PVOID AuthenticationInformation; ULONG AuthenticationInformationLength; ULONG LocalGroupsCount; - PSID_AND_ATTRIBUTES_ARRAY LocalGroups; + PSID_AND_ATTRIBUTES LocalGroups; TOKEN_SOURCE SourceContext; UCHAR Data[1]; } LSASS_LOGON_USER_REQUEST, *PLSASS_LOGON_USER_REQUEST; @@ -98,7 +98,7 @@ typedef struct _LSASS_REGISTER_LOGON_PROCESS_REPLY typedef struct _LSASS_REQUEST { - LPC_MESSAGE Header; + LPC_MESSAGE_HEADER Header; ULONG Type; union { @@ -114,7 +114,7 @@ typedef struct _LSASS_REQUEST typedef struct _LSASS_REPLY { - LPC_MESSAGE Header; + LPC_MESSAGE_HEADER Header; NTSTATUS Status; union { diff --git a/reactos/include/messages.h b/reactos/include/messages.h new file mode 100644 index 00000000000..a2e5745419b --- /dev/null +++ b/reactos/include/messages.h @@ -0,0 +1,1099 @@ +/* + Messages.h + + Windows32 API message definitions + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + + This file is part of the Windows32 API Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + If you are interested in a warranty or support for this source code, + contact Scott Christley for more information. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +/* WARNING: This file is automatically generated. */ + +#ifndef _GNU_H_WINDOWS32_MESSAGES +#define _GNU_H_WINDOWS32_MESSAGES + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +/* Application bar */ + +/* Application bar notifications */ + +/* Animation Control */ +#define ACM_OPENW (1127) +#define ACM_OPENA (1124) +#ifdef UNICODE +#define ACM_OPEN ACM_OPENW +#else +#define ACM_OPEN ACM_OPENA +#endif /* UNICODE */ +#define ACM_PLAY (1125) +#define ACM_STOP (1126) +#define ACN_START (1) +#define ACN_STOP (2) + +/* Buttons */ +#define BM_CLICK (245) +#define BM_GETCHECK (240) +#define BM_GETIMAGE (246) +#define BM_GETSTATE (242) +#define BM_SETCHECK (241) +#define BM_SETIMAGE (247) +#define BM_SETSTATE (243) +#define BM_SETSTYLE (244) +#define BN_CLICKED (0) +#define BN_DBLCLK (5) +#define BN_DISABLE (4) +#define BN_DOUBLECLICKED (5) +#define BN_HILITE (2) +#define BN_KILLFOCUS (7) +#define BN_PAINT (1) +#define BN_PUSHED (2) +#define BN_SETFOCUS (6) +#define BN_UNHILITE (3) +#define BN_UNPUSHED (3) + +/* Combo Box */ +#define CB_ADDSTRING (323) +#define CB_DELETESTRING (324) +#define CB_DIR (325) +#define CB_FINDSTRING (332) +#define CB_FINDSTRINGEXACT (344) +#define CB_GETCOUNT (326) +#define CB_GETCURSEL (327) +#define CB_GETDROPPEDCONTROLRECT (338) +#define CB_GETDROPPEDSTATE (343) +#define CB_GETDROPPEDWIDTH (351) +#define CB_GETEDITSEL (320) +#define CB_GETEXTENDEDUI (342) +#define CB_GETHORIZONTALEXTENT (349) +#define CB_GETITEMDATA (336) +#define CB_GETITEMHEIGHT (340) +#define CB_GETLBTEXT (328) +#define CB_GETLBTEXTLEN (329) +#define CB_GETLOCALE (346) +#define CB_GETTOPINDEX (347) +#define CB_INITSTORAGE (353) +#define CB_INSERTSTRING (330) +#define CB_LIMITTEXT (321) +#define CB_RESETCONTENT (331) +#define CB_SELECTSTRING (333) +#define CB_SETCURSEL (334) +#define CB_SETDROPPEDWIDTH (352) +#define CB_SETEDITSEL (322) +#define CB_SETEXTENDEDUI (341) +#define CB_SETHORIZONTALEXTENT (350) +#define CB_SETITEMDATA (337) +#define CB_SETITEMHEIGHT (339) +#define CB_SETLOCALE (345) +#define CB_SETTOPINDEX (348) +#define CB_SHOWDROPDOWN (335) + +/* Combo Box notifications */ +#define CBN_CLOSEUP (8) +#define CBN_DBLCLK (2) +#define CBN_DROPDOWN (7) +#define CBN_EDITCHANGE (5) +#define CBN_EDITUPDATE (6) +#define CBN_ERRSPACE (-1) +#define CBN_KILLFOCUS (4) +#define CBN_SELCHANGE (1) +#define CBN_SELENDCANCEL (10) +#define CBN_SELENDOK (9) +#define CBN_SETFOCUS (3) + +/* Control Panel */ + +/* Device messages */ + +/* Drag list box */ +#define DL_BEGINDRAG (1157) +#define DL_CANCELDRAG (1160) +#define DL_DRAGGING (1158) +#define DL_DROPPED (1159) + +/* Default push button */ +#define DM_GETDEFID (1024) +#define DM_REPOSITION (1026) +#define DM_SETDEFID (1025) + +/* RTF control */ +#define EM_CANPASTE (1074) +#define EM_CANUNDO (198) +#define EM_CHARFROMPOS (215) +#define EM_DISPLAYBAND (1075) +#define EM_EMPTYUNDOBUFFER (205) +#define EM_EXGETSEL (1076) +#define EM_EXLIMITTEXT (1077) +#define EM_EXLINEFROMCHAR (1078) +#define EM_EXSETSEL (1079) +#define EM_FINDTEXT (1080) +#define EM_FINDTEXTEX (1103) +#define EM_FINDWORDBREAK (1100) +#define EM_FMTLINES (200) +#define EM_FORMATRANGE (1081) +#define EM_GETCHARFORMAT (1082) +#define EM_GETEVENTMASK (1083) +#define EM_GETFIRSTVISIBLELINE (206) +#define EM_GETHANDLE (189) +#define EM_GETLIMITTEXT (213) +#define EM_GETLINE (196) +#define EM_GETLINECOUNT (186) +#define EM_GETMARGINS (212) +#define EM_GETMODIFY (184) +#define EM_GETIMECOLOR (1129) +#define EM_GETIMEOPTIONS (1131) +#define EM_GETOPTIONS (1102) +#define EM_GETOLEINTERFACE (1084) +#define EM_GETPARAFORMAT (1085) +#define EM_GETPASSWORDCHAR (210) +#define EM_GETPUNCTUATION (1125) +#define EM_GETRECT (178) +#define EM_GETSEL (176) +#define EM_GETSELTEXT (1086) +#define EM_GETTEXTRANGE (1099) +#define EM_GETTHUMB (190) +#define EM_GETWORDBREAKPROC (209) +#define EM_GETWORDBREAKPROCEX (1104) +#define EM_GETWORDWRAPMODE (1127) +#define EM_HIDESELECTION (1087) +#define EM_LIMITTEXT (197) +#define EM_LINEFROMCHAR (201) +#define EM_LINEINDEX (187) +#define EM_LINELENGTH (193) +#define EM_LINESCROLL (182) +#define EM_PASTESPECIAL (1088) +#define EM_POSFROMCHAR (214) +#define EM_REPLACESEL (194) +#define EM_REQUESTRESIZE (1089) +#define EM_SCROLL (181) +#define EM_SCROLLCARET (183) +#define EM_SELECTIONTYPE (1090) +#define EM_SETBKGNDCOLOR (1091) +#define EM_SETCHARFORMAT (1092) +#define EM_SETEVENTMASK (1093) +#define EM_SETHANDLE (188) +#define EM_SETIMECOLOR (1128) +#define EM_SETIMEOPTIONS (1130) +#define EM_SETLIMITTEXT (197) +#define EM_SETMARGINS (211) +#define EM_SETMODIFY (185) +#define EM_SETOLECALLBACK (1094) +#define EM_SETOPTIONS (1101) +#define EM_SETPARAFORMAT (1095) +#define EM_SETPASSWORDCHAR (204) +#define EM_SETPUNCTUATION (1124) +#define EM_SETREADONLY (207) +#define EM_SETRECT (179) +#define EM_SETRECTNP (180) +#define EM_SETSEL (177) +#define EM_SETTABSTOPS (203) +#define EM_SETTARGETDEVICE (1096) +#define EM_SETWORDBREAKPROC (208) +#define EM_SETWORDBREAKPROCEX (1105) +#define EM_SETWORDWRAPMODE (1126) +#define EM_STREAMIN (1097) +#define EM_STREAMOUT (1098) +#define EM_UNDO (199) + +/* Edit control */ +#define EN_CHANGE (768) +#define EN_CORRECTTEXT (1797) +#define EN_DROPFILES (1795) +#define EN_ERRSPACE (1280) +#define EN_HSCROLL (1537) +#define EN_IMECHANGE (1799) +#define EN_KILLFOCUS (512) +#define EN_MAXTEXT (1281) +#define EN_MSGFILTER (1792) +#define EN_OLEOPFAILED (1801) +#define EN_PROTECTED (1796) +#define EN_REQUESTRESIZE (1793) +#define EN_SAVECLIPBOARD (1800) +#define EN_SELCHANGE (1794) +#define EN_SETFOCUS (256) +#define EN_STOPNOUNDO (1798) +#define EN_UPDATE (1024) +#define EN_VSCROLL (1538) + +/* File Manager extensions */ + +/* File Manager extensions DLL events */ + +/* Header control */ +#define HDM_DELETEITEM (4610) +#define HDM_GETITEMW (4619) +#define HDM_INSERTITEMW (4618) +#define HDM_SETITEMW (4620) +#define HDM_GETITEMA (4611) +#define HDM_INSERTITEMA (4609) +#define HDM_SETITEMA (4612) +#ifdef UNICODE +#define HDM_GETITEM HDM_GETITEMW +#define HDM_INSERTITEM HDM_INSERTITEMW +#define HDM_SETITEM HDM_SETITEMW +#else +#define HDM_GETITEM HDM_GETITEMA +#define HDM_INSERTITEM HDM_INSERTITEMA +#define HDM_SETITEM HDM_SETITEMA +#endif /* UNICODE */ +#define HDM_GETITEMCOUNT (4608) +#define HDM_HITTEST (4614) +#define HDM_LAYOUT (4613) + +/* Header control notifications */ +#define HDN_BEGINTRACKW (-326) +#define HDN_DIVIDERDBLCLICKW (-325) +#define HDN_ENDTRACKW (-327) +#define HDN_ITEMCHANGEDW (-321) +#define HDN_ITEMCHANGINGW (-320) +#define HDN_ITEMCLICKW (-322) +#define HDN_ITEMDBLCLICKW (-323) +#define HDN_TRACKW (-328) +#define HDN_BEGINTRACKA (-306) +#define HDN_DIVIDERDBLCLICKA (-305) +#define HDN_ENDTRACKA (-307) +#define HDN_ITEMCHANGEDA (-301) +#define HDN_ITEMCHANGINGA (-300) +#define HDN_ITEMCLICKA (-302) +#define HDN_ITEMDBLCLICKA (-303) +#define HDN_TRACKA (-308) +#ifdef UNICODE +#define HDN_BEGINTRACK HDN_BEGINTRACKW +#define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKW +#define HDN_ENDTRACK HDN_ENDTRACKW +#define HDN_ITEMCHANGED HDN_ITEMCHANGEDW +#define HDN_ITEMCHANGING HDN_ITEMCHANGINGW +#define HDN_ITEMCLICK HDN_ITEMCLICKW +#define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKW +#define HDN_TRACK HDN_TRACKW +#else +#define HDN_BEGINTRACK HDN_BEGINTRACKA +#define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKA +#define HDN_ENDTRACK HDN_ENDTRACKA +#define HDN_ITEMCHANGED HDN_ITEMCHANGEDA +#define HDN_ITEMCHANGING HDN_ITEMCHANGINGA +#define HDN_ITEMCLICK HDN_ITEMCLICKA +#define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKA +#define HDN_TRACK HDN_TRACKA +#endif /* UNICODE */ + +/* Hot key control */ +#define HKM_GETHOTKEY (1026) +#define HKM_SETHOTKEY (1025) +#define HKM_SETRULES (1027) + +/* List box */ +#define LB_ADDFILE (406) +#define LB_ADDSTRING (384) +#define LB_DELETESTRING (386) +#define LB_DIR (397) +#define LB_FINDSTRING (399) +#define LB_FINDSTRINGEXACT (418) +#define LB_GETANCHORINDEX (413) +#define LB_GETCARETINDEX (415) +#define LB_GETCOUNT (395) +#define LB_GETCURSEL (392) +#define LB_GETHORIZONTALEXTENT (403) +#define LB_GETITEMDATA (409) +#define LB_GETITEMHEIGHT (417) +#define LB_GETITEMRECT (408) +#define LB_GETLOCALE (422) +#define LB_GETSEL (391) +#define LB_GETSELCOUNT (400) +#define LB_GETSELITEMS (401) +#define LB_GETTEXT (393) +#define LB_GETTEXTLEN (394) +#define LB_GETTOPINDEX (398) +#define LB_INITSTORAGE (424) +#define LB_INSERTSTRING (385) +#define LB_ITEMFROMPOINT (425) +#define LB_RESETCONTENT (388) +#define LB_SELECTSTRING (396) +#define LB_SELITEMRANGE (411) +#define LB_SELITEMRANGEEX (387) +#define LB_SETANCHORINDEX (412) +#define LB_SETCARETINDEX (414) +#define LB_SETCOLUMNWIDTH (405) +#define LB_SETCOUNT (423) +#define LB_SETCURSEL (390) +#define LB_SETHORIZONTALEXTENT (404) +#define LB_SETITEMDATA (410) +#define LB_SETITEMHEIGHT (416) +#define LB_SETLOCALE (421) +#define LB_SETSEL (389) +#define LB_SETTABSTOPS (402) +#define LB_SETTOPINDEX (407) + +/* List box notifications */ +#define LBN_DBLCLK (2) +#define LBN_ERRSPACE (-2) +#define LBN_KILLFOCUS (5) +#define LBN_SELCANCEL (3) +#define LBN_SELCHANGE (1) +#define LBN_SETFOCUS (4) + +/* List view control */ +#define LVM_ARRANGE (4118) +#define LVM_CREATEDRAGIMAGE (4129) +#define LVM_DELETEALLITEMS (4105) +#define LVM_DELETECOLUMN (4124) +#define LVM_DELETEITEM (4104) +#define LVM_ENSUREVISIBLE (4115) +#define LVM_GETBKCOLOR (4096) +#define LVM_GETCALLBACKMASK (4106) +#define LVM_GETCOLUMNWIDTH (4125) +#define LVM_GETCOUNTPERPAGE (4136) +#define LVM_GETEDITCONTROL (4120) +#define LVM_GETIMAGELIST (4098) +#define LVM_EDITLABELW (4214) +#define LVM_FINDITEMW (4179) +#define LVM_GETCOLUMNW (4191) +#define LVM_GETISEARCHSTRINGW (4213) +#define LVM_GETITEMW (4171) +#define LVM_GETITEMTEXTW (4211) +#define LVM_GETSTRINGWIDTHW (4183) +#define LVM_INSERTCOLUMNW (4193) +#define LVM_INSERTITEMW (4173) +#define LVM_SETCOLUMNW (4192) +#define LVM_SETITEMW (4172) +#define LVM_SETITEMTEXTW (4212) +#define LVM_EDITLABELA (4119) +#define LVM_FINDITEMA (4109) +#define LVM_GETCOLUMNA (4121) +#define LVM_GETISEARCHSTRINGA (4148) +#define LVM_GETITEMA (4101) +#define LVM_GETITEMTEXTA (4141) +#define LVM_GETSTRINGWIDTHA (4113) +#define LVM_INSERTCOLUMNA (4123) +#define LVM_INSERTITEMA (4103) +#define LVM_SETCOLUMNA (4122) +#define LVM_SETITEMA (4102) +#define LVM_SETITEMTEXTA (4142) +#ifdef UNICODE +#define LVM_EDITLABEL LVM_EDITLABELW +#define LVM_FINDITEM LVM_FINDITEMW +#define LVM_GETCOLUMN LVM_GETCOLUMNW +#define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGW +#define LVM_GETITEM LVM_GETITEMW +#define LVM_GETITEMTEXT LVM_GETITEMTEXTW +#define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHW +#define LVM_INSERTCOLUMN LVM_INSERTCOLUMNW +#define LVM_INSERTITEM LVM_INSERTITEMW +#define LVM_SETCOLUMN LVM_SETCOLUMNW +#define LVM_SETITEM LVM_SETITEMW +#define LVM_SETITEMTEXT LVM_SETITEMTEXTW +#else +#define LVM_EDITLABEL LVM_EDITLABELA +#define LVM_FINDITEM LVM_FINDITEMA +#define LVM_GETCOLUMN LVM_GETCOLUMNA +#define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGA +#define LVM_GETITEM LVM_GETITEMA +#define LVM_GETITEMTEXT LVM_GETITEMTEXTA +#define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHA +#define LVM_INSERTCOLUMN LVM_INSERTCOLUMNA +#define LVM_INSERTITEM LVM_INSERTITEMA +#define LVM_SETCOLUMN LVM_SETCOLUMNA +#define LVM_SETITEM LVM_SETITEMA +#define LVM_SETITEMTEXT LVM_SETITEMTEXTA +#endif /* UNICODE */ +#define LVM_GETITEMCOUNT (4100) +#define LVM_GETITEMPOSITION (4112) +#define LVM_GETITEMRECT (4110) +#define LVM_GETITEMSPACING (4147) +#define LVM_GETITEMSTATE (4140) +#define LVM_GETNEXTITEM (4108) +#define LVM_GETORIGIN (4137) +#define LVM_GETSELECTEDCOUNT (4146) +#define LVM_GETTEXTBKCOLOR (4133) +#define LVM_GETTEXTCOLOR (4131) +#define LVM_GETTOPINDEX (4135) +#define LVM_GETVIEWRECT (4130) +#define LVM_HITTEST (4114) +#define LVM_REDRAWITEMS (4117) +#define LVM_SCROLL (4116) +#define LVM_SETBKCOLOR (4097) +#define LVM_SETCALLBACKMASK (4107) +#define LVM_SETCOLUMNWIDTH (4126) +#define LVM_SETIMAGELIST (4099) +#define LVM_SETITEMCOUNT (4143) +#define LVM_SETITEMPOSITION (4111) +#define LVM_SETITEMPOSITION32 (4145) +#define LVM_SETITEMSTATE (4139) +#define LVM_SETTEXTBKCOLOR (4134) +#define LVM_SETTEXTCOLOR (4132) +#define LVM_SORTITEMS (4144) +#define LVM_UPDATE (4138) + +/* List view control notifications */ +#define LVN_BEGINDRAG (-109) +#define LVN_BEGINRDRAG (-111) +#define LVN_COLUMNCLICK (-108) +#define LVN_DELETEALLITEMS (-104) +#define LVN_DELETEITEM (-103) +#define LVN_BEGINLABELEDITW (-175) +#define LVN_ENDLABELEDITW (-176) +#define LVN_GETDISPINFOW (-177) +#define LVN_SETDISPINFOW (-178) +#define LVN_BEGINLABELEDITA (-105) +#define LVN_ENDLABELEDITA (-106) +#define LVN_GETDISPINFOA (-150) +#define LVN_SETDISPINFOA (-151) +#ifdef UNICODE +#define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITW +#define LVN_ENDLABELEDIT LVN_ENDLABELEDITW +#define LVN_GETDISPINFO LVN_GETDISPINFOW +#define LVN_SETDISPINFO LVN_SETDISPINFOW +#else +#define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITA +#define LVN_ENDLABELEDIT LVN_ENDLABELEDITA +#define LVN_GETDISPINFO LVN_GETDISPINFOA +#define LVN_SETDISPINFO LVN_SETDISPINFOA +#endif /* UNICODE */ +#define LVN_INSERTITEM (-102) +#define LVN_ITEMCHANGED (-101) +#define LVN_ITEMCHANGING (-100) +#define LVN_KEYDOWN (-155) + +/* Control notification */ +#define NM_CLICK (-2) +#define NM_DBLCLK (-3) +#define NM_KILLFOCUS (-8) +#define NM_OUTOFMEMORY (-1) +#define NM_RCLICK (-5) +#define NM_RDBLCLK (-6) +#define NM_RETURN (-4) +#define NM_SETFOCUS (-7) + +/* Power status */ + +/* Progress bar control */ +#define PBM_DELTAPOS (1027) +#define PBM_SETPOS (1026) +#define PBM_SETRANGE (1025) +#define PBM_SETSTEP (1028) +#define PBM_STEPIT (1029) + +/* Property sheets */ +#define PSM_ADDPAGE (1127) +#define PSM_APPLY (1134) +#define PSM_CANCELTOCLOSE (1131) +#define PSM_CHANGED (1128) +#define PSM_GETTABCONTROL (1140) +#define PSM_GETCURRENTPAGEHWND (1142) +#define PSM_ISDIALOGMESSAGE (1141) +#define PSM_PRESSBUTTON (1137) +#define PSM_QUERYSIBLINGS (1132) +#define PSM_REBOOTSYSTEM (1130) +#define PSM_REMOVEPAGE (1126) +#define PSM_RESTARTWINDOWS (1129) +#define PSM_SETCURSEL (1125) +#define PSM_SETCURSELID (1138) +#define PSM_SETFINISHTEXTW (1145) +#define PSM_SETTITLEW (1144) +#define PSM_SETFINISHTEXTA (1139) +#define PSM_SETTITLEA (1135) +#ifdef UNICODE +#define PSM_SETFINISHTEXT PSM_SETFINISHTEXTW +#define PSM_SETTITLE PSM_SETTITLEW +#else +#define PSM_SETFINISHTEXT PSM_SETFINISHTEXTA +#define PSM_SETTITLE PSM_SETTITLEA +#endif /* UNICODE */ +#define PSM_SETWIZBUTTONS (1136) +#define PSM_UNCHANGED (1133) + +/* Property sheet notifications */ +#define PSN_APPLY (-202) +#define PSN_HELP (-205) +#define PSN_KILLACTIVE (-201) +#define PSN_QUERYCANCEL (-209) +#define PSN_RESET (-203) +#define PSN_SETACTIVE (-200) +#define PSN_WIZBACK (-206) +#define PSN_WIZFINISH (-208) +#define PSN_WIZNEXT (-207) + +/* Status window */ +#define SB_GETBORDERS (1031) +#define SB_GETPARTS (1030) +#define SB_GETRECT (1034) +#define SB_GETTEXTW (1037) +#define SB_GETTEXTLENGTHW (1036) +#define SB_SETTEXTW (1035) +#define SB_GETTEXTA (1026) +#define SB_GETTEXTLENGTHA (1027) +#define SB_SETTEXTA (1025) +#ifdef UNICODE +#define SB_GETTEXT SB_GETTEXTW +#define SB_GETTEXTLENGTH SB_GETTEXTLENGTHW +#define SB_SETTEXT SB_SETTEXTW +#else +#define SB_GETTEXT SB_GETTEXTA +#define SB_GETTEXTLENGTH SB_GETTEXTLENGTHA +#define SB_SETTEXT SB_SETTEXTA +#endif /* UNICODE */ +#define SB_SETMINHEIGHT (1032) +#define SB_SETPARTS (1028) +#define SB_SIMPLE (1033) + +/* Scroll bar control */ +#define SBM_ENABLE_ARROWS (228) +#define SBM_GETPOS (225) +#define SBM_GETRANGE (227) +#define SBM_GETSCROLLINFO (234) +#define SBM_SETPOS (224) +#define SBM_SETRANGE (226) +#define SBM_SETRANGEREDRAW (230) +#define SBM_SETSCROLLINFO (233) + +/* Static control */ +#define STM_GETICON (369) +#define STM_GETIMAGE (371) +#define STM_SETICON (368) +#define STM_SETIMAGE (370) + +/* Static control notifications */ +#define STN_CLICKED (0) +#define STN_DBLCLK (1) +#define STN_DISABLE (3) +#define STN_ENABLE (2) + +/* Toolbar control */ +#define TB_ADDBITMAP (1043) +#define TB_ADDBUTTONS (1044) +#define TB_AUTOSIZE (1057) +#define TB_BUTTONCOUNT (1048) +#define TB_BUTTONSTRUCTSIZE (1054) +#define TB_CHANGEBITMAP (1067) +#define TB_CHECKBUTTON (1026) +#define TB_COMMANDTOINDEX (1049) +#define TB_CUSTOMIZE (1051) +#define TB_DELETEBUTTON (1046) +#define TB_ENABLEBUTTON (1025) +#define TB_GETBITMAP (1068) +#define TB_GETBITMAPFLAGS (1065) +#define TB_GETBUTTON (1047) +#define TB_ADDSTRINGW (1101) +#define TB_GETBUTTONTEXTW (1099) +#define TB_SAVERESTOREW (1100) +#define TB_ADDSTRINGA (1052) +#define TB_GETBUTTONTEXTA (1069) +#define TB_SAVERESTOREA (1050) +#ifdef UNICODE +#define TB_ADDSTRING TB_ADDSTRINGW +#define TB_GETBUTTONTEXT TB_GETBUTTONTEXTW +#define TB_SAVERESTORE TB_SAVERESTOREW +#else +#define TB_ADDSTRING TB_ADDSTRINGA +#define TB_GETBUTTONTEXT TB_GETBUTTONTEXTA +#define TB_SAVERESTORE TB_SAVERESTOREA +#endif /* UNICODE */ +#define TB_GETITEMRECT (1053) +#define TB_GETROWS (1064) +#define TB_GETSTATE (1042) +#define TB_GETTOOLTIPS (1059) +#define TB_HIDEBUTTON (1028) +#define TB_INDETERMINATE (1029) +#define TB_INSERTBUTTON (1045) +#define TB_ISBUTTONCHECKED (1034) +#define TB_ISBUTTONENABLED (1033) +#define TB_ISBUTTONHIDDEN (1036) +#define TB_ISBUTTONINDETERMINATE (1037) +#define TB_ISBUTTONPRESSED (1035) +#define TB_PRESSBUTTON (1027) +#define TB_SETBITMAPSIZE (1056) +#define TB_SETBUTTONSIZE (1055) +#define TB_SETCMDID (1066) +#define TB_SETPARENT (1061) +#define TB_SETROWS (1063) +#define TB_SETSTATE (1041) +#define TB_SETTOOLTIPS (1060) + +/* Track bar control */ +#define TBM_CLEARSEL (1043) +#define TBM_CLEARTICS (1033) +#define TBM_GETCHANNELRECT (1050) +#define TBM_GETLINESIZE (1048) +#define TBM_GETNUMTICS (1040) +#define TBM_GETPAGESIZE (1046) +#define TBM_GETPOS (1024) +#define TBM_GETPTICS (1038) +#define TBM_GETRANGEMAX (1026) +#define TBM_GETRANGEMIN (1025) +#define TBM_GETSELEND (1042) +#define TBM_GETSELSTART (1041) +#define TBM_GETTHUMBLENGTH (1052) +#define TBM_GETTHUMBRECT (1049) +#define TBM_GETTIC (1027) +#define TBM_GETTICPOS (1039) +#define TBM_SETLINESIZE (1047) +#define TBM_SETPAGESIZE (1045) +#define TBM_SETPOS (1029) +#define TBM_SETRANGE (1030) +#define TBM_SETRANGEMAX (1032) +#define TBM_SETRANGEMIN (1031) +#define TBM_SETSEL (1034) +#define TBM_SETSELEND (1036) +#define TBM_SETSELSTART (1035) +#define TBM_SETTHUMBLENGTH (1051) +#define TBM_SETTIC (1028) +#define TBM_SETTICFREQ (1044) + +/* Tool bar control notifications */ +#define TBN_BEGINADJUST (-703) +#define TBN_BEGINDRAG (-701) +#define TBN_CUSTHELP (-709) +#define TBN_ENDADJUST (-704) +#define TBN_ENDDRAG (-702) +#define TBN_GETBUTTONINFOW (-720) +#define TBN_GETBUTTONINFOA (-700) +#ifdef UNICODE +#define TBN_GETBUTTONINFO TBN_GETBUTTONINFOW +#else +#define TBN_GETBUTTONINFO TBN_GETBUTTONINFOA +#endif /* UNICODE */ +#define TBN_QUERYDELETE (-707) +#define TBN_QUERYINSERT (-706) +#define TBN_RESET (-705) +#define TBN_TOOLBARCHANGE (-708) + +/* Tab control */ +#define TCM_ADJUSTRECT (4904) +#define TCM_DELETEALLITEMS (4873) +#define TCM_DELETEITEM (4872) +#define TCM_GETCURFOCUS (4911) +#define TCM_GETCURSEL (4875) +#define TCM_GETIMAGELIST (4866) +#define TCM_GETITEMW (4924) +#define TCM_INSERTITEMW (4926) +#define TCM_SETITEMW (4925) +#define TCM_GETITEMA (4869) +#define TCM_INSERTITEMA (4871) +#define TCM_SETITEMA (4870) +#ifdef UNICODE +#define TCM_GETITEM TCM_GETITEM +#define TCM_INSERTITEM TCM_INSERTITEMW +#define TCM_SETITEM TCM_SETITEMW +#else +#define TCM_GETITEM TCM_GETITEMA +#define TCM_INSERTITEM TCM_INSERTITEMA +#define TCM_SETITEM TCM_SETITEMA +#endif /* UNICODE */ +#define TCM_GETITEMCOUNT (4868) +#define TCM_GETITEMRECT (4874) +#define TCM_GETROWCOUNT (4908) +#define TCM_GETTOOLTIPS (4909) +#define TCM_HITTEST (4877) +#define TCM_REMOVEIMAGE (4906) +#define TCM_SETCURFOCUS (4912) +#define TCM_SETCURSEL (4876) +#define TCM_SETIMAGELIST (4867) +#define TCM_SETITEMEXTRA (4878) +#define TCM_SETITEMSIZE (4905) +#define TCM_SETPADDING (4907) +#define TCM_SETTOOLTIPS (4910) + +/* Tab control notifications */ +#define TCN_KEYDOWN (-550) +#define TCN_SELCHANGE (-551) +#define TCN_SELCHANGING (-552) + +/* Tool tip control */ +#define TTM_ACTIVATE (1025) +#define TTM_ADDTOOLW (1074) +#define TTM_DELTOOLW (1075) +#define TTM_ENUMTOOLSW (1082) +#define TTM_GETCURRENTTOOLW (1083) +#define TTM_GETTEXTW (1080) +#define TTM_GETTOOLINFOW (1077) +#define TTM_HITTESTW (1079) +#define TTM_NEWTOOLRECTW (1076) +#define TTM_SETTOOLINFOW (1078) +#define TTM_UPDATETIPTEXTW (1081) +#define TTM_ADDTOOLA (1028) +#define TTM_DELTOOLA (1029) +#define TTM_ENUMTOOLSA (1038) +#define TTM_GETCURRENTTOOLA (1039) +#define TTM_GETTEXTA (1035) +#define TTM_GETTOOLINFOA (1032) +#define TTM_HITTESTA (1034) +#define TTM_NEWTOOLRECTA (1030) +#define TTM_SETTOOLINFOA (1033) +#define TTM_UPDATETIPTEXTA (1036) +#ifdef UNICODE +#define TTM_ADDTOOL TTM_ADDTOOLW +#define TTM_DELTOOL TTM_DELTOOLW +#define TTM_ENUMTOOLS TTM_ENUMTOOLSW +#define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLW +#define TTM_GETTEXT TTM_GETTEXTW +#define TTM_GETTOOLINFO TTM_GETTOOLINFOW +#define TTM_HITTEST TTM_HITTESTW +#define TTM_NEWTOOLRECT TTM_NEWTOOLRECTW +#define TTM_SETTOOLINFO TTM_SETTOOLINFOW +#define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTW +#else +#define TTM_ADDTOOL TTM_ADDTOOLA +#define TTM_DELTOOL TTM_DELTOOLA +#define TTM_ENUMTOOLS TTM_ENUMTOOLSA +#define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLA +#define TTM_GETTEXT TTM_GETTEXTA +#define TTM_GETTOOLINFO TTM_GETTOOLINFOA +#define TTM_HITTEST TTM_HITTESTA +#define TTM_NEWTOOLRECT TTM_NEWTOOLRECTA +#define TTM_SETTOOLINFO TTM_SETTOOLINFOA +#define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTA +#endif /* UNICODE */ +#define TTM_GETTOOLCOUNT (1037) +#define TTM_RELAYEVENT (1031) +#define TTM_SETDELAYTIME (1027) +#define TTM_WINDOWFROMPOINT (1040) + +/* Tool tip control notification */ +#define TTN_NEEDTEXTW (-530) +#define TTN_NEEDTEXTA (-520) +#ifdef UNICODE +#define TTN_NEEDTEXT TTN_NEEDTEXTW +#else +#define TTN_NEEDTEXT TTN_NEEDTEXTA +#endif /* UNICODE */ +#define TTN_POP (-522) +#define TTN_SHOW (-521) + +/* Tree view control */ +#define TVM_CREATEDRAGIMAGE (4370) +#define TVM_DELETEITEM (4353) +#define TVM_ENDEDITLABELNOW (4374) +#define TVM_ENSUREVISIBLE (4372) +#define TVM_EXPAND (4354) +#define TVM_GETCOUNT (4357) +#define TVM_GETEDITCONTROL (4367) +#define TVM_GETIMAGELIST (4360) +#define TVM_GETINDENT (4358) +#define TVM_GETITEMRECT (4356) +#define TVM_GETNEXTITEM (4362) +#define TVM_GETVISIBLECOUNT (4368) +#define TVM_HITTEST (4369) +#define TVM_EDITLABELW (4417) +#define TVM_GETISEARCHSTRINGW (4416) +#define TVM_GETITEMW (4414) +#define TVM_INSERTITEMW (4402) +#define TVM_SETITEMW (4415) +#define TVM_EDITLABELA (4366) +#define TVM_GETISEARCHSTRINGA (4375) +#define TVM_GETITEMA (4364) +#define TVM_INSERTITEMA (4352) +#define TVM_SETITEMA (4365) +#ifdef UNICODE +#define TVM_EDITLABEL TVM_EDITLABELW +#define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGW +#define TVM_GETITEM TVM_GETITEMW +#define TVM_INSERTITEM TVM_INSERTITEMW +#define TVM_SETITEM TVM_SETITEMW +#else +#define TVM_EDITLABEL TVM_EDITLABELA +#define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGA +#define TVM_GETITEM TVM_GETITEMA +#define TVM_INSERTITEM TVM_INSERTITEMA +#define TVM_SETITEM TVM_SETITEMA +#endif /* UNICODE */ +#define TVM_SELECTITEM (4363) +#define TVM_SETIMAGELIST (4361) +#define TVM_SETINDENT (4359) +#define TVM_SORTCHILDREN (4371) +#define TVM_SORTCHILDRENCB (4373) + +/* Tree view control notification */ +#define TVN_KEYDOWN (-412) +#define TVN_BEGINDRAGW (-456) +#define TVN_BEGINLABELEDITW (-459) +#define TVN_BEGINRDRAGW (-457) +#define TVN_DELETEITEMW (-458) +#define TVN_ENDLABELEDITW (-460) +#define TVN_GETDISPINFOW (-452) +#define TVN_ITEMEXPANDEDW (-455) +#define TVN_ITEMEXPANDINGW (-454) +#define TVN_SELCHANGEDW (-451) +#define TVN_SELCHANGINGW (-450) +#define TVN_SETDISPINFOW (-453) +#define TVN_BEGINDRAGA (-407) +#define TVN_BEGINLABELEDITA (-410) +#define TVN_BEGINRDRAGA (-408) +#define TVN_DELETEITEMA (-409) +#define TVN_ENDLABELEDITA (-411) +#define TVN_GETDISPINFOA (-403) +#define TVN_ITEMEXPANDEDA (-406) +#define TVN_ITEMEXPANDINGA (-405) +#define TVN_SELCHANGEDA (-402) +#define TVN_SELCHANGINGA (-401) +#define TVN_SETDISPINFOA (-404) +#ifdef UNICODE +#define TVN_BEGINDRAG TVN_BEGINDRAGW +#define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITW +#define TVN_BEGINRDRAG TVN_BEGINRDRAGW +#define TVN_DELETEITEM TVN_DELETEITEMW +#define TVN_ENDLABELEDIT TVN_ENDLABELEDITW +#define TVN_GETDISPINFO TVN_GETDISPINFOW +#define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDW +#define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGW +#define TVN_SELCHANGED TVN_SELCHANGEDW +#define TVN_SELCHANGING TVN_SELCHANGINGW +#define TVN_SETDISPINFO TVN_SETDISPINFOW +#else +#define TVN_BEGINDRAG TVN_BEGINDRAGA +#define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITA +#define TVN_BEGINRDRAG TVN_BEGINRDRAGA +#define TVN_DELETEITEM TVN_DELETEITEMA +#define TVN_ENDLABELEDIT TVN_ENDLABELEDITA +#define TVN_GETDISPINFO TVN_GETDISPINFOA +#define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDA +#define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGA +#define TVN_SELCHANGED TVN_SELCHANGEDA +#define TVN_SELCHANGING TVN_SELCHANGINGA +#define TVN_SETDISPINFO TVN_SETDISPINFOA +#endif /* UNICODE */ + +/* Up/down control */ +#define UDM_GETACCEL (1132) +#define UDM_GETBASE (1134) +#define UDM_GETBUDDY (1130) +#define UDM_GETPOS (1128) +#define UDM_GETRANGE (1126) +#define UDM_SETACCEL (1131) +#define UDM_SETBASE (1133) +#define UDM_SETBUDDY (1129) +#define UDM_SETPOS (1127) +#define UDM_SETRANGE (1125) + +/* Up/down control notification */ +#define UDN_DELTAPOS (-722) + +/* Window messages */ + +#define WM_ACTIVATE (6) +#define WM_ACTIVATEAPP (28) +#define WM_ASKCBFORMATNAME (780) +#define WM_CANCELJOURNAL (75) +#define WM_CANCELMODE (31) +#define WM_CAPTURECHANGED (533) +#define WM_CHANGECBCHAIN (781) +#define WM_CHAR (258) +#define WM_CHARTOITEM (47) +#define WM_CHILDACTIVATE (34) +#define WM_CHOOSEFONT_GETLOGFONT (1025) +#define WM_CHOOSEFONT_SETLOGFONT (1125) +#define WM_CHOOSEFONT_SETFLAGS (1126) +#define WM_CLEAR (771) +#define WM_CLOSE (16) +#define WM_COMMAND (273) +#define WM_COMPACTING (65) +#define WM_COMPAREITEM (57) +#define WM_CONTEXTMENU (123) +#define WM_COPY (769) +#define WM_COPYDATA (74) +#define WM_CREATE (1) +#define WM_CTLCOLORBTN (309) +#define WM_CTLCOLORDLG (310) +#define WM_CTLCOLOREDIT (307) +#define WM_CTLCOLORLISTBOX (308) +#define WM_CTLCOLORMSGBOX (306) +#define WM_CTLCOLORSCROLLBAR (311) +#define WM_CTLCOLORSTATIC (312) +#define WM_CUT (768) +#define WM_DEADCHAR (259) +#define WM_DELETEITEM (45) +#define WM_DESTROY (2) +#define WM_DESTROYCLIPBOARD (775) +#define WM_DEVICECHANGE (537) +#define WM_DEVMODECHANGE (27) +#define WM_DISPLAYCHANGE (126) +#define WM_DRAWCLIPBOARD (776) +#define WM_DRAWITEM (43) +#define WM_DROPFILES (563) +#define WM_DROPOBJECT (544) +#define WM_ENABLE (10) +#define WM_ENDSESSION (22) +#define WM_ENTERIDLE (289) +#define WM_ENTERMENULOOP (529) +#define WM_ENTERSIZEMOVE (561) +#define WM_ERASEBKGND (20) +#define WM_EXITMENULOOP (530) +#define WM_EXITSIZEMOVE (562) +#define WM_FONTCHANGE (29) +#define WM_GETDLGCODE (135) +#define WM_GETFONT (49) +#define WM_GETHOTKEY (51) +#define WM_GETICON (127) +#define WM_GETMINMAXINFO (36) +#define WM_GETTEXT (13) +#define WM_GETTEXTLENGTH (14) +#define WM_HELP (83) +#define WM_HOTKEY (786) +#define WM_HSCROLL (276) +#define WM_HSCROLLCLIPBOARD (782) +#define WM_ICONERASEBKGND (39) +#define WM_IME_CHAR (646) +#define WM_IME_COMPOSITION (271) +#define WM_IME_COMPOSITIONFULL (644) +#define WM_IME_CONTROL (643) +#define WM_IME_ENDCOMPOSITION (270) +#define WM_IME_KEYDOWN (656) +#define WM_IME_KEYUP (657) +#define WM_IME_NOTIFY (642) +#define WM_IME_SELECT (645) +#define WM_IME_SETCONTEXT (641) +#define WM_IME_STARTCOMPOSITION (269) +#define WM_INITDIALOG (272) +#define WM_INITMENU (278) +#define WM_INITMENUPOPUP (279) +#define WM_INPUTLANGCHANGE (81) +#define WM_INPUTLANGCHANGEREQUEST (80) +#define WM_KEYDOWN (256) +#define WM_KEYUP (257) +#define WM_KILLFOCUS (8) +#define WM_LBUTTONDBLCLK (515) +#define WM_LBUTTONDOWN (513) +#define WM_LBUTTONUP (514) +#define WM_MBUTTONDBLCLK (521) +#define WM_MBUTTONDOWN (519) +#define WM_MBUTTONUP (520) +#define WM_MDIACTIVATE (546) +#define WM_MDICASCADE (551) +#define WM_MDICREATE (544) +#define WM_MDIDESTROY (545) +#define WM_MDIGETACTIVE (553) +#define WM_MDIICONARRANGE (552) +#define WM_MDIMAXIMIZE (549) +#define WM_MDINEXT (548) +#define WM_MDIREFRESHMENU (564) +#define WM_MDIRESTORE (547) +#define WM_MDISETMENU (560) +#define WM_MDITILE (550) +#define WM_MEASUREITEM (44) +#define WM_MENUCHAR (288) +#define WM_MENUSELECT (287) +#define WM_MOUSEACTIVATE (33) +#define WM_MOUSEMOVE (512) +#define WM_MOUSEWHEEL (522) +#define WM_MOVE (3) +#define WM_MOVING (534) +#define WM_NCACTIVATE (134) +#define WM_NCCALCSIZE (131) +#define WM_NCCREATE (129) +#define WM_NCDESTROY (130) +#define WM_NCHITTEST (132) +#define WM_NCLBUTTONDBLCLK (163) +#define WM_NCLBUTTONDOWN (161) +#define WM_NCLBUTTONUP (162) +#define WM_NCMBUTTONDBLCLK (169) +#define WM_NCMBUTTONDOWN (167) +#define WM_NCMBUTTONUP (168) +#define WM_NCMOUSEMOVE (160) +#define WM_NCPAINT (133) +#define WM_NCRBUTTONDBLCLK (166) +#define WM_NCRBUTTONDOWN (164) +#define WM_NCRBUTTONUP (165) +#define WM_NEXTDLGCTL (40) +#define WM_NOTIFY (78) +#define WM_NOTIFYFORMAT (85) +#define WM_NULL (0) +#define WM_PAINT (15) +#define WM_PAINTCLIPBOARD (777) +#define WM_PAINTICON (38) +#define WM_PALETTECHANGED (785) +#define WM_PALETTEISCHANGING (784) +#define WM_PARENTNOTIFY (528) +#define WM_PASTE (770) +#define WM_PENWINFIRST (896) +#define WM_PENWINLAST (911) +#define WM_POWER (72) +#define WM_POWERBROADCAST (536) +#define WM_PRINT (791) +#define WM_PRINTCLIENT (792) +#define WM_PSD_ENVSTAMPRECT (1029) +#define WM_PSD_FULLPAGERECT (1025) +#define WM_PSD_GREEKTEXTRECT (1028) +#define WM_PSD_MARGINRECT (1027) +#define WM_PSD_MINMARGINRECT (1026) +#define WM_PSD_PAGESETUPDLG (1024) +#define WM_PSD_YAFULLPAGERECT (1030) +#define WM_QUERYDRAGICON (55) +#define WM_QUERYDROPOBJECT (555) +#define WM_QUERYENDSESSION (17) +#define WM_QUERYNEWPALETTE (783) +#define WM_QUERYOPEN (19) +#define WM_QUEUESYNC (35) +#define WM_QUIT (18) +#define WM_RBUTTONDBLCLK (518) +#define WM_RBUTTONDOWN (516) +#define WM_RBUTTONUP (517) +#define WM_RENDERALLFORMATS (774) +#define WM_RENDERFORMAT (773) +#define WM_SETCURSOR (32) +#define WM_SETFOCUS (7) +#define WM_SETFONT (48) +#define WM_SETHOTKEY (50) +#define WM_SETICON (128) +#define WM_SETREDRAW (11) +#define WM_SETTEXT (12) +#define WM_SETTINGCHANGE (26) +#define WM_SHOWWINDOW (24) +#define WM_SIZE (5) +#define WM_SIZECLIPBOARD (779) +#define WM_SIZING (532) +#define WM_SPOOLERSTATUS (42) +#define WM_STYLECHANGED (125) +#define WM_STYLECHANGING (124) +#define WM_SYNCPAINT (136) +#define WM_SYSCHAR (262) +#define WM_SYSCOLORCHANGE (21) +#define WM_SYSCOMMAND (274) +#define WM_SYSDEADCHAR (263) +#define WM_SYSKEYDOWN (260) +#define WM_SYSKEYUP (261) +#define WM_TCARD (82) +#define WM_TIMECHANGE (30) +#define WM_TIMER (275) +#define WM_UNDO (772) +#define WM_USER (1024) +#define WM_USERCHANGED (84) +#define WM_VKEYTOITEM (46) +#define WM_VSCROLL (277) +#define WM_VSCROLLCLIPBOARD (778) +#define WM_WINDOWPOSCHANGED (71) +#define WM_WINDOWPOSCHANGING (70) +#define WM_WININICHANGE (26) + +/* Window message ranges */ +#define WM_KEYFIRST (256) +#define WM_KEYLAST (264) +#define WM_MOUSEFIRST (512) +#define WM_MOUSELAST (521) + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _GNU_H_WINDOWS32_MESSAGES */ diff --git a/reactos/include/msvcrt/alloc.h b/reactos/include/msvcrt/alloc.h new file mode 100644 index 00000000000..c0d36b4a425 --- /dev/null +++ b/reactos/include/msvcrt/alloc.h @@ -0,0 +1,85 @@ +/* + * alloc.h + * + * Memory management functions. Because most of these functions are + * actually declared in stdlib.h I have decided to simply include that + * header file. This file is included by malloc.h. My head hurts... + * + * NOTE: In the version of the Standard C++ Library from Cygnus there + * is also an alloc.h which needs to be on your include path. Most of + * the time I think the most sensible option would be to get rid of + * this file. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.4 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:30 $ + * + */ + +#ifndef __STRICT_ANSI__ + +#ifndef _ALLOC_H_ +#define _ALLOC_H_ + +#include + +#ifndef RC_INVOKED + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The structure used to walk through the heap with _heapwalk. + * TODO: This is a guess at the internals of this structure. + */ +typedef struct _heapinfo +{ + void* ptr; + unsigned int size; + int in_use; +} _HEAPINFO; + +int _heapwalk (_HEAPINFO* pHeapinfo); + +#ifdef __GNUC__ +#ifdef USE_C_ALLOCA +void * C_alloca(size_t size); +#define _alloca(x) C_alloca(x) +#else /* USE_C_ALLOCA */ +#define _alloca(x) __builtin_alloca(x) +#endif /* USE_C_ALLOCA */ +#else /* __GNUC__ */ +void * _alloca(size_t size); +#endif /* __GNUC__ */ + +#ifndef _NO_OLDNAMES +#define heapwalk(x) _heapwalk(x) +#define alloca(s) _alloca(s) +#endif /* Not _NO_OLDNAMES */ + +#ifdef __cplusplus +} +#endif + +#endif /* Not RC_INVOKED */ + +#endif /* Not _ALLOC_H_ */ + +#endif /* Not __STRICT_ANSI__ */ + diff --git a/reactos/include/msvcrt/assert.h b/reactos/include/msvcrt/assert.h new file mode 100644 index 00000000000..5b830376b7a --- /dev/null +++ b/reactos/include/msvcrt/assert.h @@ -0,0 +1,69 @@ +/* + * assert.h + * + * Define the assert macro for debug output. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.3 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:30 $ + * + */ + +#ifndef _ASSERT_H_ +#define _ASSERT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef NDEBUG + +/* + * If not debugging, assert does nothing. + */ +#define assert(x) ((void)0); + +#else /* debugging enabled */ + +/* + * CRTDLL nicely supplies a function which does the actual output and + * call to abort. + */ +#ifndef __ATTRIB_NORETURN +#ifdef __GNUC__ +#define _ATTRIB_NORETURN __attribute__ ((noreturn)) +#else /* Not __GNUC__ */ +#define _ATTRIB_NORETURN +#endif /* __GNUC__ */ +#endif + +void _assert (const char* szExpression, const char* szFileName, int nLine) +_ATTRIB_NORETURN +; + +/* + * Definition of the assert macro. + */ +#define assert(x) if(!(x)) _assert( #x , __FILE__, __LINE__); +#endif /* NDEBUG */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/reactos/include/msvcrt/conio.h b/reactos/include/msvcrt/conio.h new file mode 100644 index 00000000000..66491cd6991 --- /dev/null +++ b/reactos/include/msvcrt/conio.h @@ -0,0 +1,67 @@ +/* + * conio.h + * + * Low level console I/O functions. Pretty please try to use the ANSI + * standard ones if you are writing new code. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.3 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:30 $ + * + */ + +#ifndef __STRICT_ANSI__ + +#ifndef _CONIO_H_ +#define _CONIO_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + +char* _cgets (char* szBuffer); +int _cprintf (const char* szFormat, ...); +int _cputs (const char* szString); +int _cscanf (char* szFormat, ...); + +int _getch (void); +int _getche (void); +int _kbhit (void); +int _putch (int cPut); +int _ungetch (int cUnget); + + +#ifndef _NO_OLDNAMES + +#define getch _getch +#define getche _getche +#define kbhit _kbhit +#define putch(cPut) _putch(cPut) +#define ungetch(cUnget) _ungetch(cUnget) + +#endif /* Not _NO_OLDNAMES */ + + +#ifdef __cplusplus +} +#endif + +#endif /* Not _CONIO_H_ */ + +#endif /* Not __STRICT_ANSI__ */ diff --git a/reactos/include/msvcrt/ctype.h b/reactos/include/msvcrt/ctype.h new file mode 100644 index 00000000000..45f6356993b --- /dev/null +++ b/reactos/include/msvcrt/ctype.h @@ -0,0 +1,139 @@ +/* + * ctype.h + * + * Functions for testing character types and converting characters. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.4 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:30 $ + * + */ + +#ifndef _CTYPE_H_ +#define _CTYPE_H_ + +#define __need_wchar_t +#define __need_wint_t +#include + + +/* + * The following flags are used to tell iswctype and _isctype what character + * types you are looking for. + */ +#define _UPPER 0x0001 +#define _LOWER 0x0002 +#define _DIGIT 0x0004 +#define _SPACE 0x0008 +#define _PUNCT 0x0010 +#define _CONTROL 0x0020 +#define _BLANK 0x0040 +#define _HEX 0x0080 + +#define _ALPHA 0x0103 +#define _LEADBYTE 0x8000 + + +#ifdef __cplusplus +extern "C" { +#endif + +int isalnum(int c); +int isalpha(int c); +int iscntrl(int c); +int isdigit(int c); +int isgraph(int c); +int islower(int c); +int isprint(int c); +int ispunct(int c); +int isspace(int c); +int isupper(int c); +int isxdigit(int c); + +#ifndef __STRICT_ANSI__ +int _isctype (unsigned int c, int ctypeFlags); +#endif + +int tolower(int c); +int toupper(int c); + +/* + * NOTE: The above are not old name type wrappers, but functions exported + * explicitly by MSVCRT. However, underscored versions are also exported. + */ +#ifndef __STRICT_ANSI__ +int _tolower(int c); +int _toupper(int c); +#endif + +#ifndef WEOF +#define WEOF (wchar_t)(0xFFFF) +#endif + +/* + * TODO: MB_CUR_MAX should be defined here (if not already defined, since + * it should also be defined in stdlib.h). It is supposed to be the + * maximum number of bytes in a multi-byte character in the current + * locale. Perhaps accessible through the __mb_curr_max_dll entry point, + * but I think (again) that that is a variable pointer, which leads to + * problems under the current Cygwin compiler distribution. + */ + +typedef int wctype_t; + +/* Wide character equivalents */ +int iswalnum(wint_t wc); +int iswalpha(wint_t wc); +int iswascii(wint_t wc); +int iswcntrl(wint_t wc); +int iswctype(wint_t wc, wctype_t wctypeFlags); +int is_wctype(wint_t wc, wctype_t wctypeFlags); /* Obsolete! */ +int iswdigit(wint_t wc); +int iswgraph(wint_t wc); +int iswlower(wint_t wc); +int iswprint(wint_t wc); +int iswpunct(wint_t wc); +int iswspace(wint_t wc); +int iswupper(wint_t wc); +int iswxdigit(wint_t wc); + +wchar_t towlower(wchar_t c); +wchar_t towupper(wchar_t c); + +int isleadbyte (int c); + +#ifndef __STRICT_ANSI__ +int __isascii (int c); +int __toascii (int c); +int __iscsymf (int c); /* Valid first character in C symbol */ +int __iscsym (int c); /* Valid character in C symbol (after first) */ + +#ifndef _NO_OLDNAMES +#define isascii(c) __isascii(c) +#define toascii(c) _toascii(c) +#define iscsymf(c) __iscsymf(c) +#define iscsym(c) __iscsym(c) +#endif /* Not _NO_OLDNAMES */ + +#endif /* Not __STRICT_ANSI__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* Not _CTYPE_H_ */ diff --git a/reactos/include/msvcrt/dir.h b/reactos/include/msvcrt/dir.h new file mode 100644 index 00000000000..5b51ee4bb59 --- /dev/null +++ b/reactos/include/msvcrt/dir.h @@ -0,0 +1,148 @@ +/* + * dir.h + * + * Functions for working with directories and path names. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.5 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:30 $ + * + */ + +#ifndef __STRICT_ANSI__ + +#ifndef _DIR_H_ +#define _DIR_H_ + +#include /* To get FILENAME_MAX... ugly. */ +#include /* To get time_t. */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Attributes of files as returned by _findfirst et al. + */ +#define _A_NORMAL 0x00000000 +#define _A_RDONLY 0x00000001 +#define _A_HIDDEN 0x00000002 +#define _A_SYSTEM 0x00000004 +#define _A_VOLID 0x00000008 +#define _A_SUBDIR 0x00000010 +#define _A_ARCH 0x00000020 + +#ifndef _FSIZE_T_DEFINED +typedef unsigned long _fsize_t; +#define _FSIZE_T_DEFINED +#endif + +/* + * The following structures are filled in by _findfirst or _findnext when + * they succeed in finding a match. + */ +struct _finddata_t +{ + unsigned attrib; /* Attributes, see constants above. */ + time_t time_create; + time_t time_access; /* always midnight local time */ + time_t time_write; + _fsize_t size; + char name[FILENAME_MAX]; /* may include spaces. */ +}; + +struct _finddatai64_t +{ + unsigned attrib; /* Attributes, see constants above. */ + time_t time_create; + time_t time_access; /* always midnight local time */ + time_t time_write; + __int64 size; + char name[FILENAME_MAX]; /* may include spaces. */ +}; + +struct _wfinddata_t +{ + unsigned attrib; /* Attributes, see constants above. */ + time_t time_create; + time_t time_access; /* always midnight local time */ + time_t time_write; + _fsize_t size; + wchar_t name[FILENAME_MAX]; /* may include spaces. */ +}; + +struct _wfinddatai64_t +{ + unsigned attrib; /* Attributes, see constants above. */ + time_t time_create; + time_t time_access; /* always midnight local time */ + time_t time_write; + __int64 size; + wchar_t name[FILENAME_MAX]; /* may include spaces. */ +}; + +/* + * Functions for searching for files. _findfirst returns -1 if no match + * is found. Otherwise it returns a handle to be used in _findnext and + * _findclose calls. _findnext also returns -1 if no match could be found, + * and 0 if a match was found. Call _findclose when you are finished. + */ +int _findclose (int nHandle); +int _findfirst (const char* szFilespec, struct _finddata_t* find); +int _findfirsti64 (const char* szFilespec, struct _finddatai64_t* find); +int _findnext (int nHandle, struct _finddata_t* find); +int _findnexti64 (int nHandle, struct _finddatai64_t* find); + +int _chdir (const char* szPath); +char* _getcwd (char* caBuffer, int nBufferSize); +int _mkdir (const char* szPath); +char* _mktemp (char* szTemplate); +int _rmdir (const char* szPath); + + +/* Wide character versions */ +int _wfindfirst(const wchar_t *_name, struct _wfinddata_t *result); +int _wfindfirsti64(const wchar_t *_name, struct _wfinddatai64_t *result); +int _wfindnext(int handle, struct _wfinddata_t *result); +int _wfindnexti64(int handle, struct _wfinddatai64_t *result); + +int _wchdir(const wchar_t *szPath); +wchar_t* _wgetcwd(wchar_t *buffer, int maxlen); +int _wmkdir(const wchar_t *_path); +wchar_t* _wmktemp (wchar_t *_template); +int _wrmdir(const wchar_t *_path); + + +#ifndef _NO_OLDNAMES + +int chdir (const char* szPath); +char* getcwd (char* caBuffer, int nBufferSize); +int mkdir (const char* szPath); +char* mktemp (char* szTemplate); +int rmdir (const char* szPath); + +#endif /* Not _NO_OLDNAMES */ + + +#ifdef __cplusplus +} +#endif + +#endif /* Not _DIR_H_ */ + +#endif /* Not __STRICT_ANSI__ */ diff --git a/reactos/include/msvcrt/direct.h b/reactos/include/msvcrt/direct.h new file mode 100644 index 00000000000..e1849eca811 --- /dev/null +++ b/reactos/include/msvcrt/direct.h @@ -0,0 +1,46 @@ +#ifndef _DIRECT_H_ +#define _DIRECT_H_ + +#ifndef _WCHAR_T_ +typedef unsigned short wchar_t; +#define _WCHAR_T_ +#endif + +#ifndef _SIZE_T_ +typedef unsigned int size_t; +#define _SIZE_T_ +#endif + +struct _diskfree_t { + unsigned short total_clusters; + unsigned short avail_clusters; + unsigned short sectors_per_cluster; + unsigned short bytes_per_sector; +}; + +unsigned int _getdiskfree(unsigned int _drive, struct _diskfree_t *_diskspace); + +int _chdrive( int drive ); +int _getdrive( void ); + +char *_getcwd( char *buffer, int maxlen ); +char *_getdcwd (int nDrive, char* caBuffer, int nBufLen); + +int _chdir(const char *_path); +int _mkdir(const char *_path); +int _rmdir(const char *_path); + +#define chdir _chdir +#define getcwd _getcwd +#define mkdir _mkdir +#define rmdir _rmdir + + +wchar_t *_wgetcwd( wchar_t *buffer, int maxlen ); +wchar_t *_wgetdcwd (int nDrive, wchar_t* caBuffer, int nBufLen); + +int _wchdir(const wchar_t *_path); +int _wmkdir(const wchar_t *_path); +int _wrmdir(const wchar_t *_path); + +#endif diff --git a/reactos/include/msvcrt/errno.h b/reactos/include/msvcrt/errno.h new file mode 100644 index 00000000000..6c8cd9c9236 --- /dev/null +++ b/reactos/include/msvcrt/errno.h @@ -0,0 +1,120 @@ +/* + * errno.h + * + * Error numbers and access to error reporting. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.6 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:30 $ + * + */ + +#ifndef _ERRNO_H_ +#define _ERRNO_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Error numbers. + * TODO: Can't be sure of some of these assignments, I guessed from the + * names given by strerror and the defines in the Cygnus errno.h. A lot + * of the names from the Cygnus errno.h are not represented, and a few + * of the descriptions returned by strerror do not obviously match + * their error naming. + */ +#define EPERM 1 /* Operation not permitted */ +#define ENOFILE 2 /* No such file or directory */ +#define ENOENT 2 +#define ESRCH 3 /* No such process */ +#define EINTR 4 /* Interrupted function call */ +#define EIO 5 /* Input/output error */ +#define ENXIO 6 /* No such device or address */ +#define E2BIG 7 /* Arg list too long */ +#define ENOEXEC 8 /* Exec format error */ +#define EBADF 9 /* Bad file descriptor */ +#define ECHILD 10 /* No child processes */ +#define EAGAIN 11 /* Resource temporarily unavailable */ +#define ENOMEM 12 /* Not enough space */ +#define EACCES 13 /* Permission denied */ +#define EFAULT 14 /* Bad address */ +/* 15 - Unknown Error */ +#define EBUSY 16 /* strerror reports "Resource device" */ +#define EEXIST 17 /* File exists */ +#define EXDEV 18 /* Improper link (cross-device link?) */ +#define ENODEV 19 /* No such device */ +#define ENOTDIR 20 /* Not a directory */ +#define EISDIR 21 /* Is a directory */ +#define EINVAL 22 /* Invalid argument */ +#define ENFILE 23 /* Too many open files in system */ +#define EMFILE 24 /* Too many open files */ +#define ENOTTY 25 /* Inappropriate I/O control operation */ +/* 26 - Unknown Error */ +#define EFBIG 27 /* File too large */ +#define ENOSPC 28 /* No space left on device */ +#define ESPIPE 29 /* Invalid seek (seek on a pipe?) */ +#define EROFS 30 /* Read-only file system */ +#define EMLINK 31 /* Too many links */ +#define EPIPE 32 /* Broken pipe */ +#define EDOM 33 /* Domain error (math functions) */ +#define ERANGE 34 /* Result too large (possibly too small) */ +/* 35 - Unknown Error */ +#define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */ +#define EDEADLK 36 +/* 37 - Unknown Error */ +#define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */ +#define ENOLCK 39 /* No locks available (46 in Cyg?) */ +#define ENOSYS 40 /* Function not implemented (88 in Cyg?) */ +#define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */ +#define EILSEQ 42 /* Illegal byte sequence */ + +/* + * NOTE: ENAMETOOLONG and ENOTEMPTY conflict with definitions in the + * sockets.h header provided with windows32api-0.1.2. + * You should go and put an #if 0 ... #endif around the whole block + * of errors (look at the comment above them). + */ + +/* + * Definitions of macros for the 'variables' errno, _doserrno, sys_nerr and + * sys_errlist. + */ +int* _errno(void); +#define errno (*_errno()) + +int* __doserrno(void); +#define _doserrno (*__doserrno()) + +/* One of the MSVCRTxx libraries */ + +extern int* __imp__sys_nerr; +#ifndef sys_nerr +#define sys_nerr (*__imp__sys_nerr) +#endif + +extern char** __imp__sys_errlist; +#ifndef sys_errlist +#define sys_errlist (__imp__sys_errlist) +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/reactos/include/msvcrt/fcntl.h b/reactos/include/msvcrt/fcntl.h new file mode 100644 index 00000000000..07e1d3e1b02 --- /dev/null +++ b/reactos/include/msvcrt/fcntl.h @@ -0,0 +1,127 @@ +/* + * fcntl.h + * + * Access constants for _open. Note that the permissions constants are + * in sys/stat.h (ick). + * + * This code is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.4 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:30 $ + * + */ +/* Appropriated for Reactos Crtdll by Ariadne */ +/* added _O_RANDOM_O_SEQUENTIAL _O_SHORT_LIVED*/ +/* changed fmode_dll */ + +#ifndef _FCNTL_H_ +#define _FCNTL_H_ + +/* + * It appears that fcntl.h should include io.h for compatibility... + */ +#include + +/* + * This variable determines the default file mode. + * TODO: Which flags work? + */ +#if 0 +#if __MSVCRT__ +extern unsigned int* __imp__fmode; +#define _fmode (*__imp__fmode) +#else +/* CRTDLL */ +extern unsigned int* _fmode_dll; +#define _fmode (*_fmode_dll) +#endif +#endif /* 0 */ + +/* + * NOTE: This is the correct definition to build crtdll. + * It is NOT valid outside of crtdll. + */ +extern unsigned int* _fmode_dll; +extern unsigned int _fmode; + + +/* Specifiy one of these flags to define the access mode. */ +#define _O_RDONLY 0 +#define _O_WRONLY 1 +#define _O_RDWR 2 + +/* Mask for access mode bits in the _open flags. */ +#define _O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) + +#define _O_APPEND 0x0008 /* Writes will add to the end of the file. */ +#define _O_CREAT 0x0100 /* Create the file if it does not exist. */ +#define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */ +#define _O_EXCL 0x0400 /* Open only if the file does not exist. */ + +/* NOTE: Text is the default even if the given _O_TEXT bit is not on. */ +#define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */ +#define _O_BINARY 0x8000 /* Input and output is not translated. */ +#define _O_RAW _O_BINARY + +#define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing. + * WARNING: Even if not created by _open! */ +#define _O_NOINHERIT 0x0080 + + +#define _O_RANDOM 0x0010 +#define _O_SEQUENTIAL _O_RANDOM +#define _O_SHORT_LIVED 0x1000 + +#ifndef __STRICT_ANSI__ +#ifndef _NO_OLDNAMES + +/* POSIX/Non-ANSI names for increased portability */ +#define O_RDONLY _O_RDONLY +#define O_WRONLY _O_WRONLY +#define O_RDWR _O_RDWR +#define O_ACCMODE _O_ACCMODE +#define O_APPEND _O_APPEND +#define O_CREAT _O_CREAT +#define O_TRUNC _O_TRUNC +#define O_EXCL _O_EXCL +#define O_TEXT _O_TEXT +#define O_BINARY _O_BINARY +#define O_TEMPORARY _O_TEMPORARY +#define O_NOINHERIT _O_NOINHERIT + +#define O_RANDOM _O_RANDOM +#define O_SEQUENTIAL _O_RANDOM +#define O_SHORT_LIVED _O_SHORT_LIVED + +#endif /* Not _NO_OLDNAMES */ + +#ifdef __cplusplus +extern "C" { +#endif + +int _setmode (int nHandle, int nAccessMode); + +#ifndef _NO_OLDNAMES +int setmode (int nHandle, int nAccessMode); +#endif /* Not _NO_OLDNAMES */ + +#ifdef __cplusplus +} +#endif + +#endif /* Not __STRICT_ANSI__ */ +#endif /* Not _FCNTL_H_ */ diff --git a/reactos/include/msvcrt/float.h b/reactos/include/msvcrt/float.h new file mode 100644 index 00000000000..426237043c4 --- /dev/null +++ b/reactos/include/msvcrt/float.h @@ -0,0 +1,199 @@ +/* + * float.h + * + * Constants related to floating point arithmetic. + * + * Also included here are some non-ANSI bits for accessing the floating + * point controller. + * + * NOTE: GCC provides float.h, and it is probably more accurate than this, + * but it doesn't include the non-standard stuff for accessing the + * fp controller. (TODO: Move those bits elsewhere?) Thus it is + * probably not a good idea to use the GCC supplied version instead + * of this header. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.3 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ + +#ifndef _FLOAT_H_ +#define _FLOAT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define FLT_ROUNDS 1 +#define FLT_GUARD 1 +#define FLT_NORMALIZE 1 + +/* + * The characteristics of float. + */ + +/* The radix for floating point representation. */ +#define FLT_RADIX 2 + +/* Decimal digits of precision. */ +#define FLT_DIG 6 + +/* Smallest number such that 1+x != 1 */ +#define FLT_EPSILON 1.19209290e-07F + +/* The number of base FLT_RADIX digits in the mantissa. */ +#define FLT_MANT_DIG 24 + +/* The maximum floating point number. */ +#define FLT_MAX 3.40282347e+38F + +/* Maximum n such that FLT_RADIX^n - 1 is representable. */ +#define FLT_MAX_EXP 128 + +/* Maximum n such that 10^n is representable. */ +#define FLT_MAX_10_EXP 38 + +/* Minimum normalized floating-point number. */ +#define FLT_MIN 1.17549435e-38F + +/* Minimum n such that FLT_RADIX^n is a normalized number. */ +#define FLT_MIN_EXP (-125) + +/* Minimum n such that 10^n is a normalized number. */ +#define FLT_MIN_10_EXP (-37) + + +/* + * The characteristics of double. + */ +#define DBL_DIG 15 +#define DBL_EPSILON 1.1102230246251568e-16 +#define DBL_MANT_DIG 53 +#define DBL_MAX 1.7976931348623157e+308 +#define DBL_MAX_EXP 1024 +#define DBL_MAX_10_EXP 308 +#define DBL_MIN 2.2250738585072014e-308 +#define DBL_MIN_EXP (-1021) +#define DBL_MIN_10_EXP (-307) + + +/* + * The characteristics of long double. + * NOTE: long double is the same as double. + */ +#define LDBL_DIG 15 +#define LDBL_EPSILON 1.1102230246251568e-16L +#define LDBL_MANT_DIG 53 +#define LDBL_MAX 1.7976931348623157e+308L +#define LDBL_MAX_EXP 1024 +#define LDBL_MAX_10_EXP 308 +#define LDBL_MIN 2.2250738585072014e-308L +#define LDBL_MIN_EXP (-1021) +#define LDBL_MIN_10_EXP (-307) + + +/* + * Functions and definitions for controlling the FPU. + */ +#ifndef __STRICT_ANSI__ + +/* TODO: These constants are only valid for x86 machines */ + +/* Control word masks for unMask */ +#define _MCW_EM 0x0008001F /* Error masks */ +#define _MCW_IC 0x00040000 /* Infinity */ +#define _MCW_RC 0x00000300 /* Rounding */ +#define _MCW_PC 0x00030000 /* Precision */ + +/* Control word values for unNew (use with related unMask above) */ +#define _EM_INVALID 0x00000010 +#define _EM_DENORMAL 0x00080000 +#define _EM_ZERODIVIDE 0x00000008 +#define _EM_OVERFLOW 0x00000004 +#define _EM_UNDERFLOW 0x00000002 +#define _EM_INEXACT 0x00000001 +#define _IC_AFFINE 0x00040000 +#define _IC_PROJECTIVE 0x00000000 +#define _RC_CHOP 0x00000300 +#define _RC_UP 0x00000200 +#define _RC_DOWN 0x00000100 +#define _RC_NEAR 0x00000000 +#define _PC_24 0x00020000 +#define _PC_53 0x00010000 +#define _PC_64 0x00000000 + + +/* 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. */ +unsigned int _controlfp (unsigned int unNew, unsigned int unMask); +unsigned int _control87 (unsigned int unNew, unsigned int unMask); + + +unsigned int _clearfp (void); /* Clear the FPU status word */ +unsigned int _statusfp (void); /* Report the FPU status word */ +#define _clear87 _clearfp +#define _status87 _statusfp + +void _fpreset (void); /* Reset the FPU */ + +/* Global 'variable' for the current floating point error code. */ +extern int * __fpecode(void); +#define _fpecode (*(__fpecode())) + +/* + * IEEE recommended functions + */ + +double _chgsign (double x); +double _copysign (double dTo, double dFrom); +double _logb (double x); +double _nextafter (double x, double y); +double _scalb (double x, long n); + +/* Return values for fpclass. */ +#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */ +#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */ +#define _FPCLASS_NINF 0x0004 /* Negative Infinity */ +#define _FPCLASS_NN 0x0008 /* Negative Normal */ +#define _FPCLASS_ND 0x0010 /* Negative Denormal */ +#define _FPCLASS_NZ 0x0020 /* Negative Zero */ +#define _FPCLASS_PZ 0x0040 /* Positive Zero */ +#define _FPCLASS_PD 0x0080 /* Positive Denormal */ +#define _FPCLASS_PN 0x0100 /* Positive Normal */ +#define _FPCLASS_PINF 0x0200 /* Positive Infinity */ + +int _finite (double x); +int _fpclass (double x); +int _isnan (double x); +int _isinf (double x); // not exported + +int _isnanl (long double x); // not exported +int _isinfl (long double x); // not exported + +#define isnan(x) _isnan(x) +#define isinf(x) _isinf(x) + +#endif /* Not __STRICT_ANSI__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _FLOAT_H_ */ diff --git a/reactos/include/msvcrt/io.h b/reactos/include/msvcrt/io.h new file mode 100644 index 00000000000..70522fab69a --- /dev/null +++ b/reactos/include/msvcrt/io.h @@ -0,0 +1,155 @@ +/* + * io.h + * + * System level I/O functions and types. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.4 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ +/* Appropriated for Reactos Crtdll by Ariadne */ +/* added D_OK */ +/* changed get_osfhandle and open_osfhandle */ +/* added fileno as macro */ +#ifndef _IO_H_ +#define _IO_H_ + +#ifndef __STRICT_ANSI__ + +#include + +#include + + +/* We need the definition of FILE anyway... */ +#include + +/* MSVC's io.h contains the stuff from dir.h, so I will too. + * NOTE: This also defines off_t, the file offset type, through + * and inclusion of sys/types.h */ +#include + +/* TODO: Maximum number of open handles has not been tested, I just set + * it the same as FOPEN_MAX. */ +#define HANDLE_MAX FOPEN_MAX + + +/* Some defines for _access nAccessMode (MS doesn't define them, but + * it doesn't seem to hurt to add them). */ +#define F_OK 0 /* Check for file existence */ +#define W_OK 2 /* Check for write permission */ +#define R_OK 4 /* Check for read permission */ +/* TODO: Is this safe? X_OK not supported directly... */ +#define X_OK R_OK /* Check for execute permission */ +#define D_OK 0x10 + + + +#ifdef __cplusplus +extern "C" { +#endif + +int _access (const char* szFileName, int nAccessMode); +int _chmod (const char* szPath, int nMode); +int _chsize (int nHandle, long lnNewSize); +int _close (int nHandle); +int _commit(int _fd); +int _creat (const char* szFileName, int nAccessMode); +int _dup (int nHandle); +int _dup2 (int nOldHandle, int nNewHandle); +long _filelength (int nHandle); +__int64 _filelengthi64(int nHandle); +int _fileno (FILE* fileGetHandle); +void* _get_osfhandle (int nHandle); +int _isatty (int nHandle); + +/* In a very odd turn of events this function is excluded from those + * files which define _STREAM_COMPAT. This is required in order to + * build GNU libio because of a conflict with _eof in streambuf.h + * line 107. Actually I might just be able to change the name of + * the enum member in streambuf.h... we'll see. TODO */ +#ifndef _STREAM_COMPAT +int _eof (int nHandle); +#endif + +/* LK_... locking commands defined in sys/locking.h. */ +int _locking (int nHandle, int nCmd, long lnLockRegionLength); + +off_t _lseek(int _fd, off_t _offset, int _whence); +__int64 _lseeki64(int _fildes, __int64 _offset, int _whence); +int _open (const char* szFileName, int nFlags, ...); +int _open_osfhandle (void *lnOSHandle, int nFlags); +int _pipe (int *naHandles, unsigned int unSize, int nMode); +size_t _read(int _fd, void *_buf, size_t _nbyte); + +/* SH_... flags for nFlag defined in share.h */ +int _sopen (char* szFileName, int nAccess, int nFlag, int nMode); + +long _tell(int nHandle); +__int64 _telli64(int nHandle); +unsigned _umask(unsigned unMode); +int _unlink(const char* szFileName); +size_t _write(int _fd, const void *_buf, size_t _nbyte); + + +/* wide character functions */ +int _waccess(const wchar_t *_path, int _amode); +int _wchmod(const wchar_t *filename, int mode); +int _wcreat(const wchar_t *filename, int mode); + +int _wopen(const wchar_t *_path, int _oflag,...); +int _wsopen(wchar_t *path, int access, int shflag, int mode); +int _wunlink(const wchar_t *filename); + + +#ifndef _NO_OLDNAMES +/* + * Non-underscored versions of non-ANSI functions to improve portability. + * These functions live in libmoldname.a. + */ + +#define access _access +#define chmod _chmod +#define chsize _chsize +#define close _close +#define creat _creat +#define dup _dup +#define dup2 _dup2 +#define eof _eof +#define filelength _filelength +#define fileno(f) ((f)->_file) +#define isatty _isatty +#define lseek _lseek +#define open _open +#define read _read +#define sopen(path,access,shflag,mode) _open((path), (access)|(shflag), (mode)) +#define tell(file) _lseek(_file, 0, SEEK_CUR) +#define umask _umask +#define unlink _unlink +#define write _write + +#endif /* Not _NO_OLDNAMES */ + +#ifdef __cplusplus +} +#endif + +#endif /* Not strict ANSI */ + +#endif /* _IO_H_ not defined */ diff --git a/reactos/include/msvcrt/locale.h b/reactos/include/msvcrt/locale.h new file mode 100644 index 00000000000..3cdc303b76e --- /dev/null +++ b/reactos/include/msvcrt/locale.h @@ -0,0 +1,84 @@ +/* + * locale.h + * + * Functions and types for localization (ie. changing the appearance of + * output based on the standards of a certain country). + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.3 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ + +#ifndef _LOCALE_H_ +#define _LOCALE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * NOTE: I have tried to test this, but I am limited by my knowledge of + * locale issues. The structure does not bomb if you look at the + * values, and 'decimal_point' even seems to be correct. But the + * rest of the values are, by default, not particularly useful + * (read meaningless and not related to the international settings + * of the system). + */ + +#define LC_ALL 0 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_MONETARY 3 +#define LC_NUMERIC 4 +#define LC_TIME 5 + +/* + * The structure returned by 'localeconv'. + */ +struct lconv +{ + char* decimal_point; + char* thousands_sep; + char* grouping; + char* int_curr_symbol; + char* currency_symbol; + char* mon_decimal_point; + char* mon_thousands_sep; + char* mon_grouping; + char* positive_sign; + char* negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; +}; + +char* setlocale (int nCategory, const char* locale); +struct lconv* localeconv (void); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/reactos/include/msvcrt/malloc.h b/reactos/include/msvcrt/malloc.h new file mode 100644 index 00000000000..2b47986a6d5 --- /dev/null +++ b/reactos/include/msvcrt/malloc.h @@ -0,0 +1,53 @@ +/* + * malloc.h + * + * Support for programs which want to use malloc.h to get memory management + * functions. Unless you absolutely need some of these functions and they are + * not in the ANSI headers you should use the ANSI standard header files + * instead. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.3 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ + +#ifndef __STRICT_ANSI__ + +#ifndef _MALLOC_H_ +#define _MALLOC_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void * _expand( void *memblock, size_t size ); +int _heapchk (void); /* Verify heap integrety. */ +int _heapmin (void); /* Return unused heap to the OS. */ +int _heapset (unsigned int unFill); +size_t _msize (void* pBlock); + +#ifdef __cplusplus +} +#endif + +#endif /* Not _MALLOC_H_ */ + +#endif /* Not __STRICT_ANSI__ */ diff --git a/reactos/include/msvcrt/math.h b/reactos/include/msvcrt/math.h new file mode 100644 index 00000000000..51bdf2ca90b --- /dev/null +++ b/reactos/include/msvcrt/math.h @@ -0,0 +1,161 @@ +/* + * math.h + * + * Mathematical functions. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.3 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ +// added modfl + +#ifndef _MATH_H_ +#define _MATH_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * HUGE_VAL is returned by strtod when the value would overflow the + * representation of 'double'. There are other uses as well. + * + * __imp__HUGE is a pointer to the actual variable _HUGE in + * MSVCRT.DLL. If we used _HUGE directly we would get a pointer + * to a thunk function. + * + * NOTE: The CRTDLL version uses _HUGE_dll instead. + */ +#if __MSVCRT__ +extern double* __imp__HUGE; +#define HUGE_VAL (*__imp__HUGE) +#else +/* CRTDLL */ +extern double* _HUGE_dll; +#define HUGE_VAL (*_HUGE_dll) +#endif + + +struct _exception +{ + int type; + char *name; + double arg1; + double arg2; + double retval; +}; + +/* + * Types for the above _exception structure. + */ + +#define _DOMAIN 1 /* domain error in argument */ +#define _SING 2 /* singularity */ +#define _OVERFLOW 3 /* range overflow */ +#define _UNDERFLOW 4 /* range underflow */ +#define _TLOSS 5 /* total loss of precision */ +#define _PLOSS 6 /* partial loss of precision */ + +/* + * Exception types with non-ANSI names for compatibility. + */ + +#ifndef __STRICT_ANSI__ +#ifndef _NO_OLDNAMES + +#define DOMAIN _DOMAIN +#define SING _SING +#define OVERFLOW _OVERFLOW +#define UNDERFLOW _UNDERFLOW +#define TLOSS _TLOSS +#define PLOSS _PLOSS + +#endif /* Not _NO_OLDNAMES */ +#endif /* Not __STRICT_ANSI__ */ + + +double sin (double x); +double cos (double x); +double tan (double x); +double sinh (double x); +double cosh (double x); +double tanh (double x); +double asin (double x); +double acos (double x); +double atan (double x); +double atan2 (double y, double x); +double exp (double x); +double log (double x); +double log10 (double x); +double pow (double x, double y); +long double powl (long double x,long double y); +double sqrt (double x); +double ceil (double x); +double floor (double x); +double fabs (double x); +double ldexp (double x, int n); +double frexp (double x, int* exp); +double modf (double x, double* ip); +long double modfl (long double x,long double* ip); +double fmod (double x, double y); + + +#ifndef __STRICT_ANSI__ + +/* Complex number (for cabs) */ +struct _complex +{ + double x; /* Real part */ + double y; /* Imaginary part */ +}; + +double _cabs (struct _complex x); +double _hypot (double x, double y); +double _j0 (double x); +double _j1 (double x); +double _jn (int n, double x); +double _y0 (double x); +double _y1 (double x); +double _yn (int n, double x); + +#ifndef _NO_OLDNAMES + +/* + * Non-underscored versions of non-ANSI functions. These reside in + * liboldnames.a. Provided for extra portability. + */ +double cabs (struct _complex x); +double hypot (double x, double y); +double j0 (double x); +double j1 (double x); +double jn (int n, double x); +double y0 (double x); +double y1 (double x); +double yn (int n, double x); + +#endif /* Not _NO_OLDNAMES */ + +#endif /* Not __STRICT_ANSI__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* Not _MATH_H_ */ + diff --git a/reactos/include/msvcrt/mbctype.h b/reactos/include/msvcrt/mbctype.h new file mode 100644 index 00000000000..686b3639dd8 --- /dev/null +++ b/reactos/include/msvcrt/mbctype.h @@ -0,0 +1,49 @@ +#ifndef _MBCTYPE_H +#define _MBCTYPE_H + +#ifdef __cplusplus +extern "C" { +#endif + +//#define _MS 0x01 +//#define _MP 0x02 +//#define _M1 0x04 +//#define _M2 0x08 + +#define _MBC_SINGLE 0 +#define _MBC_LEAD 1 +#define _MBC_TRAIL 2 +#define _MBC_ILLEGAL -1 + +#define _MB_CP_SBCS 0 +#define _MB_CP_OEM -2 +#define _MB_CP_ANSI -3 +#define _MB_CP_LOCALE -4 + +#define _KNJ_M ((char)0x01) /* Non-punctuation of Kana-set */ +#define _KNJ_P ((char)0x02) /* Punctuation of Kana-set */ +#define _KNJ_1 ((char)0x04) /* Legal 1st byte of double byte stream */ +#define _KNJ_2 ((char)0x08) /* Legal 2nd btye of double byte stream */ + + +#define ___ 0 +#define _1_ _KNJ_1 /* Legal 1st byte of double byte code */ +#define __2 _KNJ_2 /* Legal 2nd byte of double byte code */ +#define _M_ _KNJ_M /* Non-puntuation in Kana-set */ +#define _P_ _KNJ_P /* Punctuation of Kana-set */ +#define _12 (_1_|__2) +#define _M2 (_M_|__2) +#define _P2 (_P_|__2) + +extern char _jctype[257]; + + +int _ismbbkalnum( unsigned int c ); +int _ismbbkana( unsigned char c ); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/reactos/include/msvcrt/mbstring.h b/reactos/include/msvcrt/mbstring.h new file mode 100644 index 00000000000..a7bc5ba2af8 --- /dev/null +++ b/reactos/include/msvcrt/mbstring.h @@ -0,0 +1,108 @@ +#ifndef _MBSTRING_H_ +#define _MBSTRING_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +size_t _mbstrlen(const char *str); + + + + +int _mbbtype(unsigned char c, int type); +int _mbsbtype( const unsigned char *str, size_t n ); + +unsigned int _mbbtombc(unsigned int c); +unsigned int _mbctombb(unsigned int c); + +unsigned char * _mbscat(unsigned char *dst, const unsigned char *src); +unsigned char * _mbschr(unsigned char *str, unsigned char* c); +int _mbscmp(const unsigned char *, const unsigned char *); +int _mbscoll(const unsigned char *, const unsigned char *); +unsigned char * _mbscpy(unsigned char *, const unsigned char *); +size_t _mbscspn(const unsigned char *, const unsigned char *); +unsigned char * _mbsdup(const unsigned char *str); +int _mbsicmp(const unsigned char *, const unsigned char *); +int _mbsicoll(const unsigned char *, const unsigned char *); +size_t _mbslen(const unsigned char *str); + +unsigned char * _mbsncat(unsigned char *, const unsigned char *, size_t); +unsigned char * _mbsnbcat(unsigned char *, const unsigned char *, size_t); + + +int _mbsncmp(const unsigned char *, const unsigned char *, size_t); +int _mbsnbcmp(const unsigned char *, const unsigned char *, size_t); + +int _mbsncoll(const unsigned char *, const unsigned char *, size_t); +int _mbsnbcoll(const unsigned char *, const unsigned char *, size_t); + + +unsigned char * _mbsncpy(unsigned char *, const unsigned char *, size_t); +unsigned char * _mbsnbcpy(unsigned char *, const unsigned char *, size_t); + +int _mbsnicmp(const unsigned char *, const unsigned char *, size_t); +int _mbsnbicmp(const unsigned char *, const unsigned char *, size_t); + +int _mbsnicoll(const unsigned char *, const unsigned char *, size_t); +int _mbsnbicoll(const unsigned char *, const unsigned char *, size_t); + +unsigned char * _mbsnset(unsigned char *, unsigned int, size_t); +unsigned char * _mbsnbset(unsigned char *, unsigned int, size_t); + +size_t _mbsnccnt(const unsigned char *, size_t); + + +unsigned char * _mbspbrk(const unsigned char *, const unsigned char *); +unsigned char * _mbsrchr(const unsigned char *, unsigned int); +unsigned char * _mbsrev(unsigned char *); +unsigned char * _mbsset(unsigned char *, unsigned int); +size_t _mbsspn(const unsigned char *, const unsigned char *); + +unsigned char * _mbsstr(const unsigned char *, const unsigned char *); +unsigned char * _mbstok(unsigned char *, unsigned char *); + +unsigned char * _mbslwr(unsigned char *str); +unsigned char * _mbsupr(unsigned char *str); + +size_t _mbclen(const unsigned char *); +void _mbccpy(unsigned char *, const unsigned char *); + +/* tchar routines */ + +unsigned char * _mbsdec(const unsigned char *, const unsigned char *); +unsigned char * _mbsinc(const unsigned char *); +size_t _mbsnbcnt(const unsigned char *, size_t); +unsigned int _mbsnextc (const unsigned char *); +unsigned char * _mbsninc(const unsigned char *, size_t); +unsigned char * _mbsspnp(const unsigned char *, const unsigned char *); + +/* character routines */ + +int _ismbcalnum(unsigned int c); +int _ismbcalpha(unsigned int c); +int _ismbcdigit(unsigned int c); +int _ismbcgraph(unsigned int c); +int _ismbclegal(unsigned int c); +int _ismbclower(unsigned int c); +int _ismbcprint(unsigned int c); +int _ismbcpunct(unsigned int c); +int _ismbcspace(unsigned int c); +int _ismbcupper(unsigned int c); + +unsigned int _mbctolower(unsigned int); +unsigned int _mbctoupper(unsigned int); + + +int _ismbblead( unsigned int c); +int _ismbbtrail( unsigned int c); +int _ismbslead( const unsigned char *s, const unsigned char *c); +int _ismbstrail( const unsigned char *s, const unsigned char *c); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/reactos/lib/msvcrt/include/msvcrtdbg.h b/reactos/include/msvcrt/msvcrtdbg.h old mode 100755 new mode 100644 similarity index 96% rename from reactos/lib/msvcrt/include/msvcrtdbg.h rename to reactos/include/msvcrt/msvcrtdbg.h index ad7585f784c..3916f9ad63d --- a/reactos/lib/msvcrt/include/msvcrtdbg.h +++ b/reactos/include/msvcrt/msvcrtdbg.h @@ -1,43 +1,43 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: include/msvcrt/msvcrtdbg.h - * PURPOSE: Useful debugging macros - * PROGRAMMER: - * UPDATE HISTORY: - * - */ - -/* - * NOTE: Define NDEBUG before including this header to disable debugging - * macros - */ - -#ifndef __MSVCRT_DEBUG -#define __MSVCRT_DEBUG - -#include - -#if 0 -#ifdef NDEBUG -#undef NDEBUG -#endif -#endif - -#ifdef DBG -#define DPRINT1(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); -#define CHECKPOINT1 do { DbgPrint("MSVCRT:%s:%d\n",__FILE__,__LINE__); } while(0); -#else -#define DPRINT1(args...) -#define CHECKPOINT1 -#endif - -#if !defined(NDEBUG) && defined(DBG) -#define DPRINT(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); -#define CHECKPOINT do { DbgPrint("MSVCRT:%s:%d\n",__FILE__,__LINE__); } while(0); -#else -#define DPRINT(args...) -#define CHECKPOINT -#endif /* NDEBUG */ - -#endif /* __MSVCRT_DEBUG */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/msvcrt/msvcrtdbg.h + * PURPOSE: Useful debugging macros + * PROGRAMMER: + * UPDATE HISTORY: + * + */ + +/* + * NOTE: Define NDEBUG before including this header to disable debugging + * macros + */ + +#ifndef __MSVCRT_DEBUG +#define __MSVCRT_DEBUG + +#include + +#if 0 +#ifdef NDEBUG +#undef NDEBUG +#endif +#endif + +#ifdef DBG +#define DPRINT1(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); +#define CHECKPOINT1 do { DbgPrint("MSVCRT:%s:%d\n",__FILE__,__LINE__); } while(0); +#else +#define DPRINT1(args...) +#define CHECKPOINT1 +#endif + +#if !defined(NDEBUG) && defined(DBG) +#define DPRINT(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); +#define CHECKPOINT do { DbgPrint("MSVCRT:%s:%d\n",__FILE__,__LINE__); } while(0); +#else +#define DPRINT(args...) +#define CHECKPOINT +#endif /* NDEBUG */ + +#endif /* __MSVCRT_DEBUG */ diff --git a/reactos/include/msvcrt/process.h b/reactos/include/msvcrt/process.h new file mode 100644 index 00000000000..fbe12b1fe3d --- /dev/null +++ b/reactos/include/msvcrt/process.h @@ -0,0 +1,160 @@ +/* + * process.h + * + * Function calls for spawning child processes. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.3 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ +/* Appropriated for Reactos Crtdll by Ariadne */ +/* changed second argument of cwait from nPID to hProc */ + +#ifndef _PROCESS_H_ +#define _PROCESS_H_ + +#ifndef __STRICT_ANSI__ + +#ifdef __cplusplus +extern "C" { +#endif + +void _cexit(void); +void _c_exit(void); + +/* + * Constants for cwait actions. + * Obsolete for Win32. + */ +#define _WAIT_CHILD 0 +#define _WAIT_GRANDCHILD 1 + +#ifndef _NO_OLDNAMES +#define WAIT_CHILD _WAIT_CHILD +#define WAIT_GRANDCHILD _WAIT_GRANDCHILD +#endif /* Not _NO_OLDNAMES */ + +int _cwait (int* pnStatus, int hProc, int nAction); + +int _getpid(void); + +int _execl (const char* szPath, const char* szArgv0, ...); +int _execle (const char* szPath, const char* szArgv0, ...); +int _execlp (const char* szPath, const char* szArgv0, ...); +int _execlpe (const char* szPath, const char* szArgv0, ...); +int _execv (const char* szPath, char* const* szaArgv); +int _execve (const char* szPath, char* const* szaArgv, char* const* szaEnv); +int _execvp (const char* szPath, char* const* szaArgv); +int _execvpe (const char* szPath, char* const* szaArgv, char* const* szaEnv); + + +/* + * Mode constants for spawn functions. + */ +#define _P_WAIT 0 +#define _P_NOWAIT 1 +#define _P_OVERLAY 2 +#define _OLD_P_OVERLAY _P_OVERLAY +#define _P_NOWAITO 3 +#define _P_DETACH 4 + +#ifndef _NO_OLDNAMES +#define P_WAIT _P_WAIT +#define P_NOWAIT _P_NOWAIT +#define P_OVERLAY _P_OVERLAY +#define OLD_P_OVERLAY _OLD_P_OVERLAY +#define P_NOWAITO _P_NOWAITO +#define P_DETACH _P_DETACH +#endif /* Not _NO_OLDNAMES */ + +int _spawnl (int nMode, const char* szPath, const char* szArgv0, ...); +int _spawnle (int nMode, const char* szPath, const char* szArgv0,...); +int _spawnlp (int nMode, const char* szPath, const char* szArgv0,...); +int _spawnlpe (int nMode, const char* szPath, const char* szArgv0,...); +int _spawnv (int nMode, const char* szPath, char* const* szaArgv); +int _spawnve (int nMode, const char* szPath, char* const* szaArgv, char* const* szaEnv); +int _spawnvp (int nMode, const char* szPath, char* const* szaArgv); +int _spawnvpe (int nMode, const char* szPath, char* const* szaArgv, char* const* szaEnv); +/* + * The functions _beginthreadex and _endthreadex are not provided by CRTDLL. + * They are provided by MSVCRT. + * + * NOTE: Apparently _endthread calls CloseHandle on the handle of the thread, + * making for race conditions if you are not careful. Basically you have to + * make sure that no-one is going to do *anything* with the thread handle + * after the thread calls _endthread or returns from the thread function. + * + * NOTE: No old names for these functions. Use the underscore. + */ +unsigned long + _beginthread (void (__cdecl *pfuncStart)(void *), + unsigned unStackSize, void* pArgList); +void _endthread (void); + +#if __MSVCRT__ +unsigned long + _beginthreadex (void *pSecurity, unsigned unStackSize, + unsigned (__stdcall *pfuncStart)(void*), void* pArgList, + unsigned unInitFlags, unsigned* pThreadAddr); +void _endthreadex (unsigned unExitCode); +#endif + + +void *_loaddll (char *name); +int _unloaddll(void *handle); + +unsigned long __threadid(void); +#define _threadid __threadid() +void * __threadhandle(void); + + +#ifndef _NO_OLDNAMES + +#define cwait _cwait +#define getpid _getpid +#define execl _execl +#define execle _execle +#define execlp _execlp +#define execlpe _execlpe + +#define execv _execv +#define execve _execve +#define execvp _execvp +#define execvpe _execvpe + +#define spawnl _spawnl +#define spawnle _spawnle +#define spawnlp _spawnlp +#define spawnlpe _spawnlpe + +#define spawnv _spawnv +#define spawnve _spawnve +#define spawnvp _spawnvp +#define spawnvpe _spawnvpe + + +#endif /* Not _NO_OLDNAMES */ + +#ifdef __cplusplus +} +#endif + +#endif /* Not __STRICT_ANSI__ */ + +#endif /* _PROCESS_H_ not defined */ diff --git a/reactos/include/msvcrt/search.h b/reactos/include/msvcrt/search.h new file mode 100644 index 00000000000..b42c4d006cc --- /dev/null +++ b/reactos/include/msvcrt/search.h @@ -0,0 +1,35 @@ + +#ifndef _SEARCH_H_ +#define _SEARCH_H_ + +//char *key +//void *data + +//enum { FIND, ENTER } ACTION; +//enum { preorder, postorder, endorder, leaf } VISIT; + +#include +#include + + +//The Single UNIX ® Specification, Version 2 Copyright © 1997 The Open Group + +//int hcreate(size_t); +//void hdestroy(void); +//ENTRY *hsearch(ENTRY, ACTION); +//void insque(void *, void *); +void *_lfind(const void *, const void *, size_t *, + size_t, int (*)(const void *, const void *)); +void *_lsearch(const void *, void *, size_t *, + size_t, int (*)(const void *, const void *)); +//void remque(void *); +//void *tdelete(const void *, void **, +// int(*)(const void *, const void *)); +//void *tfind(const void *, void *const *, +// int(*)(const void *, const void *)); +//void *tsearch(const void *, void **, +// int(*)(const void *, const void *)); +//void twalk(const void *, +// void (*)(const void *, VISIT, int )); + +#endif diff --git a/reactos/include/msvcrt/share.h b/reactos/include/msvcrt/share.h new file mode 100644 index 00000000000..8e3af3f29ed --- /dev/null +++ b/reactos/include/msvcrt/share.h @@ -0,0 +1,17 @@ +#ifndef _include_share_h_ +#define _include_share_h_ + + +#define SH_COMPAT 0x0000 +#define SH_DENYRW 0x0010 +#define SH_DENYWR 0x0020 +#define SH_DENYRD 0x0030 +#define SH_DENYNO 0x0040 + +#define _SH_COMPAT SH_COMPAT +#define _SH_DENYRW SH_DENYRW +#define _SH_DENYWR SH_DENYWR +#define _SH_DENYRD SH_DENYRD +#define _SH_DENYNO SH_DENYNO + +#endif diff --git a/reactos/include/msvcrt/signal.h b/reactos/include/msvcrt/signal.h new file mode 100644 index 00000000000..5aa281151ae --- /dev/null +++ b/reactos/include/msvcrt/signal.h @@ -0,0 +1,111 @@ +/* + * signal.h + * + * A way to set handlers for exceptional conditions (also known as signals). + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.3 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ +/* added some extra signal constants */ +#ifndef _SIGNAL_H_ +#define _SIGNAL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The prototypes (below) are the easy part. The hard part is figuring + * out what signals are available and what numbers they are assigned + * along with appropriate values of SIG_DFL and SIG_IGN. + */ + +/* + * A pointer to a signal handler function. A signal handler takes a + * single int, which is the signal it handles. + */ +typedef void (*_p_sig_fn_t)(int nSig); + +/* + * These are special values of signal handler pointers which are + * used to send a signal to the default handler (SIG_DFL), ignore + * the signal (SIG_IGN), or indicate an error return (SIG_ERR). + */ +#define SIG_DFL ((_p_sig_fn_t) 0) +#define SIG_IGN ((_p_sig_fn_t) 1) +#define SIG_ERR ((_p_sig_fn_t) -1) + +/* + * The actual signal values. Using other values with signal + * produces a SIG_ERR return value. + * + * NOTE: SIGINT is produced when the user presses Ctrl-C. + * SIGILL has not been tested. + * SIGFPE doesn't seem to work? + * SIGSEGV does not catch writing to a NULL pointer (that shuts down + * your app; can you say "segmentation violation core dump"?). + * SIGTERM comes from what kind of termination request exactly? + * SIGBREAK is indeed produced by pressing Ctrl-Break. + * SIGABRT is produced by calling abort. + * TODO: The above results may be related to not installing an appropriate + * structured exception handling frame. Results may be better if I ever + * manage to get the SEH stuff down. + */ +#define SIGINT 2 /* Interactive attention */ +#define SIGILL 4 /* Illegal instruction */ +#define SIGFPE 8 /* Floating point error */ +#define SIGSEGV 11 /* Segmentation violation */ +#define SIGTERM 15 /* Termination request */ +#define SIGBREAK 21 /* Control-break */ +#define SIGABRT 22 /* Abnormal termination (abort) */ + +#define SIGALRM 293 +#define SIGHUP 294 +/* SIGINT is ansi */ +#define SIGKILL 296 +#define SIGPIPE 297 +#define SIGQUIT 298 +#define SIGUSR1 299 +#define SIGUSR2 300 + +#define SIGNOFP 301 +#define SIGTRAP 302 +#define SIGTIMR 303 /* Internal for setitimer (SIGALRM, SIGPROF) */ +#define SIGPROF 304 +#define SIGMAX 320 + +/* + * Call signal to set the signal handler for signal sig to the + * function pointed to by handler. Returns a pointer to the + * previous handler, or SIG_ERR if an error occurs. Initially + * unhandled signals defined above will return SIG_DFL. + */ +_p_sig_fn_t signal(int sig, _p_sig_fn_t func); + +/* + * Raise the signal indicated by sig. Returns non-zero on success. + */ +int raise (int sig); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/reactos/include/msvcrt/stdarg.h b/reactos/include/msvcrt/stdarg.h new file mode 100644 index 00000000000..661e0dfdb16 --- /dev/null +++ b/reactos/include/msvcrt/stdarg.h @@ -0,0 +1,114 @@ +/* + * stdarg.h + * + * Provides facilities for stepping through a list of function arguments of + * an unknown number and type. + * + * NOTE: Gcc should provide stdarg.h, and I believe their version will work + * with crtdll. If necessary I think you can replace this with the GCC + * stdarg.h (or is it vararg.h). + * + * Note that the type used in va_arg is supposed to match the actual type + * *after default promotions*. Thus, va_arg (..., short) is not valid. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.4 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ +/* Appropriated for Reactos Crtdll by Ariadne */ + +#ifndef _STDARG_H_ +#define _STDARG_H_ + +/* + * Don't do any of this stuff for the resource compiler. + */ +#ifndef RC_INVOKED + +/* + * I was told that Win NT likes this. + */ +#ifndef _VA_LIST_DEFINED +#define _VA_LIST_DEFINED +#endif + +#ifndef _VA_LIST +#define _VA_LIST +typedef char* va_list; +#endif + + +/* + * Amount of space required in an argument list (ie. the stack) for an + * argument of type t. + */ +#define __va_argsiz(t) \ + (((sizeof(t) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) + + +/* + * Start variable argument list processing by setting AP to point to the + * argument after pN. + */ +#ifdef __GNUC__ +/* + * In GNU the stack is not necessarily arranged very neatly in order to + * pack shorts and such into a smaller argument list. Fortunately a + * neatly arranged version is available through the use of __builtin_next_arg. + */ +#ifndef va_start +#define va_start(ap, pN) \ + ((ap) = ((va_list) __builtin_next_arg(pN))) +#endif +#else +/* + * For a simple minded compiler this should work (it works in GNU too for + * vararg lists that don't follow shorts and such). + */ +#define va_start(ap, pN) \ + ((ap) = ((va_list) (&pN) + __va_argsiz(pN))) +#endif + + +/* + * End processing of variable argument list. In this case we do nothing. + */ +#ifndef va_end +#define va_end(ap) ((void)0) +#endif + + +/* + * Increment ap to the next argument in the list while returing a + * pointer to what ap pointed to first, which is of type t. + * + * We cast to void* and then to t* because this avoids a warning about + * increasing the alignment requirement. + */ + +#ifndef va_arg +#define va_arg(ap, t) \ + (((ap) = (ap) + __va_argsiz(t)), \ + *((t*) (void*) ((ap) - __va_argsiz(t)))) +#endif + +#endif /* Not RC_INVOKED */ + +#endif /* not _STDARG_H_ */ + diff --git a/reactos/include/msvcrt/stddef.h b/reactos/include/msvcrt/stddef.h new file mode 100644 index 00000000000..f209f8a2ca3 --- /dev/null +++ b/reactos/include/msvcrt/stddef.h @@ -0,0 +1,174 @@ +/* + * stddef.h + * + * Standard type definitions provided by the C library. + * + * NOTE: Actually supplied by the compiler (correct?). As such, GCC + * supplies a version of this header file. Unfortunately, GCC's + * version is all tied up with the way other headers for the + * GNU C library are implemented (or vice-versa), in a similar + * way to how the other Mingw32 headers are dependent on + * certain internals of this file. It is not clear to me whether + * you can safely use the GCC version in place of this version. + * TODO: Line up usage in other header files to work with GCC + * stddef.h. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.5 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ + + +#ifndef __MSVCRT_STDDEF_H_ + +/* + * Any one of these symbols __need_* means that a standard header file + * wants us just to define one data type. So don't define + * the symbols that indicate this file's entire job has been done. + */ +#if (!defined(__need_wchar_t) && !defined(__need_wint_t) \ + && !defined(__need_size_t) && !defined(__need_ptrdiff_t) \ + && !defined(__need_NULL)) +#define __MSVCRT_STDDEF_H_ +#endif + +/* + * NOTE: The following typedefs are done using __xxx_TYPE__ defines followed + * by typedefs using those defines. I have chosen to do it this way because + * GCC supplies definitions for __xxx_TYPE__ macros and if, for example, your + * size_t is typedef'ed differently from what GCC expects it will give you + * warnings when you prototype functions like memcmp and memcpy. The values + * for __xxx_TYPE__ in this header file are the same as those given by GCC. + * Those values appear to work with the MSVCRT functions. + */ + +/* + * Signed type of difference of two pointers. + */ + +/* Define this type if we are doing the whole job, or if we want this type + * in particular. */ +#if defined (__MSVCRT_STDDEF_H_) || defined (__need_ptrdiff_t) + +#ifndef _PTRDIFF_T_ +#define _PTRDIFF_T_ +#ifndef __PTRDIFF_TYPE__ +#define __PTRDIFF_TYPE__ int +#endif +typedef __PTRDIFF_TYPE__ ptrdiff_t; +#endif + +/* If this symbol has done its job, get rid of it. */ +#undef __need_ptrdiff_t + +#endif /* __MSVCRT_STDDEF_H_ or __need_ptrdiff_t. */ + +/* + * Unsigned type of `sizeof' something. + */ + + +/* Define this type if we are doing the whole job, + * or if we want this type in particular. */ +#if defined (__MSVCRT_STDDEF_H_) || defined (__need_size_t) + +#ifndef _SIZE_T_ +#define _SIZE_T_ +#define SIZE_T_DEFINED +#define _SIZE_T +#ifndef __SIZE_TYPE__ +#define __SIZE_TYPE__ unsigned int +#endif +typedef __SIZE_TYPE__ size_t; +#endif + +#undef __need_size_t + +#endif /* __MSVCRT_STDDEF_H_ or __need_size_t. */ + +/* Wide character type. + Locale-writers should change this as necessary to + be big enough to hold unique values not between 0 and 127, + and not (wchar_t) -1, for each defined multibyte character. */ + +/* Define this type if we are doing the whole job, + or if we want this type in particular. */ +#if defined (__MSVCRT_STDDEF_H_) || defined (__need_wchar_t) + +#ifndef _WCHAR_T_ +#define _WCHAR_T_ +#define _WCHAR_T +#define _WCHAR_T_DEFINED +#ifndef __WCHAR_TYPE__ +#define __WCHAR_TYPE__ short unsigned int +#endif +#ifndef __cplusplus +typedef __WCHAR_TYPE__ wchar_t; +#endif /* C++ */ +#endif /* wchar_t not already defined */ + +#undef __need_wchar_t + +#endif /* __MSVCRT_STDDEF_H_ or __need_wchar_t. */ + +/* + * wint_t, the equivalent of int in wchar ctype functions. + */ +#if defined (__MSVCRT_STDDEF_H_) || defined (__need_wint_t) + +#ifndef _WINT_T_ +#define _WINT_T_ +#define _WINT_T /* To satisfy libstdc++ */ +#ifndef __WINT_TYPE__ +#define __WINT_TYPE__ short int +#endif /* Not defined __WINT_TYPE__ */ + +typedef __WINT_TYPE__ wint_t; +#endif /* Not defined _WINT_T_ */ + +#undef __need_wint_t + +#endif /* __MSVCRT_STDDEF_H_ or __need_wint_t. */ + + +/* + * A null pointer constant. + */ + +#if defined (__MSVCRT_STDDEF_H_) || defined (__need_NULL) + +#undef NULL +#define NULL (0) +#endif /* __MSVCRT_STDDEF_H_ or __need_NULL */ + +#undef __need_NULL + + +/* + * Offsetof, a macro for finding the offset of a member in a structure. + * Works by returning the 'address' of the MEMBER of a TYPE struct at address + * zero. + */ + +#if defined (__MSVCRT_STDDEF_H_) +#define offsetof(TYPE, MEMBER) ((size_t) &( ((TYPE *) 0)->MEMBER )) +#endif /* __MSVCRT_STDDEF_H_ */ + + +#endif /* not __MSVCRT_STDDEF_H_ */ diff --git a/reactos/include/msvcrt/stdio.h b/reactos/include/msvcrt/stdio.h new file mode 100644 index 00000000000..47f5229ea6d --- /dev/null +++ b/reactos/include/msvcrt/stdio.h @@ -0,0 +1,375 @@ +/* + * stdio.h + * + * Definitions of types and prototypes of functions for standard input and + * output. + * + * NOTE: The file manipulation functions provided by Microsoft seem to + * work with either slash (/) or backslash (\) as the path separator. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.4 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ +/* Appropriated for Reactos Crtdll by Ariadne */ +/* implemented clearerr feof ferror perror as macros */ +/* added _IOCOMMIT */ +/* added filbuf and flsbuf and fwalk */ + +#ifndef _STDIO_H_ +#define _STDIO_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define __need_size_t +#define __need_NULL +#define __need_wchar_t +#define __need_wint_t +#include + + +/* Some flags for the iobuf structure provided by djgpp stdio.h */ +#define _IOREAD 0x000010 +#define _IOWRT 0x000020 +#define _IOMYBUF 0x000040 +#define _IOEOF 0x000100 +#define _IOERR 0x000200 +#define _IOSTRG 0x000400 + +#define _IOAPPEND 0x002000 +#define _IORMONCL 0x004000 /* remove on close, for temp files */ +/* if _flag & _IORMONCL, ._name_to_remove needs freeing */ +#define _IOUNGETC 0x010000 /* there is an ungetc'ed character in the buffer */ +#define _IOCOMMIT 0x008000 + +#define _IODIRTY 0x000080 +#define _IOAHEAD 0x000008 +#define _IORW (_IOREAD | _IOWRITE ) + + +/* + * I used to include stdarg.h at this point, in order to allow for the + * functions later on in the file which use va_list. That conflicts with + * using stdio.h and varargs.h in the same file, so I do the typedef myself. + */ +//#ifndef _VA_LIST +//#define _VA_LIST +//typedef char* va_list; +//#endif +#include + +/* + * FILE should be used as a pointer to an opaque data type. Do not rely on + * anything else, especially the size or contents of this structure! + */ +#ifndef _FILE_DEFINED +typedef struct { + char *_ptr; + int _cnt; + char *_base; + int _flag; + int _file; + int _ungotchar; + int _bufsiz; + char *_name_to_remove; +} FILE; +#define _FILE_DEFINED +#endif + +//#define _fillsize _bufsiz + +/* + * The three standard file pointers provided by the run time library. + * NOTE: These will go to the bit-bucket silently in GUI applications! + */ +extern FILE _iob[]; /* an array of FILE */ +#define stdin (&_iob[0]) +#define stdout (&_iob[1]) +#define stderr (&_iob[2]) +#define stdaux (&_iob[3]) +#define stdprn (&_iob[4]) + +/* Returned by various functions on end of file condition or error. */ +#define EOF (-1) + + +/* + * The maximum length of a file name. You should use GetVolumeInformation + * instead of this constant. But hey, this works. + * + * NOTE: This is used in the structure _finddata_t (see dir.h) so changing it + * is probably not a good idea. + */ +#define FILENAME_MAX (260) + +/* + * The maximum number of files that may be open at once. I have set this to + * a conservative number. The actual value may be higher. + */ +#define FOPEN_MAX (20) + + +/* + * File Operations + */ +FILE* _fdopen(int handle, char *mode); +FILE* _wfdopen(int handle, wchar_t *mode); + +FILE* fopen (const char* szFileName, const char* szMode); +FILE* _wfopen(const wchar_t *file, const wchar_t *mode); + +FILE* freopen(const char* szNewFileName, const char* szNewMode, + FILE* fileChangeAssociation); +FILE* _wfreopen(const wchar_t *file, const wchar_t *mode, FILE *f); + +FILE* _fsopen(const char *file, const char *mode, int shflag); +FILE* _wfsopen(const wchar_t *file, const wchar_t *mode, int shflag); + +int fflush(FILE* fileFlush); +int fclose(FILE* fileClose); +#define fcloseall _fcloseall +int remove(const char* szFileName); +int _wremove(const wchar_t* szFileName); +int rename(const char* szOldFileName, const char* szNewFileName); +int _wrename(const wchar_t *oldName, const wchar_t *newName); +FILE* tmpfile(void); + +int _filbuf(FILE *f); +int _flsbuf(int c, FILE *f); +void _fwalk(void (*func)(FILE *)); // not exported +int _fcloseall(void); + + +/* + * The maximum size of name (including NUL) that will be put in the user + * supplied buffer caName. + * NOTE: This has not been determined by experiment, but based on the + * maximum file name length above it is probably reasonable. I could be + * wrong... + */ +#define L_tmpnam (260) + +char* tmpnam (char caName[]); +wchar_t* _wtmpnam(wchar_t *s); + +char* _tempnam (const char *szDir, const char *szPfx); +wchar_t *_wtempnam(const wchar_t *dir,const wchar_t *prefix); + +#ifndef _NO_OLDNAMES +#define tempnam _tempnam +#endif /* Not _NO_OLDNAMES */ + +/* + * The three possible buffering mode (nMode) values for setvbuf. + * NOTE: _IOFBF works, but _IOLBF seems to work like unbuffered... + * maybe I'm testing it wrong? + */ +#define _IOFBF 0 /* fully buffered */ +#define _IOLBF 1 /* line buffered */ +#define _IONBF 2 /* unbuffered */ + +int setvbuf (FILE* fileSetBuffer, char* caBuffer, int nMode, + size_t sizeBuffer); + + +/* + * The buffer size as used by setbuf such that it is equivalent to + * (void) setvbuf(fileSetBuffer, caBuffer, _IOFBF, BUFSIZ). + */ +#define BUFSIZ 512 + +void setbuf (FILE* fileSetBuffer, char* caBuffer); + +/* + * Pipe Operations + */ + +int _pclose (FILE* pipeClose); +FILE* _popen (const char* szPipeName, const char* szMode); +FILE* _wpopen (const wchar_t *cm, const wchar_t *md); + +#define popen _popen +#define pclose _pclose + +/* Wide character version */ +FILE* _wpopen (const wchar_t* szPipeName, const wchar_t* szMode); + +/* + * Formatted Output + */ + +int fprintf (FILE* filePrintTo, const char* szFormat, ...); +int printf (const char* szFormat, ...); +int sprintf (char* caBuffer, const char* szFormat, ...); +int vfprintf (FILE* filePrintTo, const char* szFormat, va_list varg); +int vprintf (const char* szFormat, va_list varg); +int vsprintf (char* caBuffer, const char* szFormat, va_list varg); + +/* Wide character versions */ +int fwprintf (FILE* filePrintTo, const wchar_t* wsFormat, ...); +int wprintf (const wchar_t* wsFormat, ...); +int swprintf (wchar_t* wcaBuffer, const wchar_t* wsFormat, ...); +int vfwprintf (FILE* filePrintTo, const wchar_t* wsFormat, va_list varg); +int vwprintf (const wchar_t* wsFormat, va_list varg); +int vswprintf (wchar_t* wcaBuffer, const wchar_t* wsFormat, va_list varg); + +/* + * Formatted Input + */ + +int fscanf (FILE* fileReadFrom, const char* szFormat, ...); +int scanf (const char* szFormat, ...); +int sscanf (const char* szReadFrom, const char* szFormat, ...); + +/* Wide character versions */ +int fwscanf (FILE* fileReadFrom, const wchar_t* wsFormat, ...); +int wscanf (const wchar_t* wsFormat, ...); +int swscanf (const wchar_t* wsReadFrom, const wchar_t* wsFormat, ...); + +/* + * Character Input and Output Functions + */ + +int fgetc (FILE* fileRead); +char* fgets (char* caBuffer, int nBufferSize, FILE* fileRead); +int fputc (int c, FILE* fileWrite); +int fputs (const char* szOutput, FILE* fileWrite); +int getc (FILE* fileRead); +int getchar (void); +char* gets (char* caBuffer); /* Unsafe: how does gets know how long the + * buffer is? */ +int putc (int c, FILE* fileWrite); +int putchar (int c); +int puts (const char* szOutput); +int ungetc (int c, FILE* fileWasRead); + +/* Wide character versions */ +wint_t fgetwc (FILE* fileRead); +wint_t fputwc (wchar_t wc, FILE* fileWrite); +wint_t getwc (FILE *fileRead); +wint_t putwc (wint_t wc, FILE* fileWrite); +wint_t putwchar (wint_t c); +int _putws (const wchar_t* ws); +wint_t ungetwc (wchar_t wc, FILE* fileWasRead); + +wint_t _filwbuf(FILE *f); +wint_t _flswbuf(wchar_t c, FILE *f); + +/* + * Not exported by CRTDLL.DLL included for reference purposes. + */ +#if 0 +wchar_t* fgetws (wchar_t* wcaBuffer, int nBufferSize, FILE* fileRead); +int fputws (const wchar_t* wsOutput, FILE* fileWrite); +int getwc (FILE* fileRead); +int getwchar (); +wchar_t* getws (wchar_t* wcaBuffer); +#endif /* 0 */ + +/* NOTE: putchar has no wide char equivalent even in tchar.h */ + + +/* + * Direct Input and Output Functions + */ + +size_t fread (void* pBuffer, size_t sizeObject, size_t sizeObjCount, + FILE* fileRead); +size_t fwrite (const void* pObjArray, size_t sizeObject, size_t sizeObjCount, + FILE* fileWrite); + + +/* + * File Positioning Functions + */ + +/* Constants for nOrigin indicating the position relative to which fseek + * sets the file position. Enclosed in ifdefs because io.h could also + * define them. (Though not anymore since io.h includes this file now.) */ +#ifndef SEEK_SET +#define SEEK_SET (0) +#endif + +#ifndef SEEK_CUR +#define SEEK_CUR (1) +#endif + +#ifndef SEEK_END +#define SEEK_END (2) +#endif + +int fseek (FILE* fileSetPosition, long lnOffset, int nOrigin); +long ftell (FILE* fileGetPosition); +void rewind (FILE* fileRewind); + +/* + * An opaque data type used for storing file positions... The contents of + * this type are unknown, but we (the compiler) need to know the size + * because the programmer using fgetpos and fsetpos will be setting aside + * storage for fpos_t structres. Actually I tested using a byte array and + * it is fairly evident that the fpos_t type is a long (in CRTDLL.DLL). + * Perhaps an unsigned long? TODO? + */ +typedef long fpos_t; + +int fgetpos (FILE* fileGetPosition, fpos_t* pfpos); +int fsetpos (FILE* fileSetPosition, const fpos_t* pfpos); + + +/* + * Error Functions + */ +#if 0 +void clearerr (FILE* fileClearErrors); +int feof (FILE* fileIsAtEnd); +int ferror (FILE* fileIsError); +void perror (const char* szErrorMessage); + +#endif +void _wperror(const wchar_t *s); + + +#define clearerr(f) (((f)->_flag) &= ~(_IOERR|_IOEOF)) +#define feof(f) (((f)->_flag&_IOEOF)!=0) +#define ferror(f) (((f)->_flag&_IOERR)!=0) +#define perror(s) (fprintf(stderr, "%s: %s\n", (s), _strerror(NULL))) +/* + * Non ANSI functions + */ + +#ifndef __STRICT_ANSI__ +int _fgetchar (void); +int _fputchar (int c); +FILE* _fdopen (int nHandle, char* szMode); + +#ifndef _NO_OLDNAMES +#define fgetchar _fgetchar +#define fputchar _fputchar +#define fdopen _fdopen +#endif /* Not _NO_OLDNAMES */ + +#endif /* Not __STRICT_ANSI__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _STDIO_H_ */ diff --git a/reactos/include/msvcrt/stdlib.h b/reactos/include/msvcrt/stdlib.h new file mode 100644 index 00000000000..80bf0e3a535 --- /dev/null +++ b/reactos/include/msvcrt/stdlib.h @@ -0,0 +1,232 @@ +/* + * stdlib.h + * + * Definitions for common types, variables, and functions. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.4 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ +/* Appropriated for Reactos Crtdll by Ariadne */ +/* added splitpath */ +/* changed definition of environ and argc */ +/* moved prototype for swab from string.h to stdlib.h */ +#ifndef _STDLIB_H_ +#define _STDLIB_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This seems like a convenient place to declare these variables, which + * give programs using WinMain (or main for that matter) access to main-ish + * argc and argv. environ is a pointer to a table of environment variables. + * NOTE: Strings in _argv and environ are ANSI strings. + */ +extern int* __argc_dll; +extern char*** __argv_dll; +extern char*** _environ_dll; +#define __argc (*__argc_dll) +#define __argv (*__argv_dll) +#define _environ (*_environ_dll) + + +#define __need_size_t +#define __need_wchar_t +#define __need_NULL +#include + +#include + +#ifndef __ATTRIB_NORETURN +#ifdef __GNUC__ +#define _ATTRIB_NORETURN __attribute__ ((noreturn)) +#ifndef __int64 +#define __int64 long long +#endif /* Not __int64 */ +#else /* Not __GNUC__ */ +#define _ATTRIB_NORETURN +#endif /* __GNUC__ */ +#endif + +double atof (const char* szNumber); +int atoi (const char* szNumber); +long atol (const char* szNumber); + + +double strtod (const char* szNumber, char** pszAfterNumber); +double wcstod (const wchar_t* wsNumber, wchar_t** pwsAfterNumber); +long strtol (const char* szNumber, char** pszAfterNumber, int nBase); +long wcstol (const wchar_t* wsNumber, wchar_t** pwsAfterNumber, int nBase); + +unsigned long strtoul (const char* szNumber, char** pszAfterNumber, + int nBase); +unsigned long wcstoul (const wchar_t* wsNumber, wchar_t** pwsAfterNumber, + int nBase); + +size_t wcstombs (char* mbsDest, const wchar_t* wsConvert, size_t size); +int wctomb (char* mbDest, wchar_t wc); + +int mblen (const char* mbs, size_t sizeString); +size_t mbstowcs (wchar_t* wcaDest, const char* mbsConvert, + size_t size); +int mbtowc (wchar_t* wcDest, const char* mbConvert, size_t size); + + +/* + * RAND_MAX is the maximum value that may be returned by rand. + * The minimum is zero. + */ +#define RAND_MAX 0x7FFF + +int rand (void); +void srand (unsigned int nSeed); + + +void* calloc (size_t sizeObjCnt, size_t sizeObject); +void* malloc (size_t sizeObject); +void* realloc (void* pObject, size_t sizeNew); +void free (void* pObject); + +/* These values may be used as exit status codes. */ +#define EXIT_SUCCESS 0 +#define EXIT_FAILURE -1 + +void abort (void) _ATTRIB_NORETURN; +void exit (int nStatus) _ATTRIB_NORETURN; +int atexit (void (*pfuncExitProcessing)(void)); + +int system (const char* szCommand); // impl in process +char* getenv (const char* szVarName); +wchar_t* _wgetenv (const wchar_t* szVarName); + +typedef int (*_pfunccmp_t)(const void*, const void*); + +void* bsearch (const void* pKey, const void* pBase, size_t cntObjects, + size_t sizeObject, _pfunccmp_t pfuncCmp); +void qsort (const void* pBase, size_t cntObjects, size_t sizeObject, + _pfunccmp_t pfuncCmp); + +int abs (int n); +long labs (long n); + +/* + * div_t and ldiv_t are structures used to return the results of div and + * ldiv. + * + * NOTE: div and ldiv appear not to work correctly unless + * -fno-pcc-struct-return is specified. This is included in the + * mingw32 specs file. + */ +typedef struct { int quot, rem; } div_t; +typedef struct { long quot, rem; } ldiv_t; +typedef struct { long long quot, rem; } lldiv_t; + +div_t div (int nNumerator, int nDenominator); +ldiv_t ldiv (long lNumerator, long lDenominator); +lldiv_t lldiv (long long lNumerator, long long lDenominator); + + +#ifndef __STRICT_ANSI__ + +/* + * NOTE: Officially the three following functions are obsolete. The Win32 API + * functions SetErrorMode, Beep and Sleep are their replacements. + */ +void _beep (unsigned int, unsigned int); +void _seterrormode (int nMode); +void _sleep (unsigned long ulTime); + +void _exit (int nStatus) _ATTRIB_NORETURN; + +int _putenv (const char *val); +int _wputenv(const wchar_t *val); +void _searchenv (const char *file, const char *var, char *path); +void _wsearchenv (const wchar_t *file, const wchar_t *var, wchar_t *path); + +void _makepath( char *path, const char *drive, const char *dir, + const char *fname, const char *ext ); +void _wmakepath( wchar_t *path, const wchar_t *drive, const wchar_t *dir, + const wchar_t *fname, const wchar_t *ext ); +void _splitpath( const char *path, char *drive, char *dir, + char *fname, char *ext ); +char* _fullpath( char* caBuf, const char* szPath, size_t sizeMax ); +wchar_t *_wfullpath( wchar_t *absPath, const wchar_t *relPath, size_t maxLength ); + +char* _itoa (int nValue, char* sz, int nRadix); +char* _i64toa(__int64 value, char *string, int radix); +char* _ltoa (long lnValue, char* sz, int nRadix); +char* _ultoa(unsigned long value, char *string, int radix); +char* _ui64toa(unsigned __int64 value, char *string, int radix); + +wchar_t* _itow (int nValue, wchar_t* sz, int nRadix); +wchar_t* _i64tow(__int64 value, wchar_t *string, int radix); +wchar_t* _ltow (long lnValue, wchar_t* sz, int nRadix); +wchar_t* _ultow(unsigned long value, wchar_t *string, int radix); +wchar_t* _ui64tow(unsigned __int64 value, wchar_t *string, int radix); + +char* _ecvt (double dValue, int nDig, int* pnDec, int* pnSign); +char* _fcvt (double dValue, int nDig, int* pnDec, int* pnSign); +char* _gcvt (double dValue, int nDec, char* caBuf); + +void _swab (const char* caFrom, char* caTo, size_t sizeToCopy); + +unsigned int _rotl( unsigned int value, int shift ); +unsigned int _rotr( unsigned int value, int shift ); +unsigned long _lrotl( unsigned long value, int shift ); +unsigned long _lrotr( unsigned long value, int shift ); + +__int64 _atoi64(const char *szNumber); + +int _wtoi( const wchar_t *str ); +__int64 _wtoi64(const wchar_t *str); +long _wtol( const wchar_t *str ); + + +#ifndef _NO_OLDNAMES +#define beep _beep +#define seterrormode _seterrormode +#define sleep _sleep +#define putenv _putenv +#define searchenv _searchenv +#define splitpath _splitpath + +#define itoa _itoa +#define ltoa _ltoa + +#define ecvt _ecvt +#define fcvt _fcvt +#define gcvt _gcvt + +#define swab _swab +#endif /* Not _NO_OLDNAMES */ + +#endif /* Not __STRICT_ANSI__ */ + +/* + * Undefine the no return attribute used in some function definitions + */ +#undef _ATTRIB_NORETURN + +#ifdef __cplusplus +} +#endif + +#endif /* _STDLIB_H_ */ diff --git a/reactos/include/msvcrt/string.h b/reactos/include/msvcrt/string.h new file mode 100644 index 00000000000..4c63cdb26b1 --- /dev/null +++ b/reactos/include/msvcrt/string.h @@ -0,0 +1,194 @@ +/* + * string.h + * + * Definitions for memory and string functions. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.4 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ +/* Appropriated for Reactos Crtdll by Ariadne */ +/* changed prototype for _strerror */ +/* moved prototype for swab from string.h to stdlib.h */ + + +#ifndef _STRING_H_ +#define _STRING_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Define size_t, wchar_t and NULL + */ +#define __need_size_t +#define __need_wchar_t +#define __need_NULL +#include + +char * ___strtok; // removed extern specifier 02-06-98, BD + +/* + * Prototypes of the ANSI Standard C library string functions. + */ +void* memchr (const void* p, int cSearchFor, size_t sizeSearch); +int memcmp (const void* p1, const void* p2, size_t sizeSearch); +void* memcpy (void* pCopyTo, const void* pSource, size_t sizeSource); +void* memmove (void* pMoveTo, const void* pSource, size_t sizeSource); +void* memset (void* p, int cFill, size_t sizeRepeatCount); +char* strcat (char* szAddTo, const char* szAdd); +char* strchr (const char* szSearch, int cFor); +int strcmp (const char* sz1, const char* sz2); +int strcoll (const char* sz1, const char* sz2); /* Compare using locale */ +char* strcpy (char* szCopyTo, const char* szSource); +size_t strcspn (const char* szGetPrefix, const char* szNotIncluding); +char* strerror (int nError); /* NOTE: NOT an old name wrapper. */ +char * _strerror(const char *s); +size_t strlen (const char* sz); +size_t strnlen (const char* sz, size_t count); // not exported +char* strncat (char* szAddTo, const char* szAdd, size_t sizeMaxAdd); +int strncmp (const char* sz1, const char* sz2, size_t sizeMaxCompare); +char* strncpy (char* szCopyTo, const char* szSource, size_t sizeMaxCopy); +char* strpbrk (const char* szSearch, const char* szAnyOf); +char* strrchr (const char* szSearch, int cFor); +size_t strspn (const char* szGetPrefix, const char *szIncluding); +char* strstr (const char* szSearch, const char *szFor); +char* strtok (char* szTokenize, const char* szDelimiters); +size_t strxfrm (char* szTransformed, const char *szSource, + size_t sizeTransform); + +#ifndef __STRICT_ANSI__ +/* + * Extra non-ANSI functions provided by the CRTDLL library + */ +void* _memccpy (void* pCopyTo, const void* pSource, int cTerminator, + size_t sizeMaxCopy); +int _memicmp (const void* p1, const void* p2, size_t sizeSearch); +char* _strdup (const char *szDuplicate); +int _strcmpi (const char* sz1, const char* sz2); +int _stricmp (const char* sz1, const char* sz2); +int _stricoll (const char* sz1, const char* sz2); +char* _strlwr (char* szToConvert); +int _strnicmp (const char* sz1, const char* sz2, + size_t sizeMaxCompare); +char* _strnset (char* szToFill, int cFill, size_t sizeMaxFill); +char* _strrev (char* szToReverse); +char* _strset (char* szToFill, int cFill); +char* _strupr (char* szToConvert); + + +#endif /* Not __STRICT_ANSI__ */ + + +/* + * Unicode versions of the standard calls. + */ +wchar_t* wcscat (wchar_t* wsAddTo, const wchar_t* wsAdd); +wchar_t* wcschr (const wchar_t* wsSearch, wchar_t wcFor); +int wcscmp (const wchar_t* ws1, const wchar_t* ws2); +int wcscoll (const wchar_t* ws1, const wchar_t* ws2); +wchar_t* wcscpy (wchar_t* wsCopyTo, const wchar_t* wsSource); +size_t wcscspn (const wchar_t* wsGetPrefix, const wchar_t* wsNotIncluding); +/* Note: No wcserror in CRTDLL. */ +size_t wcslen (const wchar_t* ws); +wchar_t* wcsncat (wchar_t* wsAddTo, const wchar_t* wsAdd, size_t sizeMaxAdd); +int wcsncmp(const wchar_t* ws1, const wchar_t* ws2, size_t sizeMaxCompare); +wchar_t* wcsncpy(wchar_t* wsCopyTo, const wchar_t* wsSource, + size_t sizeMaxCopy); +wchar_t* wcspbrk(const wchar_t* wsSearch, const wchar_t* wsAnyOf); +wchar_t* wcsrchr(const wchar_t* wsSearch, wchar_t wcFor); +size_t wcsspn(const wchar_t* wsGetPrefix, const wchar_t* wsIncluding); +wchar_t* wcsstr(const wchar_t* wsSearch, const wchar_t* wsFor); +wchar_t* wcstok(wchar_t* wsTokenize, const wchar_t* wsDelimiters); +size_t wcsxfrm(wchar_t* wsTransformed, const wchar_t *wsSource, + size_t sizeTransform); + + +#ifndef __STRICT_ANSI__ +/* + * Unicode versions of non-ANSI functions provided by CRTDLL. + */ + +/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */ +#define _wcscmpi _wcsicmp + +wchar_t* _wcsdup (const wchar_t* wsToDuplicate); +int _wcsicmp (const wchar_t* ws1, const wchar_t* ws2); +int _wcsicoll (const wchar_t* ws1, const wchar_t* ws2); +int _wcsncoll (const wchar_t *s1, const wchar_t *s2, size_t c); +int _wcsnicoll (const wchar_t *s1, const wchar_t *s2, size_t c); +wchar_t* _wcslwr (wchar_t* wsToConvert); +int _wcsnicmp (const wchar_t* ws1, const wchar_t* ws2, + size_t sizeMaxCompare); +wchar_t* _wcsnset (wchar_t* wsToFill, wchar_t wcFill, size_t sizeMaxFill); +wchar_t* _wcsrev (wchar_t* wsToReverse); +wchar_t* _wcsset (wchar_t* wsToFill, wchar_t wcToFill); +wchar_t* _wcsupr (wchar_t* wsToConvert); + +#endif /* Not __STRICT_ANSI__ */ + + +#ifndef __STRICT_ANSI__ +#ifndef _NO_OLDNAMES + +/* + * Non-underscored versions of non-ANSI functions. They live in liboldnames.a + * and provide a little extra portability. Also a few extra UNIX-isms like + * strcasecmp. + */ + +void* memccpy (void* pCopyTo, const void* pSource, int cTerminator, + size_t sizeMaxCopy); +int memicmp (const void* p1, const void* p2, size_t sizeSearch); +#define strdup(szDuplicate) _strdup(szDuplicate) +int strcmpi (const char* sz1, const char* sz2); +int stricmp (const char* sz1, const char* sz2); +int strcasecmp (const char* sz1, const char* sz2); +int stricoll (const char* sz1, const char* sz2); +char* strlwr (char* szToConvert); +int strnicmp (const char* sz1, const char* sz2, size_t sizeMaxCompare); +int strncasecmp (const char* sz1, const char* sz2, size_t sizeMaxCompare); +char* strnset (char* szToFill, int cFill, size_t sizeMaxFill); +char* strrev (char* szToReverse); +char* strset (char* szToFill, int cFill); +char* strupr (char* szToConvert); + + +/* NOTE: There is no _wcscmpi, but this is for compatibility. */ +int wcscmpi (const wchar_t* ws1, const wchar_t* ws2); +wchar_t* wcsdup (const wchar_t* wsToDuplicate); +int wcsicmp (const wchar_t* ws1, const wchar_t* ws2); +int wcsicoll (const wchar_t* ws1, const wchar_t* ws2); +wchar_t* wcslwr (wchar_t* wsToConvert); +int wcsnicmp (const wchar_t* ws1, const wchar_t* ws2, + size_t sizeMaxCompare); +wchar_t* wcsnset (wchar_t* wsToFill, wchar_t wcFill, size_t sizeMaxFill); +wchar_t* wcsrev (wchar_t* wsToReverse); +wchar_t* wcsset (wchar_t* wsToFill, wchar_t wcToFill); +wchar_t* wcsupr (wchar_t* wsToConvert); + +#endif /* Not _NO_OLDNAMES */ +#endif /* Not strict ANSI */ + +#endif + +#ifdef __cplusplus +extern "C" } +#endif diff --git a/reactos/include/msvcrt/time.h b/reactos/include/msvcrt/time.h new file mode 100644 index 00000000000..672f06fc6c3 --- /dev/null +++ b/reactos/include/msvcrt/time.h @@ -0,0 +1,126 @@ +/* + * time.h + * + * Date and time functions and types. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.5 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ +/* Appropriated for Reactos Crtdll by Ariadne */ +#ifndef _TIME_H_ +#define _TIME_H_ + +#define __need_wchar_t +#define __need_size_t +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Number of clock ticks per second. A clock tick is the unit by which + * processor time is measured and is returned by 'clock'. + */ +#define CLOCKS_PER_SEC 1000.0 +#define CLK_TICK CLOCKS_PER_SEC + +/* + * A type for measuring processor time (in clock ticks). + */ +#ifndef _CLOCK_T_ +#define _CLOCK_T_ +typedef long clock_t; +#endif + +/* + * Need a definition of time_t. + */ +#include + +/* + * A type for storing the current time and date. This is the number of + * seconds since midnight Jan 1, 1970. + * NOTE: Normally this is defined by the above include of sys/types.h + */ +#ifndef _TIME_T_ +#define _TIME_T_ +typedef long time_t; +#endif + +/* + * A structure for storing all kinds of useful information about the + * current (or another) time. + */ +struct tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + char *tm_zone; + int tm_gmtoff; +}; + + + +clock_t clock (void); +time_t time (time_t* tp); +double difftime (time_t t2, time_t t1); +time_t mktime (struct tm* tmsp); + +/* + * These functions write to and return pointers to static buffers that may + * be overwritten by other function calls. Yikes! + * + * NOTE: localtime, and perhaps the others of the four functions grouped + * below may return NULL if their argument is not 'acceptable'. Also note + * that calling asctime with a NULL pointer will produce an Invalid Page + * Fault and crap out your program. Guess how I know. Hint: stat called on + * a directory gives 'invalid' times in st_atime etc... + */ +char* asctime (const struct tm* tmsp); +wchar_t* _wasctime(const struct tm *timeptr); +char* ctime (const time_t* tp); +wchar_t* _wctime(const time_t * const timep); +struct tm* gmtime (const time_t* tm); +struct tm* localtime (const time_t* tm); + +char* _strdate(const char *datestr); +wchar_t* _wstrdate(const wchar_t *datestr); + +size_t strftime (char* caBuffer, size_t sizeMax, const char* szFormat, + const struct tm* tpPrint); + +size_t wcsftime (wchar_t* wcaBuffer, size_t sizeMax, + const wchar_t* wsFormat, const struct tm* tpPrint); + +char* _strtime(char* buf); +wchar_t* _wstrtime(wchar_t* buf); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/reactos/include/msvcrt/wchar.h b/reactos/include/msvcrt/wchar.h new file mode 100644 index 00000000000..380069b516e --- /dev/null +++ b/reactos/include/msvcrt/wchar.h @@ -0,0 +1,32 @@ +/* + * wchar.h + * + * Defines of all functions for supporting wide characters. Actually it + * just includes all those headers, which is not a good thing to do from a + * processing time point of view, but it does mean that everything will be + * in sync. + * + * This file is part of the Mingw32 package. + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.3 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:31 $ + * + */ + +#include +#include +#include +#include +#include + diff --git a/reactos/include/ntddk.h b/reactos/include/ntddk.h new file mode 100644 index 00000000000..4fed7b0cdb6 --- /dev/null +++ b/reactos/include/ntddk.h @@ -0,0 +1,5 @@ + +/* (RJJ) some programs look for the DDK header here... */ + +#include + diff --git a/reactos/include/ntdll/base.h b/reactos/include/ntdll/base.h index 96e8441f7f1..8d45888be34 100644 --- a/reactos/include/ntdll/base.h +++ b/reactos/include/ntdll/base.h @@ -1 +1 @@ -#define NTDLL_BASE (0x78800000) +#define NTDLL_BASE (0x77f60000) diff --git a/reactos/include/ntdll/rtl.h b/reactos/include/ntdll/rtl.h index 766a14e47e7..e4c65cd3c56 100644 --- a/reactos/include/ntdll/rtl.h +++ b/reactos/include/ntdll/rtl.h @@ -1,14 +1,57 @@ -/* $Id: rtl.h,v 1.34 2002/09/07 15:12:20 chorns Exp $ +/* $Id: rtl.h,v 1.35 2002/09/08 10:22:32 chorns Exp $ * */ #ifndef __INCLUDE_NTDLL_RTL_H #define __INCLUDE_NTDLL_RTL_H +#include +#include + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +typedef struct _DEBUG_BUFFER +{ + HANDLE SectionHandle; + PVOID SectionBase; + PVOID RemoteSectionBase; + ULONG SectionBaseDelta; + HANDLE EventPairHandle; + ULONG Unknown[2]; + HANDLE RemoteThreadHandle; + ULONG InfoClassMask; + ULONG SizeOfInfo; + ULONG AllocatedSize; + ULONG SectionSize; + PVOID ModuleInformation; + PVOID BackTraceInformation; + PVOID HeapInformation; + PVOID LockInformation; + PVOID Reserved[8]; +} DEBUG_BUFFER, *PDEBUG_BUFFER; + +typedef struct _CRITICAL_SECTION_DEBUG { + WORD Type; + WORD CreatorBackTraceIndex; + struct _CRITICAL_SECTION *CriticalSection; + LIST_ENTRY ProcessLocksList; + DWORD EntryCount; + DWORD ContentionCount; + DWORD Depth; + PVOID OwnerBackTrace[ 5 ]; +} CRITICAL_SECTION_DEBUG, *PCRITICAL_SECTION_DEBUG; + +typedef struct _CRITICAL_SECTION { + PCRITICAL_SECTION_DEBUG DebugInfo; + LONG LockCount; + LONG RecursionCount; + HANDLE OwningThread; + HANDLE LockSemaphore; + DWORD Reserved; +} CRITICAL_SECTION, *PCRITICAL_SECTION, *LPCRITICAL_SECTION; + typedef struct _RTL_PROCESS_INFO { ULONG Size; @@ -20,7 +63,7 @@ typedef struct _RTL_PROCESS_INFO typedef struct _RTL_RESOURCE { - RTL_CRITICAL_SECTION Lock; + CRITICAL_SECTION Lock; HANDLE SharedSemaphore; ULONG SharedWaiters; HANDLE ExclusiveSemaphore; @@ -60,31 +103,31 @@ typedef struct _RTL_HANDLE_TABLE VOID STDCALL RtlDeleteCriticalSection ( - PRTL_CRITICAL_SECTION CriticalSection + PCRITICAL_SECTION CriticalSection ); VOID STDCALL RtlEnterCriticalSection ( - PRTL_CRITICAL_SECTION CriticalSection + PCRITICAL_SECTION CriticalSection ); NTSTATUS STDCALL RtlInitializeCriticalSection ( - PRTL_CRITICAL_SECTION CriticalSection + PCRITICAL_SECTION CriticalSection ); VOID STDCALL RtlLeaveCriticalSection ( - PRTL_CRITICAL_SECTION CriticalSection + PCRITICAL_SECTION CriticalSection ); BOOLEAN STDCALL RtlTryEnterCriticalSection ( - PRTL_CRITICAL_SECTION CriticalSection + PCRITICAL_SECTION CriticalSection ); DWORD @@ -297,10 +340,10 @@ RtlFreeUserThreadStack ( NTSTATUS STDCALL -RtlRosCreateUserProcess ( +RtlCreateUserProcess ( IN PUNICODE_STRING ImageFileName, IN ULONG Attributes, - IN PRTL_ROS_USER_PROCESS_PARAMETERS ProcessParameters, + IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters, IN PSECURITY_DESCRIPTOR ProcessSecutityDescriptor OPTIONAL, IN PSECURITY_DESCRIPTOR ThreadSecurityDescriptor OPTIONAL, IN HANDLE ParentProcess OPTIONAL, @@ -312,8 +355,8 @@ RtlRosCreateUserProcess ( NTSTATUS STDCALL -RtlRosCreateProcessParameters ( - OUT PRTL_ROS_USER_PROCESS_PARAMETERS *ProcessParameters, +RtlCreateProcessParameters ( + OUT PRTL_USER_PROCESS_PARAMETERS *ProcessParameters, IN PUNICODE_STRING ImagePathName OPTIONAL, IN PUNICODE_STRING DllPath OPTIONAL, IN PUNICODE_STRING CurrentDirectory OPTIONAL, @@ -325,22 +368,22 @@ RtlRosCreateProcessParameters ( IN PUNICODE_STRING RuntimeInfo OPTIONAL ); -PRTL_ROS_USER_PROCESS_PARAMETERS +PRTL_USER_PROCESS_PARAMETERS STDCALL -RtlRosDeNormalizeProcessParams ( - IN PRTL_ROS_USER_PROCESS_PARAMETERS ProcessParameters +RtlDeNormalizeProcessParams ( + IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters ); VOID STDCALL -RtlRosDestroyProcessParameters ( - IN PRTL_ROS_USER_PROCESS_PARAMETERS ProcessParameters +RtlDestroyProcessParameters ( + IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters ); -PRTL_ROS_USER_PROCESS_PARAMETERS +PRTL_USER_PROCESS_PARAMETERS STDCALL -RtlRosNormalizeProcessParams ( - IN PRTL_ROS_USER_PROCESS_PARAMETERS ProcessParameters +RtlNormalizeProcessParams ( + IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters ); NTSTATUS @@ -525,6 +568,44 @@ RtlpNtSetValueKey ( IN ULONG DataLength ); +#ifndef __NTDRIVER__ +LONG +STDCALL +InterlockedIncrement ( + PLONG Addend + ); + +LONG +STDCALL +InterlockedDecrement ( + PLONG lpAddend + ); + +LONG +STDCALL +InterlockedExchange ( + PLONG Target, + LONG Value + ); + +PVOID +STDCALL +InterlockedCompareExchange ( + PVOID *Destination, + PVOID Exchange, + PVOID Comperand + ); + +LONG +STDCALL +InterlockedExchangeAdd ( + PLONG Addend, + LONG Increment + ); + + +#endif /* __NTDRIVER__ */ + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/reactos/include/ntos.h b/reactos/include/ntos.h index 9fcfa4a8d56..8ce61d845b2 100644 --- a/reactos/include/ntos.h +++ b/reactos/include/ntos.h @@ -1,71 +1,12 @@ #ifndef _NTOS_H #define _NTOS_H -/* $Id: ntos.h,v 1.4 2002/09/07 15:12:12 chorns Exp $ */ +/* $Id: ntos.h,v 1.5 2002/09/08 10:22:28 chorns Exp $ */ -#include -#include -#include - -#if defined(NTOS_USER_MODE) -// include windows.h before ntddk.h to get user mode prototype for InterlockedXxx functions -#include #include -#include -#include -#include -#include "ntos/i386/segment.h" -#include "ntos/types.h" -#include "ntos/disk.h" -#include "ntos/lpc.h" -#include "ntos/dbg.h" -#include "ntos/npipe.h" -#include "ntos/shared_data.h" -#include "ntos/teb.h" -#include "ntos/minmax.h" -#include "ntos/security.h" -#include "ntos/except.h" -#include "ntos/rtl.h" -#include "ntos/zwtypes.h" -#include "ntos/zw.h" -#include "ntos/win32.h" -#include "ntos/ps.h" -#include "ntos/fs.h" -#include "ntos/ntddblue.h" -#include "ntos/console.h" -#include "ntdll/csr.h" -#include "ntdll/dbg.h" -#include "ntdll/ldr.h" -#include "ntdll/registry.h" -#include "ntdll/rtl.h" -#include "ntdll/trace.h" -#include "kernel32/error.h" -#elif defined(NTOS_KERNEL_MODE) -#include -#include -#include -#include -#include -#include "ntos/i386/segment.h" -#include "ntos/types.h" -#include "ntos/disk.h" -#include "ntos/lpc.h" -#include "ntos/npipe.h" -#include "ntos/shared_data.h" -#include "ntos/teb.h" -#include "ntos/minmax.h" -#include "ntos/security.h" -#include "ntos/except.h" -#include "ntos/rtl.h" -#include "ntos/zwtypes.h" -#include "ntos/zw.h" -#include "ntos/win32.h" -#include "ntos/ps.h" -#include "ntos/fs.h" -#include "ntos/ntddblue.h" -#include "ntos/hal.h" -#include "ntos/core.h" -#else - #error Specify NTOS_USER_MODE or NTOS_KERNEL_MODE -#endif +#include +#include +#include +#include +#include #endif /* ndef _NTOS_H */ diff --git a/reactos/include/ntos/console.h b/reactos/include/ntos/console.h index 0f2fc31f086..42a78526ea4 100644 --- a/reactos/include/ntos/console.h +++ b/reactos/include/ntos/console.h @@ -13,6 +13,30 @@ #ifndef __INCLUDE_CONSOLE_H #define __INCLUDE_CONSOLE_H +/* GetConsoleMode */ +#define ENABLE_LINE_INPUT (0x02) +#define ENABLE_ECHO_INPUT (0x04) +#define ENABLE_PROCESSED_INPUT (0x01) +#define ENABLE_WINDOW_INPUT (0x08) +#define ENABLE_MOUSE_INPUT (0x0f) +#define CONSOLE_INPUT_MODE_VALID (0x0f) +#define ENABLE_PROCESSED_OUTPUT (0x01) +#define ENABLE_WRAP_AT_EOL_OUTPUT (0x02) +#define CONSOLE_OUTPUT_MODE_VALID (0x03) + +typedef struct _CONSOLE_SCREEN_BUFFER_INFO { + COORD dwSize; + COORD dwCursorPosition; + WORD wAttributes; + SMALL_RECT srWindow; + COORD dwMaximumWindowSize; +} CONSOLE_SCREEN_BUFFER_INFO, *PCONSOLE_SCREEN_BUFFER_INFO ; + +typedef struct _CONSOLE_CURSOR_INFO { + DWORD dwSize; + BOOL bVisible; +} CONSOLE_CURSOR_INFO, *PCONSOLE_CURSOR_INFO; + typedef struct _CONSOLE_FONT_INFO { DWORD nFont; COORD dwFontSize; diff --git a/reactos/include/ntos/core.h b/reactos/include/ntos/core.h deleted file mode 100755 index a620b815e18..00000000000 --- a/reactos/include/ntos/core.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __INCLUDE_NTOS_CORE_H -#define __INCLUDE_NTOS_CORE_H - -#include "../../ntoskrnl/include/internal/ke.h" - -#define MM_CORE_DUMP_HEADER_MAGIC (0xdeafbead) -#define MM_CORE_DUMP_HEADER_VERSION (0x1) -#define MM_CORE_DUMP_TYPE_MINIMAL (0x1) -#define MM_CORE_DUMP_TYPE_FULL (0x2) - -typedef struct _MM_CORE_DUMP_HEADER -{ - ULONG Magic; - ULONG Version; - ULONG Type; - KTRAP_FRAME TrapFrame; - ULONG BugCheckCode; - ULONG BugCheckParameters[4]; - PVOID FaultingStackBase; - ULONG FaultingStackSize; - ULONG PhysicalMemorySize; -} MM_CORE_DUMP_HEADER, *PMM_CORE_DUMP_HEADER; - -typedef struct _MM_DUMP_POINTERS -{ - PVOID Context; - NTSTATUS (*DeviceInit)(PVOID Context); - NTSTATUS (*DeviceWrite)(PVOID Context, ULONG Block, PMDL Mdl); - NTSTATUS (*DeviceFinish)(PVOID Context); -} MM_DUMP_POINTERS, *PMM_DUMP_POINTERS; - -#define FSCTL_GET_DUMP_BLOCK_MAP (('R' << 24) | 0xF1) -#define IOCTL_GET_DUMP_POINTERS (('R' << 24) | 0xF2) - -#endif /* __INCLUDE_NTOS_CORE_H */ diff --git a/reactos/include/ntos/dbg.h b/reactos/include/ntos/dbg.h deleted file mode 100755 index 24dc78c2e32..00000000000 --- a/reactos/include/ntos/dbg.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __INCLUDE_NAPI_DBG_H -#define __INCLUDE_NAPI_DBG_H - -#define DBG_EVENT_EXCEPTION (1) -#define DBG_EVENT_CREATE_THREAD (2) -#define DBG_EVENT_CREATE_PROCESS (3) -#define DBG_EVENT_EXIT_THREAD (4) -#define DBG_EVENT_EXIT_PROCESS (5) -#define DBG_EVENT_LOAD_DLL (6) -#define DBG_EVENT_UNLOAD_DLL (7) - -typedef struct _LPC_DBG_MESSAGE -{ - LPC_MESSAGE Header; - ULONG Type; - ULONG Status; - union - { - struct - { - EXCEPTION_RECORD ExceptionRecord; - ULONG FirstChance; - } Exception; - struct - { - ULONG Reserved; - PVOID StartAddress; - } CreateThread; - struct - { - ULONG Reserved; - HANDLE FileHandle; - PVOID Base; - ULONG PointerToSymbolTable; - ULONG NumberOfSymbols; - ULONG Reserved2; - PVOID EntryPoint; - } CreateProcess; - struct - { - ULONG ExitCode; - } ExitThread; - struct - { - ULONG ExitCode; - } ExitProcess; - struct - { - HANDLE FileHandle; - PVOID Base; - ULONG PointerToSymbolTable; - ULONG NumberOfSymbols; - } LoadDll; - struct - { - PVOID Base; - } UnloadDll; - } Data; -} LPC_DBG_MESSAGE, *PLPC_DBG_MESSAGE; - -#endif /* __INCLUDE_NAPI_DBG_H */ diff --git a/reactos/include/ntos/ddk.h b/reactos/include/ntos/ddk.h deleted file mode 100644 index 2aec9967437..00000000000 --- a/reactos/include/ntos/ddk.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: include/ntos/ddk.h - * PURPOSE: Missing definitions in MinGW Windows DDK - * PROGRAMMER: Casper S. Hornstrup - * NOTES: Put defines that is missing in MinGW DDK, in this file and - * send a patch to the MinGW project. Then, when a new - * MinGW DDK is released, remove the defines from this file - * and use the new release. - * Please verify with documentation at msdn.microsoft.com - * before putting definitions here and submitting a patch - * to the MinGW project. - */ - -#ifndef __INCLUDE_NTOS_DDK_H -#define __INCLUDE_NTOS_DDK_H - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - -#ifndef AS_INVOKED - -#endif /* !AS_INVOKED */ - -#endif /* __INCLUDE_NTOS_DDK_H */ diff --git a/reactos/include/ntos/disk.h b/reactos/include/ntos/disk.h index 6078b2263fa..1c73220b40b 100644 --- a/reactos/include/ntos/disk.h +++ b/reactos/include/ntos/disk.h @@ -1,4 +1,4 @@ -/* $Id: disk.h,v 1.10 2002/09/07 15:12:20 chorns Exp $ +/* $Id: disk.h,v 1.11 2002/09/08 10:22:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,13 +12,19 @@ #ifndef __INCLUDE_DISK_H #define __INCLUDE_DISK_H -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - -#include +#define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(FILE_DEVICE_DISK, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_DISK_GET_PARTITION_INFO CTL_CODE(FILE_DEVICE_DISK, 1, METHOD_BUFFERED, FILE_READ_ACCESS) +#define IOCTL_DISK_SET_PARTITION_INFO CTL_CODE(FILE_DEVICE_DISK, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) +#define IOCTL_DISK_GET_DRIVE_LAYOUT CTL_CODE(FILE_DEVICE_DISK, 3, METHOD_BUFFERED, FILE_READ_ACCESS) +#define IOCTL_DISK_SET_DRIVE_LAYOUT CTL_CODE(FILE_DEVICE_DISK, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) +#define IOCTL_DISK_VERIFY CTL_CODE(FILE_DEVICE_DISK, 5, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_DISK_FORMAT_TRACKS CTL_CODE(FILE_DEVICE_DISK, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) +#define IOCTL_DISK_REASSIGN_BLOCKS CTL_CODE(FILE_DEVICE_DISK, 7, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) +#define IOCTL_DISK_PERFORMANCE CTL_CODE(FILE_DEVICE_DISK, 8, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_DISK_IS_WRITABLE CTL_CODE(FILE_DEVICE_DISK, 9, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_DISK_LOGGING CTL_CODE(FILE_DEVICE_DISK, 10, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_DISK_FORMAT_TRACKS_EX CTL_CODE(FILE_DEVICE_DISK, 11, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) #define IOCTL_DISK_HISTOGRAM_STRUCTURE CTL_CODE(FILE_DEVICE_DISK, 12, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_DISK_HISTOGRAM_DATA CTL_CODE(FILE_DEVICE_DISK, 13, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_DISK_HISTOGRAM_RESET CTL_CODE(FILE_DEVICE_DISK, 14, METHOD_BUFFERED, FILE_ANY_ACCESS) @@ -45,13 +51,96 @@ #define PARTITION_NTFT 0x80 #define VALID_NTFT 0xC0 -typedef struct _DRIVE_LAYOUT_INFORMATION { - DWORD PartitionCount; - DWORD Signature; - PARTITION_INFORMATION PartitionEntry[1]; +#if 0 +#define PTEmpty 0x00 +#define PTDOS3xPrimary 0x01 +#define PTXENIXRoot 0x02 +#define PTXENIXUsr 0x03 +#define PTOLDDOS16Bit 0x04 +#define PTDosExtended 0x05 +#define PTDos5xPrimary 0x06 +#define PTIfs 0x07 // e.g.: HPFS, NTFS, etc +#define PTAIX 0x08 +#define PTAIXBootable 0x09 +#define PTOS2BootMgr 0x0A +#define PTWin95FAT32 0x0B +#define PTWin95FAT32LBA 0x0C +#define PTWin95FAT16LBA 0x0E +#define PTWin95ExtendedLBA 0x0F +#define PTVenix286 0x40 +#define PTNovell 0x51 +#define PTMicroport 0x52 +#define PTGnuHurd 0x63 +#define PTNetware286 0x64 +#define PTNetware386 0x65 +#define PTPCIX 0x75 +#define PTOldMinix 0x80 +#define PTMinix 0x81 +#define PTLinuxSwap 0x82 +#define PTLinuxExt2 0x83 +#define PTAmoeba 0x93 +#define PTAmoebaBBT 0x94 +#define PTBSD 0xA5 +#define PTBSDIFS 0xB7 +#define PTBSDISwap 0xB8 +#define PTSyrinx 0xC7 +#define PTCPM 0xDB +#define PTDOSAccess 0xE1 +#define PTDOSRO 0xE3 +#define PTDOSSecondary 0xF2 +#define PTBBT 0xFF +#endif + +#define IsRecognizedPartition(P) \ + ((P) == PARTITION_FAT_12 || \ + (P) == PARTITION_FAT_16 || \ + (P) == PARTITION_HUGE || \ + (P) == PARTITION_IFS || \ + (P) == PARTITION_FAT32 || \ + (P) == PARTITION_FAT32_XINT13 || \ + (P) == PARTITION_XINT13) + +#define IsContainerPartition(P) \ + ((P) == PARTITION_EXTENDED || \ + (P) == PARTITION_XINT13_EXTENDED) + + +typedef enum _MEDIA_TYPE +{ + Unknown, + F5_1Pt2_512, + F3_1Pt44_512, + F3_2Pt88_512, + F3_20Pt8_512, + F3_720_512, + F5_360_512, + F5_320_512, + F5_320_1024, + F5_180_512, + F5_160_512, + RemovableMedia, + FixedMedia +} MEDIA_TYPE; + +typedef struct _PARTITION_INFORMATION +{ + LARGE_INTEGER StartingOffset; + LARGE_INTEGER PartitionLength; + DWORD HiddenSectors; + DWORD PartitionNumber; + BYTE PartitionType; + BOOLEAN BootIndicator; + BOOLEAN RecognizedPartition; + BOOLEAN RewritePartition; +} PARTITION_INFORMATION, *PPARTITION_INFORMATION; + +typedef struct _DRIVE_LAYOUT_INFORMATION +{ + DWORD PartitionCount; + DWORD Signature; + PARTITION_INFORMATION PartitionEntry[1]; } DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION; -#if 0 typedef struct _SET_PARTITION_INFORMATION { ULONG PartitionType; @@ -65,7 +154,6 @@ typedef struct _DISK_GEOMETRY DWORD SectorsPerTrack; DWORD BytesPerSector; } DISK_GEOMETRY, *PDISK_GEOMETRY; -#endif #endif /* __INCLUDE_DISK_H */ diff --git a/reactos/include/ntos/except.h b/reactos/include/ntos/except.h index c17d5306670..c34b62df11f 100644 --- a/reactos/include/ntos/except.h +++ b/reactos/include/ntos/except.h @@ -9,31 +9,130 @@ #ifndef __INCLUDE_EXCEPT_H #define __INCLUDE_EXCEPT_H -#include +typedef enum { + ExceptionContinueExecution = 0, + ExceptionContinueSearch, + ExceptionNestedException, + ExceptionCollidedUnwind, + ExceptionDismiss // ??? +} EXCEPTION_DISPOSITION; -// FIXME: Figure out if this is needed -#define ExceptionDismiss (EXCEPTION_DISPOSITION)((ULONG)ExceptionCollidedUnwind + 1) -typedef DWORD (CDECL *PSCOPE_EXCEPTION_FILTER)(VOID); -typedef VOID (CDECL *PSCOPE_EXCEPTION_HANDLER)(VOID); +struct _EXCEPTION_RECORD; +struct _EXCEPTION_REGISTRATION; -typedef struct _SCOPETABLE_ENTRY { - DWORD PreviousTryLevel; - PSCOPE_EXCEPTION_FILTER FilterRoutine; +/* + * The type of function that is expected as an exception handler to be + * installed with _try1. + */ +typedef EXCEPTION_DISPOSITION CDECL (*PEXCEPTION_HANDLER)( + struct _EXCEPTION_RECORD* ExceptionRecord, + struct _EXCEPTION_REGISTRATION* ExceptionRegistration, + PCONTEXT Context, + PVOID DispatcherContext); + + +#define EXCEPTION_MAXIMUM_PARAMETERS (15) + +typedef struct _EXCEPTION_RECORD { + DWORD ExceptionCode; + DWORD ExceptionFlags; + struct _EXCEPTION_RECORD *ExceptionRecord; + PVOID ExceptionAddress; + DWORD NumberParameters; + DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; +} EXCEPTION_RECORD, *PEXCEPTION_RECORD, *LPEXCEPTION_RECORD; + +/* ExceptionFlags */ +#ifndef _GNU_H_WINDOWS32_DEFINES +#ifdef __NTOSKRNL__ +#define EXCEPTION_NONCONTINUABLE 0x01 +#endif /* __NTOSKRNL__ */ +#endif /* _GNU_H_WINDOWS32_DEFINES */ +#define EXCEPTION_UNWINDING 0x02 +#define EXCEPTION_EXIT_UNWIND 0x04 +#define EXCEPTION_STACK_INVALID 0x08 +#define EXCEPTION_NESTED_CALL 0x10 + + +typedef struct _EXCEPTION_POINTERS { + PEXCEPTION_RECORD ExceptionRecord; + PCONTEXT ContextRecord; +} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS, *LPEXCEPTION_POINTERS; + + +typedef struct _EXCEPTION_REGISTRATION +{ + struct _EXCEPTION_REGISTRATION* prev; + PEXCEPTION_HANDLER handler; +} EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION; + +typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD; +typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD; + + +/* + * A macro which installs the supplied exception handler. + * Push the pointer to the new handler onto the stack, + * then push the pointer to the old registration structure (at fs:0) + * onto the stack, then put a pointer to the new registration + * structure (i.e. the current stack pointer) at fs:0. + */ +#define __try1(pHandler) \ + __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler)); + + +/* + * A macro which (dispite its name) *removes* an installed + * exception handler. Should be used only in conjunction with the above + * install routine __try1. + * Move the pointer to the old reg. struct (at the current stack + * position) to fs:0, replacing the pointer we installed above, + * then add 8 to the stack pointer to get rid of the space we + * used when we pushed on our new reg. struct above. Notice that + * the stack must be in the exact state at this point that it was + * after we did _try1 or this will smash things. + */ +#define __except1 \ + __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \ + : : : "%eax"); + + +#if 1 + +// Runtime DLL structures + +#ifndef _GNU_H_WINDOWS32_DEFINES +#ifdef __NTOSKRNL__ +#define EXCEPTION_EXECUTE_HANDLER 1 +#define EXCEPTION_CONTINUE_SEARCH 0 +#define EXCEPTION_CONTINUE_EXECUTION -1 +#endif /* __NTOSKRNL__ */ +#endif /* _GNU_H_WINDOWS32_DEFINES */ + +// Functions of the following prototype return one of the above constants +typedef DWORD CDECL (*PSCOPE_EXCEPTION_FILTER)(VOID); +typedef VOID CDECL (*PSCOPE_EXCEPTION_HANDLER)(VOID); + +typedef struct _SCOPETABLE_ENTRY +{ + DWORD PreviousTryLevel; + PSCOPE_EXCEPTION_FILTER FilterRoutine; PSCOPE_EXCEPTION_HANDLER HandlerRoutine; } SCOPETABLE_ENTRY, *PSCOPETABLE_ENTRY; /* - * Other structures preceeding this structure: - * ULONG_PTR StandardESPInFrame; - * LPEXCEPTION_POINTERS ExceptionPointers; + Other structures preceeding this structure: + ULONG_PTR StandardESPInFrame; + LPEXCEPTION_POINTERS ExceptionPointers; */ -typedef struct _RTL_EXCEPTION_REGISTRATION_I386 { +typedef struct _RTL_EXCEPTION_REGISTRATION_I386 +{ EXCEPTION_REGISTRATION OS; PSCOPETABLE_ENTRY ScopeTable; - DWORD TryLevel; - /* Value of EBP before the EXCEPTION_REGISTRATION was created on the stack */ - ULONG_PTR Ebp; + DWORD TryLevel; + /* Value of EBP before the EXCEPTION_REGISTRATION was created */ + ULONG_PTR Ebp; } RTL_EXCEPTION_REGISTRATION_I386, *PRTL_EXCEPTION_REGISTRATION_I386; #define TRYLEVEL_NONE -1 @@ -41,4 +140,6 @@ typedef struct _RTL_EXCEPTION_REGISTRATION_I386 { typedef RTL_EXCEPTION_REGISTRATION_I386 RTL_EXCEPTION_REGISTRATION; typedef PRTL_EXCEPTION_REGISTRATION_I386 PRTL_EXCEPTION_REGISTRATION; +#endif + #endif /* __INCLUDE_EXCEPT_H */ diff --git a/reactos/include/ntos/fs.h b/reactos/include/ntos/fs.h deleted file mode 100755 index 48c4ac2d8f8..00000000000 --- a/reactos/include/ntos/fs.h +++ /dev/null @@ -1,129 +0,0 @@ -#ifndef __INCLUDE_NTOS_FS_H -#define __INCLUDE_NTOS_FS_H - -typedef struct _LARGE_MCB -{ - PFAST_MUTEX FastMutex; - ULONG MaximumPairCount; - ULONG PairCount; - POOL_TYPE PoolType; - PVOID Mapping; -} LARGE_MCB, *PLARGE_MCB; - - -BOOLEAN STDCALL -FsRtlAddLargeMcbEntry(IN PLARGE_MCB Mcb, - IN LONGLONG Vbn, - IN LONGLONG Lbn, - IN LONGLONG SectorCount); - -VOID STDCALL -FsRtlAddMcbEntry ( - DWORD Unknown0, - DWORD Unknown1, - DWORD Unknown2, - DWORD Unknown3 - ); - -BOOLEAN STDCALL -FsRtlGetNextLargeMcbEntry(IN PLARGE_MCB Mcb, - IN ULONG RunIndex, - OUT PLONGLONG Vbn, - OUT PLONGLONG Lbn, - OUT PLONGLONG SectorCount); - -VOID STDCALL -FsRtlGetNextMcbEntry ( - DWORD Unknown0, - DWORD Unknown1, - DWORD Unknown2, - DWORD Unknown3, - DWORD Unknown4 - ); - -VOID STDCALL -FsRtlInitializeLargeMcb(IN PLARGE_MCB Mcb, - IN POOL_TYPE PoolType); - -VOID STDCALL -FsRtlInitializeMcb ( - DWORD Unknown0, - DWORD Unknown1 - ); - - -BOOLEAN STDCALL -FsRtlLookupLargeMcbEntry(IN PLARGE_MCB Mcb, - IN LONGLONG Vbn, - OUT PLONGLONG Lbn OPTIONAL, - OUT PLONGLONG SectorCountFromLbn OPTIONAL, - OUT PLONGLONG StartingLbn OPTIONAL, - OUT PLONGLONG SectorCountFromStartingLbn OPTIONAL, - OUT PULONG Index OPTIONAL); - -BOOLEAN STDCALL -FsRtlLookupLastLargeMcbEntry(IN PLARGE_MCB Mcb, - OUT PLONGLONG Vbn, - OUT PLONGLONG Lbn); - -VOID STDCALL -FsRtlLookupLastMcbEntry ( - DWORD Unknown0, - DWORD Unknown1, - DWORD Unknown2 - ); - -VOID STDCALL -FsRtlLookupMcbEntry ( - DWORD Unknown0, - DWORD Unknown1, - DWORD Unknown2, - DWORD Unknown3, - DWORD Unknown4 - ); - -ULONG STDCALL -FsRtlNumberOfRunsInLargeMcb(IN PLARGE_MCB Mcb); - -VOID STDCALL -FsRtlNumberOfRunsInMcb ( - DWORD Unknown0 - ); - -VOID STDCALL -FsRtlRemoveLargeMcbEntry(IN PLARGE_MCB Mcb, - IN LONGLONG Vbn, - IN LONGLONG SectorCount); - -VOID STDCALL -FsRtlRemoveMcbEntry ( - DWORD Unknown0, - DWORD Unknown1, - DWORD Unknown2 - ); - -BOOLEAN STDCALL -FsRtlSplitLargeMcb(IN PLARGE_MCB Mcb, - IN LONGLONG Vbn, - IN LONGLONG Amount); - -VOID STDCALL -FsRtlTruncateLargeMcb(IN PLARGE_MCB Mcb, - IN LONGLONG Vbn); - - -VOID STDCALL -FsRtlTruncateMcb ( - DWORD Unknown0, - DWORD Unknown1 - ); - -VOID STDCALL -FsRtlUninitializeLargeMcb(IN PLARGE_MCB Mcb); - -VOID STDCALL -FsRtlUninitializeMcb ( - DWORD Unknown0 - ); - -#endif /* __INCLUDE_NTOS_FS_H */ diff --git a/reactos/include/ntos/gdi.h b/reactos/include/ntos/gdi.h deleted file mode 100755 index cec852d7575..00000000000 --- a/reactos/include/ntos/gdi.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: include/ntos/gdi.h - * PURPOSE: Internal GDI APIs - * PROGRAMMER: Casper S. Hornstrup - * UPDATE HISTORY: - * 01-06-2002 CSH Created -*/ - -#ifndef __NTOS_GDI_H -#define __NTOS_GDI_H - -VOID -WINAPI -GdiProcessSetup(VOID); - -#endif /* __NTOS_GDI_H */ diff --git a/reactos/include/ntos/hal.h b/reactos/include/ntos/hal.h deleted file mode 100755 index aeb37fd3acd..00000000000 --- a/reactos/include/ntos/hal.h +++ /dev/null @@ -1,616 +0,0 @@ -/* $Id: hal.h,v 1.1 2002/09/07 15:12:20 chorns Exp $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: include/ddk/haltypes.h - * PURPOSE: HAL provided defintions for device drivers - * PROGRAMMER: David Welch (welch@mcmail.com) - * REVISION HISTORY: - * 23/06/98: Taken from linux system.h - */ - - -#ifndef __HAL_H -#define __HAL_H - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - - -typedef struct _ADAPTER_OBJECT { - int Channel; - PVOID PagePort; - PVOID CountPort; - PVOID OffsetPort; - KSPIN_LOCK SpinLock; - PVOID Buffer; - BOOLEAN Inuse; -} ADAPTER_OBJECT, *PADAPTER_OBJECT; - - -VOID -STDCALL -IoAssignDriveLetters ( - IN PLOADER_PARAMETER_BLOCK LoaderBlock, - IN PSTRING NtDeviceName, - OUT PUCHAR NtSystemPath, - OUT PSTRING NtSystemPathString - ); - -/* HalReturnToFirmware */ -#define FIRMWARE_HALT 1 -#define FIRMWARE_REBOOT 3 - - -/* PCI bus definitions */ - -#define PCI_TYPE0_ADDRESSES 6 -#define PCI_TYPE1_ADDRESSES 2 -#define PCI_TYPE2_ADDRESSES 5 - -#define PCI_COMMON_HDR_LENGTH (FIELD_OFFSET (PCI_COMMON_CONFIG, DeviceSpecific)) - -#define PCI_MAX_DEVICES 32 -#define PCI_MAX_FUNCTION 8 - -#define PCI_INVALID_VENDORID 0xFFFF - - -/* Bit encodings for PCI_COMMON_CONFIG.HeaderType */ - -#define PCI_MULTIFUNCTION 0x80 -#define PCI_DEVICE_TYPE 0x00 -#define PCI_BRIDGE_TYPE 0x01 - - -/* Bit encodings for PCI_COMMON_CONFIG.Command */ - -#define PCI_ENABLE_IO_SPACE 0x0001 -#define PCI_ENABLE_MEMORY_SPACE 0x0002 -#define PCI_ENABLE_BUS_MASTER 0x0004 -#define PCI_ENABLE_SPECIAL_CYCLES 0x0008 -#define PCI_ENABLE_WRITE_AND_INVALIDATE 0x0010 -#define PCI_ENABLE_VGA_COMPATIBLE_PALETTE 0x0020 -#define PCI_ENABLE_PARITY 0x0040 -#define PCI_ENABLE_WAIT_CYCLE 0x0080 -#define PCI_ENABLE_SERR 0x0100 -#define PCI_ENABLE_FAST_BACK_TO_BACK 0x0200 - - -/* Bit encodings for PCI_COMMON_CONFIG.Status */ - -#define PCI_STATUS_FAST_BACK_TO_BACK 0x0080 -#define PCI_STATUS_DATA_PARITY_DETECTED 0x0100 -#define PCI_STATUS_DEVSEL 0x0600 /* 2 bits wide */ -#define PCI_STATUS_SIGNALED_TARGET_ABORT 0x0800 -#define PCI_STATUS_RECEIVED_TARGET_ABORT 0x1000 -#define PCI_STATUS_RECEIVED_MASTER_ABORT 0x2000 -#define PCI_STATUS_SIGNALED_SYSTEM_ERROR 0x4000 -#define PCI_STATUS_DETECTED_PARITY_ERROR 0x8000 - - -/* Bit encodes for PCI_COMMON_CONFIG.u.type0.BaseAddresses */ - -#define PCI_ADDRESS_IO_SPACE 0x00000001 -#define PCI_ADDRESS_MEMORY_TYPE_MASK 0x00000006 -#define PCI_ADDRESS_MEMORY_PREFETCHABLE 0x00000008 - -#define PCI_TYPE_32BIT 0 -#define PCI_TYPE_20BIT 2 -#define PCI_TYPE_64BIT 4 - - -/* Bit encodes for PCI_COMMON_CONFIG.u.type0.ROMBaseAddresses */ - -#define PCI_ROMADDRESS_ENABLED 0x00000001 - - -/* Hal dispatch table */ - -typedef enum _HAL_QUERY_INFORMATION_CLASS -{ - HalInstalledBusInformation, - HalProfileSourceInformation, - HalSystemDockInformation, - HalPowerInformation, - HalProcessorSpeedInformation, - HalCallbackInformation, - HalMapRegisterInformation, - HalMcaLogInformation, - HalFrameBufferCachingInformation, - HalDisplayBiosInformation - /* information levels >= 0x8000000 reserved for OEM use */ -} HAL_QUERY_INFORMATION_CLASS, *PHAL_QUERY_INFORMATION_CLASS; - - -typedef enum _HAL_SET_INFORMATION_CLASS -{ - HalProfileSourceInterval, - HalProfileSourceInterruptHandler, - HalMcaRegisterDriver -} HAL_SET_INFORMATION_CLASS, *PHAL_SET_INFORMATION_CLASS; - - -typedef struct _BUS_HANDLER *PBUS_HANDLER; -typedef struct _DEVICE_HANDLER_OBJECT *PDEVICE_HANDLER_OBJECT; - - -typedef BOOLEAN STDCALL -(*PHAL_RESET_DISPLAY_PARAMETERS)(ULONG Columns, ULONG Rows); - -typedef NTSTATUS STDCALL -(*pHalQuerySystemInformation)(IN HAL_QUERY_INFORMATION_CLASS InformationClass, - IN ULONG BufferSize, - IN OUT PVOID Buffer, - OUT PULONG ReturnedLength); - - -typedef NTSTATUS STDCALL -(*pHalSetSystemInformation)(IN HAL_SET_INFORMATION_CLASS InformationClass, - IN ULONG BufferSize, - IN PVOID Buffer); - - -typedef NTSTATUS STDCALL -(*pHalQueryBusSlots)(IN PBUS_HANDLER BusHandler, - IN ULONG BufferSize, - OUT PULONG SlotNumbers, - OUT PULONG ReturnedLength); - - -/* Control codes of HalDeviceControl function */ -#define BCTL_EJECT 0x0001 -#define BCTL_QUERY_DEVICE_ID 0x0002 -#define BCTL_QUERY_DEVICE_UNIQUE_ID 0x0003 -#define BCTL_QUERY_DEVICE_CAPABILITIES 0x0004 -#define BCTL_QUERY_DEVICE_RESOURCES 0x0005 -#define BCTL_QUERY_DEVICE_RESOURCE_REQUIREMENTS 0x0006 -#define BCTL_QUERY_EJECT 0x0007 -#define BCTL_SET_LOCK 0x0008 -#define BCTL_SET_POWER 0x0009 -#define BCTL_SET_RESUME 0x000A -#define BCTL_SET_DEVICE_RESOURCES 0x000B - -/* Defines for BCTL structures */ -typedef struct -{ - BOOLEAN PowerSupported; - BOOLEAN ResumeSupported; - BOOLEAN LockSupported; - BOOLEAN EjectSupported; - BOOLEAN Removable; -} BCTL_DEVICE_CAPABILITIES, *PBCTL_DEVICE_CAPABILITIES; - - -typedef struct _DEVICE_CONTROL_CONTEXT -{ - NTSTATUS Status; - PDEVICE_HANDLER_OBJECT DeviceHandler; - PDEVICE_OBJECT DeviceObject; - ULONG ControlCode; - PVOID Buffer; - PULONG BufferLength; - PVOID Context; -} DEVICE_CONTROL_CONTEXT, *PDEVICE_CONTROL_CONTEXT; - - -typedef VOID STDCALL -(*PDEVICE_CONTROL_COMPLETION)(IN PDEVICE_CONTROL_CONTEXT ControlContext); - - -typedef NTSTATUS STDCALL -(*pHalDeviceControl)(IN PDEVICE_HANDLER_OBJECT DeviceHandler, - IN PDEVICE_OBJECT DeviceObject, - IN ULONG ControlCode, - IN OUT PVOID Buffer OPTIONAL, - IN OUT PULONG BufferLength OPTIONAL, - IN PVOID Context, - IN PDEVICE_CONTROL_COMPLETION CompletionRoutine); - -typedef VOID FASTCALL -(*pHalExamineMBR)(IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN ULONG MBRTypeIdentifier, - OUT PVOID *Buffer); - -typedef VOID FASTCALL -(*pHalIoAssignDriveLetters)(IN PLOADER_PARAMETER_BLOCK LoaderBlock, - IN PSTRING NtDeviceName, - OUT PUCHAR NtSystemPath, - OUT PSTRING NtSystemPathString); - -typedef NTSTATUS FASTCALL -(*pHalIoReadPartitionTable)(IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN BOOLEAN ReturnRecognizedPartitions, - OUT PDRIVE_LAYOUT_INFORMATION *PartitionBuffer); - -typedef NTSTATUS FASTCALL -(*pHalIoSetPartitionInformation)(IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN ULONG PartitionNumber, - IN ULONG PartitionType); - -typedef NTSTATUS FASTCALL -(*pHalIoWritePartitionTable)(IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN ULONG SectorsPerTrack, - IN ULONG NumberOfHeads, - IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer); - -typedef PBUS_HANDLER FASTCALL -(*pHalHandlerForBus)(IN INTERFACE_TYPE InterfaceType, - IN ULONG BusNumber); - -typedef VOID FASTCALL -(*pHalReferenceBusHandler)(IN PBUS_HANDLER BusHandler); - - -typedef struct _HAL_DISPATCH_TABLE -{ - ULONG Version; - pHalQuerySystemInformation HalQuerySystemInformation; - pHalSetSystemInformation HalSetSystemInformation; - pHalQueryBusSlots HalQueryBusSlots; - pHalDeviceControl HalDeviceControl; - pHalExamineMBR HalExamineMBR; - pHalIoAssignDriveLetters HalIoAssignDriveLetters; - pHalIoReadPartitionTable HalIoReadPartitionTable; - pHalIoSetPartitionInformation HalIoSetPartitionInformation; - pHalIoWritePartitionTable HalIoWritePartitionTable; - pHalHandlerForBus HalReferenceHandlerForBus; - pHalReferenceBusHandler HalReferenceBusHandler; - pHalReferenceBusHandler HalDereferenceBusHandler; -} HAL_DISPATCH_TABLE, *PHAL_DISPATCH_TABLE; - -#define HAL_DISPATCH_VERSION 1 - -extern NTOSAPI PHAL_DISPATCH_TABLE HalDispatchTable; - -/* Hal private dispatch table */ - -typedef struct _HAL_PRIVATE_DISPATCH_TABLE -{ - ULONG Version; -} HAL_PRIVATE_DISPATCH_TABLE, *PHAL_PRIVATE_DISPATCH_TABLE; - -#define HAL_PRIVATE_DISPATCH_VERSION 1 - -extern NTOSAPI PHAL_PRIVATE_DISPATCH_TABLE HalPrivateDispatchTable; - - -/* - * Kernel debugger section - */ - -typedef struct _KD_PORT_INFORMATION -{ - ULONG ComPort; - ULONG BaudRate; - ULONG BaseAddress; -} KD_PORT_INFORMATION, *PKD_PORT_INFORMATION; - - -#ifdef __NTHAL__ -extern ULONG KdComPortInUse; -#else -extern ULONG KdComPortInUse; -#endif - - -VOID STDCALL -HalAcquireDisplayOwnership(IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters); - -NTSTATUS STDCALL -HalAdjustResourceList(PCM_RESOURCE_LIST Resources); - -NTSTATUS STDCALL -HalAllocateAdapterChannel(IN PADAPTER_OBJECT AdapterObject, - IN PDEVICE_OBJECT DeviceObject, - IN ULONG NumberOfMapRegisters, - IN PDRIVER_CONTROL ExecutionRoutine, - IN PVOID Context); - -PVOID STDCALL -HalAllocateCommonBuffer(PADAPTER_OBJECT AdapterObject, - ULONG Length, - PPHYSICAL_ADDRESS LogicalAddress, - BOOLEAN CacheEnabled); - -PVOID STDCALL -HalAllocateCrashDumpRegisters(IN PADAPTER_OBJECT AdapterObject, - IN OUT PULONG NumberOfMapRegisters); - -BOOLEAN STDCALL -HalAllProcessorsStarted(VOID); - -NTSTATUS STDCALL -HalAssignSlotResources( - PUNICODE_STRING RegistryPath, - PUNICODE_STRING DriverClassName, - PDRIVER_OBJECT DriverObject, - PDEVICE_OBJECT DeviceObject, - INTERFACE_TYPE BusType, - ULONG BusNumber, - ULONG SlotNumber, - PCM_RESOURCE_LIST *AllocatedResources - ); - -BOOLEAN STDCALL -HalBeginSystemInterrupt(ULONG Vector, - KIRQL Irql, - PKIRQL OldIrql); - -VOID STDCALL -HalCalibratePerformanceCounter(ULONG Count); - -/* -FASTCALL -HalClearSoftwareInterrupt -*/ - -BOOLEAN STDCALL -HalDisableSystemInterrupt(ULONG Vector, - ULONG Unknown2); - -VOID STDCALL -HalDisplayString(IN PCH String); - -BOOLEAN STDCALL -HalEnableSystemInterrupt(ULONG Vector, - ULONG Unknown2, - ULONG Unknown3); - -VOID STDCALL -HalEndSystemInterrupt(KIRQL Irql, - ULONG Unknown2); - -BOOLEAN STDCALL -HalFlushCommonBuffer(ULONG Unknown1, - ULONG Unknown2, - ULONG Unknown3, - ULONG Unknown4, - ULONG Unknown5, - ULONG Unknown6, - ULONG Unknown7, - ULONG Unknown8); - -VOID STDCALL -HalFreeCommonBuffer(PADAPTER_OBJECT AdapterObject, - ULONG Length, - PHYSICAL_ADDRESS LogicalAddress, - PVOID VirtualAddress, - BOOLEAN CacheEnabled); - -PADAPTER_OBJECT STDCALL -HalGetAdapter(PDEVICE_DESCRIPTION DeviceDescription, - PULONG NumberOfMapRegisters); - -ULONG STDCALL -HalGetBusData(BUS_DATA_TYPE BusDataType, - ULONG BusNumber, - ULONG SlotNumber, - PVOID Buffer, - ULONG Length); - -ULONG STDCALL -HalGetBusDataByOffset(BUS_DATA_TYPE BusDataType, - ULONG BusNumber, - ULONG SlotNumber, - PVOID Buffer, - ULONG Offset, - ULONG Length); - -BOOLEAN STDCALL -HalGetEnvironmentVariable(IN PCH Name, - OUT PCH Value, - IN USHORT ValueLength); - -ULONG STDCALL -HalGetInterruptVector(INTERFACE_TYPE InterfaceType, - ULONG BusNumber, - ULONG BusInterruptLevel, - ULONG BusInterruptVector, - PKIRQL Irql, - PKAFFINITY Affinity); - -VOID STDCALL -HalInitializeProcessor(ULONG ProcessorNumber, - PVOID ProcessorStack); - -BOOLEAN STDCALL -HalInitSystem(ULONG BootPhase, - PLOADER_PARAMETER_BLOCK LoaderBlock); - -BOOLEAN STDCALL -HalMakeBeep(ULONG Frequency); - -VOID STDCALL -HalQueryDisplayParameters(PULONG DispSizeX, - PULONG DispSizeY, - PULONG CursorPosX, - PULONG CursorPosY); - -VOID STDCALL -HalQueryRealTimeClock(PTIME_FIELDS Time); - -/* Is this function really exported ?? */ -VOID -HalQuerySystemInformation(VOID); - -ULONG STDCALL -HalReadDmaCounter(PADAPTER_OBJECT AdapterObject); - -VOID STDCALL -HalReportResourceUsage(VOID); - -VOID STDCALL -HalRequestIpi(ULONG Unknown); - -/* -FASTCALL -HalRequestSoftwareInterrupt -*/ - -VOID STDCALL -HalReturnToFirmware(ULONG Action); - -ULONG STDCALL -HalSetBusData(BUS_DATA_TYPE BusDataType, - ULONG BusNumber, - ULONG SlotNumber, - PVOID Buffer, - ULONG Length); - -ULONG STDCALL -HalSetBusDataByOffset(BUS_DATA_TYPE BusDataType, - ULONG BusNumber, - ULONG SlotNumber, - PVOID Buffer, - ULONG Offset, - ULONG Length); - -VOID STDCALL -HalSetDisplayParameters(ULONG CursorPosX, - ULONG CursorPosY); - -BOOLEAN STDCALL -HalSetEnvironmentVariable(IN PCH Name, - IN PCH Value); - -/* -HalSetProfileInterval -*/ - -VOID STDCALL -HalSetRealTimeClock(PTIME_FIELDS Time); - -/* -HalSetTimeIncrement -*/ - -BOOLEAN STDCALL -HalStartNextProcessor(ULONG Unknown1, - ULONG Unknown2); - -/* -HalStartProfileInterrupt -*/ - -/* -HalStopProfileInterrupt -*/ - -ULONG FASTCALL -HalSystemVectorDispatchEntry(ULONG Unknown1, - ULONG Unknown2, - ULONG Unknown3); - -BOOLEAN STDCALL -HalTranslateBusAddress(INTERFACE_TYPE InterfaceType, - ULONG BusNumber, - PHYSICAL_ADDRESS BusAddress, - PULONG AddressSpace, - PPHYSICAL_ADDRESS TranslatedAddress); - - -/* - * Kernel debugger support functions - */ - -BOOLEAN STDCALL -KdPortInitialize(PKD_PORT_INFORMATION PortInformation, - DWORD Unknown1, - DWORD Unknown2); - -BOOLEAN STDCALL -KdPortGetByte(PUCHAR ByteRecieved); - -BOOLEAN STDCALL -KdPortPollByte(PUCHAR ByteRecieved); - -VOID STDCALL -KdPortPutByte(UCHAR ByteToSend); - - -/* - * Port I/O functions - */ - -VOID STDCALL -READ_PORT_BUFFER_UCHAR(PUCHAR Port, - PUCHAR Value, - ULONG Count); - -VOID STDCALL -READ_PORT_BUFFER_ULONG(PULONG Port, - PULONG Value, - ULONG Count); - -VOID STDCALL -READ_PORT_BUFFER_USHORT(PUSHORT Port, - PUSHORT Value, - ULONG Count); - -UCHAR STDCALL -READ_PORT_UCHAR(PUCHAR Port); - -ULONG STDCALL -READ_PORT_ULONG(PULONG Port); - -USHORT STDCALL -READ_PORT_USHORT(PUSHORT Port); - -VOID STDCALL -WRITE_PORT_BUFFER_UCHAR(PUCHAR Port, - PUCHAR Value, - ULONG Count); - -VOID STDCALL -WRITE_PORT_BUFFER_ULONG(PULONG Port, - PULONG Value, - ULONG Count); - -VOID STDCALL -WRITE_PORT_BUFFER_USHORT(PUSHORT Port, - PUSHORT Value, - ULONG Count); - -VOID STDCALL -WRITE_PORT_UCHAR(PUCHAR Port, - UCHAR Value); - -VOID STDCALL -WRITE_PORT_ULONG(PULONG Port, - ULONG Value); - -VOID STDCALL -WRITE_PORT_USHORT(PUSHORT Port, - USHORT Value); - -BOOLEAN STDCALL -KdPortInitializeEx( - PKD_PORT_INFORMATION PortInformation, - DWORD Unknown1, - DWORD Unknown2); - -BOOLEAN -STDCALL -KdPortGetByteEx( - PKD_PORT_INFORMATION PortInformation, - PUCHAR ByteRecieved); - -BOOLEAN STDCALL -KdPortPollByteEx( - PKD_PORT_INFORMATION PortInformation, - PUCHAR ByteRecieved); - -VOID STDCALL -KdPortPutByteEx( - PKD_PORT_INFORMATION PortInformation, - UCHAR ByteToSend); - -#endif /* __HAL_H */ - -/* EOF */ diff --git a/reactos/include/ntos/i386/segment.h b/reactos/include/ntos/i386/segment.h deleted file mode 100755 index 6034b60403d..00000000000 --- a/reactos/include/ntos/i386/segment.h +++ /dev/null @@ -1,353 +0,0 @@ -#ifndef _ASM_SEGMENT_H -#define _ASM_SEGMENT_H - -#define KERNEL_CS (0x8) -#define KERNEL_DS (0x10) -#define USER_CS (0x18 + 0x3) -#define USER_DS (0x20 + 0x3) -#define RESERVED_FOR_TSS (0x28) -#define PCR_SELECTOR (0x30) -#define TEB_SELECTOR (0x38 + 0x3) - -//#define USER_CS (0x8+0x3) -//#define USER_DS (0x10+0x3) -//#define ZERO_DS 0x18 -//#define KERNEL_CS 0x20 -//#define KERNEL_DS 0x28 - -#ifndef __ASSEMBLY__ - -/* - * Uh, these should become the main single-value transfer routines.. - * They automatically use the right size if we just have the right - * pointer type.. - */ -#define put_user(x,ptr) __put_user((unsigned long)(x),(ptr),sizeof(*(ptr))) -#define get_user(ptr) ((__typeof__(*(ptr)))__get_user((ptr),sizeof(*(ptr)))) - -/* - * This is a silly but good way to make sure that - * the __put_user function is indeed always optimized, - * and that we use the correct sizes.. - */ -extern int bad_user_access_length(void); - -/* - * dummy pointer type structure.. gcc won't try to do something strange - * this way.. - */ -struct __segment_dummy { unsigned long a[100]; }; -#define __sd(x) ((struct __segment_dummy *) (x)) -#define __const_sd(x) ((const struct __segment_dummy *) (x)) - -static inline void __put_user(unsigned long x, void * y, int size) -{ - switch (size) { - case 1: - __asm__ ("movb %b1,%%fs:%0" \ - :"=m" (*__sd(y)) \ - :"iq" ((unsigned char) x), "m" (*__sd(y))); - break; - case 2: - __asm__ ("movw %w1,%%fs:%0" \ - :"=m" (*__sd(y)) \ - :"ir" ((unsigned short) x), "m" (*__sd(y))); - break; - case 4: - __asm__ ("movl %1,%%fs:%0" \ - :"=m" (*__sd(y)) \ - :"ir" (x), "m" (*__sd(y))); - break; - default: - bad_user_access_length(); - } -} - -static inline unsigned long __get_user(const void * y, int size) -{ - unsigned long result; - - switch (size) { - case 1: - __asm__ ("movb %%fs:%1,%b0" \ - :"=q" (result) \ - :"m" (*__const_sd(y))); - return (unsigned char) result; - case 2: - __asm__ ("movw %%fs:%1,%w0" \ - :"=r" (result) \ - :"m" (*__const_sd(y))); - return (unsigned short) result; - case 4: - __asm__ ("movl %%fs:%1,%0" \ - :"=r" (result) \ - :"m" (*__const_sd(y))); - return result; - default: - return bad_user_access_length(); - } -} - -static inline void __generic_memcpy_tofs(void * to, const void * from, unsigned long n) -{ - __asm__ volatile - (" cld \ - push %%es \ - push %%fs \ - cmpl $3,%0 \ - pop %%es \ - jbe 1f \ - movl %%edi,%%ecx \ - negl %%ecx \ - andl $3,%%ecx \ - subl %%ecx,%0 \ - rep; movsb \ - movl %0,%%ecx \ - shrl $2,%%ecx \ - rep; movsl \ - andl $3,%0 \ - 1: movl %0,%%ecx \ - rep; movsb \ - pop %%es" \ - :"=abd" (n) \ - :"0" (n),"D" ((long) to),"S" ((long) from) \ - :"cx","di","si"); -} - -static inline void __constant_memcpy_tofs(void * to, const void * from, unsigned long n) -{ - switch (n) { - case 0: - return; - case 1: - __put_user(*(const char *) from, (char *) to, 1); - return; - case 2: - __put_user(*(const short *) from, (short *) to, 2); - return; - case 3: - __put_user(*(const short *) from, (short *) to, 2); - __put_user(*(2+(const char *) from), 2+(char *) to, 1); - return; - case 4: - __put_user(*(const int *) from, (int *) to, 4); - return; - case 8: - __put_user(*(const int *) from, (int *) to, 4); - __put_user(*(1+(const int *) from), 1+(int *) to, 4); - return; - case 12: - __put_user(*(const int *) from, (int *) to, 4); - __put_user(*(1+(const int *) from), 1+(int *) to, 4); - __put_user(*(2+(const int *) from), 2+(int *) to, 4); - return; - case 16: - __put_user(*(const int *) from, (int *) to, 4); - __put_user(*(1+(const int *) from), 1+(int *) to, 4); - __put_user(*(2+(const int *) from), 2+(int *) to, 4); - __put_user(*(3+(const int *) from), 3+(int *) to, 4); - return; - } -#define COMMON(x) \ -__asm__("cld\n\t" \ - "push %%es\n\t" \ - "push %%fs\n\t" \ - "pop %%es\n\t" \ - "rep ; movsl\n\t" \ - x \ - "pop %%es" \ - : /* no outputs */ \ - :"c" (n/4),"D" ((long) to),"S" ((long) from) \ - :"cx","di","si") - - switch (n % 4) { - case 0: - COMMON(""); - return; - case 1: - COMMON("movsb\n\t"); - return; - case 2: - COMMON("movsw\n\t"); - return; - case 3: - COMMON("movsw\n\tmovsb\n\t"); - return; - } -#undef COMMON -} - -static inline void __generic_memcpy_fromfs(void * to, const void * from, unsigned long n) -{ - __asm__ volatile - (" cld \ - cmpl $3,%0 \ - jbe 1f \ - movl %%edi,%%ecx \ - negl %%ecx \ - andl $3,%%ecx \ - subl %%ecx,%0 \ - fs; rep; movsb \ - movl %0,%%ecx \ - shrl $2,%%ecx \ - fs; rep; movsl \ - andl $3,%0 \ - 1: movl %0,%%ecx \ - fs; rep; movsb" - :"=abd" (n) - :"0" (n),"D" ((long) to),"S" ((long) from) - :"cx","di","si", "memory"); -} - -static inline void __constant_memcpy_fromfs(void * to, const void * from, unsigned long n) -{ - switch (n) { - case 0: - return; - case 1: - *(char *)to = __get_user((const char *) from, 1); - return; - case 2: - *(short *)to = __get_user((const short *) from, 2); - return; - case 3: - *(short *) to = __get_user((const short *) from, 2); - *((char *) to + 2) = __get_user(2+(const char *) from, 1); - return; - case 4: - *(int *) to = __get_user((const int *) from, 4); - return; - case 8: - *(int *) to = __get_user((const int *) from, 4); - *(1+(int *) to) = __get_user(1+(const int *) from, 4); - return; - case 12: - *(int *) to = __get_user((const int *) from, 4); - *(1+(int *) to) = __get_user(1+(const int *) from, 4); - *(2+(int *) to) = __get_user(2+(const int *) from, 4); - return; - case 16: - *(int *) to = __get_user((const int *) from, 4); - *(1+(int *) to) = __get_user(1+(const int *) from, 4); - *(2+(int *) to) = __get_user(2+(const int *) from, 4); - *(3+(int *) to) = __get_user(3+(const int *) from, 4); - return; - } -#define COMMON(x) \ -__asm__("cld\n\t" \ - "rep ; fs ; movsl\n\t" \ - x \ - : /* no outputs */ \ - :"c" (n/4),"D" ((long) to),"S" ((long) from) \ - :"cx","di","si","memory") - - switch (n % 4) { - case 0: - COMMON(""); - return; - case 1: - COMMON("fs ; movsb"); - return; - case 2: - COMMON("fs ; movsw"); - return; - case 3: - COMMON("fs ; movsw\n\tfs ; movsb"); - return; - } -#undef COMMON -} - -#define memcpy_fromfs(to, from, n) \ -(__builtin_constant_p(n) ? \ - __constant_memcpy_fromfs((to),(from),(n)) : \ - __generic_memcpy_fromfs((to),(from),(n))) - -#define memcpy_tofs(to, from, n) \ -(__builtin_constant_p(n) ? \ - __constant_memcpy_tofs((to),(from),(n)) : \ - __generic_memcpy_tofs((to),(from),(n))) - -/* - * These are deprecated.. - * - * Use "put_user()" and "get_user()" with the proper pointer types instead. - */ - -#define get_fs_byte(addr) __get_user((const unsigned char *)(addr),1) -#define get_fs_word(addr) __get_user((const unsigned short *)(addr),2) -#define get_fs_long(addr) __get_user((const unsigned int *)(addr),4) - -#define put_fs_byte(x,addr) __put_user((x),(unsigned char *)(addr),1) -#define put_fs_word(x,addr) __put_user((x),(unsigned short *)(addr),2) -#define put_fs_long(x,addr) __put_user((x),(unsigned int *)(addr),4) - -#ifdef WE_REALLY_WANT_TO_USE_A_BROKEN_INTERFACE - -static inline unsigned short get_user_word(const short *addr) -{ - return __get_user(addr, 2); -} - -static inline unsigned char get_user_byte(const char * addr) -{ - return __get_user(addr,1); -} - -static inline unsigned long get_user_long(const int *addr) -{ - return __get_user(addr, 4); -} - -static inline void put_user_byte(char val,char *addr) -{ - __put_user(val, addr, 1); -} - -static inline void put_user_word(short val,short * addr) -{ - __put_user(val, addr, 2); -} - -static inline void put_user_long(unsigned long val,int * addr) -{ - __put_user(val, addr, 4); -} - -#endif - -/* - * Someone who knows GNU asm better than I should double check the following. - * It seems to work, but I don't know if I'm doing something subtly wrong. - * --- TYT, 11/24/91 - * [ nothing wrong here, Linus: I just changed the ax to be any reg ] - */ - -static inline unsigned long get_fs(void) -{ - unsigned long _v; - __asm__("mov %%fs,%w0":"=r" (_v):"0" (0)); - return _v; -} - -static inline unsigned long get_ds(void) -{ - unsigned long _v; - __asm__("mov %%ds,%w0":"=r" (_v):"0" (0)); - return _v; -} - -static inline void set_fs(unsigned long val) -{ - __asm__ __volatile__("mov %w0,%%fs": /* no output */ :"r" (val)); -} - -static inline void set_ds(unsigned long val) -{ - __asm__ __volatile__("mov %w0,%%ds": /* no output */ :"r" (val)); -} - - -#endif /* __ASSEMBLY__ */ - -#endif /* _ASM_SEGMENT_H */ diff --git a/reactos/include/ntos/keyboard.h b/reactos/include/ntos/keyboard.h index 8902fc54592..2945a737ad1 100644 --- a/reactos/include/ntos/keyboard.h +++ b/reactos/include/ntos/keyboard.h @@ -13,12 +13,7 @@ #ifndef __INCLUDE_KEYBOARD_H #define __INCLUDE_KEYBOARD_H -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - #include -#include /* KEY_EVENT_RECORD structure */ #define CAPSLOCK_ON (128) @@ -47,6 +42,52 @@ #define MENU_EVENT (8) #define FOCUS_EVENT (16) + +typedef struct _KEY_EVENT_RECORD { + BOOL bKeyDown; + WORD wRepeatCount; + WORD wVirtualKeyCode; + WORD wVirtualScanCode; + union { + WCHAR UnicodeChar; + CHAR AsciiChar; + } uChar; + DWORD dwControlKeyState; +} KEY_EVENT_RECORD PACKED; + +typedef struct _MOUSE_EVENT_RECORD { + COORD dwMousePosition; + DWORD dwButtonState; + DWORD dwControlKeyState; + DWORD dwEventFlags; +} MOUSE_EVENT_RECORD; + +typedef struct _WINDOW_BUFFER_SIZE_RECORD { + COORD dwSize; +} WINDOW_BUFFER_SIZE_RECORD; + +typedef struct _MENU_EVENT_RECORD { + UINT dwCommandId; +} MENU_EVENT_RECORD, *PMENU_EVENT_RECORD; + +typedef struct _FOCUS_EVENT_RECORD { + BOOL bSetFocus; +} FOCUS_EVENT_RECORD; + +typedef struct _INPUT_RECORD { + WORD EventType; + union { +#ifndef __cplus_plus + /* this will be the wrong size in c++ */ + KEY_EVENT_RECORD KeyEvent; +#endif + MOUSE_EVENT_RECORD MouseEvent; + WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent; + MENU_EVENT_RECORD MenuEvent; + FOCUS_EVENT_RECORD FocusEvent; + } Event; +} INPUT_RECORD, *PINPUT_RECORD; + /* Virtual Key codes */ #define VK_LBUTTON (1) #define VK_RBUTTON (2) diff --git a/reactos/include/ntos/lpc.h b/reactos/include/ntos/lpc.h deleted file mode 100755 index 02b38ce30bb..00000000000 --- a/reactos/include/ntos/lpc.h +++ /dev/null @@ -1,148 +0,0 @@ -#ifndef __INCLUDE_NAPI_LPC_H -#define __INCLUDE_NAPI_LPC_H - -#include - -#define MAX_MESSAGE_DATA (0x130) - -typedef struct _LPC_TERMINATION_MESSAGE -{ - LPC_MESSAGE Header; - TIME CreationTime; -} LPC_TERMINATION_MESSAGE, *PLPC_TERMINATION_MESSAGE; - -typedef struct _LPC_DEBUG_MESSAGE -{ - LPC_MESSAGE Header; - ULONG EventCode; - ULONG Status; - union { - struct { - EXCEPTION_RECORD ExceptionRecord; - ULONG FirstChance; - } Exception; - struct { - ULONG Reserved; - PVOID StartAddress; - } CreateThread; - struct { - ULONG Reserved; - HANDLE FileHandle; - PVOID Base; - ULONG PointerToSymbolTable; - ULONG NumberOfSymbols; - ULONG Reserved2; - PVOID EntryPoint; - } CreateProcess; - struct { - ULONG ExitCode; - } ExitThread; - struct { - ULONG ExitCode; - } ExitProcess; - struct { - HANDLE FileHandle; - PVOID Base; - ULONG PointerToSymbolTable; - ULONG NumberOfSymbols; - } LoadDll; - struct { - PVOID Base; - } UnloadDll; -#ifdef ANONYMOUSUNIONS - }; -#else - } u; -#endif -} LPC_DEBUG_MESSAGE, * PLPC_DEBUG_MESSAGE; - -typedef struct _LPC_MAX_MESSAGE -{ - LPC_MESSAGE Header; - BYTE Data[MAX_MESSAGE_DATA]; -} LPC_MAX_MESSAGE, *PLPC_MAX_MESSAGE; - -#define PORT_MESSAGE_TYPE(m) (LPC_TYPE)((m).Header.MessageType) - -#ifndef __USE_NT_LPC__ -NTSTATUS STDCALL NtAcceptConnectPort (PHANDLE PortHandle, - HANDLE NamedPortHandle, - PLPC_MESSAGE ServerReply, - BOOLEAN AcceptIt, - PLPC_SECTION_WRITE WriteMap, - PLPC_SECTION_READ ReadMap); -#else -NTSTATUS STDCALL NtAcceptConnectPort (PHANDLE PortHandle, - ULONG PortIdentifier, - PLPC_MESSAGE ServerReply, - BOOLEAN AcceptIt, - PLPC_SECTION_WRITE WriteMap, - PLPC_SECTION_READ ReadMap); -#endif /* ndef __USE_NT_LPC__ */ - -NTSTATUS STDCALL NtCompleteConnectPort (HANDLE PortHandle); - -NTSTATUS STDCALL NtConnectPort(PHANDLE PortHandle, - PUNICODE_STRING PortName, - PSECURITY_QUALITY_OF_SERVICE SecurityQos, - PLPC_SECTION_WRITE SectionInfo, - PLPC_SECTION_READ MapInfo, - PULONG MaxMessageSize, - PVOID ConnectInfo, - PULONG ConnectInfoLength); - -NTSTATUS STDCALL NtReplyWaitReplyPort (HANDLE PortHandle, - PLPC_MESSAGE ReplyMessage); - -NTSTATUS STDCALL NtCreatePort(PHANDLE PortHandle, - POBJECT_ATTRIBUTES ObjectAttributes, - ULONG MaxConnectInfoLength, - ULONG MaxDataLength, - ULONG NPMessageQueueSize OPTIONAL); - -NTSTATUS STDCALL NtCreateWaitablePort(PHANDLE PortHandle, - POBJECT_ATTRIBUTES ObjectAttributes, - ULONG MaxConnectInfoLength, - ULONG MaxDataLength, - ULONG NPMessageQueueSize OPTIONAL); - -NTSTATUS STDCALL NtImpersonateClientOfPort (HANDLE PortHandle, - PLPC_MESSAGE ClientMessage); - -NTSTATUS STDCALL NtListenPort (HANDLE PortHandle, - PLPC_MESSAGE LpcMessage); - -NTSTATUS STDCALL NtQueryInformationPort (HANDLE PortHandle, - CINT PortInformationClass, - PVOID PortInformation, - ULONG PortInformationLength, - PULONG ReturnLength); -NTSTATUS STDCALL NtReplyPort (HANDLE PortHandle, - PLPC_MESSAGE LpcReply); -NTSTATUS STDCALL NtReplyWaitReceivePort (HANDLE PortHandle, - PULONG PortId, - PLPC_MESSAGE MessageReply, - PLPC_MESSAGE MessageRequest); -NTSTATUS STDCALL NtRequestPort (HANDLE PortHandle, - PLPC_MESSAGE LpcMessage); - -NTSTATUS STDCALL NtRequestWaitReplyPort (HANDLE PortHandle, - PLPC_MESSAGE LpcReply, - PLPC_MESSAGE LpcRequest); - -NTSTATUS STDCALL NtReadRequestData (HANDLE PortHandle, - PLPC_MESSAGE Message, - ULONG Index, - PVOID Buffer, - ULONG BufferLength, - PULONG ReturnLength); - -NTSTATUS STDCALL NtWriteRequestData (HANDLE PortHandle, - PLPC_MESSAGE Message, - ULONG Index, - PVOID Buffer, - ULONG BufferLength, - PULONG ReturnLength); - - -#endif /* __INCLUDE_NAPI_LPC_H */ diff --git a/reactos/include/ntos/mm.h b/reactos/include/ntos/mm.h index 69e6d6410d1..7ed75b4bc9f 100644 --- a/reactos/include/ntos/mm.h +++ b/reactos/include/ntos/mm.h @@ -1,18 +1,63 @@ -#ifndef NTOS_MM_H -#define NTOS_MM_H +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/mm.h + * PURPOSE: Memory managment declarations used by all the parts of the + * system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ -#if __GNUC__ >=3 -#pragma GCC system_header + +#ifndef __INCLUDE_MM_H +#define __INCLUDE_MM_H + +#if 0 +#define SEC_COMMIT (134217728) +#define SEC_IMAGE (16777216) +#define SEC_NOCACHE (268435456) +#define SEC_RESERVE (67108864) +#else +#define SEC_BASED (0x00200000) +#define SEC_NO_CHANGE (0x00400000) +#define SEC_IMAGE (0x01000000) +#define SEC_VLM (0x02000000) +#define SEC_RESERVE (0x04000000) +#define SEC_COMMIT (0x08000000) +#define SEC_NOCACHE (0x10000000) #endif +#define PAGE_READONLY (2) +#define PAGE_READWRITE (4) +#define PAGE_WRITECOPY (8) +#define PAGE_EXECUTE (16) +#define PAGE_EXECUTE_READ (32) +#define PAGE_EXECUTE_READWRITE (64) +#define PAGE_EXECUTE_WRITECOPY (128) +#define PAGE_GUARD (256) +#define PAGE_NOACCESS (1) +#define PAGE_NOCACHE (512) +#define MEM_COMMIT (4096) +#define MEM_FREE (65536) +#define MEM_RESERVE (8192) +#define MEM_IMAGE (16777216) +#define MEM_MAPPED (262144) +#define MEM_PRIVATE (131072) +#define MEM_DECOMMIT (16384) +#define MEM_RELEASE (32768) +#define MEM_TOP_DOWN (1048576) +#define EXCEPTION_GUARD_PAGE (0x80000001L) +#define SECTION_EXTEND_SIZE (0x10) +#define SECTION_MAP_EXECUTE (0x8) +#define SECTION_MAP_READ (0x4) +#define SECTION_MAP_WRITE (0x2) +#define SECTION_QUERY (0x1) +#define SECTION_ALL_ACCESS (0xf001fL) -typedef struct _MADDRESS_SPACE -{ - LIST_ENTRY MAreaListHead; - FAST_MUTEX Lock; - ULONG LowestAddress; - struct _EPROCESS* Process; - PUSHORT PageTableRefCountTable; - ULONG PageTableRefCountTableSize; -} MADDRESS_SPACE, *PMADDRESS_SPACE; +#define FILE_MAP_ALL_ACCESS (0xf001fL) +#define FILE_MAP_READ (4) +#define FILE_MAP_WRITE (2) +#define FILE_MAP_COPY (1) -#endif /* NTOS_MM_H */ + +#endif /* __INCLUDE_MM_H */ diff --git a/reactos/include/ntos/npipe.h b/reactos/include/ntos/npipe.h deleted file mode 100755 index bd9ca2fcc43..00000000000 --- a/reactos/include/ntos/npipe.h +++ /dev/null @@ -1,197 +0,0 @@ -#ifndef __INCLUDE_NAPI_NPIPE_H -#define __INCLUDE_NAPI_NPIPE_H - -#include -#include - -/* - * FUNCTION: ZwCreateNamedPipeFile creates named pipe - * ARGUMENTS: - * NamedPipeFileHandle (OUT) = Caller supplied storage for the - * resulting handle - * DesiredAccess = Specifies the type of access that the caller - * requires to the file boject - * ObjectAttributes = Points to a structure that specifies the - * object attributes. - * IoStatusBlock = Points to a variable that receives the final - * completion status and information - * ShareAccess = Specifies the limitations on sharing of the file. - * This parameter can be zero or any compatible - * combination of the following flags - * FILE_SHARE_READ - * FILE_SHARE_WRITE - * CreateDisposition = Specifies what to do depending on whether - * the file already exists. This must be one of - * the following values - * FILE_OPEN - * FILE_CREATE - * FILE_OPEN_IF - * CreateOptions = Specifies the options to be applied when - * creating or opening the file, as a compatible - * combination of the following flags - * FILE_WRITE_THROUGH - * FILE_SYNCHRONOUS_IO_ALERT - * FILE_SYNCHRONOUS_IO_NONALERT - * TypeMessage = Specifies whether the data written to the pipe is - * interpreted as a sequence of messages or as a - * stream of bytes - * ReadModeMessage = Specifies whether the data read from the pipe - * is interpreted as a sequence of messages or as - * a stream of bytes - * NonBlocking = Specifies whether non-blocking mode is enabled - * MaxInstances = Specifies the maximum number of instancs that can - * be created for this pipe - * InBufferSize = Specifies the number of bytes to reserve for the - * input buffer - * OutBufferSize = Specifies the number of bytes to reserve for the - * output buffer - * DefaultTimeout = Optionally points to a variable that specifies - * the default timeout value in units of - * 100-nanoseconds. - * REMARKS: This funciton maps to the win32 function CreateNamedPipe - * RETURNS: - * Status - */ - -NTSTATUS STDCALL NtCreateNamedPipeFile(OUT PHANDLE NamedPipeFileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG ShareAccess, - IN ULONG CreateDisposition, - IN ULONG CreateOptions, - IN BOOLEAN WriteModeMessage, - IN BOOLEAN ReadModeMessage, - IN BOOLEAN NonBlocking, - IN ULONG MaxInstances, - IN ULONG InBufferSize, - IN ULONG OutBufferSize, - IN PLARGE_INTEGER DefaultTimeOut); -NTSTATUS STDCALL ZwCreateNamedPipeFile(OUT PHANDLE NamedPipeFileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG ShareAccess, - IN ULONG CreateDisposition, - IN ULONG CreateOptions, - IN BOOLEAN WriteModeMessage, - IN BOOLEAN ReadModeMessage, - IN BOOLEAN NonBlocking, - IN ULONG MaxInstances, - IN ULONG InBufferSize, - IN ULONG OutBufferSize, - IN PLARGE_INTEGER DefaultTimeOut); - -#define FSCTL_PIPE_ASSIGN_EVENT \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_PIPE_DISCONNECT \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_PIPE_LISTEN \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_PIPE_PEEK \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA) - -#define FSCTL_PIPE_QUERY_EVENT \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_PIPE_TRANSCEIVE \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA) - -#define FSCTL_PIPE_WAIT \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_PIPE_IMPERSONATE \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_PIPE_SET_CLIENT_PROCESS \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_PIPE_QUERY_CLIENT_PROCESS \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_PIPE_GET_STATE \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 10, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_PIPE_SET_STATE \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 11, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_PIPE_INTERNAL_READ \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA) - -#define FSCTL_PIPE_INTERNAL_WRITE \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA) - -#define FSCTL_PIPE_INTERNAL_TRANSCEIVE \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA) - -#define FSCTL_PIPE_INTERNAL_READ_OVFLOW \ - CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA) - - -typedef struct _NPFS_WAIT_PIPE -{ - LARGE_INTEGER Timeout; -} NPFS_WAIT_PIPE, *PNPFS_WAIT_PIPE; - -typedef struct _NPFS_LISTEN -{ -} NPFS_LISTEN, *PNPFS_LISTEN; - -typedef struct _NPFS_SET_STATE -{ - BOOLEAN WriteModeMessage; - BOOLEAN ReadModeMessage; - BOOLEAN NonBlocking; - ULONG InBufferSize; - ULONG OutBufferSize; - LARGE_INTEGER Timeout; -} NPFS_SET_STATE, *PNPFS_SET_STATE; - -typedef struct _NPFS_GET_STATE -{ - BOOLEAN WriteModeMessage; - BOOLEAN ReadModeMessage; - BOOLEAN NonBlocking; - ULONG InBufferSize; - ULONG OutBufferSize; - LARGE_INTEGER Timeout; -} NPFS_GET_STATE, *PNPFS_GET_STATE; - -typedef struct _FILE_PIPE_PEEK_BUFFER -{ - ULONG NamedPipeState; - ULONG ReadDataAvailable; - ULONG NumberOfMessages; - ULONG MessageLength; - CHAR Data[1]; -} FILE_PIPE_PEEK_BUFFER, *PFILE_PIPE_PEEK_BUFFER; - -#define FILE_PIPE_BYTE_STREAM_TYPE 0x00000000 -#define FILE_PIPE_MESSAGE_TYPE 0x00000001 - -#define FILE_PIPE_BYTE_STREAM_MODE 0x00000000 -#define FILE_PIPE_MESSAGE_MODE 0x00000001 - -#define FILE_PIPE_QUEUE_OPERATION 0x00000000 -#define FILE_PIPE_COMPLETE_OPERATION 0x00000001 - -#define FILE_PIPE_INBOUND 0x00000000 -#define FILE_PIPE_OUTBOUND 0x00000001 -#define FILE_PIPE_FULL_DUPLEX 0x00000002 - -#define FILE_PIPE_DISCONNECTED_STATE 0x00000001 -#define FILE_PIPE_LISTENING_STATE 0x00000002 -#define FILE_PIPE_CONNECTED_STATE 0x00000003 -#define FILE_PIPE_CLOSING_STATE 0x00000004 - -#define FILE_PIPE_CLIENT_END 0x00000000 -#define FILE_PIPE_SERVER_END 0x00000001 - -#define FILE_PIPE_READ_DATA 0x00000000 -#define FILE_PIPE_WRITE_SPACE 0x00000001 - - -#endif /* __INCLUDE_NAPI_NPIPE_H */ diff --git a/reactos/include/ntos/ntddblue.h b/reactos/include/ntos/ntddblue.h deleted file mode 100755 index 00e318d544f..00000000000 --- a/reactos/include/ntos/ntddblue.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef _NTDDBLUE_H_INCLUDED_ -#define _NTDDBLUE_H_INCLUDED_ - -#include - -#define IOCTL_CONSOLE_GET_SCREEN_BUFFER_INFO CTL_CODE(FILE_DEVICE_SCREEN, 0x801, METHOD_BUFFERED, FILE_READ_ACCESS) -#define IOCTL_CONSOLE_SET_SCREEN_BUFFER_INFO CTL_CODE(FILE_DEVICE_SCREEN, 0x802, METHOD_BUFFERED, FILE_WRITE_ACCESS) -#define IOCTL_CONSOLE_GET_CURSOR_INFO CTL_CODE(FILE_DEVICE_SCREEN, 0x803, METHOD_BUFFERED, FILE_READ_ACCESS) -#define IOCTL_CONSOLE_SET_CURSOR_INFO CTL_CODE(FILE_DEVICE_SCREEN, 0x804, METHOD_BUFFERED, FILE_WRITE_ACCESS) -#define IOCTL_CONSOLE_GET_MODE CTL_CODE(FILE_DEVICE_SCREEN, 0x805, METHOD_BUFFERED, FILE_READ_ACCESS) -#define IOCTL_CONSOLE_SET_MODE CTL_CODE(FILE_DEVICE_SCREEN, 0x806, METHOD_BUFFERED, FILE_WRITE_ACCESS) - - -#define IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE CTL_CODE(FILE_DEVICE_SCREEN, 0x810, METHOD_BUFFERED, FILE_WRITE_ACCESS) -#define IOCTL_CONSOLE_READ_OUTPUT_ATTRIBUTE CTL_CODE(FILE_DEVICE_SCREEN, 0x811, METHOD_IN_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_CONSOLE_WRITE_OUTPUT_ATTRIBUTE CTL_CODE(FILE_DEVICE_SCREEN, 0x812, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_CONSOLE_SET_TEXT_ATTRIBUTE CTL_CODE(FILE_DEVICE_SCREEN, 0x813, METHOD_BUFFERED, FILE_WRITE_ACCESS) - - -#define IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER CTL_CODE(FILE_DEVICE_SCREEN, 0x820, METHOD_BUFFERED, FILE_WRITE_ACCESS) -#define IOCTL_CONSOLE_READ_OUTPUT_CHARACTER CTL_CODE(FILE_DEVICE_SCREEN, 0x821, METHOD_IN_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_CONSOLE_WRITE_OUTPUT_CHARACTER CTL_CODE(FILE_DEVICE_SCREEN, 0x822, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) - - -#define IOCTL_CONSOLE_DRAW CTL_CODE(FILE_DEVICE_SCREEN, 0x830, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) - - -/* TYPEDEFS **************************************************************/ - - -typedef struct _CONSOLE_MODE -{ - DWORD dwMode; -} CONSOLE_MODE, *PCONSOLE_MODE; - - -typedef struct _OUTPUT_ATTRIBUTE -{ - WORD wAttribute; - DWORD nLength; - COORD dwCoord; - DWORD dwTransfered; -} OUTPUT_ATTRIBUTE, *POUTPUT_ATTRIBUTE; - - -typedef struct _OUTPUT_CHARACTER -{ - CHAR cCharacter; - DWORD nLength; - COORD dwCoord; - DWORD dwTransfered; -} OUTPUT_CHARACTER, *POUTPUT_CHARACTER; - - -typedef struct _CONSOLE_DRAW -{ - SHORT X; // Origin - SHORT Y; - SHORT SizeX; // Size of the screen buffer - SHORT SizeY; -} CONSOLE_DRAW, *PCONSOLE_DRAW; - - -#endif /* _NTDDBLUE_H_INCLUDED_ */ diff --git a/reactos/include/ntos/ntddvid.h b/reactos/include/ntos/ntddvid.h deleted file mode 100755 index d8362c1023f..00000000000 --- a/reactos/include/ntos/ntddvid.h +++ /dev/null @@ -1,480 +0,0 @@ -#ifndef NTOS_NTDDVID_H -#define NTOS_NTDDVID_H - -#include - -#define EMULATOR_READ_ACCESS 0x00000001 -#define EMULATOR_WRITE_ACCESS 0x00000002 - -typedef enum _EMULATOR_PORT_ACCESS_TYPE -{ - Uchar, - Ushort, - Ulong -} EMULATOR_PORT_ACCESS_TYPE, *PEMULATOR_PORT_ACCESS_TYPE; - -typedef struct _EMULATOR_ACCESS_ENTRY -{ - ULONG BasePort; - ULONG NumConsecutivePorts; - EMULATOR_PORT_ACCESS_TYPE AccessType; - UCHAR AccessMode; - UCHAR StringSupport; - PVOID Routine; -} EMULATOR_ACCESS_ENTRY, *PEMULATOR_ACCESS_ENTRY; - - -typedef LONG VP_STATUS, *PVP_STATUS; - -typedef struct _STATUS_BLOCK -{ - VP_STATUS Status; - ULONG Information; -} STATUS_BLOCK, *PSTATUS_BLOCK; - -typedef struct _VIDEO_X86_BIOS_ARGUMENTS -{ - ULONG Eax; - ULONG Ebx; - ULONG Ecx; - ULONG Edx; - ULONG Esi; - ULONG Edi; - ULONG Ebp; -} VIDEO_X86_BIOS_ARGUMENTS, *PVIDEO_X86_BIOS_ARGUMENTS; - -typedef struct _VIDEO_PORT_CONFIG_INFO -{ - ULONG Length; - ULONG SystemIoBusNumber; - INTERFACE_TYPE AdapterInterfaceType; - ULONG BusInterruptLevel; - ULONG BusInterruptVector; - KINTERRUPT_MODE InterruptMode; - ULONG NumEmulatorAccessEntries; - PEMULATOR_ACCESS_ENTRY EmulatorAccessEntries; - ULONG EmulatorAccessEntriesContext; - PHYSICAL_ADDRESS VdmPhysicalVideoMemoryAddress; - ULONG VdmPhysicalVideoMemoryLength; - ULONG HardwareStateSize; - ULONG DmaChannel; - ULONG DmaPort; - UCHAR DmaShareable; - UCHAR InterruptShareable; -} VIDEO_PORT_CONFIG_INFO, *PVIDEO_PORT_CONFIG_INFO; - -typedef struct _VIDEO_REQUEST_PACKET -{ - ULONG IoControlCode; - PSTATUS_BLOCK StatusBlock; - PVOID InputBuffer; - ULONG InputBufferLength; - PVOID OutputBuffer; - ULONG OutputBufferLength; -} VIDEO_REQUEST_PACKET, *PVIDEO_REQUEST_PACKET; - -typedef VP_STATUS STDCALL -(*PVIDEO_HW_FIND_ADAPTER)(PVOID HwDeviceExtension, - PVOID HwContext, - PWSTR ArgumentString, - PVIDEO_PORT_CONFIG_INFO ConfigInfo, - PUCHAR Again); - -typedef BOOLEAN STDCALL -(*PVIDEO_HW_INITIALIZE)(PVOID HwDeviceExtension); - -typedef BOOLEAN STDCALL -(*PVIDEO_HW_INTERRUPT)(PVOID HwDeviceExtension); - -typedef BOOLEAN STDCALL -(*PVIDEO_HW_START_IO)(PVOID HwDeviceExtension, - PVIDEO_REQUEST_PACKET RequestPacket); - -typedef BOOLEAN STDCALL -(*PVIDEO_HW_RESET_HW)(PVOID HwDeviceExtension, - ULONG Columns, - ULONG Rows); - -typedef VOID STDCALL -(*PVIDEO_HW_TIMER)(PVOID HwDeviceExtension); - -typedef struct _VIDEO_HW_INITIALIZATION_DATA -{ - ULONG HwInitDataSize; - INTERFACE_TYPE AdapterInterfaceType; - PVIDEO_HW_FIND_ADAPTER HwFindAdapter; - PVIDEO_HW_INITIALIZE HwInitialize; - PVIDEO_HW_INTERRUPT HwInterrupt; - PVIDEO_HW_START_IO HwStartIO; - ULONG HwDeviceExtensionSize; - ULONG StartingDeviceNumber; - PVIDEO_HW_RESET_HW HwResetHw; - PVIDEO_HW_TIMER HwTimer; -} VIDEO_HW_INITIALIZATION_DATA, *PVIDEO_HW_INITIALIZATION_DATA; - -typedef enum _VIDEO_DEVICE_DATA_TYPE -{ - VpMachineData, - VpCmosData, - VpBusData, - VpControllerData, - VpMonitorData -} VIDEO_DEVICE_DATA_TYPE, *PVIDEO_DEVICE_DATA_TYPE; - - -typedef VP_STATUS STDCALL -(*PMINIPORT_QUERY_DEVICE_ROUTINE)(PVOID HwDeviceExtension, - PVOID Context, - VIDEO_DEVICE_DATA_TYPE DeviceDataType, - PVOID Identifier, - ULONG IdentiferLength, - PVOID ConfigurationData, - ULONG ConfigurationDataLength, - PVOID ComponentInformation, - ULONG ComponentInformationLength); - -typedef struct _VIDEO_ACCESS_RANGE -{ - PHYSICAL_ADDRESS RangeStart; - ULONG RangeLength; - UCHAR RangeInIoSpace; - UCHAR RangeVisible; - UCHAR RangeShareable; -} VIDEO_ACCESS_RANGE, *PVIDEO_ACCESS_RANGE; - -typedef enum _VIDEO_SYNCHRONIZE_PRIORITY -{ - VpLowPriority, - VpMediumPriority, - VpHighPriority -} VIDEO_SYNCHRONIZE_PRIORITY, *PVIDEO_SYNCHRONIZE_PRIORITY; - - -typedef VP_STATUS STDCALL -(*PMINIPORT_GET_REGISTRY_ROUTINE)(PVOID HwDeviceExtension, - PVOID Context, - PWSTR ValueName, - PVOID ValueData, - ULONG ValueLength); - -typedef VOID STDCALL -(*PBANKED_SECTION_ROUTINE)(IN ULONG ReadBank, - IN ULONG WriteBank, - IN PVOID Context); - -typedef BOOLEAN STDCALL -(*PMINIPORT_SYNCHRONIZE_ROUTINE)(PVOID Context); - - -NTSTATUS STDCALL VideoPortInt10(IN PVOID HwDeviceExtension, - IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments); - -ULONG STDCALL VideoPortCompareMemory(IN PVOID Source1, IN PVOID Source2, IN ULONG Length); -VOID VideoPortDebugPrint(IN ULONG DebugPrintLevel, IN PCHAR DebugMessage, ...); -VP_STATUS STDCALL VideoPortDisableInterrupt(IN PVOID HwDeviceExtension); -VP_STATUS STDCALL VideoPortEnableInterrupt(IN PVOID HwDeviceExtension); -VOID STDCALL VideoPortFreeDeviceBase(IN PVOID HwDeviceExtension, IN PVOID MappedAddress); -ULONG STDCALL VideoPortGetBusData(IN PVOID HwDeviceExtension, - IN BUS_DATA_TYPE BusDataType, - IN ULONG SlotNumber, - OUT PVOID Buffer, - IN ULONG Offset, - IN ULONG Length); -UCHAR STDCALL VideoPortGetCurrentIrql(VOID); -PVOID STDCALL VideoPortGetDeviceBase(IN PVOID HwDeviceExtension, - IN PHYSICAL_ADDRESS IoAddress, - IN ULONG NumberOfUchars, - IN UCHAR InIoSpace); -VP_STATUS STDCALL VideoPortGetDeviceData(IN PVOID HwDeviceExtension, - IN VIDEO_DEVICE_DATA_TYPE DeviceDataType, - IN PMINIPORT_QUERY_DEVICE_ROUTINE CallbackRoutine, - IN PVOID Context); -VP_STATUS STDCALL VideoPortGetAccessRanges(IN PVOID HwDeviceExtension, - IN ULONG NumRequestedResources, - IN PIO_RESOURCE_DESCRIPTOR RequestedResources OPTIONAL, - IN ULONG NumAccessRanges, - IN PVIDEO_ACCESS_RANGE AccessRanges, - IN PVOID VendorId, - IN PVOID DeviceId, - IN PULONG Slot); -VP_STATUS STDCALL VideoPortGetRegistryParameters(IN PVOID HwDeviceExtension, - IN PWSTR ParameterName, - IN UCHAR IsParameterFileName, - IN PMINIPORT_GET_REGISTRY_ROUTINE GetRegistryRoutine, - IN PVOID Context); -ULONG STDCALL VideoPortInitialize(IN PVOID Context1, - IN PVOID Context2, - IN PVIDEO_HW_INITIALIZATION_DATA HwInitializationData, - IN PVOID HwContext); -VOID STDCALL VideoPortLogError(IN PVOID HwDeviceExtension, - IN PVIDEO_REQUEST_PACKET Vrp OPTIONAL, - IN VP_STATUS ErrorCode, - IN ULONG UniqueId); -VP_STATUS STDCALL VideoPortMapBankedMemory(IN PVOID HwDeviceExtension, - IN PHYSICAL_ADDRESS PhysicalAddress, - IN PULONG Length, - IN PULONG InIoSpace, - OUT PVOID *VirtualAddress, - IN ULONG BankLength, - IN UCHAR ReadWriteBank, - IN PBANKED_SECTION_ROUTINE BankRoutine, - IN PVOID Context); -VP_STATUS STDCALL VideoPortMapMemory(IN PVOID HwDeviceExtension, - IN PHYSICAL_ADDRESS PhysicalAddress, - IN PULONG Length, - IN PULONG InIoSpace, - OUT PVOID *VirtualAddress); -VOID STDCALL VideoPortMoveMemory(OUT PVOID Destination, - IN PVOID Source, - IN ULONG Length); -UCHAR STDCALL VideoPortReadPortUchar(IN PUCHAR Port); -USHORT STDCALL VideoPortReadPortUshort(IN PUSHORT Port); -ULONG STDCALL VideoPortReadPortUlong(IN PULONG Port); -VOID STDCALL VideoPortReadPortBufferUchar(IN PUCHAR Port, OUT PUCHAR Buffer, IN ULONG Count); -VOID STDCALL VideoPortReadPortBufferUshort(IN PUSHORT Port, OUT PUSHORT Buffer, IN ULONG Count); -VOID STDCALL VideoPortReadPortBufferUlong(IN PULONG Port, OUT PULONG Buffer, IN ULONG Count); -UCHAR STDCALL VideoPortReadRegisterUchar(IN PUCHAR Register); -USHORT STDCALL VideoPortReadRegisterUshort(IN PUSHORT Register); -ULONG STDCALL VideoPortReadRegisterUlong(IN PULONG Register); -VOID STDCALL VideoPortReadRegisterBufferUchar(IN PUCHAR Register, OUT PUCHAR Buffer, IN ULONG Count); -VOID STDCALL VideoPortReadRegisterBufferUshort(IN PUSHORT Register, OUT PUSHORT Buffer, IN ULONG Count); -VOID STDCALL VideoPortReadRegisterBufferUlong(IN PULONG Register, OUT PULONG Buffer, IN ULONG Count); -BOOLEAN STDCALL VideoPortScanRom(IN PVOID HwDeviceExtension, - IN PUCHAR RomBase, - IN ULONG RomLength, - IN PUCHAR String); -ULONG STDCALL VideoPortSetBusData(IN PVOID HwDeviceExtension, - IN BUS_DATA_TYPE BusDataType, - IN ULONG SlotNumber, - IN PVOID Buffer, - IN ULONG Offset, - IN ULONG Length); -VP_STATUS STDCALL VideoPortSetRegistryParameters(IN PVOID HwDeviceExtension, - IN PWSTR ValueName, - IN PVOID ValueData, - IN ULONG ValueLength); -VP_STATUS STDCALL VideoPortSetTrappedEmulatorPorts(IN PVOID HwDeviceExtension, - IN ULONG NumAccessRanges, - IN PVIDEO_ACCESS_RANGE AccessRange); -VOID STDCALL VideoPortStallExecution(IN ULONG Microseconds); -VOID STDCALL VideoPortStartTimer(IN PVOID HwDeviceExtension); -VOID STDCALL VideoPortStopTimer(IN PVOID HwDeviceExtension); -BOOLEAN STDCALL VideoPortSynchronizeExecution(IN PVOID HwDeviceExtension, - IN VIDEO_SYNCHRONIZE_PRIORITY Priority, - IN PMINIPORT_SYNCHRONIZE_ROUTINE SynchronizeRoutine, - OUT PVOID Context); -VP_STATUS STDCALL VideoPortUnmapMemory(IN PVOID HwDeviceExtension, - IN PVOID VirtualAddress, - IN HANDLE ProcessHandle); -VP_STATUS STDCALL VideoPortVerifyAccessRanges(IN PVOID HwDeviceExtension, - IN ULONG NumAccessRanges, - IN PVIDEO_ACCESS_RANGE AccessRanges); -VOID STDCALL VideoPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value); -VOID STDCALL VideoPortWritePortUshort(IN PUSHORT Port, IN USHORT Value); -VOID STDCALL VideoPortWritePortUlong(IN PULONG Port, IN ULONG Value); -VOID STDCALL VideoPortWritePortBufferUchar(IN PUCHAR Port, IN PUCHAR Buffer, IN ULONG Count); -VOID STDCALL VideoPortWritePortBufferUshort(IN PUSHORT Port, IN PUSHORT Buffer, IN ULONG Count); -VOID STDCALL VideoPortWritePortBufferUlong(IN PULONG Port, IN PULONG Buffer, IN ULONG Count); -VOID STDCALL VideoPortWriteRegisterUchar(IN PUCHAR Register, IN UCHAR Value); -VOID STDCALL VideoPortWriteRegisterUshort(IN PUSHORT Register, IN USHORT Value); -VOID STDCALL VideoPortWriteRegisterUlong(IN PULONG Register, IN ULONG Value); -VOID STDCALL VideoPortWriteRegisterBufferUchar(IN PUCHAR Register, IN PUCHAR Buffer, IN ULONG Count); -VOID STDCALL VideoPortWriteRegisterBufferUshort(IN PUSHORT Register, IN PUSHORT Buffer, IN ULONG Count); -VOID STDCALL VideoPortWriteRegisterBufferUlong(IN PULONG Register, IN PULONG Buffer, IN ULONG Count); -VOID STDCALL VideoPortZeroMemory(OUT PVOID Destination, IN ULONG Length); -VOID STDCALL VideoPortZeroDeviceMemory(OUT PVOID Destination, IN ULONG Length); - -#if 0 -/* - * the rough idea: - * init: - * miniport driver defines entrypoint thusly: - * ULONG DriverEntry(PVOID Context1, PVOID Context2); - * miniport allocates and initializes a VIDEO_HW_INIT_DATA struct - * miniport calls VideoPortInitialize - * video port driver handles init of DriverObject (Context1) - * video port driver calls back into HwVidFindAdapter entry point - * video port driver finishes up and returns the status code that - * the miniport driver should return. - * io requests: - * video port driver reformats IRP into VRP - * video port driver calls back into HwVidStartIO entry point - * minimum IoControlCodes that must be handles by the miniport: - * IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES - * IOCTL_VIDEO_QUERY_AVAIL_MODES - * IOCTL_VIDEO_SET_CURRENT_MODE - * IOCTL_VIDEO_MAP_MEMORY - * IOCTL_VIDEO_RESET_DEVICE - * interrupts are handled the same as KM drivers. - */ - -// Bit definitions for Attribute Flags -#define VIDEO_MODE_COLOR 0x0001 -#define VIDEO_MODE_GRAPHICS 0x0002 -#define VIDEO_MODE_PALETTE_DRIVEN 0x0004 - -#define VIDEO_MEMORY_SPACE_MEMORY 0x00 -#define VIDEO_MEMORY_SPACE_IO 0x01 -#define VIDEO_MEMORY_SPACE_USER_MODE 0x02 -#define VIDEO_MEMORY_SPACE_DENSE 0x04 -#define VIDEO_MEMORY_SPACE_P6CACHE 0x08 - -typedef struct _VIDEO_POINTER_CAPABILITIES -{ - ULONG Flags; - ULONG MaxWidth; - ULONG MaxHeight; - ULONG HWPtrBitmapStart; - ULONG HWPtrBitmapEnd; -} VIDEO_POINTER_CAPABILITIES, *PVIDEO_POINTER_CAPABILITIES; - -typedef struct _VIDEO_POINTER_ATTRIBUTES -{ - ULONG Flags; - ULONG Width; - ULONG Height; - ULONG WidthInBytes; - ULONG Enable; - SHORT Column; - SHORT Row; - UCHAR Pixels[1]; -} VIDEO_POINTER_ATTRIBUTES, *PVIDEO_POINTER_ATTRIBUTES; - -typedef enum _VIDEO_BANK_TYPE -{ - VideoNotBanked = 0, - VideoBanked1RW, - VideoBanked1R1W, - VideoBanked2RW, - NumVideoBankTypes -} VIDEO_BANK_TYPE, *PVIDEO_BANK_TYPE; - -typedef struct _VIDEO_BANK_SELECT -{ - ULONG Length; - ULONG Size; - ULONG BankingFlags; - ULONG BankingType; - ULONG PlanarHCBankingType; - ULONG BitmapWidthInBytes; - ULONG BitmapSize; - ULONG Granularity; - ULONG PlanarHCGranularity; - ULONG CodeOffset; - ULONG PlanarHCBankCodeOffset; - ULONG PlanarHCEnableCodeOffset; - ULONG PlanarHCDisableCodeOffset; -} VIDEO_BANK_SELECT, *PVIDEO_BANK_SELECT; - -typedef struct _VIDEO_CLUTDATA -{ - UCHAR Red; - UCHAR Green; - UCHAR Blue; - UCHAR Unused; -} VIDEO_CLUTDATA, *PVIDEO_CLUTDATA; - -typedef struct _VIDEO_NUM_MODES -{ - ULONG NumModes; - ULONG ModeInformationLength; -} VIDEO_NUM_MODES, *PVIDEO_NUM_MODES; - -typedef struct _VIDEO_MODE_INFORMATION -{ - ULONG Length; - ULONG ModeIndex; - ULONG VisScreenWidth; - ULONG VisScreenHeight; - ULONG ScreenStride; - ULONG NumberOfPlanes; - ULONG BitsPerPlane; - ULONG Frequency; - ULONG XMillimeter; - ULONG YMillimeter; - ULONG NumberRedBits; - ULONG NumberGreenBits; - ULONG NumberBlueBits; - ULONG RedMask; - ULONG GreenMask; - ULONG BlueMask; - ULONG AttributeFlags; - ULONG VideoMemoryBitmapWidth; - ULONG VideoMemoryBitmapHeight; - ULONG DriverSpecificAttributeFlags; -} VIDEO_MODE_INFORMATION, *PVIDEO_MODE_INFORMATION; - -#define IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES CTL_CODE(FILE_DEVICE_VIDEO, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_QUERY_AVAIL_MODES CTL_CODE(FILE_DEVICE_VIDEO, 1, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_QUERY_CURRENT_MODE CTL_CODE(FILE_DEVICE_VIDEO, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_SET_CURRENT_MODE CTL_CODE(FILE_DEVICE_VIDEO, 3, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_RESET_DEVICE CTL_CODE(FILE_DEVICE_VIDEO, 4, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_MAP_VIDEO_MEMORY CTL_CODE(FILE_DEVICE_VIDEO, 5, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_UNMAP_VIDEO_MEMORY CTL_CODE(FILE_DEVICE_VIDEO, 6, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_SHARE_VIDEO_MEMORY CTL_CODE(FILE_DEVICE_VIDEO, 7, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY CTL_CODE(FILE_DEVICE_VIDEO, 8, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_GET_PUBLIC_ACCESS_RANGES CTL_CODE(FILE_DEVICE_VIDEO, 9, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES CTL_CODE(FILE_DEVICE_VIDEO, 10, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_GET_POWER_MANAGEMENT CTL_CODE(FILE_DEVICE_VIDEO, 11, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_SET_POWER_MANAGEMENT CTL_CODE(FILE_DEVICE_VIDEO, 12, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_COLOR_CAPABILITIES CTL_CODE(FILE_DEVICE_VIDEO, 13, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_SET_COLOR_REGISTERS CTL_CODE(FILE_DEVICE_VIDEO, 14, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_DISABLE_POINTER CTL_CODE(FILE_DEVICE_VIDEO, 15, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_ENABLE_POINTER CTL_CODE(FILE_DEVICE_VIDEO, 16, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES CTL_CODE(FILE_DEVICE_VIDEO, 17, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_QUERY_POINTER_ATTR CTL_CODE(FILE_DEVICE_VIDEO, 18, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_SET_POINTER_ATTR CTL_CODE(FILE_DEVICE_VIDEO, 19, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_QUERY_POINTER_POSITION CTL_CODE(FILE_DEVICE_VIDEO, 20, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_SET_POINTER_POSITION CTL_CODE(FILE_DEVICE_VIDEO, 21, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_SAVE_HARDWARE_STATE CTL_CODE(FILE_DEVICE_VIDEO, 22, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_RESTORE_HARDWARE_STATE CTL_CODE(FILE_DEVICE_VIDEO, 23, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_DISABLE_CURSOR CTL_CODE(FILE_DEVICE_VIDEO, 24, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_ENABLE_CURSOR CTL_CODE(FILE_DEVICE_VIDEO, 25, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_QUERY_CURSOR_ATTR CTL_CODE(FILE_DEVICE_VIDEO, 26, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_SET_CURSOR_ATTR CTL_CODE(FILE_DEVICE_VIDEO, 27, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_QUERY_CURSOR_POSITION CTL_CODE(FILE_DEVICE_VIDEO, 28, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_SET_CURSOR_POSITION CTL_CODE(FILE_DEVICE_VIDEO, 29, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_GET_BANK_SELECT_CODE CTL_CODE(FILE_DEVICE_VIDEO, 30, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_SET_PALETTE_REGISTERS CTL_CODE(FILE_DEVICE_VIDEO, 31, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_VIDEO_LOAD_AND_SET_FONT CTL_CODE(FILE_DEVICE_VIDEO, 32, METHOD_BUFFERED, FILE_ANY_ACCESS) - -typedef struct -{ - USHORT NumEntries; - USHORT FirstEntry; - union - { - VIDEO_CLUTDATA RgbArray; - ULONG RgbLong; - } LookupTable[1]; -} VIDEO_CLUT, *PVIDEO_CLUT; - -typedef struct _VIDEO_MEMORY -{ - PVOID RequestedVirtualAddress; -} VIDEO_MEMORY, *PVIDEO_MEMORY; - -typedef struct _VIDEO_MEMORY_INFORMATION -{ - PVOID VideoRamBase; - ULONG VideoRamLength; - PVOID FrameBufferBase; - ULONG FrameBufferLength; -} VIDEO_MEMORY_INFORMATION, *PVIDEO_MEMORY_INFORMATION; - -typedef struct _VIDEO_MODE -{ - ULONG RequestedMode; -} VIDEO_MODE, *PVIDEO_MODE; - -typedef struct _VIDEO_SHARE_MEMORY -{ - HANDLE ProcessHandle; - ULONG ViewOffset; - ULONG ViewSize; - PVOID RequestedVirtualAddress; -} VIDEO_SHARE_MEMORY, *PVIDEO_SHARE_MEMORY; - -#endif - -#endif /* NTOS_NTDDVID_H */ diff --git a/reactos/include/ntos/ps.h b/reactos/include/ntos/ps.h index 620bd5419c2..c9e817195f4 100644 --- a/reactos/include/ntos/ps.h +++ b/reactos/include/ntos/ps.h @@ -10,16 +10,16 @@ */ -#ifndef NTOS_PS_H -#define NTOS_PS_H - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - -#include "mm.h" +#ifndef __INCLUDE_PS_H +#define __INCLUDE_PS_H /* Thread access rights */ +#define THREAD_TERMINATE (0x0001L) +#define THREAD_SUSPEND_RESUME (0x0002L) +#define THREAD_GET_CONTEXT (0x0008L) +#define THREAD_SET_CONTEXT (0x0010L) +#define THREAD_SET_INFORMATION (0x0020L) +#define THREAD_QUERY_INFORMATION (0x0040L) #define THREAD_SET_THREAD_TOKEN (0x0080L) #define THREAD_IMPERSONATE (0x0100L) #define THREAD_DIRECT_IMPERSONATION (0x0200L) @@ -75,345 +75,4 @@ /* ResumeThread / SuspendThread */ #define MAXIMUM_SUSPEND_COUNT (0x7f) -typedef struct _KTHREAD -{ - /* For waiting on thread exit */ - DISPATCHER_HEADER DispatcherHeader; /* 00 */ - - /* List of mutants owned by the thread */ - LIST_ENTRY MutantListHead; /* 10 */ - PVOID InitialStack; /* 18 */ - ULONG StackLimit; /* 1C */ - - /* Pointer to the thread's environment block in user memory */ - PTEB Teb; /* 20 */ - - /* Pointer to the thread's TLS array */ - PVOID TlsArray; /* 24 */ - PVOID KernelStack; /* 28 */ - UCHAR DebugActive; /* 2C */ - - /* Thread state (one of THREAD_STATE_xxx constants below) */ - UCHAR State; /* 2D */ - UCHAR Alerted[2]; /* 2E */ - UCHAR Iopl; /* 30 */ - UCHAR NpxState; /* 31 */ - UCHAR Saturation; /* 32 */ - CHAR Priority; /* 33 */ - KAPC_STATE ApcState; /* 34 */ - ULONG ContextSwitches; /* 4C */ - ULONG WaitStatus; /* 50 */ - KIRQL WaitIrql; /* 54 */ - UCHAR WaitMode; /* 58 */ - UCHAR WaitNext; /* 59 */ - UCHAR WaitReason; /* 5A */ - UCHAR Pad; /* 5B */ - PKWAIT_BLOCK WaitBlockList; /* 5C */ - LIST_ENTRY WaitListEntry; /* 60 */ - ULONG WaitTime; /* 68 */ - CHAR BasePriority; /* 69 */ - UCHAR DecrementCount; /* 6A */ - UCHAR PriorityDecrement; /* 6B */ - UCHAR Quantum; /* 6C */ - KWAIT_BLOCK WaitBlock[4]; /* 70 */ - PVOID LegoData; /* D0 */ - LONG KernelApcDisable; /* D4 */ - KAFFINITY UserAffinity; /* D8 */ - UCHAR SystemAffinityActive;/* DC */ - UCHAR Pad2[7]; /* DD */ - PKQUEUE Queue; /* E4 */ - KSPIN_LOCK ApcQueueLock; /* E8 */ - KTIMER Timer; /* EC */ - LIST_ENTRY QueueListEntry; /* 114 */ - KAFFINITY Affinity; /* 11C */ - UCHAR Preempted; /* 120 */ - UCHAR ProcessReadyQueue; /* 121 */ - UCHAR KernelStackResident; /* 122 */ - UCHAR NextProcessor; /* 123 */ - PVOID CallbackStack; /* 124 */ - BOOLEAN Win32Thread; /* 128 */ - UCHAR Pad3[3]; /* 129 */ - struct _KTRAP_FRAME* TrapFrame; /* 12C */ - PVOID ApcStatePointer[2]; /* 130 */ - UCHAR EnableStackSwap; /* 138 */ - UCHAR LargeStack; /* 139 */ - UCHAR ResourceIndex; /* 13A */ - UCHAR PreviousMode; /* 13B */ - ULONG KernelTime; /* 13C */ - ULONG UserTime; /* 140 */ - KAPC_STATE SavedApcState; /* 144 */ - UCHAR Alertable; /* 15C */ - UCHAR ApcStateIndex; /* 15D */ - UCHAR ApcQueueable; /* 15E */ - UCHAR AutoAlignment; /* 15F */ - PVOID StackBase; /* 160 */ - KAPC SuspendApc; /* 164 */ - KSEMAPHORE SuspendSemaphore; /* 194 */ - LIST_ENTRY ThreadListEntry; /* 1A8 */ - CHAR FreezeCount; /* 1B0 */ - UCHAR SuspendCount; /* 1B1 */ - UCHAR IdealProcessor; /* 1B2 */ - UCHAR DisableBoost; /* 1B3 */ - - /* - * Below here are thread structure members that are specific to ReactOS - */ - - /* Added by Phillip Susi for list of threads in a process */ - LIST_ENTRY ProcessThreadListEntry; /* 1B4 */ - ULONG Padding[3*4+1]; -} __attribute__((packed)) KTHREAD, *PKTHREAD; - - -// TopLevelIrp can be one of the following values: -// FIXME I belong somewhere else - -#define FSRTL_FSP_TOP_LEVEL_IRP (0x01) -#define FSRTL_CACHE_TOP_LEVEL_IRP (0x02) -#define FSRTL_MOD_WRITE_TOP_LEVEL_IRP (0x03) -#define FSRTL_FAST_IO_TOP_LEVEL_IRP (0x04) -#define FSRTL_MAX_TOP_LEVEL_IRP_FLAG (0x04) - -typedef struct _TOP_LEVEL_IRP -{ - PIRP TopLevelIrp; - ULONG TopLevelIrpConst; -} TOP_LEVEL_IRP; - - -typedef struct _ETHREAD -{ - KTHREAD Tcb; /* 000 */ - TIME CreateTime; /* 1F0 */ - union - { - TIME ExitTime; /* 1F8 */ - LIST_ENTRY LpcReplyChain; /* 1F8 */ - } u1; - NTSTATUS ExitStatus; /* 200 */ - LIST_ENTRY PostBlockList; /* 204 */ - LIST_ENTRY TerminationPortList; /* 20C */ - KSPIN_LOCK ActiveTimerListLock; /* 214 */ - LIST_ENTRY ActiveTimerListHead; /* 218 */ - CLIENT_ID Cid; /* 220 */ - KSEMAPHORE LpcReplySemaphore; /* 228 */ - PVOID LpcReplyMessage; /* 23C */ - PLARGE_INTEGER LpcReplyMessageId; /* 240 */ - ULONG PerformanceCounterLow; /* 244 */ - PPS_IMPERSONATION_INFORMATION ImpersonationInfo; /* 248 */ - LIST_ENTRY IrpList; /* 24C */ - TOP_LEVEL_IRP* TopLevelIrp; /* 254 */ - PDEVICE_OBJECT DeviceToVerify; /* 258 */ - ULONG ReadClusterSize; /* 25C */ - UCHAR ForwardClusterOnly; /* 260 */ - UCHAR DisablePageFaultClustering; /* 261 */ - UCHAR DeadThread; /* 262 */ - UCHAR HasTerminated; /* 263 */ - PVOID EventPair; /* 264 */ - ACCESS_MASK GrantedAccess; /* 268 */ - struct _EPROCESS* ThreadsProcess; /* 26C */ - PKSTART_ROUTINE StartAddress; /* 270 */ - union - { - LPTHREAD_START_ROUTINE Win32StartAddress; /* 274 */ - ULONG LpcReceiveMessageId; /* 274 */ - } u2; - UCHAR LpcExitThreadCalled; /* 278 */ - UCHAR HardErrorsAreDisabled; /* 279 */ - UCHAR LpcReceivedMsgIdValid; /* 27A */ - UCHAR ActiveImpersonationInfo; /* 27B */ - ULONG PerformanceCountHigh; /* 27C */ - - /* - * Added by David Welch (welch@cwcom.net) - */ - struct _EPROCESS* OldProcess; /* 280 */ - - struct _W32THREAD* Win32Thread; /* 284 */ - -} __attribute__((packed)) ETHREAD, *PETHREAD; - -typedef struct _KPROCESS -{ - /* So it's possible to wait for the process to terminate */ - DISPATCHER_HEADER DispatcherHeader; /* 000 */ - /* - * Presumably a list of profile objects associated with this process, - * currently unused. - */ - LIST_ENTRY ProfileListHead; /* 010 */ - /* - * We use the first member of this array to hold the physical address of - * the page directory for this process. - */ - PHYSICAL_ADDRESS DirectoryTableBase; /* 018 */ - /* - * Presumably a descriptor for the process's LDT, currently unused. - */ - ULONG LdtDescriptor[2]; /* 020 */ - /* - * Presumably for processing int 0x21 from V86 mode DOS, currently - * unused. - */ - ULONG Int21Descriptor[2]; /* 028 */ - /* Don't know. */ - USHORT IopmOffset; /* 030 */ - /* - * Presumably I/O privilege level to be used for this process, currently - * unused. - */ - UCHAR Iopl; /* 032 */ - /* Set if this process is a virtual dos machine? */ - UCHAR VdmFlag; /* 033 */ - /* Bitmask of the processors being used by this process's threads? */ - ULONG ActiveProcessors; /* 034 */ - /* Aggregate of the time this process's threads have spent in kernel mode? */ - ULONG KernelTime; /* 038 */ - /* Aggregate of the time this process's threads have spent in user mode? */ - ULONG UserTime; /* 03C */ - /* List of this process's threads that are ready for execution? */ - LIST_ENTRY ReadyListHead; /* 040 */ - /* List of this process's threads that have their stacks swapped out? */ - LIST_ENTRY SwapListEntry; /* 048 */ - /* List of this process's threads? */ - LIST_ENTRY ThreadListHead; /* 050 */ - /* Maybe a lock for this data structure, the type is assumed. */ - KSPIN_LOCK ProcessLock; /* 058 */ - /* Default affinity mask for this process's threads? */ - ULONG Affinity; /* 05C */ - /* Count of the stacks allocated for this process's threads? */ - USHORT StackCount; /* 060 */ - /* Base priority for this process's threads? */ - KPRIORITY BasePriority; /* 062 */ - /* Default quantum for this process's threads */ - UCHAR ThreadQuantum; /* 063 */ - /* Unknown. */ - UCHAR AutoAlignment; /* 064 */ - /* Process execution state, currently either active or terminated. */ - UCHAR State; /* 065 */ - /* Seed for generating thread ids for this process's threads? */ - UCHAR ThreadSeed; /* 066 */ - /* Disable priority boosts? */ - UCHAR DisableBoost; /* 067 */ -} KPROCESS, *PKPROCESS; - -typedef struct _EPROCESS -{ - /* Microkernel specific process state. */ - KPROCESS Pcb; /* 000 */ - /* Exit status of the process. */ - NTSTATUS ExitStatus; /* 068 */ - /* Unknown. */ - KEVENT LockEvent; /* 06C */ - /* Unknown. */ - ULONG LockCount; /* 07C */ - /* Time of process creation. */ - TIME CreateTime; /* 080 */ - /* Time of process exit. */ - TIME ExitTime; /* 088 */ - /* Unknown. */ - PVOID LockOwner; /* 090 */ - /* Process id. */ - ULONG UniqueProcessId; /* 094 */ - /* Unknown. */ - LIST_ENTRY ActiveProcessLinks; /* 098 */ - /* Unknown. */ - ULONG QuotaPeakPoolUsage[2]; /* 0A0 */ - /* Unknown. */ - ULONG QuotaPoolUsage[2]; /* 0A8 */ - /* Unknown. */ - ULONG PagefileUsage; /* 0B0 */ - /* Unknown. */ - ULONG CommitCharge; /* 0B4 */ - /* Unknown. */ - ULONG PeakPagefileUsage; /* 0B8 */ - /* Unknown. */ - ULONG PeakVirtualSize; /* 0BC */ - /* Unknown. */ - LARGE_INTEGER VirtualSize; /* 0C0 */ - struct - { - ULONG LastTrimTime; - ULONG LastTrimFaultCount; - ULONG PageFaultCount; - ULONG PeakWorkingSetSize; - ULONG WorkingSetSize; - ULONG MinimumWorkingSetSize; - ULONG MaximumWorkingSetSize; - ULONG VmWorkingSetList; - LIST_ENTRY WorkingSetExpansionList; - UCHAR AllowWorkingSetAdjustment; - UCHAR AddressSpaceBeingDeleted; - UCHAR ForegroundPrioritySwitch; - UCHAR MemoryPriority; - } Vm; - PVOID LastProtoPteFault; - struct _EPORT* DebugPort; - struct _EPORT* ExceptionPort; - PVOID ObjectTable; - PVOID Token; - // FAST_MUTEX WorkingSetLock; - KMUTEX WorkingSetLock; - PVOID WorkingSetPage; - UCHAR ProcessOutswapEnabled; - UCHAR ProcessOutswapped; - UCHAR AddressSpaceInitialized; - UCHAR AddressSpaceDeleted; - FAST_MUTEX AddressCreationLock; - KSPIN_LOCK HyperSpaceLock; - PETHREAD ForkInProgress; - USHORT VmOperation; - UCHAR ForkWasSuccessful; - UCHAR MmAgressiveWsTrimMask; - PKEVENT VmOperationEvent; - PVOID PageDirectoryPte; - ULONG LastFaultCount; - PVOID VadRoot; - PVOID VadHint; - PVOID CloneRoot; - ULONG NumberOfPrivatePages; - ULONG NumberOfLockedPages; - USHORT NextProcessColour; - UCHAR ExitProcessCalled; - UCHAR CreateProcessReported; - HANDLE SectionHandle; - PPEB Peb; - PVOID SectionBaseAddress; - PVOID QuotaBlock; - NTSTATUS LastThreadExitStatus; - PVOID WorkingSetWatch; - HANDLE InheritedFromUniqueProcessId; - ACCESS_MASK GrantedAccess; - ULONG DefaultHardErrorProcessing; - PVOID LdtInformation; - ULONG VadFreeHint; - PVOID VdmObjects; - KMUTANT ProcessMutant; - CHAR ImageFileName[16]; - ULONG VmTrimFaultValue; - UCHAR SetTimerResolution; - UCHAR PriorityClass; - UCHAR SubSystemMinorVersion; - UCHAR SubSystemMajorVersion; - USHORT SubSystemVersion; - struct _W32PROCESS* Win32Process; - HANDLE Win32WindowStation; - - /* - * Added by David Welch (welch@mcmail.com) - */ - HANDLE Win32Desktop; - MADDRESS_SPACE AddressSpace; - ROS_HANDLE_TABLE HandleTable; - LIST_ENTRY ProcessListEntry; - - /* - * Added by Philip Susi for list of threads in process - */ - LIST_ENTRY ThreadListHead; -} EPROCESS, *PEPROCESS; - -#define PROCESS_STATE_TERMINATED (1) -#define PROCESS_STATE_ACTIVE (2) - -#endif /* NTOS_PS_H */ +#endif /* __INCLUDE_PS_H */ diff --git a/reactos/include/ntos/rtl.h b/reactos/include/ntos/rtl.h deleted file mode 100755 index 055b9061034..00000000000 --- a/reactos/include/ntos/rtl.h +++ /dev/null @@ -1,1856 +0,0 @@ -/* $Id: rtl.h,v 1.1 2002/09/07 15:12:21 chorns Exp $ - * - */ - -#ifndef __DDK_RTL_H -#define __DDK_RTL_H - -/* -VOID -InitializeUnicodeString ( - PUNICODE_STRING DestinationString, - USHORT Lenght, - USHORT MaximumLength, - PCWSTR Buffer - ); - - Initialize an UNICODE_STRING from its fields. Use when you know the values of - all the fields in advance - - */ - -#define InitializeUnicodeString(__PDEST_STRING__,__LENGTH__,__MAXLENGTH__,__BUFFER__) \ -{ \ - (__PDEST_STRING__)->Length = (__LENGTH__); \ - (__PDEST_STRING__)->MaximumLength = (__MAXLENGTH__); \ - (__PDEST_STRING__)->Buffer = (__BUFFER__); \ -} - -/* -VOID -RtlInitUnicodeStringFromLiteral ( - PUNICODE_STRING DestinationString, - PCWSTR SourceString - ); - - Initialize an UNICODE_STRING from a wide string literal. WARNING: use only with - string literals and statically initialized arrays, it will calculate the wrong - length otherwise - - */ - -#define RtlInitUnicodeStringFromLiteral(__PDEST_STRING__,__SOURCE_STRING__) \ - InitializeUnicodeString( \ - (__PDEST_STRING__), \ - sizeof(__SOURCE_STRING__) - sizeof(WCHAR), \ - sizeof(__SOURCE_STRING__), \ - (__SOURCE_STRING__) \ - ) - -/* - Static initializer for UNICODE_STRING variables. Usage: - - UNICODE_STRING wstr = UNICODE_STRING_INITIALIZER(L"string"); - -*/ - -#define UNICODE_STRING_INITIALIZER(__SOURCE_STRING__) \ -{ \ - sizeof((__SOURCE_STRING__)) - sizeof(WCHAR), \ - sizeof((__SOURCE_STRING__)), \ - (__SOURCE_STRING__) \ -} - -/* - Initializer for empty UNICODE_STRING variables. Usage: - - UNICODE_STRING wstr = EMPTY_UNICODE_STRING; - -*/ -#define EMPTY_UNICODE_STRING {0, 0, NULL} - -typedef struct _INITIAL_TEB -{ - ULONG StackCommit; - ULONG StackReserve; - PVOID StackBase; - PVOID StackLimit; - PVOID StackAllocate; -} INITIAL_TEB, *PINITIAL_TEB; - -typedef struct _RTL_HEAP_DEFINITION -{ - ULONG Length; - ULONG Unknown[11]; -} RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION; - -typedef struct _RTL_ATOM_TABLE -{ - ULONG TableSize; - ULONG NumberOfAtoms; - PVOID Lock; /* fast mutex (kernel mode)/ critical section (user mode) */ - PVOID HandleTable; - LIST_ENTRY Slot[0]; -} RTL_ATOM_TABLE, *PRTL_ATOM_TABLE; - -typedef struct _LB_RANGE -{ - UCHAR upper; - UCHAR lower; -} LB_RANGE; - -typedef struct _RTL_NLS_DATA -{ - USHORT CodePage; - USHORT MaxCharacterSize; // SBCS = 1, DBCS = 2 - WCHAR DefaultCharacter; - WCHAR char1; - WCHAR char2; - WCHAR char3; - USHORT DbcsFlag; - LB_RANGE LeadByteRange[6]; - USHORT reserved; - PWCHAR MultiByteToUnicode; - PCHAR UnicodeToMultiByte; - PWCHAR DosMultiByteToUnicode; - PCHAR DbcsTags; -} RTL_NLS_DATA, *PRTL_NLS_DATA; - -typedef struct _RTL_NLS_TABLE -{ - RTL_NLS_DATA OemInfo; - RTL_NLS_DATA AnsiInfo; - PWCHAR UpcaseTable; - PWCHAR DowncaseTable; -} RTL_NLS_TABLE, *PRTL_NLS_TABLE; - - -typedef struct _RTL_GENERIC_TABLE -{ - PVOID RootElement; - ULONG Unknown2; - ULONG Unknown3; - ULONG Unknown4; - ULONG Unknown5; - ULONG ElementCount; - PVOID CompareRoutine; - PVOID AllocateRoutine; - PVOID FreeRoutine; - ULONG UserParameter; -} RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE; - - -typedef struct _RTL_MESSAGE_RESOURCE_ENTRY -{ - USHORT Length; - USHORT Flags; - UCHAR Text[1]; -} RTL_MESSAGE_RESOURCE_ENTRY, *PRTL_MESSAGE_RESOURCE_ENTRY; - -typedef struct _RTL_MESSAGE_RESOURCE_BLOCK -{ - ULONG LowId; - ULONG HighId; - ULONG OffsetToEntries; -} RTL_MESSAGE_RESOURCE_BLOCK, *PRTL_MESSAGE_RESOURCE_BLOCK; - -typedef struct _RTL_MESSAGE_RESOURCE_DATA -{ - ULONG NumberOfBlocks; - RTL_MESSAGE_RESOURCE_BLOCK Blocks[1]; -} RTL_MESSAGE_RESOURCE_DATA, *PRTL_MESSAGE_RESOURCE_DATA; - -/* - * PURPOSE: Used with RtlCheckRegistryKey, RtlCreateRegistryKey, - * RtlDeleteRegistryKey - */ -#define RTL_REGISTRY_ABSOLUTE 0 -#define RTL_REGISTRY_SERVICES 1 -#define RTL_REGISTRY_CONTROL 2 -#define RTL_REGISTRY_WINDOWS_NT 3 -#define RTL_REGISTRY_DEVICEMAP 4 -#define RTL_REGISTRY_USER 5 -#define RTL_REGISTRY_ENUM 6 // ReactOS specific: Used internally in kernel only -#define RTL_REGISTRY_MAXIMUM 7 - -#define RTL_REGISTRY_HANDLE 0x40000000 -#define RTL_REGISTRY_OPTIONAL 0x80000000 - - -#define SHORT_SIZE (sizeof(USHORT)) -#define SHORT_MASK (SHORT_SIZE-1) -#define LONG_SIZE (sizeof(ULONG)) -#define LONG_MASK (LONG_SIZE-1) -#define LOWBYTE_MASK 0x00FF - -#define FIRSTBYTE(Value) ((Value) & LOWBYTE_MASK) -#define SECONDBYTE(Value) (((Value) >> 8) & LOWBYTE_MASK) -#define THIRDBYTE(Value) (((Value) >> 16) & LOWBYTE_MASK) -#define FOURTHBYTE(Value) (((Value) >> 24) & LOWBYTE_MASK) - -/* FIXME: reverse byte-order on big-endian machines (e.g. MIPS) */ -#define SHORT_LEAST_SIGNIFICANT_BIT 0 -#define SHORT_MOST_SIGNIFICANT_BIT 1 - -#define LONG_LEAST_SIGNIFICANT_BIT 0 -#define LONG_3RD_MOST_SIGNIFICANT_BIT 1 -#define LONG_2RD_MOST_SIGNIFICANT_BIT 2 -#define LONG_MOST_SIGNIFICANT_BIT 3 - - - -#if defined(_NTOSKRNL_) || defined(__NTDLL__) -#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag -#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag -#else -#define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag) -#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag) -#endif /* _NTOSKRNL_ || __NTDLL__ */ - -extern BOOLEAN NLS_MB_CODE_PAGE_TAG; -extern BOOLEAN NLS_MB_OEM_CODE_PAGE_TAG; - - -/* - * NOTE: ReactOS extensions - */ -#define RtlMin(X,Y) (((X) < (Y))? (X) : (Y)) -#define RtlMax(X,Y) (((X) > (Y))? (X) : (Y)) -#define RtlMin3(X,Y,Z) (((X) < (Y)) ? RtlMin(X,Z) : RtlMin(Y,Z)) -#define RtlMax3(X,Y,Z) (((X) > (Y)) ? RtlMax(X,Z) : RtlMax(Y,Z)) - -#if 0 -/* - * VOID - * InitializeObjectAttributes ( - * POBJECT_ATTRIBUTES InitializedAttributes, - * PUNICODE_STRING ObjectName, - * ULONG Attributes, - * HANDLE RootDirectory, - * PSECURITY_DESCRIPTOR SecurityDescriptor - * ); - * - * FUNCTION: Sets up a parameter of type OBJECT_ATTRIBUTES for a - * subsequent call to ZwCreateXXX or ZwOpenXXX - * ARGUMENTS: - * InitializedAttributes (OUT) = Caller supplied storage for the - * object attributes - * ObjectName = Full path name for object - * Attributes = Attributes for the object - * RootDirectory = Where the object should be placed or NULL - * SecurityDescriptor = Ignored - */ -#define InitializeObjectAttributes(p,n,a,r,s) \ -{ \ - (p)->Length = sizeof(OBJECT_ATTRIBUTES); \ - (p)->ObjectName = n; \ - (p)->Attributes = a; \ - (p)->RootDirectory = r; \ - (p)->SecurityDescriptor = s; \ - (p)->SecurityQualityOfService = NULL; \ -} -#endif - -/* - * An ReactOS extension - */ -static -inline -PSINGLE_LIST_ENTRY - PopEntrySList( - PSLIST_HEADER ListHead - ) -{ - PSINGLE_LIST_ENTRY ListEntry; - - ListEntry = ListHead->Next.Next; - if (ListEntry!=NULL) - { - ListHead->Next.Next = ListEntry->Next; - ListHead->Depth++; - ListHead->Sequence++; - } - return ListEntry; -} - - -/* - * An ReactOS extension - */ -static -inline -VOID -PushEntrySList ( - PSLIST_HEADER ListHead, - PSINGLE_LIST_ENTRY Entry - ) -{ - Entry->Next = ListHead->Next.Next; - ListHead->Next.Next = Entry; - ListHead->Depth++; - ListHead->Sequence++; -} - -NTSTATUS -STDCALL -RtlAddAtomToAtomTable ( - IN PRTL_ATOM_TABLE AtomTable, - IN PWSTR AtomName, - OUT PRTL_ATOM Atom - ); - -PVOID STDCALL -RtlAllocateHeap ( - HANDLE Heap, - ULONG Flags, - ULONG Size - ); - -WCHAR -STDCALL -RtlAnsiCharToUnicodeChar ( - CHAR AnsiChar - ); - -ULONG -STDCALL -RtlAnsiStringToUnicodeSize ( - PANSI_STRING AnsiString - ); - -NTSTATUS -STDCALL -RtlAnsiStringToUnicodeString ( - PUNICODE_STRING DestinationString, - PANSI_STRING SourceString, - BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlAppendAsciizToString( - PSTRING Destination, - PCSZ Source - ); - -NTSTATUS -STDCALL -RtlAppendStringToString ( - PSTRING Destination, - PSTRING Source - ); - -NTSTATUS -STDCALL -RtlAppendUnicodeStringToString ( - PUNICODE_STRING Destination, - PUNICODE_STRING Source - ); - -BOOLEAN -STDCALL -RtlAreBitsClear ( - PRTL_BITMAP BitMapHeader, - ULONG StartingIndex, - ULONG Length - ); - -BOOLEAN -STDCALL -RtlAreBitsSet ( - PRTL_BITMAP BitMapHeader, - ULONG StartingIndex, - ULONG Length - ); - -VOID -STDCALL -RtlAssert ( - PVOID FailedAssertion, - PVOID FileName, - ULONG LineNumber, - PCHAR Message - ); - -NTSTATUS -STDCALL -RtlCharToInteger ( - PCSZ String, - ULONG Base, - PULONG Value - ); - -NTSTATUS -STDCALL -RtlCheckRegistryKey ( - ULONG RelativeTo, - PWSTR Path - ); - -VOID -STDCALL -RtlClearAllBits ( - IN PRTL_BITMAP BitMapHeader - ); - -VOID -STDCALL -RtlClearBits ( - IN PRTL_BITMAP BitMapHeader, - IN ULONG StartingIndex, - IN ULONG NumberToClear - ); - -DWORD -STDCALL -RtlCompactHeap ( - HANDLE hheap, - DWORD flags - ); - -LONG -STDCALL -RtlCompareString ( - PSTRING String1, - PSTRING String2, - BOOLEAN CaseInsensitive - ); - -LONG -STDCALL -RtlCompareUnicodeString ( - PUNICODE_STRING String1, - PUNICODE_STRING String2, - BOOLEAN BaseInsensitive - ); - -LARGE_INTEGER -STDCALL -RtlConvertLongToLargeInteger ( - IN LONG SignedInteger - ); - -NTSTATUS -STDCALL -RtlConvertSidToUnicodeString ( - IN OUT PUNICODE_STRING String, - IN PSID Sid, - IN BOOLEAN AllocateString - ); - -LARGE_INTEGER -STDCALL -RtlConvertUlongToLargeInteger ( - IN ULONG UnsignedInteger - ); - -#undef RtlCopyBytes - -VOID -RtlCopyBytes ( - PVOID Destination, - CONST VOID * Source, - ULONG Length - ); - -#undef RtlCopyMemory - -#define RtlCopyMemory(Destination,Source,Length) \ - memcpy((Destination),(Source),(Length)) - -#define RtlCopyBytes RtlCopyMemory - -VOID STDCALL -RtlCopyLuid(IN PLUID LuidDest, - IN PLUID LuidSrc); - -VOID -STDCALL -RtlCopyString ( - PSTRING DestinationString, - PSTRING SourceString - ); - -VOID -STDCALL -RtlCopyUnicodeString ( - PUNICODE_STRING DestinationString, - PUNICODE_STRING SourceString - ); - -NTSTATUS -STDCALL -RtlCreateAtomTable ( - IN ULONG TableSize, - IN OUT PRTL_ATOM_TABLE *AtomTable - ); - -HANDLE -STDCALL -RtlCreateHeap ( - ULONG Flags, - PVOID BaseAddress, - ULONG SizeToReserve, - ULONG SizeToCommit, - PVOID Unknown, - PRTL_HEAP_DEFINITION Definition - ); - -NTSTATUS -STDCALL -RtlCreateRegistryKey ( - ULONG RelativeTo, - PWSTR Path - ); - -NTSTATUS -STDCALL -RtlCreateSecurityDescriptor ( - PSECURITY_DESCRIPTOR SecurityDescriptor, - ULONG Revision - ); - -BOOLEAN -STDCALL -RtlCreateUnicodeString ( - OUT PUNICODE_STRING Destination, - IN PWSTR Source - ); - -BOOLEAN -STDCALL -RtlCreateUnicodeStringFromAsciiz ( - OUT PUNICODE_STRING Destination, - IN PCSZ Source - ); - -NTSTATUS -STDCALL -RtlCustomCPToUnicodeN ( - PRTL_NLS_DATA NlsData, - PWCHAR UnicodeString, - ULONG UnicodeSize, - PULONG ResultSize, - PCHAR CustomString, - ULONG CustomSize - ); - -NTSTATUS -STDCALL -RtlDeleteAtomFromAtomTable ( - IN PRTL_ATOM_TABLE AtomTable, - IN RTL_ATOM Atom - ); - -NTSTATUS -STDCALL -RtlDestroyAtomTable ( - IN PRTL_ATOM_TABLE AtomTable - ); - -BOOL -STDCALL -RtlDestroyHeap ( - HANDLE hheap - ); - -NTSTATUS -STDCALL -RtlDowncaseUnicodeString ( - IN OUT PUNICODE_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlEmptyAtomTable ( - IN PRTL_ATOM_TABLE AtomTable, - IN BOOLEAN DeletePinned - ); - -LARGE_INTEGER -STDCALL -RtlEnlargedIntegerMultiply ( - LONG Multiplicand, - LONG Multiplier - ); - -ULONG -STDCALL -RtlEnlargedUnsignedDivide ( - ULARGE_INTEGER Dividend, - ULONG Divisor, - PULONG Remainder - ); - -LARGE_INTEGER -STDCALL -RtlEnlargedUnsignedMultiply ( - ULONG Multiplicand, - ULONG Multiplier - ); -#if 0 -BOOLEAN STDCALL -RtlEqualLuid(IN PLUID Luid1, - IN PLUID Luid2); -#endif - -BOOLEAN -STDCALL -RtlEqualString ( - PSTRING String1, - PSTRING String2, - BOOLEAN CaseInSensitive - ); - -LARGE_INTEGER -STDCALL -RtlExtendedIntegerMultiply ( - LARGE_INTEGER Multiplicand, - LONG Multiplier - ); - -LARGE_INTEGER -STDCALL -RtlExtendedLargeIntegerDivide ( - LARGE_INTEGER Dividend, - ULONG Divisor, - PULONG Remainder - ); - -LARGE_INTEGER -STDCALL -RtlExtendedMagicDivide ( - LARGE_INTEGER Dividend, - LARGE_INTEGER MagicDivisor, - CCHAR ShiftCount - ); - -#undef RtlFillMemory - -VOID -STDCALL -RtlFillMemory ( - PVOID Destination, - ULONG Length, - UCHAR Fill - ); - -VOID -STDCALL -RtlFillMemoryUlong ( - PVOID Destination, - ULONG Length, - ULONG Fill - ); - -ULONG -STDCALL -RtlFindClearBits ( - PRTL_BITMAP BitMapHeader, - ULONG NumberToFind, - ULONG HintIndex - ); - -ULONG -STDCALL -RtlFindClearBitsAndSet ( - PRTL_BITMAP BitMapHeader, - ULONG NumberToFind, - ULONG HintIndex - ); - -ULONG -STDCALL -RtlFindFirstRunClear ( - PRTL_BITMAP BitMapHeader, - PULONG StartingIndex - ); - -ULONG -STDCALL -RtlFindFirstRunSet ( - PRTL_BITMAP BitMapHeader, - PULONG StartingIndex - ); - -ULONG -STDCALL -RtlFindLongestRunClear ( - PRTL_BITMAP BitMapHeader, - PULONG StartingIndex - ); - -ULONG -STDCALL -RtlFindLongestRunSet ( - PRTL_BITMAP BitMapHeader, - PULONG StartingIndex - ); - -NTSTATUS -STDCALL -RtlFindMessage ( - IN PVOID BaseAddress, - IN ULONG Type, - IN ULONG Language, - IN ULONG MessageId, - OUT PRTL_MESSAGE_RESOURCE_ENTRY *MessageResourceEntry - ); - -ULONG -STDCALL -RtlFindSetBits ( - PRTL_BITMAP BitMapHeader, - ULONG NumberToFind, - ULONG HintIndex - ); - -ULONG -STDCALL -RtlFindSetBitsAndClear ( - PRTL_BITMAP BitMapHeader, - ULONG NumberToFind, - ULONG HintIndex - ); - -NTSTATUS -STDCALL -RtlFormatCurrentUserKeyPath ( - IN OUT PUNICODE_STRING KeyPath - ); - -VOID -STDCALL -RtlFreeAnsiString ( - PANSI_STRING AnsiString - ); - -BOOLEAN -STDCALL -RtlFreeHeap ( - HANDLE Heap, - ULONG Flags, - PVOID Address - ); - -VOID -STDCALL -RtlFreeOemString ( - POEM_STRING OemString - ); - -VOID -STDCALL -RtlFreeUnicodeString ( - PUNICODE_STRING UnicodeString - ); - -VOID STDCALL -RtlGenerate8dot3Name(IN PUNICODE_STRING Name, - IN BOOLEAN AllowExtendedCharacters, - IN OUT PGENERATE_NAME_CONTEXT Context, - OUT PUNICODE_STRING Name8dot3); - -VOID -STDCALL -RtlGetDefaultCodePage ( - PUSHORT AnsiCodePage, - PUSHORT OemCodePage - ); - -/* - * HANDLE - * STDCALL - * RtlGetProcessHeap ( - * VOID - * ); - */ -#define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap) - - -PVOID -STDCALL -RtlImageDirectoryEntryToData ( - PVOID BaseAddress, - BOOLEAN bFlag, - ULONG Directory, - PULONG Size - ); - -PIMAGE_NT_HEADERS -STDCALL -RtlImageNtHeader ( - PVOID BaseAddress - ); - -PIMAGE_SECTION_HEADER -STDCALL -RtlImageRvaToSection ( - PIMAGE_NT_HEADERS NtHeader, - PVOID BaseAddress, - ULONG Rva - ); - -ULONG -STDCALL -RtlImageRvaToVa ( - PIMAGE_NT_HEADERS NtHeader, - PVOID BaseAddress, - ULONG Rva, - PIMAGE_SECTION_HEADER *SectionHeader - ); - -VOID -STDCALL -RtlInitAnsiString ( - PANSI_STRING DestinationString, - PCSZ SourceString - ); - -VOID -STDCALL -RtlInitString ( - PSTRING DestinationString, - PCSZ SourceString - ); - -VOID -STDCALL -RtlInitUnicodeString ( - PUNICODE_STRING DestinationString, - PCWSTR SourceString - ); - -VOID -STDCALL -RtlInitializeBitMap ( - IN OUT PRTL_BITMAP BitMapHeader, - IN PULONG BitMapBuffer, - IN ULONG SizeOfBitMap - ); - -NTSTATUS -STDCALL -RtlInitializeContext ( - IN HANDLE ProcessHandle, - IN PCONTEXT Context, - IN PVOID Parameter, - IN PTHREAD_START_ROUTINE StartAddress, - IN OUT PINITIAL_TEB InitialTeb - ); - -VOID -STDCALL -RtlInitializeGenericTable ( - IN OUT PRTL_GENERIC_TABLE Table, - IN PVOID CompareRoutine, - IN PVOID AllocateRoutine, - IN PVOID FreeRoutine, - IN ULONG UserParameter - ); - -PVOID -STDCALL -RtlInsertElementGenericTable ( - IN OUT PRTL_GENERIC_TABLE Table, - IN PVOID Element, - IN ULONG ElementSize, - IN ULONG Unknown4 - ); - -NTSTATUS -STDCALL -RtlIntegerToChar ( - IN ULONG Value, - IN ULONG Base, - IN ULONG Length, - IN OUT PCHAR String - ); - -NTSTATUS -STDCALL -RtlIntegerToUnicodeString ( - IN ULONG Value, - IN ULONG Base, - IN OUT PUNICODE_STRING String - ); - -BOOLEAN -STDCALL -RtlIsGenericTableEmpty ( - IN PRTL_GENERIC_TABLE Table - ); - -BOOLEAN STDCALL -RtlIsNameLegalDOS8Dot3(IN PUNICODE_STRING UnicodeName, - IN PANSI_STRING AnsiName, - OUT PBOOLEAN SpacesFound); - -LARGE_INTEGER -STDCALL -RtlLargeIntegerAdd ( - LARGE_INTEGER Addend1, - LARGE_INTEGER Addend2 - ); - -/* - * VOID - * RtlLargeIntegerAnd ( - * PLARGE_INTEGER Result, - * LARGE_INTEGER Source, - * LARGE_INTEGER Mask - * ); - */ -#define RtlLargeIntegerAnd(Result, Source, Mask) \ -{ \ - Result.HighPart = Source.HighPart & Mask.HighPart; \ - Result.LowPart = Source.LowPart & Mask.LowPart; \ -} - -LARGE_INTEGER -STDCALL -RtlLargeIntegerArithmeticShift ( - LARGE_INTEGER LargeInteger, - CCHAR ShiftCount - ); - -LARGE_INTEGER -STDCALL -RtlLargeIntegerDivide ( - LARGE_INTEGER Dividend, - LARGE_INTEGER Divisor, - PLARGE_INTEGER Remainder - ); - -/* - * BOOLEAN - * RtlLargeIntegerEqualTo ( - * LARGE_INTEGER Operand1, - * LARGE_INTEGER Operand2 - * ); - */ -#define RtlLargeIntegerEqualTo(X,Y) \ - (!(((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart))) - -/* - * BOOLEAN - * RtlLargeIntegerEqualToZero ( - * LARGE_INTEGER Operand - * ); - */ -#define RtlLargeIntegerEqualToZero(X) \ - (!((X).LowPart | (X).HighPart)) - -/* - * BOOLEAN - * RtlLargeIntegerGreaterThan ( - * LARGE_INTEGER Operand1, - * LARGE_INTEGER Operand2 - * ); - */ -#define RtlLargeIntegerGreaterThan(X,Y) \ - ((((X).HighPart == (Y).HighPart) && ((X).LowPart > (Y).LowPart)) || \ - ((X).HighPart > (Y).HighPart)) - -/* - * BOOLEAN - * RtlLargeIntegerGreaterThanOrEqualTo ( - * LARGE_INTEGER Operand1, - * LARGE_INTEGER Operand2 - * ); - */ -#define RtlLargeIntegerGreaterThanOrEqualTo(X,Y) \ - ((((X).HighPart == (Y).HighPart) && ((X).LowPart >= (Y).LowPart)) || \ - ((X).HighPart > (Y).HighPart)) - -/* - * BOOLEAN - * RtlLargeIntegerGreaterThanOrEqualToZero ( - * LARGE_INTEGER Operand1 - * ); - */ -#define RtlLargeIntegerGreaterOrEqualToZero(X) \ - ((X).HighPart >= 0) - -/* - * BOOLEAN - * RtlLargeIntegerGreaterThanZero ( - * LARGE_INTEGER Operand1 - * ); - */ -#define RtlLargeIntegerGreaterThanZero(X) \ - ((((X).HighPart == 0) && ((X).LowPart > 0)) || \ - ((X).HighPart > 0 )) - -/* - * BOOLEAN - * RtlLargeIntegerLessThan ( - * LARGE_INTEGER Operand1, - * LARGE_INTEGER Operand2 - * ); - */ -#define RtlLargeIntegerLessThan(X,Y) \ - ((((X).HighPart == (Y).HighPart) && ((X).LowPart < (Y).LowPart)) || \ - ((X).HighPart < (Y).HighPart)) - -/* - * BOOLEAN - * RtlLargeIntegerLessThanOrEqualTo ( - * LARGE_INTEGER Operand1, - * LARGE_INTEGER Operand2 - * ); - */ -#define RtlLargeIntegerLessThanOrEqualTo(X,Y) \ - ((((X).HighPart == (Y).HighPart) && ((X).LowPart <= (Y).LowPart)) || \ - ((X).HighPart < (Y).HighPart)) - -/* - * BOOLEAN - * RtlLargeIntegerLessThanOrEqualToZero ( - * LARGE_INTEGER Operand - * ); - */ -#define RtlLargeIntegerLessOrEqualToZero(X) \ - (((X).HighPart < 0) || !((X).LowPart | (X).HighPart)) - -/* - * BOOLEAN - * RtlLargeIntegerLessThanZero ( - * LARGE_INTEGER Operand - * ); - */ -#define RtlLargeIntegerLessThanZero(X) \ - (((X).HighPart < 0)) - -LARGE_INTEGER -STDCALL -RtlLargeIntegerNegate ( - LARGE_INTEGER Subtrahend - ); - -/* - * BOOLEAN - * RtlLargeIntegerNotEqualTo ( - * LARGE_INTEGER Operand1, - * LARGE_INTEGER Operand2 - * ); - */ -#define RtlLargeIntegerNotEqualTo(X,Y) \ - ((((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart))) - -/* - * BOOLEAN - * RtlLargeIntegerNotEqualToZero ( - * LARGE_INTEGER Operand - * ); - */ -#define RtlLargeIntegerNotEqualToZero(X) \ - (((X).LowPart | (X).HighPart)) - -LARGE_INTEGER -STDCALL -RtlLargeIntegerShiftLeft ( - LARGE_INTEGER LargeInteger, - CCHAR ShiftCount - ); - -LARGE_INTEGER -STDCALL -RtlLargeIntegerShiftRight ( - LARGE_INTEGER LargeInteger, - CCHAR ShiftCount - ); - -LARGE_INTEGER -STDCALL -RtlLargeIntegerSubtract ( - LARGE_INTEGER Minuend, - LARGE_INTEGER Subtrahend - ); - -ULONG -STDCALL -RtlLengthSecurityDescriptor ( - PSECURITY_DESCRIPTOR SecurityDescriptor - ); - -BOOL -STDCALL -RtlLockHeap ( - HANDLE hheap - ); - -NTSTATUS -STDCALL -RtlLookupAtomInAtomTable ( - IN PRTL_ATOM_TABLE AtomTable, - IN PWSTR AtomName, - OUT PRTL_ATOM Atom - ); - -#undef RtlMoveMemory - -VOID STDCALL -RtlMoveMemory (PVOID Destination, CONST VOID* Source, ULONG Length); - -NTSTATUS -STDCALL -RtlMultiByteToUnicodeN ( - PWCHAR UnicodeString, - ULONG UnicodeSize, - PULONG ResultSize, - PCHAR MbString, - ULONG MbSize - ); - -NTSTATUS -STDCALL -RtlMultiByteToUnicodeSize ( - PULONG UnicodeSize, - PCHAR MbString, - ULONG MbSize - ); - -DWORD -STDCALL -RtlNtStatusToDosError ( - NTSTATUS StatusCode - ); - -DWORD -STDCALL -RtlNtStatusToDosErrorNoTeb ( - NTSTATUS StatusCode - ); - -int -STDCALL -RtlNtStatusToPsxErrno ( - NTSTATUS StatusCode - ); - -ULONG -STDCALL -RtlNumberGenericTableElements ( - IN PRTL_GENERIC_TABLE Table - ); - -ULONG -STDCALL -RtlNumberOfClearBits ( - PRTL_BITMAP BitMapHeader - ); - -ULONG -STDCALL -RtlNumberOfSetBits ( - PRTL_BITMAP BitMapHeader - ); - -ULONG -STDCALL -RtlOemStringToUnicodeSize ( - POEM_STRING AnsiString - ); - -NTSTATUS -STDCALL -RtlOemStringToUnicodeString ( - PUNICODE_STRING DestinationString, - POEM_STRING SourceString, - BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlOemToUnicodeN ( - PWCHAR UnicodeString, - ULONG UnicodeSize, - PULONG ResultSize, - PCHAR OemString, - ULONG OemSize - ); - -NTSTATUS -STDCALL -RtlOpenCurrentUser ( - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE KeyHandle - ); - -NTSTATUS STDCALL -RtlPinAtomInAtomTable ( - IN PRTL_ATOM_TABLE AtomTable, - IN RTL_ATOM Atom - ); - -BOOLEAN -STDCALL -RtlPrefixString ( - PANSI_STRING String1, - PANSI_STRING String2, - BOOLEAN CaseInsensitive - ); - -BOOLEAN -STDCALL -RtlPrefixUnicodeString ( - PUNICODE_STRING String1, - PUNICODE_STRING String2, - BOOLEAN CaseInsensitive - ); - -NTSTATUS -STDCALL -RtlQueryAtomInAtomTable ( - IN PRTL_ATOM_TABLE AtomTable, - IN RTL_ATOM Atom, - IN OUT PULONG RefCount OPTIONAL, - IN OUT PULONG PinCount OPTIONAL, - IN OUT PWSTR AtomName OPTIONAL, - IN OUT PULONG NameLength OPTIONAL - ); - -NTSTATUS -STDCALL -RtlQueryTimeZoneInformation ( - IN OUT PTIME_ZONE_INFORMATION TimeZoneInformation - ); - -VOID -STDCALL -RtlRaiseException ( - IN PEXCEPTION_RECORD ExceptionRecord - ); - -LPVOID -STDCALL -RtlReAllocateHeap ( - HANDLE hheap, - DWORD flags, - LPVOID ptr, - DWORD size - ); - -/* - * VOID - * RtlRetrieveUlong ( - * PULONG DestinationAddress, - * PULONG SourceAddress - * ); - */ -#define RtlRetrieveUlong(DestAddress,SrcAddress) \ - if ((ULONG)(SrcAddress) & LONG_MASK) \ - { \ - ((PUCHAR)(DestAddress))[0]=((PUCHAR)(SrcAddress))[0]; \ - ((PUCHAR)(DestAddress))[1]=((PUCHAR)(SrcAddress))[1]; \ - ((PUCHAR)(DestAddress))[2]=((PUCHAR)(SrcAddress))[2]; \ - ((PUCHAR)(DestAddress))[3]=((PUCHAR)(SrcAddress))[3]; \ - } \ - else \ - { \ - *((PULONG)(DestAddress))=*((PULONG)(SrcAddress)); \ - } - -/* - * VOID - * RtlRetrieveUshort ( - * PUSHORT DestinationAddress, - * PUSHORT SourceAddress - * ); - */ -#define RtlRetrieveUshort(DestAddress,SrcAddress) \ - if ((ULONG)(SrcAddress) & SHORT_MASK) \ - { \ - ((PUCHAR)(DestAddress))[0]=((PUCHAR)(SrcAddress))[0]; \ - ((PUCHAR)(DestAddress))[1]=((PUCHAR)(SrcAddress))[1]; \ - } \ - else \ - { \ - *((PUSHORT)(DestAddress))=*((PUSHORT)(SrcAddress)); \ - } - -VOID -STDCALL -RtlSecondsSince1970ToTime ( - ULONG SecondsSince1970, - PLARGE_INTEGER Time - ); - -VOID -STDCALL -RtlSecondsSince1980ToTime ( - ULONG SecondsSince1980, - PLARGE_INTEGER Time - ); - -VOID -STDCALL -RtlSetAllBits ( - IN PRTL_BITMAP BitMapHeader - ); - -VOID -STDCALL -RtlSetBits ( - PRTL_BITMAP BitMapHeader, - ULONG StartingIndex, - ULONG NumberToSet - ); - -NTSTATUS -STDCALL -RtlSetDaclSecurityDescriptor ( - PSECURITY_DESCRIPTOR SecurityDescriptor, - BOOLEAN DaclPresent, - PACL Dacl, - BOOLEAN DaclDefaulted - ); - -NTSTATUS -STDCALL -RtlSetTimeZoneInformation ( - IN OUT PTIME_ZONE_INFORMATION TimeZoneInformation - ); - -DWORD -STDCALL -RtlSizeHeap ( - HANDLE hheap, - DWORD flags, - PVOID pmem - ); - -/* - * VOID - * RtlStoreUlong ( - * PULONG Address, - * ULONG Value - * ); - */ -#define RtlStoreUlong(Address,Value) \ - if ((ULONG)(Address) & LONG_MASK) \ - { \ - ((PUCHAR)(Address))[LONG_LEAST_SIGNIFICANT_BIT]=(UCHAR)(FIRSTBYTE(Value)); \ - ((PUCHAR)(Address))[LONG_3RD_MOST_SIGNIFICANT_BIT]=(UCHAR)(FIRSTBYTE(Value)); \ - ((PUCHAR)(Address))[LONG_2ND_MOST_SIGNIFICANT_BIT]=(UCHAR)(THIRDBYTE(Value)); \ - ((PUCHAR)(Address))[LONG_MOST_SIGNIFICANT_BIT]=(UCHAR)(FOURTHBYTE(Value)); \ - } \ - else \ - { \ - *((PULONG)(Address))=(ULONG)(Value); \ - } - -/* - * VOID - * RtlStoreUshort ( - * PUSHORT Address, - * USHORT Value - * ); - */ -#define RtlStoreUshort(Address,Value) \ - if ((ULONG)(Address) & SHORT_MASK) \ - { \ - ((PUCHAR)(Address))[SHORT_LEAST_SIGNIFICANT_BIT]=(UCHAR)(FIRSTBYTE(Value)); \ - ((PUCHAR)(Address))[SHORT_MOST_SIGNIFICANT_BIT]=(UCHAR)(SECONDBYTE(Value)); \ - } \ - else \ - { \ - *((PUSHORT)(Address))=(USHORT)(Value); \ - } - -BOOLEAN -STDCALL -RtlTimeFieldsToTime ( - PTIME_FIELDS TimeFields, - PLARGE_INTEGER Time - ); - -BOOLEAN -STDCALL -RtlTimeToSecondsSince1970 ( - PLARGE_INTEGER Time, - PULONG SecondsSince1970 - ); - -BOOLEAN -STDCALL -RtlTimeToSecondsSince1980 ( - PLARGE_INTEGER Time, - PULONG SecondsSince1980 - ); - -VOID -STDCALL -RtlTimeToTimeFields ( - PLARGE_INTEGER Time, - PTIME_FIELDS TimeFields - ); - -ULONG -STDCALL -RtlUnicodeStringToAnsiSize ( - IN PUNICODE_STRING UnicodeString - ); - -NTSTATUS -STDCALL -RtlUnicodeStringToAnsiString ( - IN OUT PANSI_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUnicodeStringToInteger ( - IN PUNICODE_STRING String, - IN ULONG Base, - OUT PULONG Value - ); - -ULONG -STDCALL -RtlUnicodeStringToOemSize ( - IN PUNICODE_STRING UnicodeString - ); - -NTSTATUS -STDCALL -RtlUnicodeStringToCountedOemString ( - IN OUT POEM_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUnicodeStringToOemString ( - IN OUT POEM_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUnicodeToCustomCPN ( - PRTL_NLS_DATA NlsData, - PCHAR MbString, - ULONG MbSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -NTSTATUS -STDCALL -RtlUnicodeToMultiByteN ( - PCHAR MbString, - ULONG MbSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -NTSTATUS -STDCALL -RtlUnicodeToMultiByteSize ( - PULONG MbSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -NTSTATUS -STDCALL -RtlUnicodeToOemN ( - PCHAR OemString, - ULONG OemSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -BOOL -STDCALL -RtlUnlockHeap ( - HANDLE hheap - ); - -VOID -STDCALL -RtlUnwind ( - PEXCEPTION_REGISTRATION RegistrationFrame, - PVOID ReturnAddress, - PEXCEPTION_RECORD ExceptionRecord, - DWORD EaxValue - ); - -WCHAR -STDCALL -RtlUpcaseUnicodeChar ( - WCHAR Source - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeString ( - IN OUT PUNICODE_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeStringToAnsiString ( - IN OUT PANSI_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeStringToCountedOemString ( - IN OUT POEM_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeStringToOemString ( - IN OUT POEM_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeToCustomCPN ( - PRTL_NLS_DATA NlsData, - PCHAR MbString, - ULONG MbSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeToMultiByteN ( - PCHAR MbString, - ULONG MbSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeToOemN ( - PCHAR OemString, - ULONG OemSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -CHAR -STDCALL -RtlUpperChar ( - CHAR Source - ); - -VOID -STDCALL -RtlUpperString ( - PSTRING DestinationString, - PSTRING SourceString - ); - -BOOL -STDCALL -RtlValidateHeap ( - HANDLE hheap, - DWORD flags, - PVOID pmem - ); - -BOOLEAN -STDCALL -RtlValidSecurityDescriptor ( - PSECURITY_DESCRIPTOR SecurityDescriptor - ); - -BOOLEAN STDCALL -RtlValidSid(IN PSID Sid); - -#undef RtlZeroMemory - -VOID STDCALL -RtlZeroMemory (PVOID Destination, ULONG Length); - -ULONG -STDCALL -RtlxAnsiStringToUnicodeSize ( - IN PANSI_STRING AnsiString - ); - -ULONG -STDCALL -RtlxOemStringToUnicodeSize ( - IN POEM_STRING OemString - ); - -ULONG -STDCALL -RtlxUnicodeStringToAnsiSize ( - IN PUNICODE_STRING UnicodeString - ); - -ULONG -STDCALL -RtlxUnicodeStringToOemSize ( - IN PUNICODE_STRING UnicodeString - ); - - -/* Register io functions */ - -UCHAR -STDCALL -READ_REGISTER_UCHAR ( - PUCHAR Register - ); - -USHORT -STDCALL -READ_REGISTER_USHORT ( - PUSHORT Register - ); - -ULONG -STDCALL -READ_REGISTER_ULONG ( - PULONG Register - ); - -VOID -STDCALL -READ_REGISTER_BUFFER_UCHAR ( - PUCHAR Register, - PUCHAR Buffer, - ULONG Count - ); - -VOID -STDCALL -READ_REGISTER_BUFFER_USHORT ( - PUSHORT Register, - PUSHORT Buffer, - ULONG Count - ); - -VOID -STDCALL -READ_REGISTER_BUFFER_ULONG ( - PULONG Register, - PULONG Buffer, - ULONG Count - ); - -VOID -STDCALL -WRITE_REGISTER_UCHAR ( - PUCHAR Register, - UCHAR Value - ); - -VOID -STDCALL -WRITE_REGISTER_USHORT ( - PUSHORT Register, - USHORT Value - ); - -VOID -STDCALL -WRITE_REGISTER_ULONG ( - PULONG Register, - ULONG Value - ); - -VOID -STDCALL -WRITE_REGISTER_BUFFER_UCHAR ( - PUCHAR Register, - PUCHAR Buffer, - ULONG Count - ); - -VOID -STDCALL -WRITE_REGISTER_BUFFER_USHORT ( - PUSHORT Register, - PUSHORT Buffer, - ULONG Count - ); - -VOID -STDCALL -WRITE_REGISTER_BUFFER_ULONG ( - PULONG Register, - PULONG Buffer, - ULONG Count - ); - - -NTSTATUS STDCALL RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision); -NTSTATUS STDCALL RtlQueryInformationAcl (PACL Acl, PVOID Information, ULONG InformationLength, ACL_INFORMATION_CLASS InformationClass); -NTSTATUS STDCALL RtlSetInformationAcl (PACL Acl, PVOID Information, ULONG InformationLength, ACL_INFORMATION_CLASS InformationClass); -BOOLEAN STDCALL RtlValidAcl (PACL Acl); - -NTSTATUS STDCALL RtlAddAccessAllowedAce(PACL Acl, ULONG Revision, ACCESS_MASK AccessMask, PSID Sid); -NTSTATUS STDCALL RtlAddAccessDeniedAce(PACL Acl, ULONG Revision, ACCESS_MASK AccessMask, PSID Sid); -NTSTATUS STDCALL RtlAddAce(PACL Acl, ULONG Revision, ULONG StartingIndex, PACE AceList, ULONG AceListLength); -NTSTATUS STDCALL RtlAddAuditAccessAce (PACL Acl, ULONG Revision, ACCESS_MASK AccessMask, PSID Sid, BOOLEAN Success, BOOLEAN Failure); -NTSTATUS STDCALL RtlDeleteAce(PACL Acl, ULONG AceIndex); -BOOLEAN STDCALL RtlFirstFreeAce(PACL Acl, PACE* Ace); -NTSTATUS STDCALL RtlGetAce(PACL Acl, ULONG AceIndex, PACE *Ace); - -NTSTATUS STDCALL RtlAbsoluteToSelfRelativeSD (PSECURITY_DESCRIPTOR AbsSD, PSECURITY_DESCRIPTOR RelSD, PULONG BufferLength); -NTSTATUS STDCALL RtlMakeSelfRelativeSD (PSECURITY_DESCRIPTOR AbsSD, PSECURITY_DESCRIPTOR RelSD, PULONG BufferLength); -NTSTATUS STDCALL RtlCreateSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG Revision); -BOOLEAN STDCALL RtlValidSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor); -ULONG STDCALL RtlLengthSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor); -NTSTATUS STDCALL RtlSetDaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, BOOLEAN DaclPresent, PACL Dacl, BOOLEAN DaclDefaulted); -NTSTATUS STDCALL RtlGetDaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PBOOLEAN DaclPresent, PACL* Dacl, PBOOLEAN DaclDefauted); -NTSTATUS STDCALL RtlSetOwnerSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PSID Owner, BOOLEAN OwnerDefaulted); -NTSTATUS STDCALL RtlGetOwnerSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PSID* Owner, PBOOLEAN OwnerDefaulted); -NTSTATUS STDCALL RtlSetGroupSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PSID Group, BOOLEAN GroupDefaulted); -NTSTATUS STDCALL RtlGetGroupSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PSID* Group, PBOOLEAN GroupDefaulted); -NTSTATUS STDCALL RtlGetControlSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PSECURITY_DESCRIPTOR_CONTROL Control, PULONG Revision); -NTSTATUS STDCALL RtlSetSaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, BOOLEAN SaclPresent, PACL Sacl, BOOLEAN SaclDefaulted); -NTSTATUS STDCALL RtlGetSaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PBOOLEAN SaclPresent, PACL* Sacl, PBOOLEAN SaclDefauted); -NTSTATUS STDCALL RtlSelfRelativeToAbsoluteSD (PSECURITY_DESCRIPTOR RelSD, - PSECURITY_DESCRIPTOR AbsSD, - PDWORD AbsSDSize, - PACL Dacl, - PDWORD DaclSize, - PACL Sacl, - PDWORD SaclSize, - PSID Owner, - PDWORD OwnerSize, - PSID Group, - PDWORD GroupSize); - -NTSTATUS STDCALL RtlAllocateAndInitializeSid (PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, - UCHAR SubAuthorityCount, - ULONG SubAuthority0, - ULONG SubAuthority1, - ULONG SubAuthority2, - ULONG SubAuthority3, - ULONG SubAuthority4, - ULONG SubAuthority5, - ULONG SubAuthority6, - ULONG SubAuthority7, - PSID *Sid); -ULONG STDCALL RtlLengthRequiredSid (UCHAR SubAuthorityCount); -PSID_IDENTIFIER_AUTHORITY STDCALL RtlIdentifierAuthoritySid (PSID Sid); -NTSTATUS STDCALL RtlInitializeSid (PSID Sid, PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, UCHAR SubAuthorityCount); -PULONG STDCALL RtlSubAuthoritySid (PSID Sid, ULONG SubAuthority); -NTSTATUS STDCALL RtlCopySid (ULONG BufferLength, PSID Dest, PSID Src); -BOOLEAN STDCALL RtlEqualPrefixSid (PSID Sid1, PSID Sid2); -BOOLEAN STDCALL RtlEqualSid(PSID Sid1, PSID Sid2); -PSID STDCALL RtlFreeSid (PSID Sid); -ULONG STDCALL RtlLengthSid (PSID Sid); -PULONG STDCALL RtlSubAuthoritySid (PSID Sid, ULONG SubAuthority); -PUCHAR STDCALL RtlSubAuthorityCountSid (PSID Sid); -BOOLEAN STDCALL RtlValidSid (PSID Sid); -NTSTATUS STDCALL RtlConvertSidToUnicodeString (PUNICODE_STRING String, PSID Sid, BOOLEAN AllocateBuffer); - -BOOLEAN STDCALL RtlAreAllAccessesGranted (ACCESS_MASK GrantedAccess, ACCESS_MASK DesiredAccess); -BOOLEAN STDCALL RtlAreAnyAccessesGranted (ACCESS_MASK GrantedAccess, ACCESS_MASK DesiredAccess); -VOID STDCALL RtlMapGenericMask (PACCESS_MASK AccessMask, PGENERIC_MAPPING GenericMapping); - - -/* functions exported from NTOSKRNL.EXE which are considered RTL */ - -#if defined(__NTOSKRNL__) || defined(__NTDRIVER__) || defined(__NTHAL__) || defined(__NTDLL__) || defined(__NTAPP__) - -char *_itoa (int value, char *string, int radix); -int _snprintf(char * buf, size_t cnt, const char *fmt, ...); -int _snwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, ...); -int _stricmp(const char *s1, const char *s2); -char * _strlwr(char *x); -int _strnicmp(const char *s1, const char *s2, size_t n); -char * _strnset(char* szToFill, int szFill, size_t sizeMaxFill); -char * _strrev(char *s); -char * _strset(char* szToFill, int szFill); -char * _strupr(char *x); -int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args); -int _wcsicmp (const wchar_t* cs, const wchar_t* ct); -wchar_t * _wcslwr (wchar_t *x); -int _wcsnicmp (const wchar_t * cs,const wchar_t * ct,size_t count); -wchar_t* _wcsnset (wchar_t* wsToFill, wchar_t wcFill, size_t sizeMaxFill); -wchar_t * _wcsrev(wchar_t *s); -wchar_t *_wcsupr(wchar_t *x); - -int atoi(const char *str); -long atol(const char *str); -int isdigit(int c); -int islower(int c); -int isprint(int c); -int isspace(int c); -int isupper(int c); -int isxdigit(int c); -size_t mbstowcs (wchar_t *wcstr, const char *mbstr, size_t count); -int mbtowc (wchar_t *wchar, const char *mbchar, size_t count); -void * memchr(const void *s, int c, size_t n); -void * memcpy(void *to, const void *from, size_t count); -void * memmove(void *dest,const void *src, size_t count); -void * memset(void *src, int val, size_t count); - -#if 0 -qsort -#endif - -int rand(void); -int sprintf(char * buf, const char *fmt, ...); -void srand(unsigned seed); -char * strcat(char *s, const char *append); -char * strchr(const char *s, int c); -int strcmp(const char *s1, const char *s2); -char * strcpy(char *to, const char *from); -size_t strlen(const char *str); -char * strncat(char *dst, const char *src, size_t n); -int strncmp(const char *s1, const char *s2, size_t n); -char *strncpy(char *dst, const char *src, size_t n); -char *strrchr(const char *s, int c); -size_t strspn(const char *s1, const char *s2); -char *strstr(const char *s, const char *find); -int swprintf(wchar_t *buf, const wchar_t *fmt, ...); -int tolower(int c); -int toupper(int c); -wchar_t towlower(wchar_t c); -wchar_t towupper(wchar_t c); -int vsprintf(char *buf, const char *fmt, va_list args); -wchar_t * wcscat(wchar_t *dest, const wchar_t *src); -wchar_t * wcschr(const wchar_t *str, wchar_t ch); -int wcscmp(const wchar_t *cs, const wchar_t *ct); -wchar_t* wcscpy(wchar_t* str1, const wchar_t* str2); -size_t wcscspn(const wchar_t *str,const wchar_t *reject); -size_t wcslen(const wchar_t *s); -wchar_t * wcsncat(wchar_t *dest, const wchar_t *src, size_t count); -int wcsncmp(const wchar_t *cs, const wchar_t *ct, size_t count); -wchar_t * wcsncpy(wchar_t *dest, const wchar_t *src, size_t count); -wchar_t * wcsrchr(const wchar_t *str, wchar_t ch); -size_t wcsspn(const wchar_t *str,const wchar_t *accept); -wchar_t *wcsstr(const wchar_t *s,const wchar_t *b); -size_t wcstombs (char *mbstr, const wchar_t *wcstr, size_t count); -int wctomb (char *mbchar, wchar_t wchar); - -#endif /* __NTOSKRNL__ || __NTDRIVER__ || __NTHAL__ || __NTDLL__ || __NTAPP__ */ - -#endif /* __DDK_RTL_H */ diff --git a/reactos/include/ntos/security.h b/reactos/include/ntos/security.h index 73f48f91a84..da67f46879e 100644 --- a/reactos/include/ntos/security.h +++ b/reactos/include/ntos/security.h @@ -1,26 +1,344 @@ #ifndef __INCLUDE_SECURITY_H #define __INCLUDE_SECURITY_H -#include -#include -#include +#include +#include -typedef struct _ROS_ACE_HEADER { - UCHAR AceType; - UCHAR AceFlags; +/* SID Auhority */ +#define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0} +#define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1} +#define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2} +#define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3} +#define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4} +#define SECURITY_NT_AUTHORITY {0,0,0,0,0,5} + +/* SID */ +#define SECURITY_NULL_RID (0L) +#define SECURITY_WORLD_RID (0L) +#define SECURITY_LOCAL_RID (0L) +#define SECURITY_CREATOR_OWNER_RID (0L) +#define SECURITY_CREATOR_GROUP_RID (0x1L) +#define SECURITY_CREATOR_OWNER_SERVER_RID (0x2L) +#define SECURITY_CREATOR_GROUP_SERVER_RID (0x3L) +#define SECURITY_DIALUP_RID (0x1L) +#define SECURITY_NETWORK_RID (0x2L) +#define SECURITY_BATCH_RID (0x3L) +#define SECURITY_INTERACTIVE_RID (0x4L) +#define SECURITY_LOGON_IDS_RID (0x5L) +#define SECURITY_LOGON_IDS_RID_COUNT (0x3L) +#define SECURITY_SERVICE_RID (0x6L) +#define SECURITY_ANONYMOUS_LOGON_RID (0x7L) +#define SECURITY_PROXY_RID (0x8L) +#define SECURITY_ENTERPRISE_CONTROLLERS_RID (0x9L) +#define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID +#define SECURITY_PRINCIPAL_SELF_RID (0xAL) +#define SECURITY_AUTHENTICATED_USER_RID (0xBL) +#define SECURITY_RESTRICTED_CODE_RID (0xCL) +#define SECURITY_LOCAL_SYSTEM_RID (0x12L) +#define SECURITY_NT_NON_UNIQUE_RID (0x15L) +#define SECURITY_BUILTIN_DOMAIN_RID (0x20L) +#define DOMAIN_USER_RID_ADMIN (0x1F4L) +#define DOMAIN_USER_RID_GUEST (0x1F5L) +#define DOMAIN_GROUP_RID_ADMINS (0x200L) +#define DOMAIN_GROUP_RID_USERS (0x201L) +#define DOMAIN_ALIAS_RID_ADMINS (0x220L) +#define DOMAIN_ALIAS_RID_USERS (0x221L) +#define DOMAIN_ALIAS_RID_GUESTS (0x222L) +#define DOMAIN_ALIAS_RID_POWER_USERS (0x223L) +#define DOMAIN_ALIAS_RID_ACCOUNT_OPS (0x224L) +#define DOMAIN_ALIAS_RID_SYSTEM_OPS (0x225L) +#define DOMAIN_ALIAS_RID_PRINT_OPS (0x226L) +#define DOMAIN_ALIAS_RID_BACKUP_OPS (0x227L) +#define DOMAIN_ALIAS_RID_REPLICATOR (0x228L) + +/* Privileges */ +#define SE_MIN_WELL_KNOWN_PRIVILEGE (2L) +#define SE_CREATE_TOKEN_PRIVILEGE (2L) +#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE (3L) +#define SE_LOCK_MEMORY_PRIVILEGE (4L) +#define SE_INCREASE_QUOTA_PRIVILEGE (5L) +#define SE_UNSOLICITED_INPUT_PRIVILEGE (6L) /* unused */ +#define SE_MACHINE_ACCOUNT_PRIVILEGE (6L) +#define SE_TCB_PRIVILEGE (7L) +#define SE_SECURITY_PRIVILEGE (8L) +#define SE_TAKE_OWNERSHIP_PRIVILEGE (9L) +#define SE_LOAD_DRIVER_PRIVILEGE (10L) +#define SE_SYSTEM_PROFILE_PRIVILEGE (11L) +#define SE_SYSTEMTIME_PRIVILEGE (12L) +#define SE_PROF_SINGLE_PROCESS_PRIVILEGE (13L) +#define SE_INC_BASE_PRIORITY_PRIVILEGE (14L) +#define SE_CREATE_PAGEFILE_PRIVILEGE (15L) +#define SE_CREATE_PERMANENT_PRIVILEGE (16L) +#define SE_BACKUP_PRIVILEGE (17L) +#define SE_RESTORE_PRIVILEGE (18L) +#define SE_SHUTDOWN_PRIVILEGE (19L) +#define SE_DEBUG_PRIVILEGE (20L) +#define SE_AUDIT_PRIVILEGE (21L) +#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE (22L) +#define SE_CHANGE_NOTIFY_PRIVILEGE (23L) +#define SE_REMOTE_SHUTDOWN_PRIVILEGE (24L) +#define SE_MAX_WELL_KNOWN_PRIVILEGE SE_REMOTE_SHUTDOWN_PRIVILEGE + +#if 0 +/* Security descriptor control. */ +#define SECURITY_DESCRIPTOR_REVISION (1) +#define SECURITY_DESCRIPTOR_MIN_LENGTH (20) +#define SE_OWNER_DEFAULTED (1) +#define SE_GROUP_DEFAULTED (2) +#define SE_DACL_PRESENT (4) +#define SE_DACL_DEFAULTED (8) +#define SE_SACL_PRESENT (16) +#define SE_SACL_DEFAULTED (32) +#define SE_SELF_RELATIVE (32768) +#endif + +/* ACCESS_MASK */ +#define MAXIMUM_ALLOWED (0x2000000L) +#define GENERIC_ALL (0x10000000L) +#define GENERIC_EXECUTE (0x20000000L) + +#define SECURITY_STATIC_TRACKING (0) +#define SECURITY_DYNAMIC_TRACKING (1) + +/* Standard rights */ +#define STANDARD_RIGHTS_REQUIRED (0xf0000L) +#define STANDARD_RIGHTS_WRITE (0x20000L) +#define STANDARD_RIGHTS_READ (0x20000L) +#define STANDARD_RIGHTS_EXECUTE (0x20000L) +#define STANDARD_RIGHTS_ALL (0x1f0000L) +#define SPECIFIC_RIGHTS_ALL (0xffffL) + +/* Token rights */ +#define TOKEN_ASSIGN_PRIMARY (0x0001L) +#define TOKEN_DUPLICATE (0x0002L) +#define TOKEN_IMPERSONATE (0x0004L) +#define TOKEN_QUERY (0x0008L) +#define TOKEN_QUERY_SOURCE (0x0010L) +#define TOKEN_ADJUST_PRIVILEGES (0x0020L) +#define TOKEN_ADJUST_GROUPS (0x0040L) +#define TOKEN_ADJUST_DEFAULT (0x0080L) + +#define TOKEN_ALL_ACCESS (0xf00ffL) +#define TOKEN_READ (0x20008L) +#define TOKEN_WRITE (0x200e0L) +#define TOKEN_EXECUTE (0x20000L) + +typedef BOOL SECURITY_CONTEXT_TRACKING_MODE; + +typedef ULONG SECURITY_INFORMATION, *PSECURITY_INFORMATION; + +typedef enum _TOKEN_INFORMATION_CLASS +{ + TokenUser = 1, + TokenGroups, + TokenPrivileges, + TokenOwner, + TokenPrimaryGroup, + TokenDefaultDacl, + TokenSource, + TokenType, + TokenImpersonationLevel, + TokenStatistics +} TOKEN_INFORMATION_CLASS; + +typedef ULONG SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL; + +#define SecurityAnonymous ((SECURITY_IMPERSONATION_LEVEL)1) +#define SecurityIdentification ((SECURITY_IMPERSONATION_LEVEL)2) +#define SecurityImpersonation ((SECURITY_IMPERSONATION_LEVEL)3) +#define SecurityDelegation ((SECURITY_IMPERSONATION_LEVEL)4) + +typedef ULONG TOKEN_TYPE, *PTOKEN_TYPE; + +#define TokenPrimary ((TOKEN_TYPE)1) +#define TokenImpersonation ((TOKEN_TYPE)2) + +//typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, *PSECURITY_CONTEXT_TRACKING_MODE; + +//#define SECURITY_DYNAMIC_TRACKING (TRUE) +//#define SECURITY_STATIC_TRACKING (FALSE) + +typedef ULONG ACCESS_MASK, *PACCESS_MASK; +typedef ULONG ACCESS_MODE, *PACCESS_MODE; + +typedef struct _SECURITY_QUALITY_OF_SERVICE +{ + ULONG Length; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; + BOOLEAN EffectiveOnly; +} SECURITY_QUALITY_OF_SERVICE; + +typedef SECURITY_QUALITY_OF_SERVICE* PSECURITY_QUALITY_OF_SERVICE; + +typedef struct _ACE_HEADER +{ + CHAR AceType; + CHAR AceFlags; USHORT AceSize; ACCESS_MASK AccessMask; -} ROS_ACE_HEADER, *PROS_ACE_HEADER; +} ACE_HEADER, *PACE_HEADER; -typedef struct _ROS_ACE { - ROS_ACE_HEADER Header; -} ROS_ACE, *PROS_ACE; +typedef struct +{ + ACE_HEADER Header; +} ACE, *PACE; -typedef ACL_REVISION_INFORMATION *PACL_REVISION_INFORMATION; -typedef ACL_SIZE_INFORMATION *PACL_SIZE_INFORMATION; +typedef struct _SID_IDENTIFIER_AUTHORITY +{ + BYTE Value[6]; +} SID_IDENTIFIER_AUTHORITY, *PSID_IDENTIFIER_AUTHORITY; + +typedef struct _SID +{ + UCHAR Revision; + UCHAR SubAuthorityCount; + SID_IDENTIFIER_AUTHORITY IdentifierAuthority; + ULONG SubAuthority[1]; +} SID, *PSID; + +typedef struct _ACL +{ + UCHAR AclRevision; + UCHAR Sbz1; + USHORT AclSize; + USHORT AceCount; + USHORT Sbz2; +} ACL, *PACL; + +typedef struct _ACL_REVISION_INFORMATION +{ + ULONG AclRevision; +} ACL_REVISION_INFORMATION, *PACL_REVISION_INFORMATION; + +typedef struct _ACL_SIZE_INFORMATION +{ + ULONG AceCount; + ULONG AclBytesInUse; + ULONG AclBytesFree; +} ACL_SIZE_INFORMATION, *PACL_SIZE_INFORMATION; + +typedef enum _ACL_INFORMATION_CLASS +{ + AclRevisionInformation = 1, + AclSizeInformation +} ACL_INFORMATION_CLASS; + +typedef USHORT SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL; typedef struct _SECURITY_DESCRIPTOR_CONTEXT { } SECURITY_DESCRIPTOR_CONTEXT, *PSECURITY_DESCRIPTOR_CONTEXT; +typedef LARGE_INTEGER LUID, *PLUID; + +typedef struct _SECURITY_DESCRIPTOR +{ + UCHAR Revision; + UCHAR Sbz1; + SECURITY_DESCRIPTOR_CONTROL Control; + PSID Owner; + PSID Group; + PACL Sacl; + PACL Dacl; +} SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR; + +typedef struct _LUID_AND_ATTRIBUTES +{ + LUID Luid; + DWORD Attributes; +} LUID_AND_ATTRIBUTES, *PLUID_AND_ATTRIBUTES; + +typedef struct _TOKEN_SOURCE +{ + CHAR SourceName[8]; + LUID SourceIdentifier; +} TOKEN_SOURCE, *PTOKEN_SOURCE; + +typedef struct _TOKEN_CONTROL +{ + LUID TokenId; + LUID AuthenticationId; + LUID ModifiedId; + TOKEN_SOURCE TokenSource; +} TOKEN_CONTROL, *PTOKEN_CONTROL; + +typedef struct _SID_AND_ATTRIBUTES +{ + PSID Sid; + DWORD Attributes; +} SID_AND_ATTRIBUTES, *PSID_AND_ATTRIBUTES; + +typedef SID_AND_ATTRIBUTES SID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY]; +typedef SID_AND_ATTRIBUTES_ARRAY *PSID_AND_ATTRIBUTES_ARRAY; + +typedef struct _TOKEN_USER +{ + SID_AND_ATTRIBUTES User; +} TOKEN_USER, *PTOKEN_USER; + +typedef struct _TOKEN_PRIMARY_GROUP +{ + PSID PrimaryGroup; +} TOKEN_PRIMARY_GROUP, *PTOKEN_PRIMARY_GROUP; + +typedef struct _TOKEN_GROUPS +{ + DWORD GroupCount; + SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]; +} TOKEN_GROUPS, *PTOKEN_GROUPS, *LPTOKEN_GROUPS; + +typedef struct _TOKEN_PRIVILEGES +{ + DWORD PrivilegeCount; + LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]; +} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES, *LPTOKEN_PRIVILEGES; + +typedef struct _TOKEN_OWNER +{ + PSID Owner; +} TOKEN_OWNER, *PTOKEN_OWNER; + +typedef struct _TOKEN_DEFAULT_DACL +{ + PACL DefaultDacl; +} TOKEN_DEFAULT_DACL, *PTOKEN_DEFAULT_DACL; + +typedef struct _TOKEN_STATISTICS +{ + LUID TokenId; + LUID AuthenticationId; + LARGE_INTEGER ExpirationTime; + TOKEN_TYPE TokenType; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + DWORD DynamicCharged; + DWORD DynamicAvailable; + DWORD GroupCount; + DWORD PrivilegeCount; + LUID ModifiedId; +} TOKEN_STATISTICS, *PTOKEN_STATISTICS; + +typedef struct _GENERIC_MAPPING +{ + ACCESS_MASK GenericRead; + ACCESS_MASK GenericWrite; + ACCESS_MASK GenericExecute; + ACCESS_MASK GenericAll; +} GENERIC_MAPPING, *PGENERIC_MAPPING; + +typedef struct _PRIVILEGE_SET +{ + DWORD PrivilegeCount; + DWORD Control; + LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY]; +} PRIVILEGE_SET, *PPRIVILEGE_SET, *LPPRIVILEGE_SET; + +typedef struct _SECURITY_ATTRIBUTES +{ + DWORD nLength; + LPVOID lpSecurityDescriptor; + BOOL bInheritHandle; +} SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; + + #endif /* __INCLUDE_SECURITY_H */ diff --git a/reactos/include/ntos/shared_data.h b/reactos/include/ntos/shared_data.h deleted file mode 100755 index ea85ef14f2e..00000000000 --- a/reactos/include/ntos/shared_data.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __INCLUDE_NTOS_SHARED_DATA_H -#define __INCLUDE_NTOS_SHARED_DATA_H - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - - -#define PROCESSOR_FEATURES_MAX 64 - -typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE -{ - StandardDesign, - NEC98x86, - EndAlternatives -} ALTERNATIVE_ARCHITECTURE_TYPE; - - -typedef struct _KUSER_SHARED_DATA -{ - volatile ULONG TickCountLow; - ULONG TickCountMultiplier; - volatile LARGE_INTEGER InterruptTime; - volatile LARGE_INTEGER SystemTime; - volatile LARGE_INTEGER TimeZoneBias; - USHORT ImageNumberLow; - USHORT ImageNumberHigh; - WCHAR NtSystemRoot[260]; - ULONG DosDeviceMap; - ULONG CryptoExponent; - ULONG TimeZoneId; - UCHAR DosDeviceDriveType[32]; - NT_PRODUCT_TYPE NtProductType; - BOOLEAN ProductTypeIsValid; - ULONG NtMajorVersion; - ULONG NtMinorVersion; - BOOLEAN ProcessorFeatures[PROCESSOR_FEATURES_MAX]; - - // NT5 / Win2k specific ?? - ULONG Reserved1; - ULONG Reserved3; - volatile ULONG TimeSlip; - ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture; - ULONG SuiteMask; -#ifdef REMOTE_BOOT - ULONG SystemFlags; - UCHAR RemoteBootServerPath[260]; -#endif - BOOLEAN KdDebuggerEnabled; -} KUSER_SHARED_DATA, *PKUSER_SHARED_DATA; - -/* Values for DosDeviceDriveType */ -#define DOSDEVICE_DRIVE_UNKNOWN 0 -#define DOSDEVICE_DRIVE_CALCULATE 1 -#define DOSDEVICE_DRIVE_REMOVABLE 2 -#define DOSDEVICE_DRIVE_FIXED 3 -#define DOSDEVICE_DRIVE_REMOTE 4 -#define DOSDEVICE_DRIVE_CDROM 5 -#define DOSDEVICE_DRIVE_RAMDISK 6 - - -#define KERNEL_SHARED_DATA (0xFFDF0000) -#define USER_SHARED_DATA (0x7FFE0000) - -#if defined(_NTOSKRNL_) || defined(__NTDRIVER__) || defined(__NTHAL__) -#else -#define SharedUserData ((KUSER_SHARED_DATA * const)USER_SHARED_DATA) -#endif - - -#endif /* __INCLUDE_NTOS_SHARED_DATA_H */ diff --git a/reactos/include/ntos/teb.h b/reactos/include/ntos/teb.h deleted file mode 100755 index 2d6d4ec8345..00000000000 --- a/reactos/include/ntos/teb.h +++ /dev/null @@ -1,236 +0,0 @@ -/* TEB/PEB parameters */ -#ifndef __INCLUDE_INTERNAL_TEB -#define __INCLUDE_INTERNAL_TEB - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - -#include -#include -#include "types.h" - -typedef struct _CURDIR -{ - UNICODE_STRING DosPath; - PVOID Handle; -} CURDIR, *PCURDIR; - -typedef struct RTL_DRIVE_LETTER_CURDIR -{ - USHORT Flags; - USHORT Length; - ULONG TimeStamp; - UNICODE_STRING DosPath; -} RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR; - -typedef struct _PEB_FREE_BLOCK -{ - struct _PEB_FREE_BLOCK* Next; - ULONG Size; -} PEB_FREE_BLOCK, *PPEB_FREE_BLOCK; - -/* RTL_USER_PROCESS_PARAMETERS.Flags */ -#define PPF_NORMALIZED (1) - -typedef struct _RTL_ROS_USER_PROCESS_PARAMETERS -{ - ULONG AllocationSize; // 00h - ULONG Length; // 04h - ULONG Flags; // 08h - ULONG DebugFlags; // 0Ch - PVOID ConsoleHandle; // 10h - ULONG ConsoleFlags; // 14h - HANDLE InputHandle; // 18h - HANDLE OutputHandle; // 1Ch - HANDLE ErrorHandle; // 20h - CURDIR CurrentDirectory; // 24h - UNICODE_STRING DllPath; // 30h - UNICODE_STRING ImagePathName; // 38h - UNICODE_STRING CommandLine; // 40h - PWSTR Environment; // 48h - ULONG StartingX; // 4Ch - ULONG StartingY; // 50h - ULONG CountX; // 54h - ULONG CountY; // 58h - ULONG CountCharsX; // 5Ch - ULONG CountCharsY; // 60h - ULONG FillAttribute; // 64h - ULONG WindowFlags; // 68h - ULONG ShowWindowFlags; // 6Ch - UNICODE_STRING WindowTitle; // 70h - UNICODE_STRING DesktopInfo; // 78h - UNICODE_STRING ShellInfo; // 80h - UNICODE_STRING RuntimeInfo; // 88h - RTL_DRIVE_LETTER_CURDIR DLCurrentDirectory[0x20]; // 90h -} RTL_ROS_USER_PROCESS_PARAMETERS, *PRTL_ROS_USER_PROCESS_PARAMETERS; - - -#define PEB_BASE (0x7FFDF000) - -typedef struct _PEB_LDR_DATA -{ - ULONG Length; - BOOLEAN Initialized; - PVOID SsHandle; - LIST_ENTRY InLoadOrderModuleList; - LIST_ENTRY InMemoryOrderModuleList; - LIST_ENTRY InInitializationOrderModuleList; -} PEB_LDR_DATA, *PPEB_LDR_DATA; - -typedef VOID STDCALL (*PPEBLOCKROUTINE)(PVOID); - -typedef struct _PEB -{ - UCHAR InheritedAddressSpace; // 00h - UCHAR ReadImageFileExecOptions; // 01h - UCHAR BeingDebugged; // 02h - UCHAR Spare; // 03h - PVOID Mutant; // 04h - PVOID ImageBaseAddress; // 08h - PPEB_LDR_DATA Ldr; // 0Ch - PRTL_ROS_USER_PROCESS_PARAMETERS ProcessParameters; // 10h - PVOID SubSystemData; // 14h - PVOID ProcessHeap; // 18h - PVOID FastPebLock; // 1Ch - PPEBLOCKROUTINE FastPebLockRoutine; // 20h - PPEBLOCKROUTINE FastPebUnlockRoutine; // 24h - ULONG EnvironmentUpdateCount; // 28h - PVOID* KernelCallbackTable; // 2Ch - PVOID EventLogSection; // 30h - PVOID EventLog; // 34h - PPEB_FREE_BLOCK FreeList; // 38h - ULONG TlsExpansionCounter; // 3Ch - PVOID TlsBitmap; // 40h - ULONG TlsBitmapBits[0x2]; // 44h - PVOID ReadOnlySharedMemoryBase; // 4Ch - PVOID ReadOnlySharedMemoryHeap; // 50h - PVOID* ReadOnlyStaticServerData; // 54h - PVOID AnsiCodePageData; // 58h - PVOID OemCodePageData; // 5Ch - PVOID UnicodeCaseTableData; // 60h - ULONG NumberOfProcessors; // 64h - ULONG NtGlobalFlag; // 68h - UCHAR Spare2[0x4]; // 6Ch - LARGE_INTEGER CriticalSectionTimeout; // 70h - ULONG HeapSegmentReserve; // 78h - ULONG HeapSegmentCommit; // 7Ch - ULONG HeapDeCommitTotalFreeThreshold; // 80h - ULONG HeapDeCommitFreeBlockThreshold; // 84h - ULONG NumberOfHeaps; // 88h - ULONG MaximumNumberOfHeaps; // 8Ch - PVOID** ProcessHeaps; // 90h - PVOID GdiSharedHandleTable; // 94h - PVOID ProcessStarterHelper; // 98h - PVOID GdiDCAttributeList; // 9Ch - PVOID LoaderLock; // A0h - ULONG OSMajorVersion; // A4h - ULONG OSMinorVersion; // A8h - ULONG OSBuildNumber; // ACh - ULONG OSPlatformId; // B0h - ULONG ImageSubSystem; // B4h - ULONG ImageSubSystemMajorVersion; // B8h - ULONG ImageSubSystemMinorVersion; // C0h - ULONG GdiHandleBuffer[0x22]; // C4h -} PEB, *PPEB; - -#if 0 -typedef struct _NT_TIB { - struct _EXCEPTION_REGISTRATION_RECORD* ExceptionList; // 00h - PVOID StackBase; // 04h - PVOID StackLimit; // 08h - PVOID SubSystemTib; // 0Ch - union { - PVOID FiberData; // 10h - ULONG Version; // 10h - } Fib; - PVOID ArbitraryUserPointer; // 14h - struct _NT_TIB *Self; // 18h -} NT_TIB, *PNT_TIB; -#endif - -typedef struct _GDI_TEB_BATCH -{ - ULONG Offset; - ULONG HDC; - ULONG Buffer[0x136]; -} GDI_TEB_BATCH, *PGDI_TEB_BATCH; - -typedef struct _TEB -{ - NT_TIB Tib; // 00h - PVOID EnvironmentPointer; // 1Ch - CLIENT_ID Cid; // 20h - PVOID ActiveRpcInfo; // 28h - PVOID ThreadLocalStoragePointer; // 2Ch - PPEB Peb; // 30h - ULONG LastErrorValue; // 34h - ULONG CountOfOwnedCriticalSections; // 38h - PVOID CsrClientThread; // 3Ch - struct _W32THREAD* Win32ThreadInfo; // 40h - ULONG Win32ClientInfo[0x1F]; // 44h - PVOID WOW32Reserved; // C0h - ULONG CurrentLocale; // C4h - ULONG FpSoftwareStatusRegister; // C8h - PVOID SystemReserved1[0x36]; // CCh - PVOID Spare1; // 1A4h - LONG ExceptionCode; // 1A8h - ULONG SpareBytes1[0x28]; // 1ACh - PVOID SystemReserved2[0xA]; // 1D4h -// GDI_TEB_BATCH GdiTebBatch; // 1FCh - ULONG gdiRgn; // 6DCh - ULONG gdiPen; // 6E0h - ULONG gdiBrush; // 6E4h - CLIENT_ID RealClientId; // 6E8h - PVOID GdiCachedProcessHandle; // 6F0h - ULONG GdiClientPID; // 6F4h - ULONG GdiClientTID; // 6F8h - PVOID GdiThreadLocaleInfo; // 6FCh - PVOID UserReserved[5]; // 700h - PVOID glDispatchTable[0x118]; // 714h - ULONG glReserved1[0x1A]; // B74h - PVOID glReserved2; // BDCh - PVOID glSectionInfo; // BE0h - PVOID glSection; // BE4h - PVOID glTable; // BE8h - PVOID glCurrentRC; // BECh - PVOID glContext; // BF0h - NTSTATUS LastStatusValue; // BF4h - UNICODE_STRING StaticUnicodeString; // BF8h - WCHAR StaticUnicodeBuffer[0x105]; // C00h - PVOID DeallocationStack; // E0Ch - PVOID TlsSlots[0x40]; // E10h - LIST_ENTRY TlsLinks; // F10h - PVOID Vdm; // F18h - PVOID ReservedForNtRpc; // F1Ch - PVOID DbgSsReserved[0x2]; // F20h - ULONG HardErrorDisabled; // F28h - PVOID Instrumentation[0x10]; // F2Ch - PVOID WinSockData; // F6Ch - ULONG GdiBatchCount; // F70h - ULONG Spare2; // F74h - ULONG Spare3; // F78h - ULONG Spare4; // F7Ch - PVOID ReservedForOle; // F80h - ULONG WaitingOnLoaderLock; // F84h - PVOID WineDebugInfo; // Needed for WINE DLL's -} TEB, *PTEB; - - -#define NtCurrentPeb() (NtCurrentTeb()->Peb) - -static inline PTEB NtCurrentTeb(VOID) -{ - int x; - - __asm__ __volatile__("movl %%fs:0x18, %0\n\t" - : "=r" (x) /* can't have two memory operands */ - : /* no inputs */ - ); - - return((PTEB)x); -} - - - -#endif /* __INCLUDE_INTERNAL_TEB */ diff --git a/reactos/include/ntos/types.h b/reactos/include/ntos/types.h index 7299cc657db..ebdf60f97ba 100644 --- a/reactos/include/ntos/types.h +++ b/reactos/include/ntos/types.h @@ -14,1008 +14,419 @@ #ifndef __INCLUDE_TYPES_H #define __INCLUDE_TYPES_H -#if __GNUC__ >=3 -#pragma GCC system_header +/* Fixed precision types */ +typedef signed char INT8, *PINT8; +typedef signed short INT16, *PINT16; +typedef signed int INT32, *PINT32; +typedef signed long long INT64, *PINT64; +typedef unsigned char UINT8, *PUINT8; +typedef unsigned short UINT16, *PUINT16; +typedef unsigned int UINT32, *PUINT32; +typedef unsigned long long UINT64, *PUINT64; + +typedef signed long int LONG32, *PLONG32; +typedef unsigned long int ULONG32, *PULONG32; +typedef unsigned long int DWORD32, *PDWORD32; + + +#ifdef _WIN64 + +/* 64-bit architecture */ + +typedef INT64 INT, *PINT; +typedef LONG64 LONG, *PLONG; +typedef DWORD64 DWORD, *PDWORD; +typedef UINT64 UINT, *PUINT; +typedef ULONG64 ULONG, *PULONG; + +/* Pointer precision types */ +typedef long long INT_PTR, *PINT_PTR; +typedef unsigned long long UINT_PTR, *PUINT_PTR; +typedef long long LONG_PTR, *PLONG_PTR; +typedef unsigned long long ULONG_PTR, *PULONG_PTR; +typedef unsigned long long HANDLE_PTR; +typedef unsigned int UHALF_PTR, *PUHALF_PTR; +typedef int HALF_PTR, *PHALF_PTR; + +#else /* _WIN64 */ + +/* 32-bit architecture */ + +typedef INT32 INT, *PINT; +typedef LONG32 LONG, *PLONG; +typedef DWORD32 DWORD, *PDWORD; +typedef UINT32 UINT, *PUINT; +typedef ULONG32 ULONG, *PULONG; + + +/* Pointer precision types */ +typedef int INT_PTR, *PINT_PTR; +typedef unsigned int UINT_PTR, *PUINT_PTR; +typedef long LONG_PTR, *PLONG_PTR; +typedef unsigned long ULONG_PTR, *PULONG_PTR; +typedef unsigned short UHALF_PTR, *PUHALF_PTR; +typedef short HALF_PTR, *PHALF_PTR; +typedef unsigned long HANDLE_PTR; + +#endif /* _WIN64 */ + +typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR; + +typedef long long LONG64, *PLONG64; + +typedef unsigned long long ULONG64, *PULONG64; +typedef unsigned long long DWORD64, *PDWORD64; + + +typedef unsigned char UCHAR; +typedef unsigned short USHORT; +typedef unsigned short WCHAR; +typedef unsigned short WORD; +typedef int BOOL; +typedef unsigned char BOOLEAN; +typedef BOOLEAN* PBOOLEAN; +typedef unsigned short *LPWSTR; +typedef unsigned short *PWSTR; +typedef unsigned char *PUCHAR; +typedef unsigned short *PUSHORT; +typedef void *PVOID; +typedef unsigned char BYTE; +typedef void *LPVOID; +typedef float *PFLOAT; +typedef unsigned short *PWCH; +typedef unsigned short *PWORD; + +typedef long long LONGLONG; +typedef unsigned long long ULONGLONG; +typedef long long *PLONGLONG; +typedef unsigned long long *PULONGLONG; + +/* Check VOID before defining CHAR, SHORT */ +#ifndef VOID +#define VOID void +typedef char CHAR; +typedef short SHORT; #endif -#ifndef AS_INVOKED +typedef CHAR *PCHAR; +typedef CHAR *PCH; +typedef void *HANDLE; +typedef char CCHAR; +typedef CCHAR *PCCHAR; -#include -#include -#include -#include -#define PAGE_ROUND_UP(x) ( (((ULONG_PTR)x)%PAGE_SIZE) ? ((((ULONG_PTR)x)&(~(PAGE_SIZE-1)))+PAGE_SIZE) : ((ULONG_PTR)x) ) -#define PAGE_ROUND_DOWN(x) (((ULONG_PTR)x)&(~(PAGE_SIZE-1))) +#define FALSE 0 +#define TRUE 1 -typedef DWORD (STDCALL *PTHREAD_START_ROUTINE)(PVOID); +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void*)0) +#endif /* __cplusplus */ +#endif /* NULL */ -#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7 -#define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7 +typedef const unsigned short *PCWSTR; -#define IOCTL_CDROM_GET_DRIVE_GEOMETRY CTL_CODE(FILE_DEVICE_CD_ROM, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS) +typedef char* PCSZ; -#define THREAD_READ (0x020048L) -#define THREAD_WRITE (0x020037L) -#define THREAD_EXECUTE (0x120000L) - -enum +typedef union _LARGE_INTEGER { - DIRECTORY_QUERY, - DIRECTORY_TRAVERSE, - DIRECTORY_CREATE_OBJECT, - DIRECTORY_CREATE_SUBDIRECTORY, - DIRECTORY_ALL_ACCESS, -}; + struct + { + DWORD LowPart; + LONG HighPart; + } u; +#ifdef ANONYMOUSUNIONS + struct + { + DWORD LowPart; + LONG HighPart; + }; +#endif /* ANONYMOUSUNIONS */ + LONGLONG QuadPart; +} LARGE_INTEGER, *PLARGE_INTEGER; -typedef enum _NT_PRODUCT_TYPE +typedef union _ULARGE_INTEGER { - NtProductWinNt = 1, - NtProductLanManNt, - NtProductServer -} NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE; + struct + { + DWORD LowPart; + DWORD HighPart; + } u; +#ifdef ANONYMOUSUNIONS + struct + { + DWORD LowPart; + DWORD HighPart; + }; +#endif /* ANONYMOUSUNIONS */ + ULONGLONG QuadPart; +} ULARGE_INTEGER, *PULARGE_INTEGER; -// ReactOS specific -#define HEAP_NO_VALLOC (0x800) - -#define EVENT_QUERY_STATE (1) -#define EVENT_PAIR_ALL_ACCESS (0x1f0000L) -#define SEMAPHORE_QUERY_STATE (1) - -typedef ULARGE_INTEGER TIME, *PTIME; - -typedef struct +typedef struct _FILETIME { - ACE_HEADER Header; -} ACE, *PACE; + DWORD dwLowDateTime; + DWORD dwHighDateTime; +} FILETIME, *LPFILETIME, *PFILETIME; + +#define CONST const + +#ifdef i386 +#define STDCALL __attribute__ ((stdcall)) +#define CDECL __attribute((cdecl)) +#define CALLBACK WINAPI +#define PASCAL WINAPI +#else +#define STDCALL +#define CDECL +#define CALLBACK +#define PASCAL +#endif + +typedef struct _LIST_ENTRY { + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; +} LIST_ENTRY, *PLIST_ENTRY; + +typedef struct _SINGLE_LIST_ENTRY { + struct _SINGLE_LIST_ENTRY *Next; +} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY; + +typedef DWORD STDCALL (*PTHREAD_START_ROUTINE) (LPVOID); +typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; + +typedef unsigned short *PWCHAR; + +#ifdef __PPC__ +#define CONTEXT_CONTROL 1L +#define CONTEXT_FLOATING_POINT 2L +#define CONTEXT_INTEGER 4L +#define CONTEXT_DEBUG_REGISTERS 8L + +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) +#define CONTEXT_DEBUGGER (CONTEXT_FULL) + +#else /* x86 */ +/* The doc refered me to winnt.h, so I had to look... */ +#define SIZE_OF_80387_REGISTERS 80 + +/* Values for contextflags */ +#define CONTEXT_i386 0x10000 +#define CONTEXT_CONTROL (CONTEXT_i386 | 1) +#define CONTEXT_INTEGER (CONTEXT_i386 | 2) +#define CONTEXT_SEGMENTS (CONTEXT_i386 | 4) +#define CONTEXT_FLOATING_POINT (CONTEXT_i386 | 8) +#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386 | 0x10) +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS) /* our own invention */ #define FLAG_TRACE_BIT 0x100 #define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT) -// ReactOS specific -#define EX_MAXIMUM_WAIT_OBJECTS (64) +#endif -#define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b)) -#define ROUNDDOWN(a,b) (((a)/(b))*(b)) +typedef struct _FLOATING_SAVE_AREA { + DWORD ControlWord; + DWORD StatusWord; + DWORD TagWord; + DWORD ErrorOffset; + DWORD ErrorSelector; + DWORD DataOffset; + DWORD DataSelector; + BYTE RegisterArea[80]; + DWORD Cr0NpxState; +} FLOATING_SAVE_AREA; -#define MAGIC(c1,c2,c3,c4) ((c1) + ((c2)<<8) + ((c3)<<16) + ((c4)<<24)) +typedef struct _CONTEXT_X86 { + DWORD ContextFlags; -#define CONSOLE_OUTPUT_MODE_VALID 0x03 -#define CONSOLE_INPUT_MODE_VALID 0x0f + DWORD Dr0; + DWORD Dr1; + DWORD Dr2; + DWORD Dr3; + DWORD Dr6; + DWORD Dr7; -typedef ULONG ACCESS_MODE, *PACCESS_MODE; + FLOATING_SAVE_AREA FloatSave; + + DWORD SegGs; + DWORD SegFs; + DWORD SegEs; + DWORD SegDs; + + DWORD Edi; + DWORD Esi; + DWORD Ebx; + DWORD Edx; + DWORD Ecx; + DWORD Eax; + + DWORD Ebp; + DWORD Eip; + DWORD SegCs; + DWORD EFlags; + DWORD Esp; + DWORD SegSs; +} CONTEXT_X86, *PCONTEXT_X86, *LPCONTEXT_X86; + +typedef struct _CONTEXT_PPC + { + /* Floating point registers returned when CONTEXT_FLOATING_POINT is set */ + double Fpr0; + double Fpr1; + double Fpr2; + double Fpr3; + double Fpr4; + double Fpr5; + double Fpr6; + double Fpr7; + double Fpr8; + double Fpr9; + double Fpr10; + double Fpr11; + double Fpr12; + double Fpr13; + double Fpr14; + double Fpr15; + double Fpr16; + double Fpr17; + double Fpr18; + double Fpr19; + double Fpr20; + double Fpr21; + double Fpr22; + double Fpr23; + double Fpr24; + double Fpr25; + double Fpr26; + double Fpr27; + double Fpr28; + double Fpr29; + double Fpr30; + double Fpr31; + double Fpscr; + + /* Integer registers returned when CONTEXT_INTEGER is set. */ + DWORD Gpr0; + DWORD Gpr1; + DWORD Gpr2; + DWORD Gpr3; + DWORD Gpr4; + DWORD Gpr5; + DWORD Gpr6; + DWORD Gpr7; + DWORD Gpr8; + DWORD Gpr9; + DWORD Gpr10; + DWORD Gpr11; + DWORD Gpr12; + DWORD Gpr13; + DWORD Gpr14; + DWORD Gpr15; + DWORD Gpr16; + DWORD Gpr17; + DWORD Gpr18; + DWORD Gpr19; + DWORD Gpr20; + DWORD Gpr21; + DWORD Gpr22; + DWORD Gpr23; + DWORD Gpr24; + DWORD Gpr25; + DWORD Gpr26; + DWORD Gpr27; + DWORD Gpr28; + DWORD Gpr29; + DWORD Gpr30; + DWORD Gpr31; + + DWORD Cr; /* Condition register */ + DWORD Xer; /* Fixed point exception register */ + + /* The following are set when CONTEXT_CONTROL is set. */ + DWORD Msr; /* Machine status register */ + DWORD Iar; /* Instruction address register */ + DWORD Lr; /* Link register */ + DWORD Ctr; /* Control register */ + + /* Control which context values are returned */ + DWORD ContextFlags; + DWORD Fill[3]; + + /* Registers returned if CONTEXT_DEBUG_REGISTERS is set. */ + DWORD Dr0; /* Breakpoint Register 1 */ + DWORD Dr1; /* Breakpoint Register 2 */ + DWORD Dr2; /* Breakpoint Register 3 */ + DWORD Dr3; /* Breakpoint Register 4 */ + DWORD Dr4; /* Breakpoint Register 5 */ + DWORD Dr5; /* Breakpoint Register 6 */ + DWORD Dr6; /* Debug Status Register */ + DWORD Dr7; /* Debug Control Register */ +} CONTEXT_PPC, *PCONTEXT_PPC, *LPCONTEXT_PPC; + +#ifdef __i386__ + +typedef CONTEXT_X86 CONTEXT; +typedef PCONTEXT_X86 PCONTEXT; +typedef LPCONTEXT_X86 LPCONTEXT; + +#else /* __ppc__ */ + +typedef CONTEXT_PPC CONTEXT; +typedef PCONTEXT_PPC PCONTEXT; +typedef LPCONTEXT_PPC LPCONTEXT; + +#endif + +typedef HANDLE *PHANDLE; + +typedef struct value_ent { + LPWSTR ve_valuename; + DWORD ve_valuelen; + DWORD ve_valueptr; + DWORD ve_type; +} WVALENT, *PWVALENT; + + +typedef const void *LPCVOID; +typedef BYTE *LPBYTE, *PBYTE; + +typedef BOOL *PBOOL; + +typedef DWORD LCID; +typedef DWORD *PLCID; + +typedef const char *LPCSTR; + +typedef char *LPSTR; + +typedef const unsigned short *LPCWSTR; + +typedef unsigned short RTL_ATOM; +typedef unsigned short *PRTL_ATOM; +typedef WORD ATOM; + +typedef struct _COORD { + SHORT X; + SHORT Y; +} COORD; + +typedef struct _SMALL_RECT { + SHORT Left; + SHORT Top; + SHORT Right; + SHORT Bottom; +} SMALL_RECT, *PSMALL_RECT; + + +typedef VOID STDCALL +(*PTIMERAPCROUTINE)( + LPVOID lpArgToCompletionRoutine, + DWORD dwTimerLowValue, + DWORD dwTimerHighValue + ); #include "except.h" - - -/* ReactOS specific */ - -#define MB_FLAGS_MEM_INFO (0x1) -#define MB_FLAGS_BOOT_DEVICE (0x2) -#define MB_FLAGS_COMMAND_LINE (0x4) -#define MB_FLAGS_MODULE_INFO (0x8) -#define MB_FLAGS_AOUT_SYMS (0x10) -#define MB_FLAGS_ELF_SYMS (0x20) -#define MB_FLAGS_MMAP_INFO (0x40) -#define MB_FLAGS_DRIVES_INFO (0x80) -#define MB_FLAGS_CONFIG_TABLE (0x100) -#define MB_FLAGS_BOOT_LOADER_NAME (0x200) -#define MB_FLAGS_APM_TABLE (0x400) -#define MB_FLAGS_GRAPHICS_TABLE (0x800) - -typedef struct _LOADER_MODULE -{ - ULONG ModStart; - ULONG ModEnd; - ULONG String; - ULONG Reserved; -} LOADER_MODULE, *PLOADER_MODULE; - -typedef struct _ADDRESS_RANGE -{ - ULONG BaseAddrLow; - ULONG BaseAddrHigh; - ULONG LengthLow; - ULONG LengthHigh; - ULONG Type; -} ADDRESS_RANGE, *PADDRESS_RANGE; - -typedef struct _LOADER_PARAMETER_BLOCK { - ULONG Flags; - ULONG MemLower; - ULONG MemHigher; - ULONG BootDevice; - ULONG CommandLine; - ULONG ModsCount; - ULONG ModsAddr; - UCHAR Syms[12]; - ULONG MmapLength; - ULONG MmapAddr; - ULONG DrivesCount; - ULONG DrivesAddr; - ULONG ConfigTable; - ULONG BootLoaderName; -} LOADER_PARAMETER_BLOCK, *PLOADER_PARAMETER_BLOCK; - - -typedef struct _KTSS -{ - USHORT PreviousTask; - USHORT Reserved1; - ULONG Esp0; - USHORT Ss0; - USHORT Reserved2; - ULONG Esp1; - USHORT Ss1; - USHORT Reserved3; - ULONG Esp2; - USHORT Ss2; - USHORT Reserved4; - ULONG Cr3; - ULONG Eip; - ULONG Eflags; - ULONG Eax; - ULONG Ecx; - ULONG Edx; - ULONG Ebx; - ULONG Esp; - ULONG Ebp; - ULONG Esi; - ULONG Edi; - USHORT Es; - USHORT Reserved5; - USHORT Cs; - USHORT Reserved6; - USHORT Ss; - USHORT Reserved7; - USHORT Ds; - USHORT Reserved8; - USHORT Fs; - USHORT Reserved9; - USHORT Gs; - USHORT Reserved10; - USHORT Ldt; - USHORT Reserved11; - USHORT Trap; - USHORT IoMapBase; - UCHAR IoBitmap[1]; -} KTSS __attribute__((packed)); - -typedef struct _IACCESS_TOKEN -{ - TOKEN_SOURCE TokenSource; // 0x00 - LUID TokenId; // 0x10 - LUID AuthenticationId; // 0x18 - LARGE_INTEGER ExpirationTime; // 0x20 - LUID ModifiedId; // 0x28 - ULONG UserAndGroupCount; // 0x30 - ULONG PrivilegeCount; // 0x34 - ULONG VariableLength; // 0x38 - ULONG DynamicCharged; // 0x3C - ULONG DynamicAvailable; // 0x40 - ULONG DefaultOwnerIndex; // 0x44 - PSID_AND_ATTRIBUTES_ARRAY UserAndGroups; // 0x48 - PSID PrimaryGroup; // 0x4C - PLUID_AND_ATTRIBUTES_ARRAY Privileges; // 0x50 - ULONG Unknown1; // 0x54 - PACL DefaultDacl; // 0x58 - TOKEN_TYPE TokenType; // 0x5C - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; // 0x60 - UCHAR TokenFlags; // 0x64 - UCHAR TokenInUse; // 0x65 - UCHAR Unused[2]; // 0x66 - PVOID ProxyData; // 0x68 - PVOID AuditData; // 0x6c - UCHAR VariablePart[0]; // 0x70 -} IACCESS_TOKEN, *PIACCESS_TOKEN; - -struct _DIRECTORY_OBJECT; -struct _OBJECT_ATTRIBUTES; - -typedef struct _OBJECT_TYPE -{ - /* - * PURPOSE: Tag to be used when allocating objects of this type - */ - ULONG Tag; - - /* - * PURPOSE: Name of the type - */ - UNICODE_STRING TypeName; - - /* - * PURPOSE: Total number of objects of this type - */ - ULONG TotalObjects; - - /* - * PURPOSE: Total number of handles of this type - */ - ULONG TotalHandles; - - /* - * PURPOSE: Maximum objects of this type - */ - ULONG MaxObjects; - - /* - * PURPOSE: Maximum handles of this type - */ - ULONG MaxHandles; - - /* - * PURPOSE: Paged pool charge - */ - ULONG PagedPoolCharge; - - /* - * PURPOSE: Nonpaged pool charge - */ - ULONG NonpagedPoolCharge; - - /* - * PURPOSE: Mapping of generic access rights - */ - PGENERIC_MAPPING Mapping; - - /* - * PURPOSE: Dumps the object - * NOTE: To be defined - */ - VOID STDCALL (*Dump)(VOID); - - /* - * PURPOSE: Opens the object - * NOTE: To be defined - */ - VOID STDCALL (*Open)(VOID); - - /* - * PURPOSE: Called to close an object if OkayToClose returns true - */ - VOID STDCALL (*Close)(PVOID ObjectBody, - ULONG HandleCount); - - /* - * PURPOSE: Called to delete an object when the last reference is removed - */ - VOID STDCALL (*Delete)(PVOID ObjectBody); - - /* - * PURPOSE: Called when an open attempts to open a file apparently - * residing within the object - * RETURNS - * STATUS_SUCCESS NextObject was found - * STATUS_UNSUCCESSFUL NextObject not found - * STATUS_REPARSE Path changed, restart parsing the path - */ - NTSTATUS STDCALL (*Parse)(PVOID ParsedObject, - PVOID *NextObject, - PUNICODE_STRING FullPath, - PWSTR *Path, - ULONG Attributes); - - /* - */ - NTSTATUS STDCALL (*Security)(PVOID Object, - ULONG InfoClass, - PVOID Info, - PULONG InfoLength); - - /* - */ - VOID STDCALL (*QueryName)(VOID); - - /* - * PURPOSE: Called when a process asks to close the object - */ - VOID STDCALL (*OkayToClose)(VOID); - - NTSTATUS STDCALL (*Create)(PVOID ObjectBody, - PVOID Parent, - PWSTR RemainingPath, - struct _OBJECT_ATTRIBUTES* ObjectAttributes); - - VOID STDCALL (*DuplicationNotify)(PEPROCESS DuplicateTo, - PEPROCESS DuplicateFrom, - PVOID Object); -} OBJECT_TYPE, *POBJECT_TYPE; - - -typedef struct _OBJECT_HEADER -/* - * PURPOSE: Header for every object managed by the object manager - */ -{ - UNICODE_STRING Name; - LIST_ENTRY Entry; - LONG RefCount; - LONG HandleCount; - BOOLEAN CloseInProcess; - BOOLEAN Permanent; - struct _DIRECTORY_OBJECT* Parent; - POBJECT_TYPE ObjectType; - - /* - * PURPOSE: Object type - * NOTE: This overlaps the first member of the object body - */ - CSHORT Type; - - /* - * PURPOSE: Object size - * NOTE: This overlaps the second member of the object body - */ - CSHORT Size; - - -} OBJECT_HEADER, *POBJECT_HEADER; - -typedef struct _ROS_HANDLE_TABLE -{ - LIST_ENTRY ListHead; - KSPIN_LOCK ListLock; -} ROS_HANDLE_TABLE, *PROS_HANDLE_TABLE; - -extern POBJECT_TYPE ObDirectoryType; - -typedef struct _KINTERRUPT -{ - ULONG Vector; - KAFFINITY ProcessorEnableMask; - PKSPIN_LOCK IrqLock; - BOOLEAN Shareable; - BOOLEAN FloatingSave; - PKSERVICE_ROUTINE ServiceRoutine; - PVOID ServiceContext; - LIST_ENTRY Entry; - KIRQL SynchLevel; -} KINTERRUPT, *PKINTERRUPT; - -/* number of entries in the service descriptor tables */ -#define SSDT_MAX_ENTRIES 4 - - -#pragma pack(1) - -typedef struct t_KeServiceDescriptorTableEntry { - PSSDT SSDT; - PULONG ServiceCounterTable; - unsigned int NumberOfServices; - PSSPT SSPT; - -} KE_SERVICE_DESCRIPTOR_TABLE_ENTRY, *PKE_SERVICE_DESCRIPTOR_TABLE_ENTRY; - -#pragma pack() - - -NTOSAPI KE_SERVICE_DESCRIPTOR_TABLE_ENTRY -KeServiceDescriptorTable[SSDT_MAX_ENTRIES]; - -extern -KE_SERVICE_DESCRIPTOR_TABLE_ENTRY -KeServiceDescriptorTableShadow[SSDT_MAX_ENTRIES]; - - -BOOLEAN -STDCALL -KeAddSystemServiceTable ( - PSSDT SSDT, - PULONG ServiceCounterTable, - ULONG NumberOfServices, - PSSPT SSPT, - ULONG TableIndex - ); - -extern struct _EPROCESS* PsInitialSystemProcess; -extern POBJECT_TYPE PsProcessType; -extern POBJECT_TYPE PsThreadType; - -BOOLEAN STDCALL -KdPollBreakIn(VOID); - - -typedef struct _REACTOS_COMMON_FCB_HEADER -{ - CSHORT NodeTypeCode; - CSHORT NodeByteSize; - struct _ROS_BCB* Bcb; - LARGE_INTEGER AllocationSize; - LARGE_INTEGER FileSize; - LARGE_INTEGER ValidDataLength; -} REACTOS_COMMON_FCB_HEADER, *PREACTOS_COMMON_FCB_HEADER; - -NTSTATUS STDCALL -NtCreateKey(OUT PHANDLE KeyHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN ULONG TitleIndex, - IN PUNICODE_STRING Class OPTIONAL, - IN ULONG CreateOptions, - IN PULONG Disposition OPTIONAL); - -#define FILE_NON_DIRECTORY_FILE 0x40 -#define FILE_CREATED 0x2 - - -typedef enum _TRAVERSE_METHOD { - TraverseMethodPreorder, - TraverseMethodInorder, - TraverseMethodPostorder -} TRAVERSE_METHOD; - -typedef LONG STDCALL -(*PKEY_COMPARATOR)(IN PVOID Key1, - IN PVOID Key2); - -typedef BOOLEAN STDCALL -(*PTRAVERSE_ROUTINE)(IN PVOID Context, - IN PVOID Key, - IN PVOID Value); - -struct _BINARY_TREE_NODE; - -typedef struct _BINARY_TREE -{ - struct _BINARY_TREE_NODE * RootNode; - PKEY_COMPARATOR Compare; - BOOLEAN UseNonPagedPool; - union { - NPAGED_LOOKASIDE_LIST NonPaged; - PAGED_LOOKASIDE_LIST Paged; - } List; - union { - KSPIN_LOCK NonPaged; - FAST_MUTEX Paged; - } Lock; -} BINARY_TREE, *PBINARY_TREE; - - -struct _SPLAY_TREE_NODE; - -typedef struct _SPLAY_TREE -{ - struct _SPLAY_TREE_NODE * RootNode; - PKEY_COMPARATOR Compare; - BOOLEAN Weighted; - BOOLEAN UseNonPagedPool; - union { - NPAGED_LOOKASIDE_LIST NonPaged; - PAGED_LOOKASIDE_LIST Paged; - } List; - union { - KSPIN_LOCK NonPaged; - FAST_MUTEX Paged; - } Lock; - PVOID Reserved[4]; -} SPLAY_TREE, *PSPLAY_TREE; - - -typedef struct _HASH_TABLE -{ - // Size of hash table in number of bits - ULONG HashTableSize; - - // Use non-paged pool memory? - BOOLEAN UseNonPagedPool; - - // Lock for this structure - union { - KSPIN_LOCK NonPaged; - FAST_MUTEX Paged; - } Lock; - - // Pointer to array of hash buckets with splay trees - PSPLAY_TREE HashTrees; -} HASH_TABLE, *PHASH_TABLE; - - -BOOLEAN STDCALL -ExInitializeBinaryTree(IN PBINARY_TREE Tree, - IN PKEY_COMPARATOR Compare, - IN BOOLEAN UseNonPagedPool); - -VOID STDCALL -ExDeleteBinaryTree(IN PBINARY_TREE Tree); - -VOID STDCALL -ExInsertBinaryTree(IN PBINARY_TREE Tree, - IN PVOID Key, - IN PVOID Value); - -BOOLEAN STDCALL -ExSearchBinaryTree(IN PBINARY_TREE Tree, - IN PVOID Key, - OUT PVOID * Value); - -BOOLEAN STDCALL -ExRemoveBinaryTree(IN PBINARY_TREE Tree, - IN PVOID Key, - IN PVOID * Value); - -BOOLEAN STDCALL -ExTraverseBinaryTree(IN PBINARY_TREE Tree, - IN TRAVERSE_METHOD Method, - IN PTRAVERSE_ROUTINE Routine, - IN PVOID Context); - -BOOLEAN STDCALL -ExInitializeSplayTree(IN PSPLAY_TREE Tree, - IN PKEY_COMPARATOR Compare, - IN BOOLEAN Weighted, - IN BOOLEAN UseNonPagedPool); - -VOID STDCALL -ExDeleteSplayTree(IN PSPLAY_TREE Tree); - -VOID STDCALL -ExInsertSplayTree(IN PSPLAY_TREE Tree, - IN PVOID Key, - IN PVOID Value); - -BOOLEAN STDCALL -ExSearchSplayTree(IN PSPLAY_TREE Tree, - IN PVOID Key, - OUT PVOID * Value); - -BOOLEAN STDCALL -ExRemoveSplayTree(IN PSPLAY_TREE Tree, - IN PVOID Key, - IN PVOID * Value); - -BOOLEAN STDCALL -ExWeightOfSplayTree(IN PSPLAY_TREE Tree, - OUT PULONG Weight); - -BOOLEAN STDCALL -ExTraverseSplayTree(IN PSPLAY_TREE Tree, - IN TRAVERSE_METHOD Method, - IN PTRAVERSE_ROUTINE Routine, - IN PVOID Context); - -BOOLEAN STDCALL -ExInitializeHashTable(IN PHASH_TABLE HashTable, - IN ULONG HashTableSize, - IN PKEY_COMPARATOR Compare OPTIONAL, - IN BOOLEAN UseNonPagedPool); - -VOID STDCALL -ExDeleteHashTable(IN PHASH_TABLE HashTable); - -VOID STDCALL -ExInsertHashTable(IN PHASH_TABLE HashTable, - IN PVOID Key, - IN ULONG KeyLength, - IN PVOID Value); - -BOOLEAN STDCALL -ExSearchHashTable(IN PHASH_TABLE HashTable, - IN PVOID Key, - IN ULONG KeyLength, - OUT PVOID * Value); - -BOOLEAN STDCALL -ExRemoveHashTable(IN PHASH_TABLE HashTable, - IN PVOID Key, - IN ULONG KeyLength, - IN PVOID * Value); - - - -NTSTATUS STDCALL -NtAccessCheckAndAuditAlarm(IN PUNICODE_STRING SubsystemName, - IN PHANDLE ObjectHandle, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN ACCESS_MASK DesiredAccess, - IN PGENERIC_MAPPING GenericMapping, - IN BOOLEAN ObjectCreation, - OUT PULONG GrantedAccess, - OUT PBOOLEAN AccessStatus, - OUT PBOOLEAN GenerateOnClose - ); - -NTSTATUS -STDCALL -NtSetInformationObject ( - IN HANDLE ObjectHandle, - IN CINT ObjectInformationClass, - IN PVOID ObjectInformation, - IN ULONG Length - ); - -#define LPC_CONNECTION_REFUSED (LPC_TYPE)(LPC_MAXIMUM + 1) - -//#define DEVICE_TYPE_FROM_CTL_CODE(ctlCode) (((ULONG)(ctlCode&0xffff0000))>>16) -#define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003) - -/* - * PURPOSE: Irp flags - */ -enum -{ - IRP_NOCACHE = 0x1, - IRP_PAGING_IO = 0x2, - IRP_MOUNT_COMPLETION = 0x2, - IRP_SYNCHRONOUS_API = 0x4, - IRP_ASSOCIATED_IRP = 0x8, - IRP_BUFFERED_IO = 0x10, - IRP_DEALLOCATE_BUFFER = 0x20, - IRP_INPUT_OPERATION = 0x40, - IRP_SYNCHRONOUS_PAGING_IO = 0x40, - IRP_CREATE_OPERATION = 0x80, - IRP_READ_OPERATION = 0x100, - IRP_WRITE_OPERATION = 0x200, - IRP_CLOSE_OPERATION = 0x400, - IRP_DEFER_IO_COMPLETION = 0x800, - IRP_OB_QUERY_NAME = 0x1000, - IRP_HOLD_DEVICE_QUEUE = 0x2000, - IRP_RETRY_IO_COMPLETION = 0x4000 -}; - -/* - * PIO_STACK_LOCATION - * IoGetFirstIrpStackLocation( - * IN PIRP Irp) - */ -#define IoGetFirstIrpStackLocation(_Irp) \ - ((PIO_STACK_LOCATION)((_Irp) + 1)) - -/* - * PIO_STACK_LOCATION - * IoGetSpecificIrpStackLocation( - * IN PIRP Irp, - * IN ULONG Number) - */ -#define IoGetSpecificIrpStackLocation(_Irp, _Number) \ - (((PIO_STACK_LOCATION)((_Irp) + 1)) + (_Number)) - -/* - * file creation flags - */ -#define FILE_DIRECTORY_FILE 0x00000001 -#define FILE_WRITE_THROUGH 0x00000002 -#define FILE_SEQUENTIAL_ONLY 0x00000004 -#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008 - -#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010 -#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020 -//#define FILE_NON_DIRECTORY_FILE 0x00000040 -#define FILE_CREATE_TREE_CONNECTION 0x00000080 - -#define FILE_COMPLETE_IF_OPLOCKED 0x00000100 -#define FILE_NO_EA_KNOWLEDGE 0x00000200 - -#define FILE_RANDOM_ACCESS 0x00000800 - -#define FILE_DELETE_ON_CLOSE 0x00001000 -#define FILE_OPEN_BY_FILE_ID 0x00002000 -#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000 -#define FILE_NO_COMPRESSION 0x00008000 - -#define FILE_RESERVE_OPFILTER 0x00100000 -#define FILE_TRANSACTED_MODE 0x00200000 -#define FILE_OPEN_OFFLINE_FILE 0x00400000 - -#define FILE_VALID_OPTION_FLAGS 0x007fffff -#define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032 -#define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032 -#define FILE_VALID_SET_FLAGS 0x00001036 - -typedef struct _IO_PIPE_CREATE_BUFFER -{ - BOOLEAN WriteModeMessage; - BOOLEAN ReadModeMessage; - BOOLEAN NonBlocking; - ULONG MaxInstances; - ULONG InBufferSize; - ULONG OutBufferSize; - LARGE_INTEGER TimeOut; -} IO_PIPE_CREATE_BUFFER, *PIO_PIPE_CREATE_BUFFER; - -typedef struct _IO_MAILSLOT_CREATE_BUFFER { - ULONG Param; /* ?? */ - ULONG MaxMessageSize; - LARGE_INTEGER TimeOut; -} IO_MAILSLOT_CREATE_BUFFER, *PIO_MAILSLOT_CREATE_BUFFER; - -/* - * PURPOSE: Special timer associated with each device - * NOTES: This is a guess - */ -typedef struct _IO_TIMER -{ - KTIMER timer; - KDPC dpc; -} IO_TIMER, *PIO_TIMER; - - -#include "ntos/hal.h" - -extern ULONG KdDebugState; -extern KD_PORT_INFORMATION GdbPortInfo; -extern KD_PORT_INFORMATION LogPortInfo; - - -typedef struct _LDR_RESOURCE_INFO -{ - ULONG Type; - ULONG Name; - ULONG Language; -} LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO; - -#define RESOURCE_TYPE_LEVEL 0 -#define RESOURCE_NAME_LEVEL 1 -#define RESOURCE_LANGUAGE_LEVEL 2 -#define RESOURCE_DATA_LEVEL 3 - - - -#define FO_FILE_OPEN 0x00000001 -#define FO_SYNCHRONOUS_IO 0x00000002 -#define FO_ALERTABLE_IO 0x00000004 -#define FO_NO_INTERMEDIATE_BUFFERING 0x00000008 -#define FO_WRITE_THROUGH 0x00000010 -#define FO_SEQUENTIAL_ONLY 0x00000020 -#define FO_CACHE_SUPPORTED 0x00000040 -#define FO_NAMED_PIPE 0x00000080 -#define FO_STREAM_FILE 0x00000100 -#define FO_MAILSLOT 0x00000200 -#define FO_GENERATE_AUDIT_ON_CLOSE 0x00000400 -#define FO_DIRECT_DEVICE_OPEN 0x00000800 -#define FO_FILE_MODIFIED 0x00001000 -#define FO_FILE_SIZE_CHANGED 0x00002000 -#define FO_CLEANUP_COMPLETE 0x00004000 -#define FO_TEMPORARY_FILE 0x00008000 -#define FO_DELETE_ON_CLOSE 0x00010000 -#define FO_OPENED_CASE_SENSITIVE 0x00020000 -#define FO_HANDLE_CREATED 0x00040000 -#define FO_FILE_FAST_IO_READ 0x00080000 - - -/* - * ReactOS specific flags - */ -#define FO_DIRECT_CACHE_READ 0x72000001 -#define FO_DIRECT_CACHE_WRITE 0x72000002 -#define FO_DIRECT_CACHE_PAGING_READ 0x72000004 -#define FO_DIRECT_CACHE_PAGING_WRITE 0x72000008 -#define FO_FCB_IS_VALID 0x72000010 - - -extern LOADER_PARAMETER_BLOCK KeLoaderBlock; - - -#define MUTANT_INCREMENT 1 - -NTSTATUS STDCALL -NtCreateMutant(OUT PHANDLE MutantHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN BOOLEAN InitialOwner); - -NTSTATUS STDCALL -NtOpenMutant(OUT PHANDLE MutantHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes); - -NTSTATUS STDCALL -NtQueryMutant(IN HANDLE MutantHandle, - IN CINT MutantInformationClass, - OUT PVOID MutantInformation, - IN ULONG Length, - OUT PULONG ResultLength); - -NTSTATUS STDCALL -NtReleaseMutant(IN HANDLE MutantHandle, - IN PULONG ReleaseCount OPTIONAL); - -VOID STDCALL -KeInitializeMutant(IN PKMUTANT Mutant, - IN BOOLEAN InitialOwner); - -LONG STDCALL -KeReadStateMutant(IN PKMUTANT Mutant); - -LONG STDCALL -KeReleaseMutant(IN PKMUTANT Mutant, - IN KPRIORITY Increment, - IN BOOLEAN Abandon, - IN BOOLEAN Wait); - - -typedef struct _ROS_OBJECT_TYPE_INFORMATION -{ - UNICODE_STRING Name; - UNICODE_STRING Type; - ULONG TotalHandles; - ULONG ReferenceCount; -} ROS_OBJECT_TYPE_INFORMATION, *PROS_OBJECT_TYPE_INFORMATION; - - -VOID STDCALL -PsImpersonateClient(PETHREAD Thread, - PACCESS_TOKEN Token, - UCHAR b, - UCHAR c, - SECURITY_IMPERSONATION_LEVEL Level); - -NTSTATUS STDCALL -PsAssignImpersonationToken(PETHREAD Thread, - HANDLE TokenHandle); - -VOID STDCALL -KiDispatchInterrupt(VOID); - - -NTSTATUS STDCALL -LdrAccessResource(IN PVOID BaseAddress, - IN PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry, - OUT PVOID *Resource OPTIONAL, - OUT PULONG Size OPTIONAL); - -NTSTATUS STDCALL -LdrFindResource_U(PVOID BaseAddress, - PLDR_RESOURCE_INFO ResourceInfo, - ULONG Level, - PIMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry); - -typedef TIME_ZONE_INFORMATION *PTIME_ZONE_INFORMATION; - -PVOID STDCALL -MmAllocateContiguousAlignedMemory(IN ULONG NumberOfBytes, - IN PHYSICAL_ADDRESS HighestAcceptableAddress, - IN ULONG Alignment); - -/* - * PVOID - * MmGetSystemAddressForMdl ( - * PMDL Mdl - * ); - * - * FUNCTION: - * Maps the physical pages described by an MDL into system space - * - * ARGUMENTS: - * Mdl = mdl - * - * RETURNS: - * The base system address for the mapped buffer - */ -#define MmGetSystemAddressForMdl(Mdl) \ - (((Mdl)->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA | MDL_SOURCE_IS_NONPAGED_POOL)) ? \ - ((Mdl)->MappedSystemVa):(MmMapLockedPages((Mdl),KernelMode))) - -VOID STDCALL -KeEnterKernelDebugger(VOID); - -#ifdef _NTOSKRNL_ -extern DECL_EXPORT ULONG DpcQueueSize; -#else -extern DECL_IMPORT ULONG DpcQueueSize; -#endif - -VOID STDCALL -KiDeliverApc(ULONG Unknown1, - ULONG Unknown2, - ULONG Unknown3); - -VOID STDCALL -KeFlushWriteBuffer(VOID); - -#if 0 -typedef struct _HANDLE_TABLE { - // Not used by ReactOS -} HANDLE_TABLE, *PHANDLE_TABLE; -#endif - -typedef struct _ROS_BCB -{ - LIST_ENTRY BcbSegmentListHead; - PFILE_OBJECT FileObject; - ULONG CacheSegmentSize; - LARGE_INTEGER AllocationSize; - LARGE_INTEGER FileSize; - KSPIN_LOCK BcbLock; - ULONG RefCount; -} ROS_BCB, *PROS_BCB; - - -NTSTATUS STDCALL -CcRosInitializeFileCache(PFILE_OBJECT FileObject, - PROS_BCB* Bcb, - ULONG CacheSegmentSize); - -NTSTATUS STDCALL -CcRosReleaseFileCache(PFILE_OBJECT FileObject, PROS_BCB Bcb); - -#define DebugDbgLoadSymbols (DEBUG_CONTROL_CODE)(DebugMaximum + 1) - -#define WM_DROPOBJECT 544 -#define WM_QUERYDROPOBJECT 555 - -typedef WINDOWPOS *PWINDOWPOS; - -#define SECURITY_CREATOR_OWNER_SERVER_RID 0x2 -#define SECURITY_CREATOR_GROUP_SERVER_RID 0x3 -#define SECURITY_LOGON_IDS_RID_COUNT 0x3 -#define SECURITY_ANONYMOUS_LOGON_RID 0x7 -#define SECURITY_PROXY_RID 0x8 -#define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x9 -#define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID -#define SECURITY_AUTHENTICATED_USER_RID 0xB -#define SECURITY_RESTRICTED_CODE_RID 0xC -#define SECURITY_NT_NON_UNIQUE_RID 0x15 -#define SE_MIN_WELL_KNOWN_PRIVILEGE 2 -#define SE_CREATE_TOKEN_PRIVILEGE 2 -#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3 -#define SE_LOCK_MEMORY_PRIVILEGE 4 -#define SE_INCREASE_QUOTA_PRIVILEGE 5 -#define SE_UNSOLICITED_INPUT_PRIVILEGE 6 -#define SE_MACHINE_ACCOUNT_PRIVILEGE 6 -#define SE_TCB_PRIVILEGE 7 -#define SE_SECURITY_PRIVILEGE 8 -#define SE_TAKE_OWNERSHIP_PRIVILEGE 9 -#define SE_LOAD_DRIVER_PRIVILEGE 10 -#define SE_SYSTEM_PROFILE_PRIVILEGE 11 -#define SE_SYSTEMTIME_PRIVILEGE 12 -#define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13 -#define SE_INC_BASE_PRIORITY_PRIVILEGE 14 -#define SE_CREATE_PAGEFILE_PRIVILEGE 15 -#define SE_CREATE_PERMANENT_PRIVILEGE 16 -#define SE_BACKUP_PRIVILEGE 17 -#define SE_RESTORE_PRIVILEGE 18 -#define SE_SHUTDOWN_PRIVILEGE 19 -#define SE_DEBUG_PRIVILEGE 20 -#define SE_AUDIT_PRIVILEGE 21 -#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22 -#define SE_CHANGE_NOTIFY_PRIVILEGE 23 -#define SE_REMOTE_SHUTDOWN_PRIVILEGE 24 -#define SE_MAX_WELL_KNOWN_PRIVILEGE SE_REMOTE_SHUTDOWN_PRIVILEGE - -typedef short INT16; - -BOOL STDCALL GdiDllInitialize(HANDLE, DWORD, LPVOID); - -#include - -typedef struct _ROS_PALOBJ -{ - XLATEOBJ *logicalToSystem; - int *mapping; - PLOGPALETTE logpalette; // _MUST_ be the last field -} ROS_PALOBJ, *PROS_PALOBJ; - -typedef struct _ROS_BRUSHOBJ -{ - ULONG iSolidColor; - PVOID pvRbrush; - - /* remainder of fields are for GDI internal use */ - LOGBRUSH logbrush; -} ROS_BRUSHOBJ, *PROS_BRUSHOBJ; - -HBRUSH STDCALL W32kCreateDIBPatternBrushPt(CONST VOID *PackedDIB, UINT Usage); - -#define GA_PARENT 1 - -#define DCX_USESTYLE 0x00010000L - -#define HELP_SETWINPOS 0x0203L - -typedef ENUMRECTS *PENUMRECTS; - -#define FSRTL_TAG TAG('F','S','r','t') - -NTSTATUS STDCALL -ObRosCreateObject(OUT PHANDLE Handle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN POBJECT_TYPE Type, - OUT PVOID *Object); - -#endif /* !AS_INVOKED */ - #endif /* __INCLUDE_TYPES_H */ diff --git a/reactos/include/ntos/w32api.h b/reactos/include/ntos/w32api.h deleted file mode 100755 index 705fea9e564..00000000000 --- a/reactos/include/ntos/w32api.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: include/ntos/w32api.h - * PURPOSE: Missing definitions in w32api - * PROGRAMMER: Casper S. Hornstrup - * NOTES: Put defines that is missing in w32api, in this file and - * send a patch to the MinGW project. Then, when a new - * w32api is released, remove the defines from this file - * and use the new release. - * Please verify with documentation at msdn.microsoft.com - * before putting definitions here and submitting a patch - * to the MinGW project. - */ - -#ifndef __INCLUDE_NTOS_W32API_H -#define __INCLUDE_NTOS_W32API_H - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - -#ifndef AS_INVOKED - -#endif /* !AS_INVOKED */ - -#endif /* __INCLUDE_NTOS_W32API_H */ diff --git a/reactos/include/ntos/win32.h b/reactos/include/ntos/win32.h deleted file mode 100755 index 7cddbc8bc6c..00000000000 --- a/reactos/include/ntos/win32.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __INCLUDE_NAPI_WIN32_H -#define __INCLUDE_NAPI_WIN32_H - -struct _DESKTOP_OBJECT; - -typedef struct _WINSTATION_OBJECT -{ - CSHORT Type; - CSHORT Size; - - KSPIN_LOCK Lock; - UNICODE_STRING Name; - LIST_ENTRY DesktopListHead; - PRTL_ATOM_TABLE AtomTable; - PVOID HandleTable; - struct _DESKTOP_OBJECT* ActiveDesktop; - /* FIXME: Clipboard */ -} WINSTATION_OBJECT, *PWINSTATION_OBJECT; - -typedef struct _DESKTOP_OBJECT -{ - CSHORT Type; - CSHORT Size; - LIST_ENTRY ListEntry; - KSPIN_LOCK Lock; - UNICODE_STRING Name; - /* Pointer to the associated window station. */ - struct _WINSTATION_OBJECT *WindowStation; - /* Head of the list of windows in this desktop. */ - LIST_ENTRY WindowListHead; - /* Pointer to the active queue. */ - PVOID ActiveMessageQueue; - /* Handle of the desktop window. */ - HANDLE DesktopWindow; - HANDLE PrevActiveWindow; -} DESKTOP_OBJECT, *PDESKTOP_OBJECT; - -typedef struct _W32THREAD -{ - PVOID MessageQueue; - FAST_MUTEX WindowListLock; - LIST_ENTRY WindowListHead; - struct _DESKTOP_OBJECT *Desktop; -} __attribute__((packed)) W32THREAD, *PW32THREAD; - -typedef struct _W32PROCESS -{ - FAST_MUTEX ClassListLock; - LIST_ENTRY ClassListHead; - struct _WINSTATION_OBJECT *WindowStation; -} W32PROCESS, *PW32PROCESS; - -typedef struct _NCCALCSIZE_PARAMS { - RECT rgrc[3]; - PWINDOWPOS lppos; -} NCCALCSIZE_PARAMS; - - -PW32THREAD STDCALL -PsGetWin32Thread(VOID); -NTSTATUS STDCALL -PsCreateWin32Thread(PETHREAD Thread); -PW32PROCESS STDCALL -PsGetWin32Process(VOID); -NTSTATUS STDCALL -PsCreateWin32Process(PEPROCESS Process); -VOID STDCALL -PsEstablishWin32Callouts(PVOID Param1, - PVOID Param2, - PVOID Param3, - PVOID Param4, - ULONG W32ThreadSize, - ULONG W32ProcessSize); - -#endif /* __INCLUDE_NAPI_WIN32_H */ diff --git a/reactos/include/ntos/zw.h b/reactos/include/ntos/zw.h deleted file mode 100755 index 12e56612a67..00000000000 --- a/reactos/include/ntos/zw.h +++ /dev/null @@ -1,4727 +0,0 @@ - -/* $Id: zw.h,v 1.1 2002/09/07 15:12:21 chorns Exp $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: System call definitions - * FILE: include/ddk/zw.h - * REVISION HISTORY: - * ??/??/??: First few functions (David Welch) - * ??/??/??: Complete implementation by Ariadne - * 13/07/98: Reorganised things a bit (David Welch) - * 04/08/98: Added some documentation (Ariadne) - * 14/08/98: Added type TIME and change variable type from [1] to [0] - * 14/09/98: Added for each Nt call a corresponding Zw Call - */ - -#ifndef __DDK_ZW_H -#define __DDK_ZW_H - -//#define LCID ULONG -//#define SECURITY_INFORMATION ULONG -//typedef ULONG SECURITY_INFORMATION; - - -/* - * FUNCTION: Checks a clients access rights to a object - * ARGUMENTS: - * SecurityDescriptor = Security information against which the access is checked - * ClientToken = Represents a client - * DesiredAcces = - * GenericMapping = - * PrivilegeSet = - * ReturnLength = Bytes written - * GrantedAccess = - * AccessStatus = Indicates if the ClientToken allows the requested access - * REMARKS: The arguments map to the win32 AccessCheck - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtAccessCheck( - IN PSECURITY_DESCRIPTOR SecurityDescriptor, - IN HANDLE ClientToken, - IN ACCESS_MASK DesiredAcces, - IN PGENERIC_MAPPING GenericMapping, - OUT PPRIVILEGE_SET PrivilegeSet, - OUT PULONG ReturnLength, - OUT PULONG GrantedAccess, - OUT PBOOLEAN AccessStatus - ); - -NTSTATUS -STDCALL -ZwAccessCheck( - IN PSECURITY_DESCRIPTOR SecurityDescriptor, - IN HANDLE ClientToken, - IN ACCESS_MASK DesiredAcces, - IN PGENERIC_MAPPING GenericMapping, - OUT PPRIVILEGE_SET PrivilegeSet, - OUT PULONG ReturnLength, - OUT PULONG GrantedAccess, - OUT PBOOLEAN AccessStatus - ); - -/* - * FUNCTION: Checks a clients access rights to a object and issues a audit a alarm. ( it logs the access ) - * ARGUMENTS: - * SubsystemName = Specifies the name of the subsystem, can be "WIN32" or "DEBUG" - * ObjectHandle = - * ObjectAttributes = - * DesiredAcces = - * GenericMapping = - * ObjectCreation = - * GrantedAccess = - * AccessStatus = - * GenerateOnClose = - * REMARKS: The arguments map to the win32 AccessCheck - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtAccessCheckAndAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PHANDLE ObjectHandle, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN ACCESS_MASK DesiredAccess, - IN PGENERIC_MAPPING GenericMapping, - IN BOOLEAN ObjectCreation, - OUT PULONG GrantedAccess, - OUT PBOOLEAN AccessStatus, - OUT PBOOLEAN GenerateOnClose - ); - - -NTSTATUS -STDCALL -ZwAddAtom( - IN PWSTR AtomName, - IN OUT PRTL_ATOM Atom - ); - - -/* - * FUNCTION: Adjusts the groups in an access token - * ARGUMENTS: - * TokenHandle = Specifies the access token - * ResetToDefault = If true the NewState parameter is ignored and the groups are set to - * their default state, if false the groups specified in - * NewState are set. - * NewState = - * BufferLength = Specifies the size of the buffer for the PreviousState. - * PreviousState = - * ReturnLength = Bytes written in PreviousState buffer. - * REMARKS: The arguments map to the win32 AdjustTokenGroups - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtAdjustGroupsToken( - IN HANDLE TokenHandle, - IN BOOLEAN ResetToDefault, - IN PTOKEN_GROUPS NewState, - IN ULONG BufferLength, - OUT PTOKEN_GROUPS PreviousState OPTIONAL, - OUT PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwAdjustGroupsToken( - IN HANDLE TokenHandle, - IN BOOLEAN ResetToDefault, - IN PTOKEN_GROUPS NewState, - IN ULONG BufferLength, - OUT PTOKEN_GROUPS PreviousState, - OUT PULONG ReturnLength - ); - - -/* - * FUNCTION: - * - * ARGUMENTS: - * TokenHandle = Handle to the access token - * DisableAllPrivileges = The resulting suspend count. - NewState = - BufferLength = - PreviousState = - ReturnLength = - * REMARK: - * The arguments map to the win32 AdjustTokenPrivileges - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtAdjustPrivilegesToken( - IN HANDLE TokenHandle, - IN BOOLEAN DisableAllPrivileges, - IN PTOKEN_PRIVILEGES NewState, - IN ULONG BufferLength, - OUT PTOKEN_PRIVILEGES PreviousState, - OUT PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwAdjustPrivilegesToken( - IN HANDLE TokenHandle, - IN BOOLEAN DisableAllPrivileges, - IN PTOKEN_PRIVILEGES NewState, - IN ULONG BufferLength, - OUT PTOKEN_PRIVILEGES PreviousState, - OUT PULONG ReturnLength - ); - - -/* - * FUNCTION: Decrements a thread's suspend count and places it in an alerted - * state. - * ARGUMENTS: - * ThreadHandle = Handle to the thread that should be resumed - * SuspendCount = The resulting suspend count. - * REMARK: - * A thread is resumed if its suspend count is 0 - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtAlertResumeThread( - IN HANDLE ThreadHandle, - OUT PULONG SuspendCount - ); - -NTSTATUS -STDCALL -ZwAlertResumeThread( - IN HANDLE ThreadHandle, - OUT PULONG SuspendCount - ); - -/* - * FUNCTION: Puts the thread in a alerted state - * ARGUMENTS: - * ThreadHandle = Handle to the thread that should be alerted - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtAlertThread( - IN HANDLE ThreadHandle - ); - -NTSTATUS -STDCALL -ZwAlertThread( - IN HANDLE ThreadHandle - ); - - -/* - * FUNCTION: Allocates a locally unique id - * ARGUMENTS: - * LocallyUniqueId = Locally unique number - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtAllocateLocallyUniqueId( - OUT LUID *LocallyUniqueId - ); - -NTSTATUS -STDCALL -ZwAllocateLocallyUniqueId( - OUT PLUID Luid - ); - -NTSTATUS -STDCALL -ZwAllocateUuids( - PULARGE_INTEGER Time, - PULONG Range, - PULONG Sequence - ); - - -/* - * FUNCTION: Allocates a block of virtual memory in the process address space - * ARGUMENTS: - * ProcessHandle = The handle of the process which owns the virtual memory - * BaseAddress = A pointer to the virtual memory allocated. If you supply a non zero - * value the system will try to allocate the memory at the address supplied. It rounds - * it down to a multiple if the page size. - * ZeroBits = (OPTIONAL) You can specify the number of high order bits that must be zero, ensuring that - * the memory will be allocated at a address below a certain value. - * RegionSize = The number of bytes to allocate - * AllocationType = Indicates the type of virtual memory you like to allocated, - * can be one of the values : MEM_COMMIT, MEM_RESERVE, MEM_RESET, MEM_TOP_DOWN - * Protect = Indicates the protection type of the pages allocated, can be a combination of - * PAGE_READONLY, PAGE_READWRITE, PAGE_EXECUTE_READ, - * PAGE_EXECUTE_READWRITE, PAGE_GUARD, PAGE_NOACCESS, PAGE_NOACCESS - * REMARKS: - * This function maps to the win32 VirtualAllocEx. Virtual memory is process based so the - * protocol starts with a ProcessHandle. I splitted the functionality of obtaining the actual address and specifying - * the start address in two parameters ( BaseAddress and StartAddress ) The NumberOfBytesAllocated specify the range - * and the AllocationType and ProctectionType map to the other two parameters. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtAllocateVirtualMemory ( - IN HANDLE ProcessHandle, - IN OUT PVOID *BaseAddress, - IN ULONG ZeroBits, - IN OUT PULONG RegionSize, - IN ULONG AllocationType, - IN ULONG Protect - ); - -NTSTATUS -STDCALL -ZwAllocateVirtualMemory ( - IN HANDLE ProcessHandle, - IN OUT PVOID *BaseAddress, - IN ULONG ZeroBits, - IN OUT PULONG RegionSize, - IN ULONG AllocationType, - IN ULONG Protect); - -/* - * FUNCTION: Returns from a callback into user mode - * ARGUMENTS: - * RETURN Status - */ -//FIXME: this function might need 3 parameters -NTSTATUS STDCALL NtCallbackReturn(PVOID Result, - ULONG ResultLength, - NTSTATUS Status); - -NTSTATUS STDCALL ZwCallbackReturn(PVOID Result, - ULONG ResultLength, - NTSTATUS Status); - -/* - * FUNCTION: Cancels a IO request - * ARGUMENTS: - * FileHandle = Handle to the file - * IoStatusBlock = - * - * REMARKS: - * This function maps to the win32 CancelIo. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCancelIoFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock - ); - -NTSTATUS -STDCALL -ZwCancelIoFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock - ); -/* - * FUNCTION: Cancels a timer - * ARGUMENTS: - * TimerHandle = Handle to the timer - * CurrentState = Specifies the state of the timer when cancelled. - * REMARKS: - * The arguments to this function map to the function CancelWaitableTimer. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCancelTimer( - IN HANDLE TimerHandle, - OUT PBOOLEAN CurrentState OPTIONAL - ); - -/* - * FUNCTION: Sets the status of the event back to non-signaled - * ARGUMENTS: - * EventHandle = Handle to the event - * REMARKS: - * This function maps to win32 function ResetEvent. - * RETURcNS: Status - */ - -NTSTATUS -STDCALL -NtClearEvent( - IN HANDLE EventHandle - ); - -NTSTATUS -STDCALL -ZwClearEvent( - IN HANDLE EventHandle - ); - -/* - * FUNCTION: Closes an object handle - * ARGUMENTS: - * Handle = Handle to the object - * REMARKS: - * This function maps to the win32 function CloseHandle. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtClose( - IN HANDLE Handle - ); - -NTSTATUS -STDCALL -ZwClose( - IN HANDLE Handle - ); - -/* - * FUNCTION: Generates an audit message when a handle to an object is dereferenced - * ARGUMENTS: - * SubsystemName = - HandleId = Handle to the object - GenerateOnClose = - * REMARKS: - * This function maps to the win32 function ObjectCloseAuditAlarm. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCloseObjectAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN BOOLEAN GenerateOnClose - ); - -NTSTATUS -STDCALL -ZwCloseObjectAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN BOOLEAN GenerateOnClose - ); - -/* - * FUNCTION: Continues a thread with the specified context - * ARGUMENTS: - * Context = Specifies the processor context - * IrqLevel = Specifies the Interupt Request Level to continue with. Can - * be PASSIVE_LEVEL or APC_LEVEL - * REMARKS - * NtContinue can be used to continue after an exception or apc. - * RETURNS: Status - */ -//FIXME This function might need another parameter - -NTSTATUS -STDCALL -NtContinue( - IN PCONTEXT Context, - IN BOOLEAN TestAlert - ); - - -/* - * FUNCTION: Creates a directory object - * ARGUMENTS: - * DirectoryHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies access to the directory - * ObjectAttribute = Initialized attributes for the object - * REMARKS: This function maps to the win32 CreateDirectory. A directory is like a file so it needs a - * handle, a access mask and a OBJECT_ATTRIBUTES structure to map the path name and the SECURITY_ATTRIBUTES. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCreateDirectoryObject( - OUT PHANDLE DirectoryHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwCreateDirectoryObject( - OUT PHANDLE DirectoryHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Creates an event object - * ARGUMENTS: - * EventHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies access to the event - * ObjectAttribute = Initialized attributes for the object - * ManualReset = manual-reset or auto-reset if true you have to reset the state of the event manually - * using NtResetEvent/NtClearEvent. if false the system will reset the event to a non-signalled state - * automatically after the system has rescheduled a thread waiting on the event. - * InitialState = specifies the initial state of the event to be signaled ( TRUE ) or non-signalled (FALSE). - * REMARKS: This function maps to the win32 CreateEvent. Demanding a out variable of type HANDLE, - * a access mask and a OBJECT_ATTRIBUTES structure mapping to the SECURITY_ATTRIBUTES. ManualReset and InitialState are - * both parameters aswell ( possibly the order is reversed ). - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCreateEvent( - OUT PHANDLE EventHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN BOOLEAN ManualReset, - IN BOOLEAN InitialState - ); - -NTSTATUS -STDCALL -ZwCreateEvent( - OUT PHANDLE EventHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN BOOLEAN ManualReset, - IN BOOLEAN InitialState - ); - -/* - * FUNCTION: Creates an eventpair object - * ARGUMENTS: - * EventPairHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies access to the event - * ObjectAttribute = Initialized attributes for the object - */ - -NTSTATUS -STDCALL -NtCreateEventPair( - OUT PHANDLE EventPairHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwCreateEventPair( - OUT PHANDLE EventPairHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - - -/* - * FUNCTION: Creates or opens a file, directory or device object. - * ARGUMENTS: - * FileHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the file can - * be a combination of DELETE | FILE_READ_DATA .. - * ObjectAttribute = Initialized attributes for the object, contains the rootdirectory and the filename - * IoStatusBlock (OUT) = Caller supplied storage for the resulting status information, indicating if the - * the file is created and opened or allready existed and is just opened. - * FileAttributes = file attributes can be a combination of FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN ... - * ShareAccess = can be a combination of the following: FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE - * CreateDisposition = specifies what the behavior of the system if the file allready exists. - * CreateOptions = specifies the behavior of the system on file creation. - * EaBuffer (OPTIONAL) = Extended Attributes buffer, applies only to files and directories. - * EaLength = Extended Attributes buffer size, applies only to files and directories. - * REMARKS: This function maps to the win32 CreateFile. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCreateFile( - OUT PHANDLE FileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PLARGE_INTEGER AllocationSize OPTIONAL, - IN ULONG FileAttributes, - IN ULONG ShareAccess, - IN ULONG CreateDisposition, - IN ULONG CreateOptions, - IN PVOID EaBuffer OPTIONAL, - IN ULONG EaLength - ); - -NTSTATUS -STDCALL -ZwCreateFile( - OUT PHANDLE FileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PLARGE_INTEGER AllocationSize OPTIONAL, - IN ULONG FileAttributes, - IN ULONG ShareAccess, - IN ULONG CreateDisposition, - IN ULONG CreateOptions, - IN PVOID EaBuffer OPTIONAL, - IN ULONG EaLength - ); - -/* - * FUNCTION: Creates or opens a file, directory or device object. - * ARGUMENTS: - * CompletionPort (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the port - * IoStatusBlock = - * NumberOfConcurrentThreads = - * REMARKS: This function maps to the win32 CreateIoCompletionPort - * RETURNS: - * Status - */ - -NTSTATUS -STDCALL -NtCreateIoCompletion( - OUT PHANDLE CompletionPort, - IN ACCESS_MASK DesiredAccess, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG NumberOfConcurrentThreads - ); - -NTSTATUS -STDCALL -ZwCreateIoCompletion( - OUT PHANDLE CompletionPort, - IN ACCESS_MASK DesiredAccess, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG NumberOfConcurrentThreads - ); - - -/* - * FUNCTION: Creates a mail slot file - * ARGUMENTS: - * MailSlotFileHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the file - * ObjectAttributes = Contains the name of the mailslotfile. - * IoStatusBlock = - * FileAttributes = - * ShareAccess = - * MaxMessageSize = - * TimeOut = - * - * REMARKS: This funciton maps to the win32 function CreateMailSlot - * RETURNS: - * Status - */ - -NTSTATUS -STDCALL -NtCreateMailslotFile( - OUT PHANDLE MailSlotFileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG FileAttributes, - IN ULONG ShareAccess, - IN ULONG MaxMessageSize, - IN PLARGE_INTEGER TimeOut - ); - -NTSTATUS -STDCALL -ZwCreateMailslotFile( - OUT PHANDLE MailSlotFileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG FileAttributes, - IN ULONG ShareAccess, - IN ULONG MaxMessageSize, - IN PLARGE_INTEGER TimeOut - ); - -/* - * FUNCTION: Creates or opens a mutex - * ARGUMENTS: - * MutantHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the port - * ObjectAttributes = Contains the name of the mutex. - * InitialOwner = If true the calling thread acquires ownership - * of the mutex. - * REMARKS: This funciton maps to the win32 function CreateMutex - * RETURNS: - * Status - */ -NTSTATUS -STDCALL -NtCreateMutant( - OUT PHANDLE MutantHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN BOOLEAN InitialOwner - ); - -NTSTATUS -STDCALL -ZwCreateMutant( - OUT PHANDLE MutantHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN BOOLEAN InitialOwner - ); - - -/* - * FUNCTION: Creates a paging file. - * ARGUMENTS: - * FileName = Name of the pagefile - * InitialSize = Specifies the initial size in bytes - * MaximumSize = Specifies the maximum size in bytes - * Reserved = Reserved for future use - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCreatePagingFile( - IN PUNICODE_STRING FileName, - IN PLARGE_INTEGER InitialSize, - IN PLARGE_INTEGER MaxiumSize, - IN ULONG Reserved - ); - -/* - * FUNCTION: Creates a process. - * ARGUMENTS: - * ProcessHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the process can - * be a combinate of STANDARD_RIGHTS_REQUIRED| .. - * ObjectAttribute = Initialized attributes for the object, contains the rootdirectory and the filename - * ParentProcess = Handle to the parent process. - * InheritObjectTable = Specifies to inherit the objects of the parent process if true. - * SectionHandle = Handle to a section object to back the image file - * DebugPort = Handle to a DebugPort if NULL the system default debug port will be used. - * ExceptionPort = Handle to a exception port. - * REMARKS: - * This function maps to the win32 CreateProcess. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCreateProcess( - OUT PHANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN HANDLE ParentProcess, - IN BOOLEAN InheritObjectTable, - IN HANDLE SectionHandle OPTIONAL, - IN HANDLE DebugPort OPTIONAL, - IN HANDLE ExceptionPort OPTIONAL - ); - -NTSTATUS -STDCALL -ZwCreateProcess( - OUT PHANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN HANDLE ParentProcess, - IN BOOLEAN InheritObjectTable, - IN HANDLE SectionHandle OPTIONAL, - IN HANDLE DebugPort OPTIONAL, - IN HANDLE ExceptionPort OPTIONAL - ); - -/* - * FUNCTION: Creates a profile - * ARGUMENTS: - * ProfileHandle (OUT) = Caller supplied storage for the resulting handle - * ObjectAttribute = Initialized attributes for the object - * ImageBase = Start address of executable image - * ImageSize = Size of the image - * Granularity = Bucket size - * Buffer = Caller supplies buffer for profiling info - * ProfilingSize = Buffer size - * ClockSource = Specify 0 / FALSE ?? - * ProcessorMask = A value of -1 indicates disables per processor profiling, - otherwise bit set for the processor to profile. - * REMARKS: - * This function maps to the win32 CreateProcess. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCreateProfile(OUT PHANDLE ProfileHandle, - IN HANDLE ProcessHandle, - IN PVOID ImageBase, - IN ULONG ImageSize, - IN ULONG Granularity, - OUT PULONG Buffer, - IN ULONG ProfilingSize, - IN KPROFILE_SOURCE Source, - IN ULONG ProcessorMask); - -/* - * FUNCTION: Creates a section object. - * ARGUMENTS: - * SectionHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the desired access to the section can be a combination of STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_WRITE | - * SECTION_MAP_READ | SECTION_MAP_EXECUTE. - * ObjectAttribute = Initialized attributes for the object can be used to create a named section - * MaxiumSize = Maximizes the size of the memory section. Must be non-NULL for a page-file backed section. - * If value specified for a mapped file and the file is not large enough, file will be extended. - * SectionPageProtection = Can be a combination of PAGE_READONLY | PAGE_READWRITE | PAGE_WRITEONLY | PAGE_WRITECOPY. - * AllocationAttributes = can be a combination of SEC_IMAGE | SEC_RESERVE - * FileHanlde = Handle to a file to create a section mapped to a file instead of a memory backed section. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCreateSection( - OUT PHANDLE SectionHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN PLARGE_INTEGER MaximumSize OPTIONAL, - IN ULONG SectionPageProtection OPTIONAL, - IN ULONG AllocationAttributes, - IN HANDLE FileHandle OPTIONAL - ); - -NTSTATUS -STDCALL -ZwCreateSection( - OUT PHANDLE SectionHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN PLARGE_INTEGER MaximumSize OPTIONAL, - IN ULONG SectionPageProtection OPTIONAL, - IN ULONG AllocationAttributes, - IN HANDLE FileHandle OPTIONAL - ); - -/* - * FUNCTION: Creates a semaphore object for interprocess synchronization. - * ARGUMENTS: - * SemaphoreHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the semaphore. - * ObjectAttribute = Initialized attributes for the object. - * InitialCount = Not necessary zero, might be smaller than zero. - * MaximumCount = Maxiumum count the semaphore can reach. - * RETURNS: Status - * REMARKS: - * The semaphore is set to signaled when its count is greater than zero, and non-signaled when its count is zero. - */ - -//FIXME: should a semaphore's initial count allowed to be smaller than zero ?? -NTSTATUS -STDCALL -NtCreateSemaphore( - OUT PHANDLE SemaphoreHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN LONG InitialCount, - IN LONG MaximumCount - ); - -NTSTATUS -STDCALL -ZwCreateSemaphore( - OUT PHANDLE SemaphoreHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN LONG InitialCount, - IN LONG MaximumCount - ); - -/* - * FUNCTION: Creates a symbolic link object - * ARGUMENTS: - * SymbolicLinkHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the thread. - * ObjectAttributes = Initialized attributes for the object. - * Name = Target name of the symbolic link - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCreateSymbolicLinkObject( - OUT PHANDLE SymbolicLinkHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PUNICODE_STRING Name - ); - -NTSTATUS -STDCALL -ZwCreateSymbolicLinkObject( - OUT PHANDLE SymbolicLinkHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PUNICODE_STRING Name - ); - -/* - * FUNCTION: Creates a user mode thread - * ARGUMENTS: - * ThreadHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the thread. - * ObjectAttributes = Initialized attributes for the object. - * ProcessHandle = Handle to the threads parent process. - * ClientId (OUT) = Caller supplies storage for returned process id and thread id. - * ThreadContext = Initial processor context for the thread. - * InitialTeb = Initial user mode stack context for the thread. - * CreateSuspended = Specifies if the thread is ready for scheduling - * REMARKS: - * This function maps to the win32 function CreateThread. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCreateThread( - OUT PHANDLE ThreadHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN HANDLE ProcessHandle, - OUT PCLIENT_ID ClientId, - IN PCONTEXT ThreadContext, - IN PINITIAL_TEB InitialTeb, - IN BOOLEAN CreateSuspended - ); - -/* - * FUNCTION: Creates a waitable timer. - * ARGUMENTS: - * TimerHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the timer. - * ObjectAttributes = Initialized attributes for the object. - * TimerType = Specifies if the timer should be reset manually. - * REMARKS: - * This function maps to the win32 CreateWaitableTimer. lpTimerAttributes and lpTimerName map to - * corresponding fields in OBJECT_ATTRIBUTES structure. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCreateTimer( - OUT PHANDLE TimerHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN TIMER_TYPE TimerType - ); - -NTSTATUS -STDCALL -ZwCreateTimer( - OUT PHANDLE TimerHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN TIMER_TYPE TimerType - ); - -/* - * FUNCTION: Creates a token. - * ARGUMENTS: - * TokenHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the process can - * be a combinate of STANDARD_RIGHTS_REQUIRED| .. - * ObjectAttribute = Initialized attributes for the object, contains the rootdirectory and the filename - * TokenType = - * AuthenticationId = - * ExpirationTime = - * TokenUser = - * TokenGroups = - * TokenPrivileges = - * TokenOwner = - * TokenPrimaryGroup = - * TokenDefaultDacl = - * TokenSource = - * REMARKS: - * This function does not map to a win32 function - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCreateToken( - OUT PHANDLE TokenHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN TOKEN_TYPE TokenType, - IN PLUID AuthenticationId, - IN PLARGE_INTEGER ExpirationTime, - IN PTOKEN_USER TokenUser, - IN PTOKEN_GROUPS TokenGroups, - IN PTOKEN_PRIVILEGES TokenPrivileges, - IN PTOKEN_OWNER TokenOwner, - IN PTOKEN_PRIMARY_GROUP TokenPrimaryGroup, - IN PTOKEN_DEFAULT_DACL TokenDefaultDacl, - IN PTOKEN_SOURCE TokenSource - ); - -NTSTATUS -STDCALL -ZwCreateToken( - OUT PHANDLE TokenHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN TOKEN_TYPE TokenType, - IN PLUID AuthenticationId, - IN PLARGE_INTEGER ExpirationTime, - IN PTOKEN_USER TokenUser, - IN PTOKEN_GROUPS TokenGroups, - IN PTOKEN_PRIVILEGES TokenPrivileges, - IN PTOKEN_OWNER TokenOwner, - IN PTOKEN_PRIMARY_GROUP TokenPrimaryGroup, - IN PTOKEN_DEFAULT_DACL TokenDefaultDacl, - IN PTOKEN_SOURCE TokenSource - ); - -/* - * FUNCTION: Returns the callers thread TEB. - * RETURNS: The resulting teb. - */ -#if 0 - NT_TEB * -STDCALL -NtCurrentTeb(VOID - ); -#endif - -/* - * FUNCTION: Delays the execution of the calling thread. - * ARGUMENTS: - * Alertable = If TRUE the thread is alertable during is wait period - * Interval = Specifies the interval to wait. - * RETURNS: Status - */ -NTSTATUS STDCALL NtDelayExecution(IN ULONG Alertable, IN TIME* Interval); - -/* - * FUNCTION: Deletes an atom from the global atom table - * ARGUMENTS: - * Atom = Identifies the atom to delete - * REMARKS: - * The function maps to the win32 GlobalDeleteAtom - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtDeleteAtom( - IN RTL_ATOM Atom - ); - -NTSTATUS -STDCALL -ZwDeleteAtom( - IN RTL_ATOM Atom - ); - -/* - * FUNCTION: Deletes a file or a directory - * ARGUMENTS: - * ObjectAttributes = Name of the file which should be deleted - * REMARKS: - * This system call is functionally equivalent to NtSetInformationFile - * setting the disposition information. - * The function maps to the win32 DeleteFile. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtDeleteFile( - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwDeleteFile( - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Deletes a registry key - * ARGUMENTS: - * KeyHandle = Handle of the key - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtDeleteKey( - IN HANDLE KeyHandle - ); -NTSTATUS -STDCALL -ZwDeleteKey( - IN HANDLE KeyHandle - ); - -/* - * FUNCTION: Generates a audit message when an object is deleted - * ARGUMENTS: - * SubsystemName = Spefies the name of the subsystem can be 'WIN32' or 'DEBUG' - * HandleId= Handle to an audit object - * GenerateOnClose = Value returned by NtAccessCheckAndAuditAlarm - * REMARKS: This function maps to the win32 ObjectCloseAuditAlarm - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtDeleteObjectAuditAlarm ( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN BOOLEAN GenerateOnClose - ); - -NTSTATUS -STDCALL -ZwDeleteObjectAuditAlarm ( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN BOOLEAN GenerateOnClose - ); - - -/* - * FUNCTION: Deletes a value from a registry key - * ARGUMENTS: - * KeyHandle = Handle of the key - * ValueName = Name of the value to delete - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtDeleteValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName - ); - -NTSTATUS -STDCALL -ZwDeleteValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName - ); -/* - * FUNCTION: Sends IOCTL to the io sub system - * ARGUMENTS: - * DeviceHandle = Points to the handle that is created by NtCreateFile - * Event = Event to synchronize on STATUS_PENDING - * ApcRoutine = Asynchroneous procedure callback - * ApcContext = Callback context. - * IoStatusBlock = Caller should supply storage for extra information.. - * IoControlCode = Contains the IO Control command. This is an - * index to the structures in InputBuffer and OutputBuffer. - * InputBuffer = Caller should supply storage for input buffer if IOTL expects one. - * InputBufferSize = Size of the input bufffer - * OutputBuffer = Caller should supply storage for output buffer if IOTL expects one. - * OutputBufferSize = Size of the input bufffer - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtDeviceIoControlFile( - IN HANDLE DeviceHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG IoControlCode, - IN PVOID InputBuffer, - IN ULONG InputBufferSize, - OUT PVOID OutputBuffer, - IN ULONG OutputBufferSize - ); - -NTSTATUS -STDCALL -ZwDeviceIoControlFile( - IN HANDLE DeviceHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG IoControlCode, - IN PVOID InputBuffer, - IN ULONG InputBufferSize, - OUT PVOID OutputBuffer, - IN ULONG OutputBufferSize - ); -/* - * FUNCTION: Displays a string on the blue screen - * ARGUMENTS: - * DisplayString = The string to display - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtDisplayString( - IN PUNICODE_STRING DisplayString - ); - -NTSTATUS -STDCALL -ZwDisplayString( - IN PUNICODE_STRING DisplayString - ); - -/* - * FUNCTION: Returns information about the subkeys of an open key - * ARGUMENTS: - * KeyHandle = Handle of the key whose subkeys are to enumerated - * Index = zero based index of the subkey for which information is - * request - * KeyInformationClass = Type of information returned - * KeyInformation (OUT) = Caller allocated buffer for the information - * about the key - * Length = Length in bytes of the KeyInformation buffer - * ResultLength (OUT) = Caller allocated storage which holds - * the number of bytes of information retrieved - * on return - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtEnumerateKey( - IN HANDLE KeyHandle, - IN ULONG Index, - IN KEY_INFORMATION_CLASS KeyInformationClass, - OUT PVOID KeyInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwEnumerateKey( - IN HANDLE KeyHandle, - IN ULONG Index, - IN KEY_INFORMATION_CLASS KeyInformationClass, - OUT PVOID KeyInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); -/* - * FUNCTION: Returns information about the value entries of an open key - * ARGUMENTS: - * KeyHandle = Handle of the key whose value entries are to enumerated - * Index = zero based index of the subkey for which information is - * request - * KeyInformationClass = Type of information returned - * KeyInformation (OUT) = Caller allocated buffer for the information - * about the key - * Length = Length in bytes of the KeyInformation buffer - * ResultLength (OUT) = Caller allocated storage which holds - * the number of bytes of information retrieved - * on return - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtEnumerateValueKey( - IN HANDLE KeyHandle, - IN ULONG Index, - IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - OUT PVOID KeyValueInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwEnumerateValueKey( - IN HANDLE KeyHandle, - IN ULONG Index, - IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - OUT PVOID KeyValueInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); -/* - * FUNCTION: Extends a section - * ARGUMENTS: - * SectionHandle = Handle to the section - * NewMaximumSize = Adjusted size - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtExtendSection( - IN HANDLE SectionHandle, - IN ULONG NewMaximumSize - ); - -NTSTATUS -STDCALL -ZwFindAtom( - IN PWSTR AtomName, - OUT PRTL_ATOM Atom OPTIONAL - ); - -/* - * FUNCTION: Flushes chached file data to disk - * ARGUMENTS: - * FileHandle = Points to the file - * IoStatusBlock = Caller must supply storage to receive the result of the flush - * buffers operation. The information field is set to number of bytes - * flushed to disk. - * RETURNS: Status - * REMARKS: - * This funciton maps to the win32 FlushFileBuffers - */ -NTSTATUS -STDCALL -NtFlushBuffersFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock - ); - -NTSTATUS -STDCALL -ZwFlushBuffersFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock - ); -/* - * FUNCTION: Flushes a the processors instruction cache - * ARGUMENTS: - * ProcessHandle = Points to the process owning the cache - * BaseAddress = // might this be a image address ???? - * NumberOfBytesToFlush = - * RETURNS: Status - * REMARKS: - * This funciton is used by debuggers - */ -NTSTATUS -STDCALL -NtFlushInstructionCache( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN UINT NumberOfBytesToFlush - ); -/* - * FUNCTION: Flushes a registry key to disk - * ARGUMENTS: - * KeyHandle = Points to the registry key handle - * RETURNS: Status - * REMARKS: - * This funciton maps to the win32 RegFlushKey. - */ -NTSTATUS -STDCALL -NtFlushKey( - IN HANDLE KeyHandle - ); - -NTSTATUS -STDCALL -ZwFlushKey( - IN HANDLE KeyHandle - ); - -/* - * FUNCTION: Flushes virtual memory to file - * ARGUMENTS: - * ProcessHandle = Points to the process that allocated the virtual memory - * BaseAddress = Points to the memory address - * NumberOfBytesToFlush = Limits the range to flush, - * NumberOfBytesFlushed = Actual number of bytes flushed - * RETURNS: Status - * REMARKS: - * Check return status on STATUS_NOT_MAPPED_DATA - */ -NTSTATUS -STDCALL -NtFlushVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN ULONG NumberOfBytesToFlush, - OUT PULONG NumberOfBytesFlushed OPTIONAL - ); - -/* - * FUNCTION: Flushes the dirty pages to file - * RETURNS: Status - * FIXME: Not sure this does (how is the file specified) - */ -NTSTATUS STDCALL NtFlushWriteBuffer(VOID); -NTSTATUS STDCALL ZwFlushWriteBuffer(VOID); - - /* - * FUNCTION: Frees a range of virtual memory - * ARGUMENTS: - * ProcessHandle = Points to the process that allocated the virtual - * memory - * BaseAddress = Points to the memory address, rounded down to a - * multiple of the pagesize - * RegionSize = Limits the range to free, rounded up to a multiple of - * the paging size - * FreeType = Can be one of the values: MEM_DECOMMIT, or MEM_RELEASE - * RETURNS: Status - */ -NTSTATUS STDCALL NtFreeVirtualMemory(IN HANDLE ProcessHandle, - IN PVOID *BaseAddress, - IN PULONG RegionSize, - IN ULONG FreeType); -NTSTATUS STDCALL ZwFreeVirtualMemory(IN HANDLE ProcessHandle, - IN PVOID *BaseAddress, - IN PULONG RegionSize, - IN ULONG FreeType); - -/* - * FUNCTION: Sends FSCTL to the filesystem - * ARGUMENTS: - * DeviceHandle = Points to the handle that is created by NtCreateFile - * Event = Event to synchronize on STATUS_PENDING - * ApcRoutine = - * ApcContext = - * IoStatusBlock = Caller should supply storage for - * IoControlCode = Contains the File System Control command. This is an - * index to the structures in InputBuffer and OutputBuffer. - * FSCTL_GET_RETRIEVAL_POINTERS MAPPING_PAIR - * FSCTL_GET_RETRIEVAL_POINTERS GET_RETRIEVAL_DESCRIPTOR - * FSCTL_GET_VOLUME_BITMAP BITMAP_DESCRIPTOR - * FSCTL_MOVE_FILE MOVEFILE_DESCRIPTOR - * - * InputBuffer = Caller should supply storage for input buffer if FCTL expects one. - * InputBufferSize = Size of the input bufffer - * OutputBuffer = Caller should supply storage for output buffer if FCTL expects one. - * OutputBufferSize = Size of the input bufffer - * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES | - * STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST ] - */ -NTSTATUS -STDCALL -NtFsControlFile( - IN HANDLE DeviceHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG IoControlCode, - IN PVOID InputBuffer, - IN ULONG InputBufferSize, - OUT PVOID OutputBuffer, - IN ULONG OutputBufferSize - ); - -NTSTATUS -STDCALL -ZwFsControlFile( - IN HANDLE DeviceHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG IoControlCode, - IN PVOID InputBuffer, - IN ULONG InputBufferSize, - OUT PVOID OutputBuffer, - IN ULONG OutputBufferSize - ); - -/* - * FUNCTION: Retrieves the processor context of a thread - * ARGUMENTS: - * ThreadHandle = Handle to a thread - * Context (OUT) = Caller allocated storage for the processor context - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtGetContextThread( - IN HANDLE ThreadHandle, - OUT PCONTEXT Context - ); - -NTSTATUS -STDCALL -ZwGetContextThread( - IN HANDLE ThreadHandle, - OUT PCONTEXT Context - ); -/* - * FUNCTION: Retrieves the uptime of the system - * ARGUMENTS: - * UpTime = Number of clock ticks since boot. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtGetTickCount( - PULONG UpTime - ); - -/* - * FUNCTION: Sets a thread to impersonate another - * ARGUMENTS: - * ThreadHandle = Server thread that will impersonate a client. - ThreadToImpersonate = Client thread that will be impersonated - SecurityQualityOfService = Specifies the impersonation level. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtImpersonateThread( - IN HANDLE ThreadHandle, - IN HANDLE ThreadToImpersonate, - IN PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService - ); - -NTSTATUS -STDCALL -ZwImpersonateThread( - IN HANDLE ThreadHandle, - IN HANDLE ThreadToImpersonate, - IN PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService - ); - -/* - * FUNCTION: Initializes the registry. - * ARGUMENTS: - * SetUpBoot = This parameter is true for a setup boot. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtInitializeRegistry( - BOOLEAN SetUpBoot - ); -NTSTATUS -STDCALL -ZwInitializeRegistry( - BOOLEAN SetUpBoot - ); - -/* - * FUNCTION: Loads a driver. - * ARGUMENTS: - * DriverServiceName = Name of the driver to load - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtLoadDriver( - IN PUNICODE_STRING DriverServiceName - ); - -NTSTATUS -STDCALL -ZwLoadDriver( - IN PUNICODE_STRING DriverServiceName - ); - -/* - * FUNCTION: Loads a registry key. - * ARGUMENTS: - * KeyHandle = Handle to the registry key - * ObjectAttributes = ??? - * REMARK: - * This procedure maps to the win32 procedure RegLoadKey - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtLoadKey( - PHANDLE KeyHandle, - POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Loads a registry key. - * ARGUMENTS: - * KeyHandle = Handle to the registry key - * ObjectAttributes = ??? - * Unknown3 = ??? - * REMARK: - * This procedure maps to the win32 procedure RegLoadKey - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtLoadKey2 ( - PHANDLE KeyHandle, - POBJECT_ATTRIBUTES ObjectAttributes, - ULONG Unknown3 - ); - -/* - * FUNCTION: Locks a range of bytes in a file. - * ARGUMENTS: - * FileHandle = Handle to the file - * Event = Should be null if apc is specified. - * ApcRoutine = Asynchroneous Procedure Callback - * ApcContext = Argument to the callback - * IoStatusBlock (OUT) = Caller should supply storage for a structure containing - * the completion status and information about the requested lock operation. - * ByteOffset = Offset - * Length = Number of bytes to lock. - * Key = Special value to give other threads the possibility to unlock the file - by supplying the key in a call to NtUnlockFile. - * FailImmediatedly = If false the request will block untill the lock is obtained. - * ExclusiveLock = Specifies whether a exclusive or a shared lock is obtained. - * REMARK: - This procedure maps to the win32 procedure LockFileEx. STATUS_PENDING is returned if the lock could - not be obtained immediately, the device queue is busy and the IRP is queued. - * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES | - STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_LOCK_NOT_GRANTED ] - - */ -NTSTATUS -STDCALL -NtLockFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PLARGE_INTEGER ByteOffset, - IN PLARGE_INTEGER Length, - IN PULONG Key, - IN BOOLEAN FailImmediatedly, - IN BOOLEAN ExclusiveLock - ); - -NTSTATUS -STDCALL -ZwLockFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PLARGE_INTEGER ByteOffset, - IN PLARGE_INTEGER Length, - IN PULONG Key, - IN BOOLEAN FailImmediatedly, - IN BOOLEAN ExclusiveLock - ); -/* - * FUNCTION: Locks a range of virtual memory. - * ARGUMENTS: - * ProcessHandle = Handle to the process - * BaseAddress = Lower boundary of the range of bytes to lock. - * NumberOfBytesLock = Offset to the upper boundary. - * NumberOfBytesLocked (OUT) = Number of bytes actually locked. - * REMARK: - This procedure maps to the win32 procedure VirtualLock - * RETURNS: Status [STATUS_SUCCESS | STATUS_WAS_LOCKED ] - */ -NTSTATUS -STDCALL -NtLockVirtualMemory( - HANDLE ProcessHandle, - PVOID BaseAddress, - ULONG NumberOfBytesToLock, - PULONG NumberOfBytesLocked - ); - -/* - * FUNCTION: Makes temporary object that will be removed at next boot. - * ARGUMENTS: - * Handle = Handle to object - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtMakeTemporaryObject( - IN HANDLE Handle - ); - -NTSTATUS -STDCALL -ZwMakeTemporaryObject( - IN HANDLE Handle - ); -/* - * FUNCTION: Maps a view of a section into the virtual address space of a - * process - * ARGUMENTS: - * SectionHandle = Handle of the section - * ProcessHandle = Handle of the process - * BaseAddress = Desired base address (or NULL) on entry - * Actual base address of the view on exit - * ZeroBits = Number of high order address bits that must be zero - * CommitSize = Size in bytes of the initially committed section of - * the view - * SectionOffset = Offset in bytes from the beginning of the section - * to the beginning of the view - * ViewSize = Desired length of map (or zero to map all) on entry - * Actual length mapped on exit - * InheritDisposition = Specified how the view is to be shared with - * child processes - * AllocateType = Type of allocation for the pages - * Protect = Protection for the committed region of the view - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtMapViewOfSection( - IN HANDLE SectionHandle, - IN HANDLE ProcessHandle, - IN OUT PVOID *BaseAddress, - IN ULONG ZeroBits, - IN ULONG CommitSize, - IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, - IN OUT PULONG ViewSize, - IN SECTION_INHERIT InheritDisposition, - IN ULONG AllocationType, - IN ULONG AccessProtection - ); - -NTSTATUS -STDCALL -ZwMapViewOfSection( - IN HANDLE SectionHandle, - IN HANDLE ProcessHandle, - IN OUT PVOID *BaseAddress, - IN ULONG ZeroBits, - IN ULONG CommitSize, - IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, - IN OUT PULONG ViewSize, - IN SECTION_INHERIT InheritDisposition, - IN ULONG AllocationType, - IN ULONG AccessProtection - ); - -/* - * FUNCTION: Installs a notify for the change of a directory's contents - * ARGUMENTS: - * FileHandle = Handle to the directory - Event = - * ApcRoutine = Start address - * ApcContext = Delimits the range of virtual memory - * for which the new access protection holds - * IoStatusBlock = The new access proctection for the pages - * Buffer = Caller supplies storage for resulting information --> FILE_NOTIFY_INFORMATION - * BufferSize = Size of the buffer - CompletionFilter = Can be one of the following values: - FILE_NOTIFY_CHANGE_FILE_NAME - FILE_NOTIFY_CHANGE_DIR_NAME - FILE_NOTIFY_CHANGE_NAME ( FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME ) - FILE_NOTIFY_CHANGE_ATTRIBUTES - FILE_NOTIFY_CHANGE_SIZE - FILE_NOTIFY_CHANGE_LAST_WRITE - FILE_NOTIFY_CHANGE_LAST_ACCESS - FILE_NOTIFY_CHANGE_CREATION ( change of creation timestamp ) - FILE_NOTIFY_CHANGE_EA - FILE_NOTIFY_CHANGE_SECURITY - FILE_NOTIFY_CHANGE_STREAM_NAME - FILE_NOTIFY_CHANGE_STREAM_SIZE - FILE_NOTIFY_CHANGE_STREAM_WRITE - WatchTree = If true the notify will be installed recursively on the targetdirectory and all subdirectories. - * - * REMARKS: - * The function maps to the win32 FindFirstChangeNotification, FindNextChangeNotification - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtNotifyChangeDirectoryFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG BufferSize, - IN ULONG CompletionFilter, - IN BOOLEAN WatchTree - ); - -NTSTATUS -STDCALL -ZwNotifyChangeDirectoryFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG BufferSize, - IN ULONG CompletionFilter, - IN BOOLEAN WatchTree - ); - -/* - * FUNCTION: Installs a notfication callback on registry changes - * ARGUMENTS: - KeyHandle = Handle to the registry key - Event = Event that should be signalled on modification of the key - ApcRoutine = Routine that should be called on modification of the key - ApcContext = Argument to the ApcRoutine - IoStatusBlock = ??? - CompletionFilter = Specifies the kind of notification the caller likes to receive. - Can be a combination of the following values: - - REG_NOTIFY_CHANGE_NAME - REG_NOTIFY_CHANGE_ATTRIBUTES - REG_NOTIFY_CHANGE_LAST_SET - REG_NOTIFY_CHANGE_SECURITY - - - Asynchroneous = If TRUE the changes are reported by signalling an event if false - the function will not return before a change occurs. - ChangeBuffer = Will return the old value - Length = Size of the change buffer - WatchSubtree = Indicates if the caller likes to receive a notification of changes in - sub keys or not. - * REMARKS: If the key is closed the event is signalled aswell. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtNotifyChangeKey( - IN HANDLE KeyHandle, - IN HANDLE Event, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG CompletionFilter, - IN BOOLEAN Asynchroneous, - OUT PVOID ChangeBuffer, - IN ULONG Length, - IN BOOLEAN WatchSubtree - ); - -NTSTATUS -STDCALL -ZwNotifyChangeKey( - IN HANDLE KeyHandle, - IN HANDLE Event, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG CompletionFilter, - IN BOOLEAN Asynchroneous, - OUT PVOID ChangeBuffer, - IN ULONG Length, - IN BOOLEAN WatchSubtree - ); - -/* - * FUNCTION: Opens an existing directory object - * ARGUMENTS: - * FileHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the directory - * ObjectAttributes = Initialized attributes for the object - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtOpenDirectoryObject( - OUT PHANDLE FileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -NTSTATUS -STDCALL -ZwOpenDirectoryObject( - OUT PHANDLE FileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Opens an existing event - * ARGUMENTS: - * EventHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the event - * ObjectAttributes = Initialized attributes for the object - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenEvent( - OUT PHANDLE EventHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwOpenEvent( - OUT PHANDLE EventHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Opens an existing event pair - * ARGUMENTS: - * EventHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the event - * ObjectAttributes = Initialized attributes for the object - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtOpenEventPair( - OUT PHANDLE EventPairHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwOpenEventPair( - OUT PHANDLE EventPairHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -/* - * FUNCTION: Opens an existing file - * ARGUMENTS: - * FileHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the file - * ObjectAttributes = Initialized attributes for the object - * IoStatusBlock = - * ShareAccess = - * OpenOptions = - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenFile( - OUT PHANDLE FileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG ShareAccess, - IN ULONG OpenOptions - ); - -NTSTATUS -STDCALL -ZwOpenFile( - OUT PHANDLE FileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG ShareAccess, - IN ULONG OpenOptions - ); - -/* - * FUNCTION: Opens an existing io completion object - * ARGUMENTS: - * CompletionPort (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the io completion object - * ObjectAttributes = Initialized attributes for the object - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtOpenIoCompletion( - OUT PHANDLE CompetionPort, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwOpenIoCompletion( - OUT PHANDLE CompetionPort, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Opens an existing key in the registry - * ARGUMENTS: - * KeyHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the key - * ObjectAttributes = Initialized attributes for the object - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenKey( - OUT PHANDLE KeyHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwOpenKey( - OUT PHANDLE KeyHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -/* - * FUNCTION: Opens an existing key in the registry - * ARGUMENTS: - * MutantHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the mutant - * ObjectAttribute = Initialized attributes for the object - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenMutant( - OUT PHANDLE MutantHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -NTSTATUS -STDCALL -ZwOpenMutant( - OUT PHANDLE MutantHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -NtOpenObjectAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN HANDLE ClientToken, - IN ULONG DesiredAccess, - IN ULONG GrantedAccess, - IN PPRIVILEGE_SET Privileges, - IN BOOLEAN ObjectCreation, - IN BOOLEAN AccessGranted, - OUT PBOOLEAN GenerateOnClose - ); - -/* - * FUNCTION: Opens an existing process - * ARGUMENTS: - * ProcessHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the process - * ObjectAttribute = Initialized attributes for the object - * ClientId = Identifies the process id to open - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenProcess ( - OUT PHANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PCLIENT_ID ClientId - ); -NTSTATUS -STDCALL -ZwOpenProcess ( - OUT PHANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PCLIENT_ID ClientId - ); -/* - * FUNCTION: Opens an existing process - * ARGUMENTS: - * ProcessHandle = Handle of the process of which owns the token - * DesiredAccess = Requested access to the token - * TokenHandle (OUT) = Caller supplies storage for the resulting token. - * REMARKS: - This function maps to the win32 - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtOpenProcessToken( - IN HANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE TokenHandle - ); - -NTSTATUS -STDCALL -ZwOpenProcessToken( - IN HANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE TokenHandle - ); - -/* - * FUNCTION: Opens an existing section object - * ARGUMENTS: - * KeyHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the key - * ObjectAttribute = Initialized attributes for the object - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtOpenSection( - OUT PHANDLE SectionHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -NTSTATUS -STDCALL -ZwOpenSection( - OUT PHANDLE SectionHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -/* - * FUNCTION: Opens an existing semaphore - * ARGUMENTS: - * SemaphoreHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the semaphore - * ObjectAttribute = Initialized attributes for the object - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenSemaphore( - IN HANDLE SemaphoreHandle, - IN ACCESS_MASK DesiredAcces, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -NTSTATUS -STDCALL -ZwOpenSemaphore( - IN HANDLE SemaphoreHandle, - IN ACCESS_MASK DesiredAcces, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -/* - * FUNCTION: Opens an existing symbolic link - * ARGUMENTS: - * SymbolicLinkHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the symbolic link - * ObjectAttribute = Initialized attributes for the object - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenSymbolicLinkObject( - OUT PHANDLE SymbolicLinkHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -NTSTATUS -STDCALL -ZwOpenSymbolicLinkObject( - OUT PHANDLE SymbolicLinkHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -/* - * FUNCTION: Opens an existing thread - * ARGUMENTS: - * ThreadHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the thread - * ObjectAttribute = Initialized attributes for the object - * ClientId = Identifies the thread to open. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenThread( - OUT PHANDLE ThreadHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PCLIENT_ID ClientId - ); -NTSTATUS -STDCALL -ZwOpenThread( - OUT PHANDLE ThreadHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PCLIENT_ID ClientId - ); - -NTSTATUS -STDCALL -NtOpenThreadToken( - IN HANDLE ThreadHandle, - IN ACCESS_MASK DesiredAccess, - IN BOOLEAN OpenAsSelf, - OUT PHANDLE TokenHandle - ); - -NTSTATUS -STDCALL -ZwOpenThreadToken( - IN HANDLE ThreadHandle, - IN ACCESS_MASK DesiredAccess, - IN BOOLEAN OpenAsSelf, - OUT PHANDLE TokenHandle - ); -/* - * FUNCTION: Opens an existing timer - * ARGUMENTS: - * TimerHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the timer - * ObjectAttribute = Initialized attributes for the object - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenTimer( - OUT PHANDLE TimerHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -NTSTATUS -STDCALL -ZwOpenTimer( - OUT PHANDLE TimerHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Checks an access token for specific privileges - * ARGUMENTS: - * ClientToken = Handle to a access token structure - * RequiredPrivileges = Specifies the requested privileges. - * Result = Caller supplies storage for the result. If PRIVILEGE_SET_ALL_NECESSARY is - set in the Control member of PRIVILEGES_SET Result - will only be TRUE if all privileges are present in the access token. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtPrivilegeCheck( - IN HANDLE ClientToken, - IN PPRIVILEGE_SET RequiredPrivileges, - IN PBOOLEAN Result - ); - -NTSTATUS -STDCALL -ZwPrivilegeCheck( - IN HANDLE ClientToken, - IN PPRIVILEGE_SET RequiredPrivileges, - IN PBOOLEAN Result - ); - -NTSTATUS -STDCALL -NtPrivilegedServiceAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PUNICODE_STRING ServiceName, - IN HANDLE ClientToken, - IN PPRIVILEGE_SET Privileges, - IN BOOLEAN AccessGranted - ); - -NTSTATUS -STDCALL -ZwPrivilegedServiceAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PUNICODE_STRING ServiceName, - IN HANDLE ClientToken, - IN PPRIVILEGE_SET Privileges, - IN BOOLEAN AccessGranted - ); - -NTSTATUS -STDCALL -NtPrivilegeObjectAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN HANDLE ClientToken, - IN ULONG DesiredAccess, - IN PPRIVILEGE_SET Privileges, - IN BOOLEAN AccessGranted - ); - -NTSTATUS -STDCALL -ZwPrivilegeObjectAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN HANDLE ClientToken, - IN ULONG DesiredAccess, - IN PPRIVILEGE_SET Privileges, - IN BOOLEAN AccessGranted - ); - -/* - * FUNCTION: Entry point for native applications - * ARGUMENTS: - * Peb = Pointes to the Process Environment Block (PEB) - * REMARKS: - * Native applications should use this function instead of a main. - * Calling proces should terminate itself. - * RETURNS: Status - */ -VOID -NtProcessStartup( - IN PPEB Peb - ); - -/* - * FUNCTION: Set the access protection of a range of virtual memory - * ARGUMENTS: - * ProcessHandle = Handle to process owning the virtual address space - * BaseAddress = Start address - * NumberOfBytesToProtect = Delimits the range of virtual memory - * for which the new access protection holds - * NewAccessProtection = The new access proctection for the pages - * OldAccessProtection = Caller should supply storage for the old - * access protection - * - * REMARKS: - * The function maps to the win32 VirtualProtectEx - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtProtectVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN ULONG NumberOfBytesToProtect, - IN ULONG NewAccessProtection, - OUT PULONG OldAccessProtection - ); - -/* - * FUNCTION: Signals an event and resets it afterwards. - * ARGUMENTS: - * EventHandle = Handle to the event - * PulseCount = Number of times the action is repeated - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtPulseEvent( - IN HANDLE EventHandle, - IN PULONG PulseCount OPTIONAL - ); - -NTSTATUS -STDCALL -ZwPulseEvent( - IN HANDLE EventHandle, - IN PULONG PulseCount OPTIONAL - ); - -NTSTATUS -STDCALL -NtQueryAttributesFile( - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PFILE_BASIC_INFORMATION FileInformation); - -NTSTATUS -STDCALL -ZwQueryAttributesFile( - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PFILE_BASIC_INFORMATION FileInformation); - -/* - * FUNCTION: Queries the default locale id - * ARGUMENTS: - * UserProfile = Type of locale id - * TRUE: thread locale id - * FALSE: system locale id - * DefaultLocaleId = Caller supplies storage for the locale id - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtQueryDefaultLocale( - IN BOOLEAN UserProfile, - OUT PLCID DefaultLocaleId - ); - -NTSTATUS -STDCALL -ZwQueryDefaultLocale( - IN BOOLEAN UserProfile, - OUT PLCID DefaultLocaleId - ); - -/* - * FUNCTION: Queries a directory file. - * ARGUMENTS: - * FileHandle = Handle to a directory file - * EventHandle = Handle to the event signaled on completion - * ApcRoutine = Asynchroneous procedure callback, called on completion - * ApcContext = Argument to the apc. - * IoStatusBlock = Caller supplies storage for extended status information. - * FileInformation = Caller supplies storage for the resulting information. - * - * FileNameInformation FILE_NAMES_INFORMATION - * FileDirectoryInformation FILE_DIRECTORY_INFORMATION - * FileFullDirectoryInformation FILE_FULL_DIRECTORY_INFORMATION - * FileBothDirectoryInformation FILE_BOTH_DIR_INFORMATION - * - * Length = Size of the storage supplied - * FileInformationClass = Indicates the type of information requested. - * ReturnSingleEntry = Specify true if caller only requests the first directory found. - * FileName = Initial directory name to query, that may contain wild cards. - * RestartScan = Number of times the action should be repeated - * RETURNS: Status [ STATUS_SUCCESS, STATUS_ACCESS_DENIED, STATUS_INSUFFICIENT_RESOURCES, - * STATUS_INVALID_PARAMETER, STATUS_INVALID_DEVICE_REQUEST, STATUS_BUFFER_OVERFLOW, - * STATUS_INVALID_INFO_CLASS, STATUS_NO_SUCH_FILE, STATUS_NO_MORE_FILES ] - */ - -NTSTATUS -STDCALL -NtQueryDirectoryFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass, - IN BOOLEAN ReturnSingleEntry, - IN PUNICODE_STRING FileName OPTIONAL, - IN BOOLEAN RestartScan - ); - -NTSTATUS -STDCALL -ZwQueryDirectoryFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass, - IN BOOLEAN ReturnSingleEntry, - IN PUNICODE_STRING FileName OPTIONAL, - IN BOOLEAN RestartScan - ); - -/* - * FUNCTION: Query information about the content of a directory object - * ARGUMENTS: - DirObjInformation = Buffer must be large enough to hold the name strings too - GetNextIndex = If TRUE :return the index of the next object in this directory in ObjectIndex - If FALSE: return the number of objects in this directory in ObjectIndex - IgnoreInputIndex= If TRUE: ignore input value of ObjectIndex always start at index 0 - If FALSE use input value of ObjectIndex - ObjectIndex = zero based index of object in the directory depends on GetNextIndex and IgnoreInputIndex - DataWritten = Actual size of the ObjectIndex ??? - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtQueryDirectoryObject( - IN HANDLE DirObjHandle, - OUT POBJDIR_INFORMATION DirObjInformation, - IN ULONG BufferLength, - IN BOOLEAN GetNextIndex, - IN BOOLEAN IgnoreInputIndex, - IN OUT PULONG ObjectIndex, - OUT PULONG DataWritten OPTIONAL - ); - -/* - * FUNCTION: Queries the extended attributes of a file - * ARGUMENTS: - * FileHandle = Handle to the event - * IoStatusBlock = Number of times the action is repeated - * Buffer - * Length - * ReturnSingleEntry - * EaList - * EaListLength - * EaIndex - * RestartScan - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtQueryEaFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG Length, - IN BOOLEAN ReturnSingleEntry, - IN PVOID EaList OPTIONAL, - IN ULONG EaListLength, - IN PULONG EaIndex OPTIONAL, - IN BOOLEAN RestartScan - ); - -NTSTATUS -STDCALL -ZwQueryEaFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG Length, - IN BOOLEAN ReturnSingleEntry, - IN PVOID EaList OPTIONAL, - IN ULONG EaListLength, - IN PULONG EaIndex OPTIONAL, - IN BOOLEAN RestartScan - ); - -/* - * FUNCTION: Queries an event - * ARGUMENTS: - * EventHandle = Handle to the event - * EventInformationClass = Index of the information structure - - EventBasicInformation EVENT_BASIC_INFORMATION - - * EventInformation = Caller supplies storage for the information structure - * EventInformationLength = Size of the information structure - * ReturnLength = Data written - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtQueryEvent( - IN HANDLE EventHandle, - IN EVENT_INFORMATION_CLASS EventInformationClass, - OUT PVOID EventInformation, - IN ULONG EventInformationLength, - OUT PULONG ReturnLength - ); -NTSTATUS -STDCALL -ZwQueryEvent( - IN HANDLE EventHandle, - IN EVENT_INFORMATION_CLASS EventInformationClass, - OUT PVOID EventInformation, - IN ULONG EventInformationLength, - OUT PULONG ReturnLength - ); - -NTSTATUS -STDCALL -NtQueryFullAttributesFile( - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PFILE_NETWORK_OPEN_INFORMATION FileInformation); - -NTSTATUS -STDCALL -ZwQueryFullAttributesFile( - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PFILE_NETWORK_OPEN_INFORMATION FileInformation); - -NTSTATUS -STDCALL -NtQueryInformationAtom( - IN RTL_ATOM Atom, - IN ATOM_INFORMATION_CLASS AtomInformationClass, - OUT PVOID AtomInformation, - IN ULONG AtomInformationLength, - OUT PULONG ReturnLength OPTIONAL - ); - -NTSTATUS -STDCALL -NtQueryInformationFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass - ); - -NTSTATUS -STDCALL -ZwQueryInformationFile( - HANDLE FileHandle, - PIO_STATUS_BLOCK IoStatusBlock, - PVOID FileInformation, - ULONG Length, - FILE_INFORMATION_CLASS FileInformationClass - ); - -/* - * FUNCTION: Queries the information of a thread object. - * ARGUMENTS: - * ThreadHandle = Handle to the thread object - * ThreadInformationClass = Index to a certain information structure - - ThreadBasicInformation THREAD_BASIC_INFORMATION - ThreadTimes KERNEL_USER_TIMES - ThreadPriority KPRIORITY - ThreadBasePriority KPRIORITY - ThreadAffinityMask KAFFINITY - ThreadImpersonationToken - ThreadDescriptorTableEntry - ThreadEnableAlignmentFaultFixup - ThreadEventPair - ThreadQuerySetWin32StartAddress - ThreadZeroTlsCell - ThreadPerformanceCount - ThreadAmILastThread BOOLEAN - ThreadIdealProcessor ULONG - ThreadPriorityBoost ULONG - MaxThreadInfoClass - - - * ThreadInformation = Caller supplies torage for the thread information - * ThreadInformationLength = Size of the thread information structure - * ReturnLength = Actual number of bytes written - - * REMARK: - * This procedure maps to the win32 GetThreadTimes, GetThreadPriority, - GetThreadPriorityBoost functions. - * RETURNS: Status -*/ - - -NTSTATUS -STDCALL -NtQueryInformationThread( - IN HANDLE ThreadHandle, - IN THREADINFOCLASS ThreadInformationClass, - OUT PVOID ThreadInformation, - IN ULONG ThreadInformationLength, - OUT PULONG ReturnLength - ); - - -NTSTATUS -STDCALL -NtQueryInformationToken( - IN HANDLE TokenHandle, - IN TOKEN_INFORMATION_CLASS TokenInformationClass, - OUT PVOID TokenInformation, - IN ULONG TokenInformationLength, - OUT PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwQueryInformationToken( - IN HANDLE TokenHandle, - IN TOKEN_INFORMATION_CLASS TokenInformationClass, - OUT PVOID TokenInformation, - IN ULONG TokenInformationLength, - OUT PULONG ReturnLength - ); - -/* - * FUNCTION: Query the interval and the clocksource for profiling - * ARGUMENTS: - Interval = - ClockSource = - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtQueryIntervalProfile( - OUT PULONG Interval, - OUT KPROFILE_SOURCE ClockSource - ); - -NTSTATUS -STDCALL -NtQueryIoCompletion( - IN HANDLE CompletionPort, - IN ULONG CompletionKey, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PULONG NumberOfBytesTransferred - ); -NTSTATUS -STDCALL -ZwQueryIoCompletion( - IN HANDLE CompletionPort, - IN ULONG CompletionKey, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PULONG NumberOfBytesTransferred - ); - - -/* - * FUNCTION: Queries the information of a registry key object. - * ARGUMENTS: - KeyHandle = Handle to a registry key - KeyInformationClass = Index to a certain information structure - KeyInformation = Caller supplies storage for resulting information - Length = Size of the supplied storage - ResultLength = Bytes written - */ -NTSTATUS -STDCALL -NtQueryKey( - IN HANDLE KeyHandle, - IN KEY_INFORMATION_CLASS KeyInformationClass, - OUT PVOID KeyInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwQueryKey( - IN HANDLE KeyHandle, - IN KEY_INFORMATION_CLASS KeyInformationClass, - OUT PVOID KeyInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - - -// draft - -NTSTATUS -STDCALL -NtQueryMultipleValueKey( - IN HANDLE KeyHandle, - IN OUT PKEY_VALUE_ENTRY ValueList, - IN ULONG NumberOfValues, - OUT PVOID Buffer, - IN OUT PULONG Length, - OUT PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwQueryMultipleValueKey( - IN HANDLE KeyHandle, - IN OUT PKEY_VALUE_ENTRY ValueList, - IN ULONG NumberOfValues, - OUT PVOID Buffer, - IN OUT PULONG Length, - OUT PULONG ReturnLength - ); - -/* - * FUNCTION: Queries the information of a mutant object. - * ARGUMENTS: - MutantHandle = Handle to a mutant - MutantInformationClass = Index to a certain information structure - MutantInformation = Caller supplies storage for resulting information - Length = Size of the supplied storage - ResultLength = Bytes written - */ -NTSTATUS -STDCALL -NtQueryMutant( - IN HANDLE MutantHandle, - IN CINT MutantInformationClass, - OUT PVOID MutantInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwQueryMutant( - IN HANDLE MutantHandle, - IN CINT MutantInformationClass, - OUT PVOID MutantInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); -/* - * FUNCTION: Queries the information of a object. - * ARGUMENTS: - ObjectHandle = Handle to a object - ObjectInformationClass = Index to a certain information structure - - ObjectBasicInformation - ObjectTypeInformation OBJECT_TYPE_INFORMATION - ObjectNameInformation OBJECT_NAME_INFORMATION - ObjectDataInformation OBJECT_DATA_INFORMATION - - ObjectInformation = Caller supplies storage for resulting information - Length = Size of the supplied storage - ResultLength = Bytes written - */ - -NTSTATUS -STDCALL -NtQueryObject( - IN HANDLE ObjectHandle, - IN CINT ObjectInformationClass, - OUT PVOID ObjectInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -/* - * FUNCTION: Queries the system ( high-resolution ) performance counter. - * ARGUMENTS: - * Counter = Performance counter - * Frequency = Performance frequency - * REMARKS: - This procedure queries a tick count faster than 10ms ( The resolution for Intel®-based CPUs is about 0.8 microseconds.) - This procedure maps to the win32 QueryPerformanceCounter, QueryPerformanceFrequency - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQueryPerformanceCounter( - IN PLARGE_INTEGER Counter, - IN PLARGE_INTEGER Frequency - ); - -NTSTATUS -STDCALL -ZwQueryPerformanceCounter( - IN PLARGE_INTEGER Counter, - IN PLARGE_INTEGER Frequency - ); -/* - * FUNCTION: Queries the information of a section object. - * ARGUMENTS: - * SectionHandle = Handle to the section link object - * SectionInformationClass = Index to a certain information structure - * SectionInformation (OUT)= Caller supplies storage for resulting information - * Length = Size of the supplied storage - * ResultLength = Data written - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQuerySection( - IN HANDLE SectionHandle, - IN CINT SectionInformationClass, - OUT PVOID SectionInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -/* - * FUNCTION: Queries the information of a semaphore. - * ARGUMENTS: - * SemaphoreHandle = Handle to the semaphore object - * SemaphoreInformationClass = Index to a certain information structure - - SemaphoreBasicInformation SEMAPHORE_BASIC_INFORMATION - - * SemaphoreInformation = Caller supplies storage for the semaphore information structure - * Length = Size of the infomation structure - */ -NTSTATUS -STDCALL -NtQuerySemaphore( - IN HANDLE SemaphoreHandle, - IN SEMAPHORE_INFORMATION_CLASS SemaphoreInformationClass, - OUT PVOID SemaphoreInformation, - IN ULONG Length, - OUT PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwQuerySemaphore( - IN HANDLE SemaphoreHandle, - IN SEMAPHORE_INFORMATION_CLASS SemaphoreInformationClass, - OUT PVOID SemaphoreInformation, - IN ULONG Length, - OUT PULONG ReturnLength - ); - - -/* - * FUNCTION: Queries the information of a symbolic link object. - * ARGUMENTS: - * SymbolicLinkHandle = Handle to the symbolic link object - * LinkTarget = resolved name of link - * DataWritten = size of the LinkName. - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQuerySymbolicLinkObject( - IN HANDLE SymLinkObjHandle, - OUT PUNICODE_STRING LinkTarget, - OUT PULONG DataWritten OPTIONAL - ); - -NTSTATUS -STDCALL -ZwQuerySymbolicLinkObject( - IN HANDLE SymLinkObjHandle, - OUT PUNICODE_STRING LinkName, - OUT PULONG DataWritten OPTIONAL - ); - - -/* - * FUNCTION: Queries a system environment variable. - * ARGUMENTS: - * Name = Name of the variable - * Value (OUT) = value of the variable - * Length = size of the buffer - * ReturnLength = data written - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQuerySystemEnvironmentValue( - IN PUNICODE_STRING Name, - OUT PVOID Value, - ULONG Length, - PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwQuerySystemEnvironmentValue( - IN PUNICODE_STRING Name, - OUT PVOID Value, - ULONG Length, - PULONG ReturnLength - ); - - -/* - * FUNCTION: Queries the system information. - * ARGUMENTS: - * SystemInformationClass = Index to a certain information structure - - SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT - SystemCacheInformation SYSTEM_CACHE_INFORMATION - SystemConfigurationInformation CONFIGURATION_INFORMATION - - * SystemInformation = caller supplies storage for the information structure - * Length = size of the structure - ResultLength = Data written - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQuerySystemInformation( - IN SYSTEM_INFORMATION_CLASS SystemInformationClass, - OUT PVOID SystemInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwQuerySystemInformation( - IN SYSTEM_INFORMATION_CLASS SystemInformationClass, - OUT PVOID SystemInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -/* - * FUNCTION: Retrieves the system time - * ARGUMENTS: - * CurrentTime (OUT) = Caller should supply storage for the resulting time. - * RETURNS: Status - * -*/ - -NTSTATUS -STDCALL -NtQuerySystemTime ( - OUT TIME *CurrentTime - ); - -/* - * FUNCTION: Queries information about a timer - * ARGUMENTS: - * TimerHandle = Handle to the timer - TimerValueInformationClass = Index to a certain information structure - TimerValueInformation = Caller supplies storage for the information structure - Length = Size of the information structure - ResultLength = Data written - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQueryTimer( - IN HANDLE TimerHandle, - IN CINT TimerInformationClass, - OUT PVOID TimerInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); -NTSTATUS -STDCALL -ZwQueryTimer( - IN HANDLE TimerHandle, - IN CINT TimerInformationClass, - OUT PVOID TimerInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -/* - * FUNCTION: Queries the timer resolution - * ARGUMENTS: - * MinimumResolution (OUT) = Caller should supply storage for the resulting time. - Maximum Resolution (OUT) = Caller should supply storage for the resulting time. - ActualResolution (OUT) = Caller should supply storage for the resulting time. - * RETURNS: Status - * -*/ - - -NTSTATUS -STDCALL -NtQueryTimerResolution ( - OUT PULONG MinimumResolution, - OUT PULONG MaximumResolution, - OUT PULONG ActualResolution - ); - -NTSTATUS -STDCALL -ZwQueryTimerResolution ( - OUT PULONG MinimumResolution, - OUT PULONG MaximumResolution, - OUT PULONG ActualResolution - ); - -/* - * FUNCTION: Queries a registry key value - * ARGUMENTS: - * KeyHandle = Handle to the registry key - ValueName = Name of the value in the registry key - KeyValueInformationClass = Index to a certain information structure - - KeyValueBasicInformation = KEY_VALUE_BASIC_INFORMATION - KeyValueFullInformation = KEY_FULL_INFORMATION - KeyValuePartialInformation = KEY_VALUE_PARTIAL_INFORMATION - - KeyValueInformation = Caller supplies storage for the information structure - Length = Size of the information structure - ResultLength = Data written - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQueryValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName, - IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - OUT PVOID KeyValueInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwQueryValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName, - IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - OUT PVOID KeyValueInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - - - - -/* - * FUNCTION: Queries the virtual memory information. - * ARGUMENTS: - ProcessHandle = Process owning the virtual address space - BaseAddress = Points to the page where the information is queried for. - * VirtualMemoryInformationClass = Index to a certain information structure - - MemoryBasicInformation MEMORY_BASIC_INFORMATION - - * VirtualMemoryInformation = caller supplies storage for the information structure - * Length = size of the structure - ResultLength = Data written - * RETURNS: Status - * -*/ - -NTSTATUS -STDCALL -NtQueryVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID Address, - IN IN CINT VirtualMemoryInformationClass, - OUT PVOID VirtualMemoryInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -/* - * FUNCTION: Queries the volume information - * ARGUMENTS: - * FileHandle = Handle to a file object on the target volume - * IoStatusBlock = Caller should supply storage for additional status information - * ReturnLength = DataWritten - * FsInformation = Caller should supply storage for the information structure. - * Length = Size of the information structure - * FsInformationClass = Index to a information structure - - FileFsVolumeInformation FILE_FS_VOLUME_INFORMATION - FileFsLabelInformation FILE_FS_LABEL_INFORMATION - FileFsSizeInformation FILE_FS_SIZE_INFORMATION - FileFsDeviceInformation FILE_FS_DEVICE_INFORMATION - FileFsAttributeInformation FILE_FS_ATTRIBUTE_INFORMATION - FileFsControlInformation - FileFsQuotaQueryInformation -- - FileFsQuotaSetInformation -- - FileFsMaximumInformation - - * RETURNS: Status [ STATUS_SUCCESS | STATUS_INSUFFICIENT_RESOURCES | STATUS_INVALID_PARAMETER | - STATUS_INVALID_DEVICE_REQUEST | STATUS_BUFFER_OVERFLOW ] - * -*/ -NTSTATUS -STDCALL -NtQueryVolumeInformationFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID FsInformation, - IN ULONG Length, - IN FS_INFORMATION_CLASS FsInformationClass - ); - -NTSTATUS -STDCALL -ZwQueryVolumeInformationFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID FsInformation, - IN ULONG Length, - IN FS_INFORMATION_CLASS FsInformationClass - ); -// draft -// FIXME: Should I specify if the apc is user or kernel mode somewhere ?? -/* - * FUNCTION: Queues a (user) apc to a thread. - * ARGUMENTS: - ThreadHandle = Thread to which the apc is queued. - ApcRoutine = Points to the apc routine - NormalContext = Argument to Apc Routine - * SystemArgument1 = Argument of the Apc Routine - SystemArgument2 = Argument of the Apc Routine - * REMARK: If the apc is queued against a thread of a different process than the calling thread - the apc routine should be specified in the address space of the queued thread's process. - * RETURNS: Status -*/ - -NTSTATUS -STDCALL -NtQueueApcThread( - HANDLE ThreadHandle, - PKNORMAL_ROUTINE ApcRoutine, - PVOID NormalContext, - PVOID SystemArgument1, - PVOID SystemArgument2); - -NTSTATUS -STDCALL -ZwQueueApcThread( - HANDLE ThreadHandle, - PKNORMAL_ROUTINE ApcRoutine, - PVOID NormalContext, - PVOID SystemArgument1, - PVOID SystemArgument2); - - -/* - * FUNCTION: Raises an exception - * ARGUMENTS: - * ExceptionRecord = Structure specifying the exception - * Context = Context in which the excpetion is raised - * IsDebugger = - * RETURNS: Status - * -*/ - -NTSTATUS -STDCALL -NtRaiseException( - IN PEXCEPTION_RECORD ExceptionRecord, - IN PCONTEXT Context, - IN BOOLEAN SearchFrames - ); - -NTSTATUS -STDCALL -ZwRaiseException( - IN PEXCEPTION_RECORD ExceptionRecord, - IN PCONTEXT Context, - IN BOOLEAN SearchFrames - ); - -/* - * FUNCTION: Raises a hard error (stops the system) - * ARGUMENTS: - * Status = Status code of the hard error - * Unknown2 = ?? - * Unknown3 = ?? - * Unknown4 = ?? - * Unknown5 = ?? - * Unknown6 = ?? - * RETURNS: Status - * - */ - -NTSTATUS -STDCALL -NtRaiseHardError( - IN NTSTATUS Status, - ULONG Unknown2, - ULONG Unknown3, - ULONG Unknown4, - ULONG Unknown5, - ULONG Unknown6 - ); - -/* - * FUNCTION: Read a file - * ARGUMENTS: - * FileHandle = Handle of a file to read - * Event = This event is signalled when the read operation completes - * UserApcRoutine = Call back , if supplied Event should be NULL - * UserApcContext = Argument to the callback - * IoStatusBlock = Caller should supply storage for additional status information - * Buffer = Caller should supply storage to receive the information - * BufferLength = Size of the buffer - * ByteOffset = Offset to start reading the file - * Key = If a range is lock a matching key will allow the read to continue. - * RETURNS: Status - * - */ - -NTSTATUS -STDCALL -NtReadFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset OPTIONAL, - IN PULONG Key OPTIONAL - ); - -NTSTATUS -STDCALL -ZwReadFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset OPTIONAL, - IN PULONG Key OPTIONAL - ); -/* - * FUNCTION: Read a file using scattered io - * ARGUMENTS: - FileHandle = Handle of a file to read - Event = This event is signalled when the read operation completes - * UserApcRoutine = Call back , if supplied Event should be NULL - UserApcContext = Argument to the callback - IoStatusBlock = Caller should supply storage for additional status information - BufferDescription = Caller should supply storage to receive the information - BufferLength = Size of the buffer - ByteOffset = Offset to start reading the file - Key = Key = If a range is lock a matching key will allow the read to continue. - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtReadFileScatter( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK UserIoStatusBlock, - IN FILE_SEGMENT_ELEMENT BufferDescription[], - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); - -NTSTATUS -STDCALL -ZwReadFileScatter( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK UserIoStatusBlock, - IN FILE_SEGMENT_ELEMENT BufferDescription[], - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); -/* - * FUNCTION: Copies a range of virtual memory to a buffer - * ARGUMENTS: - * ProcessHandle = Specifies the process owning the virtual address space - * BaseAddress = Points to the address of virtual memory to start the read - * Buffer = Caller supplies storage to copy the virtual memory to. - * NumberOfBytesToRead = Limits the range to read - * NumberOfBytesRead = The actual number of bytes read. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtReadVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - OUT PVOID Buffer, - IN ULONG NumberOfBytesToRead, - OUT PULONG NumberOfBytesRead - ); -NTSTATUS -STDCALL -ZwReadVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - OUT PVOID Buffer, - IN ULONG NumberOfBytesToRead, - OUT PULONG NumberOfBytesRead - ); - - -/* - * FUNCTION: Debugger can register for thread termination - * ARGUMENTS: - * TerminationPort = Port on which the debugger likes to be notified. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtRegisterThreadTerminatePort( - HANDLE TerminationPort - ); -NTSTATUS -STDCALL -ZwRegisterThreadTerminatePort( - HANDLE TerminationPort - ); - -/* - * FUNCTION: Releases a mutant - * ARGUMENTS: - * MutantHandle = Handle to the mutant - * ReleaseCount = - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtReleaseMutant( - IN HANDLE MutantHandle, - IN PULONG ReleaseCount OPTIONAL - ); - -NTSTATUS -STDCALL -ZwReleaseMutant( - IN HANDLE MutantHandle, - IN PULONG ReleaseCount OPTIONAL - ); - -/* - * FUNCTION: Releases a semaphore - * ARGUMENTS: - * SemaphoreHandle = Handle to the semaphore object - * ReleaseCount = Number to decrease the semaphore count - * PreviousCount = Previous semaphore count - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtReleaseSemaphore( - IN HANDLE SemaphoreHandle, - IN LONG ReleaseCount, - OUT PLONG PreviousCount - ); - -NTSTATUS -STDCALL -ZwReleaseSemaphore( - IN HANDLE SemaphoreHandle, - IN LONG ReleaseCount, - OUT PLONG PreviousCount - ); - -/* - * FUNCTION: Removes an io completion - * ARGUMENTS: - * CompletionPort (OUT) = Caller supplied storage for the resulting handle - * CompletionKey = Requested access to the key - * IoStatusBlock = Caller provides storage for extended status information - * CompletionStatus = Current status of the io operation. - * WaitTime = Time to wait if .. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtRemoveIoCompletion( - IN HANDLE CompletionPort, - OUT PULONG CompletionKey, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PULONG CompletionStatus, - IN PLARGE_INTEGER WaitTime - ); - -NTSTATUS -STDCALL -ZwRemoveIoCompletion( - IN HANDLE CompletionPort, - OUT PULONG CompletionKey, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PULONG CompletionStatus, - IN PLARGE_INTEGER WaitTime - ); -/* - * FUNCTION: Replaces one registry key with another - * ARGUMENTS: - * ObjectAttributes = Specifies the attributes of the key - * Key = Handle to the key - * ReplacedObjectAttributes = The function returns the old object attributes - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtReplaceKey( - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN HANDLE Key, - IN POBJECT_ATTRIBUTES ReplacedObjectAttributes - ); -NTSTATUS -STDCALL -ZwReplaceKey( - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN HANDLE Key, - IN POBJECT_ATTRIBUTES ReplacedObjectAttributes - ); - -/* - * FUNCTION: Resets a event to a non signaled state - * ARGUMENTS: - * EventHandle = Handle to the event that should be reset - * NumberOfWaitingThreads = The number of threads released. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtResetEvent( - HANDLE EventHandle, - PULONG NumberOfWaitingThreads OPTIONAL - ); -NTSTATUS -STDCALL -ZwResetEvent( - HANDLE EventHandle, - PULONG NumberOfWaitingThreads OPTIONAL - ); -//draft -NTSTATUS -STDCALL -NtRestoreKey( - HANDLE KeyHandle, - HANDLE FileHandle, - ULONG RestoreFlags - ); - -NTSTATUS -STDCALL -ZwRestoreKey( - HANDLE KeyHandle, - HANDLE FileHandle, - ULONG RestoreFlags - ); -/* - * FUNCTION: Decrements a thread's resume count - * ARGUMENTS: - * ThreadHandle = Handle to the thread that should be resumed - * ResumeCount = The resulting resume count. - * REMARK: - * A thread is resumed if its suspend count is 0. This procedure maps to - * the win32 ResumeThread function. ( documentation about the the suspend count can be found here aswell ) - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtResumeThread( - IN HANDLE ThreadHandle, - OUT PULONG SuspendCount - ); -NTSTATUS -STDCALL -ZwResumeThread( - IN HANDLE ThreadHandle, - OUT PULONG SuspendCount - ); -/* - * FUNCTION: Writes the content of a registry key to ascii file - * ARGUMENTS: - * KeyHandle = Handle to the key - * FileHandle = Handle of the file - * REMARKS: - This function maps to the Win32 RegSaveKey. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtSaveKey( - IN HANDLE KeyHandle, - IN HANDLE FileHandle - ); -NTSTATUS -STDCALL -ZwSaveKey( - IN HANDLE KeyHandle, - IN HANDLE FileHandle - ); - -/* - * FUNCTION: Sets the context of a specified thread. - * ARGUMENTS: - * ThreadHandle = Handle to the thread - * Context = The processor context. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtSetContextThread( - IN HANDLE ThreadHandle, - IN PCONTEXT Context - ); -NTSTATUS -STDCALL -ZwSetContextThread( - IN HANDLE ThreadHandle, - IN PCONTEXT Context - ); - -/* - * FUNCTION: Sets the default locale id - * ARGUMENTS: - * UserProfile = Type of locale id - * TRUE: thread locale id - * FALSE: system locale id - * DefaultLocaleId = Locale id - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtSetDefaultLocale( - IN BOOLEAN UserProfile, - IN LCID DefaultLocaleId - ); - -NTSTATUS -STDCALL -ZwSetDefaultLocale( - IN BOOLEAN UserProfile, - IN LCID DefaultLocaleId - ); - -/* - * FUNCTION: Sets the default hard error port - * ARGUMENTS: - * PortHandle = Handle to the port - * NOTE: The hard error port is used for first change exception handling - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtSetDefaultHardErrorPort( - IN HANDLE PortHandle - ); -NTSTATUS -STDCALL -ZwSetDefaultHardErrorPort( - IN HANDLE PortHandle - ); - -/* - * FUNCTION: Sets the extended attributes of a file. - * ARGUMENTS: - * FileHandle = Handle to the file - * IoStatusBlock = Storage for a resulting status and information - * on the current operation. - * EaBuffer = Extended Attributes buffer. - * EaBufferSize = Size of the extended attributes buffer - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtSetEaFile( - IN HANDLE FileHandle, - IN PIO_STATUS_BLOCK IoStatusBlock, - PVOID EaBuffer, - ULONG EaBufferSize - ); -NTSTATUS -STDCALL -ZwSetEaFile( - IN HANDLE FileHandle, - IN PIO_STATUS_BLOCK IoStatusBlock, - PVOID EaBuffer, - ULONG EaBufferSize - ); - -//FIXME: should I return the event state ? - -/* - * FUNCTION: Sets the event to a signalled state. - * ARGUMENTS: - * EventHandle = Handle to the event - * NumberOfThreadsReleased = The number of threads released - * REMARK: - * This procedure maps to the win32 SetEvent function. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtSetEvent( - IN HANDLE EventHandle, - PULONG NumberOfThreadsReleased - ); - -NTSTATUS -STDCALL -ZwSetEvent( - IN HANDLE EventHandle, - PULONG NumberOfThreadsReleased - ); - -/* - * FUNCTION: Sets the high part of an event pair - * ARGUMENTS: - EventPair = Handle to the event pair - * RETURNS: Status -*/ - -NTSTATUS -STDCALL -NtSetHighEventPair( - IN HANDLE EventPairHandle - ); - -NTSTATUS -STDCALL -ZwSetHighEventPair( - IN HANDLE EventPairHandle - ); -/* - * FUNCTION: Sets the high part of an event pair and wait for the low part - * ARGUMENTS: - EventPair = Handle to the event pair - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetHighWaitLowEventPair( - IN HANDLE EventPairHandle - ); -NTSTATUS -STDCALL -ZwSetHighWaitLowEventPair( - IN HANDLE EventPairHandle - ); - -/* - * FUNCTION: Sets the information of a file object. - * ARGUMENTS: - * FileHandle = Handle to the file object - * IoStatusBlock = Caller supplies storage for extended information - * on the current operation. - * FileInformation = Storage for the new file information - * Lenght = Size of the new file information. - * FileInformationClass = Indicates to a certain information structure - - FileNameInformation FILE_NAME_INFORMATION - FileRenameInformation FILE_RENAME_INFORMATION - FileStreamInformation FILE_STREAM_INFORMATION - * FileCompletionInformation IO_COMPLETION_CONTEXT - - * REMARK: - * This procedure maps to the win32 SetEndOfFile, SetFileAttributes, - * SetNamedPipeHandleState, SetMailslotInfo functions. - * RETURNS: Status - */ - - -NTSTATUS -STDCALL -NtSetInformationFile( - IN HANDLE FileHandle, - IN PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass - ); -NTSTATUS -STDCALL -ZwSetInformationFile( - IN HANDLE FileHandle, - IN PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass - ); - - - -/* - * FUNCTION: Sets the information of a registry key. - * ARGUMENTS: - * KeyHandle = Handle to the registry key - * KeyInformationClass = Index to the a certain information structure. - Can be one of the following values: - - * KeyWriteTimeInformation KEY_WRITE_TIME_INFORMATION - - KeyInformation = Storage for the new information - * KeyInformationLength = Size of the information strucure - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtSetInformationKey( - IN HANDLE KeyHandle, - IN CINT KeyInformationClass, - IN PVOID KeyInformation, - IN ULONG KeyInformationLength - ); - -/* - * FUNCTION: Changes a set of thread specific parameters - * ARGUMENTS: - * ThreadHandle = Handle to the thread - * ThreadInformationClass = Index to the set of parameters to change. - * Can be one of the following values: - * - * ThreadBasicInformation THREAD_BASIC_INFORMATION - * ThreadPriority KPRIORITY //??? - * ThreadBasePriority KPRIORITY - * ThreadAffinityMask KAFFINITY //?? - * ThreadImpersonationToken ACCESS_TOKEN - * ThreadIdealProcessor ULONG - * ThreadPriorityBoost ULONG - * - * ThreadInformation = Caller supplies storage for parameters to set. - * ThreadInformationLength = Size of the storage supplied - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetInformationThread( - IN HANDLE ThreadHandle, - IN THREADINFOCLASS ThreadInformationClass, - IN PVOID ThreadInformation, - IN ULONG ThreadInformationLength - ); -NTSTATUS -STDCALL -ZwSetInformationThread( - IN HANDLE ThreadHandle, - IN THREADINFOCLASS ThreadInformationClass, - IN PVOID ThreadInformation, - IN ULONG ThreadInformationLength - ); - -/* - * FUNCTION: Changes a set of token specific parameters - * ARGUMENTS: - * TokenHandle = Handle to the token - * TokenInformationClass = Index to a certain information structure. - * Can be one of the following values: - * - TokenUser TOKEN_USER - TokenGroups TOKEN_GROUPS - TokenPrivileges TOKEN_PRIVILEGES - TokenOwner TOKEN_OWNER - TokenPrimaryGroup TOKEN_PRIMARY_GROUP - TokenDefaultDacl TOKEN_DEFAULT_DACL - TokenSource TOKEN_SOURCE - TokenType TOKEN_TYPE - TokenImpersonationLevel TOKEN_IMPERSONATION_LEVEL - TokenStatistics TOKEN_STATISTICS - * - * TokenInformation = Caller supplies storage for information structure. - * TokenInformationLength = Size of the information structure - * RETURNS: Status -*/ - -NTSTATUS -STDCALL -NtSetInformationToken( - IN HANDLE TokenHandle, - IN TOKEN_INFORMATION_CLASS TokenInformationClass, - OUT PVOID TokenInformation, - IN ULONG TokenInformationLength - ); - -NTSTATUS -STDCALL -ZwSetInformationToken( - IN HANDLE TokenHandle, - IN TOKEN_INFORMATION_CLASS TokenInformationClass, - OUT PVOID TokenInformation, - IN ULONG TokenInformationLength - ); - - -/* - * FUNCTION: Sets an io completion - * ARGUMENTS: - * CompletionPort = - * CompletionKey = - * IoStatusBlock = - * NumberOfBytesToTransfer = - * NumberOfBytesTransferred = - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetIoCompletion( - IN HANDLE CompletionPort, - IN ULONG CompletionKey, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG NumberOfBytesToTransfer, - OUT PULONG NumberOfBytesTransferred - ); -NTSTATUS -STDCALL -ZwSetIoCompletion( - IN HANDLE CompletionPort, - IN ULONG CompletionKey, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG NumberOfBytesToTransfer, - OUT PULONG NumberOfBytesTransferred - ); - -/* - * FUNCTION: Set properties for profiling - * ARGUMENTS: - * Interval = - * ClockSource = - * RETURNS: Status - * - */ - -NTSTATUS -STDCALL -NtSetIntervalProfile( - ULONG Interval, - KPROFILE_SOURCE ClockSource - ); - -NTSTATUS -STDCALL -ZwSetIntervalProfile( - ULONG Interval, - KPROFILE_SOURCE ClockSource - ); - - -/* - * FUNCTION: Sets the low part of an event pair - * ARGUMENTS: - EventPair = Handle to the event pair - * RETURNS: Status -*/ - -NTSTATUS -STDCALL -NtSetLowEventPair( - HANDLE EventPair - ); -NTSTATUS -STDCALL -ZwSetLowEventPair( - HANDLE EventPair - ); -/* - * FUNCTION: Sets the low part of an event pair and wait for the high part - * ARGUMENTS: - EventPair = Handle to the event pair - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetLowWaitHighEventPair( - HANDLE EventPair - ); -NTSTATUS -STDCALL -ZwSetLowWaitHighEventPair( - HANDLE EventPair - ); - -NTSTATUS -STDCALL -NtSetSecurityObject( - IN HANDLE Handle, - IN SECURITY_INFORMATION SecurityInformation, - IN PSECURITY_DESCRIPTOR SecurityDescriptor - ); - -NTSTATUS -STDCALL -ZwSetSecurityObject( - IN HANDLE Handle, - IN SECURITY_INFORMATION SecurityInformation, - IN PSECURITY_DESCRIPTOR SecurityDescriptor - ); - - -/* - * FUNCTION: Sets a system environment variable - * ARGUMENTS: - * ValueName = Name of the environment variable - * Value = Value of the environment variable - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetSystemEnvironmentValue( - IN PUNICODE_STRING VariableName, - IN PUNICODE_STRING Value - ); -NTSTATUS -STDCALL -ZwSetSystemEnvironmentValue( - IN PUNICODE_STRING VariableName, - IN PUNICODE_STRING Value - ); -/* - * FUNCTION: Sets system parameters - * ARGUMENTS: - * SystemInformationClass = Index to a particular set of system parameters - * Can be one of the following values: - * - * SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT - * - * SystemInformation = Structure containing the parameters. - * SystemInformationLength = Size of the structure. - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetSystemInformation( - IN SYSTEM_INFORMATION_CLASS SystemInformationClass, - IN PVOID SystemInformation, - IN ULONG SystemInformationLength - ); - -NTSTATUS -STDCALL -ZwSetSystemInformation( - IN SYSTEM_INFORMATION_CLASS SystemInformationClass, - IN PVOID SystemInformation, - IN ULONG SystemInformationLength - ); - -/* - * FUNCTION: Sets the system time - * ARGUMENTS: - * SystemTime = Old System time - * NewSystemTime = New System time - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetSystemTime( - IN PLARGE_INTEGER SystemTime, - IN PLARGE_INTEGER NewSystemTime OPTIONAL - ); -NTSTATUS -STDCALL -ZwSetSystemTime( - IN PLARGE_INTEGER SystemTime, - IN PLARGE_INTEGER NewSystemTime OPTIONAL - ); -/* - * FUNCTION: Sets the characteristics of a timer - * ARGUMENTS: - * TimerHandle = Handle to the timer - * DueTime = Time before the timer becomes signalled for the first time. - * TimerApcRoutine = Completion routine can be called on time completion - * TimerContext = Argument to the completion routine - * Resume = Specifies if the timer should repeated after completing one cycle - * Period = Cycle of the timer - * REMARKS: This routine maps to the win32 SetWaitableTimer. - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetTimer( - IN HANDLE TimerHandle, - IN PLARGE_INTEGER DueTime, - IN PTIMERAPCROUTINE TimerApcRoutine, - IN PVOID TimerContext, - IN BOOL WakeTimer, - IN ULONG Period OPTIONAL, - OUT PBOOLEAN PreviousState OPTIONAL - ); - -/* - * FUNCTION: Sets the frequency of the system timer - * ARGUMENTS: - * RequestedResolution = - * SetOrUnset = - * ActualResolution = - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetTimerResolution( - IN ULONG RequestedResolution, - IN BOOL SetOrUnset, - OUT PULONG ActualResolution - ); -NTSTATUS -STDCALL -ZwSetTimerResolution( - IN ULONG RequestedResolution, - IN BOOL SetOrUnset, - OUT PULONG ActualResolution - ); - -/* - * FUNCTION: Sets the value of a registry key - * ARGUMENTS: - * KeyHandle = Handle to a registry key - * ValueName = Name of the value entry to change - * TitleIndex = pointer to a structure containing the new volume information - * Type = Type of the registry key. Can be one of the values: - * REG_BINARY Unspecified binary data - * REG_DWORD A 32 bit value - * REG_DWORD_LITTLE_ENDIAN Same as REG_DWORD - * REG_DWORD_BIG_ENDIAN A 32 bit value whose least significant byte is at the highest address - * REG_EXPAND_SZ A zero terminated wide character string with unexpanded environment variables ( "%PATH%" ) - * REG_LINK A zero terminated wide character string referring to a symbolic link. - * REG_MULTI_SZ A series of zero-terminated strings including a additional trailing zero - * REG_NONE Unspecified type - * REG_SZ A wide character string ( zero terminated ) - * REG_RESOURCE_LIST ?? - * REG_RESOURCE_REQUIREMENTS_LIST ?? - * REG_FULL_RESOURCE_DESCRIPTOR ?? - * Data = Contains the data for the registry key. - * DataSize = size of the data. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtSetValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName, - IN ULONG TitleIndex OPTIONAL, - IN ULONG Type, - IN PVOID Data, - IN ULONG DataSize - ); -NTSTATUS -STDCALL -ZwSetValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName, - IN ULONG TitleIndex OPTIONAL, - IN ULONG Type, - IN PVOID Data, - IN ULONG DataSize - ); - -/* - * FUNCTION: Sets the volume information. - * ARGUMENTS: - * FileHandle = Handle to the file - * IoStatusBlock = Caller should supply storage for additional status information - * VolumeInformation = pointer to a structure containing the new volume information - * Length = size of the structure. - * VolumeInformationClass = specifies the particular volume information to set - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtSetVolumeInformationFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID FsInformation, - IN ULONG Length, - IN FS_INFORMATION_CLASS FsInformationClass - ); - -NTSTATUS -STDCALL -ZwSetVolumeInformationFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID FsInformation, - IN ULONG Length, - IN FS_INFORMATION_CLASS FsInformationClass - ); - -/* - * FUNCTION: Shuts the system down - * ARGUMENTS: - * Action = Specifies the type of shutdown, it can be one of the following values: - * ShutdownNoReboot, ShutdownReboot, ShutdownPowerOff - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtShutdownSystem( - IN SHUTDOWN_ACTION Action - ); - -NTSTATUS -STDCALL -ZwShutdownSystem( - IN SHUTDOWN_ACTION Action - ); - - -/* --- PROFILING --- */ - -/* - * FUNCTION: Starts profiling - * ARGUMENTS: - * ProfileHandle = Handle to the profile - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtStartProfile( - HANDLE ProfileHandle - ); - -NTSTATUS -STDCALL -ZwStartProfile( - HANDLE ProfileHandle - ); - -/* - * FUNCTION: Stops profiling - * ARGUMENTS: - * ProfileHandle = Handle to the profile - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtStopProfile( - HANDLE ProfileHandle - ); - -NTSTATUS -STDCALL -ZwStopProfile( - HANDLE ProfileHandle - ); - -/* --- PROCESS MANAGEMENT --- */ - -//--NtSystemDebugControl -/* - * FUNCTION: Terminates the execution of a process. - * ARGUMENTS: - * ThreadHandle = Handle to the process - * ExitStatus = The exit status of the process to terminate with. - * REMARKS - Native applications should kill themselves using this function. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtTerminateProcess( - IN HANDLE ProcessHandle , - IN NTSTATUS ExitStatus - ); -NTSTATUS -STDCALL -ZwTerminateProcess( - IN HANDLE ProcessHandle , - IN NTSTATUS ExitStatus - ); - -/* --- DEVICE DRIVER CONTROL --- */ - -/* - * FUNCTION: Unloads a driver. - * ARGUMENTS: - * DriverServiceName = Name of the driver to unload - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtUnloadDriver( - IN PUNICODE_STRING DriverServiceName - ); -NTSTATUS -STDCALL -ZwUnloadDriver( - IN PUNICODE_STRING DriverServiceName - ); - -/* --- VIRTUAL MEMORY MANAGEMENT --- */ - -/* - * FUNCTION: Writes a range of virtual memory - * ARGUMENTS: - * ProcessHandle = The handle to the process owning the address space. - * BaseAddress = The points to the address to write to - * Buffer = Pointer to the buffer to write - * NumberOfBytesToWrite = Offset to the upper boundary to write - * NumberOfBytesWritten = Total bytes written - * REMARKS: - * This function maps to the win32 WriteProcessMemory - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtWriteVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN PVOID Buffer, - IN ULONG NumberOfBytesToWrite, - OUT PULONG NumberOfBytesWritten - ); - -NTSTATUS -STDCALL -ZwWriteVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN PVOID Buffer, - IN ULONG NumberOfBytesToWrite, - OUT PULONG NumberOfBytesWritten - ); - -/* - * FUNCTION: Unlocks a range of virtual memory. - * ARGUMENTS: - * ProcessHandle = Handle to the process - * BaseAddress = Lower boundary of the range of bytes to unlock. - * NumberOfBytesToUnlock = Offset to the upper boundary to unlock. - * NumberOfBytesUnlocked (OUT) = Number of bytes actually unlocked. - * REMARK: - This procedure maps to the win32 procedure VirtualUnlock - * RETURNS: Status [ STATUS_SUCCESS | STATUS_PAGE_WAS_ULOCKED ] - */ -NTSTATUS -STDCALL -NtUnlockVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN ULONG NumberOfBytesToUnlock, - OUT PULONG NumberOfBytesUnlocked OPTIONAL - ); - -/* - * FUNCTION: Unmaps a piece of virtual memory backed by a file. - * ARGUMENTS: - * ProcessHandle = Handle to the process - * BaseAddress = The address where the mapping begins - * REMARK: - This procedure maps to the win32 UnMapViewOfFile - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtUnmapViewOfSection( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress - ); -NTSTATUS -STDCALL -ZwUnmapViewOfSection( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress - ); - -/* --- OBJECT SYNCHRONIZATION --- */ - -/* - * FUNCTION: Signals an object and wait for an other one. - * ARGUMENTS: - * SignalObject = Handle to the object that should be signaled - * WaitObject = Handle to the object that should be waited for - * Alertable = True if the wait is alertable - * Time = The time to wait - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtSignalAndWaitForSingleObject( - IN HANDLE SignalObject, - IN HANDLE WaitObject, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - -NTSTATUS -STDCALL -ZwSignalAndWaitForSingleObject( - IN HANDLE SignalObject, - IN HANDLE WaitObject, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - -/* - * FUNCTION: Waits for multiple objects to become signalled. - * ARGUMENTS: - * Count = The number of objects - * Object = The array of object handles - * WaitType = Can be one of the values UserMode or KernelMode - * Alertable = If true the wait is alertable. - * Time = The maximum wait time. - * REMARKS: - * This function maps to the win32 WaitForMultipleObjectEx. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtWaitForMultipleObjects ( - IN ULONG Count, - IN HANDLE Object[], - IN CINT WaitType, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - -/* - * FUNCTION: Waits for an object to become signalled. - * ARGUMENTS: - * Object = The object handle - * Alertable = If true the wait is alertable. - * Time = The maximum wait time. - * REMARKS: - * This function maps to the win32 WaitForSingleObjectEx. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtWaitForSingleObject ( - IN HANDLE Object, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - -NTSTATUS -STDCALL -ZwWaitForSingleObject ( - IN HANDLE Object, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - -/* --- EVENT PAIR OBJECT --- */ - -/* - * FUNCTION: Waits for the high part of an eventpair to become signalled - * ARGUMENTS: - * EventPairHandle = Handle to the event pair. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtWaitHighEventPair( - IN HANDLE EventPairHandle - ); - -NTSTATUS -STDCALL -ZwWaitHighEventPair( - IN HANDLE EventPairHandle - ); - -/* - * FUNCTION: Waits for the low part of an eventpair to become signalled - * ARGUMENTS: - * EventPairHandle = Handle to the event pair. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtWaitLowEventPair( - IN HANDLE EventPairHandle - ); - -NTSTATUS -STDCALL -ZwWaitLowEventPair( - IN HANDLE EventPairHandle - ); - -/* --- FILE MANAGEMENT --- */ - -/* - * FUNCTION: Unlocks a range of bytes in a file. - * ARGUMENTS: - * FileHandle = Handle to the file - * IoStatusBlock = Caller should supply storage for a structure containing - * the completion status and information about the requested unlock operation. - The information field is set to the number of bytes unlocked. - * ByteOffset = Offset to start the range of bytes to unlock - * Length = Number of bytes to unlock. - * Key = Special value to enable other threads to unlock a file than the - thread that locked the file. The key supplied must match with the one obtained - in a previous call to NtLockFile. - * REMARK: - This procedure maps to the win32 procedure UnlockFileEx. STATUS_PENDING is returned if the lock could - not be obtained immediately, the device queue is busy and the IRP is queued. - * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES | - STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_RANGE_NOT_LOCKED ] - */ -NTSTATUS -STDCALL -NtUnlockFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PLARGE_INTEGER ByteOffset, - IN PLARGE_INTEGER Lenght, - OUT PULONG Key OPTIONAL - ); -NTSTATUS -STDCALL -ZwUnlockFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PLARGE_INTEGER ByteOffset, - IN PLARGE_INTEGER Lenght, - OUT PULONG Key OPTIONAL - ); - -/* - * FUNCTION: Writes data to a file - * ARGUMENTS: - * FileHandle = The handle a file ( from NtCreateFile ) - * Event = Specifies a event that will become signalled when the write operation completes. - * ApcRoutine = Asynchroneous Procedure Callback [ Should not be used by device drivers ] - * ApcContext = Argument to the Apc Routine - * IoStatusBlock = Caller should supply storage for a structure containing the completion status and information about the requested write operation. - * Buffer = Caller should supply storage for a buffer that will contain the information to be written to file. - * Length = Size in bytest of the buffer - * ByteOffset = Points to a file offset. If a combination of Length and BytesOfSet is past the end-of-file mark the file will be enlarged. - * BytesOffset is ignored if the file is created with FILE_APPEND_DATA in the DesiredAccess. BytesOffset is also ignored if - * the file is created with CreateOptions flags FILE_SYNCHRONOUS_IO_ALERT or FILE_SYNCHRONOUS_IO_NONALERT set, in that case a offset - * should be created by specifying FILE_USE_FILE_POINTER_POSITION. - * Key = Unused - * REMARKS: - * This function maps to the win32 WriteFile. - * Callers to NtWriteFile should run at IRQL PASSIVE_LEVEL. - * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES - STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_FILE_LOCK_CONFLICT ] - */ -NTSTATUS -STDCALL -NtWriteFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID Buffer, - IN ULONG Length, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); - -NTSTATUS -STDCALL -ZwWriteFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID Buffer, - IN ULONG Length, - IN PLARGE_INTEGER ByteOffset , - IN PULONG Key OPTIONAL - ); - -/* - * FUNCTION: Writes a file - * ARGUMENTS: - * FileHandle = The handle of the file - * Event = - * ApcRoutine = Asynchroneous Procedure Callback [ Should not be used by device drivers ] - * ApcContext = Argument to the Apc Routine - * IoStatusBlock = Caller should supply storage for a structure containing the completion status and information about the requested write operation. - * BufferDescription = Caller should supply storage for a buffer that will contain the information to be written to file. - * BufferLength = Size in bytest of the buffer - * ByteOffset = Points to a file offset. If a combination of Length and BytesOfSet is past the end-of-file mark the file will be enlarged. - * BytesOffset is ignored if the file is created with FILE_APPEND_DATA in the DesiredAccess. BytesOffset is also ignored if - * the file is created with CreateOptions flags FILE_SYNCHRONOUS_IO_ALERT or FILE_SYNCHRONOUS_IO_NONALERT set, in that case a offset - * should be created by specifying FILE_USE_FILE_POINTER_POSITION. Use FILE_WRITE_TO_END_OF_FILE to write to the EOF. - * Key = If a matching key [ a key provided at NtLockFile ] is provided the write operation will continue even if a byte range is locked. - * REMARKS: - * This function maps to the win32 WriteFile. - * Callers to NtWriteFile should run at IRQL PASSIVE_LEVEL. - * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES - STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_FILE_LOCK_CONFLICT ] - */ - -NTSTATUS -STDCALL -NtWriteFileGather( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN FILE_SEGMENT_ELEMENT BufferDescription[], - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); - -NTSTATUS -STDCALL -ZwWriteFileGather( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN FILE_SEGMENT_ELEMENT BufferDescription[], - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); - - -/* --- THREAD MANAGEMENT --- */ - -/* - * FUNCTION: Increments a thread's resume count - * ARGUMENTS: - * ThreadHandle = Handle to the thread that should be resumed - * PreviousSuspendCount = The resulting/previous suspend count. - * REMARK: - * A thread will be suspended if its suspend count is greater than 0. This procedure maps to - * the win32 SuspendThread function. ( documentation about the the suspend count can be found here aswell ) - * The suspend count is not increased if it is greater than MAXIMUM_SUSPEND_COUNT. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtSuspendThread( - IN HANDLE ThreadHandle, - IN PULONG PreviousSuspendCount - ); - -NTSTATUS -STDCALL -ZwSuspendThread( - IN HANDLE ThreadHandle, - IN PULONG PreviousSuspendCount - ); - -/* - * FUNCTION: Terminates the execution of a thread. - * ARGUMENTS: - * ThreadHandle = Handle to the thread - * ExitStatus = The exit status of the thread to terminate with. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtTerminateThread( - IN HANDLE ThreadHandle , - IN NTSTATUS ExitStatus - ); -NTSTATUS -STDCALL -ZwTerminateThread( - IN HANDLE ThreadHandle , - IN NTSTATUS ExitStatus - ); -/* - * FUNCTION: Tests to see if there are any pending alerts for the calling thread - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtTestAlert( - VOID - ); -NTSTATUS -STDCALL -ZwTestAlert( - VOID - ); - -/* - * FUNCTION: Yields the callers thread. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtYieldExecution( - VOID - ); - -NTSTATUS -STDCALL -ZwYieldExecution( - VOID - ); - - -/* - * --- Local Procedure Call Facility - * These prototypes are unknown as yet - * (stack sizes by Peter-Michael Hager) - */ - -/* --- REGISTRY --- */ - -/* - * FUNCTION: Unloads a registry key. - * ARGUMENTS: - * KeyHandle = Handle to the registry key - * REMARK: - * This procedure maps to the win32 procedure RegUnloadKey - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtUnloadKey( - HANDLE KeyHandle - ); - -/* --- PLUG AND PLAY --- */ - -NTSTATUS -STDCALL -NtPlugPlayControl ( - VOID - ); - -NTSTATUS -STDCALL -NtGetPlugPlayEvent ( - VOID - ); - -/* --- POWER MANAGEMENT --- */ - -NTSTATUS STDCALL -NtSetSystemPowerState(IN POWER_ACTION SystemAction, - IN SYSTEM_POWER_STATE MinSystemState, - IN ULONG Flags); - -/* --- DEBUG SUBSYSTEM --- */ - -NTSTATUS STDCALL -NtSystemDebugControl(DEBUG_CONTROL_CODE ControlCode, - PVOID InputBuffer, - ULONG InputBufferLength, - PVOID OutputBuffer, - ULONG OutputBufferLength, - PULONG ReturnLength); - -/* --- VIRTUAL DOS MACHINE (VDM) --- */ - -NTSTATUS -STDCALL -NtVdmControl (ULONG ControlCode, PVOID ControlData); - - -/* --- WIN32 --- */ - -NTSTATUS STDCALL -NtW32Call(IN ULONG RoutineIndex, - IN PVOID Argument, - IN ULONG ArgumentLength, - OUT PVOID* Result OPTIONAL, - OUT PULONG ResultLength OPTIONAL); - -/* --- CHANNELS --- */ - -NTSTATUS -STDCALL -NtCreateChannel ( - VOID - ); - -NTSTATUS -STDCALL -NtListenChannel ( - VOID - ); - -NTSTATUS -STDCALL -NtOpenChannel ( - VOID - ); - -NTSTATUS -STDCALL -NtReplyWaitSendChannel ( - VOID - ); - -NTSTATUS -STDCALL -NtSendWaitReplyChannel ( - VOID - ); - -NTSTATUS -STDCALL -NtSetContextChannel ( - VOID - ); - -/* --- MISCELLANEA --- */ - -//NTSTATUS STDCALL NtSetLdtEntries(VOID); -NTSTATUS -STDCALL -NtSetLdtEntries ( - HANDLE Thread, - ULONG FirstEntry, - PULONG Entries - ); - - -NTSTATUS -STDCALL -NtQueryOleDirectoryFile ( - VOID - ); - -#endif /* __DDK_ZW_H */ diff --git a/reactos/include/ntos/zwtypes.h b/reactos/include/ntos/zwtypes.h deleted file mode 100755 index 948ac0b918b..00000000000 --- a/reactos/include/ntos/zwtypes.h +++ /dev/null @@ -1,597 +0,0 @@ -#ifndef __INCLUDE_DDK_ZWTYPES_H -#define __INCLUDE_DDK_ZWTYPES_H - -#define NtCurrentProcess() ( (HANDLE) 0xFFFFFFFF ) -#define NtCurrentThread() ( (HANDLE) 0xFFFFFFFE ) - -#if defined(_NTOSKRNL_) -extern DECL_EXPORT ULONG NtBuildNumber; -#else -extern DECL_IMPORT ULONG NtBuildNumber; -#endif - -// event access mask - -#define EVENT_READ_ACCESS 1 -#define EVENT_WRITE_ACCESS 2 - -//process query / set information class - -#define ProcessBasicInformation 0 -#define ProcessQuotaLimits 1 -#define ProcessIoCounters 2 -#define ProcessVmCounters 3 -#define ProcessTimes 4 -#define ProcessBasePriority 5 -#define ProcessRaisePriority 6 -#define ProcessDebugPort 7 -#define ProcessExceptionPort 8 -#define ProcessAccessToken 9 -#define ProcessLdtInformation 10 -#define ProcessLdtSize 11 -#define ProcessDefaultHardErrorMode 12 -#define ProcessIoPortHandlers 13 -#define ProcessPooledUsageAndLimits 14 -#define ProcessWorkingSetWatch 15 -#define ProcessUserModeIOPL 16 -#define ProcessEnableAlignmentFaultFixup 17 -#define ProcessPriorityClass 18 -#define ProcessWx86Information 19 -#define ProcessHandleCount 20 -#define ProcessAffinityMask 21 -#define ProcessPriorityBoost 22 -#define ProcessDeviceMap 23 -#define ProcessSessionInformation 24 -#define ProcessForegroundInformation 25 -#define ProcessWow64Information 26 -#define MaxProcessInfoClass 26 -/* ReactOS private. */ -#define ProcessImageFileName (MaxProcessInfoClass + 1) -#define ProcessDesktop (MaxProcessInfoClass + 2) -#define RosMaxProcessInfoClass (MaxProcessInfoClass + 2) - -/* - * thread query / set information class - */ -#define ThreadBasicInformation 0 -#define ThreadTimes 1 -#define ThreadPriority 2 -#define ThreadBasePriority 3 -#define ThreadAffinityMask 4 -#define ThreadImpersonationToken 5 -#define ThreadDescriptorTableEntry 6 -#define ThreadEnableAlignmentFaultFixup 7 -#define ThreadEventPair 8 -#define ThreadQuerySetWin32StartAddress 9 -#define ThreadZeroTlsCell 10 -#define ThreadPerformanceCount 11 -#define ThreadAmILastThread 12 -#define ThreadIdealProcessor 13 -#define ThreadPriorityBoost 14 -#define ThreadSetTlsArrayAddress 15 -#define ThreadIsIoPending 16 -#define ThreadHideFromDebugger 17 -#define MaxThreadInfoClass 17 -#define RosMaxThreadInfoClass 17 - - -// object handle information - -#define ObjectBasicInformation 0 -#define ObjectNameInformation 1 -#define ObjectTypeInformation 2 -#define ObjectAllInformation 3 -#define ObjectDataInformation 4 - -typedef struct _ATOM_TABLE_INFORMATION -{ - ULONG NumberOfAtoms; - RTL_ATOM Atoms[1]; -} ATOM_TABLE_INFORMATION, *PATOM_TABLE_INFORMATION; - - -// mutant information - -typedef enum _MUTANT_INFORMATION_CLASS -{ - MutantBasicInformation = 0 -} MUTANT_INFORMATION_CLASS; - -typedef struct _MUTANT_BASIC_INFORMATION -{ - LONG Count; - BOOLEAN Owned; - BOOLEAN Abandoned; -} MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION; - - -// semaphore information - -typedef enum _SEMAPHORE_INFORMATION_CLASS -{ - SemaphoreBasicInformation = 0 -} SEMAPHORE_INFORMATION_CLASS; - -typedef struct _SEMAPHORE_BASIC_INFORMATION -{ - LONG CurrentCount; - LONG MaximumCount; -} SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION; - - -// event information - -typedef enum _EVENT_INFORMATION_CLASS -{ - EventBasicInformation = 0 -} EVENT_INFORMATION_CLASS; - -typedef struct _EVENT_BASIC_INFORMATION -{ - EVENT_TYPE EventType; - LONG EventState; -} EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION; - - -// system information -// {Nt|Zw}{Query|Set}SystemInformation -// (GN means Gary Nebbet in "NT/W2K Native API Reference") - -// SystemTimeOfDayInformation (3) -typedef -struct _SYSTEM_TIMEOFDAY_INFORMATION -{ - LARGE_INTEGER BootTime; - LARGE_INTEGER CurrentTime; - LARGE_INTEGER TimeZoneBias; - ULONG TimeZoneId; - ULONG Reserved; -} SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; - -// SystemPathInformation (4) -// IT DOES NOT WORK -typedef -struct _SYSTEM_PATH_INFORMATION -{ - PVOID Dummy; - -} SYSTEM_PATH_INFORMATION, * PSYSTEM_PATH_INFORMATION; - -// SystemProcessInformation (5) -typedef -struct _SYSTEM_THREAD_INFORMATION -{ - TIME KernelTime; - TIME UserTime; - TIME CreateTime; - ULONG TickCount; - ULONG StartEIP; - CLIENT_ID ClientId; - ULONG DynamicPriority; - ULONG BasePriority; - ULONG nSwitches; - DWORD State; - KWAIT_REASON WaitReason; - -} SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION; - -typedef -struct SYSTEM_PROCESS_INFORMATION -{ - ULONG RelativeOffset; - ULONG ThreadCount; - ULONG Unused1 [6]; - TIME CreateTime; - TIME UserTime; - TIME KernelTime; - UNICODE_STRING Name; - ULONG BasePriority; - ULONG ProcessId; - ULONG ParentProcessId; - ULONG HandleCount; - ULONG Unused2[2]; - ULONG PeakVirtualSizeBytes; - ULONG TotalVirtualSizeBytes; - ULONG PageFaultCount; - ULONG PeakWorkingSetSizeBytes; - ULONG TotalWorkingSetSizeBytes; - ULONG PeakPagedPoolUsagePages; - ULONG TotalPagedPoolUsagePages; - ULONG PeakNonPagedPoolUsagePages; - ULONG TotalNonPagedPoolUsagePages; - ULONG TotalPageFileUsageBytes; - ULONG PeakPageFileUsageBytes; - ULONG TotalPrivateBytes; - SYSTEM_THREAD_INFORMATION ThreadSysInfo [1]; - -} SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION; - -// SystemCallCountInformation (6) -typedef -struct _SYSTEM_SDT_INFORMATION -{ - ULONG BufferLength; - ULONG NumberOfSystemServiceTables; - ULONG NumberOfServices [1]; - ULONG ServiceCounters [1]; - -} SYSTEM_SDT_INFORMATION, *PSYSTEM_SDT_INFORMATION; - -// SystemDeviceInformation (7) -typedef -struct _SYSTEM_DEVICE_INFORMATION -{ - ULONG NumberOfDisks; - ULONG NumberOfFloppies; - ULONG NumberOfCdRoms; - ULONG NumberOfTapes; - ULONG NumberOfSerialPorts; - ULONG NumberOfParallelPorts; -} SYSTEM_DEVICE_INFORMATION, *PSYSTEM_DEVICE_INFORMATION; - -// SystemProcessorPerformanceInformation (8) -// (one per processor in the system) -typedef -struct _SYSTEM_PROCESSORTIME_INFO -{ - TIME TotalProcessorRunTime; - TIME TotalProcessorTime; - TIME TotalProcessorUserTime; - TIME TotalDPCTime; - TIME TotalInterruptTime; - ULONG TotalInterrupts; - ULONG Unused; - -} SYSTEM_PROCESSORTIME_INFO, *PSYSTEM_PROCESSORTIME_INFO; - -// SystemFlagsInformation (9) -typedef -struct _SYSTEM_FLAGS_INFORMATION -{ - ULONG Flags; - -} SYSTEM_FLAGS_INFORMATION, * PSYSTEM_FLAGS_INFORMATION; - -#define FLG_STOP_ON_EXCEPTION 0x00000001 -#define FLG_SHOW_LDR_SNAPS 0x00000002 -#define FLG_DEBUG_INITIAL_COMMAND 0x00000004 -#define FLG_STOP_ON_HANG_GUI 0x00000008 -#define FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010 -#define FLG_HEAP_ENABLE_FREE_CHECK 0x00000020 -#define FLG_HEAP_VALIDATE_PARAMETERS 0x00000040 -#define FLG_HEAP_VALIDATE_ALL 0x00000080 -#define FLG_POOL_ENABLE_TAIL_CHECK 0x00000100 -#define FLG_POOL_ENABLE_FREE_CHECK 0x00000200 -#define FLG_POOL_ENABLE_TAGGING 0x00000400 -#define FLG_HEAP_ENABLE_TAGGING 0x00000800 -#define FLG_USER_STACK_TRACE_DB 0x00001000 -#define FLG_KERNEL_STACK_TRACE_DB 0x00002000 -#define FLG_MAINTAIN_OBJECT_TYPELIST 0x00004000 -#define FLG_HEAP_ENABLE_TAG_BY_DLL 0x00008000 -#define FLG_IGNORE_DEBUG_PRIV 0x00010000 -#define FLG_ENABLE_CSRDEBUG 0x00020000 -#define FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x00040000 -#define FLG_DISABLE_PAGE_KERNEL_STACKS 0x00080000 -#define FLG_HEAP_ENABLE_CALL_TRACING 0x00100000 -#define FLG_HEAP_DISABLE_COALESCING 0x00200000 -#define FLG_ENABLE_CLOSE_EXCEPTION 0x00400000 -#define FLG_ENABLE_EXCEPTION_LOGGING 0x00800000 -#define FLG_UNKNOWN_01000000 0x01000000 -#define FLG_UNKNOWN_02000000 0x02000000 -#define FLG_UNKNOWN_04000000 0x04000000 -#define FLG_ENABLE_DBGPRINT_BUFFERING 0x08000000 -#define FLG_UNKNOWN_10000000 0x10000000 -#define FLG_UNKNOWN_20000000 0x20000000 -#define FLG_UNKNOWN_40000000 0x40000000 -#define FLG_UNKNOWN_80000000 0x80000000 - -// SystemCallTimeInformation (10) -// UNKNOWN - -// SystemModuleInformation (11) -typedef -struct _SYSTEM_MODULE_ENTRY -{ - ULONG Unknown1; - ULONG Unknown2; - PVOID BaseAddress; - ULONG Size; - ULONG Flags; - ULONG EntryIndex; - USHORT NameLength; /* Length of module name not including the path, this field contains valid value only for NTOSKRNL module*/ - USHORT PathLength; /* Length of 'directory path' part of modulename*/ - CHAR Name [256]; -} SYSTEM_MODULE_ENTRY, * PSYSTEM_MODULE_ENTRY; - -// SystemLocksInformation (12) -typedef -struct _SYSTEM_RESOURCE_LOCK_ENTRY -{ - ULONG ResourceAddress; - ULONG Always1; - ULONG Unknown; - ULONG ActiveCount; - ULONG ContentionCount; - ULONG Unused[2]; - ULONG NumberOfSharedWaiters; - ULONG NumberOfExclusiveWaiters; - -} SYSTEM_RESOURCE_LOCK_ENTRY, *PSYSTEM_RESOURCE_LOCK_ENTRY; - -typedef -struct _SYSTEM_RESOURCE_LOCK_INFO -{ - ULONG Count; - SYSTEM_RESOURCE_LOCK_ENTRY Lock [1]; - -} SYSTEM_RESOURCE_LOCK_INFO, *PSYSTEM_RESOURCE_LOCK_INFO; - -// SystemInformation13 (13) -// UNKNOWN - -// SystemInformation14 (14) -// UNKNOWN - -// SystemInformation15 (15) -// UNKNOWN - -// SystemHandleInformation (16) -// (see ontypes.h) -typedef -struct _SYSTEM_HANDLE_ENTRY -{ - ULONG OwnerPid; - BYTE ObjectType; - BYTE HandleFlags; - USHORT HandleValue; - PVOID ObjectPointer; - ULONG AccessMask; - -} SYSTEM_HANDLE_ENTRY, *PSYSTEM_HANDLE_ENTRY; - -// SystemInstructionEmulationInfo (19) -typedef -struct _SYSTEM_VDM_INFORMATION -{ - ULONG VdmSegmentNotPresentCount; - ULONG VdmINSWCount; - ULONG VdmESPREFIXCount; - ULONG VdmCSPREFIXCount; - ULONG VdmSSPREFIXCount; - ULONG VdmDSPREFIXCount; - ULONG VdmFSPREFIXCount; - ULONG VdmGSPREFIXCount; - ULONG VdmOPER32PREFIXCount; - ULONG VdmADDR32PREFIXCount; - ULONG VdmINSBCount; - ULONG VdmINSWV86Count; - ULONG VdmOUTSBCount; - ULONG VdmOUTSWCount; - ULONG VdmPUSHFCount; - ULONG VdmPOPFCount; - ULONG VdmINTNNCount; - ULONG VdmINTOCount; - ULONG VdmIRETCount; - ULONG VdmINBIMMCount; - ULONG VdmINWIMMCount; - ULONG VdmOUTBIMMCount; - ULONG VdmOUTWIMMCount; - ULONG VdmINBCount; - ULONG VdmINWCount; - ULONG VdmOUTBCount; - ULONG VdmOUTWCount; - ULONG VdmLOCKPREFIXCount; - ULONG VdmREPNEPREFIXCount; - ULONG VdmREPPREFIXCount; - ULONG VdmHLTCount; - ULONG VdmCLICount; - ULONG VdmSTICount; - ULONG VdmBopCount; - -} SYSTEM_VDM_INFORMATION, *PSYSTEM_VDM_INFORMATION; - -// SystemPoolTagInformation (22) -// found by Klaus P. Gerlicher -// (implemented only in checked builds) -typedef -struct _POOL_TAG_STATS -{ - ULONG AllocationCount; - ULONG FreeCount; - ULONG SizeBytes; - -} POOL_TAG_STATS; - -typedef -struct _SYSTEM_POOL_TAG_ENTRY -{ - ULONG Tag; - POOL_TAG_STATS Paged; - POOL_TAG_STATS NonPaged; - -} SYSTEM_POOL_TAG_ENTRY, * PSYSTEM_POOL_TAG_ENTRY; - -typedef -struct _SYSTEM_POOL_TAG_INFO -{ - ULONG Count; - SYSTEM_POOL_TAG_ENTRY PoolEntry [1]; - -} SYSTEM_POOL_TAG_INFO, *PSYSTEM_POOL_TAG_INFO; - -// SystemProcessorScheduleInfo (23) -typedef -struct _SYSTEM_PROCESSOR_SCHEDULE_INFO -{ - ULONG nContextSwitches; - ULONG nDPCQueued; - ULONG nDPCRate; - ULONG TimerResolution; - ULONG nDPCBypasses; - ULONG nAPCBypasses; - -} SYSTEM_PROCESSOR_SCHEDULE_INFO, *PSYSTEM_PROCESSOR_SCHEDULE_INFO; - -// SystemProcessorFaultCountInfo (33) -typedef -struct _SYSTEM_PROCESSOR_FAULT_INFO -{ - ULONG nAlignmentFixup; - ULONG nExceptionDispatches; - ULONG nFloatingEmulation; - ULONG Unknown; - -} SYSTEM_PROCESSOR_FAULT_INFO, *PSYSTEM_PROCESSOR_FAULT_INFO; - -// SystemCrashDumpStateInfo (34) -// - -// SystemDebuggerInformation (35) -typedef -struct _SYSTEM_DEBUGGER_INFO -{ - BOOLEAN KdDebuggerEnabled; - BOOLEAN KdDebuggerPresent; - -} SYSTEM_DEBUGGER_INFO, *PSYSTEM_DEBUGGER_INFO; - -// SystemInformation36 (36) -// UNKNOWN - -// SystemQuotaInformation (37) -typedef -struct _SYSTEM_QUOTA_INFORMATION -{ - ULONG CmpGlobalQuota; - ULONG CmpGlobalQuotaUsed; - ULONG MmSizeofPagedPoolInBytes; - -} SYSTEM_QUOTA_INFORMATION, *PSYSTEM_QUOTA_INFORMATION; - -// memory information - -#define MemoryBasicInformation 0 - -// wait type - -#define WaitAll 0 -#define WaitAny 1 - -// number of wait objects - -#define THREAD_WAIT_OBJECTS 3 -//#define MAXIMUM_WAIT_OBJECTS 64 - -// key restore flags - -#define REG_WHOLE_HIVE_VOLATILE 1 -#define REG_REFRESH_HIVE 2 - -// object type access rights - -#define OBJECT_TYPE_CREATE 0x0001 -#define OBJECT_TYPE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1) - -// directory access rights - -#define DIRECTORY_QUERY 0x0001 -#define DIRECTORY_TRAVERSE 0x0002 -#define DIRECTORY_CREATE_OBJECT 0x0004 -#define DIRECTORY_CREATE_SUBDIRECTORY 0x0008 - -#define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF) - -// symbolic link access rights - -#define SYMBOLIC_LINK_QUERY 0x0001 -#define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1) -// thread information - -#if 0 -// incompatible with MS NT - -typedef struct _THREAD_BASIC_INFORMATION -{ - NTSTATUS ExitStatus; - PVOID TebBaseAddress; // PNT_TIB (GN) - CLIENT_ID ClientId; - KAFFINITY AffinityMask; - KPRIORITY Priority; - KPRIORITY BasePriority; -} THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION; -#endif - -typedef struct _OBJECT_DATA_INFORMATION -{ - BOOLEAN bInheritHandle; - BOOLEAN bProtectFromClose; -} OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION; - - -// directory information - -typedef struct _OBJDIR_INFORMATION { - UNICODE_STRING ObjectName; - UNICODE_STRING ObjectTypeName; // Directory, Device ... - UCHAR Data[0]; -} OBJDIR_INFORMATION, *POBJDIR_INFORMATION; - - -/* - Action is one of the following values: - - FILE_ACTION_ADDED 0x00000001 - FILE_ACTION_REMOVED 0x00000002 - FILE_ACTION_MODIFIED 0x00000003 - FILE_ACTION_RENAMED_OLD_NAME 0x00000004 - FILE_ACTION_RENAMED_NEW_NAME 0x00000005 - FILE_ACTION_ADDED_STREAM 0x00000006 - FILE_ACTION_REMOVED_STREAM 0x00000007 - FILE_ACTION_MODIFIED_STREAM 0x00000008 - -*/ - - -// File System Control commands ( related to defragging ) - -#define FSCTL_READ_MFT_RECORD 0x90068 // NTFS only - -typedef struct _BITMAP_DESCRIPTOR -{ - ULONGLONG StartLcn; - ULONGLONG ClustersToEndOfVol; - BYTE Map[0]; // variable size -} BITMAP_DESCRIPTOR, *PBITMAP_DESCRIPTOR; - -typedef struct _TIMER_BASIC_INFORMATION -{ - LARGE_INTEGER TimeRemaining; - BOOLEAN SignalState; -} TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION; - -typedef enum _TIMER_INFORMATION_CLASS -{ - TimerBasicInformation -} TIMER_INFORMATION_CLASS; - -typedef -struct _LPC_PORT_BASIC_INFORMATION -{ - DWORD Unknown0; - DWORD Unknown1; - DWORD Unknown2; - DWORD Unknown3; - DWORD Unknown4; - DWORD Unknown5; - DWORD Unknown6; - DWORD Unknown7; - DWORD Unknown8; - DWORD Unknown9; - DWORD Unknown10; - DWORD Unknown11; - DWORD Unknown12; - DWORD Unknown13; - -} LPC_PORT_BASIC_INFORMATION, * PLPC_PORT_BASIC_INFORMATION; - -#endif diff --git a/reactos/include/pe.h b/reactos/include/pe.h index 0483e4931b3..0905542301d 100644 --- a/reactos/include/pe.h +++ b/reactos/include/pe.h @@ -1,6 +1,10 @@ #ifndef __INCLUDE_PE_H #define __INCLUDE_PE_H +#define _ANONYMOUS_UNION __extension__ +#define _ANONYMOUS_STRUCT __extension__ +#define NTAPI + #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) #define IMAGE_SECTION_CHAR_CODE 0x00000020 @@ -17,13 +21,19 @@ #define IMAGE_DOS_MAGIC 0x5a4d #define IMAGE_PE_MAGIC 0x00004550 +#define IMAGE_DOS_SIGNATURE 0x5a4d +#define IMAGE_OS2_SIGNATURE 0x454e + +#define IMAGE_OS2_SIGNATURE_LE 0x454c +#define IMAGE_VXD_SIGNATURE 0x454c #define IMAGE_NT_SIGNATURE 0x00004550 #define IMAGE_SIZEOF_FILE_HEADER 20 -#if 0 #define IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info stripped from file. +#define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable (i.e. no unresolved externel references). +#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped from file. #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped from file. #define IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word are reversed. #define IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine. @@ -34,9 +44,14 @@ #define IMAGE_FILE_DLL 0x2000 // File is a DLL. #define IMAGE_FILE_UP_SYSTEM_ONLY 0x4000 // File should only be run on a UP machine #define IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word are reversed. -#endif #define IMAGE_FILE_MACHINE_UNKNOWN 0 +#define IMAGE_FILE_MACHINE_I386 0x14c // Intel 386. +#define IMAGE_FILE_MACHINE_R3000 0x162 // MIPS little-endian, 0x160 big-endian +#define IMAGE_FILE_MACHINE_R4000 0x166 // MIPS little-endian +#define IMAGE_FILE_MACHINE_R10000 0x168 // MIPS little-endian +#define IMAGE_FILE_MACHINE_ALPHA 0x184 // Alpha_AXP +#define IMAGE_FILE_MACHINE_POWERPC 0x1F0 // IBM PowerPC Little-Endian #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 @@ -282,11 +297,416 @@ #define IMAGE_SECTION_INITIALIZED_DATA (0x40) #define IMAGE_SECTION_UNINITIALIZED_DATA (0x80) +#pragma pack(push,4) +typedef struct _IMAGE_FILE_HEADER { + WORD Machine; + WORD NumberOfSections; + DWORD TimeDateStamp; + DWORD PointerToSymbolTable; + DWORD NumberOfSymbols; + WORD SizeOfOptionalHeader; + WORD Characteristics; +} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; +typedef struct _IMAGE_DATA_DIRECTORY { + DWORD VirtualAddress; + DWORD Size; +} IMAGE_DATA_DIRECTORY,*PIMAGE_DATA_DIRECTORY; +typedef struct _IMAGE_OPTIONAL_HEADER { + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + DWORD BaseOfData; + DWORD ImageBase; + DWORD SectionAlignment; + DWORD FileAlignment; + WORD MajorOperatingSystemVersion; + WORD MinorOperatingSystemVersion; + WORD MajorImageVersion; + WORD MinorImageVersion; + WORD MajorSubsystemVersion; + WORD MinorSubsystemVersion; + DWORD Reserved1; + DWORD SizeOfImage; + DWORD SizeOfHeaders; + DWORD CheckSum; + WORD Subsystem; + WORD DllCharacteristics; + DWORD SizeOfStackReserve; + DWORD SizeOfStackCommit; + DWORD SizeOfHeapReserve; + DWORD SizeOfHeapCommit; + DWORD LoaderFlags; + DWORD NumberOfRvaAndSizes; + IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; +} IMAGE_OPTIONAL_HEADER,*PIMAGE_OPTIONAL_HEADER; +typedef struct _IMAGE_ROM_OPTIONAL_HEADER { + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + DWORD BaseOfData; + DWORD BaseOfBss; + DWORD GprMask; + DWORD CprMask[4]; + DWORD GpValue; +} IMAGE_ROM_OPTIONAL_HEADER,*PIMAGE_ROM_OPTIONAL_HEADER; +#pragma pack(pop) +#pragma pack(push,2) +typedef struct _IMAGE_DOS_HEADER { + WORD e_magic; + WORD e_cblp; + WORD e_cp; + WORD e_crlc; + WORD e_cparhdr; + WORD e_minalloc; + WORD e_maxalloc; + WORD e_ss; + WORD e_sp; + WORD e_csum; + WORD e_ip; + WORD e_cs; + WORD e_lfarlc; + WORD e_ovno; + WORD e_res[4]; + WORD e_oemid; + WORD e_oeminfo; + WORD e_res2[10]; + LONG e_lfanew; +} IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER; +typedef struct _IMAGE_OS2_HEADER { + WORD ne_magic; + CHAR ne_ver; + CHAR ne_rev; + WORD ne_enttab; + WORD ne_cbenttab; + LONG ne_crc; + WORD ne_flags; + WORD ne_autodata; + WORD ne_heap; + WORD ne_stack; + LONG ne_csip; + LONG ne_sssp; + WORD ne_cseg; + WORD ne_cmod; + WORD ne_cbnrestab; + WORD ne_segtab; + WORD ne_rsrctab; + WORD ne_restab; + WORD ne_modtab; + WORD ne_imptab; + LONG ne_nrestab; + WORD ne_cmovent; + WORD ne_align; + WORD ne_cres; + BYTE ne_exetyp; + BYTE ne_flagsothers; + WORD ne_pretthunks; + WORD ne_psegrefbytes; + WORD ne_swaparea; + WORD ne_expver; +} IMAGE_OS2_HEADER,*PIMAGE_OS2_HEADER; +#pragma pack(pop) +#pragma pack(push,4) +typedef struct _IMAGE_NT_HEADERS { + DWORD Signature; + IMAGE_FILE_HEADER FileHeader; + IMAGE_OPTIONAL_HEADER OptionalHeader; +} IMAGE_NT_HEADERS,*PIMAGE_NT_HEADERS; +typedef struct _IMAGE_ROM_HEADERS { + IMAGE_FILE_HEADER FileHeader; + IMAGE_ROM_OPTIONAL_HEADER OptionalHeader; +} IMAGE_ROM_HEADERS,*PIMAGE_ROM_HEADERS; +typedef struct _IMAGE_SECTION_HEADER { + BYTE Name[IMAGE_SIZEOF_SHORT_NAME]; + union { + DWORD PhysicalAddress; + DWORD VirtualSize; + } Misc; + DWORD VirtualAddress; + DWORD SizeOfRawData; + DWORD PointerToRawData; + DWORD PointerToRelocations; + DWORD PointerToLinenumbers; + WORD NumberOfRelocations; + WORD NumberOfLinenumbers; + DWORD Characteristics; +} IMAGE_SECTION_HEADER,*PIMAGE_SECTION_HEADER; +#pragma pack(pop) +#pragma pack(push,2) +typedef struct _IMAGE_SYMBOL { + union { + BYTE ShortName[8]; + struct { + DWORD Short; + DWORD Long; + } Name; + PBYTE LongName[2]; + } N; + DWORD Value; + SHORT SectionNumber; + WORD Type; + BYTE StorageClass; + BYTE NumberOfAuxSymbols; +} IMAGE_SYMBOL,*PIMAGE_SYMBOL; +typedef union _IMAGE_AUX_SYMBOL { + struct { + DWORD TagIndex; + union { + struct { + WORD Linenumber; + WORD Size; + } LnSz; + DWORD TotalSize; + } Misc; + union { + struct { + DWORD PointerToLinenumber; + DWORD PointerToNextFunction; + } Function; + struct { + WORD Dimension[4]; + } Array; + } FcnAry; + WORD TvIndex; + } Sym; + struct { + BYTE Name[IMAGE_SIZEOF_SYMBOL]; + } File; + struct { + DWORD Length; + WORD NumberOfRelocations; + WORD NumberOfLinenumbers; + DWORD CheckSum; + SHORT Number; + BYTE Selection; + } Section; +} IMAGE_AUX_SYMBOL,*PIMAGE_AUX_SYMBOL; +typedef struct _IMAGE_COFF_SYMBOLS_HEADER { + DWORD NumberOfSymbols; + DWORD LvaToFirstSymbol; + DWORD NumberOfLinenumbers; + DWORD LvaToFirstLinenumber; + DWORD RvaToFirstByteOfCode; + DWORD RvaToLastByteOfCode; + DWORD RvaToFirstByteOfData; + DWORD RvaToLastByteOfData; +} IMAGE_COFF_SYMBOLS_HEADER,*PIMAGE_COFF_SYMBOLS_HEADER; +typedef struct _IMAGE_RELOCATION { + _ANONYMOUS_UNION union { + DWORD VirtualAddress; + DWORD RelocCount; + } DUMMYUNIONNAME; + DWORD SymbolTableIndex; + WORD Type; +} IMAGE_RELOCATION,*PIMAGE_RELOCATION; +#pragma pack(pop) +#pragma pack(push,4) +typedef struct _IMAGE_BASE_RELOCATION { + DWORD VirtualAddress; + DWORD SizeOfBlock; +} IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION; +#pragma pack(pop) +#pragma pack(push,2) +typedef struct _IMAGE_LINENUMBER { + union { + DWORD SymbolTableIndex; + DWORD VirtualAddress; + } Type; + WORD Linenumber; +} IMAGE_LINENUMBER,*PIMAGE_LINENUMBER; +#pragma pack(pop) +#pragma pack(push,4) +typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER { + BYTE Name[16]; + BYTE Date[12]; + BYTE UserID[6]; + BYTE GroupID[6]; + BYTE Mode[8]; + BYTE Size[10]; + BYTE EndHeader[2]; +} IMAGE_ARCHIVE_MEMBER_HEADER,*PIMAGE_ARCHIVE_MEMBER_HEADER; +typedef struct _IMAGE_EXPORT_DIRECTORY { + DWORD Characteristics; + DWORD TimeDateStamp; + WORD MajorVersion; + WORD MinorVersion; + DWORD Name; + DWORD Base; + DWORD NumberOfFunctions; + DWORD NumberOfNames; + PDWORD *AddressOfFunctions; + PDWORD *AddressOfNames; + PWORD *AddressOfNameOrdinals; +} IMAGE_EXPORT_DIRECTORY,*PIMAGE_EXPORT_DIRECTORY; +typedef struct _IMAGE_IMPORT_BY_NAME { + WORD Hint; + BYTE Name[1]; +} IMAGE_IMPORT_BY_NAME,*PIMAGE_IMPORT_BY_NAME; +typedef struct _IMAGE_THUNK_DATA { + union { + PBYTE ForwarderString; + PDWORD Function; + DWORD Ordinal; + PIMAGE_IMPORT_BY_NAME AddressOfData; + } u1; +} IMAGE_THUNK_DATA,*PIMAGE_THUNK_DATA; +typedef struct _IMAGE_IMPORT_DESCRIPTOR { + _ANONYMOUS_UNION union { + DWORD Characteristics; + PIMAGE_THUNK_DATA OriginalFirstThunk; + } DUMMYUNIONNAME; + DWORD TimeDateStamp; + DWORD ForwarderChain; + DWORD Name; + PIMAGE_THUNK_DATA FirstThunk; +} IMAGE_IMPORT_DESCRIPTOR,*PIMAGE_IMPORT_DESCRIPTOR; +typedef struct _IMAGE_BOUND_IMPORT_DESCRIPTOR { + DWORD TimeDateStamp; + WORD OffsetModuleName; + WORD NumberOfModuleForwarderRefs; +} IMAGE_BOUND_IMPORT_DESCRIPTOR,*PIMAGE_BOUND_IMPORT_DESCRIPTOR; +typedef struct _IMAGE_BOUND_FORWARDER_REF { + DWORD TimeDateStamp; + WORD OffsetModuleName; + WORD Reserved; +} IMAGE_BOUND_FORWARDER_REF,*PIMAGE_BOUND_FORWARDER_REF; +typedef void(NTAPI *PIMAGE_TLS_CALLBACK)(PVOID,DWORD,PVOID); +typedef struct _IMAGE_TLS_DIRECTORY { + DWORD StartAddressOfRawData; + DWORD EndAddressOfRawData; + PDWORD AddressOfIndex; + PIMAGE_TLS_CALLBACK *AddressOfCallBacks; + DWORD SizeOfZeroFill; + DWORD Characteristics; +} IMAGE_TLS_DIRECTORY,*PIMAGE_TLS_DIRECTORY; +typedef struct _IMAGE_RESOURCE_DIRECTORY { + DWORD Characteristics; + DWORD TimeDateStamp; + WORD MajorVersion; + WORD MinorVersion; + WORD NumberOfNamedEntries; + WORD NumberOfIdEntries; +} IMAGE_RESOURCE_DIRECTORY,*PIMAGE_RESOURCE_DIRECTORY; +/*_ANONYMOUS_STRUCT typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY { + _ANONYMOUS_UNION union { + _ANONYMOUS_STRUCT struct { + DWORD NameOffset:31; + DWORD NameIsString:1; + }DUMMYSTRUCTNAME; + DWORD Name; + WORD Id; + } DUMMYUNIONNAME; + _ANONYMOUS_UNION union { + DWORD OffsetToData; + _ANONYMOUS_STRUCT struct { + DWORD OffsetToDirectory:31; + DWORD DataIsDirectory:1; + } DUMMYSTRUCTNAME2; + } DUMMYUNIONNAME2; +} IMAGE_RESOURCE_DIRECTORY_ENTRY,*PIMAGE_RESOURCE_DIRECTORY_ENTRY; +*/ +typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING { + WORD Length; + CHAR NameString[1]; +} IMAGE_RESOURCE_DIRECTORY_STRING,*PIMAGE_RESOURCE_DIRECTORY_STRING; +typedef struct _IMAGE_RESOURCE_DIR_STRING_U { + WORD Length; + WCHAR NameString[1]; +} IMAGE_RESOURCE_DIR_STRING_U,*PIMAGE_RESOURCE_DIR_STRING_U; +typedef struct _IMAGE_RESOURCE_DATA_ENTRY { + DWORD OffsetToData; + DWORD Size; + DWORD CodePage; + DWORD Reserved; +} IMAGE_RESOURCE_DATA_ENTRY,*PIMAGE_RESOURCE_DATA_ENTRY; +typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY { + DWORD Characteristics; + DWORD TimeDateStamp; + WORD MajorVersion; + WORD MinorVersion; + DWORD GlobalFlagsClear; + DWORD GlobalFlagsSet; + DWORD CriticalSectionDefaultTimeout; + DWORD DeCommitFreeBlockThreshold; + DWORD DeCommitTotalFreeThreshold; + PVOID LockPrefixTable; + DWORD MaximumAllocationSize; + DWORD VirtualMemoryThreshold; + DWORD ProcessHeapFlags; + DWORD Reserved[4]; +} IMAGE_LOAD_CONFIG_DIRECTORY,*PIMAGE_LOAD_CONFIG_DIRECTORY; +typedef struct _IMAGE_RUNTIME_FUNCTION_ENTRY { + DWORD BeginAddress; + DWORD EndAddress; + PVOID ExceptionHandler; + PVOID HandlerData; + DWORD PrologEndAddress; +} IMAGE_RUNTIME_FUNCTION_ENTRY,*PIMAGE_RUNTIME_FUNCTION_ENTRY; +typedef struct _IMAGE_DEBUG_DIRECTORY { + DWORD Characteristics; + DWORD TimeDateStamp; + WORD MajorVersion; + WORD MinorVersion; + DWORD Type; + DWORD SizeOfData; + DWORD AddressOfRawData; + DWORD PointerToRawData; +} IMAGE_DEBUG_DIRECTORY,*PIMAGE_DEBUG_DIRECTORY; +typedef struct _FPO_DATA { + DWORD ulOffStart; + DWORD cbProcSize; + DWORD cdwLocals; + WORD cdwParams; + WORD cbProlog:8; + WORD cbRegs:3; + WORD fHasSEH:1; + WORD fUseBP:1; + WORD reserved:1; + WORD cbFrame:2; +} FPO_DATA,*PFPO_DATA; +typedef struct _IMAGE_DEBUG_MISC { + DWORD DataType; + DWORD Length; + BOOLEAN Unicode; + BYTE Reserved[3]; + BYTE Data[1]; +} IMAGE_DEBUG_MISC,*PIMAGE_DEBUG_MISC; +typedef struct _IMAGE_FUNCTION_ENTRY { + DWORD StartingAddress; + DWORD EndingAddress; + DWORD EndOfPrologue; +} IMAGE_FUNCTION_ENTRY,*PIMAGE_FUNCTION_ENTRY; +typedef struct _IMAGE_SEPARATE_DEBUG_HEADER { + WORD Signature; + WORD Flags; + WORD Machine; + WORD Characteristics; + DWORD TimeDateStamp; + DWORD CheckSum; + DWORD ImageBase; + DWORD SizeOfImage; + DWORD NumberOfSections; + DWORD ExportedNamesSize; + DWORD DebugDirectorySize; + DWORD Reserved[3]; +} IMAGE_SEPARATE_DEBUG_HEADER,*PIMAGE_SEPARATE_DEBUG_HEADER; +#pragma pack(pop) + // // Import Format // #define IMAGE_ORDINAL_FLAG 0x80000000 +#define IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff) // Predefined resource types ... there may be some more, but I don't have @@ -332,6 +752,10 @@ // set to indicate this. Otherwise the high bit is clear and the offset // field points to a resource data entry. // +typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY { + DWORD Name; + DWORD OffsetToData; +} IMAGE_RESOURCE_DIRECTORY_ENTRY, *PIMAGE_RESOURCE_DIRECTORY_ENTRY; /* typedef struct _IMAGE_RESOURCE_DIRECTORY { DWORD Characteristics; diff --git a/reactos/include/sockets.h b/reactos/include/sockets.h new file mode 100644 index 00000000000..11a8f51ac84 --- /dev/null +++ b/reactos/include/sockets.h @@ -0,0 +1,965 @@ +/* + Sockets.h + + Windows Sockets specification version 1.1 + + Copyright (C) 1996 Free Software Foundation, Inc. + Thanks to Linux header files for supplying many needed definitions + + Author: Scott Christley + Date: 1996 + + This file is part of the Windows32 API Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + If you are interested in a warranty or support for this source code, + contact Scott Christley for more information. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/*- + * Portions Copyright (c) 1980, 1983, 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * - + * Portions Copyright (c) 1993 by Digital Equipment Corporation. + * + * Permission to use, copy, modify and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies, and that + * the name of Digital Equipment Corporation not be used in advertising or + * publicity pertaining to distribution of the document or software without + * specific, written prior permission. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT + * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * - + * --Copyright-- + */ + +#ifndef _GNU_H_WINDOWS32_SOCKETS +#define _GNU_H_WINDOWS32_SOCKETS + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* BSD */ +#ifndef _SYS_TYPES_H +typedef unsigned char u_char; +typedef unsigned short u_short; +typedef unsigned int u_int; +typedef unsigned long u_long; +#endif + +/* + Default maximium number of sockets. + Define this before including Sockets.h to increase; this does not + mean that the underlying Windows Sockets implementation has to + support that many! + */ +#ifndef FD_SETSIZE +#define FD_SETSIZE 64 +#endif /* !FD_SETSIZE */ + +/* + These macros are critical to the usage of Windows Sockets. + According to the documentation, a SOCKET is no longer represented + by a "small non-negative integer"; so all programs MUST use these + macros for setting, initializing, clearing and checking the + fd_set structures. + */ + +typedef u_int SOCKET; + +/* fd_set may have been defined by the newlib . */ +#ifdef fd_set +#undef fd_set +#endif +typedef struct fd_set { + u_int fd_count; + SOCKET fd_array[FD_SETSIZE]; +} fd_set; + +/* Internal function, not documented except in winsock.h */ +extern int PASCAL __WSAFDIsSet(SOCKET, fd_set*); + +#ifdef FD_CLR +#undef FD_CLR +#endif +#define FD_CLR(fd, set) do { \ + u_int __i; \ + for (__i = 0; __i < ((fd_set*)(set))->fd_count ; __i++) { \ + if (((fd_set*)(set))->fd_array[__i] == fd) { \ + while (__i < ((fd_set*)(set))->fd_count-1) { \ + ((fd_set*)(set))->fd_array[__i] = \ + ((fd_set*)(set))->fd_array[__i+1]; \ + __i++; \ + } \ + ((fd_set*)(set))->fd_count--; \ + break; \ + } \ + } \ +} while(0) + +#ifdef FD_SET +#undef FD_SET +#endif +#define FD_SET(fd, set) do { \ + if (((fd_set*)(set))->fd_count < FD_SETSIZE) \ + ((fd_set*)(set))->fd_array[((fd_set*)(set))->fd_count++]=(fd);\ +} while(0) + +#ifdef FD_ZERO +#undef FD_ZERO +#endif +#define FD_ZERO(set) (((fd_set*)(set))->fd_count=0) + +#ifdef FD_ISSET +#undef FD_ISSET +#endif +#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set*)(set)) + +/* + time structures + */ +struct timeval { + long tv_sec; /* seconds */ + long tv_usec; /* microseconds */ +}; +struct timezone { + int tz_minuteswest; /* minutes west of Greenwich */ + int tz_dsttime; /* type of dst correction */ +}; + +/* + Operations on timevals. + + NB: timercmp does not work for >= or <=. + */ +#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) +#define timercmp(tvp, uvp, cmp) \ + (((tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) \ + || (tvp)->tv_sec cmp (uvp)->tv_sec) +#define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) + +/* + ioctl command encoding. + Some of this is different than what Linux has + */ +#define IOCPARM_MASK 0x7f +#define IOC_VOID 0x20000000 +#define IOC_OUT 0x40000000 +#define IOC_IN 0x80000000 +#define IOC_INOUT (IOC_IN | IOC_OUT) + +/* _IO(magic, subcode) */ +#define _IO(c,d) (IOC_VOID | ((c)<<8) | (d)) +/* _IOXX(magic, subcode, arg_t) */ +#define _IOW(c,d,t) (IOC_IN | (((long)sizeof(t) & IOCPARM_MASK)<<16) | \ + ((c)<<8) | (d)) +#define _IOR(c,d,t) (IOC_OUT | (((long)sizeof(t) & IOCPARM_MASK)<<16) | \ + ((c)<<8) | (d)) + +/* + This stuff is hard-coded on Linux + But winsock.h uses the macros defined above + */ +#define FIONREAD _IOR('f', 127, u_long) +#define FIONBIO _IOW('f', 126, u_long) +#define FIOASYNC _IOW('f', 125, u_long) + +#define SIOCSHIWAT _IOW('s', 0, u_long) +#define SIOCGHIWAT _IOR('s', 1, u_long) +#define SIOCSLOWAT _IOW('s', 2, u_long) +#define SIOCGLOWAT _IOR('s', 3, u_long) +#define SIOCATMARK _IOR('s', 7, u_long) + +/* + Structures returned by network data base library, taken from the + BSD file netdb.h. All addresses are supplied in host order, and + returned in network order (suitable for use in system calls). + + Slight modifications for differences between Linux and winsock.h + */ + +struct hostent { + char *h_name; /* official name of host */ + char **h_aliases; /* alias list */ + short h_addrtype; /* host address type */ + short h_length; /* length of address */ + char **h_addr_list; /* list of addresses */ +#define h_addr h_addr_list[0] /* address, for backward compat */ +}; + +/* + * Assumption here is that a network number + * fits in an unsigned long -- someday that won't be true! + */ +struct netent { + char *n_name; /* official name of net */ + char **n_aliases; /* alias list */ + short n_addrtype; /* net address type */ + u_long n_net; /* network # */ +}; + +struct servent { + char *s_name; /* official service name */ + char **s_aliases; /* alias list */ + short s_port; /* port # */ + char *s_proto; /* protocol to use */ +}; + +struct protoent { + char *p_name; /* official protocol name */ + char **p_aliases; /* alias list */ + short p_proto; /* protocol # */ +}; + +/* + Standard well-known IP protocols. + For some reason there are differences between Linx and winsock.h + */ +enum { + IPPROTO_IP = 0, + IPPROTO_ICMP = 1, + IPPROTO_GGP = 2, /* huh? */ + IPPROTO_IPIP = 4, + IPPROTO_TCP = 6, /* Transmission Control Protocol */ + IPPROTO_EGP = 8, + IPPROTO_PUP = 12, + IPPROTO_UDP = 17, /* User Datagram Protocol */ + IPPROTO_IDP = 22, + IPPROTO_ND = 77, /* This one was in winsock.h */ + + IPPROTO_RAW = 255, /* raw IP packets */ + IPPROTO_MAX +}; + +/* Standard well-known ports */ +enum { + IPPORT_ECHO = 7, + IPPORT_DISCARD = 9, + IPPORT_SYSTAT = 11, + IPPORT_DAYTIME = 13, + IPPORT_NETSTAT = 15, + IPPORT_FTP = 21, + IPPORT_TELNET = 23, + IPPORT_SMTP = 25, + IPPORT_TIMESERVER = 37, + IPPORT_NAMESERVER = 42, + IPPORT_WHOIS = 43, + IPPORT_MTP = 57, + + IPPORT_TFTP = 69, + IPPORT_RJE = 77, + IPPORT_FINGER = 79, + IPPORT_TTYLINK = 87, + IPPORT_SUPDUP = 95, + + IPPORT_EXECSERVER = 512, + IPPORT_LOGINSERVER = 513, + IPPORT_CMDSERVER = 514, + IPPORT_EFSSERVER = 520, + + /* UDP ports. */ + IPPORT_BIFFUDP = 512, + IPPORT_WHOSERVER = 513, + IPPORT_ROUTESERVER = 520, + + /* Ports less than this value are reservered for privileged processes. */ + IPPORT_RESERVED = 1024, + + /* Ports greater than this value are reserved for + (non-privileged) processes */ + IPPORT_USERRESERVED = 5000 +}; + +/* Link numbers. */ +#define IMPLINK_IP 155 +#define IMPLINK_LOWEXPER 156 +#define IMPLINK_HIGHEXPER 158 + +/* Linux uses a simple unsigned long int, but winsock.h ... */ +struct in_addr { + union { + struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b; + struct { u_short s_w1,s_w2; } S_un_w; + u_long S_addr; + } S_un; +#define s_addr S_un.S_addr +#define s_host S_un.S_un_b.s_b2 +#define s_net S_un.S_un_b.s_b1 +#define s_imp S_un.S_un_w.s_w2 +#define s_impno S_un.S_un_b.s_b4 +#define s_lh S_un.S_un_b.s_b3 +}; + +/* + Definitions of bits in internet address integers. + On subnets, host and network parts are found according + to the subnet mask, not these masks. + */ +#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0) +#define IN_CLASSA_NET 0xff000000 +#define IN_CLASSA_NSHIFT 24 +#define IN_CLASSA_HOST 0x00ffffff +#define IN_CLASSA_MAX 128 + +#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000) +#define IN_CLASSB_NET 0xffff0000 +#define IN_CLASSB_NSHIFT 16 +#define IN_CLASSB_HOST 0x0000ffff +#define IN_CLASSB_MAX 65536 + +#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000) +#define IN_CLASSC_NET 0xffffff00 +#define IN_CLASSC_NSHIFT 8 +#define IN_CLASSC_HOST 0x000000ff + +#define INADDR_ANY (u_long)0x00000000 +#define INADDR_LOOPBACK 0x7f000001 +#define INADDR_BROADCAST (u_long)0xffffffff +#define INADDR_NONE 0xffffffff + +/* + Structure describing an Internet (IP) socket address. + */ +struct sockaddr_in { + short sin_family; + u_short sin_port; + struct in_addr sin_addr; + char sin_zero[8]; +}; + +/* + EVERYTHING FROM THIS POINT IS MAINLY SPECIFIC TO Win32 + + Structure which holds the detail for the underlying Window Sockets + implementation. Set when WSAStartup() is called. + */ +#define WSADESCRIPTION_LEN 256 +#define WSASYS_STATUS_LEN 128 + +typedef struct WSAData { + WORD wVersion; + WORD wHighVersion; + char szDescription[WSADESCRIPTION_LEN+1]; + char szSystemStatus[WSASYS_STATUS_LEN+1]; + unsigned short iMaxSockets; + unsigned short iMaxUdpDg; + char *lpVendorInfo; +} WSADATA, *LPWSADATA; + +#define IP_OPTIONS 1 +#define IP_MULTICAST_IF 2 +#define IP_MULTICAST_TTL 3 +#define IP_MULTICAST_LOOP 4 +#define IP_ADD_MEMBERSHIP 5 +#define IP_DROP_MEMBERSHIP 6 + +#define IP_DEFAULT_MULTICAST_TTL 1 +#define IP_DEFAULT_MULTICAST_LOOP 1 +#define IP_MAX_MEMBERSHIPS 20 + +struct ip_mreq { + struct in_addr imr_multiaddr; + struct in_addr imr_interface; +}; + +/* + * Definitions related to sockets: types, address families, options, + * taken from the BSD file sys/socket.h. + */ + +/* + * This is used instead of -1, since the + * SOCKET type is unsigned. + */ +#define INVALID_SOCKET (SOCKET)(~0) +#define SOCKET_ERROR (-1) + +/* Socket types. */ +#define SOCK_STREAM 1 +#define SOCK_DGRAM 2 +#define SOCK_RAW 3 +#define SOCK_RDM 4 +#define SOCK_SEQPACKET 5 + +/* For setsockoptions(2) */ +#define SO_DEBUG 0x0001 +#define SO_ACCEPTCONN 0x0002 +#define SO_REUSEADDR 0x0004 +#define SO_KEEPALIVE 0x0008 +#define SO_DONTROUTE 0x0010 +#define SO_BROADCAST 0x0020 +#define SO_USELOOPBACK 0x0040 +#define SO_LINGER 0x0080 +#define SO_OOBINLINE 0x0100 + +#define SO_DONTLINGER (u_int)(~SO_LINGER) + +/* + * Additional options. + */ +#define SO_SNDBUF 0x1001 /* send buffer size */ +#define SO_RCVBUF 0x1002 /* receive buffer size */ +#define SO_SNDLOWAT 0x1003 /* send low-water mark */ +#define SO_RCVLOWAT 0x1004 /* receive low-water mark */ +#define SO_SNDTIMEO 0x1005 /* send timeout */ +#define SO_RCVTIMEO 0x1006 /* receive timeout */ +#define SO_ERROR 0x1007 /* get error status and clear */ +#define SO_TYPE 0x1008 /* get socket type */ + +/* + * Options for connect and disconnect data and options. Used only by + * non-TCP/IP transports such as DECNet, OSI TP4, etc. + */ +#define SO_CONNDATA 0x7000 +#define SO_CONNOPT 0x7001 +#define SO_DISCDATA 0x7002 +#define SO_DISCOPT 0x7003 +#define SO_CONNDATALEN 0x7004 +#define SO_CONNOPTLEN 0x7005 +#define SO_DISCDATALEN 0x7006 +#define SO_DISCOPTLEN 0x7007 + +/* + * Option for opening sockets for synchronous access. + */ +#define SO_OPENTYPE 0x7008 + +#define SO_SYNCHRONOUS_ALERT 0x10 +#define SO_SYNCHRONOUS_NONALERT 0x20 + +/* + * Other NT-specific options. + */ +#define SO_MAXDG 0x7009 +#define SO_MAXPATHDG 0x700A + +/* + * TCP options. + */ +#define TCP_NODELAY 0x0001 +#define TCP_BSDURGENT 0x7000 + +/* + * Address families. + */ +#define AF_UNSPEC 0 /* unspecified */ +#define AF_UNIX 1 /* local to host (pipes, portals) */ +#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ +#define AF_IMPLINK 3 /* arpanet imp addresses */ +#define AF_PUP 4 /* pup protocols: e.g. BSP */ +#define AF_CHAOS 5 /* mit CHAOS protocols */ +#define AF_IPX 6 /* IPX and SPX */ +#define AF_NS 6 /* XEROX NS protocols */ +#define AF_ISO 7 /* ISO protocols */ +#define AF_OSI AF_ISO /* OSI is ISO */ +#define AF_ECMA 8 /* european computer manufacturers */ +#define AF_DATAKIT 9 /* datakit protocols */ +#define AF_CCITT 10 /* CCITT protocols, X.25 etc */ +#define AF_SNA 11 /* IBM SNA */ +#define AF_DECnet 12 /* DECnet */ +#define AF_DLI 13 /* Direct data link interface */ +#define AF_LAT 14 /* LAT */ +#define AF_HYLINK 15 /* NSC Hyperchannel */ +#define AF_APPLETALK 16 /* AppleTalk */ +#define AF_NETBIOS 17 /* NetBios-style addresses */ + +#define AF_MAX 18 + +/* + * Structure used by kernel to store most + * addresses. + */ +struct sockaddr { + u_short sa_family; + char sa_data[14]; +}; + +/* + * Structure used by kernel to pass protocol + * information in raw sockets. + */ +struct sockproto { + u_short sp_family; + u_short sp_protocol; +}; + +/* + * Protocol families, same as address families for now. + */ +#define PF_UNSPEC AF_UNSPEC +#define PF_UNIX AF_UNIX +#define PF_INET AF_INET +#define PF_IMPLINK AF_IMPLINK +#define PF_PUP AF_PUP +#define PF_CHAOS AF_CHAOS +#define PF_NS AF_NS +#define PF_IPX AF_IPX +#define PF_ISO AF_ISO +#define PF_OSI AF_OSI +#define PF_ECMA AF_ECMA +#define PF_DATAKIT AF_DATAKIT +#define PF_CCITT AF_CCITT +#define PF_SNA AF_SNA +#define PF_DECnet AF_DECnet +#define PF_DLI AF_DLI +#define PF_LAT AF_LAT +#define PF_HYLINK AF_HYLINK +#define PF_APPLETALK AF_APPLETALK + +#define PF_MAX AF_MAX + +/* + * Structure used for manipulating linger option. + */ +struct linger { + u_short l_onoff; + u_short l_linger; +}; + +/* + * Level number for (get/set)sockopt() to apply to socket itself. + */ +#define SOL_SOCKET 0xffff /* options for socket level */ + +/* + * Maximum queue length specifiable by listen. + */ +#define SOMAXCONN 5 + +#define MSG_OOB 0x1 /* process out-of-band data */ +#define MSG_PEEK 0x2 /* peek at incoming message */ +#define MSG_DONTROUTE 0x4 /* send without using routing tables */ + +#define MSG_MAXIOVLEN 16 + +#define MSG_PARTIAL 0x8000 /* partial send or recv for message xport */ + +/* + * Define constant based on rfc883, used by gethostbyxxxx() calls. + */ +#define MAXGETHOSTSTRUCT 1024 +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN MAXGETHOSTSTRUCT +#endif + +/* + * Define flags to be used with the WSAAsyncSelect() call. + */ +#define FD_READ 0x01 +#define FD_WRITE 0x02 +#define FD_OOB 0x04 +#define FD_ACCEPT 0x08 +#define FD_CONNECT 0x10 +#define FD_CLOSE 0x20 + +/* + * All Windows Sockets error constants are biased by WSABASEERR from + * the "normal" + */ +#define WSABASEERR 10000 +/* + * Windows Sockets definitions of regular Microsoft C error constants + */ +#define WSAEINTR (WSABASEERR+4) +#define WSAEBADF (WSABASEERR+9) +#define WSAEACCES (WSABASEERR+13) +#define WSAEFAULT (WSABASEERR+14) +#define WSAEINVAL (WSABASEERR+22) +#define WSAEMFILE (WSABASEERR+24) + +/* + * Windows Sockets definitions of regular Berkeley error constants + */ +#define WSAEWOULDBLOCK (WSABASEERR+35) +#define WSAEINPROGRESS (WSABASEERR+36) +#define WSAEALREADY (WSABASEERR+37) +#define WSAENOTSOCK (WSABASEERR+38) +#define WSAEDESTADDRREQ (WSABASEERR+39) +#define WSAEMSGSIZE (WSABASEERR+40) +#define WSAEPROTOTYPE (WSABASEERR+41) +#define WSAENOPROTOOPT (WSABASEERR+42) +#define WSAEPROTONOSUPPORT (WSABASEERR+43) +#define WSAESOCKTNOSUPPORT (WSABASEERR+44) +#define WSAEOPNOTSUPP (WSABASEERR+45) +#define WSAEPFNOSUPPORT (WSABASEERR+46) +#define WSAEAFNOSUPPORT (WSABASEERR+47) +#define WSAEADDRINUSE (WSABASEERR+48) +#define WSAEADDRNOTAVAIL (WSABASEERR+49) +#define WSAENETDOWN (WSABASEERR+50) +#define WSAENETUNREACH (WSABASEERR+51) +#define WSAENETRESET (WSABASEERR+52) +#define WSAECONNABORTED (WSABASEERR+53) +#define WSAECONNRESET (WSABASEERR+54) +#define WSAENOBUFS (WSABASEERR+55) +#define WSAEISCONN (WSABASEERR+56) +#define WSAENOTCONN (WSABASEERR+57) +#define WSAESHUTDOWN (WSABASEERR+58) +#define WSAETOOMANYREFS (WSABASEERR+59) +#define WSAETIMEDOUT (WSABASEERR+60) +#define WSAECONNREFUSED (WSABASEERR+61) +#define WSAELOOP (WSABASEERR+62) +#define WSAENAMETOOLONG (WSABASEERR+63) +#define WSAEHOSTDOWN (WSABASEERR+64) +#define WSAEHOSTUNREACH (WSABASEERR+65) +#define WSAENOTEMPTY (WSABASEERR+66) +#define WSAEPROCLIM (WSABASEERR+67) +#define WSAEUSERS (WSABASEERR+68) +#define WSAEDQUOT (WSABASEERR+69) +#define WSAESTALE (WSABASEERR+70) +#define WSAEREMOTE (WSABASEERR+71) + +#define WSAEDISCON (WSABASEERR+101) + +/* + * Extended Windows Sockets error constant definitions + */ +#define WSASYSNOTREADY (WSABASEERR+91) +#define WSAVERNOTSUPPORTED (WSABASEERR+92) +#define WSANOTINITIALISED (WSABASEERR+93) + +/* + * Error return codes from gethostbyname() and gethostbyaddr() + * (when using the resolver). Note that these errors are + * retrieved via WSAGetLastError() and must therefore follow + * the rules for avoiding clashes with error numbers from + * specific implementations or language run-time systems. + * For this reason the codes are based at WSABASEERR+1001. + * Note also that [WSA]NO_ADDRESS is defined only for + * compatibility purposes. + */ + +#define h_errno WSAGetLastError() + +/* Authoritative Answer: Host not found */ +#define WSAHOST_NOT_FOUND (WSABASEERR+1001) +#define HOST_NOT_FOUND WSAHOST_NOT_FOUND + +/* Non-Authoritative: Host not found, or SERVERFAIL */ +#define WSATRY_AGAIN (WSABASEERR+1002) +#define TRY_AGAIN WSATRY_AGAIN + +/* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ +#define WSANO_RECOVERY (WSABASEERR+1003) +#define NO_RECOVERY WSANO_RECOVERY + +/* Valid name, no data record of requested type */ +#define WSANO_DATA (WSABASEERR+1004) +#define NO_DATA WSANO_DATA + +/* no address, look for MX record */ +#define WSANO_ADDRESS WSANO_DATA +#define NO_ADDRESS WSANO_ADDRESS + +/* + * Windows Sockets errors redefined as regular Berkeley error constants. + * These are commented out in Windows NT to avoid conflicts with errno.h. + * Use the WSA constants instead. + */ +#if 0 +#define EWOULDBLOCK WSAEWOULDBLOCK +#define EINPROGRESS WSAEINPROGRESS +#define EALREADY WSAEALREADY +#define ENOTSOCK WSAENOTSOCK +#define EDESTADDRREQ WSAEDESTADDRREQ +#define EMSGSIZE WSAEMSGSIZE +#define EPROTOTYPE WSAEPROTOTYPE +#define ENOPROTOOPT WSAENOPROTOOPT +#define EPROTONOSUPPORT WSAEPROTONOSUPPORT +#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +#define EOPNOTSUPP WSAEOPNOTSUPP +#define EPFNOSUPPORT WSAEPFNOSUPPORT +#define EAFNOSUPPORT WSAEAFNOSUPPORT +#define EADDRINUSE WSAEADDRINUSE +#define EADDRNOTAVAIL WSAEADDRNOTAVAIL +#define ENETDOWN WSAENETDOWN +#define ENETUNREACH WSAENETUNREACH +#define ENETRESET WSAENETRESET +#define ECONNABORTED WSAECONNABORTED +#define ECONNRESET WSAECONNRESET +#define ENOBUFS WSAENOBUFS +#define EISCONN WSAEISCONN +#define ENOTCONN WSAENOTCONN +#define ESHUTDOWN WSAESHUTDOWN +#define ETOOMANYREFS WSAETOOMANYREFS +#define ETIMEDOUT WSAETIMEDOUT +#define ECONNREFUSED WSAECONNREFUSED +#define ELOOP WSAELOOP +#define ENAMETOOLONG WSAENAMETOOLONG +#define EHOSTDOWN WSAEHOSTDOWN +#define EHOSTUNREACH WSAEHOSTUNREACH +#define ENOTEMPTY WSAENOTEMPTY +#define EPROCLIM WSAEPROCLIM +#define EUSERS WSAEUSERS +#define EDQUOT WSAEDQUOT +#define ESTALE WSAESTALE +#define EREMOTE WSAEREMOTE +#endif + +/* Socket function prototypes */ + +SOCKET PASCAL accept (SOCKET s, struct sockaddr *addr, + int *addrlen); + +int PASCAL bind (SOCKET s, const struct sockaddr *addr, int namelen); + +int PASCAL closesocket (SOCKET s); + +int PASCAL connect (SOCKET s, const struct sockaddr *name, int namelen); + +int PASCAL ioctlsocket (SOCKET s, long cmd, u_long *argp); + +int PASCAL getpeername (SOCKET s, struct sockaddr *name, + int * namelen); + +int PASCAL getsockname (SOCKET s, struct sockaddr *name, + int * namelen); + +int PASCAL getsockopt (SOCKET s, int level, int optname, + char * optval, int *optlen); + +u_long PASCAL htonl (u_long hostlong); + +/* For some reason WSOCK.LIB has htons defined as a 4 byte paramter?! */ +#ifdef _WIN32 +u_short PASCAL htons (u_long hostshort); +#else +u_short PASCAL htons (u_short hostshort); +#endif /* _WIN32 */ + +unsigned long PASCAL inet_addr (const char * cp); + +char * PASCAL inet_ntoa (struct in_addr in); + +int PASCAL listen (SOCKET s, int backlog); + +u_long PASCAL ntohl (u_long netlong); + +/* For some reason WSOCK.LIB has ntohs defined as a 4 byte paramter?! */ +#ifdef _WIN32 +u_short PASCAL ntohs (u_long netshort); +#else +u_short PASCAL ntohs (u_short netshort); +#endif /* _WIN32 */ + +int PASCAL recv (SOCKET s, char * buf, int len, int flags); + +int PASCAL recvfrom (SOCKET s, char * buf, int len, int flags, + struct sockaddr *from, int * fromlen); + +int PASCAL select (int nfds, fd_set *readfds, fd_set *writefds, + fd_set *exceptfds, const struct timeval *timeout); + +int PASCAL send (SOCKET s, const char * buf, int len, int flags); + +int PASCAL sendto (SOCKET s, const char * buf, int len, int flags, + const struct sockaddr *to, int tolen); + +int PASCAL setsockopt (SOCKET s, int level, int optname, + const char * optval, int optlen); + +int PASCAL shutdown (SOCKET s, int how); + +SOCKET PASCAL socket (int af, int type, int protocol); + +/* Database function prototypes */ + +struct hostent * PASCAL gethostbyaddr(const char * addr, + int len, int type); + +struct hostent * PASCAL gethostbyname(const char * name); + +int PASCAL gethostname (char * name, int namelen); + +struct servent * PASCAL getservbyport(int port, const char * proto); + +struct servent * PASCAL getservbyname(const char * name, + const char * proto); + +struct protoent * PASCAL getprotobynumber(int proto); + +struct protoent * PASCAL getprotobyname(const char * name); + +/* Microsoft Windows Extension function prototypes */ + +/* int PASCAL WSAStartup(WORD wVersionRequired, LPWSADATA lpWSAData); */ +int PASCAL WSAStartup(int wVersionRequired, LPWSADATA lpWSAData); + + +int PASCAL WSACleanup(void); + +void PASCAL WSASetLastError(int iError); + +int PASCAL WSAGetLastError(void); + +WINBOOL PASCAL WSAIsBlocking(void); + +int PASCAL WSAUnhookBlockingHook(void); + +FARPROC PASCAL WSASetBlockingHook(FARPROC lpBlockFunc); + +int PASCAL WSACancelBlockingCall(void); + +HANDLE PASCAL WSAAsyncGetServByName(HWND hWnd, u_int wMsg, + const char * name, + const char * proto, + char * buf, int buflen); + +HANDLE PASCAL WSAAsyncGetServByPort(HWND hWnd, u_int wMsg, int port, + const char * proto, char * buf, + int buflen); + +HANDLE PASCAL WSAAsyncGetProtoByName(HWND hWnd, u_int wMsg, + const char * name, char * buf, + int buflen); + +HANDLE PASCAL WSAAsyncGetProtoByNumber(HWND hWnd, u_int wMsg, + int number, char * buf, + int buflen); + +HANDLE PASCAL WSAAsyncGetHostByName(HWND hWnd, u_int wMsg, + const char * name, char * buf, + int buflen); + +HANDLE PASCAL WSAAsyncGetHostByAddr(HWND hWnd, u_int wMsg, + const char * addr, int len, int type, + char * buf, int buflen); + +int PASCAL WSACancelAsyncRequest(HANDLE hAsyncTaskHandle); + +int PASCAL WSAAsyncSelect(SOCKET s, HWND hWnd, u_int wMsg, + long lEvent); + +int PASCAL WSARecvEx (SOCKET s, char * buf, int len, int *flags); + +/* Microsoft Windows Extended data types */ +typedef struct sockaddr SOCKADDR; +typedef struct sockaddr *PSOCKADDR; +typedef struct sockaddr *LPSOCKADDR; + +typedef struct sockaddr_in SOCKADDR_IN; +typedef struct sockaddr_in *PSOCKADDR_IN; +typedef struct sockaddr_in *LPSOCKADDR_IN; + +typedef struct linger LINGER; +typedef struct linger *PLINGER; +typedef struct linger *LPLINGER; + +typedef struct in_addr IN_ADDR; +typedef struct in_addr *PIN_ADDR; +typedef struct in_addr *LPIN_ADDR; + +typedef struct fd_set FD_SET; +typedef struct fd_set *PFD_SET; +typedef struct fd_set *LPFD_SET; + +typedef struct hostent HOSTENT; +typedef struct hostent *PHOSTENT; +typedef struct hostent *LPHOSTENT; + +typedef struct servent SERVENT; +typedef struct servent *PSERVENT; +typedef struct servent *LPSERVENT; + +typedef struct protoent PROTOENT; +typedef struct protoent *PPROTOENT; +typedef struct protoent *LPPROTOENT; + +typedef struct timeval TIMEVAL; +typedef struct timeval *PTIMEVAL; +typedef struct timeval *LPTIMEVAL; + +/* + * Windows message parameter composition and decomposition + * macros. + * + * WSAMAKEASYNCREPLY is intended for use by the Windows Sockets implementation + * when constructing the response to a WSAAsyncGetXByY() routine. + */ +#define WSAMAKEASYNCREPLY(buflen,error) MAKELONG(buflen,error) +/* + * WSAMAKESELECTREPLY is intended for use by the Windows Sockets implementation + * when constructing the response to WSAAsyncSelect(). + */ +#define WSAMAKESELECTREPLY(event,error) MAKELONG(event,error) +/* + * WSAGETASYNCBUFLEN is intended for use by the Windows Sockets application + * to extract the buffer length from the lParam in the response + * to a WSAGetXByY(). + */ +#define WSAGETASYNCBUFLEN(lParam) LOWORD(lParam) +/* + * WSAGETASYNCERROR is intended for use by the Windows Sockets application + * to extract the error code from the lParam in the response + * to a WSAGetXByY(). + */ +#define WSAGETASYNCERROR(lParam) HIWORD(lParam) +/* + * WSAGETSELECTEVENT is intended for use by the Windows Sockets application + * to extract the event code from the lParam in the response + * to a WSAAsyncSelect(). + */ +#define WSAGETSELECTEVENT(lParam) LOWORD(lParam) +/* + * WSAGETSELECTERROR is intended for use by the Windows Sockets application + * to extract the error code from the lParam in the response + * to a WSAAsyncSelect(). + */ +#define WSAGETSELECTERROR(lParam) HIWORD(lParam) + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _GNU_H_WINDOWS32_SOCKETS */ diff --git a/reactos/include/structs.h b/reactos/include/structs.h new file mode 100644 index 00000000000..a8decaabcf6 --- /dev/null +++ b/reactos/include/structs.h @@ -0,0 +1,4460 @@ +/* + Structures.h + + Declarations for all the Windows32 API Structures + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the Windows32 API Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + If you are interested in a warranty or support for this source code, + contact Scott Christley for more information. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + + +#ifndef _GNU_H_WINDOWS32_STRUCTURES +#define _GNU_H_WINDOWS32_STRUCTURES + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct _VALENT +{ + LPTSTR ve_valuename; + DWORD ve_valuelen; + DWORD ve_valueptr; + DWORD ve_type; +} VALENT, *PVALENT; + +#ifndef WIN32_LEAN_AND_MEAN + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +typedef struct _ABC { + int abcA; + UINT abcB; + int abcC; +} ABC, *LPABC; + +typedef struct _ABCFLOAT { + FLOAT abcfA; + FLOAT abcfB; + FLOAT abcfC; +} ABCFLOAT, *LPABCFLOAT; + +typedef struct tagACCEL { + BYTE fVirt; + WORD key; + WORD cmd; +} ACCEL, *LPACCEL; + +typedef struct tagACCESSTIMEOUT { + UINT cbSize; + DWORD dwFlags; + DWORD iTimeOutMSec; +} ACCESSTIMEOUT; + +typedef struct _ACTION_HEADER { + ULONG transport_id; + USHORT action_code; + USHORT reserved; +} ACTION_HEADER; + +typedef struct _ADAPTER_STATUS { + UCHAR adapter_address[6]; + UCHAR rev_major; + UCHAR reserved0; + UCHAR adapter_type; + UCHAR rev_minor; + WORD duration; + WORD frmr_recv; + WORD frmr_xmit; + WORD iframe_recv_err; + WORD xmit_aborts; + DWORD xmit_success; + DWORD recv_success; + WORD iframe_xmit_err; + WORD recv_buff_unavail; + WORD t1_timeouts; + WORD ti_timeouts; + DWORD reserved1; + WORD free_ncbs; + WORD max_cfg_ncbs; + WORD max_ncbs; + WORD xmit_buf_unavail; + WORD max_dgram_size; + WORD pending_sess; + WORD max_cfg_sess; + WORD max_sess; + WORD max_sess_pkt_size; + WORD name_count; +} ADAPTER_STATUS; + +typedef struct _ADDJOB_INFO_1 { + LPTSTR Path; + DWORD JobId; +} ADDJOB_INFO_1; + +typedef struct tagANIMATIONINFO { + UINT cbSize; + int iMinAnimate; +} ANIMATIONINFO, *LPANIMATIONINFO; + +typedef struct _RECT { + LONG left; + LONG top; + LONG right; + LONG bottom; +} RECT, *LPRECT, *LPCRECT, *PRECT; + +typedef struct _RECTL { + LONG left; + LONG top; + LONG right; + LONG bottom; +} RECTL, *LPRECTL, *LPCRECTL, *PRECTL; + +typedef struct _AppBarData { + DWORD cbSize; + HWND hWnd; + UINT uCallbackMessage; + UINT uEdge; + RECT rc; + LPARAM lParam; +} APPBARDATA, *PAPPBARDATA; + +typedef struct tagBITMAP +{ + LONG bmType; + LONG bmWidth; + LONG bmHeight; + LONG bmWidthBytes; + WORD bmPlanes; + WORD bmBitsPixel; + LPVOID bmBits; +} BITMAP, *PBITMAP, *NPBITMAP, *LPBITMAP; + +typedef struct tagBITMAPCOREHEADER { + DWORD bcSize; + WORD bcWidth; + WORD bcHeight; + WORD bcPlanes; + WORD bcBitCount; +} BITMAPCOREHEADER; + +typedef struct tagRGBTRIPLE { + BYTE rgbtBlue; + BYTE rgbtGreen; + BYTE rgbtRed; +} RGBTRIPLE, *PRGBTRIPLE; + +typedef struct _BITMAPCOREINFO { + BITMAPCOREHEADER bmciHeader; + RGBTRIPLE bmciColors[1]; +} BITMAPCOREINFO, *PBITMAPCOREINFO, *LPBITMAPCOREINFO; + +typedef struct tagBITMAPFILEHEADER { + WORD bfType; + DWORD bfSize; + WORD bfReserved1; + WORD bfReserved2; + DWORD bfOffBits; +} BITMAPFILEHEADER __attribute__((packed)); + +typedef struct tagBITMAPINFOHEADER { + DWORD biSize; + LONG biWidth; + LONG biHeight; + WORD biPlanes; + WORD biBitCount; + DWORD biCompression; + DWORD biSizeImage; + LONG biXPelsPerMeter; + LONG biYPelsPerMeter; + DWORD biClrUsed; + DWORD biClrImportant; +} BITMAPINFOHEADER, *LPBITMAPINFOHEADER, *PBITMAPINFOHEADER; + +typedef struct tagRGBQUAD { + BYTE rgbBlue; + BYTE rgbGreen; + BYTE rgbRed; + BYTE rgbReserved; +} RGBQUAD; + +typedef struct tagBITMAPINFO { + BITMAPINFOHEADER bmiHeader; + RGBQUAD bmiColors[1]; +} BITMAPINFO, *LPBITMAPINFO, *PBITMAPINFO; + +typedef long FXPT2DOT30, * LPFXPT2DOT30; + +typedef struct tagCIEXYZ +{ + FXPT2DOT30 ciexyzX; + FXPT2DOT30 ciexyzY; + FXPT2DOT30 ciexyzZ; +} CIEXYZ; +typedef CIEXYZ * LPCIEXYZ; + +typedef struct tagCIEXYZTRIPLE +{ + CIEXYZ ciexyzRed; + CIEXYZ ciexyzGreen; + CIEXYZ ciexyzBlue; +} CIEXYZTRIPLE; +typedef CIEXYZTRIPLE * LPCIEXYZTRIPLE; + +typedef struct { + DWORD bV4Size; + LONG bV4Width; + LONG bV4Height; + WORD bV4Planes; + WORD bV4BitCount; + DWORD bV4V4Compression; + DWORD bV4SizeImage; + LONG bV4XPelsPerMeter; + LONG bV4YPelsPerMeter; + DWORD bV4ClrUsed; + DWORD bV4ClrImportant; + DWORD bV4RedMask; + DWORD bV4GreenMask; + DWORD bV4BlueMask; + DWORD bV4AlphaMask; + DWORD bV4CSType; + CIEXYZTRIPLE bV4Endpoints; + DWORD bV4GammaRed; + DWORD bV4GammaGreen; + DWORD bV4GammaBlue; +} BITMAPV4HEADER, *LPBITMAPV4HEADER, *PBITMAPV4HEADER; + +typedef struct _BLOB { + ULONG cbSize; + BYTE *pBlobData; +} BLOB; + +typedef struct _SHITEMID { + USHORT cb; + BYTE abID[1]; +} SHITEMID, * LPSHITEMID; +typedef const SHITEMID * LPCSHITEMID; + +typedef struct _ITEMIDLIST { + SHITEMID mkid; +} ITEMIDLIST, * LPITEMIDLIST; +typedef const ITEMIDLIST * LPCITEMIDLIST; + +typedef struct _browseinfo { + HWND hwndOwner; + LPCITEMIDLIST pidlRoot; + LPSTR pszDisplayName; + LPCSTR lpszTitle; + UINT ulFlags; + BFFCALLBACK lpfn; + LPARAM lParam; + int iImage; +} BROWSEINFO, *PBROWSEINFO, *LPBROWSEINFO; + +typedef struct _BY_HANDLE_FILE_INFORMATION { + DWORD dwFileAttributes; + FILETIME ftCreationTime; + FILETIME ftLastAccessTime; + FILETIME ftLastWriteTime; + DWORD dwVolumeSerialNumber; + DWORD nFileSizeHigh; + DWORD nFileSizeLow; + DWORD nNumberOfLinks; + DWORD nFileIndexHigh; + DWORD nFileIndexLow; +} BY_HANDLE_FILE_INFORMATION, *LPBY_HANDLE_FILE_INFORMATION; + +typedef struct _FIXED { + WORD fract; + short value; +} FIXED; + +typedef struct tagPOINT { + LONG x; + LONG y; +} POINT, *LPPOINT, *PPOINT; + +typedef struct tagPOINTFX { + FIXED x; + FIXED y; +} POINTFX; + +typedef struct _POINTL { + LONG x; + LONG y; +} POINTL, *PPOINTL; + +typedef struct tagPOINTS { + SHORT x; + SHORT y; +} POINTS; + +typedef struct _tagCANDIDATEFORM { + DWORD dwIndex; + DWORD dwStyle; + POINT ptCurrentPos; + RECT rcArea; +} CANDIDATEFORM, *LPCANDIDATEFORM; + +typedef struct _tagCANDIDATELIST { + DWORD dwSize; + DWORD dwStyle; + DWORD dwCount; + DWORD dwSelection; + DWORD dwPageStart; + DWORD dwPageSize; + DWORD dwOffset[1]; +} CANDIDATELIST, *LPCANDIDATELIST; + +typedef struct tagCREATESTRUCT { + LPVOID lpCreateParams; + HINSTANCE hInstance; + HMENU hMenu; + HWND hwndParent; + int cy; + int cx; + int y; + int x; + LONG style; + LPCTSTR lpszName; + LPCTSTR lpszClass; + DWORD dwExStyle; +} CREATESTRUCT, *LPCREATESTRUCT; + +typedef struct tagCREATESTRUCTA { + LPVOID lpCreateParams; + HINSTANCE hInstance; + HMENU hMenu; + HWND hwndParent; + int cy; + int cx; + int y; + int x; + LONG style; + LPCSTR lpszName; + LPCSTR lpszClass; + DWORD dwExStyle; +} CREATESTRUCTA, *LPCREATESTRUCTA; + +typedef struct tagCREATESTRUCTW { + LPVOID lpCreateParams; + HINSTANCE hInstance; + HMENU hMenu; + HWND hwndParent; + int cy; + int cx; + int y; + int x; + LONG style; + LPCWSTR lpszName; + LPCWSTR lpszClass; + DWORD dwExStyle; +} CREATESTRUCTW, *LPCREATESTRUCTW; + +typedef struct tagCBT_CREATEWND { + LPCREATESTRUCT lpcs; + HWND hwndInsertAfter; +} CBT_CREATEWND; + +typedef struct tagCBTACTIVATESTRUCT { + WINBOOL fMouse; + HWND hWndActive; +} CBTACTIVATESTRUCT; + +typedef struct _CHAR_INFO { + union { + WCHAR UnicodeChar; + CHAR AsciiChar; + } Char; + WORD Attributes; +} CHAR_INFO, *PCHAR_INFO; + +typedef struct _charformat { + UINT cbSize; + DWORD dwMask; + DWORD dwEffects; + LONG yHeight; + LONG yOffset; + COLORREF crTextColor; + BYTE bCharSet; + BYTE bPitchAndFamily; + TCHAR szFaceName[LF_FACESIZE]; +} CHARFORMAT; + +typedef struct _charrange { + LONG cpMin; + LONG cpMax; +} CHARRANGE; + +typedef struct tagCHARSET { + DWORD aflBlock[3]; + DWORD flLang; +} CHARSET; + +typedef struct tagFONTSIGNATURE { + DWORD fsUsb[4]; + DWORD fsCsb[2]; +} FONTSIGNATURE, *LPFONTSIGNATURE; + +typedef struct { + UINT ciCharset; + UINT ciACP; + FONTSIGNATURE fs; +} CHARSETINFO, *LPCHARSETINFO; + +typedef struct { + DWORD lStructSize; + HWND hwndOwner; + HWND hInstance; + COLORREF rgbResult; + COLORREF* lpCustColors; + DWORD Flags; + LPARAM lCustData; + LPCCHOOKPROC lpfnHook; + LPCTSTR lpTemplateName; +} CHOOSECOLOR, *LPCHOOSECOLOR; + +typedef struct tagLOGFONT { + LONG lfHeight; + LONG lfWidth; + LONG lfEscapement; + LONG lfOrientation; + LONG lfWeight; + BYTE lfItalic; + BYTE lfUnderline; + BYTE lfStrikeOut; + BYTE lfCharSet; + BYTE lfOutPrecision; + BYTE lfClipPrecision; + BYTE lfQuality; + BYTE lfPitchAndFamily; + TCHAR lfFaceName[LF_FACESIZE]; +} LOGFONT, *LPLOGFONT, *PLOGFONT; + +typedef struct tagLOGFONTW { + LONG lfHeight; + LONG lfWidth; + LONG lfEscapement; + LONG lfOrientation; + LONG lfWeight; + BYTE lfItalic; + BYTE lfUnderline; + BYTE lfStrikeOut; + BYTE lfCharSet; + BYTE lfOutPrecision; + BYTE lfClipPrecision; + BYTE lfQuality; + BYTE lfPitchAndFamily; + LPWSTR lfFaceName; +} LOGFONTW, *LPLOGFONTW, *PLOGFONTW; + +typedef struct { + DWORD lStructSize; + HWND hwndOwner; + HDC hDC; + LPLOGFONT lpLogFont; + INT iPointSize; + DWORD Flags; + DWORD rgbColors; + LPARAM lCustData; + LPCFHOOKPROC lpfnHook; + LPCTSTR lpTemplateName; + HINSTANCE hInstance; + LPTSTR lpszStyle; + WORD nFontType; + WORD ___MISSING_ALIGNMENT__; + INT nSizeMin; + INT nSizeMax; +} CHOOSEFONT, *LPCHOOSEFONT; + +typedef struct _IDA { + UINT cidl; + UINT aoffset[1]; +} CIDA, * LPIDA; + +typedef struct tagCLIENTCREATESTRUCT { + HANDLE hWindowMenu; + UINT idFirstChild; +} CLIENTCREATESTRUCT; + +typedef CLIENTCREATESTRUCT *LPCLIENTCREATESTRUCT; + +typedef struct _CMInvokeCommandInfo { + DWORD cbSize; + DWORD fMask; + HWND hwnd; + LPCSTR lpVerb; + LPCSTR lpParameters; + LPCSTR lpDirectory; + int nShow; + DWORD dwHotKey; + HANDLE hIcon; +} CMINVOKECOMMANDINFO, *LPCMINVOKECOMMANDINFO; + +typedef struct tagCOLORADJUSTMENT { + WORD caSize; + WORD caFlags; + WORD caIlluminantIndex; + WORD caRedGamma; + WORD caGreenGamma; + WORD caBlueGamma; + WORD caReferenceBlack; + WORD caReferenceWhite; + SHORT caContrast; + SHORT caBrightness; + SHORT caColorfulness; + SHORT caRedGreenTint; +} COLORADJUSTMENT, *LPCOLORADJUSTMENT; + +typedef struct _COLORMAP { + COLORREF from; + COLORREF to; +} COLORMAP, * LPCOLORMAP; + +typedef struct _DCB { + DWORD DCBlength; + DWORD BaudRate; + DWORD fBinary: 1; + DWORD fParity: 1; + DWORD fOutxCtsFlow:1; + DWORD fOutxDsrFlow:1; + DWORD fDtrControl:2; + DWORD fDsrSensitivity:1; + DWORD fTXContinueOnXoff:1; + DWORD fOutX: 1; + DWORD fInX: 1; + DWORD fErrorChar: 1; + DWORD fNull: 1; + DWORD fRtsControl:2; + DWORD fAbortOnError:1; + DWORD fDummy2:17; + WORD wReserved; + WORD XonLim; + WORD XoffLim; + BYTE ByteSize; + BYTE Parity; + BYTE StopBits; + char XonChar; + char XoffChar; + char ErrorChar; + char EofChar; + char EvtChar; + WORD wReserved1; +} DCB, *LPDCB; + +typedef struct _COMM_CONFIG { + DWORD dwSize; + WORD wVersion; + WORD wReserved; + DCB dcb; + DWORD dwProviderSubType; + DWORD dwProviderOffset; + DWORD dwProviderSize; + WCHAR wcProviderData[1]; +} COMMCONFIG, *LPCOMMCONFIG; + +typedef struct _COMMPROP { + WORD wPacketLength; + WORD wPacketVersion; + DWORD dwServiceMask; + DWORD dwReserved1; + DWORD dwMaxTxQueue; + DWORD dwMaxRxQueue; + DWORD dwMaxBaud; + DWORD dwProvSubType; + DWORD dwProvCapabilities; + DWORD dwSettableParams; + DWORD dwSettableBaud; + WORD wSettableData; + WORD wSettableStopParity; + DWORD dwCurrentTxQueue; + DWORD dwCurrentRxQueue; + DWORD dwProvSpec1; + DWORD dwProvSpec2; + WCHAR wcProvChar[1]; +} COMMPROP, *LPCOMMPROP; + +typedef struct _COMMTIMEOUTS { + DWORD ReadIntervalTimeout; + DWORD ReadTotalTimeoutMultiplier; + DWORD ReadTotalTimeoutConstant; + DWORD WriteTotalTimeoutMultiplier; + DWORD WriteTotalTimeoutConstant; +} COMMTIMEOUTS,*LPCOMMTIMEOUTS; + +typedef struct tagCOMPAREITEMSTRUCT { + UINT CtlType; + UINT CtlID; + HWND hwndItem; + UINT itemID1; + DWORD itemData1; + UINT itemID2; + DWORD itemData2; +} COMPAREITEMSTRUCT; + +typedef struct { + COLORREF crText; + COLORREF crBackground; + DWORD dwEffects; +} COMPCOLOR; + +typedef struct _tagCOMPOSITIONFORM { + DWORD dwStyle; + POINT ptCurrentPos; + RECT rcArea; +} COMPOSITIONFORM, *LPCOMPOSITIONFORM; + +typedef struct _COMSTAT { + DWORD fCtsHold : 1; + DWORD fDsrHold : 1; + DWORD fRlsdHold : 1; + DWORD fXoffHold : 1; + DWORD fXoffSent : 1; + DWORD fEof : 1; + DWORD fTxim : 1; + DWORD fReserved : 25; + DWORD cbInQue; + DWORD cbOutQue; +} COMSTAT, *LPCOMSTAT; + +typedef struct tagCONVCONTEXT { + UINT cb; + UINT wFlags; + UINT wCountryID; + int iCodePage; + DWORD dwLangID; + DWORD dwSecurity; + SECURITY_QUALITY_OF_SERVICE qos; +} CONVCONTEXT; + +typedef CONVCONTEXT *PCONVCONTEXT; + +typedef struct tagCONVINFO { + DWORD cb; + DWORD hUser; + HCONV hConvPartner; + HSZ hszSvcPartner; + HSZ hszServiceReq; + HSZ hszTopic; + HSZ hszItem; + UINT wFmt; + UINT wType; + UINT wStatus; + UINT wConvst; + UINT wLastError; + HCONVLIST hConvList; + CONVCONTEXT ConvCtxt; + HWND hwnd; + HWND hwndPartner; +} CONVINFO, *PCONVINFO; + +typedef struct tagCOPYDATASTRUCT { + DWORD dwData; + DWORD cbData; + PVOID lpData; +} COPYDATASTRUCT; + +typedef struct _cpinfo { + UINT MaxCharSize; + BYTE DefaultChar[MAX_DEFAULTCHAR]; + BYTE LeadByte[MAX_LEADBYTES]; +} CPINFO, *LPCPINFO; + +typedef struct tagCPLINFO { + int idIcon; + int idName; + int idInfo; + LONG lData; +} CPLINFO; + +typedef struct _CREATE_PROCESS_DEBUG_INFO { + HANDLE hFile; + HANDLE hProcess; + HANDLE hThread; + LPVOID lpBaseOfImage; + DWORD dwDebugInfoFileOffset; + DWORD nDebugInfoSize; + LPVOID lpThreadLocalBase; + LPTHREAD_START_ROUTINE lpStartAddress; + LPVOID lpImageName; + WORD fUnicode; +} CREATE_PROCESS_DEBUG_INFO; + +typedef struct _CREATE_THREAD_DEBUG_INFO { + HANDLE hThread; + LPVOID lpThreadLocalBase; + LPTHREAD_START_ROUTINE lpStartAddress; +} CREATE_THREAD_DEBUG_INFO; + +/* + TODO: sockets +typedef struct _SOCKET_ADDRESS { + LPSOCKADDR lpSockaddr ; + INT iSockaddrLength ; +} SOCKET_ADDRESS, *PSOCKET_ADDRESS, *LPSOCKET_ADDRESS; +*/ + +/* +typedef struct _CSADDR_INFO { + SOCKET_ADDRESS LocalAddr; + SOCKET_ADDRESS RemoteAddr; + INT iSocketType; + INT iProtocol; +} CSADDR_INFO; +*/ + +typedef struct _currencyfmt { + UINT NumDigits; + UINT LeadingZero; + UINT Grouping; + LPTSTR lpDecimalSep; + LPTSTR lpThousandSep; + UINT NegativeOrder; + UINT PositiveOrder; + LPTSTR lpCurrencySymbol; +} CURRENCYFMT; + +typedef struct tagCURSORSHAPE { + int xHotSpot; + int yHotSpot; + int cx; + int cy; + int cbWidth; + BYTE Planes; + BYTE BitsPixel; +} CURSORSHAPE, *LPCURSORSHAPE; + +typedef struct tagCWPRETSTRUCT { + LRESULT lResult; + LPARAM lParam; + WPARAM wParam; + DWORD message; + HWND hwnd; +} CWPRETSTRUCT; + +typedef struct tagCWPSTRUCT { + LPARAM lParam; + WPARAM wParam; + UINT message; + HWND hwnd; +} CWPSTRUCT; + +typedef struct _DATATYPES_INFO_1 { + LPTSTR pName; +} DATATYPES_INFO_1; + +typedef struct { + unsigned short bAppReturnCode:8, + reserved:6, + fBusy:1, + fAck:1; +} DDEACK; + +typedef struct { + unsigned short reserved:14, + fDeferUpd:1, + fAckReq:1; + short cfFormat; +} DDEADVISE; + +typedef struct { + unsigned short unused:12, + fResponse:1, + fRelease:1, + reserved:1, + fAckReq:1; + short cfFormat; + BYTE Value[1]; +} DDEDATA; + +typedef struct { + unsigned short unused:13, + fRelease:1, + fDeferUpd:1, + fAckReq:1; + short cfFormat; +} DDELN; + +typedef struct tagDDEML_MSG_HOOK_DATA { + UINT uiLo; + UINT uiHi; + DWORD cbData; + DWORD Data[8]; +} DDEML_MSG_HOOK_DATA; + +typedef struct { + unsigned short unused:13, + fRelease:1, + fReserved:2; + short cfFormat; + BYTE Value[1]; +} DDEPOKE; + +typedef struct { + unsigned short unused:12, + fAck:1, + fRelease:1, + fReserved:1, + fAckReq:1; + short cfFormat; + BYTE rgb[1]; +} DDEUP; + +typedef struct _EXCEPTION_DEBUG_INFO { + EXCEPTION_RECORD ExceptionRecord; + DWORD dwFirstChance; +} EXCEPTION_DEBUG_INFO; + +typedef struct _EXIT_PROCESS_DEBUG_INFO { + DWORD dwExitCode; +} EXIT_PROCESS_DEBUG_INFO; + +typedef struct _EXIT_THREAD_DEBUG_INFO { + DWORD dwExitCode; +} EXIT_THREAD_DEBUG_INFO; + +typedef struct _LOAD_DLL_DEBUG_INFO { + HANDLE hFile; + LPVOID lpBaseOfDll; + DWORD dwDebugInfoFileOffset; + DWORD nDebugInfoSize; + LPVOID lpImageName; + WORD fUnicode; +} LOAD_DLL_DEBUG_INFO; + +typedef struct _UNLOAD_DLL_DEBUG_INFO { + LPVOID lpBaseOfDll; +} UNLOAD_DLL_DEBUG_INFO; + +typedef struct _OUTPUT_DEBUG_STRING_INFO { + LPSTR lpDebugStringData; + WORD fUnicode; + WORD nDebugStringLength; +} OUTPUT_DEBUG_STRING_INFO; + +typedef struct _RIP_INFO { + DWORD dwError; + DWORD dwType; +} RIP_INFO; + +typedef struct _DEBUG_EVENT { + DWORD dwDebugEventCode; + DWORD dwProcessId; + DWORD dwThreadId; + union { + EXCEPTION_DEBUG_INFO Exception; + CREATE_THREAD_DEBUG_INFO CreateThread; + CREATE_PROCESS_DEBUG_INFO CreateProcessInfo; + EXIT_THREAD_DEBUG_INFO ExitThread; + EXIT_PROCESS_DEBUG_INFO ExitProcess; + LOAD_DLL_DEBUG_INFO LoadDll; + UNLOAD_DLL_DEBUG_INFO UnloadDll; + OUTPUT_DEBUG_STRING_INFO DebugString; + RIP_INFO RipInfo; + } u; +} DEBUG_EVENT, *LPDEBUG_EVENT; + +typedef struct tagDEBUGHOOKINFO { + DWORD idThread; + DWORD idThreadInstaller; + LPARAM lParam; + WPARAM wParam; + int code; +} DEBUGHOOKINFO; + +typedef struct tagDELETEITEMSTRUCT { + UINT CtlType; + UINT CtlID; + UINT itemID; + HWND hwndItem; + UINT itemData; +} DELETEITEMSTRUCT; + +typedef struct _DEV_BROADCAST_HDR { + ULONG dbch_size; + ULONG dbch_devicetype; + ULONG dbch_reserved; +} DEV_BROADCAST_HDR; +typedef DEV_BROADCAST_HDR *PDEV_BROADCAST_HDR; + +typedef struct _DEV_BROADCAST_OEM { + ULONG dbco_size; + ULONG dbco_devicetype; + ULONG dbco_reserved; + ULONG dbco_identifier; + ULONG dbco_suppfunc; +} DEV_BROADCAST_OEM; +typedef DEV_BROADCAST_OEM *PDEV_BROADCAST_OEM; + +typedef struct _DEV_BROADCAST_PORT { + ULONG dbcp_size; + ULONG dbcp_devicetype; + ULONG dbcp_reserved; + char dbcp_name[1]; +} DEV_BROADCAST_PORT; +typedef DEV_BROADCAST_PORT *PDEV_BROADCAST_PORT; + +struct _DEV_BROADCAST_USERDEFINED { + struct _DEV_BROADCAST_HDR dbud_dbh; + char dbud_szName[1]; + BYTE dbud_rgbUserDefined[1]; +}; + +typedef struct _DEV_BROADCAST_VOLUME { + ULONG dbcv_size; + ULONG dbcv_devicetype; + ULONG dbcv_reserved; + ULONG dbcv_unitmask; + USHORT dbcv_flags; +} DEV_BROADCAST_VOLUME; +typedef DEV_BROADCAST_VOLUME *PDEV_BROADCAST_VOLUME; + +typedef struct tagDEVNAMES { + WORD wDriverOffset; + WORD wDeviceOffset; + WORD wOutputOffset; + WORD wDefault; +} DEVNAMES, *LPDEVNAMES; + +typedef struct tagDIBSECTION { + BITMAP dsBm; + BITMAPINFOHEADER dsBmih; + DWORD dsBitfields[3]; + HANDLE dshSection; + DWORD dsOffset; +} DIBSECTION; + +typedef struct _DISK_PERFORMANCE { + LARGE_INTEGER BytesRead; + LARGE_INTEGER BytesWritten; + LARGE_INTEGER ReadTime; + LARGE_INTEGER WriteTime; + DWORD ReadCount; + DWORD WriteCount; + DWORD QueueDepth; +} DISK_PERFORMANCE ; + +typedef struct { + DWORD style; + DWORD dwExtendedStyle; + short x; + short y; + short cx; + short cy; + WORD id; +} DLGITEMTEMPLATE PACKED; + +typedef DLGITEMTEMPLATE *LPDLGITEMTEMPLATE; +typedef DLGITEMTEMPLATE *PDLGITEMTEMPLATE; + +typedef struct { + DWORD style; + DWORD dwExtendedStyle; + WORD cdit; + short x; + short y; + short cx; + short cy; +} DLGTEMPLATE PACKED; + +typedef DLGTEMPLATE *LPDLGTEMPLATE; +typedef const DLGTEMPLATE *LPCDLGTEMPLATE; + +typedef struct _DOC_INFO_1 { + LPTSTR pDocName; + LPTSTR pOutputFile; + LPTSTR pDatatype; +} DOC_INFO_1; + +typedef struct _DOC_INFO_2 { + LPTSTR pDocName; + LPTSTR pOutputFile; + LPTSTR pDatatype; + DWORD dwMode; + DWORD JobId; +} DOC_INFO_2; + +typedef struct { + int cbSize; + LPCTSTR lpszDocName; + LPCTSTR lpszOutput; + LPCTSTR lpszDatatype; + DWORD fwType; +} DOCINFO, *PDOCINFO; + +typedef struct { + UINT uNotification; + HWND hWnd; + POINT ptCursor; +} DRAGLISTINFO, *LPDRAGLISTINFO; + +typedef struct tagDRAWITEMSTRUCT { + UINT CtlType; + UINT CtlID; + UINT itemID; + UINT itemAction; + UINT itemState; + HWND hwndItem; + HDC hDC; + RECT rcItem; + DWORD itemData; +} DRAWITEMSTRUCT, *LPDRAWITEMSTRUCT, *PDRAWITEMSTRUCT; + +typedef struct { + UINT cbSize; + int iTabLength; + int iLeftMargin; + int iRightMargin; + UINT uiLengthDrawn; +} DRAWTEXTPARAMS, *LPDRAWTEXTPARAMS; + + + +typedef struct _DRIVER_INFO_1 { + LPTSTR pName; +} DRIVER_INFO_1; + +typedef struct _DRIVER_INFO_2 { + DWORD cVersion; + LPTSTR pName; + LPTSTR pEnvironment; + LPTSTR pDriverPath; + LPTSTR pDataFile; + LPTSTR pConfigFile; +} DRIVER_INFO_2; + +typedef struct _DRIVER_INFO_3 { + DWORD cVersion; + LPTSTR pName; + LPTSTR pEnvironment; + LPTSTR pDriverPath; + LPTSTR pDataFile; + LPTSTR pConfigFile; + LPTSTR pHelpFile; + LPTSTR pDependentFiles; + LPTSTR pMonitorName; + LPTSTR pDefaultDataType; +} DRIVER_INFO_3; + +typedef struct _editstream { + DWORD dwCookie; + DWORD dwError; + EDITSTREAMCALLBACK pfnCallback; +} EDITSTREAM; + +typedef struct tagEMR +{ + DWORD iType; + DWORD nSize; +} EMR, *PEMR; + +typedef struct tagEMRANGLEARC +{ + EMR emr; + POINTL ptlCenter; + DWORD nRadius; + FLOAT eStartAngle; + FLOAT eSweepAngle; +} EMRANGLEARC, *PEMRANGLEARC; + +typedef struct tagEMRARC +{ + EMR emr; + RECTL rclBox; + POINTL ptlStart; + POINTL ptlEnd; +} EMRARC, *PEMRARC, + EMRARCTO, *PEMRARCTO, + EMRCHORD, *PEMRCHORD, + EMRPIE, *PEMRPIE; + +typedef struct _XFORM +{ + FLOAT eM11; + FLOAT eM12; + FLOAT eM21; + FLOAT eM22; + FLOAT eDx; + FLOAT eDy; +} XFORM, *PXFORM, *LPXFORM; + +typedef struct tagEMRBITBLT +{ + EMR emr; + RECTL rclBounds; + LONG xDest; + LONG yDest; + LONG cxDest; + LONG cyDest; + DWORD dwRop; + LONG xSrc; + LONG ySrc; + XFORM xformSrc; + COLORREF crBkColorSrc; + DWORD iUsageSrc; + DWORD offBmiSrc; + DWORD offBitsSrc; + DWORD cbBitsSrc; +} EMRBITBLT, *PEMRBITBLT; + +typedef struct tagLOGBRUSH { + UINT lbStyle; + COLORREF lbColor; + LONG lbHatch; +} LOGBRUSH, *PLOGBRUSH; + +typedef struct tagEMRCREATEBRUSHINDIRECT +{ + EMR emr; + DWORD ihBrush; + LOGBRUSH lb; +} EMRCREATEBRUSHINDIRECT, *PEMRCREATEBRUSHINDIRECT; + +typedef LONG LCSCSTYPE; +typedef LONG LCSGAMUTMATCH; + +typedef struct tagLOGCOLORSPACE { + DWORD lcsSignature; + DWORD lcsVersion; + DWORD lcsSize; + + LCSCSTYPE lcsCSType; + LCSGAMUTMATCH lcsIntent; + CIEXYZTRIPLE lcsEndpoints; + DWORD lcsGammaRed; + DWORD lcsGammaGreen; + DWORD lcsGammaBlue; + TCHAR lcsFilename[MAX_PATH]; +} LOGCOLORSPACE, *LPLOGCOLORSPACE; + +typedef struct tagEMRCREATECOLORSPACE +{ + EMR emr; + DWORD ihCS; + LOGCOLORSPACE lcs; +} EMRCREATECOLORSPACE, *PEMRCREATECOLORSPACE; + +typedef struct tagEMRCREATEDIBPATTERNBRUSHPT +{ + EMR emr; + DWORD ihBrush; + DWORD iUsage; + DWORD offBmi; + DWORD cbBmi; + DWORD offBits; + DWORD cbBits; +} EMRCREATEDIBPATTERNBRUSHPT, + PEMRCREATEDIBPATTERNBRUSHPT; + +typedef struct tagEMRCREATEMONOBRUSH +{ + EMR emr; + DWORD ihBrush; + DWORD iUsage; + DWORD offBmi; + DWORD cbBmi; + DWORD offBits; + DWORD cbBits; +} EMRCREATEMONOBRUSH, *PEMRCREATEMONOBRUSH; + +typedef struct tagPALETTEENTRY { + BYTE peRed; + BYTE peGreen; + BYTE peBlue; + BYTE peFlags; +} PALETTEENTRY, *LPPALETTEENTRY, *PPALETTEENTRY; + +typedef struct tagLOGPALETTE { + WORD palVersion; + WORD palNumEntries; + PALETTEENTRY palPalEntry[1]; +} LOGPALETTE, *LPLOGPALETTE, *PLOGPALETTE; + +typedef struct tagEMRCREATEPALETTE +{ + EMR emr; + DWORD ihPal; + LOGPALETTE lgpl; +} EMRCREATEPALETTE, *PEMRCREATEPALETTE; + +typedef struct tagLOGPEN { + UINT lopnStyle; + POINT lopnWidth; + COLORREF lopnColor; +} LOGPEN, *PLOGPEN; + +typedef struct tagEMRCREATEPEN +{ + EMR emr; + DWORD ihPen; + LOGPEN lopn; +} EMRCREATEPEN, *PEMRCREATEPEN; + +typedef struct tagEMRELLIPSE +{ + EMR emr; + RECTL rclBox; +} EMRELLIPSE, *PEMRELLIPSE, + EMRRECTANGLE, *PEMRRECTANGLE; + +typedef struct tagEMREOF +{ + EMR emr; + DWORD nPalEntries; + DWORD offPalEntries; + DWORD nSizeLast; +} EMREOF, *PEMREOF; + +typedef struct tagEMREXCLUDECLIPRECT +{ + EMR emr; + RECTL rclClip; +} EMREXCLUDECLIPRECT, *PEMREXCLUDECLIPRECT, + EMRINTERSECTCLIPRECT, *PEMRINTERSECTCLIPRECT; + +typedef struct tagPANOSE { + BYTE bFamilyType; + BYTE bSerifStyle; + BYTE bWeight; + BYTE bProportion; + BYTE bContrast; + BYTE bStrokeVariation; + BYTE bArmStyle; + BYTE bLetterform; + BYTE bMidline; + BYTE bXHeight; +} PANOSE; + +typedef struct tagEXTLOGFONT { + LOGFONT elfLogFont; + BCHAR elfFullName[LF_FULLFACESIZE]; + BCHAR elfStyle[LF_FACESIZE]; + DWORD elfVersion; + DWORD elfStyleSize; + DWORD elfMatch; + DWORD elfReserved; + BYTE elfVendorId[ELF_VENDOR_SIZE]; + DWORD elfCulture; + PANOSE elfPanose; +} EXTLOGFONT; + +typedef struct tagEMREXTCREATEFONTINDIRECTW +{ + EMR emr; + DWORD ihFont; + EXTLOGFONT elfw; +} EMREXTCREATEFONTINDIRECTW, + PEMREXTCREATEFONTINDIRECTW; + +typedef struct tagEXTLOGPEN { + UINT elpPenStyle; + UINT elpWidth; + UINT elpBrushStyle; + COLORREF elpColor; + LONG elpHatch; + DWORD elpNumEntries; + DWORD elpStyleEntry[1]; +} EXTLOGPEN; + +typedef struct tagEMREXTCREATEPEN +{ + EMR emr; + DWORD ihPen; + DWORD offBmi; + DWORD cbBmi; + DWORD offBits; + DWORD cbBits; + EXTLOGPEN elp; +} EMREXTCREATEPEN, *PEMREXTCREATEPEN; + +typedef struct tagEMREXTFLOODFILL +{ + EMR emr; + POINTL ptlStart; + COLORREF crColor; + DWORD iMode; +} EMREXTFLOODFILL, *PEMREXTFLOODFILL; + +typedef struct tagEMREXTSELECTCLIPRGN +{ + EMR emr; + DWORD cbRgnData; + DWORD iMode; + BYTE RgnData[1]; +} EMREXTSELECTCLIPRGN, *PEMREXTSELECTCLIPRGN; + +typedef struct tagEMRTEXT +{ + POINTL ptlReference; + DWORD nChars; + DWORD offString; + DWORD fOptions; + RECTL rcl; + DWORD offDx; +} EMRTEXT, *PEMRTEXT; + +typedef struct tagEMREXTTEXTOUTA +{ + EMR emr; + RECTL rclBounds; + DWORD iGraphicsMode; + FLOAT exScale; + FLOAT eyScale; + EMRTEXT emrtext; +} EMREXTTEXTOUTA, *PEMREXTTEXTOUTA, + EMREXTTEXTOUTW, *PEMREXTTEXTOUTW; + +typedef struct tagEMRFILLPATH +{ + EMR emr; + RECTL rclBounds; +} EMRFILLPATH, *PEMRFILLPATH, + EMRSTROKEANDFILLPATH, *PEMRSTROKEANDFILLPATH, + EMRSTROKEPATH, *PEMRSTROKEPATH; + +typedef struct tagEMRFILLRGN +{ + EMR emr; + RECTL rclBounds; + DWORD cbRgnData; + DWORD ihBrush; + BYTE RgnData[1]; +} EMRFILLRGN, *PEMRFILLRGN; + +typedef struct tagEMRFORMAT { + DWORD dSignature; + DWORD nVersion; + DWORD cbData; + DWORD offData; +} EMRFORMAT; + +typedef struct tagSIZE { + LONG cx; + LONG cy; +} SIZE, *PSIZE, *LPSIZE, SIZEL, *PSIZEL, *LPSIZEL; + +typedef struct tagEMRFRAMERGN +{ + EMR emr; + RECTL rclBounds; + DWORD cbRgnData; + DWORD ihBrush; + SIZEL szlStroke; + BYTE RgnData[1]; +} EMRFRAMERGN, *PEMRFRAMERGN; + +typedef struct tagEMRGDICOMMENT +{ + EMR emr; + DWORD cbData; + BYTE Data[1]; +} EMRGDICOMMENT, *PEMRGDICOMMENT; + +typedef struct tagEMRINVERTRGN +{ + EMR emr; + RECTL rclBounds; + DWORD cbRgnData; + BYTE RgnData[1]; +} EMRINVERTRGN, *PEMRINVERTRGN, + EMRPAINTRGN, *PEMRPAINTRGN; + +typedef struct tagEMRLINETO +{ + EMR emr; + POINTL ptl; +} EMRLINETO, *PEMRLINETO, + EMRMOVETOEX, *PEMRMOVETOEX; + +typedef struct tagEMRMASKBLT +{ + EMR emr; + RECTL rclBounds; + LONG xDest; + LONG yDest; + LONG cxDest; + LONG cyDest; + DWORD dwRop; + LONG xSrc; + LONG ySrc; + XFORM xformSrc; + COLORREF crBkColorSrc; + DWORD iUsageSrc; + DWORD offBmiSrc; + DWORD cbBmiSrc; + DWORD offBitsSrc; + DWORD cbBitsSrc; + LONG xMask; + LONG yMask; + DWORD iUsageMask; + DWORD offBmiMask; + DWORD cbBmiMask; + DWORD offBitsMask; + DWORD cbBitsMask; +} EMRMASKBLT, *PEMRMASKBLT; + +typedef struct tagEMRMODIFYWORLDTRANSFORM +{ + EMR emr; + XFORM xform; + DWORD iMode; +} EMRMODIFYWORLDTRANSFORM, + PEMRMODIFYWORLDTRANSFORM; + +typedef struct tagEMROFFSETCLIPRGN +{ + EMR emr; + POINTL ptlOffset; +} EMROFFSETCLIPRGN, *PEMROFFSETCLIPRGN; + +typedef struct tagEMRPLGBLT +{ + EMR emr; + RECTL rclBounds; + POINTL aptlDest[3]; + LONG xSrc; + LONG ySrc; + LONG cxSrc; + LONG cySrc; + XFORM xformSrc; + COLORREF crBkColorSrc; + DWORD iUsageSrc; + DWORD offBmiSrc; + DWORD cbBmiSrc; + DWORD offBitsSrc; + DWORD cbBitsSrc; + LONG xMask; + LONG yMask; + DWORD iUsageMask; + DWORD offBmiMask; + DWORD cbBmiMask; + DWORD offBitsMask; + DWORD cbBitsMask; +} EMRPLGBLT, *PEMRPLGBLT; + +typedef struct tagEMRPOLYDRAW +{ + EMR emr; + RECTL rclBounds; + DWORD cptl; + POINTL aptl[1]; + BYTE abTypes[1]; +} EMRPOLYDRAW, *PEMRPOLYDRAW; + +typedef struct tagEMRPOLYDRAW16 +{ + EMR emr; + RECTL rclBounds; + DWORD cpts; + POINTS apts[1]; + BYTE abTypes[1]; +} EMRPOLYDRAW16, *PEMRPOLYDRAW16; + +typedef struct tagEMRPOLYLINE +{ + EMR emr; + RECTL rclBounds; + DWORD cptl; + POINTL aptl[1]; +} EMRPOLYLINE, *PEMRPOLYLINE, + EMRPOLYBEZIER, *PEMRPOLYBEZIER, + EMRPOLYGON, *PEMRPOLYGON, + EMRPOLYBEZIERTO, *PEMRPOLYBEZIERTO, + EMRPOLYLINETO, *PEMRPOLYLINETO; + +typedef struct tagEMRPOLYLINE16 +{ + EMR emr; + RECTL rclBounds; + DWORD cpts; + POINTL apts[1]; +} EMRPOLYLINE16, *PEMRPOLYLINE16, + EMRPOLYBEZIER16, *PEMRPOLYBEZIER16, + EMRPOLYGON16, *PEMRPOLYGON16, + EMRPOLYBEZIERTO16, *PEMRPOLYBEZIERTO16, + EMRPOLYLINETO16, *PEMRPOLYLINETO16; + +typedef struct tagEMRPOLYPOLYLINE +{ + EMR emr; + RECTL rclBounds; + DWORD nPolys; + DWORD cptl; + DWORD aPolyCounts[1]; + POINTL aptl[1]; +} EMRPOLYPOLYLINE, *PEMRPOLYPOLYLINE, + EMRPOLYPOLYGON, *PEMRPOLYPOLYGON; + +typedef struct tagEMRPOLYPOLYLINE16 +{ + EMR emr; + RECTL rclBounds; + DWORD nPolys; + DWORD cpts; + DWORD aPolyCounts[1]; + POINTS apts[1]; +} EMRPOLYPOLYLINE16, *PEMRPOLYPOLYLINE16, + EMRPOLYPOLYGON16, *PEMRPOLYPOLYGON16; + +typedef struct tagEMRPOLYTEXTOUTA +{ + EMR emr; + RECTL rclBounds; + DWORD iGraphicsMode; + FLOAT exScale; + FLOAT eyScale; + LONG cStrings; + EMRTEXT aemrtext[1]; +} EMRPOLYTEXTOUTA, *PEMRPOLYTEXTOUTA, + EMRPOLYTEXTOUTW, *PEMRPOLYTEXTOUTW; + +typedef struct tagEMRRESIZEPALETTE +{ + EMR emr; + DWORD ihPal; + DWORD cEntries; +} EMRRESIZEPALETTE, *PEMRRESIZEPALETTE; + +typedef struct tagEMRRESTOREDC +{ + EMR emr; + LONG iRelative; +} EMRRESTOREDC, *PEMRRESTOREDC; + +typedef struct tagEMRROUNDRECT +{ + EMR emr; + RECTL rclBox; + SIZEL szlCorner; +} EMRROUNDRECT, *PEMRROUNDRECT; + +typedef struct tagEMRSCALEVIEWPORTEXTEX +{ + EMR emr; + LONG xNum; + LONG xDenom; + LONG yNum; + LONG yDenom; +} EMRSCALEVIEWPORTEXTEX, *PEMRSCALEVIEWPORTEXTEX, + EMRSCALEWINDOWEXTEX, *PEMRSCALEWINDOWEXTEX; + +typedef struct tagEMRSELECTCOLORSPACE +{ + EMR emr; + DWORD ihCS; +} EMRSELECTCOLORSPACE, *PEMRSELECTCOLORSPACE, + EMRDELETECOLORSPACE, *PEMRDELETECOLORSPACE; +typedef struct tagEMRSELECTOBJECT +{ + EMR emr; + DWORD ihObject; +} EMRSELECTOBJECT, *PEMRSELECTOBJECT, + EMRDELETEOBJECT, *PEMRDELETEOBJECT; + +typedef struct tagEMRSELECTPALETTE +{ + EMR emr; + DWORD ihPal; +} EMRSELECTPALETTE, *PEMRSELECTPALETTE; + +typedef struct tagEMRSETARCDIRECTION +{ + EMR emr; + DWORD iArcDirection; +} EMRSETARCDIRECTION, *PEMRSETARCDIRECTION; + +typedef struct tagEMRSETTEXTCOLOR +{ + EMR emr; + COLORREF crColor; +} EMRSETBKCOLOR, *PEMRSETBKCOLOR, + EMRSETTEXTCOLOR, *PEMRSETTEXTCOLOR; + +typedef struct tagEMRSETCOLORADJUSTMENT +{ + EMR emr; + COLORADJUSTMENT ColorAdjustment; +} EMRSETCOLORADJUSTMENT, *PEMRSETCOLORADJUSTMENT; + +typedef struct tagEMRSETDIBITSTODEVICE +{ + EMR emr; + RECTL rclBounds; + LONG xDest; + LONG yDest; + LONG xSrc; + LONG ySrc; + LONG cxSrc; + LONG cySrc; + DWORD offBmiSrc; + DWORD cbBmiSrc; + DWORD offBitsSrc; + DWORD cbBitsSrc; + DWORD iUsageSrc; + DWORD iStartScan; + DWORD cScans; +} EMRSETDIBITSTODEVICE, *PEMRSETDIBITSTODEVICE; + +typedef struct tagEMRSETMAPPERFLAGS +{ + EMR emr; + DWORD dwFlags; +} EMRSETMAPPERFLAGS, *PEMRSETMAPPERFLAGS; + +typedef struct tagEMRSETMITERLIMIT +{ + EMR emr; + FLOAT eMiterLimit; +} EMRSETMITERLIMIT, *PEMRSETMITERLIMIT; + +typedef struct tagEMRSETPALETTEENTRIES +{ + EMR emr; + DWORD ihPal; + DWORD iStart; + DWORD cEntries; + PALETTEENTRY aPalEntries[1]; +} EMRSETPALETTEENTRIES, *PEMRSETPALETTEENTRIES; + +typedef struct tagEMRSETPIXELV +{ + EMR emr; + POINTL ptlPixel; + COLORREF crColor; +} EMRSETPIXELV, *PEMRSETPIXELV; + +typedef struct tagEMRSETVIEWPORTEXTEX +{ + EMR emr; + SIZEL szlExtent; +} EMRSETVIEWPORTEXTEX, *PEMRSETVIEWPORTEXTEX, + EMRSETWINDOWEXTEX, *PEMRSETWINDOWEXTEX; + +typedef struct tagEMRSETVIEWPORTORGEX +{ + EMR emr; + POINTL ptlOrigin; +} EMRSETVIEWPORTORGEX, *PEMRSETVIEWPORTORGEX, + EMRSETWINDOWORGEX, *PEMRSETWINDOWORGEX, + EMRSETBRUSHORGEX, *PEMRSETBRUSHORGEX; + +typedef struct tagEMRSETWORLDTRANSFORM +{ + EMR emr; + XFORM xform; +} EMRSETWORLDTRANSFORM, *PEMRSETWORLDTRANSFORM; + +typedef struct tagEMRSTRETCHBLT +{ + EMR emr; + RECTL rclBounds; + LONG xDest; + LONG yDest; + LONG cxDest; + LONG cyDest; + DWORD dwRop; + LONG xSrc; + LONG ySrc; + XFORM xformSrc; + COLORREF crBkColorSrc; + DWORD iUsageSrc; + DWORD offBmiSrc; + DWORD cbBmiSrc; + DWORD offBitsSrc; + DWORD cbBitsSrc; + LONG cxSrc; + LONG cySrc; +} EMRSTRETCHBLT, *PEMRSTRETCHBLT; + +typedef struct tagEMRSTRETCHDIBITS +{ + EMR emr; + RECTL rclBounds; + LONG xDest; + LONG yDest; + LONG xSrc; + LONG ySrc; + LONG cxSrc; + LONG cySrc; + DWORD offBmiSrc; + DWORD cbBmiSrc; + DWORD offBitsSrc; + DWORD cbBitsSrc; + DWORD iUsageSrc; + DWORD dwRop; + LONG cxDest; + LONG cyDest; +} EMRSTRETCHDIBITS, *PEMRSTRETCHDIBITS; + +typedef struct tagABORTPATH +{ + EMR emr; +} EMRABORTPATH, *PEMRABORTPATH, + EMRBEGINPATH, *PEMRBEGINPATH, + EMRENDPATH, *PEMRENDPATH, + EMRCLOSEFIGURE, *PEMRCLOSEFIGURE, + EMRFLATTENPATH, *PEMRFLATTENPATH, + EMRWIDENPATH, *PEMRWIDENPATH, + EMRSETMETARGN, *PEMRSETMETARGN, + EMRSAVEDC, *PEMRSAVEDC, + EMRREALIZEPALETTE, *PEMRREALIZEPALETTE; + +typedef struct tagEMRSELECTCLIPPATH +{ + EMR emr; + DWORD iMode; +} EMRSELECTCLIPPATH, *PEMRSELECTCLIPPATH, + EMRSETBKMODE, *PEMRSETBKMODE, + EMRSETMAPMODE, *PEMRSETMAPMODE, + EMRSETPOLYFILLMODE, *PEMRSETPOLYFILLMODE, + EMRSETROP2, *PEMRSETROP2, + EMRSETSTRETCHBLTMODE, *PEMRSETSTRETCHBLTMODE, + EMRSETTEXTALIGN, *PEMRSETTEXTALIGN, + EMRENABLEICM, *PEMRENABLEICM; + +typedef struct tagNMHDR { + HWND hwndFrom; + UINT idFrom; + UINT code; +} NMHDR; + +typedef struct _encorrecttext { + NMHDR nmhdr; + CHARRANGE chrg; + WORD seltyp; +} ENCORRECTTEXT; + +typedef struct _endropfiles { + NMHDR nmhdr; + HANDLE hDrop; + LONG cp; + WINBOOL fProtected; +} ENDROPFILES; + +typedef struct { + NMHDR nmhdr; + LONG cObjectCount; + LONG cch; +} ENSAVECLIPBOARD; + +typedef struct { + NMHDR nmhdr; + LONG iob; + LONG lOper; + HRESULT hr; +} ENOLEOPFAILED; + +typedef struct tagENHMETAHEADER { + DWORD iType; + DWORD nSize; + RECTL rclBounds; + RECTL rclFrame; + DWORD dSignature; + DWORD nVersion; + DWORD nBytes; + DWORD nRecords; + WORD nHandles; + WORD sReserved; + DWORD nDescription; + DWORD offDescription; + DWORD nPalEntries; + SIZEL szlDevice; + SIZEL szlMillimeters; +} ENHMETAHEADER, *LPENHMETAHEADER; + +typedef struct tagENHMETARECORD { + DWORD iType; + DWORD nSize; + DWORD dParm[1]; +} ENHMETARECORD, *PENHMETARECORD, *LPENHMETARECORD; + +typedef struct _enprotected { + NMHDR nmhdr; + UINT msg; + WPARAM wParam; + LPARAM lParam; + CHARRANGE chrg; +} ENPROTECTED; + +typedef struct _SERVICE_STATUS { + DWORD dwServiceType; + DWORD dwCurrentState; + DWORD dwControlsAccepted; + DWORD dwWin32ExitCode; + DWORD dwServiceSpecificExitCode; + DWORD dwCheckPoint; + DWORD dwWaitHint; +} SERVICE_STATUS, *LPSERVICE_STATUS; + +typedef struct _ENUM_SERVICE_STATUSA { + LPSTR lpServiceName; + LPSTR lpDisplayName; + SERVICE_STATUS ServiceStatus; +} ENUM_SERVICE_STATUSA, *LPENUM_SERVICE_STATUSA; + +typedef struct _ENUM_SERVICE_STATUSW { + LPWSTR lpServiceName; + LPWSTR lpDisplayName; + SERVICE_STATUS ServiceStatus; +} ENUM_SERVICE_STATUSW, *LPENUM_SERVICE_STATUSW; + +#ifdef UNICODE +#define ENUM_SERVICE_STATUS ENUM_SERVICE_STATUSW +#define LPENUM_SERVICE_STATUS LPENUM_SERVICE_STATUSW +#else +#define ENUM_SERVICE_STATUS ENUM_SERVICE_STATUSA +#define LPENUM_SERVICE_STATUS LPENUM_SERVICE_STATUSA +#endif + +typedef struct tagENUMLOGFONT { + LOGFONT elfLogFont; + BCHAR elfFullName[LF_FULLFACESIZE]; + BCHAR elfStyle[LF_FACESIZE]; +} ENUMLOGFONT; + +typedef struct tagENUMLOGFONTEX { + LOGFONT elfLogFont; + BCHAR elfFullName[LF_FULLFACESIZE]; + BCHAR elfStyle[LF_FACESIZE]; + BCHAR elfScript[LF_FACESIZE]; +} ENUMLOGFONTEX; + +typedef struct _EVENTLOGRECORD { + DWORD Length; + DWORD Reserved; + DWORD RecordNumber; + DWORD TimeGenerated; + DWORD TimeWritten; + DWORD EventID; + WORD EventType; + WORD NumStrings; + WORD EventCategory; + WORD ReservedFlags; + DWORD ClosingRecordNumber; + DWORD StringOffset; + DWORD UserSidLength; + DWORD UserSidOffset; + DWORD DataLength; + DWORD DataOffset; + +/* + Then follow: + + TCHAR SourceName[] + TCHAR Computername[] + SID UserSid + TCHAR Strings[] + BYTE Data[] + CHAR Pad[] + DWORD Length; +*/ + +} EVENTLOGRECORD; + +typedef struct tagEVENTMSG { + UINT message; + UINT paramL; + UINT paramH; + DWORD time; + HWND hwnd; +} EVENTMSG; + +typedef struct _EXT_BUTTON { + WORD idCommand; + WORD idsHelp; + WORD fsStyle; +} EXT_BUTTON, *LPEXT_BUTTON; + +typedef struct tagFILTERKEYS { + UINT cbSize; + DWORD dwFlags; + DWORD iWaitMSec; + DWORD iDelayMSec; + DWORD iRepeatMSec; + DWORD iBounceMSec; +} FILTERKEYS; + +typedef struct _FIND_NAME_BUFFER { + UCHAR length; + UCHAR access_control; + UCHAR frame_control; + UCHAR destination_addr[6]; + UCHAR source_addr[6]; + UCHAR routing_info[18]; +} FIND_NAME_BUFFER; + +typedef struct _FIND_NAME_HEADER { + WORD node_count; + UCHAR reserved; + UCHAR unique_group; +} FIND_NAME_HEADER; + +typedef +enum _FINDEX_INFO_LEVELS +{ + FindExInfoStandard, + FindExInfoMaxInfoLevel +} FINDEX_INFO_LEVELS; + +typedef +enum _FINDEX_SEARCH_OPS +{ + FindExSearchNameMatch, + FindExSearchLimitToDirectories, + FindExSearchLimitToDevices, + FindExSearchMaxSearchOp + +} FINDEX_SEARCH_OPS; + +#define FIND_FIRST_EX_CASE_SENSITIVE 0x00000001 + +typedef struct { + DWORD lStructSize; + HWND hwndOwner; + HINSTANCE hInstance; + DWORD Flags; + LPTSTR lpstrFindWhat; + LPTSTR lpstrReplaceWith; + WORD wFindWhatLen; + WORD wReplaceWithLen; + LPARAM lCustData; + LPFRHOOKPROC lpfnHook; + LPCTSTR lpTemplateName; +} FINDREPLACE, *LPFINDREPLACE; + +typedef struct _findtext { + CHARRANGE chrg; + LPSTR lpstrText; +} FINDTEXT; + +typedef struct _findtextex { + CHARRANGE chrg; + LPSTR lpstrText; + CHARRANGE chrgText; +} FINDTEXTEX; + +typedef struct _FMS_GETDRIVEINFO { + DWORD dwTotalSpace; + DWORD dwFreeSpace; + TCHAR szPath[260]; + TCHAR szVolume[14]; + TCHAR szShare[128]; +} FMS_GETDRIVEINFO; + +typedef struct _FMS_GETFILESEL { + FILETIME ftTime; + DWORD dwSize; + BYTE bAttr; + TCHAR szName[260]; +} FMS_GETFILESEL; + +typedef struct _FMS_LOAD { + DWORD dwSize; + TCHAR szMenuName[MENU_TEXT_LEN]; + HMENU hMenu; + UINT wMenuDelta; +} FMS_LOAD; + +typedef struct _FMS_TOOLBARLOAD { + DWORD dwSize; + LPEXT_BUTTON lpButtons; + WORD cButtons; + WORD cBitmaps; + WORD idBitmap; + HBITMAP hBitmap; +} FMS_TOOLBARLOAD; + + +typedef struct _FORM_INFO_1 { + DWORD Flags; + LPTSTR pName; + SIZEL Size; + RECTL ImageableArea; +} FORM_INFO_1; + +typedef struct _FORMAT_PARAMETERS { + MEDIA_TYPE MediaType; + DWORD StartCylinderNumber; + DWORD EndCylinderNumber; + DWORD StartHeadNumber; + DWORD EndHeadNumber; +} FORMAT_PARAMETERS ; + +typedef struct _formatrange { + HDC hdc; + HDC hdcTarget; + RECT rc; + RECT rcPage; + CHARRANGE chrg; +} FORMATRANGE; + +typedef struct tagGCP_RESULTS { + DWORD lStructSize; + LPTSTR lpOutString; + UINT *lpOrder; + INT *lpDx; + INT *lpCaretPos; + LPTSTR lpClass; + UINT *lpGlyphs; + UINT nGlyphs; + UINT nMaxFit; +} GCP_RESULTS, *LPGCP_RESULTS; + + +typedef struct _GLYPHMETRICS { + UINT gmBlackBoxX; + UINT gmBlackBoxY; + POINT gmptGlyphOrigin; + short gmCellIncX; + short gmCellIncY; +} GLYPHMETRICS, *LPGLYPHMETRICS; + +typedef struct tagHANDLETABLE { + HGDIOBJ objectHandle[1]; +} HANDLETABLE, *LPHANDLETABLE; + +typedef struct _HD_HITTESTINFO { + POINT pt; + UINT flags; + int iItem; +} HD_HITTESTINFO; + +typedef struct _HD_ITEM { + UINT mask; + int cxy; + LPTSTR pszText; + HBITMAP hbm; + int cchTextMax; + int fmt; + LPARAM lParam; +} HD_ITEM; + +typedef struct _WINDOWPOS { + HWND hwnd; + HWND hwndInsertAfter; + int x; + int y; + int cx; + int cy; + UINT flags; +} WINDOWPOS, *PWINDOWPOS, *LPWINDOWPOS; + +typedef struct _HD_LAYOUT { + RECT * prc; + WINDOWPOS * pwpos; +} HD_LAYOUT; + +typedef struct _HD_NOTIFY { + NMHDR hdr; + int iItem; + int iButton; + HD_ITEM * pitem; +} HD_NOTIFY; + +typedef struct tagHELPINFO { + UINT cbSize; + int iContextType; + int iCtrlId; + HANDLE hItemHandle; + DWORD dwContextId; + POINT MousePos; +} HELPINFO, *LPHELPINFO; + +typedef struct { + DWORD mkSize; + CHAR mkKeyList; + CHAR szKeyphrase[1]; +} MULTIKEYHELPA, *PMULTIKEYHELPA, *LPMULTIKEYHELPA; + +typedef struct { + DWORD mkSize; + WCHAR mkKeyList; + WCHAR szKeyphrase[1]; +} MULTIKEYHELPW, *PMULTIKEYHELPW, *LPMULTIKEYHELPW; + +typedef struct { + int wStructSize; + int x; + int y; + int dx; + int dy; + int wMax; + TCHAR rgchMember[2]; +} HELPWININFO; + +typedef struct { + int wStructSize; + int x; + int y; + int dx; + int dy; + int wMax; + CHAR rgchMember[2]; +} HELPWININFOA, *PHELPWININFOA, *LPHELPWININFOA; + +typedef struct { + int wStructSize; + int x; + int y; + int dx; + int dy; + int wMax; + WCHAR rgchMember[2]; +} HELPWININFOW, *PHELPWININFOW, *LPHELPWININFOW; + + +typedef struct tagHIGHCONTRAST { + UINT cbSize; + DWORD dwFlags; + LPTSTR lpszDefaultScheme; +} HIGHCONTRAST, * LPHIGHCONTRAST; + +typedef struct tagHSZPAIR { + HSZ hszSvc; + HSZ hszTopic; +} HSZPAIR; + +typedef struct _ICONINFO { + WINBOOL fIcon; + DWORD xHotspot; + DWORD yHotspot; + HBITMAP hbmMask; + HBITMAP hbmColor; +} ICONINFO, *PICONINFO; + +typedef struct tagICONMETRICS { + UINT cbSize; + int iHorzSpacing; + int iVertSpacing; + int iTitleWrap; + LOGFONT lfFont; +} ICONMETRICS, *LPICONMETRICS; + +typedef struct _IMAGEINFO { + HBITMAP hbmImage; + HBITMAP hbmMask; + int Unused1; + int Unused2; + RECT rcImage; +} IMAGEINFO; + +typedef struct _JOB_INFO_1 { + DWORD JobId; + LPTSTR pPrinterName; + LPTSTR pMachineName; + LPTSTR pUserName; + LPTSTR pDocument; + LPTSTR pDatatype; + LPTSTR pStatus; + DWORD Status; + DWORD Priority; + DWORD Position; + DWORD TotalPages; + DWORD PagesPrinted; + SYSTEMTIME Submitted; +} JOB_INFO_1; + +#if 0 +typedef struct _JOB_INFO_2 { + DWORD JobId; + LPTSTR pPrinterName; + LPTSTR pMachineName; + LPTSTR pUserName; + LPTSTR pDocument; + LPTSTR pNotifyName; + LPTSTR pDatatype; + LPTSTR pPrintProcessor; + LPTSTR pParameters; + LPTSTR pDriverName; + LPDEVMODE pDevMode; + LPTSTR pStatus; + PSECURITY_DESCRIPTOR pSecurityDescriptor; + DWORD Status; + DWORD Priority; + DWORD Position; + DWORD StartTime; + DWORD UntilTime; + DWORD TotalPages; + DWORD Size; + SYSTEMTIME Submitted; + DWORD Time; + DWORD PagesPrinted ; +} JOB_INFO_2; +#endif + +typedef struct tagKERNINGPAIR { + WORD wFirst; + WORD wSecond; + int iKernAmount; +} KERNINGPAIR, *LPKERNINGPAIR; + +typedef struct _LANA_ENUM { + UCHAR length; + UCHAR lana[MAX_LANA]; +} LANA_ENUM; + +typedef struct _LDT_ENTRY { + WORD LimitLow; + WORD BaseLow; + union { + struct { + BYTE BaseMid; + BYTE Flags1; + BYTE Flags2; + BYTE BaseHi; + } Bytes; + struct { + DWORD BaseMid : 8; + DWORD Type : 5; + DWORD Dpl : 2; + DWORD Pres : 1; + DWORD LimitHi : 4; + DWORD Sys : 1; + DWORD Reserved_0 : 1; + DWORD Default_Big : 1; + DWORD Granularity : 1; + DWORD BaseHi : 8; + } Bits; + } HighWord; +} LDT_ENTRY, *PLDT_ENTRY, *LPLDT_ENTRY; + +typedef struct tagLOCALESIGNATURE { + DWORD lsUsb[4]; + DWORD lsCsbDefault[2]; + DWORD lsCsbSupported[2]; +} LOCALESIGNATURE; + + #if 0 +typedef struct _LOCALGROUP_MEMBERS_INFO_0 { + PSID lgrmi0_sid; +} LOCALGROUP_MEMBERS_INFO_0; + #endif + +typedef struct _LOCALGROUP_MEMBERS_INFO_3 { + LPWSTR lgrmi3_domainandname; +} LOCALGROUP_MEMBERS_INFO_3; + +typedef long FXPT16DOT16, * LPFXPT16DOT16; + + + +typedef LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY]; +typedef LUID_AND_ATTRIBUTES_ARRAY *PLUID_AND_ATTRIBUTES_ARRAY; + +typedef struct _LV_COLUMN { + UINT mask; + int fmt; + int cx; + LPTSTR pszText; + int cchTextMax; + int iSubItem; +} LV_COLUMN; + +typedef struct _LV_ITEM { + UINT mask; + int iItem; + int iSubItem; + UINT state; + UINT stateMask; + LPTSTR pszText; + int cchTextMax; + int iImage; + LPARAM lParam; +} LV_ITEM; + +typedef struct tagLV_DISPINFO { + NMHDR hdr; + LV_ITEM item; +} LV_DISPINFO; + +typedef struct _LV_FINDINFO { + UINT flags; + LPCTSTR psz; + LPARAM lParam; + POINT pt; + UINT vkDirection; +} LV_FINDINFO; + +typedef struct _LV_HITTESTINFO { + POINT pt; + UINT flags; + int iItem; +} LV_HITTESTINFO; + +typedef struct tagLV_KEYDOWN { + NMHDR hdr; + WORD wVKey; + UINT flags; +} LV_KEYDOWN; + +typedef struct _MAT2 { + FIXED eM11; + FIXED eM12; + FIXED eM21; + FIXED eM22; +} MAT2, *LPMAT2; + +typedef struct tagMDICREATESTRUCT { + LPCTSTR szClass; + LPCTSTR szTitle; + HANDLE hOwner; + int x; + int y; + int cx; + int cy; + DWORD style; + LPARAM lParam; +} MDICREATESTRUCT; + +typedef MDICREATESTRUCT *LPMDICREATESTRUCT; + +typedef struct tagMEASUREITEMSTRUCT { + UINT CtlType; + UINT CtlID; + UINT itemID; + UINT itemWidth; + UINT itemHeight; + DWORD itemData; +} MEASUREITEMSTRUCT, *LPMEASUREITEMSTRUCT; + +typedef struct _MEMORYSTATUS { + DWORD dwLength; + DWORD dwMemoryLoad; + DWORD dwTotalPhys; + DWORD dwAvailPhys; + DWORD dwTotalPageFile; + DWORD dwAvailPageFile; + DWORD dwTotalVirtual; + DWORD dwAvailVirtual; +} MEMORYSTATUS, *LPMEMORYSTATUS; + +typedef struct { + WORD wVersion; + WORD wOffset; + DWORD dwHelpId; +} MENUEX_TEMPLATE_HEADER; + +typedef struct { + DWORD dwType; + DWORD dwState; + UINT uId; + BYTE bResInfo; + WCHAR szText[1]; + DWORD dwHelpId; +} MENUEX_TEMPLATE_ITEM; + +typedef struct tagMENUITEMINFO { + UINT cbSize; + UINT fMask; + UINT fType; + UINT fState; + UINT wID; + HMENU hSubMenu; + HBITMAP hbmpChecked; + HBITMAP hbmpUnchecked; + DWORD dwItemData; + LPTSTR dwTypeData; + UINT cch; +} MENUITEMINFO, *LPMENUITEMINFO; +typedef MENUITEMINFO CONST *LPCMENUITEMINFO; + +typedef struct { + WORD mtOption; + WORD mtID; + WCHAR mtString[1]; +} MENUITEMTEMPLATE; + +typedef struct { + WORD versionNumber; + WORD offset; +} MENUITEMTEMPLATEHEADER; +typedef VOID MENUTEMPLATE, *LPMENUTEMPLATE; + +typedef struct tagMETAFILEPICT { +#if 0 + LONG mm; + LONG xExt; + LONG yExt; + HMETAFILE hMF; +#endif +} METAFILEPICT, *PMETAFILEPICT, *LPMETAFILEPICT; + +typedef struct tagMETAHEADER { + WORD mtType; + WORD mtHeaderSize; + WORD mtVersion; + DWORD mtSize; + WORD mtNoObjects; + DWORD mtMaxRecord; + WORD mtNoParameters; +} METAHEADER PACKED; + +typedef struct tagMETARECORD { + DWORD rdSize; + WORD rdFunction; + WORD rdParm[1]; +} METARECORD, *LPMETARECORD; + +typedef struct tagMINIMIZEDMETRICS { + UINT cbSize; + int iWidth; + int iHorzGap; + int iVertGap; + int iArrange; +} MINIMIZEDMETRICS, *LPMINIMIZEDMETRICS; + +typedef struct tagMINMAXINFO { + POINT ptReserved; + POINT ptMaxSize; + POINT ptMaxPosition; + POINT ptMinTrackSize; + POINT ptMaxTrackSize; +} MINMAXINFO; + +typedef struct modemdevcaps_tag { + DWORD dwActualSize; + DWORD dwRequiredSize; + DWORD dwDevSpecificOffset; + DWORD dwDevSpecificSize; + + DWORD dwModemProviderVersion; + DWORD dwModemManufacturerOffset; + DWORD dwModemManufacturerSize; + DWORD dwModemModelOffset; + DWORD dwModemModelSize; + DWORD dwModemVersionOffset; + DWORD dwModemVersionSize; + + DWORD dwDialOptions; + DWORD dwCallSetupFailTimer; + DWORD dwInactivityTimeout; + DWORD dwSpeakerVolume; + DWORD dwSpeakerMode; + DWORD dwModemOptions; + DWORD dwMaxDTERate; + DWORD dwMaxDCERate; + + BYTE abVariablePortion [1]; +} MODEMDEVCAPS, *PMODEMDEVCAPS, *LPMODEMDEVCAPS; + +typedef struct modemsettings_tag { + DWORD dwActualSize; + DWORD dwRequiredSize; + DWORD dwDevSpecificOffset; + DWORD dwDevSpecificSize; + + DWORD dwCallSetupFailTimer; + DWORD dwInactivityTimeout; + DWORD dwSpeakerVolume; + DWORD dwSpeakerMode; + DWORD dwPreferredModemOptions; + + DWORD dwNegotiatedModemOptions; + DWORD dwNegotiatedDCERate; + + BYTE abVariablePortion[1]; +} MODEMSETTINGS, *PMODEMSETTINGS, *LPMODEMSETTINGS; + +typedef struct tagMONCBSTRUCT { + UINT cb; + DWORD dwTime; + HANDLE hTask; + DWORD dwRet; + UINT wType; + UINT wFmt; + HCONV hConv; + HSZ hsz1; + HSZ hsz2; + HDDEDATA hData; + DWORD dwData1; + DWORD dwData2; + CONVCONTEXT cc; + DWORD cbData; + DWORD Data[8]; +} MONCBSTRUCT; + +typedef struct tagMONCONVSTRUCT { + UINT cb; + WINBOOL fConnect; + DWORD dwTime; + HANDLE hTask; + HSZ hszSvc; + HSZ hszTopic; + HCONV hConvClient; + HCONV hConvServer; +} MONCONVSTRUCT; + +typedef struct tagMONERRSTRUCT { + UINT cb; + UINT wLastError; + DWORD dwTime; + HANDLE hTask; +} MONERRSTRUCT; + +typedef struct tagMONHSZSTRUCT { + UINT cb; + WINBOOL fsAction; + DWORD dwTime; + HSZ hsz; + HANDLE hTask; + TCHAR str[1]; +} MONHSZSTRUCT; + +typedef struct _MONITOR_INFO_1 { + LPTSTR pName; +} MONITOR_INFO_1; + +typedef struct _MONITOR_INFO_2 { + LPTSTR pName; + LPTSTR pEnvironment ; + LPTSTR pDLLName ; +} MONITOR_INFO_2; + +typedef struct tagMONLINKSTRUCT { + UINT cb; + DWORD dwTime; + HANDLE hTask; + WINBOOL fEstablished; + WINBOOL fNoData; + HSZ hszSvc; + HSZ hszTopic; + HSZ hszItem; + UINT wFmt; + WINBOOL fServer; + HCONV hConvServer; + HCONV hConvClient; +} MONLINKSTRUCT; + +typedef struct tagMONMSGSTRUCT { + UINT cb; + HWND hwndTo; + DWORD dwTime; + HANDLE hTask; + UINT wMsg; + WPARAM wParam; + LPARAM lParam; + DDEML_MSG_HOOK_DATA dmhd; +} MONMSGSTRUCT; + +typedef struct tagMOUSEHOOKSTRUCT { + POINT pt; + HWND hwnd; + UINT wHitTestCode; + DWORD dwExtraInfo; +} MOUSEHOOKSTRUCT, *PMOUSEHOOKSTRUCT, *LPMOUSEHOOKSTRUCT; + +typedef struct _MOUSEKEYS { + DWORD cbSize; + DWORD dwFlags; + DWORD iMaxSpeed; + DWORD iTimeToMaxSpeed; + DWORD iCtrlSpeed; + DWORD dwReserved1; + DWORD dwReserved2; +} MOUSEKEYS; + +typedef struct tagMSG { + HWND hwnd; + UINT message; + WPARAM wParam; + LPARAM lParam; + DWORD time; + POINT pt; +} MSG, *LPMSG; + +typedef void CALLBACK (*MSGBOXCALLBACK) (LPHELPINFO lpHelpInfo); + +typedef struct { + UINT cbSize; + HWND hwndOwner; + HINSTANCE hInstance; + LPCSTR lpszText; + LPCSTR lpszCaption; + DWORD dwStyle; + LPCSTR lpszIcon; + DWORD dwContextHelpId; + MSGBOXCALLBACK lpfnMsgBoxCallback; + DWORD dwLanguageId; +} MSGBOXPARAMS, *PMSGBOXPARAMS, *LPMSGBOXPARAMS; + +typedef struct _msgfilter { + NMHDR nmhdr; + UINT msg; + WPARAM wParam; + LPARAM lParam; +} MSGFILTER; + +typedef struct tagMULTIKEYHELP { + DWORD mkSize; + TCHAR mkKeylist; + TCHAR szKeyphrase[1]; +} MULTIKEYHELP; + +typedef struct _NAME_BUFFER { + UCHAR name[NCBNAMSZ]; + UCHAR name_num; + UCHAR name_flags; +} NAME_BUFFER; + +typedef struct _NCB { + UCHAR ncb_command; + UCHAR ncb_retcode; + UCHAR ncb_lsn; + UCHAR ncb_num; + PUCHAR ncb_buffer; + WORD ncb_length; + UCHAR ncb_callname[NCBNAMSZ]; + UCHAR ncb_name[NCBNAMSZ]; + UCHAR ncb_rto; + UCHAR ncb_sto; + void (*ncb_post) (struct _NCB *); + UCHAR ncb_lana_num; + UCHAR ncb_cmd_cplt; + UCHAR ncb_reserve[10]; + HANDLE ncb_event; +} NCB; + +typedef struct _NCCALCSIZE_PARAMS { + RECT rgrc[3]; + PWINDOWPOS lppos; +} NCCALCSIZE_PARAMS; + +typedef struct _NDDESHAREINFO { + LONG lRevision; + LPTSTR lpszShareName; + LONG lShareType; + LPTSTR lpszAppTopicList; + LONG fSharedFlag; + LONG fService; + LONG fStartAppFlag; + LONG nCmdShow; + LONG qModifyId[2]; + LONG cNumItems; + LPTSTR lpszItemList; +}NDDESHAREINFO; + +typedef struct _NETRESOURCE { + DWORD dwScope; + DWORD dwType; + DWORD dwDisplayType; + DWORD dwUsage; + LPTSTR lpLocalName; + LPTSTR lpRemoteName; + LPTSTR lpComment; + LPTSTR lpProvider; +} NETRESOURCE, *LPNETRESOURCE; + +typedef struct tagNEWCPLINFO { + DWORD dwSize; + DWORD dwFlags; + DWORD dwHelpContext; + LONG lData; + HICON hIcon; + TCHAR szName[32]; + TCHAR szInfo[64]; + TCHAR szHelpFile[128]; +} NEWCPLINFO; + +typedef struct tagNEWTEXTMETRIC { + LONG tmHeight; + LONG tmAscent; + LONG tmDescent; + LONG tmInternalLeading; + LONG tmExternalLeading; + LONG tmAveCharWidth; + LONG tmMaxCharWidth; + LONG tmWeight; + LONG tmOverhang; + LONG tmDigitizedAspectX; + LONG tmDigitizedAspectY; + BCHAR tmFirstChar; + BCHAR tmLastChar; + BCHAR tmDefaultChar; + BCHAR tmBreakChar; + BYTE tmItalic; + BYTE tmUnderlined; + BYTE tmStruckOut; + BYTE tmPitchAndFamily; + BYTE tmCharSet; + DWORD ntmFlags; + UINT ntmSizeEM; + UINT ntmCellHeight; + UINT ntmAvgWidth; +} NEWTEXTMETRIC; + + +typedef struct tagNEWTEXTMETRICEX { + NEWTEXTMETRIC ntmentm; + FONTSIGNATURE ntmeFontSignature; +} NEWTEXTMETRICEX; + +typedef struct tagNM_LISTVIEW { + NMHDR hdr; + int iItem; + int iSubItem; + UINT uNewState; + UINT uOldState; + UINT uChanged; + POINT ptAction; + LPARAM lParam; +} NM_LISTVIEW; + +typedef struct _TREEITEM *HTREEITEM; + +typedef struct _TV_ITEM { + UINT mask; + HTREEITEM hItem; + UINT state; + UINT stateMask; + LPTSTR pszText; + int cchTextMax; + int iImage; + int iSelectedImage; + int cChildren; + LPARAM lParam; +} TV_ITEM, *LPTV_ITEM; + +typedef struct _NM_TREEVIEW { + NMHDR hdr; + UINT action; + TV_ITEM itemOld; + TV_ITEM itemNew; + POINT ptDrag; +} NM_TREEVIEW; +typedef NM_TREEVIEW *LPNM_TREEVIEW; + +typedef struct _NM_UPDOWN { + NMHDR hdr; + int iPos; + int iDelta; +} NM_UPDOWNW; + +typedef struct tagNONCLIENTMETRICS { + UINT cbSize; + int iBorderWidth; + int iScrollWidth; + int iScrollHeight; + int iCaptionWidth; + int iCaptionHeight; + LOGFONT lfCaptionFont; + int iSmCaptionWidth; + int iSmCaptionHeight; + LOGFONT lfSmCaptionFont; + int iMenuWidth; + int iMenuHeight; + LOGFONT lfMenuFont; + LOGFONT lfStatusFont; + LOGFONT lfMessageFont; +} NONCLIENTMETRICS, * LPNONCLIENTMETRICS; + +typedef struct _SERVICE_ADDRESS { + DWORD dwAddressType; + DWORD dwAddressFlags; + DWORD dwAddressLength; + DWORD dwPrincipalLength; + BYTE *lpAddress; + BYTE *lpPrincipal; +} SERVICE_ADDRESS; + +typedef struct _SERVICE_ADDRESSES { + DWORD dwAddressCount; + SERVICE_ADDRESS Addresses[1]; +} SERVICE_ADDRESSES, *LPSERVICE_ADDRESSES; + +#ifndef GUID_DEFINED +#define GUID_DEFINED +typedef struct _GUID +{ + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; +} GUID, *LPGUID; +typedef GUID CLSID, *LPCLSID; +#endif + +typedef struct _SERVICE_INFO { + LPGUID lpServiceType; + LPTSTR lpServiceName; + LPTSTR lpComment; + LPTSTR lpLocale; + DWORD dwDisplayHint; + DWORD dwVersion; + DWORD dwTime; + LPTSTR lpMachineName; + LPSERVICE_ADDRESSES lpServiceAddress; + BLOB ServiceSpecificInfo; +} SERVICE_INFO; + +typedef struct _NS_SERVICE_INFO { + DWORD dwNameSpace; + SERVICE_INFO ServiceInfo; +} NS_SERVICE_INFO; + +typedef struct _numberfmt { + UINT NumDigits; + UINT LeadingZero; + UINT Grouping; + LPTSTR lpDecimalSep; + LPTSTR lpThousandSep; + UINT NegativeOrder; +} NUMBERFMT; + +typedef struct _OFSTRUCT { + BYTE cBytes; + BYTE fFixedDisk; + WORD nErrCode; + WORD Reserved1; + WORD Reserved2; + CHAR szPathName[OFS_MAXPATHNAME]; +} OFSTRUCT, *LPOFSTRUCT; + +typedef struct tagOFN { + DWORD lStructSize; + HWND hwndOwner; + HINSTANCE hInstance; + LPCTSTR lpstrFilter; + LPTSTR lpstrCustomFilter; + DWORD nMaxCustFilter; + DWORD nFilterIndex; + LPTSTR lpstrFile; + DWORD nMaxFile; + LPTSTR lpstrFileTitle; + DWORD nMaxFileTitle; + LPCTSTR lpstrInitialDir; + LPCTSTR lpstrTitle; + DWORD Flags; + WORD nFileOffset; + WORD nFileExtension; + LPCTSTR lpstrDefExt; + DWORD lCustData; + LPOFNHOOKPROC lpfnHook; + LPCTSTR lpTemplateName; +} OPENFILENAME, *LPOPENFILENAME; + +typedef struct _OFNOTIFY { + NMHDR hdr; + LPOPENFILENAME lpOFN; + LPTSTR pszFile; +} OFNOTIFY, *LPOFNOTIFY; + +typedef struct _OSVERSIONINFO { + DWORD dwOSVersionInfoSize; + DWORD dwMajorVersion; + DWORD dwMinorVersion; + DWORD dwBuildNumber; + DWORD dwPlatformId; + TCHAR szCSDVersion[ 128 ]; +} OSVERSIONINFO, *POSVERSIONINFO, *LPOSVERSIONINFO; + +typedef struct tagTEXTMETRIC { + LONG tmHeight; + LONG tmAscent; + LONG tmDescent; + LONG tmInternalLeading; + LONG tmExternalLeading; + LONG tmAveCharWidth; + LONG tmMaxCharWidth; + LONG tmWeight; + LONG tmOverhang; + LONG tmDigitizedAspectX; + LONG tmDigitizedAspectY; + BCHAR tmFirstChar; + BCHAR tmLastChar; + BCHAR tmDefaultChar; + BCHAR tmBreakChar; + BYTE tmItalic; + BYTE tmUnderlined; + BYTE tmStruckOut; + BYTE tmPitchAndFamily; + BYTE tmCharSet; +} TEXTMETRIC, *LPTEXTMETRIC; + +typedef struct _OUTLINETEXTMETRIC { + UINT otmSize; + TEXTMETRIC otmTextMetrics; + BYTE otmFiller; + PANOSE otmPanoseNumber; + UINT otmfsSelection; + UINT otmfsType; + int otmsCharSlopeRise; + int otmsCharSlopeRun; + int otmItalicAngle; + UINT otmEMSquare; + int otmAscent; + int otmDescent; + UINT otmLineGap; + UINT otmsCapEmHeight; + UINT otmsXHeight; + RECT otmrcFontBox; + int otmMacAscent; + int otmMacDescent; + UINT otmMacLineGap; + UINT otmusMinimumPPEM; + POINT otmptSubscriptSize; + POINT otmptSubscriptOffset; + POINT otmptSuperscriptSize; + POINT otmptSuperscriptOffset; + UINT otmsStrikeoutSize; + int otmsStrikeoutPosition; + int otmsUnderscoreSize; + int otmsUnderscorePosition; + PSTR otmpFamilyName; + PSTR otmpFaceName; + PSTR otmpStyleName; + PSTR otmpFullName; +} OUTLINETEXTMETRIC, *LPOUTLINETEXTMETRIC; + +typedef struct _OVERLAPPED { + DWORD Internal; + DWORD InternalHigh; + DWORD Offset; + DWORD OffsetHigh; + HANDLE hEvent; +} OVERLAPPED, *LPOVERLAPPED; + +typedef struct tagPSD { + DWORD lStructSize; + HWND hwndOwner; + HGLOBAL hDevMode; + HGLOBAL hDevNames; + DWORD Flags; + POINT ptPaperSize; + RECT rtMinMargin; + RECT rtMargin; + HINSTANCE hInstance; + LPARAM lCustData; + LPPAGESETUPHOOK lpfnPageSetupHook; + LPPAGEPAINTHOOK lpfnPagePaintHook; + LPCTSTR lpPageSetupTemplateName; + HGLOBAL hPageSetupTemplate; +} PAGESETUPDLG, *LPPAGESETUPDLG; + +typedef struct tagPAINTSTRUCT { + HDC hdc; + WINBOOL fErase; + RECT rcPaint; + WINBOOL fRestore; + WINBOOL fIncUpdate; + BYTE rgbReserved[32]; +} PAINTSTRUCT, *LPPAINTSTRUCT; + +typedef struct _paraformat { + UINT cbSize; + DWORD dwMask; + WORD wNumbering; + WORD wReserved; + LONG dxStartIndent; + LONG dxRightIndent; + LONG dxOffset; + WORD wAlignment; + SHORT cTabCount; + LONG rgxTabs[MAX_TAB_STOPS]; +} PARAFORMAT; + +typedef struct _PERF_COUNTER_BLOCK { + DWORD ByteLength; +} PERF_COUNTER_BLOCK; + +typedef struct _PERF_COUNTER_DEFINITION { + DWORD ByteLength; + DWORD CounterNameTitleIndex; + LPWSTR CounterNameTitle; + DWORD CounterHelpTitleIndex; + LPWSTR CounterHelpTitle; + DWORD DefaultScale; + DWORD DetailLevel; + DWORD CounterType; + DWORD CounterSize; + DWORD CounterOffset; +} PERF_COUNTER_DEFINITION; + +typedef struct _PERF_DATA_BLOCK { + WCHAR Signature[4]; + DWORD LittleEndian; + DWORD Version; + DWORD Revision; + DWORD TotalByteLength; + DWORD HeaderLength; + DWORD NumObjectTypes; + DWORD DefaultObject; + SYSTEMTIME SystemTime; + LARGE_INTEGER PerfTime; + LARGE_INTEGER PerfFreq; + LARGE_INTEGER PerfTime100nSec; + DWORD SystemNameLength; + DWORD SystemNameOffset; +} PERF_DATA_BLOCK; + +typedef struct _PERF_INSTANCE_DEFINITION { + DWORD ByteLength; + DWORD ParentObjectTitleIndex; + DWORD ParentObjectInstance; + DWORD UniqueID; + DWORD NameOffset; + DWORD NameLength; +} PERF_INSTANCE_DEFINITION; + +typedef struct _PERF_OBJECT_TYPE { + DWORD TotalByteLength; + DWORD DefinitionLength; + DWORD HeaderLength; + DWORD ObjectNameTitleIndex; + LPWSTR ObjectNameTitle; + DWORD ObjectHelpTitleIndex; + LPWSTR ObjectHelpTitle; + DWORD DetailLevel; + DWORD NumCounters; + DWORD DefaultCounter; + DWORD NumInstances; + DWORD CodePage; + LARGE_INTEGER PerfTime; + LARGE_INTEGER PerfFreq; +} PERF_OBJECT_TYPE; + +typedef struct _POLYTEXT { + int x; + int y; + UINT n; + LPCTSTR lpstr; + UINT uiFlags; + RECT rcl; + int *pdx; +} POLYTEXT, *LPPOLYTEXT; + +typedef struct _PORT_INFO_1 { + LPTSTR pName; +} PORT_INFO_1; + +typedef struct _PORT_INFO_2 { + LPSTR pPortName; + LPSTR pMonitorName; + LPSTR pDescription; + DWORD fPortType; + DWORD Reserved; +} PORT_INFO_2; + +typedef struct _PREVENT_MEDIA_REMOVAL { + BOOLEAN PreventMediaRemoval; +} PREVENT_MEDIA_REMOVAL ; + +typedef struct tagPD { + DWORD lStructSize; + HWND hwndOwner; + HANDLE hDevMode; + HANDLE hDevNames; + HDC hDC; + DWORD Flags; + WORD nFromPage; + WORD nToPage; + WORD nMinPage; + WORD nMaxPage; + WORD nCopies; + HINSTANCE hInstance; + DWORD lCustData; + LPPRINTHOOKPROC lpfnPrintHook; + LPSETUPHOOKPROC lpfnSetupHook; + LPCTSTR lpPrintTemplateName; + LPCTSTR lpSetupTemplateName; + HANDLE hPrintTemplate; + HANDLE hSetupTemplate; +} PRINTDLG PACKED, *LPPRINTDLG PACKED; + +typedef struct _PRINTER_DEFAULTSA +{ + LPTSTR pDatatype; + LPDEVMODEA pDevMode; + ACCESS_MASK DesiredAccess; +} PRINTER_DEFAULTSA, *PPRINTER_DEFAULTSA, *LPPRINTER_DEFAULTSA; + +typedef struct _PRINTER_DEFAULTSW +{ + LPTSTR pDatatype; + LPDEVMODEA pDevMode; + ACCESS_MASK DesiredAccess; +} PRINTER_DEFAULTSW, *PPRINTER_DEFAULTSW, *LPPRINTER_DEFAULTSW; + +typedef struct _PRINTER_INFO_1 { + DWORD Flags; + LPTSTR pDescription; + LPTSTR pName; + LPTSTR pComment; +} PRINTER_INFO_1, *PPRINTER_INFO_1, *LPPRINTER_INFO_1; + + #if 0 +typedef struct _PRINTER_INFO_2 { + LPTSTR pServerName; + LPTSTR pPrinterName; + LPTSTR pShareName; + LPTSTR pPortName; + LPTSTR pDriverName; + LPTSTR pComment; + LPTSTR pLocation; + LPDEVMODE pDevMode; + LPTSTR pSepFile; + LPTSTR pPrintProcessor; + LPTSTR pDatatype; + LPTSTR pParameters; + PSECURITY_DESCRIPTOR pSecurityDescriptor; + DWORD Attributes; + DWORD Priority; + DWORD DefaultPriority; + DWORD StartTime; + DWORD UntilTime; + DWORD Status; + DWORD cJobs; + DWORD AveragePPM; +} PRINTER_INFO_2; + + +typedef struct _PRINTER_INFO_3 { + PSECURITY_DESCRIPTOR pSecurityDescriptor; +} PRINTER_INFO_3; + #endif + +typedef struct _PRINTER_INFO_4 { + LPTSTR pPrinterName; + LPTSTR pServerName; + DWORD Attributes; +} PRINTER_INFO_4; + +typedef struct _PRINTER_INFO_5 { + LPTSTR pPrinterName; + LPTSTR pPortName; + DWORD Attributes; + DWORD DeviceNotSelectedTimeout; + DWORD TransmissionRetryTimeout; +} PRINTER_INFO_5; + +typedef struct _PRINTER_NOTIFY_INFO_DATA { + WORD Type; + WORD Field; + DWORD Reserved; + DWORD Id; + union { + DWORD adwData[2]; + struct { + DWORD cbBuf; + LPVOID pBuf; + } Data; + } NotifyData; +} PRINTER_NOTIFY_INFO_DATA; + +typedef struct _PRINTER_NOTIFY_INFO { + DWORD Version; + DWORD Flags; + DWORD Count; + PRINTER_NOTIFY_INFO_DATA aData[1]; +} PRINTER_NOTIFY_INFO; + +typedef struct _PRINTER_NOTIFY_OPTIONS_TYPE { + WORD Type; + WORD Reserved0; + DWORD Reserved1; + DWORD Reserved2; + DWORD Count; + PWORD pFields; +} PRINTER_NOTIFY_OPTIONS_TYPE, *PPRINTER_NOTIFY_OPTIONS_TYPE; + +typedef struct _PRINTER_NOTIFY_OPTIONS { + DWORD Version; + DWORD Flags; + DWORD Count; + PPRINTER_NOTIFY_OPTIONS_TYPE pTypes; +} PRINTER_NOTIFY_OPTIONS; + +typedef struct _PRINTPROCESSOR_INFO_1 { + LPTSTR pName; +} PRINTPROCESSOR_INFO_1; + + +typedef struct _PROCESS_HEAP_ENTRY { + PVOID lpData; + DWORD cbData; + BYTE cbOverhead; + BYTE iRegionIndex; + WORD wFlags; + DWORD dwCommittedSize; + DWORD dwUnCommittedSize; + LPVOID lpFirstBlock; + LPVOID lpLastBlock; + HANDLE hMem; +} PROCESS_HEAPENTRY, *LPPROCESS_HEAP_ENTRY; + +typedef struct _PROCESS_INFORMATION { + HANDLE hProcess; + HANDLE hThread; + DWORD dwProcessId; + DWORD dwThreadId; +} PROCESS_INFORMATION, *LPPROCESS_INFORMATION; + +typedef UINT CALLBACK (*LPFNPSPCALLBACK) (HWND, UINT, LPVOID); + +typedef struct _PROPSHEETPAGE { + DWORD dwSize; + DWORD dwFlags; + HINSTANCE hInstance; + union { + LPCTSTR pszTemplate; + LPCDLGTEMPLATE pResource; + } u1; + union { + HICON hIcon; + LPCTSTR pszIcon; + } u2; + LPCTSTR pszTitle; + DLGPROC pfnDlgProc; + LPARAM lParam; + LPFNPSPCALLBACK pfnCallback; + UINT * pcRefParent; +} PROPSHEETPAGE, *LPPROPSHEETPAGE; +typedef const PROPSHEETPAGE *LPCPROPSHEETPAGE; + +typedef struct _PSP *HPROPSHEETPAGE; +typedef struct _PROPSHEETHEADER { + DWORD dwSize; + DWORD dwFlags; + HWND hwndParent; + HINSTANCE hInstance; + union { + HICON hIcon; + LPCTSTR pszIcon; + } u1; + LPCTSTR pszCaption; + UINT nPages; + union { + UINT nStartPage; + LPCTSTR pStartPage; + } u2; + union { + LPCPROPSHEETPAGE ppsp; + HPROPSHEETPAGE *phpage; + } u3; + PFNPROPSHEETCALLBACK pfnCallback; +} PROPSHEETHEADER, *LPPROPSHEETHEADER; +typedef const PROPSHEETHEADER *LPCPROPSHEETHEADER; + +/* PropertySheet callbacks */ +typedef WINBOOL CALLBACK (*LPFNADDPROPSHEETPAGE) (HPROPSHEETPAGE, LPARAM); +typedef WINBOOL CALLBACK (*LPFNADDPROPSHEETPAGES) (LPVOID, + LPFNADDPROPSHEETPAGE, + LPARAM); + +typedef struct _PROTOCOL_INFO { + DWORD dwServiceFlags; + INT iAddressFamily; + INT iMaxSockAddr; + INT iMinSockAddr; + INT iSocketType; + INT iProtocol; + DWORD dwMessageSize; + LPTSTR lpProtocol; +} PROTOCOL_INFO; + +typedef struct _PROVIDOR_INFO_1 { + LPTSTR pName; + LPTSTR pEnvironment ; + LPTSTR pDLLName ; +} PROVIDOR_INFO_1; + +typedef struct _PSHNOTIFY { + NMHDR hdr; + LPARAM lParam; +} PSHNOTIFY, *LPPSHNOTIFY; + +typedef struct _punctuation { + UINT iSize; + LPSTR szPunctuation; +} PUNCTUATION; + +typedef struct _QUERY_SERVICE_CONFIGA { + DWORD dwServiceType; + DWORD dwStartType; + DWORD dwErrorControl; + LPSTR lpBinaryPathName; + LPSTR lpLoadOrderGroup; + DWORD dwTagId; + LPSTR lpDependencies; + LPSTR lpServiceStartName; + LPSTR lpDisplayName; +} QUERY_SERVICE_CONFIGA, *LPQUERY_SERVICE_CONFIGA; + +typedef struct _QUERY_SERVICE_CONFIGW { + DWORD dwServiceType; + DWORD dwStartType; + DWORD dwErrorControl; + LPWSTR lpBinaryPathName; + LPWSTR lpLoadOrderGroup; + DWORD dwTagId; + LPWSTR lpDependencies; + LPWSTR lpServiceStartName; + LPWSTR lpDisplayName; +} QUERY_SERVICE_CONFIGW, *LPQUERY_SERVICE_CONFIGW; + +#ifdef UNICODE +#define QUERY_SERVICE_CONFIG QUERY_SERVICE_CONFIGW +#define LPQUERY_SERVICE_CONFIG LPQUERY_SERVICE_CONFIGW +#else +#define QUERY_SERVICE_CONFIG QUERY_SERVICE_CONFIGA +#define LPQUERY_SERVICE_CONFIG LPQUERY_SERVICE_CONFIGA +#endif + +typedef struct _QUERY_SERVICE_LOCK_STATUSA { + DWORD fIsLocked; + LPSTR lpLockOwner; + DWORD dwLockDuration; +} QUERY_SERVICE_LOCK_STATUSA, *LPQUERY_SERVICE_LOCK_STATUSA; + +typedef struct _QUERY_SERVICE_LOCK_STATUSW { + DWORD fIsLocked; + LPWSTR lpLockOwner; + DWORD dwLockDuration; +} QUERY_SERVICE_LOCK_STATUSW, *LPQUERY_SERVICE_LOCK_STATUSW; + +#ifdef UNICODE +#define QUERY_SERVICE_LOCK_STATUS QUERY_SERVICE_LOCK_STATUSW +#define LPQUERY_SERVICE_LOCK_STATUS LPQUERY_SERVICE_LOCK_STATUSW +#else +#define QUERY_SERVICE_LOCK_STATUS QUERY_SERVICE_LOCK_STATUSA +#define LPQUERY_SERVICE_LOCK_STATUS LPQUERY_SERVICE_LOCK_STATUSA +#endif + +typedef struct _RASAMB { + DWORD dwSize; + DWORD dwError; + TCHAR szNetBiosError[ NETBIOS_NAME_LEN + 1 ]; + BYTE bLana; +} RASAMB; + +typedef struct _RASCONN { + DWORD dwSize; + HRASCONN hrasconn; + TCHAR szEntryName[RAS_MaxEntryName + 1]; + + CHAR szDeviceType[ RAS_MaxDeviceType + 1 ]; + CHAR szDeviceName[ RAS_MaxDeviceName + 1 ]; +} RASCONN ; + +typedef struct _RASCONNSTATUS { + DWORD dwSize; + RASCONNSTATE rasconnstate; + DWORD dwError; + TCHAR szDeviceType[RAS_MaxDeviceType + 1]; + TCHAR szDeviceName[RAS_MaxDeviceName + 1]; +} RASCONNSTATUS; + +typedef struct _RASDIALEXTENSIONS { + DWORD dwSize; + DWORD dwfOptions; + HWND hwndParent; + DWORD reserved; +} RASDIALEXTENSIONS; + +typedef struct _RASDIALPARAMS { + DWORD dwSize; + TCHAR szEntryName[RAS_MaxEntryName + 1]; + TCHAR szPhoneNumber[RAS_MaxPhoneNumber + 1]; + TCHAR szCallbackNumber[RAS_MaxCallbackNumber + 1]; + TCHAR szUserName[UNLEN + 1]; + TCHAR szPassword[PWLEN + 1]; + TCHAR szDomain[DNLEN + 1] ; +} RASDIALPARAMS; + +typedef struct _RASENTRYNAME { + DWORD dwSize; + TCHAR szEntryName[RAS_MaxEntryName + 1]; +}RASENTRYNAME; + +typedef struct _RASPPPIP { + DWORD dwSize; + DWORD dwError; + TCHAR szIpAddress[ RAS_MaxIpAddress + 1 ]; +} RASPPPIP; + +typedef struct _RASPPPIPX { + DWORD dwSize; + DWORD dwError; + TCHAR szIpxAddress[ RAS_MaxIpxAddress + 1 ]; +} RASPPPIPX; + +typedef struct _RASPPPNBF { + DWORD dwSize; + DWORD dwError; + DWORD dwNetBiosError; + TCHAR szNetBiosError[ NETBIOS_NAME_LEN + 1 ]; + TCHAR szWorkstationName[ NETBIOS_NAME_LEN + 1 ]; + BYTE bLana; +} RASPPPNBF; + +typedef struct _RASTERIZER_STATUS { + short nSize; + short wFlags; + short nLanguageID; +} RASTERIZER_STATUS, *LPRASTERIZER_STATUS; + +typedef struct _REASSIGN_BLOCKS { + WORD Reserved; + WORD Count; + DWORD BlockNumber[1]; +} REASSIGN_BLOCKS ; + +typedef struct _REMOTE_NAME_INFO { + LPTSTR lpUniversalName; + LPTSTR lpConnectionName; + LPTSTR lpRemainingPath; +} REMOTE_NAME_INFO; + +/* + TODO: OLE +typedef struct _reobject { + DWORD cbStruct; + LONG cp; + CLSID clsid; + LPOLEOBJECT poleobj; + LPSTORAGE pstg; + LPOLECLIENTSITE polesite; + SIZEL sizel; + DWORD dvaspect; + DWORD dwFlags; + DWORD dwUser; +} REOBJECT; +*/ + +typedef struct _repastespecial { + DWORD dwAspect; + DWORD dwParam; +} REPASTESPECIAL; + +typedef struct _reqresize { + NMHDR nmhdr; + RECT rc; +} REQRESIZE; + +typedef struct _RGNDATAHEADER { + DWORD dwSize; + DWORD iType; + DWORD nCount; + DWORD nRgnSize; + RECT rcBound; +} RGNDATAHEADER; + +typedef struct _RGNDATA { + RGNDATAHEADER rdh; + char Buffer[1]; +} RGNDATA, *PRGNDATA, *LPRGNDATA; + +typedef struct tagSCROLLINFO { + UINT cbSize; + UINT fMask; + int nMin; + int nMax; + UINT nPage; + int nPos; + int nTrackPos; +} SCROLLINFO, *LPSCROLLINFO; +typedef SCROLLINFO const *LPCSCROLLINFO; + + +typedef struct _selchange { + NMHDR nmhdr; + CHARRANGE chrg; + WORD seltyp; +} SELCHANGE; + +typedef struct tagSERIALKEYS { + DWORD cbSize; + DWORD dwFlags; + LPSTR lpszActivePort; + LPSTR lpszPort; + DWORD iBaudRate; + DWORD iPortState; +} SERIALKEYS, * LPSERIALKEYS; + +typedef struct _SERVICE_TABLE_ENTRYA { + LPSTR lpServiceName; + LPSERVICE_MAIN_FUNCTION lpServiceProc; +} SERVICE_TABLE_ENTRYA, *LPSERVICE_TABLE_ENTRYA; + +typedef struct _SERVICE_TABLE_ENTRYW { + LPWSTR lpServiceName; + LPSERVICE_MAIN_FUNCTION lpServiceProc; +} SERVICE_TABLE_ENTRYW, *LPSERVICE_TABLE_ENTRYW; + +#ifdef UNICODE +#define SERVICE_TABLE_ENTRY SERVICE_TABLE_ENTRYW +#define LPSERVICE_TABLE_ENTRY LPSERVICE_TABLE_ENTRYW +#else +#define SERVICE_TABLE_ENTRY SERVICE_TABLE_ENTRYA +#define LPSERVICE_TABLE_ENTRY LPSERVICE_TABLE_ENTRYA +#endif + + +typedef struct _SERVICE_TYPE_VALUE_ABS { + DWORD dwNameSpace; + DWORD dwValueType; + DWORD dwValueSize; + LPTSTR lpValueName; + PVOID lpValue; +} SERVICE_TYPE_VALUE_ABS; + +typedef struct _SERVICE_TYPE_INFO_ABS { + LPTSTR lpTypeName; + DWORD dwValueCount; + SERVICE_TYPE_VALUE_ABS Values[1]; +} SERVICE_TYPE_INFO_ABS; + +typedef struct _SESSION_BUFFER { + UCHAR lsn; + UCHAR state; + UCHAR local_name[NCBNAMSZ]; + UCHAR remote_name[NCBNAMSZ]; + UCHAR rcvs_outstanding; + UCHAR sends_outstanding; +} SESSION_BUFFER; + +typedef struct _SESSION_HEADER { + UCHAR sess_name; + UCHAR num_sess; + UCHAR rcv_dg_outstanding; + UCHAR rcv_any_outstanding; +} SESSION_HEADER; + +typedef enum tagSHCONTF { + SHCONTF_FOLDERS = 32, + SHCONTF_NONFOLDERS = 64, + SHCONTF_INCLUDEHIDDEN = 128, +} SHCONTF; + +typedef struct _SHFILEINFO { + HICON hIcon; + int iIcon; + DWORD dwAttributes; + char szDisplayName[MAX_PATH]; + char szTypeName[80]; +} SHFILEINFO; + +typedef WORD FILEOP_FLAGS; +typedef struct _SHFILEOPSTRUCT { + HWND hwnd; + UINT wFunc; + LPCSTR pFrom; + LPCSTR pTo; + FILEOP_FLAGS fFlags; + WINBOOL fAnyOperationsAborted; + LPVOID hNameMappings; + LPCSTR lpszProgressTitle; +} SHFILEOPSTRUCT, *LPSHFILEOPSTRUCT; + +typedef enum tagSHGDN { + SHGDN_NORMAL = 0, + SHGDN_INFOLDER = 1, + SHGDN_FORPARSING = 0x8000, +} SHGNO; + +typedef struct _SHNAMEMAPPING { + LPSTR pszOldPath; + LPSTR pszNewPath; + int cchOldPath; + int cchNewPath; +} SHNAMEMAPPING, *LPSHNAMEMAPPING; + +typedef struct tagSOUNDSENTRY { + UINT cbSize; + DWORD dwFlags; + DWORD iFSTextEffect; + DWORD iFSTextEffectMSec; + DWORD iFSTextEffectColorBits; + DWORD iFSGrafEffect; + DWORD iFSGrafEffectMSec; + DWORD iFSGrafEffectColor; + DWORD iWindowsEffect; + DWORD iWindowsEffectMSec; + LPTSTR lpszWindowsEffectDLL; + DWORD iWindowsEffectOrdinal; +} SOUNDSENTRY, *LPSOUNDSENTRY; + +typedef struct _STARTUPINFOA { + DWORD cb; + LPSTR lpReserved; + LPSTR lpDesktop; + LPSTR lpTitle; + DWORD dwX; + DWORD dwY; + DWORD dwXSize; + DWORD dwYSize; + DWORD dwXCountChars; + DWORD dwYCountChars; + DWORD dwFillAttribute; + DWORD dwFlags; + WORD wShowWindow; + WORD cbReserved2; + LPBYTE lpReserved2; + HANDLE hStdInput; + HANDLE hStdOutput; + HANDLE hStdError; +} STARTUPINFOA, *LPSTARTUPINFOA; + +typedef struct _STARTUPINFOW { + DWORD cb; + LPWSTR lpReserved; + LPWSTR lpDesktop; + LPWSTR lpTitle; + DWORD dwX; + DWORD dwY; + DWORD dwXSize; + DWORD dwYSize; + DWORD dwXCountChars; + DWORD dwYCountChars; + DWORD dwFillAttribute; + DWORD dwFlags; + WORD wShowWindow; + WORD cbReserved2; + LPBYTE lpReserved2; + HANDLE hStdInput; + HANDLE hStdOutput; + HANDLE hStdError; +} STARTUPINFOW, *LPSTARTUPINFOW; + +#ifdef UNICODE +typedef STARTUPINFOW STARTUPINFO; +typedef LPSTARTUPINFOW LPSTARTUPINFO; +#else +typedef STARTUPINFOA STARTUPINFO; +typedef LPSTARTUPINFOA LPSTARTUPINFO; +#endif /* UNICODE */ + +typedef struct tagSTICKYKEYS { + DWORD cbSize; + DWORD dwFlags; +} STICKYKEYS, *LPSTICKYKEYS; + +typedef struct _STRRET { + UINT uType; + union + { + LPWSTR pOleStr; + UINT uOffset; + char cStr[MAX_PATH]; + } DUMMYUNIONNAME; +} STRRET, *LPSTRRET; + +typedef struct _tagSTYLEBUF { + DWORD dwStyle; + CHAR szDescription[32]; +} STYLEBUF, *LPSTYLEBUF; + +typedef struct tagSTYLESTRUCT { + DWORD styleOld; + DWORD styleNew; +} STYLESTRUCT, * LPSTYLESTRUCT; + +typedef struct _SYSTEM_AUDIT_ACE { + ACE_HEADER Header; + ACCESS_MASK Mask; + DWORD SidStart; +} SYSTEM_AUDIT_ACE; + +typedef struct _SYSTEM_INFO +{ + union + { + DWORD dwOemId; + struct + { + WORD wProcessorArchitecture; + WORD wReserved; + } + s; + } + u; + DWORD dwPageSize; + LPVOID lpMinimumApplicationAddress; + LPVOID lpMaximumApplicationAddress; + DWORD dwActiveProcessorMask; + DWORD dwNumberOfProcessors; + DWORD dwProcessorType; + DWORD dwAllocationGranularity; + WORD wProcessorLevel; + WORD wProcessorRevision; +} SYSTEM_INFO, *LPSYSTEM_INFO; + +typedef struct _SYSTEM_POWER_STATUS { + BYTE ACLineStatus; + BYTE BatteryFlag; + BYTE BatteryLifePercent; + BYTE Reserved1; + DWORD BatteryLifeTime; + DWORD BatteryFullLifeTime; +} SYSTEM_POWER_STATUS; +typedef SYSTEM_POWER_STATUS *LPSYSTEM_POWER_STATUS; + +typedef struct _TAPE_ERASE { + ULONG Type; +} TAPE_ERASE; + +typedef struct _TAPE_GET_DRIVE_PARAMETERS { + BOOLEAN ECC; + BOOLEAN Compression; + BOOLEAN DataPadding; + BOOLEAN ReportSetmarks; + ULONG DefaultBlockSize; + ULONG MaximumBlockSize; + ULONG MinimumBlockSize; + ULONG MaximumPartitionCount; + ULONG FeaturesLow; + ULONG FeaturesHigh; + ULONG EOTWarningZoneSize; +} TAPE_GET_DRIVE_PARAMETERS; + +typedef struct _TAPE_GET_MEDIA_PARAMETERS { + LARGE_INTEGER Capacity; + LARGE_INTEGER Remaining; + DWORD BlockSize; + DWORD PartitionCount; + BOOLEAN WriteProtected; +} TAPE_GET_MEDIA_PARAMETERS; + +typedef struct _TAPE_GET_POSITION { + ULONG Type; + ULONG Partition; + ULONG OffsetLow; + ULONG OffsetHigh; +} TAPE_GET_POSITION; + +typedef struct _TAPE_PREPARE { + ULONG Operation; +} TAPE_PREPARE; + +typedef struct _TAPE_SET_DRIVE_PARAMETERS { + BOOLEAN ECC; + BOOLEAN Compression; + BOOLEAN DataPadding; + BOOLEAN ReportSetmarks; + ULONG EOTWarningZoneSize; +} TAPE_SET_DRIVE_PARAMETERS; + +typedef struct _TAPE_SET_MEDIA_PARAMETERS { + ULONG BlockSize; +} TAPE_SET_MEDIA_PARAMETERS; + +typedef struct _TAPE_SET_POSITION { + ULONG Method; + ULONG Partition; + ULONG OffsetLow; + ULONG OffsetHigh; +} TAPE_SET_POSITION; + +typedef struct _TAPE_WRITE_MARKS { + ULONG Type; + ULONG Count; +} TAPE_WRITE_MARKS; + +typedef struct { + HINSTANCE hInst; + UINT nID; +} TBADDBITMAP, *LPTBADDBITMAP; + +typedef struct _TBBUTTON { + int iBitmap; + int idCommand; + BYTE fsState; + BYTE fsStyle; + DWORD dwData; + int iString; +} TBBUTTON, * PTBBUTTON, * LPTBBUTTON; +typedef const TBBUTTON * LPCTBBUTTON; + +typedef struct { + NMHDR hdr; + int iItem; + TBBUTTON tbButton; + int cchText; + LPTSTR pszText; +} TBNOTIFY, *LPTBNOTIFY; + +typedef struct { + HKEY hkr; + LPCTSTR pszSubKey; + LPCTSTR pszValueName; +} TBSAVEPARAMS; + +typedef struct _TC_HITTESTINFO { + POINT pt; + UINT flags; +} TC_HITTESTINFO; + +typedef struct _TC_ITEM { + UINT mask; + UINT lpReserved1; + UINT lpReserved2; + LPTSTR pszText; + int cchTextMax; + int iImage; + LPARAM lParam; +} TC_ITEM; + +typedef struct _TC_ITEMHEADER { + UINT mask; + UINT lpReserved1; + UINT lpReserved2; + LPTSTR pszText; + int cchTextMax; + int iImage; +} TC_ITEMHEADER; + +typedef struct _TC_KEYDOWN { + NMHDR hdr; + WORD wVKey; + UINT flags; +} TC_KEYDOWN; + +typedef struct _textrange { + CHARRANGE chrg; + LPSTR lpstrText; +} TEXTRANGE; + +typedef struct tagTOGGLEKEYS { + DWORD cbSize; + DWORD dwFlags; +} TOGGLEKEYS; + +typedef struct { + UINT cbSize; + UINT uFlags; + HWND hwnd; + UINT uId; + RECT rect; + HINSTANCE hinst; + LPTSTR lpszText; +} TOOLINFO, *PTOOLINFO, *LPTOOLINFO; + +typedef struct { + NMHDR hdr; + LPTSTR lpszText; + char szText[80]; + HINSTANCE hinst; + UINT uFlags; +} TOOLTIPTEXT, *LPTOOLTIPTEXT; + +typedef struct tagTPMPARAMS { + UINT cbSize; + RECT rcExclude; +} TPMPARAMS, *LPTPMPARAMS; + +#if 0 // RobD - typedef removed due to conflict with mingw headers +typedef struct _TRANSMIT_FILE_BUFFERS { + PVOID Head; + DWORD HeadLength; + PVOID Tail; + DWORD TailLength; +} TRANSMIT_FILE_BUFFERS; +#endif + +typedef struct _TT_HITTESTINFO { + HWND hwnd; + POINT pt; + TOOLINFO ti; +} TTHITTESTINFO, * LPHITTESTINFO; + +typedef struct tagTTPOLYCURVE { + WORD wType; + WORD cpfx; + POINTFX apfx[1]; +} TTPOLYCURVE, * LPTTPOLYCURVE; + +typedef struct _TTPOLYGONHEADER { + DWORD cb; + DWORD dwType; + POINTFX pfxStart; +} TTPOLYGONHEADER, * LPTTPOLYGONHEADER; + +typedef struct _TV_DISPINFO { + NMHDR hdr; + TV_ITEM item; +} TV_DISPINFO; + +typedef struct _TVHITTESTINFO { + POINT pt; + UINT flags; + HTREEITEM hItem; +} TV_HITTESTINFO, *LPTV_HITTESTINFO; + +typedef struct _TV_INSERTSTRUCT { + HTREEITEM hParent; + HTREEITEM hInsertAfter; + TV_ITEM item; +} TV_INSERTSTRUCT, *LPTV_INSERTSTRUCT; + +typedef struct _TV_KEYDOWN { + NMHDR hdr; + WORD wVKey; + UINT flags; +} TV_KEYDOWN; + +typedef struct _TV_SORTCB { + HTREEITEM hParent; + PFNTVCOMPARE lpfnCompare; + LPARAM lParam; +} TV_SORTCB, *LPTV_SORTCB; + +typedef struct { + UINT nSec; + UINT nInc; +} UDACCEL; + +typedef struct _UNIVERSAL_NAME_INFO { + LPTSTR lpUniversalName; +} UNIVERSAL_NAME_INFO; + +typedef struct tagUSEROBJECTFLAGS { + WINBOOL fInherit; + WINBOOL fReserved; + DWORD dwFlags; +} USEROBJECTFLAGS; + +typedef struct _VERIFY_INFORMATION { + LARGE_INTEGER StartingOffset; + DWORD Length; +} VERIFY_INFORMATION ; + +typedef struct _VS_FIXEDFILEINFO { + DWORD dwSignature; + DWORD dwStrucVersion; + DWORD dwFileVersionMS; + DWORD dwFileVersionLS; + DWORD dwProductVersionMS; + DWORD dwProductVersionLS; + DWORD dwFileFlagsMask; + DWORD dwFileFlags; + DWORD dwFileOS; + DWORD dwFileType; + DWORD dwFileSubtype; + DWORD dwFileDateMS; + DWORD dwFileDateLS; +} VS_FIXEDFILEINFO; + +typedef struct _WIN32_FIND_DATAA { + DWORD dwFileAttributes; + FILETIME ftCreationTime; + FILETIME ftLastAccessTime; + FILETIME ftLastWriteTime; + DWORD nFileSizeHigh; + DWORD nFileSizeLow; + DWORD dwReserved0; + DWORD dwReserved1; + CHAR cFileName[ MAX_PATH ]; + CHAR cAlternateFileName[ 14 ]; +} WIN32_FIND_DATAA, *LPWIN32_FIND_DATAA, *PWIN32_FIND_DATAA; + +typedef struct _WIN32_FIND_DATAW { + DWORD dwFileAttributes; + FILETIME ftCreationTime; + FILETIME ftLastAccessTime; + FILETIME ftLastWriteTime; + DWORD nFileSizeHigh; + DWORD nFileSizeLow; + DWORD dwReserved0; + DWORD dwReserved1; + WCHAR cFileName[ MAX_PATH ]; + WCHAR cAlternateFileName[ 14 ]; +} WIN32_FIND_DATAW, *LPWIN32_FIND_DATAW, *PWIN32_FIND_DATAW; + +#ifdef UNICODE +#define WIN32_FIND_DATA WIN32_FIND_DATAW +#define PWIN32_FIND_DATA PWIN32_FIND_DATAW +#define LPWIN32_FIND_DATA LPWIN32_FIND_DATAW +#else +#define WIN32_FIND_DATA WIN32_FIND_DATAA +#define PWIN32_FIND_DATA PWIN32_FIND_DATAA +#define LPWIN32_FIND_DATA LPWIN32_FIND_DATAA +#endif + +typedef struct _WIN32_STREAM_ID { + DWORD dwStreamId; + DWORD dwStreamAttributes; + LARGE_INTEGER Size; + DWORD dwStreamNameSize; + WCHAR *cStreamName; +} WIN32_STREAM_ID; + +typedef struct _WINDOWPLACEMENT { + UINT length; + UINT flags; + UINT showCmd; + POINT ptMinPosition; + POINT ptMaxPosition; + RECT rcNormalPosition; +} WINDOWPLACEMENT; + +typedef struct _WNDCLASS { + UINT style; + WNDPROC lpfnWndProc; + int cbClsExtra; + int cbWndExtra; + HANDLE hInstance; + HICON hIcon; + HCURSOR hCursor; + HBRUSH hbrBackground; + LPCTSTR lpszMenuName; + LPCTSTR lpszClassName; +} WNDCLASS, *LPWNDCLASS; + +typedef struct _WNDCLASSEX { + UINT cbSize; + UINT style; + WNDPROC lpfnWndProc; + int cbClsExtra; + int cbWndExtra; + HANDLE hInstance; + HICON hIcon; + HCURSOR hCursor; + HBRUSH hbrBackground; + LPCTSTR lpszMenuName; + LPCTSTR lpszClassName; + HICON hIconSm; +} WNDCLASSEX, *LPWNDCLASSEX; + +typedef struct _CONNECTDLGSTRUCT { + DWORD cbStructure; + HWND hwndOwner; + LPNETRESOURCE lpConnRes; + DWORD dwFlags; + DWORD dwDevNum; +} CONNECTDLGSTRUCT, *LPCONNECTDLGSTRUCT; + +typedef struct _DISCDLGSTRUCT { + DWORD cbStructure; + HWND hwndOwner; + LPTSTR lpLocalName; + LPTSTR lpRemoteName; + DWORD dwFlags; +} DISCDLGSTRUCT, *LPDISCDLGSTRUCT; + +typedef struct _NETINFOSTRUCT{ + DWORD cbStructure; + DWORD dwProviderVersion; + DWORD dwStatus; + DWORD dwCharacteristics; + DWORD dwHandle; + WORD wNetType; + DWORD dwPrinters; + DWORD dwDrives; +} NETINFOSTRUCT, *LPNETINFOSTRUCT; + +typedef struct _NETCONNECTINFOSTRUCT{ + DWORD cbStructure; + DWORD dwFlags; + DWORD dwSpeed; + DWORD dwDelay; + DWORD dwOptDataSize; +} NETCONNECTINFOSTRUCT, *LPNETCONNECTINFOSTRUCT; + +typedef int CALLBACK (*ENUMMETAFILEPROC) (HDC, HANDLETABLE, + METARECORD, int, LPARAM); +typedef int CALLBACK (*ENHMETAFILEPROC) (HDC, HANDLETABLE, + ENHMETARECORD, int, LPARAM); + +typedef int CALLBACK (*ENUMFONTSPROC) (LPLOGFONT, LPTEXTMETRIC, DWORD, LPARAM); +typedef int CALLBACK (*FONTENUMPROC) (ENUMLOGFONT *, NEWTEXTMETRIC *, + int, LPARAM); +typedef int CALLBACK (*FONTENUMEXPROC) (ENUMLOGFONTEX *, NEWTEXTMETRICEX *, + int, LPARAM); + +typedef VOID CALLBACK (*LPOVERLAPPED_COMPLETION_ROUTINE) (DWORD, DWORD, + LPOVERLAPPED); + +/* + Structures for the extensions to OpenGL + */ +typedef struct _POINTFLOAT +{ + FLOAT x; + FLOAT y; +} POINTFLOAT, *PPOINTFLOAT; + +typedef struct _GLYPHMETRICSFLOAT +{ + FLOAT gmfBlackBoxX; + FLOAT gmfBlackBoxY; + POINTFLOAT gmfptGlyphOrigin; + FLOAT gmfCellIncX; + FLOAT gmfCellIncY; +} GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT; + +typedef struct tagLAYERPLANEDESCRIPTOR +{ + WORD nSize; + WORD nVersion; + DWORD dwFlags; + BYTE iPixelType; + BYTE cColorBits; + BYTE cRedBits; + BYTE cRedShift; + BYTE cGreenBits; + BYTE cGreenShift; + BYTE cBlueBits; + BYTE cBlueShift; + BYTE cAlphaBits; + BYTE cAlphaShift; + BYTE cAccumBits; + BYTE cAccumRedBits; + BYTE cAccumGreenBits; + BYTE cAccumBlueBits; + BYTE cAccumAlphaBits; + BYTE cDepthBits; + BYTE cStencilBits; + BYTE cAuxBuffers; + BYTE iLayerPlane; + BYTE bReserved; + COLORREF crTransparent; +} LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR; + +typedef struct tagPIXELFORMATDESCRIPTOR +{ + WORD nSize; + WORD nVersion; + DWORD dwFlags; + BYTE iPixelType; + BYTE cColorBits; + BYTE cRedBits; + BYTE cRedShift; + BYTE cGreenBits; + BYTE cGreenShift; + BYTE cBlueBits; + BYTE cBlueShift; + BYTE cAlphaBits; + BYTE cAlphaShift; + BYTE cAccumBits; + BYTE cAccumRedBits; + BYTE cAccumGreenBits; + BYTE cAccumBlueBits; + BYTE cAccumAlphaBits; + BYTE cDepthBits; + BYTE cStencilBits; + BYTE cAuxBuffers; + BYTE iLayerType; + BYTE bReserved; + DWORD dwLayerMask; + DWORD dwVisibleMask; + DWORD dwDamageMask; +} PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR; + +typedef struct +{ + LPWSTR usri2_name; + LPWSTR usri2_password; + DWORD usri2_password_age; + DWORD usri2_priv; + LPWSTR usri2_home_dir; + LPWSTR usri2_comment; + DWORD usri2_flags; + LPWSTR usri2_script_path; + DWORD usri2_auth_flags; + LPWSTR usri2_full_name; + LPWSTR usri2_usr_comment; + LPWSTR usri2_parms; + LPWSTR usri2_workstations; + DWORD usri2_last_logon; + DWORD usri2_last_logoff; + DWORD usri2_acct_expires; + DWORD usri2_max_storage; + DWORD usri2_units_per_week; + PBYTE usri2_logon_hours; + DWORD usri2_bad_pw_count; + DWORD usri2_num_logons; + LPWSTR usri2_logon_server; + DWORD usri2_country_code; + DWORD usri2_code_page; +} USER_INFO_2, *PUSER_INFO_2, *LPUSER_INFO_2; + +typedef struct +{ + LPWSTR usri0_name; +} USER_INFO_0, *PUSER_INFO_0, *LPUSER_INFO_0; + +typedef struct +{ + LPWSTR usri3_name; + LPWSTR usri3_password; + DWORD usri3_password_age; + DWORD usri3_priv; + LPWSTR usri3_home_dir; + LPWSTR usri3_comment; + DWORD usri3_flags; + LPWSTR usri3_script_path; + DWORD usri3_auth_flags; + LPWSTR usri3_full_name; + LPWSTR usri3_usr_comment; + LPWSTR usri3_parms; + LPWSTR usri3_workstations; + DWORD usri3_last_logon; + DWORD usri3_last_logoff; + DWORD usri3_acct_expires; + DWORD usri3_max_storage; + DWORD usri3_units_per_week; + PBYTE usri3_logon_hours; + DWORD usri3_bad_pw_count; + DWORD usri3_num_logons; + LPWSTR usri3_logon_server; + DWORD usri3_country_code; + DWORD usri3_code_page; + DWORD usri3_user_id; + DWORD usri3_primary_group_id; + LPWSTR usri3_profile; + LPWSTR usri3_home_dir_drive; + DWORD usri3_password_expired; +} USER_INFO_3, *PUSER_INFO_3, *LPUSER_INFO_3; + +typedef struct +{ + LPWSTR grpi2_name; + LPWSTR grpi2_comment; + DWORD grpi2_group_id; + DWORD grpi2_attributes; +} GROUP_INFO_2, *PGROUP_INFO_2; + +typedef struct +{ + LPWSTR lgrpi0_name; +} LOCALGROUP_INFO_0, *PLOCALGROUP_INFO_0, *LPLOCALGROUP_INFO_0; + +/* PE executable header. */ +/* Windows.h now includes pe.h to avoid conflicts! */ + +typedef struct _DISPLAY_DEVICE { + DWORD cb; + WCHAR DeviceName[32]; + WCHAR DeviceString[128]; + DWORD StateFlags; + WCHAR DeviceID[128]; + WCHAR DeviceKey[128]; +} DISPLAY_DEVICE, *PDISPLAY_DEVICE; + +typedef HANDLE HMONITOR; +typedef HANDLE HDEVNOTIFY; + +typedef BOOL CALLBACK (*MonitorEnumProc)( + HMONITOR hMonitor, + HDC hdcMonitor, + LPRECT lprcMonitor, + LPARAM dwData); + +typedef MonitorEnumProc MONITORENUMPROC; + +typedef struct { + UINT cbSize; + HWND hwnd; + DWORD dwFlags; + UINT uCount; + DWORD dwTimeout; +} FLASHWINFO, *PFLASHWINFO; + +typedef struct tagALTTABINFO { + DWORD cbSize; + int cItems; + int cColumns; + int cRows; + int iColFocus; + int iRowFocus; + int cxItem; + int cyItem; + POINT ptStart; +} ALTTABINFO, *PALTTABINFO, *LPALTTABINFO; + +typedef struct tagCOMBOBOXINFO { + DWORD cbSize; + RECT rcItem; + RECT rcButton; + DWORD stateButton; + HWND hwndCombo; + HWND hwndItem; + HWND hwndList; +} COMBOBOXINFO, *PCOMBOBOXINFO, *LPCOMBOBOXINFO; + +typedef struct tagCURSORINFO { + DWORD cbSize; + DWORD flags; + HCURSOR hCursor; + POINT ptScreenPos; +} CURSORINFO, *PCURSORINFO, *LPCURSORINFO; + +typedef struct tagGUITHREADINFO { + DWORD cbSize; + DWORD flags; + HWND hwndActive; + HWND hwndFocus; + HWND hwndCapture; + HWND hwndMenuOwner; + HWND hwndMoveSize; + HWND hwndCaret; + RECT rcCaret; +} GUITHREADINFO, *PGUITHREADINFO, *LPGUITHREADINFO; + +typedef struct tagLASTINPUTINFO { + UINT cbSize; + DWORD dwTime; +} LASTINPUTINFO, *PLASTINPUTINFO; + +typedef struct tagMENUBARINFO { + DWORD cbSize; + RECT rcBar; + HMENU hMenu; + HWND hwndMenu; + BOOL fBarFocused:1; + BOOL fFocused:1; +} MENUBARINFO, *PMENUBARINFO; + +typedef struct tagMENUINFO { + DWORD cbSize; + DWORD fMask; + DWORD dwStyle; + UINT cyMax; + HBRUSH hbrBack; + DWORD dwContextHelpID; + ULONG_PTR dwMenuData; +} MENUINFO, FAR *LPMENUINFO; +typedef MENUINFO CONST FAR *LPCMENUINFO; + +typedef struct tagMONITORINFO { + DWORD cbSize; + RECT rcMonitor; + RECT rcWork; + DWORD dwFlags; +} MONITORINFO, *LPMONITORINFO; + +typedef struct tagMOUSEMOVEPOINT { + int x; + int y; + DWORD time; + ULONG_PTR dwExtraInfo; +} MOUSEMOVEPOINT, *PMOUSEMOVEPOINT, *LPMOUSEMOVEPOINT; + +#define CCHILDREN_SCROLLBAR 5 + +typedef struct tagSCROLLBARINFO { + DWORD cbSize; + RECT rcScrollBar; + int dxyLineButton; + int xyThumbTop; + int xyThumbBottom; + int reserved; + DWORD rgstate[CCHILDREN_SCROLLBAR+1]; +} SCROLLBARINFO, *PSCROLLBARINFO, *LPSCROLLBARINFO; + +#define CCHILDREN_TITLEBAR 5 + +typedef struct tagTITLEBARINFO { + DWORD cbSize; + RECT rcTitleBar; + DWORD rgstate[CCHILDREN_TITLEBAR+1]; +} TITLEBARINFO, *PTITLEBARINFO, *LPTITLEBARINFO; + +typedef struct { + HWND hwnd; + LPCTSTR szWindowName; + UINT32 fToBeClosed; + UINT32 fToBeTerminated; +} WINDOWINFO, *PWINDOWINFO, *LPWINDOWINFO; + +typedef struct tagMOUSEINPUT { + LONG dx; + LONG dy; + DWORD mouseData; + DWORD dwFlags; + DWORD time; + ULONG_PTR dwExtraInfo; +} MOUSEINPUT, *PMOUSEINPUT; + +typedef struct tagKEYBDINPUT { + WORD wVk; + WORD wScan; + DWORD dwFlags; + DWORD time; + ULONG_PTR dwExtraInfo; +} KEYBDINPUT, *PKEYBDINPUT; + +typedef struct tagHARDWAREINPUT { + DWORD uMsg; + WORD wParamL; + WORD wParamH; +} HARDWAREINPUT, *PHARDWAREINPUT; + +typedef struct tagINPUT { + DWORD type; + union + { + MOUSEINPUT mi; + KEYBDINPUT ki; + HARDWAREINPUT hi; + } u; +} INPUT, *PINPUT, FAR* LPINPUT; + +typedef struct tagTRACKMOUSEEVENT { + DWORD cbSize; + DWORD dwFlags; + HWND hwndTrack; + DWORD dwHoverTime; +} TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT; + +typedef struct _BLENDFUNCTION { + BYTE BlendOp; + BYTE BlendFlags; + BYTE SourceConstantAlpha; + BYTE AlphaFormat; +}BLENDFUNCTION, *PBLENDFUNCTION, *LPBLENDFUNCTION; + +typedef enum _GET_FILEEX_INFO_LEVELS { + GetFileExInfoStandard +} GET_FILEEX_INFO_LEVELS; + +typedef struct _WIN32_FILE_ATTRIBUTES_DATA { + DWORD dwFileAttributes; + FILETIME ftCreationTime; + FILETIME ftLastAccessTime; + FILETIME ftLastWriteTime; + DWORD nFileSizeHigh; + DWORD nFileSizeLow; +} WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* WIN32_LEAN_AND_MEAN */ + +#endif /* _GNU_H_WINDOWS32_STRUCTURES */ + + diff --git a/reactos/include/tchar.h b/reactos/include/tchar.h new file mode 100644 index 00000000000..e108dd721d6 --- /dev/null +++ b/reactos/include/tchar.h @@ -0,0 +1,231 @@ +/* + * tchar.h + * + * Unicode mapping layer for the standard C library. By including this + * file and using the 't' names for string functions + * (eg. _tprintf) you can make code which can be easily adapted to both + * Unicode and non-unicode environments. In a unicode enabled compile define + * _UNICODE before including tchar.h, otherwise the standard non-unicode + * library functions will be used. + * + * Note that you still need to include string.h or stdlib.h etc. to define + * the appropriate functions. Also note that there are several defines + * included for non-ANSI functions which are commonly available (but using + * the convention of prepending an underscore to non-ANSI library function + * names). + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Colin Peters + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.3 $ + * $Author: chorns $ + * $Date: 2002/09/08 10:22:28 $ + * + */ + +#ifndef _TCHAR_H_ +#define _TCHAR_H_ + +/* + * NOTE: This tests _UNICODE, which is different from the UNICODE define + * used to differentiate Win32 API calls. + */ +#ifdef _UNICODE + + +/* + * Use TCHAR instead of char or wchar_t. It will be appropriately translated + * if _UNICODE is correctly defined (or not). + */ +#ifndef _TCHAR_DEFINED +#ifndef RC_INVOKED +typedef wchar_t TCHAR; +#endif /* Not RC_INVOKED */ +#define _TCHAR_DEFINED +#endif + + +/* + * Enclose constant strings and literal characters in the _TEXT and _T macro to make + * them unicode constant strings when _UNICODE is defined. + */ +#define _TEXT(x) L ## x +#define _T(x) L ## x + +/* + * Unicode functions + */ + +#define _tprintf wprintf +#define _ftprintf fwprintf +#define _stprintf swprintf +#define _sntprintf _snwprintf +#define _vtprintf vwprintf +#define _vftprintf vfwprintf +#define _vstprintf vswprintf +#define _vsntprintf _vsnwprintf +#define _tscanf wscanf +#define _ftscanf fwscanf +#define _stscanf swscanf +#define _fgettc fgetwc +#define _fgettchar _fgetwchar +#define _fgetts fgetws +#define _fputtc fputwc +#define _fputtchar _fputwchar +#define _fputts fputws +#define _gettc getwc +#define _getts getws +#define _puttc putwc +#define _putts putws +#define _ungettc ungetwc +#define _tcstod wcstod +#define _tcstol wcstol +#define _tcstoul wcstoul +#define _tcscat wcscat +#define _tcschr wcschr +#define _tcscmp wcscmp +#define _tcscpy wcscpy +#define _tcscspn wcscspn +#define _tcslen wcslen +#define _tcsncat wcsncat +#define _tcsncmp wcsncmp +#define _tcsncpy wcsncpy +#define _tcspbrk wcspbrk +#define _tcsrchr wcsrchr +#define _tcsspn wcsspn +#define _tcsstr wcsstr +#define _tcstok wcstok +#define _tcsdup _wcsdup +#define _tcsicmp _wcsicmp +#define _tcsnicmp _wcsnicmp +#define _tcsnset _wcsnset +#define _tcsrev _wcsrev +#define _tcsset _wcsset +#define _tcslwr _wcslwr +#define _tcsupr _wcsupr +#define _tcsxfrm wcsxfrm +#define _tcscoll wcscoll +#define _tcsicoll _wcsicoll +#define _istalpha iswalpha +#define _istupper iswupper +#define _istlower iswlower +#define _istdigit iswdigit +#define _istxdigit iswxdigit +#define _istspace iswspace +#define _istpunct iswpunct +#define _istalnum iswalnum +#define _istprint iswprint +#define _istgraph iswgraph +#define _istcntrl iswcntrl +#define _istascii iswascii +#define _totupper towupper +#define _totlower towlower +#define _ttoi _wtoi +#define _tcsftime wcsftime + +#else /* Not _UNICODE */ + +/* + * TCHAR, the type you should use instead of char. + */ +#ifndef _TCHAR_DEFINED +#ifndef RC_INVOKED +typedef char TCHAR; +#endif +#define _TCHAR_DEFINED +#endif + +/* + * Enclose constant strings and characters in the _TEXT and _T macro. + */ +#define _TEXT(x) x +#define _T(x) x + + +/* + * Non-unicode (standard) functions + */ + +#define _tprintf printf +#define _ftprintf fprintf +#define _stprintf sprintf +#define _sntprintf _snprintf +#define _vtprintf vprintf +#define _vftprintf vfprintf +#define _vstprintf vsprintf +#define _vsntprintf _vsnprintf +#define _tscanf scanf +#define _ftscanf fscanf +#define _stscanf sscanf +#define _fgettc fgetc +#define _fgettchar _fgetchar +#define _fgetts fgets +#define _fputtc fputc +#define _fputtchar _fputchar +#define _fputts fputs +#define _gettc getc +#define _getts gets +#define _puttc putc +#define _putts puts +#define _ungettc ungetc +#define _tcstod strtod +#define _tcstol strtol +#define _tcstoul strtoul +#define _tcscat strcat +#define _tcschr strchr +#define _tcscmp strcmp +#define _tcscpy strcpy +#define _tcscspn strcspn +#define _tcslen strlen +#define _tcsncat strncat +#define _tcsncmp strncmp +#define _tcsncpy strncpy +#define _tcspbrk strpbrk +#define _tcsrchr strrchr +#define _tcsspn strspn +#define _tcsstr strstr +#define _tcstok strtok +#define _tcsdup _strdup +#define _tcsicmp _stricmp +#define _tcsnicmp _strnicmp +#define _tcsnset _strnset +#define _tcsrev _strrev +#define _tcsset _strset +#define _tcslwr _strlwr +#define _tcsupr _strupr +#define _tcsxfrm strxfrm +#define _tcscoll strcoll +#define _tcsicoll _stricoll +#define _istalpha isalpha +#define _istupper isupper +#define _istlower islower +#define _istdigit isdigit +#define _istxdigit isxdigit +#define _istspace isspace +#define _istpunct ispunct +#define _istalnum isalnum +#define _istprint isprint +#define _istgraph isgraph +#define _istcntrl iscntrl +#define _istascii isascii +#define _totupper toupper +#define _totlower tolower +#define _ttoi atoi +#define _tcsftime strftime + +#endif /* Not _UNICODE */ + +#endif /* Not _TCHAR_H_ */ + diff --git a/reactos/include/unicode.h b/reactos/include/unicode.h new file mode 100644 index 00000000000..c3b1fb8f251 --- /dev/null +++ b/reactos/include/unicode.h @@ -0,0 +1,3030 @@ +/* + UnicodeFunctions.h + + Declarations for all the Windows32 API Unicode Functions + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the Windows32 API Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + If you are interested in a warranty or support for this source code, + contact Scott Christley for more information. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNU_H_WINDOWS32_UNICODEFUNCTIONS +#define _GNU_H_WINDOWS32_UNICODEFUNCTIONS + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +WINBOOL +STDCALL +GetBinaryTypeW( + LPCWSTR lpApplicationName, + LPDWORD lpBinaryType + ); + +DWORD +STDCALL +GetShortPathNameW( + LPCWSTR lpszLongPath, + LPWSTR lpszShortPath, + DWORD cchBuffer + ); + +LPWSTR +STDCALL +GetEnvironmentStringsW( + VOID + ); + +WINBOOL +STDCALL +FreeEnvironmentStringsW( + LPWSTR + ); + +DWORD +STDCALL +FormatMessageW( + DWORD dwFlags, + LPCVOID lpSource, + DWORD dwMessageId, + DWORD dwLanguageId, + LPWSTR lpBuffer, + DWORD nSize, + va_list *Arguments + ); + +HANDLE +STDCALL +CreateMailslotW( + LPCWSTR lpName, + DWORD nMaxMessageSize, + DWORD lReadTimeout, + LPSECURITY_ATTRIBUTES lpSecurityAttributes + ); + +int +STDCALL +lstrcmpW( + LPCWSTR lpString1, + LPCWSTR lpString2 + ); + +int +STDCALL +lstrcmpiW( + LPCWSTR lpString1, + LPCWSTR lpString2 + ); + +LPWSTR +STDCALL +lstrcpynW( + LPWSTR lpString1, + LPCWSTR lpString2, + int iMaxLength + ); + +LPWSTR +STDCALL +lstrcpyW( + LPWSTR lpString1, + LPCWSTR lpString2 + ); + +LPWSTR +STDCALL +lstrcatW( + LPWSTR lpString1, + LPCWSTR lpString2 + ); + +int +STDCALL +lstrlenW( + LPCWSTR lpString + ); + +HANDLE +STDCALL +CreateMutexW( + LPSECURITY_ATTRIBUTES lpMutexAttributes, + WINBOOL bInitialOwner, + LPCWSTR lpName + ); + +HANDLE +STDCALL +OpenMutexW( + DWORD dwDesiredAccess, + WINBOOL bInheritHandle, + LPCWSTR lpName + ); + +HANDLE +STDCALL +CreateEventW( + LPSECURITY_ATTRIBUTES lpEventAttributes, + WINBOOL bManualReset, + WINBOOL bInitialState, + LPCWSTR lpName + ); + +HANDLE +STDCALL +OpenEventW( + DWORD dwDesiredAccess, + WINBOOL bInheritHandle, + LPCWSTR lpName + ); + +HANDLE +STDCALL +CreateSemaphoreW( + LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, + LONG lInitialCount, + LONG lMaximumCount, + LPCWSTR lpName + ); + +HANDLE +STDCALL +OpenSemaphoreW( + DWORD dwDesiredAccess, + WINBOOL bInheritHandle, + LPCWSTR lpName + ); + +HANDLE +STDCALL +CreateFileMappingW( + HANDLE hFile, + LPSECURITY_ATTRIBUTES lpFileMappingAttributes, + DWORD flProtect, + DWORD dwMaximumSizeHigh, + DWORD dwMaximumSizeLow, + LPCWSTR lpName + ); + +HANDLE +STDCALL +OpenFileMappingW( + DWORD dwDesiredAccess, + WINBOOL bInheritHandle, + LPCWSTR lpName + ); + +DWORD +STDCALL +GetLogicalDriveStringsW( + DWORD nBufferLength, + LPWSTR lpBuffer + ); + +HINSTANCE +STDCALL +LoadLibraryW( + LPCWSTR lpLibFileName + ); + +HINSTANCE +STDCALL +LoadLibraryExW( + LPCWSTR lpLibFileName, + HANDLE hFile, + DWORD dwFlags + ); + +DWORD +STDCALL +GetModuleFileNameW( + HINSTANCE hModule, + LPWSTR lpFilename, + DWORD nSize + ); + +HMODULE +STDCALL +GetModuleHandleW( + LPCWSTR lpModuleName + ); + +VOID +STDCALL +FatalAppExitW( + UINT uAction, + LPCWSTR lpMessageText + ); + +LPWSTR +STDCALL +GetCommandLineW( + VOID + ); + +DWORD +STDCALL +GetEnvironmentVariableW( + LPCWSTR lpName, + LPWSTR lpBuffer, + DWORD nSize + ); + +WINBOOL +STDCALL +SetEnvironmentVariableW( + LPCWSTR lpName, + LPCWSTR lpValue + ); + +DWORD +STDCALL +ExpandEnvironmentStringsW( + LPCWSTR lpSrc, + LPWSTR lpDst, + DWORD nSize + ); + +VOID +STDCALL +OutputDebugStringW( + LPCWSTR lpOutputString + ); + +HRSRC +STDCALL +FindResourceW( + HINSTANCE hModule, + LPCWSTR lpName, + LPCWSTR lpType + ); + +HRSRC +STDCALL +FindResourceExW( + HINSTANCE hModule, + LPCWSTR lpType, + LPCWSTR lpName, + WORD wLanguage + ); + +WINBOOL +STDCALL +EnumResourceTypesW( + HINSTANCE hModule, + ENUMRESTYPEPROC lpEnumFunc, + LONG lParam + ); + +WINBOOL +STDCALL +EnumResourceNamesW( + HINSTANCE hModule, + LPCWSTR lpType, + ENUMRESNAMEPROC lpEnumFunc, + LONG lParam + ); + +WINBOOL +STDCALL +EnumResourceLanguagesW( + HINSTANCE hModule, + LPCWSTR lpType, + LPCWSTR lpName, + ENUMRESLANGPROC lpEnumFunc, + LONG lParam + ); + +HANDLE +STDCALL +BeginUpdateResourceW( + LPCWSTR pFileName, + WINBOOL bDeleteExistingResources + ); + +WINBOOL +STDCALL +UpdateResourceW( + HANDLE hUpdate, + LPCWSTR lpType, + LPCWSTR lpName, + WORD wLanguage, + LPVOID lpData, + DWORD cbData + ); + +WINBOOL +STDCALL +EndUpdateResourceW( + HANDLE hUpdate, + WINBOOL fDiscard + ); + +ATOM +STDCALL +GlobalAddAtomW( + LPCWSTR lpString + ); + +ATOM +STDCALL +GlobalFindAtomW( + LPCWSTR lpString + ); + +UINT +STDCALL +GlobalGetAtomNameW( + ATOM nAtom, + LPWSTR lpBuffer, + int nSize + ); + +ATOM +STDCALL +AddAtomW( + LPCWSTR lpString + ); + +ATOM +STDCALL +FindAtomW( + LPCWSTR lpString + ); + +UINT +STDCALL +GetAtomNameW( + ATOM nAtom, + LPWSTR lpBuffer, + int nSize + ); + +UINT +STDCALL +GetProfileIntW( + LPCWSTR lpAppName, + LPCWSTR lpKeyName, + INT nDefault + ); + +DWORD +STDCALL +GetProfileStringW( + LPCWSTR lpAppName, + LPCWSTR lpKeyName, + LPCWSTR lpDefault, + LPWSTR lpReturnedString, + DWORD nSize + ); + +WINBOOL +STDCALL +WriteProfileStringW( + LPCWSTR lpAppName, + LPCWSTR lpKeyName, + LPCWSTR lpString + ); + +DWORD +STDCALL +GetProfileSectionW( + LPCWSTR lpAppName, + LPWSTR lpReturnedString, + DWORD nSize + ); + +WINBOOL +STDCALL +WriteProfileSectionW( + LPCWSTR lpAppName, + LPCWSTR lpString + ); + +UINT +STDCALL +GetPrivateProfileIntW( + LPCWSTR lpAppName, + LPCWSTR lpKeyName, + INT nDefault, + LPCWSTR lpFileName + ); + +DWORD +STDCALL +GetPrivateProfileStringW( + LPCWSTR lpAppName, + LPCWSTR lpKeyName, + LPCWSTR lpDefault, + LPWSTR lpReturnedString, + DWORD nSize, + LPCWSTR lpFileName + ); + +WINBOOL +STDCALL +WritePrivateProfileStringW( + LPCWSTR lpAppName, + LPCWSTR lpKeyName, + LPCWSTR lpString, + LPCWSTR lpFileName + ); + +DWORD +STDCALL +GetPrivateProfileSectionW( + LPCWSTR lpAppName, + LPWSTR lpReturnedString, + DWORD nSize, + LPCWSTR lpFileName + ); + +WINBOOL +STDCALL +WritePrivateProfileSectionW( + LPCWSTR lpAppName, + LPCWSTR lpString, + LPCWSTR lpFileName + ); + +UINT +STDCALL +GetDriveTypeW( + LPCWSTR lpRootPathName + ); + +UINT +STDCALL +GetSystemDirectoryW( + LPWSTR lpBuffer, + UINT uSize + ); + +DWORD +STDCALL +GetTempPathW( + DWORD nBufferLength, + LPWSTR lpBuffer + ); + +UINT +STDCALL +GetTempFileNameW( + LPCWSTR lpPathName, + LPCWSTR lpPrefixString, + UINT uUnique, + LPWSTR lpTempFileName + ); + +UINT +STDCALL +GetWindowsDirectoryW( + LPWSTR lpBuffer, + UINT uSize + ); + +WINBOOL +STDCALL +SetCurrentDirectoryW( + LPCWSTR lpPathName + ); + +DWORD +STDCALL +GetCurrentDirectoryW( + DWORD nBufferLength, + LPWSTR lpBuffer + ); + +WINBOOL +STDCALL +GetDiskFreeSpaceW( + LPCWSTR lpRootPathName, + LPDWORD lpSectorsPerCluster, + LPDWORD lpBytesPerSector, + LPDWORD lpNumberOfFreeClusters, + LPDWORD lpTotalNumberOfClusters + ); + +WINBOOL +STDCALL +GetDiskFreeSpaceExW( + LPCWSTR lpDirectoryName, + PULARGE_INTEGER lpFreeBytesAvailableToCaller, + PULARGE_INTEGER lpTotalNumberOfBytes, + PULARGE_INTEGER lpTotalNumberOfFreeBytes + ); + +WINBOOL +STDCALL +CreateDirectoryW( + LPCWSTR lpPathName, + LPSECURITY_ATTRIBUTES lpSecurityAttributes + ); + +WINBOOL +STDCALL +CreateDirectoryExW( + LPCWSTR lpTemplateDirectory, + LPCWSTR lpNewDirectory, + LPSECURITY_ATTRIBUTES lpSecurityAttributes + ); + +WINBOOL +STDCALL +RemoveDirectoryW( + LPCWSTR lpPathName + ); + +DWORD +STDCALL +GetFullPathNameW( + LPCWSTR lpFileName, + DWORD nBufferLength, + LPWSTR lpBuffer, + LPWSTR *lpFilePart + ); + +WINBOOL +STDCALL +DefineDosDeviceW( + DWORD dwFlags, + LPCWSTR lpDeviceName, + LPCWSTR lpTargetPath + ); + +DWORD +STDCALL +QueryDosDeviceW( + LPCWSTR lpDeviceName, + LPWSTR lpTargetPath, + DWORD ucchMax + ); + +HANDLE +STDCALL +CreateFileW( + LPCWSTR lpFileName, + DWORD dwDesiredAccess, + DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD dwCreationDisposition, + DWORD dwFlagsAndAttributes, + HANDLE hTemplateFile + ); + +WINBOOL +STDCALL +SetFileAttributesW( + LPCWSTR lpFileName, + DWORD dwFileAttributes + ); + +DWORD +STDCALL +GetFileAttributesW( + LPCWSTR lpFileName + ); + +DWORD +STDCALL +GetCompressedFileSizeW( + LPCWSTR lpFileName, + LPDWORD lpFileSizeHigh + ); + +WINBOOL +STDCALL +DeleteFileW( + LPCWSTR lpFileName + ); + +DWORD +STDCALL +SearchPathW( + LPCWSTR lpPath, + LPCWSTR lpFileName, + LPCWSTR lpExtension, + DWORD nBufferLength, + LPWSTR lpBuffer, + LPWSTR *lpFilePart + ); + +WINBOOL +STDCALL +CopyFileW( + LPCWSTR lpExistingFileName, + LPCWSTR lpNewFileName, + WINBOOL bFailIfExists + ); + +WINBOOL +STDCALL +MoveFileW( + LPCWSTR lpExistingFileName, + LPCWSTR lpNewFileName + ); + +WINBOOL +STDCALL +MoveFileExW( + LPCWSTR lpExistingFileName, + LPCWSTR lpNewFileName, + DWORD dwFlags + ); + +HANDLE +STDCALL +CreateNamedPipeW( + LPCWSTR lpName, + DWORD dwOpenMode, + DWORD dwPipeMode, + DWORD nMaxInstances, + DWORD nOutBufferSize, + DWORD nInBufferSize, + DWORD nDefaultTimeOut, + LPSECURITY_ATTRIBUTES lpSecurityAttributes + ); + +WINBOOL +STDCALL +GetNamedPipeHandleStateW( + HANDLE hNamedPipe, + LPDWORD lpState, + LPDWORD lpCurInstances, + LPDWORD lpMaxCollectionCount, + LPDWORD lpCollectDataTimeout, + LPWSTR lpUserName, + DWORD nMaxUserNameSize + ); + +WINBOOL +STDCALL +CallNamedPipeW( + LPCWSTR lpNamedPipeName, + LPVOID lpInBuffer, + DWORD nInBufferSize, + LPVOID lpOutBuffer, + DWORD nOutBufferSize, + LPDWORD lpBytesRead, + DWORD nTimeOut + ); + +WINBOOL +STDCALL +WaitNamedPipeW( + LPCWSTR lpNamedPipeName, + DWORD nTimeOut + ); + +WINBOOL +STDCALL +SetVolumeLabelW( + LPCWSTR lpRootPathName, + LPCWSTR lpVolumeName + ); + +WINBOOL +STDCALL +GetVolumeInformationW( + LPCWSTR lpRootPathName, + LPWSTR lpVolumeNameBuffer, + DWORD nVolumeNameSize, + LPDWORD lpVolumeSerialNumber, + LPDWORD lpMaximumComponentLength, + LPDWORD lpFileSystemFlags, + LPWSTR lpFileSystemNameBuffer, + DWORD nFileSystemNameSize + ); + +WINBOOL +STDCALL +ClearEventLogW ( + HANDLE hEventLog, + LPCWSTR lpBackupFileName + ); + +WINBOOL +STDCALL +BackupEventLogW ( + HANDLE hEventLog, + LPCWSTR lpBackupFileName + ); + +HANDLE +STDCALL +OpenEventLogW ( + LPCWSTR lpUNCServerName, + LPCWSTR lpSourceName + ); + +HANDLE +STDCALL +RegisterEventSourceW ( + LPCWSTR lpUNCServerName, + LPCWSTR lpSourceName + ); + +HANDLE +STDCALL +OpenBackupEventLogW ( + LPCWSTR lpUNCServerName, + LPCWSTR lpFileName + ); + +WINBOOL +STDCALL +ReadEventLogW ( + HANDLE hEventLog, + DWORD dwReadFlags, + DWORD dwRecordOffset, + LPVOID lpBuffer, + DWORD nNumberOfBytesToRead, + DWORD *pnBytesRead, + DWORD *pnMinNumberOfBytesNeeded + ); + +WINBOOL +STDCALL +ReportEventW ( + HANDLE hEventLog, + WORD wType, + WORD wCategory, + DWORD dwEventID, + PSID lpUserSid, + WORD wNumStrings, + DWORD dwDataSize, + LPCWSTR *lpStrings, + LPVOID lpRawData + ); + +WINBOOL +STDCALL +AccessCheckAndAuditAlarmW ( + LPCWSTR SubsystemName, + LPVOID HandleId, + LPWSTR ObjectTypeName, + LPWSTR ObjectName, + PSECURITY_DESCRIPTOR SecurityDescriptor, + DWORD DesiredAccess, + PGENERIC_MAPPING GenericMapping, + WINBOOL ObjectCreation, + LPDWORD GrantedAccess, + LPBOOL AccessStatus, + LPBOOL pfGenerateOnClose + ); + +WINBOOL +STDCALL +ObjectOpenAuditAlarmW ( + LPCWSTR SubsystemName, + LPVOID HandleId, + LPWSTR ObjectTypeName, + LPWSTR ObjectName, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + HANDLE ClientToken, + DWORD DesiredAccess, + DWORD GrantedAccess, + PPRIVILEGE_SET Privileges, + WINBOOL ObjectCreation, + WINBOOL AccessGranted, + LPBOOL GenerateOnClose + ); + +WINBOOL +STDCALL +ObjectPrivilegeAuditAlarmW ( + LPCWSTR SubsystemName, + LPVOID HandleId, + HANDLE ClientToken, + DWORD DesiredAccess, + PPRIVILEGE_SET Privileges, + WINBOOL AccessGranted + ); + +WINBOOL +STDCALL +ObjectCloseAuditAlarmW ( + LPCWSTR SubsystemName, + LPVOID HandleId, + WINBOOL GenerateOnClose + ); + +WINBOOL +STDCALL +PrivilegedServiceAuditAlarmW ( + LPCWSTR SubsystemName, + LPCWSTR ServiceName, + HANDLE ClientToken, + PPRIVILEGE_SET Privileges, + WINBOOL AccessGranted + ); + +WINBOOL +STDCALL +SetFileSecurityW ( + LPCWSTR lpFileName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor + ); + +WINBOOL +STDCALL +GetFileSecurityW ( + LPCWSTR lpFileName, + SECURITY_INFORMATION RequestedInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD nLength, + LPDWORD lpnLengthNeeded + ); + +HANDLE +STDCALL +FindFirstChangeNotificationW( + LPCWSTR lpPathName, + WINBOOL bWatchSubtree, + DWORD dwNotifyFilter + ); + +WINBOOL +STDCALL +IsBadStringPtrW( + LPCWSTR lpsz, + UINT ucchMax + ); + +WINBOOL +STDCALL +LookupAccountSidW( + LPCWSTR lpSystemName, + PSID Sid, + LPWSTR Name, + LPDWORD cbName, + LPWSTR ReferencedDomainName, + LPDWORD cbReferencedDomainName, + PSID_NAME_USE peUse + ); + +WINBOOL +STDCALL +LookupAccountNameW( + LPCWSTR lpSystemName, + LPCWSTR lpAccountName, + PSID Sid, + LPDWORD cbSid, + LPWSTR ReferencedDomainName, + LPDWORD cbReferencedDomainName, + PSID_NAME_USE peUse + ); + +WINBOOL +STDCALL +LookupPrivilegeValueW( + LPCWSTR lpSystemName, + LPCWSTR lpName, + PLUID lpLuid + ); + +WINBOOL +STDCALL +LookupPrivilegeNameW( + LPCWSTR lpSystemName, + PLUID lpLuid, + LPWSTR lpName, + LPDWORD cbName + ); + +WINBOOL +STDCALL +LookupPrivilegeDisplayNameW( + LPCWSTR lpSystemName, + LPCWSTR lpName, + LPWSTR lpDisplayName, + LPDWORD cbDisplayName, + LPDWORD lpLanguageId + ); + +WINBOOL +STDCALL +BuildCommDCBW( + LPCWSTR lpDef, + LPDCB lpDCB + ); + +WINBOOL +STDCALL +BuildCommDCBAndTimeoutsW( + LPCWSTR lpDef, + LPDCB lpDCB, + LPCOMMTIMEOUTS lpCommTimeouts + ); + +WINBOOL +STDCALL +CommConfigDialogW( + LPCWSTR lpszName, + HWND hWnd, + LPCOMMCONFIG lpCC + ); + +WINBOOL +STDCALL +GetDefaultCommConfigW( + LPCWSTR lpszName, + LPCOMMCONFIG lpCC, + LPDWORD lpdwSize + ); + +WINBOOL +STDCALL +SetDefaultCommConfigW( + LPCWSTR lpszName, + LPCOMMCONFIG lpCC, + DWORD dwSize + ); + +WINBOOL +STDCALL +GetComputerNameW ( + LPWSTR lpBuffer, + LPDWORD nSize + ); + +WINBOOL +STDCALL +SetComputerNameW ( + LPCWSTR lpComputerName + ); + +WINBOOL +STDCALL +GetUserNameW ( + LPWSTR lpBuffer, + LPDWORD nSize + ); + +int +STDCALL +wvsprintfW( + LPWSTR, + LPCWSTR, + va_list arglist); + +int +CDECL +wsprintfW(LPWSTR, LPCWSTR, ...); + +HKL +STDCALL +LoadKeyboardLayoutW( + LPCWSTR pwszKLID, + UINT Flags); + +WINBOOL +STDCALL +GetKeyboardLayoutNameW( + LPWSTR pwszKLID); + +HDESK +STDCALL +CreateDesktopW( + LPCWSTR lpszDesktop, + LPCWSTR lpszDevice, + LPDEVMODEW pDevmode, + DWORD dwFlags, + ACCESS_MASK dwDesiredAccess, + LPSECURITY_ATTRIBUTES lpsa); + +HDESK +STDCALL +OpenDesktopW( + LPWSTR lpszDesktop, + DWORD dwFlags, + WINBOOL fInherit, + DWORD dwDesiredAccess); + +WINBOOL +STDCALL +EnumDesktopsW( + HWINSTA hwinsta, + DESKTOPENUMPROC lpEnumFunc, + LPARAM lParam); + +HWINSTA +STDCALL +CreateWindowStationW( + LPWSTR lpwinsta, + DWORD dwReserved, + DWORD dwDesiredAccess, + LPSECURITY_ATTRIBUTES lpsa); + +HWINSTA +STDCALL +OpenWindowStationW( + LPWSTR lpszWinSta, + WINBOOL fInherit, + DWORD dwDesiredAccess); + +WINBOOL +STDCALL +EnumWindowStationsW( + ENUMWINDOWSTATIONPROC lpEnumFunc, + LPARAM lParam); + +WINBOOL +STDCALL +GetUserObjectInformationW( + HANDLE hObj, + int nIndex, + PVOID pvInfo, + DWORD nLength, + LPDWORD lpnLengthNeeded); + +WINBOOL +STDCALL +SetUserObjectInformationW( + HANDLE hObj, + int nIndex, + PVOID pvInfo, + DWORD nLength); + +UINT +STDCALL +RegisterWindowMessageW( + LPCWSTR lpString); + +WINBOOL +STDCALL +GetMessageW( + LPMSG lpMsg, + HWND hWnd , + UINT wMsgFilterMin, + UINT wMsgFilterMax); + +LRESULT +STDCALL +DispatchMessageW( + CONST MSG *lpMsg); + +WINBOOL +STDCALL +PeekMessageW( + LPMSG lpMsg, + HWND hWnd , + UINT wMsgFilterMin, + UINT wMsgFilterMax, + UINT wRemoveMsg); + +LRESULT +STDCALL +SendMessageW( + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +LRESULT +STDCALL +SendMessageTimeoutW( + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam, + UINT fuFlags, + UINT uTimeout, + PDWORD_PTR lpdwResult); + +WINBOOL +STDCALL +SendNotifyMessageW( + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +WINBOOL +STDCALL +SendMessageCallbackW( + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam, + SENDASYNCPROC lpResultCallBack, + ULONG_PTR dwData); + +WINBOOL +STDCALL +PostMessageW( + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +WINBOOL +STDCALL +PostThreadMessageW( + DWORD idThread, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +LRESULT +STDCALL +DefWindowProcW( + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +LRESULT +STDCALL +CallWindowProcW( + WNDPROC lpPrevWndFunc, + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +ATOM +STDCALL +RegisterClassW( + CONST WNDCLASS *lpWndClass); + +WINBOOL +STDCALL +UnregisterClassW( + LPCWSTR lpClassName, + HINSTANCE hInstance); + +WINBOOL +STDCALL +GetClassInfoW( + HINSTANCE hInstance , + LPCWSTR lpClassName, + LPWNDCLASS lpWndClass); + +ATOM +STDCALL +RegisterClassExW(CONST WNDCLASSEX *); + +WINBOOL +STDCALL +GetClassInfoExW(HINSTANCE, LPCWSTR, LPWNDCLASSEX); + +HWND +STDCALL +CreateWindowExW( + DWORD dwExStyle, + LPCWSTR lpClassName, + LPCWSTR lpWindowName, + DWORD dwStyle, + int X, + int Y, + int nWidth, + int nHeight, + HWND hWndParent , + HMENU hMenu, + HINSTANCE hInstance, + LPVOID lpParam); + +HWND +STDCALL +CreateDialogParamW( + HINSTANCE hInstance, + LPCWSTR lpTemplateName, + HWND hWndParent , + DLGPROC lpDialogFunc, + LPARAM dwInitParam); + +HWND +STDCALL +CreateDialogIndirectParamW( + HINSTANCE hInstance, + LPCDLGTEMPLATE lpTemplate, + HWND hWndParent, + DLGPROC lpDialogFunc, + LPARAM dwInitParam); + +int +STDCALL +DialogBoxParamW( + HINSTANCE hInstance, + LPCWSTR lpTemplateName, + HWND hWndParent , + DLGPROC lpDialogFunc, + LPARAM dwInitParam); + +int +STDCALL +DialogBoxIndirectParamW( + HINSTANCE hInstance, + LPCDLGTEMPLATE hDialogTemplate, + HWND hWndParent , + DLGPROC lpDialogFunc, + LPARAM dwInitParam); + +WINBOOL +STDCALL +SetDlgItemTextW( + HWND hDlg, + int nIDDlgItem, + LPCWSTR lpString); + +UINT +STDCALL +GetDlgItemTextW( + HWND hDlg, + int nIDDlgItem, + LPWSTR lpString, + int nMaxCount); + +LRESULT +STDCALL +SendDlgItemMessageW( + HWND hDlg, + int nIDDlgItem, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +LRESULT +STDCALL +DefDlgProcW( + HWND hDlg, + UINT Msg, + WPARAM wParam, + LPARAM lParam); + +WINBOOL +STDCALL +CallMsgFilterW( + LPMSG lpMsg, + int nCode); + +UINT +STDCALL +RegisterClipboardFormatW( + LPCWSTR lpszFormat); + +int +STDCALL +GetClipboardFormatNameW( + UINT format, + LPWSTR lpszFormatName, + int cchMaxCount); + +WINBOOL +STDCALL +CharToOemW( + LPCWSTR lpszSrc, + LPSTR lpszDst); + +WINBOOL +STDCALL +OemToCharW( + LPCSTR lpszSrc, + LPWSTR lpszDst); + +WINBOOL +STDCALL +CharToOemBuffW( + LPCWSTR lpszSrc, + LPSTR lpszDst, + DWORD cchDstLength); + +WINBOOL +STDCALL +OemToCharBuffW( + LPCSTR lpszSrc, + LPWSTR lpszDst, + DWORD cchDstLength); + +LPWSTR +STDCALL +CharUpperW( + LPWSTR lpsz); + +DWORD +STDCALL +CharUpperBuffW( + LPWSTR lpsz, + DWORD cchLength); + +LPWSTR +STDCALL +CharLowerW( + LPWSTR lpsz); + +DWORD +STDCALL +CharLowerBuffW( + LPWSTR lpsz, + DWORD cchLength); + +LPWSTR +STDCALL +CharNextW( + LPCWSTR lpsz); + +LPWSTR +STDCALL +CharPrevW( + LPCWSTR lpszStart, + LPCWSTR lpszCurrent); + +WINBOOL +STDCALL +IsCharAlphaW( + WCHAR ch); + +WINBOOL +STDCALL +IsCharAlphaNumericW( + WCHAR ch); + +WINBOOL +STDCALL +IsCharUpperW( + WCHAR ch); + +WINBOOL +STDCALL +IsCharLowerW( + WCHAR ch); + +int +STDCALL +GetKeyNameTextW( + LONG lParam, + LPWSTR lpString, + int nSize + ); + +SHORT +STDCALL +VkKeyScanW( + WCHAR ch); + +SHORT +STDCALL VkKeyScanExW( + WCHAR ch, + HKL dwhkl); + +UINT +STDCALL +MapVirtualKeyW( + UINT uCode, + UINT uMapType); + +UINT +STDCALL +MapVirtualKeyExW( + UINT uCode, + UINT uMapType, + HKL dwhkl); + +HACCEL +STDCALL +LoadAcceleratorsW( + HINSTANCE hInstance, + LPCWSTR lpTableName); + +HACCEL +STDCALL +CreateAcceleratorTableW( + LPACCEL, int); + +int +STDCALL +CopyAcceleratorTableW( + HACCEL hAccelSrc, + LPACCEL lpAccelDst, + int cAccelEntries); + +int +STDCALL +TranslateAcceleratorW( + HWND hWnd, + HACCEL hAccTable, + LPMSG lpMsg); + +HMENU +STDCALL +LoadMenuW( + HINSTANCE hInstance, + LPCWSTR lpMenuName); + +HMENU +STDCALL +LoadMenuIndirectW( + CONST MENUTEMPLATE *lpMenuTemplate); + +WINBOOL +STDCALL +ChangeMenuW( + HMENU hMenu, + UINT cmd, + LPCWSTR lpszNewItem, + UINT cmdInsert, + UINT flags); + +int +STDCALL +GetMenuStringW( + HMENU hMenu, + UINT uIDItem, + LPWSTR lpString, + int nMaxCount, + UINT uFlag); + +WINBOOL +STDCALL +InsertMenuW( + HMENU hMenu, + UINT uPosition, + UINT uFlags, + UINT uIDNewItem, + LPCWSTR lpNewItem + ); + +WINBOOL +STDCALL +AppendMenuW( + HMENU hMenu, + UINT uFlags, + UINT uIDNewItem, + LPCWSTR lpNewItem + ); + +WINBOOL +STDCALL +ModifyMenuW( + HMENU hMnu, + UINT uPosition, + UINT uFlags, + UINT uIDNewItem, + LPCWSTR lpNewItem + ); + +WINBOOL +STDCALL +InsertMenuItemW( + HMENU, + UINT, + WINBOOL, + LPCMENUITEMINFO + ); + +WINBOOL +STDCALL +GetMenuItemInfoW( + HMENU, + UINT, + WINBOOL, + LPMENUITEMINFO + ); + +WINBOOL +STDCALL +SetMenuItemInfoW( + HMENU hMenu, + UINT uItem, + WINBOOL fByPosition, + LPMENUITEMINFO lpmii); + +int +STDCALL +DrawTextW( + HDC hDC, + LPCWSTR lpString, + int nCount, + LPRECT lpRect, + UINT uFormat); + +int +STDCALL +DrawTextExW(HDC, LPWSTR, int, LPRECT, UINT, LPDRAWTEXTPARAMS); + +WINBOOL +STDCALL +GrayStringW( + HDC hDC, + HBRUSH hBrush, + GRAYSTRINGPROC lpOutputFunc, + LPARAM lpData, + int nCount, + int X, + int Y, + int nWidth, + int nHeight); + +WINBOOL STDCALL DrawStateW(HDC, HBRUSH, DRAWSTATEPROC, LPARAM, WPARAM, int, int, int, int, UINT); + +LONG +STDCALL +TabbedTextOutW( + HDC hDC, + int X, + int Y, + LPCWSTR lpString, + int nCount, + int nTabPositions, + LPINT lpnTabStopPositions, + int nTabOrigin); + +DWORD +STDCALL +GetTabbedTextExtentW( + HDC hDC, + LPCWSTR lpString, + int nCount, + int nTabPositions, + LPINT lpnTabStopPositions); + +WINBOOL +STDCALL +SetPropW( + HWND hWnd, + LPCWSTR lpString, + HANDLE hData); + +HANDLE +STDCALL +GetPropW( + HWND hWnd, + LPCWSTR lpString); + +HANDLE +STDCALL +RemovePropW( + HWND hWnd, + LPCWSTR lpString); + +int +STDCALL +EnumPropsExW( + HWND hWnd, + PROPENUMPROCEX lpEnumFunc, + LPARAM lParam); + +int +STDCALL +EnumPropsW( + HWND hWnd, + PROPENUMPROC lpEnumFunc); + +WINBOOL +STDCALL +SetWindowTextW( + HWND hWnd, + LPCWSTR lpString); + +int +STDCALL +GetWindowTextW( + HWND hWnd, + LPWSTR lpString, + int nMaxCount); + +int +STDCALL +GetWindowTextLengthW( + HWND hWnd); + +int +STDCALL +MessageBoxW( + HWND hWnd , + LPCWSTR lpText, + LPCWSTR lpCaption, + UINT uType); + +int +STDCALL +MessageBoxExW( + HWND hWnd , + LPCWSTR lpText, + LPCWSTR lpCaption, + UINT uType, + WORD wLanguageId); + +int +STDCALL +MessageBoxIndirectW(LPMSGBOXPARAMS); + +LONG +STDCALL +GetWindowLongW( + HWND hWnd, + int nIndex); + +LONG +STDCALL +SetWindowLongW( + HWND hWnd, + int nIndex, + LONG dwNewLong); + +DWORD +STDCALL +GetClassLongW( + HWND hWnd, + int nIndex); + +DWORD +STDCALL +SetClassLongW( + HWND hWnd, + int nIndex, + LONG dwNewLong); + +HWND +STDCALL +FindWindowW( + LPCWSTR lpClassName , + LPCWSTR lpWindowName); + +HWND +STDCALL +FindWindowExW(HWND, HWND, LPCWSTR, LPCWSTR); + +int +STDCALL +GetClassNameW( + HWND hWnd, + LPWSTR lpClassName, + int nMaxCount); + +HHOOK +STDCALL +SetWindowsHookExW( + int idHook, + HOOKPROC lpfn, + HINSTANCE hmod, + DWORD dwThreadId); + +HBITMAP +STDCALL +LoadBitmapW( + HINSTANCE hInstance, + LPCWSTR lpBitmapName); + +HCURSOR +STDCALL +LoadCursorW( + HINSTANCE hInstance, + LPCWSTR lpCursorName); + +HCURSOR +STDCALL +LoadCursorFromFileW( + LPCWSTR lpFileName); + +HICON +STDCALL +LoadIconW( + HINSTANCE hInstance, + LPCWSTR lpIconName); + +HANDLE +STDCALL +LoadImageW( + HINSTANCE, + LPCWSTR, + UINT, + int, + int, + UINT); + +int +STDCALL +LoadStringW( + HINSTANCE hInstance, + UINT uID, + LPWSTR lpBuffer, + int nBufferMax); + +WINBOOL +STDCALL +IsDialogMessageW( + HWND hDlg, + LPMSG lpMsg); + +int +STDCALL +DlgDirListW( + HWND hDlg, + LPWSTR lpPathSpec, + int nIDListBox, + int nIDStaticPath, + UINT uFileType); + +WINBOOL +STDCALL +DlgDirSelectExW( + HWND hDlg, + LPWSTR lpString, + int nCount, + int nIDListBox); + +int +STDCALL +DlgDirListComboBoxW( + HWND hDlg, + LPWSTR lpPathSpec, + int nIDComboBox, + int nIDStaticPath, + UINT uFiletype); + +WINBOOL +STDCALL +DlgDirSelectComboBoxExW( + HWND hDlg, + LPWSTR lpString, + int nCount, + int nIDComboBox); + +LRESULT +STDCALL +DefFrameProcW( + HWND hWnd, + HWND hWndMDIClient , + UINT uMsg, + WPARAM wParam, + LPARAM lParam); + +LRESULT +STDCALL +DefMDIChildProcW( + HWND hWnd, + UINT uMsg, + WPARAM wParam, + LPARAM lParam); + +HWND +STDCALL +CreateMDIWindowW( + LPCWSTR lpClassName, + LPCWSTR lpWindowName, + DWORD dwStyle, + int X, + int Y, + int nWidth, + int nHeight, + HWND hWndParent, + HINSTANCE hInstance, + LPARAM lParam + ); + +WINBOOL +STDCALL +WinHelpW( + HWND hWndMain, + LPCWSTR lpszHelp, + UINT uCommand, + DWORD dwData + ); + +LONG +STDCALL +ChangeDisplaySettingsW( + LPDEVMODEW lpDevMode, + DWORD dwFlags); + +WINBOOL +STDCALL +EnumDisplaySettingsW( + LPCWSTR lpszDeviceName, + DWORD iModeNum, + LPDEVMODEW lpDevMode); + +WINBOOL +STDCALL +SystemParametersInfoW( + UINT uiAction, + UINT uiParam, + PVOID pvParam, + UINT fWinIni); + +int +STDCALL +AddFontResourceW(LPCWSTR); + +HMETAFILE +STDCALL +CopyMetaFileW(HMETAFILE, LPCWSTR); + +HFONT +STDCALL +CreateFontIndirectW(CONST LOGFONT *); + +HFONT +STDCALL +CreateFontW(int, int, int, int, int, DWORD, + DWORD, DWORD, DWORD, DWORD, DWORD, + DWORD, DWORD, LPCWSTR); + +HDC +STDCALL +CreateICW(LPCWSTR, LPCWSTR , LPCWSTR , CONST DEVMODEW *); + +HDC +STDCALL +CreateMetaFileW(LPCWSTR); + +WINBOOL +STDCALL +CreateScalableFontResourceW(DWORD, LPCWSTR, LPCWSTR, LPCWSTR); + +int +STDCALL +DeviceCapabilitiesW(LPCWSTR, LPCWSTR, WORD, + LPWSTR, CONST DEVMODEW *); + +int +STDCALL +EnumFontFamiliesExW(HDC, LPLOGFONT, FONTENUMEXPROC, LPARAM, DWORD); + +int +STDCALL +EnumFontFamiliesW(HDC, LPCWSTR, FONTENUMPROC, LPARAM); + +int +STDCALL +EnumFontsW(HDC, LPCWSTR, ENUMFONTSPROC, LPARAM); + +WINBOOL +STDCALL +GetCharWidthW(HDC, UINT, UINT, LPINT); + +WINBOOL +STDCALL +GetCharWidth32W(HDC, UINT, UINT, LPINT); + +WINBOOL +STDCALL +GetCharWidthFloatW(HDC, UINT, UINT, PFLOAT); + +WINBOOL +STDCALL +GetCharABCWidthsW(HDC, UINT, UINT, LPABC); + +WINBOOL +STDCALL +GetCharABCWidthsFloatW(HDC, UINT, UINT, LPABCFLOAT); + +DWORD +STDCALL +GetGlyphOutlineW(HDC, UINT, UINT, LPGLYPHMETRICS, DWORD, LPVOID, CONST MAT2 *); + +HMETAFILE +STDCALL +GetMetaFileW(LPCWSTR); + +UINT +STDCALL +GetOutlineTextMetricsW(HDC, UINT, LPOUTLINETEXTMETRIC); + +WINBOOL +STDCALL GetTextExtentPointW( + HDC, + LPCWSTR, + int, + LPSIZE + ); + +WINBOOL +STDCALL +GetTextExtentPoint32W( + HDC, + LPCWSTR, + int, + LPSIZE + ); + +WINBOOL +STDCALL +GetTextExtentExPointW( + HDC, + LPCWSTR, + int, + int, + LPINT, + LPINT, + LPSIZE + ); + +DWORD +STDCALL +GetCharacterPlacementW(HDC, LPCWSTR, int, int, LPGCP_RESULTS, DWORD); + +HDC +STDCALL +ResetDCW(HDC, CONST DEVMODEW *); + +WINBOOL +STDCALL +RemoveFontResourceW(LPCWSTR); + +HENHMETAFILE +STDCALL +CopyEnhMetaFileW(HENHMETAFILE, LPCWSTR); + +HDC +STDCALL +CreateEnhMetaFileW(HDC, LPCWSTR, CONST RECT *, LPCWSTR); + +HENHMETAFILE +STDCALL +GetEnhMetaFileW(LPCWSTR); + +UINT +STDCALL +GetEnhMetaFileDescriptionW(HENHMETAFILE, UINT, LPWSTR ); + +WINBOOL +STDCALL +GetTextMetricsW(HDC, LPTEXTMETRIC); + +int +STDCALL +StartDocW(HDC, CONST DOCINFO *); + +int +STDCALL +GetObjectW(HGDIOBJ, int, LPVOID); + +WINBOOL +STDCALL +TextOutW(HDC, int, int, LPCWSTR, int); + +WINBOOL +STDCALL +ExtTextOutW(HDC, int, int, UINT, CONST RECT *,LPCWSTR, UINT, CONST INT *); + +WINBOOL +STDCALL +PolyTextOutW(HDC, CONST POLYTEXT *, int); + +int +STDCALL +GetTextFaceW(HDC, int, LPWSTR); + +DWORD +STDCALL +GetKerningPairsW(HDC, DWORD, LPKERNINGPAIR); + +WINBOOL +STDCALL +GetLogColorSpaceW(HCOLORSPACE,LPLOGCOLORSPACE,DWORD); + +HCOLORSPACE +STDCALL +CreateColorSpaceW(LPLOGCOLORSPACE); + +WINBOOL +STDCALL +GetICMProfileW(HDC,DWORD,LPWSTR); + +WINBOOL +STDCALL +SetICMProfileW(HDC,LPWSTR); + +WINBOOL +STDCALL +UpdateICMRegKeyW(DWORD, DWORD, LPWSTR, UINT); + +int +STDCALL +EnumICMProfilesW(HDC,ICMENUMPROC,LPARAM); + +HPROPSHEETPAGE +STDCALL +CreatePropertySheetPageW(LPCPROPSHEETPAGE lppsp); + +int +STDCALL +PropertySheetW(LPCPROPSHEETHEADER lppsph); + +HIMAGELIST +STDCALL +ImageList_LoadImageW(HINSTANCE hi, +LPCWSTR lpbmp, +int cx, +int cGrow, +COLORREF crMask, +UINT uType, +UINT uFlags); + +HWND +STDCALL +CreateStatusWindowW(LONG style, LPCWSTR lpszText, HWND hwndParent, UINT wID); + +void +STDCALL +DrawStatusTextW(HDC hDC, LPRECT lprc, LPCWSTR pszText, UINT uFlags); + +WINBOOL +STDCALL +GetOpenFileNameW(LPOPENFILENAME); + +WINBOOL +STDCALL +GetSaveFileNameW(LPOPENFILENAME); + +short +STDCALL +GetFileTitleW(LPCWSTR, LPWSTR, WORD); + +WINBOOL +STDCALL +ChooseColorW(LPCHOOSECOLOR); + +HWND +STDCALL +ReplaceTextW(LPFINDREPLACE); + +WINBOOL +STDCALL +ChooseFontW(LPCHOOSEFONT); + +HWND +STDCALL +FindTextW(LPFINDREPLACE); + +WINBOOL +STDCALL +PrintDlgW(LPPRINTDLG); + +WINBOOL +STDCALL +PageSetupDlgW(LPPAGESETUPDLG); + +WINBOOL +STDCALL +CreateProcessW( + LPCWSTR lpApplicationName, + LPWSTR lpCommandLine, + LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, + WINBOOL bInheritHandles, + DWORD dwCreationFlags, + LPVOID lpEnvironment, + LPCWSTR lpCurrentDirectory, + LPSTARTUPINFOW lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation + ); + +VOID +STDCALL +GetStartupInfoW( + LPSTARTUPINFOW lpStartupInfo + ); + +WINBASEAPI +HANDLE +WINAPI +FindFirstFileExW ( + LPCWSTR lpFileName, + FINDEX_INFO_LEVELS fInfoLevelId, + LPVOID lpFindFileData, + FINDEX_SEARCH_OPS fSearchOp, + LPVOID lpSearchFilter, + DWORD dwAdditionalFlags + ); + +HANDLE +STDCALL +FindFirstFileW( + LPCWSTR lpFileName, + LPWIN32_FIND_DATAW lpFindFileData + ); + +WINBOOL +STDCALL +FindNextFileW( + HANDLE hFindFile, + LPWIN32_FIND_DATAW lpFindFileData + ); + +WINBOOL +STDCALL +GetVersionExW( + LPOSVERSIONINFO lpVersionInformation + ); + +#define CreateWindowW(lpClassName, lpWindowName, dwStyle, x, y,\ +nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)\ +CreateWindowExW(0L, lpClassName, lpWindowName, dwStyle, x, y,\ +nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) + +#define CreateDialogW(hInstance, lpName, hWndParent, lpDialogFunc) \ +CreateDialogParamW(hInstance, lpName, hWndParent, lpDialogFunc, 0L) + +#define CreateDialogIndirectW(hInstance, lpTemplate, hWndParent, lpDialogFunc) \ +CreateDialogIndirectParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L) + +#define DialogBoxW(hInstance, lpTemplate, hWndParent, lpDialogFunc) \ +DialogBoxParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L) + +#define DialogBoxIndirectW(hInstance, lpTemplate, hWndParent, lpDialogFunc) \ +DialogBoxIndirectParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L) + +HDC +STDCALL +CreateDCW(LPCWSTR, LPCWSTR , LPCWSTR , CONST DEVMODEW *); + +HFONT +STDCALL +CreateFontA(int, int, int, int, int, DWORD, + DWORD, DWORD, DWORD, DWORD, DWORD, + DWORD, DWORD, LPCSTR); + +DWORD +STDCALL +VerInstallFileW( + DWORD uFlags, + LPWSTR szSrcFileName, + LPWSTR szDestFileName, + LPWSTR szSrcDir, + LPWSTR szDestDir, + LPWSTR szCurDir, + LPWSTR szTmpFile, + PUINT lpuTmpFileLen + ); + +DWORD +STDCALL +GetFileVersionInfoSizeW( + LPWSTR lptstrFilename, + LPDWORD lpdwHandle + ); + +WINBOOL +STDCALL +GetFileVersionInfoW( + LPWSTR lptstrFilename, + DWORD dwHandle, + DWORD dwLen, + LPVOID lpData + ); + +DWORD +STDCALL +VerLanguageNameW( + DWORD wLang, + LPWSTR szLang, + DWORD nSize + ); + +WINBOOL +STDCALL +VerQueryValueW( + const LPVOID pBlock, + LPWSTR lpSubBlock, + LPVOID * lplpBuffer, + PUINT puLen + ); + +DWORD +STDCALL +VerFindFileW( + DWORD uFlags, + LPWSTR szFileName, + LPWSTR szWinDir, + LPWSTR szAppDir, + LPWSTR szCurDir, + PUINT lpuCurDirLen, + LPWSTR szDestDir, + PUINT lpuDestDirLen + ); + +LONG +STDCALL +RegSetValueExW ( + HKEY hKey, + LPCWSTR lpValueName, + DWORD Reserved, + DWORD dwType, + CONST BYTE* lpData, + DWORD cbData + ); + +LONG +STDCALL +RegUnLoadKeyW ( + HKEY hKey, + LPCWSTR lpSubKey + ); + +WINBOOL +STDCALL +InitiateSystemShutdownW( + LPWSTR lpMachineName, + LPWSTR lpMessage, + DWORD dwTimeout, + WINBOOL bForceAppsClosed, + WINBOOL bRebootAfterShutdown + ); + +WINBOOL +STDCALL +AbortSystemShutdownW( + LPWSTR lpMachineName + ); + +LONG +STDCALL +RegRestoreKeyW ( + HKEY hKey, + LPCWSTR lpFile, + DWORD dwFlags + ); + +LONG +STDCALL +RegSaveKeyW ( + HKEY hKey, + LPCWSTR lpFile, + LPSECURITY_ATTRIBUTES lpSecurityAttributes + ); + +LONG +STDCALL +RegSetValueW ( + HKEY hKey, + LPCWSTR lpSubKey, + DWORD dwType, + LPCWSTR lpData, + DWORD cbData + ); + +LONG +STDCALL +RegQueryValueW ( + HKEY hKey, + LPCWSTR lpSubKey, + LPWSTR lpValue, + PLONG lpcbValue + ); + +LONG +STDCALL +RegQueryMultipleValuesW ( + HKEY hKey, + PVALENT val_list, + DWORD num_vals, + LPWSTR lpValueBuf, + LPDWORD ldwTotsize + ); + +LONG +STDCALL +RegQueryValueExW ( + HKEY hKey, + LPWSTR lpValueName, + LPDWORD lpReserved, + LPDWORD lpType, + LPBYTE lpData, + LPDWORD lpcbData + ); + +LONG +STDCALL +RegReplaceKeyW ( + HKEY hKey, + LPCWSTR lpSubKey, + LPCWSTR lpNewFile, + LPCWSTR lpOldFile + ); + +LONG +STDCALL +RegConnectRegistryW ( + LPWSTR lpMachineName, + HKEY hKey, + PHKEY phkResult + ); + +LONG +STDCALL +RegCreateKeyW ( + HKEY hKey, + LPCWSTR lpSubKey, + PHKEY phkResult + ); + +LONG +STDCALL +RegCreateKeyExW ( + HKEY hKey, + LPCWSTR lpSubKey, + DWORD Reserved, + LPWSTR lpClass, + DWORD dwOptions, + REGSAM samDesired, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, + PHKEY phkResult, + LPDWORD lpdwDisposition + ); + +LONG +STDCALL +RegDeleteKeyW ( + HKEY hKey, + LPCWSTR lpSubKey + ); + +LONG +STDCALL +RegDeleteValueW ( + HKEY hKey, + LPCWSTR lpValueName + ); + +LONG +STDCALL +RegEnumKeyW ( + HKEY hKey, + DWORD dwIndex, + LPWSTR lpName, + DWORD cbName + ); + +LONG +STDCALL +RegEnumKeyExW ( + HKEY hKey, + DWORD dwIndex, + LPWSTR lpName, + LPDWORD lpcbName, + LPDWORD lpReserved, + LPWSTR lpClass, + LPDWORD lpcbClass, + PFILETIME lpftLastWriteTime + ); + +LONG +STDCALL +RegEnumValueW ( + HKEY hKey, + DWORD dwIndex, + LPWSTR lpValueName, + LPDWORD lpcbValueName, + LPDWORD lpReserved, + LPDWORD lpType, + LPBYTE lpData, + LPDWORD lpcbData + ); + +LONG +STDCALL +RegLoadKeyW ( + HKEY hKey, + LPCWSTR lpSubKey, + LPCWSTR lpFile + ); + +LONG +STDCALL +RegOpenKeyW ( + HKEY hKey, + LPCWSTR lpSubKey, + PHKEY phkResult + ); + +LONG +STDCALL +RegOpenKeyExW ( + HKEY hKey, + LPCWSTR lpSubKey, + DWORD ulOptions, + REGSAM samDesired, + PHKEY phkResult + ); + +LONG +STDCALL +RegQueryInfoKeyW ( + HKEY hKey, + LPWSTR lpClass, + LPDWORD lpcbClass, + LPDWORD lpReserved, + LPDWORD lpcSubKeys, + LPDWORD lpcbMaxSubKeyLen, + LPDWORD lpcbMaxClassLen, + LPDWORD lpcValues, + LPDWORD lpcbMaxValueNameLen, + LPDWORD lpcbMaxValueLen, + LPDWORD lpcbSecurityDescriptor, + PFILETIME lpftLastWriteTime + ); + +int +STDCALL +CompareStringW( + LCID Locale, + DWORD dwCmpFlags, + LPCWSTR lpString1, + int cchCount1, + LPCWSTR lpString2, + int cchCount2); + +int +STDCALL +LCMapStringW( + LCID Locale, + DWORD dwMapFlags, + LPCWSTR lpSrcStr, + int cchSrc, + LPWSTR lpDestStr, + int cchDest); + + +int +STDCALL +GetLocaleInfoW( + LCID Locale, + LCTYPE LCType, + LPWSTR lpLCData, + int cchData); + +WINBOOL +STDCALL +SetLocaleInfoW( + LCID Locale, + LCTYPE LCType, + LPCWSTR lpLCData); + +int +STDCALL +GetTimeFormatW( + LCID Locale, + DWORD dwFlags, + CONST SYSTEMTIME *lpTime, + LPCWSTR lpFormat, + LPWSTR lpTimeStr, + int cchTime); + +int +STDCALL +GetDateFormatW( + LCID Locale, + DWORD dwFlags, + CONST SYSTEMTIME *lpDate, + LPCWSTR lpFormat, + LPWSTR lpDateStr, + int cchDate); + +int +STDCALL +GetNumberFormatW( + LCID Locale, + DWORD dwFlags, + LPCWSTR lpValue, + CONST NUMBERFMT *lpFormat, + LPWSTR lpNumberStr, + int cchNumber); + +int +STDCALL +GetCurrencyFormatW( + LCID Locale, + DWORD dwFlags, + LPCWSTR lpValue, + CONST CURRENCYFMT *lpFormat, + LPWSTR lpCurrencyStr, + int cchCurrency); + +WINBOOL +STDCALL +EnumCalendarInfoW( + CALINFO_ENUMPROC lpCalInfoEnumProc, + LCID Locale, + CALID Calendar, + CALTYPE CalType); + +WINBOOL +STDCALL +EnumTimeFormatsW( + TIMEFMT_ENUMPROC lpTimeFmtEnumProc, + LCID Locale, + DWORD dwFlags); + +WINBOOL +STDCALL +EnumDateFormatsW( + DATEFMT_ENUMPROC lpDateFmtEnumProc, + LCID Locale, + DWORD dwFlags); + +WINBOOL +STDCALL +GetStringTypeExW( + LCID Locale, + DWORD dwInfoType, + LPCWSTR lpSrcStr, + int cchSrc, + LPWORD lpCharType); + +WINBOOL +STDCALL +GetStringTypeW( + DWORD dwInfoType, + LPCWSTR lpSrcStr, + int cchSrc, + LPWORD lpCharType); + +int +STDCALL +FoldStringW( + DWORD dwMapFlags, + LPCWSTR lpSrcStr, + int cchSrc, + LPWSTR lpDestStr, + int cchDest); + +WINBOOL +STDCALL +EnumSystemLocalesW( + LOCALE_ENUMPROC lpLocaleEnumProc, + DWORD dwFlags); + +WINBOOL +STDCALL +EnumSystemCodePagesW( + CODEPAGE_ENUMPROC lpCodePageEnumProc, + DWORD dwFlags); + +WINBOOL +STDCALL +PeekConsoleInputW( + HANDLE hConsoleInput, + PINPUT_RECORD lpBuffer, + DWORD nLength, + LPDWORD lpNumberOfEventsRead + ); + +WINBOOL +STDCALL +ReadConsoleInputW( + HANDLE hConsoleInput, + PINPUT_RECORD lpBuffer, + DWORD nLength, + LPDWORD lpNumberOfEventsRead + ); + +WINBOOL +STDCALL +WriteConsoleInputW( + HANDLE hConsoleInput, + CONST INPUT_RECORD *lpBuffer, + DWORD nLength, + LPDWORD lpNumberOfEventsWritten + ); + +WINBOOL +STDCALL +ReadConsoleOutputW( + HANDLE hConsoleOutput, + PCHAR_INFO lpBuffer, + COORD dwBufferSize, + COORD dwBufferCoord, + PSMALL_RECT lpReadRegion + ); + +WINBOOL +STDCALL +WriteConsoleOutputW( + HANDLE hConsoleOutput, + CONST CHAR_INFO *lpBuffer, + COORD dwBufferSize, + COORD dwBufferCoord, + PSMALL_RECT lpWriteRegion + ); + +WINBOOL +STDCALL +ReadConsoleOutputCharacterW( + HANDLE hConsoleOutput, + LPWSTR lpCharacter, + DWORD nLength, + COORD dwReadCoord, + LPDWORD lpNumberOfCharsRead + ); + +WINBOOL +STDCALL +WriteConsoleOutputCharacterW( + HANDLE hConsoleOutput, + LPCWSTR lpCharacter, + DWORD nLength, + COORD dwWriteCoord, + LPDWORD lpNumberOfCharsWritten + ); + +WINBOOL +STDCALL +FillConsoleOutputCharacterW( + HANDLE hConsoleOutput, + WCHAR cCharacter, + DWORD nLength, + COORD dwWriteCoord, + LPDWORD lpNumberOfCharsWritten + ); + +WINBOOL +STDCALL +ScrollConsoleScreenBufferW( + HANDLE hConsoleOutput, + CONST SMALL_RECT *lpScrollRectangle, + CONST SMALL_RECT *lpClipRectangle, + COORD dwDestinationOrigin, + CONST CHAR_INFO *lpFill + ); + +DWORD +STDCALL +GetConsoleTitleW( + LPWSTR lpConsoleTitle, + DWORD nSize + ); + +WINBOOL +STDCALL +SetConsoleTitleW( + LPCWSTR lpConsoleTitle + ); + +WINBOOL +STDCALL +ReadConsoleW( + HANDLE hConsoleInput, + LPVOID lpBuffer, + DWORD nNumberOfCharsToRead, + LPDWORD lpNumberOfCharsRead, + LPVOID lpReserved + ); + +WINBOOL +STDCALL +WriteConsoleW( + HANDLE hConsoleOutput, + CONST VOID *lpBuffer, + DWORD nNumberOfCharsToWrite, + LPDWORD lpNumberOfCharsWritten, + LPVOID lpReserved + ); + +DWORD STDCALL +WNetAddConnectionW( + LPCWSTR lpRemoteName, + LPCWSTR lpPassword, + LPCWSTR lpLocalName + ); + +DWORD STDCALL +WNetAddConnection2W( + LPNETRESOURCE lpNetResource, + LPCWSTR lpPassword, + LPCWSTR lpUserName, + DWORD dwFlags + ); + +DWORD STDCALL +WNetAddConnection3W( + HWND hwndOwner, + LPNETRESOURCE lpNetResource, + LPCWSTR lpPassword, + LPCWSTR lpUserName, + DWORD dwFlags + ); + +DWORD STDCALL +WNetCancelConnectionW( + LPCWSTR lpName, + WINBOOL fForce + ); + +DWORD STDCALL +WNetCancelConnection2W( + LPCWSTR lpName, + DWORD dwFlags, + WINBOOL fForce + ); + +DWORD STDCALL +WNetGetConnectionW( + LPCWSTR lpLocalName, + LPWSTR lpRemoteName, + LPDWORD lpnLength + ); + +DWORD STDCALL +WNetUseConnectionW( + HWND hwndOwner, + LPNETRESOURCE lpNetResource, + LPCWSTR lpUserID, + LPCWSTR lpPassword, + DWORD dwFlags, + LPWSTR lpAccessName, + LPDWORD lpBufferSize, + LPDWORD lpResult + ); + +DWORD STDCALL +WNetSetConnectionW( + LPCWSTR lpName, + DWORD dwProperties, + LPVOID pvValues + ); + +DWORD STDCALL +WNetConnectionDialog1W( + LPCONNECTDLGSTRUCT lpConnDlgStruct + ); + +DWORD STDCALL +WNetDisconnectDialog1W( + LPDISCDLGSTRUCT lpConnDlgStruct + ); + +DWORD STDCALL +WNetOpenEnumW( + DWORD dwScope, + DWORD dwType, + DWORD dwUsage, + LPNETRESOURCE lpNetResource, + LPHANDLE lphEnum + ); + +DWORD STDCALL +WNetEnumResourceW( + HANDLE hEnum, + LPDWORD lpcCount, + LPVOID lpBuffer, + LPDWORD lpBufferSize + ); + +DWORD STDCALL +WNetGetUniversalNameW( + LPCWSTR lpLocalPath, + DWORD dwInfoLevel, + LPVOID lpBuffer, + LPDWORD lpBufferSize + ); + +DWORD STDCALL +WNetGetUserW( + LPCWSTR lpName, + LPWSTR lpUserName, + LPDWORD lpnLength + ); + +DWORD STDCALL +WNetGetProviderNameW( + DWORD dwNetType, + LPWSTR lpProviderName, + LPDWORD lpBufferSize + ); + +DWORD STDCALL +WNetGetNetworkInformationW( + LPCWSTR lpProvider, + LPNETINFOSTRUCT lpNetInfoStruct + ); + +DWORD STDCALL +WNetGetLastErrorW( + LPDWORD lpError, + LPWSTR lpErrorBuf, + DWORD nErrorBufSize, + LPWSTR lpNameBuf, + DWORD nNameBufSize + ); + +DWORD STDCALL +MultinetGetConnectionPerformanceW( + LPNETRESOURCE lpNetResource, + LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct + ); + +WINBOOL +STDCALL +ChangeServiceConfigW( + SC_HANDLE hService, + DWORD dwServiceType, + DWORD dwStartType, + DWORD dwErrorControl, + LPCWSTR lpBinaryPathName, + LPCWSTR lpLoadOrderGroup, + LPDWORD lpdwTagId, + LPCWSTR lpDependencies, + LPCWSTR lpServiceStartName, + LPCWSTR lpPassword, + LPCWSTR lpDisplayName + ); + +SC_HANDLE +STDCALL +CreateServiceW( + SC_HANDLE hSCManager, + LPCWSTR lpServiceName, + LPCWSTR lpDisplayName, + DWORD dwDesiredAccess, + DWORD dwServiceType, + DWORD dwStartType, + DWORD dwErrorControl, + LPCWSTR lpBinaryPathName, + LPCWSTR lpLoadOrderGroup, + LPDWORD lpdwTagId, + LPCWSTR lpDependencies, + LPCWSTR lpServiceStartName, + LPCWSTR lpPassword + ); + +WINBOOL +STDCALL +EnumDependentServicesW( + SC_HANDLE hService, + DWORD dwServiceState, + LPENUM_SERVICE_STATUSW lpServices, + DWORD cbBufSize, + LPDWORD pcbBytesNeeded, + LPDWORD lpServicesReturned + ); + +WINBOOL +STDCALL +EnumServicesStatusW( + SC_HANDLE hSCManager, + DWORD dwServiceType, + DWORD dwServiceState, + LPENUM_SERVICE_STATUSW lpServices, + DWORD cbBufSize, + LPDWORD pcbBytesNeeded, + LPDWORD lpServicesReturned, + LPDWORD lpResumeHandle + ); + +WINBOOL +STDCALL +GetServiceKeyNameW( + SC_HANDLE hSCManager, + LPCWSTR lpDisplayName, + LPWSTR lpServiceName, + LPDWORD lpcchBuffer + ); + +WINBOOL +STDCALL +GetServiceDisplayNameW( + SC_HANDLE hSCManager, + LPCWSTR lpServiceName, + LPWSTR lpDisplayName, + LPDWORD lpcchBuffer + ); + +SC_HANDLE +STDCALL +OpenSCManagerW( + LPCWSTR lpMachineName, + LPCWSTR lpDatabaseName, + DWORD dwDesiredAccess + ); + +SC_HANDLE +STDCALL +OpenServiceW( + SC_HANDLE hSCManager, + LPCWSTR lpServiceName, + DWORD dwDesiredAccess + ); + +WINBOOL +STDCALL +QueryServiceConfigW( + SC_HANDLE hService, + LPQUERY_SERVICE_CONFIGW lpServiceConfig, + DWORD cbBufSize, + LPDWORD pcbBytesNeeded + ); + +WINBOOL +STDCALL +QueryServiceLockStatusW( + SC_HANDLE hSCManager, + LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus, + DWORD cbBufSize, + LPDWORD pcbBytesNeeded + ); + +SERVICE_STATUS_HANDLE +STDCALL +RegisterServiceCtrlHandlerW( + LPCWSTR lpServiceName, + LPHANDLER_FUNCTION lpHandlerProc + ); + +WINBOOL +STDCALL +StartServiceCtrlDispatcherW( + LPSERVICE_TABLE_ENTRYW lpServiceStartTable + ); + +WINBOOL +STDCALL +StartServiceW( + SC_HANDLE hService, + DWORD dwNumServiceArgs, + LPCWSTR *lpServiceArgVectors + ); + +/* Extensions to OpenGL */ + +WINBOOL STDCALL +wglUseFontBitmapsW(HDC, DWORD, DWORD, DWORD); + +WINBOOL STDCALL +wglUseFontOutlinesW(HDC, DWORD, DWORD, DWORD, FLOAT, + FLOAT, int, LPGLYPHMETRICSFLOAT); + +/* ------------------------------------- */ +/* From shellapi.h in old Cygnus headers */ + +unsigned int WINAPI +DragQueryFileW(HDROP, unsigned int, LPCWSTR, unsigned int); + +HICON WINAPI +ExtractAssociatedIconW (HINSTANCE, LPCWSTR, WORD *); + +HICON WINAPI +ExtractIconW (HINSTANCE, const LPCWSTR, unsigned int); + +HINSTANCE WINAPI +FindExecutableW (const LPCWSTR, const LPCWSTR, LPCWSTR); + +int WINAPI +ShellAboutW (HWND, const LPCWSTR, const LPCWSTR, HICON); + +HINSTANCE WINAPI +ShellExecuteW (HWND, const LPCWSTR, const LPCWSTR, LPCWSTR, const LPCWSTR, int); + +/* end of stuff from shellapi.h in old Cygnus headers */ +/* -------------------------------------------------- */ +/* From ddeml.h in old Cygnus headers */ + +HSZ +WINAPI +DdeCreateStringHandleW( + DWORD idInst, + LPWSTR psz, + int iCodePage); + +UINT WINAPI +DdeInitializeW (DWORD *, CALLB, DWORD, DWORD); + +DWORD +WINAPI +DdeQueryStringW( + DWORD idInst, + HSZ hsz, + LPWSTR psz, + DWORD cchMax, + int iCodePage); + +/* end of stuff from ddeml.h in old Cygnus headers */ +/* ----------------------------------------------- */ + +WINBOOL STDCALL LogonUserW (LPWSTR, LPWSTR, LPWSTR, DWORD, DWORD, HANDLE *); +WINBOOL STDCALL CreateProcessAsUserW (HANDLE, LPCWSTR, LPWSTR, + SECURITY_ATTRIBUTES*, SECURITY_ATTRIBUTES*, WINBOOL, + DWORD, LPVOID, LPCWSTR, STARTUPINFOW*, + PROCESS_INFORMATION*); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _GNU_H_WINDOWS32_UNICODEFUNCTIONS */ diff --git a/reactos/include/win32k/brush.h b/reactos/include/win32k/brush.h index 35789a027a2..fb34f0ab95b 100644 --- a/reactos/include/win32k/brush.h +++ b/reactos/include/win32k/brush.h @@ -8,14 +8,14 @@ #define NB_HATCH_STYLES 6 #define BRUSHOBJ_AllocBrush() \ - ((HBRUSH) GDIOBJ_AllocObj (sizeof (ROS_BRUSHOBJ), GO_BRUSH_MAGIC)) + ((HBRUSH) GDIOBJ_AllocObj (sizeof (BRUSHOBJ), GO_BRUSH_MAGIC)) #define BRUSHOBJ_FreeBrush(hBrush) GDIOBJ_FreeObj((HGDIOBJ)hBrush, GO_BRUSH_MAGIC) /*#define BRUSHOBJ_HandleToPtr(hBrush) \ - ((BRUSHOBJ*) GDIOBJ_HandleToPtr ((HGDIOBJ) hBrush, GO_BRUSH_MAGIC)) + ((PBRUSHOBJ) GDIOBJ_HandleToPtr ((HGDIOBJ) hBrush, GO_BRUSH_MAGIC)) #define BRUSHOBJ_PtrToHandle(pBrushObj) \ ((HBRUSH) GDIOBJ_PtrToHandle ((PGDIOBJ) pBrushObj, GO_BRUSH_MAGIC)) */ -#define BRUSHOBJ_LockBrush(hBrush) ((BRUSHOBJ*)GDIOBJ_LockObj((HGDIOBJ)hBrush, GO_BRUSH_MAGIC)) +#define BRUSHOBJ_LockBrush(hBrush) ((PBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ)hBrush, GO_BRUSH_MAGIC)) #define BRUSHOBJ_UnlockBrush(hBrush) GDIOBJ_UnlockObj((HGDIOBJ)hBrush, GO_BRUSH_MAGIC) HBRUSH diff --git a/reactos/include/win32k/color.h b/reactos/include/win32k/color.h index 70b639ec35e..2b68d196ac6 100644 --- a/reactos/include/win32k/color.h +++ b/reactos/include/win32k/color.h @@ -1,9 +1,7 @@ #ifndef __WIN32K_COLOR_H #define __WIN32K_COLOR_H -#ifndef CLR_INVALID #define CLR_INVALID 0xffffffff -#endif #define PC_SYS_USED 0x80 // palentry is used (both system and logical) #define PC_SYS_RESERVED 0x40 // system palentry is not to be mapped to #define PC_SYS_MAPPED 0x10 // logical palentry is a direct alias for system palentry diff --git a/reactos/include/win32k/coord.h b/reactos/include/win32k/coord.h index 21da3e3cdb8..5dfba5d3565 100644 --- a/reactos/include/win32k/coord.h +++ b/reactos/include/win32k/coord.h @@ -4,9 +4,9 @@ BOOL STDCALL W32kCombineTransform ( - PXFORM XformResult, - CONST PXFORM xform1, - CONST PXFORM xform2 + LPXFORM XformResult, + CONST LPXFORM xform1, + CONST LPXFORM xform2 ); BOOL STDCALL @@ -24,7 +24,7 @@ BOOL STDCALL W32kGetWorldTransform ( HDC hDC, - PXFORM Xform + LPXFORM Xform ); BOOL STDCALL @@ -37,7 +37,7 @@ BOOL STDCALL W32kModifyWorldTransform ( HDC hDC, - CONST PXFORM Xform, + CONST LPXFORM Xform, DWORD Mode ); BOOL @@ -124,6 +124,6 @@ BOOL STDCALL W32kSetWorldTransform ( HDC hDC, - CONST PXFORM Xform + CONST LPXFORM Xform ); #endif diff --git a/reactos/include/win32k/dc.h b/reactos/include/win32k/dc.h index ab23904f1f6..28d8dcc7159 100644 --- a/reactos/include/win32k/dc.h +++ b/reactos/include/win32k/dc.h @@ -183,7 +183,7 @@ INT STDCALL W32kDrawEscape(HDC hDC, LPCSTR lpszInData); /* FIXME: this typedef should go somewhere else... */ -//typedef VOID (*GOBJENUMPROC)(PVOID, LPARAM); +typedef VOID (*GOBJENUMPROC)(PVOID, LPARAM); INT STDCALL W32kEnumObjects(HDC hDC, INT ObjectType, diff --git a/reactos/include/win32k/debug1.h b/reactos/include/win32k/debug1.h index 719dc9a505b..7618cb86c65 100644 --- a/reactos/include/win32k/debug1.h +++ b/reactos/include/win32k/debug1.h @@ -23,9 +23,6 @@ #define CHECKED #endif -#undef ASSERT -#undef assert - #ifndef NASSERT #define assert(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); KeBugCheck(0); } #define ASSERT(x) assert(x) diff --git a/reactos/include/win32k/driver.h b/reactos/include/win32k/driver.h index 4c8ecf4a9bf..ccd4e162d4c 100644 --- a/reactos/include/win32k/driver.h +++ b/reactos/include/win32k/driver.h @@ -24,73 +24,75 @@ typedef BOOL STDCALL (*PGD_ASSERTMODE)(DHPDEV, BOOL); typedef BOOL STDCALL (*PGD_RESETPDEV)(DHPDEV, DHPDEV); typedef HBITMAP STDCALL (*PGD_CREATEDEVICEBITMAP)(DHPDEV, SIZEL, ULONG); typedef VOID STDCALL (*PGD_DELETEDEVICEBITMAP)(DHSURF); -typedef BOOL STDCALL (*PGD_REALIZEBRUSH)(BRUSHOBJ*, SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*, ULONG); +typedef BOOL STDCALL (*PGD_REALIZEBRUSH)(PBRUSHOBJ, PSURFOBJ, PSURFOBJ, PSURFOBJ, + PXLATEOBJ, ULONG); typedef ULONG STDCALL (*PGD_DITHERCOLOR)(DHPDEV, ULONG, ULONG, PULONG); -typedef BOOL STDCALL (*PGD_STROKEPATH)(SURFOBJ*, PATHOBJ*, CLIPOBJ*, XFORMOBJ*, - BRUSHOBJ*, PPOINTL, PLINEATTRS, MIX); -typedef BOOL STDCALL (*PGD_FILLPATH)(SURFOBJ*, PATHOBJ*, CLIPOBJ*, BRUSHOBJ*, +typedef BOOL STDCALL (*PGD_STROKEPATH)(PSURFOBJ, PPATHOBJ, PCLIPOBJ, PXFORMOBJ, + PBRUSHOBJ, PPOINTL, PLINEATTRS, MIX); +typedef BOOL STDCALL (*PGD_FILLPATH)(PSURFOBJ, PPATHOBJ, PCLIPOBJ, PBRUSHOBJ, PPOINTL, MIX, ULONG); -typedef BOOL STDCALL (*PGD_STROKEANDFILLPATH)(SURFOBJ*, PATHOBJ*, CLIPOBJ*, - XFORMOBJ*, BRUSHOBJ*, PLINEATTRS, - BRUSHOBJ*, PPOINTL, MIX, ULONG); -typedef BOOL STDCALL (*PGD_PAINT)(SURFOBJ*, CLIPOBJ*, BRUSHOBJ*, PPOINTL, MIX); -typedef BOOL STDCALL (*PGD_BITBLT)(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, - XLATEOBJ*, PRECTL, PPOINTL, PPOINTL, BRUSHOBJ*, +typedef BOOL STDCALL (*PGD_STROKEANDFILLPATH)(PSURFOBJ, PPATHOBJ, PCLIPOBJ, + PXFORMOBJ, PBRUSHOBJ, PLINEATTRS, + PBRUSHOBJ, PPOINTL, MIX, ULONG); +typedef BOOL STDCALL (*PGD_PAINT)(PSURFOBJ, PCLIPOBJ, PBRUSHOBJ, PPOINTL, MIX); +typedef BOOL STDCALL (*PGD_BITBLT)(PSURFOBJ, PSURFOBJ, PSURFOBJ, PCLIPOBJ, + PXLATEOBJ, PRECTL, PPOINTL, PPOINTL, PBRUSHOBJ, PPOINTL, ROP4); -typedef BOOL STDCALL (*PGD_TRANSPARENTBLT)(SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, PRECTL, PRECTL, ULONG, ULONG); -typedef BOOL STDCALL (*PGD_COPYBITS)(SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, +typedef BOOL STDCALL (*PGD_TRANSPARENTBLT)(PSURFOBJ, PSURFOBJ, PCLIPOBJ, PXLATEOBJ, PRECTL, PRECTL, ULONG, ULONG); +typedef BOOL STDCALL (*PGD_COPYBITS)(PSURFOBJ, PSURFOBJ, PCLIPOBJ, PXLATEOBJ, PRECTL, PPOINTL); -typedef BOOL STDCALL (*PGD_STRETCHBLT)(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, - XLATEOBJ*, COLORADJUSTMENT*, PPOINTL, +typedef BOOL STDCALL (*PGD_STRETCHBLT)(PSURFOBJ, PSURFOBJ, PSURFOBJ, PCLIPOBJ, + PXLATEOBJ, PCOLORADJUSTMENT, PPOINTL, PRECTL, PRECTL, PPOINTL, ULONG); -typedef BOOL STDCALL (*PGD_SETPALETTE)(DHPDEV, PALOBJ*, ULONG, ULONG, ULONG); -typedef BOOL STDCALL (*PGD_TEXTOUT)(SURFOBJ*, STROBJ*, FONTOBJ*, CLIPOBJ*, PRECTL, - PRECTL, BRUSHOBJ*, BRUSHOBJ*, PPOINTL, MIX); -typedef ULONG STDCALL (*PGD_ESCAPE)(SURFOBJ*, ULONG, ULONG, PVOID *, ULONG, PVOID *); -typedef ULONG STDCALL (*PGD_DRAWESCAPE)(SURFOBJ*, ULONG, CLIPOBJ*, PRECTL, ULONG, +typedef BOOL STDCALL (*PGD_SETPALETTE)(DHPDEV, PPALOBJ, ULONG, ULONG, ULONG); +typedef BOOL STDCALL (*PGD_TEXTOUT)(PSURFOBJ, PSTROBJ, PFONTOBJ, PCLIPOBJ, PRECTL, + PRECTL, PBRUSHOBJ, PBRUSHOBJ, PPOINTL, MIX); +typedef ULONG STDCALL (*PGD_ESCAPE)(PSURFOBJ, ULONG, ULONG, PVOID *, ULONG, PVOID *); +typedef ULONG STDCALL (*PGD_DRAWESCAPE)(PSURFOBJ, ULONG, PCLIPOBJ, PRECTL, ULONG, PVOID *); typedef PIFIMETRICS STDCALL (*PGD_QUERYFONT)(DHPDEV, ULONG, ULONG, PULONG); typedef PVOID STDCALL (*PGD_QUERYFONTTREE)(DHPDEV, ULONG, ULONG, ULONG, PULONG); -typedef LONG STDCALL (*PGD_QUERYFONTDATA)(DHPDEV, FONTOBJ*, ULONG, HGLYPH, GLYPHDATA*, +typedef LONG STDCALL (*PGD_QUERYFONTDATA)(DHPDEV, PFONTOBJ, ULONG, HGLYPH, PGLYPHDATA, PVOID, ULONG); -typedef ULONG STDCALL (*PGD_SETPOINTERSHAPE)(SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*, +typedef ULONG STDCALL (*PGD_SETPOINTERSHAPE)(PSURFOBJ, PSURFOBJ, PSURFOBJ, PXLATEOBJ, LONG, LONG, LONG, LONG, PRECTL, ULONG); -typedef VOID STDCALL (*PGD_MOVEPOINTER)(SURFOBJ*, LONG, LONG, PRECTL); -typedef BOOL STDCALL (*PGD_LINETO)(SURFOBJ*, CLIPOBJ*, BRUSHOBJ*, LONG, LONG, LONG, +typedef VOID STDCALL (*PGD_MOVEPOINTER)(PSURFOBJ, LONG, LONG, PRECTL); +typedef BOOL STDCALL (*PGD_LINETO)(PSURFOBJ, PCLIPOBJ, PBRUSHOBJ, LONG, LONG, LONG, LONG, PRECTL, MIX); -typedef BOOL STDCALL (*PGD_SENDPAGE)(SURFOBJ*); -typedef BOOL STDCALL (*PGD_STARTPAGE)(SURFOBJ*); -typedef BOOL STDCALL (*PGD_ENDDOC)(SURFOBJ*, ULONG); -typedef BOOL STDCALL (*PGD_STARTDOC)(SURFOBJ*, PWSTR, DWORD); -typedef ULONG STDCALL (*PGD_GETGLYPHMODE)(DHPDEV, FONTOBJ*); +typedef BOOL STDCALL (*PGD_SENDPAGE)(PSURFOBJ); +typedef BOOL STDCALL (*PGD_STARTPAGE)(PSURFOBJ); +typedef BOOL STDCALL (*PGD_ENDDOC)(PSURFOBJ, ULONG); +typedef BOOL STDCALL (*PGD_STARTDOC)(PSURFOBJ, PWSTR, DWORD); +typedef ULONG STDCALL (*PGD_GETGLYPHMODE)(DHPDEV, PFONTOBJ); typedef VOID STDCALL (*PGD_SYNCHRONIZE)(DHPDEV, PRECTL); -typedef ULONG STDCALL (*PGD_SAVESCREENBITS)(SURFOBJ*, ULONG, ULONG, PRECTL); +typedef ULONG STDCALL (*PGD_SAVESCREENBITS)(PSURFOBJ, ULONG, ULONG, PRECTL); typedef ULONG STDCALL (*PGD_GETMODES)(HANDLE, ULONG, PDEVMODEW); typedef VOID STDCALL (*PGD_FREE)(PVOID, ULONG); -typedef VOID STDCALL (*PGD_DESTROYFONT)(FONTOBJ*); +typedef VOID STDCALL (*PGD_DESTROYFONT)(PFONTOBJ); typedef LONG STDCALL (*PGD_QUERYFONTCAPS)(ULONG, PULONG); typedef ULONG STDCALL (*PGD_LOADFONTFILE)(ULONG, PVOID, ULONG, ULONG); typedef BOOL STDCALL (*PGD_UNLOADFONTFILE)(ULONG); -typedef ULONG STDCALL (*PGD_FONTMANAGEMENT)(SURFOBJ*, FONTOBJ*, ULONG, ULONG, PVOID, +typedef ULONG STDCALL (*PGD_FONTMANAGEMENT)(PSURFOBJ, PFONTOBJ, ULONG, ULONG, PVOID, ULONG, PVOID); typedef LONG STDCALL (*PGD_QUERYTRUETYPETABLE)(ULONG, ULONG, ULONG, PTRDIFF, ULONG, PBYTE); -typedef LONG STDCALL (*PGD_QUERYTRUETYPEOUTLINE)(DHPDEV, FONTOBJ*, HGLYPH, BOOL, - GLYPHDATA*, ULONG, TTPOLYGONHEADER*); +typedef LONG STDCALL (*PGD_QUERYTRUETYPEOUTLINE)(DHPDEV, PFONTOBJ, HGLYPH, BOOL, + PGLYPHDATA, ULONG, PTTPOLYGONHEADER); typedef PVOID STDCALL (*PGD_GETTRUETYPEFILE)(ULONG, PULONG); typedef LONG STDCALL (*PGD_QUERYFONTFILE)(ULONG, ULONG, ULONG, PULONG); -typedef BOOL STDCALL (*PGD_QUERYADVANCEWIDTHS)(DHPDEV, FONTOBJ*, ULONG, HGLYPH *, +typedef BOOL STDCALL (*PGD_QUERYADVANCEWIDTHS)(DHPDEV, PFONTOBJ, ULONG, HGLYPH *, PVOID *, ULONG); -typedef BOOL STDCALL (*PGD_SETPIXELFORMAT)(SURFOBJ*, LONG, ULONG); +typedef BOOL STDCALL (*PGD_SETPIXELFORMAT)(PSURFOBJ, LONG, ULONG); typedef LONG STDCALL (*PGD_DESCRIBEPIXELFORMAT)(DHPDEV, LONG, ULONG, PPIXELFORMATDESCRIPTOR); -typedef BOOL STDCALL (*PGD_SWAPBUFFERS)(SURFOBJ*, PWNDOBJ); -typedef BOOL STDCALL (*PGD_STARTBANDING)(SURFOBJ*, PPOINTL); -typedef BOOL STDCALL (*PGD_NEXTBAND)(SURFOBJ*, PPOINTL); +typedef BOOL STDCALL (*PGD_SWAPBUFFERS)(PSURFOBJ, PWNDOBJ); +typedef BOOL STDCALL (*PGD_STARTBANDING)(PSURFOBJ, PPOINTL); +typedef BOOL STDCALL (*PGD_NEXTBAND)(PSURFOBJ, PPOINTL); typedef LONG STDCALL (*PGD_QUERYSPOOLTYPE)(DHPDEV, LPWSTR); -typedef struct _DRIVER_FUNCTIONS { +typedef struct _DRIVER_FUNCTIONS +{ PGD_ENABLEDRIVER EnableDriver; PGD_ENABLEPDEV EnablePDev; PGD_COMPLETEPDEV CompletePDev; @@ -146,10 +148,9 @@ typedef struct _DRIVER_FUNCTIONS { PGD_STARTBANDING StartBanding; PGD_NEXTBAND NextBand; #if 0 - // FIXME: DirectDraw - PGD_GETDIRECTDRAWINFO; - PGD_ENABLEDIRECTDRAW; - PGD_DISABLEDIRECTDRAW; + PGD_GETDIRECTDRAWINFO, + PGD_ENABLEDIRECTDRAW, + PGD_DISABLEDIRECTDRAW, #endif PGD_QUERYSPOOLTYPE QuerySpoolType; } DRIVER_FUNCTIONS, *PDRIVER_FUNCTIONS; diff --git a/reactos/include/win32k/ntuser.h b/reactos/include/win32k/ntuser.h index 1af235fc1a8..ac998ae8c47 100644 --- a/reactos/include/win32k/ntuser.h +++ b/reactos/include/win32k/ntuser.h @@ -1,8 +1,6 @@ #ifndef __WIN32K_NTUSER_H #define __WIN32K_NTUSER_H -#include - ULONG STDCALL NtUserGetSystemMetrics(ULONG Index); DWORD STDCALL diff --git a/reactos/include/win32k/print.h b/reactos/include/win32k/print.h index 5664a1a3310..52342d97cb9 100644 --- a/reactos/include/win32k/print.h +++ b/reactos/include/win32k/print.h @@ -39,7 +39,7 @@ W32kSetAbortProc(HDC hDC, INT STDCALL W32kStartDoc(HDC hDC, - CONST LPDOCINFO di); + CONST PDOCINFO di); INT STDCALL diff --git a/reactos/include/win32k/text.h b/reactos/include/win32k/text.h index 30c69e607c7..31ff77b41a3 100644 --- a/reactos/include/win32k/text.h +++ b/reactos/include/win32k/text.h @@ -210,12 +210,12 @@ W32kGetTextFace(HDC hDC, BOOL STDCALL W32kGetTextMetrics(HDC hDC, - LPTEXTMETRICW tm); + LPTEXTMETRIC tm); BOOL STDCALL W32kPolyTextOut(HDC hDC, - CONST PPOLYTEXTW txt, + CONST LPPOLYTEXT txt, int Count); BOOL diff --git a/reactos/include/windows.h b/reactos/include/windows.h new file mode 100644 index 00000000000..8e626789f6b --- /dev/null +++ b/reactos/include/windows.h @@ -0,0 +1,165 @@ +/* + windows.h + + Include this file if you wish to use the Windows32 API Library + + Copyright (C) 1996 Free Software Foundation + + Author: Scott Christley + Date: 1996 + + This file is part of the Windows32 API Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + If you are interested in a warranty or support for this source code, + contact Scott Christley for more information. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNU_H_WINDOWS_H +#define _GNU_H_WINDOWS_H + +#ifndef max +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#endif +#ifndef min +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +#ifndef MAX +#define MAX max +#endif +#ifndef MIN +#define MIN min +#endif + +#ifndef RC_INVOKED +#include +#include +#endif + +/* Base definitions */ +#include + +/* WIN32 messages */ +#ifndef WIN32_LEAN_AND_MEAN +#include +#endif + +/* WIN32 definitions */ +#include + +#ifndef RC_INVOKED + +/* WIN32 structures */ +#include + +/* WIN32 functions */ +#ifndef WIN32_LEAN_AND_MEAN +#include +#endif + +/* WIN32 PE file format */ +#include + +#endif /* ! defined (RC_INVOKED) */ + +/* WIN32 error codes */ +#ifndef WIN32_LEAN_AND_MEAN +#include +#endif + +#ifndef RC_INVOKED + +/* Windows sockets specification version 1.1 */ +#ifdef Win32_Winsock +#ifndef WIN32_LEAN_AND_MEAN +#include +#endif +#endif + +/* There is a conflict with BOOL between Objective-C and Win32, + so the Windows32 API Library defines and uses WINBOOL. + However, if we are not using Objective-C then define the normal + windows BOOL so Win32 programs compile normally. If you are + using Objective-C then you must use WINBOOL for Win32 operations. +*/ +#ifndef __OBJC__ +//typedef WINBOOL BOOL; +#endif /* !__OBJC__ */ + +/* How do we get the VM page size on NT? */ +#ifndef vm_page_size +#define vm_page_size 4096 +#endif + +#endif /* ! defined (RC_INVOKED) */ + +#ifdef __GNUC__ +#ifndef NONAMELESSUNION +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +#define _ANONYMOUS_UNION __extension__ +#define _ANONYMOUS_STRUCT __extension__ +#else +#if defined(__cplusplus) +#define _ANONYMOUS_UNION __extension__ +#endif +#endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */ +#endif /* NONAMELESSUNION */ +#endif /* __GNUC__ */ + +#ifndef _ANONYMOUS_UNION +#define _ANONYMOUS_UNION +#define _UNION_NAME(x) x +#define DUMMYUNIONNAME u +#define DUMMYUNIONNAME2 u2 +#define DUMMYUNIONNAME3 u3 +#define DUMMYUNIONNAME4 u4 +#define DUMMYUNIONNAME5 u5 +#define DUMMYUNIONNAME6 u6 +#define DUMMYUNIONNAME7 u7 +#define DUMMYUNIONNAME8 u8 +#else +#define _UNION_NAME(x) +#define DUMMYUNIONNAME +#define DUMMYUNIONNAME2 +#define DUMMYUNIONNAME3 +#define DUMMYUNIONNAME4 +#define DUMMYUNIONNAME5 +#define DUMMYUNIONNAME6 +#define DUMMYUNIONNAME7 +#define DUMMYUNIONNAME8 +#endif +#ifndef _ANONYMOUS_STRUCT +#define _ANONYMOUS_STRUCT +#define _STRUCT_NAME(x) x +#define DUMMYSTRUCTNAME s +#define DUMMYSTRUCTNAME2 s2 +#define DUMMYSTRUCTNAME3 s3 +#else +#define _STRUCT_NAME(x) +#define DUMMYSTRUCTNAME +#define DUMMYSTRUCTNAME2 +#define DUMMYSTRUCTNAME3 +#endif + +#ifndef NO_STRICT +#ifndef STRICT +#define STRICT 1 +#endif +#endif + +#endif /* _GNU_H_WINDOWS_H */ diff --git a/reactos/include/winsock2.h b/reactos/include/winsock2.h new file mode 100644 index 00000000000..ffbd9786403 --- /dev/null +++ b/reactos/include/winsock2.h @@ -0,0 +1,1570 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Winsock 2 DLL + * FILE: include/winsock2.h + * PURPOSE: Header file for the WinSock 2 DLL + * and WinSock 2 applications + * DEFINES: UNICODE - Use unicode prototypes + * FD_SETSIZE - Maximum size of an FD_SET (default is 64) + */ +#ifndef __WINSOCK2_H +#define __WINSOCK2_H + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#define WSAAPI STDCALL + + +#if 0 +typedef struct _GUID { + ULONG Data1; + USHORT Data2; + USHORT Data3; + UCHAR Data4[8]; +} GUID, *PGUID, *LPGUID; +#endif + +typedef UINT SOCKET; + +#define INVALID_SOCKET ((SOCKET)~0) +#define SOCKET_ERROR (-1) + +/* Socket types */ +#define SOCK_STREAM 1 +#define SOCK_DGRAM 2 +#define SOCK_RAW 3 +#define SOCK_RDM 4 +#define SOCK_SEQPACKET 5 + +/* Per socket flags */ +#define SO_DEBUG 0x0001 +#define SO_ACCEPTCONN 0x0002 +#define SO_REUSEADDR 0x0004 +#define SO_KEEPALIVE 0x0008 +#define SO_DONTROUTE 0x0010 +#define SO_BROADCAST 0x0020 +#define SO_USELOOPBACK 0x0040 +#define SO_LINGER 0x0080 +#define SO_OOBINLINE 0x0100 + +#define SO_DONTLINGER (UINT)(~SO_LINGER) + +#define SO_SNDBUF 0x1001 +#define SO_RCVBUF 0x1002 +#define SO_SNDLOWAT 0x1003 +#define SO_RCVLOWAT 0x1004 +#define SO_SNDTIMEO 0x1005 +#define SO_RCVTIMEO 0x1006 +#define SO_ERROR 0x1007 +#define SO_TYPE 0x1008 + + +/* Address families */ +#define AF_UNSPEC 0 +#define AF_UNIX 1 +#define AF_INET 2 +#define AF_IMPLINK 3 +#define AF_PUP 4 +#define AF_CHAOS 5 +#define AF_NS 6 +#define AF_ISO 7 +#define AF_OSI AF_ISO +#define AF_ECMA 8 +#define AF_DATAKIT 9 +#define AF_CCITT 10 +#define AF_SNA 11 +#define AF_DECnet 12 +#define AF_DLI 13 +#define AF_LAT 14 +#define AF_HYLINK 15 +#define AF_APPLETALK 16 +#define AF_NETBIOS 17 + +#define AF_MAX 18 + + +/* Protocol families, same as address families */ +#define PF_UNSPEC AF_UNSPEC +#define PF_UNIX AF_UNIX +#define PF_INET AF_INET +#define PF_IMPLINK AF_IMPLINK +#define PF_PUP AF_PUP +#define PF_CHAOS AF_CHAOS +#define PF_NS AF_NS +#define PF_ISO AF_ISO +#define PF_OSI AF_OSI +#define PF_ECMA AF_ECMA +#define PF_DATAKIT AF_DATAKIT +#define PF_CCITT AF_CCITT +#define PF_SNA AF_SNA +#define PF_DECnet AF_DECnet +#define PF_DLI AF_DLI +#define PF_LAT AF_LAT +#define PF_HYLINK AF_HYLINK +#define PF_APPLETALK AF_APPLETALK + +#define PF_MAX AF_MAX + + +#define SOL_SOCKET 0xffff + +#define SOMAXCONN 5 + +#define MSG_OOB 0x1 +#define MSG_PEEK 0x2 +#define MSG_DONTROUTE 0x4 + +#define MSG_MAXIOVLEN 16 + + +#define FD_READ 0x01 +#define FD_WRITE 0x02 +#define FD_OOB 0x04 +#define FD_ACCEPT 0x08 +#define FD_CONNECT 0x10 +#define FD_CLOSE 0x20 + +#define FD_MAX_EVENTS 6 +#define FD_ALL_EVENTS ((1 << FD_MAX_EVENTS) - 1) + + +/* Error codes */ + +#define WSABASEERR 10000 + +#define WSAEINTR (WSABASEERR+4) +#define WSAEBADF (WSABASEERR+9) +#define WSAEACCES (WSABASEERR+13) +#define WSAEFAULT (WSABASEERR+14) +#define WSAEINVAL (WSABASEERR+22) +#define WSAEMFILE (WSABASEERR+24) + +#define WSAEWOULDBLOCK (WSABASEERR+35) +#define WSAEINPROGRESS (WSABASEERR+36) +#define WSAEALREADY (WSABASEERR+37) +#define WSAENOTSOCK (WSABASEERR+38) +#define WSAEDESTADDRREQ (WSABASEERR+39) +#define WSAEMSGSIZE (WSABASEERR+40) +#define WSAEPROTOTYPE (WSABASEERR+41) +#define WSAENOPROTOOPT (WSABASEERR+42) +#define WSAEPROTONOSUPPORT (WSABASEERR+43) +#define WSAESOCKTNOSUPPORT (WSABASEERR+44) +#define WSAEOPNOTSUPP (WSABASEERR+45) +#define WSAEPFNOSUPPORT (WSABASEERR+46) +#define WSAEAFNOSUPPORT (WSABASEERR+47) +#define WSAEADDRINUSE (WSABASEERR+48) +#define WSAEADDRNOTAVAIL (WSABASEERR+49) +#define WSAENETDOWN (WSABASEERR+50) +#define WSAENETUNREACH (WSABASEERR+51) +#define WSAENETRESET (WSABASEERR+52) +#define WSAECONNABORTED (WSABASEERR+53) +#define WSAECONNRESET (WSABASEERR+54) +#define WSAENOBUFS (WSABASEERR+55) +#define WSAEISCONN (WSABASEERR+56) +#define WSAENOTCONN (WSABASEERR+57) +#define WSAESHUTDOWN (WSABASEERR+58) +#define WSAETOOMANYREFS (WSABASEERR+59) +#define WSAETIMEDOUT (WSABASEERR+60) +#define WSAECONNREFUSED (WSABASEERR+61) +#define WSAELOOP (WSABASEERR+62) +#define WSAENAMETOOLONG (WSABASEERR+63) +#define WSAEHOSTDOWN (WSABASEERR+64) +#define WSAEHOSTUNREACH (WSABASEERR+65) +#define WSAENOTEMPTY (WSABASEERR+66) +#define WSAEUSERS (WSABASEERR+68) +#define WSAEDQUOT (WSABASEERR+69) +#define WSAESTALE (WSABASEERR+70) +#define WSAEREMOTE (WSABASEERR+71) + +/* Extended Windows Sockets error codes */ +#define WSASYSNOTREADY (WSABASEERR+91) +#define WSAVERNOTSUPPORTED (WSABASEERR+92) +#define WSANOTINITIALISED (WSABASEERR+93) +#define WSAEDISCON (WSABASEERR+101) +#define WSAENOMORE (WSABASEERR+102) +#define WSAECANCELLED (WSABASEERR+103) +#define WSAEINVALIDPROCTABLE (WSABASEERR+104) +#define WSAEINVALIDPROVIDER (WSABASEERR+105) +#define WSAEPROVIDERFAILEDINIT (WSABASEERR+106) +#define WSASYSCALLFAILURE (WSABASEERR+107) +#define WSASERVICE_NOT_FOUND (WSABASEERR+108) +#define WSATYPE_NOT_FOUND (WSABASEERR+109) +#define WSA_E_NO_MORE (WSABASEERR+110) +#define WSA_E_CANCELLED (WSABASEERR+111) +#define WSAEREFUSED (WSABASEERR+112) + +#define WSAHOST_NOT_FOUND (WSABASEERR+1001) +#define WSATRY_AGAIN (WSABASEERR+1002) +#define WSANO_RECOVERY (WSABASEERR+1003) +#define WSANO_DATA (WSABASEERR+1004) +#define WSANO_ADDRESS WSANO_DATA + +#define WSAEVENT HANDLE +#define LPWSAEVENT LPHANDLE + +#define WSA_IO_PENDING (ERROR_IO_PENDING) +#define WSA_IO_INCOMPLETE (ERROR_IO_INCOMPLETE) +#define WSA_INVALID_HANDLE (ERROR_INVALID_HANDLE) +#define WSA_INVALID_PARAMETER (ERROR_INVALID_PARAMETER) +#define WSA_NOT_ENOUGH_MEMORY (ERROR_NOT_ENOUGH_MEMORY) +#define WSA_OPERATION_ABORTED (ERROR_OPERATION_ABORTED) + +#define WSA_INVALID_EVENT ((WSAEVENT)NULL) +#define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS) +#define WSA_WAIT_FAILED ((DWORD)-1L) +#define WSA_WAIT_EVENT_0 (WAIT_OBJECT_0) +#define WSA_WAIT_IO_COMPLETION (WAIT_IO_COMPLETION) +#define WSA_WAIT_TIMEOUT (WAIT_TIMEOUT) +#define WSA_INFINITE (INFINITE) + + + +#define IOCPARM_MASK 0x7f +#define IOC_VOID 0x20000000 +#define IOC_OUT 0x40000000 +#define IOC_IN 0x80000000 +#define IOC_INOUT (IOC_IN|IOC_OUT) + +#define _IO(x, y) (IOC_VOID|(x<<8)|y) + +#define _IOR(x, y, t) (IOC_OUT|(((LONG)sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y) + +#define _IOW(x, y, t) (IOC_IN|(((LONG)sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y) + +#define FIONREAD _IOR('f', 127, ULONG) +#define FIONBIO _IOW('f', 126, ULONG) +#define FIOASYNC _IOW('f', 125, ULONG) + +/* Socket I/O controls */ +#define SIOCSHIWAT _IOW('s', 0, ULONG) +#define SIOCGHIWAT _IOR('s', 1, ULONG) +#define SIOCSLOWAT _IOW('s', 2, ULONG) +#define SIOCGLOWAT _IOR('s', 3, ULONG) +#define SIOCATMARK _IOR('s', 7, ULONG) + + +struct in_addr { + union { + struct { UCHAR s_b1, s_b2,s_b3,s_b4; } S_un_b; + struct { USHORT s_w1,s_w2; } S_un_w; + ULONG S_addr; + } S_un; +#define s_addr S_un.S_addr +#define s_host S_un.S_un_b.s_b2 +#define s_net S_un.S_un_b.s_b1 +#define s_imp S_un.S_un_w.s_w2 +#define s_impno S_un.S_un_b.s_b4 +#define s_lh S_un.S_un_b.s_b3 +}; + +/* + Definitions of bits in internet address integers. + NOTE: On subnets the decomposition of addresses to host and + net parts is done according to subnet mask, not the masks here. + */ +#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0) +#define IN_CLASSA_NET 0xff000000 +#define IN_CLASSA_NSHIFT 24 +#define IN_CLASSA_HOST 0x00ffffff +#define IN_CLASSA_MAX 128 + +#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000) +#define IN_CLASSB_NET 0xffff0000 +#define IN_CLASSB_NSHIFT 16 +#define IN_CLASSB_HOST 0x0000ffff +#define IN_CLASSB_MAX 65536 + +#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000) +#define IN_CLASSC_NET 0xffffff00 +#define IN_CLASSC_NSHIFT 8 +#define IN_CLASSC_HOST 0x000000ff + +#define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000) +#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ +#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ +#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ +#define IN_MULTICAST(i) IN_CLASSD(i) + +#define ADDR_ANY INADDR_ANY + + +struct timeval { + LONG tv_sec; + LONG tv_usec; +}; + + +struct sockaddr { + USHORT sa_family; + CHAR sa_data[14]; +}; + + +struct linger { + USHORT l_onoff; + USHORT l_linger; +}; + + +/* IP specific */ + +struct sockaddr_in { + SHORT sin_family; + USHORT sin_port; + struct in_addr sin_addr; + CHAR sin_zero[8]; +}; + +#define INADDR_ANY ((ULONG)0x00000000) +#define INADDR_LOOPBACK ((ULONG)0x7f000001) +#define INADDR_BROADCAST ((ULONG)0xffffffff) +#define INADDR_NONE ((ULONG)0xffffffff) + +#define IPPROTO_IP 0 +#define IPPROTO_ICMP 1 +#define IPPROTO_IGMP 2 +#define IPPROTO_GGP 3 +#define IPPROTO_TCP 6 +#define IPPROTO_PUP 12 +#define IPPROTO_UDP 17 +#define IPPROTO_IDP 22 +#define IPPROTO_ND 77 +#define IPPROTO_RAW 255 +#define IPPROTO_MAX 256 + + +#ifndef FD_SETSIZE +#define FD_SETSIZE 64 +#endif /* FD_SETSIZE */ + +typedef struct fd_set { + UINT fd_count; + SOCKET fd_array[FD_SETSIZE]; +} fd_set; + +extern INT PASCAL FAR __WSAFDIsSet(SOCKET, fd_set FAR*); + +#define FD_CLR(s, set) do { \ + UINT __i; \ + for (__i = 0; __i < ((fd_set FAR*)(set))->fd_count; __i++) { \ + if (((fd_set FAR*)(set))->fd_array[__i] == s) { \ + while (__i < ((fd_set FAR*)(set))->fd_count - 1) { \ + ((fd_set FAR *)(set))->fd_array[__i] = \ + ((fd_set FAR*)(set))->fd_array[__i+1]; \ + __i++; \ + } \ + ((fd_set FAR *)(set))->fd_count--; \ + break; \ + } \ + } \ +} while(0) + +#define FD_SET(s, set) do { \ + UINT __i; \ + for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count; __i++) { \ + if (((fd_set FAR *)(set))->fd_array[__i] == (s)) { \ + break; \ + } \ + } \ + if (__i == ((fd_set FAR *)(set))->fd_count) { \ + if (((fd_set FAR*)(set))->fd_count < FD_SETSIZE) { \ + ((fd_set FAR*)(set))->fd_array[__i] = (s); \ + ((fd_set FAR*)(set))->fd_count++; \ + } \ + } \ +} while(0) + +#define FD_ISSET(s, set) __WSAFDIsSet((SOCKET)(s), (fd_set FAR*)(set)) + +#define FD_ZERO(set) (((fd_set FAR*)(set))->fd_count = 0) + + +typedef struct _WSAOVERLAPPED { + DWORD Internal; // reserved + DWORD InternalHigh; // reserved + DWORD Offset; // reserved + DWORD OffsetHigh; // reserved + WSAEVENT hEvent; +} WSAOVERLAPPED, FAR* LPWSAOVERLAPPED; + + +typedef struct __WSABUF { + ULONG len; // buffer length + CHAR FAR* buf; // pointer to buffer +} WSABUF, FAR* LPWSABUF; + + +typedef ULONG SERVICETYPE; + +#define SERVICETYPE_NOTRAFFIC 0x00000000 +#define SERVICETYPE_BESTEFFORT 0x00000001 +#define SERVICETYPE_CONTROLLEDLOAD 0x00000002 +#define SERVICETYPE_GUARANTEED 0x00000003 +#define SERVICETYPE_NETWORK_UNAVAILABLE 0x00000004 +#define SERVICETYPE_GENERAL_INFORMATION 0x00000005 +#define SERVICETYPE_NOCHANGE 0x00000006 +#define SERVICE_IMMEDIATE_TRAFFIC_CONTROL 0x00000007 + +typedef struct _flowspec { + ULONG TokenRate; /* In Bytes/sec */ + ULONG TokenBucketSize; /* In Bytes */ + ULONG PeakBandwidth; /* In Bytes/sec */ + ULONG Latency; /* In microseconds */ + ULONG DelayVariation; /* In microseconds */ + SERVICETYPE ServiceType; + ULONG MaxSduSize; /* In Bytes */ + ULONG MinimumPolicedSize; /* In Bytes */ +} FLOWSPEC, *PFLOWSPEC, FAR* LPFLOWSPEC; + + +typedef struct _QualityOfService { + FLOWSPEC SendingFlowspec; /* The flow spec for data sending */ + FLOWSPEC ReceivingFlowspec; /* The flow spec for data receiving */ + WSABUF ProviderSpecific; /* Additional provider specific stuff */ +} QOS, FAR* LPQOS; + + + +typedef struct _WSANETWORKEVENTS { + LONG lNetworkEvents; + INT iErrorCode[FD_MAX_EVENTS]; +} WSANETWORKEVENTS, FAR* LPWSANETWORKEVENTS; + + +#define MAX_PROTOCOL_CHAIN 7 + +#define BASE_PROTOCOL 1 +#define LAYERED_PROTOCOL 0 + +typedef struct _WSAPROTOCOLCHAIN { + INT ChainLen; + DWORD ChainEntries[MAX_PROTOCOL_CHAIN]; +} WSAPROTOCOLCHAIN, FAR* LPWSAPROTOCOLCHAIN; + +#define WSAPROTOCOL_LEN 255 + +typedef struct _WSAPROTOCOL_INFOA { + DWORD dwServiceFlags1; + DWORD dwServiceFlags2; + DWORD dwServiceFlags3; + DWORD dwServiceFlags4; + DWORD dwProviderFlags; + GUID ProviderId; + DWORD dwCatalogEntryId; + WSAPROTOCOLCHAIN ProtocolChain; + INT iVersion; + INT iAddressFamily; + INT iMaxSockAddr; + INT iMinSockAddr; + INT iSocketType; + INT iProtocol; + INT iProtocolMaxOffset; + INT iNetworkByteOrder; + INT iSecurityScheme; + DWORD dwMessageSize; + DWORD dwProviderReserved; + CHAR szProtocol[WSAPROTOCOL_LEN + 1]; +} WSAPROTOCOL_INFOA, FAR* LPWSAPROTOCOL_INFOA; + +typedef struct _WSAPROTOCOL_INFOW { + DWORD dwServiceFlags1; + DWORD dwServiceFlags2; + DWORD dwServiceFlags3; + DWORD dwServiceFlags4; + DWORD dwProviderFlags; + GUID ProviderId; + DWORD dwCatalogEntryId; + WSAPROTOCOLCHAIN ProtocolChain; + INT iVersion; + INT iAddressFamily; + INT iMaxSockAddr; + INT iMinSockAddr; + INT iSocketType; + INT iProtocol; + INT iProtocolMaxOffset; + INT iNetworkByteOrder; + INT iSecurityScheme; + DWORD dwMessageSize; + DWORD dwProviderReserved; + WCHAR szProtocol[WSAPROTOCOL_LEN + 1]; +} WSAPROTOCOL_INFOW, FAR * LPWSAPROTOCOL_INFOW; + +#ifdef UNICODE +typedef WSAPROTOCOL_INFOW WSAPROTOCOL_INFO; +typedef LPWSAPROTOCOL_INFOW LPWSAPROTOCOL_INFO; +#else /* UNICODE */ +typedef WSAPROTOCOL_INFOA WSAPROTOCOL_INFO; +typedef LPWSAPROTOCOL_INFOA LPWSAPROTOCOL_INFO; +#endif /* UNICODE */ + + +/* WinSock 2 extended commands for WSAIoctl() */ + +#define IOC_UNIX 0x00000000 +#define IOC_WS2 0x08000000 +#define IOC_FAMILY 0x10000000 +#define IOC_VENDOR 0x18000000 + +#define _WSAIO (x,y) (IOC_VOID | (x) | (y)) +#define _WSAIOR (x,y) (IOC_OUT | (x) | (y)) +#define _WSAIOW (x,y) (IOC_IN | (x) | (y)) +#define _WSAIORW(x,y) (IOC_INOUT| (x) | (y)) + +#define SIO_ASSOCIATE_HANDLE _WSAIOW (IOC_WS2, 1) +#define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO (IOC_WS2, 2) +#define SIO_FIND_ROUTE _WSAIOR (IOC_WS2, 3) +#define SIO_FLUSH _WSAIO (IOC_WS2, 4) +#define SIO_GET_BROADCAST_ADDRESS -WSAIOR (IOC_WS2, 5) +#define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(IOC_WS2, 6) +#define SIO_GET_QOS _WSAIORW(IOC_WS2, 7) +#define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2, 8) +#define SIO_MULTIPOINT_LOOPBACK _WSAIOW (IOC_WS2, 9) +#define SIO_MULTICAST_SCOPE _WSAIOW (IOC_WS2, 10) +#define SIO_SET_QOS _WSAIOW (IOC_WS2, 11) +#define SIO_SET_GROUP_QOS _WSAIOW (IOC_WS2, 12) +#define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2, 13) +#define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2, 20) +#define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW (IOC_WS2, 21) +#define SIO_ADDRESS_LIST_QUERY _WSAIOR (IOC_WS2, 22) +#define SIO_ADDRESS_LIST_CHANGE _WSAIO (IOC_WS2, 23) +#define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR (IOC_W32, 24) + + +/* Structures for WinSock 1.1 compatible namespace resolution */ + +struct hostent { + CHAR FAR* h_name; + CHAR FAR* FAR* h_aliases; + SHORT h_addrtype; + SHORT h_length; + CHAR FAR* FAR* h_addr_list; +#define h_addr h_addr_list[0] /* Backward compatible field name */ +}; + +struct protoent { + CHAR FAR* p_name; + CHAR FAR* FAR* p_aliases; + SHORT p_proto; +}; + +struct servent { + CHAR FAR* s_name; + CHAR FAR* FAR* s_aliases; + SHORT s_port; + CHAR FAR* s_proto; +}; + +// It is assumed here that a network number fits in 32 bits. +struct netent { + CHAR FAR* n_name; // official net name + CHAR FAR* FAR* n_aliases; // list of alias's + SHORT n_addrtype; // network address type id + ULONG n_net; // network number +}; + + +typedef UINT GROUP; + +typedef +INT +(CALLBACK * LPCONDITIONPROC)( + LPWSABUF lpCallerId, + LPWSABUF lpCallerData, + LPQOS lpSQOS, + LPQOS lpGQOS, + LPWSABUF lpCalleeId, + LPWSABUF lpCalleeData, + GROUP FAR* g, + DWORD dwCallbackData); + +typedef +VOID +(CALLBACK* LPWSAOVERLAPPED_COMPLETION_ROUTINE)( + DWORD dwError, + DWORD cbTransferred, + LPWSAOVERLAPPED lpOverlapped, + DWORD dwFlags); + + +/* Microsoft Windows extended data types */ + +typedef struct sockaddr SOCKADDR; +typedef struct sockaddr *PSOCKADDR; +typedef struct sockaddr FAR *LPSOCKADDR; + +typedef struct sockaddr_in SOCKADDR_IN; +typedef struct sockaddr_in *PSOCKADDR_IN; +typedef struct sockaddr_in FAR *LPSOCKADDR_IN; + +typedef struct linger LINGER; +typedef struct linger *PLINGER; +typedef struct linger FAR *LPLINGER; + +typedef struct in_addr IN_ADDR; +typedef struct in_addr *PIN_ADDR; +typedef struct in_addr FAR *LPIN_ADDR; + +typedef struct fd_set FD_SET; +typedef struct fd_set *PFD_SET; +typedef struct fd_set FAR *LPFD_SET; + +typedef struct hostent HOSTENT; +typedef struct hostent *PHOSTENT; +typedef struct hostent FAR *LPHOSTENT; + +typedef struct servent SERVENT; +typedef struct servent *PSERVENT; +typedef struct servent FAR *LPSERVENT; + +typedef struct protoent PROTOENT; +typedef struct protoent *PPROTOENT; +typedef struct protoent FAR *LPPROTOENT; + +typedef struct timeval TIMEVAL; +typedef struct timeval *PTIMEVAL; +typedef struct timeval FAR *LPTIMEVAL; + +#define WSAMAKEASYNCREPLY(buflen,error) MAKELONG(buflen,error) +#define WSAMAKESELECTREPLY(event,error) MAKELONG(event,error) +#define WSAGETASYNCBUFLEN(lParam) LOWORD(lParam) +#define WSAGETASYNCERROR(lParam) HIWORD(lParam) +#define WSAGETSELECTEVENT(lParam) LOWORD(lParam) +#define WSAGETSELECTERROR(lParam) HIWORD(lParam) + + +#define WSADESCRIPTION_LEN 256 +#define WSASYS_STATUS_LEN 128 + +typedef struct WSAData { + WORD wVersion; + WORD wHighVersion; + CHAR szDescription[WSADESCRIPTION_LEN + 1]; + CHAR szSystemStatus[WSASYS_STATUS_LEN + 1]; + USHORT iMaxSockets; + USHORT iMaxUdpDg; + CHAR FAR* lpVendorInfo; +} WSADATA, FAR* LPWSADATA; + +#if 0 +typedef struct _BLOB { + ULONG cbSize; + BYTE *pBlobData; +} BLOB, *LPBLOB; +#endif +typedef BLOB *LPBLOB; + +typedef struct _SOCKET_ADDRESS { + LPSOCKADDR lpSockaddr; + INT iSockaddrLength; +} SOCKET_ADDRESS, *PSOCKET_ADDRESS, FAR* LPSOCKET_ADDRESS; + +typedef struct _SOCKET_ADDRESS_LIST { + INT iAddressCount; + SOCKET_ADDRESS Address[1]; +} SOCKET_ADDRESS_LIST, FAR* LPSOCKET_ADDRESS_LIST; + +typedef struct _CSADDR_INFO { + SOCKET_ADDRESS LocalAddr; + SOCKET_ADDRESS RemoteAddr; + INT iSocketType; + INT iProtocol; +} CSADDR_INFO, *PCSADDR_INFO, FAR* LPCSADDR_INFO; + + +/* Structures for namespace resolution */ + +typedef struct _WSANAMESPACE_INFOA { + GUID NSProviderId; + DWORD dwNameSpace; + BOOL fActive; + DWORD dwVersion; + LPSTR lpszIdentifier; +} WSANAMESPACE_INFOA, *PWSANAMESPACE_INFOA, *LPWSANAMESPACE_INFOA; + +typedef struct _WSANAMESPACE_INFOW { + GUID NSProviderId; + DWORD dwNameSpace; + BOOL fActive; + DWORD dwVersion; + LPWSTR lpszIdentifier; +} WSANAMESPACE_INFOW, *PWSANAMESPACE_INFOW, *LPWSANAMESPACE_INFOW; + +#ifdef UNICODE +typedef WSANAMESPACE_INFOW WSANAMESPACE_INFO; +typedef PWSANAMESPACE_INFOW PWSANAMESPACE_INFO; +typedef LPWSANAMESPACE_INFOW LPWSANAMESPACE_INFO; +#else /* UNICODE */ +typedef WSANAMESPACE_INFOA WSANAMESPACE_INFO; +typedef PWSANAMESPACE_INFOA PWSANAMESPACE_INFO; +typedef LPWSANAMESPACE_INFOA LPWSANAMESPACE_INFO; +#endif /* UNICODE */ + + +typedef enum _WSAEcomparator +{ + COMP_EQUAL = 0, + COMP_NOTLESS +} WSAECOMPARATOR, *PWSAECOMPARATOR, *LPWSAECOMPARATOR; + +typedef struct _WSAVersion +{ + DWORD dwVersion; + WSAECOMPARATOR ecHow; +}WSAVERSION, *PWSAVERSION, *LPWSAVERSION; + + +typedef struct _AFPROTOCOLS { + INT iAddressFamily; + INT iProtocol; +} AFPROTOCOLS, *PAFPROTOCOLS, *LPAFPROTOCOLS; + + +typedef struct _WSAQuerySetA { + DWORD dwSize; + LPSTR lpszServiceInstanceName; + LPGUID lpServiceClassId; + LPWSAVERSION lpVersion; + LPSTR lpszComment; + DWORD dwNameSpace; + LPGUID lpNSProviderId; + LPSTR lpszContext; + DWORD dwNumberOfProtocols; + LPAFPROTOCOLS lpafpProtocols; + LPSTR lpszQueryString; + DWORD dwNumberOfCsAddrs; + LPCSADDR_INFO lpcsaBuffer; + DWORD dwOutputFlags; + LPBLOB lpBlob; +} WSAQUERYSETA, *PWSAQUERYSETA, *LPWSAQUERYSETA; + +typedef struct _WSAQuerySetW { + DWORD dwSize; + LPWSTR lpszServiceInstanceName; + LPGUID lpServiceClassId; + LPWSAVERSION lpVersion; + LPWSTR lpszComment; + DWORD dwNameSpace; + LPGUID lpNSProviderId; + LPWSTR lpszContext; + DWORD dwNumberOfProtocols; + LPAFPROTOCOLS lpafpProtocols; + LPWSTR lpszQueryString; + DWORD dwNumberOfCsAddrs; + LPCSADDR_INFO lpcsaBuffer; + DWORD dwOutputFlags; + LPBLOB lpBlob; +} WSAQUERYSETW, *PWSAQUERYSETW, *LPWSAQUERYSETW; + +#ifdef UNICODE +typedef WSAQUERYSETW WSAQUERYSET; +typedef PWSAQUERYSETW PWSAQUERYSET; +typedef LPWSAQUERYSETW LPWSAQUERYSET; +#else /* UNICODE */ +typedef WSAQUERYSETA WSAQUERYSET; +typedef PWSAQUERYSETA PWSAQUERYSET; +typedef LPWSAQUERYSETA LPWSAQUERYSET; +#endif /* UNICODE */ + + +typedef enum _WSAESETSERVICEOP { + RNRSERVICE_REGISTER = 0, + RNRSERVICE_DEREGISTER, + RNRSERVICE_DELETE +} WSAESETSERVICEOP, *PWSAESETSERVICEOP, *LPWSAESETSERVICEOP; + + +typedef struct _WSANSClassInfoA { + LPSTR lpszName; + DWORD dwNameSpace; + DWORD dwValueType; + DWORD dwValueSize; + LPVOID lpValue; +} WSANSCLASSINFOA, *PWSANSCLASSINFOA, *LPWSANSCLASSINFOA; + +typedef struct _WSANSClassInfoW { + LPWSTR lpszName; + DWORD dwNameSpace; + DWORD dwValueType; + DWORD dwValueSize; + LPVOID lpValue; +} WSANSCLASSINFOW, *PWSANSCLASSINFOW, *LPWSANSCLASSINFOW; + +#ifdef UNICODE +typedef WSANSCLASSINFOW WSANSCLASSINFO; +typedef PWSANSCLASSINFOW PWSANSCLASSINFO; +typedef LPWSANSCLASSINFOW LPWSANSCLASSINFO; +#else /* UNICODE */ +typedef WSANSCLASSINFOA WSANSCLASSINFO; +typedef PWSANSCLASSINFOA PWSANSCLASSINFO; +typedef LPWSANSCLASSINFOA LPWSANSCLASSINFO; +#endif /* UNICODE */ + +typedef struct _WSAServiceClassInfoA { + LPGUID lpServiceClassId; + LPSTR lpszServiceClassName; + DWORD dwCount; + LPWSANSCLASSINFOA lpClassInfos; +} WSASERVICECLASSINFOA, *PWSASERVICECLASSINFOA, *LPWSASERVICECLASSINFOA; + +typedef struct _WSAServiceClassInfoW { + LPGUID lpServiceClassId; + LPWSTR lpszServiceClassName; + DWORD dwCount; + LPWSANSCLASSINFOW lpClassInfos; +} WSASERVICECLASSINFOW, *PWSASERVICECLASSINFOW, *LPWSASERVICECLASSINFOW; + +#ifdef UNICODE +typedef WSASERVICECLASSINFOW WSASERVICECLASSINFO; +typedef PWSASERVICECLASSINFOW PWSASERVICECLASSINFO; +typedef LPWSASERVICECLASSINFOW LPWSASERVICECLASSINFO; +#else /* UNICODE */ +typedef WSASERVICECLASSINFOA WSASERVICECLASSINFO; +typedef PWSASERVICECLASSINFOA PWSASERVICECLASSINFO; +typedef LPWSASERVICECLASSINFOA LPWSASERVICECLASSINFO; +#endif /* UNICODE */ + + +/* WinSock 2 DLL prototypes */ + +SOCKET +WSAAPI +accept( + IN SOCKET s, + OUT LPSOCKADDR addr, + OUT INT FAR* addrlen); + +INT +WSAAPI +bind( + IN SOCKET s, + IN CONST LPSOCKADDR name, + IN INT namelen); + +INT +WSAAPI +closesocket( + IN SOCKET s); + +INT +WSAAPI +connect( + IN SOCKET s, + IN CONST LPSOCKADDR name, + IN INT namelen); + +INT +WSAAPI +getpeername( + IN SOCKET s, + OUT LPSOCKADDR name, + IN OUT INT FAR* namelen); + +INT +WSAAPI +getsockname( + IN SOCKET s, + OUT LPSOCKADDR name, + IN OUT INT FAR* namelen); + +INT +WSAAPI +getsockopt( + IN SOCKET s, + IN INT level, + IN INT optname, + OUT CHAR FAR* optval, + IN OUT INT FAR* optlen); + +ULONG +WSAAPI +htonl( + IN ULONG hostlong); + +USHORT +WSAAPI +htons( + IN USHORT hostshort); + +INT +WSAAPI +ioctlsocket( + IN SOCKET s, + IN LONG cmd, + IN OUT ULONG FAR* argp); + +INT +WSAAPI +listen( + IN SOCKET s, + IN INT backlog); + +ULONG +WSAAPI +ntohl( + IN ULONG netlong); + +USHORT +WSAAPI +ntohs( + IN USHORT netshort); + +INT +WSAAPI +recv( + IN SOCKET s, + OUT CHAR FAR* buf, + IN INT len, + IN INT flags); + +INT +WSAAPI +recvfrom( + IN SOCKET s, + OUT CHAR FAR* buf, + IN INT len, + IN INT flags, + OUT LPSOCKADDR from, + IN OUT INT FAR* fromlen); + +INT +WSAAPI +select( + IN INT nfds, + IN OUT LPFD_SET readfds, + IN OUT LPFD_SET writefds, + IN OUT LPFD_SET exceptfds, + IN CONST LPTIMEVAL timeout); + +INT +WSAAPI +send( + IN SOCKET s, + IN CONST CHAR FAR* buf, + IN INT len, + IN INT flags); + +INT +WSAAPI +sendto( + IN SOCKET s, + IN CONST CHAR FAR* buf, + IN INT len, + IN INT flags, + IN CONST LPSOCKADDR to, + IN INT tolen); + +INT +WSAAPI +setsockopt( + IN SOCKET s, + IN INT level, + IN INT optname, + IN CONST CHAR FAR* optval, + IN INT optlen); + +INT +WSAAPI +shutdown( + IN SOCKET s, + IN INT how); + +SOCKET +WSAAPI +socket( + IN INT af, + IN INT type, + IN INT protocol); + +SOCKET +WSAAPI +WSAAccept( + IN SOCKET s, + OUT LPSOCKADDR addr, + IN OUT LPINT addrlen, + IN LPCONDITIONPROC lpfnCondition, + IN DWORD dwCallbackData); + +INT +WSAAPI +WSAAsyncSelect( + IN SOCKET s, + IN HWND hWnd, + IN UINT wMsg, + IN LONG lEvent); + +INT +WSAAPI +WSACancelBlockingCall(VOID); + +INT +WSAAPI +WSACleanup(VOID); + +BOOL +WSAAPI +WSACloseEvent( + IN WSAEVENT hEvent); + +INT +WSAAPI +WSAConnect( + IN SOCKET s, + IN CONST LPSOCKADDR name, + IN INT namelen, + IN LPWSABUF lpCallerData, + OUT LPWSABUF lpCalleeData, + IN LPQOS lpSQOS, + IN LPQOS lpGQOS); + +WSAEVENT +WSAAPI +WSACreateEvent(VOID); + +INT +WSAAPI +WSADuplicateSocketA( + IN SOCKET s, + IN DWORD dwProcessId, + OUT LPWSAPROTOCOL_INFOA lpProtocolInfo); + +INT +WSAAPI +WSADuplicateSocketW( + IN SOCKET s, + IN DWORD dwProcessId, + OUT LPWSAPROTOCOL_INFOW lpProtocolInfo); + +#ifdef UNICODE +#define WSADuplicateSocket WSADuplicateSocketA +#else /* UNICODE */ +#define WSADuplicateSocket WSADuplicateSocketW +#endif /* UNICODE */ + +INT +WSAAPI +WSAEnumNetworkEvents( + IN SOCKET s, + IN WSAEVENT hEventObject, + OUT LPWSANETWORKEVENTS lpNetworkEvents); + +INT +WSAAPI +WSAEnumProtocolsA( + IN LPINT lpiProtocols, + OUT LPWSAPROTOCOL_INFOA lpProtocolBuffer, + IN OUT LPDWORD lpdwBufferLength); + +INT +WSAAPI +WSAEnumProtocolsW( + IN LPINT lpiProtocols, + OUT LPWSAPROTOCOL_INFOW lpProtocolBuffer, + IN OUT LPDWORD lpdwBufferLength); + +#ifdef UNICODE +#define WSAEnumProtocols WSAEnumProtocolsA +#else /* UNICODE */ +#define WSAEnumProtocols WSAEnumProtocolsW +#endif /* UNICODE */ + +INT +WSAAPI +WSAEventSelect( + IN SOCKET s, + IN WSAEVENT hEventObject, + IN LONG lNetworkEvents); + +INT +WSAAPI +WSAGetLastError(VOID); + +BOOL +WSAAPI +WSAGetOverlappedResult( + IN SOCKET s, + IN LPWSAOVERLAPPED lpOverlapped, + OUT LPDWORD lpcbTransfer, + IN BOOL fWait, + OUT LPDWORD lpdwFlags); + +BOOL +WSAAPI +WSAGetQOSByName( + IN SOCKET s, + IN OUT LPWSABUF lpQOSName, + OUT LPQOS lpQOS); + +INT +WSAAPI +WSAHtonl( + IN SOCKET s, + IN ULONG hostlong, + OUT ULONG FAR* lpnetlong); + +INT +WSAAPI +WSAHtons( + IN SOCKET s, + IN USHORT hostshort, + OUT USHORT FAR* lpnetshort); + +INT +WSAAPI +WSAIoctl( + IN SOCKET s, + IN DWORD dwIoControlCode, + IN LPVOID lpvInBuffer, + IN DWORD cbInBuffer, + OUT LPVOID lpvOutBuffer, + IN DWORD cbOutBuffer, + OUT LPDWORD lpcbBytesReturned, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); + +BOOL +WSAAPI +WSAIsBlocking(VOID); + +SOCKET +WSAAPI +WSAJoinLeaf( + IN SOCKET s, + IN CONST LPSOCKADDR name, + IN INT namelen, + IN LPWSABUF lpCallerData, + OUT LPWSABUF lpCalleeData, + IN LPQOS lpSQOS, + IN LPQOS lpGQOS, + IN DWORD dwFlags); + +INT +WSAAPI +WSANtohl( + IN SOCKET s, + IN ULONG netlong, + OUT ULONG FAR* lphostlong); + +INT +WSAAPI +WSANtohs( + IN SOCKET s, + IN USHORT netshort, + OUT USHORT FAR* lphostshort); + +INT +WSAAPI +WSARecv( + IN SOCKET s, + IN OUT LPWSABUF lpBuffers, + IN DWORD dwBufferCount, + OUT LPDWORD lpNumberOfBytesRecvd, + IN OUT LPDWORD lpFlags, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); + +INT +WSAAPI +WSARecvDisconnect( + IN SOCKET s, + OUT LPWSABUF lpInboundDisconnectData); + +INT +WSAAPI +WSARecvFrom( + IN SOCKET s, + IN OUT LPWSABUF lpBuffers, + IN DWORD dwBufferCount, + OUT LPDWORD lpNumberOfBytesRecvd, + IN OUT LPDWORD lpFlags, + OUT LPSOCKADDR lpFrom, + IN OUT LPINT lpFromlen, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); + +BOOL +WSAAPI +WSAResetEvent( + IN WSAEVENT hEvent); + +INT +WSAAPI +WSASend( + IN SOCKET s, + IN LPWSABUF lpBuffers, + IN DWORD dwBufferCount, + OUT LPDWORD lpNumberOfBytesSent, + IN DWORD dwFlags, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); + +INT +WSAAPI +WSASendDisconnect( + IN SOCKET s, + IN LPWSABUF lpOutboundDisconnectData); + +INT +WSAAPI +WSASendTo( + IN SOCKET s, + IN LPWSABUF lpBuffers, + IN DWORD dwBufferCount, + OUT LPDWORD lpNumberOfBytesSent, + IN DWORD dwFlags, + IN CONST LPSOCKADDR lpTo, + IN INT iToLen, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); + +FARPROC +WSAAPI +WSASetBlockingHook( + IN FARPROC lpBlockFunc); + +BOOL +WSAAPI +WSASetEvent( + IN WSAEVENT hEvent); + +VOID +WSAAPI +WSASetLastError( + IN INT iError); + +SOCKET +WSAAPI +WSASocketA( + IN INT af, + IN INT type, + IN INT protocol, + IN LPWSAPROTOCOL_INFOA lpProtocolInfo, + IN GROUP g, + IN DWORD dwFlags); + +SOCKET +WSAAPI +WSASocketW( + IN INT af, + IN INT type, + IN INT protocol, + IN LPWSAPROTOCOL_INFOW lpProtocolInfo, + IN GROUP g, + IN DWORD dwFlags); + +#ifdef UNICODE +#define WSASocket WSASocketW +#else /* UNICODE */ +#define WSASocket WSASocketA +#endif /* UNICODE */ + +INT +WSAAPI +WSAStartup( + IN WORD wVersionRequested, + OUT LPWSADATA lpWSAData); + +INT +WSAAPI +WSAUnhookBlockingHook(VOID); + +DWORD +WSAAPI +WSAWaitForMultipleEvents( + IN DWORD cEvents, + IN CONST WSAEVENT FAR* lphEvents, + IN BOOL fWaitAll, + IN DWORD dwTimeout, + IN BOOL fAlertable); + +INT +WSAAPI +WSAProviderConfigChange( + IN OUT LPHANDLE lpNotificationHandle, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); + +/* Name resolution APIs */ + +INT +WSAAPI +WSAAddressToStringA( + IN LPSOCKADDR lpsaAddress, + IN DWORD dwAddressLength, + IN LPWSAPROTOCOL_INFOA lpProtocolInfo, + OUT LPSTR lpszAddressString, + IN OUT LPDWORD lpdwAddressStringLength); + +INT +WSAAPI +WSAAddressToStringW( + IN LPSOCKADDR lpsaAddress, + IN DWORD dwAddressLength, + IN LPWSAPROTOCOL_INFOW lpProtocolInfo, + OUT LPWSTR lpszAddressString, + IN OUT LPDWORD lpdwAddressStringLength); + +#ifdef UNICODE +#define WSAAddressToString WSAAddressToStringW +#else /* UNICODE */ +#define WSAAddressToString WSAAddressToStringA +#endif /* UNICODE */ + +INT +WSAAPI +WSAEnumNameSpaceProvidersA( + IN OUT LPDWORD lpdwBufferLength, + OUT LPWSANAMESPACE_INFOA lpnspBuffer); + +INT +WSAAPI +WSAEnumNameSpaceProvidersW( + IN OUT LPDWORD lpdwBufferLength, + OUT LPWSANAMESPACE_INFOW lpnspBuffer); + +#ifdef UNICODE +#define WSAEnumNameSpaceProviders WSAEnumNameSpaceProvidersW +#else /* UNICODE */ +#define WSAEnumNameSpaceProviders WSAEnumNameSpaceProvidersA +#endif /* UNICODE */ + +INT +WSAAPI +WSAGetServiceClassInfoA( + IN LPGUID lpProviderId, + IN LPGUID lpServiceClassId, + IN OUT LPDWORD lpdwBufferLength, + OUT LPWSASERVICECLASSINFOA lpServiceClassInfo); + +INT +WSAAPI +WSAGetServiceClassInfoW( + IN LPGUID lpProviderId, + IN LPGUID lpServiceClassId, + IN OUT LPDWORD lpdwBufferLength, + OUT LPWSASERVICECLASSINFOW lpServiceClassInfo); + +#ifdef UNICODE +#define WSAGetServiceClassInfo WSAGetServiceClassInfoW +#else /* UNICODE */ +#define WSAGetServiceClassInfo WSAGetServiceClassInfoA +#endif /* UNICODE */ + +INT +WSAAPI +WSAGetServiceClassNameByClassIdA( + IN LPGUID lpServiceClassId, + OUT LPSTR lpszServiceClassName, + IN OUT LPDWORD lpdwBufferLength); + +INT +WSAAPI +WSAGetServiceClassNameByClassIdW( + IN LPGUID lpServiceClassId, + OUT LPWSTR lpszServiceClassName, + IN OUT LPDWORD lpdwBufferLength); + +#ifdef UNICODE +#define WSAGetServiceClassNameByClassId WSAGetServiceClassNameByClassIdW +#else /* UNICODE */ +#define WSAGetServiceClassNameByClassId WSAGetServiceClassNameByClassIdA +#endif /* UNICODE */ + +INT +WSAAPI +WSAInstallServiceClassA( + IN LPWSASERVICECLASSINFOA lpServiceClassInfo); + +INT +WSAAPI +WSAInstallServiceClassW( + IN LPWSASERVICECLASSINFOW lpServiceClassInfo); + +#ifdef UNICODE +#define WSAInstallServiceClass WSAInstallServiceClassW +#else /* UNICODE */ +#define WSAInstallServiceClass WSAInstallServiceClassA +#endif /* UNICODE */ + +INT +WSAAPI +WSALookupServiceBegin( + IN LPWSAQUERYSET lpqsRestrictions, + IN DWORD dwControlFlags, + OUT LPHANDLE lphLookup); + +INT +WSAAPI +WSALookupServiceEnd( + IN HANDLE hLookup); + +INT +WSAAPI +WSALookupServiceNext( + IN HANDLE hLookup, + IN DWORD dwControlFlags, + IN OUT LPDWORD lpdwBufferLength, + OUT LPWSAQUERYSET lpqsResults); + +INT +WSAAPI +WSARemoveServiceClass( + IN LPGUID lpServiceClassId); + +INT +WSAAPI +WSASetService( + IN LPWSAQUERYSET lpqsRegInfo, + IN WSAESETSERVICEOP essOperation, + IN DWORD dwControlFlags); + +INT +WSAAPI +WSAStringToAddressA( + IN LPSTR AddressString, + IN INT AddressFamily, + IN LPWSAPROTOCOL_INFOA lpProtocolInfo, + OUT LPSOCKADDR lpAddress, + IN OUT LPINT lpAddressLength); + +INT +WSAAPI +WSAStringToAddressW( + IN LPWSTR AddressString, + IN INT AddressFamily, + IN LPWSAPROTOCOL_INFOW lpProtocolInfo, + OUT LPSOCKADDR lpAddress, + IN OUT LPINT lpAddressLength); + +#ifdef UNICODE +#define WSAStringToAddress WSAStringToAddressW +#else /* UNICODE */ +#define WSAStringToAddress WSAStringToAddressA +#endif /* UNICODE */ + +/* WinSock 1.1 compatible name resolution APIs */ + +LPHOSTENT +WSAAPI +gethostbyaddr( + IN CONST CHAR FAR* addr, + IN INT len, + IN INT type); + +LPHOSTENT +WSAAPI +gethostbyname( + IN CONST CHAR FAR* name); + +INT +WSAAPI +gethostname( + OUT CHAR FAR* name, + IN INT namelen); + +LPPROTOENT +WSAAPI +getprotobyname( + IN CONST CHAR FAR* name); + +LPPROTOENT +WSAAPI +getprotobynumber( + IN INT number); + +LPSERVENT +WSAAPI +getservbyname( + IN CONST CHAR FAR* name, + IN CONST CHAR FAR* proto); + +LPSERVENT +WSAAPI +getservbyport( + IN INT port, + IN CONST CHAR FAR* proto); + +ULONG +WSAAPI +inet_addr( + IN CONST CHAR FAR* cp); + +CHAR FAR* +WSAAPI +inet_ntoa( + IN IN_ADDR in); + +HANDLE +WSAAPI +WSAAsyncGetHostByAddr( + IN HWND hWnd, + IN UINT wMsg, + IN CONST CHAR FAR* addr, + IN INT len, + IN INT type, + OUT CHAR FAR* buf, + IN INT buflen); + +HANDLE +WSAAPI +WSAAsyncGetHostByName( + IN HWND hWnd, + IN UINT wMsg, + IN CONST CHAR FAR* name, + OUT CHAR FAR* buf, + IN INT buflen); + +HANDLE +WSAAPI +WSAAsyncGetProtoByName( + IN HWND hWnd, + IN UINT wMsg, + IN CONST CHAR FAR* name, + OUT CHAR FAR* buf, + IN INT buflen); + +HANDLE +WSAAPI +WSAAsyncGetProtoByNumber( + IN HWND hWnd, + IN UINT wMsg, + IN INT number, + OUT CHAR FAR* buf, + IN INT buflen); + +HANDLE +WSAAPI +WSAAsyncGetServByName( + IN HWND hWnd, + IN UINT wMsg, + IN CONST CHAR FAR* name, + IN CONST CHAR FAR* proto, + OUT CHAR FAR* buf, + IN INT buflen); + +HANDLE +WSAAPI +WSAAsyncGetServByPort( + IN HWND hWnd, + IN UINT wMsg, + IN INT port, + IN CONST CHAR FAR* proto, + OUT CHAR FAR* buf, + IN INT buflen); + +INT +WSAAPI +WSACancelAsyncRequest( + IN HANDLE hAsyncTaskHandle); + +#ifdef __cplusplus +}; +#endif /* __cplusplus */ + +#endif /* __WINSOCK2_H */ + +/* EOF */ diff --git a/reactos/include/ws2spi.h b/reactos/include/ws2spi.h new file mode 100644 index 00000000000..1523de3f5f5 --- /dev/null +++ b/reactos/include/ws2spi.h @@ -0,0 +1,566 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Winsock 2 DLL + * FILE: include/ws2spi.h + * PURPOSE: Header file for the WinSock 2 DLL + * and WinSock 2 Service Providers + */ +#ifndef __WS2SPI_H +#define __WS2SPI_H + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#define WSPAPI WSAAPI + + +#define WSPDESCRIPTION_LEN 255 + +typedef struct WSPData { + WORD wVersion; + WORD wHighVersion; + WCHAR szDescription[WSPDESCRIPTION_LEN + 1]; +} WSPDATA, FAR * LPWSPDATA; + + +typedef struct _WSATHREADID { + HANDLE ThreadHandle; + DWORD Reserved; +} WSATHREADID, FAR* LPWSATHREADID; + + +typedef BOOL (CALLBACK FAR* LPBLOCKINGCALLBACK)( + DWORD dwContext); + +typedef VOID (CALLBACK FAR* LPWSAUSERAPC)( + DWORD dwContext); + + +/* Prototypes for service provider procedure table */ + +typedef SOCKET (WSPAPI * LPWSPACCEPT)( + IN SOCKET s, + OUT LPSOCKADDR addr, + IN OUT LPINT addrlen, + IN LPCONDITIONPROC lpfnCondition, + IN DWORD dwCallbackData, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPADDRESSTOSTRING)( + IN LPSOCKADDR lpsaAddress, + IN DWORD dwAddressLength, + IN LPWSAPROTOCOL_INFOW lpProtocolInfo, + OUT LPWSTR lpszAddressString, + IN OUT LPDWORD lpdwAddressStringLength, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPASYNCSELECT)( + IN SOCKET s, + IN HWND hWnd, + IN UINT wMsg, + IN LONG lEvent, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPBIND)( + IN SOCKET s, + IN CONST LPSOCKADDR name, + IN INT namelen, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPCANCELBLOCKINGCALL)( + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPCLEANUP)( + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPCLOSESOCKET)( + IN SOCKET s, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPCONNECT)( + IN SOCKET s, + IN CONST LPSOCKADDR name, + IN INT namelen, + IN LPWSABUF lpCallerData, + OUT LPWSABUF lpCalleeData, + IN LPQOS lpSQOS, + IN LPQOS lpGQOS, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPDUPLICATESOCKET)( + IN SOCKET s, + IN DWORD dwProcessId, + OUT LPWSAPROTOCOL_INFOW lpProtocolInfo, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPENUMNETWORKEVENTS)( + IN SOCKET s, + IN WSAEVENT hEventObject, + OUT LPWSANETWORKEVENTS lpNetworkEvents, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPEVENTSELECT)( + IN SOCKET s, + IN WSAEVENT hEventObject, + IN LONG lNetworkEvents, + OUT LPINT lpErrno); + +typedef BOOL (WSPAPI * LPWSPGETOVERLAPPEDRESULT)( + IN SOCKET s, + IN LPWSAOVERLAPPED lpOverlapped, + OUT LPDWORD lpcbTransfer, + IN BOOL fWait, + OUT LPDWORD lpdwFlags, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPGETPEERNAME)( + IN SOCKET s, + OUT LPSOCKADDR name, + IN OUT LPINT namelen, + OUT LPINT lpErrno); + +typedef BOOL (WSPAPI * LPWSPGETQOSBYNAME)( + IN SOCKET s, + IN OUT LPWSABUF lpQOSName, + OUT LPQOS lpQOS, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPGETSOCKNAME)( + IN SOCKET s, + OUT LPSOCKADDR name, + IN OUT LPINT namelen, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPGETSOCKOPT)( + IN SOCKET s, + IN INT level, + IN INT optname, + OUT CHAR FAR* optval, + IN OUT LPINT optlen, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPIOCTL)( + IN SOCKET s, + IN DWORD dwIoControlCode, + IN LPVOID lpvInBuffer, + IN DWORD cbInBuffer, + OUT LPVOID lpvOutBuffer, + IN DWORD cbOutBuffer, + OUT LPDWORD lpcbBytesReturned, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, + IN LPWSATHREADID lpThreadId, + OUT LPINT lpErrno); + +typedef SOCKET (WSPAPI * LPWSPJOINLEAF)( + IN SOCKET s, + IN CONST LPSOCKADDR name, + IN INT namelen, + IN LPWSABUF lpCallerData, + OUT LPWSABUF lpCalleeData, + IN LPQOS lpSQOS, + IN LPQOS lpGQOS, + IN DWORD dwFlags, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPLISTEN)( + IN SOCKET s, + IN INT backlog, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPRECV)( + IN SOCKET s, + IN OUT LPWSABUF lpBuffers, + IN DWORD dwBufferCount, + OUT LPDWORD lpNumberOfBytesRecvd, + IN OUT LPDWORD lpFlags, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, + IN LPWSATHREADID lpThreadId, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPRECVDISCONNECT)( + IN SOCKET s, + OUT LPWSABUF lpInboundDisconnectData, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPRECVFROM)( + IN SOCKET s, + IN OUT LPWSABUF lpBuffers, + IN DWORD dwBufferCount, + OUT LPDWORD lpNumberOfBytesRecvd, + IN OUT LPDWORD lpFlags, + OUT LPSOCKADDR lpFrom, + IN OUT LPINT lpFromlen, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, + IN LPWSATHREADID lpThreadId, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPSELECT)( + IN INT nfds, + IN OUT LPFD_SET readfds, + IN OUT LPFD_SET writefds, + IN OUT LPFD_SET exceptfds, + IN CONST LPTIMEVAL timeout, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPSEND)( + IN SOCKET s, + IN LPWSABUF lpBuffers, + IN DWORD dwBufferCount, + OUT LPDWORD lpNumberOfBytesSent, + IN DWORD dwFlags, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, + IN LPWSATHREADID lpThreadId, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPSENDDISCONNECT)( + IN SOCKET s, + IN LPWSABUF lpOutboundDisconnectData, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPSENDTO)( + IN SOCKET s, + IN LPWSABUF lpBuffers, + IN DWORD dwBufferCount, + OUT LPDWORD lpNumberOfBytesSent, + IN DWORD dwFlags, + IN CONST LPSOCKADDR lpTo, + IN INT iTolen, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, + IN LPWSATHREADID lpThreadId, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPSETSOCKOPT)( + IN SOCKET s, + IN INT level, + IN INT optname, + IN CONST CHAR FAR* optval, + IN INT optlen, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPSHUTDOWN)( + IN SOCKET s, + IN INT how, + OUT LPINT lpErrno); + +typedef SOCKET (WSPAPI * LPWSPSOCKET)( + IN INT af, + IN INT type, + IN INT protocol, + IN LPWSAPROTOCOL_INFOW lpProtocolInfo, + IN GROUP g, + IN DWORD dwFlags, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWSPSTRINGTOADDRESS)( + IN LPWSTR AddressString, + IN INT AddressFamily, + IN LPWSAPROTOCOL_INFOW lpProtocolInfo, + OUT LPSOCKADDR lpAddress, + IN OUT LPINT lpAddressLength, + OUT LPINT lpErrno); + + +/* Service provider procedure table */ +typedef struct _WSPPROC_TABLE { + LPWSPACCEPT lpWSPAccept; + LPWSPADDRESSTOSTRING lpWSPAddressToString; + LPWSPASYNCSELECT lpWSPAsyncSelect; + LPWSPBIND lpWSPBind; + LPWSPCANCELBLOCKINGCALL lpWSPCancelBlockingCall; + LPWSPCLEANUP lpWSPCleanup; + LPWSPCLOSESOCKET lpWSPCloseSocket; + LPWSPCONNECT lpWSPConnect; + LPWSPDUPLICATESOCKET lpWSPDuplicateSocket; + LPWSPENUMNETWORKEVENTS lpWSPEnumNetworkEvents; + LPWSPEVENTSELECT lpWSPEventSelect; + LPWSPGETOVERLAPPEDRESULT lpWSPGetOverlappedResult; + LPWSPGETPEERNAME lpWSPGetPeerName; + LPWSPGETSOCKNAME lpWSPGetSockName; + LPWSPGETSOCKOPT lpWSPGetSockOpt; + LPWSPGETQOSBYNAME lpWSPGetQOSByName; + LPWSPIOCTL lpWSPIoctl; + LPWSPJOINLEAF lpWSPJoinLeaf; + LPWSPLISTEN lpWSPListen; + LPWSPRECV lpWSPRecv; + LPWSPRECVDISCONNECT lpWSPRecvDisconnect; + LPWSPRECVFROM lpWSPRecvFrom; + LPWSPSELECT lpWSPSelect; + LPWSPSEND lpWSPSend; + LPWSPSENDDISCONNECT lpWSPSendDisconnect; + LPWSPSENDTO lpWSPSendTo; + LPWSPSETSOCKOPT lpWSPSetSockOpt; + LPWSPSHUTDOWN lpWSPShutdown; + LPWSPSOCKET lpWSPSocket; + LPWSPSTRINGTOADDRESS lpWSPStringToAddress; +} WSPPROC_TABLE, FAR* LPWSPPROC_TABLE; + + +/* Prototypes for service provider upcall procedure table */ + +typedef BOOL (WSPAPI * LPWPUCLOSEEVENT)( + IN WSAEVENT hEvent, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWPUCLOSESOCKETHANDLE)( + IN SOCKET s, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWPUCLOSETHREAD)( + IN LPWSATHREADID lpThreadId, + OUT LPINT lpErrno); + +typedef WSAEVENT (WSPAPI * LPWPUCREATEEVENT)( + OUT LPINT lpErrno); + +typedef SOCKET (WSPAPI * LPWPUCREATESOCKETHANDLE)( + IN DWORD dwCatalogEntryId, + IN DWORD dwContext, + OUT LPINT lpErrno); + +typedef SOCKET (WSPAPI * LPWPUFDISSET)( + IN SOCKET s, + IN LPFD_SET set); + +typedef INT (WSPAPI * LPWPUGETPROVIDERPATH)( + IN LPGUID lpProviderId, + OUT LPWSTR lpszProviderDllPath, + IN OUT LPINT lpProviderDllPathLen, + OUT LPINT lpErrno); + +typedef SOCKET (WSPAPI * LPWPUMODIFYIFSHANDLE)( + IN DWORD dwCatalogEntryId, + IN SOCKET ProposedHandle, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWPUOPENCURRENTTHREAD)( + OUT LPWSATHREADID lpThreadId, + OUT LPINT lpErrno); + +typedef BOOL (WSPAPI * LPWPUPOSTMESSAGE)( + IN HWND hWnd, + IN UINT Msg, + IN WPARAM wParam, + IN LPARAM lParam); + +typedef INT (WSPAPI * LPWPUQUERYBLOCKINGCALLBACK)( + IN DWORD dwCatalogEntryId, + OUT LPBLOCKINGCALLBACK FAR* lplpfnCallback, + OUT LPDWORD lpdwContext, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWPUQUERYSOCKETHANDLECONTEXT)( + IN SOCKET s, + OUT LPDWORD lpContext, + OUT LPINT lpErrno); + +typedef INT (WSPAPI * LPWPUQUEUEAPC)( + IN LPWSATHREADID lpThreadId, + IN LPWSAUSERAPC lpfnUserApc, + IN DWORD dwContext, + OUT LPINT lpErrno); + +typedef BOOL (WSPAPI * LPWPURESETEVENT)( + IN WSAEVENT hEvent, + OUT LPINT lpErrno); + +typedef BOOL (WSPAPI * LPWPUSETEVENT)( + IN WSAEVENT hEvent, + OUT LPINT lpErrno); + + +/* Available only directly from the DLL */ + +typedef INT (WSPAPI * LPWPUCOMPLETEOVERLAPPEDREQUEST)( + SOCKET s, + LPWSAOVERLAPPED lpOverlapped, + DWORD dwError, + DWORD cbTransferred, + LPINT lpErrno); + + +/* Service Provider upcall table */ + +typedef struct _WSPUPCALLTABLE { + LPWPUCLOSEEVENT lpWPUCloseEvent; + LPWPUCLOSESOCKETHANDLE lpWPUCloseSocketHandle; + LPWPUCREATEEVENT lpWPUCreateEvent; + LPWPUCREATESOCKETHANDLE lpWPUCreateSocketHandle; + LPWPUFDISSET lpWPUFDIsSet; + LPWPUGETPROVIDERPATH lpWPUGetProviderPath; + LPWPUMODIFYIFSHANDLE lpWPUModifyIFSHandle; + LPWPUPOSTMESSAGE lpWPUPostMessage; + LPWPUQUERYBLOCKINGCALLBACK lpWPUQueryBlockingCallback; + LPWPUQUERYSOCKETHANDLECONTEXT lpWPUQuerySocketHandleContext; + LPWPUQUEUEAPC lpWPUQueueApc; + LPWPURESETEVENT lpWPUResetEvent; + LPWPUSETEVENT lpWPUSetEvent; + LPWPUOPENCURRENTTHREAD lpWPUOpenCurrentThread; + LPWPUCLOSETHREAD lpWPUCloseThread; +} WSPUPCALLTABLE, FAR* LPWSPUPCALLTABLE; + + +typedef INT (WSPAPI * LPWSPSTARTUP)( + IN WORD wVersionRequested, + OUT LPWSPDATA lpWSPData, + IN LPWSAPROTOCOL_INFOW lpProtocolInfo, + IN WSPUPCALLTABLE UpcallTable, + OUT LPWSPPROC_TABLE lpProcTable); + + +/* Prototypes for service provider namespace procedure table */ + +typedef INT (WSPAPI * LPNSPCLEANUP)( + IN LPGUID lpProviderId); + +typedef INT (WSPAPI * LPNSPGETSERVICECLASSINFO)( + IN LPGUID lpProviderId, + IN OUT LPDWORD lpdwBufSize, + IN OUT LPWSASERVICECLASSINFOW lpServiceClassInfo); + +typedef INT (WSPAPI * LPNSPINSTALLSERVICECLASS)( + IN LPGUID lpProviderId, + IN LPWSASERVICECLASSINFOW lpServiceClassInfo); + +typedef INT (WSPAPI * LPNSPLOOKUPSERVICEBEGIN)( + IN LPGUID lpProviderId, + IN LPWSAQUERYSETW lpqsRestrictions, + IN LPWSASERVICECLASSINFOW lpServiceClassInfo, + IN DWORD dwControlFlags, + OUT LPHANDLE lphLookup); + +typedef INT (WSPAPI * LPNSPLOOKUPSERVICEEND)( + IN HANDLE hLookup); + +typedef INT (WSPAPI * LPNSPLOOKUPSERVICENEXT)( + IN HANDLE hLookup, + IN DWORD dwControlFlags, + IN OUT LPDWORD lpdwBufferLength, + OUT LPWSAQUERYSET lpqsResults); + +typedef INT (WSPAPI * LPNSPREMOVESERVICECLASS)( + IN LPGUID lpProviderId, + IN LPGUID lpServiceClassId); + +typedef INT (WSPAPI * LPNSPSETSERVICE)( + IN LPGUID lpProviderId, + IN LPWSASERVICECLASSINFOW lpServiceClassInfo, + IN LPWSAQUERYSETW lpqsRegInfo, + IN WSAESETSERVICEOP essOperation, + IN DWORD dwControlFlags); + + +typedef struct _NSP_ROUTINE { + DWORD cbSize; + DWORD dwMajorVersion; + DWORD dwMinorVersion; + LPNSPCLEANUP NSPCleanup; + LPNSPLOOKUPSERVICEBEGIN NSPLookupServiceBegin; + LPNSPLOOKUPSERVICENEXT NSPLookupServiceNext; + LPNSPLOOKUPSERVICEEND NSPLookupServiceEnd; + LPNSPSETSERVICE NSPSetService; + LPNSPINSTALLSERVICECLASS NSPInstallServiceClass; + LPNSPREMOVESERVICECLASS NSPRemoveServiceClass; + LPNSPGETSERVICECLASSINFO NSPGetServiceClassInfo; +} NSP_ROUTINE, *PNSP_ROUTINE, *LPNSP_ROUTINE; + + +INT +WSPAPI +NSPStartup( + IN LPGUID lpProviderId, + OUT LPNSP_ROUTINE lpNspRoutines); + + +/* WinSock 2 DLL function prototypes */ + +INT +WSPAPI +WPUCompleteOverlappedRequest( + IN SOCKET s, + IN LPWSAOVERLAPPED lpOverlapped, + IN DWORD dwError, + IN DWORD cbTransferred, + OUT LPINT lpErrno); + +INT +WSPAPI +WSPStartup( + IN WORD wVersionRequested, + OUT LPWSPDATA lpWSPData, + IN LPWSAPROTOCOL_INFOW lpProtocolInfo, + IN WSPUPCALLTABLE UpcallTable, + OUT LPWSPPROC_TABLE lpProcTable); + +INT +WSPAPI +WSCDeinstallProvider( + IN LPGUID lpProviderId, + OUT LPINT lpErrno); + +INT +WSPAPI +WSCEnumProtocols( + IN LPINT lpiProtocols, + OUT LPWSAPROTOCOL_INFOW lpProtocolBuffer, + IN OUT LPDWORD lpdwBufferLength, + OUT LPINT lpErrno); + +INT +WSPAPI +WSCGetProviderPath( + IN LPGUID lpProviderId, + OUT LPWSTR lpszProviderDllPath, + IN OUT LPINT lpProviderDllPathLen, + OUT LPINT lpErrno); + +INT +WSPAPI +WSCInstallProvider( + IN CONST LPGUID lpProviderId, + IN CONST LPWSTR lpszProviderDllPath, + IN CONST LPWSAPROTOCOL_INFOW lpProtocolInfoList, + IN DWORD dwNumberOfEntries, + OUT LPINT lpErrno); + +INT +WSPAPI +WSCEnableNSProvider( + IN LPGUID lpProviderId, + IN BOOL fEnable); + +INT +WSPAPI +WSCInstallNameSpace( + IN LPWSTR lpszIdentifier, + IN LPWSTR lpszPathName, + IN DWORD dwNameSpace, + IN DWORD dwVersion, + IN LPGUID lpProviderId); + +INT +WSPAPI +WSCUnInstallNameSpace( + IN LPGUID lpProviderId); + +INT +WSPAPI +WSCWriteProviderOrder( + IN LPDWORD lpwdCatalogEntryId, + IN DWORD dwNumberOfEntries); + +#ifdef __cplusplus +}; +#endif /* __cplusplus */ + +#endif /* __WS2SPI_H */ + +/* EOF */ diff --git a/reactos/include/wsahelp.h b/reactos/include/wsahelp.h new file mode 100644 index 00000000000..e1e1b4d4297 --- /dev/null +++ b/reactos/include/wsahelp.h @@ -0,0 +1,349 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Winsock 2 DLL + * FILE: include/wsahelp.h + * PURPOSE: Header file for the WinSock 2 DLL + * and WinSock 2 Helper DLLs + */ +#ifndef __WSAHELP_H +#define __WSAHELP_H + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#define WSH_NOTIFY_BIND 0x00000001 +#define WSH_NOTIFY_LISTEN 0x00000002 +#define WSH_NOTIFY_CONNECT 0x00000004 +#define WSH_NOTIFY_ACCEPT 0x00000008 +#define WSH_NOTIFY_SHUTDOWN_RECEIVE 0x00000010 +#define WSH_NOTIFY_SHUTDOWN_SEND 0x00000020 +#define WSH_NOTIFY_SHUTDOWN_ALL 0x00000040 +#define WSH_NOTIFY_CLOSE 0x00000080 +#define WSH_NOTIFY_CONNECT_ERROR 0x00000100 + +#define SOL_INTERNAL 0xFFFE + +#define SO_CONTEXT 1 + +typedef enum _SOCKADDR_ADDRESS_INFO { + SockaddrAddressInfoNormal, + SockaddrAddressInfoWildcard, + SockaddrAddressInfoBroadcast, + SockaddrAddressInfoLoopback +} SOCKADDR_ADDRESS_INFO, *PSOCKADDR_ADDRESS_INFO; + +typedef enum _SOCKADDR_ENDPOINT_INFO { + SockaddrEndpointInfoNormal, + SockaddrEndpointInfoWildcard, + SockaddrEndpointInfoReserved, +} SOCKADDR_ENDPOINT_INFO, *PSOCKADDR_ENDPOINT_INFO; + + +typedef struct _WINSOCK_MAPPING { + DWORD Rows; + DWORD Columns; + struct { + DWORD AddressFamily; + DWORD SocketType; + DWORD Protocol; + } Mapping[1]; +} WINSOCK_MAPPING, *PWINSOCK_MAPPING; + + +typedef struct _SOCKADDR_INFO { + SOCKADDR_ADDRESS_INFO AddressInfo; + SOCKADDR_ENDPOINT_INFO EndpointInfo; +} SOCKADDR_INFO, *PSOCKADDR_INFO; + + +INT +WINAPI +WSHAddressToString( + IN LPSOCKADDR Address, + IN INT AddressLength, + IN LPWSAPROTOCOL_INFOW ProtocolInfo OPTIONAL, + OUT LPWSTR AddressString, + IN OUT LPDWORD AddressStringLength); + +INT +WINAPI +WSHEnumProtocols( + IN LPINT lpiProtocols OPTIONAL, + IN LPWSTR lpTransportKeyName, + IN OUT LPVOID lpProtocolBuffer, + IN OUT LPDWORD lpdwBufferLength); + +INT +WINAPI +WSHGetBroadcastSockaddr( + IN PVOID HelperDllSocketContext, + OUT PSOCKADDR Sockaddr, + OUT PINT SockaddrLength); + +INT +WINAPI +WSHGetProviderGuid( + IN LPWSTR ProviderName, + OUT LPGUID ProviderGuid); + +INT +WINAPI +WSHGetSockaddrType( + IN PSOCKADDR Sockaddr, + IN DWORD SockaddrLength, + OUT PSOCKADDR_INFO SockaddrInfo); + +INT +WINAPI +WSHGetSocketInformation( + IN PVOID HelperDllSocketContext, + IN SOCKET SocketHandle, + IN HANDLE TdiAddressObjectHandle, + IN HANDLE TdiConnectionObjectHandle, + IN INT Level, + IN INT OptionName, + OUT PCHAR OptionValue, + OUT INT OptionLength); + +INT +WINAPI +WSHGetWildcardSockaddr( + IN PVOID HelperDllSocketContext, + OUT PSOCKADDR Sockaddr, + OUT PINT SockaddrLength); + +DWORD +WINAPI +WSHGetWinsockMapping( + OUT PWINSOCK_MAPPING Mapping, + IN DWORD MappingLength); + +INT +WINAPI +WSHGetWSAProtocolInfo( + IN LPWSTR ProviderName, + OUT LPWSAPROTOCOL_INFOW *ProtocolInfo, + OUT LPDWORD ProtocolInfoEntries); + +INT +WINAPI +WSHIoctl( + IN PVOID HelperDllSocketContext, + IN SOCKET SocketHandle, + IN HANDLE TdiAddressObjectHandle, + IN HANDLE TdiConnectionObjectHandle, + IN DWORD IoControlCode, + IN LPVOID InputBuffer, + IN DWORD InputBufferLength, + IN LPVOID OutputBuffer, + IN DWORD OutputBufferLength, + OUT LPDWORD NumberOfBytesReturned, + IN LPWSAOVERLAPPED Overlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine, + OUT LPBOOL NeedsCompletion); + +INT +WINAPI +WSHJoinLeaf( + IN PVOID HelperDllSocketContext, + IN SOCKET SocketHandle, + IN HANDLE TdiAddressObjectHandle, + IN HANDLE TdiConnectionObjectHandle, + IN PVOID LeafHelperDllSocketContext, + IN SOCKET LeafSocketHandle, + IN PSOCKADDR Sockaddr, + IN DWORD SockaddrLength, + IN LPWSABUF CallerData, + IN LPWSABUF CalleeData, + IN LPQOS SocketQOS, + IN LPQOS GroupQOS, + IN DWORD Flags); + +INT +WINAPI +WSHNotify( + IN PVOID HelperDllSocketContext, + IN SOCKET SocketHandle, + IN HANDLE TdiAddressObjectHandle, + IN HANDLE TdiConnectionObjectHandle, + IN DWORD NotifyEvent); + +INT +WINAPI +WSHOpenSocket( + IN OUT PINT AddressFamily, + IN OUT PINT SocketType, + IN OUT PINT Protocol, + OUT PUNICODE_STRING TransportDeviceName, + OUT PVOID HelperDllSocketContext, + OUT PDWORD NotificationEvents); + +INT +WINAPI +WSHOpenSocket2( + OUT PINT AddressFamily, + IN OUT PINT SocketType, + IN OUT PINT Protocol, + IN GROUP Group, + IN DWORD Flags, + OUT PUNICODE_STRING TransportDeviceName, + OUT PVOID *HelperDllSocketContext, + OUT PDWORD NotificationEvents); + +INT +WINAPI +WSHSetSocketInformation( + IN PVOID HelperDllSocketContext, + IN SOCKET SocketHandle, + IN HANDLE TdiAddressObjectHandle, + IN HANDLE TdiConnectionObjectHandle, + IN INT Level, + IN INT OptionName, + IN PCHAR OptionValue, + IN INT OptionLength); + +INT +WINAPI +WSHStringToAddress( + IN LPWSTR AddressString, + IN DWORD AddressFamily, + IN LPWSAPROTOCOL_INFOW ProtocolInfo OPTIONAL, + OUT LPSOCKADDR Address, + IN OUT LPDWORD AddressStringLength); + + + +typedef INT (WINAPI * PWSH_ADDRESS_TO_STRING)( + IN LPSOCKADDR Address, + IN INT AddressLength, + IN LPWSAPROTOCOL_INFOW ProtocolInfo OPTIONAL, + OUT LPWSTR AddressString, + IN OUT LPDWORD AddressStringLength); + +typedef INT (WINAPI * PWSH_ENUM_PROTOCOLS)( + IN LPINT lpiProtocols OPTIONAL, + IN LPWSTR lpTransportKeyName, + IN OUT LPVOID lpProtocolBuffer, + IN OUT LPDWORD lpdwBufferLength); + +typedef INT (WINAPI * PWSH_GET_BROADCAST_SOCKADDR)( + IN PVOID HelperDllSocketContext, + OUT PSOCKADDR Sockaddr, + OUT PINT SockaddrLength); + +typedef INT (WINAPI * PWSH_GET_PROVIDER_GUID)( + IN LPWSTR ProviderName, + OUT LPGUID ProviderGuid); + +typedef INT (WINAPI * PWSH_GET_SOCKADDR_TYPE)( + IN PSOCKADDR Sockaddr, + IN DWORD SockaddrLength, + OUT PSOCKADDR_INFO SockaddrInfo); + +typedef INT (WINAPI * PWSH_GET_SOCKET_INFORMATION)( + IN PVOID HelperDllSocketContext, + IN SOCKET SocketHandle, + IN HANDLE TdiAddressObjectHandle, + IN HANDLE TdiConnectionObjectHandle, + IN INT Level, + IN INT OptionName, + OUT PCHAR OptionValue, + OUT INT OptionLength); + +typedef INT (WINAPI * PWSH_GET_WILDCARD_SOCKEADDR)( + IN PVOID HelperDllSocketContext, + OUT PSOCKADDR Sockaddr, + OUT PINT SockaddrLength); + +typedef DWORD (WINAPI * PWSH_GET_WINSOCK_MAPPING)( + OUT PWINSOCK_MAPPING Mapping, + IN DWORD MappingLength); + +typedef INT (WINAPI * PWSH_GET_WSAPROTOCOL_INFO)( + IN LPWSTR ProviderName, + OUT LPWSAPROTOCOL_INFOW *ProtocolInfo, + OUT LPDWORD ProtocolInfoEntries); + +typedef INT (WINAPI * PWSH_IOCTL)( + IN PVOID HelperDllSocketContext, + IN SOCKET SocketHandle, + IN HANDLE TdiAddressObjectHandle, + IN HANDLE TdiConnectionObjectHandle, + IN DWORD IoControlCode, + IN LPVOID InputBuffer, + IN DWORD InputBufferLength, + IN LPVOID OutputBuffer, + IN DWORD OutputBufferLength, + OUT LPDWORD NumberOfBytesReturned, + IN LPWSAOVERLAPPED Overlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine, + OUT LPBOOL NeedsCompletion); + +typedef INT (WINAPI * PWSH_JOIN_LEAF)( + IN PVOID HelperDllSocketContext, + IN SOCKET SocketHandle, + IN HANDLE TdiAddressObjectHandle, + IN HANDLE TdiConnectionObjectHandle, + IN PVOID LeafHelperDllSocketContext, + IN SOCKET LeafSocketHandle, + IN PSOCKADDR Sockaddr, + IN DWORD SockaddrLength, + IN LPWSABUF CallerData, + IN LPWSABUF CalleeData, + IN LPQOS SocketQOS, + IN LPQOS GroupQOS, + IN DWORD Flags); + +typedef INT (WINAPI * PWSH_NOTIFY)( + IN PVOID HelperDllSocketContext, + IN SOCKET SocketHandle, + IN HANDLE TdiAddressObjectHandle, + IN HANDLE TdiConnectionObjectHandle, + IN DWORD NotifyEvent); + +typedef INT (WINAPI * PWSH_OPEN_SOCKET)( + IN OUT PINT AddressFamily, + IN OUT PINT SocketType, + IN OUT PINT Protocol, + OUT PUNICODE_STRING TransportDeviceName, + OUT PVOID HelperDllSocketContext, + OUT PDWORD NotificationEvents); + +typedef INT (WINAPI * PWSH_OPEN_SOCKET2)( + OUT PINT AddressFamily, + IN OUT PINT SocketType, + IN OUT PINT Protocol, + IN GROUP Group, + IN DWORD Flags, + OUT PUNICODE_STRING TransportDeviceName, + OUT PVOID *HelperDllSocketContext, + OUT PDWORD NotificationEvents); + +typedef INT (WINAPI * PWSH_SET_SOCKET_INFORMATION)( + IN PVOID HelperDllSocketContext, + IN SOCKET SocketHandle, + IN HANDLE TdiAddressObjectHandle, + IN HANDLE TdiConnectionObjectHandle, + IN INT Level, + IN INT OptionName, + IN PCHAR OptionValue, + IN INT OptionLength); + +typedef INT (WINAPI * PWSH_STRING_TO_ADDRESS)( + IN LPWSTR AddressString, + IN DWORD AddressFamily, + IN LPWSAPROTOCOL_INFOW ProtocolInfo OPTIONAL, + OUT LPSOCKADDR Address, + IN OUT LPDWORD AddressStringLength); + +#ifdef __cplusplus +}; +#endif /* __cplusplus */ + +#endif /* __WSAHELP_H */ + +/* EOF */ diff --git a/reactos/lib/advapi32/advapi32.rc b/reactos/lib/advapi32/advapi32.rc index 7a61506781a..03b75b6578f 100644 --- a/reactos/lib/advapi32/advapi32.rc +++ b/reactos/lib/advapi32/advapi32.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/advapi32/include/advapi32.h b/reactos/lib/advapi32/include/advapi32.h deleted file mode 100755 index bf875a91fad..00000000000 --- a/reactos/lib/advapi32/include/advapi32.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ADVAPI32_H -#define __ADVAPI32_H - -//#define _UNICODE -//#define UNICODE -#include -#define NTOS_USER_MODE -#include -#include - -#endif /* __ADVAPI32_H */ diff --git a/reactos/lib/advapi32/makefile b/reactos/lib/advapi32/makefile index ce7c6af8b29..32b78241f61 100644 --- a/reactos/lib/advapi32/makefile +++ b/reactos/lib/advapi32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.22 2002/09/07 15:12:22 chorns Exp $ +# $Id: makefile,v 1.23 2002/09/08 10:22:35 chorns Exp $ PATH_TO_TOP = ../.. @@ -8,9 +8,9 @@ TARGET_NAME = advapi32 TARGET_SDKLIBS = ntdll.a kernel32.a -TARGET_CFLAGS = -I./include +# TARGET_CFLAGS = -DUNICODE -TARGET_BASE = 0x78000000 +TARGET_BASE = 0x77dc0000 MISC_OBJECTS=\ misc/dllmain.o \ diff --git a/reactos/lib/advapi32/misc/dllmain.c b/reactos/lib/advapi32/misc/dllmain.c index 86bb8df97b8..624257523cd 100644 --- a/reactos/lib/advapi32/misc/dllmain.c +++ b/reactos/lib/advapi32/misc/dllmain.c @@ -1,4 +1,4 @@ -/* $Id: dllmain.c,v 1.5 2002/09/07 15:12:22 chorns Exp $ +/* $Id: dllmain.c,v 1.6 2002/09/08 10:22:36 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -9,12 +9,13 @@ * Created ??? */ -#include +#include +#include #define NDEBUG -//#include +#include + -#if 0 INT STDCALL DllMain(PVOID hinstDll, ULONG dwReason, @@ -34,5 +35,5 @@ DllMain(PVOID hinstDll, return TRUE; } -#endif + /* EOF */ diff --git a/reactos/lib/advapi32/misc/shutdown.c b/reactos/lib/advapi32/misc/shutdown.c index fd82cac90c4..b719584c70b 100644 --- a/reactos/lib/advapi32/misc/shutdown.c +++ b/reactos/lib/advapi32/misc/shutdown.c @@ -1,4 +1,4 @@ -/* $Id: shutdown.c,v 1.4 2002/09/07 15:12:22 chorns Exp $ +/* $Id: shutdown.c,v 1.5 2002/09/08 10:22:36 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -10,8 +10,8 @@ * 19990515 EA */ -#include - +#include +#include #define USZ {0,0,0} @@ -21,7 +21,7 @@ BOOL STDCALL AbortSystemShutdownW( - LPCWSTR lpMachineName + LPWSTR lpMachineName ) { NTSTATUS Status; @@ -37,7 +37,7 @@ AbortSystemShutdownW( BOOL STDCALL AbortSystemShutdownA( - LPCSTR lpMachineName + LPSTR lpMachineName ) { ANSI_STRING MachineNameA; diff --git a/reactos/lib/advapi32/misc/sysfunc.c b/reactos/lib/advapi32/misc/sysfunc.c index 44bfbc29bc7..054c20383a0 100644 --- a/reactos/lib/advapi32/misc/sysfunc.c +++ b/reactos/lib/advapi32/misc/sysfunc.c @@ -1,4 +1,4 @@ -/* $Id: sysfunc.c,v 1.4 2002/09/07 15:12:22 chorns Exp $ +/* $Id: sysfunc.c,v 1.5 2002/09/08 10:22:36 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -9,8 +9,7 @@ * 19990413 EA created * 19990415 EA */ - -#include +#include /********************************************************************** * SystemFunction001 diff --git a/reactos/lib/advapi32/reg/reg.c b/reactos/lib/advapi32/reg/reg.c index f972946d169..c0dd6b138e4 100644 --- a/reactos/lib/advapi32/reg/reg.c +++ b/reactos/lib/advapi32/reg/reg.c @@ -1,4 +1,4 @@ -/* $Id: reg.c,v 1.16 2002/09/07 15:12:22 chorns Exp $ +/* $Id: reg.c,v 1.17 2002/09/08 10:22:36 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -9,7 +9,9 @@ * Created 01/11/98 * 19990309 EA Stubs */ -#include +#include +#include +#include #include #define NDEBUG @@ -29,13 +31,13 @@ #define MAX_DEFAULT_HANDLES 6 -static RTL_CRITICAL_SECTION HandleTableCS; +static CRITICAL_SECTION HandleTableCS; static HANDLE DefaultHandleTable[MAX_DEFAULT_HANDLES]; /* PROTOTYPES ****************************************************************/ -static NTSTATUS MapDefaultKey (PHANDLE ParentKey, HKEY Key); +static NTSTATUS MapDefaultKey (PHKEY ParentKey, HKEY Key); static VOID CloseDefaultKeys(VOID); static NTSTATUS OpenClassesRootKey(PHANDLE KeyHandle); @@ -84,7 +86,7 @@ RegCleanup(VOID) static NTSTATUS -MapDefaultKey(PHANDLE RealKey, +MapDefaultKey(PHKEY RealKey, HKEY Key) { PHANDLE Handle; @@ -284,7 +286,7 @@ RegCloseKey(HKEY hKey) * RegConnectRegistryA */ LONG STDCALL -RegConnectRegistryA(LPCSTR lpMachineName, +RegConnectRegistryA(LPSTR lpMachineName, HKEY hKey, PHKEY phkResult) { @@ -297,7 +299,7 @@ RegConnectRegistryA(LPCSTR lpMachineName, * RegConnectRegistryW */ LONG STDCALL -RegConnectRegistryW(LPCWSTR lpMachineName, +RegConnectRegistryW(LPWSTR lpMachineName, HKEY hKey, PHKEY phkResult) { @@ -364,7 +366,7 @@ RegCreateKeyExA(HKEY hKey, UNICODE_STRING ClassString; OBJECT_ATTRIBUTES Attributes; NTSTATUS Status; - HANDLE ParentKey; + HKEY ParentKey; DPRINT("RegCreateKeyExW() called\n"); @@ -393,7 +395,7 @@ RegCreateKeyExA(HKEY hKey, (HANDLE)ParentKey, (PSECURITY_DESCRIPTOR)lpSecurityAttributes); - Status = NtCreateKey((PHANDLE)phkResult, + Status = NtCreateKey(phkResult, samDesired, &Attributes, 0, @@ -436,7 +438,7 @@ RegCreateKeyExW(HKEY hKey, UNICODE_STRING ClassString; OBJECT_ATTRIBUTES Attributes; NTSTATUS Status; - HANDLE ParentKey; + HKEY ParentKey; DPRINT("RegCreateKeyExW() called\n"); @@ -460,7 +462,7 @@ RegCreateKeyExW(HKEY hKey, (HANDLE)ParentKey, (PSECURITY_DESCRIPTOR)lpSecurityAttributes); - Status = NtCreateKey ((PHANDLE)phkResult, + Status = NtCreateKey (phkResult, samDesired, &Attributes, 0, @@ -854,14 +856,14 @@ RegEnumKeyExW( BufferSize = sizeof (KEY_NODE_INFORMATION) + *lpcbName * sizeof(WCHAR); if (lpClass) BufferSize += *lpcbClass; - KeyInfo = (PKEY_NODE_INFORMATION)RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferSize); + KeyInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferSize); /* We don't know the exact size of the data returned, so call NtEnumerateKey() with a buffer size determined from parameters to this function. If that call fails with a status code of STATUS_BUFFER_OVERFLOW, allocate a new buffer and try again */ while (TRUE) { - KeyInfo = (PKEY_NODE_INFORMATION)RtlAllocateHeap( + KeyInfo = RtlAllocateHeap( RtlGetProcessHeap(), 0, BufferSize); @@ -1049,7 +1051,7 @@ RegEnumValueW( to this function. If that call fails with a status code of STATUS_BUFFER_OVERFLOW, allocate a new buffer and try again */ while (TRUE) { - ValueInfo = (PKEY_VALUE_FULL_INFORMATION)RtlAllocateHeap( + ValueInfo = RtlAllocateHeap( RtlGetProcessHeap(), 0, BufferSize); @@ -1256,7 +1258,7 @@ RegOpenKeyA(HKEY hKey, KeyHandle, NULL); - Status = NtOpenKey((PHANDLE)phkResult, + Status = NtOpenKey(phkResult, KEY_ALL_ACCESS, &ObjectAttributes); @@ -1313,7 +1315,7 @@ RegOpenKeyW ( NULL); errCode = NtOpenKey( - (PHANDLE)phkResult, + phkResult, KEY_ALL_ACCESS, & ObjectAttributes ); @@ -1363,7 +1365,7 @@ RegOpenKeyExA(HKEY hKey, KeyHandle, NULL); - Status = NtOpenKey((PHANDLE)phkResult, + Status = NtOpenKey(phkResult, samDesired, &ObjectAttributes); @@ -1416,7 +1418,7 @@ RegOpenKeyExW(HKEY hKey, KeyHandle, NULL); - Status = NtOpenKey((PHANDLE)phkResult, + Status = NtOpenKey(phkResult, samDesired, &ObjectAttributes); if (!NT_SUCCESS(Status)) @@ -1530,7 +1532,7 @@ RegQueryInfoKeyW( if (lpClass) { FullInfoSize = sizeof(KEY_FULL_INFORMATION) + *lpcbClass; - FullInfo = (PKEY_FULL_INFORMATION)RtlAllocateHeap(RtlGetProcessHeap(), 0, FullInfoSize); + FullInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, FullInfoSize); if (!FullInfo) { SetLastError(ERROR_OUTOFMEMORY); @@ -1627,7 +1629,7 @@ LONG STDCALL RegQueryMultipleValuesA( HKEY hKey, - PVALENTA val_list, + PVALENT val_list, DWORD num_vals, LPSTR lpValueBuf, LPDWORD ldwTotsize @@ -1646,7 +1648,7 @@ LONG STDCALL RegQueryMultipleValuesW( HKEY hKey, - PVALENTW val_list, + PVALENT val_list, DWORD num_vals, LPWSTR lpValueBuf, LPDWORD ldwTotsize @@ -1698,7 +1700,7 @@ RegQueryValueA( { ValueSize = *lpcbValue * sizeof(WCHAR); Value.MaximumLength = ValueSize; - Value.Buffer = (PWCHAR)RtlAllocateHeap(RtlGetProcessHeap(), 0, ValueSize); + Value.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, ValueSize); if (!Value.Buffer) { SetLastError(ERROR_OUTOFMEMORY); @@ -1739,12 +1741,11 @@ RegQueryValueA( /************************************************************************ * RegQueryValueExA */ -LONG WINAPI RegQueryValueExA (HKEY,LPCSTR,PDWORD,PDWORD,LPBYTE,LPDWORD); LONG STDCALL RegQueryValueExA( HKEY hKey, - LPCSTR lpValueName, + LPSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, @@ -1772,7 +1773,7 @@ RegQueryValueExA( if (lpData) { ValueData.MaximumLength = *lpcbData * sizeof(WCHAR); - ValueData.Buffer = (PWCHAR)RtlAllocateHeap( + ValueData.Buffer = RtlAllocateHeap( RtlGetProcessHeap(), 0, ValueData.MaximumLength); @@ -1848,7 +1849,7 @@ LONG STDCALL RegQueryValueExW( HKEY hKey, - LPCWSTR lpValueName, + LPWSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, @@ -1884,7 +1885,7 @@ RegQueryValueExW( lpValueName); BufferSize = sizeof (KEY_VALUE_PARTIAL_INFORMATION) + *lpcbData; - ValueInfo = (PKEY_VALUE_PARTIAL_INFORMATION)RtlAllocateHeap (RtlGetProcessHeap(), + ValueInfo = RtlAllocateHeap (RtlGetProcessHeap(), 0, BufferSize); if (ValueInfo == NULL) @@ -2239,7 +2240,7 @@ RegSetValueA( DataSize = cbData * sizeof(WCHAR); Data.MaximumLength = DataSize; - Data.Buffer = (PWCHAR)RtlAllocateHeap(RtlGetProcessHeap(), 0, DataSize); + Data.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, DataSize); if (!Data.Buffer) { SetLastError(ERROR_OUTOFMEMORY); diff --git a/reactos/lib/advapi32/sec/ac.c b/reactos/lib/advapi32/sec/ac.c index c512a5d25f4..230f6f3b68d 100644 --- a/reactos/lib/advapi32/sec/ac.c +++ b/reactos/lib/advapi32/sec/ac.c @@ -1,4 +1,4 @@ -/* $Id: ac.c,v 1.3 2002/09/07 15:12:22 chorns Exp $ +/* $Id: ac.c,v 1.4 2002/09/08 10:22:37 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -6,7 +6,9 @@ * PURPOSE: ACL/ACE functions */ -#include +#include +#include +#include /* --- ACL --- */ diff --git a/reactos/lib/advapi32/sec/lsa.c b/reactos/lib/advapi32/sec/lsa.c index 8c406da0a6b..9b7db4e9e4b 100644 --- a/reactos/lib/advapi32/sec/lsa.c +++ b/reactos/lib/advapi32/sec/lsa.c @@ -1,4 +1,4 @@ -/* $Id: lsa.c,v 1.3 2002/09/07 15:12:22 chorns Exp $ +/* $Id: lsa.c,v 1.4 2002/09/08 10:22:37 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -9,8 +9,8 @@ * 19990322 EA created * 19990515 EA stubs */ - -#include +#include +#include /********************************************************************** diff --git a/reactos/lib/advapi32/sec/misc.c b/reactos/lib/advapi32/sec/misc.c index 073273d3504..9c6e602ce9d 100644 --- a/reactos/lib/advapi32/sec/misc.c +++ b/reactos/lib/advapi32/sec/misc.c @@ -1,7 +1,9 @@ /* */ -#include +#include +#include +#include WINBOOL STDCALL diff --git a/reactos/lib/advapi32/sec/sec.c b/reactos/lib/advapi32/sec/sec.c index 38dad467a8e..03fa1341b24 100644 --- a/reactos/lib/advapi32/sec/sec.c +++ b/reactos/lib/advapi32/sec/sec.c @@ -8,7 +8,9 @@ * Created 01/11/98 */ -#include +#include +#include +#include BOOL diff --git a/reactos/lib/advapi32/sec/sid.c b/reactos/lib/advapi32/sec/sid.c index 3b8ae890e45..b20556992e4 100644 --- a/reactos/lib/advapi32/sec/sid.c +++ b/reactos/lib/advapi32/sec/sid.c @@ -1,4 +1,4 @@ -/* $Id: sid.c,v 1.5 2002/09/07 15:12:22 chorns Exp $ +/* $Id: sid.c,v 1.6 2002/09/08 10:22:37 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -6,7 +6,9 @@ * PURPOSE: Security ID functions */ -#include +#include +#include +#include BOOL STDCALL diff --git a/reactos/lib/advapi32/service/scm.c b/reactos/lib/advapi32/service/scm.c index f2f0cb7aca8..93b9d2bde40 100644 --- a/reactos/lib/advapi32/service/scm.c +++ b/reactos/lib/advapi32/service/scm.c @@ -1,4 +1,4 @@ -/* $Id: scm.c,v 1.11 2002/09/07 15:12:23 chorns Exp $ +/* $Id: scm.c,v 1.12 2002/09/08 10:22:37 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -12,8 +12,8 @@ /* INCLUDES ******************************************************************/ -#include - +#include +#include /* FUNCTIONS *****************************************************************/ @@ -245,17 +245,7 @@ EnumServicesStatusA ( */ BOOL STDCALL -EnumServicesStatusExA( - SC_HANDLE hSCManager, - SC_ENUM_TYPE InfoLevel, - DWORD dwServiceType, - DWORD dwServiceState, - LPBYTE lpServices, - DWORD cbBufSize, - LPDWORD pcbBytesNeeded, - LPDWORD lpServicesReturned, - LPDWORD lpResumeHandle, - LPCSTR pszGroupName) +EnumServicesStatusExA(VOID) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; @@ -267,17 +257,7 @@ EnumServicesStatusExA( */ BOOL STDCALL -EnumServicesStatusExW( - SC_HANDLE hSCManager, - SC_ENUM_TYPE InfoLevel, - DWORD dwServiceType, - DWORD dwServiceState, - LPBYTE lpServices, - DWORD cbBufSize, - LPDWORD pcbBytesNeeded, - LPDWORD lpServicesReturned, - LPDWORD lpResumeHandle, - LPCWSTR pszGroupName) +EnumServicesStatusExW(VOID) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; @@ -711,12 +691,7 @@ QueryServiceStatus( */ BOOL STDCALL -QueryServiceStatusEx( - SC_HANDLE hService, - SC_STATUS_TYPE InfoLevel, - LPBYTE lpBuffer, - DWORD cbBufSize, - LPDWORD pcbBytesNeeded) +QueryServiceStatusEx(VOID) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; diff --git a/reactos/lib/advapi32/service/sctrl.c b/reactos/lib/advapi32/service/sctrl.c index f0ce975edd7..c517d4dc694 100644 --- a/reactos/lib/advapi32/service/sctrl.c +++ b/reactos/lib/advapi32/service/sctrl.c @@ -1,4 +1,4 @@ -/* $Id: sctrl.c,v 1.6 2002/09/07 15:12:23 chorns Exp $ +/* $Id: sctrl.c,v 1.7 2002/09/08 10:22:37 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -12,8 +12,8 @@ /* INCLUDES ******************************************************************/ -#include - +#include +#include #define NDEBUG #include diff --git a/reactos/lib/advapi32/service/undoc.c b/reactos/lib/advapi32/service/undoc.c index d4029b635d8..f9d12280fac 100644 --- a/reactos/lib/advapi32/service/undoc.c +++ b/reactos/lib/advapi32/service/undoc.c @@ -1,4 +1,4 @@ -/* $Id: undoc.c,v 1.2 2002/09/07 15:12:23 chorns Exp $ +/* $Id: undoc.c,v 1.3 2002/09/08 10:22:37 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -12,8 +12,7 @@ /* INCLUDES ******************************************************************/ -#include - +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/advapi32/token/privilege.c b/reactos/lib/advapi32/token/privilege.c index 005a810c0eb..db6dc8a40b2 100644 --- a/reactos/lib/advapi32/token/privilege.c +++ b/reactos/lib/advapi32/token/privilege.c @@ -1,4 +1,4 @@ -/* $Id: privilege.c,v 1.2 2002/09/07 15:12:23 chorns Exp $ +/* $Id: privilege.c,v 1.3 2002/09/08 10:22:37 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -8,8 +8,8 @@ * UPDATE HISTORY: * 20010317 ea stubs */ - -#include +#include +#include /********************************************************************** diff --git a/reactos/lib/advapi32/token/token.c b/reactos/lib/advapi32/token/token.c index 0039fdb658e..e2760365de3 100644 --- a/reactos/lib/advapi32/token/token.c +++ b/reactos/lib/advapi32/token/token.c @@ -8,8 +8,8 @@ * Created 01/11/98 */ -#include - +#include +#include WINBOOL STDCALL diff --git a/reactos/lib/crtdll/crtdll.rc b/reactos/lib/crtdll/crtdll.rc index 7620c754c10..c37f0a4c0c3 100644 --- a/reactos/lib/crtdll/crtdll.rc +++ b/reactos/lib/crtdll/crtdll.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/crtdll/except/exhand2.c b/reactos/lib/crtdll/except/exhand2.c index 0ffc593ab66..be66fb4116a 100644 --- a/reactos/lib/crtdll/except/exhand2.c +++ b/reactos/lib/crtdll/except/exhand2.c @@ -1,6 +1,4 @@ #include -#include - EXCEPTION_DISPOSITION _except_handler2( diff --git a/reactos/lib/crtdll/makefile b/reactos/lib/crtdll/makefile index e9df20d1025..3a1199c7f9a 100644 --- a/reactos/lib/crtdll/makefile +++ b/reactos/lib/crtdll/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.47 2002/09/07 15:12:23 chorns Exp $ +# $Id: makefile,v 1.48 2002/09/08 10:22:38 chorns Exp $ PATH_TO_TOP = ../.. @@ -10,7 +10,7 @@ TARGET_LFLAGS = -nostartfiles TARGET_SDKLIBS = kernel32.a -TARGET_BASE = 0x77500000 +TARGET_BASE = 0x77630000 TARGET_DEFONLY = yes diff --git a/reactos/lib/crtdll/mbstring/mbstok.c b/reactos/lib/crtdll/mbstring/mbstok.c index cc2f0cbee4b..538b856ee3c 100644 --- a/reactos/lib/crtdll/mbstring/mbstok.c +++ b/reactos/lib/crtdll/mbstring/mbstok.c @@ -1,6 +1,6 @@ #include -unsigned char * _mbstok(unsigned char *s, const unsigned char *delim) +unsigned char * _mbstok(unsigned char *s, unsigned char *delim) { const char *spanp; int c, sc; diff --git a/reactos/lib/crtdll/stdio/vfprintf.c b/reactos/lib/crtdll/stdio/vfprintf.c index 2096ce440e8..394cd742657 100644 --- a/reactos/lib/crtdll/stdio/vfprintf.c +++ b/reactos/lib/crtdll/stdio/vfprintf.c @@ -3,7 +3,6 @@ #include #include #include -#include int _isnanl(double x); int _isinfl(double x); diff --git a/reactos/lib/fmifs/fmifs.rc b/reactos/lib/fmifs/fmifs.rc index bd2bd295ece..8fd6dffd9fb 100644 --- a/reactos/lib/fmifs/fmifs.rc +++ b/reactos/lib/fmifs/fmifs.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/gdi32/gdi32.rc b/reactos/lib/gdi32/gdi32.rc index 62d1520e86a..159b5c339d9 100644 --- a/reactos/lib/gdi32/gdi32.rc +++ b/reactos/lib/gdi32/gdi32.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/gdi32/main/dllmain.c b/reactos/lib/gdi32/main/dllmain.c index b7b5443125c..ce7c62f7864 100644 --- a/reactos/lib/gdi32/main/dllmain.c +++ b/reactos/lib/gdi32/main/dllmain.c @@ -1,14 +1,13 @@ /* * dllmain.c * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * $Author: chorns $ - * $Date: 2002/09/07 15:12:24 $ + * $Date: 2002/09/08 10:22:40 $ * */ #include -#include #include /* diff --git a/reactos/lib/gdi32/makefile b/reactos/lib/gdi32/makefile index ff170863f07..65eedb73e55 100644 --- a/reactos/lib/gdi32/makefile +++ b/reactos/lib/gdi32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.22 2002/09/07 15:12:24 chorns Exp $ +# $Id: makefile,v 1.23 2002/09/08 10:22:39 chorns Exp $ PATH_TO_TOP = ../.. @@ -6,7 +6,7 @@ TARGET_TYPE = dynlink TARGET_NAME = gdi32 -TARGET_BASE = 0x77700000 +TARGET_BASE = 0x77ed0000 TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a diff --git a/reactos/lib/gdi32/misc/stubs.c b/reactos/lib/gdi32/misc/stubs.c index 295bff19a78..6842b1b7088 100644 --- a/reactos/lib/gdi32/misc/stubs.c +++ b/reactos/lib/gdi32/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.11 2002/09/07 15:12:24 chorns Exp $ +/* $Id: stubs.c,v 1.12 2002/09/08 10:22:40 chorns Exp $ * * reactos/lib/gdi32/misc/stubs.c * @@ -13,6 +13,7 @@ #endif #include + BOOL STDCALL AnimatePalette( @@ -255,7 +256,7 @@ STDCALL EnumObjects( HDC a0, int a1, - GOBJENUMPROC a2, + ENUMOBJECTSPROC a2, LPARAM a3 ) { @@ -1425,9 +1426,9 @@ PlayMetaFileRecord( BOOL STDCALL EnumMetaFile( - HDC a0, - HMETAFILE a1, - MFENUMPROC a2, + HDC a0, + HMETAFILE a1, + ENUMMETAFILEPROC a2, LPARAM a3 ) { @@ -1466,7 +1467,7 @@ STDCALL EnumEnhMetaFile( HDC a0, HENHMETAFILE a1, - ENHMFENUMPROC a2, + ENHMETAFILEPROC a2, LPVOID a3, CONST RECT *a4 ) @@ -1597,7 +1598,8 @@ SetWinMetaFileBits( UINT a0, CONST BYTE *a1, HDC a2, - CONST METAFILEPICT *a3 +// CONST METAFILEPICT *a3 + PVOID a3 ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -2752,12 +2754,12 @@ GetGlyphOutlineWow( } -int +DWORD STDCALL GetRandomRgn( - HDC a0, - HRGN a1, - INT a2 + DWORD a0, + DWORD a1, + DWORD a2 ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); diff --git a/reactos/lib/gdi32/misc/stubsa.c b/reactos/lib/gdi32/misc/stubsa.c index af8af2e5dcb..22b3cdaa990 100644 --- a/reactos/lib/gdi32/misc/stubsa.c +++ b/reactos/lib/gdi32/misc/stubsa.c @@ -1,4 +1,4 @@ -/* $Id: stubsa.c,v 1.7 2002/09/07 15:12:24 chorns Exp $ +/* $Id: stubsa.c,v 1.8 2002/09/08 10:22:40 chorns Exp $ * * reactos/lib/gdi32/misc/stubs.c * @@ -97,7 +97,7 @@ STDCALL EnumFontFamiliesExA( HDC a0, LPLOGFONT a1, - FONTENUMPROCA a2, + FONTENUMEXPROC a2, LPARAM a3, DWORD a4 ) @@ -112,7 +112,7 @@ STDCALL EnumFontFamiliesA( HDC a0, LPCSTR a1, - FONTENUMPROCA a2, + FONTENUMPROC a2, LPARAM a3 ) { @@ -126,7 +126,7 @@ STDCALL EnumFontsA( HDC a0, LPCSTR a1, - FONTENUMPROCA a2, + ENUMFONTSPROC a2, LPARAM a3 ) { diff --git a/reactos/lib/gdi32/misc/stubsw.c b/reactos/lib/gdi32/misc/stubsw.c index 13851985ad4..da2440edbee 100644 --- a/reactos/lib/gdi32/misc/stubsw.c +++ b/reactos/lib/gdi32/misc/stubsw.c @@ -1,4 +1,4 @@ -/* $Id: stubsw.c,v 1.6 2002/09/07 15:12:24 chorns Exp $ +/* $Id: stubsw.c,v 1.7 2002/09/08 10:22:40 chorns Exp $ * * reactos/lib/gdi32/misc/stubs.c * @@ -95,7 +95,7 @@ STDCALL EnumFontFamiliesExW( HDC a0, LPLOGFONT a1, - FONTENUMPROCW a2, + FONTENUMEXPROC a2, LPARAM a3, DWORD a4 ) @@ -110,7 +110,7 @@ STDCALL EnumFontFamiliesW( HDC a0, LPCWSTR a1, - FONTENUMPROCW a2, + FONTENUMPROC a2, LPARAM a3 ) { @@ -124,7 +124,7 @@ STDCALL EnumFontsW( HDC a0, LPCWSTR a1, - FONTENUMPROCW a2, + ENUMFONTSPROC a2, LPARAM a3 ) { diff --git a/reactos/lib/gdi32/objects/bitblt.c b/reactos/lib/gdi32/objects/bitblt.c index 66ac4b8e630..ec8f3a4fd88 100644 --- a/reactos/lib/gdi32/objects/bitblt.c +++ b/reactos/lib/gdi32/objects/bitblt.c @@ -200,7 +200,7 @@ STDCALL CreateDIBSection(HDC hDC, CONST BITMAPINFO *bmi, UINT Usage, - VOID **Bits, + VOID *Bits, HANDLE hSection, DWORD dwOffset) { diff --git a/reactos/lib/gdi32/objects/text.c b/reactos/lib/gdi32/objects/text.c index e71aabfb3d2..1e9e14c802f 100644 --- a/reactos/lib/gdi32/objects/text.c +++ b/reactos/lib/gdi32/objects/text.c @@ -58,41 +58,17 @@ BOOL STDCALL GetTextMetricsA( HDC hdc, - LPTEXTMETRICA tm + LPTEXTMETRIC tm ) { - TEXTMETRICW tmw; - BOOL Success; - - Success = GetTextMetricsW(hdc, &tmw); - tm->tmHeight = tmw.tmHeight; - tm->tmAscent = tmw.tmAscent; - tm->tmDescent = tmw.tmDescent; - tm->tmInternalLeading = tmw.tmInternalLeading; - tm->tmExternalLeading = tmw.tmExternalLeading; - tm->tmAveCharWidth = tmw.tmAveCharWidth; - tm->tmMaxCharWidth = tmw.tmMaxCharWidth; - tm->tmWeight = tmw.tmWeight; - tm->tmOverhang = tmw.tmOverhang; - tm->tmDigitizedAspectX = tmw.tmDigitizedAspectX; - tm->tmDigitizedAspectY = tmw.tmDigitizedAspectY; - tm->tmFirstChar = (BYTE)tmw.tmFirstChar; - tm->tmLastChar = (BYTE)tmw.tmLastChar; - tm->tmDefaultChar = (BYTE)tmw.tmDefaultChar; - tm->tmBreakChar = (BYTE)tmw.tmBreakChar; - tm->tmItalic = tmw.tmItalic; - tm->tmUnderlined = tmw.tmUnderlined; - tm->tmStruckOut = tmw.tmStruckOut; - tm->tmPitchAndFamily = tmw.tmPitchAndFamily; - tm->tmCharSet = tmw.tmCharSet; - return Success; + return W32kGetTextMetrics(hdc, tm); } BOOL STDCALL GetTextMetricsW( HDC hdc, - LPTEXTMETRICW tm + LPTEXTMETRIC tm ) { return W32kGetTextMetrics(hdc, tm); @@ -179,7 +155,7 @@ ExtTextOutW( HFONT STDCALL CreateFontIndirectA( - CONST LOGFONTA *lf + CONST LOGFONT *lf ) { ANSI_STRING StringA; @@ -192,7 +168,7 @@ CreateFontIndirectA( memcpy(&tlf, lf, sizeof(LOGFONT)); memcpy(&tlf.lfFaceName, &StringU.Buffer, StringU.Length); - ret = CreateFontIndirectW((CONST LOGFONTW *)&lf); + ret = CreateFontIndirectW((CONST LOGFONT *)&lf); RtlFreeUnicodeString(&StringU); @@ -202,7 +178,7 @@ CreateFontIndirectA( HFONT STDCALL CreateFontIndirectW( - CONST LOGFONTW *lf + CONST LOGFONT *lf ) { return W32kCreateFontIndirect((CONST LPLOGFONT)lf); diff --git a/reactos/lib/kernel32/except/except.c b/reactos/lib/kernel32/except/except.c index b8014af0fd6..c5e4b352184 100644 --- a/reactos/lib/kernel32/except/except.c +++ b/reactos/lib/kernel32/except/except.c @@ -1,4 +1,4 @@ -/* $Id: except.c,v 1.8 2002/09/07 15:12:25 chorns Exp $ +/* $Id: except.c,v 1.9 2002/09/08 10:22:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -10,11 +10,15 @@ * Created 01/11/98 */ +#include #include -#define NTOS_USER_MODE -#include + #include +typedef LONG (STDCALL *LPTOP_LEVEL_EXCEPTION_FILTER)( + struct _EXCEPTION_POINTERS *ExceptionInfo + ); + UINT GlobalErrMode; LPTOP_LEVEL_EXCEPTION_FILTER GlobalTopLevelExceptionFilter; diff --git a/reactos/lib/kernel32/file/backup.c b/reactos/lib/kernel32/file/backup.c index 3566daad0bc..51952704b03 100644 --- a/reactos/lib/kernel32/file/backup.c +++ b/reactos/lib/kernel32/file/backup.c @@ -1,4 +1,4 @@ -/* $Id: backup.c,v 1.2 2002/09/07 15:12:26 chorns Exp $ +/* $Id: backup.c,v 1.3 2002/09/08 10:22:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -10,26 +10,26 @@ /* INCLUDES *****************************************************************/ +#include #include -#define NTOS_USER_MODE -#include #include #include +#include #include #include /* FUNCTIONS ****************************************************************/ -BOOL +WINBOOL STDCALL BackupRead ( HANDLE hFile, LPBYTE lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, - BOOL bAbort, - BOOL bProcessSecurity, + WINBOOL bAbort, + WINBOOL bProcessSecurity, LPVOID * lpContext ) { @@ -38,7 +38,7 @@ BackupRead ( } -BOOL +WINBOOL STDCALL BackupSeek ( HANDLE hFile, @@ -54,15 +54,15 @@ BackupSeek ( } -BOOL +WINBOOL STDCALL BackupWrite ( HANDLE hFile, LPBYTE lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, - BOOL bAbort, - BOOL bProcessSecurity, + WINBOOL bAbort, + WINBOOL bProcessSecurity, LPVOID * lpContext ) { diff --git a/reactos/lib/kernel32/file/copy.c b/reactos/lib/kernel32/file/copy.c index 0b7fa16dc7d..3795f0756e7 100644 --- a/reactos/lib/kernel32/file/copy.c +++ b/reactos/lib/kernel32/file/copy.c @@ -1,4 +1,4 @@ -/* $Id: copy.c,v 1.10 2002/09/07 15:12:26 chorns Exp $ +/* $Id: copy.c,v 1.11 2002/09/08 10:22:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -12,25 +12,27 @@ /* INCLUDES ****************************************************************/ +#include #include -#define NTOS_USER_MODE -#include #define NDEBUG #include #include +#define LPPROGRESS_ROUTINE void* + + /* FUNCTIONS ****************************************************************/ -BOOL +WINBOOL STDCALL CopyFileExW ( LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, - LPBOOL pbCancel, + WINBOOL *pbCancel, DWORD dwCopyFlags ) { @@ -185,14 +187,14 @@ CopyFileExW ( } -BOOL +WINBOOL STDCALL CopyFileExA ( LPCSTR lpExistingFileName, LPCSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, - LPBOOL pbCancel, + WINBOOL *pbCancel, DWORD dwCopyFlags ) { diff --git a/reactos/lib/kernel32/file/create.c b/reactos/lib/kernel32/file/create.c index 7dd38687aa7..1ed4a5a2e5d 100644 --- a/reactos/lib/kernel32/file/create.c +++ b/reactos/lib/kernel32/file/create.c @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.28 2002/09/07 15:12:26 chorns Exp $ +/* $Id: create.c,v 1.29 2002/09/08 10:22:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -15,9 +15,11 @@ /* INCLUDES *****************************************************************/ +#include +/* please FIXME: ddk/ntddk.h should be enough */ +#include +#include #include -#define NTOS_USER_MODE -#include #define NDEBUG #include diff --git a/reactos/lib/kernel32/file/curdir.c b/reactos/lib/kernel32/file/curdir.c index 4c131c83470..b7588ce6c5d 100644 --- a/reactos/lib/kernel32/file/curdir.c +++ b/reactos/lib/kernel32/file/curdir.c @@ -1,4 +1,4 @@ -/* $Id: curdir.c,v 1.30 2002/09/07 15:12:26 chorns Exp $ +/* $Id: curdir.c,v 1.31 2002/09/08 10:22:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,9 +11,9 @@ /* INCLUDES ******************************************************************/ +#include +#include #include -#define NTOS_USER_MODE -#include #define NDEBUG #include diff --git a/reactos/lib/kernel32/file/delete.c b/reactos/lib/kernel32/file/delete.c index fb6776e37b4..ed67c231c92 100644 --- a/reactos/lib/kernel32/file/delete.c +++ b/reactos/lib/kernel32/file/delete.c @@ -1,4 +1,4 @@ -/* $Id: delete.c,v 1.11 2002/09/07 15:12:26 chorns Exp $ +/* $Id: delete.c,v 1.12 2002/09/08 10:22:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,9 +11,9 @@ /* INCLUDES ****************************************************************/ +#include +#include #include -#define NTOS_USER_MODE -#include #define NDEBUG #include diff --git a/reactos/lib/kernel32/file/deviceio.c b/reactos/lib/kernel32/file/deviceio.c index 0c1bb411fe1..8ff7173777b 100644 --- a/reactos/lib/kernel32/file/deviceio.c +++ b/reactos/lib/kernel32/file/deviceio.c @@ -1,4 +1,4 @@ -/* $Id: deviceio.c,v 1.8 2002/09/07 15:12:26 chorns Exp $ +/* $Id: deviceio.c,v 1.9 2002/09/08 10:22:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -9,9 +9,8 @@ * Created 01/11/98 */ +#include #include -#define NTOS_USER_MODE -#include #define NDEBUG #include diff --git a/reactos/lib/kernel32/file/dir.c b/reactos/lib/kernel32/file/dir.c index 0c93be1b87f..61f780d51ef 100644 --- a/reactos/lib/kernel32/file/dir.c +++ b/reactos/lib/kernel32/file/dir.c @@ -1,4 +1,4 @@ -/* $Id: dir.c,v 1.30 2002/09/07 15:12:26 chorns Exp $ +/* $Id: dir.c,v 1.31 2002/09/08 10:22:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -15,9 +15,9 @@ /* INCLUDES ******************************************************************/ +#include +#include #include -#define NTOS_USER_MODE -#include #include #include diff --git a/reactos/lib/kernel32/file/dosdev.c b/reactos/lib/kernel32/file/dosdev.c index 3e0dafdf28b..6ff85a47684 100644 --- a/reactos/lib/kernel32/file/dosdev.c +++ b/reactos/lib/kernel32/file/dosdev.c @@ -1,4 +1,4 @@ -/* $Id: dosdev.c,v 1.4 2002/09/07 15:12:26 chorns Exp $ +/* $Id: dosdev.c,v 1.5 2002/09/08 10:22:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -9,9 +9,8 @@ * Created 01/11/98 */ +#include #include -#define NTOS_USER_MODE -#include WINBOOL diff --git a/reactos/lib/kernel32/file/file.c b/reactos/lib/kernel32/file/file.c index 3fd3645b1ee..e7857f0cd12 100644 --- a/reactos/lib/kernel32/file/file.c +++ b/reactos/lib/kernel32/file/file.c @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.35 2002/09/07 15:12:26 chorns Exp $ +/* $Id: file.c,v 1.36 2002/09/08 10:22:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -12,9 +12,8 @@ /* INCLUDES *****************************************************************/ +#include #include -#define NTOS_USER_MODE -#include #include #include diff --git a/reactos/lib/kernel32/file/find.c b/reactos/lib/kernel32/file/find.c index 6252e79e3aa..1a56ff24d72 100644 --- a/reactos/lib/kernel32/file/find.c +++ b/reactos/lib/kernel32/file/find.c @@ -1,4 +1,4 @@ -/* $Id: find.c,v 1.31 2002/09/07 15:12:26 chorns Exp $ +/* $Id: find.c,v 1.32 2002/09/08 10:22:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,9 +11,9 @@ /* INCLUDES *****************************************************************/ +#include +#include #include -#define NTOS_USER_MODE -#include #define NDEBUG #include diff --git a/reactos/lib/kernel32/file/iocompl.c b/reactos/lib/kernel32/file/iocompl.c index db192dfae11..6b7d33c65d9 100644 --- a/reactos/lib/kernel32/file/iocompl.c +++ b/reactos/lib/kernel32/file/iocompl.c @@ -1,4 +1,4 @@ -/* $Id: iocompl.c,v 1.5 2002/09/07 15:12:26 chorns Exp $ +/* $Id: iocompl.c,v 1.6 2002/09/08 10:22:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -9,13 +9,21 @@ * Created 01/11/98 */ +#include #include -#define NTOS_USER_MODE -#include #include + + #include +typedef struct _FILE_COMPLETION_INFORMATION { + HANDLE CompletionPort; + ULONG CompletionKey; +} FILE_COMPLETION_INFORMATION; +typedef FILE_COMPLETION_INFORMATION *PFILE_COMPLETION_INFORMATION; + + VOID STDCALL FileIOCompletionRoutine( @@ -57,8 +65,8 @@ CreateIoCompletionPort( } if ( FileHandle != INVALID_HANDLE_VALUE ) { - CompletionInformation.Port = CompletionPort; - CompletionInformation.Key = CompletionKey; + CompletionInformation.CompletionPort = CompletionPort; + CompletionInformation.CompletionKey = CompletionKey; errCode = NtSetInformationFile(FileHandle, &IoStatusBlock,&CompletionInformation,sizeof(FILE_COMPLETION_INFORMATION),FileCompletionInformation); if ( !NT_SUCCESS(errCode) ) { diff --git a/reactos/lib/kernel32/file/lock.c b/reactos/lib/kernel32/file/lock.c index f0410b2615d..053dce3a985 100644 --- a/reactos/lib/kernel32/file/lock.c +++ b/reactos/lib/kernel32/file/lock.c @@ -1,4 +1,4 @@ -/* $Id: lock.c,v 1.6 2002/09/07 15:12:26 chorns Exp $ +/* $Id: lock.c,v 1.7 2002/09/08 10:22:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -14,13 +14,12 @@ /* INCLUDES ****************************************************************/ +#include #include -#define NTOS_USER_MODE -#include #include #include -#define NDEBUG +//#define NDEBUG #include #include diff --git a/reactos/lib/kernel32/file/mailslot.c b/reactos/lib/kernel32/file/mailslot.c index ce39c9c77f3..11c7e09c4dc 100644 --- a/reactos/lib/kernel32/file/mailslot.c +++ b/reactos/lib/kernel32/file/mailslot.c @@ -1,4 +1,4 @@ -/* $Id: mailslot.c,v 1.5 2002/09/07 15:12:26 chorns Exp $ +/* $Id: mailslot.c,v 1.6 2002/09/08 10:22:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -10,11 +10,10 @@ /* INCLUDES *****************************************************************/ +#include +#include #include -#define NTOS_USER_MODE -#include -#define NDEBUG #include #include @@ -125,23 +124,19 @@ GetMailslotInfo(HANDLE hMailslot, if (lpMaxMessageSize != NULL) { - *lpMaxMessageSize = Buffer.MaximumMessageSize; + *lpMaxMessageSize = Buffer.MaxMessageSize; } if (lpNextSize != NULL) { - *lpNextSize = Buffer.NextMessageSize; + *lpNextSize = Buffer.NextSize; } if (lpMessageCount != NULL) { - *lpMessageCount = Buffer.MessagesAvailable; + *lpMessageCount = Buffer.MessageCount; } if (lpReadTimeout != NULL) { - LARGE_INTEGER Dividend; - LARGE_INTEGER Result; - - Dividend.QuadPart = -10000; - Result = RtlLargeIntegerDivide(Buffer.ReadTimeout, Dividend, NULL); + *lpReadTimeout = (DWORD)(Buffer.Timeout.QuadPart / -10000); } return(TRUE); @@ -156,7 +151,7 @@ SetMailslotInfo(HANDLE hMailslot, IO_STATUS_BLOCK Iosb; NTSTATUS Status; - Buffer.ReadTimeout.QuadPart = lReadTimeout * -10000; + Buffer.Timeout.QuadPart = lReadTimeout * -10000; Status = NtSetInformationFile(hMailslot, &Iosb, diff --git a/reactos/lib/kernel32/file/move.c b/reactos/lib/kernel32/file/move.c index 86dafc09f10..7a300dad26e 100644 --- a/reactos/lib/kernel32/file/move.c +++ b/reactos/lib/kernel32/file/move.c @@ -1,4 +1,4 @@ -/* $Id: move.c,v 1.6 2002/09/07 15:12:26 chorns Exp $ +/* $Id: move.c,v 1.7 2002/09/08 10:22:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,9 +11,9 @@ /* INCLUDES *****************************************************************/ +#include #include -#define NTOS_USER_MODE -#include +#include #define NDEBUG #include @@ -129,9 +129,9 @@ MoveFileExW ( FileRename = (FILE_RENAME_INFORMATION *)Buffer; if ((dwFlags & MOVEFILE_REPLACE_EXISTING) == MOVEFILE_REPLACE_EXISTING) - FileRename->ReplaceIfExists = TRUE; + FileRename->Replace = TRUE; else - FileRename->ReplaceIfExists = FALSE; + FileRename->Replace = FALSE; FileRename->FileNameLength = wcslen (lpNewFileName); memcpy (FileRename->FileName, @@ -148,7 +148,7 @@ MoveFileExW ( { if (CopyFileW (lpExistingFileName, lpNewFileName, - FileRename->ReplaceIfExists)) + FileRename->Replace)) DeleteFileW (lpExistingFileName); } return TRUE; diff --git a/reactos/lib/kernel32/file/npipe.c b/reactos/lib/kernel32/file/npipe.c index b16f14d45fe..e1a5171b905 100644 --- a/reactos/lib/kernel32/file/npipe.c +++ b/reactos/lib/kernel32/file/npipe.c @@ -1,4 +1,4 @@ -/* $Id: npipe.c,v 1.12 2002/09/07 15:12:26 chorns Exp $ +/* $Id: npipe.c,v 1.13 2002/09/08 10:22:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -10,13 +10,16 @@ /* INCLUDES *****************************************************************/ +#include +#include #include -#define NTOS_USER_MODE -#include #include +//#include +//#include #include +#include -#define NDEBUG +//#define NDEBUG #include /* FUNCTIONS ****************************************************************/ diff --git a/reactos/lib/kernel32/file/pipe.c b/reactos/lib/kernel32/file/pipe.c index ee562e9ec2f..c0e62cc772c 100644 --- a/reactos/lib/kernel32/file/pipe.c +++ b/reactos/lib/kernel32/file/pipe.c @@ -1,4 +1,4 @@ -/* $Id: pipe.c,v 1.6 2002/09/07 15:12:26 chorns Exp $ +/* $Id: pipe.c,v 1.7 2002/09/08 10:22:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -10,8 +10,7 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include #include #include diff --git a/reactos/lib/kernel32/file/rw.c b/reactos/lib/kernel32/file/rw.c index e2cea002854..c0255b6f808 100644 --- a/reactos/lib/kernel32/file/rw.c +++ b/reactos/lib/kernel32/file/rw.c @@ -1,4 +1,4 @@ -/* $Id: rw.c,v 1.18 2002/09/07 15:12:26 chorns Exp $ +/* $Id: rw.c,v 1.19 2002/09/08 10:22:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,9 +11,8 @@ /* INCLUDES ****************************************************************/ +#include #include -#define NTOS_USER_MODE -#include #include #include diff --git a/reactos/lib/kernel32/file/tape.c b/reactos/lib/kernel32/file/tape.c index 98d92631e63..9220a12ebe3 100644 --- a/reactos/lib/kernel32/file/tape.c +++ b/reactos/lib/kernel32/file/tape.c @@ -1,4 +1,4 @@ -/* $Id: tape.c,v 1.2 2002/09/07 15:12:26 chorns Exp $ +/* $Id: tape.c,v 1.3 2002/09/08 10:22:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -12,9 +12,8 @@ /* INCLUDES *****************************************************************/ +#include #include -#define NTOS_USER_MODE -#include #include #include diff --git a/reactos/lib/kernel32/file/volume.c b/reactos/lib/kernel32/file/volume.c index 77b01495812..8642f75a9e4 100644 --- a/reactos/lib/kernel32/file/volume.c +++ b/reactos/lib/kernel32/file/volume.c @@ -1,4 +1,4 @@ -/* $Id: volume.c,v 1.25 2002/09/07 15:12:26 chorns Exp $ +/* $Id: volume.c,v 1.26 2002/09/08 10:22:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -19,9 +19,9 @@ * Copyright 1996 Alexandre Julliard */ +#include #include -#define NTOS_USER_MODE -#include +#include #define NDEBUG #include diff --git a/reactos/lib/kernel32/include/kernel32.h b/reactos/lib/kernel32/include/kernel32.h deleted file mode 100755 index 85da998f75b..00000000000 --- a/reactos/lib/kernel32/include/kernel32.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __KERNEL32_H -#define __KERNEL32_H - -#define _KERNEL32_ -#define WINBASEAPI -#include -#define NTOS_USER_MODE -#include - -#endif /* __KERNEL32_H */ diff --git a/reactos/lib/kernel32/kernel32.edf b/reactos/lib/kernel32/kernel32.edf index 5bdbfba1f68..8c430196713 100644 --- a/reactos/lib/kernel32/kernel32.edf +++ b/reactos/lib/kernel32/kernel32.edf @@ -1,4 +1,4 @@ -; $Id: kernel32.edf,v 1.12 2002/09/07 15:12:25 chorns Exp $ +; $Id: kernel32.edf,v 1.13 2002/09/08 10:22:41 chorns Exp $ ; ; kernel32.edf ; @@ -238,7 +238,7 @@ GetCurrencyFormatW=GetCurrencyFormatW@24 GetCurrentConsoleFont=GetCurrentConsoleFont@12 GetCurrentDirectoryA=GetCurrentDirectoryA@8 GetCurrentDirectoryW=GetCurrentDirectoryW@8 -GetCurrentFiber=InternalGetCurrentFiber@0 +GetCurrentFiber=GetCurrentFiber@0 GetCurrentProcess=GetCurrentProcess@0 GetCurrentProcessId=GetCurrentProcessId@0 GetCurrentThread=GetCurrentThread@0 @@ -260,7 +260,7 @@ GetEnvironmentVariableA=GetEnvironmentVariableA@12 GetEnvironmentVariableW=GetEnvironmentVariableW@12 GetExitCodeProcess=GetExitCodeProcess@8 GetExitCodeThread=GetExitCodeThread@8 -GetFiberData=InternalGetFiberData@0 +GetFiberData=GetFiberData@0 GetFileAttributesA=GetFileAttributesA@4 GetFileAttributesW=GetFileAttributesW@4 GetFileInformationByHandle=GetFileInformationByHandle@8 diff --git a/reactos/lib/kernel32/kernel32.rc b/reactos/lib/kernel32/kernel32.rc index 11d1b1150d6..78588bb0034 100644 --- a/reactos/lib/kernel32/kernel32.rc +++ b/reactos/lib/kernel32/kernel32.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/kernel32/makefile b/reactos/lib/kernel32/makefile index 2df7e728338..d88d2ec2189 100644 --- a/reactos/lib/kernel32/makefile +++ b/reactos/lib/kernel32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.52 2002/09/07 15:12:25 chorns Exp $ +# $Id: makefile,v 1.53 2002/09/08 10:22:41 chorns Exp $ PATH_TO_TOP = ../.. @@ -6,14 +6,16 @@ TARGET_TYPE = dynlink TARGET_NAME = kernel32 -TARGET_BASE = 0x78600000 +TARGET_BASE = 0x77f00000 -TARGET_CFLAGS = -I./include +TARGET_CFLAGS = -DKERNEL32_BASE=$(TARGET_DLLBASE) -TARGET_LFLAGS = -nostartfiles -nostdlib +TARGET_LFLAGS = -nostartfiles TARGET_SDKLIBS = ntdll.a +TARGET_GCCLIBS = gcc + TARGET_OBJECTS = $(TARGET_NAME).o TARGET_CLEAN = except/*.o file/*.o mem/*.o misc/*.o nls/*.o \ diff --git a/reactos/lib/kernel32/mem/global.c b/reactos/lib/kernel32/mem/global.c index ef74c711555..4347c24e4ac 100644 --- a/reactos/lib/kernel32/mem/global.c +++ b/reactos/lib/kernel32/mem/global.c @@ -1,4 +1,4 @@ -/* $Id: global.c,v 1.8 2002/09/07 15:12:26 chorns Exp $ +/* $Id: global.c,v 1.9 2002/09/08 10:22:43 chorns Exp $ * * Win32 Global/Local heap functions (GlobalXXX, LocalXXX). * These functions included in Win32 for compatibility with 16 bit Windows @@ -11,9 +11,9 @@ * NOTE: Only fixed memory is implemented!! */ +#include +#include #include -#define NTOS_USER_MODE -#include #define NDEBUG #include @@ -219,7 +219,7 @@ VOID STDCALL GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) { NTSTATUS Status; - SYSTEM_PERFORMANCE_INFORMATION Spi; + SYSTEM_PERFORMANCE_INFO Spi; QUOTA_LIMITS Ql; VM_COUNTERS Vmc; PIMAGE_NT_HEADERS ImageNtHeader; diff --git a/reactos/lib/kernel32/mem/heap.c b/reactos/lib/kernel32/mem/heap.c index 2ddba7d919e..ffad20a220a 100644 --- a/reactos/lib/kernel32/mem/heap.c +++ b/reactos/lib/kernel32/mem/heap.c @@ -1,4 +1,4 @@ -/* $Id: heap.c,v 1.20 2002/09/07 15:12:26 chorns Exp $ +/* $Id: heap.c,v 1.21 2002/09/08 10:22:43 chorns Exp $ * * kernel/heap.c * Copyright (C) 1996, Onno Hovers, All rights reserved @@ -27,8 +27,8 @@ * Put the type definitions of the heap in a seperate header. Boudewijn Dekker */ -#define NTOS_USER_MODE -#include +#include +#include #define NDEBUG #include diff --git a/reactos/lib/kernel32/mem/isbad.c b/reactos/lib/kernel32/mem/isbad.c index 398256bb99c..abe28093a3a 100644 --- a/reactos/lib/kernel32/mem/isbad.c +++ b/reactos/lib/kernel32/mem/isbad.c @@ -1,14 +1,11 @@ -/* $Id: isbad.c,v 1.3 2002/09/07 15:12:26 chorns Exp $ +/* $Id: isbad.c,v 1.4 2002/09/08 10:22:43 chorns Exp $ * * lib/kernel32/mem/isbad.c * * ReactOS Operating System * */ - #include -#define NTOS_USER_MODE -#include /* FIXME: Stubs. What is it for? */ UINT diff --git a/reactos/lib/kernel32/mem/local.c b/reactos/lib/kernel32/mem/local.c index 8e1d19e575b..ee2d1f19540 100644 --- a/reactos/lib/kernel32/mem/local.c +++ b/reactos/lib/kernel32/mem/local.c @@ -1,4 +1,4 @@ -/* $Id: local.c,v 1.6 2002/09/07 15:12:27 chorns Exp $ +/* $Id: local.c,v 1.7 2002/09/08 10:22:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * Copyright (C) 1996, Onno Hovers, All rights reserved @@ -21,9 +21,9 @@ /* INCLUDES ****************************************************************/ +#include +#include #include -#define NTOS_USER_MODE -#include #define NDEBUG #include diff --git a/reactos/lib/kernel32/mem/procmem.c b/reactos/lib/kernel32/mem/procmem.c index 858ed374520..708579e2bec 100644 --- a/reactos/lib/kernel32/mem/procmem.c +++ b/reactos/lib/kernel32/mem/procmem.c @@ -1,4 +1,4 @@ -/* $Id: procmem.c,v 1.3 2002/09/07 15:12:27 chorns Exp $ +/* $Id: procmem.c,v 1.4 2002/09/08 10:22:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,11 +9,10 @@ /* INCLUDES ******************************************************************/ -#include -#define NTOS_USER_MODE -#include -#include +#include +#include +#include /* FUNCTIONS *****************************************************************/ WINBOOL diff --git a/reactos/lib/kernel32/mem/section.c b/reactos/lib/kernel32/mem/section.c index 295816fdafc..2c61b5045af 100644 --- a/reactos/lib/kernel32/mem/section.c +++ b/reactos/lib/kernel32/mem/section.c @@ -1,4 +1,4 @@ -/* $Id: section.c,v 1.15 2002/09/07 15:12:27 chorns Exp $ +/* $Id: section.c,v 1.16 2002/09/08 10:22:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,12 +9,10 @@ /* INCLUDES ******************************************************************/ -#include -#define NTOS_USER_MODE -#include +#include #include +#include -#define NDEBUG #include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/kernel32/mem/virtual.c b/reactos/lib/kernel32/mem/virtual.c index 06fa10b2ff3..5873dc723cc 100644 --- a/reactos/lib/kernel32/mem/virtual.c +++ b/reactos/lib/kernel32/mem/virtual.c @@ -1,4 +1,4 @@ -/* $Id: virtual.c,v 1.8 2002/09/07 15:12:27 chorns Exp $ +/* $Id: virtual.c,v 1.9 2002/09/08 10:22:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,10 +9,9 @@ /* INCLUDES ******************************************************************/ -#include -#define NTOS_USER_MODE -#include +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/kernel32/misc/atom.c b/reactos/lib/kernel32/misc/atom.c index 9da86ecf2ba..e855d84ec32 100644 --- a/reactos/lib/kernel32/misc/atom.c +++ b/reactos/lib/kernel32/misc/atom.c @@ -1,4 +1,4 @@ -/* $Id: atom.c,v 1.14 2002/09/07 15:12:27 chorns Exp $ +/* $Id: atom.c,v 1.15 2002/09/08 10:22:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -10,9 +10,8 @@ * Full rewrite 27/05/2001 */ +#include #include -#define NTOS_USER_MODE -#include #include #define NDEBUG @@ -49,7 +48,6 @@ GlobalAddAtomA(LPCSTR lpString) (LPSTR)lpString); Status = NtAddAtom(AtomName.Buffer, - AtomName.Length, &Atom); RtlFreeUnicodeString(&AtomName); if (!NT_SUCCESS(Status)) @@ -79,7 +77,6 @@ GlobalAddAtomW(LPCWSTR lpString) } Status = NtAddAtom((LPWSTR)lpString, - wcslen(lpString), &Atom); if (!NT_SUCCESS(Status)) { @@ -132,7 +129,6 @@ GlobalFindAtomA(LPCSTR lpString) RtlCreateUnicodeStringFromAsciiz(&AtomName, (LPSTR)lpString); Status = NtFindAtom(AtomName.Buffer, - AtomName.Length, &Atom); RtlFreeUnicodeString(&AtomName); if (!NT_SUCCESS(Status)) @@ -162,7 +158,6 @@ GlobalFindAtomW(LPCWSTR lpString) } Status = NtFindAtom((LPWSTR)lpString, - wcslen(lpString), &Atom); if (!NT_SUCCESS(Status)) { diff --git a/reactos/lib/kernel32/misc/comm.c b/reactos/lib/kernel32/misc/comm.c index 94bdec529fa..3a273408a92 100644 --- a/reactos/lib/kernel32/misc/comm.c +++ b/reactos/lib/kernel32/misc/comm.c @@ -1,4 +1,4 @@ -/* $Id: comm.c,v 1.3 2002/09/07 15:12:27 chorns Exp $ +/* $Id: comm.c,v 1.4 2002/09/08 10:22:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -10,14 +10,12 @@ * Created 01/11/98 */ -#include -#define NTOS_USER_MODE -#include +#include #include #include #include #include - +//#include WINBOOL STDCALL diff --git a/reactos/lib/kernel32/misc/console.c b/reactos/lib/kernel32/misc/console.c index 61ca852f4e7..992e1f60779 100644 --- a/reactos/lib/kernel32/misc/console.c +++ b/reactos/lib/kernel32/misc/console.c @@ -1,4 +1,4 @@ -/* $Id: console.c,v 1.42 2002/09/07 15:12:27 chorns Exp $ +/* $Id: console.c,v 1.43 2002/09/08 10:22:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -13,12 +13,14 @@ /* INCLUDES ******************************************************************/ -#include -#define NTOS_USER_MODE -#include +#include +#include +#include #include #include + #include +#include #define NDEBUG #include @@ -578,7 +580,7 @@ GetStdHandle(DWORD nStdHandle) * of the specified device. Otherwise the value is INVALID_HANDLE_VALUE. */ { - PRTL_ROS_USER_PROCESS_PARAMETERS Ppb; + PRTL_USER_PROCESS_PARAMETERS Ppb; Ppb = NtCurrentPeb()->ProcessParameters; switch (nStdHandle) @@ -603,7 +605,7 @@ SetStdHandle(DWORD nStdHandle, * RETURNS: TRUE if the function succeeds, FALSE otherwise. */ { - PRTL_ROS_USER_PROCESS_PARAMETERS Ppb; + PRTL_USER_PROCESS_PARAMETERS Ppb; Ppb = NtCurrentPeb()->ProcessParameters; @@ -1935,7 +1937,7 @@ GetConsoleTitleW( & Re.quest, & Re.ply, (sizeof (CSRSS_GET_TITLE_REQUEST) + - sizeof (LPC_MESSAGE) + + sizeof (LPC_MESSAGE_HEADER) + sizeof (ULONG)), sizeof (CSRSS_API_REPLY) ); @@ -2052,7 +2054,7 @@ SetConsoleTitleW( &Reply, sizeof(CSRSS_SET_TITLE_REQUEST) + c + - sizeof( LPC_MESSAGE ) + + sizeof( LPC_MESSAGE_HEADER ) + sizeof( ULONG ), sizeof(CSRSS_API_REPLY)); @@ -2105,7 +2107,7 @@ SetConsoleTitleA( &Reply, sizeof(CSRSS_SET_TITLE_REQUEST) + c + - sizeof( LPC_MESSAGE ) + + sizeof( LPC_MESSAGE_HEADER ) + sizeof( ULONG ), sizeof(CSRSS_API_REPLY)); @@ -2202,6 +2204,7 @@ WriteConsoleW( return(FALSE); } + /*-------------------------------------------------------------- * CreateConsoleScreenBuffer */ diff --git a/reactos/lib/kernel32/misc/debug.c b/reactos/lib/kernel32/misc/debug.c index 55374dee7f7..17530ff93c3 100644 --- a/reactos/lib/kernel32/misc/debug.c +++ b/reactos/lib/kernel32/misc/debug.c @@ -1,4 +1,4 @@ -/* $Id: debug.c,v 1.4 2002/09/07 15:12:27 chorns Exp $ +/* $Id: debug.c,v 1.5 2002/09/08 10:22:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -9,10 +9,10 @@ /* INCLUDES ******************************************************************/ -#include -#define NTOS_USER_MODE -#include +#include +#include #include +#include #include #include diff --git a/reactos/lib/kernel32/misc/dllmain.c b/reactos/lib/kernel32/misc/dllmain.c index 615811a0dda..9fb6c0212f9 100644 --- a/reactos/lib/kernel32/misc/dllmain.c +++ b/reactos/lib/kernel32/misc/dllmain.c @@ -1,4 +1,4 @@ -/* $Id: dllmain.c,v 1.22 2002/09/07 15:12:27 chorns Exp $ +/* $Id: dllmain.c,v 1.23 2002/09/08 10:22:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,9 +11,10 @@ /* INCLUDES ******************************************************************/ +#include +#include +#include #include -#define NTOS_USER_MODE -#include #include #define NDEBUG @@ -34,7 +35,7 @@ WINBOOL STDCALL DllMain (HANDLE hInst, LPVOID lpReserved); /* Critical section for various kernel32 data structures */ -RTL_CRITICAL_SECTION DllLock; +CRITICAL_SECTION DllLock; /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/kernel32/misc/env.c b/reactos/lib/kernel32/misc/env.c index 9b33a5c184e..0f981f7125a 100644 --- a/reactos/lib/kernel32/misc/env.c +++ b/reactos/lib/kernel32/misc/env.c @@ -1,4 +1,4 @@ -/* $Id: env.c,v 1.14 2002/09/07 15:12:27 chorns Exp $ +/* $Id: env.c,v 1.15 2002/09/08 10:22:44 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -9,10 +9,9 @@ * Created 01/11/98 */ -#include +#include +#include #include -#define NTOS_USER_MODE -#include #include #include @@ -218,8 +217,7 @@ STDCALL GetVersion(VOID) { DWORD Version = 0; - OSVERSIONINFOW VersionInformation; - + OSVERSIONINFO VersionInformation; GetVersionExW(&VersionInformation); Version |= ( VersionInformation.dwMajorVersion << 8 ); @@ -234,7 +232,7 @@ GetVersion(VOID) WINBOOL STDCALL GetVersionExW( - LPOSVERSIONINFOW lpVersionInformation + LPOSVERSIONINFO lpVersionInformation ) { lpVersionInformation->dwOSVersionInfoSize = sizeof(OSVERSIONINFO); @@ -250,7 +248,7 @@ GetVersionExW( WINBOOL STDCALL GetVersionExA( - LPOSVERSIONINFOA lpVersionInformation + LPOSVERSIONINFO lpVersionInformation ) { lpVersionInformation->dwOSVersionInfoSize = sizeof(OSVERSIONINFO); diff --git a/reactos/lib/kernel32/misc/error.c b/reactos/lib/kernel32/misc/error.c index 301e42886cb..38ff1cba4fd 100644 --- a/reactos/lib/kernel32/misc/error.c +++ b/reactos/lib/kernel32/misc/error.c @@ -1,15 +1,12 @@ -/* $Id: error.c,v 1.15 2002/09/07 15:12:27 chorns Exp $ +/* $Id: error.c,v 1.16 2002/09/08 10:22:44 chorns Exp $ * * reactos/lib/kernel32/misc/error.c * */ - -#include -#define NTOS_USER_MODE -#include +#include #include -#define NDEBUG +// #define NDEBUG #include #include diff --git a/reactos/lib/kernel32/misc/handle.c b/reactos/lib/kernel32/misc/handle.c index 2cc5cafacaf..6c22ea0ea91 100644 --- a/reactos/lib/kernel32/misc/handle.c +++ b/reactos/lib/kernel32/misc/handle.c @@ -1,4 +1,4 @@ -/* $Id: handle.c,v 1.7 2002/09/07 15:12:27 chorns Exp $ +/* $Id: handle.c,v 1.8 2002/09/08 10:22:44 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,9 +11,8 @@ /* INCLUDES ******************************************************************/ +#include #include -#define NTOS_USER_MODE -#include #define NDEBUG #include @@ -141,7 +140,7 @@ WINBOOL STDCALL DuplicateHandle(HANDLE hSourceProcessHandle, hTargetProcessHandle, lpTargetHandle, dwDesiredAccess, - (ULONG)(bInheritHandle ? HANDLE_FLAG_INHERIT : 0), + (BOOLEAN)bInheritHandle, dwOptions); if (!NT_SUCCESS(errCode)) { diff --git a/reactos/lib/kernel32/misc/ldr.c b/reactos/lib/kernel32/misc/ldr.c index b5af9a87d85..792a742dc78 100644 --- a/reactos/lib/kernel32/misc/ldr.c +++ b/reactos/lib/kernel32/misc/ldr.c @@ -1,4 +1,4 @@ -/* $Id: ldr.c,v 1.12 2002/09/07 15:12:27 chorns Exp $ +/* $Id: ldr.c,v 1.13 2002/09/08 10:22:44 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT : ReactOS user mode libraries @@ -7,9 +7,9 @@ * AUTHOR : Boudewijn Dekker */ +#include +#include #include -#define NTOS_USER_MODE -#include #define NDEBUG #include diff --git a/reactos/lib/kernel32/misc/profile.c b/reactos/lib/kernel32/misc/profile.c index 8adad8179ef..8a124a42b72 100644 --- a/reactos/lib/kernel32/misc/profile.c +++ b/reactos/lib/kernel32/misc/profile.c @@ -1,4 +1,4 @@ -/* $Id: profile.c,v 1.4 2002/09/07 15:12:27 chorns Exp $ +/* $Id: profile.c,v 1.5 2002/09/08 10:22:44 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -10,11 +10,11 @@ * Created 01/11/98 */ +#include #include -#define NTOS_USER_MODE -#include #include #include +//#include /* FUNCTIONS *****************************************************************/ @@ -81,9 +81,9 @@ GetPrivateProfileSectionA ( DWORD STDCALL GetPrivateProfileSectionNamesW ( - LPWSTR lpszReturnBuffer, - DWORD nSize, - LPCWSTR lpFileName + DWORD Unknown0, + DWORD Unknown1, + DWORD Unknown2 ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -93,9 +93,9 @@ GetPrivateProfileSectionNamesW ( DWORD STDCALL GetPrivateProfileSectionNamesA ( - LPSTR lpszReturnBuffer, - DWORD nSize, - LPCSTR lpFileName + DWORD Unknown0, + DWORD Unknown1, + DWORD Unknown2 ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -132,13 +132,14 @@ GetPrivateProfileStringA ( return 0; } -BOOL STDCALL + +DWORD STDCALL GetPrivateProfileStructW ( - LPCWSTR lpszSection, - LPCWSTR lpszKey, - LPVOID lpStruct, - UINT uSizeStruct, - LPCWSTR szFile + DWORD Unknown0, + DWORD Unknown1, + DWORD Unknown2, + DWORD Unknown3, + DWORD Unknown4 ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -146,13 +147,13 @@ GetPrivateProfileStructW ( } -BOOL STDCALL +DWORD STDCALL GetPrivateProfileStructA ( - LPCSTR lpszSection, - LPCSTR lpszKey, - LPVOID lpStruct, - UINT uSizeStruct, - LPCSTR szFile + DWORD Unknown0, + DWORD Unknown1, + DWORD Unknown2, + DWORD Unknown3, + DWORD Unknown4 ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -306,28 +307,28 @@ WritePrivateProfileStringW(LPCWSTR lpAppName, } -BOOL STDCALL -WritePrivateProfileStructA( - LPCSTR lpszSection, - LPCSTR lpszKey, - LPVOID lpStruct, - UINT uSizeStruct, - LPCSTR szFile - ) +WINBOOL STDCALL +WritePrivateProfileStructA ( + DWORD Unknown0, + DWORD Unknown1, + DWORD Unknown2, + DWORD Unknown3, + DWORD Unknown4 + ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } -BOOL STDCALL -WritePrivateProfileStructW( - LPCWSTR lpszSection, - LPCWSTR lpszKey, - LPVOID lpStruct, - UINT uSizeStruct, - LPCWSTR szFile - ) +WINBOOL STDCALL +WritePrivateProfileStructW ( + DWORD Unknown0, + DWORD Unknown1, + DWORD Unknown2, + DWORD Unknown3, + DWORD Unknown4 + ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; diff --git a/reactos/lib/kernel32/misc/res.c b/reactos/lib/kernel32/misc/res.c index 0200eed7356..4cc6320827b 100644 --- a/reactos/lib/kernel32/misc/res.c +++ b/reactos/lib/kernel32/misc/res.c @@ -1,4 +1,4 @@ -/* $Id: res.c,v 1.10 2002/09/07 15:12:27 chorns Exp $ +/* $Id: res.c,v 1.11 2002/09/08 10:22:45 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT : ReactOS user mode libraries @@ -7,11 +7,9 @@ * AUTHOR : ??? */ +#include #include -#define NTOS_USER_MODE -#include - -#define NDEBUG +#include #include #include diff --git a/reactos/lib/kernel32/misc/stubs.c b/reactos/lib/kernel32/misc/stubs.c index 1198ded64c6..4ecd6c85c4f 100644 --- a/reactos/lib/kernel32/misc/stubs.c +++ b/reactos/lib/kernel32/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.31 2002/09/07 15:12:27 chorns Exp $ +/* $Id: stubs.c,v 1.32 2002/09/08 10:22:45 chorns Exp $ * * KERNEL32.DLL stubs (unimplemented functions) * Remove from this file, if you implement them. @@ -82,10 +82,11 @@ CreateVirtualBuffer ( return 0; } -BOOL + +WINBOOL STDCALL EnumCalendarInfoW ( - CALINFO_ENUMPROCW lpCalInfoEnumProc, + CALINFO_ENUMPROC lpCalInfoEnumProc, LCID Locale, CALID Calendar, CALTYPE CalType @@ -97,10 +98,10 @@ EnumCalendarInfoW ( -BOOL +WINBOOL STDCALL EnumCalendarInfoA ( - CALINFO_ENUMPROCA lpCalInfoEnumProc, + CALINFO_ENUMPROC lpCalInfoEnumProc, LCID Locale, CALID Calendar, CALTYPE CalType @@ -111,10 +112,10 @@ EnumCalendarInfoA ( } -BOOL +WINBOOL STDCALL EnumDateFormatsW ( - DATEFMT_ENUMPROCW lpDateFmtEnumProc, + DATEFMT_ENUMPROC lpDateFmtEnumProc, LCID Locale, DWORD dwFlags ) @@ -139,10 +140,10 @@ EnumDateFormatsA ( -BOOL +WINBOOL STDCALL EnumSystemCodePagesW ( - CODEPAGE_ENUMPROCW lpCodePageEnumProc, + CODEPAGE_ENUMPROC lpCodePageEnumProc, DWORD dwFlags ) { @@ -151,10 +152,10 @@ EnumSystemCodePagesW ( } -BOOL +WINBOOL STDCALL EnumSystemCodePagesA ( - CODEPAGE_ENUMPROCA lpCodePageEnumProc, + CODEPAGE_ENUMPROC lpCodePageEnumProc, DWORD dwFlags ) { @@ -163,10 +164,10 @@ EnumSystemCodePagesA ( } -BOOL +WINBOOL STDCALL EnumSystemLocalesW ( - LOCALE_ENUMPROCW lpLocaleEnumProc, + LOCALE_ENUMPROC lpLocaleEnumProc, DWORD dwFlags ) { @@ -175,10 +176,10 @@ EnumSystemLocalesW ( } -BOOL +WINBOOL STDCALL EnumSystemLocalesA ( - LOCALE_ENUMPROCA lpLocaleEnumProc, + LOCALE_ENUMPROC lpLocaleEnumProc, DWORD dwFlags ) { @@ -187,10 +188,10 @@ EnumSystemLocalesA ( } -BOOL +WINBOOL STDCALL EnumTimeFormatsW ( - TIMEFMT_ENUMPROCW lpTimeFmtEnumProc, + TIMEFMT_ENUMPROC lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags ) @@ -422,13 +423,14 @@ GetComputerNameA ( + int STDCALL GetCurrencyFormatW ( LCID Locale, DWORD dwFlags, LPCWSTR lpValue, - CONST CURRENCYFMTW * lpFormat, + CONST CURRENCYFMT * lpFormat, LPWSTR lpCurrencyStr, int cchCurrency ) @@ -444,7 +446,7 @@ GetCurrencyFormatA ( LCID Locale, DWORD dwFlags, LPCSTR lpValue, - CONST CURRENCYFMTA * lpFormat, + CONST CURRENCYFMT * lpFormat, LPSTR lpCurrencyStr, int cchCurrency ) @@ -534,7 +536,7 @@ GetNumberFormatW ( LCID Locale, DWORD dwFlags, LPCWSTR lpValue, - CONST NUMBERFMTW * lpFormat, + CONST NUMBERFMT * lpFormat, LPWSTR lpNumberStr, int cchNumber ) @@ -550,7 +552,7 @@ GetNumberFormatA ( LCID Locale, DWORD dwFlags, LPCSTR lpValue, - CONST NUMBERFMTA * lpFormat, + CONST NUMBERFMT * lpFormat, LPSTR lpNumberStr, int cchNumber ) @@ -654,14 +656,14 @@ GetSystemDefaultLangID (VOID) } -BOOL +DWORD STDCALL GetSystemPowerStatus ( - LPSYSTEM_POWER_STATUS lpSystemPowerStatus + DWORD Unknown0 ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + return 0; } @@ -1183,12 +1185,11 @@ SetLocaleInfoW ( } - -BOOL +WINBOOL STDCALL SetSystemPowerState ( - BOOL fSuspend, - BOOL fForce + DWORD Unknown0, + DWORD Unknown1 ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); diff --git a/reactos/lib/kernel32/misc/sysinfo.c b/reactos/lib/kernel32/misc/sysinfo.c index 626c7512992..c8a08655c44 100644 --- a/reactos/lib/kernel32/misc/sysinfo.c +++ b/reactos/lib/kernel32/misc/sysinfo.c @@ -1,17 +1,16 @@ -/* $Id: sysinfo.c,v 1.4 2002/09/07 15:12:27 chorns Exp $ +/* $Id: sysinfo.c,v 1.5 2002/09/08 10:22:45 chorns Exp $ * * reactos/lib/kernel32/misc/sysinfo.c * */ -#define WIN32_LEAN_AND_MEAN -#include -#define NTOS_USER_MODE -#include +#include -#define NDEBUG #include #include +#define WIN32_LEAN_AND_MEAN +#include + #define PV_NT351 0x00030033 @@ -56,14 +55,14 @@ GetSystemInfo ( * PROCESSOR_ARCHITECTURE_PPC 3 * PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF */ - Si->wProcessorArchitecture = Spi.ProcessorArchitecture; + Si->u.s.wProcessorArchitecture = Spi.ProcessorArchitecture; /* For future use: always zero */ - Si->wReserved = 0; - Si->dwPageSize = Sbi.PhysicalPageSize; - Si->lpMinimumApplicationAddress = (PVOID)Sbi.LowestUserAddress; - Si->lpMaximumApplicationAddress = (PVOID)Sbi.HighestUserAddress; - Si->dwActiveProcessorMask = Sbi.ActiveProcessors; - Si->dwNumberOfProcessors = Sbi.NumberProcessors; + Si->u.s.wReserved = 0; + Si->dwPageSize = Sbi.PageSize; + Si->lpMinimumApplicationAddress = (PVOID)Sbi.MinimumUserModeAddress; + Si->lpMaximumApplicationAddress = (PVOID)Sbi.MaximumUserModeAddress; + Si->dwActiveProcessorMask = Sbi.ActiveProcessorsAffinityMask; + Si->dwNumberOfProcessors = Sbi.NumberOfProcessors; /* * Compatibility (no longer relevant): * PROCESSOR_INTEL_386 386 diff --git a/reactos/lib/kernel32/misc/time.c b/reactos/lib/kernel32/misc/time.c index beac5c221e3..5b2ebc76aed 100644 --- a/reactos/lib/kernel32/misc/time.c +++ b/reactos/lib/kernel32/misc/time.c @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.15 2002/09/07 15:12:27 chorns Exp $ +/* $Id: time.c,v 1.16 2002/09/08 10:22:45 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -12,10 +12,10 @@ /* INCLUDES ******************************************************************/ +#include #include -#define NTOS_USER_MODE -#include #include +//#include #define NDEBUG #include @@ -265,37 +265,18 @@ FileTimeToSystemTime( int LeapSecondCorrections, SecondsInDay, CurYear; int LeapYear, CurMonth; long int Days; - LARGE_INTEGER Time; - LARGE_INTEGER Dividend; - //LARGE_INTEGER Divisor; - LARGE_INTEGER Remainder; - LARGE_INTEGER Result; + long long int Time = *((long long int*)lpFileTime); - Time.QuadPart = *((PLONGLONG)lpFileTime); - - /* Extract millisecond from time and convert time into seconds */ - - Dividend.QuadPart = TICKSPERSEC; - RtlLargeIntegerDivide(Time, Dividend, &Remainder); - - Dividend.QuadPart = TICKSPERMSEC; - Result = RtlLargeIntegerDivide(Remainder, Dividend, NULL); - lpSystemTime->wMilliseconds = (WORD)Dividend.LowPart; - - Dividend.QuadPart = TICKSPERMSEC; - Time = RtlLargeIntegerDivide(Time, Dividend, NULL); + /* Extract millisecond from time and convert time into seconds */ + lpSystemTime->wMilliseconds = (WORD)((Time % TICKSPERSEC) / TICKSPERMSEC); + Time = Time / TICKSPERSEC; /* FIXME: Compute the number of leap second corrections here */ LeapSecondCorrections = 0; /* Split the time into days and seconds within the day */ - Dividend.QuadPart = SECSPERDAY; - Result = RtlLargeIntegerDivide(Time, Dividend, NULL); - Days = (long int)Result.QuadPart; - - Dividend.QuadPart = SECSPERDAY; - RtlLargeIntegerDivide(Time, Dividend, &Remainder); - SecondsInDay = (long int)Remainder.QuadPart; + Days = Time / SECSPERDAY; + SecondsInDay = Time % SECSPERDAY; /* Adjust the values for GMT and leap seconds */ SecondsInDay += LeapSecondCorrections; @@ -342,10 +323,12 @@ FileTimeToSystemTime( Days = Days - (long) Months[CurMonth]; lpSystemTime->wMonth = (WORD) (CurMonth + 1); lpSystemTime->wDay = (WORD) (Days + 1); + return TRUE; } -BOOL + +WINBOOL STDCALL FileTimeToLocalFileTime( CONST FILETIME *lpFileTime, @@ -475,8 +458,6 @@ SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation) } -#undef GetCurrentTime - DWORD STDCALL GetCurrentTime(VOID) { @@ -557,14 +538,14 @@ SetSystemTimeAdjustment(DWORD dwTimeAdjustment, WINBOOL bTimeAdjustmentDisabled) { NTSTATUS Status; - SYSTEM_SET_TIME_ADJUSTMENT Buffer; + SYSTEM_TIME_ADJUSTMENT_INFO Buffer; Buffer.TimeAdjustment = (ULONG)dwTimeAdjustment; Buffer.TimeSynchronization = (BOOLEAN)bTimeAdjustmentDisabled; Status = NtSetSystemInformation(SystemTimeAdjustmentInformation, &Buffer, - sizeof(SYSTEM_SET_TIME_ADJUSTMENT)); + sizeof(SYSTEM_TIME_ADJUSTMENT_INFO)); if (!NT_SUCCESS(Status)) { SetLastErrorByStatus(Status); diff --git a/reactos/lib/kernel32/process/cmdline.c b/reactos/lib/kernel32/process/cmdline.c index eb0ec7cdd28..7ba43238393 100644 --- a/reactos/lib/kernel32/process/cmdline.c +++ b/reactos/lib/kernel32/process/cmdline.c @@ -1,4 +1,4 @@ -/* $Id: cmdline.c,v 1.14 2002/09/07 15:12:27 chorns Exp $ +/* $Id: cmdline.c,v 1.15 2002/09/08 10:22:45 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,14 +11,14 @@ /* INCLUDES ****************************************************************/ +#include #include -#define NTOS_USER_MODE -#include - #include #include #include #include +#include +#include #define NDEBUG #include @@ -37,11 +37,11 @@ static WINBOOL bCommandLineInitialized = FALSE; static VOID InitCommandLines (VOID) { - PRTL_ROS_USER_PROCESS_PARAMETERS Params; + PRTL_USER_PROCESS_PARAMETERS Params; // get command line Params = NtCurrentPeb()->ProcessParameters; - RtlRosNormalizeProcessParams (Params); + RtlNormalizeProcessParams (Params); // initialize command line buffers CommandLineStringW.Length = Params->CommandLine.Length; diff --git a/reactos/lib/kernel32/process/create.c b/reactos/lib/kernel32/process/create.c index 63d5537f32c..960a53d135a 100644 --- a/reactos/lib/kernel32/process/create.c +++ b/reactos/lib/kernel32/process/create.c @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.51 2002/09/07 15:12:27 chorns Exp $ +/* $Id: create.c,v 1.52 2002/09/08 10:22:45 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,15 +11,19 @@ /* INCLUDES ****************************************************************/ +#include #include -#define NTOS_USER_MODE -#include #include #include #include #include -#include +#include +#include +#include #include +#include +#include +#include #define NDEBUG #include @@ -27,8 +31,6 @@ /* FUNCTIONS ****************************************************************/ -#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) - WINBOOL STDCALL CreateProcessA (LPCSTR lpApplicationName, LPSTR lpCommandLine, @@ -209,10 +211,10 @@ KlCreateFirstThread(HANDLE ProcessHandle, #if 0 InitialTeb.StackCommit = (StackCommit < PAGESIZE) ? PAGESIZE : StackCommit; #endif - InitialTeb.StackCommit = InitialTeb.StackReserve - PAGE_SIZE; + InitialTeb.StackCommit = InitialTeb.StackReserve - PAGESIZE; /* size of guard page */ - InitialTeb.StackCommit += PAGE_SIZE; + InitialTeb.StackCommit += PAGESIZE; /* Reserve stack */ InitialTeb.StackAllocate = NULL; @@ -264,7 +266,7 @@ KlCreateFirstThread(HANDLE ProcessHandle, /* Protect guard page */ Status = NtProtectVirtualMemory(ProcessHandle, InitialTeb.StackLimit, - PAGE_SIZE, + PAGESIZE, PAGE_GUARD | PAGE_READWRITE, &OldPageProtection); if (!NT_SUCCESS(Status)) @@ -407,7 +409,7 @@ KlMapFile(LPCWSTR lpApplicationName) static NTSTATUS KlInitPeb (HANDLE ProcessHandle, - PRTL_ROS_USER_PROCESS_PARAMETERS Ppb, + PRTL_USER_PROCESS_PARAMETERS Ppb, PVOID* ImageBaseAddress) { NTSTATUS Status; @@ -475,7 +477,7 @@ KlInitPeb (HANDLE ProcessHandle, /* create the PPB */ PpbBase = NULL; - PpbSize = Ppb->AllocationSize; + PpbSize = Ppb->MaximumLength; Status = NtAllocateVirtualMemory(ProcessHandle, &PpbBase, 0, @@ -491,11 +493,11 @@ KlInitPeb (HANDLE ProcessHandle, NtWriteVirtualMemory(ProcessHandle, PpbBase, Ppb, - Ppb->AllocationSize, + Ppb->MaximumLength, &BytesWritten); /* write pointer to environment */ - Offset = FIELD_OFFSET(RTL_ROS_USER_PROCESS_PARAMETERS, Environment); + Offset = FIELD_OFFSET(RTL_USER_PROCESS_PARAMETERS, Environment); NtWriteVirtualMemory(ProcessHandle, (PVOID)(PpbBase + Offset), &EnvPtr, @@ -541,7 +543,7 @@ CreateProcessW(LPCWSTR lpApplicationName, UNICODE_STRING ImagePathName_U; PROCESS_BASIC_INFORMATION ProcessBasicInfo; ULONG retlen; - PRTL_ROS_USER_PROCESS_PARAMETERS Ppb; + PRTL_USER_PROCESS_PARAMETERS Ppb; UNICODE_STRING CommandLine_U; CSRSS_API_REQUEST CsrRequest; CSRSS_API_REPLY CsrReply; @@ -717,7 +719,7 @@ CreateProcessW(LPCWSTR lpApplicationName, ULONG i, Count = *(ULONG*)lpStartupInfo->lpReserved2; HANDLE * hFile; HANDLE hTemp; - PRTL_ROS_USER_PROCESS_PARAMETERS CurrPpb = NtCurrentPeb()->ProcessParameters; + PRTL_USER_PROCESS_PARAMETERS CurrPpb = NtCurrentPeb()->ProcessParameters; /* FIXME: @@ -735,7 +737,7 @@ CreateProcessW(LPCWSTR lpApplicationName, /* * Create the PPB */ - RtlRosCreateProcessParameters(&Ppb, + RtlCreateProcessParameters(&Ppb, &ImagePathName_U, NULL, lpCurrentDirectory ? &CurrentDirectory_U : NULL, @@ -760,7 +762,7 @@ CreateProcessW(LPCWSTR lpApplicationName, hProcess, &Ppb->CurrentDirectory.Handle, 0, - HANDLE_FLAG_INHERIT, + TRUE, DUPLICATE_SAME_ACCESS); } @@ -771,7 +773,7 @@ CreateProcessW(LPCWSTR lpApplicationName, hProcess, &Ppb->ConsoleHandle, 0, - HANDLE_FLAG_INHERIT, + TRUE, DUPLICATE_SAME_ACCESS); } @@ -843,7 +845,7 @@ CreateProcessW(LPCWSTR lpApplicationName, hProcess, &Ppb->InputHandle, 0, - HANDLE_FLAG_INHERIT, + TRUE, DUPLICATE_SAME_ACCESS); if(!NT_SUCCESS(Status)) { @@ -863,7 +865,7 @@ CreateProcessW(LPCWSTR lpApplicationName, hProcess, &Ppb->OutputHandle, 0, - HANDLE_FLAG_INHERIT, + TRUE, DUPLICATE_SAME_ACCESS); if(!NT_SUCCESS(Status)) { @@ -882,7 +884,7 @@ CreateProcessW(LPCWSTR lpApplicationName, hProcess, &Ppb->ErrorHandle, 0, - HANDLE_FLAG_INHERIT, + TRUE, DUPLICATE_SAME_ACCESS); if(!NT_SUCCESS(Status)) { @@ -922,7 +924,7 @@ CreateProcessW(LPCWSTR lpApplicationName, KlInitPeb(hProcess, Ppb, &ImageBaseAddress); - RtlRosDestroyProcessParameters (Ppb); + RtlDestroyProcessParameters (Ppb); Status = NtSetInformationProcess(hProcess, ProcessImageFileName, diff --git a/reactos/lib/kernel32/process/proc.c b/reactos/lib/kernel32/process/proc.c index 8660925e3ca..51d25b5869c 100644 --- a/reactos/lib/kernel32/process/proc.c +++ b/reactos/lib/kernel32/process/proc.c @@ -1,4 +1,4 @@ -/* $Id: proc.c,v 1.45 2002/09/07 15:12:27 chorns Exp $ +/* $Id: proc.c,v 1.46 2002/09/08 10:22:45 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,14 +11,19 @@ /* INCLUDES ****************************************************************/ +#include +#include #include -#define NTOS_USER_MODE -#include #include #include #include #include #include +#include +#include +#include +#include + #define NDEBUG #include @@ -371,7 +376,7 @@ SleepEx (DWORD dwMilliseconds, VOID STDCALL GetStartupInfoW(LPSTARTUPINFOW lpStartupInfo) { - PRTL_ROS_USER_PROCESS_PARAMETERS Params; + PRTL_USER_PROCESS_PARAMETERS Params; if (lpStartupInfo == NULL) { @@ -406,7 +411,7 @@ GetStartupInfoW(LPSTARTUPINFOW lpStartupInfo) VOID STDCALL GetStartupInfoA(LPSTARTUPINFOA lpStartupInfo) { - PRTL_ROS_USER_PROCESS_PARAMETERS Params; + PRTL_USER_PROCESS_PARAMETERS Params; ANSI_STRING AnsiString; if (lpStartupInfo == NULL) @@ -581,7 +586,7 @@ GetPriorityClass (HANDLE hProcess) GetCurrentProcess(), &hProcessTmp, (PROCESS_SET_INFORMATION | PROCESS_QUERY_INFORMATION), - 0, + FALSE, 0); if (!NT_SUCCESS(Status)) { @@ -613,7 +618,7 @@ WINBOOL STDCALL SetPriorityClass (HANDLE hProcess, DWORD dwPriorityClass) { - HANDLE hProcessTmp; + HANDLE hProcessTmp; DWORD CsrPriorityClass; NTSTATUS Status; diff --git a/reactos/lib/kernel32/process/session.c b/reactos/lib/kernel32/process/session.c index 79b70e43658..80290c9ae9b 100644 --- a/reactos/lib/kernel32/process/session.c +++ b/reactos/lib/kernel32/process/session.c @@ -1,4 +1,4 @@ -/* $Id: session.c,v 1.2 2002/09/07 15:12:28 chorns Exp $ +/* $Id: session.c,v 1.3 2002/09/08 10:22:45 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -8,8 +8,7 @@ * UPDATE HISTORY: * 2001-12-07 created */ -#define NTOS_USER_MODE -#include +#include BOOL STDCALL ProcessIdToSessionId ( DWORD dwProcessId, diff --git a/reactos/lib/kernel32/synch/critical.c b/reactos/lib/kernel32/synch/critical.c index daf6b550ab0..ecbbbd86eff 100644 --- a/reactos/lib/kernel32/synch/critical.c +++ b/reactos/lib/kernel32/synch/critical.c @@ -1,4 +1,4 @@ -/* $Id: critical.c,v 1.11 2002/09/07 15:12:28 chorns Exp $ +/* $Id: critical.c,v 1.12 2002/09/08 10:22:45 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -10,9 +10,8 @@ /* INCLUDES ******************************************************************/ -#include -#define NTOS_USER_MODE -#include +#include + #include @@ -23,7 +22,7 @@ InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection) { NTSTATUS Status; - Status = RtlInitializeCriticalSection((PRTL_CRITICAL_SECTION)lpCriticalSection); + Status = RtlInitializeCriticalSection(lpCriticalSection); if (!NT_SUCCESS(Status)) { RtlRaiseStatus(Status); diff --git a/reactos/lib/kernel32/synch/event.c b/reactos/lib/kernel32/synch/event.c index 025182c569b..9c9553c06b8 100644 --- a/reactos/lib/kernel32/synch/event.c +++ b/reactos/lib/kernel32/synch/event.c @@ -1,4 +1,4 @@ -/* $Id: event.c,v 1.11 2002/09/07 15:12:28 chorns Exp $ +/* $Id: event.c,v 1.12 2002/09/08 10:22:45 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,9 +11,8 @@ /* INCLUDES *****************************************************************/ +#include #include -#define NTOS_USER_MODE -#include #define NDEBUG #include diff --git a/reactos/lib/kernel32/synch/intrlck.c b/reactos/lib/kernel32/synch/intrlck.c index 9cd1ef8f99c..e09d75710db 100644 --- a/reactos/lib/kernel32/synch/intrlck.c +++ b/reactos/lib/kernel32/synch/intrlck.c @@ -115,11 +115,12 @@ InterlockedExchange(LPLONG target, LONG value ) * RETURNS * Prior value of value pointed to by Destination */ -LONG STDCALL +PVOID +STDCALL InterlockedCompareExchange( - LPLONG Destination, - LONG Exchange, - LONG Comperand) + PVOID *Destination, + PVOID Exchange, + PVOID Comperand ) { PVOID ret; __asm__ ( /* lock for SMP systems */ diff --git a/reactos/lib/kernel32/synch/mutex.c b/reactos/lib/kernel32/synch/mutex.c index 1cb95aa6c9c..6fbfe071914 100644 --- a/reactos/lib/kernel32/synch/mutex.c +++ b/reactos/lib/kernel32/synch/mutex.c @@ -1,4 +1,4 @@ -/* $Id: mutex.c,v 1.3 2002/09/07 15:12:28 chorns Exp $ +/* $Id: mutex.c,v 1.4 2002/09/08 10:22:45 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,13 +11,11 @@ /* INCLUDES *****************************************************************/ -#include -#define NTOS_USER_MODE -#include +#include #include +#include #include -#define NDEBUG #include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/kernel32/synch/sem.c b/reactos/lib/kernel32/synch/sem.c index a8c3d7ca252..fdeabad464f 100644 --- a/reactos/lib/kernel32/synch/sem.c +++ b/reactos/lib/kernel32/synch/sem.c @@ -1,4 +1,4 @@ -/* $Id: sem.c,v 1.3 2002/09/07 15:12:28 chorns Exp $ +/* $Id: sem.c,v 1.4 2002/09/08 10:22:45 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,9 +11,8 @@ /* INCLUDES *****************************************************************/ +#include #include -#define NTOS_USER_MODE -#include #define NDEBUG #include diff --git a/reactos/lib/kernel32/synch/timer.c b/reactos/lib/kernel32/synch/timer.c index 1e703c7e17b..cddd3113845 100644 --- a/reactos/lib/kernel32/synch/timer.c +++ b/reactos/lib/kernel32/synch/timer.c @@ -1,4 +1,4 @@ -/* $Id: timer.c,v 1.10 2002/09/07 15:12:28 chorns Exp $ +/* $Id: timer.c,v 1.11 2002/09/08 10:22:45 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,10 +9,9 @@ /* INCLUDES ******************************************************************/ -#include -#define NTOS_USER_MODE -#include +#include #include +#include #define NDEBUG #include @@ -21,8 +20,8 @@ HANDLE STDCALL CreateWaitableTimerW(LPSECURITY_ATTRIBUTES lpTimerAttributes, - BOOL bManualReset, - LPCWSTR lpTimerName) + WINBOOL bManualReset, + LPWSTR lpTimerName) { NTSTATUS Status; HANDLE TimerHandle; @@ -58,7 +57,7 @@ CreateWaitableTimerW(LPSECURITY_ATTRIBUTES lpTimerAttributes, HANDLE STDCALL CreateWaitableTimerA(LPSECURITY_ATTRIBUTES lpTimerAttributes, - BOOL bManualReset, + WINBOOL bManualReset, LPCSTR lpTimerName) { UNICODE_STRING TimerNameU; diff --git a/reactos/lib/kernel32/synch/wait.c b/reactos/lib/kernel32/synch/wait.c index 45b85179a1f..70a5e57b122 100644 --- a/reactos/lib/kernel32/synch/wait.c +++ b/reactos/lib/kernel32/synch/wait.c @@ -1,4 +1,4 @@ -/* $Id: wait.c,v 1.17 2002/09/07 15:12:28 chorns Exp $ +/* $Id: wait.c,v 1.18 2002/09/08 10:22:45 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,10 +11,9 @@ /* INCLUDES *****************************************************************/ -#include -#define NTOS_USER_MODE -#include +#include #include +#include #include #define NDEBUG diff --git a/reactos/lib/kernel32/thread/fiber.c b/reactos/lib/kernel32/thread/fiber.c index f97f1b331b0..2945184771d 100644 --- a/reactos/lib/kernel32/thread/fiber.c +++ b/reactos/lib/kernel32/thread/fiber.c @@ -1,11 +1,11 @@ -/* $Id: fiber.c,v 1.2 2002/09/07 15:12:28 chorns Exp $ +/* $Id: fiber.c,v 1.3 2002/09/08 10:22:46 chorns Exp $ * * FILE: lib/kernel32/thread/fiber.c * * ReactOS Kernel32.dll * */ -#include +#include /********************************************************************** @@ -57,7 +57,7 @@ DeleteFiber( */ PVOID STDCALL -InternalGetCurrentFiber(VOID) +GetCurrentFiber(VOID) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return NULL; @@ -69,7 +69,7 @@ InternalGetCurrentFiber(VOID) */ PVOID STDCALL -InternalGetFiberData(VOID) +GetFiberData(VOID) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return NULL; diff --git a/reactos/lib/kernel32/thread/thread.c b/reactos/lib/kernel32/thread/thread.c index c353d815996..29792bd28bf 100644 --- a/reactos/lib/kernel32/thread/thread.c +++ b/reactos/lib/kernel32/thread/thread.c @@ -1,4 +1,4 @@ -/* $Id: thread.c,v 1.28 2002/09/07 15:12:28 chorns Exp $ +/* $Id: thread.c,v 1.29 2002/09/08 10:22:46 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -12,15 +12,16 @@ /* INCLUDES ******************************************************************/ +#include #include -#define NTOS_USER_MODE -#include -#include -#include #include +#include +#include +#include #define NDEBUG #include +#include static VOID ThreadAttachDlls (VOID); @@ -97,10 +98,10 @@ HANDLE STDCALL CreateRemoteThread(HANDLE hProcess, #if 0 InitialTeb.StackCommit = (dwStackSize == 0) ? PAGESIZE : dwStackSize; #endif - InitialTeb.StackCommit = InitialTeb.StackReserve - PAGE_SIZE; + InitialTeb.StackCommit = InitialTeb.StackReserve - PAGESIZE; /* size of guard page */ - InitialTeb.StackCommit += PAGE_SIZE; + InitialTeb.StackCommit += PAGESIZE; /* Reserve stack */ InitialTeb.StackAllocate = NULL; @@ -153,7 +154,7 @@ HANDLE STDCALL CreateRemoteThread(HANDLE hProcess, /* Protect guard page */ Status = NtProtectVirtualMemory(hProcess, InitialTeb.StackLimit, - PAGE_SIZE, + PAGESIZE, PAGE_GUARD | PAGE_READWRITE, &OldPageProtection); if (!NT_SUCCESS(Status)) diff --git a/reactos/lib/kernel32/thread/tls.c b/reactos/lib/kernel32/thread/tls.c index a023dfa780f..d856ac28bc7 100644 --- a/reactos/lib/kernel32/thread/tls.c +++ b/reactos/lib/kernel32/thread/tls.c @@ -1,4 +1,4 @@ -/* $Id: tls.c,v 1.8 2002/09/07 15:12:28 chorns Exp $ +/* $Id: tls.c,v 1.9 2002/09/08 10:22:46 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -12,9 +12,9 @@ /* INCLUDES ******************************************************************/ +#include +#include #include -#define NTOS_USER_MODE -#include #include #include diff --git a/reactos/lib/msafd/include/debug.h b/reactos/lib/msafd/include/debug.h index 9224bb1f290..0430c329532 100644 --- a/reactos/lib/msafd/include/debug.h +++ b/reactos/lib/msafd/include/debug.h @@ -48,7 +48,7 @@ extern DWORD DebugTraceLevel; #endif /* DBG */ -#undef assert + #define assert(x) ASSERT(x) diff --git a/reactos/lib/msafd/include/msafd.h b/reactos/lib/msafd/include/msafd.h index a8f1e097691..46b560d6ad7 100644 --- a/reactos/lib/msafd/include/msafd.h +++ b/reactos/lib/msafd/include/msafd.h @@ -7,13 +7,12 @@ #ifndef __MSAFD_H #define __MSAFD_H -#include -#include -#define NTOS_USER_MODE -#include -#include #include #include +#include +#include +#include +#include #include #include diff --git a/reactos/lib/msafd/makefile b/reactos/lib/msafd/makefile index bf0f33633dd..0b3e1e8c814 100644 --- a/reactos/lib/msafd/makefile +++ b/reactos/lib/msafd/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.6 2002/09/07 15:12:28 chorns Exp $ +# $Id: makefile,v 1.7 2002/09/08 10:22:46 chorns Exp $ PATH_TO_TOP = ../.. @@ -6,7 +6,7 @@ TARGET_TYPE = dynlink TARGET_NAME = msafd -TARGET_BASE = 0x77300000 +TARGET_BASE = 0x777a0000 TARGET_SDKLIBS = ntdll.a kernel32.a diff --git a/reactos/lib/msafd/msafd.rc b/reactos/lib/msafd/msafd.rc index b02ef075f3d..dc3f8909a6e 100644 --- a/reactos/lib/msafd/msafd.rc +++ b/reactos/lib/msafd/msafd.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/msvcrt/Makefile b/reactos/lib/msvcrt/Makefile index 9d106858350..03e18551549 100644 --- a/reactos/lib/msvcrt/Makefile +++ b/reactos/lib/msvcrt/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.22 2002/09/07 15:12:29 chorns Exp $ +# $Id: Makefile,v 1.23 2002/09/08 10:22:46 chorns Exp $ PATH_TO_TOP = ../.. @@ -8,15 +8,15 @@ TARGET_TYPE = dynlink TARGET_NAME = msvcrt -TARGET_LFLAGS = -nostartfiles -nostdlib +TARGET_LFLAGS = -nostartfiles -TARGET_SDKLIBS = kernel32.a +TARGET_SDKLIBS = kernel32.a ntdll.a TARGET_GCCLIBS = gcc -TARGET_BASE = 0x77600000 +TARGET_BASE = 0x78000000 -TARGET_CFLAGS = -D__MSVCRT__ -I./include +TARGET_CFLAGS = -D__MSVCRT__ TARGET_OBJECTS = $(TARGET_NAME).o @@ -32,459 +32,432 @@ include $(PATH_TO_TOP)/rules.mak include $(TOOLS_PATH)/helper.mk -FILES_CONIO = \ - conio/cgets.c \ - conio/cprintf.c \ - conio/cputs.c \ - conio/cscanf.c \ - conio/getch.c \ - conio/getche.c \ - conio/kbhit.c \ - conio/putch.c \ - conio/ungetch.c +OBJECTS_CONIO = \ + conio/cgets.o \ + conio/cprintf.o \ + conio/cputs.o \ + conio/cscanf.o \ + conio/getch.o \ + conio/getche.o \ + conio/kbhit.o \ + conio/putch.o \ + conio/ungetch.o -FILES_CTYPE = \ - ctype/isalnum.c \ - ctype/isalpha.c \ - ctype/isascii.c \ - ctype/iscntrl.c \ - ctype/isdigit.c \ - ctype/isgraph.c \ - ctype/islower.c \ - ctype/isprint.c \ - ctype/ispunct.c \ - ctype/isspace.c \ - ctype/isupper.c \ - ctype/isxdigit.c \ - ctype/toascii.c \ - ctype/tolower.c \ - ctype/toupper.c \ - ctype/iscsym.c \ - ctype/isctype.c +OBJECTS_CTYPE = \ + ctype/isalnum.o \ + ctype/isalpha.o \ + ctype/isascii.o \ + ctype/iscntrl.o \ + ctype/isdigit.o \ + ctype/isgraph.o \ + ctype/islower.o \ + ctype/isprint.o \ + ctype/ispunct.o \ + ctype/isspace.o \ + ctype/isupper.o \ + ctype/isxdigit.o \ + ctype/toascii.o \ + ctype/tolower.o \ + ctype/toupper.o \ + ctype/iscsym.o \ + ctype/isctype.o -FILES_DIRECT = \ - direct/chdir.c \ - direct/chdrive.c \ - direct/getcwd.c \ - direct/getdcwd.c \ - direct/getdfree.c \ - direct/getdrive.c \ - direct/mkdir.c \ - direct/rmdir.c +OBJECTS_DIRECT = \ + direct/chdir.o \ + direct/chdrive.o \ + direct/getcwd.o \ + direct/getdcwd.o \ + direct/getdfree.o \ + direct/getdrive.o \ + direct/mkdir.o \ + direct/rmdir.o -FILES_EXCEPT = \ - except/abnorter.c \ - except/exhand2.c \ - except/exhand3.c \ - except/matherr.c \ - except/unwind.c \ - except/xcptfil.c +OBJECTS_EXCEPT = \ + except/abnorter.o \ + except/exhand2.o \ + except/exhand3.o \ + except/matherr.o \ + except/unwind.o \ + except/xcptfil.o -FILES_FLOAT = \ - float/chgsign.c \ - float/clearfp.c \ - float/cntrlfp.c \ - float/copysign.c \ - float/fpclass.c \ - float/fpecode.c \ - float/fpreset.c \ - float/isnan.c \ - float/logb.c \ - float/nafter.c \ - float/scalb.c \ - float/statfp.c +OBJECTS_FLOAT = \ + float/chgsign.o \ + float/clearfp.o \ + float/cntrlfp.o \ + float/copysign.o \ + float/fpclass.o \ + float/fpecode.o \ + float/fpreset.o \ + float/isnan.o \ + float/logb.o \ + float/nafter.o \ + float/scalb.o \ + float/statfp.o -FILES_IO = \ - io/access.c \ - io/chmod.c \ - io/chsize.c \ - io/close.c \ - io/commit.c \ - io/create.c \ - io/dup.c \ - io/dup2.c \ - io/eof.c \ - io/filelen.c \ - io/find.c \ - io/fmode.c \ - io/isatty.c \ - io/locking.c \ - io/lseek.c \ - io/mktemp.c \ - io/open.c \ - io/pipe.c \ - io/read.c \ - io/setmode.c \ - io/sopen.c \ - io/tell.c \ - io/umask.c \ - io/unlink.c \ - io/utime.c \ - io/write.c +OBJECTS_IO = \ + io/access.o \ + io/chmod.o \ + io/chsize.o \ + io/close.o \ + io/commit.o \ + io/create.o \ + io/dup.o \ + io/dup2.o \ + io/eof.o \ + io/filelen.o \ + io/find.o \ + io/fmode.o \ + io/isatty.o \ + io/locking.o \ + io/lseek.o \ + io/mktemp.o \ + io/open.o \ + io/pipe.o \ + io/read.o \ + io/setmode.o \ + io/sopen.o \ + io/tell.o \ + io/umask.o \ + io/unlink.o \ + io/utime.o \ + io/write.o -FILES_LOCALE = \ - locale/locale.c +OBJECTS_LOCALE = \ + locale/locale.o -FILES_MATH = \ - math/acos.c \ - math/adjust.c \ - math/asin.c \ - math/atan.c \ - math/atan2.c \ - math/cabs.c \ - math/ceil.c \ - math/cos.c \ - math/cosh.c \ - math/exp.c \ - math/fabs.c \ - math/floor.c \ - math/fmod.c \ - math/frexp.c \ - math/ftol.c \ - math/huge_val.c \ - math/hypot.c \ - math/j0_y0.c \ - math/j1_y1.c \ - math/jn_yn.c \ - math/ldexp.c \ - math/log.c \ - math/log10.c \ - math/modf.c \ - math/pow.c \ - math/sin.c \ - math/sinh.c \ - math/sqrt.c \ - math/stubs.c \ - math/tan.c \ - math/tanh.c +OBJECTS_MATH = \ + math/acos.o \ + math/adjust.o \ + math/asin.o \ + math/atan.o \ + math/atan2.o \ + math/cabs.o \ + math/ceil.o \ + math/cos.o \ + math/cosh.o \ + math/exp.o \ + math/fabs.o \ + math/floor.o \ + math/fmod.o \ + math/frexp.o \ + math/ftol.o \ + math/huge_val.o \ + math/hypot.o \ + math/j0_y0.o \ + math/j1_y1.o \ + math/jn_yn.o \ + math/ldexp.o \ + math/log.o \ + math/log10.o \ + math/modf.o \ + math/pow.o \ + math/sin.o \ + math/sinh.o \ + math/sqrt.o \ + math/stubs.o \ + math/tan.o \ + math/tanh.o -FILES_MBSTRING = \ - mbstring/hanzen.c \ - mbstring/ischira.c \ - mbstring/iskana.c \ - mbstring/iskpun.c \ - mbstring/islead.c \ - mbstring/islwr.c \ - mbstring/ismbal.c \ - mbstring/ismbaln.c \ - mbstring/ismbc.c \ - mbstring/ismbgra.c \ - mbstring/ismbkaln.c \ - mbstring/ismblead.c \ - mbstring/ismbpri.c \ - mbstring/ismbpun.c \ - mbstring/ismbtrl.c \ - mbstring/isuppr.c \ - mbstring/jistojms.c \ - mbstring/jmstojis.c \ - mbstring/mbbtype.c \ - mbstring/mbccpy.c \ - mbstring/mbclen.c \ - mbstring/mbscat.c \ - mbstring/mbschr.c \ - mbstring/mbscmp.c \ - mbstring/mbscoll.c \ - mbstring/mbscpy.c \ - mbstring/mbscspn.c \ - mbstring/mbsdec.c \ - mbstring/mbsdup.c \ - mbstring/mbsicmp.c \ - mbstring/mbsicoll.c \ - mbstring/mbsinc.c \ - mbstring/mbslen.c \ - mbstring/mbslwr.c \ - mbstring/mbsncat.c \ - mbstring/mbsnccnt.c \ - mbstring/mbsncmp.c \ - mbstring/mbsncoll.c \ - mbstring/mbsncpy.c \ - mbstring/mbsnextc.c \ - mbstring/mbsnicmp.c \ - mbstring/mbsnicoll.c \ - mbstring/mbsninc.c \ - mbstring/mbsnset.c \ - mbstring/mbspbrk.c \ - mbstring/mbsrchr.c \ - mbstring/mbsrev.c \ - mbstring/mbsset.c \ - mbstring/mbsspn.c \ - mbstring/mbsspnp.c \ - mbstring/mbsstr.c \ - mbstring/mbstok.c \ - mbstring/mbstrlen.c \ - mbstring/mbsupr.c +OBJECTS_MBSTRING = \ + mbstring/hanzen.o \ + mbstring/ischira.o \ + mbstring/iskana.o \ + mbstring/iskpun.o \ + mbstring/islead.o \ + mbstring/islwr.o \ + mbstring/ismbal.o \ + mbstring/ismbaln.o \ + mbstring/ismbc.o \ + mbstring/ismbgra.o \ + mbstring/ismbkaln.o \ + mbstring/ismblead.o \ + mbstring/ismbpri.o \ + mbstring/ismbpun.o \ + mbstring/ismbtrl.o \ + mbstring/isuppr.o \ + mbstring/jistojms.o \ + mbstring/jmstojis.o \ + mbstring/mbbtype.o \ + mbstring/mbccpy.o \ + mbstring/mbclen.o \ + mbstring/mbscat.o \ + mbstring/mbschr.o \ + mbstring/mbscmp.o \ + mbstring/mbscoll.o \ + mbstring/mbscpy.o \ + mbstring/mbscspn.o \ + mbstring/mbsdec.o \ + mbstring/mbsdup.o \ + mbstring/mbsicmp.o \ + mbstring/mbsicoll.o \ + mbstring/mbsinc.o \ + mbstring/mbslen.o \ + mbstring/mbslwr.o \ + mbstring/mbsncat.o \ + mbstring/mbsnccnt.o \ + mbstring/mbsncmp.o \ + mbstring/mbsncoll.o \ + mbstring/mbsncpy.o \ + mbstring/mbsnextc.o \ + mbstring/mbsnicmp.o \ + mbstring/mbsnicoll.o \ + mbstring/mbsninc.o \ + mbstring/mbsnset.o \ + mbstring/mbspbrk.o \ + mbstring/mbsrchr.o \ + mbstring/mbsrev.o \ + mbstring/mbsset.o \ + mbstring/mbsspn.o \ + mbstring/mbsspnp.o \ + mbstring/mbsstr.o \ + mbstring/mbstok.o \ + mbstring/mbstrlen.o \ + mbstring/mbsupr.o -FILES_MISC = \ - misc/amsg.c \ - misc/assert.c \ - misc/dllmain.c \ - misc/getargs.c \ - misc/initterm.c \ - misc/purecall.c \ - misc/tls.c +OBJECTS_MISC = \ + misc/amsg.o \ + misc/assert.o \ + misc/dllmain.o \ + misc/getargs.o \ + misc/initterm.o \ + misc/purecall.o \ + misc/tls.o -FILES_PROCESS = \ - process/_cwait.c \ - process/_system.c \ - process/dll.c \ - process/execl.c \ - process/execle.c \ - process/execlp.c \ - process/execlpe.c \ - process/execv.c \ - process/execve.c \ - process/execvp.c \ - process/execvpe.c \ - process/procid.c \ - process/spawnl.c \ - process/spawnle.c \ - process/spawnlp.c \ - process/spawnlpe.c \ - process/spawnv.c \ - process/spawnve.c \ - process/spawnvp.c \ - process/spawnvpe.c \ - process/thread.c \ - process/threadid.c +OBJECTS_PROCESS = \ + process/_cwait.o \ + process/_system.o \ + process/dll.o \ + process/execl.o \ + process/execle.o \ + process/execlp.o \ + process/execlpe.o \ + process/execv.o \ + process/execve.o \ + process/execvp.o \ + process/execvpe.o \ + process/procid.o \ + process/spawnl.o \ + process/spawnle.o \ + process/spawnlp.o \ + process/spawnlpe.o \ + process/spawnv.o \ + process/spawnve.o \ + process/spawnvp.o \ + process/spawnvpe.o \ + process/thread.o \ + process/threadid.o -FILES_SEARCH = \ - search/lfind.c \ - search/lsearch.c +OBJECTS_SEARCH = \ + search/lfind.o \ + search/lsearch.o -FILES_SETJMP = \ - setjmp/setjmp.c +OBJECTS_SETJMP = \ + setjmp/setjmp.o -FILES_SIGNAL = \ - signal/signal.c +OBJECTS_SIGNAL = \ + signal/signal.o -FILES_STDIO = \ - stdio/allocfil.c \ - stdio/clearerr.c \ - stdio/fclose.c \ - stdio/fdopen.c \ - stdio/feof.c \ - stdio/ferror.c \ - stdio/fflush.c \ - stdio/fgetc.c \ - stdio/fgetchar.c \ - stdio/fgetpos.c \ - stdio/fgets.c \ - stdio/filbuf.c \ - stdio/fileno.c \ - stdio/flsbuf.c \ - stdio/fopen.c \ - stdio/fprintf.c \ - stdio/fputc.c \ - stdio/fputchar.c \ - stdio/fputs.c \ - stdio/fread.c \ - stdio/freopen.c \ - stdio/fscanf.c \ - stdio/fseek.c \ - stdio/fsetpos.c \ - stdio/fsopen.c \ - stdio/ftell.c \ - stdio/fwalk.c \ - stdio/fwrite.c \ - stdio/getc.c \ - stdio/getchar.c \ - stdio/gets.c \ - stdio/getw.c \ - stdio/perror.c \ - stdio/popen.c \ - stdio/printf.c \ - stdio/putc.c \ - stdio/putchar.c \ - stdio/puts.c \ - stdio/putw.c \ - stdio/remove.c \ - stdio/rename.c \ - stdio/rewind.c \ - stdio/rmtmp.c \ - stdio/scanf.c \ - stdio/setbuf.c \ - stdio/setvbuf.c \ - stdio/sprintf.c \ - stdio/sscanf.c \ - stdio/stdhnd.c \ - stdio/tempnam.c \ - stdio/tmpfile.c \ - stdio/tmpnam.c \ - stdio/ungetc.c \ - stdio/vfprintf.c \ - stdio/vfscanf.c \ - stdio/vfwprint.c \ - stdio/vprintf.c \ - stdio/vscanf.c \ - stdio/vsprintf.c \ - stdio/vsscanf.c +OBJECTS_STDIO = \ + stdio/allocfil.o \ + stdio/clearerr.o \ + stdio/fclose.o \ + stdio/fdopen.o \ + stdio/feof.o \ + stdio/ferror.o \ + stdio/fflush.o \ + stdio/fgetc.o \ + stdio/fgetchar.o \ + stdio/fgetpos.o \ + stdio/fgets.o \ + stdio/filbuf.o \ + stdio/fileno.o \ + stdio/flsbuf.o \ + stdio/fopen.o \ + stdio/fprintf.o \ + stdio/fputc.o \ + stdio/fputchar.o \ + stdio/fputs.o \ + stdio/fread.o \ + stdio/freopen.o \ + stdio/fscanf.o \ + stdio/fseek.o \ + stdio/fsetpos.o \ + stdio/fsopen.o \ + stdio/ftell.o \ + stdio/fwalk.o \ + stdio/fwrite.o \ + stdio/getc.o \ + stdio/getchar.o \ + stdio/gets.o \ + stdio/getw.o \ + stdio/perror.o \ + stdio/popen.o \ + stdio/printf.o \ + stdio/putc.o \ + stdio/putchar.o \ + stdio/puts.o \ + stdio/putw.o \ + stdio/remove.o \ + stdio/rename.o \ + stdio/rewind.o \ + stdio/rmtmp.o \ + stdio/scanf.o \ + stdio/setbuf.o \ + stdio/setvbuf.o \ + stdio/sprintf.o \ + stdio/sscanf.o \ + stdio/stdhnd.o \ + stdio/tempnam.o \ + stdio/tmpfile.o \ + stdio/tmpnam.o \ + stdio/ungetc.o \ + stdio/vfprintf.o \ + stdio/vfscanf.o \ + stdio/vfwprint.o \ + stdio/vprintf.o \ + stdio/vscanf.o \ + stdio/vsprintf.o \ + stdio/vsscanf.o -FILES_STDLIB = \ - stdlib/_exit.c \ - stdlib/abort.c \ - stdlib/abs.c \ - stdlib/atexit.c \ - stdlib/atof.c \ - stdlib/atoi.c \ - stdlib/atoi64.c \ - stdlib/atol.c \ - stdlib/bsearch.c \ - stdlib/div.c \ - stdlib/ecvt.c \ - stdlib/ecvtbuf.c \ - stdlib/errno.c \ - stdlib/fcvt.c \ - stdlib/fcvtbuf.c \ - stdlib/fullpath.c \ - stdlib/gcvt.c \ - stdlib/getenv.c \ - stdlib/itoa.c \ - stdlib/itow.c \ - stdlib/labs.c \ - stdlib/ldiv.c \ - stdlib/makepath.c \ - stdlib/malloc.c \ - stdlib/obsol.c \ - stdlib/putenv.c \ - stdlib/qsort.c \ - stdlib/rand.c \ - stdlib/rot.c \ - stdlib/senv.c \ - stdlib/splitp.c \ - stdlib/strtod.c \ - stdlib/strtol.c \ - stdlib/strtoul.c \ - stdlib/swab.c \ - stdlib/wcstod.c \ - stdlib/wcstol.c \ - stdlib/wcstoul.c \ - stdlib/wtoi.c \ - stdlib/wtoi64.c +OBJECTS_STDLIB = \ + stdlib/_exit.o \ + stdlib/abort.o \ + stdlib/abs.o \ + stdlib/atexit.o \ + stdlib/atof.o \ + stdlib/atoi.o \ + stdlib/atoi64.o \ + stdlib/atol.o \ + stdlib/bsearch.o \ + stdlib/div.o \ + stdlib/ecvt.o \ + stdlib/ecvtbuf.o \ + stdlib/errno.o \ + stdlib/fcvt.o \ + stdlib/fcvtbuf.o \ + stdlib/fullpath.o \ + stdlib/gcvt.o \ + stdlib/getenv.o \ + stdlib/itoa.o \ + stdlib/itow.o \ + stdlib/labs.o \ + stdlib/ldiv.o \ + stdlib/makepath.o \ + stdlib/malloc.o \ + stdlib/obsol.o \ + stdlib/putenv.o \ + stdlib/qsort.o \ + stdlib/rand.o \ + stdlib/rot.o \ + stdlib/senv.o \ + stdlib/splitp.o \ + stdlib/strtod.o \ + stdlib/strtol.o \ + stdlib/strtoul.o \ + stdlib/swab.o \ + stdlib/wcstod.o \ + stdlib/wcstol.o \ + stdlib/wcstoul.o \ + stdlib/wtoi.o \ + stdlib/wtoi64.o -FILES_STRING = \ - string/memccpy.c \ - string/memchr.c \ - string/memcmp.c \ - string/memcpy.c \ - string/memicmp.c \ - string/memmove.c \ - string/memset.c \ - string/strcat.c \ - string/strchr.c \ - string/strcmp.c \ - string/strcoll.c \ - string/strcpy.c \ - string/strcspn.c \ - string/strdup.c \ - string/strerror.c \ - string/stricmp.c \ - string/strlen.c \ - string/strlwr.c \ - string/strncat.c \ - string/strncmp.c \ - string/strncpy.c \ - string/strnicmp.c \ - string/strnlen.c \ - string/strpbrk.c \ - string/strrchr.c \ - string/strrev.c\ - string/strset.c \ - string/strspn.c \ - string/strstr.c \ - string/strtok.c \ - string/strupr.c \ - string/strxfrm.c +OBJECTS_STRING = \ + string/memccpy.o \ + string/memchr.o \ + string/memcmp.o \ + string/memcpy.o \ + string/memicmp.o \ + string/memmove.o \ + string/memset.o \ + string/strcat.o \ + string/strchr.o \ + string/strcmp.o \ + string/strcoll.o \ + string/strcpy.o \ + string/strcspn.o \ + string/strdup.o \ + string/strerror.o \ + string/stricmp.o \ + string/strlen.o \ + string/strlwr.o \ + string/strncat.o \ + string/strncmp.o \ + string/strncpy.o \ + string/strnicmp.o \ + string/strnlen.o \ + string/strpbrk.o \ + string/strrchr.o \ + string/strrev.o\ + string/strset.o \ + string/strspn.o \ + string/strstr.o \ + string/strtok.o \ + string/strupr.o \ + string/strxfrm.o -FILES_SYS_STAT = \ - sys_stat/fstat.c \ - sys_stat/futime.c \ - sys_stat/stat.c +OBJECTS_SYS_STAT = \ + sys_stat/fstat.o \ + sys_stat/futime.o \ + sys_stat/stat.o -FILES_TIME = \ - time/clock.c \ - time/ctime.c \ - time/difftime.c \ - time/strdate.c \ - time/strftime.c \ - time/strtime.c \ - time/time.c +OBJECTS_TIME = \ + time/clock.o \ + time/ctime.o \ + time/difftime.o \ + time/strdate.o \ + time/strftime.o \ + time/strtime.o \ + time/time.o -FILES_WSTRING = \ - wstring/wcscat.c \ - wstring/wcschr.c \ - wstring/wcscmp.c \ - wstring/wcscoll.c \ - wstring/wcscpy.c \ - wstring/wcscspn.c \ - wstring/wcsdup.c \ - wstring/wcsicmp.c \ - wstring/wcslen.c \ - wstring/wcslwr.c \ - wstring/wcsncat.c \ - wstring/wcsncmp.c \ - wstring/wcsncpy.c \ - wstring/wcsnicmp.c \ - wstring/wcsnlen.c \ - wstring/wcspbrk.c \ - wstring/wcsrchr.c \ - wstring/wcsrev.c \ - wstring/wcsset.c \ - wstring/wcsspn.c \ - wstring/wcsstr.c \ - wstring/wcstok.c \ - wstring/wcsupr.c \ - wstring/wcsxfrm.c - -FILES = \ - $(FILES_CONIO) \ - $(FILES_CTYPE) \ - $(FILES_DIRECT) \ - $(FILES_EXCEPT) \ - $(FILES_FLOAT) \ - $(FILES_IO) \ - $(FILES_LOCALE) \ - $(FILES_MATH) \ - $(FILES_MBSTRING) \ - $(FILES_MISC) \ - $(FILES_PROCESS) \ - $(FILES_SEARCH) \ - $(FILES_SETJMP) \ - $(FILES_SIGNAL) \ - $(FILES_STDIO) \ - $(FILES_STDLIB) \ - $(FILES_STRING) \ - $(FILES_SYS_STAT) \ - $(FILES_TIME) \ - $(FILES_WSTRING) +OBJECTS_WSTRING = \ + wstring/wcscat.o \ + wstring/wcschr.o \ + wstring/wcscmp.o \ + wstring/wcscoll.o \ + wstring/wcscpy.o \ + wstring/wcscspn.o \ + wstring/wcsdup.o \ + wstring/wcsicmp.o \ + wstring/wcslen.o \ + wstring/wcslwr.o \ + wstring/wcsncat.o \ + wstring/wcsncmp.o \ + wstring/wcsncpy.o \ + wstring/wcsnicmp.o \ + wstring/wcsnlen.o \ + wstring/wcspbrk.o \ + wstring/wcsrchr.o \ + wstring/wcsrev.o \ + wstring/wcsset.o \ + wstring/wcsspn.o \ + wstring/wcsstr.o \ + wstring/wcstok.o \ + wstring/wcsupr.o \ + wstring/wcsxfrm.o OBJECTS = \ - conio.o \ - ctype.o \ - direct.o \ - except.o \ - float.o \ - io.o \ - locale/locale.o \ - math.o \ - mbstring.o \ - misc.o \ - process.o \ - search/lfind.o \ - search/lsearch.o \ - setjmp/setjmp.o \ - signal/signal.o \ - stdio.o \ - stdio/vprintf.o \ - stdio/vfprintf.o \ - stdio/vfwprint.o \ - stdlib.o \ - string.o \ - sys_stat.o \ - time.o \ - time/ctime.o \ - wstring.o + $(OBJECTS_CONIO) \ + $(OBJECTS_CTYPE) \ + $(OBJECTS_DIRECT) \ + $(OBJECTS_EXCEPT) \ + $(OBJECTS_FLOAT) \ + $(OBJECTS_IO) \ + $(OBJECTS_LOCALE) \ + $(OBJECTS_MATH) \ + $(OBJECTS_MBSTRING) \ + $(OBJECTS_MISC) \ + $(OBJECTS_PROCESS) \ + $(OBJECTS_SEARCH) \ + $(OBJECTS_SETJMP) \ + $(OBJECTS_SIGNAL) \ + $(OBJECTS_STDIO) \ + $(OBJECTS_STDLIB) \ + $(OBJECTS_STRING) \ + $(OBJECTS_SYS_STAT) \ + $(OBJECTS_TIME) \ + $(OBJECTS_WSTRING) -$(TARGET_NAME).o: $(OBJECTS) $(FILES) +$(TARGET_NAME).o: $(OBJECTS) $(LD) -r $(OBJECTS) -o $(TARGET_NAME).o # EOF diff --git a/reactos/lib/msvcrt/conio.c b/reactos/lib/msvcrt/conio.c deleted file mode 100755 index 6eb3354744b..00000000000 --- a/reactos/lib/msvcrt/conio.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "conio/cgets.c" -#include "conio/cprintf.c" -#include "conio/cputs.c" -#include "conio/cscanf.c" -#include "conio/getch.c" -#include "conio/getche.c" -#include "conio/kbhit.c" -#include "conio/putch.c" -#include "conio/ungetch.c" diff --git a/reactos/lib/msvcrt/conio/cgets.c b/reactos/lib/msvcrt/conio/cgets.c index 3a209b06aa5..71645d07365 100644 --- a/reactos/lib/msvcrt/conio/cgets.c +++ b/reactos/lib/msvcrt/conio/cgets.c @@ -1,4 +1,5 @@ -#include +#include +#include char *_cgets(char *string) diff --git a/reactos/lib/msvcrt/conio/cprintf.c b/reactos/lib/msvcrt/conio/cprintf.c index 6c662f92d6b..da3ca0c8d6b 100644 --- a/reactos/lib/msvcrt/conio/cprintf.c +++ b/reactos/lib/msvcrt/conio/cprintf.c @@ -1,5 +1,5 @@ -#include - +#include +#include int _cprintf(const char *fmt, ...) diff --git a/reactos/lib/msvcrt/conio/cputs.c b/reactos/lib/msvcrt/conio/cputs.c index f0267fe56c1..396c71eee61 100644 --- a/reactos/lib/msvcrt/conio/cputs.c +++ b/reactos/lib/msvcrt/conio/cputs.c @@ -7,8 +7,11 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include - +#include +#include +#include +#include +#include int _cputs(const char *_str) { diff --git a/reactos/lib/msvcrt/conio/cscanf.c b/reactos/lib/msvcrt/conio/cscanf.c index 31a121bf36c..58e01d99e2a 100644 --- a/reactos/lib/msvcrt/conio/cscanf.c +++ b/reactos/lib/msvcrt/conio/cscanf.c @@ -1,5 +1,6 @@ -#include - +#include +#include +#include int _cscanf(char *fmt, ...) { diff --git a/reactos/lib/msvcrt/conio/getch.c b/reactos/lib/msvcrt/conio/getch.c index ffa015d9ab2..15d2eb6e8db 100644 --- a/reactos/lib/msvcrt/conio/getch.c +++ b/reactos/lib/msvcrt/conio/getch.c @@ -7,7 +7,11 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include +#include +#include +#include +#include +#include int _getch(void) diff --git a/reactos/lib/msvcrt/conio/getche.c b/reactos/lib/msvcrt/conio/getche.c index 0d4b61f8116..f994649e73d 100644 --- a/reactos/lib/msvcrt/conio/getche.c +++ b/reactos/lib/msvcrt/conio/getche.c @@ -9,10 +9,12 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include + +#include +#include -int _getche(void) +int getche(void) { if (char_avail) /* @@ -24,6 +26,6 @@ int _getche(void) * hasn't been got by a conio function. * We don't echo again. */ - return(_getch()); - return (_putch(_getch())); + return(getch()); + return (_putch(getch())); } diff --git a/reactos/lib/msvcrt/conio/kbhit.c b/reactos/lib/msvcrt/conio/kbhit.c index 6f19070c13e..876099fa746 100644 --- a/reactos/lib/msvcrt/conio/kbhit.c +++ b/reactos/lib/msvcrt/conio/kbhit.c @@ -7,7 +7,10 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include + +#include +#include +#include // FIXME PeekCosoleInput returns more than keyboard hits diff --git a/reactos/lib/msvcrt/conio/putch.c b/reactos/lib/msvcrt/conio/putch.c index eae4f57eda5..5f370136593 100644 --- a/reactos/lib/msvcrt/conio/putch.c +++ b/reactos/lib/msvcrt/conio/putch.c @@ -7,7 +7,8 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include +#include +#include int _putch(int c) { diff --git a/reactos/lib/msvcrt/conio/ungetch.c b/reactos/lib/msvcrt/conio/ungetch.c index 9cfb0afe5e9..8b974bb85fc 100644 --- a/reactos/lib/msvcrt/conio/ungetch.c +++ b/reactos/lib/msvcrt/conio/ungetch.c @@ -9,8 +9,11 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include +#include +#include + +#define EOF -1 int char_avail = 0; int ungot_char = 0; diff --git a/reactos/lib/msvcrt/ctype.c b/reactos/lib/msvcrt/ctype.c deleted file mode 100755 index 5ed54cc81f7..00000000000 --- a/reactos/lib/msvcrt/ctype.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "ctype/isalnum.c" -#include "ctype/isalpha.c" -#include "ctype/isascii.c" -#include "ctype/iscntrl.c" -#include "ctype/isctype.c" -#include "ctype/isdigit.c" -#include "ctype/isgraph.c" -#include "ctype/islower.c" -#include "ctype/isprint.c" -#include "ctype/ispunct.c" -#include "ctype/isspace.c" -#include "ctype/isupper.c" -#include "ctype/isxdigit.c" -#include "ctype/toascii.c" -#include "ctype/tolower.c" -#include "ctype/toupper.c" -#include "ctype/iscsym.c" diff --git a/reactos/lib/msvcrt/ctype/isalnum.c b/reactos/lib/msvcrt/ctype/isalnum.c index 1d496ef502f..0dc3922fea2 100644 --- a/reactos/lib/msvcrt/ctype/isalnum.c +++ b/reactos/lib/msvcrt/ctype/isalnum.c @@ -7,7 +7,7 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include +#include #undef isalnum diff --git a/reactos/lib/msvcrt/ctype/isalpha.c b/reactos/lib/msvcrt/ctype/isalpha.c index 8180e3774c8..a506197d363 100644 --- a/reactos/lib/msvcrt/ctype/isalpha.c +++ b/reactos/lib/msvcrt/ctype/isalpha.c @@ -7,8 +7,8 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include +#include #undef isalpha int isalpha(int c) diff --git a/reactos/lib/msvcrt/ctype/isascii.c b/reactos/lib/msvcrt/ctype/isascii.c index 4c1ca1541b7..612a9a954c4 100644 --- a/reactos/lib/msvcrt/ctype/isascii.c +++ b/reactos/lib/msvcrt/ctype/isascii.c @@ -7,8 +7,8 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include +#include int __isascii(int c) { diff --git a/reactos/lib/msvcrt/ctype/iscntrl.c b/reactos/lib/msvcrt/ctype/iscntrl.c index 3cf66b669e4..f6a685e1aa4 100644 --- a/reactos/lib/msvcrt/ctype/iscntrl.c +++ b/reactos/lib/msvcrt/ctype/iscntrl.c @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include #undef iscntrl int iscntrl(int c) diff --git a/reactos/lib/msvcrt/ctype/iscsym.c b/reactos/lib/msvcrt/ctype/iscsym.c index 8d5980b902f..41a6da69790 100644 --- a/reactos/lib/msvcrt/ctype/iscsym.c +++ b/reactos/lib/msvcrt/ctype/iscsym.c @@ -7,8 +7,8 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include +#include int __iscsymf(int c) { diff --git a/reactos/lib/msvcrt/ctype/isctype.c b/reactos/lib/msvcrt/ctype/isctype.c index 0969dd7cd1c..22a94e1912d 100644 --- a/reactos/lib/msvcrt/ctype/isctype.c +++ b/reactos/lib/msvcrt/ctype/isctype.c @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ - -#include +#include unsigned short _ctype[] = { 0, /* , 0xFFFF */ @@ -262,12 +261,7 @@ unsigned short _ctype[] = { 0 /* 0xff */ }; -#undef _pctype - -extern unsigned short * _pctype; - unsigned short *_pctype = _ctype + 1; - unsigned short *_pwctype = _ctype + 1; unsigned short **__p__pctype(void) @@ -280,7 +274,7 @@ unsigned short **__p__pwctype(void) return &_pwctype; } -int _isctype(int c, int ctypeFlags) +int _isctype(unsigned int c, int ctypeFlags) { return (_pctype[(unsigned char)(c & 0xFF)] & ctypeFlags); } diff --git a/reactos/lib/msvcrt/ctype/isdigit.c b/reactos/lib/msvcrt/ctype/isdigit.c index 62216eee855..ae588e464cb 100644 --- a/reactos/lib/msvcrt/ctype/isdigit.c +++ b/reactos/lib/msvcrt/ctype/isdigit.c @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include #undef isdigit int isdigit(int c) diff --git a/reactos/lib/msvcrt/ctype/isgraph.c b/reactos/lib/msvcrt/ctype/isgraph.c index 7798b1fb385..39c500ccdca 100644 --- a/reactos/lib/msvcrt/ctype/isgraph.c +++ b/reactos/lib/msvcrt/ctype/isgraph.c @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include #undef isgraph int isgraph(int c) diff --git a/reactos/lib/msvcrt/ctype/islower.c b/reactos/lib/msvcrt/ctype/islower.c index b42c0e65205..c3a917850a2 100644 --- a/reactos/lib/msvcrt/ctype/islower.c +++ b/reactos/lib/msvcrt/ctype/islower.c @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include #undef islower int islower(int c) diff --git a/reactos/lib/msvcrt/ctype/isprint.c b/reactos/lib/msvcrt/ctype/isprint.c index e9bead8770d..8c6dbf59009 100644 --- a/reactos/lib/msvcrt/ctype/isprint.c +++ b/reactos/lib/msvcrt/ctype/isprint.c @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include #undef isprint int isprint(int c) diff --git a/reactos/lib/msvcrt/ctype/ispunct.c b/reactos/lib/msvcrt/ctype/ispunct.c index bd49b61854c..e26e3e86ec5 100644 --- a/reactos/lib/msvcrt/ctype/ispunct.c +++ b/reactos/lib/msvcrt/ctype/ispunct.c @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include #undef ispunct int ispunct(int c) diff --git a/reactos/lib/msvcrt/ctype/isspace.c b/reactos/lib/msvcrt/ctype/isspace.c index c343a3176be..e0ebcb3fea9 100644 --- a/reactos/lib/msvcrt/ctype/isspace.c +++ b/reactos/lib/msvcrt/ctype/isspace.c @@ -7,8 +7,7 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include - +#include #undef isspace int isspace(int c) diff --git a/reactos/lib/msvcrt/ctype/isupper.c b/reactos/lib/msvcrt/ctype/isupper.c index e638b82f3e7..9898cb3dc1d 100644 --- a/reactos/lib/msvcrt/ctype/isupper.c +++ b/reactos/lib/msvcrt/ctype/isupper.c @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include #undef isupper int isupper(int c) diff --git a/reactos/lib/msvcrt/ctype/isxdigit.c b/reactos/lib/msvcrt/ctype/isxdigit.c index 87b4a840c05..9c24dda454a 100644 --- a/reactos/lib/msvcrt/ctype/isxdigit.c +++ b/reactos/lib/msvcrt/ctype/isxdigit.c @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include #undef isxdigit int isxdigit(int c) diff --git a/reactos/lib/msvcrt/ctype/toascii.c b/reactos/lib/msvcrt/ctype/toascii.c index 81d5f7326d4..16d959bcec1 100644 --- a/reactos/lib/msvcrt/ctype/toascii.c +++ b/reactos/lib/msvcrt/ctype/toascii.c @@ -1,5 +1,6 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include + +#include int __toascii(int c) diff --git a/reactos/lib/msvcrt/ctype/tolower.c b/reactos/lib/msvcrt/ctype/tolower.c index 743f3d2ebf7..e2c188c0dcb 100644 --- a/reactos/lib/msvcrt/ctype/tolower.c +++ b/reactos/lib/msvcrt/ctype/tolower.c @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include #undef tolower int tolower(int c) diff --git a/reactos/lib/msvcrt/ctype/toupper.c b/reactos/lib/msvcrt/ctype/toupper.c index 5e69f95559c..666cee28a79 100644 --- a/reactos/lib/msvcrt/ctype/toupper.c +++ b/reactos/lib/msvcrt/ctype/toupper.c @@ -1,5 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include #undef toupper diff --git a/reactos/lib/msvcrt/direct.c b/reactos/lib/msvcrt/direct.c deleted file mode 100755 index 78fd194a4a4..00000000000 --- a/reactos/lib/msvcrt/direct.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "direct/chdir.c" -#include "direct/chdrive.c" -#include "direct/getcwd.c" -#include "direct/getdcwd.c" -#include "direct/getdfree.c" -#include "direct/getdrive.c" -#include "direct/mkdir.c" -#include "direct/rmdir.c" diff --git a/reactos/lib/msvcrt/direct/chdir.c b/reactos/lib/msvcrt/direct/chdir.c index 46a4bd37f3d..521cf52d01b 100644 --- a/reactos/lib/msvcrt/direct/chdir.c +++ b/reactos/lib/msvcrt/direct/chdir.c @@ -1,4 +1,6 @@ -#include +#include +#include +#include int _chdir( const char *_path ) diff --git a/reactos/lib/msvcrt/direct/chdrive.c b/reactos/lib/msvcrt/direct/chdrive.c index c5dd35721b3..6b67c8fd135 100644 --- a/reactos/lib/msvcrt/direct/chdrive.c +++ b/reactos/lib/msvcrt/direct/chdrive.c @@ -1,5 +1,7 @@ -#include - +#include +#include +#include +#include int cur_drive = 0; diff --git a/reactos/lib/msvcrt/direct/getcwd.c b/reactos/lib/msvcrt/direct/getcwd.c index 7f0c5a4e523..461e085f94f 100644 --- a/reactos/lib/msvcrt/direct/getcwd.c +++ b/reactos/lib/msvcrt/direct/getcwd.c @@ -1,4 +1,6 @@ -#include +#include +#include +#include char *_getcwd( char *buffer, int maxlen ) diff --git a/reactos/lib/msvcrt/direct/getdcwd.c b/reactos/lib/msvcrt/direct/getdcwd.c index 67c0aa65b00..e6e719e5b74 100644 --- a/reactos/lib/msvcrt/direct/getdcwd.c +++ b/reactos/lib/msvcrt/direct/getdcwd.c @@ -1,5 +1,5 @@ -#include - +#include +#include char* _getdcwd (int nDrive, char* caBuffer, int nBufLen) { diff --git a/reactos/lib/msvcrt/direct/getdfree.c b/reactos/lib/msvcrt/direct/getdfree.c index dc56f43e297..a2405031215 100644 --- a/reactos/lib/msvcrt/direct/getdfree.c +++ b/reactos/lib/msvcrt/direct/getdfree.c @@ -1,4 +1,6 @@ -#include +#include +#include +#include unsigned int _getdiskfree(unsigned int _drive, struct _diskfree_t *_diskspace) diff --git a/reactos/lib/msvcrt/direct/getdrive.c b/reactos/lib/msvcrt/direct/getdrive.c index 6af21a8d730..e2b6e66aff9 100644 --- a/reactos/lib/msvcrt/direct/getdrive.c +++ b/reactos/lib/msvcrt/direct/getdrive.c @@ -1,4 +1,6 @@ -#include +#include +#include +#include extern int cur_drive; diff --git a/reactos/lib/msvcrt/direct/mkdir.c b/reactos/lib/msvcrt/direct/mkdir.c index 684dc724b00..3abb1120b2b 100644 --- a/reactos/lib/msvcrt/direct/mkdir.c +++ b/reactos/lib/msvcrt/direct/mkdir.c @@ -1,4 +1,5 @@ -#include +#include +#include int _mkdir( const char *_path ) diff --git a/reactos/lib/msvcrt/direct/rmdir.c b/reactos/lib/msvcrt/direct/rmdir.c index fcd1a5a6cd3..90804f0e732 100644 --- a/reactos/lib/msvcrt/direct/rmdir.c +++ b/reactos/lib/msvcrt/direct/rmdir.c @@ -1,5 +1,5 @@ -#include - +#include +#include int _rmdir( const char *_path ) { diff --git a/reactos/lib/msvcrt/except.c b/reactos/lib/msvcrt/except.c deleted file mode 100755 index 4309e83cf83..00000000000 --- a/reactos/lib/msvcrt/except.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "except/abnorter.c" -#include "except/exhand2.c" -#include "except/exhand3.c" -#include "except/matherr.c" -#include "except/unwind.c" -#include "except/xcptfil.c" diff --git a/reactos/lib/msvcrt/except/abnorter.c b/reactos/lib/msvcrt/except/abnorter.c index 1791d395d84..2efd11a31f8 100644 --- a/reactos/lib/msvcrt/except/abnorter.c +++ b/reactos/lib/msvcrt/except/abnorter.c @@ -1,5 +1,4 @@ -#include - +#include int _abnormal_termination(void) { diff --git a/reactos/lib/msvcrt/except/exhand2.c b/reactos/lib/msvcrt/except/exhand2.c index 1f07176841e..406aeeff7d0 100644 --- a/reactos/lib/msvcrt/except/exhand2.c +++ b/reactos/lib/msvcrt/except/exhand2.c @@ -1,5 +1,4 @@ -#include - +#include EXCEPTION_DISPOSITION _except_handler2( diff --git a/reactos/lib/msvcrt/except/exhand3.c b/reactos/lib/msvcrt/except/exhand3.c index 1f8e21ab4f6..d17bacf1fd3 100644 --- a/reactos/lib/msvcrt/except/exhand3.c +++ b/reactos/lib/msvcrt/except/exhand3.c @@ -1,5 +1,4 @@ -#include - +#include EXCEPTION_DISPOSITION _except_handler3( diff --git a/reactos/lib/msvcrt/except/matherr.c b/reactos/lib/msvcrt/except/matherr.c index 5527e7fcb03..5d03db29c33 100644 --- a/reactos/lib/msvcrt/except/matherr.c +++ b/reactos/lib/msvcrt/except/matherr.c @@ -1,6 +1,3 @@ -#include - -#if 0 struct _exception { int type; char *name; @@ -8,7 +5,6 @@ struct _exception { double arg2; double retval; } ; -#endif int _matherr(struct _exception *e) { diff --git a/reactos/lib/msvcrt/except/unwind.c b/reactos/lib/msvcrt/except/unwind.c index 77be7873b33..1cdf65a8c7a 100644 --- a/reactos/lib/msvcrt/except/unwind.c +++ b/reactos/lib/msvcrt/except/unwind.c @@ -1,6 +1,4 @@ -#include - - +#include #define PEXCEPTION_FRAME void* void _global_unwind2( PEXCEPTION_FRAME frame ) diff --git a/reactos/lib/msvcrt/except/xcptfil.c b/reactos/lib/msvcrt/except/xcptfil.c index 4a3f4a67ac3..0a4271aa9e2 100644 --- a/reactos/lib/msvcrt/except/xcptfil.c +++ b/reactos/lib/msvcrt/except/xcptfil.c @@ -1,4 +1,4 @@ -#include +#include int diff --git a/reactos/lib/msvcrt/float.c b/reactos/lib/msvcrt/float.c deleted file mode 100755 index 417eeb1f0ff..00000000000 --- a/reactos/lib/msvcrt/float.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "float/chgsign.c" -#include "float/clearfp.c" -#include "float/cntrlfp.c" -#include "float/copysign.c" -#include "float/fpclass.c" -#include "float/fpecode.c" -#include "float/fpreset.c" -#include "float/isnan.c" -#include "float/logb.c" -#include "float/nafter.c" -#include "float/scalb.c" -#include "float/statfp.c" diff --git a/reactos/lib/msvcrt/float/chgsign.c b/reactos/lib/msvcrt/float/chgsign.c index 1a2330c263c..0fb4072de39 100644 --- a/reactos/lib/msvcrt/float/chgsign.c +++ b/reactos/lib/msvcrt/float/chgsign.c @@ -1,5 +1,5 @@ -#include - +#include +#include double _chgsign( double __x ) { diff --git a/reactos/lib/msvcrt/float/clearfp.c b/reactos/lib/msvcrt/float/clearfp.c index eeff583605f..11e03e5fe03 100644 --- a/reactos/lib/msvcrt/float/clearfp.c +++ b/reactos/lib/msvcrt/float/clearfp.c @@ -1,5 +1,4 @@ -#include - +#include unsigned int _clearfp (void) { diff --git a/reactos/lib/msvcrt/float/cntrlfp.c b/reactos/lib/msvcrt/float/cntrlfp.c index 3c096f48705..c15444dc1d9 100644 --- a/reactos/lib/msvcrt/float/cntrlfp.c +++ b/reactos/lib/msvcrt/float/cntrlfp.c @@ -1,7 +1,6 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include unsigned int _controlfp(unsigned int unNew, unsigned int unMask) { diff --git a/reactos/lib/msvcrt/float/copysign.c b/reactos/lib/msvcrt/float/copysign.c index 2d8e04f8444..1c488b4d4bf 100644 --- a/reactos/lib/msvcrt/float/copysign.c +++ b/reactos/lib/msvcrt/float/copysign.c @@ -1,5 +1,5 @@ -#include - +#include +#include double _copysign (double __d, double __s) { diff --git a/reactos/lib/msvcrt/float/fpclass.c b/reactos/lib/msvcrt/float/fpclass.c index 9b1295e8f93..d4c280a09fe 100644 --- a/reactos/lib/msvcrt/float/fpclass.c +++ b/reactos/lib/msvcrt/float/fpclass.c @@ -1,5 +1,6 @@ -#include - +#include +#include +#include #define _FPCLASS_SNAN 0x0001 /* signaling NaN */ #define _FPCLASS_QNAN 0x0002 /* quiet NaN */ diff --git a/reactos/lib/msvcrt/float/fpecode.c b/reactos/lib/msvcrt/float/fpecode.c index c69912e1034..3bc2082b1aa 100644 --- a/reactos/lib/msvcrt/float/fpecode.c +++ b/reactos/lib/msvcrt/float/fpecode.c @@ -1,5 +1,5 @@ -#include - +#include +#include int * __fpecode(void) { diff --git a/reactos/lib/msvcrt/float/fpreset.c b/reactos/lib/msvcrt/float/fpreset.c index f22d7d73b01..4127159174d 100644 --- a/reactos/lib/msvcrt/float/fpreset.c +++ b/reactos/lib/msvcrt/float/fpreset.c @@ -1,5 +1,4 @@ -#include - +#include void _fpreset(void) { diff --git a/reactos/lib/msvcrt/float/isnan.c b/reactos/lib/msvcrt/float/isnan.c index 7f8075cec47..6cff15b7d35 100644 --- a/reactos/lib/msvcrt/float/isnan.c +++ b/reactos/lib/msvcrt/float/isnan.c @@ -14,9 +14,11 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. -*/ -#include +Cambridge, MA 02139, USA. */ + +#include +#include +#include int _isnan(double __x) { diff --git a/reactos/lib/msvcrt/float/logb.c b/reactos/lib/msvcrt/float/logb.c index 5cca9259e7b..140a104ba66 100644 --- a/reactos/lib/msvcrt/float/logb.c +++ b/reactos/lib/msvcrt/float/logb.c @@ -16,10 +16,9 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ -#include + Boston, MA 02111-1307, USA. */ +#include double _logb (double __x) { diff --git a/reactos/lib/msvcrt/float/nafter.c b/reactos/lib/msvcrt/float/nafter.c index 94f63c92d33..9773d92b546 100644 --- a/reactos/lib/msvcrt/float/nafter.c +++ b/reactos/lib/msvcrt/float/nafter.c @@ -1,12 +1,11 @@ -#include - +#include double _nextafter( double x, double y ) { if ( x == y) return x; - if ( _isnan(x) || _isnan(y) ) + if ( isnan(x) || isnan(y) ) return x; return x; diff --git a/reactos/lib/msvcrt/float/scalb.c b/reactos/lib/msvcrt/float/scalb.c index 7c3c99ff18e..a2d1eac0d1a 100644 --- a/reactos/lib/msvcrt/float/scalb.c +++ b/reactos/lib/msvcrt/float/scalb.c @@ -1,5 +1,5 @@ -#include - +#include +#include double _scalb( double __x, long e ) { diff --git a/reactos/lib/msvcrt/float/statfp.c b/reactos/lib/msvcrt/float/statfp.c index 5e7a9b85c2f..cef37a3ecbe 100644 --- a/reactos/lib/msvcrt/float/statfp.c +++ b/reactos/lib/msvcrt/float/statfp.c @@ -1,5 +1,4 @@ -#include - +#include unsigned int _statusfp (void) { diff --git a/reactos/lib/msvcrt/include/msvcrti.h b/reactos/lib/msvcrt/include/msvcrti.h deleted file mode 100755 index ced3b91eb20..00000000000 --- a/reactos/lib/msvcrt/include/msvcrti.h +++ /dev/null @@ -1,290 +0,0 @@ -/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ - -#ifndef __MSVCRT_INTERNAL_H -#define __MSVCRT_INTERNAL_H - -#define ____MINGW_IMPORT -#define __MINGW_IMPORT extern - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __dj_ENFORCE_ANSI_FREESTANDING - -#ifndef __STRICT_ANSI__ - -#ifndef _POSIX_SOURCE - -struct __atexit { - struct __atexit *__next; - void (*__function)(void); -}; - -extern struct __atexit *__atexit_ptr; - -#endif /* !_POSIX_SOURCE */ -#endif /* !__STRICT_ANSI__ */ -#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ - -#ifndef __dj_ENFORCE_FUNCTION_CALLS -#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ - - -#ifndef __dj_ENFORCE_ANSI_FREESTANDING - -#ifndef __STRICT_ANSI__ - -#ifndef _POSIX_SOURCE - -#ifndef _IORMONCL -#define _IORMONCL 004000 /* remove on close, for temp files */ -#endif -/* if _flag & _IORMONCL, ._name_to_remove needs freeing */ - -#ifndef _IOUNGETC -#define _IOUNGETC 010000 /* there is an ungetc'ed character in the buffer */ -#endif - -#define _IOAHEAD 0x000008 -#define _IODIRTY 0x000080 - -#define stdaux (&_iob[3]) -#define stdprn (&_iob[4]) - -// might need check for IO_APPEND aswell -#define OPEN4WRITING(f) ((((f)->_flag & _IOWRT) == _IOWRT ) ) - -#define OPEN4READING(f) ((((f)->_flag & _IOREAD) == _IOREAD ) ) - -// might need check for IO_APPEND aswell -#define WRITE_STREAM(f) ((((f)->_flag & _IOWRT) == _IOWRT ) ) - -#define READ_STREAM(f) ((((f)->_flag & _IOREAD) == _IOREAD ) ) - - -char __validfp (FILE *f); - -int __set_errno(int err); -int __set_doserrno (int error); - -void *filehnd(int fn); - -char __is_text_file(FILE *p); - -int __fileno_alloc(void *hFile, int mode); - -int _doprnt(const char *fmt, va_list args, FILE *f); -int _doscan(FILE *iop, const char *fmt, va_list argp); - - -int __fileno_dup2( int handle1, int handle2 ); -int __fileno_getmode(int _fd); -int __fileno_setmode(int _fd, int _newmode); -int __fileno_close(int _fd); - -void sigabort_handler(int sig); - -#include - -void UnixTimeToFileTime( time_t unix_time, FILETIME *filetime, DWORD remainder ); -time_t FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder ); - - -#endif /* !_POSIX_SOURCE */ -#endif /* !__STRICT_ANSI__ */ -#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ - -#ifndef __dj_ENFORCE_FUNCTION_CALLS -#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ - - -#define __FILE_REC_MAX 20 -typedef struct __file_rec -{ - struct __file_rec *next; - int count; - FILE *files[__FILE_REC_MAX]; -} __file_rec; - -extern __file_rec *__file_rec_list; - - -typedef struct { - unsigned int mantissa:23; - unsigned int exponent:8; - unsigned int sign:1; -} float_t; - -typedef struct { - unsigned int mantissal:32; - unsigned int mantissah:20; - unsigned int exponent:11; - unsigned int sign:1; -} double_t; - -typedef struct { - unsigned int mantissal:32; - unsigned int mantissah:32; - unsigned int exponent:15; - unsigned int sign:1; - unsigned int empty:16; -} long_double_t; - - -#define _RT_STACK 0 /* stack overflow */ -#define _RT_NULLPTR 1 /* null pointer assignment */ -#define _RT_FLOAT 2 /* floating point not loaded */ -#define _RT_INTDIV 3 /* integer divide by 0 */ -#define _RT_SPACEARG 4 /* not enough space for arguments */ -#define _RT_SPACEENV 5 /* not enough space for environment */ -#define _RT_ABORT 6 /* abnormal program termination */ -#define _RT_THREAD 7 /* not enough space for thread data */ -#define _RT_LOCK 8 /* unexpected multi-thread lock error */ -#define _RT_HEAP 9 /* unexpected heap error */ -#define _RT_OPENCON 10 /* unable to open console device */ -#define _RT_NONCONT 11 /* non-continuable exception */ -#define _RT_INVALDISP 12 /* invalid disposition of exception */ -#define _RT_ONEXIT 13 /* insufficient heap to allocate - * initial table of function pointers - * used by _onexit()/atexit(). */ -#define _RT_PUREVIRT 14 /* pure virtual function call attempted - * (C++ error) */ -#define _RT_STDIOINIT 15 /* not enough space for stdio initialization */ -#define _RT_LOWIOINIT 16 /* not enough space for lowio initialization */ - -void _amsg_exit (int errnum); - -#ifdef __cplusplus -} -#endif - - -int __vfscanf (FILE *s, const char *format, va_list argptr); -int __vscanf (const char *format, va_list arg); -int __vsscanf (const char *s,const char *format,va_list arg); - - -extern int char_avail; -extern int ungot_char; - - -typedef struct _ThreadData -{ - int terrno; /* *nix error code */ - unsigned long tdoserrno; /* Win32 error code (for I/O only) */ - unsigned long long tnext; /* used by rand/srand */ - - char *lasttoken; /* used by strtok */ - wchar_t *wlasttoken; /* used by wcstok */ - - - int fpecode; /* fp exception code */ - - /* qsort variables */ - int (*qcmp)(const void *, const void *); /* the comparison routine */ - int qsz; /* size of each record */ - int thresh; /* THRESHold in chars */ - int mthresh; /* MTHRESHold in chars */ - -} THREADDATA, *PTHREADDATA; - - -int CreateThreadData(void); -void DestroyThreadData(void); - -void FreeThreadData(PTHREADDATA ptd); -PTHREADDATA GetThreadData(void); - -#define _KNJ_M ((char)0x01) /* Non-punctuation of Kana-set */ -#define _KNJ_P ((char)0x02) /* Punctuation of Kana-set */ -#define _KNJ_1 ((char)0x04) /* Legal 1st byte of double byte stream */ -#define _KNJ_2 ((char)0x08) /* Legal 2nd btye of double byte stream */ - - -#define ___ 0 -#define _1_ _KNJ_1 /* Legal 1st byte of double byte code */ -#define __2 _KNJ_2 /* Legal 2nd byte of double byte code */ -#define _M_ _KNJ_M /* Non-puntuation in Kana-set */ -#define _P_ _KNJ_P /* Punctuation of Kana-set */ -#define _12 (_1_|__2) -#define _M2 (_M_|__2) -#define _P2 (_P_|__2) - -#define _jctype _mbctype - - -#define SIGINT 2 /* Interactive attention */ -#define SIGILL 4 /* Illegal instruction */ -#define SIGFPE 8 /* Floating point error */ -#define SIGSEGV 11 /* Segmentation violation */ -#define SIGTERM 15 /* Termination request */ -#define SIGBREAK 21 /* Control-break */ -#define SIGABRT 22 /* Abnormal termination (abort) */ - -#define SIGALRM 293 -#define SIGHUP 294 -/* SIGINT is ansi */ -#define SIGKILL 296 -#define SIGPIPE 297 -#define SIGQUIT 298 -#define SIGUSR1 299 -#define SIGUSR2 300 - -#define SIGNOFP 301 -#define SIGTRAP 302 -#define SIGTIMR 303 /* Internal for setitimer (SIGALRM, SIGPROF) */ -#define SIGPROF 304 -#define SIGMAX 320 - - -/* FIXME: Should be in MinGW runtime */ -void _fwalk(void (*func)(FILE *)); - -size_t _mbstrlen( const char *string ); - -#if 1 -// Put in MinGW runtime? - -#define _O_NOINHERIT 0x0080 -#define O_NOINHERIT _O_NOINHERIT - -#endif - -//typedef int (* _onexit_t)(void); -_onexit_t onexit(_onexit_t); - -#endif /* __MSVCRT_INTERNAL_H */ diff --git a/reactos/lib/msvcrt/io.c b/reactos/lib/msvcrt/io.c deleted file mode 100755 index fa95f86e1cc..00000000000 --- a/reactos/lib/msvcrt/io.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "io/access.c" -#include "io/chmod.c" -#include "io/chsize.c" -#include "io/close.c" -#include "io/commit.c" -#include "io/create.c" -#include "io/dup.c" -#include "io/dup2.c" -#include "io/eof.c" -#include "io/filelen.c" -#include "io/find.c" -#include "io/fmode.c" -#include "io/isatty.c" -#include "io/locking.c" -#include "io/lseek.c" -#include "io/mktemp.c" -#include "io/open.c" -#include "io/pipe.c" -#include "io/read.c" -#include "io/setmode.c" -#include "io/sopen.c" -#include "io/tell.c" -#include "io/umask.c" -#include "io/unlink.c" -#include "io/utime.c" -#include "io/write.c" diff --git a/reactos/lib/msvcrt/io/access.c b/reactos/lib/msvcrt/io/access.c index eacdc242a30..493c4a748eb 100644 --- a/reactos/lib/msvcrt/io/access.c +++ b/reactos/lib/msvcrt/io/access.c @@ -1,8 +1,8 @@ -#include - +#include +#include +#include #define NDEBUG -#include - +#include #ifndef F_OK #define F_OK 0x01 diff --git a/reactos/lib/msvcrt/io/chmod.c b/reactos/lib/msvcrt/io/chmod.c index 9a206cf7c6c..f5d61aa97f0 100644 --- a/reactos/lib/msvcrt/io/chmod.c +++ b/reactos/lib/msvcrt/io/chmod.c @@ -1,8 +1,8 @@ -#include +#include +#include #define NDEBUG -#include - +#include #define mode_t int diff --git a/reactos/lib/msvcrt/io/chsize.c b/reactos/lib/msvcrt/io/chsize.c index 7bd6e5d2794..865bec2e461 100644 --- a/reactos/lib/msvcrt/io/chsize.c +++ b/reactos/lib/msvcrt/io/chsize.c @@ -1,14 +1,13 @@ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ -#include - +#include #define NDEBUG -#include +#include int _chsize(int _fd, long size) { DPRINT("_chsize(fd %d, size %d)\n", _fd, size); - if (_lseek(_fd, size, 0) == -1) + if (lseek(_fd, size, 0) == -1) return -1; if (_write(_fd, 0, 0) < 0) return -1; diff --git a/reactos/lib/msvcrt/io/close.c b/reactos/lib/msvcrt/io/close.c index 7ef3c315bd6..65d6230ce39 100644 --- a/reactos/lib/msvcrt/io/close.c +++ b/reactos/lib/msvcrt/io/close.c @@ -1,15 +1,16 @@ -#include - +#include +#include +#include #define NDEBUG -#include +#include int _close(int _fd) { DPRINT("_close(fd %d)\n", _fd); if (_fd == -1) return -1; - if (CloseHandle((HANDLE)_get_osfhandle(_fd)) == FALSE) + if (CloseHandle(_get_osfhandle(_fd)) == FALSE) return -1; return __fileno_close(_fd); } diff --git a/reactos/lib/msvcrt/io/commit.c b/reactos/lib/msvcrt/io/commit.c index 40b23ebf0f3..406b03fc7cb 100644 --- a/reactos/lib/msvcrt/io/commit.c +++ b/reactos/lib/msvcrt/io/commit.c @@ -1,7 +1,7 @@ -#include - - -#define _IOCOMMIT 0x008000 +#include +#include +#include +#include int _commode = _IOCOMMIT; @@ -13,7 +13,7 @@ int *__p__commode(void) int _commit(int _fd) { - if (! FlushFileBuffers((HANDLE)_get_osfhandle(_fd)) ) + if (! FlushFileBuffers(_get_osfhandle(_fd)) ) { __set_errno(EBADF); return -1; diff --git a/reactos/lib/msvcrt/io/create.c b/reactos/lib/msvcrt/io/create.c index dc07ce41c65..3f11706db79 100644 --- a/reactos/lib/msvcrt/io/create.c +++ b/reactos/lib/msvcrt/io/create.c @@ -1,8 +1,8 @@ -#include +#include +#include #define NDEBUG -#include - +#include int _creat(const char *filename, int mode) { diff --git a/reactos/lib/msvcrt/io/dup.c b/reactos/lib/msvcrt/io/dup.c index 24b77c92220..6e0e4b0453c 100644 --- a/reactos/lib/msvcrt/io/dup.c +++ b/reactos/lib/msvcrt/io/dup.c @@ -1,5 +1,7 @@ -/* $Id: dup.c,v 1.3 2002/09/07 15:12:30 chorns Exp $ */ -#include +/* $Id: dup.c,v 1.4 2002/09/08 10:22:50 chorns Exp $ */ +#include +#include +#include int _dup(int handle) @@ -9,7 +11,7 @@ int _dup(int handle) BOOL result; int fd; - hFile = (HANDLE)_get_osfhandle(handle); + hFile = _get_osfhandle(handle); if (hFile == INVALID_HANDLE_VALUE) return -1; result = DuplicateHandle(hProcess, diff --git a/reactos/lib/msvcrt/io/dup2.c b/reactos/lib/msvcrt/io/dup2.c index 3617e291598..fc825052fc3 100644 --- a/reactos/lib/msvcrt/io/dup2.c +++ b/reactos/lib/msvcrt/io/dup2.c @@ -1,5 +1,5 @@ -#include - +#include +#include int _dup2(int handle1, int handle2) { diff --git a/reactos/lib/msvcrt/io/eof.c b/reactos/lib/msvcrt/io/eof.c index 6d699f7b9b1..5fa959d2498 100644 --- a/reactos/lib/msvcrt/io/eof.c +++ b/reactos/lib/msvcrt/io/eof.c @@ -1,5 +1,5 @@ -#include - +//#include +#include int _eof(int _fd) { diff --git a/reactos/lib/msvcrt/io/filelen.c b/reactos/lib/msvcrt/io/filelen.c index 62cc2b9770a..84e9f102ffa 100644 --- a/reactos/lib/msvcrt/io/filelen.c +++ b/reactos/lib/msvcrt/io/filelen.c @@ -1,16 +1,16 @@ -#include - +#include +#include long _filelength(int _fd) { - return GetFileSize((HANDLE)_get_osfhandle(_fd),NULL); + return GetFileSize(_get_osfhandle(_fd),NULL); } __int64 _filelengthi64(int _fd) { long lo_length, hi_length; - lo_length = GetFileSize((HANDLE)_get_osfhandle(_fd), &hi_length); + lo_length = GetFileSize(_get_osfhandle(_fd), &hi_length); return((((__int64)hi_length) << 32) + lo_length); } diff --git a/reactos/lib/msvcrt/io/find.c b/reactos/lib/msvcrt/io/find.c index bc2cb9e0f9a..f7921b850c4 100644 --- a/reactos/lib/msvcrt/io/find.c +++ b/reactos/lib/msvcrt/io/find.c @@ -1,4 +1,7 @@ -#include +#include +#include +#include +#include int _findclose(int handle) @@ -55,7 +58,7 @@ int _findfirst(const char *_name, struct _finddata_t *result) return hFindFile; } -long _findfirsti64(const char *_name, struct _finddatai64_t *result) +int _findfirsti64(const char *_name, struct _finddatai64_t *result) { WIN32_FIND_DATAA FindFileData; char dir[MAX_PATH]; @@ -123,7 +126,7 @@ int _findnext(int handle, struct _finddata_t *result) return 0; } -int _findnexti64(long handle, struct _finddatai64_t *result) +int _findnexti64(int handle, struct _finddatai64_t *result) { WIN32_FIND_DATAA FindFileData; @@ -145,7 +148,7 @@ int _findnexti64(long handle, struct _finddatai64_t *result) return 0; } -long _wfindfirst(const wchar_t *_name, struct _wfinddata_t *result) +int _wfindfirst(const wchar_t *_name, struct _wfinddata_t *result) { WIN32_FIND_DATAW FindFileData; wchar_t dir[MAX_PATH]; @@ -191,7 +194,7 @@ long _wfindfirst(const wchar_t *_name, struct _wfinddata_t *result) return hFindFile; } -long _wfindfirsti64(const wchar_t *_name, struct _wfinddatai64_t *result) +int _wfindfirsti64(const wchar_t *_name, struct _wfinddatai64_t *result) { WIN32_FIND_DATAW FindFileData; wchar_t dir[MAX_PATH]; @@ -238,7 +241,7 @@ long _wfindfirsti64(const wchar_t *_name, struct _wfinddatai64_t *result) return hFindFile; } -int _wfindnext(long handle, struct _wfinddata_t *result) +int _wfindnext(int handle, struct _wfinddata_t *result) { WIN32_FIND_DATAW FindFileData; @@ -259,7 +262,7 @@ int _wfindnext(long handle, struct _wfinddata_t *result) return 0; } -int _wfindnexti64(long handle, struct _wfinddatai64_t *result) +int _wfindnexti64(int handle, struct _wfinddatai64_t *result) { WIN32_FIND_DATAW FindFileData; diff --git a/reactos/lib/msvcrt/io/fmode.c b/reactos/lib/msvcrt/io/fmode.c index 12330bd5604..7d1909d5c38 100644 --- a/reactos/lib/msvcrt/io/fmode.c +++ b/reactos/lib/msvcrt/io/fmode.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include #undef _fmode unsigned int _fmode = O_TEXT; diff --git a/reactos/lib/msvcrt/io/isatty.c b/reactos/lib/msvcrt/io/isatty.c index f9d9f8a9b50..3ed7a80d1e6 100644 --- a/reactos/lib/msvcrt/io/isatty.c +++ b/reactos/lib/msvcrt/io/isatty.c @@ -1,12 +1,12 @@ -#include - +#include +#include #define NDEBUG -#include +#include int _isatty( int fd ) { - struct _stat buf; + struct stat buf; DPRINT("_isatty(fd %d)\n", fd); if (_fstat (fd, &buf) < 0) return 0; diff --git a/reactos/lib/msvcrt/io/locking.c b/reactos/lib/msvcrt/io/locking.c index 1e04b9ecda0..ba3283014e8 100644 --- a/reactos/lib/msvcrt/io/locking.c +++ b/reactos/lib/msvcrt/io/locking.c @@ -1,10 +1,10 @@ -#include - +#include +#include int _locking(int _fd, int mode, long nbytes) { long offset = _lseek(_fd, 0L, 1); - if (!LockFile((HANDLE)_get_osfhandle(_fd),offset,0,nbytes,0)) + if (!LockFile(_get_osfhandle(_fd),offset,0,nbytes,0)) return -1; return 0; } diff --git a/reactos/lib/msvcrt/io/lseek.c b/reactos/lib/msvcrt/io/lseek.c index 7dae60bb66f..4f03d437ec4 100644 --- a/reactos/lib/msvcrt/io/lseek.c +++ b/reactos/lib/msvcrt/io/lseek.c @@ -1,4 +1,6 @@ -#include +#include +#include +#include long _lseek(int _fildes, long _offset, int _whence) diff --git a/reactos/lib/msvcrt/io/mktemp.c b/reactos/lib/msvcrt/io/mktemp.c index 4865bb03254..6f31b4a0007 100644 --- a/reactos/lib/msvcrt/io/mktemp.c +++ b/reactos/lib/msvcrt/io/mktemp.c @@ -13,10 +13,12 @@ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include #define NDEBUG -#include +#include char* _mktemp (char *_template) diff --git a/reactos/lib/msvcrt/io/open.c b/reactos/lib/msvcrt/io/open.c index 39922821bac..b46a34aa7a7 100644 --- a/reactos/lib/msvcrt/io/open.c +++ b/reactos/lib/msvcrt/io/open.c @@ -1,4 +1,4 @@ -/* $Id: open.c,v 1.9 2002/09/07 15:12:32 chorns Exp $ +/* $Id: open.c,v 1.10 2002/09/08 10:22:50 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -13,11 +13,21 @@ // possibly store extra information at the handle -#include +#include +#if !defined(NDEBUG) && defined(DBG) +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG -#include - +#include #define STD_AUX_HANDLE 3 #define STD_PRINTER_HANDLE 4 @@ -394,15 +404,14 @@ int __fileno_close(int _fd) return 0; } -int _open_osfhandle (long osfhandle, int flags ) +int _open_osfhandle (void *osfhandle, int flags ) { return __fileno_alloc((HANDLE)osfhandle, flags); } -long _get_osfhandle( int fileno ) +void *_get_osfhandle( int fileno ) { - /* FIXME: 32-bit only */ - return (int)filehnd(fileno); + return filehnd(fileno); } void __fileno_init(void) diff --git a/reactos/lib/msvcrt/io/pipe.c b/reactos/lib/msvcrt/io/pipe.c index d70caa5ee3b..6583b72d9b0 100644 --- a/reactos/lib/msvcrt/io/pipe.c +++ b/reactos/lib/msvcrt/io/pipe.c @@ -1,4 +1,4 @@ -/* $Id: pipe.c,v 1.3 2002/09/07 15:12:32 chorns Exp $ +/* $Id: pipe.c,v 1.4 2002/09/08 10:22:50 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -8,7 +8,10 @@ * UPDATE HISTORY: * 28/12/98: Appropriated for Reactos */ -#include +#include +#include +#include +#include int _pipe(int _fildes[2], unsigned int size, int mode ) diff --git a/reactos/lib/msvcrt/io/read.c b/reactos/lib/msvcrt/io/read.c index e70e41e0d5b..8a69cd6d48f 100644 --- a/reactos/lib/msvcrt/io/read.c +++ b/reactos/lib/msvcrt/io/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.7 2002/09/07 15:12:32 chorns Exp $ +/* $Id: read.c,v 1.8 2002/09/08 10:22:50 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,13 +11,14 @@ * any amount of data has been read. It's the expected * behavior for line-buffered streams (KJK::Hyperion) */ -#include +#include +#include +#include #define NDEBUG -#include +#include - -int _read(int _fd, void *_buf, unsigned int _nbyte) +size_t _read(int _fd, void *_buf, size_t _nbyte) { DWORD _rbyte = 0, nbyte = _nbyte; char *bufp = (char*)_buf; @@ -30,7 +31,7 @@ int _read(int _fd, void *_buf, unsigned int _nbyte) if(_nbyte == 0) return 0; - hfile = (HANDLE)_get_osfhandle(_fd); + hfile = _get_osfhandle(_fd); istext = __fileno_getmode(_fd) & O_TEXT; /* read data */ diff --git a/reactos/lib/msvcrt/io/setmode.c b/reactos/lib/msvcrt/io/setmode.c index bd290804a8f..feba9b2eaac 100644 --- a/reactos/lib/msvcrt/io/setmode.c +++ b/reactos/lib/msvcrt/io/setmode.c @@ -1,4 +1,4 @@ -/* $Id: setmode.c,v 1.5 2002/09/07 15:12:32 chorns Exp $ +/* $Id: setmode.c,v 1.6 2002/09/08 10:22:50 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -8,10 +8,13 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include + +#include +#include +#include #define NDEBUG -#include +#include int _setmode(int _fd, int _newmode) diff --git a/reactos/lib/msvcrt/io/sopen.c b/reactos/lib/msvcrt/io/sopen.c index 3ce33cd762c..e98fa85c1ba 100644 --- a/reactos/lib/msvcrt/io/sopen.c +++ b/reactos/lib/msvcrt/io/sopen.c @@ -1,44 +1,12 @@ -#include +#include -int -vsopen(const char *path, int access, int shflag, va_list args) +int _sopen(char *path, int access, int shflag, int mode) { - int mode; - - mode = va_arg(args, int); - return _open(path, access | shflag, mode); + return _open((path), (access)|(shflag), (mode)); } -int -vwsopen(const wchar_t *path, int access, int shflag, va_list args) +int _wsopen(wchar_t *path, int access, int shflag, int mode) { - int mode; - - mode = va_arg(args, int); - return _wopen(path, access | shflag, mode); -} - -int _sopen(const char *path, int access, int shflag, ...) -{ - va_list args; - int retval; - - va_start (args, shflag); - retval = vsopen(path, access, shflag, args); - va_end (args); - - return retval; -} - -int _wsopen(const wchar_t *path, int access, int shflag, ...) -{ - va_list args; - int retval; - - va_start (args, shflag); - retval = vwsopen(path, access, shflag, args); - va_end (args); - - return retval; + return _wopen((path), (access)|(shflag), (mode)); } diff --git a/reactos/lib/msvcrt/io/tell.c b/reactos/lib/msvcrt/io/tell.c index d065995be4b..3d7d95bbf28 100644 --- a/reactos/lib/msvcrt/io/tell.c +++ b/reactos/lib/msvcrt/io/tell.c @@ -1,5 +1,6 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include off_t _tell(int _file) diff --git a/reactos/lib/msvcrt/io/umask.c b/reactos/lib/msvcrt/io/umask.c index fb514cc1b44..4146b81176e 100644 --- a/reactos/lib/msvcrt/io/umask.c +++ b/reactos/lib/msvcrt/io/umask.c @@ -1,10 +1,9 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include +unsigned _unMode_dll = 022; -int _unMode_dll = 022; - -int _umask (int unMode) +unsigned _umask (unsigned unMode) { unsigned old_mask = _unMode_dll; _unMode_dll = unMode; diff --git a/reactos/lib/msvcrt/io/unlink.c b/reactos/lib/msvcrt/io/unlink.c index 0edcbf125cd..9165aac0440 100644 --- a/reactos/lib/msvcrt/io/unlink.c +++ b/reactos/lib/msvcrt/io/unlink.c @@ -7,10 +7,11 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include +#include +#include #define NDEBUG -#include +#include int _unlink(const char *filename) diff --git a/reactos/lib/msvcrt/io/utime.c b/reactos/lib/msvcrt/io/utime.c index 2fe3c5f4bc1..7a5b0378ccd 100644 --- a/reactos/lib/msvcrt/io/utime.c +++ b/reactos/lib/msvcrt/io/utime.c @@ -1,5 +1,8 @@ -#include - +#include +#include +#include +#include +#include int _utime(const char* filename, struct _utimbuf* buf) { diff --git a/reactos/lib/msvcrt/io/write.c b/reactos/lib/msvcrt/io/write.c index 82bd0bca01a..299d3042ef1 100644 --- a/reactos/lib/msvcrt/io/write.c +++ b/reactos/lib/msvcrt/io/write.c @@ -7,15 +7,16 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include +#include +#include +#include #define NDEBUG -#include - +#include #define BUFSIZE 4096 -int _write(int _fd, const void *_buf, unsigned int _nbyte) +size_t _write(int _fd, const void *_buf, size_t _nbyte) { char *tmp, *in, *out; int count, result; @@ -41,7 +42,7 @@ int _write(int _fd, const void *_buf, unsigned int _nbyte) count--; if (count == 0) { - if (!WriteFile((HANDLE)_get_osfhandle(_fd), tmp, BUFSIZE, &wbyte, NULL)) + if (!WriteFile(_get_osfhandle(_fd), tmp, BUFSIZE, &wbyte, NULL)) { result = -1; break; @@ -59,7 +60,7 @@ int _write(int _fd, const void *_buf, unsigned int _nbyte) count--; if (count == 0 || _nbyte == 0) { - if (!WriteFile((HANDLE)_get_osfhandle(_fd), tmp, BUFSIZE - count, &wbyte, NULL)) + if (!WriteFile(_get_osfhandle(_fd), tmp, BUFSIZE - count, &wbyte, NULL)) { result = -1; break; @@ -78,7 +79,7 @@ int _write(int _fd, const void *_buf, unsigned int _nbyte) } else { - if(!WriteFile((HANDLE)_get_osfhandle(_fd), _buf, _nbyte, &wbyte, NULL)) + if(!WriteFile(_get_osfhandle(_fd), _buf, _nbyte, &wbyte, NULL)) { return -1; } diff --git a/reactos/lib/msvcrt/locale/locale.c b/reactos/lib/msvcrt/locale/locale.c index fa3b07d45f2..971c706c661 100644 --- a/reactos/lib/msvcrt/locale/locale.c +++ b/reactos/lib/msvcrt/locale/locale.c @@ -1,4 +1,7 @@ -#include +#include +#include +#include +#include int _current_category; /* used by setlocale */ diff --git a/reactos/lib/msvcrt/math.c b/reactos/lib/msvcrt/math.c deleted file mode 100755 index 2aab546775b..00000000000 --- a/reactos/lib/msvcrt/math.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "math/acos.c" -#include "math/adjust.c" -#include "math/asin.c" -#include "math/atan.c" -#include "math/atan2.c" -#include "math/cabs.c" -#include "math/ceil.c" -#include "math/cos.c" -#include "math/cosh.c" -#include "math/exp.c" -#include "math/fabs.c" -#include "math/floor.c" -#include "math/fmod.c" -#include "math/frexp.c" -#include "math/ftol.c" -#include "math/huge_val.c" -#include "math/hypot.c" -#include "math/j0_y0.c" -#include "math/j1_y1.c" -#include "math/jn_yn.c" -#include "math/ldexp.c" -#include "math/log.c" -#include "math/log10.c" -#include "math/modf.c" -#include "math/pow.c" -#include "math/sin.c" -#include "math/sinh.c" -#include "math/sqrt.c" -#include "math/stubs.c" -#include "math/tan.c" -#include "math/tanh.c" diff --git a/reactos/lib/msvcrt/math/acos.c b/reactos/lib/msvcrt/math/acos.c index 2a87cb4a065..9bde5e95b0a 100644 --- a/reactos/lib/msvcrt/math/acos.c +++ b/reactos/lib/msvcrt/math/acos.c @@ -16,10 +16,9 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ -#include + Boston, MA 02111-1307, USA. */ +#include double acos (double __x) { diff --git a/reactos/lib/msvcrt/math/asin.c b/reactos/lib/msvcrt/math/asin.c index f097bd4dbcb..5f912baead1 100644 --- a/reactos/lib/msvcrt/math/asin.c +++ b/reactos/lib/msvcrt/math/asin.c @@ -16,10 +16,9 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ -#include + Boston, MA 02111-1307, USA. */ +#include double asin (double __x) { diff --git a/reactos/lib/msvcrt/math/atan.c b/reactos/lib/msvcrt/math/atan.c index 3fe490ffed6..d1df5035bd0 100644 --- a/reactos/lib/msvcrt/math/atan.c +++ b/reactos/lib/msvcrt/math/atan.c @@ -16,10 +16,9 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ -#include + Boston, MA 02111-1307, USA. */ +#include double atan (double __x); diff --git a/reactos/lib/msvcrt/math/atan2.c b/reactos/lib/msvcrt/math/atan2.c index 004be53a859..f430c2770b9 100644 --- a/reactos/lib/msvcrt/math/atan2.c +++ b/reactos/lib/msvcrt/math/atan2.c @@ -1,5 +1,5 @@ -#include +#include double atan2 (double __y, double __x); diff --git a/reactos/lib/msvcrt/math/cabs.c b/reactos/lib/msvcrt/math/cabs.c index b2c0fadc93c..73d4643290f 100644 --- a/reactos/lib/msvcrt/math/cabs.c +++ b/reactos/lib/msvcrt/math/cabs.c @@ -1,5 +1,4 @@ -#include - +#include double _cabs( struct _complex z ) { diff --git a/reactos/lib/msvcrt/math/ceil.c b/reactos/lib/msvcrt/math/ceil.c index 018dd645981..34a10193ff3 100644 --- a/reactos/lib/msvcrt/math/ceil.c +++ b/reactos/lib/msvcrt/math/ceil.c @@ -1,5 +1,4 @@ -#include - +#include double ceil (double __x) { diff --git a/reactos/lib/msvcrt/math/cos.c b/reactos/lib/msvcrt/math/cos.c index 39414550d94..1753f59413d 100644 --- a/reactos/lib/msvcrt/math/cos.c +++ b/reactos/lib/msvcrt/math/cos.c @@ -1,5 +1,4 @@ -#include - +#include double cos (double __x); diff --git a/reactos/lib/msvcrt/math/cosh.c b/reactos/lib/msvcrt/math/cosh.c index 7b3d861f7fe..1f89a0ead5b 100644 --- a/reactos/lib/msvcrt/math/cosh.c +++ b/reactos/lib/msvcrt/math/cosh.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include double cosh(double x) { diff --git a/reactos/lib/msvcrt/math/exp.c b/reactos/lib/msvcrt/math/exp.c index cfe223630cc..fb074fbdb8d 100644 --- a/reactos/lib/msvcrt/math/exp.c +++ b/reactos/lib/msvcrt/math/exp.c @@ -18,7 +18,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include double exp (double __x); diff --git a/reactos/lib/msvcrt/math/fabs.c b/reactos/lib/msvcrt/math/fabs.c index 25f7a9712df..2e1587a9896 100644 --- a/reactos/lib/msvcrt/math/fabs.c +++ b/reactos/lib/msvcrt/math/fabs.c @@ -16,10 +16,9 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ -#include + Boston, MA 02111-1307, USA. */ +#include double fabs (double __x); diff --git a/reactos/lib/msvcrt/math/floor.c b/reactos/lib/msvcrt/math/floor.c index 7a482850ccb..3e567818287 100644 --- a/reactos/lib/msvcrt/math/floor.c +++ b/reactos/lib/msvcrt/math/floor.c @@ -16,10 +16,9 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ -#include + Boston, MA 02111-1307, USA. */ +#include double floor (double __x); diff --git a/reactos/lib/msvcrt/math/fmod.c b/reactos/lib/msvcrt/math/fmod.c index 1e40240d43c..823fc00a77d 100644 --- a/reactos/lib/msvcrt/math/fmod.c +++ b/reactos/lib/msvcrt/math/fmod.c @@ -16,10 +16,9 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ -#include + Boston, MA 02111-1307, USA. */ +#include double fmod (double __x, double __y); diff --git a/reactos/lib/msvcrt/math/frexp.c b/reactos/lib/msvcrt/math/frexp.c index f7140b27ce3..27de8a366e3 100644 --- a/reactos/lib/msvcrt/math/frexp.c +++ b/reactos/lib/msvcrt/math/frexp.c @@ -1,5 +1,6 @@ -#include - +#include +#include +#include double frexp(double __x, int *exptr) diff --git a/reactos/lib/msvcrt/math/ftol.c b/reactos/lib/msvcrt/math/ftol.c index 6d18ebce689..dfa334624e6 100644 --- a/reactos/lib/msvcrt/math/ftol.c +++ b/reactos/lib/msvcrt/math/ftol.c @@ -1,5 +1,4 @@ -#include - +#include long _ftol(double fl) { diff --git a/reactos/lib/msvcrt/math/huge_val.c b/reactos/lib/msvcrt/math/huge_val.c index eb7e218fa5a..aaa50d0e81e 100644 --- a/reactos/lib/msvcrt/math/huge_val.c +++ b/reactos/lib/msvcrt/math/huge_val.c @@ -1,5 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include -double _HUGE = { 0x00000, 0x00000, 0x7ff, 0x0 }; +#undef _HUGE +double_t _HUGE = { 0x00000, 0x00000, 0x7ff, 0x0 }; diff --git a/reactos/lib/msvcrt/math/hypot.c b/reactos/lib/msvcrt/math/hypot.c index 36dfc33ddd4..9ca52e3ec1b 100644 --- a/reactos/lib/msvcrt/math/hypot.c +++ b/reactos/lib/msvcrt/math/hypot.c @@ -15,8 +15,10 @@ * inflicting too much of a performance hit. * */ -#include - + +#include +#include +#include /* Approximate square roots of DBL_MAX and DBL_MIN. Numbers between these two shouldn't neither overflow nor underflow diff --git a/reactos/lib/msvcrt/math/j0_y0.c b/reactos/lib/msvcrt/math/j0_y0.c index e9489a891b4..db89a92acaa 100644 --- a/reactos/lib/msvcrt/math/j0_y0.c +++ b/reactos/lib/msvcrt/math/j0_y0.c @@ -1,5 +1,4 @@ -#include - +#include double _j0(double x) { diff --git a/reactos/lib/msvcrt/math/j1_y1.c b/reactos/lib/msvcrt/math/j1_y1.c index 1f4313764f1..fa0f618f3fd 100644 --- a/reactos/lib/msvcrt/math/j1_y1.c +++ b/reactos/lib/msvcrt/math/j1_y1.c @@ -1,5 +1,4 @@ -#include - +#include double _j1(double x) { diff --git a/reactos/lib/msvcrt/math/jn_yn.c b/reactos/lib/msvcrt/math/jn_yn.c index 8f2e945f2c3..b641a81dc07 100644 --- a/reactos/lib/msvcrt/math/jn_yn.c +++ b/reactos/lib/msvcrt/math/jn_yn.c @@ -1,5 +1,4 @@ -#include - +#include double _jn(int n, double x) { diff --git a/reactos/lib/msvcrt/math/ldexp.c b/reactos/lib/msvcrt/math/ldexp.c index 89697493bc2..65e9e254237 100644 --- a/reactos/lib/msvcrt/math/ldexp.c +++ b/reactos/lib/msvcrt/math/ldexp.c @@ -16,10 +16,9 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ -#include + Boston, MA 02111-1307, USA. */ +#include double ldexp (double __x, int __y); diff --git a/reactos/lib/msvcrt/math/log.c b/reactos/lib/msvcrt/math/log.c index 63dafe58ad8..e9b7cb64ec4 100644 --- a/reactos/lib/msvcrt/math/log.c +++ b/reactos/lib/msvcrt/math/log.c @@ -16,10 +16,9 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ -#include + Boston, MA 02111-1307, USA. */ +#include double log (double __x); diff --git a/reactos/lib/msvcrt/math/log10.c b/reactos/lib/msvcrt/math/log10.c index 850d1361a71..e1988374d1c 100644 --- a/reactos/lib/msvcrt/math/log10.c +++ b/reactos/lib/msvcrt/math/log10.c @@ -16,10 +16,9 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ -#include + Boston, MA 02111-1307, USA. */ +#include double log10 (double __x); diff --git a/reactos/lib/msvcrt/math/modf.c b/reactos/lib/msvcrt/math/modf.c index 1c451dea4a7..336a7d712bf 100644 --- a/reactos/lib/msvcrt/math/modf.c +++ b/reactos/lib/msvcrt/math/modf.c @@ -9,7 +9,11 @@ * is preserved. * ==================================================== */ -#include + +#include +#include +#include + //static const double one = 1.0; diff --git a/reactos/lib/msvcrt/math/pow.c b/reactos/lib/msvcrt/math/pow.c index a00b72923c6..266fc039840 100644 --- a/reactos/lib/msvcrt/math/pow.c +++ b/reactos/lib/msvcrt/math/pow.c @@ -16,10 +16,9 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ -#include + Boston, MA 02111-1307, USA. */ +#include double pow (double __x, double __y); diff --git a/reactos/lib/msvcrt/math/sin.c b/reactos/lib/msvcrt/math/sin.c index 6d45275947d..97e58a3059c 100644 --- a/reactos/lib/msvcrt/math/sin.c +++ b/reactos/lib/msvcrt/math/sin.c @@ -16,10 +16,9 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ -#include + Boston, MA 02111-1307, USA. */ +#include double sin (double __x); diff --git a/reactos/lib/msvcrt/math/sinh.c b/reactos/lib/msvcrt/math/sinh.c index 24bc485ae7d..5a0b2be95a8 100644 --- a/reactos/lib/msvcrt/math/sinh.c +++ b/reactos/lib/msvcrt/math/sinh.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include double sinh(double x) { diff --git a/reactos/lib/msvcrt/math/sqrt.c b/reactos/lib/msvcrt/math/sqrt.c index 3b8ce1e78c9..47e5e5ff7fd 100644 --- a/reactos/lib/msvcrt/math/sqrt.c +++ b/reactos/lib/msvcrt/math/sqrt.c @@ -16,10 +16,8 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ -#include - + Boston, MA 02111-1307, USA. */ +#include double sqrt (double __x); diff --git a/reactos/lib/msvcrt/math/stubs.c b/reactos/lib/msvcrt/math/stubs.c index 6056fc15026..a43b9fc9ca2 100644 --- a/reactos/lib/msvcrt/math/stubs.c +++ b/reactos/lib/msvcrt/math/stubs.c @@ -1,5 +1,4 @@ -#include - +#include double _CIsin (double x); double _CIcos (double x); diff --git a/reactos/lib/msvcrt/math/tan.c b/reactos/lib/msvcrt/math/tan.c index dfafa996316..baa92c4f828 100644 --- a/reactos/lib/msvcrt/math/tan.c +++ b/reactos/lib/msvcrt/math/tan.c @@ -16,10 +16,9 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ -#include + Boston, MA 02111-1307, USA. */ +#include double tan (double __x); diff --git a/reactos/lib/msvcrt/math/tanh.c b/reactos/lib/msvcrt/math/tanh.c index b103566280b..da1eabb8ace 100644 --- a/reactos/lib/msvcrt/math/tanh.c +++ b/reactos/lib/msvcrt/math/tanh.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include double tanh(double x) { diff --git a/reactos/lib/msvcrt/mbstring.c b/reactos/lib/msvcrt/mbstring.c deleted file mode 100755 index 9aa07081c5a..00000000000 --- a/reactos/lib/msvcrt/mbstring.c +++ /dev/null @@ -1,54 +0,0 @@ -#include "mbstring/hanzen.c" -#include "mbstring/ischira.c" -#include "mbstring/iskana.c" -#include "mbstring/iskpun.c" -#include "mbstring/islead.c" -#include "mbstring/islwr.c" -#include "mbstring/ismbal.c" -#include "mbstring/ismbaln.c" -#include "mbstring/ismbc.c" -#include "mbstring/ismbgra.c" -#include "mbstring/ismbkaln.c" -#include "mbstring/ismblead.c" -#include "mbstring/ismbpri.c" -#include "mbstring/ismbpun.c" -#include "mbstring/ismbtrl.c" -#include "mbstring/isuppr.c" -#include "mbstring/jistojms.c" -#include "mbstring/jmstojis.c" -#include "mbstring/mbbtype.c" -#include "mbstring/mbccpy.c" -#include "mbstring/mbclen.c" -#include "mbstring/mbscat.c" -#include "mbstring/mbschr.c" -#include "mbstring/mbscmp.c" -#include "mbstring/mbscoll.c" -#include "mbstring/mbscpy.c" -#include "mbstring/mbscspn.c" -#include "mbstring/mbsdec.c" -#include "mbstring/mbsdup.c" -#include "mbstring/mbsicmp.c" -#include "mbstring/mbsicoll.c" -#include "mbstring/mbsinc.c" -#include "mbstring/mbslen.c" -#include "mbstring/mbslwr.c" -#include "mbstring/mbsncat.c" -#include "mbstring/mbsnccnt.c" -#include "mbstring/mbsncmp.c" -#include "mbstring/mbsncoll.c" -#include "mbstring/mbsncpy.c" -#include "mbstring/mbsnextc.c" -#include "mbstring/mbsnicmp.c" -#include "mbstring/mbsnicoll.c" -#include "mbstring/mbsninc.c" -#include "mbstring/mbsnset.c" -#include "mbstring/mbspbrk.c" -#include "mbstring/mbsrchr.c" -#include "mbstring/mbsrev.c" -#include "mbstring/mbsset.c" -#include "mbstring/mbsspn.c" -#include "mbstring/mbsspnp.c" -#include "mbstring/mbsstr.c" -#include "mbstring/mbstok.c" -#include "mbstring/mbstrlen.c" -#include "mbstring/mbsupr.c" diff --git a/reactos/lib/msvcrt/mbstring/hanzen.c b/reactos/lib/msvcrt/mbstring/hanzen.c index ad506ab5082..f640d4e2f11 100644 --- a/reactos/lib/msvcrt/mbstring/hanzen.c +++ b/reactos/lib/msvcrt/mbstring/hanzen.c @@ -8,8 +8,8 @@ Modified from Taiji Yamada japanese code system utilities * 12/04/99: Created */ -#include +#include static unsigned short han_to_zen_ascii_table[0x5f] = { 0x8140, 0x8149, 0x8168, 0x8194, 0x8190, 0x8193, 0x8195, 0x8166, @@ -61,7 +61,7 @@ static unsigned char zen_to_han_symbol_table_2[ZTOH_SYMBOLS] = { #define JTOKANA(c) ((c) <= 0x82dd ? (c) + 0xa1 : (c) + 0xa2) -unsigned int _mbbtombc(unsigned int c) +unsigned short _mbbtombc(unsigned short c) { if (c >= 0x20 && c <= 0x7e) { return han_to_zen_ascii_table[c - 0x20]; @@ -72,7 +72,7 @@ unsigned int _mbbtombc(unsigned int c) } -unsigned int _mbctombb(unsigned int c) +unsigned short _mbctombb(unsigned short c) { int i; unsigned short *p; diff --git a/reactos/lib/msvcrt/mbstring/ischira.c b/reactos/lib/msvcrt/mbstring/ischira.c index 4de6b534e9a..b27bf6ec9d1 100644 --- a/reactos/lib/msvcrt/mbstring/ischira.c +++ b/reactos/lib/msvcrt/mbstring/ischira.c @@ -7,8 +7,9 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include +#include +#include int _ismbchira( unsigned int c ) { diff --git a/reactos/lib/msvcrt/mbstring/iskana.c b/reactos/lib/msvcrt/mbstring/iskana.c index 393f9263893..f7d028b6925 100644 --- a/reactos/lib/msvcrt/mbstring/iskana.c +++ b/reactos/lib/msvcrt/mbstring/iskana.c @@ -5,13 +5,13 @@ * PURPOSE: Checks for kana character * PROGRAMER: Boudewijn Dekker, Taiji Yamada * UPDATE HISTORY: - * Modified from Taiji Yamada japanese code system utilities + Modified from Taiji Yamada japanese code system utilities * 12/04/99: Created */ -#include +#include +#include - -int _ismbbkana(unsigned int c) +int _ismbbkana(unsigned char c) { return ((_jctype+1)[(unsigned char)(c)] & (_KNJ_M|_KNJ_P)); } diff --git a/reactos/lib/msvcrt/mbstring/iskmoji.c b/reactos/lib/msvcrt/mbstring/iskmoji.c index 0ac38d4d1f4..a8cc1745bf8 100644 --- a/reactos/lib/msvcrt/mbstring/iskmoji.c +++ b/reactos/lib/msvcrt/mbstring/iskmoji.c @@ -1,5 +1,4 @@ -#include - +#include int _ismbbkalpha(unsigned char c) { diff --git a/reactos/lib/msvcrt/mbstring/iskpun.c b/reactos/lib/msvcrt/mbstring/iskpun.c index 30fdf151373..fc04c8dc946 100644 --- a/reactos/lib/msvcrt/mbstring/iskpun.c +++ b/reactos/lib/msvcrt/mbstring/iskpun.c @@ -7,8 +7,7 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include - +#include int _ismbbkpunct( unsigned int c ) { diff --git a/reactos/lib/msvcrt/mbstring/islead.c b/reactos/lib/msvcrt/mbstring/islead.c index 87f3506da26..08ff0a6693d 100644 --- a/reactos/lib/msvcrt/mbstring/islead.c +++ b/reactos/lib/msvcrt/mbstring/islead.c @@ -1,7 +1,8 @@ -#include +#include +#include - -int isleadbyte(int c) +int isleadbyte(char *mbstr) { return 0; + //return IsDBCSLeadByteEx(0,*c); } diff --git a/reactos/lib/msvcrt/mbstring/islwr.c b/reactos/lib/msvcrt/mbstring/islwr.c index 500fa4ebaf3..01c9cf43092 100644 --- a/reactos/lib/msvcrt/mbstring/islwr.c +++ b/reactos/lib/msvcrt/mbstring/islwr.c @@ -7,8 +7,9 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include +#include +#include // code page 952 only int _ismbclower( unsigned int c ) diff --git a/reactos/lib/msvcrt/mbstring/ismbal.c b/reactos/lib/msvcrt/mbstring/ismbal.c index 5dec99dd540..ee59df2ef98 100644 --- a/reactos/lib/msvcrt/mbstring/ismbal.c +++ b/reactos/lib/msvcrt/mbstring/ismbal.c @@ -7,10 +7,10 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include +#include +#include - -int _ismbbalpha(unsigned int c) +int _ismbbalpha(unsigned char c) { return (isalpha(c) || _ismbbkalnum(c)); } diff --git a/reactos/lib/msvcrt/mbstring/ismbaln.c b/reactos/lib/msvcrt/mbstring/ismbaln.c index 143d9c94ef8..a72f4d89a64 100644 --- a/reactos/lib/msvcrt/mbstring/ismbaln.c +++ b/reactos/lib/msvcrt/mbstring/ismbaln.c @@ -1,7 +1,8 @@ -#include +#include +#include -int _ismbbalnum(unsigned int c) +int _ismbbalnum(unsigned char c) { return (isalnum(c) || _ismbbkalnum(c)); } diff --git a/reactos/lib/msvcrt/mbstring/ismbc.c b/reactos/lib/msvcrt/mbstring/ismbc.c index 70308e984f5..6c2ece21145 100644 --- a/reactos/lib/msvcrt/mbstring/ismbc.c +++ b/reactos/lib/msvcrt/mbstring/ismbc.c @@ -1,5 +1,7 @@ -#include +#include +int _ismbbalpha(unsigned char c); +int _ismbbalnum(unsigned char c); int _ismbcalnum( unsigned int c ) { diff --git a/reactos/lib/msvcrt/mbstring/ismbgra.c b/reactos/lib/msvcrt/mbstring/ismbgra.c index 2a2eb8a384f..d86781fa442 100644 --- a/reactos/lib/msvcrt/mbstring/ismbgra.c +++ b/reactos/lib/msvcrt/mbstring/ismbgra.c @@ -1,7 +1,8 @@ -#include +#include +#include +#include - -int _ismbbgraph(unsigned int c) +int _ismbbgraph(unsigned char c) { return (isgraph(c) || _ismbbkana(c)); } diff --git a/reactos/lib/msvcrt/mbstring/ismbkaln.c b/reactos/lib/msvcrt/mbstring/ismbkaln.c index c963a2b08fc..446a5981d8e 100644 --- a/reactos/lib/msvcrt/mbstring/ismbkaln.c +++ b/reactos/lib/msvcrt/mbstring/ismbkaln.c @@ -7,8 +7,8 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include - +#include +#include int _ismbbkalnum( unsigned int c ) { diff --git a/reactos/lib/msvcrt/mbstring/ismblead.c b/reactos/lib/msvcrt/mbstring/ismblead.c index 0dab86ff194..f15f3ec6248 100644 --- a/reactos/lib/msvcrt/mbstring/ismblead.c +++ b/reactos/lib/msvcrt/mbstring/ismblead.c @@ -8,12 +8,14 @@ * Modified from Taiji Yamada japanese code system utilities * 12/04/99: Created */ -#include +#include +#include +#include size_t _mbclen2(const unsigned int s); -unsigned char _mbctype[257] = { +char _jctype[257] = { /*-1*/ ___, /*0x*/ ___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___, /*1x*/ ___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___, @@ -33,6 +35,7 @@ unsigned char _mbctype[257] = { /*Fx*/ _12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,___,___,___ }; +char *_mbctype = _jctype; int _ismbblead(unsigned int c) { return ((_jctype+1)[(unsigned char)(c)] & _KNJ_1); diff --git a/reactos/lib/msvcrt/mbstring/ismbpri.c b/reactos/lib/msvcrt/mbstring/ismbpri.c index 7a5438b242f..c6d9bf6bf9c 100644 --- a/reactos/lib/msvcrt/mbstring/ismbpri.c +++ b/reactos/lib/msvcrt/mbstring/ismbpri.c @@ -1,7 +1,8 @@ -#include +#include +#include +#include - -int _ismbbprint(unsigned int c) +int _ismbbprint(unsigned char c) { return (isprint(c) || _ismbbkana(c)); } diff --git a/reactos/lib/msvcrt/mbstring/ismbpun.c b/reactos/lib/msvcrt/mbstring/ismbpun.c index 7f2b25697d0..171b1a40b45 100644 --- a/reactos/lib/msvcrt/mbstring/ismbpun.c +++ b/reactos/lib/msvcrt/mbstring/ismbpun.c @@ -2,10 +2,11 @@ //iskana() :(0xA1 <= c <= 0xDF) //iskpun() :(0xA1 <= c <= 0xA6) //iskmoji() :(0xA7 <= c <= 0xDF) -#include +#include +#include +#include - -int _ismbbpunct(unsigned int c) +int _ismbbpunct(unsigned char c) { // (0xA1 <= c <= 0xA6) return (ispunct(c) || _ismbbkana(c)); diff --git a/reactos/lib/msvcrt/mbstring/ismbtrl.c b/reactos/lib/msvcrt/mbstring/ismbtrl.c index 46f7afcbf42..aeeff7eb25a 100644 --- a/reactos/lib/msvcrt/mbstring/ismbtrl.c +++ b/reactos/lib/msvcrt/mbstring/ismbtrl.c @@ -7,8 +7,9 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include +#include +#include size_t _mbclen2(const unsigned int s); diff --git a/reactos/lib/msvcrt/mbstring/isuppr.c b/reactos/lib/msvcrt/mbstring/isuppr.c index 601128849e3..110b9a828a0 100644 --- a/reactos/lib/msvcrt/mbstring/isuppr.c +++ b/reactos/lib/msvcrt/mbstring/isuppr.c @@ -7,8 +7,9 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include +#include +#include // code page 952 only int _ismbcupper( unsigned int c ) diff --git a/reactos/lib/msvcrt/mbstring/jistojms.c b/reactos/lib/msvcrt/mbstring/jistojms.c index 26afa5a5b8d..c05d80e16b1 100644 --- a/reactos/lib/msvcrt/mbstring/jistojms.c +++ b/reactos/lib/msvcrt/mbstring/jistojms.c @@ -1,7 +1,6 @@ -#include +#include - -unsigned int _mbcjistojms(unsigned int c) +unsigned short _mbcjistojms(unsigned short c) { int c1, c2; diff --git a/reactos/lib/msvcrt/mbstring/jmstojis.c b/reactos/lib/msvcrt/mbstring/jmstojis.c index f3c778d58c7..62c948d3ebc 100644 --- a/reactos/lib/msvcrt/mbstring/jmstojis.c +++ b/reactos/lib/msvcrt/mbstring/jmstojis.c @@ -1,6 +1,6 @@ -#include +#include -unsigned int _mbcjmstojis(unsigned int c) +unsigned short _mbcjmstojis(unsigned short c) { int c1, c2; diff --git a/reactos/lib/msvcrt/mbstring/mbbtype.c b/reactos/lib/msvcrt/mbstring/mbbtype.c index 789400ccf9d..85e605abef4 100644 --- a/reactos/lib/msvcrt/mbstring/mbbtype.c +++ b/reactos/lib/msvcrt/mbstring/mbbtype.c @@ -7,8 +7,9 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include +#include +#include int _mbbtype(unsigned char c , int type) { @@ -41,7 +42,7 @@ int _mbbtype(unsigned char c , int type) int _mbsbtype( const unsigned char *str, size_t n ) { - if (str == (void *)0) + if (str == NULL) return -1; return _mbbtype(*(str+n),1); } diff --git a/reactos/lib/msvcrt/mbstring/mbccpy.c b/reactos/lib/msvcrt/mbstring/mbccpy.c index d35aca579b7..6cf434ecd3b 100644 --- a/reactos/lib/msvcrt/mbstring/mbccpy.c +++ b/reactos/lib/msvcrt/mbstring/mbccpy.c @@ -1,5 +1,5 @@ -#include - +#include +#include size_t _mbclen2(const unsigned int s); diff --git a/reactos/lib/msvcrt/mbstring/mbclen.c b/reactos/lib/msvcrt/mbstring/mbclen.c index b65e22a51d5..389aa07cee7 100644 --- a/reactos/lib/msvcrt/mbstring/mbclen.c +++ b/reactos/lib/msvcrt/mbstring/mbclen.c @@ -1,4 +1,6 @@ -#include + +#include +#include size_t _mbclen(const unsigned char *s) diff --git a/reactos/lib/msvcrt/mbstring/mbscat.c b/reactos/lib/msvcrt/mbstring/mbscat.c index fd72220fba6..dc6a982cad8 100644 --- a/reactos/lib/msvcrt/mbstring/mbscat.c +++ b/reactos/lib/msvcrt/mbstring/mbscat.c @@ -1,5 +1,4 @@ -#include - +#include unsigned char * _mbscat(unsigned char *dst, const unsigned char *src) { diff --git a/reactos/lib/msvcrt/mbstring/mbschr.c b/reactos/lib/msvcrt/mbstring/mbschr.c index 489d7bac48e..70c4c67bade 100644 --- a/reactos/lib/msvcrt/mbstring/mbschr.c +++ b/reactos/lib/msvcrt/mbstring/mbschr.c @@ -1,5 +1,4 @@ -#include - +#include unsigned char * _mbschr(const unsigned char *str, unsigned int c) { diff --git a/reactos/lib/msvcrt/mbstring/mbscmp.c b/reactos/lib/msvcrt/mbstring/mbscmp.c index 5ef888dbf68..3bc0d98c058 100644 --- a/reactos/lib/msvcrt/mbstring/mbscmp.c +++ b/reactos/lib/msvcrt/mbstring/mbscmp.c @@ -1,5 +1,5 @@ -#include - +#include +#include int _mbscmp(const unsigned char *str1, const unsigned char *str2) { diff --git a/reactos/lib/msvcrt/mbstring/mbscoll.c b/reactos/lib/msvcrt/mbstring/mbscoll.c index 2b46bba942d..dad12be050b 100644 --- a/reactos/lib/msvcrt/mbstring/mbscoll.c +++ b/reactos/lib/msvcrt/mbstring/mbscoll.c @@ -7,8 +7,8 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include +#include int colldif(unsigned short c1, unsigned short c2); diff --git a/reactos/lib/msvcrt/mbstring/mbscpy.c b/reactos/lib/msvcrt/mbstring/mbscpy.c index 95bc2ed6891..247900aa76a 100644 --- a/reactos/lib/msvcrt/mbstring/mbscpy.c +++ b/reactos/lib/msvcrt/mbstring/mbscpy.c @@ -1,5 +1,5 @@ -#include - +#include +#include unsigned char * _mbscpy(unsigned char *dst, const unsigned char *str) { diff --git a/reactos/lib/msvcrt/mbstring/mbscspn.c b/reactos/lib/msvcrt/mbstring/mbscspn.c index 6298770cc0f..46783ee21fc 100644 --- a/reactos/lib/msvcrt/mbstring/mbscspn.c +++ b/reactos/lib/msvcrt/mbstring/mbscspn.c @@ -1,5 +1,4 @@ -#include - +#include // not correct size_t _mbscspn(const unsigned char *s1, const unsigned char *s2) diff --git a/reactos/lib/msvcrt/mbstring/mbsdec.c b/reactos/lib/msvcrt/mbstring/mbsdec.c index 054b1f53383..0836f15c971 100644 --- a/reactos/lib/msvcrt/mbstring/mbsdec.c +++ b/reactos/lib/msvcrt/mbstring/mbsdec.c @@ -1,11 +1,10 @@ -#include - +#include unsigned char * _mbsdec(const unsigned char *str, const unsigned char *cur) { unsigned char *s = (unsigned char *)cur; if ( str >= cur ) - return (void *)0; + return NULL; s--; if (_ismbblead(*(s-1)) ) diff --git a/reactos/lib/msvcrt/mbstring/mbsdup.c b/reactos/lib/msvcrt/mbstring/mbsdup.c index 1e425c75cc7..00dc9d05c97 100644 --- a/reactos/lib/msvcrt/mbstring/mbsdup.c +++ b/reactos/lib/msvcrt/mbstring/mbsdup.c @@ -8,7 +8,9 @@ Modified from DJGPP strdup * 12/04/99: Created */ -#include + +#include +#include unsigned char * _mbsdup(const unsigned char *_s) { diff --git a/reactos/lib/msvcrt/mbstring/mbsicmp.c b/reactos/lib/msvcrt/mbstring/mbsicmp.c index 9d29d57a2a1..db88fede13c 100644 --- a/reactos/lib/msvcrt/mbstring/mbsicmp.c +++ b/reactos/lib/msvcrt/mbstring/mbsicmp.c @@ -7,8 +7,9 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include - +#include +#include +#include int _mbsicmp(const unsigned char *str1, const unsigned char *str2) { diff --git a/reactos/lib/msvcrt/mbstring/mbsicoll.c b/reactos/lib/msvcrt/mbstring/mbsicoll.c index 76dd902e089..32020cc8348 100644 --- a/reactos/lib/msvcrt/mbstring/mbsicoll.c +++ b/reactos/lib/msvcrt/mbstring/mbsicoll.c @@ -7,8 +7,9 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include - +#include +#include +#include int colldif(unsigned short c1, unsigned short c2); int _mbsicoll(const unsigned char *str1, const unsigned char *str2) diff --git a/reactos/lib/msvcrt/mbstring/mbsinc.c b/reactos/lib/msvcrt/mbstring/mbsinc.c index a365e462f9a..30e42e9e22d 100644 --- a/reactos/lib/msvcrt/mbstring/mbsinc.c +++ b/reactos/lib/msvcrt/mbstring/mbsinc.c @@ -1,5 +1,4 @@ -#include - +#include unsigned char * _mbsinc(const unsigned char *s) { diff --git a/reactos/lib/msvcrt/mbstring/mbslen.c b/reactos/lib/msvcrt/mbstring/mbslen.c index 94afddb372c..06386b26756 100644 --- a/reactos/lib/msvcrt/mbstring/mbslen.c +++ b/reactos/lib/msvcrt/mbstring/mbslen.c @@ -1,5 +1,4 @@ -#include - +#include size_t _mbclen2(const unsigned int s); diff --git a/reactos/lib/msvcrt/mbstring/mbslwr.c b/reactos/lib/msvcrt/mbstring/mbslwr.c index 916eb0d3662..0b405fdb054 100644 --- a/reactos/lib/msvcrt/mbstring/mbslwr.c +++ b/reactos/lib/msvcrt/mbstring/mbslwr.c @@ -1,5 +1,5 @@ -#include - +#include +#include unsigned int _mbbtolower(unsigned int c) { diff --git a/reactos/lib/msvcrt/mbstring/mbsncat.c b/reactos/lib/msvcrt/mbstring/mbsncat.c index fed6c5796d4..a875ab0072f 100644 --- a/reactos/lib/msvcrt/mbstring/mbsncat.c +++ b/reactos/lib/msvcrt/mbstring/mbsncat.c @@ -7,8 +7,9 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include +#include +#include size_t _mbclen2(const unsigned int s); diff --git a/reactos/lib/msvcrt/mbstring/mbsnccnt.c b/reactos/lib/msvcrt/mbstring/mbsnccnt.c index 23d21fc64e3..daa44844d68 100644 --- a/reactos/lib/msvcrt/mbstring/mbsnccnt.c +++ b/reactos/lib/msvcrt/mbstring/mbsnccnt.c @@ -1,5 +1,4 @@ -#include - +#include size_t _mbsnccnt(const unsigned char *str, size_t n) { diff --git a/reactos/lib/msvcrt/mbstring/mbsncmp.c b/reactos/lib/msvcrt/mbstring/mbsncmp.c index 4ff3f64b896..8e1011bcf03 100644 --- a/reactos/lib/msvcrt/mbstring/mbsncmp.c +++ b/reactos/lib/msvcrt/mbstring/mbsncmp.c @@ -7,8 +7,8 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include +#include int _mbsncmp(const unsigned char *str1, const unsigned char *str2, size_t n) { diff --git a/reactos/lib/msvcrt/mbstring/mbsncoll.c b/reactos/lib/msvcrt/mbstring/mbsncoll.c index 4b7441e8a82..e32cbd0a6b6 100644 --- a/reactos/lib/msvcrt/mbstring/mbsncoll.c +++ b/reactos/lib/msvcrt/mbstring/mbsncoll.c @@ -7,8 +7,7 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include - +#include int colldif(unsigned short c1, unsigned short c2); diff --git a/reactos/lib/msvcrt/mbstring/mbsncpy.c b/reactos/lib/msvcrt/mbstring/mbsncpy.c index be2bf47a6f1..a2e21c0b79c 100644 --- a/reactos/lib/msvcrt/mbstring/mbsncpy.c +++ b/reactos/lib/msvcrt/mbstring/mbsncpy.c @@ -7,8 +7,8 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include +#include unsigned char *_mbsncpy(unsigned char *str1, const unsigned char *str2, size_t n) { diff --git a/reactos/lib/msvcrt/mbstring/mbsnextc.c b/reactos/lib/msvcrt/mbstring/mbsnextc.c index 21373fcca2c..9b9c4f7c13d 100644 --- a/reactos/lib/msvcrt/mbstring/mbsnextc.c +++ b/reactos/lib/msvcrt/mbstring/mbsnextc.c @@ -1,12 +1,11 @@ -#include - +#include unsigned int _mbsnextc (const unsigned char *src) { unsigned char *char_src = (unsigned char *)src; unsigned short *short_src = (unsigned short *)src; - if (src == (void *)0) + if (src == NULL) return 0; if (!_ismbblead(*src)) diff --git a/reactos/lib/msvcrt/mbstring/mbsnicmp.c b/reactos/lib/msvcrt/mbstring/mbsnicmp.c index 2eab56a9030..ef34bd15959 100644 --- a/reactos/lib/msvcrt/mbstring/mbsnicmp.c +++ b/reactos/lib/msvcrt/mbstring/mbsnicmp.c @@ -1,5 +1,4 @@ -#include - +#include size_t _mbclen2(const unsigned int s); unsigned int _mbbtoupper(unsigned int c); diff --git a/reactos/lib/msvcrt/mbstring/mbsnicoll.c b/reactos/lib/msvcrt/mbstring/mbsnicoll.c index 7b9d3e88310..c163636eba7 100644 --- a/reactos/lib/msvcrt/mbstring/mbsnicoll.c +++ b/reactos/lib/msvcrt/mbstring/mbsnicoll.c @@ -1,5 +1,4 @@ -#include - +#include int _mbsnicoll(const unsigned char *s1, const unsigned char *s2, size_t n) { diff --git a/reactos/lib/msvcrt/mbstring/mbsninc.c b/reactos/lib/msvcrt/mbstring/mbsninc.c index 2b2e7ba28f3..3cb3a4951ba 100644 --- a/reactos/lib/msvcrt/mbstring/mbsninc.c +++ b/reactos/lib/msvcrt/mbstring/mbsninc.c @@ -1,5 +1,4 @@ -#include - +#include unsigned char * _mbsninc(const unsigned char *str, size_t n) { diff --git a/reactos/lib/msvcrt/mbstring/mbsnset.c b/reactos/lib/msvcrt/mbstring/mbsnset.c index 68c438b7d19..75befef6ee5 100644 --- a/reactos/lib/msvcrt/mbstring/mbsnset.c +++ b/reactos/lib/msvcrt/mbstring/mbsnset.c @@ -7,8 +7,7 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include - +#include size_t _mbclen2(const unsigned int s); diff --git a/reactos/lib/msvcrt/mbstring/mbspbrk.c b/reactos/lib/msvcrt/mbstring/mbspbrk.c index 1ed3fb3aa22..f9566e7dd26 100644 --- a/reactos/lib/msvcrt/mbstring/mbspbrk.c +++ b/reactos/lib/msvcrt/mbstring/mbspbrk.c @@ -1,5 +1,4 @@ -#include - +#include // not correct unsigned char * _mbspbrk(const unsigned char *s1, const unsigned char *s2) diff --git a/reactos/lib/msvcrt/mbstring/mbsrchr.c b/reactos/lib/msvcrt/mbstring/mbsrchr.c index 0848a8b322a..3a2a8d61a29 100644 --- a/reactos/lib/msvcrt/mbstring/mbsrchr.c +++ b/reactos/lib/msvcrt/mbstring/mbsrchr.c @@ -7,8 +7,8 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include +#include size_t _mbclen2(const unsigned int s); diff --git a/reactos/lib/msvcrt/mbstring/mbsrev.c b/reactos/lib/msvcrt/mbstring/mbsrev.c index 2e8670ade75..5509c9d5c50 100644 --- a/reactos/lib/msvcrt/mbstring/mbsrev.c +++ b/reactos/lib/msvcrt/mbstring/mbsrev.c @@ -1,5 +1,4 @@ -#include - +#include unsigned char * _mbsrev(unsigned char *s) { diff --git a/reactos/lib/msvcrt/mbstring/mbsset.c b/reactos/lib/msvcrt/mbstring/mbsset.c index f2c80eee114..4c6f14c23ef 100644 --- a/reactos/lib/msvcrt/mbstring/mbsset.c +++ b/reactos/lib/msvcrt/mbstring/mbsset.c @@ -7,8 +7,8 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include +#include size_t _mbclen2(const unsigned int s); diff --git a/reactos/lib/msvcrt/mbstring/mbsspn.c b/reactos/lib/msvcrt/mbstring/mbsspn.c index 296bee7ce5f..c9ca1ac6219 100644 --- a/reactos/lib/msvcrt/mbstring/mbsspn.c +++ b/reactos/lib/msvcrt/mbstring/mbsspn.c @@ -1,5 +1,4 @@ -#include - +#include // not correct size_t _mbsspn(const unsigned char *s1, const unsigned char *s2) diff --git a/reactos/lib/msvcrt/mbstring/mbsspnp.c b/reactos/lib/msvcrt/mbstring/mbsspnp.c index 625721fca20..37b8f368efa 100644 --- a/reactos/lib/msvcrt/mbstring/mbsspnp.c +++ b/reactos/lib/msvcrt/mbstring/mbsspnp.c @@ -1,5 +1,4 @@ -#include - +#include // not correct unsigned char * _mbsspnp(const unsigned char *s1, const unsigned char *s2) diff --git a/reactos/lib/msvcrt/mbstring/mbsstr.c b/reactos/lib/msvcrt/mbstring/mbsstr.c index 875e04355ab..ba0b86231f2 100644 --- a/reactos/lib/msvcrt/mbstring/mbsstr.c +++ b/reactos/lib/msvcrt/mbstring/mbsstr.c @@ -1,5 +1,5 @@ -#include - +#include +#include unsigned char *_mbsstr(const unsigned char *src1,const unsigned char *src2) { diff --git a/reactos/lib/msvcrt/mbstring/mbstok.c b/reactos/lib/msvcrt/mbstring/mbstok.c index 89246730a74..3c6809738ff 100644 --- a/reactos/lib/msvcrt/mbstring/mbstok.c +++ b/reactos/lib/msvcrt/mbstring/mbstok.c @@ -1,7 +1,6 @@ -#include +#include - -unsigned char * _mbstok(unsigned char *s, const unsigned char *delim) +unsigned char * _mbstok(unsigned char *s, unsigned char *delim) { const char *spanp; int c, sc; @@ -9,8 +8,8 @@ unsigned char * _mbstok(unsigned char *s, const unsigned char *delim) static char *last; - if (s == (void *)0 && (s = last) == (void *)0) - return ((void *)0); + if (s == NULL && (s = last) == NULL) + return (NULL); /* * Skip (span) leading delimiters (s += strspn(s, delim), sort of). @@ -25,8 +24,8 @@ unsigned char * _mbstok(unsigned char *s, const unsigned char *delim) } if (c == 0) { /* no non-delimiter characters */ - last = (void *)0; - return ((void *)0); + last = NULL; + return (NULL); } tok = s - 1; @@ -41,7 +40,7 @@ unsigned char * _mbstok(unsigned char *s, const unsigned char *delim) do { if ((sc = *spanp) == c) { if (c == 0) - s = (void *)0; + s = NULL; else s[-1] = 0; last = s; diff --git a/reactos/lib/msvcrt/mbstring/mbstrlen.c b/reactos/lib/msvcrt/mbstring/mbstrlen.c index 8dc8c4102df..aa356773a89 100644 --- a/reactos/lib/msvcrt/mbstring/mbstrlen.c +++ b/reactos/lib/msvcrt/mbstring/mbstrlen.c @@ -1,5 +1,5 @@ -#include - +#include +#include size_t _mbstrlen( const char *string ) { diff --git a/reactos/lib/msvcrt/mbstring/mbsupr.c b/reactos/lib/msvcrt/mbstring/mbsupr.c index c25cc285226..8f8ac5b755f 100644 --- a/reactos/lib/msvcrt/mbstring/mbsupr.c +++ b/reactos/lib/msvcrt/mbstring/mbsupr.c @@ -7,8 +7,8 @@ * UPDATE HISTORY: * 12/04/99: Created */ -#include - +#include +#include unsigned int _mbbtoupper(unsigned int c) { diff --git a/reactos/lib/msvcrt/misc.c b/reactos/lib/msvcrt/misc.c deleted file mode 100755 index bfd15ceb34b..00000000000 --- a/reactos/lib/msvcrt/misc.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "misc/amsg.c" -#include "misc/assert.c" -#include "misc/dllmain.c" -#include "misc/getargs.c" -#include "misc/initterm.c" -#include "misc/purecall.c" -#include "misc/tls.c" - diff --git a/reactos/lib/msvcrt/misc/amsg.c b/reactos/lib/msvcrt/misc/amsg.c index a5d2a5c104d..dafdcd17689 100644 --- a/reactos/lib/msvcrt/misc/amsg.c +++ b/reactos/lib/msvcrt/misc/amsg.c @@ -7,7 +7,8 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include + +#include static char *__rt_err_msg[] = diff --git a/reactos/lib/msvcrt/misc/assert.c b/reactos/lib/msvcrt/misc/assert.c index 8e92758565e..59b3bbdafa6 100644 --- a/reactos/lib/msvcrt/misc/assert.c +++ b/reactos/lib/msvcrt/misc/assert.c @@ -1,6 +1,8 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include void _assert(const char *msg, const char *file, int line) { diff --git a/reactos/lib/msvcrt/misc/dllmain.c b/reactos/lib/msvcrt/misc/dllmain.c index d422a8634e7..e24bb45a5f8 100644 --- a/reactos/lib/msvcrt/misc/dllmain.c +++ b/reactos/lib/msvcrt/misc/dllmain.c @@ -1,21 +1,17 @@ -/* $Id: dllmain.c,v 1.15 2002/09/07 15:12:34 chorns Exp $ +/* $Id: dllmain.c,v 1.16 2002/09/08 10:22:53 chorns Exp $ * * ReactOS MSVCRT.DLL Compatibility Library */ -#include +#include + +#include +#include #define NDEBUG -#include - +#include static int nAttachCount = 0; -#undef _osver -#undef _winminor -#undef _winmajor -#undef _winver -#undef _pgmptr - unsigned int _osver = 0; unsigned int _winminor = 0; unsigned int _winmajor = 0; diff --git a/reactos/lib/msvcrt/misc/getargs.c b/reactos/lib/msvcrt/misc/getargs.c index 8b224750c92..b9452e70ced 100644 --- a/reactos/lib/msvcrt/misc/getargs.c +++ b/reactos/lib/msvcrt/misc/getargs.c @@ -1,5 +1,6 @@ -#include - +#include +#include +#include extern char *_acmdln; extern char *_pgmptr; @@ -72,7 +73,7 @@ int expand(char* name) if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { strcpy(&buffer[pos], fd.cFileName); - if (add(_strdup(buffer)) < 0) + if (add(strdup(buffer)) < 0) { FindClose(hFile); return -1; @@ -130,7 +131,7 @@ int __getmainargs(int *argc,char ***argv,char ***env,int flag) *argv = __argv; *env = _environ; - _pgmptr = _strdup((char *)argv[0]); + _pgmptr = strdup((char *)argv[0]); return 0; } diff --git a/reactos/lib/msvcrt/misc/initterm.c b/reactos/lib/msvcrt/misc/initterm.c index 92cd7021dca..69f9e65d1fb 100644 --- a/reactos/lib/msvcrt/misc/initterm.c +++ b/reactos/lib/msvcrt/misc/initterm.c @@ -1,4 +1,4 @@ -#include +#include void @@ -18,6 +18,9 @@ _initterm(void (* fStart[])(void), } } + +typedef int (* _onexit_t)(void); + _onexit_t __dllonexit(_onexit_t func, void (** fStart[])(void), diff --git a/reactos/lib/msvcrt/misc/purecall.c b/reactos/lib/msvcrt/misc/purecall.c index 9f4f9203db0..fea7d5ef2b5 100644 --- a/reactos/lib/msvcrt/misc/purecall.c +++ b/reactos/lib/msvcrt/misc/purecall.c @@ -1,5 +1,5 @@ -#include +#include void _purecall(void) { diff --git a/reactos/lib/msvcrt/misc/tls.c b/reactos/lib/msvcrt/misc/tls.c index 9c1585879e7..1e8a81b49ec 100644 --- a/reactos/lib/msvcrt/misc/tls.c +++ b/reactos/lib/msvcrt/misc/tls.c @@ -1,4 +1,8 @@ -#include +/* tls.c */ + +#include +#include +#include static unsigned long TlsIndex = (unsigned long)-1; diff --git a/reactos/lib/msvcrt/msvcrt.rc b/reactos/lib/msvcrt/msvcrt.rc index fd883558787..efb5c3134bd 100644 --- a/reactos/lib/msvcrt/msvcrt.rc +++ b/reactos/lib/msvcrt/msvcrt.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/msvcrt/process.c b/reactos/lib/msvcrt/process.c deleted file mode 100755 index 3cb8f7e64e2..00000000000 --- a/reactos/lib/msvcrt/process.c +++ /dev/null @@ -1,22 +0,0 @@ -#include "process/_cwait.c" -#include "process/_system.c" -#include "process/dll.c" -#include "process/execl.c" -#include "process/execle.c" -#include "process/execlp.c" -#include "process/execlpe.c" -#include "process/execv.c" -#include "process/execve.c" -#include "process/execvp.c" -#include "process/execvpe.c" -#include "process/procid.c" -#include "process/spawnl.c" -#include "process/spawnle.c" -#include "process/spawnlp.c" -#include "process/spawnlpe.c" -#include "process/spawnv.c" -#include "process/spawnve.c" -#include "process/spawnvp.c" -#include "process/spawnvpe.c" -#include "process/thread.c" -#include "process/threadid.c" diff --git a/reactos/lib/msvcrt/process/_cwait.c b/reactos/lib/msvcrt/process/_cwait.c index 04c301c0d98..d4df111c817 100644 --- a/reactos/lib/msvcrt/process/_cwait.c +++ b/reactos/lib/msvcrt/process/_cwait.c @@ -7,8 +7,10 @@ * UPDATE HISTORY: * 04/03/99: Created */ -#include - +#include +#include +#include +#include int _cwait(int* pnStatus, int hProc, int nAction) { diff --git a/reactos/lib/msvcrt/process/_system.c b/reactos/lib/msvcrt/process/_system.c index e2803497f79..149a880d1d4 100644 --- a/reactos/lib/msvcrt/process/_system.c +++ b/reactos/lib/msvcrt/process/_system.c @@ -1,4 +1,4 @@ -/* $Id: _system.c,v 1.3 2002/09/07 15:12:34 chorns Exp $ +/* $Id: _system.c,v 1.4 2002/09/08 10:22:53 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -8,8 +8,11 @@ * UPDATE HISTORY: * 04/03/99: Created */ -#include - +#include +#include +#include +#include +#include int system(const char *command) { @@ -43,7 +46,7 @@ int system(const char *command) if (szComSpec == NULL) { - szComSpec = _strdup("cmd.exe"); + szComSpec = strdup("cmd.exe"); if (szComSpec == NULL) { __set_errno(ENOMEM); diff --git a/reactos/lib/msvcrt/process/dll.c b/reactos/lib/msvcrt/process/dll.c index 52a49ecdde7..ccb3c2ab1c2 100644 --- a/reactos/lib/msvcrt/process/dll.c +++ b/reactos/lib/msvcrt/process/dll.c @@ -7,8 +7,9 @@ * UPDATE HISTORY: * 04/03/99: Created */ -#include +#include +#include void *_loaddll (char *name) { diff --git a/reactos/lib/msvcrt/process/execl.c b/reactos/lib/msvcrt/process/execl.c index 837857061a9..3cb52661e4e 100644 --- a/reactos/lib/msvcrt/process/execl.c +++ b/reactos/lib/msvcrt/process/execl.c @@ -1,6 +1,8 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include int _execl(const char* szPath, const char* szArgv0, ...) { diff --git a/reactos/lib/msvcrt/process/execle.c b/reactos/lib/msvcrt/process/execle.c index 857c22477e6..5ccacf6d4b7 100644 --- a/reactos/lib/msvcrt/process/execle.c +++ b/reactos/lib/msvcrt/process/execle.c @@ -1,4 +1,6 @@ -#include +#include +#include +#include // fixme rewrite to pass the array variants to va_list variant diff --git a/reactos/lib/msvcrt/process/execlp.c b/reactos/lib/msvcrt/process/execlp.c index 57189aca7b7..00384c63b12 100644 --- a/reactos/lib/msvcrt/process/execlp.c +++ b/reactos/lib/msvcrt/process/execlp.c @@ -1,5 +1,6 @@ -#include - +#include +#include +#include int _execlp(const char *szPath, const char *szArgv0, ...) { diff --git a/reactos/lib/msvcrt/process/execlpe.c b/reactos/lib/msvcrt/process/execlpe.c index f1b5ad3dbf5..e6e6f2179ea 100644 --- a/reactos/lib/msvcrt/process/execlpe.c +++ b/reactos/lib/msvcrt/process/execlpe.c @@ -1,7 +1,9 @@ -#include +#include +#include +#include -int _execlpe(const char *path, const char *szArgv0, ... /*, const char **envp */) +int execlpe(const char *path, const char *szArgv0, ... /*, const char **envp */) { char *szArg[100]; const char *a; @@ -23,5 +25,5 @@ int _execlpe(const char *path, const char *szArgv0, ... /*, const char **envp */ } else ptr = NULL; - return _spawnvpe(P_OVERLAY, path, (char * const *)szArg, (char * const *)ptr); + return spawnvpe(P_OVERLAY, path, (char * const *)szArg, (char * const *)ptr); } diff --git a/reactos/lib/msvcrt/process/execv.c b/reactos/lib/msvcrt/process/execv.c index e303d4e92eb..01cc594f941 100644 --- a/reactos/lib/msvcrt/process/execv.c +++ b/reactos/lib/msvcrt/process/execv.c @@ -1,6 +1,7 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include int _execv(const char* szPath, char* const* szaArgv) { diff --git a/reactos/lib/msvcrt/process/execve.c b/reactos/lib/msvcrt/process/execve.c index 0c58600d070..77136fd31e6 100644 --- a/reactos/lib/msvcrt/process/execve.c +++ b/reactos/lib/msvcrt/process/execve.c @@ -1,8 +1,7 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include int _execve(const char* szPath, char* const* szaArgv, char* const* szaEnv) { - return _spawnve(P_OVERLAY, szPath, szaArgv, szaEnv); + return spawnve(P_OVERLAY, szPath, szaArgv, szaEnv); } diff --git a/reactos/lib/msvcrt/process/execvp.c b/reactos/lib/msvcrt/process/execvp.c index a59a54b1771..465a587fdf9 100644 --- a/reactos/lib/msvcrt/process/execvp.c +++ b/reactos/lib/msvcrt/process/execvp.c @@ -1,6 +1,7 @@ -/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details *///#include +#include +#include int _execvp(const char* szPath, char* const* szaArgv) { diff --git a/reactos/lib/msvcrt/process/execvpe.c b/reactos/lib/msvcrt/process/execvpe.c index 665d9249645..c894f5faa0c 100644 --- a/reactos/lib/msvcrt/process/execvpe.c +++ b/reactos/lib/msvcrt/process/execvpe.c @@ -1,7 +1,8 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include + int _execvpe(const char* szPath, char* const* szaArgv, char* const* szaEnv) { return _spawnvpe(P_OVERLAY, szPath, szaArgv, szaEnv); diff --git a/reactos/lib/msvcrt/process/procid.c b/reactos/lib/msvcrt/process/procid.c index 9d4bd7d3f6d..a8616fbbdae 100644 --- a/reactos/lib/msvcrt/process/procid.c +++ b/reactos/lib/msvcrt/process/procid.c @@ -1,5 +1,5 @@ -#include - +#include +#include int _getpid (void) { diff --git a/reactos/lib/msvcrt/process/spawnl.c b/reactos/lib/msvcrt/process/spawnl.c index a6174ebc6b4..b007ca2e5ab 100644 --- a/reactos/lib/msvcrt/process/spawnl.c +++ b/reactos/lib/msvcrt/process/spawnl.c @@ -1,6 +1,8 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include int _spawnl(int nMode, const char* szPath, const char* szArgv0,...) { diff --git a/reactos/lib/msvcrt/process/spawnle.c b/reactos/lib/msvcrt/process/spawnle.c index 1d3a732bd32..27c354f6077 100644 --- a/reactos/lib/msvcrt/process/spawnle.c +++ b/reactos/lib/msvcrt/process/spawnle.c @@ -1,4 +1,6 @@ -#include +#include +#include +#include int _spawnle(int mode, const char *path, const char *szArgv0, ... /*, const char **envp */) diff --git a/reactos/lib/msvcrt/process/spawnlp.c b/reactos/lib/msvcrt/process/spawnlp.c index 12e4aad0ea9..139ff7e470f 100644 --- a/reactos/lib/msvcrt/process/spawnlp.c +++ b/reactos/lib/msvcrt/process/spawnlp.c @@ -1,6 +1,8 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include int _spawnlp(int nMode, const char* szPath, const char* szArgv0, ...) { diff --git a/reactos/lib/msvcrt/process/spawnlpe.c b/reactos/lib/msvcrt/process/spawnlpe.c index 9f4cb7245c4..81abee8cc1b 100644 --- a/reactos/lib/msvcrt/process/spawnlpe.c +++ b/reactos/lib/msvcrt/process/spawnlpe.c @@ -1,4 +1,6 @@ -#include +#include +#include +#include int _spawnlpe(int mode, const char *path, const char *szArgv0, ... /*, const char **envp */) diff --git a/reactos/lib/msvcrt/process/spawnv.c b/reactos/lib/msvcrt/process/spawnv.c index e1ee7e9cbab..e4971128d74 100644 --- a/reactos/lib/msvcrt/process/spawnv.c +++ b/reactos/lib/msvcrt/process/spawnv.c @@ -1,6 +1,7 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include int _spawnv(int nMode, const char* szPath, char* const* szaArgv) { diff --git a/reactos/lib/msvcrt/process/spawnve.c b/reactos/lib/msvcrt/process/spawnve.c index e18c0587d1a..f0529a67a73 100644 --- a/reactos/lib/msvcrt/process/spawnve.c +++ b/reactos/lib/msvcrt/process/spawnve.c @@ -1,11 +1,22 @@ -/* $Id: spawnve.c,v 1.4 2002/09/07 15:12:34 chorns Exp $ */ +/* $Id: spawnve.c,v 1.5 2002/09/08 10:22:53 chorns Exp $ */ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include + +#include + +#include +#include +#include +#include +//#include +#include +#include +#include +#include #define NDEBUG -#include +#include #ifndef F_OK @@ -48,7 +59,7 @@ direct_exec_tail(int mode, const char *program, for (last = i = 0; i < maxfno; i++) { - if ((HANDLE)-1 != (HANDLE)_get_osfhandle(i)) + if ((void*)-1 != _get_osfhandle(i)) { last = i + 1; } @@ -69,7 +80,7 @@ direct_exec_tail(int mode, const char *program, for (i = 0; i < last; i++) { int mode = __fileno_getmode(i); - HANDLE h = (HANDLE)_get_osfhandle(i); + HANDLE h = _get_osfhandle(i); /* FIXME: The test of console handles (((ULONG)Handle) & 0x10000003) == 0x3) * is possible wrong */ @@ -113,42 +124,20 @@ direct_exec_tail(int mode, const char *program, return (int)ProcessInformation.hProcess; } -static int vdm_exec(int mode, const char *program, char **argv, char **envp) +static int vdm_exec(int mode, const char *program, char **argv, char *envp) { - char * penvblock, * ptr; - int i, len, result; static char args[1024]; - - i = 0; + int i = 0; args[0] = 0; + strcpy(args,"vdm.exe "); while(argv[i] != NULL ) { strcat(args,argv[i]); strcat(args," "); i++; } - - for (i = 0, len = 0; envp[i]; i++) { - len += strlen(envp[i]) + 1; - } - penvblock = ptr = (char*)malloc(len + 1); - if (penvblock == NULL) - return -1; - - for(i = 0, *ptr = 0; envp[i]; i++) { - strcpy(ptr, envp[i]); - ptr += strlen(envp[i]) + 1; - } - *ptr = 0; - - for(i = 0, len = 0; argv[i]; i++) { - len += strlen(argv[i]) + 1; - } - - result = direct_exec_tail(mode, program,args,(const char*)penvblock); - free(penvblock); - - return result; + + return direct_exec_tail(mode,program,args,envp); } static int go32_exec(int mode, const char *program, char **argv, char **envp) @@ -196,42 +185,24 @@ static int go32_exec(int mode, const char *program, char **argv, char **envp) } int -command_exec(int mode, const char *program, char **argv, char **envp) +command_exec(int mode, const char *program, char **argv, char *envp) { - char * penvblock, * ptr; - int i, len, result; - static char args[1024]; + static char args[1024]; + int i = 0; + + - i = 0; args[0] = 0; + strcpy(args,"cmd.exe /c "); while(argv[i] != NULL ) { strcat(args,argv[i]); strcat(args," "); i++; } + + return direct_exec_tail(mode,program,args,envp); - for (i = 0, len = 0; envp[i]; i++) { - len += strlen(envp[i]) + 1; - } - penvblock = ptr = (char*)malloc(len + 1); - if (penvblock == NULL) - return -1; - - for(i = 0, *ptr = 0; envp[i]; i++) { - strcpy(ptr, envp[i]); - ptr += strlen(envp[i]) + 1; - } - *ptr = 0; - - for(i = 0, len = 0; argv[i]; i++) { - len += strlen(argv[i]) + 1; - } - - result = direct_exec_tail(mode, program,args,(const char*)penvblock); - free(penvblock); - - return result; } static int script_exec(int mode, const char *program, char **argv, char **envp) diff --git a/reactos/lib/msvcrt/process/spawnvp.c b/reactos/lib/msvcrt/process/spawnvp.c index a46ace9ca1e..8a6862b85ba 100644 --- a/reactos/lib/msvcrt/process/spawnvp.c +++ b/reactos/lib/msvcrt/process/spawnvp.c @@ -1,8 +1,9 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include int _spawnvp(int nMode, const char* szPath, char* const* szaArgv) { - return _spawnvpe(nMode, szPath, (char * const *)szaArgv, _environ); + return spawnvpe(nMode, szPath, (char * const *)szaArgv, _environ); } diff --git a/reactos/lib/msvcrt/process/spawnvpe.c b/reactos/lib/msvcrt/process/spawnvpe.c index 1d9d3b9dedf..2ed34cebdb0 100644 --- a/reactos/lib/msvcrt/process/spawnvpe.c +++ b/reactos/lib/msvcrt/process/spawnvpe.c @@ -1,5 +1,7 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include + +#include +#include #if 0 int _spawnvpe(int nMode, const char* szPath, char* const* szaArgv, char* const* szaEnv) diff --git a/reactos/lib/msvcrt/process/thread.c b/reactos/lib/msvcrt/process/thread.c index 3452f12b42e..d904bfc8c19 100644 --- a/reactos/lib/msvcrt/process/thread.c +++ b/reactos/lib/msvcrt/process/thread.c @@ -1,8 +1,9 @@ -/* $Id: thread.c,v 1.3 2002/09/07 15:12:34 chorns Exp $ +/* $Id: thread.c,v 1.4 2002/09/08 10:22:54 chorns Exp $ * */ -#include - +#include +#include +#include unsigned long _beginthread ( diff --git a/reactos/lib/msvcrt/process/threadid.c b/reactos/lib/msvcrt/process/threadid.c index e49f16a7e62..bd97858893c 100644 --- a/reactos/lib/msvcrt/process/threadid.c +++ b/reactos/lib/msvcrt/process/threadid.c @@ -1,5 +1,5 @@ -#include - +#include +#include unsigned long __threadid (void) { diff --git a/reactos/lib/msvcrt/search/lfind.c b/reactos/lib/msvcrt/search/lfind.c index 5c6881b201b..210a14942f6 100644 --- a/reactos/lib/msvcrt/search/lfind.c +++ b/reactos/lib/msvcrt/search/lfind.c @@ -1,4 +1,5 @@ -#include +#include +#include void *_lfind(const void *key, const void *base, size_t *nelp, diff --git a/reactos/lib/msvcrt/search/lsearch.c b/reactos/lib/msvcrt/search/lsearch.c index 09dc328c904..a1ada3f029d 100644 --- a/reactos/lib/msvcrt/search/lsearch.c +++ b/reactos/lib/msvcrt/search/lsearch.c @@ -1,5 +1,6 @@ -#include - +#include +#include +#include void *_lsearch(const void *key, void *base, size_t *nelp, size_t width, int (*compar)(const void *, const void *)) diff --git a/reactos/lib/msvcrt/setjmp/setjmp.c b/reactos/lib/msvcrt/setjmp/setjmp.c index bcc9fe928bf..65a705067a3 100644 --- a/reactos/lib/msvcrt/setjmp/setjmp.c +++ b/reactos/lib/msvcrt/setjmp/setjmp.c @@ -3,9 +3,6 @@ /* ms uses a smaller jmp_buf structure */ /* might do a realloc in setjmp */ -#include - - typedef struct { unsigned int __eax, __ebx, __ecx, __edx, __esi; unsigned int __edi, __ebp, __esp, __eip, __eflags; diff --git a/reactos/lib/msvcrt/signal/signal.c b/reactos/lib/msvcrt/signal/signal.c index f8a9e849c6a..69d90a65369 100644 --- a/reactos/lib/msvcrt/signal/signal.c +++ b/reactos/lib/msvcrt/signal/signal.c @@ -1,5 +1,8 @@ -#include - +#include +#include +#include +#include +#include void _default_handler(int signal); @@ -7,7 +10,7 @@ typedef struct _sig_element { int signal; char *signame; - __p_sig_fn_t handler; + _p_sig_fn_t handler; } sig_element; static sig_element signal_list[SIGMAX] = @@ -35,9 +38,9 @@ static sig_element signal_list[SIGMAX] = int nsignal = 21; -__p_sig_fn_t signal(int sig, __p_sig_fn_t func) +_p_sig_fn_t signal(int sig, _p_sig_fn_t func) { - __p_sig_fn_t temp; + _p_sig_fn_t temp; int i; if(sig <= 0 || sig > SIGMAX || sig == SIGKILL) { @@ -46,7 +49,7 @@ __p_sig_fn_t signal(int sig, __p_sig_fn_t func) } // check with IsBadCodePtr - if ( func < (__p_sig_fn_t)4096 ) { + if ( func < (_p_sig_fn_t)4096 ) { __set_errno(EINVAL); return SIG_ERR; } @@ -72,7 +75,7 @@ __p_sig_fn_t signal(int sig, __p_sig_fn_t func) int raise(int sig) { - __p_sig_fn_t temp = SIG_DFL; + _p_sig_fn_t temp = SIG_DFL; int i; if(sig <= 0) return -1; @@ -83,10 +86,10 @@ raise(int sig) temp = signal_list[i].handler; } } - if(temp == (__p_sig_fn_t)SIG_IGN - || (sig == SIGQUIT && temp == (__p_sig_fn_t)SIG_DFL)) + if(temp == (_p_sig_fn_t)SIG_IGN + || (sig == SIGQUIT && temp == (_p_sig_fn_t)SIG_DFL)) return 0; /* Ignore it */ - if(temp == (__p_sig_fn_t)SIG_DFL) + if(temp == (_p_sig_fn_t)SIG_DFL) _default_handler(sig); /* this does not return */ else temp(sig); diff --git a/reactos/lib/msvcrt/stdio.c b/reactos/lib/msvcrt/stdio.c deleted file mode 100755 index a79cc39f542..00000000000 --- a/reactos/lib/msvcrt/stdio.c +++ /dev/null @@ -1,57 +0,0 @@ -#include "stdio/allocfil.c" -#include "stdio/clearerr.c" -#include "stdio/fclose.c" -#include "stdio/fdopen.c" -#include "stdio/feof.c" -#include "stdio/ferror.c" -#include "stdio/fflush.c" -#include "stdio/fgetc.c" -#include "stdio/fgetchar.c" -#include "stdio/fgetpos.c" -#include "stdio/fgets.c" -#include "stdio/filbuf.c" -#include "stdio/fileno.c" -#include "stdio/flsbuf.c" -#include "stdio/fopen.c" -#include "stdio/fprintf.c" -#include "stdio/fputc.c" -#include "stdio/fputchar.c" -#include "stdio/fputs.c" -#include "stdio/fread.c" -#include "stdio/freopen.c" -#include "stdio/fscanf.c" -#include "stdio/fseek.c" -#include "stdio/fsetpos.c" -#include "stdio/fsopen.c" -#include "stdio/ftell.c" -#include "stdio/fwalk.c" -#include "stdio/fwrite.c" -#include "stdio/getc.c" -#include "stdio/getchar.c" -#include "stdio/gets.c" -#include "stdio/getw.c" -#include "stdio/perror.c" -#include "stdio/popen.c" -#include "stdio/printf.c" -#include "stdio/putc.c" -#include "stdio/putchar.c" -#include "stdio/puts.c" -#include "stdio/putw.c" -#include "stdio/remove.c" -#include "stdio/rename.c" -#include "stdio/rewind.c" -#include "stdio/rmtmp.c" -#include "stdio/scanf.c" -#include "stdio/setbuf.c" -#include "stdio/setvbuf.c" -#include "stdio/sprintf.c" -#include "stdio/sscanf.c" -#include "stdio/stdhnd.c" -#include "stdio/tempnam.c" -#include "stdio/tmpfile.c" -#include "stdio/tmpnam.c" -#include "stdio/ungetc.c" -#include "stdio/vfscanf.c" -#include "stdio/vscanf.c" -#include "stdio/vsprintf.c" -#include "stdio/vsscanf.c" diff --git a/reactos/lib/msvcrt/stdio/allocfil.c b/reactos/lib/msvcrt/stdio/allocfil.c index 9fae55b01bc..631d29839e7 100644 --- a/reactos/lib/msvcrt/stdio/allocfil.c +++ b/reactos/lib/msvcrt/stdio/allocfil.c @@ -1,5 +1,8 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include +#include FILE * __alloc_file(void); diff --git a/reactos/lib/msvcrt/stdio/clearerr.c b/reactos/lib/msvcrt/stdio/clearerr.c index 0fb533a5e48..5055fa7f670 100644 --- a/reactos/lib/msvcrt/stdio/clearerr.c +++ b/reactos/lib/msvcrt/stdio/clearerr.c @@ -1,6 +1,7 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include #ifdef clearerr #undef clearerr diff --git a/reactos/lib/msvcrt/stdio/fclose.c b/reactos/lib/msvcrt/stdio/fclose.c index 57fe2ea26cb..74b3b0c2afb 100644 --- a/reactos/lib/msvcrt/stdio/fclose.c +++ b/reactos/lib/msvcrt/stdio/fclose.c @@ -1,6 +1,12 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include +#include +#include +#include +#include // changed check for writable stream @@ -22,17 +28,17 @@ fclose(FILE *f) if ( OPEN4WRITING(f) ) r = fflush(f); - if (_close(_fileno(f)) < 0) + if (_close(fileno(f)) < 0) r = EOF; if (f->_flag&_IOMYBUF) free(f->_base); // Kernel might do this later - if (f->_flag & _IORMONCL && f->_tmpfname) + if (f->_flag & _IORMONCL && f->_name_to_remove) { - remove(f->_tmpfname); - free(f->_tmpfname); - f->_tmpfname = 0; + remove(f->_name_to_remove); + free(f->_name_to_remove); + f->_name_to_remove = 0; } } f->_cnt = 0; diff --git a/reactos/lib/msvcrt/stdio/fdopen.c b/reactos/lib/msvcrt/stdio/fdopen.c index d7cd7fd63d8..a9f70ccc888 100644 --- a/reactos/lib/msvcrt/stdio/fdopen.c +++ b/reactos/lib/msvcrt/stdio/fdopen.c @@ -1,9 +1,9 @@ -#include - +#include +#include FILE * __alloc_file(void); -FILE *_fdopen(int handle, const char *mode) +FILE *_fdopen(int handle, char *mode) { FILE *file; int rw; diff --git a/reactos/lib/msvcrt/stdio/feof.c b/reactos/lib/msvcrt/stdio/feof.c index 495fd47ab32..a2487d8bd17 100644 --- a/reactos/lib/msvcrt/stdio/feof.c +++ b/reactos/lib/msvcrt/stdio/feof.c @@ -1,6 +1,7 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include #ifdef feof #undef feof diff --git a/reactos/lib/msvcrt/stdio/ferror.c b/reactos/lib/msvcrt/stdio/ferror.c index 6c4db2d6629..05110cd6272 100644 --- a/reactos/lib/msvcrt/stdio/ferror.c +++ b/reactos/lib/msvcrt/stdio/ferror.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include #ifdef ferror #undef ferror diff --git a/reactos/lib/msvcrt/stdio/fflush.c b/reactos/lib/msvcrt/stdio/fflush.c index dda0faf4fe9..7848bb3086d 100644 --- a/reactos/lib/msvcrt/stdio/fflush.c +++ b/reactos/lib/msvcrt/stdio/fflush.c @@ -10,7 +10,14 @@ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include + +#include +#include +#include +#include +#include +#include +#include int fflush(FILE *f) @@ -65,7 +72,7 @@ int fflush(FILE *f) if ((f->_flag & _IOFBF) == _IOFBF) { if ( (f->_flag & _IOAHEAD) == _IOAHEAD ) - _lseek(_fileno(f),-rn, SEEK_CUR); + _lseek(fileno(f),-rn, SEEK_CUR); } f->_flag &= ~_IOAHEAD; @@ -79,7 +86,7 @@ int fflush(FILE *f) // better open the file in write through mode while (rn > 0) { - n = _write(_fileno(f), base, rn); + n = _write(fileno(f), base, rn); if (n <= 0) { f->_flag |= _IOERR; return EOF; diff --git a/reactos/lib/msvcrt/stdio/fgetc.c b/reactos/lib/msvcrt/stdio/fgetc.c index f19bb02753a..7ce598cfab6 100644 --- a/reactos/lib/msvcrt/stdio/fgetc.c +++ b/reactos/lib/msvcrt/stdio/fgetc.c @@ -9,8 +9,8 @@ 25/02/99: Added fgetwc */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include int fgetc(FILE *f) { diff --git a/reactos/lib/msvcrt/stdio/fgetchar.c b/reactos/lib/msvcrt/stdio/fgetchar.c index 18f66c282d9..a80ce3a3115 100644 --- a/reactos/lib/msvcrt/stdio/fgetchar.c +++ b/reactos/lib/msvcrt/stdio/fgetchar.c @@ -1,12 +1,12 @@ -#include - +#include +#include int _fgetchar(void) { return _getch(); } -wint_t _fgetwchar(void) +int _fgetwchar(void) { return _getch(); } diff --git a/reactos/lib/msvcrt/stdio/fgetpos.c b/reactos/lib/msvcrt/stdio/fgetpos.c index 3dd40b62abf..82c4bf5f2e0 100644 --- a/reactos/lib/msvcrt/stdio/fgetpos.c +++ b/reactos/lib/msvcrt/stdio/fgetpos.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include int fgetpos(FILE *stream, fpos_t *pos) { diff --git a/reactos/lib/msvcrt/stdio/fgets.c b/reactos/lib/msvcrt/stdio/fgets.c index ab836df174c..3230fc5d71a 100644 --- a/reactos/lib/msvcrt/stdio/fgets.c +++ b/reactos/lib/msvcrt/stdio/fgets.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include char * fgets(char *s, int n, FILE *f) diff --git a/reactos/lib/msvcrt/stdio/filbuf.c b/reactos/lib/msvcrt/stdio/filbuf.c index 85995032023..5033a60a26c 100644 --- a/reactos/lib/msvcrt/stdio/filbuf.c +++ b/reactos/lib/msvcrt/stdio/filbuf.c @@ -1,8 +1,15 @@ /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include +#include +#include +#include +#include +#include int _readcnv(int fn, void *buf, size_t siz ); @@ -57,7 +64,7 @@ _filbuf(FILE *f) - f->_cnt = _read(_fileno(f), f->_base, f->_flag & _IONBF ? 1 : f->_bufsiz ); + f->_cnt = _read(fileno(f), f->_base, f->_flag & _IONBF ? 1 : f->_bufsiz ); f->_flag |= _IOAHEAD; if(__is_text_file(f) && f->_cnt>0) @@ -67,7 +74,7 @@ _filbuf(FILE *f) if(cz) { int newcnt = cz - f->_base; - _lseek(_fileno(f), -(f->_cnt - newcnt), SEEK_CUR); + lseek(fileno(f), -(f->_cnt - newcnt), SEEK_CUR); f->_cnt = newcnt; } } diff --git a/reactos/lib/msvcrt/stdio/fileno.c b/reactos/lib/msvcrt/stdio/fileno.c index 49a9a2c4d16..50019c0557b 100644 --- a/reactos/lib/msvcrt/stdio/fileno.c +++ b/reactos/lib/msvcrt/stdio/fileno.c @@ -1,5 +1,4 @@ -#include - +#include #if 0 #undef fileno diff --git a/reactos/lib/msvcrt/stdio/flsbuf.c b/reactos/lib/msvcrt/stdio/flsbuf.c index 691f481510c..4af1ee9e86b 100644 --- a/reactos/lib/msvcrt/stdio/flsbuf.c +++ b/reactos/lib/msvcrt/stdio/flsbuf.c @@ -1,7 +1,13 @@ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include +#include +#include +#include +#include int cntcr(char *bufp, int bufsiz); int convert(char *endp, int bufsiz,int n); @@ -25,7 +31,7 @@ _flsbuf(int c, FILE *f) // no file associated with buffer // this is a memory stream - if ( _fileno(f) == -1 ) + if ( fileno(f) == -1 ) return c; /* if the buffer is not yet allocated, allocate it */ @@ -43,7 +49,7 @@ _flsbuf(int c, FILE *f) f->_cnt = f->_bufsiz = size; f->_ptr = base; rn = 0; - if (f == stdout && _isatty (_fileno (stdout))) + if (f == stdout && isatty (fileno (stdout))) f->_flag |= _IOLBF; } } @@ -80,7 +86,7 @@ _flsbuf(int c, FILE *f) rn = f->_ptr - base; f->_ptr = base; if ( (f->_flag & _IOAHEAD) == _IOAHEAD ) - _lseek(_fileno(f),-(rn+f->_cnt), SEEK_CUR); + _lseek(fileno(f),-(rn+f->_cnt), SEEK_CUR); f->_cnt = f->_bufsiz; f->_flag &= ~_IOAHEAD; } @@ -90,7 +96,7 @@ _flsbuf(int c, FILE *f) f->_flag &= ~_IODIRTY; while (rn > 0) { - n = _write(_fileno(f), base, rn); + n = _write(fileno(f), base, rn); if (n <= 0) { f->_flag |= _IOERR; diff --git a/reactos/lib/msvcrt/stdio/fopen.c b/reactos/lib/msvcrt/stdio/fopen.c index 976e2b44356..def102f2a7a 100644 --- a/reactos/lib/msvcrt/stdio/fopen.c +++ b/reactos/lib/msvcrt/stdio/fopen.c @@ -1,6 +1,10 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include +#include +//#include //might change fopen(file,mode) -> fsopen(file,mode,_SH_DENYNO); @@ -59,7 +63,7 @@ FILE* fopen(const char *file, const char *mode) // ms crtdll ensures that writes will end up at the end of file in append mode // we just move the file pointer to the end of file initially if (*mode == 'a') - _lseek(fd, 0, SEEK_END); + lseek(fd, 0, SEEK_END); f->_cnt = 0; f->_file = fd; @@ -124,7 +128,7 @@ FILE* _wfopen(const wchar_t *file, const wchar_t *mode) // ms crtdll ensures that writes will end up at the end of file in append mode // we just move the file pointer to the end of file initially if (*mode == L'a') - _lseek(fd, 0, SEEK_END); + lseek(fd, 0, SEEK_END); f->_cnt = 0; f->_file = fd; diff --git a/reactos/lib/msvcrt/stdio/fprintf.c b/reactos/lib/msvcrt/stdio/fprintf.c index 6ea096621d4..6c503dea6cb 100644 --- a/reactos/lib/msvcrt/stdio/fprintf.c +++ b/reactos/lib/msvcrt/stdio/fprintf.c @@ -1,6 +1,7 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include int fprintf(register FILE *iop, const char *fmt, ...) diff --git a/reactos/lib/msvcrt/stdio/fputc.c b/reactos/lib/msvcrt/stdio/fputc.c index f849c390b9f..a5c676176a0 100644 --- a/reactos/lib/msvcrt/stdio/fputc.c +++ b/reactos/lib/msvcrt/stdio/fputc.c @@ -1,6 +1,7 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include int fputc(int c, FILE *fp) diff --git a/reactos/lib/msvcrt/stdio/fputchar.c b/reactos/lib/msvcrt/stdio/fputchar.c index 8438c61bb2c..46d4eb5e2e2 100644 --- a/reactos/lib/msvcrt/stdio/fputchar.c +++ b/reactos/lib/msvcrt/stdio/fputchar.c @@ -1,4 +1,5 @@ -#include +#include +#include int _fputchar(int c) @@ -6,7 +7,7 @@ int _fputchar(int c) return _putch(c); } -wint_t _fputwchar(wint_t c) +int _fputwchar(wchar_t c) { //return _putch(c); return 0; diff --git a/reactos/lib/msvcrt/stdio/fputs.c b/reactos/lib/msvcrt/stdio/fputs.c index 6de261e7e65..d39672b8d43 100644 --- a/reactos/lib/msvcrt/stdio/fputs.c +++ b/reactos/lib/msvcrt/stdio/fputs.c @@ -1,6 +1,8 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include int fputs(const char *s, FILE *f) diff --git a/reactos/lib/msvcrt/stdio/fread.c b/reactos/lib/msvcrt/stdio/fread.c index 57541f44012..d5f3369bb00 100644 --- a/reactos/lib/msvcrt/stdio/fread.c +++ b/reactos/lib/msvcrt/stdio/fread.c @@ -1,4 +1,8 @@ -#include +#include +#include +#include +#include +#include size_t fread(void *vptr, size_t size, size_t count, FILE *iop) @@ -53,7 +57,7 @@ size_t fread(void *vptr, size_t size, size_t count, FILE *iop) if (to_read >= iop->_bufsiz) { - n_read = _read(_fileno(iop), ptr, to_read); + n_read = _read(fileno(iop), ptr, to_read); if (n_read < 0) iop->_flag |= _IOERR; else if (n_read == 0) diff --git a/reactos/lib/msvcrt/stdio/freopen.c b/reactos/lib/msvcrt/stdio/freopen.c index c4c456bd84d..f6f14fd2b5c 100644 --- a/reactos/lib/msvcrt/stdio/freopen.c +++ b/reactos/lib/msvcrt/stdio/freopen.c @@ -1,5 +1,10 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include + +#include +#include +#include +#include +#include FILE *freopen(const char *file, const char *mode, FILE *f) @@ -43,7 +48,7 @@ FILE *freopen(const char *file, const char *mode, FILE *f) return NULL; if (*mode == 'a') - _lseek(fd, 0, SEEK_END); + lseek(fd, 0, SEEK_END); f->_cnt = 0; f->_file = fd; @@ -100,7 +105,7 @@ FILE *_wfreopen(const wchar_t *file, const wchar_t *mode, FILE *f) return NULL; if (*mode == L'a') - _lseek(fd, 0, SEEK_END); + lseek(fd, 0, SEEK_END); f->_cnt = 0; f->_file = fd; diff --git a/reactos/lib/msvcrt/stdio/fscanf.c b/reactos/lib/msvcrt/stdio/fscanf.c index d458cc4aa06..0187334b893 100644 --- a/reactos/lib/msvcrt/stdio/fscanf.c +++ b/reactos/lib/msvcrt/stdio/fscanf.c @@ -14,9 +14,14 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. - */ -#include +Cambridge, MA 02139, USA. */ + + +#include +#include +#include +#include +#include /* Read formatted input from STREAM according to the format string FORMAT. */ diff --git a/reactos/lib/msvcrt/stdio/fseek.c b/reactos/lib/msvcrt/stdio/fseek.c index 10f12c1e820..0c7707e67f2 100644 --- a/reactos/lib/msvcrt/stdio/fseek.c +++ b/reactos/lib/msvcrt/stdio/fseek.c @@ -1,7 +1,12 @@ /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include + +#include +#include +#include +#include +#include int fseek(FILE *f, long offset, int ptrname) @@ -34,7 +39,7 @@ int fseek(FILE *f, long offset, int ptrname) } } - p = _lseek(_fileno(f), offset, ptrname); + p = lseek(fileno(f), offset, ptrname); f->_cnt = 0; f->_ptr = f->_base; f->_flag &= ~_IOUNGETC; @@ -42,7 +47,7 @@ int fseek(FILE *f, long offset, int ptrname) else { p = fflush(f); - return _lseek(_fileno(f), offset, ptrname) == -1 || p == EOF ? + return lseek(fileno(f), offset, ptrname) == -1 || p == EOF ? -1 : 0; } return p==-1 ? -1 : 0; diff --git a/reactos/lib/msvcrt/stdio/fsetpos.c b/reactos/lib/msvcrt/stdio/fsetpos.c index f6e797a54a6..eb485576700 100644 --- a/reactos/lib/msvcrt/stdio/fsetpos.c +++ b/reactos/lib/msvcrt/stdio/fsetpos.c @@ -1,6 +1,7 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include int fsetpos(FILE *stream,const fpos_t *pos) { diff --git a/reactos/lib/msvcrt/stdio/fsopen.c b/reactos/lib/msvcrt/stdio/fsopen.c index 0c257106196..0b36507bbc8 100644 --- a/reactos/lib/msvcrt/stdio/fsopen.c +++ b/reactos/lib/msvcrt/stdio/fsopen.c @@ -8,7 +8,13 @@ * 28/12/98: Created */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include + +#include +#include +#include +#include +#include +#include FILE * __alloc_file(void); @@ -76,7 +82,7 @@ FILE* _fsopen(const char *file, const char *mode, int shflag) // ms crtdll ensures that writes will end up at the end of file in append mode // we just move the file pointer to the end of file initially if (*mode == 'a') - _lseek(fd, 0, SEEK_END); + lseek(fd, 0, SEEK_END); f->_cnt = 0; f->_file = fd; @@ -154,7 +160,7 @@ FILE* _wfsopen(const wchar_t *file, const wchar_t *mode, int shflag) // ms crtdll ensures that writes will end up at the end of file in append mode // we just move the file pointer to the end of file initially if (*mode == L'a') - _lseek(fd, 0, SEEK_END); + lseek(fd, 0, SEEK_END); f->_cnt = 0; f->_file = fd; diff --git a/reactos/lib/msvcrt/stdio/ftell.c b/reactos/lib/msvcrt/stdio/ftell.c index 51dde401656..bb486734b73 100644 --- a/reactos/lib/msvcrt/stdio/ftell.c +++ b/reactos/lib/msvcrt/stdio/ftell.c @@ -1,6 +1,12 @@ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include + +#include +//#include +#include +#include +#include +#include long ftell(FILE *f) @@ -28,7 +34,7 @@ long ftell(FILE *f) else return -1; - tres = _lseek(_fileno(f), 0L, SEEK_CUR); + tres = lseek(fileno(f), 0L, SEEK_CUR); if (tres<0) return tres; tres += adjust; diff --git a/reactos/lib/msvcrt/stdio/fwalk.c b/reactos/lib/msvcrt/stdio/fwalk.c index fb61363a735..f7d261b5365 100644 --- a/reactos/lib/msvcrt/stdio/fwalk.c +++ b/reactos/lib/msvcrt/stdio/fwalk.c @@ -1,7 +1,8 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +// not exported by crtdll __file_rec *__file_rec_list; void diff --git a/reactos/lib/msvcrt/stdio/fwrite.c b/reactos/lib/msvcrt/stdio/fwrite.c index eef8f0e755e..c5f573ed0a1 100644 --- a/reactos/lib/msvcrt/stdio/fwrite.c +++ b/reactos/lib/msvcrt/stdio/fwrite.c @@ -1,7 +1,10 @@ -#include - +#include +#include +#include +#include +#include #define NDEBUG -#include +#include size_t fwrite(const void *vptr, size_t size, size_t count, FILE *iop) @@ -72,7 +75,7 @@ size_t fwrite(const void *vptr, size_t size, size_t count, FILE *iop) { while (to_write > 0) { - n_written = _write(_fileno(iop), ptr, to_write); + n_written = _write(fileno(iop), ptr, to_write); if (n_written <= 0) { iop->_flag |= _IOERR; diff --git a/reactos/lib/msvcrt/stdio/getc.c b/reactos/lib/msvcrt/stdio/getc.c index 963aec2ceab..3bdb61c3c7b 100644 --- a/reactos/lib/msvcrt/stdio/getc.c +++ b/reactos/lib/msvcrt/stdio/getc.c @@ -1,5 +1,8 @@ -#include - +#include +#include +#include +#include +#include //getc can be a macro #undef getc diff --git a/reactos/lib/msvcrt/stdio/getchar.c b/reactos/lib/msvcrt/stdio/getchar.c index 72e636f748b..14392d2cb81 100644 --- a/reactos/lib/msvcrt/stdio/getchar.c +++ b/reactos/lib/msvcrt/stdio/getchar.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include #undef getchar int diff --git a/reactos/lib/msvcrt/stdio/gets.c b/reactos/lib/msvcrt/stdio/gets.c index ec8d69754bc..ac974203fdf 100644 --- a/reactos/lib/msvcrt/stdio/gets.c +++ b/reactos/lib/msvcrt/stdio/gets.c @@ -8,8 +8,7 @@ * 28/12/98: Appropriated for Reactos */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include char *gets(char *s) { diff --git a/reactos/lib/msvcrt/stdio/getw.c b/reactos/lib/msvcrt/stdio/getw.c index acd5e3c795d..119d4e19418 100644 --- a/reactos/lib/msvcrt/stdio/getw.c +++ b/reactos/lib/msvcrt/stdio/getw.c @@ -14,10 +14,9 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. -*/ -#include +Cambridge, MA 02139, USA. */ +#include /* Read a word (int) from STREAM. */ int _getw(FILE *stream) diff --git a/reactos/lib/msvcrt/stdio/perror.c b/reactos/lib/msvcrt/stdio/perror.c index 6bcd7d2b902..7606a1eca3b 100644 --- a/reactos/lib/msvcrt/stdio/perror.c +++ b/reactos/lib/msvcrt/stdio/perror.c @@ -1,5 +1,7 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include #ifdef perror diff --git a/reactos/lib/msvcrt/stdio/popen.c b/reactos/lib/msvcrt/stdio/popen.c index a81b4e28bf2..bc51282abb2 100644 --- a/reactos/lib/msvcrt/stdio/popen.c +++ b/reactos/lib/msvcrt/stdio/popen.c @@ -1,8 +1,13 @@ -/* $Id: popen.c,v 1.3 2002/09/07 15:12:35 chorns Exp $ */ -#include - +/* $Id: popen.c,v 1.4 2002/09/08 10:22:56 chorns Exp $ */ +#include +#include +#include +#include +#include +#include +#include #define NDEBUG -#include +#include FILE *_popen (const char *cm, const char *md) /* program name, pipe mode */ @@ -26,7 +31,7 @@ FILE *_popen (const char *cm, const char *md) /* program name, pipe mode */ if (szComSpec == NULL) { - szComSpec = _strdup("cmd.exe"); + szComSpec = strdup("cmd.exe"); if (szComSpec == NULL) return NULL; } @@ -103,7 +108,7 @@ FILE *_popen (const char *cm, const char *md) /* program name, pipe mode */ CloseHandle(hReadPipe); } - pf->_tmpfname = ProcessInformation.hProcess; + pf->_name_to_remove = ProcessInformation.hProcess; return pf; } @@ -112,7 +117,7 @@ FILE *_popen (const char *cm, const char *md) /* program name, pipe mode */ int _pclose (FILE *pp) { fclose(pp); - if (!TerminateProcess(pp->_tmpfname,0)) + if (!TerminateProcess(pp->_name_to_remove,0)) return -1; return 0; } @@ -216,7 +221,7 @@ FILE *_wpopen (const wchar_t *cm, const wchar_t *md) /* program name, pipe mode CloseHandle(hReadPipe); } - pf->_tmpfname = ProcessInformation.hProcess; + pf->_name_to_remove = ProcessInformation.hProcess; return pf; } diff --git a/reactos/lib/msvcrt/stdio/printf.c b/reactos/lib/msvcrt/stdio/printf.c index ea2d0d8b2f6..36cd1ae8466 100644 --- a/reactos/lib/msvcrt/stdio/printf.c +++ b/reactos/lib/msvcrt/stdio/printf.c @@ -14,10 +14,11 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ -#include + Boston, MA 02111-1307, USA. */ +#include +#include +#include /* Write formatted output to stdout from the format string FORMAT. */ /* VARARGS1 */ diff --git a/reactos/lib/msvcrt/stdio/putc.c b/reactos/lib/msvcrt/stdio/putc.c index 8bb8df79fb1..62f31ce76df 100644 --- a/reactos/lib/msvcrt/stdio/putc.c +++ b/reactos/lib/msvcrt/stdio/putc.c @@ -1,6 +1,9 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include +#include // putc can be a macro #undef putc diff --git a/reactos/lib/msvcrt/stdio/putchar.c b/reactos/lib/msvcrt/stdio/putchar.c index 362213bb20f..cc850512c7e 100644 --- a/reactos/lib/msvcrt/stdio/putchar.c +++ b/reactos/lib/msvcrt/stdio/putchar.c @@ -8,8 +8,7 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include - +#include #undef putc #undef putchar diff --git a/reactos/lib/msvcrt/stdio/puts.c b/reactos/lib/msvcrt/stdio/puts.c index 836cf156293..443a36bc030 100644 --- a/reactos/lib/msvcrt/stdio/puts.c +++ b/reactos/lib/msvcrt/stdio/puts.c @@ -1,6 +1,8 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include #undef putchar int diff --git a/reactos/lib/msvcrt/stdio/putw.c b/reactos/lib/msvcrt/stdio/putw.c index e265bd1a284..94951269905 100644 --- a/reactos/lib/msvcrt/stdio/putw.c +++ b/reactos/lib/msvcrt/stdio/putw.c @@ -14,9 +14,10 @@ * You should have received a copy of the GNU Library General Public * License along with the GNU C Library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, Inc., 675 Mass Ave, - * Cambridge, MA 02139, USA. - */ -#include + * Cambridge, MA 02139, USA. */ + + +#include /* Write the word (int) W to STREAM. */ diff --git a/reactos/lib/msvcrt/stdio/remove.c b/reactos/lib/msvcrt/stdio/remove.c index 4fd6f5a111a..5f309af75f5 100644 --- a/reactos/lib/msvcrt/stdio/remove.c +++ b/reactos/lib/msvcrt/stdio/remove.c @@ -1,8 +1,9 @@ -#include +#include +#include +#include #define NDEBUG -#include - +#include int remove(const char *fn) { diff --git a/reactos/lib/msvcrt/stdio/rename.c b/reactos/lib/msvcrt/stdio/rename.c index 68b296bc232..6139cf70266 100644 --- a/reactos/lib/msvcrt/stdio/rename.c +++ b/reactos/lib/msvcrt/stdio/rename.c @@ -1,4 +1,6 @@ -#include +#include +#include +#include int rename(const char *old_, const char *new_) diff --git a/reactos/lib/msvcrt/stdio/rewind.c b/reactos/lib/msvcrt/stdio/rewind.c index cc1be724e4c..013e2fcc38a 100644 --- a/reactos/lib/msvcrt/stdio/rewind.c +++ b/reactos/lib/msvcrt/stdio/rewind.c @@ -1,11 +1,14 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include + +#include +#include +#include void rewind(FILE *f) { fflush(f); - _lseek(_fileno(f), 0L, SEEK_SET); + lseek(fileno(f), 0L, SEEK_SET); f->_cnt = 0; f->_ptr = f->_base; f->_flag &= ~(_IOERR|_IOEOF|_IOAHEAD); diff --git a/reactos/lib/msvcrt/stdio/rmtmp.c b/reactos/lib/msvcrt/stdio/rmtmp.c index 65396b3069e..69894475007 100644 --- a/reactos/lib/msvcrt/stdio/rmtmp.c +++ b/reactos/lib/msvcrt/stdio/rmtmp.c @@ -8,8 +8,10 @@ * Created 19/01/99 * NOTE Not tested. */ -#include +#include +#include +#include #ifndef F_OK #define F_OK 0x01 @@ -49,9 +51,9 @@ loop files and check for name_to_remove /* If one of the existing slots is available, return it */ for (i=0; icount; i++) { - if (fr->files[i]->_tmpfname != NULL) { - if ( _access(fr->files[i]->_tmpfname,W_OK) ) { - strcpy(temp_name,fr->files[i]->_tmpfname); + if (fr->files[i]->_name_to_remove != NULL) { + if ( _access(fr->files[i]->_name_to_remove,W_OK) ) { + strcpy(temp_name,fr->files[i]->_name_to_remove); fclose(fr->files[i]); remove(temp_name); total_closed++; diff --git a/reactos/lib/msvcrt/stdio/scanf.c b/reactos/lib/msvcrt/stdio/scanf.c index afb86a2e6a4..41462b08e11 100644 --- a/reactos/lib/msvcrt/stdio/scanf.c +++ b/reactos/lib/msvcrt/stdio/scanf.c @@ -14,9 +14,13 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. - */ -#include +Cambridge, MA 02139, USA. */ + +#include +#include +#include +#include +#include /* Read formatted input from stdin according to the format string FORMAT. */ diff --git a/reactos/lib/msvcrt/stdio/setbuf.c b/reactos/lib/msvcrt/stdio/setbuf.c index 35a534f52a4..a112ae3dfeb 100644 --- a/reactos/lib/msvcrt/stdio/setbuf.c +++ b/reactos/lib/msvcrt/stdio/setbuf.c @@ -1,6 +1,7 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include void setbuf(FILE *f, char *buf) { diff --git a/reactos/lib/msvcrt/stdio/setvbuf.c b/reactos/lib/msvcrt/stdio/setvbuf.c index 4cfce37afbc..2b1d074915f 100644 --- a/reactos/lib/msvcrt/stdio/setvbuf.c +++ b/reactos/lib/msvcrt/stdio/setvbuf.c @@ -1,7 +1,11 @@ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include +#include +#include int setvbuf(FILE *f, char *buf, int type, size_t len) diff --git a/reactos/lib/msvcrt/stdio/sprintf.c b/reactos/lib/msvcrt/stdio/sprintf.c index d4673cebb03..8a27c85a84d 100644 --- a/reactos/lib/msvcrt/stdio/sprintf.c +++ b/reactos/lib/msvcrt/stdio/sprintf.c @@ -16,10 +16,13 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. - */ -#include +Cambridge, MA 02139, USA. */ +#include +#include +#include +#include +#include #undef sprintf #undef wsprintf diff --git a/reactos/lib/msvcrt/stdio/sscanf.c b/reactos/lib/msvcrt/stdio/sscanf.c index 19ecd0f6ade..2261657b667 100644 --- a/reactos/lib/msvcrt/stdio/sscanf.c +++ b/reactos/lib/msvcrt/stdio/sscanf.c @@ -14,9 +14,13 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ -#include + Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include +#include /* Read formatted input from S, according to the format string FORMAT. */ diff --git a/reactos/lib/msvcrt/stdio/stdhnd.c b/reactos/lib/msvcrt/stdio/stdhnd.c index ad5b4b10dbc..c4fc04df908 100644 --- a/reactos/lib/msvcrt/stdio/stdhnd.c +++ b/reactos/lib/msvcrt/stdio/stdhnd.c @@ -1,6 +1,6 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include FILE _iob[5] = { diff --git a/reactos/lib/msvcrt/stdio/tempnam.c b/reactos/lib/msvcrt/stdio/tempnam.c index 6f35f6762a8..81215ebd9f7 100644 --- a/reactos/lib/msvcrt/stdio/tempnam.c +++ b/reactos/lib/msvcrt/stdio/tempnam.c @@ -1,4 +1,6 @@ -#include +#include +#include +#include char *_tempnam(const char *dir,const char *prefix ) diff --git a/reactos/lib/msvcrt/stdio/tmpfile.c b/reactos/lib/msvcrt/stdio/tmpfile.c index e9d42ad74e0..1e1c116e1ed 100644 --- a/reactos/lib/msvcrt/stdio/tmpfile.c +++ b/reactos/lib/msvcrt/stdio/tmpfile.c @@ -2,7 +2,16 @@ /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include + +#include +#include +#include +#include +#include +//#include +#include +#include +#include FILE * __alloc_file(void); @@ -44,13 +53,13 @@ tmpfile(void) f->_cnt = 0; f->_bufsiz = 0; f->_flag = _IORMONCL | _IOREAD | _IOWRT; - f->_tmpfname = n_t_r; - strcpy(f->_tmpfname, temp_name); + f->_name_to_remove = n_t_r; + strcpy(f->_name_to_remove, temp_name); f->_base = f->_ptr = NULL; } else { - _close(temp_fd); + close(temp_fd); remove(temp_name); free(n_t_r); } diff --git a/reactos/lib/msvcrt/stdio/tmpnam.c b/reactos/lib/msvcrt/stdio/tmpnam.c index 18ebd110bd2..cd16118dce4 100644 --- a/reactos/lib/msvcrt/stdio/tmpnam.c +++ b/reactos/lib/msvcrt/stdio/tmpnam.c @@ -1,4 +1,6 @@ -#include +#include +#include +#include char *tmpnam(char *s) diff --git a/reactos/lib/msvcrt/stdio/ungetc.c b/reactos/lib/msvcrt/stdio/ungetc.c index 5ae6742197a..1ef5b437757 100644 --- a/reactos/lib/msvcrt/stdio/ungetc.c +++ b/reactos/lib/msvcrt/stdio/ungetc.c @@ -1,7 +1,9 @@ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include int ungetc(int c, FILE *f) { diff --git a/reactos/lib/msvcrt/stdio/vfprintf.c b/reactos/lib/msvcrt/stdio/vfprintf.c index b904b972a5a..fd5bc9c5891 100644 --- a/reactos/lib/msvcrt/stdio/vfprintf.c +++ b/reactos/lib/msvcrt/stdio/vfprintf.c @@ -1,6 +1,8 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include int _isnanl(double x); int _isinfl(double x); @@ -51,13 +53,14 @@ vfprintf(FILE *f, const char *fmt, va_list ap) * Appropiated for the reactos kernel, March 1998 -- David Welch */ -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define ZEROPAD 1 /* pad with zero */ diff --git a/reactos/lib/msvcrt/stdio/vfscanf.c b/reactos/lib/msvcrt/stdio/vfscanf.c index 42cb938a349..909901b4785 100644 --- a/reactos/lib/msvcrt/stdio/vfscanf.c +++ b/reactos/lib/msvcrt/stdio/vfscanf.c @@ -15,8 +15,19 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* The internal entry points for `strtoX' take an extra flag argument saying whether or not to parse locale-dependent number grouping. */ @@ -171,7 +182,7 @@ int __vfscanf (FILE *s, const char *format, va_list argptr) otherwise it is the next argument after the state now in ARG. */ #define ARG(type) va_arg(argptr,type) - if (!__isascii (*f)) + if (!isascii (*f)) { /* Non-ASCII, may be a multibyte. */ // int len = mblen (f, strlen (f)); diff --git a/reactos/lib/msvcrt/stdio/vfwprint.c b/reactos/lib/msvcrt/stdio/vfwprint.c index 080f48f2c1f..91082d7971c 100644 --- a/reactos/lib/msvcrt/stdio/vfwprint.c +++ b/reactos/lib/msvcrt/stdio/vfwprint.c @@ -1,6 +1,8 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include int _isnanl(double x); int _isinfl(double x); @@ -51,6 +53,16 @@ vfwprintf(FILE *f, const wchar_t *fmt, va_list ap) * Appropiated for the reactos kernel, March 1998 -- David Welch */ +#include + +#include +#include +#include +#include +#include +#include + + #define ZEROPAD 1 /* pad with zero */ #define SIGN 2 /* unsigned/signed long */ #define PLUS 4 /* show plus */ diff --git a/reactos/lib/msvcrt/stdio/vprintf.c b/reactos/lib/msvcrt/stdio/vprintf.c index d87a12709be..f7247499e96 100644 --- a/reactos/lib/msvcrt/stdio/vprintf.c +++ b/reactos/lib/msvcrt/stdio/vprintf.c @@ -15,9 +15,11 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#undef __OPTIMIZE__ /* Avoid inline `vprintf' function. */ -#include +#include +#undef __OPTIMIZE__ /* Avoid inline `vprintf' function. */ +#include +#include #undef vprintf #undef vwprintf diff --git a/reactos/lib/msvcrt/stdio/vscanf.c b/reactos/lib/msvcrt/stdio/vscanf.c index 2c81dfdad0a..4c6b7968964 100644 --- a/reactos/lib/msvcrt/stdio/vscanf.c +++ b/reactos/lib/msvcrt/stdio/vscanf.c @@ -15,7 +15,11 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include + +#include +#include +#include +#include #undef vscanf diff --git a/reactos/lib/msvcrt/stdio/vsprintf.c b/reactos/lib/msvcrt/stdio/vsprintf.c index 356456e0c0c..75bfb1d1197 100644 --- a/reactos/lib/msvcrt/stdio/vsprintf.c +++ b/reactos/lib/msvcrt/stdio/vsprintf.c @@ -1,6 +1,8 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include int vsprintf(char *str, const char *fmt, va_list ap) diff --git a/reactos/lib/msvcrt/stdio/vsscanf.c b/reactos/lib/msvcrt/stdio/vsscanf.c index 70be2096686..42348a1a111 100644 --- a/reactos/lib/msvcrt/stdio/vsscanf.c +++ b/reactos/lib/msvcrt/stdio/vsscanf.c @@ -15,8 +15,13 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include +#include +#include +#include +#include +#include #undef vsscanf diff --git a/reactos/lib/msvcrt/stdlib.c b/reactos/lib/msvcrt/stdlib.c deleted file mode 100755 index 0cfbbe96f09..00000000000 --- a/reactos/lib/msvcrt/stdlib.c +++ /dev/null @@ -1,40 +0,0 @@ -#include "stdlib/_exit.c" -#include "stdlib/abort.c" -#include "stdlib/abs.c" -#include "stdlib/atexit.c" -#include "stdlib/atof.c" -#include "stdlib/atoi.c" -#include "stdlib/atoi64.c" -#include "stdlib/atol.c" -#include "stdlib/bsearch.c" -#include "stdlib/div.c" -#include "stdlib/ecvt.c" -#include "stdlib/ecvtbuf.c" -#include "stdlib/errno.c" -#include "stdlib/fcvt.c" -#include "stdlib/fcvtbuf.c" -#include "stdlib/fullpath.c" -#include "stdlib/gcvt.c" -#include "stdlib/getenv.c" -#include "stdlib/itoa.c" -#include "stdlib/itow.c" -#include "stdlib/labs.c" -#include "stdlib/ldiv.c" -#include "stdlib/makepath.c" -#include "stdlib/malloc.c" -#include "stdlib/obsol.c" -#include "stdlib/putenv.c" -#include "stdlib/qsort.c" -#include "stdlib/rand.c" -#include "stdlib/rot.c" -#include "stdlib/senv.c" -#include "stdlib/splitp.c" -#include "stdlib/strtod.c" -#include "stdlib/strtol.c" -#include "stdlib/strtoul.c" -#include "stdlib/swab.c" -#include "stdlib/wcstod.c" -#include "stdlib/wcstol.c" -#include "stdlib/wcstoul.c" -#include "stdlib/wtoi.c" -#include "stdlib/wtoi64.c" diff --git a/reactos/lib/msvcrt/stdlib/_exit.c b/reactos/lib/msvcrt/stdlib/_exit.c index 1042d08bfd4..c67e0cffb96 100644 --- a/reactos/lib/msvcrt/stdlib/_exit.c +++ b/reactos/lib/msvcrt/stdlib/_exit.c @@ -1,5 +1,8 @@ -#include - +#include +#include +#include +#include +#include struct __atexit *__atexit_ptr = 0; diff --git a/reactos/lib/msvcrt/stdlib/abort.c b/reactos/lib/msvcrt/stdlib/abort.c index bd08374c05a..b76a2275e99 100644 --- a/reactos/lib/msvcrt/stdlib/abort.c +++ b/reactos/lib/msvcrt/stdlib/abort.c @@ -1,12 +1,14 @@ -#include - +#include +#include +#include +#include char *msg ="Abort\n\r"; void abort() { fflush(NULL); - _fcloseall(); + fcloseall(); raise(SIGABRT); _write(stderr->_file, msg, sizeof(msg)-1); exit(3); diff --git a/reactos/lib/msvcrt/stdlib/abs.c b/reactos/lib/msvcrt/stdlib/abs.c index 1b8b5c6b165..95802c5f59b 100644 --- a/reactos/lib/msvcrt/stdlib/abs.c +++ b/reactos/lib/msvcrt/stdlib/abs.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include int abs(int j) diff --git a/reactos/lib/msvcrt/stdlib/atexit.c b/reactos/lib/msvcrt/stdlib/atexit.c index c232ffb99c4..fd80fde5f53 100644 --- a/reactos/lib/msvcrt/stdlib/atexit.c +++ b/reactos/lib/msvcrt/stdlib/atexit.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include int atexit(void (*a)(void)) diff --git a/reactos/lib/msvcrt/stdlib/atof.c b/reactos/lib/msvcrt/stdlib/atof.c index 559ff6f3014..8497148784a 100644 --- a/reactos/lib/msvcrt/stdlib/atof.c +++ b/reactos/lib/msvcrt/stdlib/atof.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include double atof(const char *ascii) diff --git a/reactos/lib/msvcrt/stdlib/atoi.c b/reactos/lib/msvcrt/stdlib/atoi.c index f0c5339e61f..c6b95e31af9 100644 --- a/reactos/lib/msvcrt/stdlib/atoi.c +++ b/reactos/lib/msvcrt/stdlib/atoi.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include int atoi(const char *str) diff --git a/reactos/lib/msvcrt/stdlib/atoi64.c b/reactos/lib/msvcrt/stdlib/atoi64.c index e646b3bc4f6..9b81b19b5eb 100644 --- a/reactos/lib/msvcrt/stdlib/atoi64.c +++ b/reactos/lib/msvcrt/stdlib/atoi64.c @@ -1,5 +1,6 @@ -#include +#include +#include __int64 _atoi64(const char *nptr) diff --git a/reactos/lib/msvcrt/stdlib/atol.c b/reactos/lib/msvcrt/stdlib/atol.c index 399a8e466d9..3cac430b260 100644 --- a/reactos/lib/msvcrt/stdlib/atol.c +++ b/reactos/lib/msvcrt/stdlib/atol.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include long atol(const char *str) diff --git a/reactos/lib/msvcrt/stdlib/atold.c b/reactos/lib/msvcrt/stdlib/atold.c index e9fbe4e9274..c9b511684a4 100644 --- a/reactos/lib/msvcrt/stdlib/atold.c +++ b/reactos/lib/msvcrt/stdlib/atold.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include long double _atold(const char *ascii) diff --git a/reactos/lib/msvcrt/stdlib/bsearch.c b/reactos/lib/msvcrt/stdlib/bsearch.c index 46ff6c9bbdb..7c3d9ed0e66 100644 --- a/reactos/lib/msvcrt/stdlib/bsearch.c +++ b/reactos/lib/msvcrt/stdlib/bsearch.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include void * bsearch(const void *key, const void *base0, size_t nelem, diff --git a/reactos/lib/msvcrt/stdlib/div.c b/reactos/lib/msvcrt/stdlib/div.c index d359d2fc23d..833e6a349e7 100644 --- a/reactos/lib/msvcrt/stdlib/div.c +++ b/reactos/lib/msvcrt/stdlib/div.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include div_t div(int num, int denom) diff --git a/reactos/lib/msvcrt/stdlib/ecvt.c b/reactos/lib/msvcrt/stdlib/ecvt.c index 870bac927ce..18d00902fcb 100644 --- a/reactos/lib/msvcrt/stdlib/ecvt.c +++ b/reactos/lib/msvcrt/stdlib/ecvt.c @@ -1,6 +1,6 @@ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include char *ecvtbuf (double, int, int *, int *, char *); diff --git a/reactos/lib/msvcrt/stdlib/ecvtbuf.c b/reactos/lib/msvcrt/stdlib/ecvtbuf.c index 621a872fc5b..1d0f65fbba8 100644 --- a/reactos/lib/msvcrt/stdlib/ecvtbuf.c +++ b/reactos/lib/msvcrt/stdlib/ecvtbuf.c @@ -1,6 +1,10 @@ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include +#include +// #include void __ecvround (char *, char *, const char *, int *); @@ -35,7 +39,7 @@ __ecvround (char *numbuf, char *last_digit, const char *after_last, int *decpt) char * ecvtbuf (double value, int ndigits, int *decpt, int *sign, char *buf) { - static char _INFINITY[] = "Infinity"; + static char INFINITY[] = "Infinity"; char decimal = '.' /* localeconv()->decimal_point[0] */; char *cvtbuf = (char *)alloca (ndigits + 20); /* +3 for sign, dot, null; */ /* two extra for rounding */ @@ -56,7 +60,7 @@ ecvtbuf (double value, int ndigits, int *decpt, int *sign, char *buf) if (strncmp (s, "Inf", 3) == 0) { /* SunOS docs says we have return "Infinity" for NDIGITS >= 8. */ - memcpy (buf, _INFINITY, ndigits >= 8 ? 9 : 3); + memcpy (buf, INFINITY, ndigits >= 8 ? 9 : 3); if (ndigits < 8) buf[3] = '\0'; } diff --git a/reactos/lib/msvcrt/stdlib/errno.c b/reactos/lib/msvcrt/stdlib/errno.c index 4614c854233..0da935087a1 100644 --- a/reactos/lib/msvcrt/stdlib/errno.c +++ b/reactos/lib/msvcrt/stdlib/errno.c @@ -1,12 +1,14 @@ -/* $Id: errno.c,v 1.7 2002/09/07 15:12:36 chorns Exp $ +/* $Id: errno.c,v 1.8 2002/09/08 10:22:57 chorns Exp $ * */ -#include +#include +#include +#include int* __doserrno(void) { - return((int *)&GetThreadData()->tdoserrno); + return(&GetThreadData()->tdoserrno); } int *_errno(void) diff --git a/reactos/lib/msvcrt/stdlib/fcvt.c b/reactos/lib/msvcrt/stdlib/fcvt.c index 0a010e4f7e6..8e4a3ed12b2 100644 --- a/reactos/lib/msvcrt/stdlib/fcvt.c +++ b/reactos/lib/msvcrt/stdlib/fcvt.c @@ -1,6 +1,6 @@ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include char *fcvtbuf (double, int, int *, int *, char *); diff --git a/reactos/lib/msvcrt/stdlib/fcvtbuf.c b/reactos/lib/msvcrt/stdlib/fcvtbuf.c index 8511122089d..2bf85aa6483 100644 --- a/reactos/lib/msvcrt/stdlib/fcvtbuf.c +++ b/reactos/lib/msvcrt/stdlib/fcvtbuf.c @@ -1,6 +1,10 @@ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include +#include +// #include void __ecvround (char *, char *, const char *, int *); char *ecvtbuf (double, int, int *, int *, char *); @@ -8,7 +12,7 @@ char *ecvtbuf (double, int, int *, int *, char *); char * fcvtbuf (double value, int ndigits, int *decpt, int *sign, char *buf) { - static char _INFINITY[] = "Infinity"; + static char INFINITY[] = "Infinity"; char decimal = '.' /* localeconv()->decimal_point[0] */; int digits = ndigits >= 0 ? ndigits : 0; char *cvtbuf = (char *)alloca (2*DBL_MAX_10_EXP + 16); @@ -31,7 +35,7 @@ fcvtbuf (double value, int ndigits, int *decpt, int *sign, char *buf) instead of "Inf". */ if (strncmp (s, "Inf", 3) == 0) { - memcpy (buf, _INFINITY, ndigits >= 8 ? 9 : 3); + memcpy (buf, INFINITY, ndigits >= 8 ? 9 : 3); if (ndigits < 8) buf[3] = '\0'; return buf; diff --git a/reactos/lib/msvcrt/stdlib/fullpath.c b/reactos/lib/msvcrt/stdlib/fullpath.c index 59636cff4e9..9b3c200ed63 100644 --- a/reactos/lib/msvcrt/stdlib/fullpath.c +++ b/reactos/lib/msvcrt/stdlib/fullpath.c @@ -7,8 +7,8 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include - +#include +#include char *_fullpath( char *absPath, const char *relPath, size_t maxLength ) { diff --git a/reactos/lib/msvcrt/stdlib/gcvt.c b/reactos/lib/msvcrt/stdlib/gcvt.c index 90f88d06e1e..3a0b621945e 100644 --- a/reactos/lib/msvcrt/stdlib/gcvt.c +++ b/reactos/lib/msvcrt/stdlib/gcvt.c @@ -1,6 +1,7 @@ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include char * _gcvt (double value, int ndigits, char *buf) diff --git a/reactos/lib/msvcrt/stdlib/getenv.c b/reactos/lib/msvcrt/stdlib/getenv.c index 1b5f8041c16..359ac0d3f8a 100644 --- a/reactos/lib/msvcrt/stdlib/getenv.c +++ b/reactos/lib/msvcrt/stdlib/getenv.c @@ -1,7 +1,8 @@ -#include +#include +#include #define NDEBUG -#include +#include char *getenv(const char *name) diff --git a/reactos/lib/msvcrt/stdlib/itoa.c b/reactos/lib/msvcrt/stdlib/itoa.c index e25592720db..e8b62af231c 100644 --- a/reactos/lib/msvcrt/stdlib/itoa.c +++ b/reactos/lib/msvcrt/stdlib/itoa.c @@ -9,8 +9,8 @@ * 1998: Added ltoa Boudewijn Dekker */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include char * _itoa(int value, char *string, int radix) diff --git a/reactos/lib/msvcrt/stdlib/itow.c b/reactos/lib/msvcrt/stdlib/itow.c index 5c99dfd6673..f65531ea715 100644 --- a/reactos/lib/msvcrt/stdlib/itow.c +++ b/reactos/lib/msvcrt/stdlib/itow.c @@ -9,8 +9,8 @@ * 1998: Added ltoa Boudewijn Dekker */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include wchar_t * _itow(int value, wchar_t *string, int radix) diff --git a/reactos/lib/msvcrt/stdlib/labs.c b/reactos/lib/msvcrt/stdlib/labs.c index b665116de21..eea59890d7c 100644 --- a/reactos/lib/msvcrt/stdlib/labs.c +++ b/reactos/lib/msvcrt/stdlib/labs.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include long labs(long j) diff --git a/reactos/lib/msvcrt/stdlib/ldiv.c b/reactos/lib/msvcrt/stdlib/ldiv.c index c7f1611602d..a3b121b8623 100644 --- a/reactos/lib/msvcrt/stdlib/ldiv.c +++ b/reactos/lib/msvcrt/stdlib/ldiv.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include ldiv_t ldiv(long num, long denom) diff --git a/reactos/lib/msvcrt/stdlib/makepath.c b/reactos/lib/msvcrt/stdlib/makepath.c index 9f69b7226b9..b5e431b0f33 100644 --- a/reactos/lib/msvcrt/stdlib/makepath.c +++ b/reactos/lib/msvcrt/stdlib/makepath.c @@ -1,7 +1,7 @@ -/* $Id: makepath.c,v 1.8 2002/09/07 15:12:36 chorns Exp $ +/* $Id: makepath.c,v 1.9 2002/09/08 10:22:57 chorns Exp $ */ -#include - +#include +#include void _makepath(char *path, const char *drive, const char *dir, const char *fname, const char *ext) { diff --git a/reactos/lib/msvcrt/stdlib/malloc.c b/reactos/lib/msvcrt/stdlib/malloc.c index f7345008c45..83532674845 100644 --- a/reactos/lib/msvcrt/stdlib/malloc.c +++ b/reactos/lib/msvcrt/stdlib/malloc.c @@ -1,5 +1,5 @@ -#include - +#include +#include extern HANDLE hHeap; diff --git a/reactos/lib/msvcrt/stdlib/mbstow.c b/reactos/lib/msvcrt/stdlib/mbstow.c index 49e981e677e..9daae0ba5a3 100644 --- a/reactos/lib/msvcrt/stdlib/mbstow.c +++ b/reactos/lib/msvcrt/stdlib/mbstow.c @@ -1,4 +1,4 @@ -#include +#include int mblen (const char* mbs, size_t sizeString) diff --git a/reactos/lib/msvcrt/stdlib/mbstowcs.c b/reactos/lib/msvcrt/stdlib/mbstowcs.c index 2c2c67dcf36..0aac3f198ed 100644 --- a/reactos/lib/msvcrt/stdlib/mbstowcs.c +++ b/reactos/lib/msvcrt/stdlib/mbstowcs.c @@ -1,5 +1,4 @@ -#include - +#include size_t mbstowcs( wchar_t *wcstr, const char *mbstr, size_t count ) { diff --git a/reactos/lib/msvcrt/stdlib/obsol.c b/reactos/lib/msvcrt/stdlib/obsol.c index 046317fb21c..eac7119b160 100644 --- a/reactos/lib/msvcrt/stdlib/obsol.c +++ b/reactos/lib/msvcrt/stdlib/obsol.c @@ -1,5 +1,5 @@ -#include - +#include +#include #undef _cpumode unsigned char _cpumode = 0; diff --git a/reactos/lib/msvcrt/stdlib/putenv.c b/reactos/lib/msvcrt/stdlib/putenv.c index 97d570dafe1..ce68245ba87 100644 --- a/reactos/lib/msvcrt/stdlib/putenv.c +++ b/reactos/lib/msvcrt/stdlib/putenv.c @@ -1,7 +1,9 @@ -#include +#include +#include +#include #define NDEBUG -#include +#include extern int BlockEnvToEnviron(); // defined in misc/dllmain.c @@ -37,7 +39,7 @@ int _wputenv(const wchar_t *val) epos = wcsrchr(val, L'='); if ( epos == NULL ) return -1; - buffer = (wchar_t*)malloc((epos - val + 1) * sizeof (wchar_t)); + buffer = (char*)malloc((epos - val + 1) * sizeof (wchar_t)); if (buffer == NULL) return -1; wcsncpy(buffer, val, epos - val); diff --git a/reactos/lib/msvcrt/stdlib/qsort.c b/reactos/lib/msvcrt/stdlib/qsort.c index b09807120db..f0e2f55b363 100644 --- a/reactos/lib/msvcrt/stdlib/qsort.c +++ b/reactos/lib/msvcrt/stdlib/qsort.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include /*- * Copyright (c) 1980, 1983 The Regents of the University of California. @@ -168,8 +168,7 @@ qst(PTHREADDATA pThreadData, char *base, char *max) * It's not... */ void -qsort(const void *base0, size_t n, size_t size,int (__cdecl * compar) - (const void *, const void *)) +qsort(const void *base0, size_t n, size_t size, _pfunccmp_t compar) { PTHREADDATA pThreadData; char *base = (char *)base0; diff --git a/reactos/lib/msvcrt/stdlib/rand.c b/reactos/lib/msvcrt/stdlib/rand.c index e1b67a71c59..bae3e28e4ad 100644 --- a/reactos/lib/msvcrt/stdlib/rand.c +++ b/reactos/lib/msvcrt/stdlib/rand.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include int rand(void) diff --git a/reactos/lib/msvcrt/stdlib/rot.c b/reactos/lib/msvcrt/stdlib/rot.c index 0b9722cba6a..ee6dfe49959 100644 --- a/reactos/lib/msvcrt/stdlib/rot.c +++ b/reactos/lib/msvcrt/stdlib/rot.c @@ -7,8 +7,8 @@ * UPDATE HISTORY: * 03/04/99: Created */ -#include +#include unsigned int _rotl( unsigned int value, int shift ) { @@ -53,4 +53,4 @@ unsigned long _lrotr( unsigned long value, int shift ) if ( shift > max_bits ) shift = shift % max_bits; return (value >> shift) | (value << (max_bits-shift)); -} +} \ No newline at end of file diff --git a/reactos/lib/msvcrt/stdlib/senv.c b/reactos/lib/msvcrt/stdlib/senv.c index f45c20441bb..32c1afea984 100644 --- a/reactos/lib/msvcrt/stdlib/senv.c +++ b/reactos/lib/msvcrt/stdlib/senv.c @@ -1,8 +1,9 @@ -#include +#include +#include +#include #define NDEBUG -#include - +#include void _searchenv(const char *file,const char *var,char *path ) { diff --git a/reactos/lib/msvcrt/stdlib/splitp.c b/reactos/lib/msvcrt/stdlib/splitp.c index 9c87aff2553..20536c67ebc 100644 --- a/reactos/lib/msvcrt/stdlib/splitp.c +++ b/reactos/lib/msvcrt/stdlib/splitp.c @@ -1,5 +1,5 @@ -#include - +#include +#include void _splitpath( const char *path, char *drive, char *dir, char *fname, char *ext ) { diff --git a/reactos/lib/msvcrt/stdlib/strtod.c b/reactos/lib/msvcrt/stdlib/strtod.c index 31e42f83640..433ea38129a 100644 --- a/reactos/lib/msvcrt/stdlib/strtod.c +++ b/reactos/lib/msvcrt/stdlib/strtod.c @@ -1,6 +1,7 @@ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include + +#include double diff --git a/reactos/lib/msvcrt/stdlib/strtol.c b/reactos/lib/msvcrt/stdlib/strtol.c index 3f505ead0a1..1d32150ef04 100644 --- a/reactos/lib/msvcrt/stdlib/strtol.c +++ b/reactos/lib/msvcrt/stdlib/strtol.c @@ -1,5 +1,8 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include +#include long diff --git a/reactos/lib/msvcrt/stdlib/strtold.c b/reactos/lib/msvcrt/stdlib/strtold.c index 8e3715aa1ba..90e847b48f2 100644 --- a/reactos/lib/msvcrt/stdlib/strtold.c +++ b/reactos/lib/msvcrt/stdlib/strtold.c @@ -1,6 +1,7 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +//#include static double powten[] = { diff --git a/reactos/lib/msvcrt/stdlib/strtoll.c b/reactos/lib/msvcrt/stdlib/strtoll.c index a7f34ea57c2..b609e79d233 100644 --- a/reactos/lib/msvcrt/stdlib/strtoll.c +++ b/reactos/lib/msvcrt/stdlib/strtoll.c @@ -1,7 +1,10 @@ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include +//#include /* constants used in Solaris */ #define LLONG_MIN -9223372036854775807L-1L diff --git a/reactos/lib/msvcrt/stdlib/strtoul.c b/reactos/lib/msvcrt/stdlib/strtoul.c index 6144d337966..7e275dafc0d 100644 --- a/reactos/lib/msvcrt/stdlib/strtoul.c +++ b/reactos/lib/msvcrt/stdlib/strtoul.c @@ -1,5 +1,8 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include +#include /* * Convert a string to an unsigned long integer. diff --git a/reactos/lib/msvcrt/stdlib/strtoull.c b/reactos/lib/msvcrt/stdlib/strtoull.c index 51ea86de31d..ec9f852525f 100644 --- a/reactos/lib/msvcrt/stdlib/strtoull.c +++ b/reactos/lib/msvcrt/stdlib/strtoull.c @@ -1,7 +1,10 @@ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include +//#include /* * Convert a string to an unsigned long integer. diff --git a/reactos/lib/msvcrt/stdlib/swab.c b/reactos/lib/msvcrt/stdlib/swab.c index f8e282c5789..bdc39de85a4 100644 --- a/reactos/lib/msvcrt/stdlib/swab.c +++ b/reactos/lib/msvcrt/stdlib/swab.c @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include void _swab (const char* caFrom, char* caTo, size_t sizeToCopy) { diff --git a/reactos/lib/msvcrt/stdlib/wcstod.c b/reactos/lib/msvcrt/stdlib/wcstod.c index a91e29625ac..777271822c1 100644 --- a/reactos/lib/msvcrt/stdlib/wcstod.c +++ b/reactos/lib/msvcrt/stdlib/wcstod.c @@ -1,6 +1,6 @@ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include double wcstod(const wchar_t *s, wchar_t **sret) diff --git a/reactos/lib/msvcrt/stdlib/wcstol.c b/reactos/lib/msvcrt/stdlib/wcstol.c index 624998754d4..732eb3d3e44 100644 --- a/reactos/lib/msvcrt/stdlib/wcstol.c +++ b/reactos/lib/msvcrt/stdlib/wcstol.c @@ -1,4 +1,4 @@ -#include +#include long wcstol(const wchar_t *cp,wchar_t **endp,int base) diff --git a/reactos/lib/msvcrt/stdlib/wcstom.c b/reactos/lib/msvcrt/stdlib/wcstom.c index a9f4c30433c..ce3921d7e95 100644 --- a/reactos/lib/msvcrt/stdlib/wcstom.c +++ b/reactos/lib/msvcrt/stdlib/wcstom.c @@ -1,5 +1,4 @@ -#include - +#include size_t wcstombs (char* mbsDest, const wchar_t* wsConvert, size_t size) { diff --git a/reactos/lib/msvcrt/stdlib/wcstomb.c b/reactos/lib/msvcrt/stdlib/wcstomb.c index 3ecd1b6a142..978bd2a7d42 100644 --- a/reactos/lib/msvcrt/stdlib/wcstomb.c +++ b/reactos/lib/msvcrt/stdlib/wcstomb.c @@ -15,8 +15,13 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include +#include + +#include +#include +#include #ifndef EILSEQ #define EILSEQ EINVAL diff --git a/reactos/lib/msvcrt/stdlib/wcstombs.c b/reactos/lib/msvcrt/stdlib/wcstombs.c index 75f96c67a0d..4fc85df3210 100644 --- a/reactos/lib/msvcrt/stdlib/wcstombs.c +++ b/reactos/lib/msvcrt/stdlib/wcstombs.c @@ -15,8 +15,12 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include +#include + +#include +#include #ifndef EILSEQ #define EILSEQ EINVAL diff --git a/reactos/lib/msvcrt/stdlib/wcstoul.c b/reactos/lib/msvcrt/stdlib/wcstoul.c index 88c399515ab..5ee82eed08c 100644 --- a/reactos/lib/msvcrt/stdlib/wcstoul.c +++ b/reactos/lib/msvcrt/stdlib/wcstoul.c @@ -1,6 +1,8 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include /* * Convert a unicode string to an unsigned long integer. diff --git a/reactos/lib/msvcrt/stdlib/wtoi.c b/reactos/lib/msvcrt/stdlib/wtoi.c index 3de89aadf8f..38f03db634a 100644 --- a/reactos/lib/msvcrt/stdlib/wtoi.c +++ b/reactos/lib/msvcrt/stdlib/wtoi.c @@ -1,5 +1,4 @@ -#include - +#include int _wtoi( const wchar_t *str ) { diff --git a/reactos/lib/msvcrt/stdlib/wtoi64.c b/reactos/lib/msvcrt/stdlib/wtoi64.c index e149fd4f0d0..c9d94415532 100644 --- a/reactos/lib/msvcrt/stdlib/wtoi64.c +++ b/reactos/lib/msvcrt/stdlib/wtoi64.c @@ -1,5 +1,6 @@ -#include +#include +#include __int64 _wtoi64(const wchar_t *nptr) diff --git a/reactos/lib/msvcrt/string.c b/reactos/lib/msvcrt/string.c deleted file mode 100755 index 6b87ce3d398..00000000000 --- a/reactos/lib/msvcrt/string.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "string/memccpy.c" -#include "string/memchr.c" -#include "string/memcmp.c" -#include "string/memcpy.c" -#include "string/memicmp.c" -#include "string/memmove.c" -#include "string/memset.c" -#include "string/strcat.c" -#include "string/strchr.c" -#include "string/strcmp.c" -#include "string/strcoll.c" -#include "string/strcpy.c" -#include "string/strcspn.c" -#include "string/strdup.c" -#include "string/strerror.c" -#include "string/stricmp.c" -#include "string/strlen.c" -#include "string/strlwr.c" -#include "string/strncat.c" -#include "string/strncmp.c" -#include "string/strncpy.c" -#include "string/strnicmp.c" -#include "string/strnlen.c" -#include "string/strpbrk.c" -#include "string/strrchr.c" -#include "string/strrev.c" -#include "string/strset.c" -#include "string/strspn.c" -#include "string/strstr.c" -#include "string/strtok.c" -#include "string/strupr.c" -#include "string/strxfrm.c" diff --git a/reactos/lib/msvcrt/string/memccpy.c b/reactos/lib/msvcrt/string/memccpy.c index f2e9e538070..42fd26b0795 100644 --- a/reactos/lib/msvcrt/string/memccpy.c +++ b/reactos/lib/msvcrt/string/memccpy.c @@ -1,4 +1,4 @@ -#include +#include void * diff --git a/reactos/lib/msvcrt/string/memchr.c b/reactos/lib/msvcrt/string/memchr.c index 9192a43892b..fd21697b3e8 100644 --- a/reactos/lib/msvcrt/string/memchr.c +++ b/reactos/lib/msvcrt/string/memchr.c @@ -1,5 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include void * diff --git a/reactos/lib/msvcrt/string/memcmp.c b/reactos/lib/msvcrt/string/memcmp.c index 5b2c2d4e9d8..81371e03348 100644 --- a/reactos/lib/msvcrt/string/memcmp.c +++ b/reactos/lib/msvcrt/string/memcmp.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include int memcmp(const void *s1, const void *s2, size_t n) diff --git a/reactos/lib/msvcrt/string/memcpy.c b/reactos/lib/msvcrt/string/memcpy.c index c07f188b052..83077e1a0ce 100644 --- a/reactos/lib/msvcrt/string/memcpy.c +++ b/reactos/lib/msvcrt/string/memcpy.c @@ -1,5 +1,4 @@ -#include - +#include /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ diff --git a/reactos/lib/msvcrt/string/memicmp.c b/reactos/lib/msvcrt/string/memicmp.c index c40acf5ed74..ed7660312d2 100644 --- a/reactos/lib/msvcrt/string/memicmp.c +++ b/reactos/lib/msvcrt/string/memicmp.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include int _memicmp(const void *s1, const void *s2, size_t n) diff --git a/reactos/lib/msvcrt/string/memmove.c b/reactos/lib/msvcrt/string/memmove.c index e5ba2e9a687..a3d37265db3 100644 --- a/reactos/lib/msvcrt/string/memmove.c +++ b/reactos/lib/msvcrt/string/memmove.c @@ -1,4 +1,4 @@ -#include +#include void * memmove(void *dest,const void *src,size_t count) diff --git a/reactos/lib/msvcrt/string/memset.c b/reactos/lib/msvcrt/string/memset.c index 4686cf10bcb..129e6acab69 100644 --- a/reactos/lib/msvcrt/string/memset.c +++ b/reactos/lib/msvcrt/string/memset.c @@ -1,5 +1,4 @@ -#include - +#include void * memset(void *src,int val,size_t count) { diff --git a/reactos/lib/msvcrt/string/strcat.c b/reactos/lib/msvcrt/string/strcat.c index 72aaf788bda..fa717189adb 100644 --- a/reactos/lib/msvcrt/string/strcat.c +++ b/reactos/lib/msvcrt/string/strcat.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include char * strcat(char *s, const char *append) diff --git a/reactos/lib/msvcrt/string/strchr.c b/reactos/lib/msvcrt/string/strchr.c index 9e59047b1ee..2e739a87505 100644 --- a/reactos/lib/msvcrt/string/strchr.c +++ b/reactos/lib/msvcrt/string/strchr.c @@ -1,6 +1,6 @@ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include char *strchr(const char *s, int c) diff --git a/reactos/lib/msvcrt/string/strcmp.c b/reactos/lib/msvcrt/string/strcmp.c index 5e779b2e3f1..edc4c94626a 100644 --- a/reactos/lib/msvcrt/string/strcmp.c +++ b/reactos/lib/msvcrt/string/strcmp.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include int strcmp(const char *s1, const char *s2) { diff --git a/reactos/lib/msvcrt/string/strcoll.c b/reactos/lib/msvcrt/string/strcoll.c index 03cb3e359d0..30b4b4cec1b 100644 --- a/reactos/lib/msvcrt/string/strcoll.c +++ b/reactos/lib/msvcrt/string/strcoll.c @@ -1,5 +1,5 @@ -#include - +#include +#include /* Compare S1 and S2, returning less than, equal to or greater than zero if the collated form of S1 is lexicographically diff --git a/reactos/lib/msvcrt/string/strcpy.c b/reactos/lib/msvcrt/string/strcpy.c index 5f59412ca40..c62cf0dc92f 100644 --- a/reactos/lib/msvcrt/string/strcpy.c +++ b/reactos/lib/msvcrt/string/strcpy.c @@ -1,5 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include char* strcpy(char *to, const char *from) diff --git a/reactos/lib/msvcrt/string/strcspn.c b/reactos/lib/msvcrt/string/strcspn.c index d1b2226e92d..db77bb707b2 100644 --- a/reactos/lib/msvcrt/string/strcspn.c +++ b/reactos/lib/msvcrt/string/strcspn.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include size_t strcspn(const char *s1, const char *s2) { diff --git a/reactos/lib/msvcrt/string/strdup.c b/reactos/lib/msvcrt/string/strdup.c index 6ec64c5de1d..a84de3667bf 100644 --- a/reactos/lib/msvcrt/string/strdup.c +++ b/reactos/lib/msvcrt/string/strdup.c @@ -1,5 +1,6 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include char *_strdup(const char *_s) diff --git a/reactos/lib/msvcrt/string/strerror.c b/reactos/lib/msvcrt/string/strerror.c index de3742d9f4f..620a35d48a4 100644 --- a/reactos/lib/msvcrt/string/strerror.c +++ b/reactos/lib/msvcrt/string/strerror.c @@ -1,5 +1,7 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include +#include +#include char __syserr00[] = "No Error"; @@ -49,7 +51,7 @@ char __syserr42[] = "Illegal byte sequence (EILSEQ)"; -char *_sys_errlist[] = { +const char *_sys_errlist[] = { __syserr00, __syserr01, __syserr02, __syserr03, __syserr04, __syserr05, __syserr06, __syserr07, __syserr08, __syserr09, __syserr10, __syserr11, __syserr12, __syserr13, __syserr14, @@ -61,9 +63,9 @@ __syserr35, __syserr36, __syserr37, __syserr38, __syserr39, __syserr40, __syserr41, __syserr42 }; -#undef _sys_nerr +int __sys_nerr = sizeof(_sys_errlist) / sizeof(_sys_errlist[0]); -int _sys_nerr = sizeof(_sys_errlist) / sizeof(_sys_errlist[0]); +int* _sys_nerr = &__sys_nerr; char *strerror(int errnum) { @@ -71,7 +73,7 @@ char *strerror(int errnum) char *cp; int v=1000000, lz=0; - if (errnum >= 0 && errnum < _sys_nerr) + if (errnum >= 0 && errnum < __sys_nerr) return((char *)_sys_errlist[errnum]); strcpy(ebuf, "Unknown error: "); diff --git a/reactos/lib/msvcrt/string/stricmp.c b/reactos/lib/msvcrt/string/stricmp.c index eb318552f15..de15d0f8a30 100644 --- a/reactos/lib/msvcrt/string/stricmp.c +++ b/reactos/lib/msvcrt/string/stricmp.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include int _stricmp(const char *s1, const char *s2) diff --git a/reactos/lib/msvcrt/string/strlen.c b/reactos/lib/msvcrt/string/strlen.c index 9d9d18674e4..808d96c8f62 100644 --- a/reactos/lib/msvcrt/string/strlen.c +++ b/reactos/lib/msvcrt/string/strlen.c @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include size_t strlen(const char *str) diff --git a/reactos/lib/msvcrt/string/strlwr.c b/reactos/lib/msvcrt/string/strlwr.c index 55a017bfba0..131ec3f44d4 100644 --- a/reactos/lib/msvcrt/string/strlwr.c +++ b/reactos/lib/msvcrt/string/strlwr.c @@ -7,8 +7,9 @@ * Copyright 1996 Jukka Iivonen * Copyright 1997 Uwe Bonnes */ -#include +#include +#include char * _strlwr(char *x) { diff --git a/reactos/lib/msvcrt/string/strncat.c b/reactos/lib/msvcrt/string/strncat.c index b2aa76fb9e5..be963b47ab5 100644 --- a/reactos/lib/msvcrt/string/strncat.c +++ b/reactos/lib/msvcrt/string/strncat.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include char * strncat(char *dst, const char *src, size_t n) diff --git a/reactos/lib/msvcrt/string/strncmp.c b/reactos/lib/msvcrt/string/strncmp.c index c09e797417c..6a2352ddfd8 100644 --- a/reactos/lib/msvcrt/string/strncmp.c +++ b/reactos/lib/msvcrt/string/strncmp.c @@ -1,5 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include int diff --git a/reactos/lib/msvcrt/string/strncpy.c b/reactos/lib/msvcrt/string/strncpy.c index 52f3b2bceba..6981589407f 100644 --- a/reactos/lib/msvcrt/string/strncpy.c +++ b/reactos/lib/msvcrt/string/strncpy.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include char * strncpy(char *dst, const char *src, size_t n) diff --git a/reactos/lib/msvcrt/string/strnicmp.c b/reactos/lib/msvcrt/string/strnicmp.c index 190dad59160..b19a8a80c00 100644 --- a/reactos/lib/msvcrt/string/strnicmp.c +++ b/reactos/lib/msvcrt/string/strnicmp.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include int _strnicmp(const char *s1, const char *s2, size_t n) { diff --git a/reactos/lib/msvcrt/string/strnlen.c b/reactos/lib/msvcrt/string/strnlen.c index 0ee85b5705b..ba113d00e14 100644 --- a/reactos/lib/msvcrt/string/strnlen.c +++ b/reactos/lib/msvcrt/string/strnlen.c @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include - +#include size_t strnlen(const char *str, size_t count) diff --git a/reactos/lib/msvcrt/string/strpbrk.c b/reactos/lib/msvcrt/string/strpbrk.c index acade76a1d1..c4837fc60b5 100644 --- a/reactos/lib/msvcrt/string/strpbrk.c +++ b/reactos/lib/msvcrt/string/strpbrk.c @@ -1,5 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include char * diff --git a/reactos/lib/msvcrt/string/strrchr.c b/reactos/lib/msvcrt/string/strrchr.c index a8a3dc49826..64be5cdf904 100644 --- a/reactos/lib/msvcrt/string/strrchr.c +++ b/reactos/lib/msvcrt/string/strrchr.c @@ -1,7 +1,6 @@ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include char * strrchr(const char *s, int c) diff --git a/reactos/lib/msvcrt/string/strrev.c b/reactos/lib/msvcrt/string/strrev.c index 15ffc01258d..d36b7a3dee7 100644 --- a/reactos/lib/msvcrt/string/strrev.c +++ b/reactos/lib/msvcrt/string/strrev.c @@ -1,5 +1,4 @@ -#include - +#include char * _strrev(char *s) { diff --git a/reactos/lib/msvcrt/string/strset.c b/reactos/lib/msvcrt/string/strset.c index 5bc59009e36..8c517395f68 100644 --- a/reactos/lib/msvcrt/string/strset.c +++ b/reactos/lib/msvcrt/string/strset.c @@ -1,5 +1,5 @@ -#include - +#include +#include char* _strnset (char* szToFill, int szFill, size_t sizeMaxFill) { diff --git a/reactos/lib/msvcrt/string/strspn.c b/reactos/lib/msvcrt/string/strspn.c index 64d6aafb806..f01e1bf2d3f 100644 --- a/reactos/lib/msvcrt/string/strspn.c +++ b/reactos/lib/msvcrt/string/strspn.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include size_t strspn(const char *s1, const char *s2) diff --git a/reactos/lib/msvcrt/string/strstr.c b/reactos/lib/msvcrt/string/strstr.c index c6291802c8c..4f23e4ffb15 100644 --- a/reactos/lib/msvcrt/string/strstr.c +++ b/reactos/lib/msvcrt/string/strstr.c @@ -1,5 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include char *strstr(const char *s, const char *find) diff --git a/reactos/lib/msvcrt/string/strtok.c b/reactos/lib/msvcrt/string/strtok.c index c1f19263b17..1388dbeb749 100644 --- a/reactos/lib/msvcrt/string/strtok.c +++ b/reactos/lib/msvcrt/string/strtok.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include -#include +#include +#include char *strtok(char *s, const char *delim) { diff --git a/reactos/lib/msvcrt/string/strupr.c b/reactos/lib/msvcrt/string/strupr.c index 451bbdef434..21b17f45c78 100644 --- a/reactos/lib/msvcrt/string/strupr.c +++ b/reactos/lib/msvcrt/string/strupr.c @@ -8,8 +8,9 @@ * Copyright 1997 Uwe Bonnes */ -#include -#include + +#include +#include char *_strupr(char *x) { diff --git a/reactos/lib/msvcrt/string/strxfrm.c b/reactos/lib/msvcrt/string/strxfrm.c index cce2f4a90e4..eca0b2d32f3 100644 --- a/reactos/lib/msvcrt/string/strxfrm.c +++ b/reactos/lib/msvcrt/string/strxfrm.c @@ -1,5 +1,5 @@ #include -#include +#include #if 1 size_t strxfrm( char *dest, const char *src, size_t n ) diff --git a/reactos/lib/msvcrt/sys_stat.c b/reactos/lib/msvcrt/sys_stat.c deleted file mode 100755 index 835894a6d60..00000000000 --- a/reactos/lib/msvcrt/sys_stat.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "sys_stat/fstat.c" -#include "sys_stat/futime.c" -#include "sys_stat/stat.c" diff --git a/reactos/lib/msvcrt/sys_stat/fstat.c b/reactos/lib/msvcrt/sys_stat/fstat.c index 18378e944a2..242af358358 100644 --- a/reactos/lib/msvcrt/sys_stat/fstat.c +++ b/reactos/lib/msvcrt/sys_stat/fstat.c @@ -1,4 +1,4 @@ -/* $Id: fstat.c,v 1.11 2002/09/07 15:12:37 chorns Exp $ +/* $Id: fstat.c,v 1.12 2002/09/08 10:22:59 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -8,10 +8,15 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include +#include +#include +#include +#include +#include +#include +#include - -int _fstat(int fd, struct _stat *statbuf) +int _fstat(int fd, struct stat *statbuf) { BY_HANDLE_FILE_INFORMATION FileInformation; DWORD dwFileType; @@ -23,7 +28,7 @@ int _fstat(int fd, struct _stat *statbuf) return -1; } - if ((void*)-1 == (handle = (HANDLE)_get_osfhandle(fd))) + if ((void*)-1 == (handle = _get_osfhandle(fd))) { __set_errno(EBADF); return -1; @@ -74,11 +79,11 @@ int _fstat(int fd, struct _stat *statbuf) return 0; } -int _fstati64 (int fd, struct _stati64* statbuf) +__int64 _fstati64 (int fd, struct _stati64* statbuf) { BY_HANDLE_FILE_INFORMATION FileInformation; DWORD dwFileType; - HANDLE handle; + void *handle; if (!statbuf) { @@ -86,7 +91,7 @@ int _fstati64 (int fd, struct _stati64* statbuf) return -1; } - if ((HANDLE)-1 == (handle = (HANDLE)_get_osfhandle(fd))) + if ((void*)-1 == (handle = _get_osfhandle(fd))) { __set_errno(EBADF); return -1; diff --git a/reactos/lib/msvcrt/sys_stat/futime.c b/reactos/lib/msvcrt/sys_stat/futime.c index 31969949b80..b308d086361 100644 --- a/reactos/lib/msvcrt/sys_stat/futime.c +++ b/reactos/lib/msvcrt/sys_stat/futime.c @@ -1,5 +1,10 @@ -#include - +#include +#include +#include +#include +#include +#include +#include int _futime (int nHandle, struct _utimbuf *pTimes) { @@ -28,7 +33,7 @@ int _futime (int nHandle, struct _utimbuf *pTimes) UnixTimeToFileTime(pTimes->actime,&LastAccessTime,0); UnixTimeToFileTime(pTimes->modtime,&LastWriteTime,0); - if (!SetFileTime((HANDLE)_get_osfhandle(nHandle),NULL, &LastAccessTime, &LastWriteTime)) + if (!SetFileTime(_get_osfhandle(nHandle),NULL, &LastAccessTime, &LastWriteTime)) { __set_errno(EBADF); return -1; diff --git a/reactos/lib/msvcrt/sys_stat/stat.c b/reactos/lib/msvcrt/sys_stat/stat.c index eb6eae9f22a..9e7a164d0fa 100644 --- a/reactos/lib/msvcrt/sys_stat/stat.c +++ b/reactos/lib/msvcrt/sys_stat/stat.c @@ -1,6 +1,13 @@ -#include +#include +#include +#include +#include +#include -int _stat(const char *path, struct _stat *buffer) +#include + + +int _stat(const char *path, struct stat *buffer) { HANDLE findHandle; WIN32_FIND_DATAA findData; @@ -45,7 +52,7 @@ int _stat(const char *path, struct _stat *buffer) return 0; } -int _stati64 (const char *path, struct _stati64 *buffer) +__int64 _stati64 (const char *path, struct _stati64 *buffer) { HANDLE findHandle; WIN32_FIND_DATAA findData; @@ -91,7 +98,7 @@ int _stati64 (const char *path, struct _stati64 *buffer) return 0; } -int _wstat (const wchar_t *path, struct _stat *buffer) +int _wstat (const wchar_t *path, struct stat *buffer) { HANDLE findHandle; WIN32_FIND_DATAW findData; @@ -136,7 +143,7 @@ int _wstat (const wchar_t *path, struct _stat *buffer) return 0; } -int _wstati64 (const wchar_t *path, struct _stati64 *buffer) +__int64 _wstati64 (const wchar_t *path, struct _stati64 *buffer) { HANDLE findHandle; WIN32_FIND_DATAW findData; diff --git a/reactos/lib/msvcrt/time.c b/reactos/lib/msvcrt/time.c deleted file mode 100755 index 46c6e3c6ea1..00000000000 --- a/reactos/lib/msvcrt/time.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "time/clock.c" -#include "time/difftime.c" -#include "time/strdate.c" -#include "time/strftime.c" -#include "time/strtime.c" -#include "time/time.c" diff --git a/reactos/lib/msvcrt/time/clock.c b/reactos/lib/msvcrt/time/clock.c index 56877d80a25..15c22c5d1e0 100644 --- a/reactos/lib/msvcrt/time/clock.c +++ b/reactos/lib/msvcrt/time/clock.c @@ -7,8 +7,12 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include +#include +#include +#include + +VOID STDCALL GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime ); clock_t clock ( void ) { diff --git a/reactos/lib/msvcrt/time/ctime.c b/reactos/lib/msvcrt/time/ctime.c index f6b1386691f..344301202cf 100644 --- a/reactos/lib/msvcrt/time/ctime.c +++ b/reactos/lib/msvcrt/time/ctime.c @@ -38,11 +38,24 @@ static char sccsid[] = "@(#)ctime.c 5.23 (Berkeley) 6/22/90"; ** POSIX-style TZ environment variable handling from Guy Harris ** (guy@auspex.com). */ -#include -#include "tzfile.h" -#include "posixrul.h" + + +#include +#include +#include +#include +#include +#include + +#include +#include "tzfile.h" + +#include + +#include "posixrul.h" + #define P(s) s #define alloc_size_t size_t #define qsort_size_t size_t @@ -72,7 +85,7 @@ static char sccsid[] = "@(#)ctime.c 5.23 (Berkeley) 6/22/90"; ** that tzname[0] has the "normal" length of three characters). */ int _daylight; -long _timezone; +int _timezone; static char WILDABBR[] = " "; @@ -274,7 +287,7 @@ tzload(const char *name, struct state * const sp) name = fullname; } - if ((fid = _open(name, OPEN_MODE)) == -1) + if ((fid = open(name, OPEN_MODE)) == -1) { const char *base = strrchr(name, '/'); if (base) @@ -290,8 +303,8 @@ tzload(const char *name, struct state * const sp) } else { - i = _read(fid, buf, sizeof buf); - if (_close(fid) != 0 || i < sizeof *tzhp) + i = read(fid, buf, sizeof buf); + if (close(fid) != 0 || i < sizeof *tzhp) return -1; } @@ -999,10 +1012,7 @@ localsub(const time_t * const timep, const long offset, struct tm * const tmp) timesub(&t, ttisp->tt_gmtoff, sp, tmp); tmp->tm_isdst = ttisp->tt_isdst; _tzname[tmp->tm_isdst] = (char *)&sp->chars[ttisp->tt_abbrind]; -#if 0 - // FIXME: tmp->tm_zone does not appear to be in MS headers tmp->tm_zone = (char *)&sp->chars[ttisp->tt_abbrind]; -#endif } struct tm * @@ -1031,8 +1041,6 @@ gmtsub(const time_t * const timep, const long offset, struct tm * const tmp) gmtload(gmtptr); } timesub(timep, offset, gmtptr, tmp); -#if 0 - // FIXME: tmp->tm_zone does not appear to be in MS headers /* ** Could get fancy here and deliver something such as ** "GMT+xxxx" or "GMT-xxxx" if offset is non-zero, @@ -1052,7 +1060,6 @@ gmtsub(const time_t * const timep, const long offset, struct tm * const tmp) tmp->tm_zone = gmtptr->chars; #endif /* State Farm */ } -#endif } struct tm * @@ -1156,10 +1163,7 @@ timesub(const time_t * const timep, const long offset, const struct state * cons days = days - (long) ip[tmp->tm_mon]; tmp->tm_mday = (int) (days + 1); tmp->tm_isdst = 0; -#if 0 - // FIXME: tmp->tm_gmtoff does not appear to be in MS headers tmp->tm_gmtoff = offset; -#endif } /* diff --git a/reactos/lib/msvcrt/time/difftime.c b/reactos/lib/msvcrt/time/difftime.c index 565b56d98fd..87f4005b354 100644 --- a/reactos/lib/msvcrt/time/difftime.c +++ b/reactos/lib/msvcrt/time/difftime.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include double difftime(time_t time1, time_t time0) diff --git a/reactos/lib/msvcrt/time/strdate.c b/reactos/lib/msvcrt/time/strdate.c index aeb6ab7f59a..91ff36c5502 100644 --- a/reactos/lib/msvcrt/time/strdate.c +++ b/reactos/lib/msvcrt/time/strdate.c @@ -7,10 +7,12 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include +#include +#include +#include +#include - -char *_strdate( char *datestr ) +char *_strdate( const char *datestr ) { time_t t; struct tm *d; @@ -27,7 +29,7 @@ char *_strdate( char *datestr ) return dt; } -wchar_t *_wstrdate( wchar_t *datestr ) +wchar_t *_wstrdate( const wchar_t *datestr ) { time_t t; struct tm *d; diff --git a/reactos/lib/msvcrt/time/strftime.c b/reactos/lib/msvcrt/time/strftime.c index d6bf15c0d85..96831ed6e63 100644 --- a/reactos/lib/msvcrt/time/strftime.c +++ b/reactos/lib/msvcrt/time/strftime.c @@ -1,6 +1,8 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include +#include +#include +#include #define TM_YEAR_BASE 1900 @@ -194,10 +196,7 @@ _fmt(const char *format, const struct tm *t) return 0; continue; case 'Z': -#if 0 - // FIXME: t->tm_zone does not appear to be in MS headers if (!t->tm_zone || !_add(t->tm_zone)) -#endif return 0; continue; case '%': diff --git a/reactos/lib/msvcrt/time/strtime.c b/reactos/lib/msvcrt/time/strtime.c index 15e67b832d2..7a64c05cf2f 100644 --- a/reactos/lib/msvcrt/time/strtime.c +++ b/reactos/lib/msvcrt/time/strtime.c @@ -7,8 +7,10 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include - +#include +#include +#include +#include char *_strtime(char* buf) { diff --git a/reactos/lib/msvcrt/time/time.c b/reactos/lib/msvcrt/time/time.c index 42c20f8d996..917ee9a60bb 100644 --- a/reactos/lib/msvcrt/time/time.c +++ b/reactos/lib/msvcrt/time/time.c @@ -14,7 +14,12 @@ * Copyright 1993 Erik Bos * Copyright 1996 Alexandre Julliard */ -#include + +#include +#include +#include + +VOID STDCALL GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime ); time_t time(time_t *t) diff --git a/reactos/lib/msvcrt/wstring.c b/reactos/lib/msvcrt/wstring.c deleted file mode 100755 index 1e8e545de79..00000000000 --- a/reactos/lib/msvcrt/wstring.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "wstring/wcscat.c" -#include "wstring/wcschr.c" -#include "wstring/wcscmp.c" -#include "wstring/wcscoll.c" -#include "wstring/wcscpy.c" -#include "wstring/wcscspn.c" -#include "wstring/wcsdup.c" -#include "wstring/wcsicmp.c" -#include "wstring/wcslen.c" -#include "wstring/wcslwr.c" -#include "wstring/wcsncat.c" -#include "wstring/wcsncmp.c" -#include "wstring/wcsncpy.c" -#include "wstring/wcsnicmp.c" -#include "wstring/wcsnlen.c" -#include "wstring/wcspbrk.c" -#include "wstring/wcsrchr.c" -#include "wstring/wcsrev.c" -#include "wstring/wcsset.c" -#include "wstring/wcsspn.c" -#include "wstring/wcsstr.c" -#include "wstring/wcstok.c" -#include "wstring/wcsupr.c" -#include "wstring/wcsxfrm.c" diff --git a/reactos/lib/msvcrt/wstring/wcscat.c b/reactos/lib/msvcrt/wstring/wcscat.c index 0c16fd16f63..e56161700aa 100644 --- a/reactos/lib/msvcrt/wstring/wcscat.c +++ b/reactos/lib/msvcrt/wstring/wcscat.c @@ -1,6 +1,7 @@ -#include +#include + wchar_t * wcscat(wchar_t * dest,const wchar_t * src) { wchar_t *d = dest; diff --git a/reactos/lib/msvcrt/wstring/wcschr.c b/reactos/lib/msvcrt/wstring/wcschr.c index 42737e93ab8..31ccb1dc80c 100644 --- a/reactos/lib/msvcrt/wstring/wcschr.c +++ b/reactos/lib/msvcrt/wstring/wcschr.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include wchar_t* wcschr(const wchar_t* str, wchar_t ch) { diff --git a/reactos/lib/msvcrt/wstring/wcscmp.c b/reactos/lib/msvcrt/wstring/wcscmp.c index 8cdeae7bceb..4d5a48fb40d 100644 --- a/reactos/lib/msvcrt/wstring/wcscmp.c +++ b/reactos/lib/msvcrt/wstring/wcscmp.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include int wcscmp(const wchar_t* cs,const wchar_t * ct) { diff --git a/reactos/lib/msvcrt/wstring/wcscoll.c b/reactos/lib/msvcrt/wstring/wcscoll.c index 2527276fc8c..21c51c247d7 100644 --- a/reactos/lib/msvcrt/wstring/wcscoll.c +++ b/reactos/lib/msvcrt/wstring/wcscoll.c @@ -1,5 +1,5 @@ -#include +#include int wcscoll(const wchar_t *a1,const wchar_t *a2) { diff --git a/reactos/lib/msvcrt/wstring/wcscpy.c b/reactos/lib/msvcrt/wstring/wcscpy.c index 380e6e39395..e63e91ffd5d 100644 --- a/reactos/lib/msvcrt/wstring/wcscpy.c +++ b/reactos/lib/msvcrt/wstring/wcscpy.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include +#include wchar_t * wcscpy(wchar_t * str1,const wchar_t * str2) { diff --git a/reactos/lib/msvcrt/wstring/wcscspn.c b/reactos/lib/msvcrt/wstring/wcscspn.c index 1cee1cd8ab6..4cccc3367c1 100644 --- a/reactos/lib/msvcrt/wstring/wcscspn.c +++ b/reactos/lib/msvcrt/wstring/wcscspn.c @@ -1,5 +1,4 @@ -#include - +#include size_t wcscspn(const wchar_t *str,const wchar_t *reject) { diff --git a/reactos/lib/msvcrt/wstring/wcsdup.c b/reactos/lib/msvcrt/wstring/wcsdup.c index c5482afc6bb..c3e646adea3 100644 --- a/reactos/lib/msvcrt/wstring/wcsdup.c +++ b/reactos/lib/msvcrt/wstring/wcsdup.c @@ -1,4 +1,6 @@ -#include +#include +#include +#include wchar_t *_wcsdup(const wchar_t *ptr) diff --git a/reactos/lib/msvcrt/wstring/wcsicmp.c b/reactos/lib/msvcrt/wstring/wcsicmp.c index e75f13c4446..4e1f0db751b 100644 --- a/reactos/lib/msvcrt/wstring/wcsicmp.c +++ b/reactos/lib/msvcrt/wstring/wcsicmp.c @@ -1,5 +1,7 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include + +#include +#include int _wcsicmp(const wchar_t* cs,const wchar_t * ct) diff --git a/reactos/lib/msvcrt/wstring/wcslen.c b/reactos/lib/msvcrt/wstring/wcslen.c index 12370fc82a6..7829d2fca9b 100644 --- a/reactos/lib/msvcrt/wstring/wcslen.c +++ b/reactos/lib/msvcrt/wstring/wcslen.c @@ -1,5 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include + +#include size_t wcslen(const wchar_t * s) diff --git a/reactos/lib/msvcrt/wstring/wcslwr.c b/reactos/lib/msvcrt/wstring/wcslwr.c index ec77e140807..8980b83ee98 100644 --- a/reactos/lib/msvcrt/wstring/wcslwr.c +++ b/reactos/lib/msvcrt/wstring/wcslwr.c @@ -7,8 +7,8 @@ * Copyright 1996 Jukka Iivonen * Copyright 1997 Uwe Bonnes */ -#include +#include wchar_t * _wcslwr(wchar_t *x) { diff --git a/reactos/lib/msvcrt/wstring/wcsncat.c b/reactos/lib/msvcrt/wstring/wcsncat.c index cc177cd631e..bca5052d65a 100644 --- a/reactos/lib/msvcrt/wstring/wcsncat.c +++ b/reactos/lib/msvcrt/wstring/wcsncat.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include - +#include wchar_t *wcsncat(wchar_t *dst, const wchar_t *src, size_t n) { diff --git a/reactos/lib/msvcrt/wstring/wcsncmp.c b/reactos/lib/msvcrt/wstring/wcsncmp.c index 21194832fb4..e661043f2f9 100644 --- a/reactos/lib/msvcrt/wstring/wcsncmp.c +++ b/reactos/lib/msvcrt/wstring/wcsncmp.c @@ -1,5 +1,4 @@ -#include - +#include int wcsncmp(const wchar_t * cs,const wchar_t * ct,size_t count) { diff --git a/reactos/lib/msvcrt/wstring/wcsncpy.c b/reactos/lib/msvcrt/wstring/wcsncpy.c index 1457be0b8ee..07d0000e898 100644 --- a/reactos/lib/msvcrt/wstring/wcsncpy.c +++ b/reactos/lib/msvcrt/wstring/wcsncpy.c @@ -1,5 +1,4 @@ -#include - +#include wchar_t * wcsncpy(wchar_t * dest,const wchar_t *src,size_t count) { diff --git a/reactos/lib/msvcrt/wstring/wcsnicmp.c b/reactos/lib/msvcrt/wstring/wcsnicmp.c index 157fa721924..ef917c32b93 100644 --- a/reactos/lib/msvcrt/wstring/wcsnicmp.c +++ b/reactos/lib/msvcrt/wstring/wcsnicmp.c @@ -1,5 +1,4 @@ -#include - +#include int _wcsnicmp (const wchar_t *cs, const wchar_t *ct, size_t count) { diff --git a/reactos/lib/msvcrt/wstring/wcsnlen.c b/reactos/lib/msvcrt/wstring/wcsnlen.c index 330a5b6dd2a..aa3e330ed45 100644 --- a/reactos/lib/msvcrt/wstring/wcsnlen.c +++ b/reactos/lib/msvcrt/wstring/wcsnlen.c @@ -1,5 +1,4 @@ -#include - +#include size_t _wcsnlen(const wchar_t * s, size_t count) { diff --git a/reactos/lib/msvcrt/wstring/wcspbrk.c b/reactos/lib/msvcrt/wstring/wcspbrk.c index bc69f4a7bb2..7ab4b91d214 100644 --- a/reactos/lib/msvcrt/wstring/wcspbrk.c +++ b/reactos/lib/msvcrt/wstring/wcspbrk.c @@ -1,5 +1,4 @@ -#include - +#include wchar_t *wcspbrk(const wchar_t *s1, const wchar_t *s2) { @@ -14,4 +13,4 @@ wchar_t *wcspbrk(const wchar_t *s1, const wchar_t *s2) } } return 0; -} +} \ No newline at end of file diff --git a/reactos/lib/msvcrt/wstring/wcsrchr.c b/reactos/lib/msvcrt/wstring/wcsrchr.c index 6ea367ddeaf..19d9d9a9297 100644 --- a/reactos/lib/msvcrt/wstring/wcsrchr.c +++ b/reactos/lib/msvcrt/wstring/wcsrchr.c @@ -1,5 +1,4 @@ -#include - +#include wchar_t* wcsrchr(const wchar_t* str, wchar_t ch) { diff --git a/reactos/lib/msvcrt/wstring/wcsrev.c b/reactos/lib/msvcrt/wstring/wcsrev.c index 648fe653f58..cafd759193f 100644 --- a/reactos/lib/msvcrt/wstring/wcsrev.c +++ b/reactos/lib/msvcrt/wstring/wcsrev.c @@ -1,5 +1,4 @@ -#include - +#include wchar_t * _wcsrev(wchar_t *s) { diff --git a/reactos/lib/msvcrt/wstring/wcsset.c b/reactos/lib/msvcrt/wstring/wcsset.c index c4128fcffb4..0f0e673414d 100644 --- a/reactos/lib/msvcrt/wstring/wcsset.c +++ b/reactos/lib/msvcrt/wstring/wcsset.c @@ -1,5 +1,4 @@ -#include - +#include wchar_t* _wcsnset (wchar_t* wsToFill, wchar_t wcFill, size_t sizeMaxFill) { diff --git a/reactos/lib/msvcrt/wstring/wcsspn.c b/reactos/lib/msvcrt/wstring/wcsspn.c index 8b539ad1f84..d3d32c604f6 100644 --- a/reactos/lib/msvcrt/wstring/wcsspn.c +++ b/reactos/lib/msvcrt/wstring/wcsspn.c @@ -1,5 +1,4 @@ -#include - +#include size_t wcsspn(const wchar_t *str,const wchar_t *accept) { diff --git a/reactos/lib/msvcrt/wstring/wcsstr.c b/reactos/lib/msvcrt/wstring/wcsstr.c index fcf60844630..c061a176167 100644 --- a/reactos/lib/msvcrt/wstring/wcsstr.c +++ b/reactos/lib/msvcrt/wstring/wcsstr.c @@ -1,5 +1,4 @@ -#include - +#include wchar_t *wcsstr(const wchar_t *s,const wchar_t *b) { diff --git a/reactos/lib/msvcrt/wstring/wcstok.c b/reactos/lib/msvcrt/wstring/wcstok.c index 9d4e6b33826..ee8c40a5deb 100644 --- a/reactos/lib/msvcrt/wstring/wcstok.c +++ b/reactos/lib/msvcrt/wstring/wcstok.c @@ -1,5 +1,5 @@ -#include - +#include +#include wchar_t *wcstok(wchar_t *s, const wchar_t *ct) { diff --git a/reactos/lib/msvcrt/wstring/wcsupr.c b/reactos/lib/msvcrt/wstring/wcsupr.c index a40bfa0271f..27db416ba42 100644 --- a/reactos/lib/msvcrt/wstring/wcsupr.c +++ b/reactos/lib/msvcrt/wstring/wcsupr.c @@ -1,5 +1,4 @@ -#include - +#include wchar_t *_wcsupr(wchar_t *x) { diff --git a/reactos/lib/msvcrt/wstring/wcsxfrm.c b/reactos/lib/msvcrt/wstring/wcsxfrm.c index 765cf1628df..60a5babde96 100644 --- a/reactos/lib/msvcrt/wstring/wcsxfrm.c +++ b/reactos/lib/msvcrt/wstring/wcsxfrm.c @@ -1,5 +1,4 @@ -#include - +#include size_t wcsxfrm(wchar_t *dst,const wchar_t *src, size_t n) { diff --git a/reactos/lib/ntdll/csr/capture.c b/reactos/lib/ntdll/csr/capture.c index db0697342aa..18012d6e5c0 100644 --- a/reactos/lib/ntdll/csr/capture.c +++ b/reactos/lib/ntdll/csr/capture.c @@ -1,4 +1,4 @@ -/* $Id: capture.c,v 1.4 2002/09/07 15:12:38 chorns Exp $ +/* $Id: capture.c,v 1.5 2002/09/08 10:23:02 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -8,13 +8,14 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include #include + #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/lib/ntdll/csr/lpc.c b/reactos/lib/ntdll/csr/lpc.c index 85a25b40cbd..4202bb73c74 100644 --- a/reactos/lib/ntdll/csr/lpc.c +++ b/reactos/lib/ntdll/csr/lpc.c @@ -1,4 +1,4 @@ -/* $Id: lpc.c,v 1.7 2002/09/07 15:12:38 chorns Exp $ +/* $Id: lpc.c,v 1.8 2002/09/08 10:23:02 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,13 +13,14 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include #include + #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ @@ -96,7 +97,7 @@ CsrClientCallServer(PCSRSS_API_REQUEST Request, return (STATUS_UNSUCCESSFUL); } - Request->Header.DataSize = Length - sizeof(LPC_MESSAGE); + Request->Header.DataSize = Length - sizeof(LPC_MESSAGE_HEADER); Request->Header.MessageSize = Length; Status = NtRequestWaitReplyPort(WindowsApiPort, diff --git a/reactos/lib/ntdll/csr/probe.c b/reactos/lib/ntdll/csr/probe.c index fbf496d2b87..c03969b3089 100644 --- a/reactos/lib/ntdll/csr/probe.c +++ b/reactos/lib/ntdll/csr/probe.c @@ -1,4 +1,4 @@ -/* $Id: probe.c,v 1.2 2002/09/07 15:12:38 chorns Exp $ +/* $Id: probe.c,v 1.3 2002/09/08 10:23:02 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -7,13 +7,11 @@ * AUTHOR: Eric Kohl * DATE: 2001-06-17 */ - -#define NTOS_USER_MODE +#define NTOS_MODE_USER #include #define NDEBUG -#include - +#include VOID STDCALL CsrProbeForRead(IN CONST PVOID Address, diff --git a/reactos/lib/ntdll/csr/thread.c b/reactos/lib/ntdll/csr/thread.c index 08008c768fb..c8761785072 100644 --- a/reactos/lib/ntdll/csr/thread.c +++ b/reactos/lib/ntdll/csr/thread.c @@ -1,19 +1,20 @@ -/* $Id: thread.c,v 1.2 2002/09/07 15:12:38 chorns Exp $ +/* $Id: thread.c,v 1.3 2002/09/08 10:23:02 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: lib/ntdll/csr/propvar.c * PURPOSE: CSRSS threads API */ - -#define NTOS_USER_MODE +#define NTOS_MODE_USER #include + +#include #include + #include #define NDEBUG -#include - +#include NTSTATUS STDCALL CsrNewThread(VOID) diff --git a/reactos/lib/ntdll/dbg/brkpoint.c b/reactos/lib/ntdll/dbg/brkpoint.c index 83675aab38c..1c142dde0ac 100644 --- a/reactos/lib/ntdll/dbg/brkpoint.c +++ b/reactos/lib/ntdll/dbg/brkpoint.c @@ -1,4 +1,4 @@ -/* $Id: brkpoint.c,v 1.3 2002/09/07 15:12:39 chorns Exp $ +/* $Id: brkpoint.c,v 1.4 2002/09/08 10:23:03 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,8 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include -#define NDEBUG -#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/ntdll/dbg/debug.c b/reactos/lib/ntdll/dbg/debug.c index abe495ab33b..4cb8ec399f1 100644 --- a/reactos/lib/ntdll/dbg/debug.c +++ b/reactos/lib/ntdll/dbg/debug.c @@ -1,4 +1,4 @@ -/* $Id: debug.c,v 1.5 2002/09/07 15:12:39 chorns Exp $ +/* $Id: debug.c,v 1.6 2002/09/08 10:23:03 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,10 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include - -#define NDEBUG -#include +#include +#include +#include +#include /* FUNCTIONS *****************************************************************/ @@ -25,7 +24,7 @@ static HANDLE DbgSsReplyPort = NULL; typedef struct _LPC_DBGSS_MESSAGE { - LPC_MESSAGE Header; + LPC_MESSAGE_HEADER Header; ULONG Unknown1; ULONG Unknown2; ULONG Unknown3; diff --git a/reactos/lib/ntdll/dbg/print.c b/reactos/lib/ntdll/dbg/print.c index c5d18c881cc..f93e7eb4afc 100644 --- a/reactos/lib/ntdll/dbg/print.c +++ b/reactos/lib/ntdll/dbg/print.c @@ -1,4 +1,4 @@ -/* $Id: print.c,v 1.5 2002/09/07 15:12:39 chorns Exp $ +/* $Id: print.c,v 1.6 2002/09/08 10:23:03 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,16 +9,11 @@ * Created 28/12/1999 */ -/* INCLUDES ***************************************************************/ - -#define NTOS_USER_MODE -#include +#include #include #include #include -#define NDEBUG -#include /* FUNCTIONS ***************************************************************/ diff --git a/reactos/lib/ntdll/dbg/winedbg.c b/reactos/lib/ntdll/dbg/winedbg.c index 818fa2e9eed..c18c6d60a7b 100644 --- a/reactos/lib/ntdll/dbg/winedbg.c +++ b/reactos/lib/ntdll/dbg/winedbg.c @@ -1,8 +1,7 @@ /* * Debugging functions for WINE */ -#define NTOS_USER_MODE -#include +#include #include DECLARE_DEBUG_CHANNEL(tid); diff --git a/reactos/lib/ntdll/def/ntdll.def b/reactos/lib/ntdll/def/ntdll.def index 98c87b283f0..3b006fceee9 100644 --- a/reactos/lib/ntdll/def/ntdll.def +++ b/reactos/lib/ntdll/def/ntdll.def @@ -1,4 +1,4 @@ -; $Id: ntdll.def,v 1.89 2002/09/07 15:12:39 chorns Exp $ +; $Id: ntdll.def,v 1.90 2002/09/08 10:23:03 chorns Exp $ ; ; ReactOS Operating System ; @@ -57,13 +57,13 @@ NlsMbOemCodePageTag DATA NtAcceptConnectPort@24 NtAccessCheck@32 NtAccessCheckAndAuditAlarm@44 -NtAddAtom@12 +NtAddAtom@8 NtAdjustGroupsToken@24 NtAdjustPrivilegesToken@24 NtAlertResumeThread@8 NtAlertThread@4 NtAllocateLocallyUniqueId@4 -NtAllocateUuids@16 +NtAllocateUuids@12 NtAllocateVirtualMemory@24 NtCallbackReturn@12 NtCancelIoFile@8 @@ -108,7 +108,7 @@ NtDuplicateToken@24 NtEnumerateKey@24 NtEnumerateValueKey@24 NtExtendSection@8 -NtFindAtom@12 +NtFindAtom@8 NtFlushBuffersFile@8 NtFlushInstructionCache@12 NtFlushKey@4 @@ -333,7 +333,7 @@ RtlCreateAcl@12 RtlCreateAtomTable@8 RtlCreateEnvironment@8 RtlCreateHeap@24 -RtlRosCreateProcessParameters@40 +RtlCreateProcessParameters@40 ;RtlCreatePropertySet ;RtlCreateQueryDebugBuffer RtlCreateRegistryKey@8 @@ -341,12 +341,12 @@ RtlCreateSecurityDescriptor@8 ;RtlCreateTagHeap RtlCreateUnicodeString@8 RtlCreateUnicodeStringFromAsciiz@8 -RtlRosCreateUserProcess@40 +RtlCreateUserProcess@40 ;RtlCreateUserSecurityObject RtlCreateUserThread@40 RtlCustomCPToUnicodeN@24 ;RtlCutoverTimeToSystemTime -RtlRosDeNormalizeProcessParams@4 +RtlDeNormalizeProcessParams@4 RtlDecompressBuffer@24 RtlDecompressFragment@32 ;RtlDelete @@ -362,7 +362,7 @@ RtlDestroyAtomTable@4 RtlDestroyEnvironment@4 RtlDestroyHandleTable@4 RtlDestroyHeap@4 -RtlRosDestroyProcessParameters@4 +RtlDestroyProcessParameters@4 ;RtlDestroyQueryDebugBuffer RtlDetermineDosPathNameType_U@4 RtlDoesFileExists_U@4 @@ -483,7 +483,7 @@ RtlMultiByteToUnicodeSize@12 ;RtlNewInstanceSecurityObject ;RtlNewSecurityGrantedAccess ;RtlNewSecurityObject -RtlRosNormalizeProcessParams@4 +RtlNormalizeProcessParams@4 RtlNtStatusToDosError@4 RtlNtStatusToPsxErrno@4 ;RtlNumberGenericTableElements @@ -610,13 +610,13 @@ RtlxUnicodeStringToOemSize@4 ZwAcceptConnectPort@24 ZwAccessCheck@32 ZwAccessCheckAndAuditAlarm@44 -ZwAddAtom@12 +ZwAddAtom@8 ZwAdjustGroupsToken@24 ZwAdjustPrivilegesToken@24 ZwAlertResumeThread@8 ZwAlertThread@4 ZwAllocateLocallyUniqueId@4 -ZwAllocateUuids@16 +ZwAllocateUuids@12 ZwAllocateVirtualMemory@24 ZwCallbackReturn@12 ZwCancelIoFile@8 @@ -660,7 +660,7 @@ ZwDuplicateToken@24 ZwEnumerateKey@24 ZwEnumerateValueKey@24 ZwExtendSection@8 -ZwFindAtom@12 +ZwFindAtom@8 ZwFlushBuffersFile@8 ZwFlushInstructionCache@12 ZwFlushKey@4 @@ -945,4 +945,4 @@ InterlockedIncrement@4 InterlockedDecrement@4 InterlockedExchange@8 InterlockedCompareExchange@12 -InterlockedExchangeAdd@8 \ No newline at end of file +;EOF diff --git a/reactos/lib/ntdll/def/ntdll.edf b/reactos/lib/ntdll/def/ntdll.edf index d9ef78f2d33..e1d4742bf73 100644 --- a/reactos/lib/ntdll/def/ntdll.edf +++ b/reactos/lib/ntdll/def/ntdll.edf @@ -1,4 +1,4 @@ -; $Id: ntdll.edf,v 1.78 2002/09/07 15:12:39 chorns Exp $ +; $Id: ntdll.edf,v 1.79 2002/09/08 10:23:03 chorns Exp $ ; ; ReactOS Operating System ; @@ -57,13 +57,13 @@ NlsMbOemCodePageTag DATA NtAcceptConnectPort=NtAcceptConnectPort@24 NtAccessCheck=NtAccessCheck@32 NtAccessCheckAndAuditAlarm=NtAccessCheckAndAuditAlarm@44 -NtAddAtom=NtAddAtom@12 +NtAddAtom=NtAddAtom@8 NtAdjustGroupsToken=NtAdjustGroupsToken@24 NtAdjustPrivilegesToken=NtAdjustPrivilegesToken@24 NtAlertResumeThread=NtAlertResumeThread@8 NtAlertThread=NtAlertThread@4 NtAllocateLocallyUniqueId=NtAllocateLocallyUniqueId@4 -NtAllocateUuids=NtAllocateUuids@16 +NtAllocateUuids=NtAllocateUuids@12 NtAllocateVirtualMemory=NtAllocateVirtualMemory@24 NtCallbackReturn=NtCallbackReturn@12 NtCancelIoFile=NtCancelIoFile@8 @@ -108,7 +108,7 @@ NtDuplicateToken=NtDuplicateToken@24 NtEnumerateKey=NtEnumerateKey@24 NtEnumerateValueKey=NtEnumerateValueKey@24 NtExtendSection=NtExtendSection@8 -NtFindAtom=NtFindAtom@12 +NtFindAtom=NtFindAtom@8 NtFlushBuffersFile=NtFlushBuffersFile@8 NtFlushInstructionCache=NtFlushInstructionCache@12 NtFlushKey=NtFlushKey@4 @@ -333,7 +333,7 @@ RtlCreateAcl=RtlCreateAcl@12 RtlCreateAtomTable=RtlCreateAtomTable@8 RtlCreateEnvironment=RtlCreateEnvironment@8 RtlCreateHeap=RtlCreateHeap@24 -RtlRosCreateProcessParameters=RtlRosCreateProcessParameters@40 +RtlCreateProcessParameters=RtlCreateProcessParameters@40 ;RtlCreatePropertySet ;RtlCreateQueryDebugBuffer RtlCreateRegistryKey=RtlCreateRegistryKey@8 @@ -341,12 +341,12 @@ RtlCreateSecurityDescriptor=RtlCreateSecurityDescriptor@8 ;RtlCreateTagHeap RtlCreateUnicodeString=RtlCreateUnicodeString@8 RtlCreateUnicodeStringFromAsciiz=RtlCreateUnicodeStringFromAsciiz@8 -RtlRosCreateUserProcess=RtlRosCreateUserProcess@40 +RtlCreateUserProcess=RtlCreateUserProcess@40 ;RtlCreateUserSecurityObject RtlCreateUserThread=RtlCreateUserThread@40 RtlCustomCPToUnicodeN=RtlCustomCPToUnicodeN@24 ;RtlCutoverTimeToSystemTime -RtlRosDeNormalizeProcessParams=RtlRosDeNormalizeProcessParams@4 +RtlDeNormalizeProcessParams=RtlDeNormalizeProcessParams@4 RtlDecompressBuffer=RtlDecompressBuffer@24 RtlDecompressFragment=RtlDecompressFragment@32 ;RtlDelete @@ -362,7 +362,7 @@ RtlDestroyAtomTable=RtlDestroyAtomTable@4 RtlDestroyEnvironment=RtlDestroyEnvironment@4 RtlDestroyHandleTable=RtlDestroyHandleTable@4 RtlDestroyHeap=RtlDestroyHeap@4 -RtlRosDestroyProcessParameters=RtlRosDestroyProcessParameters@4 +RtlDestroyProcessParameters=RtlDestroyProcessParameters@4 ;RtlDestroyQueryDebugBuffer RtlDetermineDosPathNameType_U=RtlDetermineDosPathNameType_U@4 RtlDoesFileExists_U=RtlDoesFileExists_U@4 @@ -482,7 +482,7 @@ RtlMultiByteToUnicodeSize=RtlMultiByteToUnicodeSize@12 ;RtlNewInstanceSecurityObject ;RtlNewSecurityGrantedAccess ;RtlNewSecurityObject -RtlRosNormalizeProcessParams=RtlRosNormalizeProcessParams@4 +RtlNormalizeProcessParams=RtlNormalizeProcessParams@4 RtlNtStatusToDosError=RtlNtStatusToDosError@4 RtlNtStatusToPsxErrno=RtlNtStatusToPsxErrno@4 ;RtlNumberGenericTableElements @@ -609,13 +609,13 @@ RtlxUnicodeStringToOemSize=RtlxUnicodeStringToOemSize@4 ZwAcceptConnectPort=ZwAcceptConnectPort@24 ZwAccessCheck=ZwAccessCheck@32 ZwAccessCheckAndAuditAlarm=ZwAccessCheckAndAuditAlarm@44 -ZwAddAtom=ZwAddAtom@12 +ZwAddAtom=ZwAddAtom@8 ZwAdjustGroupsToken=ZwAdjustGroupsToken@24 ZwAdjustPrivilegesToken=ZwAdjustPrivilegesToken@24 ZwAlertResumeThread=ZwAlertResumeThread@8 ZwAlertThread=ZwAlertThread@4 ZwAllocateLocallyUniqueId=ZwAllocateLocallyUniqueId@4 -ZwAllocateUuids=ZwAllocateUuids@16 +ZwAllocateUuids=ZwAllocateUuids@12 ZwAllocateVirtualMemory=ZwAllocateVirtualMemory@24 ZwCallbackReturn=ZwCallbackReturn@12 ZwCancelIoFile=ZwCancelIoFile@8 @@ -659,7 +659,7 @@ ZwDuplicateToken=ZwDuplicateToken@24 ZwEnumerateKey=ZwEnumerateKey@24 ZwEnumerateValueKey=ZwEnumerateValueKey@24 ZwExtendSection=ZwExtendSection@8 -ZwFindAtom=ZwFindAtom@12 +ZwFindAtom=ZwFindAtom@8 ZwFlushBuffersFile=ZwFlushBuffersFile@8 ZwFlushInstructionCache=ZwFlushInstructionCache@12 ZwFlushKey=ZwFlushKey@4 @@ -944,8 +944,4 @@ wine_dbgstr_guid wine_dbg_vprintf wine_dbg_printf wine_dbg_log -InterlockedIncrement@4 -InterlockedDecrement@4 -InterlockedExchange@8 -InterlockedCompareExchange@12 -InterlockedExchangeAdd@8 \ No newline at end of file +;EOF diff --git a/reactos/lib/ntdll/def/ntdll.rc b/reactos/lib/ntdll/def/ntdll.rc index ccbced7eba8..3d18969b7a3 100644 --- a/reactos/lib/ntdll/def/ntdll.rc +++ b/reactos/lib/ntdll/def/ntdll.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/ntdll/ldr/startup.c b/reactos/lib/ntdll/ldr/startup.c index 3d33d63f15c..b7da2c539a4 100644 --- a/reactos/lib/ntdll/ldr/startup.c +++ b/reactos/lib/ntdll/ldr/startup.c @@ -1,4 +1,4 @@ -/* $Id: startup.c,v 1.43 2002/09/07 15:12:39 chorns Exp $ +/* $Id: startup.c,v 1.44 2002/09/08 10:23:03 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -10,24 +10,28 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include -#include #include +#include +#include +#include +#include #include +#include #include #define NDEBUG -#include +#include -/* GLOBALS *******************************************************************/ VOID RtlInitializeHeapManager (VOID); +/* GLOBALS *******************************************************************/ + + extern unsigned int _image_base__; -static RTL_CRITICAL_SECTION PebLock; -static RTL_CRITICAL_SECTION LoaderLock; +static CRITICAL_SECTION PebLock; +static CRITICAL_SECTION LoaderLock; static RTL_BITMAP TlsBitMap; ULONG NtGlobalFlag = 0; @@ -102,7 +106,7 @@ LdrInitializeThunk (ULONG Unknown1, } /* normalize process parameters */ - RtlRosNormalizeProcessParams (Peb->ProcessParameters); + RtlNormalizeProcessParams (Peb->ProcessParameters); #if 0 /* initialize NLS data */ diff --git a/reactos/lib/ntdll/ldr/utils.c b/reactos/lib/ntdll/ldr/utils.c index 89b5f2372f7..171a058f69c 100644 --- a/reactos/lib/ntdll/ldr/utils.c +++ b/reactos/lib/ntdll/ldr/utils.c @@ -1,4 +1,4 @@ -/* $Id: utils.c,v 1.55 2002/09/07 15:12:39 chorns Exp $ +/* $Id: utils.c,v 1.56 2002/09/08 10:23:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -17,18 +17,19 @@ /* INCLUDES *****************************************************************/ -#include -#define NTOS_USER_MODE -#include -#include #include +#include +#include #include #include +#include +#include + #ifdef DBG_NTDLL_LDR_UTILS #define NDEBUG #endif -#include +#include /* PROTOTYPES ****************************************************************/ @@ -892,7 +893,7 @@ static NTSTATUS LdrPerformRelocations (PIMAGE_NT_HEADERS NTHeaders, Status = NtProtectVirtualMemory(NtCurrentProcess(), ImageBase + RelocationDir->VirtualAddress, - PAGE_SIZE, + PAGESIZE, PAGE_READWRITE, &OldProtect); if (!NT_SUCCESS(Status)) @@ -944,7 +945,7 @@ static NTSTATUS LdrPerformRelocations (PIMAGE_NT_HEADERS NTHeaders, Status = NtProtectVirtualMemory(NtCurrentProcess(), ImageBase + RelocationDir->VirtualAddress, - PAGE_SIZE, + PAGESIZE, OldProtect, &OldProtect); if (!NT_SUCCESS(Status)) diff --git a/reactos/lib/ntdll/main/dllmain.c b/reactos/lib/ntdll/main/dllmain.c index 6594e1cabf0..b0e1bbc58ac 100644 --- a/reactos/lib/ntdll/main/dllmain.c +++ b/reactos/lib/ntdll/main/dllmain.c @@ -1,4 +1,4 @@ -/* $Id: dllmain.c,v 1.9 2002/09/07 15:12:39 chorns Exp $ +/* $Id: dllmain.c,v 1.10 2002/09/08 10:23:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -7,14 +7,11 @@ * PROGRAMMER: */ -#include -#define NTOS_USER_MODE -#include +#include #include #include - -#define NDEBUG -#include +#include +#include BOOL WINAPI DllMainCRTStartup(HINSTANCE hinstDll, DWORD fdwReason, diff --git a/reactos/lib/ntdll/makefile b/reactos/lib/ntdll/makefile index e453dd1c675..245bab0e7dc 100644 --- a/reactos/lib/ntdll/makefile +++ b/reactos/lib/ntdll/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.73 2002/09/07 15:12:38 chorns Exp $ +# $Id: makefile,v 1.74 2002/09/08 10:23:02 chorns Exp $ PATH_TO_TOP = ../.. @@ -6,7 +6,7 @@ TARGET_TYPE = dynlink TARGET_NAME = ntdll -TARGET_CFLAGS = -g -D__NTDLL__ -DNTOSAPI= +TARGET_CFLAGS = -g -D__NTDLL__ TARGET_LFLAGS = -Wl,--file-alignment,0x1000 \ -Wl,--section-alignment,0x1000 \ @@ -14,7 +14,7 @@ TARGET_LFLAGS = -Wl,--file-alignment,0x1000 \ TARGET_GCCLIBS = gcc -TARGET_BASE = 0x78800000 +TARGET_BASE = 0x77f60000 TARGET_PATH = def diff --git a/reactos/lib/ntdll/rtl/access.c b/reactos/lib/ntdll/rtl/access.c index 03b00d2c7d5..0c2526112c8 100644 --- a/reactos/lib/ntdll/rtl/access.c +++ b/reactos/lib/ntdll/rtl/access.c @@ -1,4 +1,4 @@ -/* $Id: access.c,v 1.2 2002/09/07 15:12:40 chorns Exp $ +/* $Id: access.c,v 1.3 2002/09/08 10:23:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,9 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include -#define NDEBUG -#include +#include /* FUNCTIONS ***************************************************************/ diff --git a/reactos/lib/ntdll/rtl/acl.c b/reactos/lib/ntdll/rtl/acl.c index 3904aeccf2a..77a5c2afdca 100644 --- a/reactos/lib/ntdll/rtl/acl.c +++ b/reactos/lib/ntdll/rtl/acl.c @@ -1,4 +1,4 @@ -/* $Id: acl.c,v 1.7 2002/09/07 15:12:40 chorns Exp $ +/* $Id: acl.c,v 1.8 2002/09/08 10:23:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,9 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include -#define NDEBUG -#include +#include /* FUNCTIONS ***************************************************************/ @@ -108,7 +106,7 @@ RtlpAddKnownAce(PACL Acl, PSID Sid, ULONG Type) { - PROS_ACE Ace; + PACE Ace; if (!RtlValidSid(Sid)) { @@ -123,7 +121,7 @@ RtlpAddKnownAce(PACL Acl, { Revision = Acl->AclRevision; } - if (!RtlFirstFreeAce(Acl, (PACE*)&Ace)) + if (!RtlFirstFreeAce(Acl, &Ace)) { return(STATUS_INVALID_ACL); } @@ -131,14 +129,14 @@ RtlpAddKnownAce(PACL Acl, { return(STATUS_ALLOTTED_SPACE_EXCEEDED); } - if (((PVOID)Ace + RtlLengthSid(Sid) + sizeof(ROS_ACE)) >= + if (((PVOID)Ace + RtlLengthSid(Sid) + sizeof(ACE)) >= ((PVOID)Acl + Acl->AclSize)) { return(STATUS_ALLOTTED_SPACE_EXCEEDED); } Ace->Header.AceFlags = 0; Ace->Header.AceType = Type; - Ace->Header.AceSize = RtlLengthSid(Sid) + sizeof(ROS_ACE); + Ace->Header.AceSize = RtlLengthSid(Sid) + sizeof(ACE); Ace->Header.AccessMask = AccessMask; RtlCopySid(RtlLengthSid(Sid), (PSID)(Ace + 1), Sid); Acl->AceCount++; @@ -275,7 +273,7 @@ RtlAddAuditAccessAce(PACL Acl, BOOLEAN Success, BOOLEAN Failure) { - PROS_ACE Ace; + PACE Ace; ULONG Flags = 0; if (Success != FALSE) @@ -304,7 +302,7 @@ RtlAddAuditAccessAce(PACL Acl, Revision = Acl->AclRevision; } - if (!RtlFirstFreeAce(Acl, (PACE*)&Ace)) + if (!RtlFirstFreeAce(Acl, &Ace)) { return(STATUS_INVALID_ACL); } diff --git a/reactos/lib/ntdll/rtl/apc.c b/reactos/lib/ntdll/rtl/apc.c index 02afa491070..45a1b6cc5c7 100644 --- a/reactos/lib/ntdll/rtl/apc.c +++ b/reactos/lib/ntdll/rtl/apc.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: apc.c,v 1.6 2002/09/07 15:12:40 chorns Exp $ +/* $Id: apc.c,v 1.7 2002/09/08 10:23:04 chorns Exp $ * * PROJECT: ReactOS kernel * PURPOSE: User-mode APC support @@ -26,13 +26,9 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include #include -#define NDEBUG -#include - /* FUNCTIONS ***************************************************************/ VOID STDCALL diff --git a/reactos/lib/ntdll/rtl/atom.c b/reactos/lib/ntdll/rtl/atom.c index 3165a6525b8..acf65cf0b93 100644 --- a/reactos/lib/ntdll/rtl/atom.c +++ b/reactos/lib/ntdll/rtl/atom.c @@ -1,4 +1,4 @@ -/* $Id: atom.c,v 1.3 2002/09/07 15:12:40 chorns Exp $ +/* $Id: atom.c,v 1.4 2002/09/08 10:23:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,13 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include +#include #define NDEBUG -#include +#include + /* LOCAL TYPES ***************************************************************/ @@ -625,11 +627,11 @@ RtlpInitAtomTableLock(PRTL_ATOM_TABLE AtomTable) { AtomTable->Lock = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(RTL_CRITICAL_SECTION)); + sizeof(CRITICAL_SECTION)); if (AtomTable->Lock == NULL) return STATUS_NO_MEMORY; - RtlInitializeCriticalSection((PRTL_CRITICAL_SECTION)AtomTable->Lock); + RtlInitializeCriticalSection((PCRITICAL_SECTION)AtomTable->Lock); return STATUS_SUCCESS; } @@ -640,7 +642,7 @@ RtlpDestroyAtomTableLock(PRTL_ATOM_TABLE AtomTable) { if (AtomTable->Lock) { - RtlDeleteCriticalSection((PRTL_CRITICAL_SECTION)AtomTable->Lock); + RtlDeleteCriticalSection((PCRITICAL_SECTION)AtomTable->Lock); RtlFreeHeap(RtlGetProcessHeap(), 0, AtomTable->Lock); @@ -652,7 +654,7 @@ RtlpDestroyAtomTableLock(PRTL_ATOM_TABLE AtomTable) static BOOLEAN RtlpLockAtomTable(PRTL_ATOM_TABLE AtomTable) { - RtlEnterCriticalSection((PRTL_CRITICAL_SECTION)AtomTable->Lock); + RtlEnterCriticalSection((PCRITICAL_SECTION)AtomTable->Lock); return TRUE; } @@ -660,7 +662,7 @@ RtlpLockAtomTable(PRTL_ATOM_TABLE AtomTable) static VOID RtlpUnlockAtomTable(PRTL_ATOM_TABLE AtomTable) { - RtlLeaveCriticalSection((PRTL_CRITICAL_SECTION)AtomTable->Lock); + RtlLeaveCriticalSection((PCRITICAL_SECTION)AtomTable->Lock); } diff --git a/reactos/lib/ntdll/rtl/bitmap.c b/reactos/lib/ntdll/rtl/bitmap.c index 0885c10772d..500605bb8c1 100644 --- a/reactos/lib/ntdll/rtl/bitmap.c +++ b/reactos/lib/ntdll/rtl/bitmap.c @@ -1,4 +1,4 @@ -/* $Id: bitmap.c,v 1.3 2002/09/07 15:12:40 chorns Exp $ +/* $Id: bitmap.c,v 1.4 2002/09/08 10:23:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -8,11 +8,11 @@ * 20/08/99 Created by Eric Kohl */ -#define NTOS_USER_MODE -#include +#include + #define NDEBUG -#include +#include #define ALIGN(x,align) (((x)+(align)-1) / (align)) diff --git a/reactos/lib/ntdll/rtl/callback.c b/reactos/lib/ntdll/rtl/callback.c index 201d1331255..81c569bc51d 100644 --- a/reactos/lib/ntdll/rtl/callback.c +++ b/reactos/lib/ntdll/rtl/callback.c @@ -1,4 +1,4 @@ -/* $Id: callback.c,v 1.6 2002/09/07 15:12:40 chorns Exp $ +/* $Id: callback.c,v 1.7 2002/09/08 10:23:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,16 +9,14 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include #include +#include -#define NDEBUG -#include /* TYPES *********************************************************************/ -typedef NTSTATUS STDCALL (*USER_CALLBACK_FUNCTION)(PVOID Argument, +typedef NTSTATUS STDCALL (*CALLBACK_FUNCTION)(PVOID Argument, ULONG ArgumentLength); /* FUNCTIONS *****************************************************************/ @@ -30,10 +28,10 @@ KiUserCallbackDispatcher(ULONG RoutineIndex, { PPEB Peb; NTSTATUS Status; - USER_CALLBACK_FUNCTION Callback; + CALLBACK_FUNCTION Callback; Peb = NtCurrentPeb(); - Callback = (USER_CALLBACK_FUNCTION)Peb->KernelCallbackTable[RoutineIndex]; + Callback = (CALLBACK_FUNCTION)Peb->KernelCallbackTable[RoutineIndex]; DbgPrint("KiUserCallbackDispatcher(%d, %x, %d)\n", RoutineIndex, Argument, ArgumentLength); Status = Callback(Argument, ArgumentLength); diff --git a/reactos/lib/ntdll/rtl/critical.c b/reactos/lib/ntdll/rtl/critical.c index b3e97de253c..d52fa525319 100644 --- a/reactos/lib/ntdll/rtl/critical.c +++ b/reactos/lib/ntdll/rtl/critical.c @@ -1,4 +1,4 @@ -/* $Id: critical.c,v 1.11 2002/09/07 15:12:40 chorns Exp $ +/* $Id: critical.c,v 1.12 2002/09/08 10:23:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -10,25 +10,23 @@ /* INCLUDES ******************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include +#include -#define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ -#define SPIN_COUNT(CriticalSection)((CriticalSection)->Reserved) - VOID STDCALL -RtlDeleteCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) +RtlDeleteCriticalSection(PCRITICAL_SECTION CriticalSection) { NtClose(CriticalSection->LockSemaphore); - SPIN_COUNT(CriticalSection) = -1; + CriticalSection->Reserved = -1; } VOID STDCALL -RtlEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) +RtlEnterCriticalSection(PCRITICAL_SECTION CriticalSection) { HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread; ULONG ret; @@ -77,14 +75,14 @@ RtlEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) } NTSTATUS STDCALL -RtlInitializeCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) +RtlInitializeCriticalSection(PCRITICAL_SECTION CriticalSection) { NTSTATUS Status; CriticalSection->LockCount = -1; CriticalSection->RecursionCount = 0; CriticalSection->OwningThread = (HANDLE)0; - SPIN_COUNT(CriticalSection) = 0; + CriticalSection->Reserved = 0; Status = NtCreateSemaphore(&CriticalSection->LockSemaphore, SEMAPHORE_ALL_ACCESS, @@ -95,7 +93,7 @@ RtlInitializeCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) } VOID STDCALL -RtlLeaveCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) +RtlLeaveCriticalSection(PCRITICAL_SECTION CriticalSection) { HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread; @@ -145,10 +143,10 @@ RtlLeaveCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) } BOOLEAN STDCALL -RtlTryEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) +RtlTryEnterCriticalSection(PCRITICAL_SECTION CriticalSection) { - if (InterlockedCompareExchange((PLONG)&CriticalSection->LockCount, - 1, 0 ) == 0) + if (InterlockedCompareExchange((PVOID*)&CriticalSection->LockCount, + (PVOID)1, (PVOID)0 ) == 0) { CriticalSection->OwningThread = (HANDLE) NtCurrentTeb()->Cid.UniqueThread; diff --git a/reactos/lib/ntdll/rtl/dos8dot3.c b/reactos/lib/ntdll/rtl/dos8dot3.c index 500acb57061..eb2454f29a0 100644 --- a/reactos/lib/ntdll/rtl/dos8dot3.c +++ b/reactos/lib/ntdll/rtl/dos8dot3.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dos8dot3.c,v 1.4 2002/09/07 15:12:40 chorns Exp $ +/* $Id: dos8dot3.c,v 1.5 2002/09/08 10:23:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -27,11 +27,12 @@ /* INCLUDES ******************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include + +//#define NDEBUG +#include -#define NDEBUG -#include /* CONSTANTS *****************************************************************/ diff --git a/reactos/lib/ntdll/rtl/env.c b/reactos/lib/ntdll/rtl/env.c index adc14b356af..cc78b68e2be 100644 --- a/reactos/lib/ntdll/rtl/env.c +++ b/reactos/lib/ntdll/rtl/env.c @@ -1,4 +1,4 @@ -/* $Id: env.c,v 1.16 2002/09/07 15:12:40 chorns Exp $ +/* $Id: env.c,v 1.17 2002/09/08 10:23:05 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,12 +11,14 @@ /* INCLUDES ******************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include +#include #include #define NDEBUG -#include +#include + /* FUNCTIONS *****************************************************************/ @@ -27,7 +29,7 @@ RtlCreateEnvironment(BOOLEAN Inherit, MEMORY_BASIC_INFORMATION MemInfo; PVOID EnvPtr = NULL; NTSTATUS Status = STATUS_SUCCESS; - ULONG RegionSize = PAGE_SIZE; + ULONG RegionSize = PAGESIZE; if (Inherit == TRUE) { @@ -296,7 +298,7 @@ found: /* enlarge environment size */ /* check the size of available memory */ new_size += (env_len - hole_len) * sizeof(WCHAR); - new_size = ROUNDUP(new_size, PAGE_SIZE); + new_size = ROUNDUP(new_size, PAGESIZE); mbi.RegionSize = 0; DPRINT("new_size %lu\n", new_size); diff --git a/reactos/lib/ntdll/rtl/error.c b/reactos/lib/ntdll/rtl/error.c index 1529289ae13..ebe91360445 100644 --- a/reactos/lib/ntdll/rtl/error.c +++ b/reactos/lib/ntdll/rtl/error.c @@ -1,4 +1,4 @@ -/* $Id: error.c,v 1.10 2002/09/07 15:12:40 chorns Exp $ +/* $Id: error.c,v 1.11 2002/09/08 10:23:05 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -20,11 +20,11 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include #define NDEBUG -#include +#include /* TYPES *******************************************************************/ diff --git a/reactos/lib/ntdll/rtl/exception.c b/reactos/lib/ntdll/rtl/exception.c index ede274af04a..7ea159d303e 100644 --- a/reactos/lib/ntdll/rtl/exception.c +++ b/reactos/lib/ntdll/rtl/exception.c @@ -1,4 +1,4 @@ -/* $Id: exception.c,v 1.9 2002/09/07 15:12:40 chorns Exp $ +/* $Id: exception.c,v 1.10 2002/09/08 10:23:05 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,14 +9,10 @@ /* INCLUDES *****************************************************************/ +#include #include -#define NTOS_USER_MODE -#include #include -#define NDEBUG -#include - /* FUNCTIONS ***************************************************************/ VOID STDCALL diff --git a/reactos/lib/ntdll/rtl/handle.c b/reactos/lib/ntdll/rtl/handle.c index c9298125ccf..fdb921427fd 100644 --- a/reactos/lib/ntdll/rtl/handle.c +++ b/reactos/lib/ntdll/rtl/handle.c @@ -1,4 +1,4 @@ -/* $Id: handle.c,v 1.3 2002/09/07 15:12:40 chorns Exp $ +/* $Id: handle.c,v 1.4 2002/09/08 10:23:05 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,11 +9,11 @@ /* INCLUDES ******************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/ntdll/rtl/heap.c b/reactos/lib/ntdll/rtl/heap.c index 29c55fd8268..cb17d4470a5 100644 --- a/reactos/lib/ntdll/rtl/heap.c +++ b/reactos/lib/ntdll/rtl/heap.c @@ -12,13 +12,14 @@ * require it. */ -#define NTOS_USER_MODE -#include #include +#include +#include +#include +#include #define NDEBUG -#include - +#include #define DPRINTF DPRINT #define ERR DPRINT @@ -37,7 +38,7 @@ #endif -static RTL_CRITICAL_SECTION RtlpProcessHeapsListLock; +static CRITICAL_SECTION RtlpProcessHeapsListLock; typedef struct tagARENA_INUSE @@ -100,13 +101,13 @@ typedef struct tagSUBHEAP typedef struct tagHEAP { - SUBHEAP subheap; /* First sub-heap */ - struct tagHEAP *next; /* Next heap for this process */ + SUBHEAP subheap; /* First sub-heap */ + struct tagHEAP *next; /* Next heap for this process */ FREE_LIST_ENTRY freeList[HEAP_NB_FREE_LISTS]; /* Free lists */ - RTL_CRITICAL_SECTION critSection; /* Critical section for serialization */ - DWORD flags; /* Heap flags */ - DWORD magic; /* Magic number */ - void *private; /* Private pointer for the user of the heap */ + CRITICAL_SECTION critSection; /* Critical section for serialization */ + DWORD flags; /* Heap flags */ + DWORD magic; /* Magic number */ + void *private; /* Private pointer for the user of the heap */ } HEAP, *PHEAP; #define HEAP_MAGIC ((DWORD)('H' | ('E'<<8) | ('A'<<16) | ('P'<<24))) @@ -1559,7 +1560,7 @@ RtlInitializeHeapManager(VOID) Peb = NtCurrentPeb(); Peb->NumberOfHeaps = 0; - Peb->MaximumNumberOfHeaps = (PAGE_SIZE - sizeof(PEB)) / sizeof(HANDLE); + Peb->MaximumNumberOfHeaps = (PAGESIZE - sizeof(PEB)) / sizeof(HANDLE); Peb->ProcessHeaps = (PVOID)Peb + sizeof(PEB); RtlInitializeCriticalSection(&RtlpProcessHeapsListLock); diff --git a/reactos/lib/ntdll/rtl/image.c b/reactos/lib/ntdll/rtl/image.c index e6c7e996b80..2120d769cfd 100644 --- a/reactos/lib/ntdll/rtl/image.c +++ b/reactos/lib/ntdll/rtl/image.c @@ -1,4 +1,4 @@ -/* $Id: image.c,v 1.3 2002/09/07 15:12:40 chorns Exp $ +/* $Id: image.c,v 1.4 2002/09/08 10:23:05 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,11 +9,11 @@ * 17/03/2000 Created */ -#define NTOS_USER_MODE -#include +#include +#include #define NDEBUG -#include +#include /* FUNCTIONS ****************************************************************/ diff --git a/reactos/lib/ntdll/rtl/intrlck.c b/reactos/lib/ntdll/rtl/intrlck.c index 3cac01ef1de..5e91816b2a7 100644 --- a/reactos/lib/ntdll/rtl/intrlck.c +++ b/reactos/lib/ntdll/rtl/intrlck.c @@ -116,14 +116,14 @@ InterlockedExchange(LPLONG target, LONG value ) * RETURNS * Prior value of value pointed to by Destination */ -LONG +PVOID STDCALL InterlockedCompareExchange( - LPLONG Destination, - LONG Exchange, - LONG Comperand) + PVOID *Destination, + PVOID Exchange, + PVOID Comperand ) { - LONG ret; + PVOID ret; __asm__ ( /* lock for SMP systems */ "lock\n\t" "cmpxchgl %2,(%1)" diff --git a/reactos/lib/ntdll/rtl/largeint.c b/reactos/lib/ntdll/rtl/largeint.c index 20278556a96..88f40ac81d0 100644 --- a/reactos/lib/ntdll/rtl/largeint.c +++ b/reactos/lib/ntdll/rtl/largeint.c @@ -1,4 +1,4 @@ -/* $Id: largeint.c,v 1.8 2002/09/07 15:12:40 chorns Exp $ +/* $Id: largeint.c,v 1.9 2002/09/08 10:23:05 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,11 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include #define NDEBUG -#include +#include + /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/ntdll/rtl/luid.c b/reactos/lib/ntdll/rtl/luid.c index 33125b25b9d..8bb2038e0ad 100644 --- a/reactos/lib/ntdll/rtl/luid.c +++ b/reactos/lib/ntdll/rtl/luid.c @@ -1,4 +1,4 @@ -/* $Id: luid.c,v 1.4 2002/09/07 15:12:40 chorns Exp $ +/* $Id: luid.c,v 1.5 2002/09/08 10:23:05 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,7 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include - -#define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ @@ -42,7 +38,6 @@ RtlCopyLuidAndAttributesArray(ULONG Count, } } -#undef RtlEqualLuid BOOLEAN STDCALL RtlEqualLuid(PLUID Luid1, diff --git a/reactos/lib/ntdll/rtl/mem.c b/reactos/lib/ntdll/rtl/mem.c index 9664a78580c..0dc50fc546c 100644 --- a/reactos/lib/ntdll/rtl/mem.c +++ b/reactos/lib/ntdll/rtl/mem.c @@ -1,4 +1,4 @@ -/* $Id: mem.c,v 1.10 2002/09/07 15:12:40 chorns Exp $ +/* $Id: mem.c,v 1.11 2002/09/08 10:23:05 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,22 +11,14 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include #include -#define NDEBUG -#include - /* FUNCTIONS *****************************************************************/ -#undef RtlCompareMemory - -SIZE_T STDCALL -RtlCompareMemory( - IN CONST VOID *Source1, - IN CONST VOID *Source2, - IN SIZE_T Length) +ULONG +STDCALL +RtlCompareMemory(PVOID Source1, PVOID Source2, ULONG Length) /* * FUNCTION: Compares blocks of memory and returns the number of equal bytes * ARGUMENTS: @@ -48,8 +40,6 @@ RtlCompareMemory( return(total); } -#undef RtlCompareMemoryUlong - ULONG STDCALL RtlCompareMemoryUlong ( @@ -81,8 +71,6 @@ RtlCompareMemoryUlong ( } #if 0 - -#undef RtlCopyBytes VOID RtlCopyBytes(PVOID Destination, CONST VOID* Source, ULONG Length) @@ -90,8 +78,6 @@ VOID RtlCopyBytes(PVOID Destination, RtlCopyMemory(Destination,Source,Length); } -#undef RtlCopyMemory - VOID RtlCopyMemory(VOID* Destination, CONST VOID* Source, ULONG Length) { DPRINT("RtlCopyMemory(Destination %x Source %x Length %d\n", @@ -101,8 +87,6 @@ VOID RtlCopyMemory(VOID* Destination, CONST VOID* Source, ULONG Length) } #endif -#undef RtlFillMemory - VOID STDCALL RtlFillMemory ( @@ -118,8 +102,6 @@ RtlFillMemory ( ); } -#undef RtlFillMemoryUlong - VOID STDCALL RtlFillMemoryUlong ( @@ -139,7 +121,6 @@ RtlFillMemoryUlong ( } } -#undef RtlZeroMemory VOID STDCALL @@ -155,7 +136,6 @@ RtlZeroMemory ( ); } -#undef RtlMoveMemory VOID STDCALL diff --git a/reactos/lib/ntdll/rtl/message.c b/reactos/lib/ntdll/rtl/message.c index b95ee2cdb23..d7c9facd3f9 100644 --- a/reactos/lib/ntdll/rtl/message.c +++ b/reactos/lib/ntdll/rtl/message.c @@ -1,4 +1,4 @@ -/* $Id: message.c,v 1.4 2002/09/07 15:12:40 chorns Exp $ +/* $Id: message.c,v 1.5 2002/09/08 10:23:06 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,11 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include #define NDEBUG -#include +#include + /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/ntdll/rtl/misc.c b/reactos/lib/ntdll/rtl/misc.c index a11e246d09c..b9a45ae776a 100644 --- a/reactos/lib/ntdll/rtl/misc.c +++ b/reactos/lib/ntdll/rtl/misc.c @@ -1,4 +1,4 @@ -/* $Id: misc.c,v 1.4 2002/09/07 15:12:40 chorns Exp $ +/* $Id: misc.c,v 1.5 2002/09/08 10:23:06 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,8 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include - -#define NDEBUG -#include +#include +#include /* GLOBALS ******************************************************************/ diff --git a/reactos/lib/ntdll/rtl/nls.c b/reactos/lib/ntdll/rtl/nls.c index e3cb1b9f2ea..64a9d1c4b9a 100644 --- a/reactos/lib/ntdll/rtl/nls.c +++ b/reactos/lib/ntdll/rtl/nls.c @@ -1,4 +1,4 @@ -/* $Id: nls.c,v 1.5 2002/09/07 15:12:40 chorns Exp $ +/* $Id: nls.c,v 1.6 2002/09/08 10:23:06 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -21,11 +21,8 @@ * 5) Add multi-byte translation code. */ -#define NTOS_USER_MODE -#include - -#define NDEBUG -#include +#include +//#include BOOLEAN diff --git a/reactos/lib/ntdll/rtl/path.c b/reactos/lib/ntdll/rtl/path.c index c36294ca091..b55542df9aa 100644 --- a/reactos/lib/ntdll/rtl/path.c +++ b/reactos/lib/ntdll/rtl/path.c @@ -1,4 +1,4 @@ -/* $Id: path.c,v 1.13 2002/09/07 15:12:40 chorns Exp $ +/* $Id: path.c,v 1.14 2002/09/08 10:23:06 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -10,14 +10,15 @@ /* INCLUDES ******************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include #include #include #include +#include #define NDEBUG -#include +#include /* DEFINITONS and MACROS ******************************************************/ diff --git a/reactos/lib/ntdll/rtl/ppb.c b/reactos/lib/ntdll/rtl/ppb.c index 4d0b9ce3dd0..a1685b67fe6 100644 --- a/reactos/lib/ntdll/rtl/ppb.c +++ b/reactos/lib/ntdll/rtl/ppb.c @@ -1,4 +1,4 @@ -/* $Id: ppb.c,v 1.13 2002/09/07 15:12:40 chorns Exp $ +/* $Id: ppb.c,v 1.14 2002/09/08 10:23:06 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,11 +11,14 @@ /* INCLUDES ****************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include +#include +#include +#include #define NDEBUG -#include +#include /* MACROS ****************************************************************/ @@ -58,7 +61,7 @@ RtlpCopyParameterString(PWCHAR *Ptr, NTSTATUS STDCALL -RtlRosCreateProcessParameters(PRTL_ROS_USER_PROCESS_PARAMETERS *ProcessParameters, +RtlCreateProcessParameters(PRTL_USER_PROCESS_PARAMETERS *ProcessParameters, PUNICODE_STRING ImagePathName, PUNICODE_STRING DllPath, PUNICODE_STRING CurrentDirectory, @@ -70,7 +73,7 @@ RtlRosCreateProcessParameters(PRTL_ROS_USER_PROCESS_PARAMETERS *ProcessParameter PUNICODE_STRING RuntimeInfo) { NTSTATUS Status = STATUS_SUCCESS; - PRTL_ROS_USER_PROCESS_PARAMETERS Param = NULL; + PRTL_USER_PROCESS_PARAMETERS Param = NULL; ULONG RegionSize = 0; ULONG Length = 0; PWCHAR Dest; @@ -122,7 +125,7 @@ RtlRosCreateProcessParameters(PRTL_ROS_USER_PROCESS_PARAMETERS *ProcessParameter RuntimeInfo = &EmptyString; /* size of process parameter block */ - Length = sizeof(RTL_ROS_USER_PROCESS_PARAMETERS); + Length = sizeof(RTL_USER_PROCESS_PARAMETERS); /* size of current directory buffer */ Length += (MAX_PATH * sizeof(WCHAR)); @@ -137,7 +140,7 @@ RtlRosCreateProcessParameters(PRTL_ROS_USER_PROCESS_PARAMETERS *ProcessParameter Length += ALIGN(RuntimeInfo->MaximumLength, sizeof(ULONG)); /* Calculate the required block size */ - RegionSize = ROUNDUP(Length, PAGE_SIZE); + RegionSize = ROUNDUP(Length, PAGESIZE); Status = NtAllocateVirtualMemory(NtCurrentProcess(), (PVOID*)&Param, @@ -153,7 +156,7 @@ RtlRosCreateProcessParameters(PRTL_ROS_USER_PROCESS_PARAMETERS *ProcessParameter DPRINT ("Process parameters allocated\n"); - Param->AllocationSize = RegionSize; + Param->MaximumLength = RegionSize; Param->Length = Length; Param->Flags = PPF_NORMALIZED; Param->Environment = Environment; @@ -161,7 +164,7 @@ RtlRosCreateProcessParameters(PRTL_ROS_USER_PROCESS_PARAMETERS *ProcessParameter Param->ConsoleHandle = ConsoleHandle; Param->ConsoleFlags = ConsoleFlags; - Dest = (PWCHAR)(((PBYTE)Param) + sizeof(RTL_ROS_USER_PROCESS_PARAMETERS)); + Dest = (PWCHAR)(((PBYTE)Param) + sizeof(RTL_USER_PROCESS_PARAMETERS)); /* copy current directory */ RtlpCopyParameterString(&Dest, @@ -225,7 +228,7 @@ RtlRosCreateProcessParameters(PRTL_ROS_USER_PROCESS_PARAMETERS *ProcessParameter RuntimeInfo, 0); - RtlRosDeNormalizeProcessParams(Param); + RtlDeNormalizeProcessParams(Param); *ProcessParameters = Param; RtlReleasePebLock(); @@ -233,7 +236,7 @@ RtlRosCreateProcessParameters(PRTL_ROS_USER_PROCESS_PARAMETERS *ProcessParameter } VOID STDCALL -RtlRosDestroyProcessParameters(PRTL_ROS_USER_PROCESS_PARAMETERS ProcessParameters) +RtlDestroyProcessParameters(PRTL_USER_PROCESS_PARAMETERS ProcessParameters) { ULONG RegionSize = 0; @@ -246,8 +249,8 @@ RtlRosDestroyProcessParameters(PRTL_ROS_USER_PROCESS_PARAMETERS ProcessParameter /* * denormalize process parameters (Pointer-->Offset) */ -PRTL_ROS_USER_PROCESS_PARAMETERS STDCALL -RtlRosDeNormalizeProcessParams(PRTL_ROS_USER_PROCESS_PARAMETERS Params) +PRTL_USER_PROCESS_PARAMETERS STDCALL +RtlDeNormalizeProcessParams(PRTL_USER_PROCESS_PARAMETERS Params) { if (Params && (Params->Flags & PPF_NORMALIZED)) { @@ -269,8 +272,8 @@ RtlRosDeNormalizeProcessParams(PRTL_ROS_USER_PROCESS_PARAMETERS Params) /* * normalize process parameters (Offset-->Pointer) */ -PRTL_ROS_USER_PROCESS_PARAMETERS STDCALL -RtlRosNormalizeProcessParams(PRTL_ROS_USER_PROCESS_PARAMETERS Params) +PRTL_USER_PROCESS_PARAMETERS STDCALL +RtlNormalizeProcessParams(PRTL_USER_PROCESS_PARAMETERS Params) { if (Params && !(Params->Flags & PPF_NORMALIZED)) { diff --git a/reactos/lib/ntdll/rtl/process.c b/reactos/lib/ntdll/rtl/process.c index 3affddaa82d..e274f493b6b 100644 --- a/reactos/lib/ntdll/rtl/process.c +++ b/reactos/lib/ntdll/rtl/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.29 2002/09/07 15:12:40 chorns Exp $ +/* $Id: process.c,v 1.30 2002/09/08 10:23:06 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,12 +11,14 @@ /* INCLUDES ****************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include +#include #include +#include #define NDEBUG -#include +#include /* FUNCTIONS ****************************************************************/ @@ -55,10 +57,10 @@ RtlpCreateFirstThread(HANDLE ProcessHandle, else InitialTeb.StackCommit = PAGESIZE; #endif - InitialTeb.StackCommit = InitialTeb.StackReserve - PAGE_SIZE; + InitialTeb.StackCommit = InitialTeb.StackReserve - PAGESIZE; /* add guard page size */ - InitialTeb.StackCommit += PAGE_SIZE; + InitialTeb.StackCommit += PAGESIZE; /* Reserve stack */ InitialTeb.StackAllocate = NULL; @@ -107,7 +109,7 @@ RtlpCreateFirstThread(HANDLE ProcessHandle, /* Protect guard page */ Status = NtProtectVirtualMemory(ProcessHandle, InitialTeb.StackLimit, - PAGE_SIZE, + PAGESIZE, PAGE_GUARD | PAGE_READWRITE, &OldPageProtection); if (!NT_SUCCESS(Status)) @@ -177,7 +179,7 @@ RtlpCreateFirstThread(HANDLE ProcessHandle, } static NTSTATUS -RtlpMapFile(PRTL_ROS_USER_PROCESS_PARAMETERS Ppb, +RtlpMapFile(PRTL_USER_PROCESS_PARAMETERS Ppb, ULONG Attributes, PHANDLE Section, PCHAR ImageFileName) @@ -193,7 +195,7 @@ RtlpMapFile(PRTL_ROS_USER_PROCESS_PARAMETERS Ppb, hFile = NULL; - RtlRosDeNormalizeProcessParams (Ppb); + RtlDeNormalizeProcessParams (Ppb); // DbgPrint("ImagePathName %x\n", Ppb->ImagePathName.Buffer); @@ -203,7 +205,7 @@ RtlpMapFile(PRTL_ROS_USER_PROCESS_PARAMETERS Ppb, NULL, SecurityDescriptor); - RtlRosNormalizeProcessParams (Ppb); + RtlNormalizeProcessParams (Ppb); /* * @@ -267,7 +269,7 @@ RtlpMapFile(PRTL_ROS_USER_PROCESS_PARAMETERS Ppb, } static NTSTATUS KlInitPeb (HANDLE ProcessHandle, - PRTL_ROS_USER_PROCESS_PARAMETERS Ppb, + PRTL_USER_PROCESS_PARAMETERS Ppb, PVOID* ImageBaseAddress) { NTSTATUS Status; @@ -321,7 +323,7 @@ static NTSTATUS KlInitPeb (HANDLE ProcessHandle, /* create the PPB */ PpbBase = NULL; - PpbSize = Ppb->AllocationSize; + PpbSize = Ppb->MaximumLength; Status = NtAllocateVirtualMemory(ProcessHandle, &PpbBase, 0, @@ -333,19 +335,19 @@ static NTSTATUS KlInitPeb (HANDLE ProcessHandle, return(Status); } - DPRINT("Ppb->AllocationSize %x\n", Ppb->AllocationSize); + DPRINT("Ppb->MaximumLength %x\n", Ppb->MaximumLength); /* write process parameters block*/ - RtlRosDeNormalizeProcessParams (Ppb); + RtlDeNormalizeProcessParams (Ppb); NtWriteVirtualMemory(ProcessHandle, PpbBase, Ppb, - Ppb->AllocationSize, + Ppb->MaximumLength, &BytesWritten); - RtlRosNormalizeProcessParams (Ppb); + RtlNormalizeProcessParams (Ppb); /* write pointer to environment */ - Offset = FIELD_OFFSET(RTL_ROS_USER_PROCESS_PARAMETERS, Environment); + Offset = FIELD_OFFSET(RTL_USER_PROCESS_PARAMETERS, Environment); NtWriteVirtualMemory(ProcessHandle, (PVOID)(PpbBase + Offset), &EnvPtr, @@ -373,9 +375,9 @@ static NTSTATUS KlInitPeb (HANDLE ProcessHandle, NTSTATUS STDCALL -RtlRosCreateUserProcess(PUNICODE_STRING ImageFileName, +RtlCreateUserProcess(PUNICODE_STRING ImageFileName, ULONG Attributes, - PRTL_ROS_USER_PROCESS_PARAMETERS ProcessParameters, + PRTL_USER_PROCESS_PARAMETERS ProcessParameters, PSECURITY_DESCRIPTOR ProcessSecurityDescriptor, PSECURITY_DESCRIPTOR ThreadSecurityDescriptor, HANDLE ParentProcess, diff --git a/reactos/lib/ntdll/rtl/propvar.c b/reactos/lib/ntdll/rtl/propvar.c index 0d2a1a414fa..49a1d615965 100644 --- a/reactos/lib/ntdll/rtl/propvar.c +++ b/reactos/lib/ntdll/rtl/propvar.c @@ -1,16 +1,13 @@ -/* $Id: propvar.c,v 1.2 2002/09/07 15:12:40 chorns Exp $ +/* $Id: propvar.c,v 1.3 2002/09/08 10:23:06 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: lib/ntdll/csr/propvar.c * PURPOSE: CSRSS properties and variants API */ -#define NTOS_USER_MODE +#define NTOS_MODE_USER #include -#define NDEBUG -#include - NTSTATUS STDCALL PropertyLengthAsVariant ( diff --git a/reactos/lib/ntdll/rtl/registry.c b/reactos/lib/ntdll/rtl/registry.c index e864de73461..da6696d21a3 100644 --- a/reactos/lib/ntdll/rtl/registry.c +++ b/reactos/lib/ntdll/rtl/registry.c @@ -1,4 +1,4 @@ -/* $Id: registry.c,v 1.17 2002/09/07 15:12:40 chorns Exp $ +/* $Id: registry.c,v 1.18 2002/09/08 10:23:06 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -19,11 +19,14 @@ /* INCLUDES ****************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include +#include +#include #define NDEBUG -#include +#include + /* FUNCTIONS ***************************************************************/ @@ -69,15 +72,15 @@ RtlCreateRegistryKey(IN ULONG RelativeTo, NTSTATUS STDCALL RtlDeleteRegistryValue(IN ULONG RelativeTo, - IN PCWSTR Path, - IN PCWSTR ValueName) + IN PWSTR Path, + IN PWSTR ValueName) { HANDLE KeyHandle; NTSTATUS Status; UNICODE_STRING Name; Status = RtlpGetRegistryHandle(RelativeTo, - (PWSTR)Path, + Path, FALSE, &KeyHandle); if (!NT_SUCCESS(Status)) @@ -143,7 +146,7 @@ RtlOpenCurrentUser(IN ACCESS_MASK DesiredAccess, NTSTATUS STDCALL RtlQueryRegistryValues(IN ULONG RelativeTo, - IN PCWSTR Path, + IN PWSTR Path, IN PRTL_QUERY_REGISTRY_TABLE QueryTable, IN PVOID Context, IN PVOID Environment) @@ -168,7 +171,7 @@ RtlQueryRegistryValues(IN ULONG RelativeTo, DPRINT("RtlQueryRegistryValues() called\n"); Status = RtlpGetRegistryHandle(RelativeTo, - (PWSTR)Path, + Path, FALSE, &BaseKeyHandle); if (!NT_SUCCESS(Status)) @@ -652,8 +655,8 @@ RtlQueryRegistryValues(IN ULONG RelativeTo, NTSTATUS STDCALL RtlWriteRegistryValue(IN ULONG RelativeTo, - IN PCWSTR Path, - IN PCWSTR ValueName, + IN PWSTR Path, + IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength) @@ -663,7 +666,7 @@ RtlWriteRegistryValue(IN ULONG RelativeTo, UNICODE_STRING Name; Status = RtlpGetRegistryHandle(RelativeTo, - (PWSTR)Path, + Path, TRUE, &KeyHandle); if (!NT_SUCCESS(Status)) @@ -880,7 +883,7 @@ RtlpGetRegistryHandle(ULONG RelativeTo, NtCurrentProcess(), KeyHandle, 0, - 0, + FALSE, DUPLICATE_SAME_ACCESS); return(Status); } diff --git a/reactos/lib/ntdll/rtl/resource.c b/reactos/lib/ntdll/rtl/resource.c index 7aded7543f2..03d20e94c6d 100644 --- a/reactos/lib/ntdll/rtl/resource.c +++ b/reactos/lib/ntdll/rtl/resource.c @@ -1,4 +1,4 @@ -/* $Id: resource.c,v 1.2 2002/09/07 15:12:40 chorns Exp $ +/* $Id: resource.c,v 1.3 2002/09/08 10:23:06 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -18,11 +18,13 @@ * The code is based on information published in WDJ January 1999 issue. */ -#define NTOS_USER_MODE -#include +#include +#include +#include #define NDEBUG -#include +#include + /* FUNCTIONS ****************************************************************/ @@ -297,4 +299,4 @@ RtlDumpResource(PRTL_RESOURCE Resource) } } -/* EOF */ +/* EOF */ \ No newline at end of file diff --git a/reactos/lib/ntdll/rtl/sd.c b/reactos/lib/ntdll/rtl/sd.c index 0bb546da4e8..a4b0d651921 100644 --- a/reactos/lib/ntdll/rtl/sd.c +++ b/reactos/lib/ntdll/rtl/sd.c @@ -1,4 +1,4 @@ -/* $Id: sd.c,v 1.8 2002/09/07 15:12:40 chorns Exp $ +/* $Id: sd.c,v 1.9 2002/09/08 10:23:06 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,9 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include -#define NDEBUG -#include +#include /* FUNCTIONS ***************************************************************/ @@ -42,8 +40,8 @@ RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG STDCALL RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor) { - PISID Owner; - PISID Group; + PSID Owner; + PSID Group; ULONG Length; PACL Dacl; PACL Sacl; @@ -52,10 +50,10 @@ RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor) if (SecurityDescriptor->Owner != NULL) { - Owner = (PISID)SecurityDescriptor->Owner; + Owner = SecurityDescriptor->Owner; if (SecurityDescriptor->Control & SE_SELF_RELATIVE) { - Owner = (PISID)((ULONG)Owner + + Owner = (PSID)((ULONG)Owner + (ULONG)SecurityDescriptor); } Length = Length + ((sizeof(SID) + (Owner->SubAuthorityCount - 1) * @@ -67,7 +65,7 @@ RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor) Group = SecurityDescriptor->Group; if (SecurityDescriptor->Control & SE_SELF_RELATIVE) { - Group = (PISID)((ULONG)Group + (ULONG)SecurityDescriptor); + Group = (PSID)((ULONG)Group + (ULONG)SecurityDescriptor); } Length = Length + ((sizeof(SID) + (Group->SubAuthorityCount - 1) * sizeof(ULONG) + 3) & 0xfc); diff --git a/reactos/lib/ntdll/rtl/security.c b/reactos/lib/ntdll/rtl/security.c index 10a0af09543..21b1399a306 100644 --- a/reactos/lib/ntdll/rtl/security.c +++ b/reactos/lib/ntdll/rtl/security.c @@ -1,4 +1,4 @@ -/* $Id: security.c,v 1.6 2002/09/07 15:12:41 chorns Exp $ +/* $Id: security.c,v 1.7 2002/09/08 10:23:06 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,11 +9,8 @@ * 21/11/2001 Created */ -#define NTOS_USER_MODE -#include - -#define NDEBUG -#include +#include +#include NTSTATUS STDCALL diff --git a/reactos/lib/ntdll/rtl/sid.c b/reactos/lib/ntdll/rtl/sid.c index e1447be1493..322c5fd120b 100644 --- a/reactos/lib/ntdll/rtl/sid.c +++ b/reactos/lib/ntdll/rtl/sid.c @@ -1,4 +1,4 @@ -/* $Id: sid.c,v 1.5 2002/09/07 15:12:41 chorns Exp $ +/* $Id: sid.c,v 1.6 2002/09/08 10:23:06 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,29 +11,25 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include #include -#define NDEBUG -#include +//#include /* FUNCTIONS ***************************************************************/ BOOLEAN STDCALL RtlValidSid(IN PSID Sid) { - PISID iSid = (PISID)Sid; - - if ((iSid->Revision & 0xf) != 1) - { - return(FALSE); - } - if (iSid->SubAuthorityCount > 15) - { - return(FALSE); - } - return(TRUE); + if ((Sid->Revision & 0xf) != 1) + { + return(FALSE); + } + if (Sid->SubAuthorityCount > 15) + { + return(FALSE); + } + return(TRUE); } @@ -49,13 +45,12 @@ RtlInitializeSid(IN PSID Sid, IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, IN UCHAR SubAuthorityCount) { - PISID iSid = (PISID)Sid; - - iSid->Revision = 1; - iSid->SubAuthorityCount = SubAuthorityCount; - memcpy(&iSid->IdentifierAuthority, IdentifierAuthority, - sizeof(SID_IDENTIFIER_AUTHORITY)); - return(STATUS_SUCCESS); + Sid->Revision = 1; + Sid->SubAuthorityCount = SubAuthorityCount; + memcpy(&Sid->IdentifierAuthority, + IdentifierAuthority, + sizeof(SID_IDENTIFIER_AUTHORITY)); + return(STATUS_SUCCESS); } @@ -63,18 +58,14 @@ PULONG STDCALL RtlSubAuthoritySid(IN PSID Sid, IN ULONG SubAuthority) { - PISID iSid = (PISID)Sid; - - return(&iSid->SubAuthority[SubAuthority]); + return(&Sid->SubAuthority[SubAuthority]); } PUCHAR STDCALL RtlSubAuthorityCountSid(IN PSID Sid) { - PISID iSid = (PISID)Sid; - - return(&iSid->SubAuthorityCount); + return(&Sid->SubAuthorityCount); } @@ -82,18 +73,14 @@ BOOLEAN STDCALL RtlEqualSid(IN PSID Sid1, IN PSID Sid2) { - PISID iSid1 = (PISID)Sid1; - PISID iSid2 = (PISID)Sid2; - - if (iSid1->Revision != iSid2->Revision) - { - return(FALSE); - } - if ((*RtlSubAuthorityCountSid(Sid1)) != - (*RtlSubAuthorityCountSid(Sid2))) - { - return(FALSE); - } + if (Sid1->Revision != Sid2->Revision) + { + return(FALSE); + } + if ((*RtlSubAuthorityCountSid(Sid1)) != (*RtlSubAuthorityCountSid(Sid2))) + { + return(FALSE); + } if (memcmp(Sid1, Sid2, RtlLengthSid(Sid1)) != 0) { return(FALSE); @@ -105,9 +92,7 @@ RtlEqualSid(IN PSID Sid1, ULONG STDCALL RtlLengthSid(IN PSID Sid) { - PISID iSid = (PISID)Sid; - - return(sizeof(SID) + (iSid->SubAuthorityCount-1)*4); + return(sizeof(SID) + (Sid->SubAuthorityCount-1)*4); } @@ -166,9 +151,7 @@ RtlCopySidAndAttributesArray(ULONG Count, PSID_IDENTIFIER_AUTHORITY STDCALL RtlIdentifierAuthoritySid(IN PSID Sid) { - PISID iSid = (PISID)Sid; - - return (&iSid->IdentifierAuthority); + return(&Sid->IdentifierAuthority); } @@ -188,7 +171,7 @@ RtlAllocateAndInitializeSid ( PSID *Sid ) { - PISID pSid; + PSID pSid; if (SubAuthorityCount > 8) return STATUS_INVALID_SID; @@ -196,9 +179,9 @@ RtlAllocateAndInitializeSid ( if (Sid == NULL) return STATUS_INVALID_PARAMETER; - pSid = (PISID)RtlAllocateHeap (RtlGetProcessHeap (), - 0, - SubAuthorityCount * sizeof(DWORD) + 8); + pSid = (PSID)RtlAllocateHeap (RtlGetProcessHeap (), + 0, + SubAuthorityCount * sizeof(DWORD) + 8); if (pSid == NULL) return STATUS_NO_MEMORY; @@ -229,7 +212,7 @@ RtlAllocateAndInitializeSid ( break; } - *Sid = (PSID)pSid; + *Sid = pSid; return STATUS_SUCCESS; } @@ -249,12 +232,9 @@ BOOLEAN STDCALL RtlEqualPrefixSid(IN PSID Sid1, IN PSID Sid2) { - PISID iSid1 = (PISID)Sid1; - PISID iSid2 = (PISID)Sid2; - - return (iSid1->SubAuthorityCount == iSid2->SubAuthorityCount && - !memcmp (iSid1, iSid2, - (iSid1->SubAuthorityCount - 1) * sizeof(DWORD) + 8)); + return(Sid1->SubAuthorityCount == Sid2->SubAuthorityCount && + !memcmp(Sid1, Sid2, + (Sid1->SubAuthorityCount - 1) * sizeof(DWORD) + 8)); } @@ -263,7 +243,6 @@ RtlConvertSidToUnicodeString(PUNICODE_STRING String, PSID Sid, BOOLEAN AllocateBuffer) { - PISID iSid = (PISID)Sid; WCHAR Buffer[256]; PWSTR wcs; ULONG Length; @@ -273,34 +252,34 @@ RtlConvertSidToUnicodeString(PUNICODE_STRING String, return STATUS_INVALID_SID; wcs = Buffer; - wcs += swprintf (wcs, L"S-%u-", iSid->Revision); - if (!iSid->IdentifierAuthority.Value[0] && - !iSid->IdentifierAuthority.Value[1]) + wcs += swprintf (wcs, L"S-%u-", Sid->Revision); + if (!Sid->IdentifierAuthority.Value[0] && + !Sid->IdentifierAuthority.Value[1]) { wcs += swprintf (wcs, L"%u", - (DWORD)iSid->IdentifierAuthority.Value[2] << 24 | - (DWORD)iSid->IdentifierAuthority.Value[3] << 16 | - (DWORD)iSid->IdentifierAuthority.Value[4] << 8 | - (DWORD)iSid->IdentifierAuthority.Value[5]); + (DWORD)Sid->IdentifierAuthority.Value[2] << 24 | + (DWORD)Sid->IdentifierAuthority.Value[3] << 16 | + (DWORD)Sid->IdentifierAuthority.Value[4] << 8 | + (DWORD)Sid->IdentifierAuthority.Value[5]); } else { wcs += swprintf (wcs, L"0x%02hx%02hx%02hx%02hx%02hx%02hx", - iSid->IdentifierAuthority.Value[0], - iSid->IdentifierAuthority.Value[1], - iSid->IdentifierAuthority.Value[2], - iSid->IdentifierAuthority.Value[3], - iSid->IdentifierAuthority.Value[4], - iSid->IdentifierAuthority.Value[5]); + Sid->IdentifierAuthority.Value[0], + Sid->IdentifierAuthority.Value[1], + Sid->IdentifierAuthority.Value[2], + Sid->IdentifierAuthority.Value[3], + Sid->IdentifierAuthority.Value[4], + Sid->IdentifierAuthority.Value[5]); } - for (i = 0; i < iSid->SubAuthorityCount; i++) + for (i = 0; i < Sid->SubAuthorityCount; i++) { wcs += swprintf (wcs, L"-%u", - iSid->SubAuthority[0]); + Sid->SubAuthority[0]); } Length = (wcs - Buffer) * sizeof(WCHAR); diff --git a/reactos/lib/ntdll/rtl/thread.c b/reactos/lib/ntdll/rtl/thread.c index 2d1c704f779..5b1cb8709da 100644 --- a/reactos/lib/ntdll/rtl/thread.c +++ b/reactos/lib/ntdll/rtl/thread.c @@ -11,11 +11,14 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include +#include +#include #define NDEBUG -#include +#include + /* FUNCTIONS ***************************************************************/ @@ -48,15 +51,15 @@ RtlCreateUserThread(HANDLE ProcessHandle, /* FIXME: use correct commit size */ #if 0 - if ((StackCommit != NULL) && (*StackCommit > PAGE_SIZE)) + if ((StackCommit != NULL) && (*StackCommit > PAGESIZE)) InitialTeb.StackCommit = *StackCommit; else InitialTeb.StackCommit = PAGESIZE; #endif - InitialTeb.StackCommit = InitialTeb.StackReserve - PAGE_SIZE; + InitialTeb.StackCommit = InitialTeb.StackReserve - PAGESIZE; /* add size of guard page */ - InitialTeb.StackCommit += PAGE_SIZE; + InitialTeb.StackCommit += PAGESIZE; /* Reserve stack */ InitialTeb.StackAllocate = NULL; @@ -107,7 +110,7 @@ RtlCreateUserThread(HANDLE ProcessHandle, /* Protect guard page */ Status = NtProtectVirtualMemory(ProcessHandle, InitialTeb.StackLimit, - PAGE_SIZE, + PAGESIZE, PAGE_GUARD | PAGE_READWRITE, &OldPageProtection); if (!NT_SUCCESS(Status)) diff --git a/reactos/lib/ntdll/rtl/time.c b/reactos/lib/ntdll/rtl/time.c index 11fe1e1f338..39c94201114 100644 --- a/reactos/lib/ntdll/rtl/time.c +++ b/reactos/lib/ntdll/rtl/time.c @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.11 2002/09/07 15:12:41 chorns Exp $ +/* $Id: time.c,v 1.12 2002/09/08 10:23:07 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,11 +12,8 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include - -#define NDEBUG -#include +#include +#include #define TICKSPERSEC 10000000 diff --git a/reactos/lib/ntdll/rtl/timezone.c b/reactos/lib/ntdll/rtl/timezone.c index 68e92d832bc..ce3e5484800 100644 --- a/reactos/lib/ntdll/rtl/timezone.c +++ b/reactos/lib/ntdll/rtl/timezone.c @@ -1,4 +1,4 @@ -/* $Id: timezone.c,v 1.3 2002/09/07 15:12:41 chorns Exp $ +/* $Id: timezone.c,v 1.4 2002/09/08 10:23:07 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,13 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include +#include #define NDEBUG -#include +#include + /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/ntdll/rtl/trace.c b/reactos/lib/ntdll/rtl/trace.c index 39b866699dd..a58bbf85338 100644 --- a/reactos/lib/ntdll/rtl/trace.c +++ b/reactos/lib/ntdll/rtl/trace.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: trace.c,v 1.2 2002/09/07 15:12:41 chorns Exp $ +/* $Id: trace.c,v 1.3 2002/09/08 10:23:07 chorns Exp $ * * PROJECT: ReactOS kernel * PURPOSE: Tracing library calls @@ -26,13 +26,12 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include #include #include -#define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/lib/ntdll/rtl/unicode.c b/reactos/lib/ntdll/rtl/unicode.c index 68c61b95e1a..2a3f1bf036f 100644 --- a/reactos/lib/ntdll/rtl/unicode.c +++ b/reactos/lib/ntdll/rtl/unicode.c @@ -1,4 +1,4 @@ -/* $Id: unicode.c,v 1.21 2002/09/07 15:12:41 chorns Exp $ +/* $Id: unicode.c,v 1.22 2002/09/08 10:23:07 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,12 +9,13 @@ * Created 10/08/98 */ -#define NTOS_USER_MODE -#include +#include +#include +//#include #include - +#include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ @@ -212,7 +213,7 @@ RtlAppendUnicodeStringToString ( NTSTATUS STDCALL RtlAppendUnicodeToString(IN OUT PUNICODE_STRING Destination, - IN PCWSTR Source) + IN PWSTR Source) { PWCHAR Src; PWCHAR Dest; @@ -224,7 +225,7 @@ RtlAppendUnicodeToString(IN OUT PUNICODE_STRING Destination, if (Destination->Length + slen >= Destination->MaximumLength) return(STATUS_BUFFER_TOO_SMALL); - Src = (PWCHAR)Source; + Src = Source; Dest = Destination->Buffer + (Destination->Length / sizeof(WCHAR)); for (i = 0; i < (slen / sizeof(WCHAR)); i++) @@ -630,8 +631,8 @@ RtlEqualString ( BOOLEAN STDCALL RtlEqualUnicodeString ( - IN CONST UNICODE_STRING *String1, - IN CONST UNICODE_STRING *String2, + IN PUNICODE_STRING String1, + IN PUNICODE_STRING String2, IN BOOLEAN CaseInsensitive ) { diff --git a/reactos/lib/ntdll/stdio/sprintf.c b/reactos/lib/ntdll/stdio/sprintf.c index 8a9968c4472..d2a71dd7930 100644 --- a/reactos/lib/ntdll/stdio/sprintf.c +++ b/reactos/lib/ntdll/stdio/sprintf.c @@ -1,4 +1,4 @@ -/* $Id: sprintf.c,v 1.7 2002/09/07 15:12:41 chorns Exp $ +/* $Id: sprintf.c,v 1.8 2002/09/08 10:23:07 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -22,8 +22,7 @@ * Wirzenius wrote this portably, Torvalds fucked it up :-) */ -#define NTOS_USER_MODE -#include +#include #include #include #include @@ -31,7 +30,7 @@ #include #define NDEBUG -#include +#include #define ZEROPAD 1 /* pad with zero */ diff --git a/reactos/lib/ntdll/stdio/swprintf.c b/reactos/lib/ntdll/stdio/swprintf.c index 47fc3da0b54..83cd0b382cc 100644 --- a/reactos/lib/ntdll/stdio/swprintf.c +++ b/reactos/lib/ntdll/stdio/swprintf.c @@ -1,4 +1,4 @@ -/* $Id: swprintf.c,v 1.9 2002/09/07 15:12:41 chorns Exp $ +/* $Id: swprintf.c,v 1.10 2002/09/08 10:23:07 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -23,8 +23,7 @@ * Wirzenius wrote this portably, Torvalds fucked it up :-) */ -#define NTOS_USER_MODE -#include +#include #include #include #include @@ -32,7 +31,7 @@ #include #define NDEBUG -#include +#include #define ZEROPAD 1 /* pad with zero */ diff --git a/reactos/lib/ntdll/string/ctype.c b/reactos/lib/ntdll/string/ctype.c index b619c9d2766..91eaa19e1c9 100644 --- a/reactos/lib/ntdll/string/ctype.c +++ b/reactos/lib/ntdll/string/ctype.c @@ -1,4 +1,4 @@ -/* $Id: ctype.c,v 1.9 2002/09/07 15:12:41 chorns Exp $ +/* $Id: ctype.c,v 1.10 2002/09/08 10:23:07 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -278,17 +278,17 @@ unsigned short _ctype[] = { 0 /* 0xff */ }; -//unsigned short *_pctype = _ctype + 1; -//unsigned short *_pwctype = _ctype + 1; +unsigned short *_pctype = _ctype + 1; +unsigned short *_pwctype = _ctype + 1; int _isctype (int c, int ctypeFlags) { - return (_ctype[1+(unsigned char)(c & 0xFF)] & ctypeFlags); + return (_pctype[(unsigned char)(c & 0xFF)] & ctypeFlags); } int iswctype(wint_t wc, wctype_t wctypeFlags) { - return (_ctype[1+(unsigned char)(wc & 0xFF)] & wctypeFlags); + return (_pwctype[(unsigned char)(wc & 0xFF)] & wctypeFlags); } int isalpha(int c) diff --git a/reactos/lib/ntdll/stubs/stubs.c b/reactos/lib/ntdll/stubs/stubs.c index d9614f4b379..ade64b3464f 100644 --- a/reactos/lib/ntdll/stubs/stubs.c +++ b/reactos/lib/ntdll/stubs/stubs.c @@ -1,5 +1,4 @@ -#define NTOS_USER_MODE -#include +#include #define STUB(x) void x(void) { \ UNICODE_STRING UnicodeString = \ diff --git a/reactos/lib/ole32/ole32.rc b/reactos/lib/ole32/ole32.rc index d2483d8685a..aed7dcaaf77 100644 --- a/reactos/lib/ole32/ole32.rc +++ b/reactos/lib/ole32/ole32.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/oleaut32/oleaut32.rc b/reactos/lib/oleaut32/oleaut32.rc index 020b522eb83..f6cdfb9c416 100644 --- a/reactos/lib/oleaut32/oleaut32.rc +++ b/reactos/lib/oleaut32/oleaut32.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/psapi/psapi.rc b/reactos/lib/psapi/psapi.rc index 2fc43eaf35d..095c4f237c2 100644 --- a/reactos/lib/psapi/psapi.rc +++ b/reactos/lib/psapi/psapi.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/secur32/Makefile b/reactos/lib/secur32/Makefile index 4cd59f9f488..d3bca6a084e 100644 --- a/reactos/lib/secur32/Makefile +++ b/reactos/lib/secur32/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.8 2002/09/07 15:12:43 chorns Exp $ +# $Id: Makefile,v 1.9 2002/09/08 10:23:08 chorns Exp $ PATH_TO_TOP = ../.. @@ -7,7 +7,7 @@ TARGET_TYPE = dynlink TARGET_NAME = secur32 -TARGET_BASE = 0x77100000 +TARGET_BASE = 0x10000000 TARGET_SDKLIBS = ntdll.a diff --git a/reactos/lib/secur32/dllmain.c b/reactos/lib/secur32/dllmain.c index ee82876fdab..c4baa224480 100644 --- a/reactos/lib/secur32/dllmain.c +++ b/reactos/lib/secur32/dllmain.c @@ -1,4 +1,4 @@ -/* $Id: dllmain.c,v 1.2 2002/09/07 15:12:43 chorns Exp $ +/* $Id: dllmain.c,v 1.3 2002/09/08 10:23:08 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,7 +11,6 @@ /* INCLUDES ******************************************************************/ #include -#define NTOS_USER_MODE #include /* GLOBALS *******************************************************************/ diff --git a/reactos/lib/secur32/lsa.c b/reactos/lib/secur32/lsa.c index 308321353a6..884d37da60d 100644 --- a/reactos/lib/secur32/lsa.c +++ b/reactos/lib/secur32/lsa.c @@ -1,4 +1,4 @@ -/* $Id: lsa.c,v 1.4 2002/09/07 15:12:43 chorns Exp $ +/* $Id: lsa.c,v 1.5 2002/09/08 10:23:08 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,8 +11,8 @@ /* INCLUDES ******************************************************************/ #include -#define NTOS_USER_MODE -#include +#include +#include #include #include @@ -74,9 +74,9 @@ LsaCallAuthenticationPackage(HANDLE LsaHandle, Reply = (PLSASS_REPLY)RawReply; Request->Header.DataSize = sizeof(LSASS_REQUEST) + SubmitBufferLength - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); Request->Header.MessageSize = - Request->Header.DataSize + sizeof(LPC_MESSAGE); + Request->Header.DataSize + sizeof(LPC_MESSAGE_HEADER); Request->Type = LSASS_REQUEST_CALL_AUTHENTICATION_PACKAGE; Request->d.CallAuthenticationPackageRequest.AuthenticationPackage = AuthenticationPackage; @@ -129,9 +129,9 @@ LsaLookupAuthenticationPackage(HANDLE LsaHandle, Request = (PLSASS_REQUEST)RawRequest; Request->Header.DataSize = sizeof(LSASS_REQUEST) + PackageName->Length - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); Request->Header.MessageSize = Request->Header.DataSize + - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); Request->Type = LSASS_REQUEST_LOOKUP_AUTHENTICATION_PACKAGE; Status = NtRequestWaitReplyPort(LsaHandle, @@ -175,7 +175,7 @@ LsaLogonUser(HANDLE LsaHandle, UCHAR RawReply[MAX_MESSAGE_DATA]; NTSTATUS Status; - RequestLength = sizeof(LSASS_REQUEST) - sizeof(LPC_MESSAGE); + RequestLength = sizeof(LSASS_REQUEST) - sizeof(LPC_MESSAGE_HEADER); RequestLength = RequestLength + (OriginName->Length * sizeof(WCHAR)); RequestLength = RequestLength + AuthenticationInformationLength; RequestLength = RequestLength + @@ -215,8 +215,8 @@ LsaLogonUser(HANDLE LsaHandle, Request->d.LogonUserRequest.SourceContext = *SourceContext; Request->Type = LSASS_REQUEST_LOGON_USER; - Request->Header.DataSize = RequestLength - sizeof(LPC_MESSAGE); - Request->Header.MessageSize = RequestLength + sizeof(LPC_MESSAGE); + Request->Header.DataSize = RequestLength - sizeof(LPC_MESSAGE_HEADER); + Request->Header.MessageSize = RequestLength + sizeof(LPC_MESSAGE_HEADER); Reply = (PLSASS_REPLY)RawReply; @@ -278,7 +278,7 @@ LsaRegisterLogonProcess(PLSA_STRING LsaLogonProcessName, Request.Type = LSASS_REQUEST_REGISTER_LOGON_PROCESS; Request.Header.DataSize = sizeof(LSASS_REQUEST) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); Request.Header.MessageSize = sizeof(LSASS_REQUEST); Request.d.RegisterLogonProcessRequest.Length = LsaLogonProcessName->Length; diff --git a/reactos/lib/secur32/secur32.rc b/reactos/lib/secur32/secur32.rc index d5f70700a80..e7c8ba851b5 100644 --- a/reactos/lib/secur32/secur32.rc +++ b/reactos/lib/secur32/secur32.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/shell32/shell32.rc b/reactos/lib/shell32/shell32.rc index b58d8d7def5..699027d1603 100644 --- a/reactos/lib/shell32/shell32.rc +++ b/reactos/lib/shell32/shell32.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/user32/Makefile b/reactos/lib/user32/Makefile index 91915053480..bc9ff6c81d2 100644 --- a/reactos/lib/user32/Makefile +++ b/reactos/lib/user32/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 2002/09/07 15:12:44 chorns Exp $ +# $Id: Makefile,v 1.5 2002/09/08 10:23:09 chorns Exp $ PATH_TO_TOP = ../.. @@ -6,7 +6,7 @@ TARGET_TYPE = dynlink TARGET_NAME = user32 -TARGET_BASE = 0x78200000 +TARGET_BASE = 0x77e70000 TARGET_SDKLIBS = ntdll.a kernel32.a gdi32.a diff --git a/reactos/lib/user32/controls/combobox.c b/reactos/lib/user32/controls/combobox.c index 670c3dc41f5..803ed3227cc 100644 --- a/reactos/lib/user32/controls/combobox.c +++ b/reactos/lib/user32/controls/combobox.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: combobox.c,v 1.2 2002/09/07 15:12:44 chorns Exp $ +/* $Id: combobox.c,v 1.3 2002/09/08 10:23:09 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/controls/combobox.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/controls/listbox.c b/reactos/lib/user32/controls/listbox.c index 7d455474d70..bef3d67dedb 100644 --- a/reactos/lib/user32/controls/listbox.c +++ b/reactos/lib/user32/controls/listbox.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: listbox.c,v 1.7 2002/09/07 15:12:44 chorns Exp $ +/* $Id: listbox.c,v 1.8 2002/09/08 10:23:09 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/controls/listbox.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/controls/scrollbar.c b/reactos/lib/user32/controls/scrollbar.c index 1c2c9004bb3..8a0b01ada6e 100644 --- a/reactos/lib/user32/controls/scrollbar.c +++ b/reactos/lib/user32/controls/scrollbar.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: scrollbar.c,v 1.2 2002/09/07 15:12:44 chorns Exp $ +/* $Id: scrollbar.c,v 1.3 2002/09/08 10:23:09 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/controls/scrollbar.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/include/debug.h b/reactos/lib/user32/include/debug.h index d1495461329..dc957fcbcce 100644 --- a/reactos/lib/user32/include/debug.h +++ b/reactos/lib/user32/include/debug.h @@ -52,7 +52,7 @@ extern DWORD DebugTraceLevel; #endif /* DBG */ -#undef assert + #define assert(x) ASSERT(x) #define assert_irql(x) ASSERT_IRQL(x) diff --git a/reactos/lib/user32/include/user32.h b/reactos/lib/user32/include/user32.h index a1b9fe25d83..23732f44e2b 100644 --- a/reactos/lib/user32/include/user32.h +++ b/reactos/lib/user32/include/user32.h @@ -4,18 +4,8 @@ * FILE: include/user32.h * PURPOSE: Global user32 definitions */ -#define WINVER 0x1000 #include -#define NTOS_USER_MODE -#include -#include -#include #include -#include -#include - -#define SLOWORD(l) ((SHORT)((LONG)(l))) -#define SHIWORD(l) ((SHORT)(((LONG)(l) >> 16) & 0xFFFF)) extern HANDLE ProcessHeap; VOID diff --git a/reactos/lib/user32/misc/dde.c b/reactos/lib/user32/misc/dde.c index a4f280d2e87..0e53239b2ff 100644 --- a/reactos/lib/user32/misc/dde.c +++ b/reactos/lib/user32/misc/dde.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dde.c,v 1.2 2002/09/07 15:12:44 chorns Exp $ +/* $Id: dde.c,v 1.3 2002/09/08 10:23:10 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/misc/dde.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ @@ -149,7 +151,7 @@ DdeFreeDataHandle(HDDEDATA hData) return FALSE; } -BOOL STDCALL +BOOL DdeFreeStringHandle(DWORD idInst, HSZ hsz) { diff --git a/reactos/lib/user32/misc/desktop.c b/reactos/lib/user32/misc/desktop.c index e61dd57e39e..a6fe1b62a75 100644 --- a/reactos/lib/user32/misc/desktop.c +++ b/reactos/lib/user32/misc/desktop.c @@ -1,4 +1,4 @@ -/* $Id: desktop.c,v 1.5 2002/09/07 15:12:44 chorns Exp $ +/* $Id: desktop.c,v 1.6 2002/09/08 10:23:10 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -8,8 +8,9 @@ * UPDATE HISTORY: * 06-06-2001 CSH Created */ - +#include #include +#include int STDCALL GetSystemMetrics(int nIndex) @@ -63,8 +64,8 @@ CreateDesktopA(LPCSTR lpszDesktop, ACCESS_MASK dwDesiredAccess, LPSECURITY_ATTRIBUTES lpsa) { - UNICODE_STRING DesktopNameU; ANSI_STRING DesktopNameA; + UNICODE_STRING DesktopNameU; HDESK hDesktop; if (lpszDesktop != NULL) @@ -80,7 +81,7 @@ CreateDesktopA(LPCSTR lpszDesktop, hDesktop = CreateDesktopW(DesktopNameU.Buffer, NULL, - (LPDEVMODEW)pDevmode, + pDevmode, dwFlags, dwDesiredAccess, lpsa); @@ -128,7 +129,7 @@ WINBOOL STDCALL EnumDesktopsA( HWINSTA hwinsta, - DESKTOPENUMPROCA lpEnumFunc, + DESKTOPENUMPROC lpEnumFunc, LPARAM lParam) { return FALSE; @@ -138,7 +139,7 @@ WINBOOL STDCALL EnumDesktopsW( HWINSTA hwinsta, - DESKTOPENUMPROCW lpEnumFunc, + DESKTOPENUMPROC lpEnumFunc, LPARAM lParam) { return FALSE; diff --git a/reactos/lib/user32/misc/display.c b/reactos/lib/user32/misc/display.c index b608c16122b..d5032aaaf96 100644 --- a/reactos/lib/user32/misc/display.c +++ b/reactos/lib/user32/misc/display.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: display.c,v 1.2 2002/09/07 15:12:44 chorns Exp $ +/* $Id: display.c,v 1.3 2002/09/08 10:23:10 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/misc/dde.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ @@ -57,7 +59,7 @@ WINBOOL STDCALL EnumDisplayMonitors( HDC hdc, - LPCRECT lprcClip, + LPRECT lprcClip, MONITORENUMPROC lpfnEnum, LPARAM dwData) { diff --git a/reactos/lib/user32/misc/dllmain.c b/reactos/lib/user32/misc/dllmain.c index 9e311e028a9..077df95ba0c 100644 --- a/reactos/lib/user32/misc/dllmain.c +++ b/reactos/lib/user32/misc/dllmain.c @@ -1,5 +1,6 @@ - -#include +#include +#include +#include #ifdef DBG diff --git a/reactos/lib/user32/misc/object.c b/reactos/lib/user32/misc/object.c index 2e0fe1038ff..e8d268c3266 100644 --- a/reactos/lib/user32/misc/object.c +++ b/reactos/lib/user32/misc/object.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: object.c,v 1.2 2002/09/07 15:12:44 chorns Exp $ +/* $Id: object.c,v 1.3 2002/09/08 10:23:10 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/misc/dde.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/misc/resources.c b/reactos/lib/user32/misc/resources.c index 3bac568e483..0bfc676e6f5 100644 --- a/reactos/lib/user32/misc/resources.c +++ b/reactos/lib/user32/misc/resources.c @@ -1,6 +1,7 @@ -#include - +#include +#include +#include int STDCALL diff --git a/reactos/lib/user32/misc/stubs.c b/reactos/lib/user32/misc/stubs.c index e42a9cdacad..00fca0f49dd 100644 --- a/reactos/lib/user32/misc/stubs.c +++ b/reactos/lib/user32/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.13 2002/09/07 15:12:44 chorns Exp $ +/* $Id: stubs.c,v 1.14 2002/09/08 10:23:10 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -195,8 +195,8 @@ int STDCALL GetMouseMovePointsEx( UINT cbSize, - PMOUSEMOVEPOINT lppt, - PMOUSEMOVEPOINT lpptBuf, + LPMOUSEMOVEPOINT lppt, + LPMOUSEMOVEPOINT lpptBuf, int nBufPoints, DWORD resolution) { @@ -343,7 +343,7 @@ DWORD STDCALL MsgWaitForMultipleObjects( DWORD nCount, - CONST HANDLE *pHandles, + CONST LPHANDLE pHandles, WINBOOL fWaitAll, DWORD dwMilliseconds, DWORD dwWakeMask) @@ -355,7 +355,7 @@ DWORD STDCALL MsgWaitForMultipleObjectsEx( DWORD nCount, - CONST HANDLE *pHandles, + CONST HANDLE pHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags) diff --git a/reactos/lib/user32/misc/timer.c b/reactos/lib/user32/misc/timer.c index 1098c8e5386..dd9dea26fdb 100644 --- a/reactos/lib/user32/misc/timer.c +++ b/reactos/lib/user32/misc/timer.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: timer.c,v 1.3 2002/09/07 15:12:44 chorns Exp $ +/* $Id: timer.c,v 1.4 2002/09/08 10:23:10 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/misc/dde.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/misc/winsta.c b/reactos/lib/user32/misc/winsta.c index ec786a9acf7..c393c0d87b6 100644 --- a/reactos/lib/user32/misc/winsta.c +++ b/reactos/lib/user32/misc/winsta.c @@ -1,4 +1,4 @@ -/* $Id: winsta.c,v 1.5 2002/09/07 15:12:44 chorns Exp $ +/* $Id: winsta.c,v 1.6 2002/09/08 10:23:10 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -8,8 +8,9 @@ * UPDATE HISTORY: * 04-06-2001 CSH Created */ - +#include #include +#include WINBOOL STDCALL @@ -64,15 +65,15 @@ CreateWindowStationW(LPWSTR lpwinsta, lpsa, 0, 0, 0); } -BOOL STDCALL -EnumWindowStationsA(WINSTAENUMPROCA lpEnumFunc, +WINBOOL STDCALL +EnumWindowStationsA(ENUMWINDOWSTATIONPROC lpEnumFunc, LPARAM lParam) { return FALSE; } -BOOL STDCALL -EnumWindowStationsW(WINSTAENUMPROCW lpEnumFunc, +WINBOOL STDCALL +EnumWindowStationsW(ENUMWINDOWSTATIONPROC lpEnumFunc, LPARAM lParam) { return FALSE; diff --git a/reactos/lib/user32/user32.rc b/reactos/lib/user32/user32.rc index 7e05e8fb9bb..52248d8fb4d 100644 --- a/reactos/lib/user32/user32.rc +++ b/reactos/lib/user32/user32.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/user32/windows/accel.c b/reactos/lib/user32/windows/accel.c index ddd2bc15890..cdd383cb099 100644 --- a/reactos/lib/user32/windows/accel.c +++ b/reactos/lib/user32/windows/accel.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: accel.c,v 1.2 2002/09/07 15:12:45 chorns Exp $ +/* $Id: accel.c,v 1.3 2002/09/08 10:23:11 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/bitmap.c b/reactos/lib/user32/windows/bitmap.c index bfb9419ee8c..5da0840e2e5 100644 --- a/reactos/lib/user32/windows/bitmap.c +++ b/reactos/lib/user32/windows/bitmap.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: bitmap.c,v 1.3 2002/09/07 15:12:45 chorns Exp $ +/* $Id: bitmap.c,v 1.4 2002/09/08 10:23:11 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/class.c b/reactos/lib/user32/windows/class.c index d037a9256be..14d94209c7c 100644 --- a/reactos/lib/user32/windows/class.c +++ b/reactos/lib/user32/windows/class.c @@ -1,4 +1,4 @@ -/* $Id: class.c,v 1.15 2002/09/07 15:12:45 chorns Exp $ +/* $Id: class.c,v 1.16 2002/09/08 10:23:12 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -8,46 +8,47 @@ * UPDATE HISTORY: * 09-05-2001 CSH Created */ - +#include #include +#include -BOOL +WINBOOL STDCALL GetClassInfoA( HINSTANCE hInstance, LPCSTR lpClassName, - LPWNDCLASSA lpWndClass) + LPWNDCLASS lpWndClass) { return FALSE; } -BOOL +WINBOOL STDCALL GetClassInfoExA( HINSTANCE hinst, LPCSTR lpszClass, - LPWNDCLASSEXA lpwcx) + LPWNDCLASSEX lpwcx) { return FALSE; } -BOOL +WINBOOL STDCALL GetClassInfoExW( HINSTANCE hinst, LPCWSTR lpszClass, - LPWNDCLASSEXW lpwcx) + LPWNDCLASSEX lpwcx) { return FALSE; } -BOOL +WINBOOL STDCALL GetClassInfoW( HINSTANCE hInstance, LPCWSTR lpClassName, - LPWNDCLASSW lpWndClass) + LPWNDCLASS lpWndClass) { return FALSE; } @@ -149,9 +150,9 @@ RealGetWindowClassW( } ATOM STDCALL -RegisterClassA(CONST WNDCLASSA *lpWndClass) +RegisterClassA(CONST WNDCLASS *lpWndClass) { - WNDCLASSEXA Class; + WNDCLASSEX Class; RtlMoveMemory(&Class.style, lpWndClass, sizeof(WNDCLASS)); Class.cbSize = sizeof(WNDCLASSEX); @@ -160,7 +161,7 @@ RegisterClassA(CONST WNDCLASSA *lpWndClass) } ATOM STDCALL -RegisterClassExA(CONST WNDCLASSEXA *lpwcx) +RegisterClassExA(CONST WNDCLASSEX *lpwcx) { UNICODE_STRING MenuName; UNICODE_STRING ClassName; @@ -199,7 +200,7 @@ RegisterClassExA(CONST WNDCLASSEXA *lpwcx) } ATOM STDCALL -RegisterClassExW(CONST WNDCLASSEXW *lpwcx) +RegisterClassExW(CONST WNDCLASSEX *lpwcx) { RTL_ATOM Atom; @@ -214,7 +215,7 @@ RegisterClassExW(CONST WNDCLASSEXW *lpwcx) } ATOM STDCALL -RegisterClassW(CONST WNDCLASSW *lpWndClass) +RegisterClassW(CONST WNDCLASS *lpWndClass) { WNDCLASSEX Class; diff --git a/reactos/lib/user32/windows/clipboard.c b/reactos/lib/user32/windows/clipboard.c index bafac3c26e8..cc1319aa780 100644 --- a/reactos/lib/user32/windows/clipboard.c +++ b/reactos/lib/user32/windows/clipboard.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: clipboard.c,v 1.2 2002/09/07 15:12:45 chorns Exp $ +/* $Id: clipboard.c,v 1.3 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/cursor.c b/reactos/lib/user32/windows/cursor.c index 836a78e65b4..7357e2bf752 100644 --- a/reactos/lib/user32/windows/cursor.c +++ b/reactos/lib/user32/windows/cursor.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: cursor.c,v 1.2 2002/09/07 15:12:45 chorns Exp $ +/* $Id: cursor.c,v 1.3 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/cursor.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/dc.c b/reactos/lib/user32/windows/dc.c index 4d413593325..b390370c49f 100644 --- a/reactos/lib/user32/windows/dc.c +++ b/reactos/lib/user32/windows/dc.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dc.c,v 1.8 2002/09/07 15:12:45 chorns Exp $ +/* $Id: dc.c,v 1.9 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/defwnd.c b/reactos/lib/user32/windows/defwnd.c index 6280ce97ea2..94ab84a3637 100644 --- a/reactos/lib/user32/windows/defwnd.c +++ b/reactos/lib/user32/windows/defwnd.c @@ -1,4 +1,4 @@ -/* $Id: defwnd.c,v 1.8 2002/09/07 15:12:45 chorns Exp $ +/* $Id: defwnd.c,v 1.9 2002/09/08 10:23:12 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -11,7 +11,11 @@ /* INCLUDES ******************************************************************/ +#include #include +#include +#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/lib/user32/windows/dialog.c b/reactos/lib/user32/windows/dialog.c index ddef4071b15..ca30223e920 100644 --- a/reactos/lib/user32/windows/dialog.c +++ b/reactos/lib/user32/windows/dialog.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dialog.c,v 1.6 2002/09/07 15:12:45 chorns Exp $ +/* $Id: dialog.c,v 1.7 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/draw.c b/reactos/lib/user32/windows/draw.c index d9f33c0b9cb..ee433e45cd1 100644 --- a/reactos/lib/user32/windows/draw.c +++ b/reactos/lib/user32/windows/draw.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: draw.c,v 1.3 2002/09/07 15:12:45 chorns Exp $ +/* $Id: draw.c,v 1.4 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* GLOBALS *******************************************************************/ @@ -67,7 +69,6 @@ GrayStringW( { return FALSE; } - WINBOOL STDCALL InvertRect( @@ -76,7 +77,6 @@ InvertRect( { return FALSE; } - LONG STDCALL TabbedTextOutA( @@ -106,7 +106,6 @@ TabbedTextOutW( { return 0; } - int STDCALL FrameRect( @@ -116,8 +115,7 @@ FrameRect( { return 0; } - -BOOL +WINBOOL STDCALL FlashWindow( HWND hWnd, @@ -168,7 +166,7 @@ STDCALL DrawCaption( HWND hwnd, HDC hdc, - LPCRECT lprc, + LPRECT lprc, UINT uFlags) { return FALSE; @@ -194,6 +192,7 @@ DrawFocusRect( return FALSE; } + WINBOOL STDCALL DrawStateA( diff --git a/reactos/lib/user32/windows/font.c b/reactos/lib/user32/windows/font.c index 433ace1b542..55a268d7141 100644 --- a/reactos/lib/user32/windows/font.c +++ b/reactos/lib/user32/windows/font.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: font.c,v 1.2 2002/09/07 15:12:45 chorns Exp $ +/* $Id: font.c,v 1.3 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/hook.c b/reactos/lib/user32/windows/hook.c index 25865c39548..c61ac4987f1 100644 --- a/reactos/lib/user32/windows/hook.c +++ b/reactos/lib/user32/windows/hook.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: hook.c,v 1.7 2002/09/07 15:12:45 chorns Exp $ +/* $Id: hook.c,v 1.8 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/icon.c b/reactos/lib/user32/windows/icon.c index f42e0ff9e53..d03b949265a 100644 --- a/reactos/lib/user32/windows/icon.c +++ b/reactos/lib/user32/windows/icon.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: icon.c,v 1.2 2002/09/07 15:12:45 chorns Exp $ +/* $Id: icon.c,v 1.3 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/input.c b/reactos/lib/user32/windows/input.c index 5b99860cce4..38873522db2 100644 --- a/reactos/lib/user32/windows/input.c +++ b/reactos/lib/user32/windows/input.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: input.c,v 1.4 2002/09/07 15:12:45 chorns Exp $ +/* $Id: input.c,v 1.5 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/mdi.c b/reactos/lib/user32/windows/mdi.c index df0e67c526f..c89806c79b4 100644 --- a/reactos/lib/user32/windows/mdi.c +++ b/reactos/lib/user32/windows/mdi.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: mdi.c,v 1.2 2002/09/07 15:12:45 chorns Exp $ +/* $Id: mdi.c,v 1.3 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/menu.c b/reactos/lib/user32/windows/menu.c index 66553661b18..ed423c94070 100644 --- a/reactos/lib/user32/windows/menu.c +++ b/reactos/lib/user32/windows/menu.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: menu.c,v 1.4 2002/09/07 15:12:45 chorns Exp $ +/* $Id: menu.c,v 1.5 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/menu.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* TYPES *********************************************************************/ @@ -255,11 +257,11 @@ GetMenuDefaultItem( return 0; } -BOOL +WINBOOL STDCALL GetMenuInfo( HMENU hmenu, - LPMENUINFO lpcmi) + LPCMENUINFO lpcmi) { return FALSE; } @@ -281,24 +283,24 @@ GetMenuItemID( return 0; } -BOOL +WINBOOL STDCALL GetMenuItemInfoA( HMENU hMenu, UINT uItem, - BOOL fByPosition, - LPMENUITEMINFOA lpmii) + WINBOOL fByPosition, + LPMENUITEMINFO lpmii) { return FALSE; } -BOOL +WINBOOL STDCALL GetMenuItemInfoW( HMENU hMenu, UINT uItem, - BOOL fByPosition, - LPMENUITEMINFOW lpmii) + WINBOOL fByPosition, + LPMENUITEMINFO lpmii) { return FALSE; } @@ -383,7 +385,7 @@ InsertMenuItemA( HMENU hMenu, UINT uItem, WINBOOL fByPosition, - LPCMENUITEMINFOA lpmii) + LPCMENUITEMINFO lpmii) { return FALSE; } @@ -394,7 +396,7 @@ InsertMenuItemW( HMENU hMenu, UINT uItem, WINBOOL fByPosition, - LPCMENUITEMINFOW lpmii) + LPCMENUITEMINFO lpmii) { return FALSE; } @@ -536,8 +538,8 @@ STDCALL SetMenuItemInfoA( HMENU hMenu, UINT uItem, - BOOL fByPosition, - LPCMENUITEMINFOA lpmii) + WINBOOL fByPosition, + LPMENUITEMINFO lpmii) { return FALSE; } @@ -547,8 +549,8 @@ STDCALL SetMenuItemInfoW( HMENU hMenu, UINT uItem, - BOOL fByPosition, - LPCMENUITEMINFOW lpmii) + WINBOOL fByPosition, + LPMENUITEMINFO lpmii) { return FALSE; } diff --git a/reactos/lib/user32/windows/message.c b/reactos/lib/user32/windows/message.c index 1ee055c4496..51c35b008b1 100644 --- a/reactos/lib/user32/windows/message.c +++ b/reactos/lib/user32/windows/message.c @@ -1,4 +1,4 @@ -/* $Id: message.c,v 1.9 2002/09/07 15:12:45 chorns Exp $ +/* $Id: message.c,v 1.10 2002/09/08 10:23:12 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -8,9 +8,9 @@ * UPDATE HISTORY: * 06-06-2001 CSH Created */ - +#include #include - +#include LPARAM STDCALL diff --git a/reactos/lib/user32/windows/messagebox.c b/reactos/lib/user32/windows/messagebox.c index c8b491d48e1..bef581e7714 100644 --- a/reactos/lib/user32/windows/messagebox.c +++ b/reactos/lib/user32/windows/messagebox.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: messagebox.c,v 1.2 2002/09/07 15:12:45 chorns Exp $ +/* $Id: messagebox.c,v 1.3 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ @@ -70,7 +72,7 @@ MessageBoxExW( int STDCALL MessageBoxIndirectA( - CONST MSGBOXPARAMSA *lpMsgBoxParams) + CONST LPMSGBOXPARAMS lpMsgBoxParams) { return 0; } @@ -78,7 +80,7 @@ MessageBoxIndirectA( int STDCALL MessageBoxIndirectW( - CONST MSGBOXPARAMSW *lpMsgBoxParams) + CONST LPMSGBOXPARAMS lpMsgBoxParams) { return 0; } diff --git a/reactos/lib/user32/windows/paint.c b/reactos/lib/user32/windows/paint.c index 3a907429b97..74e7860e867 100644 --- a/reactos/lib/user32/windows/paint.c +++ b/reactos/lib/user32/windows/paint.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: paint.c,v 1.7 2002/09/07 15:12:45 chorns Exp $ +/* $Id: paint.c,v 1.8 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/prop.c b/reactos/lib/user32/windows/prop.c index 4e7c4a0750c..ef180dcfe80 100644 --- a/reactos/lib/user32/windows/prop.c +++ b/reactos/lib/user32/windows/prop.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: prop.c,v 1.3 2002/09/07 15:12:45 chorns Exp $ +/* $Id: prop.c,v 1.4 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,31 +28,33 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ int STDCALL -EnumPropsA(HWND hWnd, PROPENUMPROCA lpEnumFunc) +EnumPropsA(HWND hWnd, PROPENUMPROC lpEnumFunc) { return 0; } int STDCALL -EnumPropsExA(HWND hWnd, PROPENUMPROCEXA lpEnumFunc, LPARAM lParam) +EnumPropsExA(HWND hWnd, PROPENUMPROCEX lpEnumFunc, LPARAM lParam) { return 0; } int STDCALL -EnumPropsExW(HWND hWnd, PROPENUMPROCEXW lpEnumFunc, LPARAM lParam) +EnumPropsExW(HWND hWnd, PROPENUMPROCEX lpEnumFunc, LPARAM lParam) { return 0; } int STDCALL -EnumPropsW(HWND hWnd, PROPENUMPROCW lpEnumFunc) +EnumPropsW(HWND hWnd, PROPENUMPROC lpEnumFunc) { return 0; } diff --git a/reactos/lib/user32/windows/rect.c b/reactos/lib/user32/windows/rect.c index cedebb0de8b..746b89808c4 100644 --- a/reactos/lib/user32/windows/rect.c +++ b/reactos/lib/user32/windows/rect.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: rect.c,v 1.9 2002/09/07 15:12:45 chorns Exp $ +/* $Id: rect.c,v 1.10 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/text.c b/reactos/lib/user32/windows/text.c index 90b7cb489cf..44793eca3a1 100644 --- a/reactos/lib/user32/windows/text.c +++ b/reactos/lib/user32/windows/text.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: text.c,v 1.2 2002/09/07 15:12:45 chorns Exp $ +/* $Id: text.c,v 1.3 2002/09/08 10:23:12 chorns Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -28,7 +28,9 @@ /* INCLUDES ******************************************************************/ +#include #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/user32/windows/window.c b/reactos/lib/user32/windows/window.c index 4b577c484c9..422ffae9d85 100644 --- a/reactos/lib/user32/windows/window.c +++ b/reactos/lib/user32/windows/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.12 2002/09/07 15:12:45 chorns Exp $ +/* $Id: window.c,v 1.13 2002/09/08 10:23:12 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -11,7 +11,11 @@ /* INCLUDES ******************************************************************/ +#include #include +#include +#include +#include /* FUNCTIONS *****************************************************************/ @@ -541,23 +545,17 @@ FindWindowExW(HWND hwndParent, return (HWND)0; } -#undef GetAltTabInfo - -BOOL STDCALL +WINBOOL STDCALL GetAltTabInfo(HWND hwnd, int iItem, PALTTABINFO pati, - LPSTR pszItemText, + LPTSTR pszItemText, UINT cchItemText) { - return GetAltTabInfoA(hwnd, - iItem, - pati, - pszItemText, - cchItemText); + return FALSE; } -BOOL STDCALL +WINBOOL STDCALL GetAltTabInfoA(HWND hwnd, int iItem, PALTTABINFO pati, @@ -567,7 +565,7 @@ GetAltTabInfoA(HWND hwnd, return FALSE; } -BOOL STDCALL +WINBOOL STDCALL GetAltTabInfoW(HWND hwnd, int iItem, PALTTABINFO pati, @@ -602,9 +600,9 @@ GetForegroundWindow(VOID) return (HWND)0; } -BOOL STDCALL +WINBOOL STDCALL GetGUIThreadInfo(DWORD idThread, - PGUITHREADINFO lpgui) + LPGUITHREADINFO lpgui) { return FALSE; } @@ -654,16 +652,12 @@ GetWindowInfo(HWND hwnd, return FALSE; } -#undef GetWindowModuleFileName - UINT STDCALL GetWindowModuleFileName(HWND hwnd, LPSTR lpszFileName, UINT cchFileNameMax) { - return GetWindowModuleFileNameA(hwnd, - lpszFileName, - cchFileNameMax); + return 0; } UINT STDCALL diff --git a/reactos/lib/version/makefile b/reactos/lib/version/makefile index 3b2f257caf2..1fa31f0f66c 100644 --- a/reactos/lib/version/makefile +++ b/reactos/lib/version/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.9 2002/09/07 15:12:45 chorns Exp $ +# $Id: makefile,v 1.10 2002/09/08 10:23:13 chorns Exp $ PATH_TO_TOP = ../.. @@ -6,7 +6,7 @@ TARGET_TYPE = dynlink TARGET_NAME = version -TARGET_BASE = 0x77000000 +TARGET_BASE = 0x77a90000 TARGET_SDKLIBS = kernel32.a diff --git a/reactos/lib/version/misc/stubs.c b/reactos/lib/version/misc/stubs.c index 0f495f5d190..2c8a6bf6eb7 100644 --- a/reactos/lib/version/misc/stubs.c +++ b/reactos/lib/version/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.2 2002/09/07 15:12:46 chorns Exp $ +/* $Id: stubs.c,v 1.3 2002/09/08 10:23:13 chorns Exp $ * * version.dll stubs: remove from this file if * you implement one of these functions. @@ -158,7 +158,7 @@ VerLanguageNameW ( return 0; } -BOOL +WINBOOL STDCALL VerQueryValueA ( const LPVOID pBlock, @@ -172,7 +172,7 @@ VerQueryValueA ( } -BOOL +WINBOOL STDCALL VerQueryValueW ( const LPVOID pBlock, diff --git a/reactos/lib/version/version.rc b/reactos/lib/version/version.rc index 95474a8a285..13d54ec8e24 100644 --- a/reactos/lib/version/version.rc +++ b/reactos/lib/version/version.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/ws2_32/include/debug.h b/reactos/lib/ws2_32/include/debug.h index 305cfb41276..c0ee7d95fe5 100644 --- a/reactos/lib/ws2_32/include/debug.h +++ b/reactos/lib/ws2_32/include/debug.h @@ -18,9 +18,6 @@ #define DEBUG_CHECK 0x00000100 #define DEBUG_ULTRA 0xFFFFFFFF -#undef ASSERT -#undef assert - #ifdef DBG extern DWORD DebugTraceLevel; @@ -32,6 +29,10 @@ extern DWORD DebugTraceLevel; DbgPrint _x_; \ } +#ifdef ASSERT +#undef ASSERT +#endif + #ifdef NASSERT #define ASSERT(x) #else /* NASSERT */ @@ -47,7 +48,7 @@ extern DWORD DebugTraceLevel; #endif /* DBG */ -#undef assert + #define assert(x) ASSERT(x) #define assert_irql(x) ASSERT_IRQL(x) diff --git a/reactos/lib/ws2_32/include/ws2_32.h b/reactos/lib/ws2_32/include/ws2_32.h index d3545e9ce52..254f7022365 100644 --- a/reactos/lib/ws2_32/include/ws2_32.h +++ b/reactos/lib/ws2_32/include/ws2_32.h @@ -7,11 +7,10 @@ #ifndef __WS2_32_H #define __WS2_32_H -#include -#define NTOS_USER_MODE -#include +#include #include #include +#include #include /* Exported by ntdll.dll, but where is the prototype? */ diff --git a/reactos/lib/ws2_32/makefile b/reactos/lib/ws2_32/makefile index 8b6ae5c30ab..1deba1e69d4 100644 --- a/reactos/lib/ws2_32/makefile +++ b/reactos/lib/ws2_32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.8 2002/09/07 15:12:46 chorns Exp $ +# $Id: makefile,v 1.9 2002/09/08 10:23:13 chorns Exp $ PATH_TO_TOP = ../.. @@ -6,7 +6,7 @@ TARGET_TYPE = dynlink TARGET_NAME = ws2_32 -TARGET_BASE = 0x77400000 +TARGET_BASE = 0x77780000 TARGET_CFLAGS = -I./include -DUNICODE -DLE -DDBG diff --git a/reactos/lib/ws2_32/misc/dllmain.c b/reactos/lib/ws2_32/misc/dllmain.c index d1512ed5003..ed6b1814bfd 100644 --- a/reactos/lib/ws2_32/misc/dllmain.c +++ b/reactos/lib/ws2_32/misc/dllmain.c @@ -264,14 +264,14 @@ closesocket( } -int +INT EXPORT select( - IN int nfds, - IN OUT fd_set *readfds, - IN OUT fd_set *writefds, - IN OUT fd_set *exceptfds, - IN const struct timeval FAR *timeout) + IN INT nfds, + IN OUT LPFD_SET readfds, + IN OUT LPFD_SET writefds, + IN OUT LPFD_SET exceptfds, + IN CONST LPTIMEVAL timeout) /* * FUNCTION: Returns status of one or more sockets * ARGUMENTS: @@ -322,7 +322,7 @@ select( } Count = Provider->ProcTable.lpWSPSelect( - nfds, readfds, writefds, exceptfds, (CONST LPTIMEVAL)timeout, &Errno); + nfds, readfds, writefds, exceptfds, timeout, &Errno); WS_DbgPrint(MAX_TRACE, ("Provider (0x%X).\n", Provider)); @@ -337,12 +337,12 @@ select( } -int +INT EXPORT bind( IN SOCKET s, - IN const struct sockaddr FAR *name, - IN int namelen) + IN CONST LPSOCKADDR name, + IN INT namelen) { PCATALOG_ENTRY Provider; INT Status; @@ -359,7 +359,7 @@ bind( } Status = Provider->ProcTable.lpWSPBind( - s, (CONST LPSOCKADDR)name, namelen, &Errno); + s, name, namelen, &Errno); DereferenceProviderByPointer(Provider); @@ -451,23 +451,23 @@ WSAAccept( } -int +INT EXPORT connect( IN SOCKET s, - IN const struct sockaddr *name, - IN int namelen) + IN CONST LPSOCKADDR name, + IN INT namelen) { return WSAConnect(s, name, namelen, NULL, NULL, NULL, NULL); } -int +INT EXPORT WSAConnect( IN SOCKET s, - IN const struct sockaddr *name, - IN int namelen, + IN CONST LPSOCKADDR name, + IN INT namelen, IN LPWSABUF lpCallerData, OUT LPWSABUF lpCalleeData, IN LPQOS lpSQOS, @@ -488,7 +488,7 @@ WSAConnect( } Status = Provider->ProcTable.lpWSPConnect( - s, (CONST LPSOCKADDR)name, namelen, lpCallerData, lpCalleeData, lpSQOS, lpGQOS, &Errno); + s, name, namelen, lpCallerData, lpCalleeData, lpSQOS, lpGQOS, &Errno); DereferenceProviderByPointer(Provider); diff --git a/reactos/lib/ws2_32/misc/sndrcv.c b/reactos/lib/ws2_32/misc/sndrcv.c index c3da65329ee..3f642548b1d 100644 --- a/reactos/lib/ws2_32/misc/sndrcv.c +++ b/reactos/lib/ws2_32/misc/sndrcv.c @@ -79,15 +79,15 @@ send( } -int +INT EXPORT sendto( IN SOCKET s, - IN const char FAR *buf, - IN int len, - IN int flags, - IN const struct sockaddr *to, - IN int tolen) + IN CONST CHAR FAR* buf, + IN INT len, + IN INT flags, + IN CONST LPSOCKADDR to, + IN INT tolen) { DWORD BytesSent; WSABUF WSABuf; @@ -239,7 +239,7 @@ WSASendDisconnect( } -int +INT EXPORT WSASendTo( IN SOCKET s, @@ -247,8 +247,8 @@ WSASendTo( IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesSent, IN DWORD dwFlags, - IN const struct sockaddr *lpTo, - IN int iToLen, + IN CONST LPSOCKADDR lpTo, + IN INT iToLen, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) { @@ -266,7 +266,7 @@ WSASendTo( assert(Provider->ProcTable.lpWSPSendTo); Code = Provider->ProcTable.lpWSPSendTo(s, lpBuffers, dwBufferCount, - lpNumberOfBytesSent, dwFlags, (CONST LPSOCKADDR) lpTo, iToLen, lpOverlapped, + lpNumberOfBytesSent, dwFlags, lpTo, iToLen, lpOverlapped, lpCompletionRoutine, NULL /* lpThreadId */, &Errno); DereferenceProviderByPointer(Provider); diff --git a/reactos/lib/ws2_32/misc/stubs.c b/reactos/lib/ws2_32/misc/stubs.c index 470ec4fc83d..f07ee3f4264 100644 --- a/reactos/lib/ws2_32/misc/stubs.c +++ b/reactos/lib/ws2_32/misc/stubs.c @@ -235,8 +235,8 @@ SOCKET EXPORT WSAJoinLeaf( IN SOCKET s, - IN const struct sockaddr FAR *name, - IN int namelen, + IN CONST LPSOCKADDR name, + IN INT namelen, IN LPWSABUF lpCallerData, OUT LPWSABUF lpCalleeData, IN LPQOS lpSQOS, diff --git a/reactos/lib/ws2_32/ws2_32.rc b/reactos/lib/ws2_32/ws2_32.rc index 40c8266cfad..723083e83c9 100644 --- a/reactos/lib/ws2_32/ws2_32.rc +++ b/reactos/lib/ws2_32/ws2_32.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/ws2help/ws2help.rc b/reactos/lib/ws2help/ws2help.rc index 47e17cc545f..a2aad15f01e 100644 --- a/reactos/lib/ws2help/ws2help.rc +++ b/reactos/lib/ws2help/ws2help.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/lib/wshirda/debug.h b/reactos/lib/wshirda/debug.h index b32f63d7f09..13a623f8fb3 100644 --- a/reactos/lib/wshirda/debug.h +++ b/reactos/lib/wshirda/debug.h @@ -17,9 +17,6 @@ #define DEBUG_ULTRA 0xFFFFFFFF -#undef ASSERT -#undef assert - #ifdef DBG extern DWORD DebugTraceLevel; @@ -31,6 +28,10 @@ extern DWORD DebugTraceLevel; DbgPrint _x_; \ } +#ifdef ASSERT +#undef ASSERT +#endif + #ifdef NASSERT #define ASSERT(x) #else /* NASSERT */ diff --git a/reactos/lib/wshirda/wshirda.c b/reactos/lib/wshirda/wshirda.c index dddecd0cf66..49760550a2e 100644 --- a/reactos/lib/wshirda/wshirda.c +++ b/reactos/lib/wshirda/wshirda.c @@ -104,7 +104,7 @@ INT WINAPI WSHGetWSAProtocolInfo( IN LPWSTR ProviderName, - OUT LPWSAPROTOCOL_INFOW* ProtocolInfo, + OUT LPWSAPROTOCOL_INFOW *ProtocolInfo, OUT LPDWORD ProtocolInfoEntries) { UNIMPLEMENTED diff --git a/reactos/lib/wshirda/wshirda.rc b/reactos/lib/wshirda/wshirda.rc index ed10df150f2..9b18a99241b 100644 --- a/reactos/lib/wshirda/wshirda.rc +++ b/reactos/lib/wshirda/wshirda.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/ntoskrnl/Makefile b/reactos/ntoskrnl/Makefile index 8bcc865e9ef..c544e9d5926 100644 --- a/reactos/ntoskrnl/Makefile +++ b/reactos/ntoskrnl/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.82 2002/09/07 16:44:12 chorns Exp $ +# $Id: Makefile,v 1.83 2002/09/08 10:23:15 chorns Exp $ # # ReactOS Operating System # @@ -34,10 +34,10 @@ endif ifeq ($(strip $(SDK_PATH_INC)),) ASFLAGS += -I./include -CFLAGS += -I./include -D_NTOSKRNL_ $(CFLAGS_DBG) -Wall -Werror +CFLAGS += -I./include -D__NTOSKRNL__ $(CFLAGS_DBG) -Wall -Werror else ASFLAGS += -I./include -I$(SDK_PATH_INC) -CFLAGS += -I./include -I$(SDK_PATH_INC) -D_NTOSKRNL_ $(CFLAGS_DBG) -Wall -Werror +CFLAGS += -I./include -I$(SDK_PATH_INC) -D__NTOSKRNL__ $(CFLAGS_DBG) -Wall -Werror endif # @@ -350,8 +350,7 @@ TAG_OBJECTS := $(join $(dir $(DEP_OBJECTS)),$(patsubst %.o, .%.TAG, $(notdir $(D # Include automatic dependancy tracking # DEP_EXCLUDE_FILTER := ex/napi.% nt/zw.% -# FIXME: Disabled -#include $(PATH_TO_TOP)/tools/depend.mk +include $(PATH_TO_TOP)/tools/depend.mk # Resources @@ -515,7 +514,7 @@ CLEAN_FILES = $(OBJECTS_PATH)/*.o cc/*.o cm/*.o dbg/*.o dbg/i386/*.o ex/*.o \ $(TARGETNAME).nostrip.exe: $(TARGETNAME).o $(IE_DATA) $(CC) \ - -g -Wl,-T,ntoskrnl.lnk \ + -Wl,-T,ntoskrnl.lnk \ -nostartfiles \ -nostdlib \ -mdll \ @@ -536,7 +535,7 @@ $(TARGETNAME).nostrip.exe: $(TARGETNAME).o $(IE_DATA) --kill-at - $(RM) base.tmp $(CC) \ - -g -nostartfiles \ + -nostartfiles \ -nostdlib \ -Wl,-T,ntoskrnl.lnk \ -mdll \ diff --git a/reactos/ntoskrnl/cc/cacheman.c b/reactos/ntoskrnl/cc/cacheman.c index 3a6c7b91f53..5592f1c0409 100644 --- a/reactos/ntoskrnl/cc/cacheman.c +++ b/reactos/ntoskrnl/cc/cacheman.c @@ -28,9 +28,9 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/cc/copy.c b/reactos/ntoskrnl/cc/copy.c index a614fc531c2..413886ecba3 100644 --- a/reactos/ntoskrnl/cc/copy.c +++ b/reactos/ntoskrnl/cc/copy.c @@ -1,4 +1,4 @@ -/* $Id: copy.c,v 1.11 2002/09/07 15:12:47 chorns Exp $ +/* $Id: copy.c,v 1.12 2002/09/08 10:23:16 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,17 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define ROUND_DOWN(N, S) ((N) - ((N) % (S))) @@ -45,12 +50,12 @@ CcInitCacheZeroPage(VOID) } NTSTATUS -ReadCacheSegmentChain(PROS_BCB Bcb, ULONG ReadOffset, ULONG Length, +ReadCacheSegmentChain(PBCB Bcb, ULONG ReadOffset, ULONG Length, PVOID Buffer) { - PROS_CACHE_SEGMENT head; - PROS_CACHE_SEGMENT current; - PROS_CACHE_SEGMENT previous; + PCACHE_SEGMENT head; + PCACHE_SEGMENT current; + PCACHE_SEGMENT previous; IO_STATUS_BLOCK Iosb; LARGE_INTEGER SegOffset; NTSTATUS Status; @@ -84,7 +89,7 @@ ReadCacheSegmentChain(PROS_BCB Bcb, ULONG ReadOffset, ULONG Length, */ else { - PROS_CACHE_SEGMENT current2; + PCACHE_SEGMENT current2; ULONG current_size; PMDL Mdl; ULONG i; @@ -111,11 +116,11 @@ ReadCacheSegmentChain(PROS_BCB Bcb, ULONG ReadOffset, ULONG Length, offset = 0; while (current2 != NULL && !current2->Valid) { - for (i = 0; i < (Bcb->CacheSegmentSize / PAGE_SIZE); i++) + for (i = 0; i < (Bcb->CacheSegmentSize / PAGESIZE); i++) { PVOID address; PHYSICAL_ADDRESS page; - address = current2->BaseAddress + (i * PAGE_SIZE); + address = current2->BaseAddress + (i * PAGESIZE); page = MmGetPhysicalAddressForProcess(NULL, address); ((PULONG)(Mdl + 1))[offset] = page.u.LowPart; offset++; @@ -164,7 +169,7 @@ ReadCacheSegmentChain(PROS_BCB Bcb, ULONG ReadOffset, ULONG Length, } NTSTATUS -ReadCacheSegment(PROS_CACHE_SEGMENT CacheSeg) +ReadCacheSegment(PCACHE_SEGMENT CacheSeg) { ULONG Size; PMDL Mdl; @@ -204,7 +209,7 @@ ReadCacheSegment(PROS_CACHE_SEGMENT CacheSeg) } NTSTATUS -WriteCacheSegment(PROS_CACHE_SEGMENT CacheSeg) +WriteCacheSegment(PCACHE_SEGMENT CacheSeg) { ULONG Size; PMDL Mdl; @@ -250,13 +255,13 @@ CcCopyRead (IN PFILE_OBJECT FileObject, ULONG TempLength; NTSTATUS Status = STATUS_SUCCESS; PVOID BaseAddress; - PROS_CACHE_SEGMENT CacheSeg; + PCACHE_SEGMENT CacheSeg; BOOLEAN Valid; ULONG ReadLength = 0; - PROS_BCB Bcb; + PBCB Bcb; KIRQL oldirql; PLIST_ENTRY current_entry; - PROS_CACHE_SEGMENT current; + PCACHE_SEGMENT current; DPRINT("CcCopyRead(FileObject %x, FileOffset %x, " "Length %d, Wait %d, Buffer %x, IoStatus %x)\n", @@ -280,7 +285,7 @@ CcCopyRead (IN PFILE_OBJECT FileObject, current_entry = Bcb->BcbSegmentListHead.Flink; while (current_entry != &Bcb->BcbSegmentListHead) { - current = CONTAINING_RECORD(current_entry, ROS_CACHE_SEGMENT, + current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); if (!current->Valid && current->FileOffset < ReadOffset + Length && current->FileOffset + Bcb->CacheSegmentSize > ReadOffset) @@ -353,9 +358,9 @@ CcCopyWrite (IN PFILE_OBJECT FileObject, NTSTATUS Status; ULONG WriteOffset; KIRQL oldirql; - PROS_BCB Bcb; + PBCB Bcb; PLIST_ENTRY current_entry; - PROS_CACHE_SEGMENT CacheSeg; + PCACHE_SEGMENT CacheSeg; ULONG TempLength; PVOID BaseAddress; BOOLEAN Valid; @@ -374,7 +379,7 @@ CcCopyWrite (IN PFILE_OBJECT FileObject, current_entry = Bcb->BcbSegmentListHead.Flink; while (current_entry != &Bcb->BcbSegmentListHead) { - CacheSeg = CONTAINING_RECORD(current_entry, ROS_CACHE_SEGMENT, + CacheSeg = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); if (!CacheSeg->Valid) { @@ -470,28 +475,28 @@ CcZeroData (IN PFILE_OBJECT FileObject, /* * FIXME: NT uses the shared cache map field for cached/non cached detection */ - if (FileObject->SectionObjectPointer->SharedCacheMap == NULL) + if (FileObject->SectionObjectPointers->SharedCacheMap == NULL) { /* File is not cached */ WriteOffset.QuadPart = StartOffset->QuadPart; while (Length > 0) { - if (Length + WriteOffset.u.LowPart % PAGE_SIZE > 262144) + if (Length + WriteOffset.u.LowPart % PAGESIZE > 262144) { Mdl = MmCreateMdl(NULL, (PVOID)WriteOffset.u.LowPart, - 262144 - WriteOffset.u.LowPart % PAGE_SIZE); + 262144 - WriteOffset.u.LowPart % PAGESIZE); WriteOffset.QuadPart += - (262144 - WriteOffset.u.LowPart % PAGE_SIZE); - Length -= (262144 - WriteOffset.u.LowPart % PAGE_SIZE); + (262144 - WriteOffset.u.LowPart % PAGESIZE); + Length -= (262144 - WriteOffset.u.LowPart % PAGESIZE); } else { Mdl = MmCreateMdl(NULL, (PVOID)WriteOffset.u.LowPart, - Length - WriteOffset.u.LowPart % PAGE_SIZE); + Length - WriteOffset.u.LowPart % PAGESIZE); WriteOffset.QuadPart += - (Length - WriteOffset.u.LowPart % PAGE_SIZE); + (Length - WriteOffset.u.LowPart % PAGESIZE); Length = 0; } if (Mdl == NULL) @@ -520,9 +525,9 @@ CcZeroData (IN PFILE_OBJECT FileObject, { /* File is cached */ KIRQL oldirql; - PROS_BCB Bcb; + PBCB Bcb; PLIST_ENTRY current_entry; - PROS_CACHE_SEGMENT CacheSeg, current, previous; + PCACHE_SEGMENT CacheSeg, current, previous; ULONG TempLength; ULONG Start; ULONG count; @@ -538,7 +543,7 @@ CcZeroData (IN PFILE_OBJECT FileObject, current_entry = Bcb->BcbSegmentListHead.Flink; while (current_entry != &Bcb->BcbSegmentListHead) { - CacheSeg = CONTAINING_RECORD(current_entry, ROS_CACHE_SEGMENT, + CacheSeg = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); if (!CacheSeg->Valid) { @@ -628,11 +633,11 @@ CcZeroData (IN PFILE_OBJECT FileObject, Length -= TempLength; size = ((Mdl->Size - sizeof(MDL)) / sizeof(ULONG)); - for (i = 0; i < (Bcb->CacheSegmentSize / PAGE_SIZE) && + for (i = 0; i < (Bcb->CacheSegmentSize / PAGESIZE) && count < size; i++) { PVOID Address; - Address = current->BaseAddress + (i * PAGE_SIZE); + Address = current->BaseAddress + (i * PAGESIZE); page = MmGetPhysicalAddressForProcess(NULL, Address); ((PULONG)(Mdl + 1))[count++] = page.u.LowPart; diff --git a/reactos/ntoskrnl/cc/misc.c b/reactos/ntoskrnl/cc/misc.c index 722a5105640..40ce9d967c4 100644 --- a/reactos/ntoskrnl/cc/misc.c +++ b/reactos/ntoskrnl/cc/misc.c @@ -1,11 +1,16 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ /* FUNCTIONS *****************************************************************/ @@ -65,9 +70,9 @@ CcSetFileSizes (IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes) { KIRQL oldirql; - PROS_BCB Bcb; + PBCB Bcb; PLIST_ENTRY current_entry; - PROS_CACHE_SEGMENT current; + PCACHE_SEGMENT current; DPRINT("CcSetFileSizes(FileObject %x, FileSizes %x)\n", FileObject, FileSizes); @@ -85,7 +90,7 @@ CcSetFileSizes (IN PFILE_OBJECT FileObject, current_entry = Bcb->BcbSegmentListHead.Flink; while (current_entry != &Bcb->BcbSegmentListHead) { - current = CONTAINING_RECORD(current_entry, ROS_CACHE_SEGMENT, + current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); current_entry = current_entry->Flink; if (current->FileOffset > FileSizes->AllocationSize.QuadPart) diff --git a/reactos/ntoskrnl/cc/pin.c b/reactos/ntoskrnl/cc/pin.c index 8ccf0a66a35..1b954394da6 100644 --- a/reactos/ntoskrnl/cc/pin.c +++ b/reactos/ntoskrnl/cc/pin.c @@ -1,4 +1,4 @@ -/* $Id: pin.c,v 1.6 2002/09/07 15:12:47 chorns Exp $ +/* $Id: pin.c,v 1.7 2002/09/08 10:23:16 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,17 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define ROUND_DOWN(N, S) ((N) - ((N) % (S))) @@ -26,7 +31,7 @@ typedef struct _INTERNAL_BCB { PUBLIC_BCB PFCB; - PROS_CACHE_SEGMENT CacheSegment; + PCACHE_SEGMENT CacheSegment; BOOLEAN Dirty; } INTERNAL_BCB, *PINTERNAL_BCB; @@ -40,8 +45,8 @@ CcMapData (IN PFILE_OBJECT FileObject, { ULONG ReadOffset; BOOLEAN Valid; - PROS_BCB Bcb; - PROS_CACHE_SEGMENT CacheSeg; + PBCB Bcb; + PCACHE_SEGMENT CacheSeg; NTSTATUS Status; PINTERNAL_BCB iBcb; ULONG ROffset; diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index 9e8d5fa0a22..08c108f8670 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: view.c,v 1.48 2002/09/07 15:12:47 chorns Exp $ +/* $Id: view.c,v 1.49 2002/09/08 10:23:16 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/cc/view.c @@ -51,13 +51,16 @@ */ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include -extern void * alloca(size_t); - /* GLOBALS *******************************************************************/ #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) @@ -73,12 +76,12 @@ static LIST_ENTRY CacheSegmentLRUListHead; static FAST_MUTEX ViewLock; NTSTATUS STDCALL -CcRosInternalFreeCacheSegment(PROS_BCB Bcb, PROS_CACHE_SEGMENT CacheSeg); +CcRosInternalFreeCacheSegment(PBCB Bcb, PCACHE_SEGMENT CacheSeg); /* FUNCTIONS *****************************************************************/ NTSTATUS STATIC -CcRosFlushCacheSegment(PROS_CACHE_SEGMENT CacheSegment) +CcRosFlushCacheSegment(PCACHE_SEGMENT CacheSegment) { NTSTATUS Status; Status = WriteCacheSegment(CacheSegment); @@ -94,7 +97,7 @@ NTSTATUS CcRosFlushDirtyPages(ULONG Target, PULONG Count) { PLIST_ENTRY current_entry; - PROS_CACHE_SEGMENT current; + PCACHE_SEGMENT current; ULONG PagesPerSegment; BOOLEAN Locked; NTSTATUS Status; @@ -107,7 +110,7 @@ CcRosFlushDirtyPages(ULONG Target, PULONG Count) current_entry = DirtySegmentListHead.Flink; while (current_entry != &DirtySegmentListHead && Target > 0) { - current = CONTAINING_RECORD(current_entry, ROS_CACHE_SEGMENT, + current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, DirtySegmentListEntry); current_entry = current_entry->Flink; Locked = ExTryToAcquireFastMutex(¤t->Lock); @@ -123,7 +126,7 @@ CcRosFlushDirtyPages(ULONG Target, PULONG Count) } current->ReferenceCount++; ExReleaseFastMutex(&ViewLock); - PagesPerSegment = current->Bcb->CacheSegmentSize / PAGE_SIZE; + PagesPerSegment = current->Bcb->CacheSegmentSize / PAGESIZE; Status = CcRosFlushCacheSegment(current); current->ReferenceCount--; ExReleaseFastMutex(¤t->Lock); @@ -154,7 +157,7 @@ CcRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed) */ { PLIST_ENTRY current_entry; - PROS_CACHE_SEGMENT current; + PCACHE_SEGMENT current; ULONG PagesPerSegment; ULONG PagesFreed; BOOLEAN Locked; @@ -167,7 +170,7 @@ CcRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed) current_entry = CacheSegmentLRUListHead.Flink; while (current_entry != &CacheSegmentLRUListHead && Target > 0) { - current = CONTAINING_RECORD(current_entry, ROS_CACHE_SEGMENT, + current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, CacheSegmentLRUListEntry); current_entry = current_entry->Flink; Locked = ExTryToAcquireFastMutex(¤t->Lock); @@ -184,7 +187,7 @@ CcRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed) ExReleaseFastMutex(¤t->Lock); DPRINT("current->Bcb->CacheSegmentSize %d\n", current->Bcb->CacheSegmentSize); - PagesPerSegment = current->Bcb->CacheSegmentSize / PAGE_SIZE; + PagesPerSegment = current->Bcb->CacheSegmentSize / PAGESIZE; CcRosInternalFreeCacheSegment(current->Bcb, current); DPRINT("CcRosTrimCache(): Freed %d\n", PagesPerSegment); PagesFreed = min(PagesPerSegment, Target); @@ -197,8 +200,8 @@ CcRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed) } NTSTATUS STDCALL -CcRosReleaseCacheSegment(PROS_BCB Bcb, - PROS_CACHE_SEGMENT CacheSeg, +CcRosReleaseCacheSegment(PBCB Bcb, + PCACHE_SEGMENT CacheSeg, BOOLEAN Valid, BOOLEAN Dirty, BOOLEAN Mapped) @@ -231,17 +234,17 @@ CcRosReleaseCacheSegment(PROS_BCB Bcb, return(STATUS_SUCCESS); } -PROS_CACHE_SEGMENT CcRosLookupCacheSegment(PROS_BCB Bcb, ULONG FileOffset) +PCACHE_SEGMENT CcRosLookupCacheSegment(PBCB Bcb, ULONG FileOffset) { PLIST_ENTRY current_entry; - PROS_CACHE_SEGMENT current; + PCACHE_SEGMENT current; KIRQL oldIrql; KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); current_entry = Bcb->BcbSegmentListHead.Flink; while (current_entry != &Bcb->BcbSegmentListHead) { - current = CONTAINING_RECORD(current_entry, ROS_CACHE_SEGMENT, + current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); if (current->FileOffset <= FileOffset && (current->FileOffset + Bcb->CacheSegmentSize) > FileOffset) @@ -256,9 +259,9 @@ PROS_CACHE_SEGMENT CcRosLookupCacheSegment(PROS_BCB Bcb, ULONG FileOffset) } NTSTATUS -CcRosMarkDirtyCacheSegment(PROS_BCB Bcb, ULONG FileOffset) +CcRosMarkDirtyCacheSegment(PBCB Bcb, ULONG FileOffset) { - PROS_CACHE_SEGMENT CacheSeg; + PCACHE_SEGMENT CacheSeg; ExAcquireFastMutex(&ViewLock); CacheSeg = CcRosLookupCacheSegment(Bcb, FileOffset); @@ -278,9 +281,9 @@ CcRosMarkDirtyCacheSegment(PROS_BCB Bcb, ULONG FileOffset) } NTSTATUS -CcRosSuggestFreeCacheSegment(PROS_BCB Bcb, ULONG FileOffset, BOOLEAN NowDirty) +CcRosSuggestFreeCacheSegment(PBCB Bcb, ULONG FileOffset, BOOLEAN NowDirty) { - PROS_CACHE_SEGMENT CacheSeg; + PCACHE_SEGMENT CacheSeg; ExAcquireFastMutex(&ViewLock); CacheSeg = CcRosLookupCacheSegment(Bcb, FileOffset); @@ -307,9 +310,9 @@ CcRosSuggestFreeCacheSegment(PROS_BCB Bcb, ULONG FileOffset, BOOLEAN NowDirty) } NTSTATUS -CcRosUnmapCacheSegment(PROS_BCB Bcb, ULONG FileOffset, BOOLEAN NowDirty) +CcRosUnmapCacheSegment(PBCB Bcb, ULONG FileOffset, BOOLEAN NowDirty) { - PROS_CACHE_SEGMENT CacheSeg; + PCACHE_SEGMENT CacheSeg; ExAcquireFastMutex(&ViewLock); CacheSeg = CcRosLookupCacheSegment(Bcb, FileOffset); @@ -329,17 +332,17 @@ CcRosUnmapCacheSegment(PROS_BCB Bcb, ULONG FileOffset, BOOLEAN NowDirty) } NTSTATUS STATIC -CcRosCreateCacheSegment(PROS_BCB Bcb, +CcRosCreateCacheSegment(PBCB Bcb, ULONG FileOffset, - PROS_CACHE_SEGMENT* CacheSeg, + PCACHE_SEGMENT* CacheSeg, BOOLEAN Lock) { ULONG i; - PROS_CACHE_SEGMENT current; + PCACHE_SEGMENT current; NTSTATUS Status; KIRQL oldIrql; - current = ExAllocatePoolWithTag(NonPagedPool, sizeof(ROS_CACHE_SEGMENT), + current = ExAllocatePoolWithTag(NonPagedPool, sizeof(CACHE_SEGMENT), TAG_CSEG); MmLockAddressSpace(MmGetKernelAddressSpace()); @@ -378,7 +381,7 @@ CcRosCreateCacheSegment(PROS_BCB Bcb, ExAcquireFastMutex(¤t->Lock); } ExReleaseFastMutex(&ViewLock); - for (i = 0; i < (Bcb->CacheSegmentSize / PAGE_SIZE); i++) + for (i = 0; i < (Bcb->CacheSegmentSize / PAGESIZE); i++) { PHYSICAL_ADDRESS Page; @@ -389,7 +392,7 @@ CcRosCreateCacheSegment(PROS_BCB Bcb, } Status = MmCreateVirtualMapping(NULL, - current->BaseAddress + (i * PAGE_SIZE), + current->BaseAddress + (i * PAGESIZE), PAGE_READWRITE, Page, TRUE); @@ -403,19 +406,19 @@ CcRosCreateCacheSegment(PROS_BCB Bcb, } NTSTATUS -CcRosGetCacheSegmentChain(PROS_BCB Bcb, +CcRosGetCacheSegmentChain(PBCB Bcb, ULONG FileOffset, ULONG Length, - PROS_CACHE_SEGMENT* CacheSeg) + PCACHE_SEGMENT* CacheSeg) { - PROS_CACHE_SEGMENT current; + PCACHE_SEGMENT current; ULONG i; - PROS_CACHE_SEGMENT* CacheSegList; - PROS_CACHE_SEGMENT Previous; + PCACHE_SEGMENT* CacheSegList; + PCACHE_SEGMENT Previous; Length = ROUND_UP(Length, Bcb->CacheSegmentSize); - CacheSegList = alloca(sizeof(PROS_CACHE_SEGMENT) * + CacheSegList = alloca(sizeof(PCACHE_SEGMENT) * (Length / Bcb->CacheSegmentSize)); /* @@ -467,14 +470,14 @@ CcRosGetCacheSegmentChain(PROS_BCB Bcb, } NTSTATUS -CcRosGetCacheSegment(PROS_BCB Bcb, +CcRosGetCacheSegment(PBCB Bcb, ULONG FileOffset, PULONG BaseOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, - PROS_CACHE_SEGMENT* CacheSeg) + PCACHE_SEGMENT* CacheSeg) { - PROS_CACHE_SEGMENT current; + PCACHE_SEGMENT current; NTSTATUS Status; /* @@ -522,11 +525,11 @@ CcRosGetCacheSegment(PROS_BCB Bcb, } NTSTATUS STDCALL -CcRosRequestCacheSegment(PROS_BCB Bcb, +CcRosRequestCacheSegment(PBCB Bcb, ULONG FileOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, - PROS_CACHE_SEGMENT* CacheSeg) + PCACHE_SEGMENT* CacheSeg) /* * FUNCTION: Request a page mapping for a BCB */ @@ -560,7 +563,7 @@ CcFreeCachePage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, } NTSTATUS STDCALL -CcRosInternalFreeCacheSegment(PROS_BCB Bcb, PROS_CACHE_SEGMENT CacheSeg) +CcRosInternalFreeCacheSegment(PBCB Bcb, PCACHE_SEGMENT CacheSeg) /* * FUNCTION: Releases a cache segment associated with a BCB */ @@ -581,7 +584,7 @@ CcRosInternalFreeCacheSegment(PROS_BCB Bcb, PROS_CACHE_SEGMENT CacheSeg) } NTSTATUS STDCALL -CcRosFreeCacheSegment(PROS_BCB Bcb, PROS_CACHE_SEGMENT CacheSeg) +CcRosFreeCacheSegment(PBCB Bcb, PCACHE_SEGMENT CacheSeg) { NTSTATUS Status; ExAcquireFastMutex(&ViewLock); @@ -591,13 +594,13 @@ CcRosFreeCacheSegment(PROS_BCB Bcb, PROS_CACHE_SEGMENT CacheSeg) } NTSTATUS STDCALL -CcRosDeleteFileCache(PFILE_OBJECT FileObject, PROS_BCB Bcb) +CcRosDeleteFileCache(PFILE_OBJECT FileObject, PBCB Bcb) /* * FUNCTION: Releases the BCB associated with a file object */ { PLIST_ENTRY current_entry; - PROS_CACHE_SEGMENT current; + PCACHE_SEGMENT current; NTSTATUS Status; DPRINT("CcRosDeleteFileCache(FileObject %x, Bcb %x)\n", Bcb->FileObject, @@ -612,7 +615,7 @@ CcRosDeleteFileCache(PFILE_OBJECT FileObject, PROS_BCB Bcb) while (current_entry != &Bcb->BcbSegmentListHead) { current = - CONTAINING_RECORD(current_entry, ROS_CACHE_SEGMENT, BcbSegmentListEntry); + CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); if (current->Dirty) { Status = WriteCacheSegment(current); @@ -634,11 +637,11 @@ CcRosDeleteFileCache(PFILE_OBJECT FileObject, PROS_BCB Bcb) while (current_entry != &Bcb->BcbSegmentListHead) { current = - CONTAINING_RECORD(current_entry, ROS_CACHE_SEGMENT, BcbSegmentListEntry); + CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); current_entry = current_entry->Flink; CcRosFreeCacheSegment(Bcb, current); } - FileObject->SectionObjectPointer->SharedCacheMap = NULL; + FileObject->SectionObjectPointers->SharedCacheMap = NULL; ObDereferenceObject (Bcb->FileObject); ExFreePool(Bcb); @@ -648,7 +651,7 @@ CcRosDeleteFileCache(PFILE_OBJECT FileObject, PROS_BCB Bcb) VOID CcRosReferenceCache(PFILE_OBJECT FileObject) { KIRQL oldIrql; - PROS_BCB Bcb = (PROS_BCB)FileObject->SectionObjectPointer->SharedCacheMap; + PBCB Bcb = (PBCB)FileObject->SectionObjectPointers->SharedCacheMap; KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); Bcb->RefCount++; KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); @@ -657,7 +660,7 @@ VOID CcRosReferenceCache(PFILE_OBJECT FileObject) VOID CcRosDereferenceCache(PFILE_OBJECT FileObject) { KIRQL oldIrql; - PROS_BCB Bcb = (PROS_BCB)FileObject->SectionObjectPointer->SharedCacheMap; + PBCB Bcb = (PBCB)FileObject->SectionObjectPointers->SharedCacheMap; KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); Bcb->RefCount--; KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); @@ -668,14 +671,14 @@ VOID CcRosDereferenceCache(PFILE_OBJECT FileObject) } NTSTATUS STDCALL -CcRosReleaseFileCache(PFILE_OBJECT FileObject, PROS_BCB Bcb) +CcRosReleaseFileCache(PFILE_OBJECT FileObject, PBCB Bcb) /* * FUNCTION: Called by the file system when a handle to a file object * has been closed. */ { KIRQL oldIrql; - if (FileObject->SectionObjectPointer->SharedCacheMap != NULL) + if (FileObject->SectionObjectPointers->SharedCacheMap != NULL) { KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); if (FileObject->PrivateCacheMap != NULL) @@ -694,7 +697,7 @@ CcRosReleaseFileCache(PFILE_OBJECT FileObject, PROS_BCB Bcb) NTSTATUS STDCALL CcRosInitializeFileCache(PFILE_OBJECT FileObject, - PROS_BCB* Bcb, + PBCB* Bcb, ULONG CacheSegmentSize) /* * FUNCTION: Initializes a BCB for a file object @@ -703,7 +706,7 @@ CcRosInitializeFileCache(PFILE_OBJECT FileObject, KIRQL oldIrql; if (*Bcb == NULL) { - (*Bcb) = ExAllocatePoolWithTag(NonPagedPool, sizeof(ROS_BCB), TAG_BCB); + (*Bcb) = ExAllocatePoolWithTag(NonPagedPool, sizeof(BCB), TAG_BCB); if ((*Bcb) == NULL) { return(STATUS_UNSUCCESSFUL); @@ -724,7 +727,7 @@ CcRosInitializeFileCache(PFILE_OBJECT FileObject, } KeInitializeSpinLock(&(*Bcb)->BcbLock); InitializeListHead(&(*Bcb)->BcbSegmentListHead); - FileObject->SectionObjectPointer->SharedCacheMap = *Bcb; + FileObject->SectionObjectPointers->SharedCacheMap = *Bcb; } KeAcquireSpinLock(&(*Bcb)->BcbLock, &oldIrql); if (FileObject->PrivateCacheMap == NULL) diff --git a/reactos/ntoskrnl/cm/cm.h b/reactos/ntoskrnl/cm/cm.h index c86c83af452..2299fb8c7a1 100644 --- a/reactos/ntoskrnl/cm/cm.h +++ b/reactos/ntoskrnl/cm/cm.h @@ -496,11 +496,4 @@ CmiAddFree(PREGISTRY_HIVE RegistryHive, NTSTATUS CmiInitHives(BOOLEAN SetUpBoot); -NTSTATUS STDCALL -CmiObjectParse(PVOID ParsedObject, - PVOID *NextObject, - PUNICODE_STRING FullPath, - PWSTR *Path, - ULONG Attributes); - #endif /*__INCLUDE_CM_H*/ diff --git a/reactos/ntoskrnl/cm/import.c b/reactos/ntoskrnl/cm/import.c index 8b18b6d3a86..3a838b3fa06 100644 --- a/reactos/ntoskrnl/cm/import.c +++ b/reactos/ntoskrnl/cm/import.c @@ -1,4 +1,4 @@ -/* $Id: import.c,v 1.7 2002/09/07 15:12:47 chorns Exp $ +/* $Id: import.c,v 1.8 2002/09/08 10:23:17 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -7,12 +7,20 @@ * PROGRAMMERS: Rex Jolliff */ -#include -#include "cm.h" +#include + +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include +#include "cm.h" static PCHAR checkAndSkipMagic (PCHAR regChunk) diff --git a/reactos/ntoskrnl/cm/ntfunc.c b/reactos/ntoskrnl/cm/ntfunc.c index 748d5a6b8bd..086317351bf 100644 --- a/reactos/ntoskrnl/cm/ntfunc.c +++ b/reactos/ntoskrnl/cm/ntfunc.c @@ -6,12 +6,18 @@ * UPDATE HISTORY: */ -#include -#include "cm.h" +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include +#include "cm.h" extern POBJECT_TYPE CmiKeyType; extern PREGISTRY_HIVE CmiVolatileHive; @@ -86,7 +92,7 @@ NtCreateKey(OUT PHANDLE KeyHandle, DPRINT("RemainingPath %S ParentObject %x\n", RemainingPath.Buffer, Object); - Status = ObRosCreateObject(KeyHandle, + Status = ObCreateObject(KeyHandle, DesiredAccess, NULL, CmiKeyType, @@ -396,8 +402,6 @@ NtEnumerateKey( } } break; - default: - assert(FALSE); } CmiReleaseBlock(RegistryHive, SubKeyCell); ObDereferenceObject (KeyObject); @@ -565,8 +569,6 @@ NtEnumerateValueKey(IN HANDLE KeyHandle, } } break; - default: - assert(FALSE); } } else @@ -767,7 +769,7 @@ END FIXME*/ /* Change version in header */ RegistryHive->HiveHeader->VersionOld = RegistryHive->HiveHeader->Version; - ZwQuerySystemTime((PLARGE_INTEGER)&RegistryHive->HiveHeader->DateModified); + ZwQuerySystemTime((PTIME) &RegistryHive->HiveHeader->DateModified); /* Calculate checksum */ RegistryHive->HiveHeader->Checksum = 0; @@ -1006,8 +1008,6 @@ NtQueryKey(IN HANDLE KeyHandle, *ResultLength = sizeof(KEY_FULL_INFORMATION) + KeyCell->ClassSize; } break; - default: - assert(FALSE); } ObDereferenceObject(KeyObject); @@ -1169,8 +1169,6 @@ NtQueryValueKey(IN HANDLE KeyHandle, } } break; - default: - assert(FALSE); } } else @@ -1291,7 +1289,7 @@ NtSetValueKey(IN HANDLE KeyHandle, /* Update time of heap */ if (IsPermanentHive(RegistryHive)) { - ZwQuerySystemTime((PLARGE_INTEGER) &pBin->DateModified); + ZwQuerySystemTime((PTIME) &pBin->DateModified); } } else @@ -1323,7 +1321,7 @@ NtSetValueKey(IN HANDLE KeyHandle, /* Update time of heap */ if (IsPermanentHive(RegistryHive) && CmiGetBlock(RegistryHive, VBOffset, &pBin)) { - ZwQuerySystemTime((PLARGE_INTEGER) &pBin->DateModified); + ZwQuerySystemTime((PTIME) &pBin->DateModified); } } diff --git a/reactos/ntoskrnl/cm/regfile.c b/reactos/ntoskrnl/cm/regfile.c index 77609e560c9..db8913559cf 100644 --- a/reactos/ntoskrnl/cm/regfile.c +++ b/reactos/ntoskrnl/cm/regfile.c @@ -6,12 +6,20 @@ * UPDATE HISTORY: */ -#include -#include "cm.h" +#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include +#include "cm.h" + BOOLEAN CmiDoVerify = FALSE; @@ -57,7 +65,7 @@ CmiCreateDefaultRootKeyCell(PKEY_CELL RootKeyCell) RootKeyCell->CellSize = -sizeof(KEY_CELL); RootKeyCell->Id = REG_KEY_CELL_ID; RootKeyCell->Type = REG_ROOT_KEY_CELL_TYPE; - ZwQuerySystemTime((PLARGE_INTEGER) &RootKeyCell->LastWriteTime); + ZwQuerySystemTime((PTIME) &RootKeyCell->LastWriteTime); RootKeyCell->ParentKeyOffset = 0; RootKeyCell->NumberOfSubKeys = 0; RootKeyCell->HashTableOffset = -1; @@ -1051,7 +1059,7 @@ CmiAddSubKey(PREGISTRY_HIVE RegistryHive, { NewKeyCell->Id = REG_KEY_CELL_ID; NewKeyCell->Type = REG_KEY_CELL_TYPE; - ZwQuerySystemTime((PLARGE_INTEGER) &NewKeyCell->LastWriteTime); + ZwQuerySystemTime((PTIME) &NewKeyCell->LastWriteTime); NewKeyCell->ParentKeyOffset = -1; NewKeyCell->NumberOfSubKeys = 0; NewKeyCell->HashTableOffset = -1; @@ -1505,7 +1513,7 @@ CmiDestroyValueCell(PREGISTRY_HIVE RegistryHive, /* Update time of heap */ if (IsPermanentHive(RegistryHive)) - ZwQuerySystemTime((PLARGE_INTEGER) &pBin->DateModified); + ZwQuerySystemTime((PTIME) &pBin->DateModified); } Status = CmiDestroyBlock(RegistryHive, ValueCell, VBOffset); @@ -1513,7 +1521,7 @@ CmiDestroyValueCell(PREGISTRY_HIVE RegistryHive, /* Update time of heap */ if (IsPermanentHive(RegistryHive) && CmiGetBlock(RegistryHive, VBOffset, &pBin)) { - ZwQuerySystemTime((PLARGE_INTEGER) &pBin->DateModified); + ZwQuerySystemTime((PTIME) &pBin->DateModified); } return Status; @@ -1540,7 +1548,7 @@ CmiAddBin(PREGISTRY_HIVE RegistryHive, RegistryHive->FileSize += REG_BLOCK_SIZE; tmpBin->BlockSize = REG_BLOCK_SIZE; tmpBin->Unused1 = 0; - ZwQuerySystemTime((PLARGE_INTEGER) &tmpBin->DateModified); + ZwQuerySystemTime((PTIME) &tmpBin->DateModified); tmpBin->Unused2 = 0; /* Increase size of list of blocks */ @@ -1631,7 +1639,7 @@ CmiAllocateBlock(PREGISTRY_HIVE RegistryHive, Temp = CmiGetBlock(RegistryHive, RegistryHive->FreeListOffset[i], &pBin); if (Temp) - ZwQuerySystemTime((PLARGE_INTEGER) &pBin->DateModified); + ZwQuerySystemTime((PTIME) &pBin->DateModified); if ((i + 1) < RegistryHive->FreeListSize) { @@ -1707,7 +1715,7 @@ CmiDestroyBlock(PREGISTRY_HIVE RegistryHive, /* Update time of heap */ if (IsPermanentHive(RegistryHive) && CmiGetBlock(RegistryHive, Offset,&pBin)) - ZwQuerySystemTime((PLARGE_INTEGER) &pBin->DateModified); + ZwQuerySystemTime((PTIME) &pBin->DateModified); /* FIXME: Set first dword to block_offset of another free block ? */ /* FIXME: Concatenate with previous and next block if free */ diff --git a/reactos/ntoskrnl/cm/registry.c b/reactos/ntoskrnl/cm/registry.c index 585063740b0..09ec1eb5160 100644 --- a/reactos/ntoskrnl/cm/registry.c +++ b/reactos/ntoskrnl/cm/registry.c @@ -1,4 +1,4 @@ -/* $Id: registry.c,v 1.75 2002/09/07 15:12:48 chorns Exp $ +/* $Id: registry.c,v 1.76 2002/09/08 10:23:17 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,17 @@ * Created 22/05/98 */ -#include -#include "cm.h" +#include +#include +#include +#include +#include +#include #define NDEBUG #include +#include "cm.h" /* ------------------------------------------------- File Statics */ @@ -269,7 +274,7 @@ CmInitializeRegistry(VOID) /* Build the Root Key Object */ RtlInitUnicodeString(&RootKeyName, REG_ROOT_KEY_NAME); InitializeObjectAttributes(&ObjectAttributes, &RootKeyName, 0, NULL, NULL); - Status = ObRosCreateObject(&RootKeyHandle, + Status = ObCreateObject(&RootKeyHandle, STANDARD_RIGHTS_REQUIRED, &ObjectAttributes, CmiKeyType, @@ -299,7 +304,7 @@ CmInitializeRegistry(VOID) /* Create initial predefined symbolic links */ /* HKEY_LOCAL_MACHINE */ - Status = ObRosCreateObject(&KeyHandle, + Status = ObCreateObject(&KeyHandle, STANDARD_RIGHTS_REQUIRED, NULL, CmiKeyType, @@ -326,7 +331,7 @@ CmInitializeRegistry(VOID) CmiMachineKey = NewKey; /* HKEY_USERS */ - Status = ObRosCreateObject(&KeyHandle, + Status = ObCreateObject(&KeyHandle, STANDARD_RIGHTS_REQUIRED, NULL, CmiKeyType, @@ -353,7 +358,7 @@ CmInitializeRegistry(VOID) CmiUserKey = NewKey; /* Create '\\Registry\\Machine\\HARDWARE' key. */ - Status = ObRosCreateObject(&KeyHandle, + Status = ObCreateObject(&KeyHandle, STANDARD_RIGHTS_REQUIRED, NULL, CmiKeyType, @@ -380,7 +385,7 @@ CmInitializeRegistry(VOID) CmiHardwareKey = NewKey; /* Create '\\Registry\\Machine\\HARDWARE\\DESCRIPTION' key. */ - Status = ObRosCreateObject(&KeyHandle, + Status = ObCreateObject(&KeyHandle, STANDARD_RIGHTS_REQUIRED, NULL, CmiKeyType, @@ -406,7 +411,7 @@ CmInitializeRegistry(VOID) CmiAddKeyToList(CmiHardwareKey, NewKey); /* Create '\\Registry\\Machine\\HARDWARE\\DEVICEMAP' key. */ - Status = ObRosCreateObject(&KeyHandle, + Status = ObCreateObject(&KeyHandle, STANDARD_RIGHTS_REQUIRED, NULL, CmiKeyType, @@ -432,7 +437,7 @@ CmInitializeRegistry(VOID) CmiAddKeyToList(CmiHardwareKey,NewKey); /* Create '\\Registry\\Machine\\HARDWARE\\RESOURCEMAP' key. */ - Status = ObRosCreateObject(&KeyHandle, + Status = ObCreateObject(&KeyHandle, STANDARD_RIGHTS_REQUIRED, NULL, CmiKeyType, @@ -628,7 +633,7 @@ CmiConnectHive(PWSTR FileName, NULL, NULL); - Status = ObRosCreateObject(&KeyHandle, + Status = ObCreateObject(&KeyHandle, STANDARD_RIGHTS_REQUIRED, &ObjectAttributes, CmiKeyType, diff --git a/reactos/ntoskrnl/cm/regobj.c b/reactos/ntoskrnl/cm/regobj.c index f92db3e11bf..41cfcbd3ca2 100644 --- a/reactos/ntoskrnl/cm/regobj.c +++ b/reactos/ntoskrnl/cm/regobj.c @@ -6,12 +6,19 @@ * UPDATE HISTORY: */ -#include -#include "cm.h" +#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include +#include "cm.h" static NTSTATUS @@ -133,7 +140,7 @@ CmiObjectParse(PVOID ParsedObject, /* Create new key object and put into linked list */ DPRINT("CmiObjectParse %s\n", cPath); - Status = ObRosCreateObject(NULL, + Status = ObCreateObject(NULL, STANDARD_RIGHTS_REQUIRED, NULL, CmiKeyType, diff --git a/reactos/ntoskrnl/cm/rtlfunc.c b/reactos/ntoskrnl/cm/rtlfunc.c index b83ffe90361..52fa4de109c 100644 --- a/reactos/ntoskrnl/cm/rtlfunc.c +++ b/reactos/ntoskrnl/cm/rtlfunc.c @@ -6,12 +6,18 @@ * UPDATE HISTORY: */ -#include -#include "cm.h" +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include +#include "cm.h" NTSTATUS STDCALL RtlCheckRegistryKey(IN ULONG RelativeTo, @@ -55,8 +61,8 @@ RtlCreateRegistryKey(IN ULONG RelativeTo, NTSTATUS STDCALL RtlDeleteRegistryValue(IN ULONG RelativeTo, - IN PCWSTR Path, - IN PCWSTR ValueName) + IN PWSTR Path, + IN PWSTR ValueName) { HANDLE KeyHandle; NTSTATUS Status; @@ -119,7 +125,7 @@ RtlOpenCurrentUser(IN ACCESS_MASK DesiredAccess, NTSTATUS STDCALL RtlQueryRegistryValues(IN ULONG RelativeTo, - IN PCWSTR Path, + IN PWSTR Path, IN PRTL_QUERY_REGISTRY_TABLE QueryTable, IN PVOID Context, IN PVOID Environment) @@ -488,8 +494,8 @@ ByeBye: NTSTATUS STDCALL RtlWriteRegistryValue(IN ULONG RelativeTo, - IN PCWSTR Path, - IN PCWSTR ValueName, + IN PWSTR Path, + IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength) @@ -536,7 +542,7 @@ RtlFormatCurrentUserKeyPath(IN OUT PUNICODE_STRING KeyPath) NTSTATUS RtlpGetRegistryHandle(ULONG RelativeTo, - PCWSTR Path, + PWSTR Path, BOOLEAN Create, PHANDLE KeyHandle) { @@ -552,7 +558,7 @@ RtlpGetRegistryHandle(ULONG RelativeTo, PsGetCurrentProcessId(), KeyHandle, 0, - 0, + FALSE, DUPLICATE_SAME_ACCESS); return(Status); } diff --git a/reactos/ntoskrnl/dbg/dbgctrl.c b/reactos/ntoskrnl/dbg/dbgctrl.c index 33128a01dbb..6dbc5d27e82 100644 --- a/reactos/ntoskrnl/dbg/dbgctrl.c +++ b/reactos/ntoskrnl/dbg/dbgctrl.c @@ -25,12 +25,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS STDCALL @@ -44,6 +46,7 @@ NtSystemDebugControl(DEBUG_CONTROL_CODE ControlCode, switch (ControlCode) { case DebugGetTraceInformation: case DebugSetInternalBreakpoint: + case DebugSetSpecialCalls: case DebugClearSpecialCalls: case DebugQuerySpecialCalls: case DebugDbgBreakPoint: diff --git a/reactos/ntoskrnl/dbg/errinfo.c b/reactos/ntoskrnl/dbg/errinfo.c index 5fdcca92102..904c40998c1 100644 --- a/reactos/ntoskrnl/dbg/errinfo.c +++ b/reactos/ntoskrnl/dbg/errinfo.c @@ -27,27 +27,11 @@ /* INCLUDES ******************************************************************/ -#include - -#define NDEBUG +#include #include - /* GLOBALS *******************************************************************/ -#define DBG_GET_SHOW_FACILITY 0x0001 - -#define NTSTAT_SEVERITY_SHIFT 30 -#define NTSTAT_SEVERITY_MASK 0x00000003 -#define NTSTAT_FACILITY_SHIFT 16 -#define NTSTAT_FACILITY_MASK 0x00000FFF -#define NTSTAT_CUSTOMER_MASK 0x20000000 - -#define NT_SEVERITY(StatCode) (((StatCode) >> NTSTAT_SEVERITY_SHIFT) & NTSTAT_SEVERITY_MASK) -#define NT_FACILITY(StatCode) (((StatCode) >> NTSTAT_FACILITY_SHIFT) & NTSTAT_FACILITY_MASK) -#define NT_CUSTOMER(StatCode) ((StatCode) & NTSTAT_CUSTOMER_MASK) - - static PCHAR SeverityCodes[] = {"SUC", "INF", "ERR", "WRN"}; static struct _FACLIST @@ -76,7 +60,7 @@ static struct _ERRLIST {STATUS_SECTION_NOT_IMAGE, "SECTION_NOT_IMAGE", NULL}, {STATUS_BAD_WORKING_SET_LIMIT, "BAD_WORKING_SET_LIMIT", NULL}, {STATUS_INCOMPATIBLE_FILE_MAP, "INCOMPATIBLE_FILE_MAP", NULL}, -// {STATUS_HANDLE_NOT_WAITABLE, "HANDLE_NOT_WAITABLE", NULL}, + {STATUS_HANDLE_NOT_WAITABLE, "HANDLE_NOT_WAITABLE", NULL}, {STATUS_PORT_DISCONNECTED, "PORT_DISCONNECTED", NULL}, {STATUS_NOT_LOCKED, "NOT_LOCKED", NULL}, {STATUS_NOT_MAPPED_VIEW, "NOT_MAPPED_VIEW", NULL}, @@ -119,7 +103,7 @@ static struct _ERRLIST {STATUS_SECTION_TOO_BIG, "SECTION_TOO_BIG", NULL}, {RPC_NT_SS_IN_NULL_CONTEXT, "RPC_NT_SS_IN_NULL_CONTEXT", NULL}, {RPC_NT_INVALID_BINDING, "RPC_NT_INVALID_BINDING", NULL}, - //{STATUS_OBJECT_FILE_MISMATCH, "OBJECT_FILE_MISMATCH", NULL}, + {STATUS_OBJECT_FILE_MISMATCH, "OBJECT_FILE_MISMATCH", NULL}, {STATUS_FILE_CLOSED, "FILE_CLOSED", NULL}, {STATUS_INVALID_PORT_HANDLE, "INVALID_PORT_HANDLE", NULL}, {STATUS_NOT_COMMITTED, "NOT_COMMITTED", NULL}, @@ -136,7 +120,7 @@ static struct _ERRLIST {STATUS_INVALID_PARAMETER_10, "INVALID_PARAMETER_10", NULL}, {STATUS_INVALID_PARAMETER_11, "INVALID_PARAMETER_11", NULL}, {STATUS_INVALID_PARAMETER_12, "INVALID_PARAMETER_12", NULL}, - //{STATUS_INVALID_PARAMETER_MAX, "INVALID_PARAMETER_MAX", NULL}, + {STATUS_INVALID_PARAMETER_MAX, "INVALID_PARAMETER_MAX", NULL}, {STATUS_INVALID_PAGE_PROTECTION, "INVALID_PAGE_PROTECTION", NULL}, {STATUS_RESOURCE_DATA_NOT_FOUND, "RESOURCE_DATA_NOT_FOUND", NULL}, {STATUS_RESOURCE_TYPE_NOT_FOUND, "RESOURCE_TYPE_NOT_FOUND", NULL}, @@ -152,7 +136,7 @@ static struct _ERRLIST {STATUS_NO_MEDIA_IN_DEVICE, "NO_MEDIA_IN_DEVICE", NULL}, {STATUS_NONEXISTENT_SECTOR, "NONEXISTENT_SECTOR", NULL}, {STATUS_WORKING_SET_QUOTA, "WORKING_SET_QUOTA", NULL}, - //{STATUS_CONFLICTING_ADDRESS, "CONFLICTING_ADDRESS", NULL}, + {STATUS_CONFLICTING_ADDRESS, "CONFLICTING_ADDRESS", NULL}, {STATUS_INVALID_SYSTEM_SERVICE, "INVALID_SYSTEM_SERVICE", NULL}, {STATUS_THREAD_IS_TERMINATING, "THREAD_IS_TERMINATING", NULL}, {STATUS_PROCESS_IS_TERMINATING, "PROCESS_IS_TERMINATING", NULL}, @@ -181,7 +165,7 @@ static struct _ERRLIST {STATUS_OBJECT_PATH_INVALID, "OBJECT_PATH_INVALID", NULL}, {STATUS_OBJECT_PATH_NOT_FOUND, "OBJECT_PATH_NOT_FOUND", NULL}, {STATUS_DFS_EXIT_PATH_FOUND, "DFS_EXIT_PATH_FOUND", NULL}, - //{STATUS_PATH_SYNTAX_BAD, "PATH_SYNTAX_BAD", NULL}, + {STATUS_PATH_SYNTAX_BAD, "PATH_SYNTAX_BAD", NULL}, {STATUS_DATA_OVERRUN, "DATA_OVERRUN", NULL}, {STATUS_DATA_LATE_ERROR, "DATA_LATE_ERROR", NULL}, {STATUS_DATA_ERROR, "DATA_ERROR", NULL}, @@ -195,14 +179,14 @@ static struct _ERRLIST {STATUS_DEVICE_NOT_READY, "DEVICE_NOT_READY", NULL}, {STATUS_IO_TIMEOUT, "IO_TIMEOUT", NULL}, {STATUS_MEDIA_WRITE_PROTECTED, "MEDIA_WRITE_PROTECTED", NULL}, - //{STATUS_NO_MEDIA_IN_DRIVE, "NO_MEDIA_IN_DRIVE", NULL}, + {STATUS_NO_MEDIA_IN_DRIVE, "NO_MEDIA_IN_DRIVE", NULL}, {STATUS_VERIFY_REQUIRED, "VERIFY_REQUIRED", NULL}, {STATUS_UNRECOGNIZED_MEDIA, "UNRECOGNIZED_MEDIA", NULL}, {STATUS_UNRECOGNIZED_VOLUME, "UNRECOGNIZED_VOLUME", NULL}, {STATUS_FS_DRIVER_REQUIRED, "FS_DRIVER_REQUIRED", NULL}, {STATUS_NOT_SUPPORTED, "NOT_SUPPORTED", NULL}, {STATUS_DISK_OPERATION_FAILED, "DISK_OPERATION_FAILED", NULL}, -// {STATUS_FS_QUERY_REQUIRED, "FS_QUERY_REQUIRED", NULL}, + {STATUS_FS_QUERY_REQUIRED, "FS_QUERY_REQUIRED", NULL}, {0, NULL, NULL} }; diff --git a/reactos/ntoskrnl/dbg/kdb.c b/reactos/ntoskrnl/dbg/kdb.c index d9663be0e52..0de6c2a28af 100644 --- a/reactos/ntoskrnl/dbg/kdb.c +++ b/reactos/ntoskrnl/dbg/kdb.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: kdb.c,v 1.9 2002/09/07 15:12:48 chorns Exp $ +/* $Id: kdb.c,v 1.10 2002/09/08 10:23:18 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/dbg/kdb.c @@ -28,15 +28,17 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include #include #include +#include #include "kdb.h" #define NDEBUG #include - /* TYPES *********************************************************************/ /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/dbg/kdb.h b/reactos/ntoskrnl/dbg/kdb.h index fa44652a781..570759ea109 100644 --- a/reactos/ntoskrnl/dbg/kdb.h +++ b/reactos/ntoskrnl/dbg/kdb.h @@ -1,4 +1,4 @@ -CHAR +ULONG KdbTryGetCharKeyboard(VOID); VOID KdbEnter(VOID); diff --git a/reactos/ntoskrnl/dbg/kdb_keyboard.c b/reactos/ntoskrnl/dbg/kdb_keyboard.c index cc70c4e127e..087dc4a8a4c 100644 --- a/reactos/ntoskrnl/dbg/kdb_keyboard.c +++ b/reactos/ntoskrnl/dbg/kdb_keyboard.c @@ -26,12 +26,13 @@ /* INCLUDES ****************************************************************/ -#include -#include "kdb.h" +#include +#include +#include +#include #define NDEBUG -#include - +#include #if 1 diff --git a/reactos/ntoskrnl/dbg/kdb_stabs.c b/reactos/ntoskrnl/dbg/kdb_stabs.c index f66e071482b..88b5bab15c1 100644 --- a/reactos/ntoskrnl/dbg/kdb_stabs.c +++ b/reactos/ntoskrnl/dbg/kdb_stabs.c @@ -27,8 +27,19 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/dbg/print.c b/reactos/ntoskrnl/dbg/print.c index e30e5518553..fc87ed02092 100644 --- a/reactos/ntoskrnl/dbg/print.c +++ b/reactos/ntoskrnl/dbg/print.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: print.c,v 1.15 2002/09/07 15:12:49 chorns Exp $ +/* $Id: print.c,v 1.16 2002/09/08 10:23:18 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -30,10 +30,8 @@ /* INCLUDES *****************************************************************/ -#include - -#define NDEBUG -#include +#include +#include /* FUNCTIONS ****************************************************************/ diff --git a/reactos/ntoskrnl/dbg/rdebug.c b/reactos/ntoskrnl/dbg/rdebug.c index 740acc05364..8a13523c410 100644 --- a/reactos/ntoskrnl/dbg/rdebug.c +++ b/reactos/ntoskrnl/dbg/rdebug.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: rdebug.c,v 1.2 2002/09/07 15:12:49 chorns Exp $ +/* $Id: rdebug.c,v 1.3 2002/09/08 10:23:18 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -29,11 +29,10 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG -#include - +#include /* GLOBALS ******************************************************************/ diff --git a/reactos/ntoskrnl/dbg/user.c b/reactos/ntoskrnl/dbg/user.c index e209967c20b..3641fff758d 100644 --- a/reactos/ntoskrnl/dbg/user.c +++ b/reactos/ntoskrnl/dbg/user.c @@ -26,12 +26,13 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID @@ -48,7 +49,7 @@ DbgkCreateThread(PVOID StartAddress) Message.Header.MessageSize = sizeof(LPC_DBG_MESSAGE); Message.Header.DataSize = sizeof(LPC_DBG_MESSAGE) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); Message.Type = DBG_EVENT_CREATE_THREAD; Message.Status = STATUS_SUCCESS; Message.Data.CreateThread.Reserved = 0; @@ -84,7 +85,7 @@ DbgkForwardException(EXCEPTION_RECORD Er, ULONG FirstChance) Message.Header.MessageSize = sizeof(LPC_DBG_MESSAGE); Message.Header.DataSize = sizeof(LPC_DBG_MESSAGE) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); Message.Type = DBG_EVENT_EXCEPTION; Message.Status = STATUS_SUCCESS; Message.Data.Exception.ExceptionRecord = Er; diff --git a/reactos/ntoskrnl/ex/btree.c b/reactos/ntoskrnl/ex/btree.c index 015ea23cbf9..98ab9a9f715 100644 --- a/reactos/ntoskrnl/ex/btree.c +++ b/reactos/ntoskrnl/ex/btree.c @@ -24,13 +24,12 @@ * UPDATE HISTORY: * 15-03-2002 CSH Created */ - -#include +#include +#include #define NDEBUG #include - /* DATA **********************************************************************/ typedef struct _BINARY_TREE_NODE diff --git a/reactos/ntoskrnl/ex/callback.c b/reactos/ntoskrnl/ex/callback.c index 2ac9534c2ac..514cb3865c3 100644 --- a/reactos/ntoskrnl/ex/callback.c +++ b/reactos/ntoskrnl/ex/callback.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: callback.c,v 1.7 2002/09/07 15:12:49 chorns Exp $ +/* $Id: callback.c,v 1.8 2002/09/08 10:23:19 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ex/callback.c @@ -35,12 +35,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS @@ -58,7 +56,7 @@ ExCreateCallback ( VOID STDCALL ExNotifyCallback ( - IN PCALLBACK_OBJECT CallbackObject, + IN PVOID CallbackObject, IN PVOID Argument1, IN PVOID Argument2 ) diff --git a/reactos/ntoskrnl/ex/fmutex.c b/reactos/ntoskrnl/ex/fmutex.c index d40f8a772e5..c24cd393dd8 100644 --- a/reactos/ntoskrnl/ex/fmutex.c +++ b/reactos/ntoskrnl/ex/fmutex.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: fmutex.c,v 1.16 2002/09/07 15:12:50 chorns Exp $ +/* $Id: fmutex.c,v 1.17 2002/09/08 10:23:19 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ex/fmutex.c @@ -29,12 +29,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID FASTCALL @@ -55,7 +53,7 @@ ExAcquireFastMutexUnsafe(PFAST_MUTEX FastMutex) } VOID FASTCALL -ExReleaseFastMutexUnsafe(IN PFAST_MUTEX FastMutex) +ExReleaseFastMutexUnsafe(PFAST_MUTEX FastMutex) { assert(FastMutex->Owner == KeGetCurrentThread()); FastMutex->Owner = NULL; diff --git a/reactos/ntoskrnl/ex/hashtab.c b/reactos/ntoskrnl/ex/hashtab.c index 79b5afe1bac..207fa443b4f 100644 --- a/reactos/ntoskrnl/ex/hashtab.c +++ b/reactos/ntoskrnl/ex/hashtab.c @@ -27,13 +27,12 @@ * UPDATE HISTORY: * 15-03-2002 CSH Created */ - -#include +#include +#include #define NDEBUG #include - /* FUNCTIONS ****************************************************************/ #define ExpHashTableSize(n) ((ULONG)1 << (n)) diff --git a/reactos/ntoskrnl/ex/i386/interlck.c b/reactos/ntoskrnl/ex/i386/interlck.c index a874c3b9961..639bfc04621 100644 --- a/reactos/ntoskrnl/ex/i386/interlck.c +++ b/reactos/ntoskrnl/ex/i386/interlck.c @@ -1,9 +1,9 @@ -/* $Id: interlck.c,v 1.3 2002/09/07 15:12:50 chorns Exp $ +/* $Id: interlck.c,v 1.4 2002/09/08 10:23:20 chorns Exp $ * * reactos/ntoskrnl/ex/i386/interlck.c * */ -#include +#include INTERLOCKED_RESULT FASTCALL @@ -64,11 +64,10 @@ __asm__("\n\t.global _Exi386InterlockedDecrementLong@4\n\t" "ret $4\n\t"); -#if 0 ULONG STDCALL Exi386InterlockedExchangeUlong(IN PULONG Target, IN ULONG Value); -#endif + __asm__("\n\t.global _Exi386InterlockedExchangeUlong@8\n\t" "_Exi386InterlockedExchangeUlong@8:\n\t" "movl 4(%esp),%edx\n\t" @@ -81,10 +80,8 @@ __asm__("\n\t.global _Exi386InterlockedExchangeUlong@8\n\t" * FASTCALL: @InterlockedIncrement@4 * STDCALL : _InterlockedIncrement@4 */ -#if 0 LONG FASTCALL InterlockedIncrement(PLONG Addend); -#endif /* * FUNCTION: Increments a caller supplied variable of type LONG as an * atomic operation @@ -105,10 +102,9 @@ __asm__("\n\t.global @InterlockedIncrement@4\n\t" * FASTCALL: @InterlockedDecrement@4 * STDCALL : _InterlockedDecrement@4 */ -#if 0 LONG FASTCALL InterlockedDecrement(PLONG Addend); -#endif + __asm__("\n\t.global @InterlockedDecrement@4\n\t" "@InterlockedDecrement@4:\n\t" "movl $-1,%eax\n\t" @@ -121,11 +117,11 @@ __asm__("\n\t.global @InterlockedDecrement@4\n\t" * FASTCALL: @InterlockedExchange@8 * STDCALL : _InterlockedExchange@8 */ -#if 0 + LONG FASTCALL InterlockedExchange(PLONG Target, LONG Value); -#endif + __asm__("\n\t.global @InterlockedExchange@8\n\t" "@InterlockedExchange@8:\n\t" "movl (%ecx),%eax\n" @@ -137,11 +133,10 @@ __asm__("\n\t.global @InterlockedExchange@8\n\t" * FASTCALL: @InterlockedExchangeAdd@8 * STDCALL: _InterlockedExchangeAdd@8 */ -#if 0 LONG FASTCALL InterlockedExchangeAdd(PLONG Addend, LONG Value); -#endif + __asm__("\n\t.global @InterlockedExchangeAdd@8\n\t" "@InterlockedExchangeAdd@8:\n\t" "xaddl %edx,(%ecx)\n\t" diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index 511fd4c2ec7..c9a8c3ed27e 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -26,12 +26,12 @@ * Created 11/09/99 */ -#include +#include +#include #define NDEBUG #include - /* DATA **********************************************************************/ /* FUNCTIONS ****************************************************************/ diff --git a/reactos/ntoskrnl/ex/interlck.c b/reactos/ntoskrnl/ex/interlck.c index 5f024bd4857..868e700debe 100644 --- a/reactos/ntoskrnl/ex/interlck.c +++ b/reactos/ntoskrnl/ex/interlck.c @@ -1,4 +1,4 @@ -/* $Id: interlck.c,v 1.8 2002/09/07 15:12:50 chorns Exp $ +/* $Id: interlck.c,v 1.9 2002/09/08 10:23:19 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,16 +11,11 @@ /* INCLUDES *****************************************************************/ -#include - -#define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ -#undef ExInterlockedDecrementLong - INTERLOCKED_RESULT STDCALL ExInterlockedDecrementLong (PLONG Addend, PKSPIN_LOCK Lock) @@ -42,8 +37,6 @@ ExInterlockedDecrementLong (PLONG Addend, } -#undef ExInterlockedExchangeUlong - ULONG STDCALL ExInterlockedExchangeUlong (PULONG Target, ULONG Value, @@ -66,7 +59,7 @@ ExInterlockedExchangeUlong (PULONG Target, } -ULONG FASTCALL +ULONG STDCALL ExInterlockedAddUlong (PULONG Addend, ULONG Increment, PKSPIN_LOCK Lock) @@ -132,8 +125,6 @@ ExInterlockedAddLargeInteger (PLARGE_INTEGER Addend, return oldval; } -#undef ExInterlockedIncrementLong - INTERLOCKED_RESULT STDCALL ExInterlockedIncrementLong (PLONG Addend, PKSPIN_LOCK Lock) diff --git a/reactos/ntoskrnl/ex/list.c b/reactos/ntoskrnl/ex/list.c index 1cd816c7c90..d5dee480e3b 100644 --- a/reactos/ntoskrnl/ex/list.c +++ b/reactos/ntoskrnl/ex/list.c @@ -1,4 +1,4 @@ -/* $Id: list.c,v 1.6 2002/09/07 15:12:50 chorns Exp $ +/* $Id: list.c,v 1.7 2002/09/08 10:23:19 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,16 +13,15 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG #include -static KSPIN_LOCK ExpGlobalInterlockedLock = 0; - /* FUNCTIONS *************************************************************/ -PLIST_ENTRY FASTCALL + +PLIST_ENTRY STDCALL ExInterlockedInsertHeadList(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry, PKSPIN_LOCK Lock) @@ -54,7 +53,7 @@ ExInterlockedInsertHeadList(PLIST_ENTRY ListHead, } -PLIST_ENTRY FASTCALL +PLIST_ENTRY STDCALL ExInterlockedInsertTailList(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry, PKSPIN_LOCK Lock) @@ -86,7 +85,7 @@ ExInterlockedInsertTailList(PLIST_ENTRY ListHead, } -PLIST_ENTRY FASTCALL +PLIST_ENTRY STDCALL ExInterlockedRemoveHeadList(PLIST_ENTRY Head, PKSPIN_LOCK Lock) /* @@ -113,7 +112,8 @@ ExInterlockedRemoveHeadList(PLIST_ENTRY Head, return(ret); } -PLIST_ENTRY FASTCALL + +PLIST_ENTRY ExInterlockedRemoveTailList(PLIST_ENTRY Head, PKSPIN_LOCK Lock) /* @@ -140,7 +140,6 @@ ExInterlockedRemoveTailList(PLIST_ENTRY Head, return(ret); } -#undef ExInterlockedPopEntrySList PSINGLE_LIST_ENTRY FASTCALL ExInterlockedPopEntrySList(IN PSLIST_HEADER ListHead, @@ -157,17 +156,16 @@ ExInterlockedPopEntrySList(IN PSLIST_HEADER ListHead, KIRQL oldlvl; KeAcquireSpinLock(Lock,&oldlvl); - ret = PopEntryList(&ListHead->Next); + ret = PopEntryList(&ListHead->s.Next); if (ret) { - ListHead->Depth--; - ListHead->Sequence++; + ListHead->s.Depth--; + ListHead->s.Sequence++; } KeReleaseSpinLock(Lock,oldlvl); return(ret); } -#undef ExInterlockedPushEntrySList PSINGLE_LIST_ENTRY FASTCALL ExInterlockedPushEntrySList(IN PSLIST_HEADER ListHead, @@ -186,16 +184,16 @@ ExInterlockedPushEntrySList(IN PSLIST_HEADER ListHead, PSINGLE_LIST_ENTRY ret; KeAcquireSpinLock(Lock,&oldlvl); - ret=ListHead->Next.Next; - PushEntryList(&ListHead->Next,ListEntry); - ListHead->Depth++; - ListHead->Sequence++; + ret=ListHead->s.Next.Next; + PushEntryList(&ListHead->s.Next,ListEntry); + ListHead->s.Depth++; + ListHead->s.Sequence++; KeReleaseSpinLock(Lock,oldlvl); return(ret); } -PSINGLE_LIST_ENTRY FASTCALL +PSINGLE_LIST_ENTRY STDCALL ExInterlockedPopEntryList(IN PSINGLE_LIST_ENTRY ListHead, IN PKSPIN_LOCK Lock) /* @@ -216,7 +214,7 @@ ExInterlockedPopEntryList(IN PSINGLE_LIST_ENTRY ListHead, } -PSINGLE_LIST_ENTRY FASTCALL +PSINGLE_LIST_ENTRY STDCALL ExInterlockedPushEntryList(IN PSINGLE_LIST_ENTRY ListHead, IN PSINGLE_LIST_ENTRY ListEntry, IN PKSPIN_LOCK Lock) @@ -376,43 +374,4 @@ ExfInterlockedRemoveHeadList(IN PLIST_ENTRY Head, return(ret); } - -PSLIST_ENTRY -FASTCALL -InterlockedPopEntrySList( - IN PSLIST_HEADER ListHead) -{ - KIRQL OldIrql; - PSLIST_ENTRY Value; - - KeAcquireSpinLock(&ExpGlobalInterlockedLock, &OldIrql); - Value = PopEntryList(&ListHead->Next); - if (Value) - { - ListHead->Depth--; - ListHead->Sequence++; - } - KeReleaseSpinLock(&ExpGlobalInterlockedLock, OldIrql); - return(Value); -} - - -PSLIST_ENTRY -FASTCALL -InterlockedPushEntrySList( - IN PSLIST_HEADER ListHead, - IN PSLIST_ENTRY ListEntry) -{ - KIRQL OldIrql; - PSLIST_ENTRY Value; - - KeAcquireSpinLock(&ExpGlobalInterlockedLock, &OldIrql); - Value = ListHead->Next.Next; - PushEntryList(&ListHead->Next, ListEntry); - ListHead->Depth++; - ListHead->Sequence++; - KeReleaseSpinLock(&ExpGlobalInterlockedLock, OldIrql); - return(Value); -} - /* EOF */ diff --git a/reactos/ntoskrnl/ex/lookas.c b/reactos/ntoskrnl/ex/lookas.c index 4dee9a2ef2f..1270552ca89 100644 --- a/reactos/ntoskrnl/ex/lookas.c +++ b/reactos/ntoskrnl/ex/lookas.c @@ -1,4 +1,4 @@ -/* $Id: lookas.c,v 1.5 2002/09/07 15:12:50 chorns Exp $ +/* $Id: lookas.c,v 1.6 2002/09/08 10:23:19 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,12 +13,11 @@ /* INCLUDES *****************************************************************/ -#include - +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ LIST_ENTRY ExpNonPagedLookasideListHead; @@ -31,6 +30,35 @@ PLOOKASIDE_MINMAX_ROUTINE ExpMinMaxRoutine; /* FUNCTIONS *****************************************************************/ +VOID ExpDefaultMinMax( + POOL_TYPE PoolType, + ULONG Size, + PUSHORT MinimumDepth, + PUSHORT MaximumDepth) +/* + * FUNCTION: Determines the minimum and maximum depth of a new lookaside list + * ARGUMENTS: + * Type = Type of executive pool + * Size = Size in bytes of each element in the new lookaside list + * MinimumDepth = Buffer to store minimum depth of the new lookaside list in + * MaximumDepth = Buffer to store maximum depth of the new lookaside list in + */ +{ + /* FIXME: Could probably do some serious computing here */ + if ((PoolType == NonPagedPool) || + (PoolType == NonPagedPoolMustSucceed)) + { + *MinimumDepth = 10; + *MaximumDepth = 100; + } + else + { + *MinimumDepth = 20; + *MaximumDepth = 200; + } +} + + PVOID STDCALL ExpDefaultAllocate(POOL_TYPE PoolType, ULONG NumberOfBytes, @@ -69,8 +97,41 @@ ExpInitLookasideLists() InitializeListHead(&ExpPagedLookasideListHead); KeInitializeSpinLock(&ExpPagedLookasideListLock); + + /* FIXME: Possibly configure the algorithm using the registry */ + ExpMinMaxRoutine = ExpDefaultMinMax; } +PVOID +STDCALL +ExAllocateFromPagedLookasideList ( + PPAGED_LOOKASIDE_LIST Lookaside + ) +{ + PVOID Entry; + + /* Try to obtain an entry from the lookaside list. If that fails, try to + allocate a new entry with the allocate method for the lookaside list */ + + Lookaside->TotalAllocates++; + +// ExAcquireFastMutex(&Lookaside->Lock); + + Entry = PopEntrySList(&Lookaside->ListHead); + +// ExReleaseFastMutex(&Lookaside->Lock); + + if (Entry) + return Entry; + + Lookaside->AllocateMisses++; + + Entry = (*Lookaside->Allocate)(Lookaside->Type, + Lookaside->Size, + Lookaside->Tag); + + return Entry; +} VOID STDCALL @@ -108,10 +169,15 @@ ExDeletePagedLookasideList ( for them */ for (;;) { - Entry = InterlockedPopEntrySList(&Lookaside->ListHead); + +// ExAcquireFastMutex(&Lookaside->Lock); + + Entry = PopEntrySList(&Lookaside->ListHead); if (!Entry) break; +// ExReleaseFastMutex(&Lookaside->Lock); + (*Lookaside->Free)(Entry); } @@ -120,69 +186,26 @@ ExDeletePagedLookasideList ( KeReleaseSpinLock(&ExpPagedLookasideListLock, OldIrql); } -PVOID -STDCALL -ExiAllocateFromNPagedLookasideList( - IN PNPAGED_LOOKASIDE_LIST Lookaside) -{ - PVOID Entry; - - Lookaside->TotalAllocates++; - Entry = InterlockedPopEntrySList(&Lookaside->ListHead); - if (Entry == NULL) { - Lookaside->AllocateMisses++; - Entry = (Lookaside->Allocate)(Lookaside->Type, Lookaside->Size, Lookaside->Tag); - } - return Entry; -} - -PVOID -STDCALL -ExiAllocateFromPagedLookasideList( - IN PPAGED_LOOKASIDE_LIST Lookaside) -{ - PVOID Entry; - - Lookaside->TotalAllocates++; - Entry = InterlockedPopEntrySList(&Lookaside->ListHead); - if (Entry == NULL) { - Lookaside->AllocateMisses++; - Entry = (Lookaside->Allocate)(Lookaside->Type, - Lookaside->Size, Lookaside->Tag); - } - return Entry; -} - VOID STDCALL -ExiFreeToNPagedLookasideList( - IN PNPAGED_LOOKASIDE_LIST Lookaside, - IN PVOID Entry) -{ - Lookaside->TotalFrees++; - if (ExQueryDepthSList(&Lookaside->ListHead) >= Lookaside->Depth) { - Lookaside->FreeMisses++; - (Lookaside->Free)(Entry); - } else { - InterlockedPushEntrySList(&Lookaside->ListHead, - (PSLIST_ENTRY)Entry); - } -} - -VOID -STDCALL -ExiFreeToPagedLookasideList ( +ExFreeToPagedLookasideList ( PPAGED_LOOKASIDE_LIST Lookaside, PVOID Entry ) { - Lookaside->TotalFrees++; - if (ExQueryDepthSList(&Lookaside->ListHead) >= Lookaside->Depth) { - Lookaside->FreeMisses++; - (Lookaside->Free)(Entry); - } else { - InterlockedPushEntrySList(&Lookaside->ListHead, (PSINGLE_LIST_ENTRY)Entry); - } + Lookaside->TotalFrees++; + + if (ExQueryDepthSList(&Lookaside->ListHead) >= Lookaside->MinimumDepth) + { + Lookaside->FreeMisses++; + (*Lookaside->Free)(Entry); + } + else + { +// ExAcquireFastMutex(&Lookaside->Lock); + PushEntrySList(&Lookaside->ListHead, (PSINGLE_LIST_ENTRY)Entry); +// ExReleaseFastMutex(&Lookaside->Lock); + } } VOID @@ -223,6 +246,15 @@ ExInitializeNPagedLookasideList ( Lookaside->Free = ExpDefaultFree; ExInitializeSListHead(&Lookaside->ListHead); + KeInitializeSpinLock(&Lookaside->Lock); + + /* Determine minimum and maximum number of entries on the lookaside list + using the configured algorithm */ + (*ExpMinMaxRoutine)( + NonPagedPool, + Lookaside->Size, + &Lookaside->MinimumDepth, + &Lookaside->MaximumDepth); ExInterlockedInsertTailList( &ExpNonPagedLookasideListHead, @@ -269,6 +301,15 @@ ExInitializePagedLookasideList ( Lookaside->Free = ExpDefaultFree; ExInitializeSListHead(&Lookaside->ListHead); + //ExInitializeFastMutex(&Lookaside->Lock); + + /* Determine minimum and maximum number of entries on the lookaside list + using the configured algorithm */ + (*ExpMinMaxRoutine)( + PagedPool, + Lookaside->Size, + &Lookaside->MinimumDepth, + &Lookaside->MaximumDepth); ExInterlockedInsertTailList( &ExpPagedLookasideListHead, diff --git a/reactos/ntoskrnl/ex/napi.c b/reactos/ntoskrnl/ex/napi.c index 0b789aa8cb7..ae64d80f2e8 100644 --- a/reactos/ntoskrnl/ex/napi.c +++ b/reactos/ntoskrnl/ex/napi.c @@ -8,14 +8,13 @@ /* INCLUDES *****************************************************************/ -#include - -#define NDEBUG +#include +#include #include - /* GLOBALS ******************************************************************/ +#include #include /* GLOBALS *****************************************************************/ diff --git a/reactos/ntoskrnl/ex/power.c b/reactos/ntoskrnl/ex/power.c index a8786d40fed..34c63a657e8 100644 --- a/reactos/ntoskrnl/ex/power.c +++ b/reactos/ntoskrnl/ex/power.c @@ -11,12 +11,15 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS STDCALL diff --git a/reactos/ntoskrnl/ex/resource.c b/reactos/ntoskrnl/ex/resource.c index 2dff0358035..c63b1b08098 100644 --- a/reactos/ntoskrnl/ex/resource.c +++ b/reactos/ntoskrnl/ex/resource.c @@ -1,4 +1,4 @@ -/* $Id: resource.c,v 1.20 2002/09/07 15:12:50 chorns Exp $ +/* $Id: resource.c,v 1.21 2002/09/08 10:23:19 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -38,12 +38,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define TAG_OWNER_TABLE TAG('R', 'O', 'W', 'N') @@ -52,6 +53,33 @@ /* FUNCTIONS *****************************************************************/ + +BOOLEAN +STDCALL +ExTryToAcquireResourceExclusiveLite ( + PERESOURCE Resource + ) +/* + * FUNCTION: Attempts to require the resource for exclusive access + * ARGUMENTS: + * Resource = Points to the resource of be acquired + * RETURNS: TRUE if the resource was acquired for the caller + * NOTES: Must be acquired at IRQL < DISPATCH_LEVEL + */ +{ + return(ExAcquireResourceExclusiveLite(Resource,FALSE)); +} + +BOOLEAN +STDCALL +ExAcquireResourceExclusive ( + PERESOURCE Resource, + BOOLEAN Wait + ) +{ + return(ExAcquireResourceExclusiveLite(Resource,Wait)); +} + BOOLEAN STDCALL ExAcquireResourceExclusiveLite ( @@ -81,7 +109,7 @@ ExAcquireResourceExclusiveLite ( && Resource->OwnerThreads[0].OwnerThread == ExGetCurrentResourceThread()) { /* it's ok : same lock for same thread */ - Resource->OwnerThreads[0].OwnerCount++; + Resource->OwnerThreads[0].a.OwnerCount++; KeReleaseSpinLock(&Resource->SpinLock, oldIrql); DPRINT("ExAcquireResourceExclusiveLite() = TRUE\n"); return(TRUE); @@ -118,40 +146,12 @@ ExAcquireResourceExclusiveLite ( Resource->Flag |= ResourceOwnedExclusive; Resource->ActiveCount = 1; Resource->OwnerThreads[0].OwnerThread = ExGetCurrentResourceThread(); - Resource->OwnerThreads[0].OwnerCount = 1; + Resource->OwnerThreads[0].a.OwnerCount = 1; KeReleaseSpinLock(&Resource->SpinLock, oldIrql); DPRINT("ExAcquireResourceExclusiveLite() = TRUE\n"); return(TRUE); } -BOOLEAN -STDCALL -ExTryToAcquireResourceExclusiveLite ( - PERESOURCE Resource - ) -/* - * FUNCTION: Attempts to require the resource for exclusive access - * ARGUMENTS: - * Resource = Points to the resource of be acquired - * RETURNS: TRUE if the resource was acquired for the caller - * NOTES: Must be acquired at IRQL < DISPATCH_LEVEL - */ -{ - return(ExAcquireResourceExclusiveLite(Resource,FALSE)); -} - -#undef ExAcquireResourceExclusive - -BOOLEAN -STDCALL -ExAcquireResourceExclusive ( - PERESOURCE Resource, - BOOLEAN Wait - ) -{ - return(ExAcquireResourceExclusiveLite(Resource,Wait)); -} - static BOOLEAN EiRemoveSharedOwner(PERESOURCE Resource, ERESOURCE_THREAD ResourceThreadId) /* @@ -166,8 +166,8 @@ static BOOLEAN EiRemoveSharedOwner(PERESOURCE Resource, if (Resource->OwnerThreads[1].OwnerThread == ResourceThreadId) { - Resource->OwnerThreads[1].OwnerCount--; - if (Resource->OwnerThreads[1].OwnerCount == 0) + Resource->OwnerThreads[1].a.OwnerCount--; + if (Resource->OwnerThreads[1].a.OwnerCount == 0) { Resource->ActiveCount--; Resource->OwnerThreads[1].OwnerThread = 0; @@ -181,12 +181,12 @@ static BOOLEAN EiRemoveSharedOwner(PERESOURCE Resource, return(FALSE);; } - for (i=0; iOwnerThreads[1].TableSize; i++) + for (i=0; iOwnerThreads[1].a.TableSize; i++) { if (Resource->OwnerTable[i].OwnerThread == ResourceThreadId) { - Resource->OwnerTable[i].OwnerCount--; - if (Resource->OwnerTable[i].OwnerCount == 0) + Resource->OwnerTable[i].a.OwnerCount--; + if (Resource->OwnerTable[i].a.OwnerCount == 0) { Resource->ActiveCount--; Resource->OwnerTable[i].OwnerThread = 0; @@ -216,7 +216,7 @@ static BOOLEAN EiAddSharedOwner(PERESOURCE Resource) { /* no owner, it's easy */ Resource->OwnerThreads[1].OwnerThread = ExGetCurrentResourceThread(); - Resource->OwnerThreads[1].OwnerCount = 1; + Resource->OwnerThreads[1].a.OwnerCount = 1; if (Resource->OwnerTable != NULL) { ExFreePool(Resource->OwnerTable); @@ -250,10 +250,10 @@ static BOOLEAN EiAddSharedOwner(PERESOURCE Resource) sizeof(OWNER_ENTRY)); Resource->OwnerThreads[1].OwnerThread = 0; - Resource->OwnerThreads[1].TableSize = 3; + Resource->OwnerThreads[1].a.TableSize = 3; Resource->OwnerTable[1].OwnerThread = CurrentThread; - Resource->OwnerTable[1].OwnerCount = 1; + Resource->OwnerTable[1].a.OwnerCount = 1; Resource->ActiveCount++; return(TRUE); @@ -262,15 +262,15 @@ static BOOLEAN EiAddSharedOwner(PERESOURCE Resource) DPRINT("Search free entries\n"); DPRINT("Number of entries %d\n", - Resource->OwnerThreads[1].TableSize); + Resource->OwnerThreads[1].a.TableSize); freeEntry = NULL; - for (i=0; iOwnerThreads[1].TableSize; i++) + for (i=0; iOwnerThreads[1].a.TableSize; i++) { if (Resource->OwnerTable[i].OwnerThread == CurrentThread) { DPRINT("Thread already owns resource\n"); - Resource->OwnerTable[i].OwnerCount++; + Resource->OwnerTable[i].a.OwnerCount++; return(TRUE); } if (Resource->OwnerTable[i].OwnerThread == 0) @@ -290,7 +290,7 @@ static BOOLEAN EiAddSharedOwner(PERESOURCE Resource) freeEntry = ExAllocatePoolWithTag(NonPagedPool, sizeof(OWNER_ENTRY)* - (Resource->OwnerThreads[1].TableSize+1), + (Resource->OwnerThreads[1].a.TableSize+1), TAG_OWNER_TABLE); if (freeEntry == NULL) { @@ -298,15 +298,15 @@ static BOOLEAN EiAddSharedOwner(PERESOURCE Resource) return(FALSE); } memcpy(freeEntry,Resource->OwnerTable, - sizeof(OWNER_ENTRY)*(Resource->OwnerThreads[1].TableSize)); + sizeof(OWNER_ENTRY)*(Resource->OwnerThreads[1].a.TableSize)); ExFreePool(Resource->OwnerTable); Resource->OwnerTable=freeEntry; - freeEntry=&Resource->OwnerTable[Resource->OwnerThreads[1].TableSize]; - Resource->OwnerThreads[1].TableSize++; + freeEntry=&Resource->OwnerTable[Resource->OwnerThreads[1].a.TableSize]; + Resource->OwnerThreads[1].a.TableSize++; } DPRINT("Creating entry\n"); freeEntry->OwnerThread=ExGetCurrentResourceThread(); - freeEntry->OwnerCount=1; + freeEntry->a.OwnerCount=1; Resource->ActiveCount++; return(TRUE); } @@ -352,7 +352,7 @@ ExAcquireResourceSharedLite ( /* * NOTE: Is this correct? Seems the same as ExConvertExclusiveToShared */ - Resource->OwnerThreads[0].OwnerCount++; + Resource->OwnerThreads[0].a.OwnerCount++; KeReleaseSpinLock(&Resource->SpinLock, oldIrql); DPRINT("ExAcquireResourceSharedLite() = TRUE\n"); return(TRUE); @@ -424,9 +424,9 @@ ExConvertExclusiveToSharedLite ( //transfer infos from entry 0 to entry 1 and erase entry 0 Resource->OwnerThreads[1].OwnerThread=Resource->OwnerThreads[0].OwnerThread; - Resource->OwnerThreads[1].OwnerCount=Resource->OwnerThreads[0].OwnerCount; + Resource->OwnerThreads[1].a.OwnerCount=Resource->OwnerThreads[0].a.OwnerCount; Resource->OwnerThreads[0].OwnerThread=0; - Resource->OwnerThreads[0].OwnerCount=0; + Resource->OwnerThreads[0].a.OwnerCount=0; /* erase exclusive flag */ Resource->Flag &= (~ResourceOwnedExclusive); /* if no shared waiters, that's all */ @@ -489,7 +489,7 @@ ExAcquireSharedStarveExclusive ( if (Resource->ActiveCount == 0) { Resource->OwnerThreads[1].OwnerThread=ExGetCurrentResourceThread(); - Resource->OwnerThreads[1].OwnerCount=1; + Resource->OwnerThreads[1].a.OwnerCount=1; Resource->ActiveCount=1; KeReleaseSpinLock(&Resource->SpinLock, oldIrql); DPRINT("ExAcquireSharedStarveExclusive() = TRUE\n"); @@ -500,7 +500,7 @@ ExAcquireSharedStarveExclusive ( && Resource->OwnerThreads[0].OwnerThread==ExGetCurrentResourceThread()) { /* exclusive, but by same thread : it's ok */ - Resource->OwnerThreads[0].OwnerCount++; + Resource->OwnerThreads[0].a.OwnerCount++; KeReleaseSpinLock(&Resource->SpinLock, oldIrql); DPRINT("ExAcquireSharedStarveExclusive() = TRUE\n"); return(TRUE); @@ -541,8 +541,6 @@ ExAcquireSharedWaitForExclusive ( return(ExAcquireResourceSharedLite(Resource,Wait)); } -#undef ExDeleteResource - NTSTATUS STDCALL ExDeleteResource ( @@ -574,8 +572,6 @@ ExGetSharedWaiterCount ( return(Resource->NumberOfSharedWaiters); } -#undef ExInitializeResource - NTSTATUS STDCALL ExInitializeResource ( @@ -624,7 +620,7 @@ ExIsResourceAcquiredExclusiveLite ( && Resource->OwnerThreads[0].OwnerThread==ExGetCurrentResourceThread()); } -USHORT +ULONG STDCALL ExIsResourceAcquiredSharedLite ( PERESOURCE Resource @@ -641,21 +637,21 @@ ExIsResourceAcquiredSharedLite ( ULONG i; if (Resource->OwnerThreads[0].OwnerThread == ExGetCurrentResourceThread()) { - return(Resource->OwnerThreads[0].OwnerCount); + return(Resource->OwnerThreads[0].a.OwnerCount); } if (Resource->OwnerThreads[1].OwnerThread == ExGetCurrentResourceThread()) { - return(Resource->OwnerThreads[1].OwnerCount); + return(Resource->OwnerThreads[1].a.OwnerCount); } - if (!Resource->OwnerThreads[1].TableSize) + if (!Resource->OwnerThreads[1].a.TableSize) { return(0); } - for (i=0; iOwnerThreads[1].TableSize; i++) + for (i=0; iOwnerThreads[1].a.TableSize; i++) { if (Resource->OwnerTable[i].OwnerThread==ExGetCurrentResourceThread()) { - return Resource->OwnerTable[i].OwnerCount; + return Resource->OwnerTable[i].a.OwnerCount; } } return(0); @@ -680,9 +676,9 @@ ExReinitializeResourceLite ( ExFreePool(Resource->OwnerTable); } Resource->OwnerThreads[0].OwnerThread=0; - Resource->OwnerThreads[0].OwnerCount=0; + Resource->OwnerThreads[0].a.OwnerCount=0; Resource->OwnerThreads[1].OwnerThread=0; - Resource->OwnerThreads[1].OwnerCount=0; + Resource->OwnerThreads[1].a.OwnerCount=0; } VOID @@ -691,12 +687,10 @@ ExReleaseResourceLite ( PERESOURCE Resource ) { - ExReleaseResourceForThreadLite(Resource, - ExGetCurrentResourceThread()); + return(ExReleaseResourceForThreadLite(Resource, + ExGetCurrentResourceThread())); } -#undef ExReleaseResourceForThread - VOID STDCALL ExReleaseResourceForThread ( @@ -704,7 +698,7 @@ ExReleaseResourceForThread ( ERESOURCE_THREAD ResourceThreadId ) { - ExReleaseResourceForThreadLite(Resource,ResourceThreadId); + return(ExReleaseResourceForThreadLite(Resource,ResourceThreadId)); } VOID @@ -734,8 +728,8 @@ ExReleaseResourceForThreadLite ( { DPRINT("Releasing from exclusive access\n"); - Resource->OwnerThreads[0].OwnerCount--; - if (Resource->OwnerThreads[0].OwnerCount > 0) + Resource->OwnerThreads[0].a.OwnerCount--; + if (Resource->OwnerThreads[0].a.OwnerCount > 0) { KeReleaseSpinLock(&Resource->SpinLock, oldIrql); DPRINT("ExReleaseResourceForThreadLite() finished\n"); diff --git a/reactos/ntoskrnl/ex/stree.c b/reactos/ntoskrnl/ex/stree.c index 791a4ba9ab6..1a79ce04bc1 100644 --- a/reactos/ntoskrnl/ex/stree.c +++ b/reactos/ntoskrnl/ex/stree.c @@ -27,13 +27,12 @@ * UPDATE HISTORY: * 15-03-2002 CSH Created */ - -#include +#include +#include #define NDEBUG #include - /* DATA **********************************************************************/ #define WEIGHT 1 diff --git a/reactos/ntoskrnl/ex/sysinfo.c b/reactos/ntoskrnl/ex/sysinfo.c index 0dd7b29febe..12c7eda5bb9 100644 --- a/reactos/ntoskrnl/ex/sysinfo.c +++ b/reactos/ntoskrnl/ex/sysinfo.c @@ -1,4 +1,4 @@ -/* $Id: sysinfo.c,v 1.16 2002/09/07 15:12:50 chorns Exp $ +/* $Id: sysinfo.c,v 1.17 2002/09/08 10:23:19 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,16 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include -#define NDEBUG #include - extern ULONG NtGlobalFlag; /* FIXME: it should go in a ddk/?.h */ /* FUNCTIONS *****************************************************************/ @@ -286,17 +290,17 @@ QSI_DEF(SystemBasicInformation) return (STATUS_INFO_LENGTH_MISMATCH); } - Sbi->Unknown = 0; - Sbi->MaximumIncrement = 0; /* FIXME */ - Sbi->PhysicalPageSize = PAGE_SIZE; + Sbi->Reserved = 0; + Sbi->TimerResolution = 0; /* FIXME */ + Sbi->PageSize = PAGESIZE; /* FIXME: it should be PAGE_SIZE */ Sbi->NumberOfPhysicalPages = 0; /* FIXME */ - Sbi->LowestPhysicalPage = 0; /* FIXME */ - Sbi->HighestPhysicalPage = 0; /* FIXME */ + Sbi->LowestPhysicalPageNumber = 0; /* FIXME */ + Sbi->HighestPhysicalPageNumber = 0; /* FIXME */ Sbi->AllocationGranularity = 65536; /* hard coded on Intel? */ - Sbi->LowestUserAddress = 0; /* FIXME */ - Sbi->HighestUserAddress = 0; /* FIXME */ - Sbi->ActiveProcessors = 0x00000001; /* FIXME */ - Sbi->NumberProcessors = 1; /* FIXME */ + Sbi->MinimumUserModeAddress = 0; /* FIXME */ + Sbi->MaximumUserModeAddress = 0; /* FIXME */ + Sbi->ActiveProcessorsAffinityMask = 0x00000001; /* FIXME */ + Sbi->NumberOfProcessors = 1; /* FIXME */ return (STATUS_SUCCESS); } @@ -320,8 +324,8 @@ QSI_DEF(SystemProcessorInformation) Spi->ProcessorArchitecture = 0; /* FIXME */ Spi->ProcessorLevel = 0; /* FIXME */ Spi->ProcessorRevision = 0; /* FIXME */ - Spi->Unknown = 0; - Spi->FeatureBits = 0x00000000; /* FIXME */ + Spi->Reserved = 0; + Spi->ProcessorFeatureBits = 0x00000000; /* FIXME */ return (STATUS_SUCCESS); } @@ -329,91 +333,91 @@ QSI_DEF(SystemProcessorInformation) /* Class 2 - Performance Information */ QSI_DEF(SystemPerformanceInformation) { - PSYSTEM_PERFORMANCE_INFORMATION Spi - = (PSYSTEM_PERFORMANCE_INFORMATION) Buffer; + PSYSTEM_PERFORMANCE_INFO Spi + = (PSYSTEM_PERFORMANCE_INFO) Buffer; - *ReqSize = sizeof (SYSTEM_PERFORMANCE_INFORMATION); + *ReqSize = sizeof (SYSTEM_PERFORMANCE_INFO); /* * Check user buffer's size */ - if (Size < sizeof (SYSTEM_PERFORMANCE_INFORMATION)) + if (Size < sizeof (SYSTEM_PERFORMANCE_INFO)) { return (STATUS_INFO_LENGTH_MISMATCH); } - Spi->IdleTime.QuadPart = 0; /* FIXME */ - Spi->ReadTransferCount.QuadPart = 0; /* FIXME */ - Spi->WriteTransferCount.QuadPart = 0; /* FIXME */ - Spi->OtherTransferCount.QuadPart = 0; /* FIXME */ - Spi->ReadOperationCount = 0; /* FIXME */ - Spi->WriteOperationCount = 0; /* FIXME */ - Spi->OtherOperationCount = 0; /* FIXME */ + Spi->IdleProcessorTime.QuadPart = 0; /* FIXME */ + Spi->IoReadTransferCount.QuadPart = 0; /* FIXME */ + Spi->IoWriteTransferCount.QuadPart = 0; /* FIXME */ + Spi->IoOtherTransferCount.QuadPart = 0; /* FIXME */ + Spi->IoReadOperationCount = 0; /* FIXME */ + Spi->IoWriteOperationCount = 0; /* FIXME */ + Spi->IoOtherOperationCount = 0; /* FIXME */ Spi->AvailablePages = 0; /* FIXME */ - Spi->TotalCommittedPages = 0; /* FIXME */ - Spi->TotalCommitLimit = 0; /* FIXME */ + Spi->CommitedPages = 0; /* FIXME */ + Spi->CommitLimit = 0; /* FIXME */ Spi->PeakCommitment = 0; /* FIXME */ - Spi->PageFaults = 0; /* FIXME */ - Spi->WriteCopyFaults = 0; /* FIXME */ - Spi->TransitionFaults = 0; /* FIXME */ - Spi->CacheTransitionFaults = 0; /* FIXME */ - Spi->DemandZeroFaults = 0; /* FIXME */ - Spi->PagesRead = 0; /* FIXME */ - Spi->PageReadIos = 0; /* FIXME */ - Spi->CacheReads = 0; /* FIXME */ - Spi->CacheIos = 0; /* FIXME */ - Spi->PagefilePagesWritten = 0; /* FIXME */ - Spi->PagefilePageWriteIos = 0; /* FIXME */ - Spi->MappedFilePagesWritten = 0; /* FIXME */ - Spi->MappedFilePageWriteIos = 0; /* FIXME */ - Spi->PagedPoolUsage = 0; /* FIXME */ - Spi->NonPagedPoolUsage = 0; /* FIXME */ - Spi->PagedPoolAllocs = 0; /* FIXME */ - Spi->PagedPoolFrees = 0; /* FIXME */ - Spi->NonPagedPoolAllocs = 0; /* FIXME */ - Spi->NonPagedPoolFrees = 0; /* FIXME */ - Spi->TotalFreeSystemPtes = 0; /* FIXME */ - Spi->SystemCodePage = 0; /* FIXME */ - Spi->TotalSystemDriverPages = 0; /* FIXME */ - Spi->TotalSystemCodePages = 0; /* FIXME */ - Spi->SmallNonPagedLookasideListAllocateHits = 0; /* FIXME */ - Spi->SmallPagedLookasideListAllocateHits = 0; /* FIXME */ - Spi->Reserved3 = 0; /* FIXME */ + Spi->PageFaultCount = 0; /* FIXME */ + Spi->CopyOnWriteCount = 0; /* FIXME */ + Spi->TransitionCount = 0; /* FIXME */ + Spi->CacheTransitionCount = 0; /* FIXME */ + Spi->DemandZeroCount = 0; /* FIXME */ + Spi->PageReadCount = 0; /* FIXME */ + Spi->PageReadIoCount = 0; /* FIXME */ + Spi->CacheReadCount = 0; /* FIXME */ + Spi->CacheIoCount = 0; /* FIXME */ + Spi->DirtyPagesWriteCount = 0; /* FIXME */ + Spi->DirtyWriteIoCount = 0; /* FIXME */ + Spi->MappedPagesWriteCount = 0; /* FIXME */ + Spi->MappedWriteIoCount = 0; /* FIXME */ + Spi->PagedPoolPages = 0; /* FIXME */ + Spi->NonPagedPoolPages = 0; /* FIXME */ + Spi->Unknown6 = 0; /* FIXME */ + Spi->Unknown7 = 0; /* FIXME */ + Spi->Unknown8 = 0; /* FIXME */ + Spi->Unknown9 = 0; /* FIXME */ + Spi->MmTotalSystemFreePtes = 0; /* FIXME */ + Spi->MmSystemCodepage = 0; /* FIXME */ + Spi->MmTotalSystemDriverPages = 0; /* FIXME */ + Spi->MmTotalSystemCodePages = 0; /* FIXME */ + Spi->Unknown10 = 0; /* FIXME */ + Spi->Unknown11 = 0; /* FIXME */ + Spi->Unknown12 = 0; /* FIXME */ Spi->MmSystemCachePage = 0; /* FIXME */ - Spi->PagedPoolPage = 0; /* FIXME */ - Spi->SystemDriverPage = 0; /* FIXME */ - Spi->FastReadNoWait = 0; /* FIXME */ - Spi->FastReadWait = 0; /* FIXME */ - Spi->FastReadResourceMiss = 0; /* FIXME */ - Spi->FastReadNotPossible = 0; /* FIXME */ - Spi->FastMdlReadNoWait = 0; /* FIXME */ - Spi->FastMdlReadWait = 0; /* FIXME */ - Spi->FastMdlReadResourceMiss = 0; /* FIXME */ - Spi->FastMdlReadNotPossible = 0; /* FIXME */ - Spi->MapDataNoWait = 0; /* FIXME */ - Spi->MapDataWait = 0; /* FIXME */ - Spi->MapDataNoWaitMiss = 0; /* FIXME */ - Spi->MapDataWaitMiss = 0; /* FIXME */ - Spi->PinMappedDataCount = 0; /* FIXME */ - Spi->PinReadNoWait = 0; /* FIXME */ - Spi->PinReadWait = 0; /* FIXME */ - Spi->PinReadNoWaitMiss = 0; /* FIXME */ - Spi->PinReadWaitMiss = 0; /* FIXME */ - Spi->CopyReadNoWait = 0; /* FIXME */ - Spi->CopyReadWait = 0; /* FIXME */ - Spi->CopyReadNoWaitMiss = 0; /* FIXME */ - Spi->CopyReadWaitMiss = 0; /* FIXME */ - Spi->MdlReadNoWait = 0; /* FIXME */ - Spi->MdlReadWait = 0; /* FIXME */ - Spi->MdlReadNoWaitMiss = 0; /* FIXME */ - Spi->MdlReadWaitMiss = 0; /* FIXME */ - Spi->ReadAheadIos = 0; /* FIXME */ - Spi->LazyWriteIos = 0; /* FIXME */ - Spi->LazyWritePages = 0; /* FIXME */ - Spi->DataFlushes = 0; /* FIXME */ - Spi->DataPages = 0; /* FIXME */ + Spi->MmPagedPoolPage = 0; /* FIXME */ + Spi->MmSystemDriverPage = 0; /* FIXME */ + Spi->CcFastReadNoWait = 0; /* FIXME */ + Spi->CcFastReadWait = 0; /* FIXME */ + Spi->CcFastReadResourceMiss = 0; /* FIXME */ + Spi->CcFastReadNotPossible = 0; /* FIXME */ + Spi->CcFastMdlReadNoWait = 0; /* FIXME */ + Spi->CcFastMdlReadWait = 0; /* FIXME */ + Spi->CcFastMdlReadResourceMiss = 0; /* FIXME */ + Spi->CcFastMdlReadNotPossible = 0; /* FIXME */ + Spi->CcMapDataNoWait = 0; /* FIXME */ + Spi->CcMapDataWait = 0; /* FIXME */ + Spi->CcMapDataNoWaitMiss = 0; /* FIXME */ + Spi->CcMapDataWaitMiss = 0; /* FIXME */ + Spi->CcPinMappedDataCount = 0; /* FIXME */ + Spi->CcPinReadNoWait = 0; /* FIXME */ + Spi->CcPinReadWait = 0; /* FIXME */ + Spi->CcPinReadNoWaitMiss = 0; /* FIXME */ + Spi->CcPinReadWaitMiss = 0; /* FIXME */ + Spi->CcCopyReadNoWait = 0; /* FIXME */ + Spi->CcCopyReadWait = 0; /* FIXME */ + Spi->CcCopyReadNoWaitMiss = 0; /* FIXME */ + Spi->CcCopyReadWaitMiss = 0; /* FIXME */ + Spi->CcMdlReadNoWait = 0; /* FIXME */ + Spi->CcMdlReadWait = 0; /* FIXME */ + Spi->CcMdlReadNoWaitMiss = 0; /* FIXME */ + Spi->CcMdlReadWaitMiss = 0; /* FIXME */ + Spi->CcReadaheadIos = 0; /* FIXME */ + Spi->CcLazyWriteIos = 0; /* FIXME */ + Spi->CcLazyWritePages = 0; /* FIXME */ + Spi->CcDataFlushes = 0; /* FIXME */ + Spi->CcDataPages = 0; /* FIXME */ Spi->ContextSwitches = 0; /* FIXME */ - Spi->FirstLevelTbFills = 0; /* FIXME */ - Spi->SecondLevelTbFills = 0; /* FIXME */ + Spi->Unknown13 = 0; /* FIXME */ + Spi->Unknown14 = 0; /* FIXME */ Spi->SystemCalls = 0; /* FIXME */ return (STATUS_SUCCESS); @@ -484,7 +488,7 @@ QSI_DEF(SystemDeviceInformation) Sdi->NumberOfDisks = ConfigInfo->DiskCount; Sdi->NumberOfFloppies = ConfigInfo->FloppyCount; - Sdi->NumberOfCdRoms = ConfigInfo->CdRomCount; + Sdi->NumberOfCdRoms = ConfigInfo->CDRomCount; Sdi->NumberOfTapes = ConfigInfo->TapeCount; Sdi->NumberOfSerialPorts = ConfigInfo->SerialCount; Sdi->NumberOfParallelPorts = ConfigInfo->ParallelCount; @@ -686,9 +690,9 @@ SSI_DEF(SystemUnloadImage) /* Class 28 - Time Adjustment Information */ QSI_DEF(SystemTimeAdjustmentInformation) { - if (sizeof (SYSTEM_SET_TIME_ADJUSTMENT) > Size) + if (sizeof (SYSTEM_TIME_ADJUSTMENT_INFO) > Size) { - * ReqSize = sizeof (SYSTEM_SET_TIME_ADJUSTMENT); + * ReqSize = sizeof (SYSTEM_TIME_ADJUSTMENT_INFO); return (STATUS_INFO_LENGTH_MISMATCH); } /* FIXME: */ @@ -697,7 +701,7 @@ QSI_DEF(SystemTimeAdjustmentInformation) SSI_DEF(SystemTimeAdjustmentInformation) { - if (sizeof (SYSTEM_SET_TIME_ADJUSTMENT) > Size) + if (sizeof (SYSTEM_TIME_ADJUSTMENT_INFO) > Size) { return (STATUS_INFO_LENGTH_MISMATCH); } diff --git a/reactos/ntoskrnl/ex/time.c b/reactos/ntoskrnl/ex/time.c index 04159151f01..9ac993601cf 100644 --- a/reactos/ntoskrnl/ex/time.c +++ b/reactos/ntoskrnl/ex/time.c @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.13 2002/09/07 15:12:50 chorns Exp $ +/* $Id: time.c,v 1.14 2002/09/08 10:23:19 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,9 +11,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include -#define NDEBUG #include diff --git a/reactos/ntoskrnl/ex/win32k.c b/reactos/ntoskrnl/ex/win32k.c index e2ab4988cdb..d8461e74edd 100644 --- a/reactos/ntoskrnl/ex/win32k.c +++ b/reactos/ntoskrnl/ex/win32k.c @@ -24,17 +24,18 @@ * UPDATE HISTORY: * 04-06-2001 CSH Created */ - -#include +#include +#include +#include +#include #define NDEBUG #include - /* DATA **********************************************************************/ -POBJECT_TYPE ExWindowStationObjectType = NULL; -POBJECT_TYPE ExDesktopObjectType = NULL; +POBJECT_TYPE EXPORTED ExWindowStationObjectType = NULL; +POBJECT_TYPE EXPORTED ExDesktopObjectType = NULL; static GENERIC_MAPPING ExpWindowStationMapping = { FILE_GENERIC_READ, diff --git a/reactos/ntoskrnl/ex/work.c b/reactos/ntoskrnl/ex/work.c index 1f1b556b734..1cc86d74622 100644 --- a/reactos/ntoskrnl/ex/work.c +++ b/reactos/ntoskrnl/ex/work.c @@ -1,4 +1,4 @@ -/* $Id: work.c,v 1.14 2002/09/07 15:12:50 chorns Exp $ +/* $Id: work.c,v 1.15 2002/09/08 10:23:19 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,13 @@ /* INCLUDES ******************************************************************/ -#include +#include + +#include #define NDEBUG #include - /* DEFINES *******************************************************************/ #define NUMBER_OF_WORKER_THREADS (5) @@ -59,7 +60,7 @@ WORK_QUEUE EiHyperCriticalWorkQueue; /* FUNCTIONS ****************************************************************/ -static VOID STDCALL +static NTSTATUS STDCALL ExWorkerThreadEntryPoint(PVOID context) /* * FUNCTION: Entry point for a worker thread @@ -80,8 +81,8 @@ ExWorkerThreadEntryPoint(PVOID context) &queue->Lock); if (current!=NULL) { - item = CONTAINING_RECORD(current,WORK_QUEUE_ITEM,List); - (item->WorkerRoutine)(item->Parameter); + item = CONTAINING_RECORD(current,WORK_QUEUE_ITEM,Entry); + item->Routine(item->Context); } else { @@ -159,7 +160,7 @@ ExQueueWorkItem (PWORK_QUEUE_ITEM WorkItem, { case DelayedWorkQueue: ExInterlockedInsertTailList(&EiNormalWorkQueue.Head, - &WorkItem->List, + &WorkItem->Entry, &EiNormalWorkQueue.Lock); KeReleaseSemaphore(&EiNormalWorkQueue.Sem, IO_NO_INCREMENT, @@ -169,7 +170,7 @@ ExQueueWorkItem (PWORK_QUEUE_ITEM WorkItem, case CriticalWorkQueue: ExInterlockedInsertTailList(&EiCriticalWorkQueue.Head, - &WorkItem->List, + &WorkItem->Entry, &EiCriticalWorkQueue.Lock); KeReleaseSemaphore(&EiCriticalWorkQueue.Sem, IO_NO_INCREMENT, @@ -179,15 +180,14 @@ ExQueueWorkItem (PWORK_QUEUE_ITEM WorkItem, case HyperCriticalWorkQueue: ExInterlockedInsertTailList(&EiHyperCriticalWorkQueue.Head, - &WorkItem->List, + &WorkItem->Entry, &EiHyperCriticalWorkQueue.Lock); KeReleaseSemaphore(&EiHyperCriticalWorkQueue.Sem, IO_NO_INCREMENT, 1, FALSE); break; - default: - assert(FALSE); + } } diff --git a/reactos/ntoskrnl/ex/zone.c b/reactos/ntoskrnl/ex/zone.c index 49f0117d971..1e81cbb8c8b 100644 --- a/reactos/ntoskrnl/ex/zone.c +++ b/reactos/ntoskrnl/ex/zone.c @@ -1,4 +1,4 @@ -/* $Id: zone.c,v 1.3 2002/09/07 15:12:50 chorns Exp $ +/* $Id: zone.c,v 1.4 2002/09/08 10:23:20 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,23 +9,7 @@ /* INCLUDES ****************************************************************/ -#include - -#define NDEBUG -#include - -/* VARIABLES ***************************************************************/ - -typedef struct _ZONE_SEGMENT -{ - SINGLE_LIST_ENTRY Entry; - ULONG size; -} ZONE_SEGMENT, *PZONE_SEGMENT; - -typedef struct _ZONE_ENTRY -{ - SINGLE_LIST_ENTRY Entry; -} ZONE_ENTRY, *PZONE_ENTRY; +#include /* FUNCTIONS ***************************************************************/ diff --git a/reactos/ntoskrnl/fs/dbcsname.c b/reactos/ntoskrnl/fs/dbcsname.c index f4a4c4c71ac..d2cfa585a0e 100644 --- a/reactos/ntoskrnl/fs/dbcsname.c +++ b/reactos/ntoskrnl/fs/dbcsname.c @@ -1,13 +1,10 @@ -/* $Id: dbcsname.c,v 1.2 2002/09/07 15:12:50 chorns Exp $ +/* $Id: dbcsname.c,v 1.3 2002/09/08 10:23:20 chorns Exp $ * * reactos/ntoskrnl/fs/dbcsname.c * */ - -#include - -#define NDEBUG -#include +#include +#include /********************************************************************** diff --git a/reactos/ntoskrnl/fs/filelock.c b/reactos/ntoskrnl/fs/filelock.c index eab85f72c15..2d3d0fe0162 100644 --- a/reactos/ntoskrnl/fs/filelock.c +++ b/reactos/ntoskrnl/fs/filelock.c @@ -1,13 +1,10 @@ -/* $Id: filelock.c,v 1.4 2002/09/07 15:12:50 chorns Exp $ +/* $Id: filelock.c,v 1.5 2002/09/08 10:23:20 chorns Exp $ * * reactos/ntoskrnl/fs/filelock.c * */ - -#include - -#define NDEBUG -#include +#include +#include /********************************************************************** diff --git a/reactos/ntoskrnl/fs/mcb.c b/reactos/ntoskrnl/fs/mcb.c index 3b07b7e8dd1..734d639b0b5 100644 --- a/reactos/ntoskrnl/fs/mcb.c +++ b/reactos/ntoskrnl/fs/mcb.c @@ -1,14 +1,13 @@ -/* $Id: mcb.c,v 1.4 2002/09/07 15:12:50 chorns Exp $ +/* $Id: mcb.c,v 1.5 2002/09/08 10:23:20 chorns Exp $ * * reactos/ntoskrnl/fs/mcb.c * */ -#include +#include +#include -#define NDEBUG #include - /********************************************************************** * NAME EXPORTED * diff --git a/reactos/ntoskrnl/fs/mdl.c b/reactos/ntoskrnl/fs/mdl.c index 18d740d894e..9233c68fd8d 100644 --- a/reactos/ntoskrnl/fs/mdl.c +++ b/reactos/ntoskrnl/fs/mdl.c @@ -1,14 +1,11 @@ -/* $Id: mdl.c,v 1.3 2002/09/07 15:12:50 chorns Exp $ +/* $Id: mdl.c,v 1.4 2002/09/08 10:23:20 chorns Exp $ * * reactos/ntoskrnl/fs/mdl.c * */ - -#include - -#define NDEBUG -#include - +#include +#include +#include /********************************************************************** * NAME EXPORTED diff --git a/reactos/ntoskrnl/fs/name.c b/reactos/ntoskrnl/fs/name.c index ac83953fd19..aa53d0d76fa 100644 --- a/reactos/ntoskrnl/fs/name.c +++ b/reactos/ntoskrnl/fs/name.c @@ -1,14 +1,9 @@ -/* $Id: name.c,v 1.4 2002/09/07 15:12:50 chorns Exp $ +/* $Id: name.c,v 1.5 2002/09/08 10:23:20 chorns Exp $ * * reactos/ntoskrnl/fs/name.c * */ - -#include - -#define NDEBUG -#include - +#include /* DATA */ diff --git a/reactos/ntoskrnl/fs/notify.c b/reactos/ntoskrnl/fs/notify.c index 4bc728a11a2..ee9c41d1cd2 100644 --- a/reactos/ntoskrnl/fs/notify.c +++ b/reactos/ntoskrnl/fs/notify.c @@ -1,13 +1,10 @@ -/* $Id: notify.c,v 1.4 2002/09/07 15:12:50 chorns Exp $ +/* $Id: notify.c,v 1.5 2002/09/08 10:23:20 chorns Exp $ * * reactos/ntoskrnl/fs/notify.c * */ - -#include - -#define NDEBUG -#include +#include +#include /********************************************************************** @@ -142,10 +139,24 @@ FsRtlNotifyFullReportChange ( VOID STDCALL FsRtlNotifyInitializeSync ( - IN PNOTIFY_SYNC NotifySync + IN PNOTIFY_SYNC * NotifySync ) { - UNIMPLEMENTED + *NotifySync = NULL; + *NotifySync = ExAllocatePoolWithTag ( + 0x10, // PoolType??? + sizeof (NOTIFY_SYNC), // NumberOfBytes = 0x28 + FSRTL_TAG + ); +#if 0 + *NotifySync->Unknown0 = 1; + *NotifySync->Unknown2 = 0; + *NotifySync->Unknown3 = 1; + *NotifySync->Unknown4 = 4; + *NotifySync->Unknown5 = 0; + *NotifySync->Unknown9 = 0; + *NotifySync->Unknown10 = 0; +#endif } @@ -192,7 +203,9 @@ FsRtlNotifyReportChange ( * Uninitialize a NOTIFY_SYNC object. * * ARGUMENTS - * NotifySync - Pointer to caller allocated space for NOTIFY_SYNC + * NotifySync is the address of a pointer + * to a PNOTIFY_SYNC object previously initialized by + * FsRtlNotifyInitializeSync(). * * RETURN VALUE * None. @@ -200,10 +213,14 @@ FsRtlNotifyReportChange ( VOID STDCALL FsRtlNotifyUninitializeSync ( - IN OUT PNOTIFY_SYNC NotifySync + IN OUT PNOTIFY_SYNC * NotifySync ) { - UNIMPLEMENTED + if (NULL != *NotifySync) + { + ExFreePool (*NotifySync); + *NotifySync = NULL; + } } /********************************************************************** diff --git a/reactos/ntoskrnl/fs/oplock.c b/reactos/ntoskrnl/fs/oplock.c index c4782280756..96bf21dcb90 100644 --- a/reactos/ntoskrnl/fs/oplock.c +++ b/reactos/ntoskrnl/fs/oplock.c @@ -1,12 +1,10 @@ -/* $Id: oplock.c,v 1.4 2002/09/07 15:12:50 chorns Exp $ +/* $Id: oplock.c,v 1.5 2002/09/08 10:23:20 chorns Exp $ * * reactos/ntoskrnl/fs/oplock.c * */ -#include - -#define NDEBUG -#include +#include +#include /********************************************************************** diff --git a/reactos/ntoskrnl/fs/pool.c b/reactos/ntoskrnl/fs/pool.c index 2a3d127d4ab..27ce54d09ae 100644 --- a/reactos/ntoskrnl/fs/pool.c +++ b/reactos/ntoskrnl/fs/pool.c @@ -1,13 +1,11 @@ -/* $Id: pool.c,v 1.3 2002/09/07 15:12:50 chorns Exp $ +/* $Id: pool.c,v 1.4 2002/09/08 10:23:20 chorns Exp $ * * reactos/ntoskrnl/fs/pool.c * */ - -#include - -#define NDEBUG -#include +#include +#include +#include /********************************************************************** diff --git a/reactos/ntoskrnl/fs/tunnel.c b/reactos/ntoskrnl/fs/tunnel.c index 8258dabb697..28c0344bd50 100644 --- a/reactos/ntoskrnl/fs/tunnel.c +++ b/reactos/ntoskrnl/fs/tunnel.c @@ -1,13 +1,10 @@ -/* $Id: tunnel.c,v 1.3 2002/09/07 15:12:50 chorns Exp $ +/* $Id: tunnel.c,v 1.4 2002/09/08 10:23:20 chorns Exp $ * * reactos/ntoskrnl/fs/tunnel.c * */ - -#include - -#define NDEBUG -#include +#include +#include /********************************************************************** @@ -88,7 +85,7 @@ FsRtlDeleteTunnelCache ( * RETURN VALUE * */ -BOOLEAN +VOID STDCALL FsRtlFindInTunnelCache ( IN PTUNNEL Cache, @@ -100,8 +97,6 @@ FsRtlFindInTunnelCache ( OUT PVOID Data ) { - UNIMPLEMENTED - return 0; } diff --git a/reactos/ntoskrnl/fs/unc.c b/reactos/ntoskrnl/fs/unc.c index 059567aefd6..8d918dc73cf 100644 --- a/reactos/ntoskrnl/fs/unc.c +++ b/reactos/ntoskrnl/fs/unc.c @@ -1,12 +1,10 @@ -/* $Id: unc.c,v 1.3 2002/09/07 15:12:50 chorns Exp $ +/* $Id: unc.c,v 1.4 2002/09/08 10:23:20 chorns Exp $ * * reactos/ntoskrnl/fs/unc.c * */ -#include - -#define NDEBUG -#include +#include +#include /********************************************************************** diff --git a/reactos/ntoskrnl/fs/util.c b/reactos/ntoskrnl/fs/util.c index 9a8f3073f79..b489816eab2 100644 --- a/reactos/ntoskrnl/fs/util.c +++ b/reactos/ntoskrnl/fs/util.c @@ -1,12 +1,10 @@ -/* $Id: util.c,v 1.11 2002/09/07 15:12:51 chorns Exp $ +/* $Id: util.c,v 1.12 2002/09/08 10:23:20 chorns Exp $ * * reactos/ntoskrnl/fs/util.c * */ -#include - -#define NDEBUG -#include +#include +#include /********************************************************************** diff --git a/reactos/ntoskrnl/include/internal/arch/ke.h b/reactos/ntoskrnl/include/internal/arch/ke.h index 2973640b691..cc0589b60a0 100644 --- a/reactos/ntoskrnl/include/internal/arch/ke.h +++ b/reactos/ntoskrnl/include/internal/arch/ke.h @@ -20,7 +20,7 @@ #define __NTOSKRNL_INCLUDE_INTERNAL_ARCH_KE_H #ifdef i386 -#include "../i386/ke.h" +#include #else #error "Unknown processor" #endif diff --git a/reactos/ntoskrnl/include/internal/arch/mm.h b/reactos/ntoskrnl/include/internal/arch/mm.h index 92936d11429..1622a69621d 100644 --- a/reactos/ntoskrnl/include/internal/arch/mm.h +++ b/reactos/ntoskrnl/include/internal/arch/mm.h @@ -20,7 +20,7 @@ #define __NTOSKRNL_INCLUDE_INTERNAL_ARCH_MM_H #ifdef i386 -#include "../i386/mm.h" +#include #else #error "Unknown processor" #endif diff --git a/reactos/ntoskrnl/include/internal/arch/ps.h b/reactos/ntoskrnl/include/internal/arch/ps.h index a3d52b43d8e..8d3d0efe9d9 100644 --- a/reactos/ntoskrnl/include/internal/arch/ps.h +++ b/reactos/ntoskrnl/include/internal/arch/ps.h @@ -20,7 +20,7 @@ #define __NTOSKRNL_INCLUDE_INTERNAL_ARCH_PS_H #ifdef i386 -#include "../i386/ps.h" +#include #define KiArchContextSwitch Ki386ContextSwitch #define KiArchInitThread Ke386InitThread #define KiArchInitThreadWithContext Ke386InitThreadWithContext diff --git a/reactos/ntoskrnl/include/internal/cc.h b/reactos/ntoskrnl/include/internal/cc.h index 08843ba1c89..9b80bd5da41 100644 --- a/reactos/ntoskrnl/include/internal/cc.h +++ b/reactos/ntoskrnl/include/internal/cc.h @@ -1,17 +1,20 @@ #ifndef __INCLUDE_INTERNAL_CC_H #define __INCLUDE_INTERNAL_CC_H - -/* $Id: cc.h,v 1.15 2002/09/07 15:12:51 chorns Exp $ */ - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - -#ifndef AS_INVOKED - +/* $Id: cc.h,v 1.16 2002/09/08 10:23:21 chorns Exp $ */ #include -typedef struct _ROS_CACHE_SEGMENT +typedef struct _BCB +{ + LIST_ENTRY BcbSegmentListHead; + PFILE_OBJECT FileObject; + ULONG CacheSegmentSize; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER FileSize; + KSPIN_LOCK BcbLock; + ULONG RefCount; +} BCB; + +typedef struct _CACHE_SEGMENT { /* Base address of the region where the cache segment data is mapped. */ PVOID BaseAddress; @@ -39,69 +42,48 @@ typedef struct _ROS_CACHE_SEGMENT /* Number of references. */ ULONG ReferenceCount; /* Pointer to the BCB for the file which this cache segment maps data for. */ - PROS_BCB Bcb; + PBCB Bcb; /* Pointer to the next cache segment in a chain. */ - struct _ROS_CACHE_SEGMENT* NextInChain; -} ROS_CACHE_SEGMENT, *PROS_CACHE_SEGMENT; + struct _CACHE_SEGMENT* NextInChain; +} CACHE_SEGMENT; VOID STDCALL CcMdlReadCompleteDev (IN PMDL MdlChain, IN PDEVICE_OBJECT DeviceObject); NTSTATUS -CcRosGetCacheSegment(PROS_BCB Bcb, +CcRosGetCacheSegment(PBCB Bcb, ULONG FileOffset, PULONG BaseOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, - PROS_CACHE_SEGMENT* CacheSeg); - -NTSTATUS STDCALL -CcRosFreeCacheSegment(PROS_BCB Bcb, PROS_CACHE_SEGMENT CacheSeg); - + PCACHE_SEGMENT* CacheSeg); VOID CcInitView(VOID); -NTSTATUS STDCALL CcRosFreeCacheSegment(PROS_BCB, PROS_CACHE_SEGMENT); -NTSTATUS STDCALL -CcRosRequestCacheSegment(PROS_BCB Bcb, - ULONG FileOffset, - PVOID* BaseAddress, - PBOOLEAN UptoDate, - PROS_CACHE_SEGMENT* CacheSeg); +NTSTATUS STDCALL CcRosFreeCacheSegment(PBCB, PCACHE_SEGMENT); -NTSTATUS STDCALL -CcRosReleaseCacheSegment(PROS_BCB Bcb, - PROS_CACHE_SEGMENT CacheSeg, - BOOLEAN Valid, - BOOLEAN Dirty, - BOOLEAN Mapped); +NTSTATUS ReadCacheSegment(PCACHE_SEGMENT CacheSeg); -NTSTATUS ReadCacheSegment(PROS_CACHE_SEGMENT CacheSeg); - -NTSTATUS WriteCacheSegment(PROS_CACHE_SEGMENT CacheSeg); +NTSTATUS WriteCacheSegment(PCACHE_SEGMENT CacheSeg); VOID CcInit(VOID); NTSTATUS -CcRosUnmapCacheSegment(PROS_BCB Bcb, ULONG FileOffset, BOOLEAN NowDirty); +CcRosUnmapCacheSegment(PBCB Bcb, ULONG FileOffset, BOOLEAN NowDirty); NTSTATUS -CcRosSuggestFreeCacheSegment(PROS_BCB Bcb, ULONG FileOffset, BOOLEAN NowDirty); +CcRosSuggestFreeCacheSegment(PBCB Bcb, ULONG FileOffset, BOOLEAN NowDirty); NTSTATUS -CcRosGetCacheSegmentChain(PROS_BCB Bcb, +CcRosGetCacheSegmentChain(PBCB Bcb, ULONG FileOffset, ULONG Length, - PROS_CACHE_SEGMENT* CacheSeg); - + PCACHE_SEGMENT* CacheSeg); VOID CcInitCacheZeroPage(VOID); - NTSTATUS -CcRosMarkDirtyCacheSegment(PROS_BCB Bcb, ULONG FileOffset); +CcRosMarkDirtyCacheSegment(PBCB Bcb, ULONG FileOffset); NTSTATUS CcRosFlushDirtyPages(ULONG Target, PULONG Count); VOID CcRosDereferenceCache(PFILE_OBJECT FileObject); VOID CcRosReferenceCache(PFILE_OBJECT FileObject); -#endif /* !AS_INVOKED */ - #endif diff --git a/reactos/ntoskrnl/include/internal/dbg.h b/reactos/ntoskrnl/include/internal/dbg.h index 25d9fb53c72..87b3d1ec51b 100644 --- a/reactos/ntoskrnl/include/internal/dbg.h +++ b/reactos/ntoskrnl/include/internal/dbg.h @@ -1,9 +1,8 @@ #ifndef __INCLUDE_INTERNAL_DBG_H #define __INCLUDE_INTERNAL_DBG_H -#ifndef AS_INVOKED - -#include +#include +#include #include NTSTATUS STDCALL @@ -17,6 +16,4 @@ DbgkForwardException(EXCEPTION_RECORD Er, ULONG FirstChance); BOOLEAN DbgShouldPrint(PCH Filename); -#endif /* !AS_INVOKED */ - #endif /* __INCLUDE_INTERNAL_DBG_H */ diff --git a/reactos/ntoskrnl/include/internal/debug.h b/reactos/ntoskrnl/include/internal/debug.h index 604688e1483..148da1b3005 100644 --- a/reactos/ntoskrnl/include/internal/debug.h +++ b/reactos/ntoskrnl/include/internal/debug.h @@ -18,8 +18,6 @@ #ifndef __INTERNAL_DEBUG #define __INTERNAL_DEBUG -#undef assert - #include #include #include diff --git a/reactos/ntoskrnl/include/internal/ex.h b/reactos/ntoskrnl/include/internal/ex.h index fc2dc02cd0d..75cc857abf1 100644 --- a/reactos/ntoskrnl/include/internal/ex.h +++ b/reactos/ntoskrnl/include/internal/ex.h @@ -5,7 +5,41 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H #define __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H -#ifndef AS_INVOKED +#include +#include + +typedef struct _WINSTATION_OBJECT +{ + CSHORT Type; + CSHORT Size; + + KSPIN_LOCK Lock; + UNICODE_STRING Name; + LIST_ENTRY DesktopListHead; + PRTL_ATOM_TABLE AtomTable; + PVOID HandleTable; + struct _DESKTOP_OBJECT* ActiveDesktop; + /* FIXME: Clipboard */ +} WINSTATION_OBJECT, *PWINSTATION_OBJECT; + +typedef struct _DESKTOP_OBJECT +{ + CSHORT Type; + CSHORT Size; + LIST_ENTRY ListEntry; + KSPIN_LOCK Lock; + UNICODE_STRING Name; + /* Pointer to the associated window station. */ + struct _WINSTATION_OBJECT *WindowStation; + /* Head of the list of windows in this desktop. */ + LIST_ENTRY WindowListHead; + /* Pointer to the active queue. */ + PVOID ActiveMessageQueue; + /* Handle of the desktop window. */ + HANDLE DesktopWindow; + HANDLE PrevActiveWindow; +} DESKTOP_OBJECT, *PDESKTOP_OBJECT; + typedef VOID (*PLOOKASIDE_MINMAX_ROUTINE)( POOL_TYPE PoolType, @@ -31,6 +65,4 @@ ExInitializeWorkerThreads(VOID); VOID ExpInitLookasideLists(VOID); -#endif /* !AS_INVOKED */ - #endif /* __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H */ diff --git a/reactos/ntoskrnl/include/internal/handle.h b/reactos/ntoskrnl/include/internal/handle.h index 71fe654ff10..8d1f4363e3f 100644 --- a/reactos/ntoskrnl/include/internal/handle.h +++ b/reactos/ntoskrnl/include/internal/handle.h @@ -1,11 +1,6 @@ #ifndef __INTERNAL_HANDLE_H #define __INTERNAL_HANDLE_H -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - -#ifndef AS_INVOKED typedef struct _RTL_HANDLE { @@ -28,6 +23,4 @@ BOOLEAN RtlpAllocateHandle(PRTL_HANDLE_TABLE HandleTable, PVOID Object, PULONG I BOOLEAN RtlpFreeHandle(PRTL_HANDLE_TABLE HandleTable, ULONG Index); PVOID RtlpMapHandleToPointer(PRTL_HANDLE_TABLE HandleTable, ULONG Index); -#endif /* !AS_INVOKED */ - #endif /* __INTERNAL_HANDLE_H */ diff --git a/reactos/ntoskrnl/include/internal/i386/fpu.h b/reactos/ntoskrnl/include/internal/i386/fpu.h index e983bcf58f0..fec8ba10169 100644 --- a/reactos/ntoskrnl/include/internal/i386/fpu.h +++ b/reactos/ntoskrnl/include/internal/i386/fpu.h @@ -20,11 +20,7 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_I386_FPU_H #define __NTOSKRNL_INCLUDE_INTERNAL_I386_FPU_H -#ifndef AS_INVOKED - VOID KiCheckFPU(VOID); -#endif /* !AS_INVOKED */ - #endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_FPU_H */ diff --git a/reactos/ntoskrnl/include/internal/i386/ke.h b/reactos/ntoskrnl/include/internal/i386/ke.h index 15bbdf637c5..89d81e6cafd 100644 --- a/reactos/ntoskrnl/include/internal/i386/ke.h +++ b/reactos/ntoskrnl/include/internal/i386/ke.h @@ -19,8 +19,6 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H #define __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H -#define KTSS_ESP0 0x4 - #define KTRAP_FRAME_DEBUGEBP (0x0) #define KTRAP_FRAME_DEBUGEIP (0x4) #define KTRAP_FRAME_DEBUGARGMARK (0x8) @@ -67,7 +65,7 @@ #define KTRAP_FRAME_RESERVED9 (0x8A) #define KTRAP_FRAME_SIZE (0x8C) -#ifndef AS_INVOKED +#ifndef __ASM__ typedef struct _KTRAP_FRAME { @@ -115,11 +113,11 @@ typedef struct _KTRAP_FRAME USHORT Reserved8; USHORT V86_Gs; USHORT Reserved9; -} KTRAP_FRAME, *PIKTRAP_FRAME; +} KTRAP_FRAME, *PKTRAP_FRAME; -struct _IKPCR; +struct _KPCR; VOID -KiInitializeGdt(struct _IKPCR* Pcr); +KiInitializeGdt(struct _KPCR* Pcr); VOID Ki386ApplicationProcessorInitializeTSS(VOID); VOID @@ -133,7 +131,7 @@ VOID KeFreeGdtSelector(ULONG Entry); VOID NtEarlyInitVdm(VOID); -#endif /* !AS_INVOKED */ +#endif /* __ASM__ */ #endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H */ diff --git a/reactos/ntoskrnl/include/internal/i386/mm.h b/reactos/ntoskrnl/include/internal/i386/mm.h index b9a49a09fbe..0cf659dcf69 100644 --- a/reactos/ntoskrnl/include/internal/i386/mm.h +++ b/reactos/ntoskrnl/include/internal/i386/mm.h @@ -5,10 +5,27 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H #define __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H -#ifndef AS_INVOKED - struct _EPROCESS; +#if 0 +/* + * Page access attributes (or these together) + */ +#define PA_READ (1<<0) +#define PA_WRITE ((1<<0)+(1<<1)) +#define PA_EXECUTE PA_READ +#define PA_PCD (1<<4) +#define PA_PWT (1<<3) + +/* + * Page attributes + */ +#define PA_USER (1<<2) +#define PA_SYSTEM (0) +#endif + +#define PAGESIZE (4096) + PULONG MmGetPageEntry(PVOID Address); #define KERNEL_BASE (0xc0000000) @@ -17,6 +34,17 @@ PULONG MmGetPageEntry(PVOID Address); PULONG MmGetPageDirectory(VOID); +#if 0 +extern inline PULONG get_page_directory(void) +{ + unsigned int page_dir=0; + __asm__("movl %%cr3,%0\n\t" + : "=r" (page_dir)); + return((PULONG)page_dir); +} +#endif + + /* * Amount of memory that can be mapped by a page table */ @@ -26,6 +54,4 @@ PULONG MmGetPageDirectory(VOID); #define VADDR_TO_PT_OFFSET(x) (((x/1024)%4096)) #define VADDR_TO_PD_OFFSET(x) ((x)/(4*1024*1024)) -#endif /* !AS_INVOKED */ - #endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H */ diff --git a/reactos/ntoskrnl/include/internal/i386/ps.h b/reactos/ntoskrnl/include/internal/i386/ps.h index 91767c6ffdf..f7eac43517b 100644 --- a/reactos/ntoskrnl/include/internal/i386/ps.h +++ b/reactos/ntoskrnl/include/internal/i386/ps.h @@ -26,11 +26,11 @@ #define KTHREAD_STACK_LIMIT 0x1C #define KTHREAD_TEB 0x20 #define KTHREAD_KERNEL_STACK 0x28 -#define KTHREAD_PREVIOUS_MODE 0x13B -#define KTHREAD_TRAP_FRAME 0x12C -#define KTHREAD_CALLBACK_STACK 0x124 +#define KTHREAD_PREVIOUS_MODE 0x137 +#define KTHREAD_TRAP_FRAME 0x128 +#define KTHREAD_CALLBACK_STACK 0x120 -#define ETHREAD_THREADS_PROCESS 0x26C +#define ETHREAD_THREADS_PROCESS 0x234 #define KPROCESS_DIRECTORY_TABLE_BASE 0x18 @@ -38,20 +38,43 @@ #define KPCR_EXCEPTION_LIST 0x0 #define KPCR_SELF 0x18 -#define KPCR_TSS 0x3C -#define KPCR_CURRENT_THREAD 0x5C +#define KPCR_TSS 0x28 +#define KPCR_CURRENT_THREAD 0x124 -#ifndef AS_INVOKED +#ifndef __ASM__ /* * Processor Control Region */ -typedef struct _IKPCR +typedef struct _KPCR { - KPCR KPCR; /* 00 */ - UCHAR Reserved[0x0C]; /* 50 */ - struct _KTHREAD* CurrentThread; /* 5C */ -} IKPCR, *PIKPCR; /* 60 */ + PVOID ExceptionList; /* 00 */ + PVOID StackBase; /* 04 */ + PVOID StackLimit; /* 08 */ + PVOID SubSystemTib; /* 0C */ + PVOID Reserved1; /* 10 */ + PVOID ArbitraryUserPointer; /* 14 */ + struct _KPCR* Self; /* 18 */ + UCHAR ProcessorNumber; /* 1C */ + KIRQL Irql; /* 1D */ + UCHAR Reserved2[0x2]; /* 1E */ + PUSHORT IDT; /* 20 */ + PUSHORT GDT; /* 24 */ + KTSS* TSS; /* 28 */ + UCHAR Reserved3[0xF8]; /* 2C */ + struct _KTHREAD* CurrentThread; /* 124 */ +} __attribute__((packed)) KPCR, *PKPCR; + +static inline PKPCR KeGetCurrentKPCR(VOID) +{ + ULONG value; + + __asm__ __volatile__ ("movl %%fs:0x18, %0\n\t" + : "=r" (value) + : /* no inputs */ + ); + return((PKPCR)value); +} VOID Ki386ContextSwitch(struct _KTHREAD* NewThread, @@ -64,7 +87,7 @@ Ke386InitThreadWithContext(struct _KTHREAD* Thread, PCONTEXT Context); NTSTATUS Ki386ValidateUserContext(PCONTEXT Context); -#endif /* AS_INVOKED */ +#endif /* __ASM__ */ #endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_PS_H */ diff --git a/reactos/ntoskrnl/include/internal/id.h b/reactos/ntoskrnl/include/internal/id.h index 9ba7030a0c2..43a29588163 100644 --- a/reactos/ntoskrnl/include/internal/id.h +++ b/reactos/ntoskrnl/include/internal/id.h @@ -2,8 +2,6 @@ * Structure ids */ -#ifndef AS_INVOKED - #define InternalBaseType (0xcc) #define InternalNotificationEvent (InternalBaseType + 1) #define InternalSynchronizationEvent (InternalBaseType + 2) @@ -18,4 +16,4 @@ #define InternalSynchronizationTimer (InternalBaseType + 11) #define InternalQueueType (InternalBaseType + 12) -#endif /* !AS_INVOKED */ + diff --git a/reactos/ntoskrnl/include/internal/ifs.h b/reactos/ntoskrnl/include/internal/ifs.h index 50c540e8bcf..10a06ca5725 100644 --- a/reactos/ntoskrnl/include/internal/ifs.h +++ b/reactos/ntoskrnl/include/internal/ifs.h @@ -1,12 +1,8 @@ #ifndef __INCLUDE_INTERNAL_IFS_H #define __INCLUDE_INTERNAL_IFS_H -/* $Id: ifs.h,v 1.2 2002/09/07 15:12:51 chorns Exp $ */ - -#ifndef AS_INVOKED +/* $Id: ifs.h,v 1.3 2002/09/08 10:23:21 chorns Exp $ */ /* Look for "FSrt" in mem view */ #define IFS_POOL_TAG 0x74725346 -#endif /* !AS_INVOKED */ - #endif diff --git a/reactos/ntoskrnl/include/internal/io.h b/reactos/ntoskrnl/include/internal/io.h index a509f820ba0..cfd8937feb5 100644 --- a/reactos/ntoskrnl/include/internal/io.h +++ b/reactos/ntoskrnl/include/internal/io.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: io.h,v 1.24 2002/09/07 15:12:51 chorns Exp $ +/* $Id: io.h,v 1.25 2002/09/08 10:23:21 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -30,12 +30,6 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_IO_H #define __NTOSKRNL_INCLUDE_INTERNAL_IO_H -#ifndef AS_INVOKED - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - #include #include @@ -301,7 +295,7 @@ PIRP IoBuildSynchronousFsdRequestWithMdl(ULONG MajorFunction, PLARGE_INTEGER StartingOffset, PKEVENT Event, PIO_STATUS_BLOCK IoStatusBlock, - BOOLEAN PagingIo); + ULONG PagingIo); VOID IoInitShutdownNotification(VOID); VOID IoShutdownRegisteredDevices(VOID); @@ -353,6 +347,4 @@ NTSTATUS PnpRootCreateDevice( PDEVICE_OBJECT *PhysicalDeviceObject); -#endif /* !AS_INVOKED */ - #endif diff --git a/reactos/ntoskrnl/include/internal/kd.h b/reactos/ntoskrnl/include/internal/kd.h index fe91f6cbb22..5b038e2b0cd 100644 --- a/reactos/ntoskrnl/include/internal/kd.h +++ b/reactos/ntoskrnl/include/internal/kd.h @@ -1,4 +1,4 @@ -/* $Id: kd.h,v 1.15 2002/09/07 15:12:51 chorns Exp $ +/* $Id: kd.h,v 1.16 2002/09/08 10:23:21 chorns Exp $ * * kernel debugger prototypes */ @@ -6,8 +6,6 @@ #ifndef __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H #define __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H -#ifndef AS_INVOKED - #include #include @@ -106,6 +104,4 @@ KdbEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord, PCONTEXT Context, PKTRAP_FRAME TrapFrame); -#endif /* !AS_INVOKED */ - #endif /* __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H */ diff --git a/reactos/ntoskrnl/include/internal/ke.h b/reactos/ntoskrnl/include/internal/ke.h index 46fe498bad0..13121187838 100644 --- a/reactos/ntoskrnl/include/internal/ke.h +++ b/reactos/ntoskrnl/include/internal/ke.h @@ -20,15 +20,19 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_KE_H #define __NTOSKRNL_INCLUDE_INTERNAL_KE_H -#define MAXIMUM_PROCESSORS 32 - /* INCLUDES *****************************************************************/ -#include "arch/ke.h" +#ifndef __ASM__ +#include + +#include +#endif /* not __ASM__ */ + +#include /* INTERNAL KERNEL FUNCTIONS ************************************************/ -#ifndef AS_INVOKED +#ifndef __ASM__ struct _KTHREAD; @@ -101,6 +105,8 @@ KeBugCheckWithTf(ULONG BugCheckCode, VOID KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG ExceptionNr, ULONG cr2); -#endif /* !AS_INVOKED */ +#endif /* not __ASM__ */ + +#define MAXIMUM_PROCESSORS 32 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_KE_H */ diff --git a/reactos/ntoskrnl/include/internal/ldr.h b/reactos/ntoskrnl/include/internal/ldr.h index b57413233c8..207e6358023 100644 --- a/reactos/ntoskrnl/include/internal/ldr.h +++ b/reactos/ntoskrnl/include/internal/ldr.h @@ -8,8 +8,6 @@ #ifndef __INCLUDE_INTERNAL_LDR_H #define __INCLUDE_INTERNAL_LDR_H -#ifndef AS_INVOKED - #include #include #include @@ -132,6 +130,4 @@ LdrUnloadModuleSymbols(PIMAGE_SYMBOL_INFO SymbolInfo); #endif /* DBG */ -#endif /* !AS_INVOKED */ - #endif /* __INCLUDE_INTERNAL_LDR_H */ diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index 65fa5356246..bfe84088eff 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -5,8 +5,6 @@ #ifndef __INCLUDE_INTERNAL_MM_H #define __INCLUDE_INTERNAL_MM_H -#ifndef AS_INVOKED - #include #include @@ -89,7 +87,7 @@ typedef struct _MM_SECTION_SEGMENT BOOLEAN WriteCopy; } MM_SECTION_SEGMENT, *PMM_SECTION_SEGMENT; -typedef struct _SECTION_OBJECT +typedef struct { CSHORT Type; CSHORT Size; @@ -143,6 +141,16 @@ typedef struct } Data; } MEMORY_AREA, *PMEMORY_AREA; +typedef struct _MADDRESS_SPACE +{ + LIST_ENTRY MAreaListHead; + FAST_MUTEX Lock; + ULONG LowestAddress; + struct _EPROCESS* Process; + PUSHORT PageTableRefCountTable; + ULONG PageTableRefCountTableSize; +} MADDRESS_SPACE, *PMADDRESS_SPACE; + /* FUNCTIONS */ VOID MmLockAddressSpace(PMADDRESS_SPACE AddressSpace); @@ -178,6 +186,8 @@ NTSTATUS MmLockMemoryArea(MEMORY_AREA* MemoryArea); NTSTATUS MmUnlockMemoryArea(MEMORY_AREA* MemoryArea); NTSTATUS MmInitSectionImplementation(VOID); +#define MM_LOWEST_USER_ADDRESS (4096) + PMEMORY_AREA MmSplitMemoryArea(struct _EPROCESS* Process, PMADDRESS_SPACE AddressSpace, PMEMORY_AREA OriginalMemoryArea, @@ -573,7 +583,6 @@ MmProtectSectionView(PMADDRESS_SPACE AddressSpace, ULONG Length, ULONG Protect, PULONG OldProtect); - NTSTATUS MmWritePageSectionView(PMADDRESS_SPACE AddressSpace, PMEMORY_AREA MArea, @@ -584,7 +593,6 @@ MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace, PMEMORY_AREA MArea, PVOID Address, PMM_PAGEOP PageOp); - VOID MmSetCleanAllRmaps(PHYSICAL_ADDRESS PhysicalAddress); VOID @@ -599,6 +607,4 @@ MmIsAvailableSwapPage(VOID); VOID MmShowOutOfSpaceMessagePagingFile(VOID); -#endif /* !AS_INVOKED */ - #endif diff --git a/reactos/ntoskrnl/include/internal/module.h b/reactos/ntoskrnl/include/internal/module.h index 65257ff1021..b9f0c9c038c 100644 --- a/reactos/ntoskrnl/include/internal/module.h +++ b/reactos/ntoskrnl/include/internal/module.h @@ -2,8 +2,8 @@ #ifndef __MODULE_H #define __MODULE_H -#ifndef AS_INVOKED - +#include +#include #include #include @@ -57,7 +57,5 @@ typedef struct _INSTANCE BOOLEAN process_boot_module(unsigned int start); -#endif /* !AS_INVOKED */ - #endif diff --git a/reactos/ntoskrnl/include/internal/nt.h b/reactos/ntoskrnl/include/internal/nt.h index 538ccca4760..1276503ca7a 100644 --- a/reactos/ntoskrnl/include/internal/nt.h +++ b/reactos/ntoskrnl/include/internal/nt.h @@ -1,12 +1,3 @@ -#ifndef __INCLUDE_INTERNAL_NT_H -#define __INCLUDE_INTERNAL_NT_H - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - -#ifndef AS_INVOKED - VOID NtInitializeEventImplementation(VOID); VOID NtInitializeEventPairImplementation(VOID); VOID NtInitializeSemaphoreImplementation(VOID); @@ -14,7 +5,3 @@ VOID NtInitializeMutantImplementation(VOID); VOID NtInitializeTimerImplementation(VOID); NTSTATUS NiInitPort(VOID); VOID NtInitializeProfileImplementation(VOID); - -#endif /* !AS_INVOKED */ - -#endif diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index f3cde794289..7481602c1c4 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -5,17 +5,11 @@ #ifndef __INCLUDE_INTERNAL_NTOSKRNL_H #define __INCLUDE_INTERNAL_NTOSKRNL_H -#define MM_STACK_SIZE (3*4096) +#ifndef __ASM__ -#ifdef AS_INVOKED +#include -#define KernelMode 0 -#define UserMode 1 - -#endif /* AS_INVOKED */ - - -#ifndef AS_INVOKED +#include /* * Use these to place a function in a specific section of the executable @@ -63,6 +57,11 @@ NTSTATUS RtlpInitNlsSections(ULONG Mod1Start, ULONG Mod3Start, ULONG Mod3End); -#endif /* !AS_INVOKED */ +#endif /* __ASM__ */ + +/* + * + */ +#define MM_STACK_SIZE (3*4096) #endif /* INCLUDE_INTERNAL_NTOSKRNL_H */ diff --git a/reactos/ntoskrnl/include/internal/ob.h b/reactos/ntoskrnl/include/internal/ob.h index 16f406a7606..b8ad6b79aa0 100644 --- a/reactos/ntoskrnl/include/internal/ob.h +++ b/reactos/ntoskrnl/include/internal/ob.h @@ -9,7 +9,7 @@ #ifndef __INCLUDE_INTERNAL_OBJMGR_H #define __INCLUDE_INTERNAL_OBJMGR_H -#ifndef AS_INVOKED +#include struct _EPROCESS; @@ -109,6 +109,4 @@ ObDuplicateObject(PEPROCESS SourceProcess, BOOLEAN InheritHandle, ULONG Options); -#endif /* !AS_INVOKED */ - #endif /* __INCLUDE_INTERNAL_OBJMGR_H */ diff --git a/reactos/ntoskrnl/include/internal/po.h b/reactos/ntoskrnl/include/internal/po.h index 7337fb95998..8947262523a 100644 --- a/reactos/ntoskrnl/include/internal/po.h +++ b/reactos/ntoskrnl/include/internal/po.h @@ -1,4 +1,4 @@ -/* $Id: po.h,v 1.2 2002/09/07 15:12:51 chorns Exp $ +/* $Id: po.h,v 1.3 2002/09/08 10:23:23 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,8 +12,6 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_PO_H #define __NTOSKRNL_INCLUDE_INTERNAL_PO_H -#ifndef AS_INVOKED - #include #include @@ -26,6 +24,4 @@ NTSTATUS PopSetSystemPowerState( SYSTEM_POWER_STATE PowerState); -#endif /* !AS_INVOKED */ - #endif /* __NTOSKRNL_INCLUDE_INTERNAL_PO_H */ diff --git a/reactos/ntoskrnl/include/internal/pool.h b/reactos/ntoskrnl/include/internal/pool.h index e3d0de90b44..cf709282f2d 100644 --- a/reactos/ntoskrnl/include/internal/pool.h +++ b/reactos/ntoskrnl/include/internal/pool.h @@ -1,13 +1,10 @@ #ifndef __INTERNAL_POOL_H #define __INTERNAL_POOL_H -#ifndef AS_INVOKED - -PVOID STDCALL -ExAllocateNonPagedPoolWithTag(ULONG Type, - ULONG Size, - ULONG Tag, - PVOID Caller); +PVOID STDCALL ExAllocateNonPagedPoolWithTag (POOL_TYPE type, + ULONG size, + ULONG Tag, + PVOID Caller); PVOID STDCALL ExAllocatePagedPoolWithTag (POOL_TYPE Type, ULONG size, @@ -28,6 +25,4 @@ extern ULONG MmPagedPoolSize; */ #define NONPAGED_POOL_SIZE (100*1024*1024) -#endif /* !AS_INVOKED */ - #endif /* __INTERNAL_POOL_H */ diff --git a/reactos/ntoskrnl/include/internal/port.h b/reactos/ntoskrnl/include/internal/port.h index dcfa3f984b8..b987c3bd04b 100644 --- a/reactos/ntoskrnl/include/internal/port.h +++ b/reactos/ntoskrnl/include/internal/port.h @@ -1,7 +1,7 @@ #ifndef __INCLUDE_INTERNAL_PORT_H #define __INCLUDE_INTERNAL_PORT_H -#ifndef AS_INVOKED +#include typedef struct _EPORT_LISTENER { @@ -43,7 +43,7 @@ typedef struct _EPORT_TERMINATION_REQUEST typedef struct _EPORT_CONNECT_REQUEST_MESSAGE { - LPC_MESSAGE MessageHeader; + LPC_MESSAGE_HEADER MessageHeader; PEPROCESS ConnectingProcess; struct _SECTION_OBJECT* SendSectionObject; LARGE_INTEGER SendSectionOffset; @@ -54,7 +54,7 @@ typedef struct _EPORT_CONNECT_REQUEST_MESSAGE typedef struct _EPORT_CONNECT_REPLY_MESSAGE { - LPC_MESSAGE MessageHeader; + LPC_MESSAGE_HEADER MessageHeader; PVOID SendServerViewBase; ULONG ReceiveClientViewSize; PVOID ReceiveClientViewBase; @@ -142,6 +142,5 @@ EiReplyOrRequestPort (IN PEPORT Port, IN ULONG MessageType, IN PEPORT Sender); -#endif /* !AS_INVOKED */ #endif /* __INCLUDE_INTERNAL_PORT_H */ diff --git a/reactos/ntoskrnl/include/internal/ps.h b/reactos/ntoskrnl/include/internal/ps.h index 6c5d7a826a9..27eb97f7794 100644 --- a/reactos/ntoskrnl/include/internal/ps.h +++ b/reactos/ntoskrnl/include/internal/ps.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: ps.h,v 1.42 2002/09/07 15:12:51 chorns Exp $ +/* $Id: ps.h,v 1.43 2002/09/08 10:23:23 chorns Exp $ * * FILE: ntoskrnl/ke/kthread.c * PURPOSE: Process manager definitions @@ -28,31 +28,381 @@ #ifndef __INCLUDE_INTERNAL_PS_H #define __INCLUDE_INTERNAL_PS_H -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - -#ifndef AS_INVOKED - -#include +#ifndef __ASM__ /* Forward declarations. */ - struct _KTHREAD; struct _KTRAPFRAME; -#endif /* !AS_INVOKED */ +#endif /* __ASM__ */ #include -#ifndef AS_INVOKED +#ifndef __ASM__ #include +#include + +#define KeGetCurrentProcessorNumber() (KeGetCurrentKPCR()->ProcessorNumber) extern HANDLE SystemProcessHandle; + extern LCID PsDefaultThreadLocaleId; extern LCID PsDefaultSystemLocaleId; +typedef struct _KAPC_STATE +{ + LIST_ENTRY ApcListHead[2]; + struct _KPROCESS* Process; + UCHAR KernelApcInProgress; + UCHAR KernelApcPending; + USHORT UserApcPending; +} __attribute__((packed)) KAPC_STATE, *PKAPC_STATE; + +typedef struct _KTHREAD +{ + /* For waiting on thread exit */ + DISPATCHER_HEADER DispatcherHeader; /* 00 */ + + /* List of mutants owned by the thread */ + LIST_ENTRY MutantListHead; /* 10 */ + PVOID InitialStack; /* 18 */ + ULONG StackLimit; /* 1C */ + + /* Pointer to the thread's environment block in user memory */ + PTEB Teb; /* 20 */ + + /* Pointer to the thread's TLS array */ + PVOID TlsArray; /* 24 */ + PVOID KernelStack; /* 28 */ + UCHAR DebugActive; /* 2C */ + + /* Thread state (one of THREAD_STATE_xxx constants below) */ + UCHAR State; /* 2D */ + UCHAR Alerted[2]; /* 2E */ + UCHAR Iopl; /* 30 */ + UCHAR NpxState; /* 31 */ + UCHAR Saturation; /* 32 */ + CHAR Priority; /* 33 */ + KAPC_STATE ApcState; /* 34 */ + ULONG ContextSwitches; /* 4C */ + ULONG WaitStatus; /* 50 */ + KIRQL WaitIrql; /* 54 */ + UCHAR WaitMode; /* 55 */ + UCHAR WaitNext; /* 56 */ + UCHAR WaitReason; /* 57 */ + PKWAIT_BLOCK WaitBlockList; /* 58 */ + LIST_ENTRY WaitListEntry; /* 5C */ + ULONG WaitTime; /* 64 */ + CHAR BasePriority; /* 68 */ + UCHAR DecrementCount; /* 69 */ + UCHAR PriorityDecrement; /* 6A */ + UCHAR Quantum; /* 6B */ + KWAIT_BLOCK WaitBlock[4]; /* 6C */ + PVOID LegoData; /* CC */ + LONG KernelApcDisable; /* D0 */ + KAFFINITY UserAffinity; /* D4 */ + UCHAR SystemAffinityActive;/* D8 */ + UCHAR Pad[7]; /* D9 */ + PKQUEUE Queue; /* E0 */ + KSPIN_LOCK ApcQueueLock; /* E4 */ + KTIMER Timer; /* E8 */ + LIST_ENTRY QueueListEntry; /* 110 */ + KAFFINITY Affinity; /* 118 */ + UCHAR Preempted; /* 11C */ + UCHAR ProcessReadyQueue; /* 11D */ + UCHAR KernelStackResident; /* 11E */ + UCHAR NextProcessor; /* 11F */ + PVOID CallbackStack; /* 120 */ + BOOL Win32Thread; /* 124 */ + struct _KTRAP_FRAME* TrapFrame; /* 128 */ + PVOID ApcStatePointer[2]; /* 12C */ + UCHAR EnableStackSwap; /* 134 */ + UCHAR LargeStack; /* 135 */ + UCHAR ResourceIndex; /* 136 */ + UCHAR PreviousMode; /* 137 */ + ULONG KernelTime; /* 138 */ + ULONG UserTime; /* 13C */ + KAPC_STATE SavedApcState; /* 140 */ + UCHAR Alertable; /* 158 */ + UCHAR ApcStateIndex; /* 159 */ + UCHAR ApcQueueable; /* 15A */ + UCHAR AutoAlignment; /* 15B */ + PVOID StackBase; /* 15C */ + KAPC SuspendApc; /* 160 */ + KSEMAPHORE SuspendSemaphore; /* 190 */ + LIST_ENTRY ThreadListEntry; /* 1A4 */ + CHAR FreezeCount; /* 1AC */ + UCHAR SuspendCount; /* 1AD */ + UCHAR IdealProcessor; /* 1AE */ + UCHAR DisableBoost; /* 1AF */ + + /* + * Below here are thread structure members that are specific to ReactOS + */ + + /* Added by Phillip Susi for list of threads in a process */ + LIST_ENTRY ProcessThreadListEntry; /* 1B0 */ +} __attribute__((packed)) KTHREAD, *PKTHREAD; + +/* Top level irp definitions. */ +#define FSRTL_FSP_TOP_LEVEL_IRP (0x01) +#define FSRTL_CACHE_TOP_LEVEL_IRP (0x02) +#define FSRTL_MOD_WRITE_TOP_LEVEL_IRP (0x03) +#define FSRTL_FAST_IO_TOP_LEVEL_IRP (0x04) +#define FSRTL_MAX_TOP_LEVEL_IRP_FLAG (0x04) + +typedef struct _TOP_LEVEL_IRP +{ + PIRP TopLevelIrp; + ULONG TopLevelIrpConst; +} TOP_LEVEL_IRP; + +typedef struct +{ + PACCESS_TOKEN Token; // 0x0 + UCHAR Unknown1; // 0x4 + UCHAR Unknown2; // 0x5 + UCHAR Pad[2]; // 0x6 + SECURITY_IMPERSONATION_LEVEL Level; // 0x8 +} PS_IMPERSONATION_INFO, *PPS_IMPERSONATION_INFO; + +typedef struct _ETHREAD +{ + KTHREAD Tcb; /* 000 */ + TIME CreateTime; /* 1B0/1B8 */ + union + { + TIME ExitTime; /* 1B8/1E4 */ + LIST_ENTRY LpcReplyChain; /* 1B8/1E4 */ + } u1; + NTSTATUS ExitStatus; /* 1C0/1EC */ + LIST_ENTRY PostBlockList; /* 1C4/1F0 */ + LIST_ENTRY TerminationPortList; /* 1CC/1F8 */ + KSPIN_LOCK ActiveTimerListLock; /* 1D4/200 */ + LIST_ENTRY ActiveTimerListHead; /* 1D8/204 */ + CLIENT_ID Cid; /* 1E0/20C */ + KSEMAPHORE LpcReplySemaphore; /* 1E8/214 */ + PVOID LpcReplyMessage; /* 1FC/228 */ + PLARGE_INTEGER LpcReplyMessageId; /* 200/22C */ + ULONG PerformanceCounterLow; /* 204/230 */ + PPS_IMPERSONATION_INFO ImpersonationInfo; /* 208/234 */ + LIST_ENTRY IrpList; /* 20C/238 */ + TOP_LEVEL_IRP* TopLevelIrp; /* 214/240 */ + PDEVICE_OBJECT DeviceToVerify; /* 218/244 */ + ULONG ReadClusterSize; /* 21C/248 */ + UCHAR ForwardClusterOnly; /* 220/24C */ + UCHAR DisablePageFaultClustering; /* 221/24D */ + UCHAR DeadThread; /* 222/24E */ + UCHAR HasTerminated; /* 223/24F */ + PVOID EventPair; /* 224/250 */ + ACCESS_MASK GrantedAccess; /* 228/254 */ + struct _EPROCESS* ThreadsProcess; /* 22C/258 */ + PKSTART_ROUTINE StartAddress; /* 230/25C */ + union + { + LPTHREAD_START_ROUTINE Win32StartAddress; /* 234/260 */ + ULONG LpcReceiveMessageId; /* 234/260 */ + } u2; + UCHAR LpcExitThreadCalled; /* 238/264 */ + UCHAR HardErrorsAreDisabled; /* 239/265 */ + UCHAR LpcReceivedMsgIdValid; /* 23A/266 */ + UCHAR ActiveImpersonationInfo; /* 23B/267 */ + ULONG PerformanceCountHigh; /* 23C/268 */ + + /* + * Added by David Welch (welch@cwcom.net) + */ + struct _EPROCESS* OldProcess; /* 240/26C */ + + struct _W32THREAD* Win32Thread; + +} __attribute__((packed)) ETHREAD, *PETHREAD; + + +typedef struct _KPROCESS +{ + /* So it's possible to wait for the process to terminate */ + DISPATCHER_HEADER DispatcherHeader; /* 000 */ + /* + * Presumably a list of profile objects associated with this process, + * currently unused. + */ + LIST_ENTRY ProfileListHead; /* 010 */ + /* + * We use the first member of this array to hold the physical address of + * the page directory for this process. + */ + PHYSICAL_ADDRESS DirectoryTableBase; /* 018 */ + /* + * Presumably a descriptor for the process's LDT, currently unused. + */ + ULONG LdtDescriptor[2]; /* 020 */ + /* + * Presumably for processing int 0x21 from V86 mode DOS, currently + * unused. + */ + ULONG Int21Descriptor[2]; /* 028 */ + /* Don't know. */ + USHORT IopmOffset; /* 030 */ + /* + * Presumably I/O privilege level to be used for this process, currently + * unused. + */ + UCHAR Iopl; /* 032 */ + /* Set if this process is a virtual dos machine? */ + UCHAR VdmFlag; /* 033 */ + /* Bitmask of the processors being used by this process's threads? */ + ULONG ActiveProcessors; /* 034 */ + /* Aggregate of the time this process's threads have spent in kernel mode? */ + ULONG KernelTime; /* 038 */ + /* Aggregate of the time this process's threads have spent in user mode? */ + ULONG UserTime; /* 03C */ + /* List of this process's threads that are ready for execution? */ + LIST_ENTRY ReadyListHead; /* 040 */ + /* List of this process's threads that have their stacks swapped out? */ + LIST_ENTRY SwapListEntry; /* 048 */ + /* List of this process's threads? */ + LIST_ENTRY ThreadListHead; /* 050 */ + /* Maybe a lock for this data structure, the type is assumed. */ + KSPIN_LOCK ProcessLock; /* 058 */ + /* Default affinity mask for this process's threads? */ + ULONG Affinity; /* 05C */ + /* Count of the stacks allocated for this process's threads? */ + USHORT StackCount; /* 060 */ + /* Base priority for this process's threads? */ + KPRIORITY BasePriority; /* 062 */ + /* Default quantum for this process's threads */ + UCHAR ThreadQuantum; /* 063 */ + /* Unknown. */ + UCHAR AutoAlignment; /* 064 */ + /* Process execution state, currently either active or terminated. */ + UCHAR State; /* 065 */ + /* Seed for generating thread ids for this process's threads? */ + UCHAR ThreadSeed; /* 066 */ + /* Disable priority boosts? */ + UCHAR DisableBoost; /* 067 */ +} KPROCESS, *PKPROCESS; + +struct _EPROCESS +{ + /* Microkernel specific process state. */ + KPROCESS Pcb; /* 000 */ + /* Exit status of the process. */ + NTSTATUS ExitStatus; /* 068 */ + /* Unknown. */ + KEVENT LockEvent; /* 06C */ + /* Unknown. */ + ULONG LockCount; /* 07C */ + /* Time of process creation. */ + TIME CreateTime; /* 080 */ + /* Time of process exit. */ + TIME ExitTime; /* 088 */ + /* Unknown. */ + PVOID LockOwner; /* 090 */ + /* Process id. */ + ULONG UniqueProcessId; /* 094 */ + /* Unknown. */ + LIST_ENTRY ActiveProcessLinks; /* 098 */ + /* Unknown. */ + ULONG QuotaPeakPoolUsage[2]; /* 0A0 */ + /* Unknown. */ + ULONG QuotaPoolUsage[2]; /* 0A8 */ + /* Unknown. */ + ULONG PagefileUsage; /* 0B0 */ + /* Unknown. */ + ULONG CommitCharge; /* 0B4 */ + /* Unknown. */ + ULONG PeakPagefileUsage; /* 0B8 */ + /* Unknown. */ + ULONG PeakVirtualSize; /* 0BC */ + /* Unknown. */ + LARGE_INTEGER VirtualSize; /* 0C0 */ + struct + { + ULONG LastTrimTime; + ULONG LastTrimFaultCount; + ULONG PageFaultCount; + ULONG PeakWorkingSetSize; + ULONG WorkingSetSize; + ULONG MinimumWorkingSetSize; + ULONG MaximumWorkingSetSize; + ULONG VmWorkingSetList; + LIST_ENTRY WorkingSetExpansionList; + UCHAR AllowWorkingSetAdjustment; + UCHAR AddressSpaceBeingDeleted; + UCHAR ForegroundPrioritySwitch; + UCHAR MemoryPriority; + } Vm; + PVOID LastProtoPteFault; + struct _EPORT* DebugPort; + struct _EPORT* ExceptionPort; + PVOID ObjectTable; + PVOID Token; + /* FAST_MUTEX WorkingSetLock; */ + KMUTEX WorkingSetLock; + PVOID WorkingSetPage; + UCHAR ProcessOutswapEnabled; + UCHAR ProcessOutswapped; + UCHAR AddressSpaceInitialized; + UCHAR AddressSpaceDeleted; + FAST_MUTEX AddressCreationLock; + KSPIN_LOCK HyperSpaceLock; + PETHREAD ForkInProgress; + USHORT VmOperation; + UCHAR ForkWasSuccessful; + UCHAR MmAgressiveWsTrimMask; + PKEVENT VmOperationEvent; + PVOID PageDirectoryPte; + ULONG LastFaultCount; + PVOID VadRoot; + PVOID VadHint; + PVOID CloneRoot; + ULONG NumberOfPrivatePages; + ULONG NumberOfLockedPages; + USHORT NextProcessColour; + UCHAR ExitProcessCalled; + UCHAR CreateProcessReported; + HANDLE SectionHandle; + PPEB Peb; + PVOID SectionBaseAddress; + PVOID QuotaBlock; + NTSTATUS LastThreadExitStatus; + PVOID WorkingSetWatch; + HANDLE InheritedFromUniqueProcessId; + ACCESS_MASK GrantedAccess; + ULONG DefaultHardErrorProcessing; + PVOID LdtInformation; + ULONG VadFreeHint; + PVOID VdmObjects; + KMUTANT ProcessMutant; + CHAR ImageFileName[16]; + ULONG VmTrimFaultValue; + UCHAR SetTimerResolution; + UCHAR PriorityClass; + UCHAR SubSystemMinorVersion; + UCHAR SubSystemMajorVersion; + USHORT SubSystemVersion; + struct _W32PROCESS* Win32Process; + HANDLE Win32WindowStation; + + /* + * Added by David Welch (welch@mcmail.com) + */ + HANDLE Win32Desktop; + MADDRESS_SPACE AddressSpace; + HANDLE_TABLE HandleTable; + LIST_ENTRY ProcessListEntry; + + /* + * Added by Philip Susi for list of threads in process + */ + LIST_ENTRY ThreadListHead; +}; + +#define PROCESS_STATE_TERMINATED (1) +#define PROCESS_STATE_ACTIVE (2) + VOID PiInitDefaultLocale(VOID); VOID PiInitProcessManager(VOID); VOID PiShutdownProcessManager(VOID); @@ -78,13 +428,13 @@ PsInitializeThread(HANDLE ProcessHandle, POBJECT_ATTRIBUTES ObjectAttributes, BOOLEAN First); -PIACCESS_TOKEN PsReferenceEffectiveToken(PETHREAD Thread, +PACCESS_TOKEN PsReferenceEffectiveToken(PETHREAD Thread, PTOKEN_TYPE TokenType, PUCHAR b, PSECURITY_IMPERSONATION_LEVEL Level); NTSTATUS PsOpenTokenOfProcess(HANDLE ProcessHandle, - PIACCESS_TOKEN* Token); + PACCESS_TOKEN* Token); NTSTATUS PsSuspendThread(PETHREAD Thread, PULONG PreviousCount); NTSTATUS PsResumeThread(PETHREAD Thread, PULONG PreviousCount); @@ -131,7 +481,7 @@ VOID PsApplicationProcessorInit(VOID); VOID PsPrepareForApplicationProcessorInit(ULONG Id); -VOID STDCALL +NTSTATUS STDCALL PsIdleThreadMain(PVOID Context); VOID STDCALL @@ -153,6 +503,6 @@ PsInitialiseSuspendImplementation(VOID); extern ULONG PiNrThreadsAwaitingReaping; -#endif /* !AS_INVOKED */ +#endif /* ASSEMBLER */ #endif /* __INCLUDE_INTERNAL_PS_H */ diff --git a/reactos/ntoskrnl/include/internal/registry.h b/reactos/ntoskrnl/include/internal/registry.h index 20733f5f263..1921071c153 100644 --- a/reactos/ntoskrnl/include/internal/registry.h +++ b/reactos/ntoskrnl/include/internal/registry.h @@ -2,17 +2,13 @@ #ifndef __INCLUDE_INTERNAL_REGISTRY_H #define __INCLUDE_INTERNAL_REGISTRY_H -#ifndef AS_INVOKED - NTSTATUS RtlpGetRegistryHandle(ULONG RelativeTo, - PCWSTR Path, + PWSTR Path, BOOLEAN Create, PHANDLE KeyHandle); NTSTATUS RtlpCreateRegistryKeyPath(PWSTR Path); -#endif /* !AS_INVOKED */ - #endif /* __INCLUDE_INTERNAL_REGISTRY_H */ diff --git a/reactos/ntoskrnl/include/internal/safe.h b/reactos/ntoskrnl/include/internal/safe.h index daa12bdc3f4..d20c7a7fd5c 100644 --- a/reactos/ntoskrnl/include/internal/safe.h +++ b/reactos/ntoskrnl/include/internal/safe.h @@ -1,8 +1,6 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_SAFE_H #define __NTOSKRNL_INCLUDE_INTERNAL_SAFE_H -#ifndef AS_INVOKED - NTSTATUS MmSafeCopyFromUser(PVOID Dest, PVOID Src, ULONG NumberOfBytes); NTSTATUS MmSafeCopyToUser(PVOID Dest, PVOID Src, ULONG NumberOfBytes); @@ -15,6 +13,4 @@ NTSTATUS RtlCaptureUnicodeString(PUNICODE_STRING Dest, PUNICODE_STRING UnsafeSrc); -#endif /* !AS_INVOKED */ - #endif /* __NTOSKRNL_INCLUDE_INTERNAL_SAFE_Hb */ diff --git a/reactos/ntoskrnl/include/internal/se.h b/reactos/ntoskrnl/include/internal/se.h index 1c0fe305824..98fb83c9fab 100644 --- a/reactos/ntoskrnl/include/internal/se.h +++ b/reactos/ntoskrnl/include/internal/se.h @@ -20,7 +20,6 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_SE_H #define __NTOSKRNL_INCLUDE_INTERNAL_SE_H -#ifndef AS_INVOKED extern POBJECT_TYPE SepTokenObjectType; @@ -109,8 +108,8 @@ NTSTATUS SepInitializeNewProcess(struct _EPROCESS* NewProcess, struct _EPROCESS* ParentProcess); NTSTATUS SeExchangePrimaryToken(struct _EPROCESS* Process, - PIACCESS_TOKEN NewToken, - PIACCESS_TOKEN* OldTokenP); + PACCESS_TOKEN NewToken, + PACCESS_TOKEN* OldTokenP); NTSTATUS SeCaptureLuidAndAttributesArray(PLUID_AND_ATTRIBUTES Src, ULONG PrivilegeCount, @@ -122,16 +121,6 @@ NTSTATUS SeCaptureLuidAndAttributesArray(PLUID_AND_ATTRIBUTES Src, PLUID_AND_ATTRIBUTES* Dest, PULONG Length); -NTSTATUS STDCALL -RtlCopySidAndAttributesArray(ULONG Count, - PSID_AND_ATTRIBUTES_ARRAY Src, - ULONG SidAreaSize, - PSID_AND_ATTRIBUTES_ARRAY Dest, - PVOID SidArea, - PVOID* RemainingSidArea, - PULONG RemainingSidAreaSize); - -#endif /* !AS_INVOKED */ #endif /* __NTOSKRNL_INCLUDE_INTERNAL_SE_H */ diff --git a/reactos/ntoskrnl/include/internal/trap.h b/reactos/ntoskrnl/include/internal/trap.h index a05003da472..6588b324fa9 100644 --- a/reactos/ntoskrnl/include/internal/trap.h +++ b/reactos/ntoskrnl/include/internal/trap.h @@ -31,7 +31,8 @@ #define TF_REGS (0x90) #define TF_ORIG_EBP (0x94) -#ifndef AS_INVOKED + +#ifndef __ASM__ #include @@ -52,6 +53,6 @@ typedef struct _KV86M_TRAP_FRAME ULONG KeV86Exception(ULONG ExceptionNr, PKTRAP_FRAME Tf, ULONG address); -#endif /* !AS_INVOKED */ +#endif /* not __ASM__ */ #endif /* __NTOSKRNL_INCLUDE_INTERNAL_TRAP_H */ diff --git a/reactos/ntoskrnl/include/internal/v86m.h b/reactos/ntoskrnl/include/internal/v86m.h index b7fdd14ebca..43f80f43409 100644 --- a/reactos/ntoskrnl/include/internal/v86m.h +++ b/reactos/ntoskrnl/include/internal/v86m.h @@ -27,7 +27,7 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_V86M_H #define __NTOSKRNL_INCLUDE_INTERNAL_V86M_H -#ifndef AS_INVOKED +#ifndef __ASM__ /* Emulate cli/sti instructions */ #define KV86M_EMULATE_CLI_STI (0x1) @@ -69,12 +69,12 @@ typedef struct _KV86M_REGISTERS ULONG Vif; ULONG Flags; PNTSTATUS PStatus; -} __attribute__((packed)) KV86M_REGISTERS, *PKV86M_REGISTERS; +} KV86M_REGISTERS, *PKV86M_REGISTERS; NTSTATUS STDCALL Ke386CallBios(UCHAR Int, PKV86M_REGISTERS Regs); -#endif /* !AS_INVOKED */ +#else /* ASSEMBLER */ /* * Definitions for the offsets of members in the KV86M_REGISTERS @@ -96,4 +96,6 @@ Ke386CallBios(UCHAR Int, PKV86M_REGISTERS Regs); #define KV86M_REGISTERS_ESP (0x38) #define KV86M_REGISTERS_SS (0x3C) +#endif /* ASSEMBLER */ + #endif /* __NTOSKRNL_INCLUDE_INTERNAL_V86M_H */ diff --git a/reactos/ntoskrnl/include/internal/xhal.h b/reactos/ntoskrnl/include/internal/xhal.h index 1e9badef430..55a3f17943c 100644 --- a/reactos/ntoskrnl/include/internal/xhal.h +++ b/reactos/ntoskrnl/include/internal/xhal.h @@ -1,8 +1,6 @@ #ifndef __INCLUDE_INTERNAL_XHAL_H #define __INCLUDE_INTERNAL_XHAL_H -#ifndef AS_INVOKED - NTSTATUS xHalQueryDriveLayout(IN PUNICODE_STRING DeviceName, OUT PDRIVE_LAYOUT_INFORMATION *LayoutInfo); @@ -38,6 +36,4 @@ xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject, IN ULONG NumberOfHeads, IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer); -#endif /* !AS_INVOKED */ - #endif diff --git a/reactos/ntoskrnl/include/ntoskrnl.h b/reactos/ntoskrnl/include/ntoskrnl.h deleted file mode 100755 index aa6872d422b..00000000000 --- a/reactos/ntoskrnl/include/ntoskrnl.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef __INTERNAL_NTOSKRNL_H -#define __INTERNAL_NTOSKRNL_H - -#define __MINGW_IMPORT extern - -#ifndef AS_INVOKED -#include -#include -#include -#include -#include -#include -#include -#define NTOS_KERNEL_MODE -#include -#include -#include -#include -#include -#endif /* !AS_INVOKED */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Conflicts with a member name */ -#undef DeviceCapabilities - -#endif /* __INTERNAL_NTOSKRNL_H */ diff --git a/reactos/ntoskrnl/io/adapter.c b/reactos/ntoskrnl/io/adapter.c index ac5cec3ad58..a785d42ef3b 100644 --- a/reactos/ntoskrnl/io/adapter.c +++ b/reactos/ntoskrnl/io/adapter.c @@ -1,4 +1,4 @@ -/* $Id: adapter.c,v 1.6 2002/09/07 15:12:52 chorns Exp $ +/* $Id: adapter.c,v 1.7 2002/09/08 10:23:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,17 +11,15 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* DATA **********************************************************************/ -POBJECT_TYPE IoAdapterObjectType = NULL; /* FIXME */ -POBJECT_TYPE IoDeviceHandlerObjectType = NULL; /* FIXME */ -ULONG IoDeviceHandlerObjectSize = 0; /* FIXME */ +POBJECT_TYPE EXPORTED IoAdapterObjectType = NULL; /* FIXME */ +POBJECT_TYPE EXPORTED IoDeviceHandlerObjectType = NULL; /* FIXME */ +USHORT EXPORTED IoDeviceHandlerObjectSize = 0; /* FIXME */ /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/io/arcname.c b/reactos/ntoskrnl/io/arcname.c index 488bf561581..09a1f375f71 100644 --- a/reactos/ntoskrnl/io/arcname.c +++ b/reactos/ntoskrnl/io/arcname.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: arcname.c,v 1.8 2002/09/07 15:12:52 chorns Exp $ +/* $Id: arcname.c,v 1.9 2002/09/08 10:23:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -28,7 +28,10 @@ /* INCLUDES *****************************************************************/ -#include +#include + +#include "internal/io.h" +#include "internal/xhal.h" #define NDEBUG #include @@ -142,7 +145,7 @@ IoCreateArcNames(VOID) /* create ARC names for cdrom drives */ DPRINT("CD-ROM drives: %lu\n", ConfigInfo->CDRomCount); - for (i = 0; i < ConfigInfo->CdRomCount; i++) + for (i = 0; i < ConfigInfo->CDRomCount; i++) { swprintf(DeviceNameBuffer, L"\\Device\\CdRom%lu", @@ -188,7 +191,7 @@ IopCheckCdromDevices(PULONG DeviceNumber) FileFsVolume = (PFILE_FS_VOLUME_INFORMATION)Buffer; ConfigInfo = IoGetConfigurationInformation(); - for (i = 0; i < ConfigInfo->CdRomCount; i++) + for (i = 0; i < ConfigInfo->CDRomCount; i++) { swprintf(DeviceNameBuffer, L"\\Device\\CdRom%lu\\", diff --git a/reactos/ntoskrnl/io/buildirp.c b/reactos/ntoskrnl/io/buildirp.c index fa04e3de291..92c48fd47c9 100644 --- a/reactos/ntoskrnl/io/buildirp.c +++ b/reactos/ntoskrnl/io/buildirp.c @@ -1,4 +1,4 @@ -/* $Id: buildirp.c,v 1.29 2002/09/07 15:12:52 chorns Exp $ +/* $Id: buildirp.c,v 1.30 2002/09/08 10:23:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,12 +12,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - /* GLOBALS ******************************************************************/ #define TAG_SYS_BUF TAG('S', 'B', 'U', 'F') diff --git a/reactos/ntoskrnl/io/cancel.c b/reactos/ntoskrnl/io/cancel.c index 770c927928f..c381aa439b4 100644 --- a/reactos/ntoskrnl/io/cancel.c +++ b/reactos/ntoskrnl/io/cancel.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: cancel.c,v 1.7 2002/09/07 15:12:52 chorns Exp $ +/* $Id: cancel.c,v 1.8 2002/09/08 10:23:24 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/io/cancel.c @@ -28,12 +28,11 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ static KSPIN_LOCK CancelSpinLock; @@ -60,7 +59,7 @@ IoCancelIrp(PIRP Irp) { return(FALSE); } - (Irp->CancelRoutine)(IoGetFirstIrpStackLocation(Irp)->DeviceObject, Irp); + Irp->CancelRoutine(Irp->Stack[0].DeviceObject, Irp); IoReleaseCancelSpinLock(oldlvl); return(TRUE); } diff --git a/reactos/ntoskrnl/io/cleanup.c b/reactos/ntoskrnl/io/cleanup.c index b108a3251e2..c1be1884d2c 100644 --- a/reactos/ntoskrnl/io/cleanup.c +++ b/reactos/ntoskrnl/io/cleanup.c @@ -10,12 +10,15 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS ***************************************************************/ VOID STDCALL @@ -35,7 +38,7 @@ IopCompleteRequest1(struct _KAPC* Apc, Irp = (PIRP)(*SystemArgument1); PriorityBoost = (CCHAR)(LONG)(*SystemArgument2); - IoStack = IoGetSpecificIrpStackLocation(Irp, Irp->CurrentLocation); + IoStack = &Irp->Stack[(ULONG)Irp->CurrentLocation]; FileObject = IoStack->FileObject; (*SystemArgument1) = (PVOID)Irp->UserIosb; @@ -177,8 +180,8 @@ VOID IoSecondStageCompletion(PIRP Irp, CCHAR PriorityBoost) DPRINT("IoSecondStageCompletion(Irp %x, PriorityBoost %d)\n", Irp, PriorityBoost); - - IoStack = IoGetSpecificIrpStackLocation(Irp, Irp->CurrentLocation); + + IoStack = &Irp->Stack[(ULONG)Irp->CurrentLocation]; FileObject = IoStack->FileObject; DeviceObject = IoStack->DeviceObject; diff --git a/reactos/ntoskrnl/io/cntrller.c b/reactos/ntoskrnl/io/cntrller.c index 68517337165..41f7c199faf 100644 --- a/reactos/ntoskrnl/io/cntrller.c +++ b/reactos/ntoskrnl/io/cntrller.c @@ -1,4 +1,4 @@ -/* $Id: cntrller.c,v 1.8 2002/09/07 15:12:52 chorns Exp $ +/* $Id: cntrller.c,v 1.9 2002/09/08 10:23:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,11 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include - /* GLOBALS *******************************************************************/ #define TAG_CQE TAG('C', 'Q', 'E', ' ') diff --git a/reactos/ntoskrnl/io/create.c b/reactos/ntoskrnl/io/create.c index ce2449a82d9..5268abb134d 100644 --- a/reactos/ntoskrnl/io/create.c +++ b/reactos/ntoskrnl/io/create.c @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.60 2002/09/07 15:12:52 chorns Exp $ +/* $Id: create.c,v 1.61 2002/09/08 10:23:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,15 @@ /* INCLUDES ***************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define TAG_FILE_NAME TAG('F', 'N', 'A', 'M') @@ -190,7 +193,7 @@ IoCreateStreamFileObject(PFILE_OBJECT FileObject, assert_irql(PASSIVE_LEVEL); - Status = ObRosCreateObject(&FileHandle, + Status = ObCreateObject(&FileHandle, STANDARD_RIGHTS_REQUIRED, NULL, IoFileObjectType, @@ -323,14 +326,14 @@ IoCreateFile(OUT PHANDLE FileHandle, *FileHandle = 0; - Status = ObRosCreateObject(FileHandle, + Status = ObCreateObject(FileHandle, DesiredAccess, ObjectAttributes, IoFileObjectType, (PVOID*)&FileObject); if (!NT_SUCCESS(Status)) { - DPRINT("ObRosCreateObject() failed! (Status %lx)\n", Status); + DPRINT("ObCreateObject() failed! (Status %lx)\n", Status); return(Status); } if (CreateOptions & FILE_SYNCHRONOUS_IO_ALERT) diff --git a/reactos/ntoskrnl/io/device.c b/reactos/ntoskrnl/io/device.c index 4e2c1700c5e..752c5ac7923 100644 --- a/reactos/ntoskrnl/io/device.c +++ b/reactos/ntoskrnl/io/device.c @@ -1,4 +1,4 @@ -/* $Id: device.c,v 1.47 2002/09/07 15:12:52 chorns Exp $ +/* $Id: device.c,v 1.48 2002/09/08 10:23:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,19 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include + +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define TAG_DRIVER TAG('D', 'R', 'V', 'R') @@ -261,7 +268,7 @@ IopCreateDriverObject(PDRIVER_OBJECT *DriverObject, NULL); /* Create module object */ - Status = ObRosCreateObject(&DriverHandle, + Status = ObCreateObject(&DriverHandle, STANDARD_RIGHTS_REQUIRED, &ObjectAttributes, IoDriverObjectType, @@ -326,7 +333,7 @@ IopInitializeDevice(PDEVICE_NODE DeviceNode, DPRINT("Calling driver AddDevice entrypoint at %08lx\n", DriverObject->DriverExtension->AddDevice); - Status = ((PDRIVER_ADD_DEVICE)DriverObject->DriverExtension->AddDevice)( + Status = DriverObject->DriverExtension->AddDevice( DriverObject, DeviceNode->Pdo); if (!NT_SUCCESS(Status)) { @@ -615,11 +622,11 @@ IoCreateDevice(PDRIVER_OBJECT DriverObject, { DPRINT("IoCreateDevice(DriverObject %x)\n",DriverObject); } - + if (DeviceName != NULL) { InitializeObjectAttributes(&ObjectAttributes,DeviceName,0,NULL,NULL); - Status = ObRosCreateObject(&DeviceHandle, + Status = ObCreateObject(&DeviceHandle, 0, &ObjectAttributes, IoDeviceObjectType, @@ -627,14 +634,13 @@ IoCreateDevice(PDRIVER_OBJECT DriverObject, } else { - Status = ObRosCreateObject(&DeviceHandle, + Status = ObCreateObject(&DeviceHandle, 0, NULL, IoDeviceObjectType, (PVOID*)&CreatedDeviceObject); } - *DeviceObject = NULL; if (!NT_SUCCESS(Status)) @@ -672,6 +678,7 @@ IoCreateDevice(PDRIVER_OBJECT DriverObject, RtlZeroMemory(CreatedDeviceObject->DeviceExtension, DeviceExtensionSize); } + CreatedDeviceObject->AttachedDevice = NULL; CreatedDeviceObject->DeviceType = DeviceType; CreatedDeviceObject->StackSize = 1; @@ -689,9 +696,9 @@ IoCreateDevice(PDRIVER_OBJECT DriverObject, { IoAttachVpb(CreatedDeviceObject); } - + *DeviceObject = CreatedDeviceObject; - + return(STATUS_SUCCESS); } diff --git a/reactos/ntoskrnl/io/dir.c b/reactos/ntoskrnl/io/dir.c index 59d39b6bb38..b28b6dface2 100644 --- a/reactos/ntoskrnl/io/dir.c +++ b/reactos/ntoskrnl/io/dir.c @@ -1,4 +1,4 @@ -/* $Id: dir.c,v 1.14 2002/09/07 15:12:52 chorns Exp $ +/* $Id: dir.c,v 1.15 2002/09/08 10:23:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ @@ -85,7 +85,7 @@ NtQueryDirectoryFile( PDEVICE_OBJECT DeviceObject; PFILE_OBJECT FileObject; NTSTATUS Status; - PEXTENDED_IO_STACK_LOCATION IoStack; + PIO_STACK_LOCATION IoStack; IO_STATUS_BLOCK IoSB; DPRINT("NtQueryDirectoryFile()\n"); @@ -117,7 +117,7 @@ NtQueryDirectoryFile( KeResetEvent( &FileObject->Event ); Irp->UserBuffer=FileInformation; - IoStack = (PEXTENDED_IO_STACK_LOCATION)IoGetNextIrpStackLocation(Irp); + IoStack = IoGetNextIrpStackLocation(Irp); IoStack->MajorFunction = IRP_MJ_DIRECTORY_CONTROL; IoStack->MinorFunction = IRP_MN_QUERY_DIRECTORY; diff --git a/reactos/ntoskrnl/io/driver.c b/reactos/ntoskrnl/io/driver.c index 1b6858a8935..3414ab2d674 100644 --- a/reactos/ntoskrnl/io/driver.c +++ b/reactos/ntoskrnl/io/driver.c @@ -1,4 +1,4 @@ -/* $Id: driver.c,v 1.11 2002/09/07 15:12:52 chorns Exp $ +/* $Id: driver.c,v 1.12 2002/09/08 10:23:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,7 +11,16 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #define NDEBUG #include @@ -50,7 +59,7 @@ typedef struct _SERVICE static LIST_ENTRY GroupListHead = {NULL, NULL}; static LIST_ENTRY ServiceListHead = {NULL, NULL}; -POBJECT_TYPE IoDriverObjectType = NULL; +POBJECT_TYPE EXPORTED IoDriverObjectType = NULL; #define TAG_DRIVER TAG('D', 'R', 'V', 'R') #define TAG_DRIVER_EXTENSION TAG('D', 'R', 'V', 'E') diff --git a/reactos/ntoskrnl/io/errlog.c b/reactos/ntoskrnl/io/errlog.c index 4060d7d8a41..eb60e40ec56 100644 --- a/reactos/ntoskrnl/io/errlog.c +++ b/reactos/ntoskrnl/io/errlog.c @@ -1,4 +1,4 @@ -/* $Id: errlog.c,v 1.7 2002/09/07 15:12:52 chorns Exp $ +/* $Id: errlog.c,v 1.8 2002/09/08 10:23:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,18 +11,35 @@ /* INCLUDES *****************************************************************/ -#include +#include + +#include -#define NDEBUG #include - /* TYPES *********************************************************************/ #define LOG_FILE_APPLICATION L"\\SystemRoot\\System32\\Config\\AppEvent.Evt" #define LOG_FILE_SECURITY L"\\SystemRoot\\System32\\Config\\SecEvent.Evt" #define LOG_FILE_SYSTEM L"\\SystemRoot\\System32\\Config\\SysEvent.Evt" +typedef struct _IO_ERROR_LOG_PACKET +{ + UCHAR MajorFunctionCode; + UCHAR RetryCount; + USHORT DumpDataSize; + USHORT NumberOfStrings; + USHORT StringOffset; + USHORT EventCategory; + NTSTATUS ErrorCode; + ULONG UniqueErrorValue; + NTSTATUS FinalStatus; + ULONG SequenceNumber; + ULONG IoControlCode; + LARGE_INTEGER DeviceOffset; + ULONG DumpData[1]; +} IO_ERROR_LOG_PACKET, *PIO_ERROR_LOG_PACKET; + /* FUNCTIONS *****************************************************************/ NTSTATUS IoInitErrorLog(VOID) diff --git a/reactos/ntoskrnl/io/error.c b/reactos/ntoskrnl/io/error.c index a3307a6f645..2ddcfad3b1c 100644 --- a/reactos/ntoskrnl/io/error.c +++ b/reactos/ntoskrnl/io/error.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: error.c,v 1.7 2002/09/07 15:12:52 chorns Exp $ +/* $Id: error.c,v 1.8 2002/09/08 10:23:24 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/io/error.c @@ -28,12 +28,11 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/io/event.c b/reactos/ntoskrnl/io/event.c index 16c3228f076..b04bbafce1b 100644 --- a/reactos/ntoskrnl/io/event.c +++ b/reactos/ntoskrnl/io/event.c @@ -1,4 +1,4 @@ -/* $Id: event.c,v 1.5 2002/09/07 15:12:52 chorns Exp $ +/* $Id: event.c,v 1.6 2002/09/08 10:23:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,11 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ PKEVENT STDCALL diff --git a/reactos/ntoskrnl/io/file.c b/reactos/ntoskrnl/io/file.c index 1242d5f4f3d..dc50e9f71ec 100644 --- a/reactos/ntoskrnl/io/file.c +++ b/reactos/ntoskrnl/io/file.c @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.20 2002/09/07 15:12:52 chorns Exp $ +/* $Id: file.c,v 1.21 2002/09/08 10:23:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,7 +11,9 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/io/flush.c b/reactos/ntoskrnl/io/flush.c index 1186ba9c622..078f5ea767e 100644 --- a/reactos/ntoskrnl/io/flush.c +++ b/reactos/ntoskrnl/io/flush.c @@ -10,12 +10,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/io/fs.c b/reactos/ntoskrnl/io/fs.c index 87f80184d78..cc07f69a3e9 100644 --- a/reactos/ntoskrnl/io/fs.c +++ b/reactos/ntoskrnl/io/fs.c @@ -1,4 +1,4 @@ -/* $Id: fs.c,v 1.28 2002/09/07 15:12:52 chorns Exp $ +/* $Id: fs.c,v 1.29 2002/09/08 10:23:25 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,9 +11,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include -//#define NDEBUG +#define NDEBUG #include @@ -29,7 +32,7 @@ typedef struct _FS_CHANGE_NOTIFY_ENTRY { LIST_ENTRY FsChangeNotifyList; PDRIVER_OBJECT DriverObject; - PDRIVER_FS_NOTIFICATION FSDNotificationProc; + PFSDNOTIFICATIONPROC FSDNotificationProc; } FS_CHANGE_NOTIFY_ENTRY, *PFS_CHANGE_NOTIFY_ENTRY; @@ -70,7 +73,7 @@ NtFsControlFile ( PFILE_OBJECT FileObject; PDEVICE_OBJECT DeviceObject; PIRP Irp; - PEXTENDED_IO_STACK_LOCATION StackPtr; + PIO_STACK_LOCATION StackPtr; PKEVENT ptrEvent; IO_STATUS_BLOCK IoSB; @@ -130,7 +133,7 @@ NtFsControlFile ( Irp->Overlay.AsynchronousParameters.UserApcRoutine = ApcRoutine; Irp->Overlay.AsynchronousParameters.UserApcContext = ApcContext; - StackPtr = (PEXTENDED_IO_STACK_LOCATION)IoGetNextIrpStackLocation(Irp); + StackPtr = IoGetNextIrpStackLocation(Irp); StackPtr->FileObject = FileObject; StackPtr->DeviceObject = DeviceObject; StackPtr->Parameters.FileSystemControl.InputBufferLength = InputBufferSize; @@ -679,7 +682,7 @@ IopNotifyFileSystemChange(PDEVICE_OBJECT DeviceObject, NTSTATUS STDCALL IoRegisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject, - IN PDRIVER_FS_NOTIFICATION FSDNotificationProc) + IN PFSDNOTIFICATIONPROC FSDNotificationProc) { PFS_CHANGE_NOTIFY_ENTRY Entry; @@ -700,9 +703,9 @@ IoRegisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject, } -NTSTATUS STDCALL +VOID STDCALL IoUnregisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject, - IN PDRIVER_FS_NOTIFICATION FSDNotificationProc) + IN PFSDNOTIFICATIONPROC FSDNotificationProc) { PFS_CHANGE_NOTIFY_ENTRY ChangeEntry; PLIST_ENTRY Entry; @@ -720,12 +723,11 @@ IoUnregisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject, KeReleaseSpinLock(&FsChangeNotifyListLock,oldlvl); ExFreePool(Entry); - return(STATUS_SUCCESS); + return; } Entry = Entry->Flink; } - return(STATUS_SUCCESS); } /* EOF */ diff --git a/reactos/ntoskrnl/io/iocomp.c b/reactos/ntoskrnl/io/iocomp.c index 00f67add067..21b672dbad7 100644 --- a/reactos/ntoskrnl/io/iocomp.c +++ b/reactos/ntoskrnl/io/iocomp.c @@ -11,12 +11,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS diff --git a/reactos/ntoskrnl/io/ioctrl.c b/reactos/ntoskrnl/io/ioctrl.c index c654bd23aee..8b65a153290 100644 --- a/reactos/ntoskrnl/io/ioctrl.c +++ b/reactos/ntoskrnl/io/ioctrl.c @@ -1,4 +1,4 @@ -/* $Id: ioctrl.c,v 1.15 2002/09/07 15:12:53 chorns Exp $ +/* $Id: ioctrl.c,v 1.16 2002/09/08 10:23:25 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -15,12 +15,11 @@ /* INCLUDES *****************************************************************/ -#include - +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS STDCALL NtDeviceIoControlFile (IN HANDLE DeviceHandle, diff --git a/reactos/ntoskrnl/io/iomgr.c b/reactos/ntoskrnl/io/iomgr.c index abc6309cd10..e6a1fb111ad 100644 --- a/reactos/ntoskrnl/io/iomgr.c +++ b/reactos/ntoskrnl/io/iomgr.c @@ -1,4 +1,4 @@ -/* $Id: iomgr.c,v 1.26 2002/09/07 17:08:31 chorns Exp $ +/* $Id: iomgr.c,v 1.27 2002/09/08 10:23:25 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,7 +11,11 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include @@ -24,13 +28,13 @@ /* DATA ********************************************************************/ -POBJECT_TYPE IoDeviceObjectType = NULL; -POBJECT_TYPE IoFileObjectType = NULL; -ULONG IoReadOperationCount = 0; /* FIXME: unknown type */ -ULONG IoReadTransferCount = 0; /* FIXME: unknown type */ -ULONG IoWriteOperationCount = 0; /* FIXME: unknown type */ -ULONG IoWriteTransferCount = 0; /* FIXME: unknown type */ -ULONG IoStatisticsLock = 0; /* FIXME: unknown type */ +POBJECT_TYPE EXPORTED IoDeviceObjectType = NULL; +POBJECT_TYPE EXPORTED IoFileObjectType = NULL; +ULONG EXPORTED IoReadOperationCount = 0; /* FIXME: unknown type */ +ULONG EXPORTED IoReadTransferCount = 0; /* FIXME: unknown type */ +ULONG EXPORTED IoWriteOperationCount = 0; /* FIXME: unknown type */ +ULONG EXPORTED IoWriteTransferCount = 0; /* FIXME: unknown type */ +ULONG EXPORTED IoStatisticsLock = 0; /* FIXME: unknown type */ static GENERIC_MAPPING IopFileMapping = {FILE_GENERIC_READ, FILE_GENERIC_WRITE, @@ -201,8 +205,6 @@ VOID IoInit (VOID) /* * Create the '\Device' directory */ - RtlInitUnicodeString(&DirName, - L"\\Device"); RtlInitUnicodeStringFromLiteral(&DirName, L"\\Device"); InitializeObjectAttributes(&ObjectAttributes, @@ -210,8 +212,7 @@ VOID IoInit (VOID) 0, NULL, NULL); - - NtCreateDirectoryObject(&Handle, + ZwCreateDirectoryObject(&Handle, 0, &ObjectAttributes); @@ -225,7 +226,7 @@ VOID IoInit (VOID) 0, NULL, NULL); - NtCreateDirectoryObject(&Handle, + ZwCreateDirectoryObject(&Handle, 0, &ObjectAttributes); @@ -239,7 +240,7 @@ VOID IoInit (VOID) 0, NULL, NULL); - NtCreateDirectoryObject(&Handle, + ZwCreateDirectoryObject(&Handle, 0, &ObjectAttributes); diff --git a/reactos/ntoskrnl/io/irp.c b/reactos/ntoskrnl/io/irp.c index 95f3dd7d8a8..a67ffd1576c 100644 --- a/reactos/ntoskrnl/io/irp.c +++ b/reactos/ntoskrnl/io/irp.c @@ -1,4 +1,4 @@ -/* $Id: irp.c,v 1.42 2002/09/07 15:12:53 chorns Exp $ +/* $Id: irp.c,v 1.43 2002/09/08 10:23:25 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -30,12 +30,14 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define TAG_IRP TAG('I', 'R', 'P', ' ') @@ -91,7 +93,7 @@ IoInitializeIrp(PIRP Irp, Irp->Size = PacketSize; Irp->StackCount = StackSize; Irp->CurrentLocation = StackSize; - Irp->Tail.Overlay.CurrentStackLocation = IoGetSpecificIrpStackLocation(Irp, StackSize); + Irp->Tail.Overlay.CurrentStackLocation = &Irp->Stack[(ULONG)StackSize]; } @@ -125,13 +127,12 @@ IofCallDriver(PDEVICE_OBJECT DeviceObject, DPRINT("MajorFunction %d\n", Param->MajorFunction); DPRINT("DriverObject->MajorFunction[Param->MajorFunction] %x\n", DriverObject->MajorFunction[Param->MajorFunction]); - Status = ((PDRIVER_DISPATCH)DriverObject->MajorFunction[Param->MajorFunction])(DeviceObject, + Status = DriverObject->MajorFunction[Param->MajorFunction](DeviceObject, Irp); return(Status); } -#undef IoCallDriver NTSTATUS STDCALL @@ -227,18 +228,18 @@ IofCompleteRequest(PIRP Irp, for (i=Irp->CurrentLocation;iStackCount;i++) { - PIO_STACK_LOCATION IrpSp = IoGetSpecificIrpStackLocation(Irp, i); - if (IrpSp->CompletionRoutine != NULL) + if (Irp->Stack[i].CompletionRoutine != NULL) { - Status = IrpSp->CompletionRoutine(IrpSp->DeviceObject, - Irp, - IrpSp->Context); + Status = Irp->Stack[i].CompletionRoutine( + Irp->Stack[i].DeviceObject, + Irp, + Irp->Stack[i].CompletionContext); if (Status == STATUS_MORE_PROCESSING_REQUIRED) { return; } } - if (IrpSp->Control & SL_PENDING_RETURNED) + if (Irp->Stack[i].Control & SL_PENDING_RETURNED) { Irp->PendingReturned = TRUE; } @@ -273,7 +274,6 @@ IofCompleteRequest(PIRP Irp, } } -#undef IoCompleteRequest VOID STDCALL IoCompleteRequest(PIRP Irp, diff --git a/reactos/ntoskrnl/io/lock.c b/reactos/ntoskrnl/io/lock.c index 928fbd1074f..f27ca8dd691 100644 --- a/reactos/ntoskrnl/io/lock.c +++ b/reactos/ntoskrnl/io/lock.c @@ -10,12 +10,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS diff --git a/reactos/ntoskrnl/io/mailslot.c b/reactos/ntoskrnl/io/mailslot.c index 5ab8ae8c2f7..93d9c7e1147 100644 --- a/reactos/ntoskrnl/io/mailslot.c +++ b/reactos/ntoskrnl/io/mailslot.c @@ -11,12 +11,11 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS STDCALL diff --git a/reactos/ntoskrnl/io/mdl.c b/reactos/ntoskrnl/io/mdl.c index fe3b1f0c223..43b8f746d7d 100644 --- a/reactos/ntoskrnl/io/mdl.c +++ b/reactos/ntoskrnl/io/mdl.c @@ -1,4 +1,4 @@ -/* $Id: mdl.c,v 1.9 2002/09/07 15:12:53 chorns Exp $ +/* $Id: mdl.c,v 1.10 2002/09/08 10:23:25 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,11 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include - /* GLOBALS *******************************************************************/ #define TAG_MDL TAG('M', 'D', 'L', ' ') @@ -48,8 +47,6 @@ IoAllocateMdl(PVOID VirtualAddress, TAG_MDL); } MmInitializeMdl(Mdl,VirtualAddress,Length); - Mdl->Process = PsGetCurrentProcess(); - if (Irp!=NULL && !SecondaryBuffer) { Irp->MdlAddress = Mdl; @@ -68,9 +65,9 @@ IoBuildPartialMdl(PMDL SourceMdl, PULONG SourcePages = (PULONG)(SourceMdl + 1); ULONG Va; ULONG Delta = (PAGE_ROUND_DOWN(VirtualAddress) - (ULONG)SourceMdl->StartVa)/ - PAGE_SIZE; + PAGESIZE; - for (Va = 0; Va < (PAGE_ROUND_UP(Length)/PAGE_SIZE); Va++) + for (Va = 0; Va < (PAGE_ROUND_UP(Length)/PAGESIZE); Va++) { TargetPages[Va] = SourcePages[Va+Delta]; } diff --git a/reactos/ntoskrnl/io/npipe.c b/reactos/ntoskrnl/io/npipe.c index 2287e5091a2..e45596aa07f 100644 --- a/reactos/ntoskrnl/io/npipe.c +++ b/reactos/ntoskrnl/io/npipe.c @@ -10,12 +10,11 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS STDCALL diff --git a/reactos/ntoskrnl/io/page.c b/reactos/ntoskrnl/io/page.c index 65d26cc8272..d07211661c6 100644 --- a/reactos/ntoskrnl/io/page.c +++ b/reactos/ntoskrnl/io/page.c @@ -1,4 +1,4 @@ -/* $Id: page.c,v 1.18 2002/09/07 15:12:53 chorns Exp $ +/* $Id: page.c,v 1.19 2002/09/08 10:23:25 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS STDCALL diff --git a/reactos/ntoskrnl/io/parttab.c b/reactos/ntoskrnl/io/parttab.c index 02894b89017..870ec509a85 100644 --- a/reactos/ntoskrnl/io/parttab.c +++ b/reactos/ntoskrnl/io/parttab.c @@ -1,4 +1,4 @@ -/* $Id: parttab.c,v 1.2 2002/09/07 15:12:53 chorns Exp $ +/* $Id: parttab.c,v 1.3 2002/09/08 10:23:25 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,21 +13,19 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS STDCALL IoReadPartitionTable(PDEVICE_OBJECT DeviceObject, ULONG SectorSize, BOOLEAN ReturnRecognizedPartitions, - struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer) + PDRIVE_LAYOUT_INFORMATION *PartitionBuffer) { - return HalDispatchTable->HalIoReadPartitionTable(DeviceObject, + return HalDispatchTable.HalIoReadPartitionTable(DeviceObject, SectorSize, ReturnRecognizedPartitions, PartitionBuffer); @@ -40,7 +38,7 @@ IoSetPartitionInformation(PDEVICE_OBJECT DeviceObject, ULONG PartitionNumber, ULONG PartitionType) { - return HalDispatchTable->HalIoSetPartitionInformation(DeviceObject, + return HalDispatchTable.HalIoSetPartitionInformation(DeviceObject, SectorSize, PartitionNumber, PartitionType); @@ -52,9 +50,9 @@ IoWritePartitionTable(PDEVICE_OBJECT DeviceObject, ULONG SectorSize, ULONG SectorsPerTrack, ULONG NumberOfHeads, - struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer) + PDRIVE_LAYOUT_INFORMATION PartitionBuffer) { - return HalDispatchTable->HalIoWritePartitionTable(DeviceObject, + return HalDispatchTable.HalIoWritePartitionTable(DeviceObject, SectorSize, SectorsPerTrack, NumberOfHeads, diff --git a/reactos/ntoskrnl/io/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr.c index 986f5cb492f..68008610378 100644 --- a/reactos/ntoskrnl/io/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr.c @@ -1,4 +1,4 @@ -/* $Id: pnpmgr.c,v 1.7 2002/09/07 15:12:53 chorns Exp $ +/* $Id: pnpmgr.c,v 1.8 2002/09/08 10:23:25 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,16 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ PDEVICE_NODE IopRootDeviceNode; @@ -69,8 +73,6 @@ IoReleaseRemoveLockAndWaitEx( { } -#undef IoAdjustPagingPathCount - VOID STDCALL IoAdjustPagingPathCount( @@ -1187,7 +1189,7 @@ VOID PnpInit(VOID) PnpRootDriverEntry(IopRootDriverObject, NULL); - ((PDRIVER_ADD_DEVICE)IopRootDriverObject->DriverExtension->AddDevice)( + IopRootDriverObject->DriverExtension->AddDevice( IopRootDriverObject, IopRootDeviceNode->Pdo); } diff --git a/reactos/ntoskrnl/io/pnproot.c b/reactos/ntoskrnl/io/pnproot.c index dd2cd162382..0c2dd3ce1cb 100644 --- a/reactos/ntoskrnl/io/pnproot.c +++ b/reactos/ntoskrnl/io/pnproot.c @@ -1,4 +1,4 @@ -/* $Id: pnproot.c,v 1.9 2002/09/07 15:12:53 chorns Exp $ +/* $Id: pnproot.c,v 1.10 2002/09/08 10:23:25 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,13 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define ENUM_NAME_ROOT L"Root" diff --git a/reactos/ntoskrnl/io/process.c b/reactos/ntoskrnl/io/process.c index 8a16c6dd02f..07af0655538 100644 --- a/reactos/ntoskrnl/io/process.c +++ b/reactos/ntoskrnl/io/process.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: process.c,v 1.13 2002/09/07 15:12:53 chorns Exp $ +/* $Id: process.c,v 1.14 2002/09/08 10:23:25 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -29,12 +29,11 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ PVOID STDCALL @@ -80,7 +79,7 @@ IoGetRequestorProcess(IN PIRP Irp) * Previous value for the current thread's hard errors * processing policy. */ -BOOLEAN STDCALL +BOOLEAN STDCALL EXPORTED IoSetThreadHardErrorMode(IN BOOLEAN HardErrorEnabled) { BOOLEAN PreviousHEM = NtCurrentTeb()->HardErrorDisabled; diff --git a/reactos/ntoskrnl/io/queue.c b/reactos/ntoskrnl/io/queue.c index 89dd569df1b..30d495336e3 100644 --- a/reactos/ntoskrnl/io/queue.c +++ b/reactos/ntoskrnl/io/queue.c @@ -1,4 +1,4 @@ -/* $Id: queue.c,v 1.11 2002/09/07 15:12:53 chorns Exp $ +/* $Id: queue.c,v 1.12 2002/09/08 10:23:25 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,12 +9,11 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID @@ -45,7 +44,7 @@ IoStartNextPacketByKey(PDEVICE_OBJECT DeviceObject, Tail.Overlay.DeviceQueueEntry); DeviceObject->CurrentIrp = Irp; DPRINT("Next irp is %x\n", Irp); - ((PDRIVER_STARTIO)DeviceObject->DriverObject->DriverStartIo)(DeviceObject, Irp); + DeviceObject->DriverObject->DriverStartIo(DeviceObject, Irp); } else { @@ -77,7 +76,7 @@ IoStartNextPacket(PDEVICE_OBJECT DeviceObject, BOOLEAN Cancelable) { Irp = CONTAINING_RECORD(entry,IRP,Tail.Overlay.DeviceQueueEntry); DeviceObject->CurrentIrp = Irp; - ((PDRIVER_STARTIO)DeviceObject->DriverObject->DriverStartIo)(DeviceObject,Irp); + DeviceObject->DriverObject->DriverStartIo(DeviceObject,Irp); } else { @@ -131,7 +130,7 @@ IoStartPacket(PDEVICE_OBJECT DeviceObject, if (!stat) { DeviceObject->CurrentIrp = Irp; - ((PDRIVER_STARTIO)DeviceObject->DriverObject->DriverStartIo)(DeviceObject,Irp); + DeviceObject->DriverObject->DriverStartIo(DeviceObject,Irp); } } diff --git a/reactos/ntoskrnl/io/resource.c b/reactos/ntoskrnl/io/resource.c index ced87e6c57d..bf7ce079ff0 100644 --- a/reactos/ntoskrnl/io/resource.c +++ b/reactos/ntoskrnl/io/resource.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: resource.c,v 1.10 2002/09/07 15:12:53 chorns Exp $ +/* $Id: resource.c,v 1.11 2002/09/08 10:23:26 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/io/resource.c @@ -28,23 +28,22 @@ /* INCLUDES *****************************************************************/ -#include +#include + -#define NDEBUG #include - /* GLOBALS *******************************************************************/ static CONFIGURATION_INFORMATION -IopSystemConfigurationInformation = {0, 0, 0, 0, 0, 0, 0, FALSE, FALSE}; +SystemConfigurationInformation = {0, 0, 0, 0, 0, 0, 0, FALSE, FALSE}; /* FUNCTIONS *****************************************************************/ PCONFIGURATION_INFORMATION STDCALL IoGetConfigurationInformation(VOID) { - return(&IopSystemConfigurationInformation); + return(&SystemConfigurationInformation); } NTSTATUS STDCALL diff --git a/reactos/ntoskrnl/io/rw.c b/reactos/ntoskrnl/io/rw.c index 38b0938bb6c..5eb014e4498 100644 --- a/reactos/ntoskrnl/io/rw.c +++ b/reactos/ntoskrnl/io/rw.c @@ -1,4 +1,4 @@ -/* $Id: rw.c,v 1.39 2002/09/07 15:12:53 chorns Exp $ +/* $Id: rw.c,v 1.40 2002/09/08 10:23:26 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,7 +11,9 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/io/share.c b/reactos/ntoskrnl/io/share.c index 33a6285e87c..3f348360525 100644 --- a/reactos/ntoskrnl/io/share.c +++ b/reactos/ntoskrnl/io/share.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: share.c,v 1.7 2002/09/07 15:12:53 chorns Exp $ +/* $Id: share.c,v 1.8 2002/09/08 10:23:26 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -29,12 +29,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID STDCALL diff --git a/reactos/ntoskrnl/io/shutdown.c b/reactos/ntoskrnl/io/shutdown.c index 8210459627f..3e44fca74e6 100644 --- a/reactos/ntoskrnl/io/shutdown.c +++ b/reactos/ntoskrnl/io/shutdown.c @@ -1,4 +1,4 @@ -/* $Id: shutdown.c,v 1.6 2002/09/07 15:12:53 chorns Exp $ +/* $Id: shutdown.c,v 1.7 2002/09/08 10:23:26 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - /* LOCAL DATA ***************************************************************/ typedef struct _SHUTDOWN_ENTRY diff --git a/reactos/ntoskrnl/io/symlink.c b/reactos/ntoskrnl/io/symlink.c index 88423e5778f..9b45e14080b 100644 --- a/reactos/ntoskrnl/io/symlink.c +++ b/reactos/ntoskrnl/io/symlink.c @@ -1,4 +1,4 @@ -/* $Id: symlink.c,v 1.30 2002/09/07 15:12:53 chorns Exp $ +/* $Id: symlink.c,v 1.31 2002/09/08 10:23:26 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS ******************************************************************/ typedef struct @@ -303,7 +304,7 @@ IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, NULL, NULL ); - Status = ObRosCreateObject( + Status = ObCreateObject( NULL, SYMBOLIC_LINK_ALL_ACCESS, & ObjectAttributes, @@ -416,7 +417,7 @@ NtCreateSymbolicLinkObject(OUT PHANDLE SymbolicLinkHandle, ObjectAttributes, DeviceName->Buffer); - Status = ObRosCreateObject(SymbolicLinkHandle, + Status = ObCreateObject(SymbolicLinkHandle, DesiredAccess, ObjectAttributes, IoSymbolicLinkType, diff --git a/reactos/ntoskrnl/io/timer.c b/reactos/ntoskrnl/io/timer.c index 1b2ee83d2c2..7ad5053474c 100644 --- a/reactos/ntoskrnl/io/timer.c +++ b/reactos/ntoskrnl/io/timer.c @@ -1,4 +1,4 @@ -/* $Id: timer.c,v 1.7 2002/09/07 15:12:53 chorns Exp $ +/* $Id: timer.c,v 1.8 2002/09/08 10:23:26 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - /* GLBOALS *******************************************************************/ #define TAG_IO_TIMER TAG('I', 'O', 'T', 'M') diff --git a/reactos/ntoskrnl/io/vpb.c b/reactos/ntoskrnl/io/vpb.c index 5fb9fb8eb33..d5390277662 100644 --- a/reactos/ntoskrnl/io/vpb.c +++ b/reactos/ntoskrnl/io/vpb.c @@ -1,4 +1,4 @@ -/* $Id: vpb.c,v 1.18 2002/09/07 15:12:53 chorns Exp $ +/* $Id: vpb.c,v 1.19 2002/09/08 10:23:26 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,15 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include + #define NDEBUG #include - /* GLOBALS *******************************************************************/ static KSPIN_LOCK IoVpbLock; @@ -53,7 +56,8 @@ IoAttachVpb(PDEVICE_OBJECT DeviceObject) Vpb->RealDevice = DeviceObject; Vpb->SerialNumber = 0; Vpb->ReferenceCount = 0; - RtlZeroMemory(Vpb->VolumeLabel, MAXIMUM_VOLUME_LABEL_LENGTH); + RtlZeroMemory(Vpb->VolumeLabel, + sizeof(WCHAR) * MAXIMUM_VOLUME_LABEL_LENGTH); DeviceObject->Vpb = Vpb; @@ -268,7 +272,7 @@ NtSetVolumeInformationFile(IN HANDLE FileHandle, PDEVICE_OBJECT DeviceObject; PIRP Irp; NTSTATUS Status; - PEXTENDED_IO_STACK_LOCATION StackPtr; + PIO_STACK_LOCATION StackPtr; PVOID SystemBuffer; IO_STATUS_BLOCK IoSB; @@ -312,7 +316,7 @@ NtSetVolumeInformationFile(IN HANDLE FileHandle, Irp->UserIosb = &IoSB; Irp->Tail.Overlay.Thread = PsGetCurrentThread(); - StackPtr = (PEXTENDED_IO_STACK_LOCATION)IoGetNextIrpStackLocation(Irp); + StackPtr = IoGetNextIrpStackLocation(Irp); StackPtr->MajorFunction = IRP_MJ_SET_VOLUME_INFORMATION; StackPtr->MinorFunction = 0; StackPtr->Flags = 0; diff --git a/reactos/ntoskrnl/io/xhaldisp.c b/reactos/ntoskrnl/io/xhaldisp.c index ebb6c70ea80..da656ccdbe7 100644 --- a/reactos/ntoskrnl/io/xhaldisp.c +++ b/reactos/ntoskrnl/io/xhaldisp.c @@ -1,4 +1,4 @@ -/* $Id: xhaldisp.c,v 1.6 2002/09/07 15:12:53 chorns Exp $ +/* $Id: xhaldisp.c,v 1.7 2002/09/08 10:23:26 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,15 +11,13 @@ /* INCLUDES *****************************************************************/ -#include - -#define NDEBUG -#include - +#include +#include /* DATA **********************************************************************/ -HAL_DISPATCH_TABLE IopHalDispatchTable = + +HAL_DISPATCH EXPORTED HalDispatchTable = { HAL_DISPATCH_VERSION, (pHalQuerySystemInformation) NULL, // HalQuerySystemInformation @@ -36,10 +34,8 @@ HAL_DISPATCH_TABLE IopHalDispatchTable = (pHalReferenceBusHandler) NULL // HalDereferenceBusHandler }; -PHAL_DISPATCH_TABLE HalDispatchTable = &IopHalDispatchTable; - -HAL_PRIVATE_DISPATCH_TABLE IopHalPrivateDispatchTable = +HAL_PRIVATE_DISPATCH EXPORTED HalPrivateDispatchTable = { HAL_PRIVATE_DISPATCH_VERSION // HalHandlerForBus @@ -49,7 +45,5 @@ HAL_PRIVATE_DISPATCH_TABLE IopHalPrivateDispatchTable = // any more?? }; -PHAL_PRIVATE_DISPATCH_TABLE HalPrivateDispatchTable = &IopHalPrivateDispatchTable; - /* EOF */ diff --git a/reactos/ntoskrnl/io/xhaldrv.c b/reactos/ntoskrnl/io/xhaldrv.c index 9dd4ae22e82..793ddf80392 100644 --- a/reactos/ntoskrnl/io/xhaldrv.c +++ b/reactos/ntoskrnl/io/xhaldrv.c @@ -1,4 +1,4 @@ -/* $Id: xhaldrv.c,v 1.24 2002/09/07 15:12:53 chorns Exp $ +/* $Id: xhaldrv.c,v 1.25 2002/09/08 10:23:26 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - /* LOCAL MACROS and TYPES ***************************************************/ #define AUTO_DRIVE ((ULONG)-1) @@ -558,7 +558,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, /* Assign cdrom drives */ DPRINT("CD-Rom drives: %d\n", ConfigInfo->CDRomCount); - for (i = 0; i < ConfigInfo->CdRomCount; i++) + for (i = 0; i < ConfigInfo->CDRomCount; i++) { swprintf(Buffer1, L"\\Device\\CdRom%d", diff --git a/reactos/ntoskrnl/kd/dlog.c b/reactos/ntoskrnl/kd/dlog.c index 8e893eb8d3e..198ef68b932 100644 --- a/reactos/ntoskrnl/kd/dlog.c +++ b/reactos/ntoskrnl/kd/dlog.c @@ -1,4 +1,4 @@ -/* $Id: dlog.c,v 1.6 2002/09/07 15:12:53 chorns Exp $ +/* $Id: dlog.c,v 1.7 2002/09/08 10:23:27 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,11 @@ /* INCLUDES ******************************************************************/ -#include - -#define NDEBUG -#include - +#include +#include +#include +#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/kd/gdbstub.c b/reactos/ntoskrnl/kd/gdbstub.c index 619219ec356..2d1ec764094 100644 --- a/reactos/ntoskrnl/kd/gdbstub.c +++ b/reactos/ntoskrnl/kd/gdbstub.c @@ -83,12 +83,16 @@ * ****************************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - extern LIST_ENTRY PiThreadListHead; diff --git a/reactos/ntoskrnl/kd/kdebug.c b/reactos/ntoskrnl/kd/kdebug.c index 21bed18d24c..86666844bc5 100644 --- a/reactos/ntoskrnl/kd/kdebug.c +++ b/reactos/ntoskrnl/kd/kdebug.c @@ -1,4 +1,4 @@ -/* $Id: kdebug.c,v 1.39 2002/09/07 15:12:53 chorns Exp $ +/* $Id: kdebug.c,v 1.40 2002/09/08 10:23:27 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,13 +9,13 @@ * 21/10/99: Created */ -#include +#include +#include +#include +#include +#include #include "../dbg/kdb.h" -#define NDEBUG -#include - - /* serial debug connection */ #define DEFAULT_DEBUG_PORT 2 /* COM2 */ #define DEFAULT_DEBUG_COM1_IRQ 4 /* COM1 IRQ */ @@ -28,18 +28,12 @@ /* VARIABLES ***************************************************************/ BOOLEAN -KdpDebuggerEnabled = FALSE; - -PBOOLEAN __declspec(dllexport) -KdDebuggerEnabled = &KdpDebuggerEnabled; +KdDebuggerEnabled = FALSE; /* EXPORTED */ BOOLEAN -KdpDebuggerNotPresent = TRUE; - -PBOOLEAN __declspec(dllexport) -KdDebuggerNotPresent = &KdpDebuggerNotPresent; +KdDebuggerNotPresent = TRUE; /* EXPORTED */ static BOOLEAN KdpBreakPending = FALSE; @@ -80,7 +74,7 @@ KdInitSystem(ULONG Reserved, #ifdef KDBG /* Initialize the local kernel debugger. */ - KdpDebuggerEnabled = TRUE; + KdDebuggerEnabled = TRUE; KdDebugState |= KD_DEBUG_KDB; #endif @@ -109,19 +103,19 @@ KdInitSystem(ULONG Reserved, if (!_strnicmp(p2, "SCREEN", 6)) { p2 += 6; - KdpDebuggerEnabled = TRUE; + KdDebuggerEnabled = TRUE; KdDebugState |= KD_DEBUG_SCREEN; } else if (!_strnicmp(p2, "BOCHS", 5)) { p2 += 5; - KdpDebuggerEnabled = TRUE; + KdDebuggerEnabled = TRUE; KdDebugState |= KD_DEBUG_BOCHS; } else if (!_strnicmp(p2, "GDB", 3)) { p2 += 3; - KdpDebuggerEnabled = TRUE; + KdDebuggerEnabled = TRUE; KdDebugState |= KD_DEBUG_GDB; /* Reset port information to defaults */ @@ -132,7 +126,7 @@ KdInitSystem(ULONG Reserved, else if (!_strnicmp(p2, "PICE", 4)) { p2 += 4; - KdpDebuggerEnabled = TRUE; + KdDebuggerEnabled = TRUE; KdDebugState |= KD_DEBUG_PICE; } else if (!_strnicmp(p2, "COM", 3)) @@ -141,7 +135,7 @@ KdInitSystem(ULONG Reserved, Value = (ULONG)atol(p2); if (Value > 0 && Value < 5) { - KdpDebuggerEnabled = TRUE; + KdDebuggerEnabled = TRUE; KdDebugState |= KD_DEBUG_SERIAL; LogPortInfo.ComPort = Value; } @@ -149,13 +143,13 @@ KdInitSystem(ULONG Reserved, else if (!_strnicmp(p2, "FILE", 4)) { p2 += 4; - KdpDebuggerEnabled = TRUE; + KdDebuggerEnabled = TRUE; KdDebugState |= KD_DEBUG_FILELOG; } else if (!_strnicmp(p2, "MDA", 3)) { p2 += 3; - KdpDebuggerEnabled = TRUE; + KdDebuggerEnabled = TRUE; KdDebugState |= KD_DEBUG_MDA; } } @@ -163,19 +157,19 @@ KdInitSystem(ULONG Reserved, else if (!_strnicmp(p2, "DEBUG", 5)) { p2 += 5; - KdpDebuggerEnabled = TRUE; + KdDebuggerEnabled = TRUE; KdDebugState |= KD_DEBUG_SERIAL; } else if (!_strnicmp(p2, "NODEBUG", 7)) { p2 += 7; - KdpDebuggerEnabled = FALSE; + KdDebuggerEnabled = FALSE; KdDebugState = KD_DEBUG_DISABLED; } else if (!_strnicmp(p2, "CRASHDEBUG", 10)) { p2 += 10; - KdpDebuggerEnabled = FALSE; + KdDebuggerEnabled = FALSE; KdDebugState = KD_DEBUG_DISABLED; } else if (!_strnicmp(p2, "BREAK", 5)) @@ -226,7 +220,7 @@ KdInitSystem(ULONG Reserved, } /* Print some information */ - if (KdpDebuggerEnabled == TRUE) + if (KdDebuggerEnabled == TRUE) { if (KdDebugState & KD_DEBUG_GDB) PrintString("\n GDB debugging enabled. COM%ld %ld Baud\n\n", @@ -247,13 +241,12 @@ KdInitSystem(ULONG Reserved, if (KdDebugState & KD_DEBUG_FILELOG) PrintString("\n File log debugging enabled\n\n"); - if (KdDebugState & KD_DEBUG_MDA) PrintString("\n MDA debugging enabled\n\n"); } /* Perform any initialization nescessary */ - if (KdpDebuggerEnabled == TRUE) + if (KdDebuggerEnabled == TRUE) { if (KdDebugState & KD_DEBUG_GDB) KdPortInitializeEx(&GdbPortInfo, 0, 0); @@ -274,7 +267,7 @@ VOID KdInit1(VOID) { /* Initialize kernel debugger (phase 0) */ - if ((KdpDebuggerEnabled == TRUE) && + if ((KdDebuggerEnabled == TRUE) && (KdDebugState & KD_DEBUG_GDB)) { KdGdbStubInit(0); @@ -285,7 +278,7 @@ KdInit1(VOID) VOID KdInit2(VOID) { /* Initialize kernel debugger (phase 1) */ - if ((KdpDebuggerEnabled == TRUE) && + if ((KdDebuggerEnabled == TRUE) && (KdDebugState & KD_DEBUG_GDB)) { KdGdbStubInit(1); @@ -357,7 +350,7 @@ KdpPrintString(PANSI_STRING String) BOOLEAN STDCALL KdPollBreakIn(VOID) { - if ((!KdpDebuggerEnabled) || (!(KdDebugState & KD_DEBUG_SERIAL))) + if ((!KdDebuggerEnabled) || (!(KdDebugState & KD_DEBUG_SERIAL))) return FALSE; return KdpBreakPending; } diff --git a/reactos/ntoskrnl/kd/mda.c b/reactos/ntoskrnl/kd/mda.c index 65898256689..787359ea6ef 100644 --- a/reactos/ntoskrnl/kd/mda.c +++ b/reactos/ntoskrnl/kd/mda.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: mda.c,v 1.2 2002/09/07 15:12:54 chorns Exp $ +/* $Id: mda.c,v 1.3 2002/09/08 10:23:27 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/kd/mda.c @@ -26,7 +26,11 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include +#include #include "../dbg/kdb.h" /* VARIABLES ***************************************************************/ diff --git a/reactos/ntoskrnl/kd/service.c b/reactos/ntoskrnl/kd/service.c index ce64ed3074d..c2f9c3ed009 100644 --- a/reactos/ntoskrnl/kd/service.c +++ b/reactos/ntoskrnl/kd/service.c @@ -1,4 +1,4 @@ -/* $Id: service.c,v 1.4 2002/09/07 15:12:54 chorns Exp $ +/* $Id: service.c,v 1.5 2002/09/08 10:23:27 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,11 +9,9 @@ * 17/01/2000: Created */ -#include - -#define NDEBUG -#include - +#include +#include +#include /* FUNCTIONS ***************************************************************/ diff --git a/reactos/ntoskrnl/ke/apc.c b/reactos/ntoskrnl/ke/apc.c index 0f7b3618864..8a8a6336bc0 100644 --- a/reactos/ntoskrnl/ke/apc.c +++ b/reactos/ntoskrnl/ke/apc.c @@ -29,12 +29,16 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ KSPIN_LOCK PiApcLock; diff --git a/reactos/ntoskrnl/ke/bug.c b/reactos/ntoskrnl/ke/bug.c index d2180e47e67..c77e5898dff 100644 --- a/reactos/ntoskrnl/ke/bug.c +++ b/reactos/ntoskrnl/ke/bug.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: bug.c,v 1.26 2002/09/07 15:12:55 chorns Exp $ +/* $Id: bug.c,v 1.27 2002/09/08 10:23:28 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/bug.c @@ -30,12 +30,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include -#define NDEBUG #include - /* GLOBALS ******************************************************************/ static LIST_ENTRY BugcheckCallbackListHead = {NULL,NULL}; diff --git a/reactos/ntoskrnl/ke/catch.c b/reactos/ntoskrnl/ke/catch.c index b0a237ba555..29df611da27 100644 --- a/reactos/ntoskrnl/ke/catch.c +++ b/reactos/ntoskrnl/ke/catch.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: catch.c,v 1.23 2002/09/07 15:12:56 chorns Exp $ +/* $Id: catch.c,v 1.24 2002/09/08 10:23:28 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/catch.c @@ -26,12 +26,16 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS ****************************************************************/ EXCEPTION_DISPOSITION @@ -111,20 +115,20 @@ RtlpDispatchException( #if 0 if (Thread->KernelStack > RegistrationFrameEnd) { - ExceptionRecord->ExceptionFlags |= EH_STACK_INVALID; + ExceptionRecord->ExceptionFlags |= EXCEPTION_STACK_INVALID; return ExceptionDismiss; } // FIXME: Correct? if (Thread->StackLimit < RegistrationFrameEnd) { - ExceptionRecord->ExceptionFlags |= EH_STACK_INVALID; + ExceptionRecord->ExceptionFlags |= EXCEPTION_STACK_INVALID; return ExceptionDismiss; } // Make sure stack is DWORD aligned if ((ULONG_PTR)RegistrationFrame & 3) { - ExceptionRecord->ExceptionFlags |= EH_STACK_INVALID; + ExceptionRecord->ExceptionFlags |= EXCEPTION_STACK_INVALID; return ExceptionDismiss; } #endif @@ -140,7 +144,7 @@ RtlpDispatchException( if (RegistrationFrame == NULL) { - ExceptionRecord->ExceptionFlags &= ~EH_NESTED_CALL; // Turn off flag + ExceptionRecord->ExceptionFlags &= ~EXCEPTION_NESTED_CALL; // Turn off flag } if (ReturnValue == ExceptionContinueExecution) @@ -151,11 +155,11 @@ RtlpDispatchException( } else if (ReturnValue == ExceptionDismiss) { - if (ExceptionRecord->ExceptionFlags & EH_NONCONTINUABLE) + if (ExceptionRecord->ExceptionFlags & EXCEPTION_NONCONTINUABLE) { ExceptionRecord2.ExceptionRecord = ExceptionRecord; ExceptionRecord2.ExceptionCode = STATUS_NONCONTINUABLE_EXCEPTION; - ExceptionRecord2.ExceptionFlags = EH_NONCONTINUABLE; + ExceptionRecord2.ExceptionFlags = EXCEPTION_NONCONTINUABLE; ExceptionRecord2.NumberParameters = 0; RtlRaiseException(&ExceptionRecord2); } @@ -163,7 +167,7 @@ RtlpDispatchException( } else if (ReturnValue == ExceptionNestedException) { - ExceptionRecord->ExceptionFlags |= EH_EXIT_UNWIND; + ExceptionRecord->ExceptionFlags |= EXCEPTION_EXIT_UNWIND; if (DispatcherContext > Temp) Temp = DispatcherContext; } @@ -171,7 +175,7 @@ RtlpDispatchException( { ExceptionRecord2.ExceptionRecord = ExceptionRecord; ExceptionRecord2.ExceptionCode = STATUS_INVALID_DISPOSITION; - ExceptionRecord2.ExceptionFlags = EH_NONCONTINUABLE; + ExceptionRecord2.ExceptionFlags = EXCEPTION_NONCONTINUABLE; ExceptionRecord2.NumberParameters = 0; RtlRaiseException(&ExceptionRecord2); } @@ -273,7 +277,7 @@ KiDispatchException(PEXCEPTION_RECORD ExceptionRecord, Action = KdEnterDebuggerException (ExceptionRecord, Context, Tf); } #ifdef KDBG - else if (KdDebuggerEnabled && KdDebugState & KD_DEBUG_KDB) + else if (KdDebuggerEnable && KdDebugState & KD_DEBUG_KDB) { Action = KdbEnterDebuggerException (ExceptionRecord, Context, Tf); } @@ -393,7 +397,7 @@ RtlpExceptionHandler( // If unwind flag set, return DISPOSITION_CONTINUE_SEARCH, else // assign DispatcherContext context and return DISPOSITION_NESTED_EXCEPTION - if (ExceptionRecord->ExceptionFlags & EH_UNWINDING) + if (ExceptionRecord->ExceptionFlags & EXCEPTION_UNWINDING) { DPRINT("RtlpExceptionHandler(). Returning ExceptionContinueSearch\n"); return ExceptionContinueSearch; @@ -417,7 +421,7 @@ RtlpUnwindHandler( // If unwind flag set, return DISPOSITION_CONTINUE_SEARCH, else // assign DispatcherContext and return DISPOSITION_COLLIDED_UNWIND - if (ExceptionRecord->ExceptionFlags & EH_UNWINDING) + if (ExceptionRecord->ExceptionFlags & EXCEPTION_UNWINDING) { DPRINT("RtlpUnwindHandler(). Returning ExceptionContinueSearch\n"); return ExceptionContinueSearch; @@ -445,7 +449,7 @@ RtlpExecuteHandlerForException( Context, DispatcherContext, Handler, - (PEXCEPTION_HANDLER)RtlpExceptionHandler); + RtlpExceptionHandler); } @@ -463,7 +467,7 @@ RtlpExecuteHandlerForUnwind( Context, DispatcherContext, Handler, - (PEXCEPTION_HANDLER)RtlpUnwindHandler); + RtlpUnwindHandler); } @@ -502,9 +506,9 @@ RtlUnwind( } if (RegistrationFrame) - pExceptRec->ExceptionFlags |= EH_UNWINDING; + pExceptRec->ExceptionFlags |= EXCEPTION_UNWINDING; else - pExceptRec->ExceptionFlags |= (EH_UNWINDING|EH_EXIT_UNWIND); + pExceptRec->ExceptionFlags |= (EXCEPTION_UNWINDING|EXCEPTION_EXIT_UNWIND); Context.ContextFlags = (CONTEXT_i386 | CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS); @@ -514,7 +518,7 @@ RtlUnwind( Context.Esp += 0x10; Context.Eax = EaxValue; - // Begin traversing the list of EH_REGISTRATION + // Begin traversing the list of EXCEPTION_REGISTRATION while ((ULONG_PTR)ERHead != -1) { EXCEPTION_RECORD er2; @@ -539,7 +543,7 @@ RtlUnwind( er2.ExceptionRecord = pExceptRec; er2.NumberParameters = 0; er2.ExceptionCode = STATUS_INVALID_UNWIND_TARGET; - er2.ExceptionFlags = EH_NONCONTINUABLE; + er2.ExceptionFlags = EXCEPTION_NONCONTINUABLE; RtlRaiseException(&er2); } @@ -578,7 +582,7 @@ RtlUnwind( er2.ExceptionRecord = pExceptRec; er2.NumberParameters = 0; er2.ExceptionCode = STATUS_INVALID_DISPOSITION; - er2.ExceptionFlags = EH_NONCONTINUABLE; + er2.ExceptionFlags = EXCEPTION_NONCONTINUABLE; RtlRaiseException(&er2); } else @@ -594,7 +598,7 @@ RtlUnwind( RegistrationFrame->prev); // Unlink the exception handler - KeGetCurrentKPCR()->Tib.ExceptionList = RegistrationFrame->prev; + KeGetCurrentKPCR()->ExceptionList = RegistrationFrame->prev; } else // The stack looks goofy! Raise an exception to bail out { @@ -603,7 +607,7 @@ RtlUnwind( er2.ExceptionRecord = pExceptRec; er2.NumberParameters = 0; er2.ExceptionCode = STATUS_BAD_STACK; - er2.ExceptionFlags = EH_NONCONTINUABLE; + er2.ExceptionFlags = EXCEPTION_NONCONTINUABLE; RtlRaiseException(&er2); } diff --git a/reactos/ntoskrnl/ke/critical.c b/reactos/ntoskrnl/ke/critical.c index 636ceee15a7..4a03d393e93 100644 --- a/reactos/ntoskrnl/ke/critical.c +++ b/reactos/ntoskrnl/ke/critical.c @@ -1,4 +1,4 @@ -/* $Id: critical.c,v 1.6 2002/09/07 15:12:56 chorns Exp $ +/* $Id: critical.c,v 1.7 2002/09/08 10:23:28 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID STDCALL KeEnterCriticalRegion (VOID) diff --git a/reactos/ntoskrnl/ke/dpc.c b/reactos/ntoskrnl/ke/dpc.c index 622df076494..34f47aea1b1 100644 --- a/reactos/ntoskrnl/ke/dpc.c +++ b/reactos/ntoskrnl/ke/dpc.c @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dpc.c,v 1.23 2002/09/07 15:12:56 chorns Exp $ +/* $Id: dpc.c,v 1.24 2002/09/08 10:23:28 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -36,12 +36,12 @@ /* INCLUDES ***************************************************************/ -#include +#include +#include #define NDEBUG #include - /* TYPES *******************************************************************/ /* GLOBALS ******************************************************************/ diff --git a/reactos/ntoskrnl/ke/error.c b/reactos/ntoskrnl/ke/error.c index 74a8ffe665f..f0f82a48a7a 100644 --- a/reactos/ntoskrnl/ke/error.c +++ b/reactos/ntoskrnl/ke/error.c @@ -11,12 +11,10 @@ /* INCLUDE *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS ***************************************************************/ NTSTATUS STDCALL diff --git a/reactos/ntoskrnl/ke/event.c b/reactos/ntoskrnl/ke/event.c index dd95f7ea3a0..adb7d1ba1b3 100644 --- a/reactos/ntoskrnl/ke/event.c +++ b/reactos/ntoskrnl/ke/event.c @@ -10,12 +10,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS ****************************************************************/ VOID STDCALL KeClearEvent (PKEVENT Event) diff --git a/reactos/ntoskrnl/ke/i386/bios.c b/reactos/ntoskrnl/ke/i386/bios.c index 90152e8f6a3..bcc6c5e1aa3 100644 --- a/reactos/ntoskrnl/ke/i386/bios.c +++ b/reactos/ntoskrnl/ke/i386/bios.c @@ -25,12 +25,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define TRAMPOLINE_BASE (0x10000) diff --git a/reactos/ntoskrnl/ke/i386/brkpoint.c b/reactos/ntoskrnl/ke/i386/brkpoint.c index 382093df17a..5f2f7eb6e10 100644 --- a/reactos/ntoskrnl/ke/i386/brkpoint.c +++ b/reactos/ntoskrnl/ke/i386/brkpoint.c @@ -25,12 +25,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID STDCALL diff --git a/reactos/ntoskrnl/ke/i386/bthread.S b/reactos/ntoskrnl/ke/i386/bthread.S index 83e0507995e..997be090e73 100644 --- a/reactos/ntoskrnl/ke/i386/bthread.S +++ b/reactos/ntoskrnl/ke/i386/bthread.S @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: bthread.S,v 1.4 2002/09/07 15:12:57 chorns Exp $ +/* $Id: bthread.S,v 1.5 2002/09/08 10:23:29 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -27,7 +27,10 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/ke/i386/exp.c b/reactos/ntoskrnl/ke/i386/exp.c index a065b781ed0..c8da711a0e4 100644 --- a/reactos/ntoskrnl/ke/i386/exp.c +++ b/reactos/ntoskrnl/ke/i386/exp.c @@ -27,13 +27,23 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #define NDEBUG #include - /* GLOBALS *****************************************************************/ #define _STR(x) #x diff --git a/reactos/ntoskrnl/ke/i386/fpu.c b/reactos/ntoskrnl/ke/i386/fpu.c index c3ddc748fe1..f295014dfc1 100644 --- a/reactos/ntoskrnl/ke/i386/fpu.c +++ b/reactos/ntoskrnl/ke/i386/fpu.c @@ -27,12 +27,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ static ULONG HardwareMathSupport; diff --git a/reactos/ntoskrnl/ke/i386/gdt.c b/reactos/ntoskrnl/ke/i386/gdt.c index 066468e8f5a..f0a052cba9e 100644 --- a/reactos/ntoskrnl/ke/i386/gdt.c +++ b/reactos/ntoskrnl/ke/i386/gdt.c @@ -27,12 +27,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ PUSHORT KiGdtArray[MAXIMUM_PROCESSORS]; @@ -69,7 +71,7 @@ KiGdtPrepareForApplicationProcessorInit(ULONG Id) } VOID -KiInitializeGdt(PIKPCR Pcr) +KiInitializeGdt(PKPCR Pcr) { PUSHORT Gdt; struct @@ -89,10 +91,10 @@ KiInitializeGdt(PIKPCR Pcr) /* * Allocate a GDT */ - Gdt = KiGdtArray[Pcr->KPCR.ProcessorNumber]; + Gdt = KiGdtArray[Pcr->ProcessorNumber]; if (Gdt == NULL) { - DbgPrint("No GDT (%d)\n", Pcr->KPCR.ProcessorNumber); + DbgPrint("No GDT (%d)\n", Pcr->ProcessorNumber); KeBugCheck(0); } @@ -103,7 +105,7 @@ KiInitializeGdt(PIKPCR Pcr) * irrelevant. */ memcpy(Gdt, KiBootGdt, sizeof(USHORT) * 4 * 11); - Pcr->KPCR.GDT = Gdt; + Pcr->GDT = Gdt; /* * Set the base address of the PCR diff --git a/reactos/ntoskrnl/ke/i386/idt.c b/reactos/ntoskrnl/ke/i386/idt.c index 648a85908de..1e2e2912705 100644 --- a/reactos/ntoskrnl/ke/i386/idt.c +++ b/reactos/ntoskrnl/ke/i386/idt.c @@ -10,12 +10,11 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ IDT_DESCRIPTOR KiIdt[256]; diff --git a/reactos/ntoskrnl/ke/i386/irq.c b/reactos/ntoskrnl/ke/i386/irq.c index fcfc1ba3e0a..a54cda78baa 100644 --- a/reactos/ntoskrnl/ke/i386/irq.c +++ b/reactos/ntoskrnl/ke/i386/irq.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: irq.c,v 1.23 2002/09/07 15:12:57 chorns Exp $ +/* $Id: irq.c,v 1.24 2002/09/08 10:23:29 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/i386/irq.c @@ -35,16 +35,19 @@ /* INCLUDES ****************************************************************/ -#include - -#define NDEBUG -#include - +#include +#include +#include +#include +#include +#include #ifdef MP #include #endif /* MP */ +#define NDEBUG +#include /* GLOBALS *****************************************************************/ @@ -311,7 +314,6 @@ KiInterruptDispatch (ULONG Vector, PKIRQ_TRAPFRAME Trapframe) #endif /* DBG */ DPRINT("I(%d) ", Vector); - DbgPrint("I(%d) ", Vector); /* * Notify the rest of the kernel of the raised irq level @@ -389,7 +391,6 @@ KiInterruptDispatch (ULONG Vector, PKIRQ_TRAPFRAME Trapframe) } HalEndSystemInterrupt (old_level, 0); - DbgPrint("I(%d)exit", Vector); } #else /* MP */ diff --git a/reactos/ntoskrnl/ke/i386/irqhand.s b/reactos/ntoskrnl/ke/i386/irqhand.s index ac18e664f73..d54a97c3c82 100644 --- a/reactos/ntoskrnl/ke/i386/irqhand.s +++ b/reactos/ntoskrnl/ke/i386/irqhand.s @@ -1,5 +1,5 @@ -#include +#include .global _irq_handler_0 _irq_handler_0: diff --git a/reactos/ntoskrnl/ke/i386/kernel.c b/reactos/ntoskrnl/ke/i386/kernel.c index 06aefd5f5d1..685fd0e1ca7 100644 --- a/reactos/ntoskrnl/ke/i386/kernel.c +++ b/reactos/ntoskrnl/ke/i386/kernel.c @@ -27,12 +27,15 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ ULONG KiPcrInitDone = 0; @@ -51,24 +54,24 @@ KePrepareForApplicationProcessorInit(ULONG Id) VOID KeApplicationProcessorInit(VOID) { - PIKPCR KPCR; + PKPCR KPCR; ULONG Offset; /* * Create a PCR for this processor */ Offset = InterlockedIncrement(&PcrsAllocated) - 1; - KPCR = (PIKPCR)(KPCR_BASE + (Offset * PAGE_SIZE)); + KPCR = (PKPCR)(KPCR_BASE + (Offset * PAGESIZE)); MmCreateVirtualMappingForKernel((PVOID)KPCR, PAGE_READWRITE, PcrPages[Offset]); - memset(KPCR, 0, PAGE_SIZE); - KPCR->KPCR.ProcessorNumber = Offset; - KPCR->KPCR.Self = &KPCR->KPCR; - KPCR->KPCR.Irql = HIGH_LEVEL; + memset(KPCR, 0, PAGESIZE); + KPCR->ProcessorNumber = Offset; + KPCR->Self = KPCR; + KPCR->Irql = HIGH_LEVEL; /* Mark the end of the exception handler list */ - KPCR->KPCR.Tib.ExceptionList = (PVOID)-1; + KPCR->ExceptionList = (PVOID)-1; /* * Initialize the GDT @@ -96,7 +99,7 @@ KeApplicationProcessorInit(VOID) VOID KeInit1(VOID) { - PIKPCR KPCR; + PKPCR KPCR; extern USHORT KiBootGdt[]; extern KTSS KiBootTss; @@ -112,19 +115,19 @@ KeInit1(VOID) * with MmAllocPage() here because MmInit1() has not yet been * called, so we use a predefined page in low memory */ - KPCR = (PIKPCR)KPCR_BASE; - memset(KPCR, 0, PAGE_SIZE); - KPCR->KPCR.Self = (PKPCR)KPCR_BASE; - KPCR->KPCR.Irql = HIGH_LEVEL; - KPCR->KPCR.GDT = (PUSHORT)&KiBootGdt; - KPCR->KPCR.IDT = (PUSHORT)&KiIdt; - KPCR->KPCR.TSS = &KiBootTss; - KPCR->KPCR.ProcessorNumber = 0; + KPCR = (PKPCR)KPCR_BASE; + memset(KPCR, 0, PAGESIZE); + KPCR->Self = (PKPCR)KPCR_BASE; + KPCR->Irql = HIGH_LEVEL; + KPCR->GDT = (PUSHORT)&KiBootGdt; + KPCR->IDT = (PUSHORT)&KiIdt; + KPCR->TSS = &KiBootTss; + KPCR->ProcessorNumber = 0; KiPcrInitDone = 1; PcrsAllocated++; /* Mark the end of the exception handler list */ - KPCR->KPCR.Tib.ExceptionList = (PVOID)-1; + KPCR->ExceptionList = (PVOID)-1; Ki386InitializeLdt(); } diff --git a/reactos/ntoskrnl/ke/i386/ldt.c b/reactos/ntoskrnl/ke/i386/ldt.c index f0976f4a348..b1e33d59209 100644 --- a/reactos/ntoskrnl/ke/i386/ldt.c +++ b/reactos/ntoskrnl/ke/i386/ldt.c @@ -27,12 +27,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ /* diff --git a/reactos/ntoskrnl/ke/i386/multiboot.S b/reactos/ntoskrnl/ke/i386/multiboot.S index 6768178bdab..c6123945658 100644 --- a/reactos/ntoskrnl/ke/i386/multiboot.S +++ b/reactos/ntoskrnl/ke/i386/multiboot.S @@ -1,5 +1,7 @@ - -#include +#include +#include +#include +#include #define KERNEL_BASE (0xc0000000) diff --git a/reactos/ntoskrnl/ke/i386/stkswitch.S b/reactos/ntoskrnl/ke/i386/stkswitch.S index 94576a6b88b..440b84813cf 100644 --- a/reactos/ntoskrnl/ke/i386/stkswitch.S +++ b/reactos/ntoskrnl/ke/i386/stkswitch.S @@ -26,7 +26,9 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include /* FUNCTIONS ****************************************************************/ diff --git a/reactos/ntoskrnl/ke/i386/syscall.S b/reactos/ntoskrnl/ke/i386/syscall.S index b503b8da9fc..672da456f5b 100644 --- a/reactos/ntoskrnl/ke/i386/syscall.S +++ b/reactos/ntoskrnl/ke/i386/syscall.S @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: syscall.S,v 1.8 2002/09/07 15:12:57 chorns Exp $ +/* $Id: syscall.S,v 1.9 2002/09/08 10:23:30 chorns Exp $ * * FILE: ntoskrnl/hal/x86/syscall.s * PURPOSE: 2E trap handler @@ -25,10 +25,10 @@ * ??? */ -#include - -#undef STATUS_INVALID_SYSTEM_SERVICE -#define STATUS_INVALID_SYSTEM_SERVICE 0xC000001C +#include +#include +#include +#include /* * @@ -221,7 +221,7 @@ KeReturnFromSystemCall: /* Restore the user context */ /* Get a pointer to the current thread */ - movl %fs:KPCR_CURRENT_THREAD, %esi + movl %fs:0x124, %esi /* Restore the old trap frame pointer */ movl 0x3c(%esp), %ebx diff --git a/reactos/ntoskrnl/ke/i386/thread.c b/reactos/ntoskrnl/ke/i386/thread.c index cfd621fb075..3cbdd0d0432 100644 --- a/reactos/ntoskrnl/ke/i386/thread.c +++ b/reactos/ntoskrnl/ke/i386/thread.c @@ -27,7 +27,12 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include @@ -134,7 +139,7 @@ Ke386InitThreadWithContext(PKTHREAD Thread, PCONTEXT Context) TrapFrame->Gs = Context->SegGs; TrapFrame->Es = Context->SegEs; TrapFrame->Ds = Context->SegDs; - TrapFrame->Edx = Context->Edx; + TrapFrame->Edx = Context->Ebx; TrapFrame->Ecx = Context->Ecx; TrapFrame->Eax = Context->Eax; TrapFrame->PreviousMode = UserMode; diff --git a/reactos/ntoskrnl/ke/i386/trap.s b/reactos/ntoskrnl/ke/i386/trap.s index 0d82f10a58a..f5374655bc3 100644 --- a/reactos/ntoskrnl/ke/i386/trap.s +++ b/reactos/ntoskrnl/ke/i386/trap.s @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: trap.s,v 1.15 2002/09/07 15:12:57 chorns Exp $ +/* $Id: trap.s,v 1.16 2002/09/08 10:23:30 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/i386/trap.s @@ -25,8 +25,11 @@ */ /* INCLUDES ******************************************************************/ - -#include + +#include +#include +#include +#include /* FUNCTIONS *****************************************************************/ @@ -167,7 +170,7 @@ _KiTrapProlog: addl $4, %esp /* Get a pointer to the current thread */ - movl %fs:KPCR_CURRENT_THREAD, %esi + movl %fs:0x124, %esi /* Restore the old trap frame pointer */ popl %ebx diff --git a/reactos/ntoskrnl/ke/i386/tskswitch.S b/reactos/ntoskrnl/ke/i386/tskswitch.S index c55c67c5d27..74099482a4c 100644 --- a/reactos/ntoskrnl/ke/i386/tskswitch.S +++ b/reactos/ntoskrnl/ke/i386/tskswitch.S @@ -26,7 +26,10 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include /* FUNCTIONS ****************************************************************/ diff --git a/reactos/ntoskrnl/ke/i386/tss.c b/reactos/ntoskrnl/ke/i386/tss.c index 909b8e177ad..46b75a2efe7 100644 --- a/reactos/ntoskrnl/ke/i386/tss.c +++ b/reactos/ntoskrnl/ke/i386/tss.c @@ -27,12 +27,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ static KTSS* Ki386TssArray[MAXIMUM_PROCESSORS]; diff --git a/reactos/ntoskrnl/ke/i386/usercall.c b/reactos/ntoskrnl/ke/i386/usercall.c index 31feac3af4d..1fcd56b7d87 100644 --- a/reactos/ntoskrnl/ke/i386/usercall.c +++ b/reactos/ntoskrnl/ke/i386/usercall.c @@ -1,4 +1,4 @@ -/* $Id: usercall.c,v 1.21 2002/09/07 15:12:57 chorns Exp $ +/* $Id: usercall.c,v 1.22 2002/09/08 10:23:30 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,19 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include +#include +#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/ke/i386/usertrap.c b/reactos/ntoskrnl/ke/i386/usertrap.c index d2517e251dc..27e245f4cf6 100644 --- a/reactos/ntoskrnl/ke/i386/usertrap.c +++ b/reactos/ntoskrnl/ke/i386/usertrap.c @@ -27,13 +27,22 @@ /* INCLUDES *****************************************************************/ -#include -//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *****************************************************************/ static char *ExceptionTypeStrings[] = diff --git a/reactos/ntoskrnl/ke/i386/v86m.c b/reactos/ntoskrnl/ke/i386/v86m.c index 4d1ade471e4..c4d4b9aa4cc 100644 --- a/reactos/ntoskrnl/ke/i386/v86m.c +++ b/reactos/ntoskrnl/ke/i386/v86m.c @@ -25,12 +25,16 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define IOPL_FLAG ((1 << 12) | (1 << 13)) diff --git a/reactos/ntoskrnl/ke/i386/v86m_sup.S b/reactos/ntoskrnl/ke/i386/v86m_sup.S index 6d571868dd9..0ee36633812 100644 --- a/reactos/ntoskrnl/ke/i386/v86m_sup.S +++ b/reactos/ntoskrnl/ke/i386/v86m_sup.S @@ -24,8 +24,10 @@ * Created 09/10/00 */ -#include - +#include +#include +#include +#include .globl _Ki386RetToV86Mode .globl _KiV86Complete diff --git a/reactos/ntoskrnl/ke/kqueue.c b/reactos/ntoskrnl/ke/kqueue.c index 9d3446e07bd..6c8d685f23c 100644 --- a/reactos/ntoskrnl/ke/kqueue.c +++ b/reactos/ntoskrnl/ke/kqueue.c @@ -10,12 +10,11 @@ /* INCLUDES ****************************************************************/ -#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID @@ -35,7 +34,7 @@ KeInsertByKeyDeviceQueue (PKDEVICE_QUEUE DeviceQueue, DPRINT("KeInsertByKeyDeviceQueue()\n"); - DeviceQueueEntry->SortKey=SortKey; + DeviceQueueEntry->Key=SortKey; KeAcquireSpinLock(&DeviceQueue->Lock,&oldlvl); @@ -46,21 +45,21 @@ KeInsertByKeyDeviceQueue (PKDEVICE_QUEUE DeviceQueue, return(FALSE); } - current=DeviceQueue->DeviceListHead.Flink; - while (current!=(&DeviceQueue->DeviceListHead)) + current=DeviceQueue->ListHead.Flink; + while (current!=(&DeviceQueue->ListHead)) { - entry = CONTAINING_RECORD(current,KDEVICE_QUEUE_ENTRY,DeviceListEntry); - if (entry->SortKey < SortKey) + entry = CONTAINING_RECORD(current,KDEVICE_QUEUE_ENTRY,Entry); + if (entry->Key < SortKey) { - InsertBeforeEntryInList(&DeviceQueue->DeviceListHead, - &DeviceQueueEntry->DeviceListEntry, + InsertBeforeEntryInList(&DeviceQueue->ListHead, + &DeviceQueueEntry->Entry, current); KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl); return(TRUE); } current = current->Flink; } - InsertTailList(&DeviceQueue->DeviceListHead,&DeviceQueueEntry->DeviceListEntry); + InsertTailList(&DeviceQueue->ListHead,&DeviceQueueEntry->Entry); KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl); return(TRUE); @@ -83,12 +82,12 @@ KeRemoveByKeyDeviceQueue ( KeAcquireSpinLock(&DeviceQueue->Lock,&oldlvl); - current = DeviceQueue->DeviceListHead.Flink; - while (current != &DeviceQueue->DeviceListHead) + current = DeviceQueue->ListHead.Flink; + while (current != &DeviceQueue->ListHead) { - entry = CONTAINING_RECORD(current,KDEVICE_QUEUE_ENTRY,DeviceListEntry); - if (entry->SortKey < SortKey || - current->Flink == &DeviceQueue->DeviceListHead) + entry = CONTAINING_RECORD(current,KDEVICE_QUEUE_ENTRY,Entry); + if (entry->Key < SortKey || + current->Flink == &DeviceQueue->ListHead) { RemoveEntryList(current); KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl); @@ -125,8 +124,8 @@ KeRemoveDeviceQueue ( KeAcquireSpinLock(&DeviceQueue->Lock,&oldlvl); - list_entry = RemoveHeadList(&DeviceQueue->DeviceListHead); - if (list_entry==(&DeviceQueue->DeviceListHead)) + list_entry = RemoveHeadList(&DeviceQueue->ListHead); + if (list_entry==(&DeviceQueue->ListHead)) { DeviceQueue->Busy=FALSE; KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl); @@ -134,7 +133,7 @@ KeRemoveDeviceQueue ( } KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl); - entry = CONTAINING_RECORD(list_entry,KDEVICE_QUEUE_ENTRY,DeviceListEntry); + entry = CONTAINING_RECORD(list_entry,KDEVICE_QUEUE_ENTRY,Entry); return(entry); } @@ -150,7 +149,7 @@ KeInitializeDeviceQueue ( */ { assert(DeviceQueue!=NULL); - InitializeListHead(&DeviceQueue->DeviceListHead); + InitializeListHead(&DeviceQueue->ListHead); DeviceQueue->Busy=FALSE; KeInitializeSpinLock(&DeviceQueue->Lock); } @@ -181,9 +180,9 @@ KeInsertDeviceQueue ( return(FALSE); } - InsertTailList(&DeviceQueue->DeviceListHead, - &DeviceQueueEntry->DeviceListEntry); - DeviceQueueEntry->SortKey=0; + InsertTailList(&DeviceQueue->ListHead, + &DeviceQueueEntry->Entry); + DeviceQueueEntry->Key=0; KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl); return(TRUE); diff --git a/reactos/ntoskrnl/ke/kthread.c b/reactos/ntoskrnl/ke/kthread.c index 00d636e6ef0..78216d57630 100644 --- a/reactos/ntoskrnl/ke/kthread.c +++ b/reactos/ntoskrnl/ke/kthread.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: kthread.c,v 1.33 2002/09/07 15:12:56 chorns Exp $ +/* $Id: kthread.c,v 1.34 2002/09/08 10:23:28 chorns Exp $ * * FILE: ntoskrnl/ke/kthread.c * PURPOSE: Microkernel thread support @@ -27,7 +27,11 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include @@ -110,7 +114,7 @@ KeInitializeThread(PKPROCESS Process, PKTHREAD Thread, BOOLEAN First) DPRINT1("Failed to create thread stack\n"); KeBugCheck(0); } - for (i = 0; i < (MM_STACK_SIZE / PAGE_SIZE); i++) + for (i = 0; i < (MM_STACK_SIZE / PAGESIZE); i++) { PHYSICAL_ADDRESS Page; Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &Page); @@ -119,7 +123,7 @@ KeInitializeThread(PKPROCESS Process, PKTHREAD Thread, BOOLEAN First) KeBugCheck(0); } Status = MmCreateVirtualMapping(NULL, - KernelStack + (i * PAGE_SIZE), + KernelStack + (i * PAGESIZE), PAGE_EXECUTE_READWRITE, Page, TRUE); diff --git a/reactos/ntoskrnl/ke/main.c b/reactos/ntoskrnl/ke/main.c index 1d061388013..7b76ecaf99a 100644 --- a/reactos/ntoskrnl/ke/main.c +++ b/reactos/ntoskrnl/ke/main.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: main.c,v 1.136 2002/09/07 17:08:31 chorns Exp $ +/* $Id: main.c,v 1.137 2002/09/08 10:23:29 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/main.c @@ -28,21 +28,43 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "../dbg/kdb.h" +#include +#include + +#ifdef HALDBG +#include +#else +#define ps(args...) +#endif #define NDEBUG #include /* GLOBALS *******************************************************************/ -ULONG NtBuildNumber = KERNEL_VERSION_BUILD; -ULONG NtGlobalFlag = 0; -CHAR KeNumberProcessors; -LOADER_PARAMETER_BLOCK KeLoaderBlock; -ULONG KeDcacheFlushCount = 0; -ULONG KeIcacheFlushCount = 0; - +ULONG EXPORTED NtBuildNumber = KERNEL_VERSION_BUILD; +ULONG EXPORTED NtGlobalFlag = 0; +CHAR EXPORTED KeNumberProcessors; +LOADER_PARAMETER_BLOCK EXPORTED KeLoaderBlock; +ULONG EXPORTED KeDcacheFlushCount = 0; +ULONG EXPORTED KeIcacheFlushCount = 0; static LOADER_MODULE KeLoaderModules[64]; static UCHAR KeLoaderModuleStrings[64][256]; static UCHAR KeLoaderCommandLine[256]; @@ -261,8 +283,16 @@ InitSystemSharedUserPage (PCSZ ParameterLine) } VOID -ExpVerifyOffsets() +ExpInitializeExecutive(VOID) { + ULONG BootDriverCount; + ULONG i; + ULONG start; + ULONG length; + PCHAR name; + CHAR str[50]; + NTSTATUS Status; + /* * Fail at runtime if someone has changed various structures without * updating the offsets used for the assembler code. @@ -279,41 +309,10 @@ ExpVerifyOffsets() assert(FIELD_OFFSET(KTRAP_FRAME, Reserved9) == KTRAP_FRAME_RESERVED9); assert(FIELD_OFFSET(KV86M_TRAP_FRAME, regs) == TF_REGS); assert(FIELD_OFFSET(KV86M_TRAP_FRAME, orig_ebp) == TF_ORIG_EBP); - assert(FIELD_OFFSET(IKPCR, KPCR.Tib.ExceptionList) == KPCR_EXCEPTION_LIST); - assert(FIELD_OFFSET(IKPCR, KPCR.Self) == KPCR_SELF); - assert(FIELD_OFFSET(IKPCR, KPCR.TSS) == KPCR_TSS); - assert(FIELD_OFFSET(IKPCR, CurrentThread) == KPCR_CURRENT_THREAD); - assert(FIELD_OFFSET(KTSS, Esp0) == KTSS_ESP0); - assert(FIELD_OFFSET(KV86M_REGISTERS, Ebp) == KV86M_REGISTERS_EBP); - assert(FIELD_OFFSET(KV86M_REGISTERS, Edi) == KV86M_REGISTERS_EDI); - assert(FIELD_OFFSET(KV86M_REGISTERS, Esi) == KV86M_REGISTERS_ESI); - assert(FIELD_OFFSET(KV86M_REGISTERS, Edx) == KV86M_REGISTERS_EDX); - assert(FIELD_OFFSET(KV86M_REGISTERS, Ecx) == KV86M_REGISTERS_ECX); - assert(FIELD_OFFSET(KV86M_REGISTERS, Ebx) == KV86M_REGISTERS_EBX); - assert(FIELD_OFFSET(KV86M_REGISTERS, Eax) == KV86M_REGISTERS_EAX); - assert(FIELD_OFFSET(KV86M_REGISTERS, Ds) == KV86M_REGISTERS_DS); - assert(FIELD_OFFSET(KV86M_REGISTERS, Es) == KV86M_REGISTERS_ES); - assert(FIELD_OFFSET(KV86M_REGISTERS, Fs) == KV86M_REGISTERS_FS); - assert(FIELD_OFFSET(KV86M_REGISTERS, Gs) == KV86M_REGISTERS_GS); - assert(FIELD_OFFSET(KV86M_REGISTERS, Eip) == KV86M_REGISTERS_EIP); - assert(FIELD_OFFSET(KV86M_REGISTERS, Cs) == KV86M_REGISTERS_CS); - assert(FIELD_OFFSET(KV86M_REGISTERS, Eflags) == KV86M_REGISTERS_EFLAGS); - assert(FIELD_OFFSET(KV86M_REGISTERS, Esp) == KV86M_REGISTERS_ESP); - assert(FIELD_OFFSET(KV86M_REGISTERS, Ss) == KV86M_REGISTERS_SS); -} - -VOID -ExpInitializeExecutive(VOID) -{ - ULONG BootDriverCount; - ULONG i; - ULONG start; - ULONG length; - PCHAR name; - CHAR str[50]; - NTSTATUS Status; - - ExpVerifyOffsets(); + + assert(FIELD_OFFSET(KPCR, ExceptionList) == KPCR_EXCEPTION_LIST); + assert(FIELD_OFFSET(KPCR, Self) == KPCR_SELF); + assert(FIELD_OFFSET(KPCR, CurrentThread) == KPCR_CURRENT_THREAD); LdrInit1(); @@ -326,7 +325,7 @@ ExpInitializeExecutive(VOID) LastKernelAddress, (PADDRESS_RANGE)&KeMemoryMap, KeMemoryMapRangeCount); - + /* create default nls tables */ RtlpInitNlsTables(); @@ -372,9 +371,11 @@ ExpInitializeExecutive(VOID) /* Initialize all processors */ KeNumberProcessors = 0; + while (!HalAllProcessorsStarted()) { PVOID ProcessorStack; + if (KeNumberProcessors != 0) { KePrepareForApplicationProcessorInit(KeNumberProcessors); @@ -384,7 +385,6 @@ ExpInitializeExecutive(VOID) /* FIXME: The nonpaged memory for the stack is not released after use */ ProcessorStack = ExAllocatePool(NonPagedPool, MM_STACK_SIZE) + MM_STACK_SIZE; - Ki386InitialStackArray[((int)KeNumberProcessors)] = (PVOID)(ProcessorStack - MM_STACK_SIZE); HalInitializeProcessor(KeNumberProcessors, ProcessorStack); @@ -688,7 +688,7 @@ _main (ULONG MultiBootMagic, PLOADER_PARAMETER_BLOCK _LoaderBlock) strcpy(KeLoaderCommandLine, (PUCHAR)_LoaderBlock->CommandLine); } KeLoaderBlock.CommandLine = (ULONG)KeLoaderCommandLine; - + strcpy(KeLoaderModuleStrings[0], "ntoskrnl.exe"); KeLoaderModules[0].String = (ULONG)KeLoaderModuleStrings[0]; KeLoaderModules[0].ModStart = 0xC0000000; @@ -748,7 +748,7 @@ _main (ULONG MultiBootMagic, PLOADER_PARAMETER_BLOCK _LoaderBlock) i += size; } } - + KiSystemStartup(1); } diff --git a/reactos/ntoskrnl/ke/mutex.c b/reactos/ntoskrnl/ke/mutex.c index 4fce5febd74..62a5bab2a25 100644 --- a/reactos/ntoskrnl/ke/mutex.c +++ b/reactos/ntoskrnl/ke/mutex.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: mutex.c,v 1.11 2002/09/07 15:12:57 chorns Exp $ +/* $Id: mutex.c,v 1.12 2002/09/08 10:23:29 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/mutex.c @@ -28,12 +28,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID STDCALL diff --git a/reactos/ntoskrnl/ke/process.c b/reactos/ntoskrnl/ke/process.c index a8e8707d7d3..7a833026124 100644 --- a/reactos/ntoskrnl/ke/process.c +++ b/reactos/ntoskrnl/ke/process.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: process.c,v 1.10 2002/09/07 15:12:57 chorns Exp $ +/* $Id: process.c,v 1.11 2002/09/08 10:23:29 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/process.c @@ -29,12 +29,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID STDCALL @@ -58,7 +60,6 @@ KeAttachProcess (PEPROCESS Process) CurrentThread->OldProcess = PsGetCurrentProcess(); CurrentThread->ThreadsProcess = Process; - assert(CurrentThread->ThreadsProcess); PageDir = CurrentThread->ThreadsProcess->Pcb.DirectoryTableBase.u.LowPart; DPRINT("Switching process context to %x\n",PageDir) __asm__("movl %0,%%cr3\n\t" diff --git a/reactos/ntoskrnl/ke/queue.c b/reactos/ntoskrnl/ke/queue.c index b5131b68dae..e6ec4b8a3bb 100644 --- a/reactos/ntoskrnl/ke/queue.c +++ b/reactos/ntoskrnl/ke/queue.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: queue.c,v 1.2 2002/09/07 15:12:57 chorns Exp $ +/* $Id: queue.c,v 1.3 2002/09/08 10:23:29 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/queue.c @@ -28,12 +28,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID STDCALL @@ -45,7 +46,7 @@ KeInitializeQueue(IN PKQUEUE Queue, sizeof(KQUEUE)/sizeof(ULONG), 0); InitializeListHead(&Queue->EntryListHead); - InitializeListHead(&Queue->ThreadListHead); + InitializeListHead(&Queue->ThreadListEntry); Queue->CurrentCount = 0; Queue->MaximumCount = (Count == 0) ? KeNumberProcessors : Count; } diff --git a/reactos/ntoskrnl/ke/sem.c b/reactos/ntoskrnl/ke/sem.c index a0a085583c1..57c40dbed78 100644 --- a/reactos/ntoskrnl/ke/sem.c +++ b/reactos/ntoskrnl/ke/sem.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: sem.c,v 1.10 2002/09/07 15:12:57 chorns Exp $ +/* $Id: sem.c,v 1.11 2002/09/08 10:23:29 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/sem.c @@ -28,12 +28,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID STDCALL diff --git a/reactos/ntoskrnl/ke/spinlock.c b/reactos/ntoskrnl/ke/spinlock.c index b8d3344d162..9756f19127a 100644 --- a/reactos/ntoskrnl/ke/spinlock.c +++ b/reactos/ntoskrnl/ke/spinlock.c @@ -1,4 +1,4 @@ -/* $Id: spinlock.c,v 1.12 2002/09/07 15:12:57 chorns Exp $ +/* $Id: spinlock.c,v 1.13 2002/09/08 10:23:29 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -16,12 +16,11 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include -#define NDEBUG #include - /* FUNCTIONS ***************************************************************/ BOOLEAN STDCALL @@ -61,11 +60,11 @@ KeInitializeSpinLock (PKSPIN_LOCK SpinLock) * SpinLock = Caller supplied storage for the spinlock */ { - *SpinLock = 0; + SpinLock->Lock = 0; } -VOID FASTCALL -KefAcquireSpinLockAtDpcLevel (PKSPIN_LOCK SpinLock) +VOID STDCALL +KeAcquireSpinLockAtDpcLevel (PKSPIN_LOCK SpinLock) /* * FUNCTION: Acquires a spinlock when the caller is already running at * dispatch level @@ -79,13 +78,13 @@ KefAcquireSpinLockAtDpcLevel (PKSPIN_LOCK SpinLock) * FIXME: This depends on gcc assembling this test to a single load from * the spinlock's value. */ - if ((ULONG)*SpinLock >= 2) + if ((ULONG)SpinLock->Lock >= 2) { - DbgPrint("Lock %x has bad value %x\n", SpinLock, *SpinLock); + DbgPrint("Lock %x has bad value %x\n", SpinLock, SpinLock->Lock); KeBugCheck(0); } - while ((i = InterlockedExchange(SpinLock, 1)) == 1) + while ((i = InterlockedExchange(&SpinLock->Lock, 1)) == 1) { #ifndef MP DbgPrint("Spinning on spinlock %x current value %x\n", SpinLock, i); @@ -96,39 +95,6 @@ KefAcquireSpinLockAtDpcLevel (PKSPIN_LOCK SpinLock) } } -#undef KeAcquireSpinLockAtDpcLevel - -VOID STDCALL -KeAcquireSpinLockAtDpcLevel (PKSPIN_LOCK SpinLock) -/* - * FUNCTION: Acquires a spinlock when the caller is already running at - * dispatch level - * ARGUMENTS: - * SpinLock = Spinlock to acquire - */ -{ - KefAcquireSpinLockAtDpcLevel (SpinLock); -} - -VOID FASTCALL -KefReleaseSpinLockFromDpcLevel (PKSPIN_LOCK SpinLock) -/* - * FUNCTION: Releases a spinlock when the caller was running at dispatch - * level before acquiring it - * ARGUMENTS: - * SpinLock = Spinlock to release - */ -{ - if (*SpinLock != 1) - { - DbgPrint("Releasing unacquired spinlock %x\n", SpinLock); - KeBugCheck(0); - } - (void)InterlockedExchange(SpinLock, 0); -} - -#undef KeReleaseSpinLockFromDpcLevel - VOID STDCALL KeReleaseSpinLockFromDpcLevel (PKSPIN_LOCK SpinLock) /* @@ -138,7 +104,12 @@ KeReleaseSpinLockFromDpcLevel (PKSPIN_LOCK SpinLock) * SpinLock = Spinlock to release */ { - KefReleaseSpinLockFromDpcLevel (SpinLock); + if (SpinLock->Lock != 1) + { + DbgPrint("Releasing unacquired spinlock %x\n", SpinLock); + KeBugCheck(0); + } + (void)InterlockedExchange(&SpinLock->Lock, 0); } /* EOF */ diff --git a/reactos/ntoskrnl/ke/timer.c b/reactos/ntoskrnl/ke/timer.c index 25b1c40754b..7066217f94f 100644 --- a/reactos/ntoskrnl/ke/timer.c +++ b/reactos/ntoskrnl/ke/timer.c @@ -1,4 +1,4 @@ -/* $Id: timer.c,v 1.52 2002/09/07 15:12:57 chorns Exp $ +/* $Id: timer.c,v 1.53 2002/09/08 10:23:29 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -17,12 +17,15 @@ /* INCLUDES ***************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* TYPES *****************************************************************/ #define TIMER_IRQ 0 diff --git a/reactos/ntoskrnl/ke/wait.c b/reactos/ntoskrnl/ke/wait.c index f0cf2178741..12dcd29fa48 100644 --- a/reactos/ntoskrnl/ke/wait.c +++ b/reactos/ntoskrnl/ke/wait.c @@ -16,12 +16,16 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS ******************************************************************/ static KSPIN_LOCK DispatcherDatabaseLock; diff --git a/reactos/ntoskrnl/ldr/init.c b/reactos/ntoskrnl/ldr/init.c index 5a4fe87ce1a..a4b4f614b6e 100644 --- a/reactos/ntoskrnl/ldr/init.c +++ b/reactos/ntoskrnl/ldr/init.c @@ -35,12 +35,18 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ /* @@ -173,10 +179,10 @@ NTSTATUS LdrLoadInitialProcess (VOID) DPRINT("NTHeaders %x\n", NTHeaders); InitialTeb.StackReserve = NTHeaders->OptionalHeader.SizeOfStackReserve; /* FIXME: use correct commit size */ - InitialTeb.StackCommit = NTHeaders->OptionalHeader.SizeOfStackReserve - PAGE_SIZE; + InitialTeb.StackCommit = NTHeaders->OptionalHeader.SizeOfStackReserve - PAGESIZE; // InitialTeb.StackCommit = NTHeaders->OptionalHeader.SizeOfStackCommit; /* add guard page size */ - InitialTeb.StackCommit += PAGE_SIZE; + InitialTeb.StackCommit += PAGESIZE; DPRINT("StackReserve 0x%lX StackCommit 0x%lX\n", InitialTeb.StackReserve, InitialTeb.StackCommit); KeDetachProcess(); @@ -232,7 +238,7 @@ NTSTATUS LdrLoadInitialProcess (VOID) /* Protect guard page */ Status = NtProtectVirtualMemory(ProcessHandle, InitialTeb.StackLimit, - PAGE_SIZE, + PAGESIZE, PAGE_GUARD | PAGE_READWRITE, &OldPageProtection); if (!NT_SUCCESS(Status)) @@ -287,7 +293,7 @@ NTSTATUS LdrLoadInitialProcess (VOID) ProcessHandle, NULL, &Context, - (PUSER_STACK)&InitialTeb, + &InitialTeb, FALSE); if (!NT_SUCCESS(Status)) { diff --git a/reactos/ntoskrnl/ldr/loader.c b/reactos/ntoskrnl/ldr/loader.c index 32c47b05eb9..10b43233563 100644 --- a/reactos/ntoskrnl/ldr/loader.c +++ b/reactos/ntoskrnl/ldr/loader.c @@ -1,4 +1,4 @@ -/* $Id: loader.c,v 1.121 2002/09/07 15:12:58 chorns Exp $ +/* $Id: loader.c,v 1.122 2002/09/08 10:23:31 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -23,11 +23,19 @@ /* INCLUDES *****************************************************************/ -#include #include - -#define NDEBUG -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef HALDBG #include @@ -35,6 +43,8 @@ #define ps(args...) #endif +#define NDEBUG +#include /* GLOBALS *******************************************************************/ @@ -525,9 +535,6 @@ LdrInitializeBootStartDriver(PVOID ModuleLoadBase, wcsncpy(Buffer, Start, Length); RtlCreateUnicodeString(&DeviceNode->ServiceName, Buffer); - DPRINT1("Driver loaded at (%.08x) Length (0x%.08x)\n", - ModuleObject->Base, ModuleObject->Length); - Status = IopInitializeDriver(ModuleObject->EntryPoint, DeviceNode, FALSE); if (!NT_SUCCESS(Status)) @@ -622,14 +629,14 @@ LdrpQueryModuleInformation(PVOID Buffer, current = CONTAINING_RECORD(current_entry,MODULE_OBJECT,ListEntry); Smi->Module[ModuleCount].Unknown2 = 0; /* Always 0 */ - Smi->Module[ModuleCount].Base = current->Base; + Smi->Module[ModuleCount].BaseAddress = current->Base; Smi->Module[ModuleCount].Size = current->Length; Smi->Module[ModuleCount].Flags = 0; /* Flags ??? (GN) */ - Smi->Module[ModuleCount].Index = ModuleCount; + Smi->Module[ModuleCount].EntryIndex = ModuleCount; AnsiName.Length = 0; AnsiName.MaximumLength = 256; - AnsiName.Buffer = Smi->Module[ModuleCount].ImageName; + AnsiName.Buffer = Smi->Module[ModuleCount].Name; RtlUnicodeStringToAnsiString(&AnsiName, ¤t->FullName, FALSE); @@ -1110,7 +1117,7 @@ LdrPEProcessModule(PVOID ModuleLoadBase, { for (i = 0; i < PAGE_ROUND_DOWN(Length); i++) { - MmSetPageProtect(NULL, BaseAddress + (i * PAGE_SIZE), + MmSetPageProtect(NULL, BaseAddress + (i * PAGESIZE), PAGE_READONLY); } } @@ -1179,7 +1186,7 @@ LdrPEProcessModule(PVOID ModuleLoadBase, DPRINT("Loading Module %wZ...\n", FileName); - if ((*KdDebuggerEnabled == TRUE) && (KdDebugState & KD_DEBUG_GDB)) + if ((KdDebuggerEnabled == TRUE) && (KdDebugState & KD_DEBUG_GDB)) { DPRINT("Module %wZ loaded at 0x%.08x.\n", FileName, CreatedModuleObject->Base); diff --git a/reactos/ntoskrnl/ldr/resource.c b/reactos/ntoskrnl/ldr/resource.c index e5be5653581..720aac65588 100644 --- a/reactos/ntoskrnl/ldr/resource.c +++ b/reactos/ntoskrnl/ldr/resource.c @@ -1,4 +1,4 @@ -/* $Id: resource.c,v 1.2 2002/09/07 15:12:58 chorns Exp $ +/* $Id: resource.c,v 1.3 2002/09/08 10:23:31 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,12 +9,11 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG #include - /* FUNCTIONS ****************************************************************/ NTSTATUS STDCALL diff --git a/reactos/ntoskrnl/ldr/rtl.c b/reactos/ntoskrnl/ldr/rtl.c index dcd9e0a70dd..3b4b2c50dda 100644 --- a/reactos/ntoskrnl/ldr/rtl.c +++ b/reactos/ntoskrnl/ldr/rtl.c @@ -1,4 +1,4 @@ -/* $Id: rtl.c,v 1.14 2002/09/07 15:12:58 chorns Exp $ +/* $Id: rtl.c,v 1.15 2002/09/08 10:23:31 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -10,12 +10,16 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS ****************************************************************/ diff --git a/reactos/ntoskrnl/ldr/sysdll.c b/reactos/ntoskrnl/ldr/sysdll.c index f656570e58d..11a8fa65b8a 100644 --- a/reactos/ntoskrnl/ldr/sysdll.c +++ b/reactos/ntoskrnl/ldr/sysdll.c @@ -11,12 +11,16 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ static PVOID SystemDllEntryPoint = NULL; diff --git a/reactos/ntoskrnl/ldr/userldr.c b/reactos/ntoskrnl/ldr/userldr.c index 36e4aa31662..3856b6e9d7b 100644 --- a/reactos/ntoskrnl/ldr/userldr.c +++ b/reactos/ntoskrnl/ldr/userldr.c @@ -11,7 +11,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/lpc/close.c b/reactos/ntoskrnl/lpc/close.c index 44777fef118..591d34f0e7c 100644 --- a/reactos/ntoskrnl/lpc/close.c +++ b/reactos/ntoskrnl/lpc/close.c @@ -1,4 +1,4 @@ -/* $Id: close.c,v 1.9 2002/09/07 15:12:58 chorns Exp $ +/* $Id: close.c,v 1.10 2002/09/08 10:23:31 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ /********************************************************************** diff --git a/reactos/ntoskrnl/lpc/complete.c b/reactos/ntoskrnl/lpc/complete.c index 661003af84c..f383ca9196c 100644 --- a/reactos/ntoskrnl/lpc/complete.c +++ b/reactos/ntoskrnl/lpc/complete.c @@ -1,4 +1,4 @@ -/* $Id: complete.c,v 1.6 2002/09/07 15:12:58 chorns Exp $ +/* $Id: complete.c,v 1.7 2002/09/08 10:23:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,14 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ /*********************************************************************** @@ -25,7 +27,7 @@ * * */ -NTSTATUS STDCALL +EXPORTED NTSTATUS STDCALL NtCompleteConnectPort (HANDLE PortHandle) { NTSTATUS Status; diff --git a/reactos/ntoskrnl/lpc/connect.c b/reactos/ntoskrnl/lpc/connect.c index a86f8ac844e..ab8ac402f16 100644 --- a/reactos/ntoskrnl/lpc/connect.c +++ b/reactos/ntoskrnl/lpc/connect.c @@ -1,4 +1,4 @@ -/* $Id: connect.c,v 1.11 2002/09/07 15:12:58 chorns Exp $ +/* $Id: connect.c,v 1.12 2002/09/08 10:23:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,17 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define TAG_LPC_CONNECT_MESSAGE TAG('L', 'P', 'C', 'C') @@ -57,7 +62,7 @@ EiConnectPort(IN PEPORT* ConnectedPort, /* * Create a port to represent our side of the connection */ - Status = ObRosCreateObject (NULL, + Status = ObCreateObject (NULL, PORT_ALL_ACCESS, NULL, ExPortType, @@ -85,12 +90,12 @@ EiConnectPort(IN PEPORT* ConnectedPort, */ RequestMessage->MessageHeader.DataSize = sizeof(EPORT_CONNECT_REQUEST_MESSAGE) + RequestConnectDataLength - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); RequestMessage->MessageHeader.MessageSize = sizeof(EPORT_CONNECT_REQUEST_MESSAGE) + RequestConnectDataLength; DPRINT("RequestMessageSize %d\n", RequestMessage->MessageHeader.MessageSize); - RequestMessage->MessageHeader.SectionSize = 0; + RequestMessage->MessageHeader.SharedSectionSize = 0; RequestMessage->ConnectingProcess = PsGetCurrentProcess(); ObReferenceObjectByPointer(RequestMessage->ConnectingProcess, PROCESS_VM_OPERATION, @@ -497,7 +502,7 @@ NtConnectPort (PHANDLE UnsafeConnectedPortHandle, * RETURN VALUE * */ -NTSTATUS STDCALL +EXPORTED NTSTATUS STDCALL NtAcceptConnectPort (PHANDLE ServerPortHandle, HANDLE NamedPortHandle, PLPC_MESSAGE LpcMessage, @@ -537,7 +542,7 @@ NtAcceptConnectPort (PHANDLE ServerPortHandle, */ if (AcceptIt == 1) { - Status = ObRosCreateObject(ServerPortHandle, + Status = ObCreateObject(ServerPortHandle, PORT_ALL_ACCESS, NULL, ExPortType, @@ -563,20 +568,20 @@ NtAcceptConnectPort (PHANDLE ServerPortHandle, */ if (LpcMessage != NULL) { - memcpy(&CReply->MessageHeader, LpcMessage, sizeof(LPC_MESSAGE)); + memcpy(&CReply->MessageHeader, LpcMessage, sizeof(LPC_MESSAGE_HEADER)); memcpy(&CReply->ConnectData, (PVOID)(LpcMessage + 1), LpcMessage->DataSize); CReply->MessageHeader.MessageSize = sizeof(EPORT_CONNECT_REPLY_MESSAGE) + LpcMessage->DataSize; CReply->MessageHeader.DataSize = CReply->MessageHeader.MessageSize - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); CReply->ConnectDataLength = LpcMessage->DataSize; } else { CReply->MessageHeader.MessageSize = sizeof(EPORT_CONNECT_REPLY_MESSAGE); CReply->MessageHeader.DataSize = sizeof(EPORT_CONNECT_REPLY_MESSAGE) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); CReply->ConnectDataLength = 0; } if (AcceptIt != 1) diff --git a/reactos/ntoskrnl/lpc/create.c b/reactos/ntoskrnl/lpc/create.c index 7c4357c1ca3..081587fc61c 100644 --- a/reactos/ntoskrnl/lpc/create.c +++ b/reactos/ntoskrnl/lpc/create.c @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.8 2002/09/07 15:12:58 chorns Exp $ +/* $Id: create.c,v 1.9 2002/09/08 10:23:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - STATIC NTSTATUS STDCALL VerifyCreateParameters (IN PHANDLE PortHandle, IN POBJECT_ATTRIBUTES ObjectAttributes, @@ -89,7 +90,7 @@ NiCreatePort (PVOID ObjectBody, * RETURN VALUE * */ -NTSTATUS STDCALL +EXPORTED NTSTATUS STDCALL NtCreatePort (PHANDLE PortHandle, POBJECT_ATTRIBUTES ObjectAttributes, ULONG MaxConnectInfoLength, @@ -112,7 +113,7 @@ NtCreatePort (PHANDLE PortHandle, return (Status); } /* Ask Ob to create the object */ - Status = ObRosCreateObject (PortHandle, + Status = ObCreateObject (PortHandle, PORT_ALL_ACCESS, ObjectAttributes, ExPortType, @@ -151,7 +152,7 @@ NtCreatePort (PHANDLE PortHandle, * RETURN VALUE * */ -NTSTATUS STDCALL +EXPORTED NTSTATUS STDCALL NtCreateWaitablePort (OUT PHANDLE PortHandle, IN POBJECT_ATTRIBUTES ObjectAttributes, IN ULONG MaxConnectInfoLength, diff --git a/reactos/ntoskrnl/lpc/listen.c b/reactos/ntoskrnl/lpc/listen.c index 3de515e723b..662234aa448 100644 --- a/reactos/ntoskrnl/lpc/listen.c +++ b/reactos/ntoskrnl/lpc/listen.c @@ -1,4 +1,4 @@ -/* $Id: listen.c,v 1.4 2002/09/07 15:12:58 chorns Exp $ +/* $Id: listen.c,v 1.5 2002/09/08 10:23:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,14 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ /********************************************************************** @@ -42,7 +44,7 @@ * NOTE * */ -NTSTATUS STDCALL +EXPORTED NTSTATUS STDCALL NtListenPort (IN HANDLE PortHandle, IN PLPC_MESSAGE ConnectMsg) { diff --git a/reactos/ntoskrnl/lpc/port.c b/reactos/ntoskrnl/lpc/port.c index 657227701bc..7843522c42a 100644 --- a/reactos/ntoskrnl/lpc/port.c +++ b/reactos/ntoskrnl/lpc/port.c @@ -1,4 +1,4 @@ -/* $Id: port.c,v 1.10 2002/09/07 15:12:58 chorns Exp $ +/* $Id: port.c,v 1.11 2002/09/08 10:23:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -14,7 +14,13 @@ /* INCLUDES *****************************************************************/ -#include +#include + +#include +#include +#include +#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/lpc/query.c b/reactos/ntoskrnl/lpc/query.c index f3ed857ba9e..b93690a7942 100644 --- a/reactos/ntoskrnl/lpc/query.c +++ b/reactos/ntoskrnl/lpc/query.c @@ -1,4 +1,4 @@ -/* $Id: query.c,v 1.4 2002/09/07 15:12:58 chorns Exp $ +/* $Id: query.c,v 1.5 2002/09/08 10:23:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ /********************************************************************** @@ -40,7 +42,7 @@ * P. Dabak reports that this system service seems to return * no information. */ -NTSTATUS STDCALL +EXPORTED NTSTATUS STDCALL NtQueryInformationPort (IN HANDLE PortHandle, IN CINT PortInformationClass, OUT PVOID PortInformation, diff --git a/reactos/ntoskrnl/lpc/queue.c b/reactos/ntoskrnl/lpc/queue.c index 9d50bfcba42..ae2f7d177bd 100644 --- a/reactos/ntoskrnl/lpc/queue.c +++ b/reactos/ntoskrnl/lpc/queue.c @@ -1,4 +1,4 @@ -/* $Id: queue.c,v 1.6 2002/09/07 15:12:58 chorns Exp $ +/* $Id: queue.c,v 1.7 2002/09/08 10:23:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID STDCALL diff --git a/reactos/ntoskrnl/lpc/receive.c b/reactos/ntoskrnl/lpc/receive.c index f03a6dfc611..2534495298b 100644 --- a/reactos/ntoskrnl/lpc/receive.c +++ b/reactos/ntoskrnl/lpc/receive.c @@ -1,4 +1,4 @@ -/* $Id: receive.c,v 1.4 2002/09/07 15:12:58 chorns Exp $ +/* $Id: receive.c,v 1.5 2002/09/08 10:23:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ /********************************************************************** diff --git a/reactos/ntoskrnl/lpc/reply.c b/reactos/ntoskrnl/lpc/reply.c index 0248c6021ef..bac3e6eae80 100644 --- a/reactos/ntoskrnl/lpc/reply.c +++ b/reactos/ntoskrnl/lpc/reply.c @@ -1,4 +1,4 @@ -/* $Id: reply.c,v 1.10 2002/09/07 15:12:58 chorns Exp $ +/* $Id: reply.c,v 1.11 2002/09/08 10:23:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,7 +11,12 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include @@ -57,8 +62,8 @@ EiReplyOrRequestPort (IN PEPORT Port, memcpy(&MessageReply->Message, LpcReply, LpcReply->MessageSize); } - MessageReply->Message.ClientId.UniqueProcess = PsGetCurrentProcessId(); - MessageReply->Message.ClientId.UniqueThread = PsGetCurrentThreadId(); + MessageReply->Message.Cid.UniqueProcess = PsGetCurrentProcessId(); + MessageReply->Message.Cid.UniqueThread = PsGetCurrentThreadId(); MessageReply->Message.MessageType = MessageType; MessageReply->Message.MessageId = InterlockedIncrement(&EiNextLpcMessageId); @@ -228,13 +233,13 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle, if (Request->Message.MessageType == LPC_CONNECTION_REQUEST) { - LPC_MESSAGE Header; + LPC_MESSAGE_HEADER Header; PEPORT_CONNECT_REQUEST_MESSAGE CRequest; CRequest = (PEPORT_CONNECT_REQUEST_MESSAGE)&Request->Message; - memcpy(&Header, &Request->Message, sizeof(LPC_MESSAGE)); + memcpy(&Header, &Request->Message, sizeof(LPC_MESSAGE_HEADER)); Header.DataSize = CRequest->ConnectDataLength; - Header.MessageSize = Header.DataSize + sizeof(LPC_MESSAGE); + Header.MessageSize = Header.DataSize + sizeof(LPC_MESSAGE_HEADER); Status = MmCopyToCaller(LpcMessage, &Header, sizeof(LPC_MESSAGE)); if (!NT_SUCCESS(Status)) { diff --git a/reactos/ntoskrnl/lpc/send.c b/reactos/ntoskrnl/lpc/send.c index ecb78bf930b..77c2f334305 100644 --- a/reactos/ntoskrnl/lpc/send.c +++ b/reactos/ntoskrnl/lpc/send.c @@ -1,4 +1,4 @@ -/* $Id: send.c,v 1.8 2002/09/07 15:12:59 chorns Exp $ +/* $Id: send.c,v 1.9 2002/09/08 10:23:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,7 +11,11 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/mm/anonmem.c b/reactos/ntoskrnl/mm/anonmem.c index ede0009814c..036368b1315 100644 --- a/reactos/ntoskrnl/mm/anonmem.c +++ b/reactos/ntoskrnl/mm/anonmem.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: anonmem.c,v 1.5 2002/09/07 15:12:59 chorns Exp $ +/* $Id: anonmem.c,v 1.6 2002/09/08 10:23:32 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/anonmem.c @@ -26,7 +26,12 @@ /* INCLUDE *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include @@ -94,7 +99,7 @@ MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace, /* * Write the page to the pagefile */ - Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE); + Mdl = MmCreateMdl(NULL, NULL, PAGESIZE); MmBuildMdlFromPages(Mdl, (PULONG)&PhysicalAddress); Status = MmWriteToSwapPage(SwapEntry, Mdl); if (!NT_SUCCESS(Status)) @@ -194,7 +199,7 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace, /* * Write the page to the pagefile */ - Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE); + Mdl = MmCreateMdl(NULL, NULL, PAGESIZE); MmBuildMdlFromPages(Mdl, (PULONG)&PhysicalAddress); Status = MmWriteToSwapPage(SwapEntry, Mdl); if (!NT_SUCCESS(Status)) @@ -360,7 +365,7 @@ MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace, PMDL Mdl; MmDeletePageFileMapping(NULL, Address, &SwapEntry); - Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE); + Mdl = MmCreateMdl(NULL, NULL, PAGESIZE); MmBuildMdlFromPages(Mdl, (PULONG)&Page); Status = MmReadFromSwapPage(SwapEntry, Mdl); if (!NT_SUCCESS(Status)) @@ -434,25 +439,25 @@ MmModifyAttributes(PMADDRESS_SPACE AddressSpace, { ULONG i; - for (i=0; i <= (RegionSize/PAGE_SIZE); i++) + for (i=0; i <= (RegionSize/PAGESIZE); i++) { LARGE_INTEGER PhysicalAddr; if (MmIsPageSwapEntry(AddressSpace->Process, - BaseAddress + (i * PAGE_SIZE))) + BaseAddress + (i * PAGESIZE))) { SWAPENTRY SwapEntry; MmDeletePageFileMapping(AddressSpace->Process, - BaseAddress + (i * PAGE_SIZE), + BaseAddress + (i * PAGESIZE), &SwapEntry); MmFreeSwapPage(SwapEntry); } else { - PhysicalAddr = MmGetPhysicalAddress(BaseAddress + (i*PAGE_SIZE)); + PhysicalAddr = MmGetPhysicalAddress(BaseAddress + (i*PAGESIZE)); MmDeleteVirtualMapping(AddressSpace->Process, - BaseAddress + (i*PAGE_SIZE), + BaseAddress + (i*PAGESIZE), FALSE, NULL, NULL); if (PhysicalAddr.QuadPart != 0) { @@ -464,7 +469,7 @@ MmModifyAttributes(PMADDRESS_SPACE AddressSpace, MmSetSavedSwapEntryPage(PhysicalAddr, 0); } MmDeleteRmap(PhysicalAddr, AddressSpace->Process, - BaseAddress + (i * PAGE_SIZE)); + BaseAddress + (i * PAGESIZE)); MmReleasePageMemoryConsumer(MC_USER, PhysicalAddr); } } @@ -480,13 +485,13 @@ MmModifyAttributes(PMADDRESS_SPACE AddressSpace, { ULONG i; - for (i=0; i <= (RegionSize/PAGE_SIZE); i++) + for (i=0; i <= (RegionSize/PAGESIZE); i++) { if (MmIsPagePresent(AddressSpace->Process, - BaseAddress + (i*PAGE_SIZE))) + BaseAddress + (i*PAGESIZE))) { MmSetPageProtect(AddressSpace->Process, - BaseAddress + (i*PAGE_SIZE), + BaseAddress + (i*PAGESIZE), NewProtect); } } @@ -685,7 +690,7 @@ MmFreeVirtualMemory(PEPROCESS Process, */ if (MemoryArea->PageOpCount > 0) { - for (i = 0; i < (PAGE_ROUND_UP(MemoryArea->Length) / PAGE_SIZE); i++) + for (i = 0; i < (PAGE_ROUND_UP(MemoryArea->Length) / PAGESIZE); i++) { PMM_PAGEOP PageOp; @@ -695,7 +700,7 @@ MmFreeVirtualMemory(PEPROCESS Process, } PageOp = MmCheckForPageOp(MemoryArea, Process->UniqueProcessId, - MemoryArea->BaseAddress + (i * PAGE_SIZE), + MemoryArea->BaseAddress + (i * PAGESIZE), NULL, 0); if (PageOp != NULL) { @@ -745,7 +750,7 @@ NtFreeVirtualMemory(IN HANDLE ProcessHandle, * ProcessHandle = Points to the process that allocated the virtual * memory * BaseAddress = Points to the memory address, rounded down to a - * multiple of the PAGE_SIZE + * multiple of the pagesize * RegionSize = Limits the range to free, rounded up to a multiple of * the paging size * FreeType = Can be one of the values: MEM_DECOMMIT, or MEM_RELEASE diff --git a/reactos/ntoskrnl/mm/aspace.c b/reactos/ntoskrnl/mm/aspace.c index 44fa7aa0438..118fbf2f064 100644 --- a/reactos/ntoskrnl/mm/aspace.c +++ b/reactos/ntoskrnl/mm/aspace.c @@ -1,4 +1,4 @@ -/* $Id: aspace.c,v 1.12 2002/09/07 15:12:59 chorns Exp $ +/* $Id: aspace.c,v 1.13 2002/09/08 10:23:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include -#define NDEBUG #include - /* GLOBALS ******************************************************************/ STATIC MADDRESS_SPACE KernelAddressSpace; @@ -75,7 +76,7 @@ MmInitializeAddressSpace(PEPROCESS Process, ExInitializeFastMutex(&AddressSpace->Lock); if (Process != NULL) { - AddressSpace->LowestAddress = (ULONG_PTR)MM_LOWEST_USER_ADDRESS; + AddressSpace->LowestAddress = MM_LOWEST_USER_ADDRESS; } else { diff --git a/reactos/ntoskrnl/mm/balance.c b/reactos/ntoskrnl/mm/balance.c index 5e52cf280d2..b154b028c07 100644 --- a/reactos/ntoskrnl/mm/balance.c +++ b/reactos/ntoskrnl/mm/balance.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: balance.c,v 1.12 2002/09/07 15:12:59 chorns Exp $ +/* $Id: balance.c,v 1.13 2002/09/08 10:23:32 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/balance.c @@ -28,12 +28,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* TYPES ********************************************************************/ typedef struct _MM_MEMORY_CONSUMER diff --git a/reactos/ntoskrnl/mm/cont.c b/reactos/ntoskrnl/mm/cont.c index bfb32d82b19..b1d9320263b 100644 --- a/reactos/ntoskrnl/mm/cont.c +++ b/reactos/ntoskrnl/mm/cont.c @@ -1,4 +1,4 @@ -/* $Id: cont.c,v 1.22 2002/09/07 15:12:59 chorns Exp $ +/* $Id: cont.c,v 1.23 2002/09/08 10:23:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID STATIC @@ -70,12 +70,12 @@ MmAllocateContiguousAlignedMemory(IN ULONG NumberOfBytes, NULL); return(NULL); } - for (i = 0; i < (PAGE_ROUND_UP(NumberOfBytes) / PAGE_SIZE); i++) + for (i = 0; i < (PAGE_ROUND_UP(NumberOfBytes) / 4096); i++) { MmCreateVirtualMapping(NULL, - BaseAddress + (i * PAGE_SIZE), + BaseAddress + (i * 4096), PAGE_EXECUTE_READWRITE | PAGE_SYSTEM, - (LARGE_INTEGER)(PBase.QuadPart + (i * PAGE_SIZE)), + (LARGE_INTEGER)(PBase.QuadPart + (i * 4096)), TRUE); } return(BaseAddress); @@ -113,7 +113,7 @@ MmAllocateContiguousMemory (IN ULONG NumberOfBytes, { return(MmAllocateContiguousAlignedMemory(NumberOfBytes, HighestAcceptableAddress, - PAGE_SIZE)); + PAGESIZE)); } diff --git a/reactos/ntoskrnl/mm/drvlck.c b/reactos/ntoskrnl/mm/drvlck.c index 6c211a5d44f..a9ecd534550 100644 --- a/reactos/ntoskrnl/mm/drvlck.c +++ b/reactos/ntoskrnl/mm/drvlck.c @@ -1,4 +1,4 @@ -/* $Id: drvlck.c,v 1.2 2002/09/07 15:12:59 chorns Exp $ +/* $Id: drvlck.c,v 1.3 2002/09/08 10:23:32 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,11 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ #if 0 diff --git a/reactos/ntoskrnl/mm/freelist.c b/reactos/ntoskrnl/mm/freelist.c index ac320b579bc..0c36d02a655 100644 --- a/reactos/ntoskrnl/mm/freelist.c +++ b/reactos/ntoskrnl/mm/freelist.c @@ -11,12 +11,13 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* TYPES *******************************************************************/ #define MM_PHYSICAL_PAGE_FREE (0x1) @@ -51,7 +52,7 @@ static LIST_ENTRY BiosPageListHead; VOID MmTransferOwnershipPage(PHYSICAL_ADDRESS PhysicalAddress, ULONG NewConsumer) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; KIRQL oldIrql; KeAcquireSpinLock(&PageListLock, &oldIrql); @@ -79,7 +80,7 @@ MmGetLRUFirstUserPage(VOID) } PageDescriptor = CONTAINING_RECORD(NextListEntry, PHYSICAL_PAGE, ListEntry); Next.QuadPart = (ULONG)((ULONG)PageDescriptor - (ULONG)MmPageArray); - Next.QuadPart = (Next.QuadPart / sizeof(PHYSICAL_PAGE)) * PAGE_SIZE; + Next.QuadPart = (Next.QuadPart / sizeof(PHYSICAL_PAGE)) * PAGESIZE; KeReleaseSpinLock(&PageListLock, oldIrql); return(Next); } @@ -87,7 +88,7 @@ MmGetLRUFirstUserPage(VOID) PHYSICAL_ADDRESS MmGetLRUNextUserPage(PHYSICAL_ADDRESS PreviousPhysicalAddress) { - ULONG Start = PreviousPhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PreviousPhysicalAddress.u.LowPart / PAGESIZE; PLIST_ENTRY NextListEntry; PHYSICAL_ADDRESS Next; PHYSICAL_PAGE* PageDescriptor; @@ -109,7 +110,7 @@ MmGetLRUNextUserPage(PHYSICAL_ADDRESS PreviousPhysicalAddress) } PageDescriptor = CONTAINING_RECORD(NextListEntry, PHYSICAL_PAGE, ListEntry); Next.QuadPart = (ULONG)((ULONG)PageDescriptor - (ULONG)MmPageArray); - Next.QuadPart = (Next.QuadPart / sizeof(PHYSICAL_PAGE)) * PAGE_SIZE; + Next.QuadPart = (Next.QuadPart / sizeof(PHYSICAL_PAGE)) * PAGESIZE; KeReleaseSpinLock(&PageListLock, oldIrql); return(Next); } @@ -125,13 +126,13 @@ MmGetContinuousPages(ULONG NumberOfBytes, ULONG length; KIRQL oldIrql; - NrPages = PAGE_ROUND_UP(NumberOfBytes) / PAGE_SIZE; + NrPages = PAGE_ROUND_UP(NumberOfBytes) / PAGESIZE; KeAcquireSpinLock(&PageListLock, &oldIrql); start = -1; length = 0; - for (i = 0; i < (HighestAcceptableAddress.QuadPart / PAGE_SIZE); ) + for (i = 0; i < (HighestAcceptableAddress.QuadPart / PAGESIZE); ) { if (MM_PTYPE(MmPageArray[i].Flags) == MM_PHYSICAL_PAGE_FREE) { @@ -156,7 +157,7 @@ MmGetContinuousPages(ULONG NumberOfBytes, /* * Fast forward to the base of the next aligned region */ - i = ROUND_UP((i + 1), (Alignment / PAGE_SIZE)); + i = ROUND_UP((i + 1), (Alignment / PAGESIZE)); } } if (start == -1 || length != NrPages) @@ -191,8 +192,8 @@ MiParseRangeToFreeList(PADDRESS_RANGE Range) Range->LengthLow, Range->Type); - first = (Range->BaseAddrLow + PAGE_SIZE - 1) / PAGE_SIZE; - last = first + ((Range->LengthLow + PAGE_SIZE - 1) / PAGE_SIZE); + first = (Range->BaseAddrLow + PAGESIZE - 1) / PAGESIZE; + last = first + ((Range->LengthLow + PAGESIZE - 1) / PAGESIZE); for (i = first; i < last; i++) { if (MmPageArray[i].Flags == 0) @@ -217,8 +218,8 @@ MiParseRangeToBiosList(PADDRESS_RANGE Range) Range->LengthLow, Range->Type); - first = (Range->BaseAddrLow + PAGE_SIZE - 1) / PAGE_SIZE; - last = first + ((Range->LengthLow + PAGE_SIZE - 1) / PAGE_SIZE); + first = (Range->BaseAddrLow + PAGESIZE - 1) / PAGESIZE; + last = first + ((Range->LengthLow + PAGESIZE - 1) / PAGESIZE); for (i = first; i < last; i++) { /* Remove the page from the free list if it is there */ @@ -248,7 +249,7 @@ MiParseBIOSMemoryMap(ULONG MemorySizeInPages, p = BIOSMemoryMap; for (i = 0; i < AddressRangeCount; i++) { - if (((p->BaseAddrLow + PAGE_SIZE - 1) / PAGE_SIZE) < MemorySizeInPages) + if (((p->BaseAddrLow + PAGESIZE - 1) / PAGESIZE) < MemorySizeInPages) { if (p->Type == 1) { @@ -303,15 +304,15 @@ MmInitializePageList(PVOID FirstPhysKernelAddress, LastKernelAddress = PAGE_ROUND_UP(LastKernelAddress); Reserved = - PAGE_ROUND_UP((MemorySizeInPages * sizeof(PHYSICAL_PAGE))) / PAGE_SIZE; + PAGE_ROUND_UP((MemorySizeInPages * sizeof(PHYSICAL_PAGE))) / PAGESIZE; MmPageArray = (PHYSICAL_PAGE *)LastKernelAddress; DPRINT("Reserved %d\n", Reserved); LastKernelAddress = PAGE_ROUND_UP(LastKernelAddress); - LastKernelAddress = ((ULONG)LastKernelAddress + (Reserved * PAGE_SIZE)); + LastKernelAddress = ((ULONG)LastKernelAddress + (Reserved * PAGESIZE)); LastPhysKernelAddress = (PVOID)PAGE_ROUND_UP(LastPhysKernelAddress); - LastPhysKernelAddress = LastPhysKernelAddress + (Reserved * PAGE_SIZE); + LastPhysKernelAddress = LastPhysKernelAddress + (Reserved * PAGESIZE); MmStats.NrTotalPages = 0; MmStats.NrSystemPages = 0; @@ -322,12 +323,12 @@ MmInitializePageList(PVOID FirstPhysKernelAddress, for (i = 0; i < Reserved; i++) { - PVOID Address = (PVOID)(ULONG)MmPageArray + (i * PAGE_SIZE); + PVOID Address = (PVOID)(ULONG)MmPageArray + (i * PAGESIZE); if (!MmIsPagePresent(NULL, Address)) { ULONG PhysicalAddress; PhysicalAddress = (ULONG)LastPhysKernelAddress - - (Reserved * PAGE_SIZE) + (i * PAGE_SIZE); + (Reserved * PAGESIZE) + (i * PAGESIZE); Status = MmCreateVirtualMappingUnsafe(NULL, Address, @@ -340,7 +341,7 @@ MmInitializePageList(PVOID FirstPhysKernelAddress, KeBugCheck(0); } } - memset((PVOID)MmPageArray + (i * PAGE_SIZE), 0, PAGE_SIZE); + memset((PVOID)MmPageArray + (i * PAGESIZE), 0, PAGESIZE); } /* @@ -362,8 +363,8 @@ MmInitializePageList(PVOID FirstPhysKernelAddress, i = 2; if ((ULONG)FirstPhysKernelAddress < 0xa0000) { - MmStats.NrFreePages += (((ULONG)FirstPhysKernelAddress/PAGE_SIZE) - 1); - for (; i<((ULONG)FirstPhysKernelAddress/PAGE_SIZE); i++) + MmStats.NrFreePages += (((ULONG)FirstPhysKernelAddress/PAGESIZE) - 1); + for (; i<((ULONG)FirstPhysKernelAddress/PAGESIZE); i++) { MmPageArray[i].Flags = MM_PHYSICAL_PAGE_FREE; MmPageArray[i].ReferenceCount = 0; @@ -371,24 +372,24 @@ MmInitializePageList(PVOID FirstPhysKernelAddress, &MmPageArray[i].ListEntry); } MmStats.NrSystemPages += - ((((ULONG)LastPhysKernelAddress) / PAGE_SIZE) - i); - for (; i<((ULONG)LastPhysKernelAddress / PAGE_SIZE); i++) + ((((ULONG)LastPhysKernelAddress) / PAGESIZE) - i); + for (; i<((ULONG)LastPhysKernelAddress / PAGESIZE); i++) { MmPageArray[i].Flags = MM_PHYSICAL_PAGE_USED; MmPageArray[i].ReferenceCount = 1; InsertTailList(&UsedPageListHeads[MC_NPPOOL], &MmPageArray[i].ListEntry); } - MmStats.NrFreePages += ((0xa0000/PAGE_SIZE) - i); - for (; i<(0xa0000/PAGE_SIZE); i++) + MmStats.NrFreePages += ((0xa0000/PAGESIZE) - i); + for (; i<(0xa0000/PAGESIZE); i++) { MmPageArray[i].Flags = MM_PHYSICAL_PAGE_FREE; MmPageArray[i].ReferenceCount = 0; InsertTailList(&FreeUnzeroedPageListHead, &MmPageArray[i].ListEntry); } - MmStats.NrReservedPages += ((0x100000/PAGE_SIZE) - i); - for (; i<(0x100000 / PAGE_SIZE); i++) + MmStats.NrReservedPages += ((0x100000/PAGESIZE) - i); + for (; i<(0x100000 / PAGESIZE); i++) { MmPageArray[i].Flags = MM_PHYSICAL_PAGE_BIOS; MmPageArray[i].ReferenceCount = 1; @@ -398,24 +399,24 @@ MmInitializePageList(PVOID FirstPhysKernelAddress, } else { - MmStats.NrFreePages += ((0xa0000 / PAGE_SIZE) - 1); - for (; i<(0xa0000 / PAGE_SIZE); i++) + MmStats.NrFreePages += ((0xa0000 / PAGESIZE) - 1); + for (; i<(0xa0000 / PAGESIZE); i++) { MmPageArray[i].Flags = MM_PHYSICAL_PAGE_FREE; MmPageArray[i].ReferenceCount = 0; InsertTailList(&FreeUnzeroedPageListHead, &MmPageArray[i].ListEntry); } - MmStats.NrReservedPages += (0x60000 / PAGE_SIZE); - for (; i<(0x100000 / PAGE_SIZE); i++) + MmStats.NrReservedPages += (0x60000 / PAGESIZE); + for (; i<(0x100000 / PAGESIZE); i++) { MmPageArray[i].Flags = MM_PHYSICAL_PAGE_BIOS; MmPageArray[i].ReferenceCount = 1; InsertTailList(&BiosPageListHead, &MmPageArray[i].ListEntry); } - MmStats.NrFreePages += (((ULONG)FirstPhysKernelAddress/PAGE_SIZE) - i); - for (; i<((ULONG)FirstPhysKernelAddress/PAGE_SIZE); i++) + MmStats.NrFreePages += (((ULONG)FirstPhysKernelAddress/PAGESIZE) - i); + for (; i<((ULONG)FirstPhysKernelAddress/PAGESIZE); i++) { MmPageArray[i].Flags = MM_PHYSICAL_PAGE_FREE; MmPageArray[i].ReferenceCount = 0; @@ -423,8 +424,8 @@ MmInitializePageList(PVOID FirstPhysKernelAddress, &MmPageArray[i].ListEntry); } MmStats.NrSystemPages += - (((ULONG)LastPhysKernelAddress/PAGE_SIZE) - i); - for (; i<((ULONG)LastPhysKernelAddress/PAGE_SIZE); i++) + (((ULONG)LastPhysKernelAddress/PAGESIZE) - i); + for (; i<((ULONG)LastPhysKernelAddress/PAGESIZE); i++) { MmPageArray[i].Flags = MM_PHYSICAL_PAGE_USED; MmPageArray[i].ReferenceCount = 1; @@ -459,7 +460,7 @@ MmInitializePageList(PVOID FirstPhysKernelAddress, VOID MmSetFlagsPage(PHYSICAL_ADDRESS PhysicalAddress, ULONG Flags) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; KIRQL oldIrql; KeAcquireSpinLock(&PageListLock, &oldIrql); @@ -471,7 +472,7 @@ VOID MmSetRmapListHeadPage(PHYSICAL_ADDRESS PhysicalAddress, struct _MM_RMAP_ENTRY* ListHead) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; MmPageArray[Start].RmapListHead = ListHead; } @@ -479,7 +480,7 @@ MmSetRmapListHeadPage(PHYSICAL_ADDRESS PhysicalAddress, struct _MM_RMAP_ENTRY* MmGetRmapListHeadPage(PHYSICAL_ADDRESS PhysicalAddress) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; return(MmPageArray[Start].RmapListHead); } @@ -487,7 +488,7 @@ MmGetRmapListHeadPage(PHYSICAL_ADDRESS PhysicalAddress) VOID MmMarkPageMapped(PHYSICAL_ADDRESS PhysicalAddress) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; KIRQL oldIrql; KeAcquireSpinLock(&PageListLock, &oldIrql); @@ -498,7 +499,7 @@ MmMarkPageMapped(PHYSICAL_ADDRESS PhysicalAddress) VOID MmMarkPageUnmapped(PHYSICAL_ADDRESS PhysicalAddress) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; KIRQL oldIrql; KeAcquireSpinLock(&PageListLock, &oldIrql); @@ -509,7 +510,7 @@ MmMarkPageUnmapped(PHYSICAL_ADDRESS PhysicalAddress) ULONG MmGetFlagsPage(PHYSICAL_ADDRESS PhysicalAddress) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; KIRQL oldIrql; ULONG Flags; @@ -525,7 +526,7 @@ VOID MmSetSavedSwapEntryPage(PHYSICAL_ADDRESS PhysicalAddress, SWAPENTRY SavedSwapEntry) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; KIRQL oldIrql; KeAcquireSpinLock(&PageListLock, &oldIrql); @@ -536,7 +537,7 @@ MmSetSavedSwapEntryPage(PHYSICAL_ADDRESS PhysicalAddress, SWAPENTRY MmGetSavedSwapEntryPage(PHYSICAL_ADDRESS PhysicalAddress) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; SWAPENTRY SavedSwapEntry; KIRQL oldIrql; @@ -550,7 +551,7 @@ MmGetSavedSwapEntryPage(PHYSICAL_ADDRESS PhysicalAddress) VOID MmReferencePage(PHYSICAL_ADDRESS PhysicalAddress) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; KIRQL oldIrql; DPRINT("MmReferencePage(PhysicalAddress %x)\n", PhysicalAddress); @@ -575,7 +576,7 @@ MmReferencePage(PHYSICAL_ADDRESS PhysicalAddress) ULONG MmGetReferenceCountPage(PHYSICAL_ADDRESS PhysicalAddress) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; KIRQL oldIrql; ULONG RCount; @@ -603,7 +604,7 @@ MmGetReferenceCountPage(PHYSICAL_ADDRESS PhysicalAddress) BOOLEAN MmIsUsablePage(PHYSICAL_ADDRESS PhysicalAddress) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; DPRINT("MmGetReferenceCountPage(PhysicalAddress %x)\n", PhysicalAddress); @@ -624,7 +625,7 @@ MmIsUsablePage(PHYSICAL_ADDRESS PhysicalAddress) VOID MmDereferencePage(PHYSICAL_ADDRESS PhysicalAddress) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; KIRQL oldIrql; DPRINT("MmDereferencePage(PhysicalAddress %I64x)\n", PhysicalAddress); @@ -686,7 +687,7 @@ MmDereferencePage(PHYSICAL_ADDRESS PhysicalAddress) ULONG MmGetLockCountPage(PHYSICAL_ADDRESS PhysicalAddress) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; KIRQL oldIrql; ULONG LockCount; @@ -714,7 +715,7 @@ MmGetLockCountPage(PHYSICAL_ADDRESS PhysicalAddress) VOID MmLockPage(PHYSICAL_ADDRESS PhysicalAddress) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; KIRQL oldIrql; DPRINT("MmLockPage(PhysicalAddress %x)\n", PhysicalAddress); @@ -739,7 +740,7 @@ MmLockPage(PHYSICAL_ADDRESS PhysicalAddress) VOID MmUnlockPage(PHYSICAL_ADDRESS PhysicalAddress) { - ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE; + ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE; KIRQL oldIrql; DPRINT("MmUnlockPage(PhysicalAddress %llx)\n", PhysicalAddress); @@ -814,7 +815,7 @@ MmAllocPage(ULONG Consumer, SWAPENTRY SavedSwapEntry) PageOffset.QuadPart = (ULONG)((ULONG)PageDescriptor - (ULONG)MmPageArray); PageOffset.QuadPart = - (PageOffset.QuadPart / sizeof(PHYSICAL_PAGE)) * PAGE_SIZE; + (PageOffset.QuadPart / sizeof(PHYSICAL_PAGE)) * PAGESIZE; if (NeedClear) { MiZeroPage(PageOffset); diff --git a/reactos/ntoskrnl/mm/i386/page.c b/reactos/ntoskrnl/mm/i386/page.c index d7183233e96..cc345f1ec49 100644 --- a/reactos/ntoskrnl/mm/i386/page.c +++ b/reactos/ntoskrnl/mm/i386/page.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: page.c,v 1.42 2002/09/07 15:13:03 chorns Exp $ +/* $Id: page.c,v 1.43 2002/09/08 10:23:37 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/i386/page.c @@ -28,12 +28,15 @@ /* INCLUDES ***************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *****************************************************************/ #define PA_BIT_PRESENT (0) @@ -147,7 +150,7 @@ NTSTATUS MmCopyMmInfo(PEPROCESS Src, PEPROCESS Dest) KProcess->DirectoryTableBase = PhysPageDirectory; CurrentPageDirectory = (PULONG)PAGEDIRECTORY_MAP; - memset(PageDirectory,0,PAGE_SIZE); + memset(PageDirectory,0,PAGESIZE); for (i=768; i<896; i++) { PageDirectory[i] = CurrentPageDirectory[i]; @@ -255,7 +258,7 @@ NTSTATUS MmGetPageEntry2(PVOID PAddress, PULONG* Pte, BOOLEAN MayWait) MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = *Pde; } - memset((PVOID)PAGE_ROUND_DOWN(ADDR_TO_PTE(Address)), 0, PAGE_SIZE); + memset((PVOID)PAGE_ROUND_DOWN(ADDR_TO_PTE(Address)), 0, PAGESIZE); FLUSH_TLB; } } @@ -658,7 +661,7 @@ NTSTATUS MmCreatePageTable(PVOID PAddress) return(Status); } (*page_dir) = npage.QuadPart | 0x7; - memset((PVOID)PAGE_ROUND_DOWN(ADDR_TO_PTE(Address)), 0, PAGE_SIZE); + memset((PVOID)PAGE_ROUND_DOWN(ADDR_TO_PTE(Address)), 0, PAGESIZE); FLUSH_TLB; } return(STATUS_SUCCESS); @@ -693,7 +696,7 @@ PULONG MmGetPageEntry(PVOID PAddress) KeBugCheck(0); } (*page_dir) = npage.QuadPart | 0x7; - memset((PVOID)PAGE_ROUND_DOWN(ADDR_TO_PTE(Address)), 0, PAGE_SIZE); + memset((PVOID)PAGE_ROUND_DOWN(ADDR_TO_PTE(Address)), 0, PAGESIZE); FLUSH_TLB; } page_tlb = ADDR_TO_PTE(Address); diff --git a/reactos/ntoskrnl/mm/i386/pfault.c b/reactos/ntoskrnl/mm/i386/pfault.c index 446efceda2a..fe09febff12 100644 --- a/reactos/ntoskrnl/mm/i386/pfault.c +++ b/reactos/ntoskrnl/mm/i386/pfault.c @@ -10,12 +10,15 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* EXTERNS *******************************************************************/ extern VOID MmSafeCopyFromUserUnsafeStart(VOID); diff --git a/reactos/ntoskrnl/mm/iospace.c b/reactos/ntoskrnl/mm/iospace.c index 7e4b59f5e7d..70a16c4e59b 100644 --- a/reactos/ntoskrnl/mm/iospace.c +++ b/reactos/ntoskrnl/mm/iospace.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: iospace.c,v 1.14 2002/09/07 15:12:59 chorns Exp $ +/* $Id: iospace.c,v 1.15 2002/09/08 10:23:33 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/iospace.c @@ -28,12 +28,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ /********************************************************************** @@ -64,10 +65,9 @@ * */ PVOID STDCALL -MmMapIoSpace( - IN PHYSICAL_ADDRESS PhysicalAddress, - IN ULONG NumberOfBytes, - IN MEMORY_CACHING_TYPE CacheEnable) +MmMapIoSpace (IN PHYSICAL_ADDRESS PhysicalAddress, + IN ULONG NumberOfBytes, + IN BOOLEAN CacheEnable) { PVOID Result; MEMORY_AREA* marea; @@ -92,25 +92,25 @@ MmMapIoSpace( return (NULL); } Attributes = PAGE_EXECUTE_READWRITE | PAGE_SYSTEM; - if (CacheEnable == MmNonCached) + if (!CacheEnable) { Attributes |= (PAGE_NOCACHE | PAGE_WRITETHROUGH); } - for (i = 0; (i < ((NumberOfBytes + PAGE_SIZE - 1) / PAGE_SIZE)); i++) + for (i = 0; (i < ((NumberOfBytes + PAGESIZE - 1) / PAGESIZE)); i++) { Status = - MmCreateVirtualMappingForKernel(Result + (i * PAGE_SIZE), + MmCreateVirtualMappingForKernel(Result + (i * PAGESIZE), Attributes, (PHYSICAL_ADDRESS) (PhysicalAddress.QuadPart + - (i * PAGE_SIZE))); + (i * PAGESIZE))); if (!NT_SUCCESS(Status)) { DbgPrint("Unable to create virtual mapping\n"); KeBugCheck(0); } } - return ((PVOID)(Result + PhysicalAddress.QuadPart % PAGE_SIZE)); + return ((PVOID)(Result + PhysicalAddress.QuadPart % PAGESIZE)); } @@ -142,7 +142,7 @@ MmUnmapIoSpace (IN PVOID BaseAddress, IN ULONG NumberOfBytes) { (VOID)MmFreeMemoryArea(&PsGetCurrentProcess()->AddressSpace, - (PVOID)(((ULONG)BaseAddress / PAGE_SIZE) * PAGE_SIZE), + (PVOID)(((ULONG)BaseAddress / PAGESIZE) * PAGESIZE), NumberOfBytes, NULL, NULL); diff --git a/reactos/ntoskrnl/mm/kmap.c b/reactos/ntoskrnl/mm/kmap.c index d75c34e6b83..900cddd1485 100644 --- a/reactos/ntoskrnl/mm/kmap.c +++ b/reactos/ntoskrnl/mm/kmap.c @@ -1,4 +1,4 @@ -/* $Id: kmap.c,v 1.19 2002/09/07 15:12:59 chorns Exp $ +/* $Id: kmap.c,v 1.20 2002/09/08 10:23:33 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,15 +9,18 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *****************************************************************/ -#define ALLOC_MAP_SIZE (NONPAGED_POOL_SIZE / PAGE_SIZE) +#define ALLOC_MAP_SIZE (NONPAGED_POOL_SIZE / PAGESIZE) /* * One bit for each page in the kmalloc region @@ -35,7 +38,7 @@ VOID ExUnmapPage(PVOID Addr) { KIRQL oldIrql; - ULONG i = (Addr - NonPagedPoolBase) / PAGE_SIZE; + ULONG i = (Addr - NonPagedPoolBase) / PAGESIZE; DPRINT("ExUnmapPage(Addr %x)\n",Addr); DPRINT("i %x\n",i); @@ -72,7 +75,7 @@ MiZeroPage(PHYSICAL_ADDRESS PhysPage) { return(STATUS_NO_MEMORY); } - memset(TempAddress, 0, PAGE_SIZE); + memset(TempAddress, 0, PAGESIZE); ExUnmapPage(TempAddress); return(STATUS_SUCCESS); } @@ -87,7 +90,7 @@ MiCopyFromUserPage(PHYSICAL_ADDRESS DestPhysPage, PVOID SourceAddress) { return(STATUS_NO_MEMORY); } - memcpy(TempAddress, SourceAddress, PAGE_SIZE); + memcpy(TempAddress, SourceAddress, PAGESIZE); ExUnmapPage(TempAddress); return(STATUS_SUCCESS); } @@ -108,7 +111,7 @@ ExAllocatePageWithPhysPage(PHYSICAL_ADDRESS PhysPage) DPRINT("i %x\n",i); AllocMap[i / 32] |= (1 << (i % 32)); AllocMapHint = i + 1; - addr = (ULONG)(NonPagedPoolBase + (i*PAGE_SIZE)); + addr = (ULONG)(NonPagedPoolBase + (i*PAGESIZE)); Status = MmCreateVirtualMapping(NULL, (PVOID)addr, PAGE_READWRITE | PAGE_SYSTEM, @@ -138,7 +141,7 @@ VOID MiFreeNonPagedPoolRegion(PVOID Addr, ULONG Count, BOOLEAN Free) { ULONG i; - ULONG Base = (Addr - NonPagedPoolBase) / PAGE_SIZE; + ULONG Base = (Addr - NonPagedPoolBase) / PAGESIZE; ULONG Offset; KIRQL oldlvl; @@ -149,7 +152,7 @@ MiFreeNonPagedPoolRegion(PVOID Addr, ULONG Count, BOOLEAN Free) Offset = Base + i; AllocMap[Offset / 32] &= (~(1 << (Offset % 32))); MmDeleteVirtualMapping(NULL, - Addr + (i * PAGE_SIZE), + Addr + (i * PAGESIZE), Free, NULL, NULL); @@ -189,9 +192,9 @@ MiAllocNonPagedPoolRegion(ULONG nr_pages) { AllocMap[j / 32] |= (1 << (j % 32)); } - DPRINT("returning %x\n",((start*PAGE_SIZE)+NonPagedPoolBase)); + DPRINT("returning %x\n",((start*PAGESIZE)+NonPagedPoolBase)); KeReleaseSpinLock(&AllocMapLock, oldlvl); - return(((start*PAGE_SIZE)+NonPagedPoolBase)); + return(((start*PAGESIZE)+NonPagedPoolBase)); } } else diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index eef09ec57e7..1f10f229489 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -27,12 +27,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define TAG_MAREA TAG('M', 'A', 'R', 'E') @@ -269,29 +271,29 @@ MmFreeMemoryArea(PMADDRESS_SPACE AddressSpace, KeBugCheck(0); return(STATUS_UNSUCCESSFUL); } - for (i=0; i<(PAGE_ROUND_UP(MemoryArea->Length)/PAGE_SIZE); i++) + for (i=0; i<(PAGE_ROUND_UP(MemoryArea->Length)/PAGESIZE); i++) { PHYSICAL_ADDRESS PhysAddr = (PHYSICAL_ADDRESS)0LL; BOOL Dirty; SWAPENTRY SwapEntry = 0; if (MmIsPageSwapEntry(AddressSpace->Process, - MemoryArea->BaseAddress + (i * PAGE_SIZE))) + MemoryArea->BaseAddress + (i * PAGESIZE))) { MmDeletePageFileMapping(AddressSpace->Process, - MemoryArea->BaseAddress + (i * PAGE_SIZE), + MemoryArea->BaseAddress + (i * PAGESIZE), &SwapEntry); } else { MmDeleteVirtualMapping(AddressSpace->Process, - MemoryArea->BaseAddress + (i*PAGE_SIZE), + MemoryArea->BaseAddress + (i*PAGESIZE), FALSE, &Dirty, &PhysAddr); } if (FreePage != NULL) { FreePage(FreePageContext, MemoryArea, - MemoryArea->BaseAddress + (i * PAGE_SIZE), PhysAddr, + MemoryArea->BaseAddress + (i * PAGESIZE), PhysAddr, SwapEntry, Dirty); } } @@ -381,13 +383,13 @@ NTSTATUS MmCreateMemoryArea(PEPROCESS Process, if ((*BaseAddress)==0 && !FixedAddress) { *BaseAddress = MmFindGap(AddressSpace, - PAGE_ROUND_UP(Length) +(PAGE_SIZE*2)); + PAGE_ROUND_UP(Length) +(PAGESIZE*2)); if ((*BaseAddress)==0) { DPRINT("No suitable gap\n"); return(STATUS_NO_MEMORY); } - (*BaseAddress)=(*BaseAddress)+PAGE_SIZE; + (*BaseAddress)=(*BaseAddress)+PAGESIZE; } else { diff --git a/reactos/ntoskrnl/mm/mdl.c b/reactos/ntoskrnl/mm/mdl.c index 89ef3d03713..569b2d7b192 100644 --- a/reactos/ntoskrnl/mm/mdl.c +++ b/reactos/ntoskrnl/mm/mdl.c @@ -1,4 +1,4 @@ -/* $Id: mdl.c,v 1.43 2002/09/07 15:12:59 chorns Exp $ +/* $Id: mdl.c,v 1.44 2002/09/08 10:23:34 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,14 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define TAG_MDL TAG('M', 'M', 'D', 'L') @@ -56,7 +58,7 @@ MmInitializeMdlImplementation(VOID) MiMdlMappingRegionAllocMap = ExAllocatePool(NonPagedPool, - MI_MDL_MAPPING_REGION_SIZE / (PAGE_SIZE * 32)); + MI_MDL_MAPPING_REGION_SIZE / (PAGESIZE * 32)); MiMdlMappingRegionHighWaterMark = 0; KeInitializeSpinLock(&MiMdlMappingRegionLock); } @@ -68,7 +70,7 @@ MmGetMdlPageAddress(PMDL Mdl, PVOID Offset) MdlPages = (PULONG)(Mdl + 1); - return((PVOID)MdlPages[((ULONG)Offset) / PAGE_SIZE]); + return((PVOID)MdlPages[((ULONG)Offset) / PAGESIZE]); } VOID STDCALL @@ -103,7 +105,7 @@ MmUnlockPages(PMDL Mdl) } MdlPages = (PULONG)(Mdl + 1); - for (i=0; i<(PAGE_ROUND_UP(Mdl->ByteCount+Mdl->ByteOffset)/PAGE_SIZE); i++) + for (i=0; i<(PAGE_ROUND_UP(Mdl->ByteCount+Mdl->ByteOffset)/PAGESIZE); i++) { MmUnlockPage((LARGE_INTEGER)(LONGLONG)MdlPages[i]); MmDereferencePage((LARGE_INTEGER)(LONGLONG)MdlPages[i]); @@ -143,11 +145,11 @@ MmMapLockedPages(PMDL Mdl, KPROCESSOR_MODE AccessMode) } /* Calculate the number of pages required. */ - RegionSize = PAGE_ROUND_UP(Mdl->ByteCount + Mdl->ByteOffset) / PAGE_SIZE; + RegionSize = PAGE_ROUND_UP(Mdl->ByteCount + Mdl->ByteOffset) / PAGESIZE; /* Allocate that number of pages from the mdl mapping region. */ KeAcquireSpinLock(&MiMdlMappingRegionLock, &oldIrql); - Base = MiMdlMappingRegionBase + MiMdlMappingRegionHighWaterMark * PAGE_SIZE; + Base = MiMdlMappingRegionBase + MiMdlMappingRegionHighWaterMark * PAGESIZE; for (i = 0; i < RegionSize; i++) { ULONG Offset = MiMdlMappingRegionHighWaterMark + i; @@ -162,7 +164,7 @@ MmMapLockedPages(PMDL Mdl, KPROCESSOR_MODE AccessMode) { NTSTATUS Status; Status = MmCreateVirtualMapping(NULL, - (PVOID)((ULONG)Base+(i*PAGE_SIZE)), + (PVOID)((ULONG)Base+(i*PAGESIZE)), PAGE_READWRITE, (LARGE_INTEGER)(LONGLONG)MdlPages[i], FALSE); @@ -205,13 +207,13 @@ MmUnmapLockedPages(PVOID BaseAddress, PMDL Mdl) } /* Calculate the number of pages we mapped. */ - RegionSize = PAGE_ROUND_UP(Mdl->ByteCount + Mdl->ByteOffset) / PAGE_SIZE; + RegionSize = PAGE_ROUND_UP(Mdl->ByteCount + Mdl->ByteOffset) / PAGESIZE; /* Unmap all the pages. */ for (i = 0; i < RegionSize; i++) { MmDeleteVirtualMapping(NULL, - BaseAddress + (i * PAGE_SIZE), + BaseAddress + (i * PAGESIZE), FALSE, NULL, NULL); @@ -220,7 +222,7 @@ MmUnmapLockedPages(PVOID BaseAddress, PMDL Mdl) KeAcquireSpinLock(&MiMdlMappingRegionLock, &oldIrql); /* Deallocate all the pages used. */ Base = (ULONG)(BaseAddress - MiMdlMappingRegionBase - Mdl->ByteOffset); - Base = Base / PAGE_SIZE; + Base = Base / PAGESIZE; for (i = 0; i < RegionSize; i++) { ULONG Offset = Base + i; @@ -250,7 +252,7 @@ MmBuildMdlFromPages(PMDL Mdl, PULONG Pages) MdlPages = (PULONG)(Mdl + 1); - for (i=0;i<(PAGE_ROUND_UP(Mdl->ByteOffset+Mdl->ByteCount)/PAGE_SIZE);i++) + for (i=0;i<(PAGE_ROUND_UP(Mdl->ByteOffset+Mdl->ByteCount)/PAGESIZE);i++) { MdlPages[i] = Pages[i]; } @@ -306,12 +308,12 @@ VOID STDCALL MmProbeAndLockPages (PMDL Mdl, MmLockAddressSpace(&Mdl->Process->AddressSpace); MdlPages = (ULONG *)(Mdl + 1); - NrPages = PAGE_ROUND_UP(Mdl->ByteOffset + Mdl->ByteCount) / PAGE_SIZE; + NrPages = PAGE_ROUND_UP(Mdl->ByteOffset + Mdl->ByteCount) / PAGESIZE; for (i = 0; i < NrPages; i++) { PVOID Address; - Address = Mdl->StartVa + (i*PAGE_SIZE); + Address = Mdl->StartVa + (i*PAGESIZE); if (!MmIsPagePresent(NULL, Address)) { @@ -391,7 +393,7 @@ MmBuildMdlForNonPagedPool (PMDL Mdl) for (va=0; va < ((Mdl->Size - sizeof(MDL)) / sizeof(ULONG)); va++) { ((PULONG)(Mdl + 1))[va] = - (MmGetPhysicalAddress(Mdl->StartVa + (va * PAGE_SIZE))).u.LowPart; + (MmGetPhysicalAddress(Mdl->StartVa + (va * PAGESIZE))).u.LowPart; } Mdl->MappedSystemVa = Mdl->StartVa + Mdl->ByteOffset; } @@ -425,7 +427,6 @@ MmCreateMdl (PMDL MemoryDescriptorList, } MmInitializeMdl(MemoryDescriptorList,Base,Length); - MemoryDescriptorList->Process = PsGetCurrentProcess(); return(MemoryDescriptorList); } diff --git a/reactos/ntoskrnl/mm/mm.c b/reactos/ntoskrnl/mm/mm.c index 91ac4f65b16..1bb94ffbb1b 100644 --- a/reactos/ntoskrnl/mm/mm.c +++ b/reactos/ntoskrnl/mm/mm.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: mm.c,v 1.59 2002/09/07 15:12:59 chorns Exp $ +/* $Id: mm.c,v 1.60 2002/09/08 10:23:35 chorns Exp $ * * COPYRIGHT: See COPYING in the top directory * PROJECT: ReactOS kernel @@ -29,14 +29,20 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *****************************************************************/ +PVOID EXPORTED MmUserProbeAddress = NULL; +PVOID EXPORTED MmHighestUserAddress = NULL; MM_STATS MmStats; /* FUNCTIONS ****************************************************************/ @@ -154,7 +160,6 @@ NTSTATUS MmAccessFault(KPROCESSOR_MODE Mode, if (KeGetCurrentIrql() >= DISPATCH_LEVEL) { DbgPrint("Page fault at high IRQL was %d\n", KeGetCurrentIrql()); -KeDumpStackFrames((PULONG)__builtin_frame_address(0)); return(STATUS_UNSUCCESSFUL); } if (PsGetCurrentProcess() == NULL) @@ -427,8 +432,8 @@ MmGrowKernelStack ( BOOLEAN STDCALL MmSetAddressRangeModified ( - IN PVOID Address, - IN ULONG Length + DWORD Unknown0, + DWORD Unknown1 ) { UNIMPLEMENTED; diff --git a/reactos/ntoskrnl/mm/mminit.c b/reactos/ntoskrnl/mm/mminit.c index 7b909015e8e..92b7c6106a9 100644 --- a/reactos/ntoskrnl/mm/mminit.c +++ b/reactos/ntoskrnl/mm/mminit.c @@ -1,4 +1,4 @@ -/* $Id: mminit.c,v 1.39 2002/09/07 15:13:00 chorns Exp $ +/* $Id: mminit.c,v 1.40 2002/09/08 10:23:35 chorns Exp $ * * COPYRIGHT: See COPYING in the top directory * PROJECT: ReactOS kernel @@ -11,12 +11,18 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *****************************************************************/ /* @@ -44,12 +50,6 @@ static MEMORY_AREA* MiPagedPoolDescriptor = NULL; PHYSICAL_ADDRESS MmSharedDataPagePhysicalAddress; -PVOID MiHighestUserAddress = NULL; -PVOID * MmHighestUserAddress = &MiHighestUserAddress; -ULONG MiUserProbeAddress = 0; -ULONG * MmUserProbeAddress = &MiUserProbeAddress; - - /* FUNCTIONS ****************************************************************/ BOOLEAN STDCALL MmIsThisAnNtAsSystem(VOID) @@ -86,7 +86,7 @@ VOID MmInitVirtualMemory(ULONG LastKernelAddress, LastKernelAddress = PAGE_ROUND_UP(LastKernelAddress); MmInitMemoryAreas(); - ExInitNonPagedPool(LastKernelAddress + PAGE_SIZE); + ExInitNonPagedPool(LastKernelAddress + PAGESIZE); /* * Setup the system area descriptor list @@ -140,7 +140,7 @@ VOID MmInitVirtualMemory(ULONG LastKernelAddress, &kernel_param_desc, FALSE); - BaseAddress = (PVOID)(LastKernelAddress + PAGE_SIZE); + BaseAddress = (PVOID)(LastKernelAddress + PAGESIZE); Length = NONPAGED_POOL_SIZE; MmCreateMemoryArea(NULL, MmGetKernelAddressSpace(), @@ -152,8 +152,8 @@ VOID MmInitVirtualMemory(ULONG LastKernelAddress, FALSE); MmPagedPoolSize = MM_PAGED_POOL_SIZE; - BaseAddress = (PVOID)(LastKernelAddress + PAGE_SIZE + NONPAGED_POOL_SIZE + - PAGE_SIZE); + BaseAddress = (PVOID)(LastKernelAddress + PAGESIZE + NONPAGED_POOL_SIZE + + PAGESIZE); MmPagedPoolBase = BaseAddress; Length = MM_PAGED_POOL_SIZE; MmCreateMemoryArea(NULL, @@ -170,7 +170,7 @@ VOID MmInitVirtualMemory(ULONG LastKernelAddress, * Create the kernel mapping of the user/kernel shared memory. */ BaseAddress = (PVOID)KI_USER_SHARED_DATA; - Length = PAGE_SIZE; + Length = PAGESIZE; MmCreateMemoryArea(NULL, MmGetKernelAddressSpace(), MEMORY_AREA_SYSTEM, @@ -226,9 +226,9 @@ VOID MmInit1(ULONG FirstKrnlPhysAddr, for (i = 0; i < AddressRangeCount; i++) { if (BIOSMemoryMap[i].Type == 1 - && (BIOSMemoryMap[i].BaseAddrLow + BIOSMemoryMap[i].LengthLow + PAGE_SIZE -1) / PAGE_SIZE > last) + && (BIOSMemoryMap[i].BaseAddrLow + BIOSMemoryMap[i].LengthLow + PAGESIZE -1) / PAGESIZE > last) { - last = (BIOSMemoryMap[i].BaseAddrLow + BIOSMemoryMap[i].LengthLow + PAGE_SIZE -1) / PAGE_SIZE; + last = (BIOSMemoryMap[i].BaseAddrLow + BIOSMemoryMap[i].LengthLow + PAGESIZE -1) / PAGESIZE; } } if ((last - 256) * 4 > KeLoaderBlock.MemHigher) @@ -240,8 +240,8 @@ VOID MmInit1(ULONG FirstKrnlPhysAddr, /* * FIXME: Set this based on the system command line */ - MiUserProbeAddress = (ULONG)0x7fff0000; - MiHighestUserAddress = (PVOID)0x7ffeffff; + MmUserProbeAddress = (PVOID)0x7fff0000; + MmHighestUserAddress = (PVOID)0x7ffeffff; /* * Initialize memory managment statistics @@ -294,7 +294,7 @@ VOID MmInit1(ULONG FirstKrnlPhysAddr, #ifdef BIOS_MEM_FIX MmStats.NrTotalPages += 16; #endif - DbgPrint("Used memory %dKb\n", (MmStats.NrTotalPages * PAGE_SIZE) / 1024); + DbgPrint("Used memory %dKb\n", (MmStats.NrTotalPages * PAGESIZE) / 1024); LastKernelAddress = (ULONG)MmInitializePageList( (PVOID)FirstKrnlPhysAddr, @@ -312,7 +312,7 @@ VOID MmInit1(ULONG FirstKrnlPhysAddr, CHECKPOINT; DPRINT("_text_start__ %x _text_end__ %x\n",(int)&_text_start__,(int)&_text_end__); for (i=PAGE_ROUND_UP(((int)&_text_start__)); - i +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ static HANDLE MpwThreadHandle; @@ -69,7 +71,7 @@ MmWriteDirtyPages(ULONG Target, PULONG Actual) return(STATUS_SUCCESS); } -VOID STDCALL +NTSTATUS STDCALL MmMpwThreadMain(PVOID Ignored) { NTSTATUS Status; @@ -89,12 +91,12 @@ MmMpwThreadMain(PVOID Ignored) { DbgPrint("MpwThread: Wait failed\n"); KeBugCheck(0); - return; + return(STATUS_UNSUCCESSFUL); } if (MpwThreadShouldTerminate) { DbgPrint("MpwThread: Terminating\n"); - return; + return(STATUS_SUCCESS); } PagesWritten = 0; diff --git a/reactos/ntoskrnl/mm/ncache.c b/reactos/ntoskrnl/mm/ncache.c index 05e0580ad53..12473980265 100644 --- a/reactos/ntoskrnl/mm/ncache.c +++ b/reactos/ntoskrnl/mm/ncache.c @@ -1,4 +1,4 @@ -/* $Id: ncache.c,v 1.20 2002/09/07 15:13:00 chorns Exp $ +/* $Id: ncache.c,v 1.21 2002/09/08 10:23:35 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ @@ -70,13 +71,13 @@ MmAllocateNonCachedMemory(IN ULONG NumberOfBytes) } Attributes = PAGE_READWRITE | PAGE_SYSTEM | PAGE_NOCACHE | PAGE_WRITETHROUGH; - for (i = 0; i <= (NumberOfBytes / PAGE_SIZE); i++) + for (i = 0; i <= (NumberOfBytes / PAGESIZE); i++) { PHYSICAL_ADDRESS NPage; Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &NPage); MmCreateVirtualMapping (NULL, - Result + (i * PAGE_SIZE), + Result + (i * PAGESIZE), Attributes, NPage, TRUE); diff --git a/reactos/ntoskrnl/mm/npool.c b/reactos/ntoskrnl/mm/npool.c index eafb5dbd820..a3893c989e1 100644 --- a/reactos/ntoskrnl/mm/npool.c +++ b/reactos/ntoskrnl/mm/npool.c @@ -1,4 +1,4 @@ -/* $Id: npool.c,v 1.60 2002/09/07 15:13:00 chorns Exp $ +/* $Id: npool.c,v 1.61 2002/09/08 10:23:35 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -16,7 +16,10 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include @@ -200,6 +203,10 @@ MiAddToTagHashTable(BLOCK_HDR* block) return; } previous = current; + if ((PVOID)current->tag_next >= (PVOID)0xc1123160) + { + DbgPrint("previous %x\n", previous); + } current = current->tag_next; } block->tag_next = NULL; @@ -380,7 +387,7 @@ static void validate_free_list(void) { DbgPrint("Bad block magic (probable pool corruption) at %x\n", current); - KeBugCheck(0); //(KBUG_POOL_FREE_LIST_CORRUPT); + KeBugCheck(KBUG_POOL_FREE_LIST_CORRUPT); } if (base_addr < (kernel_pool_base) || @@ -390,13 +397,13 @@ static void validate_free_list(void) DbgPrint("Size %d\n",current->Size); DbgPrint("Limits are %x %x\n",kernel_pool_base, kernel_pool_base+NONPAGED_POOL_SIZE); - KeBugCheck(0); //KBUG_POOL_FREE_LIST_CORRUPT); + KeBugCheck(KBUG_POOL_FREE_LIST_CORRUPT); } blocks_seen++; if (blocks_seen > EiNrFreeBlocks) { DbgPrint("Too many blocks on free list\n"); - KeBugCheck(0); //KBUG_POOL_FREE_LIST_CORRUPT); + KeBugCheck(KBUG_POOL_FREE_LIST_CORRUPT); } if (current->ListEntry.Flink != &FreeBlockListHead && current->ListEntry.Flink->Blink != ¤t->ListEntry) @@ -405,7 +412,7 @@ static void validate_free_list(void) "current->next->previous %x)\n", __FILE__,__LINE__,current, current->ListEntry.Flink, current->ListEntry.Flink->Blink); - KeBugCheck(0); //KBUG_POOL_FREE_LIST_CORRUPT); + KeBugCheck(KBUG_POOL_FREE_LIST_CORRUPT); } current_entry = current_entry->Flink; @@ -433,27 +440,27 @@ static void validate_used_list(void) { DbgPrint("Bad block magic (probable pool corruption) at %x\n", current); - KeBugCheck(0); //KBUG_POOL_FREE_LIST_CORRUPT); + KeBugCheck(KBUG_POOL_FREE_LIST_CORRUPT); } if (base_addr < (kernel_pool_base) || (base_addr+current->Size) > (kernel_pool_base)+NONPAGED_POOL_SIZE) { DbgPrint("Block %x found outside pool area\n",current); - KeBugCheck(0); //KBUG_POOL_FREE_LIST_CORRUPT); + for(;;); } blocks_seen++; if (blocks_seen > EiNrUsedBlocks) { DbgPrint("Too many blocks on used list\n"); - KeBugCheck(0); //KBUG_POOL_FREE_LIST_CORRUPT); + for(;;); } if (current->ListEntry.Flink != &UsedBlockListHead && current->ListEntry.Flink->Blink != ¤t->ListEntry) { DbgPrint("Break in list (current %x next %x)\n", current, current->ListEntry.Flink); - KeBugCheck(0); //KBUG_POOL_FREE_LIST_CORRUPT); + for(;;); } current_entry = current_entry->Flink; @@ -482,7 +489,7 @@ static void check_duplicates(BLOCK_HDR* blk) { DbgPrint("Bad block magic (probable pool corruption) at %x\n", current); - KeBugCheck(0); //KBUG_POOL_FREE_LIST_CORRUPT); + KeBugCheck(KBUG_POOL_FREE_LIST_CORRUPT); } if ( (int)current > base && (int)current < last ) @@ -684,7 +691,7 @@ static BLOCK_HDR* grow_kernel_pool(unsigned int size, ULONG Tag, PVOID Caller) */ { unsigned int total_size = size + sizeof(BLOCK_HDR); - unsigned int nr_pages = PAGE_ROUND_UP(total_size) / PAGE_SIZE; + unsigned int nr_pages = PAGE_ROUND_UP(total_size) / PAGESIZE; unsigned int start; BLOCK_HDR* used_blk=NULL; BLOCK_HDR* free_blk=NULL; @@ -708,7 +715,7 @@ static BLOCK_HDR* grow_kernel_pool(unsigned int size, ULONG Tag, PVOID Caller) return(NULL); } Status = MmCreateVirtualMapping(NULL, - (PVOID)(start + (i*PAGE_SIZE)), + (PVOID)(start + (i*PAGESIZE)), PAGE_READWRITE, Page, FALSE); @@ -720,7 +727,7 @@ static BLOCK_HDR* grow_kernel_pool(unsigned int size, ULONG Tag, PVOID Caller) } KeAcquireSpinLock(&MmNpoolLock, &oldIrql); - if ((PAGE_SIZE-(total_size%PAGE_SIZE))>(2*sizeof(BLOCK_HDR))) + if ((PAGESIZE-(total_size%PAGESIZE))>(2*sizeof(BLOCK_HDR))) { used_blk = (struct _BLOCK_HDR *)start; DPRINT("Creating block at %x\n",start); @@ -731,7 +738,7 @@ static BLOCK_HDR* grow_kernel_pool(unsigned int size, ULONG Tag, PVOID Caller) free_blk = (BLOCK_HDR *)(start + sizeof(BLOCK_HDR) + size); DPRINT("Creating block at %x\n",free_blk); free_blk->Magic = BLOCK_HDR_FREE_MAGIC; - free_blk->Size = (nr_pages * PAGE_SIZE) -((sizeof(BLOCK_HDR)*2) + size); + free_blk->Size = (nr_pages * PAGESIZE) -((sizeof(BLOCK_HDR)*2) + size); add_to_free_list(free_blk); EiFreeNonPagedPool = EiFreeNonPagedPool + free_blk->Size; @@ -741,7 +748,7 @@ static BLOCK_HDR* grow_kernel_pool(unsigned int size, ULONG Tag, PVOID Caller) { used_blk = (struct _BLOCK_HDR *)start; used_blk->Magic = BLOCK_HDR_USED_MAGIC; - used_blk->Size = (nr_pages * PAGE_SIZE) - sizeof(BLOCK_HDR); + used_blk->Size = (nr_pages * PAGESIZE) - sizeof(BLOCK_HDR); add_to_used_list(used_blk); EiUsedNonPagedPool = EiUsedNonPagedPool + used_blk->Size; @@ -870,7 +877,7 @@ VOID STDCALL ExFreeNonPagedPool (PVOID block) POOL_TRACE("ExFreePool(block %x), size %d, caller %x\n",block,blk->size, ((PULONG)&block)[-1]); - + KeAcquireSpinLock(&MmNpoolLock, &oldIrql); VALIDATE_POOL; @@ -889,9 +896,9 @@ VOID STDCALL ExFreeNonPagedPool (PVOID block) KeBugCheck(0); return; } - + memset(block, 0xcc, blk->Size); - + #ifdef TAG_STATISTICS_TRACKING MiRemoveFromTagHashTable(blk); #endif /* TAG_STATISTICS_TRACKING */ @@ -909,10 +916,7 @@ VOID STDCALL ExFreeNonPagedPool (PVOID block) } PVOID STDCALL -ExAllocateNonPagedPoolWithTag(ULONG Type, - ULONG Size, - ULONG Tag, - PVOID Caller) +ExAllocateNonPagedPoolWithTag(ULONG Type, ULONG Size, ULONG Tag, PVOID Caller) { #ifdef WHOLE_PAGE_ALLOCATIONS PVOID block; @@ -943,7 +947,7 @@ ExAllocateNonPagedPoolWithTag(ULONG Type, PVOID block; BLOCK_HDR* best = NULL; KIRQL oldIrql; - + POOL_TRACE("ExAllocatePool(NumberOfBytes %d) caller %x ", Size,Caller); @@ -983,7 +987,6 @@ ExAllocateNonPagedPoolWithTag(ULONG Type, VALIDATE_POOL; memset(block,0,Size); KeReleaseSpinLock(&MmNpoolLock, oldIrql); - return(block); } @@ -993,9 +996,7 @@ ExAllocateNonPagedPoolWithTag(ULONG Type, */ KeReleaseSpinLock(&MmNpoolLock, oldIrql); block=block_to_address(grow_kernel_pool(Size, Tag, Caller)); - memset(block, 0, Size); - return(block); #endif /* WHOLE_PAGE_ALLOCATIONS */ } @@ -1012,7 +1013,7 @@ ExAllocateWholePageBlock(ULONG UserSize) ULONG NrPages; Size = sizeof(ULONG) + UserSize; - NrPages = ROUND_UP(Size, PAGE_SIZE) / PAGE_SIZE; + NrPages = ROUND_UP(Size, PAGESIZE) / PAGESIZE; Address = MiAllocNonPagedPoolRegion(NrPages + 1); @@ -1024,14 +1025,14 @@ ExAllocateWholePageBlock(ULONG UserSize) KeBugCheck(0); } MmCreateVirtualMapping(NULL, - Address + (i * PAGE_SIZE), + Address + (i * PAGESIZE), PAGE_READWRITE | PAGE_SYSTEM, Page, TRUE); } - *((PULONG)((ULONG)Address + (NrPages * PAGE_SIZE) - Size)) = NrPages; - return((PVOID)((ULONG)Address + (NrPages * PAGE_SIZE) - UserSize)); + *((PULONG)((ULONG)Address + (NrPages * PAGESIZE) - Size)) = NrPages; + return((PVOID)((ULONG)Address + (NrPages * PAGESIZE) - UserSize)); } VOID STDCALL diff --git a/reactos/ntoskrnl/mm/pagefile.c b/reactos/ntoskrnl/mm/pagefile.c index 2f07de4d7b7..edd0ede3281 100644 --- a/reactos/ntoskrnl/mm/pagefile.c +++ b/reactos/ntoskrnl/mm/pagefile.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: pagefile.c,v 1.25 2002/09/07 15:13:00 chorns Exp $ +/* $Id: pagefile.c,v 1.26 2002/09/08 10:23:35 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/pagefile.c @@ -28,12 +28,15 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* TYPES *********************************************************************/ typedef struct _PAGINGFILE @@ -224,7 +227,7 @@ MmInitPagingFile(VOID) /* * Initialize the crash dump support. */ - MmCoreDumpPageFrame = MmAllocateSection(PAGE_SIZE); + MmCoreDumpPageFrame = MmAllocateSection(PAGESIZE); if (MmCoreDumpType == MM_CORE_DUMP_TYPE_FULL) { MmCoreDumpSize = MmStats.NrTotalPages * 4096 + 1024 * 1024; @@ -424,7 +427,7 @@ MmDumpToPagingFile(ULONG BugCode, Headers->FaultingStackBase = (PVOID)Thread->Tcb.StackLimit; Headers->FaultingStackSize = StackSize = (ULONG)(Thread->Tcb.StackBase - Thread->Tcb.StackLimit); - Headers->PhysicalMemorySize = MmStats.NrTotalPages * PAGE_SIZE; + Headers->PhysicalMemorySize = MmStats.NrTotalPages * PAGESIZE; /* Initialize the dump device. */ Context = MmCoreDumpDeviceFuncs.Context; @@ -442,7 +445,7 @@ MmDumpToPagingFile(ULONG BugCode, Mdl->Process = NULL; Mdl->MappedSystemVa = MmCoreDumpPageFrame; Mdl->StartVa = NULL; - Mdl->ByteCount = PAGE_SIZE; + Mdl->ByteCount = PAGESIZE; Mdl->ByteOffset = 0; MdlMap = (PULONG)(Mdl + 1); @@ -459,9 +462,9 @@ MmDumpToPagingFile(ULONG BugCode, DbgPrint("."); /* Write out the kernel mode stack of the faulting thread. */ - for (i = 0; i < (StackSize / PAGE_SIZE); i++) + for (i = 0; i < (StackSize / PAGESIZE); i++) { - Mdl->MappedSystemVa = (PVOID)(Thread->Tcb.StackLimit + (i * PAGE_SIZE)); + Mdl->MappedSystemVa = (PVOID)(Thread->Tcb.StackLimit + (i * PAGESIZE)); MdlMap[0] = MmGetPhysicalAddress(Mdl->MappedSystemVa).u.LowPart; Status = MmCoreDumpDeviceFuncs.DeviceWrite(Context, @@ -482,8 +485,8 @@ MmDumpToPagingFile(ULONG BugCode, for (i = 0; i < MmStats.NrTotalPages; i++) { LARGE_INTEGER PhysicalAddress; - PhysicalAddress.QuadPart = i * PAGE_SIZE; - MdlMap[0] = i * PAGE_SIZE; + PhysicalAddress.QuadPart = i * PAGESIZE; + MdlMap[0] = i * PAGESIZE; MmCreateVirtualMappingForKernel(MmCoreDumpPageFrame, PAGE_READWRITE, PhysicalAddress); @@ -588,7 +591,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName, PagingFile->FileObject = FileObject; PagingFile->MaximumSize.QuadPart = MaximumSize->QuadPart; PagingFile->CurrentSize.QuadPart = InitialSize->QuadPart; - PagingFile->FreePages = InitialSize->QuadPart / PAGE_SIZE; + PagingFile->FreePages = InitialSize->QuadPart / PAGESIZE; PagingFile->UsedPages = 0; KeInitializeSpinLock(&PagingFile->AllocMapLock); @@ -624,7 +627,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName, { MmCoreDumpBlockMap = ExAllocatePool(NonPagedPool, - (MmCoreDumpSize / PAGE_SIZE) * sizeof(ULONG)); + (MmCoreDumpSize / PAGESIZE) * sizeof(ULONG)); if (MmCoreDumpBlockMap == NULL) { DPRINT1("Failed to allocate block map.\n"); @@ -640,7 +643,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName, &MmCoreDumpSize, sizeof(ULONG), MmCoreDumpBlockMap, - (MmCoreDumpSize / PAGE_SIZE) * sizeof(ULONG)); + (MmCoreDumpSize / PAGESIZE) * sizeof(ULONG)); if (!NT_SUCCESS(Status)) { DPRINT1("Failed to get dump block map (Status %X)\n", Status); diff --git a/reactos/ntoskrnl/mm/pageop.c b/reactos/ntoskrnl/mm/pageop.c index 66b0148b631..738cb9c4866 100644 --- a/reactos/ntoskrnl/mm/pageop.c +++ b/reactos/ntoskrnl/mm/pageop.c @@ -1,4 +1,4 @@ -/* $Id: pageop.c,v 1.12 2002/09/07 15:13:00 chorns Exp $ +/* $Id: pageop.c,v 1.13 2002/09/08 10:23:36 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -10,12 +10,14 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define PAGEOP_HASH_TABLE_SIZE (32) @@ -80,11 +82,11 @@ MmCheckForPageOp(PMEMORY_AREA MArea, ULONG Pid, PVOID Address, */ if (MArea->Type == MEMORY_AREA_SECTION_VIEW) { - Hash = (((ULONG)Segment) | (((ULONG)Offset) / PAGE_SIZE)); + Hash = (((ULONG)Segment) | (((ULONG)Offset) / PAGESIZE)); } else { - Hash = (((ULONG)Pid) | (((ULONG)Address) / PAGE_SIZE)); + Hash = (((ULONG)Pid) | (((ULONG)Address) / PAGESIZE)); } Hash = Hash % PAGEOP_HASH_TABLE_SIZE; @@ -147,11 +149,11 @@ MmGetPageOp(PMEMORY_AREA MArea, ULONG Pid, PVOID Address, */ if (MArea->Type == MEMORY_AREA_SECTION_VIEW) { - Hash = (((ULONG)Segment) | (((ULONG)Offset) / PAGE_SIZE)); + Hash = (((ULONG)Segment) | (((ULONG)Offset) / PAGESIZE)); } else { - Hash = (((ULONG)Pid) | (((ULONG)Address) / PAGE_SIZE)); + Hash = (((ULONG)Pid) | (((ULONG)Address) / PAGESIZE)); } Hash = Hash % PAGEOP_HASH_TABLE_SIZE; diff --git a/reactos/ntoskrnl/mm/pager.c b/reactos/ntoskrnl/mm/pager.c index 6e76296bdb9..6e68b14f30d 100644 --- a/reactos/ntoskrnl/mm/pager.c +++ b/reactos/ntoskrnl/mm/pager.c @@ -1,4 +1,4 @@ -/* $Id: pager.c,v 1.10 2002/09/07 15:13:00 chorns Exp $ +/* $Id: pager.c,v 1.11 2002/09/08 10:23:36 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,14 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ static HANDLE PagerThreadHandle; @@ -26,7 +28,7 @@ static BOOLEAN PagerThreadShouldTerminate; /* FUNCTIONS *****************************************************************/ -static VOID STDCALL +static NTSTATUS STDCALL MmPagerThreadMain(PVOID Ignored) { NTSTATUS Status; @@ -46,7 +48,7 @@ MmPagerThreadMain(PVOID Ignored) if (PagerThreadShouldTerminate) { DbgPrint("PagerThread: Terminating\n"); - return; + return(STATUS_SUCCESS); } } } @@ -59,7 +61,7 @@ NTSTATUS MmInitPagerThread(VOID) KeInitializeEvent(&PagerThreadEvent, SynchronizationEvent, FALSE); - + Status = PsCreateSystemThread(&PagerThreadHandle, THREAD_ALL_ACCESS, NULL, diff --git a/reactos/ntoskrnl/mm/pagfault.c b/reactos/ntoskrnl/mm/pagfault.c index 059a40e46d3..b12b89dc7ee 100644 --- a/reactos/ntoskrnl/mm/pagfault.c +++ b/reactos/ntoskrnl/mm/pagfault.c @@ -1,10 +1,6 @@ -/* $Id: pagfault.c,v 1.3 2002/09/07 15:13:00 chorns Exp $ */ - -#include - -#define NDEBUG -#include - +/* $Id: pagfault.c,v 1.4 2002/09/08 10:23:36 chorns Exp $ */ +#include +#include BOOLEAN STDCALL diff --git a/reactos/ntoskrnl/mm/paging.c b/reactos/ntoskrnl/mm/paging.c index c49439cd2a2..c6ff3a37f5f 100644 --- a/reactos/ntoskrnl/mm/paging.c +++ b/reactos/ntoskrnl/mm/paging.c @@ -10,10 +10,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include + /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/mm/pool.c b/reactos/ntoskrnl/mm/pool.c index 78d68e69ad2..1313dbe25e3 100644 --- a/reactos/ntoskrnl/mm/pool.c +++ b/reactos/ntoskrnl/mm/pool.c @@ -1,4 +1,4 @@ -/* $Id: pool.c,v 1.14 2002/09/07 15:13:00 chorns Exp $ +/* $Id: pool.c,v 1.15 2002/09/08 10:23:36 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,12 +9,13 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *****************************************************************/ #define TAG_NONE (ULONG)(('N'<<0) + ('o'<<8) + ('n'<<16) + ('e'<<24)) @@ -28,6 +29,7 @@ EiAllocatePool(POOL_TYPE PoolType, PVOID Caller) { PVOID Block; + if (PoolType == NonPagedPoolCacheAligned || PoolType == NonPagedPoolCacheAlignedMustS) { @@ -98,10 +100,7 @@ ExAllocatePool (POOL_TYPE PoolType, ULONG NumberOfBytes) PVOID STDCALL -ExAllocatePoolWithTag ( - IN POOL_TYPE PoolType, - IN SIZE_T NumberOfBytes, - IN ULONG Tag) +ExAllocatePoolWithTag (ULONG PoolType, ULONG NumberOfBytes, ULONG Tag) { PVOID Block; Block = EiAllocatePool(PoolType, diff --git a/reactos/ntoskrnl/mm/ppool.c b/reactos/ntoskrnl/mm/ppool.c index fdfac72a877..356bbc2096a 100644 --- a/reactos/ntoskrnl/mm/ppool.c +++ b/reactos/ntoskrnl/mm/ppool.c @@ -1,4 +1,4 @@ -/* $Id: ppool.c,v 1.10 2002/09/07 15:13:00 chorns Exp $ +/* $Id: ppool.c,v 1.11 2002/09/08 10:23:36 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include -#define NDEBUG #include - /* GLOBALS *******************************************************************/ typedef struct _MM_PPOOL_FREE_BLOCK_HEADER diff --git a/reactos/ntoskrnl/mm/region.c b/reactos/ntoskrnl/mm/region.c index 8ceb22230f3..6277261e485 100644 --- a/reactos/ntoskrnl/mm/region.c +++ b/reactos/ntoskrnl/mm/region.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: region.c,v 1.2 2002/09/07 15:13:00 chorns Exp $ +/* $Id: region.c,v 1.3 2002/09/08 10:23:36 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/region.c @@ -26,7 +26,13 @@ /* INCLUDE *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/mm/rmap.c b/reactos/ntoskrnl/mm/rmap.c index b8acd898c3b..d563f3621c8 100644 --- a/reactos/ntoskrnl/mm/rmap.c +++ b/reactos/ntoskrnl/mm/rmap.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: rmap.c,v 1.11 2002/09/07 15:13:00 chorns Exp $ +/* $Id: rmap.c,v 1.12 2002/09/08 10:23:36 chorns Exp $ * * COPYRIGHT: See COPYING in the top directory * PROJECT: ReactOS kernel @@ -29,12 +29,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* TYPES ********************************************************************/ typedef struct _MM_RMAP_ENTRY diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index ee313a71fb5..e2d7ca5cb48 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: section.c,v 1.96 2002/09/07 15:13:01 chorns Exp $ +/* $Id: section.c,v 1.97 2002/09/08 10:23:36 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/section.c @@ -28,12 +28,19 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* TYPES *********************************************************************/ typedef struct @@ -47,7 +54,7 @@ typedef struct /* GLOBALS *******************************************************************/ -POBJECT_TYPE MmSectionObjectType = NULL; +POBJECT_TYPE EXPORTED MmSectionObjectType = NULL; static GENERIC_MAPPING MmpSectionMapping = { STANDARD_RIGHTS_READ | SECTION_MAP_READ | SECTION_QUERY, @@ -85,14 +92,14 @@ MmFreePageTablesSectionSegment(PMM_SECTION_SEGMENT Segment) VOID MmFreeSectionSegments(PFILE_OBJECT FileObject) { - if (FileObject->SectionObjectPointer->ImageSectionObject != NULL) + if (FileObject->SectionObjectPointers->ImageSectionObject != NULL) { PMM_IMAGE_SECTION_OBJECT ImageSectionObject; ULONG i; ImageSectionObject = - (PMM_IMAGE_SECTION_OBJECT)FileObject->SectionObjectPointer-> + (PMM_IMAGE_SECTION_OBJECT)FileObject->SectionObjectPointers-> ImageSectionObject; for (i = 0; i < ImageSectionObject->NrSegments; i++) @@ -106,13 +113,13 @@ MmFreeSectionSegments(PFILE_OBJECT FileObject) MmFreePageTablesSectionSegment(&ImageSectionObject->Segments[i]); } ExFreePool(ImageSectionObject); - FileObject->SectionObjectPointer->ImageSectionObject = NULL; + FileObject->SectionObjectPointers->ImageSectionObject = NULL; } - if (FileObject->SectionObjectPointer->DataSectionObject != NULL) + if (FileObject->SectionObjectPointers->DataSectionObject != NULL) { PMM_SECTION_SEGMENT Segment; - Segment = (PMM_SECTION_SEGMENT)FileObject->SectionObjectPointer-> + Segment = (PMM_SECTION_SEGMENT)FileObject->SectionObjectPointers-> DataSectionObject; if (Segment->ReferenceCount != 0) @@ -122,7 +129,7 @@ MmFreeSectionSegments(PFILE_OBJECT FileObject) } MmFreePageTablesSectionSegment(Segment); ExFreePool(Segment); - FileObject->SectionObjectPointer->DataSectionObject = NULL; + FileObject->SectionObjectPointers->DataSectionObject = NULL; } } @@ -273,7 +280,7 @@ MmUnsharePageEntrySectionSegment(PSECTION_OBJECT Section, Fcb = (PREACTOS_COMMON_FCB_HEADER)FileObject->FsContext; if (FileObject->Flags & FO_DIRECT_CACHE_PAGING_READ && - (Offset % PAGE_SIZE) == 0) + (Offset % PAGESIZE) == 0) { NTSTATUS Status; Status = CcRosUnmapCacheSegment(Fcb->Bcb, Offset, Dirty); @@ -327,12 +334,12 @@ MiReadPage(PMEMORY_AREA MemoryArea, * then get the related cache segment. */ if (FileObject->Flags & FO_DIRECT_CACHE_PAGING_READ && - (Offset->QuadPart % PAGE_SIZE) == 0) + (Offset->QuadPart % PAGESIZE) == 0) { ULONG BaseOffset; PVOID BaseAddress; BOOLEAN UptoDate; - PROS_CACHE_SEGMENT CacheSeg; + PCACHE_SEGMENT CacheSeg; PHYSICAL_ADDRESS Addr; /* @@ -388,7 +395,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, /* * Create an mdl to hold the page we are going to read data into. */ - Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE); + Mdl = MmCreateMdl(NULL, NULL, PAGESIZE); MmBuildMdlFromPages(Mdl, &Page->u.LowPart); /* * Call the FSD to read the page @@ -592,7 +599,7 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace, KeBugCheck(0); } - Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE); + Mdl = MmCreateMdl(NULL, NULL, PAGESIZE); MmBuildMdlFromPages(Mdl, (PULONG)&Page); Status = MmReadFromSwapPage(SwapEntry, Mdl); if (!NT_SUCCESS(Status)) @@ -854,7 +861,7 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace, KeBugCheck(0); } - Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE); + Mdl = MmCreateMdl(NULL, NULL, PAGESIZE); MmBuildMdlFromPages(Mdl, (PULONG)&Page); Status = MmReadFromSwapPage(SwapEntry, Mdl); if (!NT_SUCCESS(Status)) @@ -1081,7 +1088,7 @@ MmAccessFaultSectionView(PMADDRESS_SPACE AddressSpace, OldPage = MmGetPhysicalAddressForProcess(NULL, Address); NewAddress = ExAllocatePageWithPhysPage(NewPage); - memcpy(NewAddress, (PVOID)PAGE_ROUND_DOWN(Address), PAGE_SIZE); + memcpy(NewAddress, (PVOID)PAGE_ROUND_DOWN(Address), PAGESIZE); ExUnmapPage(NewAddress); /* @@ -1188,7 +1195,7 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace, * then note this is a direct mapped page. */ if (FileObject->Flags & FO_DIRECT_CACHE_PAGING_READ && - (Offset.QuadPart % PAGE_SIZE) == 0) + (Offset.QuadPart % PAGESIZE) == 0) { DirectMapped = TRUE; } @@ -1424,7 +1431,7 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace, /* * Write the page to the pagefile */ - Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE); + Mdl = MmCreateMdl(NULL, NULL, PAGESIZE); MmBuildMdlFromPages(Mdl, (PULONG)&PhysicalAddress); Status = MmWriteToSwapPage(SwapEntry, Mdl); if (!NT_SUCCESS(Status)) @@ -1533,7 +1540,7 @@ MmWritePageSectionView(PMADDRESS_SPACE AddressSpace, * then note this is a direct mapped page. */ if (FileObject->Flags & FO_DIRECT_CACHE_PAGING_READ && - (Offset.QuadPart % PAGE_SIZE) == 0) + (Offset.QuadPart % PAGESIZE) == 0) { DirectMapped = TRUE; } @@ -1623,7 +1630,7 @@ MmWritePageSectionView(PMADDRESS_SPACE AddressSpace, /* * Write the page to the pagefile */ - Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE); + Mdl = MmCreateMdl(NULL, NULL, PAGESIZE); MmBuildMdlFromPages(Mdl, (PULONG)&PhysicalAddress); Status = MmWriteToSwapPage(SwapEntry, Mdl); if (!NT_SUCCESS(Status)) @@ -1673,9 +1680,9 @@ MmAlterViewAttributes(PMADDRESS_SPACE AddressSpace, if (OldProtect != NewProtect) { - for (i = 0; i < (RegionSize / PAGE_SIZE); i++) + for (i = 0; i < (RegionSize / PAGESIZE); i++) { - PVOID Address = BaseAddress + (i * PAGE_SIZE); + PVOID Address = BaseAddress + (i * PAGESIZE); ULONG Protect = NewProtect; /* @@ -1937,7 +1944,7 @@ MmCreatePageFileSection(PHANDLE SectionHandle, /* * Create the section */ - Status = ObRosCreateObject(SectionHandle, + Status = ObCreateObject(SectionHandle, DesiredAccess, ObjectAttributes, MmSectionObjectType, @@ -2009,7 +2016,7 @@ MmCreateDataFileSection(PHANDLE SectionHandle, /* * Create the section */ - Status = ObRosCreateObject(SectionHandle, + Status = ObCreateObject(SectionHandle, DesiredAccess, ObjectAttributes, MmSectionObjectType, @@ -2132,7 +2139,7 @@ MmCreateDataFileSection(PHANDLE SectionHandle, * If this file hasn't been mapped as a data file before then allocate a * section segment to describe the data file mapping */ - if (FileObject->SectionObjectPointer->DataSectionObject == NULL) + if (FileObject->SectionObjectPointers->DataSectionObject == NULL) { Segment = ExAllocatePoolWithTag(NonPagedPool, sizeof(MM_SECTION_SEGMENT), TAG_MM_SECTION_SEGMENT); @@ -2165,7 +2172,7 @@ MmCreateDataFileSection(PHANDLE SectionHandle, ObDereferenceObject(FileObject); return(Status); } - FileObject->SectionObjectPointer->DataSectionObject = (PVOID)Segment; + FileObject->SectionObjectPointers->DataSectionObject = (PVOID)Segment; Segment->FileOffset = 0; Segment->Protection = 0; @@ -2190,7 +2197,7 @@ MmCreateDataFileSection(PHANDLE SectionHandle, * to extend it */ Segment = - (PMM_SECTION_SEGMENT)FileObject->SectionObjectPointer-> + (PMM_SECTION_SEGMENT)FileObject->SectionObjectPointers-> DataSectionObject; Section->Segments = Segment; InterlockedIncrement((PLONG)&Segment->ReferenceCount); @@ -2376,7 +2383,7 @@ MmCreateImageSection(PHANDLE SectionHandle, /* * Create the section */ - Status = ObRosCreateObject(SectionHandle, + Status = ObCreateObject(SectionHandle, DesiredAccess, ObjectAttributes, MmSectionObjectType, @@ -2474,7 +2481,7 @@ MmCreateImageSection(PHANDLE SectionHandle, * section segments to describe the mapping */ NrSegments = PEHeader.FileHeader.NumberOfSections + 1; - if (FileObject->SectionObjectPointer->ImageSectionObject == NULL) + if (FileObject->SectionObjectPointers->ImageSectionObject == NULL) { ULONG i; ULONG Size; @@ -2500,8 +2507,8 @@ MmCreateImageSection(PHANDLE SectionHandle, SectionSegments[0].FileOffset = 0; SectionSegments[0].Characteristics = IMAGE_SECTION_CHAR_DATA; SectionSegments[0].Protection = PAGE_READWRITE; - SectionSegments[0].RawLength = PAGE_SIZE; - SectionSegments[0].Length = PAGE_SIZE; + SectionSegments[0].RawLength = PAGESIZE; + SectionSegments[0].Length = PAGESIZE; SectionSegments[0].Flags = 0; SectionSegments[0].ReferenceCount = 1; SectionSegments[0].VirtualAddress = 0; @@ -2579,7 +2586,7 @@ MmCreateImageSection(PHANDLE SectionHandle, KeInitializeMutex(&SectionSegments[i].Lock, 0); } - FileObject->SectionObjectPointer->ImageSectionObject = + FileObject->SectionObjectPointers->ImageSectionObject = (PVOID)ImageSectionObject; } else @@ -2587,7 +2594,7 @@ MmCreateImageSection(PHANDLE SectionHandle, ULONG i; ImageSectionObject = (PMM_IMAGE_SECTION_OBJECT) - FileObject->SectionObjectPointer->ImageSectionObject; + FileObject->SectionObjectPointers->ImageSectionObject; SectionSegments = ImageSectionObject->Segments; Section->Segments = SectionSegments; @@ -3182,7 +3189,7 @@ MmAllocateSection (IN ULONG Length) } MmUnlockAddressSpace(AddressSpace); DPRINT("Result %p\n",Result); - for (i = 0; (i <= (Length / PAGE_SIZE)); i++) + for (i = 0; (i <= (Length / PAGESIZE)); i++) { PHYSICAL_ADDRESS Page; @@ -3193,7 +3200,7 @@ MmAllocateSection (IN ULONG Length) KeBugCheck(0); } Status = MmCreateVirtualMapping (NULL, - (Result + (i * PAGE_SIZE)), + (Result + (i * PAGESIZE)), PAGE_READWRITE, Page, TRUE); @@ -3362,7 +3369,7 @@ MmMapViewOfSection(IN PVOID SectionObject, ViewOffset = SectionOffset->u.LowPart; } - if ((ViewOffset % PAGE_SIZE) != 0) + if ((ViewOffset % PAGESIZE) != 0) { MmUnlockSection(Section); MmUnlockAddressSpace(AddressSpace); @@ -3427,8 +3434,8 @@ MmFlushImageSection (IN PSECTION_OBJECT_POINTERS SectionObjectPointer, } BOOLEAN STDCALL -MmForceSectionClosed (IN PSECTION_OBJECT_POINTERS SectionObjectPointer, - IN BOOLEAN DelayClose) +MmForceSectionClosed (DWORD Unknown0, + DWORD Unknown1) { UNIMPLEMENTED; return (FALSE); @@ -3445,7 +3452,7 @@ MmMapViewInSystemSpace (IN PVOID Section, } NTSTATUS STDCALL -MmUnmapViewInSystemSpace (IN PVOID MappedBase) +MmUnmapViewInSystemSpace (DWORD Unknown0) { UNIMPLEMENTED; return (STATUS_NOT_IMPLEMENTED); diff --git a/reactos/ntoskrnl/mm/slab.c b/reactos/ntoskrnl/mm/slab.c index a275bb991ca..1a373c8b5e2 100644 --- a/reactos/ntoskrnl/mm/slab.c +++ b/reactos/ntoskrnl/mm/slab.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: slab.c,v 1.6 2002/09/07 15:13:02 chorns Exp $ +/* $Id: slab.c,v 1.7 2002/09/08 10:23:36 chorns Exp $ * * COPYRIGHT: See COPYING in the top directory * PROJECT: ReactOS kernel @@ -29,12 +29,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - /* TYPES ********************************************************************/ typedef VOID (*SLAB_CACHE_CONSTRUCTOR)(VOID*, ULONG); @@ -92,7 +92,7 @@ ExCreateSlabCache(PUNICODE_STRING Name, ULONG Size, ULONG Align, AlignSize = Align - (ObjectSize % Align); Slab->ObjectSize = ObjectSize + AlignSize; Slab->ObjectsPerPage = - (PAGE_SIZE - sizeof(SLAB_CACHE_PAGE)) / Slab->ObjectSize; + (PAGESIZE - sizeof(SLAB_CACHE_PAGE)) / Slab->ObjectSize; InitializeListHead(&Slab->PageListHead); KeInitializeSpinLock(&Slab->SlabLock); @@ -123,7 +123,7 @@ ExGrowSlabCache(PSLAB_CACHE Slab) return(NULL); } - SlabPage = (PSLAB_CACHE_PAGE)(Page + PAGE_SIZE - sizeof(SLAB_CACHE_PAGE)); + SlabPage = (PSLAB_CACHE_PAGE)(Page + PAGESIZE - sizeof(SLAB_CACHE_PAGE)); SlabPage->ReferenceCount = 0; SlabPage->FirstFreeBuffer = (PSLAB_CACHE_BUFCTL)Page; for (i = 0; i < Slab->ObjectsPerPage; i++) @@ -261,9 +261,9 @@ ExFreeSlabCache(PSLAB_CACHE Slab, PVOID Object) current = CONTAINING_RECORD(current_entry, SLAB_CACHE_PAGE, PageListEntry); - Base = (PVOID)current + sizeof(SLAB_CACHE_PAGE) - PAGE_SIZE; + Base = (PVOID)current + sizeof(SLAB_CACHE_PAGE) - PAGESIZE; if (Base >= Object && - (Base + PAGE_SIZE - sizeof(SLAB_CACHE_PAGE)) >= + (Base + PAGESIZE - sizeof(SLAB_CACHE_PAGE)) >= (Object + Slab->ObjectSize)) { ExFreeFromPageSlabCache(Slab, current, Object); @@ -304,7 +304,7 @@ ExDestroySlabCache(PSLAB_CACHE Slab) current = CONTAINING_RECORD(current_entry, SLAB_CACHE_PAGE, PageListEntry); - Base = (PVOID)current + sizeof(SLAB_CACHE_PAGE) - PAGE_SIZE; + Base = (PVOID)current + sizeof(SLAB_CACHE_PAGE) - PAGESIZE; if (Slab->Destructor != NULL) { for (i = 0; i < Slab->ObjectsPerPage; i++) diff --git a/reactos/ntoskrnl/mm/virtual.c b/reactos/ntoskrnl/mm/virtual.c index b58e25b2932..72e262900ca 100644 --- a/reactos/ntoskrnl/mm/virtual.c +++ b/reactos/ntoskrnl/mm/virtual.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: virtual.c,v 1.63 2002/09/07 15:13:03 chorns Exp $ +/* $Id: virtual.c,v 1.64 2002/09/08 10:23:37 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/virtual.c @@ -26,7 +26,13 @@ /* INCLUDE *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include @@ -337,10 +343,10 @@ NtWriteVirtualMemory(IN HANDLE ProcessHandle, return(STATUS_SUCCESS); } -HANDLE STDCALL -MmSecureVirtualMemory (IN PVOID Address, - IN SIZE_T Size, - IN ULONG ProbeMode) +DWORD STDCALL +MmSecureVirtualMemory (DWORD Unknown0, + DWORD Unknown1, + DWORD Unknown2) { UNIMPLEMENTED; return 0; @@ -348,7 +354,7 @@ MmSecureVirtualMemory (IN PVOID Address, VOID STDCALL -MmUnsecureVirtualMemory (IN HANDLE SecureHandle) +MmUnsecureVirtualMemory (DWORD Unknown0) { UNIMPLEMENTED; } diff --git a/reactos/ntoskrnl/mm/wset.c b/reactos/ntoskrnl/mm/wset.c index 02c0b8f8acc..d680fb77c2c 100644 --- a/reactos/ntoskrnl/mm/wset.c +++ b/reactos/ntoskrnl/mm/wset.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: wset.c,v 1.15 2002/09/07 15:13:03 chorns Exp $ +/* $Id: wset.c,v 1.16 2002/09/08 10:23:37 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/wset.c @@ -28,12 +28,14 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS diff --git a/reactos/ntoskrnl/nls/nls.c b/reactos/ntoskrnl/nls/nls.c index 66e44c7ad90..37149d4d55f 100644 --- a/reactos/ntoskrnl/nls/nls.c +++ b/reactos/ntoskrnl/nls/nls.c @@ -1,13 +1,8 @@ -/* $Id: nls.c,v 1.3 2002/09/07 15:13:03 chorns Exp $ +/* $Id: nls.c,v 1.4 2002/09/08 10:23:37 chorns Exp $ * * reactos/ntoskrnl/nls/nls.c */ - -#include - -#define NDEBUG -#include - +#include #if 0 BYTE diff --git a/reactos/ntoskrnl/nt/channel.c b/reactos/ntoskrnl/nt/channel.c index b8ad293cc57..cb67dc2601e 100644 --- a/reactos/ntoskrnl/nt/channel.c +++ b/reactos/ntoskrnl/nt/channel.c @@ -18,12 +18,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS diff --git a/reactos/ntoskrnl/nt/evtpair.c b/reactos/ntoskrnl/nt/evtpair.c index 498a3c77891..9537613b737 100644 --- a/reactos/ntoskrnl/nt/evtpair.c +++ b/reactos/ntoskrnl/nt/evtpair.c @@ -1,4 +1,4 @@ -/* $Id: evtpair.c,v 1.12 2002/09/07 15:13:03 chorns Exp $ +/* $Id: evtpair.c,v 1.13 2002/09/08 10:23:38 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,7 +11,9 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include @@ -19,7 +21,7 @@ /* GLOBALS *******************************************************************/ -POBJECT_TYPE ExEventPairObjectType = NULL; +POBJECT_TYPE EXPORTED ExEventPairObjectType = NULL; static GENERIC_MAPPING ExEventPairMapping = { STANDARD_RIGHTS_READ, @@ -81,7 +83,7 @@ NtCreateEventPair(OUT PHANDLE EventPairHandle, NTSTATUS Status; DPRINT("NtCreateEventPair()\n"); - Status = ObRosCreateObject(EventPairHandle, + Status = ObCreateObject(EventPairHandle, DesiredAccess, ObjectAttributes, ExEventPairObjectType, @@ -90,10 +92,10 @@ NtCreateEventPair(OUT PHANDLE EventPairHandle, { return(Status); } - KeInitializeEvent(&EventPair->Event1, + KeInitializeEvent(&EventPair->LowEvent, SynchronizationEvent, FALSE); - KeInitializeEvent(&EventPair->Event2, + KeInitializeEvent(&EventPair->HighEvent, SynchronizationEvent, FALSE); ObDereferenceObject(EventPair); @@ -140,7 +142,7 @@ NtSetHighEventPair(IN HANDLE EventPairHandle) if (!NT_SUCCESS(Status)) return(Status); - KeSetEvent(&EventPair->Event2, + KeSetEvent(&EventPair->HighEvent, EVENT_INCREMENT, FALSE); @@ -167,11 +169,11 @@ NtSetHighWaitLowEventPair(IN HANDLE EventPairHandle) if (!NT_SUCCESS(Status)) return(Status); - KeSetEvent(&EventPair->Event2, + KeSetEvent(&EventPair->HighEvent, EVENT_INCREMENT, FALSE); - KeWaitForSingleObject(&EventPair->Event1, + KeWaitForSingleObject(&EventPair->LowEvent, WrEventPair, UserMode, FALSE, @@ -200,7 +202,7 @@ NtSetLowEventPair(IN HANDLE EventPairHandle) if (!NT_SUCCESS(Status)) return(Status); - KeSetEvent(&EventPair->Event1, + KeSetEvent(&EventPair->LowEvent, EVENT_INCREMENT, FALSE); @@ -227,11 +229,11 @@ NtSetLowWaitHighEventPair(IN HANDLE EventPairHandle) if (!NT_SUCCESS(Status)) return(Status); - KeSetEvent(&EventPair->Event1, + KeSetEvent(&EventPair->LowEvent, EVENT_INCREMENT, FALSE); - KeWaitForSingleObject(&EventPair->Event2, + KeWaitForSingleObject(&EventPair->HighEvent, WrEventPair, UserMode, FALSE, @@ -260,7 +262,7 @@ NtWaitLowEventPair(IN HANDLE EventPairHandle) if (!NT_SUCCESS(Status)) return(Status); - KeWaitForSingleObject(&EventPair->Event1, + KeWaitForSingleObject(&EventPair->LowEvent, WrEventPair, UserMode, FALSE, @@ -289,7 +291,7 @@ NtWaitHighEventPair(IN HANDLE EventPairHandle) if (!NT_SUCCESS(Status)) return(Status); - KeWaitForSingleObject(&EventPair->Event2, + KeWaitForSingleObject(&EventPair->HighEvent, WrEventPair, UserMode, FALSE, diff --git a/reactos/ntoskrnl/nt/misc.c b/reactos/ntoskrnl/nt/misc.c index c3f15644b52..41d6af48891 100644 --- a/reactos/ntoskrnl/nt/misc.c +++ b/reactos/ntoskrnl/nt/misc.c @@ -10,12 +10,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS diff --git a/reactos/ntoskrnl/nt/mutant.c b/reactos/ntoskrnl/nt/mutant.c index 3d0f034af35..2f1f627b77e 100644 --- a/reactos/ntoskrnl/nt/mutant.c +++ b/reactos/ntoskrnl/nt/mutant.c @@ -28,12 +28,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - POBJECT_TYPE ExMutantObjectType = NULL; static GENERIC_MAPPING ExpMutantMapping = { @@ -112,7 +113,7 @@ NtCreateMutant(OUT PHANDLE MutantHandle, PKMUTEX Mutant; NTSTATUS Status; - Status = ObRosCreateObject(MutantHandle, + Status = ObCreateObject(MutantHandle, DesiredAccess, ObjectAttributes, ExMutantObjectType, diff --git a/reactos/ntoskrnl/nt/nt.c b/reactos/ntoskrnl/nt/nt.c index d002afa0343..1fab35511a9 100644 --- a/reactos/ntoskrnl/nt/nt.c +++ b/reactos/ntoskrnl/nt/nt.c @@ -1,4 +1,4 @@ -/* $Id: nt.c,v 1.9 2002/09/07 15:13:04 chorns Exp $ +/* $Id: nt.c,v 1.10 2002/09/08 10:23:38 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,11 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ VOID NtInit(VOID) diff --git a/reactos/ntoskrnl/nt/ntevent.c b/reactos/ntoskrnl/nt/ntevent.c index 05568ac25b6..496bc621740 100644 --- a/reactos/ntoskrnl/nt/ntevent.c +++ b/reactos/ntoskrnl/nt/ntevent.c @@ -27,15 +27,19 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ -POBJECT_TYPE ExEventObjectType = NULL; +POBJECT_TYPE EXPORTED ExEventObjectType = NULL; static GENERIC_MAPPING ExpEventMapping = { STANDARD_RIGHTS_READ | SYNCHRONIZE | EVENT_QUERY_STATE, @@ -142,7 +146,7 @@ NtCreateEvent(OUT PHANDLE UnsafeEventHandle, ObjectAttributes = NULL; } - Status = ObRosCreateObject(&EventHandle, + Status = ObCreateObject(&EventHandle, DesiredAccess, ObjectAttributes, ExEventObjectType, diff --git a/reactos/ntoskrnl/nt/ntsem.c b/reactos/ntoskrnl/nt/ntsem.c index 9f870bde1f1..42610055c66 100644 --- a/reactos/ntoskrnl/nt/ntsem.c +++ b/reactos/ntoskrnl/nt/ntsem.c @@ -1,4 +1,4 @@ -/* $Id: ntsem.c,v 1.16 2002/09/07 15:13:04 chorns Exp $ +/* $Id: ntsem.c,v 1.17 2002/09/08 10:23:38 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,15 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS ******************************************************************/ POBJECT_TYPE ExSemaphoreType; @@ -82,7 +85,7 @@ NtCreateSemaphore(OUT PHANDLE SemaphoreHandle, PKSEMAPHORE Semaphore; NTSTATUS Status; - Status = ObRosCreateObject(SemaphoreHandle, + Status = ObCreateObject(SemaphoreHandle, DesiredAccess, ObjectAttributes, ExSemaphoreType, diff --git a/reactos/ntoskrnl/nt/nttimer.c b/reactos/ntoskrnl/nt/nttimer.c index 03a8b35e42b..11850665d4f 100644 --- a/reactos/ntoskrnl/nt/nttimer.c +++ b/reactos/ntoskrnl/nt/nttimer.c @@ -1,4 +1,4 @@ -/* $Id: nttimer.c,v 1.15 2002/09/07 15:13:04 chorns Exp $ +/* $Id: nttimer.c,v 1.16 2002/09/08 10:23:38 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,9 +11,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include -#define NDEBUG #include @@ -168,7 +172,7 @@ NtCreateTimer(OUT PHANDLE TimerHandle, NTSTATUS Status; DPRINT("NtCreateTimer()\n"); - Status = ObRosCreateObject(TimerHandle, + Status = ObCreateObject(TimerHandle, DesiredAccess, ObjectAttributes, ExTimerType, diff --git a/reactos/ntoskrnl/nt/plugplay.c b/reactos/ntoskrnl/nt/plugplay.c index ab5efda1216..aae5a53ed2d 100644 --- a/reactos/ntoskrnl/nt/plugplay.c +++ b/reactos/ntoskrnl/nt/plugplay.c @@ -10,12 +10,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS STDCALL NtGetPlugPlayEvent(VOID) diff --git a/reactos/ntoskrnl/nt/profile.c b/reactos/ntoskrnl/nt/profile.c index afc7093fc91..12ff5548fa9 100644 --- a/reactos/ntoskrnl/nt/profile.c +++ b/reactos/ntoskrnl/nt/profile.c @@ -27,12 +27,15 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include -#define NDEBUG #include - /* TYPES ********************************************************************/ typedef struct _KPROCESS_PROFILE @@ -89,7 +92,7 @@ typedef struct _KPROFILE /* GLOBALS *******************************************************************/ -POBJECT_TYPE ExProfileObjectType = NULL; +POBJECT_TYPE EXPORTED ExProfileObjectType = NULL; static GENERIC_MAPPING ExpProfileMapping = { STANDARD_RIGHTS_READ, @@ -454,7 +457,7 @@ NtCreateProfile(OUT PHANDLE UnsafeProfileHandle, /* * Create the object */ - Status = ObRosCreateObject(&ProfileHandle, + Status = ObCreateObject(&ProfileHandle, STANDARD_RIGHTS_ALL, NULL, ExProfileObjectType, diff --git a/reactos/ntoskrnl/nt/vdm.c b/reactos/ntoskrnl/nt/vdm.c index eb46b8a1408..59630a2c777 100644 --- a/reactos/ntoskrnl/nt/vdm.c +++ b/reactos/ntoskrnl/nt/vdm.c @@ -10,12 +10,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* GLOBALS *******************************************************************/ static UCHAR OrigIVT[1024]; @@ -35,9 +33,8 @@ NtEarlyInitVdm(VOID) memcpy(OrigBDA, (PVOID)0x400, 256); } -NTSTATUS STDCALL -NtVdmControl(IN ULONG ControlCode, - IN PVOID ControlData) +NTSTATUS STDCALL NtVdmControl(ULONG ControlCode, + PVOID ControlData) { switch (ControlCode) { diff --git a/reactos/ntoskrnl/ntoskrnl.def b/reactos/ntoskrnl/ntoskrnl.def index 62574de4b16..af3c4641a69 100644 --- a/reactos/ntoskrnl/ntoskrnl.def +++ b/reactos/ntoskrnl/ntoskrnl.def @@ -1,4 +1,4 @@ -; $Id: ntoskrnl.def,v 1.142 2002/09/07 15:12:47 chorns Exp $ +; $Id: ntoskrnl.def,v 1.143 2002/09/08 10:23:15 chorns Exp $ ; ; reactos/ntoskrnl/ntoskrnl.def ; @@ -29,7 +29,6 @@ ExAcquireResourceExclusiveLite@8 ExAcquireResourceSharedLite@8 ExAcquireSharedStarveExclusive@8 ExAcquireSharedWaitForExclusive@8 -ExAllocateFromNPagedLookasideList@4 ExAllocateFromPagedLookasideList@4 ExAllocatePool@8 ExAllocatePoolWithQuota@8 @@ -46,7 +45,6 @@ ExDisableResourceBoostLite@4 ExEventObjectType DATA ExExtendZone@12 ExFreePool@4 -ExFreeToNPagedLookasideList@8 ExFreeToPagedLookasideList@8 ExGetExclusiveWaiterCount@4 ExGetPreviousMode@0 @@ -58,19 +56,19 @@ ExInitializeResourceLite@4 ExInitializeZone@16 ExInterlockedAddLargeInteger@16 @ExInterlockedAddLargeStatistic@8 -@ExInterlockedAddUlong@12 +ExInterlockedAddUlong@12 @ExInterlockedCompareExchange64@16 ExInterlockedDecrementLong@8 ExInterlockedExchangeUlong@12 ExInterlockedExtendZone@16 ExInterlockedIncrementLong@8 -@ExInterlockedInsertHeadList@12 -@ExInterlockedInsertTailList@12 -@ExInterlockedPopEntryList@8 +ExInterlockedInsertHeadList@12 +ExInterlockedInsertTailList@12 +ExInterlockedPopEntryList@8 @ExInterlockedPopEntrySList@8 -@ExInterlockedPushEntryList@12 +ExInterlockedPushEntryList@12 @ExInterlockedPushEntrySList@12 -@ExInterlockedRemoveHeadList@8 +ExInterlockedRemoveHeadList@8 ExIsProcessorFeaturePresent@4 ExIsResourceAcquiredExclusiveLite@4 ExIsResourceAcquiredSharedLite@4 @@ -219,8 +217,6 @@ HalPrivateDispatchTable DATA @InterlockedExchange@8 @InterlockedExchangeAdd@8 @InterlockedIncrement@4 -@InterlockedPopEntrySList@4 -@InterlockedPushEntrySList@8 IoAcquireCancelSpinLock@4 IoAcquireRemoveLockEx@20 IoAcquireVpbSpinLock@4 @@ -451,8 +447,8 @@ KeTickCount DATA KeWaitForMultipleObjects@32 KeWaitForMutexObject@20 KeWaitForSingleObject@20 -@KefAcquireSpinLockAtDpcLevel@4 -@KefReleaseSpinLockFromDpcLevel@4 +;@KefAcquireSpinLockAtDpcLevel +;@KefReleaseSpinLockFromDpcLevel ;Kei386EoiHelper ;@KiAcquireSpinLock@4 ;KiBugCheckData DATA @@ -531,11 +527,11 @@ NlsLeadByteInfo DATA NlsMbCodePageTag DATA NlsMbOemCodePageTag DATA NlsOemLeadByteInfo DATA -NtAddAtom@12 +NtAddAtom@8 NtAdjustPrivilegesToken@24 NtAlertThread@4 NtAllocateLocallyUniqueId@4 -NtAllocateUuids@16 +NtAllocateUuids@12 NtAllocateVirtualMemory@24 NtBuildNumber DATA NtClose@4 @@ -550,7 +546,7 @@ NtDeleteFile@4 NtDeviceIoControlFile@40 NtDuplicateObject@28 NtDuplicateToken@24 -NtFindAtom@12 +NtFindAtom@8 NtFreeVirtualMemory@16 NtFsControlFile@40 NtGlobalFlag DATA @@ -588,7 +584,7 @@ ObAssignSecurity@16 ;ObCheckCreateObjectAccess@28 ;ObCheckObjectAccess@20 ;ObCreateObject@36 -ObRosCreateObject@20 +ObCreateObject@20 ;ObFindHandleForObject@20 ObGetObjectPointerCount@4 ObGetObjectSecurity@12 diff --git a/reactos/ntoskrnl/ntoskrnl.edf b/reactos/ntoskrnl/ntoskrnl.edf index a03ed05c9a4..b0524e3aba8 100644 --- a/reactos/ntoskrnl/ntoskrnl.edf +++ b/reactos/ntoskrnl/ntoskrnl.edf @@ -1,4 +1,4 @@ -; $Id: ntoskrnl.edf,v 1.128 2002/09/07 15:12:47 chorns Exp $ +; $Id: ntoskrnl.edf,v 1.129 2002/09/08 10:23:15 chorns Exp $ ; ; reactos/ntoskrnl/ntoskrnl.def ; @@ -29,8 +29,7 @@ ExAcquireResourceExclusiveLite=ExAcquireResourceExclusiveLite@8 ExAcquireResourceSharedLite=ExAcquireResourceSharedLite@8 ExAcquireSharedStarveExclusive=ExAcquireSharedStarveExclusive@8 ExAcquireSharedWaitForExclusive=ExAcquireSharedWaitForExclusive@8 -ExAllocateFromNPagedLookasideList=ExiAllocateFromNPagedLookasideList@4 -ExAllocateFromPagedLookasideList=ExiAllocateFromPagedLookasideList@4 +ExAllocateFromPagedLookasideList=ExAllocateFromPagedLookasideList@4 ExAllocatePool=ExAllocatePool@8 ExAllocatePoolWithQuota=ExAllocatePoolWithQuota@8 ExAllocatePoolWithQuotaTag=ExAllocatePoolWithQuotaTag@12 @@ -46,8 +45,7 @@ ExDisableResourceBoostLite=ExDisableResourceBoostLite@4 ExEventObjectType DATA ExExtendZone=ExExtendZone@12 ExFreePool=ExFreePool@4 -ExFreeToNPagedLookasideList=ExiFreeToNPagedLookasideList@8 -ExFreeToPagedLookasideList=ExiFreeToPagedLookasideList@8 +ExFreeToPagedLookasideList=ExFreeToPagedLookasideList@8 ExGetExclusiveWaiterCount=ExGetExclusiveWaiterCount@4 ExGetPreviousMode=ExGetPreviousMode@0 ExGetSharedWaiterCount=ExGetSharedWaiterCount@4 @@ -58,19 +56,19 @@ ExInitializeResourceLite=ExInitializeResourceLite@4 ExInitializeZone=ExInitializeZone@16 ExInterlockedAddLargeInteger=ExInterlockedAddLargeInteger@16 ExInterlockedAddLargeStatistic=@ExInterlockedAddLargeStatistic@8 -ExInterlockedAddUlong=@ExInterlockedAddUlong@12 +ExInterlockedAddUlong=ExInterlockedAddUlong@12 ExInterlockedCompareExchange64=@ExInterlockedCompareExchange64@16 ExInterlockedDecrementLong=ExInterlockedDecrementLong@8 ExInterlockedExchangeUlong=ExInterlockedExchangeUlong@12 ExInterlockedExtendZone=ExInterlockedExtendZone@16 ExInterlockedIncrementLong=ExInterlockedIncrementLong@8 -ExInterlockedInsertHeadList=@ExInterlockedInsertHeadList@12 -ExInterlockedInsertTailList=@ExInterlockedInsertTailList@12 -ExInterlockedPopEntryList=@ExInterlockedPopEntryList@8 +ExInterlockedInsertHeadList=ExInterlockedInsertHeadList@12 +ExInterlockedInsertTailList=ExInterlockedInsertTailList@12 +ExInterlockedPopEntryList=ExInterlockedPopEntryList@8 ExInterlockedPopEntrySList=@ExInterlockedPopEntrySList@8 -ExInterlockedPushEntryList=@ExInterlockedPushEntryList@12 +ExInterlockedPushEntryList=ExInterlockedPushEntryList@12 ExInterlockedPushEntrySList=@ExInterlockedPushEntrySList@12 -ExInterlockedRemoveHeadList=@ExInterlockedRemoveHeadList@8 +ExInterlockedRemoveHeadList=ExInterlockedRemoveHeadList@8 ExIsProcessorFeaturePresent=ExIsProcessorFeaturePresent@4 ExIsResourceAcquiredExclusiveLite=ExIsResourceAcquiredExclusiveLite@4 ExIsResourceAcquiredSharedLite=ExIsResourceAcquiredSharedLite@4 @@ -219,8 +217,6 @@ InterlockedDecrement=@InterlockedDecrement@4 InterlockedExchange=@InterlockedExchange@8 InterlockedExchangeAdd=@InterlockedExchangeAdd@8 InterlockedIncrement=@InterlockedIncrement@4 -InterlockedPopEntrySList=@InterlockedPopEntrySList@4 -InterlockedPushEntrySList=@InterlockedPushEntrySList@8 IoAcquireCancelSpinLock=IoAcquireCancelSpinLock@4 IoAcquireVpbSpinLock=IoAcquireVpbSpinLock@4 IoAdapterObjectType DATA @@ -450,8 +446,8 @@ KeTickCount DATA KeWaitForMultipleObjects=KeWaitForMultipleObjects@32 KeWaitForMutexObject=KeWaitForMutexObject@20 KeWaitForSingleObject=KeWaitForSingleObject@20 -@KefAcquireSpinLockAtDpcLevel@4 -@KefReleaseSpinLockFromDpcLevel@4 +;KefAcquireSpinLockAtDpcLevel +;KefReleaseSpinLockFromDpcLevel ;Kei386EoiHelper ;KiAcquireSpinLock@4 ;KiBugCheckData DATA @@ -530,11 +526,11 @@ NlsLeadByteInfo DATA NlsMbCodePageTag DATA NlsMbOemCodePageTag DATA NlsOemLeadByteInfo DATA -NtAddAtom=NtAddAtom@12 +NtAddAtom=NtAddAtom@8 NtAdjustPrivilegesToken=NtAdjustPrivilegesToken@24 NtAlertThread=NtAlertThread@4 NtAllocateLocallyUniqueId=NtAllocateLocallyUniqueId@4 -NtAllocateUuids=NtAllocateUuids@16 +NtAllocateUuids=NtAllocateUuids@12 NtAllocateVirtualMemory=NtAllocateVirtualMemory@24 NtBuildNumber DATA NtClose=NtClose@4 @@ -549,7 +545,7 @@ NtDeleteFile=NtDeleteFile@4 NtDeviceIoControlFile=NtDeviceIoControlFile@40 NtDuplicateObject=NtDuplicateObject@28 NtDuplicateToken=NtDuplicateToken@24 -NtFindAtom=NtFindAtom@12 +NtFindAtom=NtFindAtom@8 NtFreeVirtualMemory=NtFreeVirtualMemory@16 NtFsControlFile=NtFsControlFile@40 NtGlobalFlag DATA @@ -587,7 +583,7 @@ ObAssignSecurity=ObAssignSecurity@16 ;ObCheckCreateObjectAccess=ObCheckCreateObjectAccess@28 ;ObCheckObjectAccess=ObCheckObjectAccess@20 ;ObCreateObject=ObCreateObject@36 -ObRosCreateObject=ObRosCreateObject@20 +ObCreateObject=ObCreateObject@20 ;ObFindHandleForObject=ObFindHandleForObject@20 ObGetObjectPointerCount=ObGetObjectPointerCount@4 ObGetObjectSecurity=ObGetObjectSecurity@12 diff --git a/reactos/ntoskrnl/ntoskrnl.rc b/reactos/ntoskrnl/ntoskrnl.rc index 4ae2310a4d8..2d6864ded17 100644 --- a/reactos/ntoskrnl/ntoskrnl.rc +++ b/reactos/ntoskrnl/ntoskrnl.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/ntoskrnl/ob/dirobj.c b/reactos/ntoskrnl/ob/dirobj.c index 8ebc52bb57f..92e7d10850d 100644 --- a/reactos/ntoskrnl/ob/dirobj.c +++ b/reactos/ntoskrnl/ob/dirobj.c @@ -1,4 +1,4 @@ -/* $Id: dirobj.c,v 1.15 2002/09/07 15:13:04 chorns Exp $ +/* $Id: dirobj.c,v 1.16 2002/09/08 10:23:38 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,7 +11,9 @@ /* INCLUDES ***************************************************************/ -#include +#include +#include +#include #define NDEBUG #include @@ -49,6 +51,7 @@ NTSTATUS STDCALL NtOpenDirectoryObject(PHANDLE DirectoryHandle, { PVOID Object; NTSTATUS Status; + *DirectoryHandle = 0; Status = ObReferenceObjectByName(ObjectAttributes->ObjectName, @@ -63,6 +66,7 @@ NTSTATUS STDCALL NtOpenDirectoryObject(PHANDLE DirectoryHandle, { return Status; } + Status = ObCreateHandle(PsGetCurrentProcess(), Object, DesiredAccess, @@ -334,7 +338,7 @@ NtCreateDirectoryObject(PHANDLE DirectoryHandle, DirectoryHandle, DesiredAccess, ObjectAttributes, ObjectAttributes->ObjectName); - return(ObRosCreateObject(DirectoryHandle, + return(ObCreateObject(DirectoryHandle, DesiredAccess, ObjectAttributes, ObDirectoryType, diff --git a/reactos/ntoskrnl/ob/handle.c b/reactos/ntoskrnl/ob/handle.c index 9819a14080e..21710ec171d 100644 --- a/reactos/ntoskrnl/ob/handle.c +++ b/reactos/ntoskrnl/ob/handle.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: handle.c,v 1.39 2002/09/07 15:13:04 chorns Exp $ +/* $Id: handle.c,v 1.40 2002/09/08 10:23:39 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -29,12 +29,15 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* TYPES *******************************************************************/ /* @@ -47,7 +50,7 @@ typedef struct BOOLEAN Inherit; } HANDLE_REP, *PHANDLE_REP; -#define HANDLE_BLOCK_ENTRIES ((PAGE_SIZE-sizeof(LIST_ENTRY))/sizeof(HANDLE_REP)) +#define HANDLE_BLOCK_ENTRIES ((PAGESIZE-sizeof(LIST_ENTRY))/sizeof(HANDLE_REP)) /* @@ -67,7 +70,7 @@ typedef struct /* FUNCTIONS ***************************************************************/ -static PHANDLE_REP ObpGetObjectByHandle(PROS_HANDLE_TABLE HandleTable, HANDLE h) +static PHANDLE_REP ObpGetObjectByHandle(PHANDLE_TABLE HandleTable, HANDLE h) /* * FUNCTION: Get the data structure for a handle * ARGUMENTS: @@ -154,9 +157,9 @@ NTSTATUS STDCALL NtDuplicateObject (IN HANDLE SourceProcessHandle, IN HANDLE SourceHandle, IN HANDLE TargetProcessHandle, - OUT PHANDLE UnsafeTargetHandle OPTIONAL, + OUT PHANDLE UnsafeTargetHandle, IN ACCESS_MASK DesiredAccess, - IN ULONG Attributes, + IN BOOLEAN InheritHandle, ULONG Options) /* * FUNCTION: Copies a handle from one process space to another @@ -170,7 +173,8 @@ NtDuplicateObject (IN HANDLE SourceProcessHandle, * TargetHandle (OUT) = Caller should supply storage for the * duplicated handle. * DesiredAccess = The desired access to the handle. - * Attritbutes = Attributes. Eg. inheritable. + * InheritHandle = Indicates wheter the new handle will be inheritable + * or not. * Options = Specifies special actions upon duplicating the handle. * Can be one of the values DUPLICATE_CLOSE_SOURCE | * DUPLICATE_SAME_ACCESS. DUPLICATE_CLOSE_SOURCE specifies @@ -245,7 +249,7 @@ NtDuplicateObject (IN HANDLE SourceProcessHandle, ObCreateHandle(TargetProcess, ObjectBody, DesiredAccess, - Attributes & HANDLE_FLAG_INHERIT, + InheritHandle, &TargetHandle); if (Options & DUPLICATE_CLOSE_SOURCE) @@ -269,7 +273,7 @@ NtDuplicateObject (IN HANDLE SourceProcessHandle, VOID ObCloseAllHandles(PEPROCESS Process) { KIRQL oldIrql; - PROS_HANDLE_TABLE HandleTable; + PHANDLE_TABLE HandleTable; PLIST_ENTRY current_entry; PHANDLE_BLOCK current; ULONG i; @@ -339,7 +343,7 @@ VOID ObDeleteHandleTable(PEPROCESS Process) */ { PLIST_ENTRY current = NULL; - PROS_HANDLE_TABLE HandleTable = NULL; + PHANDLE_TABLE HandleTable = NULL; ObCloseAllHandles(Process); @@ -370,7 +374,7 @@ VOID ObCreateHandleTable(PEPROCESS Parent, * Process = Process whose handle table is to be created */ { - PROS_HANDLE_TABLE ParentHandleTable, HandleTable; + PHANDLE_TABLE ParentHandleTable, HandleTable; KIRQL oldIrql; PLIST_ENTRY parent_current; ULONG i; @@ -435,7 +439,7 @@ PVOID ObDeleteHandle(PEPROCESS Process, HANDLE Handle) PHANDLE_REP Rep; PVOID ObjectBody; KIRQL oldIrql; - PROS_HANDLE_TABLE HandleTable; + PHANDLE_TABLE HandleTable; POBJECT_HEADER Header; DPRINT("ObDeleteHandle(Handle %x)\n",Handle); @@ -498,7 +502,7 @@ NTSTATUS ObCreateHandle(PEPROCESS Process, unsigned int handle=1; unsigned int i; HANDLE_BLOCK* new_blk = NULL; - PROS_HANDLE_TABLE HandleTable; + PHANDLE_TABLE HandleTable; KIRQL oldlvl; DPRINT("ObCreateHandle(Process %x, obj %x)\n",Process,ObjectBody); diff --git a/reactos/ntoskrnl/ob/namespc.c b/reactos/ntoskrnl/ob/namespc.c index 85ac3f3ccf6..4ffecc4a7b1 100644 --- a/reactos/ntoskrnl/ob/namespc.c +++ b/reactos/ntoskrnl/ob/namespc.c @@ -1,4 +1,4 @@ -/* $Id: namespc.c,v 1.33 2002/09/07 15:13:04 chorns Exp $ +/* $Id: namespc.c,v 1.34 2002/09/08 10:23:39 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,15 @@ /* INCLUDES ***************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS ****************************************************************/ POBJECT_TYPE ObDirectoryType = NULL; @@ -380,7 +383,7 @@ ObInit(VOID) L"ObjectType"); /* create root directory */ - ObRosCreateObject(NULL, + ObCreateObject(NULL, STANDARD_RIGHTS_REQUIRED, NULL, ObDirectoryType, @@ -394,7 +397,7 @@ ObInit(VOID) OBJ_PERMANENT, NULL, NULL); - ObRosCreateObject(NULL, + ObCreateObject(NULL, STANDARD_RIGHTS_REQUIRED, &ObjectAttributes, ObDirectoryType, @@ -425,7 +428,7 @@ ObpCreateTypeObject(POBJECT_TYPE ObjectType) OBJ_PERMANENT, NULL, NULL); - Status = ObRosCreateObject(NULL, + Status = ObCreateObject(NULL, STANDARD_RIGHTS_REQUIRED, &ObjectAttributes, ObTypeObjectType, diff --git a/reactos/ntoskrnl/ob/ntobj.c b/reactos/ntoskrnl/ob/ntobj.c index 749ebcf01b8..6c6fead6e2e 100644 --- a/reactos/ntoskrnl/ob/ntobj.c +++ b/reactos/ntoskrnl/ob/ntobj.c @@ -1,4 +1,4 @@ -/* $Id: ntobj.c,v 1.10 2002/09/07 15:13:04 chorns Exp $ +/* $Id: ntobj.c,v 1.11 2002/09/08 10:23:39 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS ************************************************************/ NTSTATUS @@ -80,7 +81,7 @@ NtQueryObject ( the different object types*/ { POBJECT_NAME_INFORMATION nameinfo; - PROS_OBJECT_TYPE_INFORMATION typeinfo; + POBJECT_TYPE_INFORMATION typeinfo; PFILE_NAME_INFORMATION filenameinfo; PVOID Object; NTSTATUS Status; @@ -136,8 +137,8 @@ NtQueryObject ( ObDereferenceObject(Object); return STATUS_NOT_IMPLEMENTED; case ObjectTypeInformation: - typeinfo = (PROS_OBJECT_TYPE_INFORMATION)ObjectInformation; - if (Length!=sizeof(ROS_OBJECT_TYPE_INFORMATION)) return STATUS_INVALID_BUFFER_SIZE; + typeinfo = (POBJECT_TYPE_INFORMATION)ObjectInformation; + if (Length!=sizeof(OBJECT_TYPE_INFORMATION)) return STATUS_INVALID_BUFFER_SIZE; // FIXME: Is this supposed to only be the header's Name field? // Can somebody check/verify this? diff --git a/reactos/ntoskrnl/ob/object.c b/reactos/ntoskrnl/ob/object.c index ca9ed478e84..07801849e00 100644 --- a/reactos/ntoskrnl/ob/object.c +++ b/reactos/ntoskrnl/ob/object.c @@ -1,4 +1,4 @@ -/* $Id: object.c,v 1.55 2002/09/07 15:13:04 chorns Exp $ +/* $Id: object.c,v 1.56 2002/09/08 10:23:39 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,16 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS ************************************************************/ PVOID HEADER_TO_BODY(POBJECT_HEADER obj) @@ -213,7 +217,7 @@ NTSTATUS ObFindObject(POBJECT_ATTRIBUTES ObjectAttributes, /********************************************************************** * NAME EXPORTED - * ObRosCreateObject@36 + * ObCreateObject@36 * * DESCRIPTION * @@ -222,7 +226,7 @@ NTSTATUS ObFindObject(POBJECT_ATTRIBUTES ObjectAttributes, * RETURN VALUE */ NTSTATUS STDCALL -ObRosCreateObject(OUT PHANDLE Handle, +ObCreateObject(OUT PHANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN POBJECT_TYPE Type, @@ -237,7 +241,7 @@ ObRosCreateObject(OUT PHANDLE Handle, assert_irql(APC_LEVEL); - DPRINT("ObRosCreateObject(Handle %x, ObjectAttributes %x, Type %x)\n", + DPRINT("ObCreateObject(Handle %x, ObjectAttributes %x, Type %x)\n", Handle, ObjectAttributes, Type); if (ObjectAttributes != NULL && @@ -261,6 +265,7 @@ ObRosCreateObject(OUT PHANDLE Handle, RtlMapGenericMask(&DesiredAccess, Type->Mapping); + Header = (POBJECT_HEADER)ExAllocatePoolWithTag(NonPagedPool, OBJECT_ALLOC_SIZE(Type), Type->Tag); diff --git a/reactos/ntoskrnl/ob/security.c b/reactos/ntoskrnl/ob/security.c index ee131946d73..cef5182186b 100644 --- a/reactos/ntoskrnl/ob/security.c +++ b/reactos/ntoskrnl/ob/security.c @@ -10,12 +10,11 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include - /* FUNCTIONS ***************************************************************/ NTSTATUS STDCALL @@ -46,18 +45,18 @@ ObReleaseObjectSecurity(IN PSECURITY_DESCRIPTOR SecurityDescriptor, NTSTATUS STDCALL -NtQuerySecurityObject(IN HANDLE Handle, - IN SECURITY_INFORMATION SecurityInformation, - OUT PSECURITY_DESCRIPTOR SecurityDescriptor, - IN ULONG SecurityDescriptorLength, - OUT PULONG ReturnLength) +NtQuerySecurityObject(IN HANDLE ObjectHandle, + IN CINT SecurityObjectInformationClass, + OUT PVOID SecurityObjectInformation, + IN ULONG Length, + OUT PULONG ReturnLength) { NTSTATUS Status; PVOID Object; OBJECT_HANDLE_INFORMATION HandleInfo; POBJECT_HEADER Header; - Status = ObReferenceObjectByHandle(Handle, + Status = ObReferenceObjectByHandle(ObjectHandle, 0, NULL, KeGetPreviousMode(), @@ -73,10 +72,10 @@ NtQuerySecurityObject(IN HANDLE Handle, Header->ObjectType->Security != NULL) { Status = Header->ObjectType->Security(Object, - SecurityInformation, - SecurityDescriptor, - &SecurityDescriptorLength); - *ReturnLength = SecurityDescriptorLength; + SecurityObjectInformationClass, + SecurityObjectInformation, + &Length); + *ReturnLength = Length; } else { diff --git a/reactos/ntoskrnl/po/power.c b/reactos/ntoskrnl/po/power.c index 801099189d4..aa50de6123a 100644 --- a/reactos/ntoskrnl/po/power.c +++ b/reactos/ntoskrnl/po/power.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: power.c,v 1.5 2002/09/07 15:13:04 chorns Exp $ +/* $Id: power.c,v 1.6 2002/09/08 10:23:39 chorns Exp $ * PROJECT: ReactOS kernel * FILE: ntoskrnl/po/power.c * PURPOSE: Power Manager @@ -25,8 +25,10 @@ * 20/08/1999 EA Created * 16/04/2001 CSH Stubs added */ - -#include +#include +#include +#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/ps/create.c b/reactos/ntoskrnl/ps/create.c index 05f5d5a1c73..5387eab3206 100644 --- a/reactos/ntoskrnl/ps/create.c +++ b/reactos/ntoskrnl/ps/create.c @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.52 2002/09/07 15:13:05 chorns Exp $ +/* $Id: create.c,v 1.53 2002/09/08 10:23:39 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -20,12 +20,18 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBAL *******************************************************************/ static ULONG PiNextThreadUniqueId = 0; @@ -47,7 +53,7 @@ NTSTATUS STDCALL PsAssignImpersonationToken(PETHREAD Thread, HANDLE TokenHandle) { - PIACCESS_TOKEN Token; + PACCESS_TOKEN Token; SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; NTSTATUS Status; @@ -100,13 +106,11 @@ PsRevertToSelf(VOID) VOID STDCALL PsImpersonateClient(PETHREAD Thread, PACCESS_TOKEN Token, - BOOLEAN CopyOnUse, - BOOLEAN EffectiveOnly, + UCHAR b, + UCHAR c, SECURITY_IMPERSONATION_LEVEL Level) { - PIACCESS_TOKEN iToken = (PIACCESS_TOKEN)Token; - - if (iToken == 0) + if (Token == 0) { if (Thread->ActiveImpersonationInfo != 0) { @@ -122,43 +126,43 @@ PsImpersonateClient(PETHREAD Thread, Thread->ImpersonationInfo == NULL) { Thread->ImpersonationInfo = ExAllocatePool(NonPagedPool, - sizeof(PS_IMPERSONATION_INFORMATION)); + sizeof(PS_IMPERSONATION_INFO)); } - Thread->ImpersonationInfo->ImpersonationLevel = Level; - Thread->ImpersonationInfo->CopyOnOpen = CopyOnUse; - Thread->ImpersonationInfo->EffectiveOnly = EffectiveOnly; - Thread->ImpersonationInfo->Token = iToken; - ObReferenceObjectByPointer(iToken, + Thread->ImpersonationInfo->Level = Level; + Thread->ImpersonationInfo->Unknown2 = c; + Thread->ImpersonationInfo->Unknown1 = b; + Thread->ImpersonationInfo->Token = Token; + ObReferenceObjectByPointer(Token, 0, SepTokenObjectType, KernelMode); Thread->ActiveImpersonationInfo = 1; } -PIACCESS_TOKEN +PACCESS_TOKEN PsReferenceEffectiveToken(PETHREAD Thread, PTOKEN_TYPE TokenType, - PBOOLEAN EffectiveOnly, + PUCHAR b, PSECURITY_IMPERSONATION_LEVEL Level) { PEPROCESS Process; - PIACCESS_TOKEN iToken; + PACCESS_TOKEN Token; if (Thread->ActiveImpersonationInfo == 0) { Process = Thread->ThreadsProcess; *TokenType = TokenPrimary; - *EffectiveOnly = 0; - iToken = Process->Token; + *b = 0; + Token = Process->Token; } else { - iToken = Thread->ImpersonationInfo->Token; + Token = Thread->ImpersonationInfo->Token; *TokenType = TokenImpersonation; - *EffectiveOnly = Thread->ImpersonationInfo->EffectiveOnly; - *Level = Thread->ImpersonationInfo->ImpersonationLevel; + *b = Thread->ImpersonationInfo->Unknown2; + *Level = Thread->ImpersonationInfo->Level; } - return(iToken); + return(Token); } NTSTATUS STDCALL @@ -206,9 +210,9 @@ NtImpersonateThread(IN HANDLE ThreadHandle, } SeImpersonateClient(&ClientContext, Thread); - if (ClientContext.ClientToken != NULL) + if (ClientContext.Token != NULL) { - ObDereferenceObject(ClientContext.ClientToken); + ObDereferenceObject(ClientContext.Token); } return(STATUS_SUCCESS); } @@ -242,24 +246,24 @@ NtOpenThreadToken(IN HANDLE ThreadHandle, } PACCESS_TOKEN STDCALL -PsReferenceImpersonationToken(IN PETHREAD Thread, - OUT PBOOLEAN CopyOnUse, - OUT PBOOLEAN EffectiveOnly, - OUT PSECURITY_IMPERSONATION_LEVEL Level) +PsReferenceImpersonationToken(PETHREAD Thread, + PULONG Unknown1, + PULONG Unknown2, + SECURITY_IMPERSONATION_LEVEL* Level) { if (Thread->ActiveImpersonationInfo == 0) { return(NULL); } - *Level = Thread->ImpersonationInfo->ImpersonationLevel; - *CopyOnUse = Thread->ImpersonationInfo->CopyOnOpen; - *EffectiveOnly = Thread->ImpersonationInfo->EffectiveOnly; + *Level = Thread->ImpersonationInfo->Level; + *Unknown1 = Thread->ImpersonationInfo->Unknown1; + *Unknown2 = Thread->ImpersonationInfo->Unknown2; ObReferenceObjectByPointer(Thread->ImpersonationInfo->Token, TOKEN_ALL_ACCESS, SepTokenObjectType, KernelMode); - return((PACCESS_TOKEN)Thread->ImpersonationInfo->Token); + return(Thread->ImpersonationInfo->Token); } VOID @@ -341,7 +345,7 @@ PsInitializeThread(HANDLE ProcessHandle, /* * Create and initialize thread */ - Status = ObRosCreateObject(ThreadHandle, + Status = ObCreateObject(ThreadHandle, DesiredAccess, ThreadAttributes, PsThreadType, @@ -408,7 +412,7 @@ PsCreateTeb(HANDLE ProcessHandle, ULONG ResultLength; TebBase = (PVOID)0x7FFDE000; - TebSize = PAGE_SIZE; + TebSize = PAGESIZE; while (TRUE) { @@ -521,7 +525,7 @@ NtCreateThread(PHANDLE ThreadHandle, HANDLE ProcessHandle, PCLIENT_ID Client, PCONTEXT ThreadContext, - PINITIAL_TEB InitialTeb, /* MINGWFIXME: Change to PUSER_STACK */ + PINITIAL_TEB InitialTeb, BOOLEAN CreateSuspended) { PETHREAD Thread; diff --git a/reactos/ntoskrnl/ps/debug.c b/reactos/ntoskrnl/ps/debug.c index 13727888b12..71701f1f801 100644 --- a/reactos/ntoskrnl/ps/debug.c +++ b/reactos/ntoskrnl/ps/debug.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: debug.c,v 1.5 2002/09/07 15:13:05 chorns Exp $ +/* $Id: debug.c,v 1.6 2002/09/08 10:23:40 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ps/debug.c @@ -38,12 +38,16 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS ***************************************************************/ VOID diff --git a/reactos/ntoskrnl/ps/idle.c b/reactos/ntoskrnl/ps/idle.c index 49ae00818ec..f19ac148d4e 100644 --- a/reactos/ntoskrnl/ps/idle.c +++ b/reactos/ntoskrnl/ps/idle.c @@ -10,12 +10,13 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ HANDLE PsIdleThreadHandle = NULL; @@ -24,7 +25,7 @@ PETHREAD PiIdleThread; /* FUNCTIONS *****************************************************************/ -VOID STDCALL +NTSTATUS STDCALL PsIdleThreadMain(PVOID Context) { KIRQL oldlvl; @@ -46,7 +47,6 @@ VOID PsInitIdleThread(VOID) { KPRIORITY Priority; ULONG Affinity; - NTSTATUS Status; PsCreateSystemThread(&PsIdleThreadHandle, THREAD_ALL_ACCESS, @@ -55,20 +55,15 @@ VOID PsInitIdleThread(VOID) NULL, PsIdleThreadMain, NULL); - + Priority = LOW_PRIORITY; - Status = NtSetInformationThread(PsIdleThreadHandle, + NtSetInformationThread(PsIdleThreadHandle, ThreadPriority, &Priority, sizeof(Priority)); - assertmsg(NT_SUCCESS(Status), ("NtSetInformationThread() failed with " - "status 0x%.08x for ThreadPriority", Status)); - Affinity = 1 << 0; - Status = NtSetInformationThread(PsIdleThreadHandle, + NtSetInformationThread(PsIdleThreadHandle, ThreadAffinityMask, &Affinity, sizeof(Affinity)); - assertmsg(NT_SUCCESS(Status), ("NtSetInformationThread() failed with " - "status 0x%.08x for ThreadAffinityMask", Status)); } diff --git a/reactos/ntoskrnl/ps/kill.c b/reactos/ntoskrnl/ps/kill.c index fe8c1cd50bf..0a240cb811d 100644 --- a/reactos/ntoskrnl/ps/kill.c +++ b/reactos/ntoskrnl/ps/kill.c @@ -1,4 +1,4 @@ -/* $Id: kill.c,v 1.56 2002/09/07 15:13:05 chorns Exp $ +/* $Id: kill.c,v 1.57 2002/09/08 10:23:40 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,17 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ extern ULONG PiNrThreads; diff --git a/reactos/ntoskrnl/ps/locale.c b/reactos/ntoskrnl/ps/locale.c index ad9ccb78eaf..23f718b377a 100644 --- a/reactos/ntoskrnl/ps/locale.c +++ b/reactos/ntoskrnl/ps/locale.c @@ -1,4 +1,4 @@ -/* $Id: locale.c,v 1.3 2002/09/07 15:13:05 chorns Exp $ +/* $Id: locale.c,v 1.4 2002/09/08 10:23:40 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,7 +11,8 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/ps/process.c b/reactos/ntoskrnl/ps/process.c index 544d0007eea..2bac85702d2 100644 --- a/reactos/ntoskrnl/ps/process.c +++ b/reactos/ntoskrnl/ps/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.91 2002/09/07 15:13:05 chorns Exp $ +/* $Id: process.c,v 1.92 2002/09/08 10:23:40 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,18 +11,33 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS ******************************************************************/ -PEPROCESS PsInitialSystemProcess = NULL; +PEPROCESS EXPORTED PsInitialSystemProcess = NULL; HANDLE SystemProcessHandle = NULL; -POBJECT_TYPE PsProcessType = NULL; +POBJECT_TYPE EXPORTED PsProcessType = NULL; LIST_ENTRY PsProcessListHead; static KSPIN_LOCK PsProcessListLock; @@ -41,6 +56,7 @@ PiProcessNotifyRoutine[MAX_PROCESS_NOTIFY_ROUTINE_COUNT]; /* FUNCTIONS *****************************************************************/ + PEPROCESS PsGetNextProcess(PEPROCESS OldProcess) { @@ -56,7 +72,7 @@ PsGetNextProcess(PEPROCESS OldProcess) KeAcquireSpinLock(&PsProcessListLock, &oldIrql); if (OldProcess->ProcessListEntry.Flink == &PsProcessListHead) { - NextProcess = CONTAINING_RECORD (PsProcessListHead.Flink, + NextProcess = CONTAINING_RECORD(PsProcessListHead.Flink, EPROCESS, ProcessListEntry); } @@ -87,21 +103,21 @@ _NtOpenProcessToken(IN HANDLE ProcessHandle, IN ACCESS_MASK DesiredAccess, OUT PHANDLE TokenHandle) { - PIACCESS_TOKEN iToken; + PACCESS_TOKEN Token; NTSTATUS Status; Status = PsOpenTokenOfProcess(ProcessHandle, - &iToken); + &Token); if (!NT_SUCCESS(Status)) { return(Status); } Status = ObCreateHandle(PsGetCurrentProcess(), - iToken, + Token, DesiredAccess, FALSE, TokenHandle); - ObDereferenceObject(iToken); + ObDereferenceObject(Token); return(Status); } @@ -128,7 +144,7 @@ PsReferencePrimaryToken(PEPROCESS Process) NTSTATUS PsOpenTokenOfProcess(HANDLE ProcessHandle, - PIACCESS_TOKEN* Token) + PACCESS_TOKEN* Token) { PEPROCESS Process; NTSTATUS Status; @@ -216,7 +232,7 @@ PsInitProcessManagment(VOID) /* * Initialize the system process */ - Status = ObRosCreateObject(NULL, + Status = ObCreateObject(NULL, PROCESS_ALL_ACCESS, NULL, PsProcessType, @@ -253,12 +269,7 @@ PsInitProcessManagment(VOID) strcpy(PsInitialSystemProcess->ImageFileName, "SYSTEM"); - Status = SepCreateSystemProcessToken(PsInitialSystemProcess); - if (!NT_SUCCESS(Status)) - { - assertmsg(FALSE, ("SepCreateSystemProcessToken() failed with status 0x%.08x\n", Status)); - KeBugCheck(0); - } + SepCreateSystemProcessToken(PsInitialSystemProcess); ObCreateHandle(PsInitialSystemProcess, PsInitialSystemProcess, @@ -353,8 +364,6 @@ PsGetCurrentProcessId(VOID) return((HANDLE)PsGetCurrentProcess()->UniqueProcessId); } -#undef PsGetCurrentProcess - /* * FUNCTION: Returns a pointer to the current process */ @@ -452,7 +461,7 @@ NtCreateProcess(OUT PHANDLE ProcessHandle, return(Status); } - Status = ObRosCreateObject(ProcessHandle, + Status = ObCreateObject(ProcessHandle, DesiredAccess, ObjectAttributes, PsProcessType, @@ -460,7 +469,7 @@ NtCreateProcess(OUT PHANDLE ProcessHandle, if (!NT_SUCCESS(Status)) { ObDereferenceObject(ParentProcess); - DPRINT("ObRosCreateObject() = %x\n",Status); + DPRINT("ObCreateObject() = %x\n",Status); return(Status); } @@ -592,7 +601,7 @@ NtCreateProcess(OUT PHANDLE ProcessHandle, &Process->AddressSpace, MEMORY_AREA_SHARED_DATA, &BaseAddress, - PAGE_SIZE, + PAGESIZE, PAGE_READONLY, &MemoryArea, FALSE); @@ -787,10 +796,10 @@ NtOpenProcess(OUT PHANDLE ProcessHandle, NTSTATUS STDCALL NtQueryInformationProcess(IN HANDLE ProcessHandle, - IN PROCESSINFOCLASS ProcessInformationClass, + IN CINT ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, - OUT PULONG ReturnLength OPTIONAL) + OUT PULONG ReturnLength) { PEPROCESS Process; NTSTATUS Status; @@ -870,32 +879,32 @@ NTSTATUS PspAssignPrimaryToken(PEPROCESS Process, HANDLE TokenHandle) { - PIACCESS_TOKEN iToken; - PIACCESS_TOKEN OldToken; + PACCESS_TOKEN Token; + PACCESS_TOKEN OldToken; NTSTATUS Status; Status = ObReferenceObjectByHandle(TokenHandle, 0, SepTokenObjectType, UserMode, - (PVOID*)&iToken, + (PVOID*)&Token, NULL); if (!NT_SUCCESS(Status)) { return(Status); } - Status = SeExchangePrimaryToken(Process, iToken, &OldToken); + Status = SeExchangePrimaryToken(Process, Token, &OldToken); if (NT_SUCCESS(Status)) { ObDereferenceObject(OldToken); } - ObDereferenceObject(iToken); + ObDereferenceObject(Token); return(Status); } NTSTATUS STDCALL NtSetInformationProcess(IN HANDLE ProcessHandle, - IN PROCESSINFOCLASS ProcessInformationClass, + IN CINT ProcessInformationClass, IN PVOID ProcessInformation, IN ULONG ProcessInformationLength) { @@ -1177,10 +1186,12 @@ PiQuerySystemProcessInformation(PVOID Buffer, #endif } -ULONGLONG STDCALL +LARGE_INTEGER STDCALL PsGetProcessExitTime(VOID) { - return PsGetCurrentProcess()->ExitTime.QuadPart; + LARGE_INTEGER Li; + Li.QuadPart = PsGetCurrentProcess()->ExitTime.QuadPart; + return Li; } BOOLEAN STDCALL diff --git a/reactos/ntoskrnl/ps/psmgr.c b/reactos/ntoskrnl/ps/psmgr.c index 196db964812..464e86c23fd 100644 --- a/reactos/ntoskrnl/ps/psmgr.c +++ b/reactos/ntoskrnl/ps/psmgr.c @@ -1,4 +1,4 @@ -/* $Id: psmgr.c,v 1.13 2002/09/07 15:13:05 chorns Exp $ +/* $Id: psmgr.c,v 1.14 2002/09/08 10:23:40 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,12 +9,14 @@ /* INCLUDES **************************************************************/ -#include +#include +#include +#include +#include #define NDEBUG #include - /* FUNCTIONS ***************************************************************/ VOID PiShutdownProcessManager(VOID) diff --git a/reactos/ntoskrnl/ps/suspend.c b/reactos/ntoskrnl/ps/suspend.c index a9824d6e92f..ab6c843f090 100644 --- a/reactos/ntoskrnl/ps/suspend.c +++ b/reactos/ntoskrnl/ps/suspend.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: suspend.c,v 1.9 2002/09/07 15:13:05 chorns Exp $ +/* $Id: suspend.c,v 1.10 2002/09/08 10:23:40 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ps/suspend.c @@ -26,12 +26,15 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* NOTES ********************************************************************** * */ diff --git a/reactos/ntoskrnl/ps/thread.c b/reactos/ntoskrnl/ps/thread.c index 447d1062541..9456e1756c0 100644 --- a/reactos/ntoskrnl/ps/thread.c +++ b/reactos/ntoskrnl/ps/thread.c @@ -1,4 +1,4 @@ -/* $Id: thread.c,v 1.105 2002/09/07 15:13:05 chorns Exp $ +/* $Id: thread.c,v 1.106 2002/09/08 10:23:40 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -20,17 +20,23 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* TYPES *******************************************************************/ /* GLOBALS ******************************************************************/ -POBJECT_TYPE PsThreadType = NULL; +POBJECT_TYPE EXPORTED PsThreadType = NULL; KSPIN_LOCK PiThreadListLock; @@ -57,14 +63,12 @@ static GENERIC_MAPPING PiThreadMapping = {THREAD_READ, PKTHREAD STDCALL KeGetCurrentThread(VOID) { - return((PIKPCR)KeGetCurrentKPCR())->CurrentThread; + return(KeGetCurrentKPCR()->CurrentThread); } -#undef PsGetCurrentThread - PETHREAD STDCALL PsGetCurrentThread(VOID) { - PKTHREAD CurrentThread = ((PIKPCR)KeGetCurrentKPCR())->CurrentThread; + PKTHREAD CurrentThread = KeGetCurrentKPCR()->CurrentThread; return(CONTAINING_RECORD(CurrentThread, ETHREAD, Tcb)); } @@ -170,7 +174,7 @@ PiWakeupReaperThread(VOID) KeSetEvent(&PiReaperThreadEvent, 0, FALSE); } -VOID STDCALL +NTSTATUS STDCALL PiReaperThreadMain(PVOID Ignored) { while (1) @@ -193,7 +197,7 @@ VOID PsDispatchThreadNoLock (ULONG NewThreadStatus) KPRIORITY CurrentPriority; PETHREAD Candidate; ULONG Affinity; - PKTHREAD KCurrentThread = ((PIKPCR)KeGetCurrentKPCR())->CurrentThread; + PKTHREAD KCurrentThread = KeGetCurrentKPCR()->CurrentThread; PETHREAD CurrentThread = CONTAINING_RECORD(KCurrentThread, ETHREAD, Tcb); DPRINT("PsDispatchThread() %d/%d\n", KeGetCurrentProcessorNumber(), @@ -260,7 +264,7 @@ PsDispatchThread(ULONG NewThreadStatus) /* * Save wait IRQL */ - ((PIKPCR)KeGetCurrentKPCR())->CurrentThread->WaitIrql = oldIrql; + KeGetCurrentKPCR()->CurrentThread->WaitIrql = oldIrql; PsDispatchThreadNoLock(NewThreadStatus); KeLowerIrql(oldIrql); } @@ -285,7 +289,7 @@ PsBlockThread(PNTSTATUS Status, UCHAR Alertable, ULONG WaitMode, BOOLEAN DispatcherLock, KIRQL WaitIrql) { KIRQL oldIrql; - PKTHREAD KThread = ((PIKPCR)KeGetCurrentKPCR())->CurrentThread; + PKTHREAD KThread = KeGetCurrentKPCR()->CurrentThread; PETHREAD Thread = CONTAINING_RECORD (KThread, ETHREAD, Tcb); PKWAIT_BLOCK WaitBlock; @@ -362,7 +366,7 @@ PsFreezeAllThreads(PEPROCESS Process) VOID PsApplicationProcessorInit(VOID) { - ((PIKPCR)KeGetCurrentKPCR())->CurrentThread = + KeGetCurrentKPCR()->CurrentThread = (PVOID)IdleThreads[KeGetCurrentProcessorNumber()]; } @@ -435,7 +439,7 @@ PsInitThreadManagment(VOID) THREAD_ALL_ACCESS,NULL, TRUE); FirstThread->Tcb.State = THREAD_STATE_RUNNING; FirstThread->Tcb.FreezeCount = 0; - ((PIKPCR)KeGetCurrentKPCR())->CurrentThread = (PVOID)FirstThread; + KeGetCurrentKPCR()->CurrentThread = (PVOID)FirstThread; NtClose(FirstThreadHandle); DPRINT("FirstThread %x\n",FirstThread); diff --git a/reactos/ntoskrnl/ps/tinfo.c b/reactos/ntoskrnl/ps/tinfo.c index c5cb568ef33..cbb0dc5a8c8 100644 --- a/reactos/ntoskrnl/ps/tinfo.c +++ b/reactos/ntoskrnl/ps/tinfo.c @@ -1,4 +1,4 @@ -/* $Id: tinfo.c,v 1.18 2002/09/07 15:13:05 chorns Exp $ +/* $Id: tinfo.c,v 1.19 2002/09/08 10:23:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,11 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS STDCALL @@ -27,7 +26,7 @@ NtSetInformationThread(HANDLE ThreadHandle, { PETHREAD Thread; NTSTATUS Status; - + Status = ObReferenceObjectByHandle(ThreadHandle, THREAD_SET_INFORMATION, PsThreadType, @@ -193,8 +192,7 @@ NtQueryInformationThread (IN HANDLE ThreadHandle, } TBI->ExitStatus = Thread->ExitStatus; - /* MINGWFIXME: Use NT_TIB */ - TBI->TebBaseAddress = (PNT_TIB)Thread->Tcb.Teb; + TBI->TebBaseAddress = Thread->Tcb.Teb; TBI->ClientId = Thread->Cid; TBI->AffinityMask = Thread->Tcb.Affinity; TBI->Priority = Thread->Tcb.Priority; @@ -323,16 +321,16 @@ VOID KeSetPreviousMode(ULONG Mode) PsGetCurrentThread()->Tcb.PreviousMode = Mode; } -KPROCESSOR_MODE STDCALL +ULONG STDCALL KeGetPreviousMode (VOID) { - return PsGetCurrentThread()->Tcb.PreviousMode; + return (ULONG)PsGetCurrentThread()->Tcb.PreviousMode; } -KPROCESSOR_MODE STDCALL +ULONG STDCALL ExGetPreviousMode (VOID) { - return PsGetCurrentThread()->Tcb.PreviousMode; + return (ULONG)PsGetCurrentThread()->Tcb.PreviousMode; } /* EOF */ diff --git a/reactos/ntoskrnl/ps/w32call.c b/reactos/ntoskrnl/ps/w32call.c index ecd9a5e360e..53c03381589 100644 --- a/reactos/ntoskrnl/ps/w32call.c +++ b/reactos/ntoskrnl/ps/w32call.c @@ -1,4 +1,4 @@ -/* $Id: w32call.c,v 1.3 2002/09/07 15:13:05 chorns Exp $ +/* $Id: w32call.c,v 1.4 2002/09/08 10:23:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -20,7 +20,14 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include @@ -162,7 +169,7 @@ PsAllocateCallbackStack(ULONG StackSize) DPRINT("Failed to create thread stack\n"); return(NULL); } - for (i = 0; i < (StackSize / PAGE_SIZE); i++) + for (i = 0; i < (StackSize / PAGESIZE); i++) { PHYSICAL_ADDRESS Page; Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &Page); @@ -171,7 +178,7 @@ PsAllocateCallbackStack(ULONG StackSize) return(NULL); } Status = MmCreateVirtualMapping(NULL, - KernelStack + (i * PAGE_SIZE), + KernelStack + (i * PAGESIZE), PAGE_EXECUTE_READWRITE, Page, TRUE); diff --git a/reactos/ntoskrnl/ps/win32.c b/reactos/ntoskrnl/ps/win32.c index d93f8f9b2c0..accc180da58 100644 --- a/reactos/ntoskrnl/ps/win32.c +++ b/reactos/ntoskrnl/ps/win32.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: win32.c,v 1.4 2002/09/07 15:13:05 chorns Exp $ +/* $Id: win32.c,v 1.5 2002/09/08 10:23:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -29,11 +29,9 @@ /* INCLUDES ****************************************************************/ -#include - -#define NDEBUG -#include - +#include +#include +#include /* TYPES *******************************************************************/ diff --git a/reactos/ntoskrnl/rtl/atom.c b/reactos/ntoskrnl/rtl/atom.c index a6da5ca5ee3..a8732c37647 100644 --- a/reactos/ntoskrnl/rtl/atom.c +++ b/reactos/ntoskrnl/rtl/atom.c @@ -1,4 +1,4 @@ -/* $Id: atom.c,v 1.3 2002/09/07 15:13:05 chorns Exp $ +/* $Id: atom.c,v 1.4 2002/09/08 10:23:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,15 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include + typedef struct _RTL_ATOM_ENTRY { LIST_ENTRY List; @@ -63,14 +66,11 @@ static PRTL_ATOM_TABLE GlobalAtomTable = NULL; NTSTATUS STDCALL -NtAddAtom(IN PWSTR AtomName, - IN ULONG AtomNameLength, - OUT PRTL_ATOM Atom) +NtAddAtom(IN PWSTR AtomName, + OUT PRTL_ATOM Atom) { PRTL_ATOM_TABLE AtomTable; - /* FIXME: Use AtomNameLength information */ - AtomTable = RtlpGetGlobalAtomTable(); if (AtomTable == NULL) return STATUS_ACCESS_DENIED; @@ -96,14 +96,11 @@ NtDeleteAtom(IN RTL_ATOM Atom) NTSTATUS STDCALL -NtFindAtom(IN PWSTR AtomName, - IN ULONG AtomNameLength, - OUT PRTL_ATOM Atom) +NtFindAtom(IN PWSTR AtomName, + OUT PRTL_ATOM Atom) { PRTL_ATOM_TABLE AtomTable; - /* FIXME: Use AtomNameLength information */ - AtomTable = RtlpGetGlobalAtomTable(); if (AtomTable == NULL) return STATUS_ACCESS_DENIED; @@ -138,7 +135,7 @@ NtQueryInformationAtom(RTL_ATOM Atom, ReturnLength); break; - case AtomListInformation: + case AtomTableInformation: Status = RtlpQueryAtomTableInformation(AtomTable, Atom, AtomInformation, @@ -831,14 +828,14 @@ RtlpQueryAtomInformation(PRTL_ATOM_TABLE AtomTable, { NTSTATUS Status; ULONG UsageCount; - ULONG Pinned; + ULONG Flags; ULONG NameLength; NameLength = AtomInformationLength - sizeof(ATOM_BASIC_INFORMATION) + sizeof(WCHAR); Status = RtlQueryAtomInAtomTable(AtomTable, Atom, &UsageCount, - &Pinned, + &Flags, AtomInformation->Name, &NameLength); if (!NT_SUCCESS(Status)) @@ -858,8 +855,8 @@ RtlpQueryAtomInformation(PRTL_ATOM_TABLE AtomTable, return STATUS_BUFFER_TOO_SMALL; } - AtomInformation->ReferenceCount = (USHORT)UsageCount; - AtomInformation->Pinned = (USHORT)Pinned; + AtomInformation->UsageCount = (USHORT)UsageCount; + AtomInformation->Flags = (USHORT)Flags; AtomInformation->NameLength = (USHORT)NameLength; return STATUS_SUCCESS; diff --git a/reactos/ntoskrnl/rtl/bitmap.c b/reactos/ntoskrnl/rtl/bitmap.c index f961b125bd9..93627ce643f 100644 --- a/reactos/ntoskrnl/rtl/bitmap.c +++ b/reactos/ntoskrnl/rtl/bitmap.c @@ -1,4 +1,4 @@ -/* $Id: bitmap.c,v 1.3 2002/09/07 15:13:05 chorns Exp $ +/* $Id: bitmap.c,v 1.4 2002/09/08 10:23:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -8,10 +8,7 @@ * 20/08/99 Created by Eric Kohl */ -#include - -#define NDEBUG -#include +#include #define ALIGN(x,align) (((x)+(align)-1) / (align)) diff --git a/reactos/ntoskrnl/rtl/capture.c b/reactos/ntoskrnl/rtl/capture.c index 38e1fe517d3..eac181abe2e 100644 --- a/reactos/ntoskrnl/rtl/capture.c +++ b/reactos/ntoskrnl/rtl/capture.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: capture.c,v 1.3 2002/09/07 15:13:05 chorns Exp $ +/* $Id: capture.c,v 1.4 2002/09/08 10:23:41 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/rtl/capture.c @@ -28,12 +28,12 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS diff --git a/reactos/ntoskrnl/rtl/ctype.c b/reactos/ntoskrnl/rtl/ctype.c index c62784f4a4f..b38263fe894 100644 --- a/reactos/ntoskrnl/rtl/ctype.c +++ b/reactos/ntoskrnl/rtl/ctype.c @@ -1,4 +1,4 @@ -/* $Id: ctype.c,v 1.9 2002/09/07 15:13:05 chorns Exp $ +/* $Id: ctype.c,v 1.10 2002/09/08 10:23:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,10 +11,7 @@ * all functions to use ctype table */ -#include - -#define NDEBUG -#include +#include #undef _pctype diff --git a/reactos/ntoskrnl/rtl/dos8dot3.c b/reactos/ntoskrnl/rtl/dos8dot3.c index 0b5d38f1afb..4794b296b6b 100644 --- a/reactos/ntoskrnl/rtl/dos8dot3.c +++ b/reactos/ntoskrnl/rtl/dos8dot3.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dos8dot3.c,v 1.5 2002/09/07 15:13:05 chorns Exp $ +/* $Id: dos8dot3.c,v 1.6 2002/09/08 10:23:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -27,7 +27,8 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/rtl/error.c b/reactos/ntoskrnl/rtl/error.c index 5e69220fea2..8f5182d850a 100644 --- a/reactos/ntoskrnl/rtl/error.c +++ b/reactos/ntoskrnl/rtl/error.c @@ -1,4 +1,4 @@ -/* $Id: error.c,v 1.4 2002/09/07 15:13:05 chorns Exp $ +/* $Id: error.c,v 1.5 2002/09/08 10:23:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -19,12 +19,14 @@ /* INCLUDES *****************************************************************/ -#include -#include +#include +#include #define NDEBUG #include +#define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xFFFF)) +#define LOWORD(l) ((WORD)(l)) /* TYPES *******************************************************************/ diff --git a/reactos/ntoskrnl/rtl/handle.c b/reactos/ntoskrnl/rtl/handle.c index 40cf3cc820e..0ca76131dfe 100644 --- a/reactos/ntoskrnl/rtl/handle.c +++ b/reactos/ntoskrnl/rtl/handle.c @@ -1,4 +1,4 @@ -/* $Id: handle.c,v 1.2 2002/09/07 15:13:05 chorns Exp $ +/* $Id: handle.c,v 1.3 2002/09/08 10:23:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,7 +9,9 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/rtl/i386/memcpy.c b/reactos/ntoskrnl/rtl/i386/memcpy.c index 0089a43d539..631cf4a9a25 100644 --- a/reactos/ntoskrnl/rtl/i386/memcpy.c +++ b/reactos/ntoskrnl/rtl/i386/memcpy.c @@ -1,4 +1,4 @@ -/* $Id: memcpy.c,v 1.2 2002/09/07 15:13:06 chorns Exp $ +/* $Id: memcpy.c,v 1.3 2002/09/08 10:23:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,7 +9,7 @@ /* INCLUDES *****************************************************************/ -#include +#include #include #define NDEBUG diff --git a/reactos/ntoskrnl/rtl/i386/memset.c b/reactos/ntoskrnl/rtl/i386/memset.c index 22389030250..c39b8c442a5 100644 --- a/reactos/ntoskrnl/rtl/i386/memset.c +++ b/reactos/ntoskrnl/rtl/i386/memset.c @@ -1,4 +1,4 @@ -/* $Id: memset.c,v 1.2 2002/09/07 15:13:06 chorns Exp $ +/* $Id: memset.c,v 1.3 2002/09/08 10:23:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,7 +9,6 @@ /* INCLUDES *****************************************************************/ -#include #include #define NDEBUG diff --git a/reactos/ntoskrnl/rtl/largeint.c b/reactos/ntoskrnl/rtl/largeint.c index 7aecb5b9659..7d93b5009e9 100644 --- a/reactos/ntoskrnl/rtl/largeint.c +++ b/reactos/ntoskrnl/rtl/largeint.c @@ -1,4 +1,4 @@ -/* $Id: largeint.c,v 1.11 2002/09/07 15:13:05 chorns Exp $ +/* $Id: largeint.c,v 1.12 2002/09/08 10:23:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,7 +11,7 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/rtl/mem.c b/reactos/ntoskrnl/rtl/mem.c index 97e3a121465..80d1def2055 100644 --- a/reactos/ntoskrnl/rtl/mem.c +++ b/reactos/ntoskrnl/rtl/mem.c @@ -1,4 +1,4 @@ -/* $Id: mem.c,v 1.15 2002/09/07 15:13:05 chorns Exp $ +/* $Id: mem.c,v 1.16 2002/09/08 10:23:41 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ NTSTATUS STDCALL @@ -61,12 +61,13 @@ MmCopyFromCaller(PVOID Dest, PVOID Src, ULONG NumberOfBytes) } } + ULONG STDCALL RtlCompareMemory ( - IN CONST VOID *Source1, - IN CONST VOID *Source2, - IN SIZE_T Length + PVOID Source1, + PVOID Source2, + ULONG Length ) /* * FUNCTION: Compares blocks of memory and returns the number of equal bytes @@ -121,17 +122,16 @@ RtlCompareMemoryUlong ( } -#undef RtlCopyBytes - +#if 0 VOID RtlCopyBytes(PVOID Destination, CONST VOID* Source, ULONG Length) { RtlCopyMemory(Destination,Source,Length); } +#endif -#undef RtlCopyMemory - +#if 0 VOID RtlCopyMemory(VOID* Destination, CONST VOID* Source, ULONG Length) { DPRINT("RtlCopyMemory(Destination %x Source %x Length %d\n", @@ -139,8 +139,7 @@ VOID RtlCopyMemory(VOID* Destination, CONST VOID* Source, ULONG Length) memcpy(Destination,Source,Length); DPRINT("*Destination %x\n",*(PULONG)Destination); } - -#undef RtlFillMemory +#endif VOID STDCALL @@ -173,7 +172,6 @@ RtlFillMemoryUlong ( } } -#undef RtlMoveMemory VOID STDCALL @@ -191,8 +189,6 @@ RtlMoveMemory ( } -#undef RtlZeroMemory - VOID STDCALL RtlZeroMemory ( diff --git a/reactos/ntoskrnl/rtl/memchr.c b/reactos/ntoskrnl/rtl/memchr.c index feb4882b8ed..dd8e58c8e9f 100644 --- a/reactos/ntoskrnl/rtl/memchr.c +++ b/reactos/ntoskrnl/rtl/memchr.c @@ -24,11 +24,8 @@ * Created 22/05/98 */ -#include - -#define NDEBUG -#include +#include void *memchr(const void *s, int c, size_t n) { diff --git a/reactos/ntoskrnl/rtl/memcmp.c b/reactos/ntoskrnl/rtl/memcmp.c index 2644a2f48dd..ed1b796dff4 100644 --- a/reactos/ntoskrnl/rtl/memcmp.c +++ b/reactos/ntoskrnl/rtl/memcmp.c @@ -24,11 +24,7 @@ * Created 01/10/00 */ -#include - -#define NDEBUG -#include - +#include int memcmp(const void* _s1, const void* _s2, size_t n) { diff --git a/reactos/ntoskrnl/rtl/memcpy.c b/reactos/ntoskrnl/rtl/memcpy.c index 81d0b7e53f8..73739854704 100644 --- a/reactos/ntoskrnl/rtl/memcpy.c +++ b/reactos/ntoskrnl/rtl/memcpy.c @@ -8,12 +8,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ #undef memcpy diff --git a/reactos/ntoskrnl/rtl/memmove.c b/reactos/ntoskrnl/rtl/memmove.c index 8c3275c8d09..f15f6bb58b5 100644 --- a/reactos/ntoskrnl/rtl/memmove.c +++ b/reactos/ntoskrnl/rtl/memmove.c @@ -1,8 +1,4 @@ -#include - -#define NDEBUG -#include - +#include void * memmove(void *dest,const void *src,size_t count) { diff --git a/reactos/ntoskrnl/rtl/memset.c b/reactos/ntoskrnl/rtl/memset.c index 545db3301d1..49d1e730ef6 100644 --- a/reactos/ntoskrnl/rtl/memset.c +++ b/reactos/ntoskrnl/rtl/memset.c @@ -1,8 +1,5 @@ -#include - -#define NDEBUG -#include +#include void * memset(void *src, int val, size_t count) { diff --git a/reactos/ntoskrnl/rtl/message.c b/reactos/ntoskrnl/rtl/message.c index 9f1de9e91e1..26fedd2f9df 100644 --- a/reactos/ntoskrnl/rtl/message.c +++ b/reactos/ntoskrnl/rtl/message.c @@ -1,4 +1,4 @@ -/* $Id: message.c,v 1.3 2002/09/07 15:13:06 chorns Exp $ +/* $Id: message.c,v 1.4 2002/09/08 10:23:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,7 +11,7 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/rtl/nls.c b/reactos/ntoskrnl/rtl/nls.c index f5cd0ddc617..f308cf8fcae 100644 --- a/reactos/ntoskrnl/rtl/nls.c +++ b/reactos/ntoskrnl/rtl/nls.c @@ -1,4 +1,4 @@ -/* $Id: nls.c,v 1.8 2002/09/07 15:13:06 chorns Exp $ +/* $Id: nls.c,v 1.9 2002/09/08 10:23:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -20,12 +20,12 @@ * 4) Add multi-byte translation code. */ -#include +#include +//#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ BOOLEAN NlsMbCodePageTag = FALSE; diff --git a/reactos/ntoskrnl/rtl/regio.c b/reactos/ntoskrnl/rtl/regio.c index f2890e856d1..476a81e8cb9 100644 --- a/reactos/ntoskrnl/rtl/regio.c +++ b/reactos/ntoskrnl/rtl/regio.c @@ -1,4 +1,4 @@ -/* $Id: regio.c,v 1.4 2002/09/07 15:13:06 chorns Exp $ +/* $Id: regio.c,v 1.5 2002/09/08 10:23:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,10 +9,7 @@ * 29/12/1999 Created */ -#include - -#define NDEBUG -#include +#include /* FUNCTIONS ***************************************************************/ diff --git a/reactos/ntoskrnl/rtl/seh.c b/reactos/ntoskrnl/rtl/seh.c index 81ce4ee0541..778119ed788 100644 --- a/reactos/ntoskrnl/rtl/seh.c +++ b/reactos/ntoskrnl/rtl/seh.c @@ -10,11 +10,10 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG -#include - +#include /* FUNCTIONS *****************************************************************/ @@ -120,12 +119,12 @@ _except_handler3( // Clear the direction flag (make no assumptions!) __asm__ ("cld"); - // if neither the EH_UNWINDING nor EH_EXIT_UNWIND bit + // if neither the EXCEPTION_UNWINDING nor EXCEPTION_EXIT_UNWIND bit // is set... This is true the first time through the handler (the // non-unwinding case) if (!(ExceptionRecord->ExceptionFlags - & (EH_UNWINDING|EH_EXIT_UNWIND))) + & (EXCEPTION_UNWINDING|EXCEPTION_EXIT_UNWIND))) { DPRINT("Exception caught\n"); @@ -235,7 +234,7 @@ DPRINT("\n"); ReturnValue = ExceptionContinueSearch; } } - else // Either EH_UNWINDING or EH_EXIT_UNWIND flags is set + else // Either EXCEPTION_UNWINDING or EXCEPTION_EXIT_UNWIND flags is set { DPRINT("Local unwind\n"); diff --git a/reactos/ntoskrnl/rtl/sprintf.c b/reactos/ntoskrnl/rtl/sprintf.c index bddc73291d4..1cd2ce42c29 100644 --- a/reactos/ntoskrnl/rtl/sprintf.c +++ b/reactos/ntoskrnl/rtl/sprintf.c @@ -1,4 +1,4 @@ -/* $Id: sprintf.c,v 1.8 2002/09/07 15:13:06 chorns Exp $ +/* $Id: sprintf.c,v 1.9 2002/09/08 10:23:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -22,9 +22,13 @@ * Wirzenius wrote this portably, Torvalds fucked it up :-) */ -#include +#include +#include +#include +#include +#include +#include -#define NDEBUG #include diff --git a/reactos/ntoskrnl/rtl/stdlib.c b/reactos/ntoskrnl/rtl/stdlib.c index 836fb5540a8..1c474f8c445 100644 --- a/reactos/ntoskrnl/rtl/stdlib.c +++ b/reactos/ntoskrnl/rtl/stdlib.c @@ -1,4 +1,4 @@ -/* $Id: stdlib.c,v 1.6 2002/09/07 15:13:06 chorns Exp $ +/* $Id: stdlib.c,v 1.7 2002/09/08 10:23:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,11 @@ /* INCLUDES *****************************************************************/ -#include - -#define NDEBUG -#include - +#include +#include +#include +#include +#include /* GLOBALS ****************************************************************/ diff --git a/reactos/ntoskrnl/rtl/string.c b/reactos/ntoskrnl/rtl/string.c index f364776020d..99fd4ee7c10 100644 --- a/reactos/ntoskrnl/rtl/string.c +++ b/reactos/ntoskrnl/rtl/string.c @@ -10,11 +10,8 @@ /* INCLUDES *****************************************************************/ -#include - -#define NDEBUG -#include - +#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/rtl/strtok.c b/reactos/ntoskrnl/rtl/strtok.c index 8584a0aa962..535c1c70456 100644 --- a/reactos/ntoskrnl/rtl/strtok.c +++ b/reactos/ntoskrnl/rtl/strtok.c @@ -10,9 +10,8 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include diff --git a/reactos/ntoskrnl/rtl/swprintf.c b/reactos/ntoskrnl/rtl/swprintf.c index 1ee490f6534..ad6f50216e8 100644 --- a/reactos/ntoskrnl/rtl/swprintf.c +++ b/reactos/ntoskrnl/rtl/swprintf.c @@ -1,4 +1,4 @@ -/* $Id: swprintf.c,v 1.6 2002/09/07 15:13:06 chorns Exp $ +/* $Id: swprintf.c,v 1.7 2002/09/08 10:23:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -23,7 +23,12 @@ * Wirzenius wrote this portably, Torvalds fucked it up :-) */ -#include +#include +#include +#include +#include +#include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/rtl/time.c b/reactos/ntoskrnl/rtl/time.c index be827c9741b..596ef67bc9f 100644 --- a/reactos/ntoskrnl/rtl/time.c +++ b/reactos/ntoskrnl/rtl/time.c @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.10 2002/09/07 15:13:06 chorns Exp $ +/* $Id: time.c,v 1.11 2002/09/08 10:23:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,12 +12,11 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG #include - #define TICKSPERMIN 600000000 #define TICKSPERSEC 10000000 #define TICKSPERMSEC 10000 diff --git a/reactos/ntoskrnl/rtl/timezone.c b/reactos/ntoskrnl/rtl/timezone.c index a9a075a93bb..1600a13a73f 100644 --- a/reactos/ntoskrnl/rtl/timezone.c +++ b/reactos/ntoskrnl/rtl/timezone.c @@ -1,4 +1,4 @@ -/* $Id: timezone.c,v 1.3 2002/09/07 15:13:06 chorns Exp $ +/* $Id: timezone.c,v 1.4 2002/09/08 10:23:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,10 +11,12 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ @@ -78,7 +80,7 @@ RtlQueryTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation) QueryTable[6].Name = L"Daylight Start"; QueryTable[6].Flags = RTL_QUERY_REGISTRY_DIRECT; QueryTable[6].EntryContext = &TimeZoneInformation->DaylightDate; - + Status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE, (PWSTR)KeyHandle, QueryTable, diff --git a/reactos/ntoskrnl/rtl/unicode.c b/reactos/ntoskrnl/rtl/unicode.c index e2eb56f9074..3c83926d06a 100644 --- a/reactos/ntoskrnl/rtl/unicode.c +++ b/reactos/ntoskrnl/rtl/unicode.c @@ -1,4 +1,4 @@ -/* $Id: unicode.c,v 1.22 2002/09/07 15:13:06 chorns Exp $ +/* $Id: unicode.c,v 1.23 2002/09/08 10:23:42 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,12 +9,15 @@ * Created 10/08/98 */ -#include +#include +//#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ #define TAG_USTR TAG('U', 'S', 'T', 'R') @@ -194,7 +197,7 @@ RtlAppendUnicodeStringToString(IN OUT PUNICODE_STRING Destination, NTSTATUS STDCALL RtlAppendUnicodeToString(IN OUT PUNICODE_STRING Destination, - IN PCWSTR Source) + IN PWSTR Source) { PWCHAR Src; PWCHAR Dest; @@ -206,7 +209,7 @@ RtlAppendUnicodeToString(IN OUT PUNICODE_STRING Destination, if (Destination->Length + slen >= Destination->MaximumLength) return(STATUS_BUFFER_TOO_SMALL); - Src = (PWCHAR)Source; + Src = Source; Dest = Destination->Buffer + (Destination->Length / sizeof(WCHAR)); for (i = 0; i < (slen / sizeof(WCHAR)); i++) @@ -550,8 +553,8 @@ RtlEqualString(IN PSTRING String1, BOOLEAN STDCALL -RtlEqualUnicodeString(IN CONST UNICODE_STRING *String1, - IN CONST UNICODE_STRING *String2, +RtlEqualUnicodeString(IN PUNICODE_STRING String1, + IN PUNICODE_STRING String2, IN BOOLEAN CaseInsensitive) { unsigned long s1l = String1->Length / sizeof(WCHAR); diff --git a/reactos/ntoskrnl/rtl/wstring.c b/reactos/ntoskrnl/rtl/wstring.c index c0b5d8ed9ff..ee59a519641 100644 --- a/reactos/ntoskrnl/rtl/wstring.c +++ b/reactos/ntoskrnl/rtl/wstring.c @@ -12,12 +12,11 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ int _wcsicmp (const wchar_t* cs, const wchar_t* ct) diff --git a/reactos/ntoskrnl/se/access.c b/reactos/ntoskrnl/se/access.c index 7a4a79c6fac..25d874ec908 100644 --- a/reactos/ntoskrnl/se/access.c +++ b/reactos/ntoskrnl/se/access.c @@ -1,4 +1,4 @@ -/* $Id: access.c,v 1.2 2002/09/07 15:13:06 chorns Exp $ +/* $Id: access.c,v 1.3 2002/09/08 10:23:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,10 +11,7 @@ /* INCLUDES *****************************************************************/ -#include - -#define NDEBUG -#include +#include /* FUNCTIONS ***************************************************************/ diff --git a/reactos/ntoskrnl/se/acl.c b/reactos/ntoskrnl/se/acl.c index cb7f1b6b4a1..f41e0dd9656 100644 --- a/reactos/ntoskrnl/se/acl.c +++ b/reactos/ntoskrnl/se/acl.c @@ -1,4 +1,4 @@ -/* $Id: acl.c,v 1.8 2002/09/07 15:13:06 chorns Exp $ +/* $Id: acl.c,v 1.9 2002/09/08 10:23:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,19 +11,18 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include - #define TAG_ACL TAG('A', 'C', 'L', 'T') /* GLOBALS ******************************************************************/ -PACL SePublicDefaultDacl = NULL; -PACL SeSystemDefaultDacl = NULL; +PACL EXPORTED SePublicDefaultDacl = NULL; +PACL EXPORTED SeSystemDefaultDacl = NULL; PACL SePublicDefaultUnrestrictedDacl = NULL; PACL SePublicOpenDacl = NULL; @@ -41,11 +40,11 @@ SepInitDACLs(VOID) ULONG AclLength4; AclLength2 = sizeof(ACL) + - 2 * (RtlLengthRequiredSid(1) + sizeof(ROS_ACE_HEADER)); + 2 * (RtlLengthRequiredSid(1) + sizeof(ACE_HEADER)); AclLength3 = sizeof(ACL) + - 3 * (RtlLengthRequiredSid(1) + sizeof(ROS_ACE_HEADER)); + 3 * (RtlLengthRequiredSid(1) + sizeof(ACE_HEADER)); AclLength4 = sizeof(ACL) + - 4 * (RtlLengthRequiredSid(1) + sizeof(ROS_ACE_HEADER)); + 4 * (RtlLengthRequiredSid(1) + sizeof(ACE_HEADER)); /* create PublicDefaultDacl */ SePublicDefaultDacl = ExAllocatePoolWithTag(NonPagedPool, @@ -180,7 +179,7 @@ RtlpAddKnownAce(PACL Acl, PSID Sid, ULONG Type) { - PROS_ACE Ace; + PACE Ace; if (!RtlValidSid(Sid)) { @@ -195,7 +194,7 @@ RtlpAddKnownAce(PACL Acl, { Revision = Acl->AclRevision; } - if (!RtlFirstFreeAce(Acl, (PACE*)&Ace)) + if (!RtlFirstFreeAce(Acl, &Ace)) { return(STATUS_BUFFER_TOO_SMALL); } @@ -203,14 +202,14 @@ RtlpAddKnownAce(PACL Acl, { return(STATUS_UNSUCCESSFUL); } - if (((PVOID)Ace + RtlLengthSid(Sid) + sizeof(ROS_ACE)) >= + if (((PVOID)Ace + RtlLengthSid(Sid) + sizeof(ACE)) >= ((PVOID)Acl + Acl->AclSize)) { return(STATUS_BUFFER_TOO_SMALL); } Ace->Header.AceFlags = 0; Ace->Header.AceType = Type; - Ace->Header.AceSize = RtlLengthSid(Sid) + sizeof(ROS_ACE); + Ace->Header.AceSize = RtlLengthSid(Sid) + sizeof(ACE); Ace->Header.AccessMask = AccessMask; RtlCopySid(RtlLengthSid(Sid), (PSID)(Ace + 1), Sid); Acl->AceCount++; diff --git a/reactos/ntoskrnl/se/lsa.c b/reactos/ntoskrnl/se/lsa.c index c1e58fd3987..1c78adc1a35 100644 --- a/reactos/ntoskrnl/se/lsa.c +++ b/reactos/ntoskrnl/se/lsa.c @@ -1,11 +1,6 @@ -/* $Id: lsa.c,v 1.2 2002/09/07 15:13:06 chorns Exp $ +/* $Id: lsa.c,v 1.3 2002/09/08 10:23:43 chorns Exp $ */ - -#include - -#define NDEBUG -#include - +#include /* LsaCallAuthenticationPackage@28 */ NTSTATUS STDCALL LsaCallAuthenticationPackage ( diff --git a/reactos/ntoskrnl/se/luid.c b/reactos/ntoskrnl/se/luid.c index 2052a6807fc..f7215a5f1b1 100644 --- a/reactos/ntoskrnl/se/luid.c +++ b/reactos/ntoskrnl/se/luid.c @@ -1,4 +1,4 @@ -/* $Id: luid.c,v 1.5 2002/09/07 15:13:06 chorns Exp $ +/* $Id: luid.c,v 1.6 2002/09/08 10:23:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,10 @@ /* INCLUDES *****************************************************************/ -#include +#include -#define NDEBUG #include - /* GLOBALS *******************************************************************/ static KSPIN_LOCK LuidLock; @@ -60,7 +58,6 @@ RtlCopyLuid(IN PLUID LuidDest, LuidDest->QuadPart = LuidSrc->QuadPart; } -#undef RtlEqualLuid BOOLEAN STDCALL RtlEqualLuid(IN PLUID Luid1, diff --git a/reactos/ntoskrnl/se/priv.c b/reactos/ntoskrnl/se/priv.c index 403888b0556..a23149febb4 100644 --- a/reactos/ntoskrnl/se/priv.c +++ b/reactos/ntoskrnl/se/priv.c @@ -1,4 +1,4 @@ -/* $Id: priv.c,v 1.4 2002/09/07 15:13:06 chorns Exp $ +/* $Id: priv.c,v 1.5 2002/09/08 10:23:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,9 +11,9 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include @@ -75,14 +75,14 @@ SepInitPrivileges(VOID) } -BOOLEAN SepPrivilegeCheck(PIACCESS_TOKEN Token, +BOOLEAN SepPrivilegeCheck(PACCESS_TOKEN Token, PLUID_AND_ATTRIBUTES Privileges, ULONG PrivilegeCount, ULONG PrivilegeControl, KPROCESSOR_MODE PreviousMode) { ULONG i; - PLUID_AND_ATTRIBUTES_ARRAY Current; + PLUID_AND_ATTRIBUTES Current; ULONG j; ULONG k; @@ -101,11 +101,11 @@ BOOLEAN SepPrivilegeCheck(PIACCESS_TOKEN Token, Current = Token->Privileges; for (i = 0; i < Token->PrivilegeCount; i++) { - if (!(Current[i]->Attributes & SE_PRIVILEGE_ENABLED) && + if (!(Current[i].Attributes & SE_PRIVILEGE_ENABLED) && Privileges[i].Luid.u.LowPart == - Current[i]->Luid.u.LowPart && + Current[i].Luid.u.LowPart && Privileges[i].Luid.u.HighPart == - Current[i]->Luid.u.HighPart) + Current[i].Luid.u.HighPart) { Privileges[i].Attributes = Privileges[i].Attributes | @@ -195,7 +195,7 @@ NtPrivilegeCheck(IN HANDLE ClientToken, IN PBOOLEAN Result) { NTSTATUS Status; - PIACCESS_TOKEN iToken; + PACCESS_TOKEN Token; ULONG PrivilegeCount; BOOLEAN TResult; ULONG PrivilegeControl; @@ -206,16 +206,16 @@ NtPrivilegeCheck(IN HANDLE ClientToken, 0, SepTokenObjectType, UserMode, - (PVOID*)&iToken, + (PVOID*)&Token, NULL); if (!NT_SUCCESS(Status)) { return(Status); } - if (iToken->TokenType == TokenImpersonation && - iToken->ImpersonationLevel < SecurityAnonymous) + if (Token->TokenType == TokenImpersonation && + Token->ImpersonationLevel < SecurityAnonymous) { - ObDereferenceObject(iToken); + ObDereferenceObject(Token); return(STATUS_UNSUCCESSFUL); } PrivilegeCount = RequiredPrivileges->PrivilegeCount; @@ -232,10 +232,10 @@ NtPrivilegeCheck(IN HANDLE ClientToken, &Length); if (!NT_SUCCESS(Status)) { - ObDereferenceObject(iToken); + ObDereferenceObject(Token); return(STATUS_UNSUCCESSFUL); } - TResult = SepPrivilegeCheck(iToken, + TResult = SepPrivilegeCheck(Token, Privilege, PrivilegeCount, PrivilegeControl, @@ -251,22 +251,22 @@ SePrivilegeCheck(PPRIVILEGE_SET Privileges, PSECURITY_SUBJECT_CONTEXT SubjectContext, KPROCESSOR_MODE PreviousMode) { - PIACCESS_TOKEN iToken = NULL; + PACCESS_TOKEN Token = NULL; if (SubjectContext->ClientToken == NULL) { - iToken = SubjectContext->PrimaryToken; + Token = SubjectContext->PrimaryToken; } else { - iToken = SubjectContext->ClientToken; + Token = SubjectContext->ClientToken; if (SubjectContext->ImpersonationLevel < 2) { return(FALSE); } } - return(SepPrivilegeCheck(iToken, + return(SepPrivilegeCheck(Token, Privileges->Privilege, Privileges->PrivilegeCount, Privileges->Control, diff --git a/reactos/ntoskrnl/se/sd.c b/reactos/ntoskrnl/se/sd.c index 6e233362132..cb751249375 100644 --- a/reactos/ntoskrnl/se/sd.c +++ b/reactos/ntoskrnl/se/sd.c @@ -1,4 +1,4 @@ -/* $Id: sd.c,v 1.7 2002/09/07 15:13:06 chorns Exp $ +/* $Id: sd.c,v 1.8 2002/09/08 10:23:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,9 +11,9 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include @@ -47,8 +47,8 @@ RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG STDCALL RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor) { - PISID Owner; - PISID Group; + PSID Owner; + PSID Group; ULONG Length; PACL Dacl; PACL Sacl; @@ -57,10 +57,10 @@ RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor) if (SecurityDescriptor->Owner != NULL) { - Owner = (PISID)SecurityDescriptor->Owner; + Owner = SecurityDescriptor->Owner; if (SecurityDescriptor->Control & SE_SELF_RELATIVE) { - Owner = (PISID)((ULONG)Owner + + Owner = (PSID)((ULONG)Owner + (ULONG)SecurityDescriptor); } Length = Length + ((sizeof(SID) + (Owner->SubAuthorityCount - 1) * @@ -68,10 +68,10 @@ RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor) } if (SecurityDescriptor->Group != NULL) { - Group = (PISID)SecurityDescriptor->Group; + Group = SecurityDescriptor->Group; if (SecurityDescriptor->Control & SE_SELF_RELATIVE) { - Group = (PISID)((ULONG)Group + (ULONG)SecurityDescriptor); + Group = (PSID)((ULONG)Group + (ULONG)SecurityDescriptor); } Length = Length + ((sizeof(SID) + (Group->SubAuthorityCount - 1) * sizeof(ULONG) + 3) & 0xfc); @@ -389,4 +389,6 @@ RtlAbsoluteToSelfRelativeSD(PSECURITY_DESCRIPTOR AbsSD, return(STATUS_NOT_IMPLEMENTED); } + + /* EOF */ diff --git a/reactos/ntoskrnl/se/semgr.c b/reactos/ntoskrnl/se/semgr.c index 09e75e1572e..b6f6b1daf98 100644 --- a/reactos/ntoskrnl/se/semgr.c +++ b/reactos/ntoskrnl/se/semgr.c @@ -1,4 +1,4 @@ -/* $Id: semgr.c,v 1.21 2002/09/07 15:13:06 chorns Exp $ +/* $Id: semgr.c,v 1.22 2002/09/08 10:23:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,18 +11,18 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include -#define NDEBUG #include - #define TAG_SXPT TAG('S', 'X', 'P', 'T') /* GLOBALS ******************************************************************/ -PSE_EXPORTS SeExports = NULL; +PSE_EXPORTS EXPORTED SeExports = NULL; /* PROTOTYPES ***************************************************************/ @@ -187,10 +187,9 @@ NtAccessCheckAndAuditAlarm(IN PUNICODE_STRING SubsystemName, NTSTATUS STDCALL -NtAllocateUuids(OUT PLARGE_INTEGER UuidLastTimeAllocated, - OUT PULONG UuidDeltaTime, - OUT PULONG UuidSequenceNumber, - OUT PUCHAR UuidSeed) +NtAllocateUuids(PULARGE_INTEGER Time, + PULONG Range, + PULONG Sequence) { UNIMPLEMENTED; } @@ -241,16 +240,16 @@ VOID STDCALL SeReleaseSubjectContext (PSECURITY_SUBJECT_CONTEXT SubjectContext) VOID STDCALL SeCaptureSubjectContext (PSECURITY_SUBJECT_CONTEXT SubjectContext) { PEPROCESS Process; - BOOLEAN CopyOnUse; - BOOLEAN EffectiveOnly; + ULONG a; + ULONG b; Process = PsGetCurrentThread()->ThreadsProcess; SubjectContext->ProcessAuditId = Process; SubjectContext->ClientToken = PsReferenceImpersonationToken(PsGetCurrentThread(), - &CopyOnUse, - &EffectiveOnly, + &a, + &b, &SubjectContext->ImpersonationLevel); SubjectContext->PrimaryToken = PsReferencePrimaryToken(Process); } @@ -381,7 +380,7 @@ SeAssignSecurity(PSECURITY_DESCRIPTOR ParentDescriptor, #endif } -BOOLEAN SepSidInToken(PIACCESS_TOKEN Token, +BOOLEAN SepSidInToken(PACCESS_TOKEN Token, PSID Sid) { ULONG i; @@ -393,10 +392,10 @@ BOOLEAN SepSidInToken(PIACCESS_TOKEN Token, for (i=0; iUserAndGroupCount; i++) { - if (RtlEqualSid(Sid, Token->UserAndGroups[i]->Sid)) + if (RtlEqualSid(Sid, Token->UserAndGroups[i].Sid)) { if (i == 0 || - (!(Token->UserAndGroups[i]->Attributes & SE_GROUP_ENABLED))) + (!(Token->UserAndGroups[i].Attributes & SE_GROUP_ENABLED))) { return(TRUE); } @@ -440,7 +439,7 @@ SeAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor, BOOLEAN Present; BOOLEAN Defaulted; NTSTATUS Status; - PROS_ACE CurrentAce; + PACE CurrentAce; PSID Sid; ACCESS_MASK CurrentAccess; @@ -462,7 +461,7 @@ SeAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor, return(Status); } - CurrentAce = (PROS_ACE)(Dacl + 1); + CurrentAce = (PACE)(Dacl + 1); for (i = 0; i < Dacl->AceCount; i++) { Sid = (PSID)(CurrentAce + 1); diff --git a/reactos/ntoskrnl/se/sid.c b/reactos/ntoskrnl/se/sid.c index ed1911af83f..97c4777f1c8 100644 --- a/reactos/ntoskrnl/se/sid.c +++ b/reactos/ntoskrnl/se/sid.c @@ -1,4 +1,4 @@ -/* $Id: sid.c,v 1.11 2002/09/07 15:13:06 chorns Exp $ +/* $Id: sid.c,v 1.12 2002/09/08 10:23:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,12 +11,11 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include -#define NDEBUG #include - #define TAG_SID TAG('S', 'I', 'D', 'T') @@ -472,13 +471,11 @@ SepInitSecurityIDs(VOID) BOOLEAN STDCALL RtlValidSid(PSID Sid) { - PISID iSid = (PISID)Sid; - - if ((iSid->Revision & 0xf) != 1) + if ((Sid->Revision & 0xf) != 1) { return(FALSE); } - if (iSid->SubAuthorityCount > 15) + if (Sid->SubAuthorityCount > 15) { return(FALSE); } @@ -498,11 +495,9 @@ RtlInitializeSid(PSID Sid, PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, UCHAR SubAuthorityCount) { - PISID iSid = (PISID)Sid; - - iSid->Revision = 1; - iSid->SubAuthorityCount = SubAuthorityCount; - RtlCopyMemory(&iSid->IdentifierAuthority, + Sid->Revision = 1; + Sid->SubAuthorityCount = SubAuthorityCount; + RtlCopyMemory(&Sid->IdentifierAuthority, IdentifierAuthority, sizeof(SID_IDENTIFIER_AUTHORITY)); return(STATUS_SUCCESS); @@ -513,18 +508,14 @@ PULONG STDCALL RtlSubAuthoritySid(PSID Sid, ULONG SubAuthority) { - PISID iSid = (PISID)Sid; - - return(&iSid->SubAuthority[SubAuthority]); + return(&Sid->SubAuthority[SubAuthority]); } PUCHAR STDCALL RtlSubAuthorityCountSid(PSID Sid) { - PISID iSid = (PISID)Sid; - - return(&iSid->SubAuthorityCount); + return(&Sid->SubAuthorityCount); } @@ -532,10 +523,7 @@ BOOLEAN STDCALL RtlEqualSid(PSID Sid1, PSID Sid2) { - PISID iSid1 = (PISID)Sid1; - PISID iSid2 = (PISID)Sid2; - - if (iSid1->Revision != iSid2->Revision) + if (Sid1->Revision != Sid2->Revision) { return(FALSE); } @@ -555,9 +543,7 @@ RtlEqualSid(PSID Sid1, ULONG STDCALL RtlLengthSid(PSID Sid) { - PISID iSid = (PISID)Sid; - - return(sizeof(SID) + (iSid->SubAuthorityCount-1)*4); + return(sizeof(SID) + (Sid->SubAuthorityCount-1)*4); } @@ -577,9 +563,9 @@ RtlCopySid(ULONG BufferLength, NTSTATUS STDCALL RtlCopySidAndAttributesArray(ULONG Count, - PSID_AND_ATTRIBUTES_ARRAY Src, + PSID_AND_ATTRIBUTES Src, ULONG SidAreaSize, - PSID_AND_ATTRIBUTES_ARRAY Dest, + PSID_AND_ATTRIBUTES Dest, PVOID SidArea, PVOID* RemainingSidArea, PULONG RemainingSidAreaSize) @@ -591,15 +577,15 @@ RtlCopySidAndAttributesArray(ULONG Count, for (i=0; iSid) > Length) + if (RtlLengthSid(Src[i].Sid) > Length) { return(STATUS_BUFFER_TOO_SMALL); } - Length = Length - RtlLengthSid(Src[i]->Sid); - Dest[i]->Sid = SidArea; - Dest[i]->Attributes = Src[i]->Attributes; - RtlCopySid(RtlLengthSid(Src[i]->Sid), SidArea, Src[i]->Sid); - SidArea = SidArea + RtlLengthSid(Src[i]->Sid); + Length = Length - RtlLengthSid(Src[i].Sid); + Dest[i].Sid = SidArea; + Dest[i].Attributes = Src[i].Attributes; + RtlCopySid(RtlLengthSid(Src[i].Sid), SidArea, Src[i].Sid); + SidArea = SidArea + RtlLengthSid(Src[i].Sid); } *RemainingSidArea = SidArea; *RemainingSidAreaSize = Length; @@ -612,7 +598,6 @@ RtlConvertSidToUnicodeString(PUNICODE_STRING String, PSID Sid, BOOLEAN AllocateString) { - PISID iSid = (PISID)Sid; WCHAR Buffer[256]; PWSTR Ptr; ULONG Length; @@ -624,35 +609,35 @@ RtlConvertSidToUnicodeString(PUNICODE_STRING String, Ptr = Buffer; Ptr += swprintf (Ptr, L"S-%u-", - iSid->Revision); + Sid->Revision); - if(!iSid->IdentifierAuthority.Value[0] && - !iSid->IdentifierAuthority.Value[1]) + if(!Sid->IdentifierAuthority.Value[0] && + !Sid->IdentifierAuthority.Value[1]) { Ptr += swprintf(Ptr, L"%u", - (ULONG)iSid->IdentifierAuthority.Value[2] << 24 | - (ULONG)iSid->IdentifierAuthority.Value[3] << 16 | - (ULONG)iSid->IdentifierAuthority.Value[4] << 8 | - (ULONG)iSid->IdentifierAuthority.Value[5]); + (ULONG)Sid->IdentifierAuthority.Value[2] << 24 | + (ULONG)Sid->IdentifierAuthority.Value[3] << 16 | + (ULONG)Sid->IdentifierAuthority.Value[4] << 8 | + (ULONG)Sid->IdentifierAuthority.Value[5]); } else { Ptr += swprintf(Ptr, L"0x%02hx%02hx%02hx%02hx%02hx%02hx", - iSid->IdentifierAuthority.Value[0], - iSid->IdentifierAuthority.Value[1], - iSid->IdentifierAuthority.Value[2], - iSid->IdentifierAuthority.Value[3], - iSid->IdentifierAuthority.Value[4], - iSid->IdentifierAuthority.Value[5]); + Sid->IdentifierAuthority.Value[0], + Sid->IdentifierAuthority.Value[1], + Sid->IdentifierAuthority.Value[2], + Sid->IdentifierAuthority.Value[3], + Sid->IdentifierAuthority.Value[4], + Sid->IdentifierAuthority.Value[5]); } - for (i = 0; i < iSid->SubAuthorityCount; i++) + for (i = 0; i < Sid->SubAuthorityCount; i++) { Ptr += swprintf(Ptr, L"-%u", - iSid->SubAuthority[i]); + Sid->SubAuthority[i]); } Length = (Ptr - Buffer) * sizeof(WCHAR); diff --git a/reactos/ntoskrnl/se/token.c b/reactos/ntoskrnl/se/token.c index fed032462ce..64efe388974 100644 --- a/reactos/ntoskrnl/se/token.c +++ b/reactos/ntoskrnl/se/token.c @@ -1,4 +1,4 @@ -/* $Id: token.c,v 1.20 2002/09/07 15:13:07 chorns Exp $ +/* $Id: token.c,v 1.21 2002/09/08 10:23:43 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,24 +11,26 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include +#include +#include #define NDEBUG #include - /* GLOBALS *******************************************************************/ POBJECT_TYPE SepTokenObjectType = NULL; -#undef SYSTEM_LUID -#define SYSTEM_LUID 999 - static GENERIC_MAPPING SepTokenMapping = {TOKEN_READ, TOKEN_WRITE, TOKEN_EXECUTE, TOKEN_ALL_ACCESS}; +#define SYSTEM_LUID 0x3E7; + /* FUNCTIONS *****************************************************************/ VOID SepFreeProxyData(PVOID ProxyData) @@ -42,10 +44,10 @@ NTSTATUS SepCopyProxyData(PVOID* Dest, PVOID Src) } NTSTATUS SeExchangePrimaryToken(PEPROCESS Process, - PIACCESS_TOKEN NewToken, - PIACCESS_TOKEN* OldTokenP) + PACCESS_TOKEN NewToken, + PACCESS_TOKEN* OldTokenP) { - PIACCESS_TOKEN OldToken; + PACCESS_TOKEN OldToken; if (NewToken->TokenType != TokenPrimary) { @@ -67,24 +69,23 @@ NTSTATUS SeExchangePrimaryToken(PEPROCESS Process, return(STATUS_SUCCESS); } - static ULONG RtlLengthSidAndAttributes(ULONG Count, - PSID_AND_ATTRIBUTES_ARRAY Src) + PSID_AND_ATTRIBUTES Src) { ULONG i; ULONG uLength; uLength = Count * sizeof(SID_AND_ATTRIBUTES); for (i = 0; i < Count; i++) - uLength += RtlLengthSid(Src[i]->Sid); + uLength += RtlLengthSid(Src[i].Sid); return(uLength); } NTSTATUS -SepFindPrimaryGroupAndDefaultOwner(PIACCESS_TOKEN Token, +SepFindPrimaryGroupAndDefaultOwner(PACCESS_TOKEN Token, PSID PrimaryGroup, PSID DefaultOwner) { @@ -101,14 +102,14 @@ SepFindPrimaryGroupAndDefaultOwner(PIACCESS_TOKEN Token, for (i = 0; i < Token->UserAndGroupCount; i++) { if (DefaultOwner && - RtlEqualSid(Token->UserAndGroups[i]->Sid, DefaultOwner)) + RtlEqualSid(Token->UserAndGroups[i].Sid, DefaultOwner)) { Token->DefaultOwnerIndex = i; } - if (RtlEqualSid(Token->UserAndGroups[i]->Sid, PrimaryGroup)) + if (RtlEqualSid(Token->UserAndGroups[i].Sid, PrimaryGroup)) { - Token->PrimaryGroup = Token->UserAndGroups[i]->Sid; + Token->PrimaryGroup = Token->UserAndGroups[i].Sid; } } @@ -127,13 +128,13 @@ SepFindPrimaryGroupAndDefaultOwner(PIACCESS_TOKEN Token, NTSTATUS -SepDuplicateToken(PIACCESS_TOKEN Token, +SepDuplicateToken(PACCESS_TOKEN Token, POBJECT_ATTRIBUTES ObjectAttributes, TOKEN_TYPE TokenType, SECURITY_IMPERSONATION_LEVEL Level, SECURITY_IMPERSONATION_LEVEL ExistingLevel, KPROCESSOR_MODE PreviousMode, - PIACCESS_TOKEN* NewAccessToken) + PACCESS_TOKEN* NewAccessToken) { NTSTATUS Status; ULONG uLength; @@ -141,16 +142,16 @@ SepDuplicateToken(PIACCESS_TOKEN Token, PVOID EndMem; - PIACCESS_TOKEN AccessToken; + PACCESS_TOKEN AccessToken; - Status = ObRosCreateObject(0, + Status = ObCreateObject(0, TOKEN_ALL_ACCESS, ObjectAttributes, SepTokenObjectType, (PVOID*)&AccessToken); if (!NT_SUCCESS(Status)) { - DPRINT1("ObRosCreateObject() failed (Status %lx)\n"); + DPRINT1("ObCreateObject() failed (Status %lx)\n"); return(Status); } @@ -181,10 +182,10 @@ SepDuplicateToken(PIACCESS_TOKEN Token, uLength = sizeof(SID_AND_ATTRIBUTES) * AccessToken->UserAndGroupCount; for (i = 0; i < Token->UserAndGroupCount; i++) - uLength += RtlLengthSid(Token->UserAndGroups[i]->Sid); + uLength += RtlLengthSid(Token->UserAndGroups[i].Sid); AccessToken->UserAndGroups = - (PSID_AND_ATTRIBUTES_ARRAY)ExAllocatePoolWithTag(NonPagedPool, + (PSID_AND_ATTRIBUTES)ExAllocatePoolWithTag(NonPagedPool, uLength, TAG('T', 'O', 'K', 'u')); @@ -211,16 +212,16 @@ SepDuplicateToken(PIACCESS_TOKEN Token, uLength = AccessToken->PrivilegeCount * sizeof(LUID_AND_ATTRIBUTES); AccessToken->Privileges = - (PLUID_AND_ATTRIBUTES_ARRAY)ExAllocatePoolWithTag(NonPagedPool, + (PLUID_AND_ATTRIBUTES)ExAllocatePoolWithTag(NonPagedPool, uLength, TAG('T', 'O', 'K', 'p')); for (i = 0; i < AccessToken->PrivilegeCount; i++) { - RtlCopyLuid(&AccessToken->Privileges[i]->Luid, - &Token->Privileges[i]->Luid); - AccessToken->Privileges[i]->Attributes = - Token->Privileges[i]->Attributes; + RtlCopyLuid(&AccessToken->Privileges[i].Luid, + &Token->Privileges[i].Luid); + AccessToken->Privileges[i].Attributes = + Token->Privileges[i].Attributes; } if ( Token->DefaultDacl ) @@ -255,12 +256,12 @@ SepInitializeNewProcess(struct _EPROCESS* NewProcess, struct _EPROCESS* ParentProcess) { NTSTATUS Status; - PIACCESS_TOKEN pNewToken; - PIACCESS_TOKEN pParentToken; + PACCESS_TOKEN pNewToken; + PACCESS_TOKEN pParentToken; OBJECT_ATTRIBUTES ObjectAttributes; - pParentToken = (PIACCESS_TOKEN) ParentProcess->Token; + pParentToken = (PACCESS_TOKEN) ParentProcess->Token; InitializeObjectAttributes(&ObjectAttributes, NULL, @@ -282,10 +283,11 @@ SepInitializeNewProcess(struct _EPROCESS* NewProcess, return(STATUS_SUCCESS); } -NTSTATUS SeCopyClientToken(PIACCESS_TOKEN Token, + +NTSTATUS SeCopyClientToken(PACCESS_TOKEN Token, SECURITY_IMPERSONATION_LEVEL Level, KPROCESSOR_MODE PreviousMode, - PIACCESS_TOKEN* NewToken) + PACCESS_TOKEN* NewToken) { NTSTATUS Status; OBJECT_ATTRIBUTES ObjectAttributes; @@ -315,11 +317,11 @@ SeCreateClientSecurity(IN struct _ETHREAD *Thread, TOKEN_TYPE TokenType; UCHAR b; SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; - PIACCESS_TOKEN iToken; + PACCESS_TOKEN Token; ULONG g; - PIACCESS_TOKEN NewToken; + PACCESS_TOKEN NewToken; - iToken = PsReferenceEffectiveToken(Thread, + Token = PsReferenceEffectiveToken(Thread, &TokenType, &b, &ImpersonationLevel); @@ -331,9 +333,9 @@ SeCreateClientSecurity(IN struct _ETHREAD *Thread, { if (Qos->ImpersonationLevel > ImpersonationLevel) { - if (iToken != NULL) + if (Token != NULL) { - ObDereferenceObject(iToken); + ObDereferenceObject(Token); } return(STATUS_UNSUCCESSFUL); } @@ -341,9 +343,9 @@ SeCreateClientSecurity(IN struct _ETHREAD *Thread, ImpersonationLevel == 1 || (RemoteClient != FALSE && ImpersonationLevel != 3)) { - if (iToken != NULL) + if (Token != NULL) { - ObDereferenceObject(iToken); + ObDereferenceObject(Token); } return(STATUS_UNSUCCESSFUL); } @@ -361,14 +363,14 @@ SeCreateClientSecurity(IN struct _ETHREAD *Thread, if (Qos->ContextTrackingMode == 0) { ClientContext->DirectlyAccessClientToken = FALSE; - g = SeCopyClientToken(iToken, ImpersonationLevel, 0, &NewToken); + g = SeCopyClientToken(Token, ImpersonationLevel, 0, &NewToken); if (g >= 0) { // ObDeleteCapturedInsertInfo(NewToken); } - if (TokenType == TokenPrimary || iToken != NULL) + if (TokenType == TokenPrimary || Token != NULL) { - ObDereferenceObject(iToken); + ObDereferenceObject(Token); } if (g < 0) { @@ -380,16 +382,16 @@ SeCreateClientSecurity(IN struct _ETHREAD *Thread, ClientContext->DirectlyAccessClientToken = TRUE; if (RemoteClient != FALSE) { -// SeGetTokenControlInformation(iToken, &ClientContext->Unknown11); +// SeGetTokenControlInformation(Token, &ClientContext->Unknown11); } - NewToken = iToken; + NewToken = Token; } ClientContext->SecurityQos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE); ClientContext->SecurityQos.ImpersonationLevel = Qos->ImpersonationLevel; ClientContext->SecurityQos.ContextTrackingMode = Qos->ContextTrackingMode; ClientContext->SecurityQos.EffectiveOnly = Qos->EffectiveOnly; ClientContext->ServerIsRemote = RemoteClient; - ClientContext->ClientToken = NewToken; + ClientContext->Token = NewToken; return(STATUS_SUCCESS); } @@ -414,7 +416,7 @@ SeImpersonateClient(IN PSECURITY_CLIENT_CONTEXT ClientContext, ServerThread = PsGetCurrentThread(); } PsImpersonateClient(ServerThread, - ClientContext->ClientToken, + ClientContext->Token, 1, (ULONG)b, ClientContext->SecurityQos.ImpersonationLevel); @@ -424,7 +426,7 @@ SeImpersonateClient(IN PSECURITY_CLIENT_CONTEXT ClientContext, VOID STDCALL SepDeleteToken(PVOID ObjectBody) { - PIACCESS_TOKEN AccessToken = (PIACCESS_TOKEN)ObjectBody; + PACCESS_TOKEN AccessToken = (PACCESS_TOKEN)ObjectBody; if (AccessToken->UserAndGroups) ExFreePool(AccessToken->UserAndGroups); @@ -448,7 +450,7 @@ SepInitializeTokenImplementation(VOID) SepTokenObjectType->TotalObjects = 0; SepTokenObjectType->TotalHandles = 0; SepTokenObjectType->PagedPoolCharge = 0; - SepTokenObjectType->NonpagedPoolCharge = sizeof(IACCESS_TOKEN); + SepTokenObjectType->NonpagedPoolCharge = sizeof(ACCESS_TOKEN); SepTokenObjectType->Mapping = &SepTokenMapping; SepTokenObjectType->Dump = NULL; SepTokenObjectType->Open = NULL; @@ -465,6 +467,7 @@ SepInitializeTokenImplementation(VOID) L"Token"); } + NTSTATUS STDCALL NtQueryInformationToken(IN HANDLE TokenHandle, IN TOKEN_INFORMATION_CLASS TokenInformationClass, @@ -473,7 +476,7 @@ NtQueryInformationToken(IN HANDLE TokenHandle, OUT PULONG ReturnLength) { NTSTATUS Status; - PIACCESS_TOKEN iToken; + PACCESS_TOKEN Token; PVOID UnusedInfo; PVOID EndMem; PTOKEN_GROUPS PtrTokenGroups; @@ -485,7 +488,7 @@ NtQueryInformationToken(IN HANDLE TokenHandle, (TokenInformationClass == TokenSource) ? TOKEN_QUERY_SOURCE : TOKEN_QUERY, SepTokenObjectType, UserMode, - (PVOID*)&iToken, + (PVOID*)&Token, NULL); if (!NT_SUCCESS(Status)) { @@ -496,7 +499,7 @@ NtQueryInformationToken(IN HANDLE TokenHandle, { case TokenUser: DPRINT("NtQueryInformationToken(TokenUser)\n"); - uLength = RtlLengthSidAndAttributes(1, iToken->UserAndGroups); + uLength = RtlLengthSidAndAttributes(1, Token->UserAndGroups); if (TokenInformationLength < uLength) { Status = MmCopyToCaller(ReturnLength, &uLength, sizeof(ULONG)); @@ -506,7 +509,7 @@ NtQueryInformationToken(IN HANDLE TokenHandle, else { Status = RtlCopySidAndAttributesArray(1, - iToken->UserAndGroups, + Token->UserAndGroups, TokenInformationLength, TokenInformation, TokenInformation + 8, @@ -522,7 +525,7 @@ NtQueryInformationToken(IN HANDLE TokenHandle, case TokenGroups: DPRINT("NtQueryInformationToken(TokenGroups)\n"); - uLength = RtlLengthSidAndAttributes(iToken->UserAndGroupCount - 1, &iToken->UserAndGroups[1]) + sizeof(DWORD); + uLength = RtlLengthSidAndAttributes(Token->UserAndGroupCount - 1, &Token->UserAndGroups[1]) + sizeof(DWORD); if (TokenInformationLength < uLength) { Status = MmCopyToCaller(ReturnLength, &uLength, sizeof(ULONG)); @@ -531,13 +534,13 @@ NtQueryInformationToken(IN HANDLE TokenHandle, } else { - EndMem = TokenInformation + iToken->UserAndGroupCount * sizeof(SID_AND_ATTRIBUTES); + EndMem = TokenInformation + Token->UserAndGroupCount * sizeof(SID_AND_ATTRIBUTES); PtrTokenGroups = (PTOKEN_GROUPS)TokenInformation; - PtrTokenGroups->GroupCount = iToken->UserAndGroupCount - 1; - Status = RtlCopySidAndAttributesArray(iToken->UserAndGroupCount - 1, - (PSID_AND_ATTRIBUTES_ARRAY)&iToken->UserAndGroups[1], + PtrTokenGroups->GroupCount = Token->UserAndGroupCount - 1; + Status = RtlCopySidAndAttributesArray(Token->UserAndGroupCount - 1, + &Token->UserAndGroups[1], TokenInformationLength, - (PSID_AND_ATTRIBUTES_ARRAY)&PtrTokenGroups->Groups[0], + PtrTokenGroups->Groups, EndMem, &UnusedInfo, &uLength); @@ -551,7 +554,7 @@ NtQueryInformationToken(IN HANDLE TokenHandle, case TokenPrivileges: DPRINT("NtQueryInformationToken(TokenPrivileges)\n"); - uLength = sizeof(DWORD) + iToken->PrivilegeCount * sizeof(LUID_AND_ATTRIBUTES); + uLength = sizeof(DWORD) + Token->PrivilegeCount * sizeof(LUID_AND_ATTRIBUTES); if (TokenInformationLength < uLength) { Status = MmCopyToCaller(ReturnLength, &uLength, sizeof(ULONG)); @@ -563,11 +566,11 @@ NtQueryInformationToken(IN HANDLE TokenHandle, ULONG i; TOKEN_PRIVILEGES* pPriv = (TOKEN_PRIVILEGES*)TokenInformation; - pPriv->PrivilegeCount = iToken->PrivilegeCount; - for (i = 0; i < iToken->PrivilegeCount; i++) + pPriv->PrivilegeCount = Token->PrivilegeCount; + for (i = 0; i < Token->PrivilegeCount; i++) { - RtlCopyLuid(&pPriv->Privileges[i].Luid, &iToken->Privileges[i]->Luid); - pPriv->Privileges[i].Attributes = iToken->Privileges[i]->Attributes; + RtlCopyLuid(&pPriv->Privileges[i].Luid, &Token->Privileges[i].Luid); + pPriv->Privileges[i].Attributes = Token->Privileges[i].Attributes; } Status = STATUS_SUCCESS; } @@ -575,7 +578,7 @@ NtQueryInformationToken(IN HANDLE TokenHandle, case TokenOwner: DPRINT("NtQueryInformationToken(TokenOwner)\n"); - uLength = RtlLengthSid(iToken->UserAndGroups[iToken->DefaultOwnerIndex]->Sid) + sizeof(TOKEN_OWNER); + uLength = RtlLengthSid(Token->UserAndGroups[Token->DefaultOwnerIndex].Sid) + sizeof(TOKEN_OWNER); if (TokenInformationLength < uLength) { Status = MmCopyToCaller(ReturnLength, &uLength, sizeof(ULONG)); @@ -588,7 +591,7 @@ NtQueryInformationToken(IN HANDLE TokenHandle, (PSID)(((PTOKEN_OWNER)TokenInformation) + 1); RtlCopySid(TokenInformationLength - sizeof(TOKEN_OWNER), ((PTOKEN_OWNER)TokenInformation)->Owner, - iToken->UserAndGroups[iToken->DefaultOwnerIndex]->Sid); + Token->UserAndGroups[Token->DefaultOwnerIndex].Sid); Status = STATUS_SUCCESS; } break; @@ -596,7 +599,7 @@ NtQueryInformationToken(IN HANDLE TokenHandle, case TokenPrimaryGroup: DPRINT("NtQueryInformationToken(TokenPrimaryGroup)," "Token->PrimaryGroup = 0x%08x\n", Token->PrimaryGroup); - uLength = RtlLengthSid(iToken->PrimaryGroup) + sizeof(TOKEN_PRIMARY_GROUP); + uLength = RtlLengthSid(Token->PrimaryGroup) + sizeof(TOKEN_PRIMARY_GROUP); if (TokenInformationLength < uLength) { Status = MmCopyToCaller(ReturnLength, &uLength, sizeof(ULONG)); @@ -609,7 +612,7 @@ NtQueryInformationToken(IN HANDLE TokenHandle, (PSID)(((PTOKEN_PRIMARY_GROUP)TokenInformation) + 1); RtlCopySid(TokenInformationLength - sizeof(TOKEN_PRIMARY_GROUP), ((PTOKEN_PRIMARY_GROUP)TokenInformation)->PrimaryGroup, - iToken->PrimaryGroup); + Token->PrimaryGroup); Status = STATUS_SUCCESS; } break; @@ -617,14 +620,14 @@ NtQueryInformationToken(IN HANDLE TokenHandle, case TokenDefaultDacl: DPRINT("NtQueryInformationToken(TokenDefaultDacl)\n"); PtrDefaultDacl = (PTOKEN_DEFAULT_DACL) TokenInformation; - uLength = (iToken->DefaultDacl ? iToken->DefaultDacl->AclSize : 0) + sizeof(TOKEN_DEFAULT_DACL); + uLength = (Token->DefaultDacl ? Token->DefaultDacl->AclSize : 0) + sizeof(TOKEN_DEFAULT_DACL); if (TokenInformationLength < uLength) { Status = MmCopyToCaller(ReturnLength, &uLength, sizeof(ULONG)); if (NT_SUCCESS(Status)) Status = STATUS_BUFFER_TOO_SMALL; } - else if (!iToken->DefaultDacl) + else if (!Token->DefaultDacl) { PtrDefaultDacl->DefaultDacl = 0; Status = MmCopyToCaller(ReturnLength, &uLength, sizeof(ULONG)); @@ -633,8 +636,8 @@ NtQueryInformationToken(IN HANDLE TokenHandle, { PtrDefaultDacl->DefaultDacl = (PACL) (PtrDefaultDacl + 1); memmove(PtrDefaultDacl->DefaultDacl, - iToken->DefaultDacl, - iToken->DefaultDacl->AclSize); + Token->DefaultDacl, + Token->DefaultDacl->AclSize); Status = MmCopyToCaller(ReturnLength, &uLength, sizeof(ULONG)); } break; @@ -650,7 +653,7 @@ NtQueryInformationToken(IN HANDLE TokenHandle, } else { - Status = MmCopyToCaller(TokenInformation, &iToken->TokenSource, sizeof(TOKEN_SOURCE)); + Status = MmCopyToCaller(TokenInformation, &Token->TokenSource, sizeof(TOKEN_SOURCE)); } break; @@ -665,7 +668,7 @@ NtQueryInformationToken(IN HANDLE TokenHandle, } else { - Status = MmCopyToCaller(TokenInformation, &iToken->TokenType, sizeof(TOKEN_TYPE)); + Status = MmCopyToCaller(TokenInformation, &Token->TokenType, sizeof(TOKEN_TYPE)); } break; @@ -680,8 +683,7 @@ NtQueryInformationToken(IN HANDLE TokenHandle, } else { - Status = MmCopyToCaller(TokenInformation, &iToken->ImpersonationLevel, - sizeof(SECURITY_IMPERSONATION_LEVEL)); + Status = MmCopyToCaller(TokenInformation, &Token->ImpersonationLevel, sizeof(SECURITY_IMPERSONATION_LEVEL)); } break; @@ -697,25 +699,23 @@ NtQueryInformationToken(IN HANDLE TokenHandle, else { PtrTokenStatistics = (PTOKEN_STATISTICS)TokenInformation; - PtrTokenStatistics->TokenId = iToken->TokenId; - PtrTokenStatistics->AuthenticationId = iToken->AuthenticationId; - PtrTokenStatistics->ExpirationTime = iToken->ExpirationTime; - PtrTokenStatistics->TokenType = iToken->TokenType; - PtrTokenStatistics->ImpersonationLevel = iToken->ImpersonationLevel; - PtrTokenStatistics->DynamicCharged = iToken->DynamicCharged; - PtrTokenStatistics->DynamicAvailable = iToken->DynamicAvailable; - PtrTokenStatistics->GroupCount = iToken->UserAndGroupCount - 1; - PtrTokenStatistics->PrivilegeCount = iToken->PrivilegeCount; - PtrTokenStatistics->ModifiedId = iToken->ModifiedId; + PtrTokenStatistics->TokenId = Token->TokenId; + PtrTokenStatistics->AuthenticationId = Token->AuthenticationId; + PtrTokenStatistics->ExpirationTime = Token->ExpirationTime; + PtrTokenStatistics->TokenType = Token->TokenType; + PtrTokenStatistics->ImpersonationLevel = Token->ImpersonationLevel; + PtrTokenStatistics->DynamicCharged = Token->DynamicCharged; + PtrTokenStatistics->DynamicAvailable = Token->DynamicAvailable; + PtrTokenStatistics->GroupCount = Token->UserAndGroupCount - 1; + PtrTokenStatistics->PrivilegeCount = Token->PrivilegeCount; + PtrTokenStatistics->ModifiedId = Token->ModifiedId; Status = STATUS_SUCCESS; } break; - default: - break; } - ObDereferenceObject(iToken); + ObDereferenceObject(Token); return(Status); } @@ -732,16 +732,16 @@ NtSetInformationToken(IN HANDLE TokenHandle, NTSTATUS STDCALL -NtDuplicateToken(IN HANDLE ExistingTokenHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN BOOLEAN EffectiveOnly, - IN TOKEN_TYPE TokenType, - OUT PHANDLE NewTokenHandle) +NtDuplicateToken(IN HANDLE ExistingTokenHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, + IN TOKEN_TYPE TokenType, + OUT PHANDLE NewTokenHandle) { #if 0 - PIACCESS_TOKEN Token; - PIACCESS_TOKEN NewToken; + PACCESS_TOKEN Token; + PACCESS_TOKEN NewToken; NTSTATUS Status; ULONG ExistingImpersonationLevel; @@ -765,10 +765,10 @@ NtDuplicateToken(IN HANDLE ExistingTokenHandle, #endif } -VOID SepAdjustGroups(PIACCESS_TOKEN Token, +VOID SepAdjustGroups(PACCESS_TOKEN Token, ULONG a, BOOLEAN ResetToDefault, - PSID_AND_ATTRIBUTES_ARRAY Groups, + PSID_AND_ATTRIBUTES Groups, ULONG b, KPROCESSOR_MODE PreviousMode, ULONG c, @@ -790,7 +790,7 @@ NtAdjustGroupsToken(IN HANDLE TokenHandle, { #if 0 NTSTATUS Status; - PIACCESS_TOKEN Token; + PACCESS_TOKEN Token; ULONG a; ULONG b; ULONG c; @@ -820,7 +820,7 @@ NtAdjustGroupsToken(IN HANDLE TokenHandle, #if 0 -NTSTATUS SepAdjustPrivileges(PIACCESS_TOKEN Token, // 0x8 +NTSTATUS SepAdjustPrivileges(PACCESS_TOKEN Token, // 0x8 ULONG a, // 0xC KPROCESSOR_MODE PreviousMode, // 0x10 ULONG PrivilegeCount, // 0x14 @@ -928,32 +928,33 @@ SepCreateSystemProcessToken(struct _EPROCESS* Process) ULONG uAuthUserLength = RtlLengthSid(SeAuthenticatedUserSid); ULONG uAdminsLength = RtlLengthSid(SeAliasAdminsSid); - PIACCESS_TOKEN AccessToken; + PACCESS_TOKEN AccessToken; PVOID SidArea; - DPRINT("SepCreateSystemProcessToken\n"); - /* * Initialize the token */ - Status = ObRosCreateObject(NULL, + Status = ObCreateObject(NULL, TOKEN_ALL_ACCESS, NULL, SepTokenObjectType, (PVOID*)&AccessToken); + Status = NtAllocateLocallyUniqueId(&AccessToken->TokenId); if (!NT_SUCCESS(Status)) { ObDereferenceObject(AccessToken); return(Status); } + Status = NtAllocateLocallyUniqueId(&AccessToken->ModifiedId); if (!NT_SUCCESS(Status)) { ObDereferenceObject(AccessToken); return(Status); } + AccessToken->AuthenticationId.QuadPart = SYSTEM_LUID; AccessToken->TokenType = TokenPrimary; @@ -970,31 +971,31 @@ SepCreateSystemProcessToken(struct _EPROCESS* Process) uSize += uAdminsLength; AccessToken->UserAndGroups = - (PSID_AND_ATTRIBUTES_ARRAY)ExAllocatePoolWithTag(NonPagedPool, + (PSID_AND_ATTRIBUTES)ExAllocatePoolWithTag(NonPagedPool, uSize, TAG('T', 'O', 'K', 'u')); SidArea = &AccessToken->UserAndGroups[AccessToken->UserAndGroupCount]; i = 0; - AccessToken->UserAndGroups[i]->Sid = (PSID) SidArea; - AccessToken->UserAndGroups[i++]->Attributes = 0; + AccessToken->UserAndGroups[i].Sid = (PSID) SidArea; + AccessToken->UserAndGroups[i++].Attributes = 0; RtlCopySid(uLocalSystemLength, SidArea, SeLocalSystemSid); SidArea += uLocalSystemLength; AccessToken->DefaultOwnerIndex = i; - AccessToken->UserAndGroups[i]->Sid = (PSID) SidArea; + AccessToken->UserAndGroups[i].Sid = (PSID) SidArea; AccessToken->PrimaryGroup = (PSID) SidArea; - AccessToken->UserAndGroups[i++]->Attributes = SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT; + AccessToken->UserAndGroups[i++].Attributes = SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT; Status = RtlCopySid(uAdminsLength, SidArea, SeAliasAdminsSid); SidArea += uAdminsLength; - AccessToken->UserAndGroups[i]->Sid = (PSID) SidArea; - AccessToken->UserAndGroups[i++]->Attributes = SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY; + AccessToken->UserAndGroups[i].Sid = (PSID) SidArea; + AccessToken->UserAndGroups[i++].Attributes = SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY; RtlCopySid(uWorldLength, SidArea, SeWorldSid); SidArea += uWorldLength; - AccessToken->UserAndGroups[i]->Sid = (PSID) SidArea; - AccessToken->UserAndGroups[i++]->Attributes = SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY; + AccessToken->UserAndGroups[i].Sid = (PSID) SidArea; + AccessToken->UserAndGroups[i++].Attributes = SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY; RtlCopySid(uAuthUserLength, SidArea, SeAuthenticatedUserSid); SidArea += uAuthUserLength; @@ -1002,83 +1003,83 @@ SepCreateSystemProcessToken(struct _EPROCESS* Process) uSize = AccessToken->PrivilegeCount * sizeof(LUID_AND_ATTRIBUTES); AccessToken->Privileges = - (PLUID_AND_ATTRIBUTES_ARRAY)ExAllocatePoolWithTag(NonPagedPool, + (PLUID_AND_ATTRIBUTES)ExAllocatePoolWithTag(NonPagedPool, uSize, TAG('T', 'O', 'K', 'p')); i = 0; - AccessToken->Privileges[i]->Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; - AccessToken->Privileges[i++]->Luid = SeTcbPrivilege; + AccessToken->Privileges[i].Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; + AccessToken->Privileges[i++].Luid = SeTcbPrivilege; - AccessToken->Privileges[i]->Attributes = 0; - AccessToken->Privileges[i++]->Luid = SeCreateTokenPrivilege; + AccessToken->Privileges[i].Attributes = 0; + AccessToken->Privileges[i++].Luid = SeCreateTokenPrivilege; - AccessToken->Privileges[i]->Attributes = 0; - AccessToken->Privileges[i++]->Luid = SeTakeOwnershipPrivilege; + AccessToken->Privileges[i].Attributes = 0; + AccessToken->Privileges[i++].Luid = SeTakeOwnershipPrivilege; - AccessToken->Privileges[i]->Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; - AccessToken->Privileges[i++]->Luid = SeCreatePagefilePrivilege; + AccessToken->Privileges[i].Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; + AccessToken->Privileges[i++].Luid = SeCreatePagefilePrivilege; - AccessToken->Privileges[i]->Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; - AccessToken->Privileges[i++]->Luid = SeLockMemoryPrivilege; + AccessToken->Privileges[i].Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; + AccessToken->Privileges[i++].Luid = SeLockMemoryPrivilege; - AccessToken->Privileges[i]->Attributes = 0; - AccessToken->Privileges[i++]->Luid = SeAssignPrimaryTokenPrivilege; + AccessToken->Privileges[i].Attributes = 0; + AccessToken->Privileges[i++].Luid = SeAssignPrimaryTokenPrivilege; - AccessToken->Privileges[i]->Attributes = 0; - AccessToken->Privileges[i++]->Luid = SeIncreaseQuotaPrivilege; + AccessToken->Privileges[i].Attributes = 0; + AccessToken->Privileges[i++].Luid = SeIncreaseQuotaPrivilege; - AccessToken->Privileges[i]->Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; - AccessToken->Privileges[i++]->Luid = SeIncreaseBasePriorityPrivilege; + AccessToken->Privileges[i].Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; + AccessToken->Privileges[i++].Luid = SeIncreaseBasePriorityPrivilege; - AccessToken->Privileges[i]->Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; - AccessToken->Privileges[i++]->Luid = SeCreatePermanentPrivilege; + AccessToken->Privileges[i].Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; + AccessToken->Privileges[i++].Luid = SeCreatePermanentPrivilege; - AccessToken->Privileges[i]->Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; - AccessToken->Privileges[i++]->Luid = SeDebugPrivilege; + AccessToken->Privileges[i].Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; + AccessToken->Privileges[i++].Luid = SeDebugPrivilege; - AccessToken->Privileges[i]->Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; - AccessToken->Privileges[i++]->Luid = SeAuditPrivilege; + AccessToken->Privileges[i].Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; + AccessToken->Privileges[i++].Luid = SeAuditPrivilege; - AccessToken->Privileges[i]->Attributes = 0; - AccessToken->Privileges[i++]->Luid = SeSecurityPrivilege; + AccessToken->Privileges[i].Attributes = 0; + AccessToken->Privileges[i++].Luid = SeSecurityPrivilege; - AccessToken->Privileges[i]->Attributes = 0; - AccessToken->Privileges[i++]->Luid = SeSystemEnvironmentPrivilege; + AccessToken->Privileges[i].Attributes = 0; + AccessToken->Privileges[i++].Luid = SeSystemEnvironmentPrivilege; - AccessToken->Privileges[i]->Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; - AccessToken->Privileges[i++]->Luid = SeChangeNotifyPrivilege; + AccessToken->Privileges[i].Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; + AccessToken->Privileges[i++].Luid = SeChangeNotifyPrivilege; - AccessToken->Privileges[i]->Attributes = 0; - AccessToken->Privileges[i++]->Luid = SeBackupPrivilege; + AccessToken->Privileges[i].Attributes = 0; + AccessToken->Privileges[i++].Luid = SeBackupPrivilege; - AccessToken->Privileges[i]->Attributes = 0; - AccessToken->Privileges[i++]->Luid = SeRestorePrivilege; + AccessToken->Privileges[i].Attributes = 0; + AccessToken->Privileges[i++].Luid = SeRestorePrivilege; - AccessToken->Privileges[i]->Attributes = 0; - AccessToken->Privileges[i++]->Luid = SeShutdownPrivilege; + AccessToken->Privileges[i].Attributes = 0; + AccessToken->Privileges[i++].Luid = SeShutdownPrivilege; - AccessToken->Privileges[i]->Attributes = 0; - AccessToken->Privileges[i++]->Luid = SeLoadDriverPrivilege; + AccessToken->Privileges[i].Attributes = 0; + AccessToken->Privileges[i++].Luid = SeLoadDriverPrivilege; - AccessToken->Privileges[i]->Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; - AccessToken->Privileges[i++]->Luid = SeProfileSingleProcessPrivilege; + AccessToken->Privileges[i].Attributes = SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED; + AccessToken->Privileges[i++].Luid = SeProfileSingleProcessPrivilege; - AccessToken->Privileges[i]->Attributes = 0; - AccessToken->Privileges[i++]->Luid = SeSystemtimePrivilege; + AccessToken->Privileges[i].Attributes = 0; + AccessToken->Privileges[i++].Luid = SeSystemtimePrivilege; #if 0 - AccessToken->Privileges[i]->Attributes = 0; - AccessToken->Privileges[i++]->Luid = SeUndockPrivilege; + AccessToken->Privileges[i].Attributes = 0; + AccessToken->Privileges[i++].Luid = SeUndockPrivilege; - AccessToken->Privileges[i]->Attributes = 0; - AccessToken->Privileges[i++]->Luid = SeManageVolumePrivilege; + AccessToken->Privileges[i].Attributes = 0; + AccessToken->Privileges[i++].Luid = SeManageVolumePrivilege; #endif assert( i == 20 ); uSize = sizeof(ACL); - uSize += sizeof(ROS_ACE_HEADER) + uLocalSystemLength; - uSize += sizeof(ROS_ACE_HEADER) + uAdminsLength; + uSize += sizeof(ACE_HEADER) + uLocalSystemLength; + uSize += sizeof(ACE_HEADER) + uAdminsLength; uSize = (uSize & (~3)) + 8; AccessToken->DefaultDacl = (PACL) ExAllocatePoolWithTag(NonPagedPool, @@ -1089,15 +1090,18 @@ SepCreateSystemProcessToken(struct _EPROCESS* Process) { Status = RtlAddAccessAllowedAce(AccessToken->DefaultDacl, ACL_REVISION, GENERIC_ALL, SeLocalSystemSid); } + if ( NT_SUCCESS(Status) ) { Status = RtlAddAccessAllowedAce(AccessToken->DefaultDacl, ACL_REVISION, GENERIC_READ|GENERIC_EXECUTE|READ_CONTROL, SeAliasAdminsSid); } + if ( ! NT_SUCCESS(Status) ) { ObDereferenceObject(AccessToken); return Status; } + Process->Token = AccessToken; return(STATUS_SUCCESS); } @@ -1118,7 +1122,7 @@ NtCreateToken(OUT PHANDLE UnsafeTokenHandle, IN PTOKEN_SOURCE TokenSource) { HANDLE TokenHandle; - PIACCESS_TOKEN AccessToken; + PACCESS_TOKEN AccessToken; NTSTATUS Status; OBJECT_ATTRIBUTES SafeObjectAttributes; POBJECT_ATTRIBUTES ObjectAttributes; @@ -1144,14 +1148,14 @@ NtCreateToken(OUT PHANDLE UnsafeTokenHandle, if (!NT_SUCCESS(Status)) return(Status); - Status = ObRosCreateObject(&TokenHandle, + Status = ObCreateObject(&TokenHandle, DesiredAccess, ObjectAttributes, SepTokenObjectType, (PVOID*)&AccessToken); if (!NT_SUCCESS(Status)) { - DPRINT1("ObRosCreateObject() failed (Status %lx)\n"); + DPRINT1("ObCreateObject() failed (Status %lx)\n"); return(Status); } @@ -1172,12 +1176,11 @@ NtCreateToken(OUT PHANDLE UnsafeTokenHandle, AccessToken->Privileges = 0; AccessToken->TokenType = TokenType; - AccessToken->ImpersonationLevel = ((PSECURITY_QUALITY_OF_SERVICE) - ObjectAttributes->SecurityQualityOfService)->ImpersonationLevel; + AccessToken->ImpersonationLevel = ObjectAttributes->SecurityQualityOfService->ImpersonationLevel; /* * Normally we would just point these members into the variable information - * area; however, our ObRosCreateObject() call can't allocate a variable information + * area; however, our ObCreateObject() call can't allocate a variable information * area, so we allocate them seperately and provide a destroy function. */ @@ -1187,23 +1190,23 @@ NtCreateToken(OUT PHANDLE UnsafeTokenHandle, uLength += RtlLengthSid(TokenGroups->Groups[i].Sid); AccessToken->UserAndGroups = - (PSID_AND_ATTRIBUTES_ARRAY)ExAllocatePoolWithTag(NonPagedPool, + (PSID_AND_ATTRIBUTES)ExAllocatePoolWithTag(NonPagedPool, uLength, TAG('T', 'O', 'K', 'u')); EndMem = &AccessToken->UserAndGroups[AccessToken->UserAndGroupCount]; Status = RtlCopySidAndAttributesArray(1, - (PSID_AND_ATTRIBUTES_ARRAY)&TokenUser->User, + &TokenUser->User, uLength, - (PSID_AND_ATTRIBUTES_ARRAY)AccessToken->UserAndGroups, + AccessToken->UserAndGroups, EndMem, &EndMem, &uLength); if (NT_SUCCESS(Status)) { Status = RtlCopySidAndAttributesArray(TokenGroups->GroupCount, - (PSID_AND_ATTRIBUTES_ARRAY)&TokenGroups->Groups[0], + TokenGroups->Groups, uLength, &AccessToken->UserAndGroups[1], EndMem, @@ -1223,7 +1226,7 @@ NtCreateToken(OUT PHANDLE UnsafeTokenHandle, { uLength = TokenPrivileges->PrivilegeCount * sizeof(LUID_AND_ATTRIBUTES); AccessToken->Privileges = - (PLUID_AND_ATTRIBUTES_ARRAY)ExAllocatePoolWithTag(NonPagedPool, + (PLUID_AND_ATTRIBUTES)ExAllocatePoolWithTag(NonPagedPool, uLength, TAG('T', 'O', 'K', 'p')); @@ -1270,18 +1273,14 @@ NtCreateToken(OUT PHANDLE UnsafeTokenHandle, SECURITY_IMPERSONATION_LEVEL STDCALL SeTokenImpersonationLevel(IN PACCESS_TOKEN Token) { - PIACCESS_TOKEN iToken = (PIACCESS_TOKEN)Token; - - return(iToken->ImpersonationLevel); + return(Token->ImpersonationLevel); } TOKEN_TYPE STDCALL SeTokenType(IN PACCESS_TOKEN Token) { - PIACCESS_TOKEN iToken = (PIACCESS_TOKEN)Token; - - return(iToken->TokenType); + return(Token->TokenType); } /* EOF */ diff --git a/reactos/rules.mak b/reactos/rules.mak index 02904d98295..355c468cc47 100644 --- a/reactos/rules.mak +++ b/reactos/rules.mak @@ -92,7 +92,7 @@ endif CXXFLAGS = $(CFLAGS) NFLAGS = -i$(PATH_TO_TOP)/include/ -f$(NASM_FORMAT) -d$(NASM_FORMAT) -ASFLAGS := $(ASFLAGS) -I$(PATH_TO_TOP)/include -D AS_INVOKED +ASFLAGS := $(ASFLAGS) -I$(PATH_TO_TOP)/include -D__ASM__ # Developer Kits @@ -100,11 +100,11 @@ DK_PATH=$(PATH_TO_TOP)/dk # Native and kernel mode DDK_PATH=$(DK_PATH)/nkm DDK_PATH_LIB=$(DDK_PATH)/lib -DDK_PATH_INC=$(DDK_PATH)/include +DDK_PATH_INC=$(PATH_TO_TOP)/include # Win32 SDK_PATH=$(DK_PATH)/w32 SDK_PATH_LIB=$(SDK_PATH)/lib -SDK_PATH_INC=$(SDK_PATH)/include +SDK_PATH_INC=$(PATH_TO_TOP)/include # POSIX+ XDK_PATH=$(DK_PATH)/psx XDK_PATH_LIB=$(XDK_PATH)/lib diff --git a/reactos/services/eventlog/eventlog.c b/reactos/services/eventlog/eventlog.c index 3fdfc4f33c1..c84dd9508ab 100644 --- a/reactos/services/eventlog/eventlog.c +++ b/reactos/services/eventlog/eventlog.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: eventlog.c,v 1.3 2002/09/07 15:13:07 chorns Exp $ +/* $Id: eventlog.c,v 1.4 2002/09/08 10:23:44 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -29,9 +29,9 @@ #define UNICODE -#include -#define NTOS_USER_MODE +#define NTOS_MODE_USER #include +#include #include "eventlog.h" diff --git a/reactos/services/eventlog/eventlog.rc b/reactos/services/eventlog/eventlog.rc index 2091e65808a..fff9e1db3ee 100644 --- a/reactos/services/eventlog/eventlog.rc +++ b/reactos/services/eventlog/eventlog.rc @@ -1,5 +1,5 @@ -#include -#include +#include "../../include/defines.h" +#include "../../include/reactos/resource.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/services/eventlog/logport.c b/reactos/services/eventlog/logport.c index db27e377a46..dd60ed754f2 100644 --- a/reactos/services/eventlog/logport.c +++ b/reactos/services/eventlog/logport.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: logport.c,v 1.3 2002/09/07 15:13:07 chorns Exp $ +/* $Id: logport.c,v 1.4 2002/09/08 10:23:44 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -29,9 +29,10 @@ #define UNICODE -#include -#define NTOS_USER_MODE +#define NTOS_MODE_USER #include +#include +#include #include "eventlog.h" diff --git a/reactos/services/rpcss/rpcss.c b/reactos/services/rpcss/rpcss.c index f725e201ad4..145946a03e6 100644 --- a/reactos/services/rpcss/rpcss.c +++ b/reactos/services/rpcss/rpcss.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: rpcss.c,v 1.2 2002/09/07 15:13:07 chorns Exp $ +/* $Id: rpcss.c,v 1.3 2002/09/08 10:23:44 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -29,9 +29,9 @@ #define UNICODE -#include -#define NTOS_USER_MODE +#define NTOS_MODE_USER #include +#include //#include "services.h" diff --git a/reactos/services/rpcss/rpcss.rc b/reactos/services/rpcss/rpcss.rc index e4072cd6798..5cd1dba4a24 100644 --- a/reactos/services/rpcss/rpcss.rc +++ b/reactos/services/rpcss/rpcss.rc @@ -1,5 +1,5 @@ -#include -#include +#include "../../include/defines.h" +#include "../../include/reactos/resource.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/subsys/csrss/api.h b/reactos/subsys/csrss/api.h index 20a2027cedc..7c1836c3690 100644 --- a/reactos/subsys/csrss/api.h +++ b/reactos/subsys/csrss/api.h @@ -1,7 +1,6 @@ #ifndef _CSRSS_API_H #define _CSRSS_API_H -#define NTOS_USER_MODE #include #include diff --git a/reactos/subsys/csrss/api/conio.c b/reactos/subsys/csrss/api/conio.c index 51051149e26..a0765d1f667 100644 --- a/reactos/subsys/csrss/api/conio.c +++ b/reactos/subsys/csrss/api/conio.c @@ -1,4 +1,4 @@ -/* $Id: conio.c,v 1.33 2002/09/07 15:13:08 chorns Exp $ +/* $Id: conio.c,v 1.34 2002/09/08 10:23:45 chorns Exp $ * * reactos/subsys/csrss/api/conio.c * @@ -9,11 +9,12 @@ /* INCLUDES ******************************************************************/ -#include -#define NTOS_USER_MODE -#include +#include + #include #include "api.h" +#include +#include #define NDEBUG #include @@ -21,6 +22,7 @@ #define LOCK RtlEnterCriticalSection(&ActiveConsoleLock) #define UNLOCK RtlLeaveCriticalSection(&ActiveConsoleLock) +/* FIXME: Is there a way to create real aliasses with gcc? [CSH] */ #define ALIAS(Name, Target) typeof(Target) Name = Target @@ -29,7 +31,7 @@ static HANDLE ConsoleDeviceHandle; static HANDLE KeyboardDeviceHandle; static PCSRSS_CONSOLE ActiveConsole; -RTL_CRITICAL_SECTION ActiveConsoleLock; +CRITICAL_SECTION ActiveConsoleLock; static COORD PhysicalConsoleSize; /* FUNCTIONS *****************************************************************/ @@ -43,7 +45,7 @@ CSR_API(CsrAllocConsole) Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); if( ProcessData->Console ) { Reply->Status = STATUS_INVALID_PARAMETER; @@ -112,7 +114,7 @@ CSR_API(CsrFreeConsole) { Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); Reply->Status = STATUS_NOT_IMPLEMENTED; @@ -133,7 +135,7 @@ CSR_API(CsrReadConsole) nNumberOfCharsToRead = Request->Data.ReadConsoleRequest.NrCharactersToRead > CSRSS_MAX_READ_CONSOLE_REQUEST ? CSRSS_MAX_READ_CONSOLE_REQUEST : Request->Data.ReadConsoleRequest.NrCharactersToRead; Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = Reply->Header.MessageSize - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); Buffer = Reply->Data.ReadConsoleReply.Buffer; Reply->Data.ReadConsoleReply.EventHandle = ProcessData->ConsoleEvent; LOCK; @@ -612,7 +614,7 @@ CSR_API(CsrWriteConsole) Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); LOCK; if( !NT_SUCCESS( CsrGetObject( ProcessData, Request->Data.WriteConsoleRequest.ConsoleHandle, @@ -1114,7 +1116,7 @@ CSR_API(CsrGetScreenBufferInfo) Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); LOCK; if( !NT_SUCCESS( CsrGetObject( ProcessData, Request->Data.ScreenBufferInfoRequest.ConsoleHandle, @@ -1157,7 +1159,7 @@ CSR_API(CsrSetCursor) Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); LOCK; if( !NT_SUCCESS( CsrGetObject( ProcessData, Request->Data.SetCursorRequest.ConsoleHandle, @@ -1192,7 +1194,7 @@ CSR_API(CsrWriteConsoleOutputChar) Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); LOCK; if( !NT_SUCCESS( CsrGetObject( ProcessData, Request->Data.WriteConsoleOutputCharRequest.ConsoleHandle, (Object_t **)&Buff ) ) || Buff->Header.Type != CSRSS_SCREEN_BUFFER_MAGIC ) { @@ -1235,7 +1237,7 @@ CSR_API(CsrFillOutputChar) Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); LOCK; if( !NT_SUCCESS( CsrGetObject( ProcessData, Request->Data.FillOutputRequest.ConsoleHandle, (Object_t **)&Buff ) ) || Buff->Header.Type != CSRSS_SCREEN_BUFFER_MAGIC ) @@ -1271,7 +1273,7 @@ CSR_API(CsrReadInputEvent) Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); Reply->Data.ReadInputReply.Event = ProcessData->ConsoleEvent; LOCK; @@ -1321,7 +1323,7 @@ CSR_API(CsrWriteConsoleOutputAttrib) Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); LOCK; Status = CsrGetObject( ProcessData, Request->Data.WriteConsoleOutputAttribRequest.ConsoleHandle, (Object_t **)&Buff ); if( !NT_SUCCESS( Status ) || (Status = Buff->Header.Type == CSRSS_SCREEN_BUFFER_MAGIC ? 0 : STATUS_INVALID_HANDLE )) @@ -1379,7 +1381,7 @@ CSR_API(CsrFillOutputAttrib) Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); LOCK; Status = CsrGetObject( ProcessData, Request->Data.FillOutputAttribRequest.ConsoleHandle, (Object_t **)&Buff ); if( !NT_SUCCESS( Status ) || (Status = Buff->Header.Type == CSRSS_SCREEN_BUFFER_MAGIC ? 0 : STATUS_INVALID_HANDLE )) @@ -1434,7 +1436,7 @@ CSR_API(CsrGetCursorInfo) Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); LOCK; Status = CsrGetObject( ProcessData, Request->Data.GetCursorInfoRequest.ConsoleHandle, (Object_t **)&Buff ); if( !NT_SUCCESS( Status ) || (Status = Buff->Header.Type == CSRSS_SCREEN_BUFFER_MAGIC ? 0 : STATUS_INVALID_HANDLE )) @@ -1456,7 +1458,7 @@ CSR_API(CsrSetCursorInfo) Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); LOCK; Status = CsrGetObject( ProcessData, Request->Data.SetCursorInfoRequest.ConsoleHandle, (Object_t **)&Buff ); @@ -1490,7 +1492,7 @@ CSR_API(CsrSetTextAttrib) Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); LOCK; Status = CsrGetObject( ProcessData, Request->Data.SetAttribRequest.ConsoleHandle, (Object_t **)&Buff ); if( !NT_SUCCESS( Status ) || (Status = Buff->Header.Type == CSRSS_SCREEN_BUFFER_MAGIC ? 0 : STATUS_INVALID_HANDLE )) @@ -1524,7 +1526,7 @@ CSR_API(CsrSetConsoleMode) PCSRSS_SCREEN_BUFFER Buff; Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); - Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE); + Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE_HEADER); LOCK; Status = CsrGetObject( ProcessData, Request->Data.SetConsoleModeRequest.ConsoleHandle, @@ -1558,7 +1560,7 @@ CSR_API(CsrGetConsoleMode) PCSRSS_SCREEN_BUFFER Buff; /* gee, I really wish I could use an anonymous union here */ Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); - Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE); + Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE_HEADER); LOCK; Status = CsrGetObject( ProcessData, Request->Data.GetConsoleModeRequest.ConsoleHandle, @@ -1586,7 +1588,7 @@ CSR_API(CsrCreateScreenBuffer) NTSTATUS Status; Reply->Header.MessageSize = sizeof( CSRSS_API_REPLY ); - Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE); + Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE_HEADER); if( !Buff ) Reply->Status = STATUS_INSUFFICIENT_RESOURCES; LOCK; @@ -1609,7 +1611,7 @@ CSR_API(CsrSetScreenBuffer) PCSRSS_SCREEN_BUFFER Buff; Reply->Header.MessageSize = sizeof( CSRSS_API_REPLY ); - Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE); + Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE_HEADER); LOCK; Status = CsrGetObject( ProcessData, Request->Data.SetActiveScreenBufferRequest.OutputHandle, (Object_t **)&Buff ); if( !NT_SUCCESS( Status ) ) @@ -1637,7 +1639,7 @@ CSR_API(CsrSetTitle) PCSRSS_CONSOLE Console; Reply->Header.MessageSize = sizeof( CSRSS_API_REPLY ); - Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE); + Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE_HEADER); LOCK; Status = CsrGetObject( ProcessData, Request->Data.SetTitleRequest.Console, (Object_t **)&Console ); if( !NT_SUCCESS( Status ) ) @@ -1660,7 +1662,7 @@ CSR_API(CsrGetTitle) Reply->Header.MessageSize = sizeof (CSRSS_API_REPLY); Reply->Header.DataSize = sizeof (CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + - sizeof(LPC_MESSAGE_HEADER); LOCK; Status = CsrGetObject ( ProcessData, @@ -1704,7 +1706,7 @@ CSR_API(CsrWriteConsoleOutput) DWORD PSize; Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); - Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE); + Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE_HEADER); LOCK; Status = CsrGetObject( ProcessData, Request->Data.WriteConsoleOutputRequest.ConsoleHandle, (Object_t **)&Buff ); if( !NT_SUCCESS( Status ) || (Status = Buff->Header.Type == CSRSS_SCREEN_BUFFER_MAGIC ? STATUS_SUCCESS : STATUS_INVALID_HANDLE )) @@ -1774,7 +1776,7 @@ CSR_API(CsrFlushInputBuffer) NTSTATUS Status; Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); - Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE); + Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE_HEADER); LOCK; Status = CsrGetObject( ProcessData, Request->Data.FlushInputBufferRequest.ConsoleInput, (Object_t **)&Console ); if( !NT_SUCCESS( Status ) || (Status = Console->Header.Type == CSRSS_CONSOLE_MAGIC ? STATUS_SUCCESS : STATUS_INVALID_HANDLE )) @@ -1823,7 +1825,7 @@ CSR_API(CsrScrollConsoleScreenBuffer) ALIAS(Fill,Request->Data.ScrollConsoleScreenBufferRequest.Fill); Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); - Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE); + Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE_HEADER); LOCK; Status = CsrGetObject( ProcessData, ConsoleHandle, (Object_t **)&Buff ); if( !NT_SUCCESS( Status ) || (Status = Buff->Header.Type == CSRSS_SCREEN_BUFFER_MAGIC ? STATUS_SUCCESS : STATUS_INVALID_HANDLE )) @@ -1909,7 +1911,7 @@ CSR_API(CsrReadConsoleOutputChar) DWORD i; Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); - Reply->Header.DataSize = Reply->Header.MessageSize - sizeof(LPC_MESSAGE); + Reply->Header.DataSize = Reply->Header.MessageSize - sizeof(LPC_MESSAGE_HEADER); ReadBuffer = Reply->Data.ReadConsoleOutputCharReply.String; LOCK; diff --git a/reactos/subsys/csrss/api/handle.c b/reactos/subsys/csrss/api/handle.c index ea005ba6d36..41ba84f1344 100644 --- a/reactos/subsys/csrss/api/handle.c +++ b/reactos/subsys/csrss/api/handle.c @@ -1,4 +1,4 @@ -/* $Id: handle.c,v 1.11 2002/09/07 15:13:08 chorns Exp $ +/* $Id: handle.c,v 1.12 2002/09/08 10:23:45 chorns Exp $ * * reactos/subsys/csrss/api/handle.c * @@ -9,12 +9,11 @@ /* INCLUDES ******************************************************************/ -#include -#define NTOS_USER_MODE -#include +#include #include #include "api.h" +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/subsys/csrss/api/process.c b/reactos/subsys/csrss/api/process.c index 360282eb67e..926abdcfb65 100644 --- a/reactos/subsys/csrss/api/process.c +++ b/reactos/subsys/csrss/api/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.18 2002/09/07 15:13:08 chorns Exp $ +/* $Id: process.c,v 1.19 2002/09/08 10:23:45 chorns Exp $ * * reactos/subsys/csrss/api/process.c * @@ -9,10 +9,10 @@ /* INCLUDES ******************************************************************/ -#include -#define NTOS_USER_MODE -#include +#include + #include +#include #include "api.h" #define LOCK RtlEnterCriticalSection(&ProcessDataLock) @@ -22,8 +22,8 @@ static ULONG NrProcess; static PCSRSS_PROCESS_DATA ProcessData[256]; -extern RTL_CRITICAL_SECTION ActiveConsoleLock; -RTL_CRITICAL_SECTION ProcessDataLock; +extern CRITICAL_SECTION ActiveConsoleLock; +CRITICAL_SECTION ProcessDataLock; /* FUNCTIONS *****************************************************************/ @@ -120,7 +120,7 @@ CSR_API(CsrCreateProcess) HANDLE Process; Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); NewProcessData = CsrGetProcessData(Request->Data.CreateProcessRequest.NewProcessId); @@ -201,7 +201,7 @@ CSR_API(CsrTerminateProcess) NTSTATUS Status; Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + - sizeof(LPC_MESSAGE_HEADER); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY); Status = CsrFreeProcessData(ProcessData->ProcessId); @@ -214,7 +214,7 @@ CSR_API(CsrConnectProcess) { Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - - sizeof(LPC_MESSAGE); + sizeof(LPC_MESSAGE_HEADER); Reply->Status = STATUS_SUCCESS; diff --git a/reactos/subsys/csrss/api/wapi.c b/reactos/subsys/csrss/api/wapi.c index 692b49bbf97..85a84276a70 100644 --- a/reactos/subsys/csrss/api/wapi.c +++ b/reactos/subsys/csrss/api/wapi.c @@ -1,4 +1,4 @@ -/* $Id: wapi.c,v 1.18 2002/09/07 15:13:08 chorns Exp $ +/* $Id: wapi.c,v 1.19 2002/09/08 10:23:45 chorns Exp $ * * reactos/subsys/csrss/api/wapi.c * @@ -10,14 +10,14 @@ /* INCLUDES ******************************************************************/ +#include #include -#define NTOS_USER_MODE -#include +#include #include -#include "api.h" - #include +#include "api.h" + /* GLOBALS *******************************************************************/ HANDLE CsrssApiHeap; @@ -81,7 +81,7 @@ static void Thread_Api2(HANDLE ServerPort) if ( LpcRequest.Header.MessageType == LPC_PORT_CLOSED ) { - CsrFreeProcessData( (ULONG)LpcRequest.Header.ClientId.UniqueProcess ); + CsrFreeProcessData( (ULONG)LpcRequest.Header.Cid.UniqueProcess ); NtClose(ServerPort); NtTerminateThread(NtCurrentThread(), STATUS_SUCCESS); continue; @@ -91,7 +91,7 @@ static void Thread_Api2(HANDLE ServerPort) Reply = (PCSRSS_API_REPLY)&LpcReply; ProcessData = CsrGetProcessData( - (ULONG)LpcRequest.Header.ClientId.UniqueProcess); + (ULONG)LpcRequest.Header.Cid.UniqueProcess); // DisplayString(L"CSR: Received request\n"); if( Request->Type >= (sizeof( CsrFuncs ) / sizeof( CsrFunc )) - 1 ) @@ -141,7 +141,7 @@ void Thread_Api(PVOID PortHandle) NtTerminateThread(NtCurrentThread(), Status); } - ProcessData = CsrGetProcessData(Request.Header.ClientId.UniqueProcess); + ProcessData = CsrGetProcessData(Request.Header.Cid.UniqueProcess); ProcessData->CsrSectionViewBase = LpcRead.ViewBase; ProcessData->CsrSectionViewSize = LpcRead.ViewSize; diff --git a/reactos/subsys/csrss/csrss.c b/reactos/subsys/csrss/csrss.c index 9eafc4c17b7..47028106568 100644 --- a/reactos/subsys/csrss/csrss.c +++ b/reactos/subsys/csrss/csrss.c @@ -1,4 +1,4 @@ -/* $Id: csrss.c,v 1.12 2002/09/07 15:13:07 chorns Exp $ +/* $Id: csrss.c,v 1.13 2002/09/08 10:23:44 chorns Exp $ * * csrss.c - Client/Server Runtime subsystem * @@ -31,9 +31,10 @@ * First standalone run under ReactOS (it * actually does nothing but running). */ -#define NTOS_USER_MODE -#include +#include +#include #include + #include "api.h" /* Native process' entry point */ @@ -51,7 +52,7 @@ VOID NtProcessStartup(PPEB Peb) UNICODE_STRING UnicodeString; NTSTATUS Status; - ProcParams = RtlRosNormalizeProcessParams (Peb->ProcessParameters); + ProcParams = RtlNormalizeProcessParams (Peb->ProcessParameters); argv = (PWSTR *)RtlAllocateHeap (Peb->ProcessHeap, 0, 512 * sizeof(PWSTR)); diff --git a/reactos/subsys/csrss/csrss.rc b/reactos/subsys/csrss/csrss.rc index c89efc0f967..c2ecd4d2f60 100644 --- a/reactos/subsys/csrss/csrss.rc +++ b/reactos/subsys/csrss/csrss.rc @@ -1,5 +1,5 @@ -#include -#include +#include "../../include/defines.h" +#include "../../include/reactos/resource.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/subsys/csrss/init.c b/reactos/subsys/csrss/init.c index f71d99c990a..3107a773c13 100644 --- a/reactos/subsys/csrss/init.c +++ b/reactos/subsys/csrss/init.c @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.16 2002/09/07 15:13:07 chorns Exp $ +/* $Id: init.c,v 1.17 2002/09/08 10:23:44 chorns Exp $ * * reactos/subsys/csrss/init.c * @@ -10,9 +10,10 @@ /* INCLUDES ******************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include #include + #include "api.h" /* GLOBALS ******************************************************************/ diff --git a/reactos/subsys/csrss/print.c b/reactos/subsys/csrss/print.c index 2ed415ee3f8..a071a2c1388 100644 --- a/reactos/subsys/csrss/print.c +++ b/reactos/subsys/csrss/print.c @@ -1,4 +1,4 @@ -/* $Id: print.c,v 1.4 2002/09/07 15:13:07 chorns Exp $ +/* $Id: print.c,v 1.5 2002/09/08 10:23:44 chorns Exp $ * * smss.c - Session Manager * @@ -27,8 +27,8 @@ * Compiled successfully with egcs 1.1.2 */ -#define NTOS_USER_MODE -#include +#include + #include diff --git a/reactos/subsys/csrss/video.c b/reactos/subsys/csrss/video.c index 41cc8703e66..b72c86c89c9 100644 --- a/reactos/subsys/csrss/video.c +++ b/reactos/subsys/csrss/video.c @@ -1,10 +1,8 @@ -/* $Id: video.c,v 1.5 2002/09/07 15:13:07 chorns Exp $ +/* $Id: video.c,v 1.6 2002/09/08 10:23:44 chorns Exp $ * * ReactOS Project */ -#define NTOS_USER_MODE -#include - +#include ULONG InitializeVideoAddressSpace(VOID) diff --git a/reactos/subsys/smss/init.c b/reactos/subsys/smss/init.c index 2376cf2293e..677e85be6e8 100644 --- a/reactos/subsys/smss/init.c +++ b/reactos/subsys/smss/init.c @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.43 2002/09/07 15:13:09 chorns Exp $ +/* $Id: init.c,v 1.44 2002/09/08 10:23:46 chorns Exp $ * * init.c - Session Manager initialization * @@ -29,8 +29,9 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE #include +#include +#include #include "smss.h" @@ -197,7 +198,7 @@ SmRunBootAppsQueryRoutine(PWSTR ValueName, PVOID Context, PVOID EntryContext) { - PRTL_ROS_USER_PROCESS_PARAMETERS ProcessParameters; + PRTL_USER_PROCESS_PARAMETERS ProcessParameters; RTL_PROCESS_INFO ProcessInfo; UNICODE_STRING ImagePathString; UNICODE_STRING CommandLineString; @@ -263,7 +264,7 @@ SmRunBootAppsQueryRoutine(PWSTR ValueName, RtlInitUnicodeString(&CommandLineString, CommandLine); - RtlRosCreateProcessParameters(&ProcessParameters, + RtlCreateProcessParameters(&ProcessParameters, &ImagePathString, NULL, NULL, @@ -274,7 +275,7 @@ SmRunBootAppsQueryRoutine(PWSTR ValueName, NULL, NULL); - Status = RtlRosCreateUserProcess(&ImagePathString, + Status = RtlCreateUserProcess(&ImagePathString, OBJ_CASE_INSENSITIVE, ProcessParameters, NULL, @@ -290,7 +291,7 @@ SmRunBootAppsQueryRoutine(PWSTR ValueName, return(STATUS_SUCCESS); } - RtlRosDestroyProcessParameters(ProcessParameters); + RtlDestroyProcessParameters(ProcessParameters); /* Wait for process termination */ NtWaitForSingleObject(ProcessInfo.ProcessHandle, @@ -587,7 +588,7 @@ InitSessionManager(HANDLE Children[]) UNICODE_STRING UnicodeString; OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING CmdLineW; - PRTL_ROS_USER_PROCESS_PARAMETERS ProcessParameters; + PRTL_USER_PROCESS_PARAMETERS ProcessParameters; RTL_PROCESS_INFO ProcessInfo; HANDLE CsrssInitEvent; WCHAR UnicodeBuffer[MAX_PATH]; @@ -705,7 +706,7 @@ InitSessionManager(HANDLE Children[]) RtlInitUnicodeString(&UnicodeString, UnicodeBuffer); - RtlRosCreateProcessParameters(&ProcessParameters, + RtlCreateProcessParameters(&ProcessParameters, &UnicodeString, NULL, NULL, @@ -716,7 +717,7 @@ InitSessionManager(HANDLE Children[]) NULL, NULL); - Status = RtlRosCreateUserProcess(&UnicodeString, + Status = RtlCreateUserProcess(&UnicodeString, OBJ_CASE_INSENSITIVE, ProcessParameters, NULL, @@ -727,7 +728,7 @@ InitSessionManager(HANDLE Children[]) NULL, &ProcessInfo); - RtlRosDestroyProcessParameters (ProcessParameters); + RtlDestroyProcessParameters (ProcessParameters); if (!NT_SUCCESS(Status)) { @@ -752,7 +753,7 @@ InitSessionManager(HANDLE Children[]) RtlInitUnicodeString(&UnicodeString, UnicodeBuffer); - RtlRosCreateProcessParameters(&ProcessParameters, + RtlCreateProcessParameters(&ProcessParameters, &UnicodeString, NULL, NULL, @@ -763,7 +764,7 @@ InitSessionManager(HANDLE Children[]) NULL, NULL); - Status = RtlRosCreateUserProcess(&UnicodeString, + Status = RtlCreateUserProcess(&UnicodeString, OBJ_CASE_INSENSITIVE, ProcessParameters, NULL, @@ -774,7 +775,7 @@ InitSessionManager(HANDLE Children[]) NULL, &ProcessInfo); - RtlRosDestroyProcessParameters(ProcessParameters); + RtlDestroyProcessParameters(ProcessParameters); if (!NT_SUCCESS(Status)) { diff --git a/reactos/subsys/smss/smapi.c b/reactos/subsys/smss/smapi.c index 0fa528644e4..75211ac534d 100644 --- a/reactos/subsys/smss/smapi.c +++ b/reactos/subsys/smss/smapi.c @@ -1,12 +1,14 @@ -/* $Id: smapi.c,v 1.8 2002/09/07 15:13:09 chorns Exp $ +/* $Id: smapi.c,v 1.9 2002/09/08 10:23:46 chorns Exp $ * * Reactos Session Manager * * */ -#define NTOS_USER_MODE -#include +#include +#include +#include + #include "smss.h" #define NDEBUG diff --git a/reactos/subsys/smss/smss.c b/reactos/subsys/smss/smss.c index 581885a5d66..2683cb38f10 100644 --- a/reactos/subsys/smss/smss.c +++ b/reactos/subsys/smss/smss.c @@ -1,4 +1,4 @@ -/* $Id: smss.c,v 1.12 2002/09/07 15:13:09 chorns Exp $ +/* $Id: smss.c,v 1.13 2002/09/08 10:23:46 chorns Exp $ * * smss.c - Session Manager * @@ -26,9 +26,8 @@ * 19990529 (Emanuele Aliberti) * Compiled successfully with egcs 1.1.2 */ +#include -#define NTOS_USER_MODE -#include #include "smss.h" diff --git a/reactos/subsys/smss/smss.rc b/reactos/subsys/smss/smss.rc index c1937105f4e..c8e6cd10e0b 100644 --- a/reactos/subsys/smss/smss.rc +++ b/reactos/subsys/smss/smss.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/subsys/system/autochk/autochk.c b/reactos/subsys/system/autochk/autochk.c index cd0cd21f1cf..5b2ef541868 100644 --- a/reactos/subsys/system/autochk/autochk.c +++ b/reactos/subsys/system/autochk/autochk.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: autochk.c,v 1.2 2002/09/07 15:13:09 chorns Exp $ +/* $Id: autochk.c,v 1.3 2002/09/08 10:23:46 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -27,8 +27,8 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE -#include +#include +#include /* FUNCTIONS ****************************************************************/ diff --git a/reactos/subsys/system/autochk/autochk.rc b/reactos/subsys/system/autochk/autochk.rc index 3d4d9088000..270e3922d0e 100644 --- a/reactos/subsys/system/autochk/autochk.rc +++ b/reactos/subsys/system/autochk/autochk.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/subsys/system/gstart/gstart.c b/reactos/subsys/system/gstart/gstart.c index e9335f430ff..452b24391a1 100644 --- a/reactos/subsys/system/gstart/gstart.c +++ b/reactos/subsys/system/gstart/gstart.c @@ -1,11 +1,11 @@ -/* $Id: gstart.c,v 1.2 2002/09/07 15:13:09 chorns Exp $ +/* $Id: gstart.c,v 1.3 2002/09/08 10:23:47 chorns Exp $ * * PROJECT : ReactOS Operating System * DESCRIPTION: ReactOS GUI Startup * LICENSE : See top level directory * */ -#define NTOS_USER_MODE +#define NTOS_MODE_USER #include #include #include diff --git a/reactos/subsys/system/gstart/gstart.rc b/reactos/subsys/system/gstart/gstart.rc index 4272d050c92..0982e26a88b 100644 --- a/reactos/subsys/system/gstart/gstart.rc +++ b/reactos/subsys/system/gstart/gstart.rc @@ -1,5 +1,5 @@ -#include -#include +#include "../../../include/defines.h" +#include "../../../include/reactos/resource.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/subsys/system/services/database.c b/reactos/subsys/system/services/database.c index e25fbb71e19..77900bcc734 100644 --- a/reactos/subsys/system/services/database.c +++ b/reactos/subsys/system/services/database.c @@ -1,4 +1,4 @@ -/* $Id: database.c,v 1.6 2002/09/07 15:13:09 chorns Exp $ +/* $Id: database.c,v 1.7 2002/09/08 10:23:47 chorns Exp $ * * service control manager * @@ -25,7 +25,7 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE +#define NTOS_MODE_USER #include #include @@ -719,3 +719,5 @@ ScmAutoStartServices(VOID) ServiceEntry = ServiceEntry->Flink; } } + +/* EOF */ diff --git a/reactos/subsys/system/services/services.c b/reactos/subsys/system/services/services.c index 1dd76a07a6d..c1ef3f47442 100644 --- a/reactos/subsys/system/services/services.c +++ b/reactos/subsys/system/services/services.c @@ -1,4 +1,4 @@ -/* $Id: services.c,v 1.7 2002/09/07 15:13:09 chorns Exp $ +/* $Id: services.c,v 1.8 2002/09/08 10:23:47 chorns Exp $ * * service control manager * @@ -29,14 +29,14 @@ /* INCLUDES *****************************************************************/ -#define NTOS_USER_MODE +#define NTOS_MODE_USER #include #include -#include + #include "services.h" #define DBG -#define NDEBUG +//#define NDEBUG #include diff --git a/reactos/subsys/system/services/services.rc b/reactos/subsys/system/services/services.rc index cd27e42ef36..6870571831f 100644 --- a/reactos/subsys/system/services/services.rc +++ b/reactos/subsys/system/services/services.rc @@ -1,5 +1,5 @@ -#include -#include +#include "../../../include/defines.h" +#include "../../../include/reactos/resource.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/subsys/system/shell/shell.c b/reactos/subsys/system/shell/shell.c index 3500c4bb7a5..40faab1a7fa 100644 --- a/reactos/subsys/system/shell/shell.c +++ b/reactos/subsys/system/shell/shell.c @@ -1,14 +1,13 @@ -/* $Id: shell.c,v 1.11 2002/09/07 15:13:09 chorns Exp $ +/* $Id: shell.c,v 1.12 2002/09/08 10:23:47 chorns Exp $ * * PROJECT : ReactOS Operating System * DESCRIPTION: ReactOS' Native Shell * LICENSE : See top level directory * */ -#include -#define NTOS_USER_MODE +#define NTOS_MODE_USER #include -#include +#include #include #include #include @@ -291,7 +290,7 @@ ExecuteKill(char * lpPid) void ExecuteHelp (void * dummy) { debug_printf ( - "A:\t\t\tCurrent drive is A:\n" + "A:\t\t\tCurrent drive is A:\n" "C:\t\t\tCurrent drive is C:\n" "cd [directory]\t\tChange current directory\n" "dir [directory]\t\tList directory\n" diff --git a/reactos/subsys/system/shell/shell.rc b/reactos/subsys/system/shell/shell.rc index 4272d050c92..0982e26a88b 100644 --- a/reactos/subsys/system/shell/shell.rc +++ b/reactos/subsys/system/shell/shell.rc @@ -1,5 +1,5 @@ -#include -#include +#include "../../../include/defines.h" +#include "../../../include/reactos/resource.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/subsys/system/winlogon/winlogon.c b/reactos/subsys/system/winlogon/winlogon.c index 3ef2d00e91f..c8813926a5a 100644 --- a/reactos/subsys/system/winlogon/winlogon.c +++ b/reactos/subsys/system/winlogon/winlogon.c @@ -1,4 +1,4 @@ -/* $Id: winlogon.c,v 1.11 2002/09/07 15:13:10 chorns Exp $ +/* $Id: winlogon.c,v 1.12 2002/09/08 10:23:48 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -10,9 +10,9 @@ */ /* INCLUDES *****************************************************************/ -#include -#define NTOS_USER_MODE + #include +#include #include #include diff --git a/reactos/subsys/system/winlogon/winlogon.rc b/reactos/subsys/system/winlogon/winlogon.rc index 3a2cb36bbc2..46b4f776e50 100644 --- a/reactos/subsys/system/winlogon/winlogon.rc +++ b/reactos/subsys/system/winlogon/winlogon.rc @@ -1,4 +1,4 @@ -#include +#include #include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/subsys/win32k/dib/dib.h b/reactos/subsys/win32k/dib/dib.h index c20e8d4ca6c..72bdff1373b 100644 --- a/reactos/subsys/win32k/dib/dib.h +++ b/reactos/subsys/win32k/dib/dib.h @@ -1,25 +1,25 @@ -extern unsigned char notmask[2]; -extern unsigned char altnotmask[2]; +static unsigned char notmask[2] = { 0x0f, 0xf0 }; +static unsigned char altnotmask[2] = { 0xf0, 0x0f }; -typedef VOID (*PFN_DIB_PutPixel)(SURFOBJ*, LONG, LONG, ULONG); -typedef ULONG (*PFN_DIB_GetPixel)(SURFOBJ*, LONG, LONG); -typedef VOID (*PFN_DIB_HLine) (SURFOBJ*, LONG, LONG, LONG, ULONG); -typedef VOID (*PFN_DIB_VLine) (SURFOBJ*, LONG, LONG, LONG, ULONG); +typedef VOID (*PFN_DIB_PutPixel)(PSURFOBJ, LONG, LONG, ULONG); +typedef ULONG (*PFN_DIB_GetPixel)(PSURFOBJ, LONG, LONG); +typedef VOID (*PFN_DIB_HLine) (PSURFOBJ, LONG, LONG, LONG, ULONG); +typedef VOID (*PFN_DIB_VLine) (PSURFOBJ, LONG, LONG, LONG, ULONG); -PFN_DIB_PutPixel DIB_4BPP_PutPixel(SURFOBJ* SurfObj, LONG x, LONG y, ULONG c); -PFN_DIB_GetPixel DIB_4BPP_GetPixel(SURFOBJ* SurfObj, LONG x, LONG y); -PFN_DIB_HLine DIB_4BPP_HLine(SURFOBJ* SurfObj, LONG x1, LONG x2, LONG y, ULONG c); -PFN_DIB_VLine DIB_4BPP_VLine(SURFOBJ* SurfObj, LONG x, LONG y1, LONG y2, ULONG c); +PFN_DIB_PutPixel DIB_4BPP_PutPixel(PSURFOBJ SurfObj, LONG x, LONG y, ULONG c); +PFN_DIB_GetPixel DIB_4BPP_GetPixel(PSURFOBJ SurfObj, LONG x, LONG y); +PFN_DIB_HLine DIB_4BPP_HLine(PSURFOBJ SurfObj, LONG x1, LONG x2, LONG y, ULONG c); +PFN_DIB_VLine DIB_4BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c); BOOLEAN DIB_To_4BPP_Bitblt( SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFGDI *DestGDI, SURFGDI *SourceGDI, PRECTL DestRect, POINTL *SourcePoint, ULONG Delta, XLATEOBJ *ColorTranslation); -PFN_DIB_PutPixel DIB_24BPP_PutPixel(SURFOBJ* SurfObj, LONG x, LONG y, ULONG c); -PFN_DIB_GetPixel DIB_24BPP_GetPixel(SURFOBJ* SurfObj, LONG x, LONG y); -PFN_DIB_HLine DIB_24BPP_HLine(SURFOBJ* SurfObj, LONG x1, LONG x2, LONG y, ULONG c); -PFN_DIB_VLine DIB_24BPP_VLine(SURFOBJ* SurfObj, LONG x, LONG y1, LONG y2, ULONG c); +PFN_DIB_PutPixel DIB_24BPP_PutPixel(PSURFOBJ SurfObj, LONG x, LONG y, ULONG c); +PFN_DIB_GetPixel DIB_24BPP_GetPixel(PSURFOBJ SurfObj, LONG x, LONG y); +PFN_DIB_HLine DIB_24BPP_HLine(PSURFOBJ SurfObj, LONG x1, LONG x2, LONG y, ULONG c); +PFN_DIB_VLine DIB_24BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c); BOOLEAN DIB_To_24BPP_Bitblt( SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFGDI *DestGDI, SURFGDI *SourceGDI, - RECTL *DestRect, POINTL *SourcePoint, + PRECTL DestRect, POINTL *SourcePoint, ULONG Delta, XLATEOBJ *ColorTranslation); diff --git a/reactos/subsys/win32k/dib/dib24bpp.c b/reactos/subsys/win32k/dib/dib24bpp.c index 3053278e805..e4f6ec1163a 100644 --- a/reactos/subsys/win32k/dib/dib24bpp.c +++ b/reactos/subsys/win32k/dib/dib24bpp.c @@ -8,26 +8,26 @@ #include "../eng/objects.h" #include "dib.h" -PFN_DIB_PutPixel DIB_24BPP_PutPixel(SURFOBJ* SurfObj, LONG x, LONG y, ULONG c) +PFN_DIB_PutPixel DIB_24BPP_PutPixel(PSURFOBJ SurfObj, LONG x, LONG y, ULONG c) { PBYTE byteaddr = SurfObj->pvBits + y * SurfObj->lDelta; - RGBTRIPLE *addr = (RGBTRIPLE*)byteaddr + x; + PRGBTRIPLE addr = (PRGBTRIPLE)byteaddr + x; *(PULONG)(addr) = c; } -PFN_DIB_GetPixel DIB_24BPP_GetPixel(SURFOBJ* SurfObj, LONG x, LONG y) +PFN_DIB_GetPixel DIB_24BPP_GetPixel(PSURFOBJ SurfObj, LONG x, LONG y) { PBYTE byteaddr = SurfObj->pvBits + y * SurfObj->lDelta; - RGBTRIPLE *addr = (RGBTRIPLE*)byteaddr + x; + PRGBTRIPLE addr = (PRGBTRIPLE)byteaddr + x; return (PFN_DIB_GetPixel)(*(PULONG)(addr)); } -PFN_DIB_HLine DIB_24BPP_HLine(SURFOBJ* SurfObj, LONG x1, LONG x2, LONG y, ULONG c) +PFN_DIB_HLine DIB_24BPP_HLine(PSURFOBJ SurfObj, LONG x1, LONG x2, LONG y, ULONG c) { PBYTE byteaddr = SurfObj->pvBits + y * SurfObj->lDelta; - RGBTRIPLE *addr = (RGBTRIPLE*)byteaddr + x1; + PRGBTRIPLE addr = (PRGBTRIPLE)byteaddr + x1; LONG cx = x1; while(cx <= x2) { @@ -37,10 +37,10 @@ PFN_DIB_HLine DIB_24BPP_HLine(SURFOBJ* SurfObj, LONG x1, LONG x2, LONG y, ULONG } } -PFN_DIB_VLine DIB_24BPP_VLine(SURFOBJ* SurfObj, LONG x, LONG y1, LONG y2, ULONG c) +PFN_DIB_VLine DIB_24BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c) { PBYTE byteaddr = SurfObj->pvBits + y1 * SurfObj->lDelta; - RGBTRIPLE *addr = (RGBTRIPLE*)byteaddr + x; + PRGBTRIPLE addr = (PRGBTRIPLE)byteaddr + x; ULONG lDelta = SurfObj->lDelta; byteaddr = (PBYTE)addr; @@ -48,15 +48,15 @@ PFN_DIB_VLine DIB_24BPP_VLine(SURFOBJ* SurfObj, LONG x, LONG y1, LONG y2, ULONG *(PULONG)(addr) = c; byteaddr += lDelta; - addr = (RGBTRIPLE*)byteaddr; + addr = (PRGBTRIPLE)byteaddr; } } -VOID DIB_24BPP_BltTo_24BPP(SURFOBJ* dstpsd, LONG dstx, LONG dsty, LONG w, LONG h, - SURFOBJ* srcpsd, LONG srcx, LONG srcy) +VOID DIB_24BPP_BltTo_24BPP(PSURFOBJ dstpsd, LONG dstx, LONG dsty, LONG w, LONG h, + PSURFOBJ srcpsd, LONG srcx, LONG srcy) { - RGBTRIPLE *dst; - RGBTRIPLE *src; + PRGBTRIPLE dst; + PRGBTRIPLE src; PBYTE bytedst; PBYTE bytesrc; int i; @@ -65,12 +65,12 @@ VOID DIB_24BPP_BltTo_24BPP(SURFOBJ* dstpsd, LONG dstx, LONG dsty, LONG w, LONG h bytedst = (char *)dstpsd->pvBits + dsty * dlDelta; bytesrc = (char *)srcpsd->pvBits + srcy * slDelta; - dst = (RGBTRIPLE*)bytedst + dstx; - src = (RGBTRIPLE*)bytesrc + srcx; + dst = (PRGBTRIPLE)bytedst + dstx; + src = (PRGBTRIPLE)bytesrc + srcx; while(--h >= 0) { - RGBTRIPLE *d = dst; - RGBTRIPLE *s = src; + PRGBTRIPLE d = dst; + PRGBTRIPLE s = src; LONG dx = dstx; LONG sx = srcx; for(i=0; ipvBits; return (PFN_DIB_GetPixel)((addr[(x>>1) + y * SurfObj->lDelta] >> ((1-(x&1))<<2) ) & 0x0f); } -PFN_DIB_HLine DIB_4BPP_HLine(SURFOBJ* SurfObj, LONG x1, LONG x2, LONG y, ULONG c) +PFN_DIB_HLine DIB_4BPP_HLine(PSURFOBJ SurfObj, LONG x1, LONG x2, LONG y, ULONG c) { PBYTE addr = SurfObj->pvBits + (x1>>1) + y * SurfObj->lDelta; LONG cx = x1; @@ -41,7 +38,7 @@ PFN_DIB_HLine DIB_4BPP_HLine(SURFOBJ* SurfObj, LONG x1, LONG x2, LONG y, ULONG c } } -PFN_DIB_VLine DIB_4BPP_VLine(SURFOBJ* SurfObj, LONG x, LONG y1, LONG y2, ULONG c) +PFN_DIB_VLine DIB_4BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c) { PBYTE addr = SurfObj->pvBits; int lDelta = SurfObj->lDelta; diff --git a/reactos/subsys/win32k/eng/bitblt.c b/reactos/subsys/win32k/eng/bitblt.c index 02d1cd92fa0..91ba8835bb1 100644 --- a/reactos/subsys/win32k/eng/bitblt.c +++ b/reactos/subsys/win32k/eng/bitblt.c @@ -7,8 +7,7 @@ * REVISION HISTORY: * 2/10/1999: Created */ -#define NTOS_KERNEL_MODE -#include + #include #include #include @@ -52,11 +51,10 @@ EngBitBlt(SURFOBJ *Dest, RECTL *DestRect, POINTL *SourcePoint, POINTL *MaskRect, - BRUSHOBJ *bo, + BRUSHOBJ *Brush, POINTL *BrushOrigin, ROP4 rop4) { - ROS_BRUSHOBJ* Brush = (ROS_BRUSHOBJ*)bo; BOOLEAN ret; BYTE clippingType; RECTL rclTmp; @@ -65,7 +63,7 @@ EngBitBlt(SURFOBJ *Dest, BOOL EnumMore; PSURFGDI DestGDI, SourceGDI; HSURF hTemp; - SURFOBJ *TempSurf = NULL; + PSURFOBJ TempSurf = NULL; BOOLEAN canCopyBits; POINTL TempPoint; RECTL TempRect; @@ -113,7 +111,7 @@ EngBitBlt(SURFOBJ *Dest, hTemp = EngCreateBitmap(TempSize, DIB_GetDIBWidthBytes(DestRect->right - DestRect->left, BitsPerFormat(Dest->iBitmapFormat)), Dest->iBitmapFormat, 0, NULL); - TempSurf = (SURFOBJ*)AccessUserObject((ULONG)hTemp); + TempSurf = (PSURFOBJ)AccessUserObject((ULONG)hTemp); // FIXME: Skip creating a TempSurf if we have the same BPP and palette EngBitBlt(TempSurf, Source, NULL, NULL, ColorTranslation, &TempRect, SourcePoint, NULL, NULL, NULL, 0); diff --git a/reactos/subsys/win32k/eng/brush.c b/reactos/subsys/win32k/eng/brush.c index a1ff992912b..b07abf134e0 100644 --- a/reactos/subsys/win32k/eng/brush.c +++ b/reactos/subsys/win32k/eng/brush.c @@ -8,21 +8,18 @@ * 3/7/1999: Created */ -#define NTOS_KERNEL_MODE -#include #include PVOID STDCALL -BRUSHOBJ_pvAllocRbrush(IN BRUSHOBJ *BrushObj, +BRUSHOBJ_pvAllocRbrush(IN PBRUSHOBJ BrushObj, IN ULONG ObjSize) { - ROS_BRUSHOBJ *bo = (ROS_BRUSHOBJ *)BrushObj; - bo->pvRbrush=EngAllocMem(0, ObjSize, 0); - return(bo->pvRbrush); + BrushObj->pvRbrush=EngAllocMem(0, ObjSize, 0); + return(BrushObj->pvRbrush); } -PVOID STDCALL BRUSHOBJ_pvGetRbrush(IN BRUSHOBJ *BrushObj) +PVOID STDCALL +BRUSHOBJ_pvGetRbrush(IN PBRUSHOBJ BrushObj) { - ROS_BRUSHOBJ *bo = (ROS_BRUSHOBJ *)BrushObj; - return(bo->pvRbrush); + return(BrushObj->pvRbrush); } diff --git a/reactos/subsys/win32k/eng/clip.c b/reactos/subsys/win32k/eng/clip.c index ace91de1aca..244b3bdbada 100644 --- a/reactos/subsys/win32k/eng/clip.c +++ b/reactos/subsys/win32k/eng/clip.c @@ -85,7 +85,7 @@ EngDeleteClip(CLIPOBJ *ClipRegion) } ULONG STDCALL -CLIPOBJ_cEnumStart(IN CLIPOBJ *ClipObj, +CLIPOBJ_cEnumStart(IN PCLIPOBJ ClipObj, IN BOOL ShouldDoAll, IN ULONG ClipType, IN ULONG BuildOrder, @@ -111,7 +111,7 @@ CLIPOBJ_cEnumStart(IN CLIPOBJ *ClipObj, } BOOL STDCALL -CLIPOBJ_bEnum(IN CLIPOBJ *ClipObj, +CLIPOBJ_bEnum(IN PCLIPOBJ ClipObj, IN ULONG ObjSize, OUT ULONG *EnumRects) { @@ -120,8 +120,8 @@ CLIPOBJ_bEnum(IN CLIPOBJ *ClipObj, PENUMRECTS pERects = (PENUMRECTS)EnumRects; //calculate how many rectangles we should copy - nCopy = min( ClipGDI->EnumMax-ClipGDI->EnumPos, - min( ClipGDI->EnumRects.c, (ObjSize-sizeof(ULONG))/sizeof(RECTL))); + nCopy = MIN( ClipGDI->EnumMax-ClipGDI->EnumPos, + MIN( ClipGDI->EnumRects.c, (ObjSize-sizeof(ULONG))/sizeof(RECTL))); RtlCopyMemory( &(pERects->arcl), &(ClipGDI->EnumRects.arcl), nCopy*sizeof(RECTL) ); pERects->c = nCopy; diff --git a/reactos/subsys/win32k/eng/copybits.c b/reactos/subsys/win32k/eng/copybits.c index b26aa47a05d..95359f2fae0 100644 --- a/reactos/subsys/win32k/eng/copybits.c +++ b/reactos/subsys/win32k/eng/copybits.c @@ -16,11 +16,10 @@ #include #include -BOOL -CopyBitsCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - SURFGDI *DestGDI, SURFGDI *SourceGDI, - RECTL *DestRect, POINTL *SourcePoint, - ULONG Delta, XLATEOBJ *ColorTranslation) +BOOLEAN CopyBitsCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, + SURFGDI *DestGDI, SURFGDI *SourceGDI, + PRECTL DestRect, POINTL *SourcePoint, + ULONG Delta, XLATEOBJ *ColorTranslation) { ULONG DestWidth, DestHeight, CurrentDestLine, CurrentSourceLine, CurrentDestCol, CurrentSourceCol, i, TranslationPixel; diff --git a/reactos/subsys/win32k/eng/lineto.c b/reactos/subsys/win32k/eng/lineto.c index 7f50af7e4d8..955b38264c2 100644 --- a/reactos/subsys/win32k/eng/lineto.c +++ b/reactos/subsys/win32k/eng/lineto.c @@ -1,6 +1,7 @@ #include #include "objects.h" #include "../dib/dib.h" + #include #include #include @@ -16,7 +17,6 @@ EngLineTo(SURFOBJ *Surface, RECTL *RectBounds, MIX mix) { - ROS_BRUSHOBJ *bo = (ROS_BRUSHOBJ *)Brush; BOOLEAN ret; SURFGDI *SurfGDI; LONG x, y, d, deltax, deltay, i, length, xchange, ychange, error, hx, vy; @@ -90,8 +90,8 @@ EngLineTo(SURFOBJ *Surface, vy = y1; } - if(y1==y2) { DIB_HLine(Surface, hx, hx + deltax, y1, bo->iSolidColor); MouseSafetyOnDrawEnd(Surface, SurfGDI); return TRUE; } - if(x1==x2) { DIB_VLine(Surface, x1, vy, vy + deltay, bo->iSolidColor); MouseSafetyOnDrawEnd(Surface, SurfGDI); return TRUE; } + if(y1==y2) { DIB_HLine(Surface, hx, hx + deltax, y1, Brush->iSolidColor); MouseSafetyOnDrawEnd(Surface, SurfGDI); return TRUE; } + if(x1==x2) { DIB_VLine(Surface, x1, vy, vy + deltay, Brush->iSolidColor); MouseSafetyOnDrawEnd(Surface, SurfGDI); return TRUE; } error=0; i=0; @@ -101,7 +101,7 @@ EngLineTo(SURFOBJ *Surface, length=deltay+1; while(iiSolidColor); + DIB_PutPixel(Surface, x, y, Brush->iSolidColor); y=y+ychange; error=error+deltax; @@ -117,7 +117,7 @@ EngLineTo(SURFOBJ *Surface, length=deltax+1; while(iiSolidColor); + DIB_PutPixel(Surface, x, y, Brush->iSolidColor); x=x+xchange; error=error+deltay; if(error>deltax) diff --git a/reactos/subsys/win32k/eng/mouse.c b/reactos/subsys/win32k/eng/mouse.c index 5c62925b3d3..661096a85cf 100644 --- a/reactos/subsys/win32k/eng/mouse.c +++ b/reactos/subsys/win32k/eng/mouse.c @@ -7,7 +7,7 @@ BOOLEAN SafetySwitch = FALSE, SafetySwitch2 = FALSE, MouseEnabled = FALSE; LONG mouse_x, mouse_y; UINT mouse_width = 0, mouse_height = 0; -INT MouseSafetyOnDrawStart(SURFOBJ *SurfObj, SURFGDI *SurfGDI, LONG HazardX1, LONG HazardY1, LONG HazardX2, LONG HazardY2) +INT MouseSafetyOnDrawStart(PSURFOBJ SurfObj, PSURFGDI SurfGDI, LONG HazardX1, LONG HazardY1, LONG HazardX2, LONG HazardY2) { RECTL MouseRect; LONG tmp; @@ -32,7 +32,7 @@ INT MouseSafetyOnDrawStart(SURFOBJ *SurfObj, SURFGDI *SurfGDI, LONG HazardX1, LO return 1; } -INT MouseSafetyOnDrawEnd(SURFOBJ *SurfObj, SURFGDI *SurfGDI) +INT MouseSafetyOnDrawEnd(PSURFOBJ SurfObj, PSURFGDI SurfGDI) { RECTL MouseRect; diff --git a/reactos/subsys/win32k/eng/objects.h b/reactos/subsys/win32k/eng/objects.h index 03c439198e2..23bb15c1ccc 100644 --- a/reactos/subsys/win32k/eng/objects.h +++ b/reactos/subsys/win32k/eng/objects.h @@ -10,11 +10,6 @@ #ifndef __ENG_OBJECTS_H #define __ENG_OBJECTS_H -#define NTOS_KERNEL_MODE -#include -#include -#include - #include /* Structure of internal gdi objects that win32k manages for ddi engine: @@ -100,44 +95,44 @@ typedef struct _STRGDI { //STROBJ StrObj; } STRGDI; -typedef BOOL STDCALL (*PFN_BitBlt)(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, - XLATEOBJ*, RECTL*, POINTL*, POINTL*, - ROS_BRUSHOBJ*, POINTL*, ROP4); +typedef BOOL STDCALL (*PFN_BitBlt)(PSURFOBJ, PSURFOBJ, PSURFOBJ, PCLIPOBJ, + PXLATEOBJ, PRECTL, PPOINTL, PPOINTL, + PBRUSHOBJ, PPOINTL, ROP4); -typedef BOOL STDCALL (*PFN_TransparentBlt)(SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, RECTL*, RECTL*, ULONG, ULONG); +typedef BOOL STDCALL (*PFN_TransparentBlt)(PSURFOBJ, PSURFOBJ, PCLIPOBJ, PXLATEOBJ, PRECTL, PRECTL, ULONG, ULONG); -typedef BOOL STDCALL (*PFN_StretchBlt)(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, - XLATEOBJ*, COLORADJUSTMENT*, POINTL*, - RECTL*, RECTL*, POINT*, ULONG); +typedef BOOL STDCALL (*PFN_StretchBlt)(PSURFOBJ, PSURFOBJ, PSURFOBJ, PCLIPOBJ, + PXLATEOBJ, PCOLORADJUSTMENT, PPOINTL, + PRECTL, PRECTL, PPOINT, ULONG); -typedef BOOL STDCALL (*PFN_TextOut)(SURFOBJ*, STROBJ*, FONTOBJ*, CLIPOBJ*, - RECTL*, RECTL*, ROS_BRUSHOBJ*, ROS_BRUSHOBJ*, - POINTL*, MIX); +typedef BOOL STDCALL (*PFN_TextOut)(PSURFOBJ, PSTROBJ, PFONTOBJ, PCLIPOBJ, + PRECTL, PRECTL, PBRUSHOBJ, PBRUSHOBJ, + PPOINTL, MIX); -typedef BOOL STDCALL (*PFN_Paint)(SURFOBJ*, CLIPOBJ*, ROS_BRUSHOBJ*, POINTL*, MIX); +typedef BOOL STDCALL (*PFN_Paint)(PSURFOBJ, PCLIPOBJ, PBRUSHOBJ, PPOINTL, MIX); -typedef BOOL STDCALL (*PFN_StrokePath)(SURFOBJ*, PATHOBJ*, CLIPOBJ*, XFORMOBJ*, - ROS_BRUSHOBJ*, POINTL*, LINEATTRS*, MIX); +typedef BOOL STDCALL (*PFN_StrokePath)(PSURFOBJ, PPATHOBJ, PCLIPOBJ, PXFORMOBJ, + PBRUSHOBJ, PPOINTL, PLINEATTRS, MIX); -typedef BOOL STDCALL (*PFN_FillPath)(SURFOBJ*, PATHOBJ*, CLIPOBJ*, ROS_BRUSHOBJ*, - POINTL*, MIX, ULONG); +typedef BOOL STDCALL (*PFN_FillPath)(PSURFOBJ, PPATHOBJ, PCLIPOBJ, PBRUSHOBJ, + PPOINTL, MIX, ULONG); -typedef BOOL STDCALL (*PFN_StrokeAndFillPath)(SURFOBJ*, PATHOBJ*, CLIPOBJ*, - XFORMOBJ*, ROS_BRUSHOBJ*, LINEATTRS*, ROS_BRUSHOBJ*, - POINTL*, MIX, ULONG); +typedef BOOL STDCALL (*PFN_StrokeAndFillPath)(PSURFOBJ, PPATHOBJ, PCLIPOBJ, + PXFORMOBJ, PBRUSHOBJ, PLINEATTRS, PBRUSHOBJ, + PPOINTL, MIX, ULONG); -typedef BOOL STDCALL (*PFN_LineTo)(SURFOBJ*, CLIPOBJ*, ROS_BRUSHOBJ*, - LONG, LONG, LONG, LONG, RECTL*, MIX); +typedef BOOL STDCALL (*PFN_LineTo)(PSURFOBJ, PCLIPOBJ, PBRUSHOBJ, + LONG, LONG, LONG, LONG, PRECTL, MIX); -typedef BOOL STDCALL (*PFN_CopyBits)(SURFOBJ*, SURFOBJ*, CLIPOBJ*, - XLATEOBJ*, RECTL*, POINTL*); +typedef BOOL STDCALL (*PFN_CopyBits)(PSURFOBJ, PSURFOBJ, PCLIPOBJ, + PXLATEOBJ, PRECTL, PPOINTL); -typedef VOID STDCALL (*PFN_Synchronize)(DHPDEV, RECTL*); +typedef VOID STDCALL (*PFN_Synchronize)(DHPDEV, PRECTL); -typedef VOID STDCALL (*PFN_MovePointer)(SURFOBJ*, LONG, LONG, RECTL*); +typedef VOID STDCALL (*PFN_MovePointer)(PSURFOBJ, LONG, LONG, PRECTL); -typedef VOID STDCALL (*PFN_SetPointerShape)(SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*, - LONG, LONG, LONG, LONG, RECTL*, ULONG); +typedef VOID STDCALL (*PFN_SetPointerShape)(PSURFOBJ, PSURFOBJ, PSURFOBJ, PXLATEOBJ, + LONG, LONG, LONG, LONG, PRECTL, ULONG); typedef HBITMAP STDCALL (*PFN_CreateDeviceBitmap)(DHPDEV, SIZEL, ULONG); diff --git a/reactos/subsys/win32k/eng/paint.c b/reactos/subsys/win32k/eng/paint.c index 97d21f1aae7..a5009693384 100644 --- a/reactos/subsys/win32k/eng/paint.c +++ b/reactos/subsys/win32k/eng/paint.c @@ -124,11 +124,10 @@ EngPaint(IN SURFOBJ *Surface, IN POINTL *BrushOrigin, IN MIX Mix) { - ROS_BRUSHOBJ *bo = (ROS_BRUSHOBJ*)Brush; BOOLEAN ret; // FIXME: We only support a brush's solid color attribute - ret = EngPaintRgn(Surface, ClipRegion, bo->iSolidColor, Mix, NULL, BrushOrigin); + ret = EngPaintRgn(Surface, ClipRegion, Brush->iSolidColor, Mix, NULL, BrushOrigin); return ret; } diff --git a/reactos/subsys/win32k/eng/palette.c b/reactos/subsys/win32k/eng/palette.c index a5d62903cb3..22cf0741851 100644 --- a/reactos/subsys/win32k/eng/palette.c +++ b/reactos/subsys/win32k/eng/palette.c @@ -8,7 +8,6 @@ * 11/7/1999: Created */ -#include #include #include #include "handle.h" @@ -19,7 +18,7 @@ HPALETTE STDCALL EngCreatePalette(ULONG Mode, ULONG NumColors, - ULONG *Colors, + PULONG *Colors, // FIXME: This was implemented with ULONG *Colors!! ULONG Red, ULONG Green, ULONG Blue) diff --git a/reactos/subsys/win32k/eng/transblt.c b/reactos/subsys/win32k/eng/transblt.c index 5eb7caee169..9af39f65856 100644 --- a/reactos/subsys/win32k/eng/transblt.c +++ b/reactos/subsys/win32k/eng/transblt.c @@ -14,23 +14,27 @@ #include #include #include -#include #include "brush.h" #include "clip.h" #include "objects.h" +#include BOOL STDCALL -EngTransparentBlt(SURFOBJ *Dest, SURFOBJ *Source, - CLIPOBJ *Clip, XLATEOBJ *ColorTranslation, - RECTL *DestRect, RECTL *SourceRect, - ULONG TransparentColor, ULONG Reserved) +EngTransparentBlt(PSURFOBJ Dest, + PSURFOBJ Source, + PCLIPOBJ Clip, + PXLATEOBJ ColorTranslation, + PRECTL DestRect, + PRECTL SourceRect, + ULONG TransparentColor, + ULONG Reserved) { PSURFGDI DestGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Dest), SourceGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Source); HSURF hTemp; - SURFOBJ *TempSurf; + PSURFOBJ TempSurf; POINTL TempPoint, SourcePoint; RECTL TempRect; SIZEL TempSize; @@ -64,7 +68,7 @@ EngTransparentBlt(SURFOBJ *Dest, SURFOBJ *Source, hTemp = EngCreateBitmap(TempSize, DIB_GetDIBWidthBytes(dx, BitsPerFormat(Dest->iBitmapFormat)), Dest->iBitmapFormat, 0, NULL); - TempSurf = (SURFOBJ*)AccessUserObject((ULONG)hTemp); + TempSurf = (PSURFOBJ)AccessUserObject((ULONG)hTemp); SourcePoint.x = SourceRect->left; SourcePoint.y = SourceRect->top; diff --git a/reactos/subsys/win32k/eng/xlate.c b/reactos/subsys/win32k/eng/xlate.c index cc57dd175c6..226f56fabb8 100644 --- a/reactos/subsys/win32k/eng/xlate.c +++ b/reactos/subsys/win32k/eng/xlate.c @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include "handle.h" @@ -199,8 +199,7 @@ XLATEOBJ *EngCreateXlate(USHORT DestPalType, USHORT SourcePalType, return XlateObj; } -VOID STDCALL -EngDeleteXlate(XLATEOBJ *XlateObj) +VOID EngDeleteXlate(XLATEOBJ *XlateObj) { HPALETTE HXlate = (HPALETTE)AccessHandleFromUserObject(XlateObj); XLATEGDI *XlateGDI = (XLATEGDI*)AccessInternalObject((ULONG)HXlate); @@ -258,9 +257,9 @@ XLATEOBJ_iXlate(XLATEOBJ *XlateObj, ULONG STDCALL XLATEOBJ_cGetPalette(XLATEOBJ *XlateObj, - ULONG PalOutType, - ULONG cPal, - ULONG *OutPal) + ULONG PalOutType, + ULONG cPal, + ULONG *OutPal) { ULONG i; HPALETTE HPal; diff --git a/reactos/subsys/win32k/freetype/grfont.c b/reactos/subsys/win32k/freetype/grfont.c index 61bb7b399be..d8e8d41796d 100644 --- a/reactos/subsys/win32k/freetype/grfont.c +++ b/reactos/subsys/win32k/freetype/grfont.c @@ -275,10 +275,10 @@ const unsigned char font_8x8[2048] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static SURFOBJ *CharCellSurfObj; +static PSURFOBJ CharCellSurfObj; static HBITMAP hCharCellBitmap; -VOID BitmapToSurf(HDC hdc, PSURFGDI SurfGDI, SURFOBJ *SurfObj, PBITMAPOBJ Bitmap); +VOID BitmapToSurf(HDC hdc, PSURFGDI SurfGDI, PSURFOBJ SurfObj, PBITMAPOBJ Bitmap); // Set things up for a character cell surface void CreateCellCharSurface() @@ -298,7 +298,7 @@ void CreateCellCharSurface() BITMAPOBJ_ReleasePtr( hCharCellBitmap ); } -void grWriteCellChar(SURFOBJ *target, +void grWriteCellChar(PSURFOBJ target, int x, int y, int charcode, @@ -349,7 +349,7 @@ void grWriteCellChar(SURFOBJ *target, ExFreePool(bigbit); } -void grWriteCellString(SURFOBJ *target, +void grWriteCellString(PSURFOBJ target, int x, int y, const char* string, diff --git a/reactos/subsys/win32k/include/callback.h b/reactos/subsys/win32k/include/callback.h index 31b7955afea..b620beeb099 100644 --- a/reactos/subsys/win32k/include/callback.h +++ b/reactos/subsys/win32k/include/callback.h @@ -1,9 +1,6 @@ #ifndef __SUBSYS_WIN32K_INCLUDE_CALLBACK_H #define __SUBSYS_WIN32K_INCLUDE_CALLBACK_H -#define NTOS_KERNEL_MODE -#include - LRESULT STDCALL W32kCallWindowProc(WNDPROC Proc, HWND Wnd, diff --git a/reactos/subsys/win32k/include/class.h b/reactos/subsys/win32k/include/class.h index f038088cb16..ca3af5410d6 100644 --- a/reactos/subsys/win32k/include/class.h +++ b/reactos/subsys/win32k/include/class.h @@ -2,9 +2,8 @@ #define __WIN32K_CLASS_H #include -#define NTOS_KERNEL_MODE -#include - +#include +#include #define IS_ATOM(x) \ (((ULONG_PTR)(x) > 0x0) && ((ULONG_PTR)(x) < 0x10000)) diff --git a/reactos/subsys/win32k/include/eng.h b/reactos/subsys/win32k/include/eng.h index fc30c83d735..b70f8fc3c34 100644 --- a/reactos/subsys/win32k/include/eng.h +++ b/reactos/subsys/win32k/include/eng.h @@ -1,8 +1,6 @@ #ifndef __WIN32K_ENG_H #define __WIN32K_ENG_H -#define NO_RESERVED_COLORS 20 - BOOL EngIntersectRect(PRECTL prcDst, PRECTL prcSrc1, PRECTL prcSrc2); #endif /* __WIN32K_ENG_H */ diff --git a/reactos/subsys/win32k/include/mouse.h b/reactos/subsys/win32k/include/mouse.h index bef4bde9b86..734a67e463a 100644 --- a/reactos/subsys/win32k/include/mouse.h +++ b/reactos/subsys/win32k/include/mouse.h @@ -1,9 +1,7 @@ #ifndef __WIN32K_MOUSE_H #define __WIN32K_MOUSE_H -#include "../eng/objects.h" - -INT MouseSafetyOnDrawStart(SURFOBJ *SurfObj, SURFGDI *SurfGDI, LONG HazardX1, LONG HazardY1, LONG HazardX2, LONG HazardY2); -INT MouseSafetyOnDrawEnd(SURFOBJ *SurfObj, SURFGDI *SurfGDI); +INT MouseSafetyOnDrawStart(PSURFOBJ SurfObj, PSURFGDI SurfGDI, LONG HazardX1, LONG HazardY1, LONG HazardX2, LONG HazardY2); +INT MouseSafetyOnDrawEnd(PSURFOBJ SurfObj, PSURFGDI SurfGDI); #endif /* __WIN32K_MOUSE_H */ diff --git a/reactos/subsys/win32k/include/object.h b/reactos/subsys/win32k/include/object.h index bfc9a7b2122..0fa95afe4b6 100644 --- a/reactos/subsys/win32k/include/object.h +++ b/reactos/subsys/win32k/include/object.h @@ -1,7 +1,6 @@ #ifndef __WIN32K_OBJECT_H #define __WIN32K_OBJECT_H -#include #include typedef enum { @@ -26,7 +25,7 @@ typedef struct _USER_HANDLE PVOID ObjectBody; } USER_HANDLE, *PUSER_HANDLE; -#define HANDLE_BLOCK_ENTRIES ((PAGE_SIZE-sizeof(LIST_ENTRY))/sizeof(USER_HANDLE)) +#define HANDLE_BLOCK_ENTRIES ((PAGESIZE-sizeof(LIST_ENTRY))/sizeof(USER_HANDLE)) typedef struct _USER_HANDLE_BLOCK { diff --git a/reactos/subsys/win32k/include/winsta.h b/reactos/subsys/win32k/include/winsta.h index 10571341ab3..0bf8505ecd9 100644 --- a/reactos/subsys/win32k/include/winsta.h +++ b/reactos/subsys/win32k/include/winsta.h @@ -1,9 +1,10 @@ #ifndef __WIN32K_WINSTA_H #define __WIN32K_WINSTA_H -#define NTOS_KERNEL_MODE -#include #include +#include +#include +#include #define PROCESS_WINDOW_STATION() \ ((HWINSTA)(IoGetCurrentProcess()->Win32WindowStation)) diff --git a/reactos/subsys/win32k/ldr/loader.c b/reactos/subsys/win32k/ldr/loader.c index 91c2657882a..3661928f399 100644 --- a/reactos/subsys/win32k/ldr/loader.c +++ b/reactos/subsys/win32k/ldr/loader.c @@ -1,9 +1,8 @@ -/* $Id: loader.c,v 1.8 2002/09/07 15:13:11 chorns Exp $ +/* $Id: loader.c,v 1.9 2002/09/08 10:23:50 chorns Exp $ * */ -#define NTOS_KERNEL_MODE -#include +#include #include HANDLE diff --git a/reactos/subsys/win32k/main/dllmain.c b/reactos/subsys/win32k/main/dllmain.c index f554c20e51c..2d5b938abad 100644 --- a/reactos/subsys/win32k/main/dllmain.c +++ b/reactos/subsys/win32k/main/dllmain.c @@ -1,4 +1,4 @@ -/* $Id: dllmain.c,v 1.28 2002/09/07 15:13:11 chorns Exp $ +/* $Id: dllmain.c,v 1.29 2002/09/08 10:23:51 chorns Exp $ * * Entry Point for win32k.sys */ @@ -6,16 +6,16 @@ #undef WIN32_LEAN_AND_MEAN #define WIN32_NO_STATUS #include -#define NTOS_KERNEL_MODE -#include #include #include +#include + +#include #include #include #include #include -#include //#define NDEBUG #include diff --git a/reactos/subsys/win32k/main/svctabm.c b/reactos/subsys/win32k/main/svctabm.c index 9bb58842c7a..0a0411f1d9f 100644 --- a/reactos/subsys/win32k/main/svctabm.c +++ b/reactos/subsys/win32k/main/svctabm.c @@ -1,4 +1,4 @@ -/* $Id: svctabm.c,v 1.2 2002/09/07 15:13:11 chorns Exp $ +/* $Id: svctabm.c,v 1.3 2002/09/08 10:23:51 chorns Exp $ * * Entry Point for win32k.sys */ @@ -6,8 +6,7 @@ #undef WIN32_LEAN_AND_MEAN #define WIN32_NO_STATUS #include -#define NTOS_KERNEL_MODE -#include +#include #include /* diff --git a/reactos/subsys/win32k/makefile b/reactos/subsys/win32k/makefile index 146024fecc9..58f319873ed 100644 --- a/reactos/subsys/win32k/makefile +++ b/reactos/subsys/win32k/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.50 2002/09/07 15:13:10 chorns Exp $ +# $Id: makefile,v 1.51 2002/09/08 10:23:48 chorns Exp $ PATH_TO_TOP = ../.. @@ -18,7 +18,7 @@ else CFLAGS_DBG := endif -TARGET_CFLAGS = $(CFLAGS_DBG) -I$(PATH_TO_TOP)/ntoskrnl/include -DUNICODE -D_WIN32K_ -D__MINGW_IMPORT=extern -Wall +TARGET_CFLAGS = $(CFLAGS_DBG) -I$(PATH_TO_TOP)/ntoskrnl/include -DUNICODE -Wall ENG_OBJECTS= eng/debug.o eng/mem.o eng/brush.o eng/bitblt.o eng/clip.o \ eng/copybits.o eng/device.o eng/handle.o eng/lineto.o eng/paint.o \ diff --git a/reactos/subsys/win32k/misc/driver.c b/reactos/subsys/win32k/misc/driver.c index 6fe82c380e2..526e4df46d7 100644 --- a/reactos/subsys/win32k/misc/driver.c +++ b/reactos/subsys/win32k/misc/driver.c @@ -1,4 +1,4 @@ -/* $Id: driver.c,v 1.21 2002/09/07 15:13:11 chorns Exp $ +/* $Id: driver.c,v 1.22 2002/09/08 10:23:51 chorns Exp $ * * GDI Driver support routines * (mostly swiped from Wine) @@ -8,13 +8,13 @@ #undef WIN32_LEAN_AND_MEAN #define WIN32_NO_PEHDR -#define NTOS_KERNEL_MODE -#include +#include #include -#include -#include #include #include +//#include "../../ntoskrnl/include/internal/module.h" +#include +#include #define NDEBUG #include @@ -159,7 +159,7 @@ BOOL DRIVER_BuildDDIFunctions(PDRVENABLEDATA DED, return TRUE; } -typedef NTSTATUS (*PMP_DRIVERENTRY)(PVOID, PVOID); +typedef VP_STATUS (*PMP_DRIVERENTRY)(PVOID, PVOID); HANDLE DRIVER_FindMPDriver(LPCWSTR Name) { diff --git a/reactos/subsys/win32k/misc/error.c b/reactos/subsys/win32k/misc/error.c index 7c9c9b27cc7..0d124d9a349 100644 --- a/reactos/subsys/win32k/misc/error.c +++ b/reactos/subsys/win32k/misc/error.c @@ -7,8 +7,7 @@ * REVISION HISTORY: * 06-06-2001 CSH Created */ -#define NTOS_KERNEL_MODE -#include +#include #include diff --git a/reactos/subsys/win32k/ntuser/class.c b/reactos/subsys/win32k/ntuser/class.c index 0cdf8ce8f11..d95b4ccdd6e 100644 --- a/reactos/subsys/win32k/ntuser/class.c +++ b/reactos/subsys/win32k/ntuser/class.c @@ -1,4 +1,4 @@ -/* $Id: class.c,v 1.12 2002/09/07 15:13:12 chorns Exp $ +/* $Id: class.c,v 1.13 2002/09/08 10:23:52 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,9 +9,10 @@ * 06-06-2001 CSH Created */ /* INCLUDES ******************************************************************/ -#define NTOS_KERNEL_MODE -#include + +#include #include +#include #include #include #include diff --git a/reactos/subsys/win32k/ntuser/guicheck.c b/reactos/subsys/win32k/ntuser/guicheck.c index 8a60666742a..407dfa567e0 100644 --- a/reactos/subsys/win32k/ntuser/guicheck.c +++ b/reactos/subsys/win32k/ntuser/guicheck.c @@ -1,4 +1,4 @@ - /* $Id: guicheck.c,v 1.7 2002/09/07 15:13:12 chorns Exp $ + /* $Id: guicheck.c,v 1.8 2002/09/08 10:23:52 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -15,12 +15,13 @@ /* INCLUDES ******************************************************************/ -#define NTOS_KERNEL_MODE -#include +#include +#include #include #include #include #include +#include #include #define NDEBUG diff --git a/reactos/subsys/win32k/ntuser/window.c b/reactos/subsys/win32k/ntuser/window.c index 0477bdcd8cd..1fcb5667766 100644 --- a/reactos/subsys/win32k/ntuser/window.c +++ b/reactos/subsys/win32k/ntuser/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.16 2002/09/07 15:13:12 chorns Exp $ +/* $Id: window.c,v 1.17 2002/09/08 10:23:52 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -563,7 +563,7 @@ NtUserCreateWindowEx(DWORD dwExStyle, if (WindowObject->Style & (WS_MINIMIZE | WS_MAXIMIZE)) { RECT NewPos; - USHORT SwFlag; + UINT16 SwFlag; SwFlag = (WindowObject->Style & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE; diff --git a/reactos/subsys/win32k/ntuser/winsta.c b/reactos/subsys/win32k/ntuser/winsta.c index f73cdb12e19..46af76baaed 100644 --- a/reactos/subsys/win32k/ntuser/winsta.c +++ b/reactos/subsys/win32k/ntuser/winsta.c @@ -1,4 +1,4 @@ -/* $Id: winsta.c,v 1.8 2002/09/07 15:13:12 chorns Exp $ +/* $Id: winsta.c,v 1.9 2002/09/08 10:23:52 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -17,12 +17,12 @@ /* INCLUDES ******************************************************************/ -#define NTOS_KERNEL_MODE -#include +#include #include #include #include #include +#include #include #include @@ -253,7 +253,7 @@ NtUserCreateWindowStation(PUNICODE_STRING lpszWindowStationName, DPRINT("Creating window station (%wZ)\n", &WindowStationName); - Status = ObRosCreateObject(&WinSta, + Status = ObCreateObject(&WinSta, STANDARD_RIGHTS_REQUIRED, &ObjectAttributes, ExWindowStationObjectType, @@ -570,7 +570,7 @@ NtUserCreateDesktop(PUNICODE_STRING lpszDesktopName, DPRINT("Status for open operation (0x%X)\n", Status); - Status = ObRosCreateObject(&Desktop, + Status = ObCreateObject(&Desktop, STANDARD_RIGHTS_REQUIRED, &ObjectAttributes, ExDesktopObjectType, diff --git a/reactos/subsys/win32k/objects/bitmaps.c b/reactos/subsys/win32k/objects/bitmaps.c index cb00799d6cc..4198d11828f 100644 --- a/reactos/subsys/win32k/objects/bitmaps.c +++ b/reactos/subsys/win32k/objects/bitmaps.c @@ -1,7 +1,5 @@ #undef WIN32_LEAN_AND_MEAN #include -#define NTOS_KERNEL_MODE -#include #include #include //#include @@ -22,16 +20,16 @@ BOOL STDCALL W32kBitBlt(HDC hDCDest, { PDC DCDest = DC_HandleToPtr(hDCDest); PDC DCSrc = DC_HandleToPtr(hDCSrc); - SURFOBJ *SurfDest, *SurfSrc; + PSURFOBJ SurfDest, SurfSrc; PSURFGDI SurfGDIDest, SurfGDISrc; RECTL DestRect; POINTL SourcePoint; PBITMAPOBJ DestBitmapObj; PBITMAPOBJ SrcBitmapObj; BOOL Status, SurfDestAlloc, SurfSrcAlloc; - ROS_PALOBJ* DCLogPal; + PPALOBJ DCLogPal; PPALGDI PalDestGDI, PalSourceGDI; - XLATEOBJ* XlateObj = NULL; + PXLATEOBJ XlateObj = NULL; HPALETTE SourcePalette, DestPalette; /* Offset the destination and source by the origin of their DCs. */ @@ -52,14 +50,14 @@ BOOL STDCALL W32kBitBlt(HDC hDCDest, SurfSrcAlloc = FALSE; // Determine surfaces to be used in the bitblt - SurfDest = (SURFOBJ*)AccessUserObject(DCDest->Surface); - SurfSrc = (SURFOBJ*)AccessUserObject(DCSrc->Surface); + SurfDest = (PSURFOBJ)AccessUserObject(DCDest->Surface); + SurfSrc = (PSURFOBJ)AccessUserObject(DCSrc->Surface); - SurfGDIDest = (SURFGDI*)AccessInternalObjectFromUserObject(SurfDest); - SurfGDISrc = (SURFGDI*)AccessInternalObjectFromUserObject(SurfSrc); + SurfGDIDest = (PSURFGDI)AccessInternalObjectFromUserObject(SurfDest); + SurfGDISrc = (PSURFGDI)AccessInternalObjectFromUserObject(SurfSrc); // Retrieve the logical palette of the destination DC - DCLogPal = (ROS_PALOBJ*)AccessUserObject(DCDest->w.hPalette); + DCLogPal = (PPALOBJ)AccessUserObject(DCDest->w.hPalette); if(DCLogPal) if(DCLogPal->logicalToSystem) @@ -83,7 +81,7 @@ BOOL STDCALL W32kBitBlt(HDC hDCDest, PalDestGDI = (PPALGDI)AccessInternalObject(DestPalette); PalSourceGDI = (PPALGDI)AccessInternalObject(SourcePalette); - XlateObj = (XLATEOBJ*)EngCreateXlate(PalDestGDI->Mode, PalSourceGDI->Mode, DestPalette, SourcePalette); + XlateObj = (PXLATEOBJ)EngCreateXlate(PalDestGDI->Mode, PalSourceGDI->Mode, DestPalette, SourcePalette); } // Perform the bitblt operation diff --git a/reactos/subsys/win32k/objects/brush.c b/reactos/subsys/win32k/objects/brush.c index 015a0a3e7d9..11feb083358 100644 --- a/reactos/subsys/win32k/objects/brush.c +++ b/reactos/subsys/win32k/objects/brush.c @@ -1,11 +1,10 @@ -/* $Id: brush.c,v 1.16 2002/09/07 15:13:12 chorns Exp $ +/* $Id: brush.c,v 1.17 2002/09/08 10:23:52 chorns Exp $ */ #undef WIN32_LEAN_AND_MEAN #include -#define NTOS_KERNEL_MODE -#include +#include #include #include //#include @@ -16,7 +15,7 @@ HBRUSH STDCALL W32kCreateBrushIndirect(CONST LOGBRUSH *lb) { - ROS_BRUSHOBJ *brushPtr; + PBRUSHOBJ brushPtr; HBRUSH hBrush; hBrush = BRUSHOBJ_AllocBrush(); @@ -25,7 +24,7 @@ HBRUSH STDCALL W32kCreateBrushIndirect(CONST LOGBRUSH *lb) return 0; } - brushPtr = (ROS_BRUSHOBJ *)BRUSHOBJ_LockBrush (hBrush); + brushPtr = BRUSHOBJ_LockBrush (hBrush); ASSERT( brushPtr ); //I want to know if this ever occurs if( brushPtr ){ @@ -45,7 +44,6 @@ HBRUSH STDCALL W32kCreateDIBPatternBrush(HGLOBAL hDIBPacked, { UNIMPLEMENTED; #if 0 - // FIXME: LOGBRUSH logbrush; PBITMAPINFO info, newInfo; INT size; @@ -187,8 +185,8 @@ BOOL STDCALL W32kPatBlt(HDC hDC, DWORD ROP) { RECT DestRect; - ROS_BRUSHOBJ *BrushObj; - SURFOBJ *SurfObj; + PBRUSHOBJ BrushObj; + PSURFOBJ SurfObj; DC *dc = DC_HandleToPtr(hDC); BOOL ret; @@ -199,7 +197,7 @@ BOOL STDCALL W32kPatBlt(HDC hDC, SurfObj = (SURFOBJ*)AccessUserObject((ULONG)dc->Surface); - BrushObj = (ROS_BRUSHOBJ*) GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC); + BrushObj = (BRUSHOBJ*) GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC); assert(BrushObj); if (BrushObj->logbrush.lbStyle != BS_NULL) { diff --git a/reactos/subsys/win32k/objects/cliprgn.c b/reactos/subsys/win32k/objects/cliprgn.c index 3c25dc7b541..2439268ef5e 100644 --- a/reactos/subsys/win32k/objects/cliprgn.c +++ b/reactos/subsys/win32k/objects/cliprgn.c @@ -1,6 +1,8 @@ -#define NTOS_KERNEL_MODE -#include + +#undef WIN32_LEAN_AND_MEAN +#include +#include #include #include #include diff --git a/reactos/subsys/win32k/objects/color.c b/reactos/subsys/win32k/objects/color.c index eaeb6ee1daa..a9a2f91b089 100644 --- a/reactos/subsys/win32k/objects/color.c +++ b/reactos/subsys/win32k/objects/color.c @@ -6,10 +6,9 @@ #include #include #include -#include #include "../eng/handle.h" -#define NDEBUG +// #define NDEBUG #include int COLOR_gapStart = 256; @@ -20,7 +19,7 @@ int COLOR_max = 256; static HPALETTE hPrimaryPalette = 0; // used for WM_PALETTECHANGED static HPALETTE hLastRealizedPalette = 0; // UnrealizeObject() needs it -const PALETTEENTRY COLOR_sysPalTemplate[NO_RESERVED_COLORS] = +const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS] = { // first 10 entries in the system palette // red green blue flags @@ -123,13 +122,12 @@ HPALETTE STDCALL W32kCreateHalftonePalette(HDC hDC) HPALETTE STDCALL W32kCreatePalette(CONST PLOGPALETTE palette) { -// FIXME: PALOBJ is not correct - reimplement - ROS_PALOBJ* PalObj; + PPALOBJ PalObj; HPALETTE NewPalette = (HPALETTE)EngCreatePalette(PAL_INDEXED, palette->palNumEntries, (PULONG*) palette->palPalEntry, 0, 0, 0); ULONG size; - PalObj = (ROS_PALOBJ*)AccessUserObject(NewPalette); + PalObj = (PPALOBJ)AccessUserObject(NewPalette); size = sizeof(LOGPALETTE) + (palette->palNumEntries * sizeof(PALETTEENTRY)); PalObj->logpalette = ExAllocatePool(NonPagedPool, size); @@ -151,12 +149,12 @@ COLORREF STDCALL W32kGetNearestColor(HDC hDC, { COLORREF nearest = CLR_INVALID; PDC dc; - ROS_PALOBJ* palObj; + PPALOBJ palObj; if( (dc = DC_HandleToPtr(hDC) ) ) { HPALETTE hpal = (dc->w.hPalette)? dc->w.hPalette : W32kGetStockObject(DEFAULT_PALETTE); - palObj = (ROS_PALOBJ*)AccessUserObject(hpal); + palObj = (PPALOBJ)AccessUserObject(hpal); if (!palObj) { // GDI_ReleaseObj(hdc); return nearest; @@ -175,7 +173,7 @@ COLORREF STDCALL W32kGetNearestColor(HDC hDC, UINT STDCALL W32kGetNearestPaletteIndex(HPALETTE hpal, COLORREF Color) { - ROS_PALOBJ* palObj = (ROS_PALOBJ*)AccessUserObject(hpal); + PPALOBJ palObj = (PPALOBJ)AccessUserObject(hpal); UINT index = 0; if( palObj ) @@ -193,10 +191,10 @@ UINT STDCALL W32kGetPaletteEntries(HPALETTE hpal, UINT Entries, LPPALETTEENTRY pe) { - ROS_PALOBJ* palPtr; + PPALOBJ palPtr; UINT numEntries; - palPtr = (ROS_PALOBJ*)AccessUserObject(hpal); + palPtr = (PPALOBJ)AccessUserObject(hpal); if (!palPtr) return 0; numEntries = palPtr->logpalette->palNumEntries; @@ -274,7 +272,7 @@ A logical palette is a buffer between color-intensive applications and the syste -- If it is an RGB palette, then an XLATEOBJ is created between the RGB values and the dc palette. */ { - ROS_PALOBJ *palPtr, *sysPtr; + PPALOBJ palPtr, sysPtr; PPALGDI palGDI, sysGDI; int realized = 0; PDC dc = (PDC)AccessUserObject(hDC); @@ -284,10 +282,10 @@ A logical palette is a buffer between color-intensive applications and the syste if (!dc) return 0; - palPtr = (ROS_PALOBJ*)AccessUserObject(dc->w.hPalette); + palPtr = (PPALOBJ)AccessUserObject(dc->w.hPalette); SurfGDI = (PSURFGDI)AccessInternalObjectFromUserObject(dc->Surface); systemPalette = W32kGetStockObject(STOCK_DEFAULT_PALETTE); - sysPtr = (ROS_PALOBJ*)AccessInternalObject(systemPalette); + sysPtr = (PPALOBJ)AccessInternalObject(systemPalette); palGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette); sysGDI = (PPALGDI)AccessInternalObject(systemPalette); @@ -327,7 +325,7 @@ A logical palette is a buffer between color-intensive applications and the syste BOOL STDCALL W32kResizePalette(HPALETTE hpal, UINT Entries) { -/* PALOBJ* palPtr = (PALOBJ*)AccessUserObject(hPal); +/* PPALOBJ palPtr = (PPALOBJ)AccessUserObject(hPal); UINT cPrevEnt, prevVer; INT prevsize, size = sizeof(LOGPALETTE) + (cEntries - 1) * sizeof(PALETTEENTRY); PXLATEOBJ XlateObj = NULL; @@ -393,10 +391,10 @@ UINT STDCALL W32kSetPaletteEntries(HPALETTE hpal, UINT Entries, CONST LPPALETTEENTRY pe) { - ROS_PALOBJ* palPtr; + PPALOBJ palPtr; INT numEntries; - palPtr = (ROS_PALOBJ*)AccessUserObject(hpal); + palPtr = (PPALOBJ)AccessUserObject(hpal); if (!palPtr) return 0; numEntries = palPtr->logpalette->palNumEntries; @@ -447,7 +445,7 @@ BOOL STDCALL W32kUpdateColors(HDC hDC) } int COLOR_PaletteLookupPixel(PALETTEENTRY *palPalEntry, int size, - XLATEOBJ *XlateObj, COLORREF col, BOOL skipReserved) + PXLATEOBJ XlateObj, COLORREF col, BOOL skipReserved) { int i, best = 0, diff = 0x7fffffff; int r, g, b; diff --git a/reactos/subsys/win32k/objects/dc.c b/reactos/subsys/win32k/objects/dc.c index dca4f17139e..f146aaa06f0 100644 --- a/reactos/subsys/win32k/objects/dc.c +++ b/reactos/subsys/win32k/objects/dc.c @@ -1,4 +1,4 @@ -/* $Id: dc.c,v 1.37 2002/09/07 15:13:12 chorns Exp $ +/* $Id: dc.c,v 1.38 2002/09/08 10:23:52 chorns Exp $ * * DC.C - Device context functions * @@ -6,9 +6,7 @@ #undef WIN32_LEAN_AND_MEAN #include -#define NTOS_KERNEL_MODE -#include -#include +#include #include #include @@ -27,7 +25,6 @@ /* FIXME: DCs should probably be thread safe */ -#define DDI_DRIVER_VERSION 0x00010000 /* * DC device-independent Get/SetXXX functions * (RJJ) swiped from WINE @@ -84,7 +81,7 @@ INT STDCALL func_name( HDC hdc, INT mode ) \ return prevMode; \ } -VOID BitmapToSurf(HDC hdc, PSURFGDI SurfGDI, SURFOBJ *SurfObj, PBITMAPOBJ Bitmap); +VOID BitmapToSurf(HDC hdc, PSURFGDI SurfGDI, PSURFOBJ SurfObj, PBITMAPOBJ Bitmap); // --------------------------------------------------------- File Statics @@ -184,6 +181,8 @@ HDC STDCALL W32kCreateCompatableDC(HDC hDC) return hNewDC; } +#include + HDC STDCALL W32kCreateDC(LPCWSTR Driver, LPCWSTR Device, LPCWSTR Output, @@ -194,7 +193,7 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver, PDC NewDC; HDC hDC = NULL; DRVENABLEDATA DED; - SURFOBJ *SurfObj; + PSURFOBJ SurfObj; /* Check for existing DC object */ if ((hNewDC = DC_FindOpenDC(Driver)) != NULL) @@ -300,7 +299,7 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver, NewDC->Surface = NewDC->DriverFunctions.EnableSurface(NewDC->PDev); // hsurf NewDC->w.hPalette = NewDC->DevInfo.hpalDefault; - SurfObj = (SURFOBJ*)AccessUserObject(NewDC->Surface); + SurfObj = (PSURFOBJ)AccessUserObject(NewDC->Surface); SurfObj->dhpdev = NewDC->PDev; DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel); @@ -900,14 +899,14 @@ INT STDCALL W32kSaveDC(HDC hDC) HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj) { - ROS_BRUSHOBJ *brush; HGDIOBJ objOrg; BITMAPOBJ *pb; - SURFOBJ *surfobj; + PSURFOBJ surfobj; PSURFGDI surfgdi; PDC dc; PPENOBJ pen; - XLATEOBJ *XlateObj; + PBRUSHOBJ brush; + PXLATEOBJ XlateObj; PPALGDI PalGDI; WORD objectMagic; @@ -927,7 +926,7 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj) // Convert the color of the pen to the format of the DC PalGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette); if( PalGDI ){ - XlateObj = (XLATEOBJ*)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL); + XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL); pen = GDIOBJ_LockObj(dc->w.hPen, GO_PEN_MAGIC); pen->logpen.lopnColor = XLATEOBJ_iXlate(XlateObj, pen->logpen.lopnColor); GDIOBJ_UnlockObj( dc->w.hPen, GO_PEN_MAGIC); @@ -940,8 +939,8 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj) // Convert the color of the brush to the format of the DC PalGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette); if( PalGDI ){ - XlateObj = (XLATEOBJ*)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL); - brush = (ROS_BRUSHOBJ *)GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC); + XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL); + brush = GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC); brush->iSolidColor = XLATEOBJ_iXlate(XlateObj, brush->logbrush.lbColor); GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC); @@ -960,7 +959,7 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj) pb = BITMAPOBJ_HandleToPtr (hGDIObj); dc->w.hBitmap = CreateGDIHandle(sizeof( SURFGDI ), sizeof( SURFOBJ )); // Assign the DC's bitmap - surfobj = (SURFOBJ*) AccessUserObject( dc->w.hBitmap ); + surfobj = (PSURFOBJ) AccessUserObject( dc->w.hBitmap ); surfgdi = (PSURFGDI) AccessInternalObject( dc->w.hBitmap ); BitmapToSurf(hDC, surfgdi, surfobj, pb); // Put the bitmap in a surface diff --git a/reactos/subsys/win32k/objects/dib.c b/reactos/subsys/win32k/objects/dib.c index 2d44d274a48..494db319be3 100644 --- a/reactos/subsys/win32k/objects/dib.c +++ b/reactos/subsys/win32k/objects/dib.c @@ -6,24 +6,22 @@ #include #include "../eng/handle.h" #include -#include -VOID BitmapToSurf(HDC hdc, PSURFGDI SurfGDI, SURFOBJ *SurfObj, PBITMAPOBJ Bitmap); +VOID BitmapToSurf(HDC hdc, PSURFGDI SurfGDI, PSURFOBJ SurfObj, PBITMAPOBJ Bitmap); UINT STDCALL W32kSetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, CONST RGBQUAD *Colors) { - // FIXME: PALOBJ changed, reimplement PDC dc; PALETTEENTRY * palEntry; - ROS_PALOBJ* palette; + PPALOBJ palette; RGBQUAD *end; if (!(dc = (PDC)AccessUserObject(hDC))) return 0; - if (!(palette = (ROS_PALOBJ*)AccessUserObject(dc->DevInfo.hpalDefault))) + if (!(palette = (PPALOBJ)AccessUserObject(dc->DevInfo.hpalDefault))) { // GDI_ReleaseObj( hdc ); return 0; @@ -69,12 +67,12 @@ INT STDCALL W32kSetDIBits(HDC hDC, HBITMAP SourceBitmap, DestBitmap; INT result; BOOL copyBitsResult; - SURFOBJ *DestSurf, *SourceSurf; + PSURFOBJ DestSurf, SourceSurf; PSURFGDI DestGDI; SIZEL SourceSize; POINTL ZeroPoint; RECTL DestRect; - XLATEOBJ* XlateObj; + PXLATEOBJ XlateObj; PPALGDI hDCPalette; RGBQUAD *lpRGB; HPALETTE DDB_Palette, DIB_Palette; @@ -100,7 +98,7 @@ INT STDCALL W32kSetDIBits(HDC hDC, // Create a temporary surface for the destination bitmap DestBitmap = (HBITMAP)CreateGDIHandle(sizeof(SURFGDI), sizeof(SURFOBJ)); - DestSurf = (SURFOBJ*) AccessUserObject( DestBitmap ); + DestSurf = (PSURFOBJ) AccessUserObject( DestBitmap ); DestGDI = (PSURFGDI) AccessInternalObject( DestBitmap ); BitmapToSurf(hDC, DestGDI, DestSurf, bitmap); @@ -111,7 +109,7 @@ INT STDCALL W32kSetDIBits(HDC hDC, SourceBitmap = EngCreateBitmap(SourceSize, DIB_GetDIBWidthBytes(SourceSize.cx, bmi->bmiHeader.biBitCount), BitmapFormat(bmi->bmiHeader.biBitCount, bmi->bmiHeader.biCompression), 0, Bits); - SourceSurf = (SURFOBJ*)AccessUserObject(SourceBitmap); + SourceSurf = (PSURFOBJ)AccessUserObject(SourceBitmap); // Destination palette obtained from the hDC hDCPalette = (PPALGDI)AccessInternalObject(dc->DevInfo.hpalDefault); @@ -660,11 +658,10 @@ PBITMAPOBJ DIBtoDDB(HGLOBAL hPackedDIB, HDC hdc) // FIXME: This should be remove RGBQUAD *DIB_MapPaletteColors(PDC dc, LPBITMAPINFO lpbmi) { - // FIXME: PALOBJ changed, reimplement RGBQUAD *lpRGB; int nNumColors,i; DWORD *lpIndex; - ROS_PALOBJ* palObj; + PPALOBJ palObj; palObj = AccessUserObject(dc->DevInfo.hpalDefault); diff --git a/reactos/subsys/win32k/objects/fillshap.c b/reactos/subsys/win32k/objects/fillshap.c index 3dff3644824..a7f10517dc0 100644 --- a/reactos/subsys/win32k/objects/fillshap.c +++ b/reactos/subsys/win32k/objects/fillshap.c @@ -1,8 +1,7 @@ #undef WIN32_LEAN_AND_MEAN #include -#define NTOS_KERNEL_MODE -#include +#include #include #include #include @@ -81,7 +80,7 @@ W32kRectangle(HDC hDC, { DC *dc = DC_HandleToPtr(hDC); SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject((ULONG)dc->Surface); - ROS_BRUSHOBJ *BrushObj; + PBRUSHOBJ BrushObj; BOOL ret; PRECTL RectBounds; PENOBJ * pen; @@ -99,7 +98,7 @@ W32kRectangle(HDC hDC, // Draw the rectangle with the current pen pen = (PENOBJ*) GDIOBJ_LockObj(dc->w.hPen, GO_PEN_MAGIC); ASSERT(pen); - BrushObj = (ROS_BRUSHOBJ*)PenToBrushObj(dc, pen); + BrushObj = (PBRUSHOBJ)PenToBrushObj(dc, pen); GDIOBJ_UnlockObj( dc->w.hPen, GO_PEN_MAGIC ); LeftRect += dc->w.DCOrgX; diff --git a/reactos/subsys/win32k/objects/gdiobj.c b/reactos/subsys/win32k/objects/gdiobj.c index 50aafd74684..9fae31a4879 100644 --- a/reactos/subsys/win32k/objects/gdiobj.c +++ b/reactos/subsys/win32k/objects/gdiobj.c @@ -1,7 +1,7 @@ /* * GDIOBJ.C - GDI object manipulation routines * - * $Id: gdiobj.c,v 1.17 2002/09/07 15:13:12 chorns Exp $ + * $Id: gdiobj.c,v 1.18 2002/09/08 10:23:53 chorns Exp $ * */ @@ -165,8 +165,6 @@ HGDIOBJ GDIOBJ_AllocObj(WORD Size, WORD Magic) PGDIOBJHDR newObject; PGDI_HANDLE_ENTRY handleEntry; - assert_irql(PASSIVE_LEVEL); - DPRINT("GDIOBJ_AllocObj: size: %d, magic: %x\n", Size, Magic); newObject = ExAllocatePool (PagedPool, Size + sizeof (GDIOBJHDR)); if (newObject == NULL) @@ -410,7 +408,7 @@ WORD GDIOBJ_GetHandleMagic (HGDIOBJ ObjectHandle) } VOID -InitGdiObjectHandleTable (VOID) +InitGdiObjectHandleTable (void) { DPRINT ("InitGdiObjectHandleTable\n"); ExInitializeFastMutex (&HandleTableMutex); diff --git a/reactos/subsys/win32k/objects/objconv.c b/reactos/subsys/win32k/objects/objconv.c index 3e0be63403c..9dbbe03e076 100644 --- a/reactos/subsys/win32k/objects/objconv.c +++ b/reactos/subsys/win32k/objects/objconv.c @@ -1,7 +1,6 @@ #undef WIN32_LEAN_AND_MEAN #include -#define NTOS_KERNEL_MODE -#include +#include /* FIXME: Surely we should just have one include file that includes all of these.. */ #include @@ -18,7 +17,7 @@ #include -BRUSHOBJ* PenToBrushObj(PDC dc, PENOBJ *pen) +PBRUSHOBJ PenToBrushObj(PDC dc, PENOBJ *pen) { BRUSHOBJ *BrushObj; XLATEOBJ *RGBtoVGA16; @@ -29,7 +28,7 @@ BRUSHOBJ* PenToBrushObj(PDC dc, PENOBJ *pen) return BrushObj; } -VOID BitmapToSurf(HDC hdc, PSURFGDI SurfGDI, SURFOBJ *SurfObj, PBITMAPOBJ Bitmap) +VOID BitmapToSurf(HDC hdc, PSURFGDI SurfGDI, PSURFOBJ SurfObj, PBITMAPOBJ Bitmap) { ASSERT( SurfGDI ); if( Bitmap ){ diff --git a/reactos/subsys/win32k/objects/palette.c b/reactos/subsys/win32k/objects/palette.c index bf8f4f5ff1f..d676098142c 100644 --- a/reactos/subsys/win32k/objects/palette.c +++ b/reactos/subsys/win32k/objects/palette.c @@ -1,11 +1,8 @@ #undef WIN32_LEAN_AND_MEAN #include -#define NTOS_KERNEL_MODE -#include #include #include #include -#include #include static int PALETTE_firstFree = 0; @@ -29,16 +26,16 @@ HPALETTE PALETTE_Init(void) int i; HPALETTE hpalette; PLOGPALETTE palPtr; - ROS_PALOBJ *palObj; + PPALOBJ palObj; const PALETTEENTRY* __sysPalTemplate = (const PALETTEENTRY*)COLOR_GetSystemPaletteTemplate(); // create default palette (20 system colors) - palPtr = ExAllocatePool(NonPagedPool, sizeof(LOGPALETTE) + (NO_RESERVED_COLORS * sizeof(PALETTEENTRY))); + palPtr = ExAllocatePool(NonPagedPool, sizeof(LOGPALETTE) + (NB_RESERVED_COLORS * sizeof(PALETTEENTRY))); if (!palPtr) return FALSE; palPtr->palVersion = 0x300; - palPtr->palNumEntries = NO_RESERVED_COLORS; - for(i=0; ipalNumEntries = NB_RESERVED_COLORS; + for(i=0; ipalPalEntry[i].peRed = __sysPalTemplate[i].peRed; palPtr->palPalEntry[i].peGreen = __sysPalTemplate[i].peGreen; @@ -49,7 +46,7 @@ HPALETTE PALETTE_Init(void) hpalette = W32kCreatePalette(palPtr); ExFreePool(palPtr); - palObj = (PALOBJ*)AccessUserObject(hpalette); + palObj = (PPALOBJ)AccessUserObject(hpalette); if (palObj) { if (!(palObj->mapping = ExAllocatePool(NonPagedPool, sizeof(int) * 20))) @@ -68,10 +65,10 @@ static void PALETTE_FormatSystemPalette(void) // Build free list so we'd have an easy way to find // out if there are any available colorcells. - int i, j = PALETTE_firstFree = NO_RESERVED_COLORS/2; + int i, j = PALETTE_firstFree = NB_RESERVED_COLORS/2; COLOR_sysPal[j].peFlags = 0; - for(i = NO_RESERVED_COLORS/2 + 1 ; i < 256 - NO_RESERVED_COLORS/2 ; i++) + for(i = NB_RESERVED_COLORS/2 + 1 ; i < 256 - NB_RESERVED_COLORS/2 ; i++) { if( i < COLOR_gapStart || i > COLOR_gapEnd ) { @@ -92,16 +89,13 @@ void PALETTE_ValidateFlags(PALETTEENTRY* lpPalE, int size) // Set the color-mapping table for selected palette. // Return number of entries which mapping has changed. -int PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly) +int PALETTE_SetMapping(PPALOBJ palPtr, UINT uStart, UINT uNum, BOOL mapOnly) { - ROS_PALOBJ *po; char flag; - int prevMapping; + int prevMapping = (palPtr->mapping) ? 1 : 0; int index, iRemapped = 0; int *mapping; - prevMapping = (po->mapping) ? 1 : 0; - // reset dynamic system palette entries if( !mapOnly && PALETTE_firstFree != -1) PALETTE_FormatSystemPalette(); @@ -109,22 +103,22 @@ int PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly) // initialize palette mapping table //mapping = HeapReAlloc( GetProcessHeap(), 0, palPtr->mapping, - // sizeof(int)*po->logpalette->palNumEntries); - ExFreePool(po->mapping); - mapping = ExAllocatePool(NonPagedPool, sizeof(int)*po->logpalette->palNumEntries); + // sizeof(int)*palPtr->logpalette->palNumEntries); + ExFreePool(palPtr->mapping); + mapping = ExAllocatePool(NonPagedPool, sizeof(int)*palPtr->logpalette->palNumEntries); - po->mapping = mapping; + palPtr->mapping = mapping; for(uNum += uStart; uStart < uNum; uStart++) { index = -1; flag = PC_SYS_USED; - switch( po->logpalette->palPalEntry[uStart].peFlags & 0x07 ) + switch( palPtr->logpalette->palPalEntry[uStart].peFlags & 0x07 ) { case PC_EXPLICIT: // palette entries are indices into system palette // The PC_EXPLICIT flag is used to copy an entry from the system palette into the logical palette - index = *(WORD*)(po->logpalette->palPalEntry + uStart); + index = *(WORD*)(palPtr->logpalette->palPalEntry + uStart); if(index > 255 || (index >= COLOR_gapStart && index <= COLOR_gapEnd)) { DbgPrint("Win32k: PC_EXPLICIT: idx %d out of system palette, assuming black.\n", index); @@ -139,7 +133,7 @@ int PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly) // fall through default: // try to collapse identical colors index = COLOR_PaletteLookupExactIndex(COLOR_sysPal, 256, - *(COLORREF*)(po->logpalette->palPalEntry + uStart)); + *(COLORREF*)(palPtr->logpalette->palPalEntry + uStart)); // fall through case PC_NOCOLLAPSE: @@ -159,13 +153,13 @@ int PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly) PALETTE_firstFree = PALETTE_freeList[index]; color.pixel = (PALETTE_PaletteToXPixel) ? PALETTE_PaletteToXPixel[index] : index; - color.red = po->logpalette->palPalEntry[uStart].peRed << 8; - color.green = po->logpalette->palPalEntry[uStart].peGreen << 8; - color.blue = po->logpalette->palPalEntry[uStart].peBlue << 8; + color.red = palPtr->logpalette->palPalEntry[uStart].peRed << 8; + color.green = palPtr->logpalette->palPalEntry[uStart].peGreen << 8; + color.blue = palPtr->logpalette->palPalEntry[uStart].peBlue << 8; color.flags = DoRed | DoGreen | DoBlue; TSXStoreColor(display, PALETTE_PaletteXColormap, &color); - COLOR_sysPal[index] = po->logpalette->palPalEntry[uStart]; + COLOR_sysPal[index] = palPtr->logpalette->palPalEntry[uStart]; COLOR_sysPal[index].peFlags = flag; PALETTE_freeList[index] = 0; @@ -175,23 +169,23 @@ int PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly) /* else if (PALETTE_PaletteFlags & PALETTE_VIRTUAL) { index = PALETTE_ToPhysical(NULL, 0x00ffffff & - *(COLORREF*)(po->logpalette->palPalEntry + uStart)); + *(COLORREF*)(palPtr->logpalette->palPalEntry + uStart)); break; } FIXME */ // we have to map to existing entry in the system palette index = COLOR_PaletteLookupPixel(COLOR_sysPal, 256, NULL, - *(COLORREF*)(po->logpalette->palPalEntry + uStart), TRUE); + *(COLORREF*)(palPtr->logpalette->palPalEntry + uStart), TRUE); } - po->logpalette->palPalEntry[uStart].peFlags |= PC_SYS_USED; + palPtr->logpalette->palPalEntry[uStart].peFlags |= PC_SYS_USED; /* if(PALETTE_PaletteToXPixel) index = PALETTE_PaletteToXPixel[index]; FIXME */ break; } - if( !prevMapping || po->mapping[uStart] != index ) iRemapped++; - po->mapping[uStart] = index; + if( !prevMapping || palPtr->mapping[uStart] != index ) iRemapped++; + palPtr->mapping[uStart] = index; } return iRemapped; diff --git a/reactos/subsys/win32k/objects/print.c b/reactos/subsys/win32k/objects/print.c index 675f32d1daf..b8b452822b5 100644 --- a/reactos/subsys/win32k/objects/print.c +++ b/reactos/subsys/win32k/objects/print.c @@ -61,7 +61,7 @@ W32kSetAbortProc(HDC hDC, INT STDCALL W32kStartDoc(HDC hDC, - CONST LPDOCINFO di) + CONST PDOCINFO di) { UNIMPLEMENTED; } diff --git a/reactos/subsys/win32k/objects/region.c b/reactos/subsys/win32k/objects/region.c index 4e54581791e..dc4959a64b6 100644 --- a/reactos/subsys/win32k/objects/region.c +++ b/reactos/subsys/win32k/objects/region.c @@ -1784,7 +1784,7 @@ W32kPaintRgn(HDC hDC, PROSRGNDATA visrgn; CLIPOBJ* ClipRegion; BOOL bRet = FALSE; - BRUSHOBJ *pBrush; + PBRUSHOBJ pBrush; POINTL BrushOrigin; SURFOBJ *SurfObj; diff --git a/reactos/subsys/win32k/objects/text.c b/reactos/subsys/win32k/objects/text.c index e0235cbd7ea..a50faaa5cc5 100644 --- a/reactos/subsys/win32k/objects/text.c +++ b/reactos/subsys/win32k/objects/text.c @@ -1,8 +1,8 @@ + + #undef WIN32_LEAN_AND_MEAN #include -#define NTOS_KERNEL_MODE -#include -#include +#include #include #include #include @@ -46,7 +46,7 @@ STDCALL W32kAddFontResource(LPCWSTR Filename) { HFONT NewFont; - FONTOBJ *FontObj; + PFONTOBJ FontObj; PFONTGDI FontGDI; UNICODE_STRING uFileName; NTSTATUS Status; @@ -62,7 +62,7 @@ W32kAddFontResource(LPCWSTR Filename) IO_STATUS_BLOCK Iosb; NewFont = (HFONT)CreateGDIHandle(sizeof( FONTGDI ), sizeof( FONTOBJ )); - FontObj = (FONTOBJ*) AccessUserObject( NewFont ); + FontObj = (PFONTOBJ) AccessUserObject( NewFont ); FontGDI = (PFONTGDI) AccessInternalObject( NewFont ); RtlCreateUnicodeString(&uFileName, (LPWSTR)Filename); @@ -459,7 +459,6 @@ W32kGetTextExtentPoint(HDC hDC, Size->cx = TotalWidth; Size->cy = MaxHeight; - return TRUE; } BOOL @@ -498,7 +497,7 @@ W32kGetTextMetrics(HDC hDC, BOOL STDCALL W32kPolyTextOut(HDC hDC, - CONST PPOLYTEXTW txt, + CONST LPPOLYTEXT txt, int Count) { UNIMPLEMENTED; @@ -586,18 +585,18 @@ W32kTextOut(HDC hDC, RECTL DestRect, MaskRect; POINTL SourcePoint, BrushOrigin; HBRUSH hBrush = NULL; - BRUSHOBJ *Brush = NULL; + PBRUSHOBJ Brush = NULL; HBITMAP HSourceGlyph; - SURFOBJ *SourceGlyphSurf; + PSURFOBJ SourceGlyphSurf; SIZEL bitSize; FT_CharMap found = 0, charmap; INT yoff; HFONT hFont = 0; - FONTOBJ *FontObj; + PFONTOBJ FontObj; PFONTGDI FontGDI; PTEXTOBJ TextObj; PPALGDI PalDestGDI; - XLATEOBJ *XlateObj; + PXLATEOBJ XlateObj; if( !dc ) return FALSE; @@ -621,7 +620,7 @@ W32kTextOut(HDC hDC, goto fail; } - FontObj = (FONTOBJ*)AccessUserObject(hFont); + FontObj = (PFONTOBJ)AccessUserObject(hFont); FontGDI = (PFONTGDI)AccessInternalObject(hFont); face = FontGDI->face; @@ -653,7 +652,7 @@ W32kTextOut(HDC hDC, // Create the brush PalDestGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette); - XlateObj = (XLATEOBJ*)EngCreateXlate(PalDestGDI->Mode, PAL_RGB, dc->w.hPalette, NULL); + XlateObj = (PXLATEOBJ)EngCreateXlate(PalDestGDI->Mode, PAL_RGB, dc->w.hPalette, NULL); hBrush = W32kCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.textColor)); Brush = BRUSHOBJ_LockBrush(hBrush); EngDeleteXlate(XlateObj); @@ -723,7 +722,7 @@ W32kTextOut(HDC hDC, // Then use memset with 0 to clear it and sourcerect to limit the work of the transbitblt HSourceGlyph = EngCreateBitmap(bitSize, pitch, BMF_1BPP, 0, glyph->bitmap.buffer); - SourceGlyphSurf = (SURFOBJ*)AccessUserObject(HSourceGlyph); + SourceGlyphSurf = (PSURFOBJ)AccessUserObject(HSourceGlyph); // Use the font data as a mask to paint onto the DCs surface using a brush EngBitBlt(SurfObj, NULL, SourceGlyphSurf, NULL, NULL, &DestRect, &SourcePoint, &MaskRect, Brush, &BrushOrigin, 0xAACC); diff --git a/reactos/subsys/win32k/win32k.rc b/reactos/subsys/win32k/win32k.rc index 5965ee8f9f4..20e669aeb7b 100644 --- a/reactos/subsys/win32k/win32k.rc +++ b/reactos/subsys/win32k/win32k.rc @@ -1,5 +1,6 @@ -#include -#include + +#include "../../include/defines.h" +#include "../../include/reactos/resource.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/reactos/tools/depend.mk b/reactos/tools/depend.mk index 6b765bf7a9c..bf49d4432c5 100644 --- a/reactos/tools/depend.mk +++ b/reactos/tools/depend.mk @@ -5,7 +5,6 @@ DEP_FILTERED := $(filter-out $(DEP_EXCLUDE_FILTER), $(DEP_OBJECTS:.o=.d)) DEP_FILES := $(join $(dir $(DEP_FILTERED)), $(addprefix ., $(notdir $(DEP_FILTERED)))) -TARGET_CLEAN += $(DEP_FILES) ifneq ($(MAKECMDGOALS),clean) include $(DEP_FILES) diff --git a/reactos/tools/helper.mk b/reactos/tools/helper.mk index d06a98068b6..4d34e4b13c6 100644 --- a/reactos/tools/helper.mk +++ b/reactos/tools/helper.mk @@ -1,4 +1,4 @@ -# $Id: helper.mk,v 1.20 2002/09/07 15:13:13 chorns Exp $ +# $Id: helper.mk,v 1.21 2002/09/08 10:23:53 chorns Exp $ # # Helper makefile for ReactOS modules # Variables this makefile accepts: @@ -380,7 +380,6 @@ include $(PATH_TO_TOP)/config TARGET_CFLAGS += $(MK_CFLAGS) TARGET_CFLAGS += -pipe -march=$(ARCH) -TARGET_CFLAGS += -I$(PATH_TO_TOP)/include ifeq ($(DBG),1) TARGET_CFLAGS += -g TARGET_LFLAGS += -g @@ -458,14 +457,14 @@ ifeq ($(MK_EXETYPE),dll) endif $(CC) $(TARGET_LFLAGS) \ -Wl,--entry,$(TARGET_ENTRY) $(MK_EXTRACMD2) \ - -o $(MK_NOSTRIPNAME) \ + -o $(MK_NOSTRIPNAME) \ $(MK_FULLRES) $(MK_OBJECTS) $(MK_LIBS) $(MK_GCCLIBS) - $(RM) temp.exp - $(RSYM) $(MK_NOSTRIPNAME) $(MK_BASENAME).sym $(MK_FULLNAME): $(MK_NOSTRIPNAME) - $(CP) $(MK_NOSTRIPNAME) $(MK_FULLNAME) - $(STRIP) --strip-debug $(MK_FULLNAME) + $(CP) $(MK_NOSTRIPNAME) $(MK_FULLNAME) +# $(STRIP) --strip-debug $(MK_FULLNAME) endif # KM_MODE diff --git a/reactos/tools/mkconfig.c b/reactos/tools/mkconfig.c index 9945c89f5c5..56bb885dc08 100644 --- a/reactos/tools/mkconfig.c +++ b/reactos/tools/mkconfig.c @@ -98,7 +98,7 @@ main(int argc, char* argv[]) strcpy(config, ""); for (i = 2; i < argc; i++) { - s = s + sprintf(s, "#define %s 1\n", argv[i]); + s = s + sprintf(s, "#define %s\n", argv[i]); strcat(config, argv[i]); if (i != (argc - 1)) { diff --git a/reactos/tools/wmc/write.c b/reactos/tools/wmc/write.c index 4a289370e3a..1dc7c1d199c 100644 --- a/reactos/tools/wmc/write.c +++ b/reactos/tools/wmc/write.c @@ -88,7 +88,7 @@ static char *dup_u2c(int cp, const WCHAR *uc) // if(!cpdef) // internal_error(__FILE__, __LINE__, "Codepage %d not found (vanished?)", cp); // if((len = cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, cptr, len+1, NULL, NULL)) < 0) - if((len = WideCharToMultiByte(cp, 0, uc, unistrlen(uc)+1, cptr, len+1, NULL, NULL)) < 0) + if((len = WideCharToMultiByte(cp, 0, uc, unistrlen(uc)+1, cptr, len+1, NULL, NULL)) < 0) internal_error(__FILE__, __LINE__, "Buffer overflow? code %d.", len); return cptr; } @@ -378,7 +378,7 @@ static char *make_string(WCHAR *uc, int len, int codepage) // assert(cpdef != NULL); // if((i = cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, tmp, 2*len+1, NULL, NULL)) < 0) - if((i = WideCharToMultiByte(codepage, 0, uc, unistrlen(uc)+1, tmp, 2*len+1, NULL, NULL)) < 0) + if((i = WideCharToMultiByte(codepage, 0, uc, unistrlen(uc)+1, tmp, 2*len+1, NULL, NULL)) < 0) internal_error(__FILE__, __LINE__, "Buffer overflow? code %d.", i); *cptr++ = ' '; *cptr++ = '"'; @@ -435,7 +435,7 @@ static char *make_string(WCHAR *uc, int len, int codepage) } -static char *make_bin_string(WCHAR *uc, int len, int *retlen, int codepage) +static char *make_bin_string(WCHAR *uc, int len, int *retlen, int codepage) { char *str = xmalloc(7 * len + 1); int i; diff --git a/reactos/tools/wmc/y_tab.c b/reactos/tools/wmc/y_tab.c index 3ec7fd0b60d..fea2c2d3239 100644 --- a/reactos/tools/wmc/y_tab.c +++ b/reactos/tools/wmc/y_tab.c @@ -1065,10 +1065,10 @@ case 59: if(find_cpxlat(yyvsp[-4].num)) xyyerror("Codepage translation already defined for language 0x%x", yyvsp[-4].num); // if(yyvsp[-2].num && !find_codepage(yyvsp[-2].num)) - if(yyvsp[-2].num) + if(yyvsp[-2].num) xyyerror(err_nocp, yyvsp[-2].num); // if(yyvsp[0].num && !find_codepage(yyvsp[0].num)) - if(yyvsp[0].num) + if(yyvsp[0].num) xyyerror(err_nocp, yyvsp[0].num); add_cpxlat(yyvsp[-4].num, yyvsp[-2].num, yyvsp[0].num); ;