From b5efc5cfc5107724fe2df5d3b3aeaf3983bdd99a Mon Sep 17 00:00:00 2001 From: Rex Jolliff Date: Tue, 25 Aug 1998 04:27:41 +0000 Subject: [PATCH] This commit was generated by cvs2svn to compensate for changes in r10, which included commits to RCS files with non-trunk default branches. svn path=/trunk/; revision=11 --- reactos/boot.bat | 2 +- reactos/doc/api.txt | 280 +- reactos/doc/faq.txt | 228 +- reactos/doc/internal/pe.txt | 2506 ++--- reactos/include/base.h | 1144 +- reactos/include/coff.h | 678 +- reactos/include/ddk/defines.h | 920 +- reactos/include/ddk/exfuncs.h | 77 +- reactos/include/ddk/extypes.h | 109 + reactos/include/ddk/iofuncs.h | 23 +- reactos/include/ddk/iotypes.h | 230 +- reactos/include/ddk/kefuncs.h | 14 + reactos/include/ddk/ketypes.h | 219 +- reactos/include/ddk/mmfuncs.h | 2 +- reactos/include/ddk/mmtypes.h | 28 +- reactos/include/ddk/ntddk.h | 116 +- reactos/include/ddk/obtypes.h | 12 +- reactos/include/ddk/psfuncs.h | 5 + reactos/include/ddk/pstypes.h | 57 +- reactos/include/ddk/rtl.h | 83 + reactos/include/ddk/structs.h | 332 +- reactos/include/ddk/types.h | 26 +- reactos/include/ddk/zw.h | 5015 ++++++--- reactos/include/funcs.h | 14968 ++++++++++++------------- reactos/include/internal/ctype.h | 37 + reactos/include/internal/debug.h | 142 +- reactos/include/internal/hal/ddk.h | 29 - reactos/include/internal/hal/hal.h | 142 +- reactos/include/internal/hal/page.h | 5 + reactos/include/internal/iomgr.h | 12 +- reactos/include/internal/kernel.h | 202 +- reactos/include/internal/mm.h | 292 +- reactos/include/internal/module.h | 68 +- reactos/include/internal/objmgr.h | 7 +- reactos/include/internal/pool.h | 30 +- reactos/include/internal/psmgr.h | 98 +- reactos/include/internal/version.h | 4 +- reactos/include/ntdll/pagesize.h | 14 +- reactos/include/types.h | 2 +- reactos/include/windows.h | 178 +- reactos/include/wstring.h | 10 +- reactos/lib/kernel32/mem/global.cc | 640 +- reactos/lib/kernel32/mem/local.c | 246 +- reactos/lib/kernel32/thread/thread.c | 9 +- reactos/lib/ntdll/genntdll | Bin 9418 -> 33 bytes reactos/lib/ntdll/genntdll.c | 24 +- reactos/loaders/boot/boot.bin | Bin 512 -> 184 bytes reactos/loaders/boot/boot.inc | 392 +- reactos/loaders/boot/boot.map | 16 +- reactos/loaders/boot/osldr.asm | 680 +- reactos/loaders/boot/osldr.bin | Bin 401 -> 147 bytes reactos/loaders/boot/osldr.txt | 24 +- reactos/loaders/dos/loadros.asm | 1387 +-- reactos/loaders/dos/loadros.com | Bin 3360 -> 3368 bytes reactos/makefile.dos | 124 +- reactos/readme_rex | 41 +- reactos/rules.mak | 3 +- 57 files changed, 17063 insertions(+), 14869 deletions(-) diff --git a/reactos/boot.bat b/reactos/boot.bat index f85739b58e1..513c1077868 100644 --- a/reactos/boot.bat +++ b/reactos/boot.bat @@ -1 +1 @@ -loaders\dos\loadros kernel\kimage.bin %1 %2 %3 %4 +loaders\dos\loadros ntoskrnl\kimage.bin %1 %2 %3 %4 diff --git a/reactos/doc/api.txt b/reactos/doc/api.txt index 379023ffb71..4dd8408e5b9 100644 --- a/reactos/doc/api.txt +++ b/reactos/doc/api.txt @@ -1,140 +1,140 @@ -This file attempts to document the functions made publically available by -the various subsystems. - -* Formatted I/O operations * - -NAME: int vsprintf(char *buf, const char *fmt, va_list args) -NAME: int sprintf(char* buf, const char* fmt, ...) -WHERE: internal/kernel.h -FUNCTION: The same as the standard c library versions - -* PIO operations * - -NAME: in[b/w/l](port) -WHERE: internal/io.h -FUNCTION: Read an IO port of the specified size (byte/word or long) -RETURNS: The value read - -NAME: out[b/w/l](port,val) -WHERE: internal/io.h -FUNCTION: Write an IO port of the specified size (byte/word or long) - -NAME: in_p[b/w/l](port) -WHERE: internal/io.h -FUNCTION: Read an IO port of the specified size (byte/word or long) with - a pause -RETURNS: The value read - -NAME: out_p[b/w/l](port,val) -WHERE: internal/io.h -FUNCTION: Write an IO port of the specified size (byte/word or long) with - a pause - -* Bit operations * - -NAME: int set_bit(int nr, void* addr) -NAME: int clear_bit(int nr, void* addr) -NAME: int change_bit(int nr, void* addr) -WHERE: internal/bitops.h> -FUNCTION: Operate on a bit in the word pointed to by addr -RETURN: 0 if the bit was cleared before the operations - non-zero otherwise - -* Debugging functions * - -NAME: DPRINT(fmt,....) -WHERE: internal/debug.h -FUNCTION: Outputs a string to the console if NDEBUG isn't defined before -including internal/debug.h, a NOP otherwise -ARGUMENTS: The same as printf - -NAME: printk -WHERE: internal/kernel.h -FUNCTION: Outputs a string to the console -ARGUMENTS: The same as printf - -* Memory managment functions * - -NAME: unsigned int physical_to_linear(unsigned int paddr) -WHERE: hal/page.h -FUNCTION: Converts a physical address to a linear one -RECEIVES: - paddr = the physical address to convert -RETURNS: A virtual address where the memory at that physical address can be -accessed - -NAME: void* ExAllocatePool(unsigned int size, unsigned int type = 0); -WHERE: internal/pool.h -FUNCTION: Allocates a block of memory -RECEIVES: - size = the size of the block to allocate - type = will be whether to allocate pagable memory -RETURNS: The address of the block -NOTE: This isn't interrupt safe - -NAME: void ExFreePool(void* block) -WHERE: internal/pool.h -FUNCTION: Frees a block of memory - -NAME: void free_page(unsigned int physical_base, unsigned int nr = 1) -WHERE: internal/mm.h -FUNCTION: Adds a continuous range of physical memory to the free list - -NAME: unsigned int get_free_page(void) -WHERE: internal/mm.h -FUNCTION: Gets a free page -RETURNS: Its physical address - -NAME: unsigned int get_page_physical_address(unsigned int vaddr) -WHERE: internal/mm.h -FUNCTION: Gets the physical address of a page - -NAME: void mark_page_not_writable(unsigned int vaddr) -WHERE: internal/mm.h -FUNCTION: Prevent writing the page - -* DMA functions * - -NAME: unsigned int get_dma_page(unsigned int max_address) -WHERE: internal/mm.h -FUNCTION: Gets a page with a restricted physical address i.e. suitable for - dma -RETURNS: The physical address of the page - -NAME: void disable_dma(unsigned int dmanr) -WHERE: internal/dma.h -FUNCTION: Disables the specified dma channel - -NAME: void enable_dma(unsigned int dmanr) -WHERE: internal/dma.h -FUNCTION: Enables the specified dma channel - -NAME: void clear_dma_ff(unsigned int dmanr) -WHERE: internal/dma.h -FUNCTION: Clear the dma flip-flop - -NAME: void set_dma_mode(unsigned int dmanr, char mode) -WHERE: internal/dma.h -FUNCTION: Sets the type of dma transfer - -NAME: void set_dma_page(unsigned int dmanr, char pagenr) -WHERE: internal/dma.h -FUNCTION: Set only the page register bits of the transfer address - -NAME: void set_dma_addr(unsigned int dmanr, unsigned int a) -WHERE: internal/dma.h -FUNCTION: Set the transfer address for dma -NOTE: Assumes flip-flop is clear - -NAME: void set_dma_count(unsigned int dmanr, unsigned int count) -WHERE: internal/dma.h -FUNCTION: Sets the size of the transfer -ARGUMENTS: - count = the number of bytes to transfer -NOTE: Count must be even for channels 5-7 - -NAME: int get_dma_residue(unsigned int dmanr) -WHERE: internal/dma.h -FUNCTION: Gets the residue remaining after a dma transfer on the channel - - +This file attempts to document the functions made publically available by +the various subsystems. + +* Formatted I/O operations * + +NAME: int vsprintf(char *buf, const char *fmt, va_list args) +NAME: int sprintf(char* buf, const char* fmt, ...) +WHERE: internal/kernel.h +FUNCTION: The same as the standard c library versions + +* PIO operations * + +NAME: in[b/w/l](port) +WHERE: internal/io.h +FUNCTION: Read an IO port of the specified size (byte/word or long) +RETURNS: The value read + +NAME: out[b/w/l](port,val) +WHERE: internal/io.h +FUNCTION: Write an IO port of the specified size (byte/word or long) + +NAME: in_p[b/w/l](port) +WHERE: internal/io.h +FUNCTION: Read an IO port of the specified size (byte/word or long) with + a pause +RETURNS: The value read + +NAME: out_p[b/w/l](port,val) +WHERE: internal/io.h +FUNCTION: Write an IO port of the specified size (byte/word or long) with + a pause + +* Bit operations * + +NAME: int set_bit(int nr, void* addr) +NAME: int clear_bit(int nr, void* addr) +NAME: int change_bit(int nr, void* addr) +WHERE: internal/bitops.h> +FUNCTION: Operate on a bit in the word pointed to by addr +RETURN: 0 if the bit was cleared before the operations + non-zero otherwise + +* Debugging functions * + +NAME: DPRINT(fmt,....) +WHERE: internal/debug.h +FUNCTION: Outputs a string to the console if NDEBUG isn't defined before +including internal/debug.h, a NOP otherwise +ARGUMENTS: The same as printf + +NAME: printk +WHERE: internal/kernel.h +FUNCTION: Outputs a string to the console +ARGUMENTS: The same as printf + +* Memory managment functions * + +NAME: unsigned int physical_to_linear(unsigned int paddr) +WHERE: hal/page.h +FUNCTION: Converts a physical address to a linear one +RECEIVES: + paddr = the physical address to convert +RETURNS: A virtual address where the memory at that physical address can be +accessed + +NAME: void* ExAllocatePool(unsigned int size, unsigned int type = 0); +WHERE: internal/pool.h +FUNCTION: Allocates a block of memory +RECEIVES: + size = the size of the block to allocate + type = will be whether to allocate pagable memory +RETURNS: The address of the block +NOTE: This isn't interrupt safe + +NAME: void ExFreePool(void* block) +WHERE: internal/pool.h +FUNCTION: Frees a block of memory + +NAME: void free_page(unsigned int physical_base, unsigned int nr = 1) +WHERE: internal/mm.h +FUNCTION: Adds a continuous range of physical memory to the free list + +NAME: unsigned int get_free_page(void) +WHERE: internal/mm.h +FUNCTION: Gets a free page +RETURNS: Its physical address + +NAME: unsigned int get_page_physical_address(unsigned int vaddr) +WHERE: internal/mm.h +FUNCTION: Gets the physical address of a page + +NAME: void mark_page_not_writable(unsigned int vaddr) +WHERE: internal/mm.h +FUNCTION: Prevent writing the page + +* DMA functions * + +NAME: unsigned int get_dma_page(unsigned int max_address) +WHERE: internal/mm.h +FUNCTION: Gets a page with a restricted physical address i.e. suitable for + dma +RETURNS: The physical address of the page + +NAME: void disable_dma(unsigned int dmanr) +WHERE: internal/dma.h +FUNCTION: Disables the specified dma channel + +NAME: void enable_dma(unsigned int dmanr) +WHERE: internal/dma.h +FUNCTION: Enables the specified dma channel + +NAME: void clear_dma_ff(unsigned int dmanr) +WHERE: internal/dma.h +FUNCTION: Clear the dma flip-flop + +NAME: void set_dma_mode(unsigned int dmanr, char mode) +WHERE: internal/dma.h +FUNCTION: Sets the type of dma transfer + +NAME: void set_dma_page(unsigned int dmanr, char pagenr) +WHERE: internal/dma.h +FUNCTION: Set only the page register bits of the transfer address + +NAME: void set_dma_addr(unsigned int dmanr, unsigned int a) +WHERE: internal/dma.h +FUNCTION: Set the transfer address for dma +NOTE: Assumes flip-flop is clear + +NAME: void set_dma_count(unsigned int dmanr, unsigned int count) +WHERE: internal/dma.h +FUNCTION: Sets the size of the transfer +ARGUMENTS: + count = the number of bytes to transfer +NOTE: Count must be even for channels 5-7 + +NAME: int get_dma_residue(unsigned int dmanr) +WHERE: internal/dma.h +FUNCTION: Gets the residue remaining after a dma transfer on the channel + + diff --git a/reactos/doc/faq.txt b/reactos/doc/faq.txt index 69b3e10617c..1fe8c22e27f 100644 --- a/reactos/doc/faq.txt +++ b/reactos/doc/faq.txt @@ -1,114 +1,114 @@ -Kernel Development FAQ (for v0.0.7) - -This attempts to answer some of the common questions people developing for -the kernel might want to ask (or at least what I think they should ask). -Obviously I can only detail those parts which I have written so other -developers please fill in the gaps. - -Q: What is this, what are you people, what's going on -A: This is the ReactOS, an operating system intended as a clone of windows -NT. See the project website (http://www.sid-dis.com/reactos/) for more details. - -Q: Why ReactOS -A: To condemn Bill Gates to penury. - -Q: What do I need to compile the kernel -A: DJGPP, get it from http://www.delorie.com/djgpp - -Q: How do I compile the kernel -A: Unpack the zip. It is important not to install the kernel in the same -directory as a previous version, this has caused a bit of confusion in the -past. Edit the makefile in the top level directory, in particular select the -correct host to build from. Then run make in the top directory - -Q: What files are created when I make the kernel -A: The following files are created in the kernel directory - kimage = the kernel as a coff executable - kimage.bin = the kernel as a raw binary image - kernel.sym = a list of the kernel symbols - -Q: How do I load the kernel -A: Run the boot.bat batch file. - -Q: Does it boot from disk -A: Not at the moment. - -Q: When I run the kernel it crashes -A: The kernel (at the moment) can only be loaded from a clean system. That -is one without EMM386 or any version of windows loaded. A quick way to -ensure this (if you have windows 95) is to set the program to run in msdos -mode and specify an empty config.sys and autoexec.bat. See the windows help -for more information. - -If you do that and the problem persists then contact the kernel team -(ros-kernel@sid-dis.com) as it is probably a bug in the kernel - -Q6: How do I load a module with the kernel -A: Add the names of any modules to be loaded to the command line of boot.bat. - -Q7: I want to add code to the kernel, how do I get it to be compiled -A: You will need to edit the Makefile in kernel directory. There should be -a statement like this - - OBJECTS = hal/head.o hal/exp.o kernel/vsprintf.o \ - .... - kernel/irqhand.o hal/page.o mm/virtual.o kernel/error.o \ - kernel/exports.o kernel/module.o - -Add the name of the object file (the file produced when your code is -compiled) to the end of the statement (in this case after kernel/module.o). -If you need to go onto a new line then add a slash to the end of the -previous line. It is also very important to use an editor which preserves -tabs. - -Q8: I want to add code to the kernel, how do I make it official -A: Contact the kernel mailing list ros-kernel@sid-dis.com or our coordinator -dwinkley@whitworth.edu. If it is for a specific section then the kernel -website (http://www.geocities.com/SiliconValley/Peaks/1957) has a list of -those working on individual areas, you might what to contact one of them -instead. - -Q9: What header files should I use -A: Don't include the usual DJGPP headers like stdio.h unless you are using -something compiler based like stdargs.h. To use the DJGPP headers requires -linking with libc which is useless in kernel mode. - -All the header files are in the top-level include directory which is laid -out like this - include = general win32 api declarations - include/internal = private kernel headers - include/internal/hal = HAL headers - include/ddk = header files with declarations for modules - -There should be a file called api.txt which documents all of the functions -(and which header files they need). - -Q11: I want to export my function for modules to use, how do I do that -A: Add the function to the list in kernel/exports.lst, then remake the -kernel. Note the function must be declared as extern "C". - -Q12: I want to make my functions part of the kernel interface to user mode, -A: That section isn't finished yet, though it will probably mean adding a -pointer to the function and the size of its parameters to a internal table -somewhere. - -Q14: I want to write a module, what are the guidelines -A: See modules.txt in this directory - -Q15: I want to write an ISR (interrupt service routine) -A: See irq.txt in this directory - -Q16: I want to use DMA -A: Firstly this answer covers only DMA via the dma chips *not* -busmaster DMA. - -To program the dma chip use the functions in internal/dma.h (look in api.txt -for details). PC DMA can only go to memory with a physical address below -1mb (or 16mb on some systems), use the get_dma_page to allocate this kind -of memory. - -Q17: You haven't answered my question -A: Send your questions to ros-kernel@sid-dis.com - - -- David Welch (welch@mcmail.com) +Kernel Development FAQ (for v0.0.7) + +This attempts to answer some of the common questions people developing for +the kernel might want to ask (or at least what I think they should ask). +Obviously I can only detail those parts which I have written so other +developers please fill in the gaps. + +Q: What is this, what are you people, what's going on +A: This is the ReactOS, an operating system intended as a clone of windows +NT. See the project website (http://www.sid-dis.com/reactos/) for more details. + +Q: Why ReactOS +A: To condemn Bill Gates to penury. + +Q: What do I need to compile the kernel +A: DJGPP, get it from http://www.delorie.com/djgpp + +Q: How do I compile the kernel +A: Unpack the zip. It is important not to install the kernel in the same +directory as a previous version, this has caused a bit of confusion in the +past. Edit the makefile in the top level directory, in particular select the +correct host to build from. Then run make in the top directory + +Q: What files are created when I make the kernel +A: The following files are created in the kernel directory + kimage = the kernel as a coff executable + kimage.bin = the kernel as a raw binary image + kernel.sym = a list of the kernel symbols + +Q: How do I load the kernel +A: Run the boot.bat batch file. + +Q: Does it boot from disk +A: Not at the moment. + +Q: When I run the kernel it crashes +A: The kernel (at the moment) can only be loaded from a clean system. That +is one without EMM386 or any version of windows loaded. A quick way to +ensure this (if you have windows 95) is to set the program to run in msdos +mode and specify an empty config.sys and autoexec.bat. See the windows help +for more information. + +If you do that and the problem persists then contact the kernel team +(ros-kernel@sid-dis.com) as it is probably a bug in the kernel + +Q6: How do I load a module with the kernel +A: Add the names of any modules to be loaded to the command line of boot.bat. + +Q7: I want to add code to the kernel, how do I get it to be compiled +A: You will need to edit the Makefile in kernel directory. There should be +a statement like this + + OBJECTS = hal/head.o hal/exp.o kernel/vsprintf.o \ + .... + kernel/irqhand.o hal/page.o mm/virtual.o kernel/error.o \ + kernel/exports.o kernel/module.o + +Add the name of the object file (the file produced when your code is +compiled) to the end of the statement (in this case after kernel/module.o). +If you need to go onto a new line then add a slash to the end of the +previous line. It is also very important to use an editor which preserves +tabs. + +Q8: I want to add code to the kernel, how do I make it official +A: Contact the kernel mailing list ros-kernel@sid-dis.com or our coordinator +dwinkley@whitworth.edu. If it is for a specific section then the kernel +website (http://www.geocities.com/SiliconValley/Peaks/1957) has a list of +those working on individual areas, you might what to contact one of them +instead. + +Q9: What header files should I use +A: Don't include the usual DJGPP headers like stdio.h unless you are using +something compiler based like stdargs.h. To use the DJGPP headers requires +linking with libc which is useless in kernel mode. + +All the header files are in the top-level include directory which is laid +out like this + include = general win32 api declarations + include/internal = private kernel headers + include/internal/hal = HAL headers + include/ddk = header files with declarations for modules + +There should be a file called api.txt which documents all of the functions +(and which header files they need). + +Q11: I want to export my function for modules to use, how do I do that +A: Add the function to the list in kernel/exports.lst, then remake the +kernel. Note the function must be declared as extern "C". + +Q12: I want to make my functions part of the kernel interface to user mode, +A: That section isn't finished yet, though it will probably mean adding a +pointer to the function and the size of its parameters to a internal table +somewhere. + +Q14: I want to write a module, what are the guidelines +A: See modules.txt in this directory + +Q15: I want to write an ISR (interrupt service routine) +A: See irq.txt in this directory + +Q16: I want to use DMA +A: Firstly this answer covers only DMA via the dma chips *not* +busmaster DMA. + +To program the dma chip use the functions in internal/dma.h (look in api.txt +for details). PC DMA can only go to memory with a physical address below +1mb (or 16mb on some systems), use the get_dma_page to allocate this kind +of memory. + +Q17: You haven't answered my question +A: Send your questions to ros-kernel@sid-dis.com + + +- David Welch (welch@mcmail.com) diff --git a/reactos/doc/internal/pe.txt b/reactos/doc/internal/pe.txt index 69e19e41618..aeafa654276 100644 --- a/reactos/doc/internal/pe.txt +++ b/reactos/doc/internal/pe.txt @@ -1,1253 +1,1253 @@ - - PORTABLE EXECUTABLE FORMAT - - Author: Micheal J. O'Leary - - - Preface - - This document was edited and released by Microsoft Developer - Support. It describes the binary portable executable format for NT. - The information is provided at this point because we feel it will - make the work of application development easier. Unfortunately, the - information in this document may change before the final release of - Windows NT. Microsoft is NOT committing to stay with these formats - by releasing this document. Questions or follow-ups for any of the - information presented here should be posted to CompuServe MSWIN32 - forum, section 6. - --Steve Firebaugh - Microsoft Developer Support - - - -Contents - - 1. Overview - - 2. PE Header - - 3. Object Table - - 4. Image Pages - - 5. Exports - 5.1 Export Directory Table - 5.2 Export Address Table - 5.3 Export Name Table Pointers - 5.4 Export Ordinal Table - 5.5 Export Name Table - - 6. Imports - 6.1 Import Directory Table - 6.2 Import Lookup Table - 6.3 Hint-Name Table - 6.4 Import Address Table - - 7. Thread Local Storage - 7.1 Thread Local Storage Directory Table - 7.2 Thread Local Storage CallBack Table - - 8. Resources - 8.1 Resource Directory Table - 8.2 Resource Example - - 9. Fixup Table - 9.1 Fixup Block - - 10. Debug Information - 10.1 Debug Directory - - - -1. Overview - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ <ÄÄ¿ <ÄÄÄÄÄ Base of Image Header - ³ DOS 2 Compatible ³ ³ - ³ EXE Header ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ - ³ unused ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ - ³ OEM Identifier ³ ³ - ³ OEM Info ³ ³ - ³ ³ ³ DOS 2.0 Section - ³ Offset to ³ ³ (for DOS compatibility only) - ³ PE Header ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ - ³ DOS 2.0 Stub ³ ³ - ³ Program & ³ ³ - ³ Reloc. Table ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ <ÄÄÙ - ³ unused ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ <ÄÄÄÄÄÄÄÄÄ Aligned on 8 byte boundary - ³ PE Header ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ Object Table ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ Image Pages ³ - ³ import info ³ - ³ export info ³ - ³ fixup info ³ - ³ resource info³ - ³ debug info ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - -Figure 1. A typical 32-bit Portable EXE File Layout - - - -2. PE Header - - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ SIGNATURE BYTES ³ CPU TYPE ³ # OBJECTS ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ TIME/DATE STAMP ³ RESERVED ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ RESERVED ³ NT HDR SIZE³ FLAGS ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ RESERVED ³LMAJOR³LMINOR³ RESERVED ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ RESERVED ³ RESERVED ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ ENTRYPOINT RVA ³ RESERVED ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ RESERVED ³ IMAGE BASE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ OBJECT ALIGN ³ FILE ALIGN ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ OS MAJOR ³ OS MINOR ³USER MAJOR ³USER MINOR ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ SUBSYS MAJOR³ SUBSYS MINOR³ RESERVED ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ IMAGE SIZE ³ HEADER SIZE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ FILE CHECKSUM ³ SUBSYSTEM ³ DLL FLAGS ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ STACK RESERVE SIZE ³ STACK COMMIT SIZE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ HEAP RESERVE SIZE ³ HEAP COMMIT SIZE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ RESERVED ³ # INTERESTING RVA/SIZES ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ EXPORT TABLE RVA ³ TOTAL EXPORT DATA SIZE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ IMPORT TABLE RVA ³ TOTAL IMPORT DATA SIZE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ RESOURCE TABLE RVA ³ TOTAL RESOURCE DATA SIZE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ EXCEPTION TABLE RVA ³ TOTAL EXCEPTION DATA SIZE³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ SECURITY TABLE RVA ³ TOTAL SECURITY DATA SIZE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ FIXUP TABLE RVA ³ TOTAL FIXUP DATA SIZE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ DEBUG TABLE RVA ³ TOTAL DEBUG DIRECTORIES ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ IMAGE DESCRIPTION RVA ³ TOTAL DESCRIPTION SIZE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ MACHINE SPECIFIC RVA ³ MACHINE SPECIFIC SIZE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ THREAD LOCAL STORAGE RVA ³ TOTAL TLS SIZE ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - -Figure 2. PE Header - -Notes: - - o A VA is a virtual address that is already biased by the Image - Base found in the PE Header. A RVA is a virtual address that is - relative to the Image Base. - - o An RVA in the PE Header which has a value of zero indicates the - field isn't used. - - o Image pages are aligned and zero padded to a File Align - boundary. The bases of all other tables and structures must be - aligned on DWORD (4 byte) boundary. Thus, all VA's and RVA's - must be on a 32 bit boundary. All table and structure fields - must be aligned on their "natural" boundaries, with the possible - exception of the Debug Info. - -SIGNATURE BYTES = DB * 4. -Current value is "PE/0/0". Thats PE followed by two zeros (nulls). - -CPU TYPE = DW CPU Type. -This field specifies the type of CPU compatibility required by this -image to run. The values are: - - o 0000h __unknown - - o 014Ch __80386 - - o 014Dh __80486 - - o 014Eh __80586 - - o 0162h __MIPS Mark I (R2000, R3000) - - o 0163h __MIPS Mark II (R6000) - - o 0166h __MIPS Mark III (R4000) - -# OBJECTS = DW Number of object entries. -This field specifies the number of entries in the Object Table. - -TIME/DATE STAMP = DD Used to store the time and date the file was -created or modified by the linker. - -NT HDR SIZE = DW This is the number of remaining bytes in the NT -header that follow the FLAGS field. - -FLAGS = DW Flag bits for the image. -The flag bits have the following definitons: - - o 0000h __Program image. - - o 0002h __Image is executable. - If this bit isn't set, then it indicates that either errors - where detected at link time or that the image is being - incrementally linked and therefore can't be loaded. - - o 0200h __Fixed. - Indicates that if the image can't be loaded at the Image Base, - then don't load it. - - o 2000h __Library image. - -LMAJOR/LMINOR = DB Linker major/minor version number. - -ENTRYPOINT RVA = DD Entrypoint relative virtual address. -The address is relative to the Image Base. The address is the -starting address for program images and the library initialization -and library termination address for library images. - -IMAGE BASE = DD The virtual base of the image. -This will be the virtual address of the first byte of the file (Dos -Header). This must be a multiple of 64K. - -OBJECT ALIGN = DD The alignment of the objects. This must be a power -of 2 between 512 and 256M inclusive. The default is 64K. - -FILE ALIGN = DD Alignment factor used to align image pages. The -alignment factor (in bytes) used to align the base of the image pages -and to determine the granularity of per-object trailing zero pad. -Larger alignment factors will cost more file space; smaller alignment -factors will impact demand load performance, perhaps significantly. -Of the two, wasting file space is preferable. This value should be a -power of 2 between 512 and 64K inclusive. - -OS MAJOR/MINOR = DW OS version number required to run this image. - -USER MAJOR/MINOR # = DW User major/minor version number. -This is useful for differentiating between revisions of -images/dynamic linked libraries. The values are specified at link -time by the user. - -SUBSYS MAJOR/MINOR # = DW Subsystem major/minor version number. - -IMAGE SIZE = DD The virtual size (in bytes) of the image. -This includes all headers. The total image size must be a multiple -of Object Align. - -HEADER SIZE = DD Total header size. -The combined size of the Dos Header, PE Header and Object Table. - -FILE CHECKSUM = DD Checksum for entire file. Set to 0 by the linker. - -SUBSYSTEM = DW NT Subsystem required to run this image. -The values are: - - o 0000h __Unknown - - o 0001h __Native - - o 0002h __Windows GUI - - o 0003h __Windows Character - - o 0005h __OS/2 Character - - o 0007h __Posix Character - -DLL FLAGS = DW Indicates special loader requirements. -This flag has the following bit values: - - o 0001h __Per-Process Library Initialization. - - o 0002h __Per-Process Library Termination. - - o 0004h __Per-Thread Library Initialization. - - o 0008h __Per-Thread Library Termination. - -All other bits are reserved for future use and should be set to zero. - -STACK RESERVE SIZE = DD Stack size needed for image. -The memory is reserved, but only the STACK COMMIT SIZE is committed. -The next page of the stack is a 'guarded page'. When the application -hits the guarded page, the guarded page becomes valid, and the next -page becomes the guarded page. This continues until the RESERVE SIZE -is reached. - -STACK COMMIT SIZE = DD Stack commit size. - -HEAP RESERVE SIZE = DD Size of local heap to reserve. - -HEAP COMMIT SIZE = DD Amount to commit in local heap. - -# INTERESTING VA/SIZES = DD Indicates the size of the VA/SIZE array -that follows. - -EXPORT TABLE RVA = DD Relative Virtual Address of the Export Table. -This address is relative to the Image Base. - -IMPORT TABLE RVA = DD Relative Virtual Address of the Import Table. -This address is relative to the Image Base. - -RESOURCE TABLE RVA = DD Relative Virtual Address of the Resource -Table. This address is relative to the Image Base. - -EXCEPTION TABLE RVA = DD Relative Virtual Address of the Exception -Table. This address is relative to the Image Base. - -SECURITY TABLE RVA = DD Relative Virtual Address of the Security -Table. This address is relative to the Image Base. - -FIXUP TABLE RVA = DD Relative Virtual Address of the Fixup Table. -This address is relative to the Image Base. - -DEBUG TABLE RVA = DD Relative Virtual Address of the Debug Table. -This address is relative to the Image Base. - -IMAGE DESCRIPTION RVA = DD Relative Virtual Address of the -description string specified in the module definiton file. - -MACHINE SPECIFIC RVA = DD Relative Virtual Address of a machine -specific value. This address is relative to the Image Base. - -TOTAL EXPORT DATA SIZE = DD Total size of the export data. - -TOTAL IMPORT DATA SIZE = DD Total size of the import data. - -TOTAL RESOURCE DATA SIZE = DD Total size of the resource data. - -TOTAL EXCEPTION DATA SIZE = DD Total size of the exception data. - -TOTAL SECURITY DATA SIZE = DD Total size of the security data. - -TOTAL FIXUP DATA SIZE = DD Total size of the fixup data. - -TOTAL DEBUG DIRECTORIES = DD Total number of debug directories. - -TOTAL DESCRIPTION SIZE = DD Total size of the description data. - -MACHINE SPECIFIC SIZE = DD A machine specific value. - - - -3. Object Table - -The number of entries in the Object Table is given by the # Objects -field in the PE Header. Entries in the Object Table are numbered -starting from one. The object table immediately follows the PE -Header. The code and data memory object entries are in the order -chosen by the linker. The virtual addresses for objects must be -assigned by the linker such that they are in ascending order and -adjacent, and must be a multiple of Object Align in the PE header. - -Each Object Table entry has the following format: - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ OBJECT NAME ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ VIRTUAL SIZE ³ RVA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ PHYSICAL SIZE ³ PHYSICAL OFFSET ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ RESERVED ³ RESERVED ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ RESERVED ³ OBJECT FLAGS ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - -Figure 3. Object Table - -OBJECT NAME = DB * 8 Object name. This is an eight-byte null-padded -ASCII string representing the object name. - -VIRTUAL SIZE = DD Virtual memory size. The size of the object that -will be allocated when the object is loaded. Any difference between -PHYSICAL SIZE and VIRTUAL SIZE is zero filled. - -RVA = DD Relative Virtual Address. The virtual address the object is -currently relocated to, relative to the Image Base. Each Object's -virtual address space consumes a multiple of Object Align (power of 2 -between 512 and 256M inclusive. Default is 64K), and immediately -follows the previous Object in the virtual address space (the virtual -address space for a image must be dense). - -PHYSICAL SIZE = DD Physical file size of initialized data. The size -of the initialized data in the file for the object. The physical -size must be a multiple of the File Align field in the PE Header, and -must be less than or equal to the Virtual Size. - -PHYSICAL OFFSET = DD Physical offset for object's first page. This -offset is relative to beginning of the EXE file, and is aligned on a -multiple of the File Align field in the PE Header. The offset is -used as a seek value. - -OBJECT FLAGS = DD Flag bits for the object. The object flag bits -have the following definitions: - - o 000000020h __Code object. - - o 000000040h __Initialized data object. - - o 000000080h __Uninitialized data object. - - o 040000000h __Object must not be cached. - - o 080000000h __Object is not pageable. - - o 100000000h __Object is shared. - - o 200000000h __Executable object. - - o 400000000h __Readable object. - - o 800000000h __Writeable object. - -All other bits are reserved for future use and should be set to zero. - -4. Image Pages - -The Image Pages section contains all initialized data for all -objects. The seek offset for the first page in each object is -specified in the object table and is aligned on a File Align -boundary. The objects are ordered by the RVA. Every object begins -on a multiple of Object Align. - - - -5. Exports - -A typical file layout for the export information follows: - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ DIRECTORY TABLE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ ADDRESS TABLE ³ - ³ ³ - ³ ³ - ³ ³ - ³ ³ - ³ ³ - ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ NAME PTR TABLE ³ - ³ ³ - ³ ³ - ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ ORDINAL TABLE ³ - ³ ³ - ³ ³ - ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ NAME STRINGS ³ - ³ ³ - ³ ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - -Figure 4. Export File Layout - -5.1 Export Directory Table - -The export information begins with the Export Directory Table which -describes the remainder of the export information. The Export -Directory Table contains address information that is used to resolve -fixup references to the entry points within this image. - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ EXPORT FLAGS ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ TIME/DATE STAMP ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ MAJOR VERSION ³ MINOR VERSION ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ NAME RVA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ ORDINAL BASE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ # EAT ENTRIES ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ # NAME PTRS ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ ADDRESS TABLE RVA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ NAME PTR TABLE RVA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ ORDINAL TABLE RVA ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - -Figure 5. Export Directory Table Entry - -EXPORT FLAGS = DD Currently set to zero. - -TIME/DATE STAMP = DD Time/Date the export data was created. - -MAJOR/MINOR VERSION = DW A user settable major/minor version number. - -NAME RVA = DD Relative Virtual Address of the Dll asciiz Name. -This is the address relative to the Image Base. - -ORDINAL BASE = DD First valid exported ordinal. -This field specifies the starting ordinal number for the export -address table for this image. Normally set to 1. - -# EAT ENTRIES = DD Indicates number of entries in the Export Address -Table. - -# NAME PTRS = DD This indicates the number of entries in the Name Ptr -Table (and parallel Ordinal Table). - -ADDRESS TABLE RVA = DD Relative Virtual Address of the Export Address -Table. -This address is relative to the Image Base. - -NAME TABLE RVA = DD Relative Virtual Address of the Export Name Table -Pointers. -This address is relative to the beginning of the Image Base. This -table is an array of RVA's with # NAMES entries. - -ORDINAL TABLE RVA = DD Relative Virtual Address of Export Ordinals -Table Entry. -This address is relative to the beginning of the Image Base. - -5.2 Export Address Table - -The Export Address Table contains the address of exported entrypoints -and exported data and absolutes. An ordinal number is used to index -the Export Address Table. The ORDINAL BASE must be subracted from the -ordinal number before indexing into this table. - -Export Address Table entry formats are described below: - - ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ - ³ EXPORTED RVA ³ - ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ - -Figure 6. Export Address Table Entry - -EXPORTED RVA = DD Export address. -This field contains the relative virtual address of the exported -entry (relative to the Image Base). - -5.3 Export Name Table Pointers - -The export name table pointers array contains address into the Export -Name Table. The pointers are 32-bits each, and are relative to the -Image Base. The pointers are ordered lexically to allow binary -searches. - -5.4 Export Ordinal Table - -The Export Name Table Pointers and the Export Ordinal Table form two -parallel arrays, separated to allow natural field alignment. The -export ordinal table array contains the Export Address Table ordinal -numbers associated with the named export referenced by corresponding -Export Name Table Pointers. - -The ordinals are 16-bits each, and already include the Ordinal Base -stored in the Export Directory Table. - -5.5 Export Name Table - -The export name table contains optional ASCII names for exported -entries in the image. These tables are used with the array of Export -Name Table Pointers and the array of Export Ordinals to translate a -procedure name string into an ordinal number by searching for a -matching name string. The ordinal number is used to locate the entry -point information in the export address table. - -Import references by name require the Export Name Table Pointers -table to be binary searched to find the matching name, then the -corresponding Export Ordinal Table is known to contain the entry -point ordinal number. Import references by ordinal number provide -the fastest lookup since searching the name table is not required. - -Each name table entry has the following format: - - ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ - ³ ASCII STRING ::: :::::::: '\0' ³ - ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ - -Figure 7. Export Name Table Entry - -ASCII STRING = DB ASCII String. -The string is case sensitive and is terminated by a null byte. - - - -6. Imports - -A typical file layout for the import information follows: - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ DIRECTORY TABLE ³ - ³ ³ - ³ ³ - ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ NULL DIR ENTRY ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ DLL1 LOOKUP TABLE ³ - ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ NULL ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ DLL2 LOOKUP TABLE ³ - ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ NULL ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ Dll3 LOOKUP TABLE ³ - ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ NULL ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ HINT-NAME TABLE ³ - ³ ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ DLL1 ADDRESS TABLE ³ - ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ NULL ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ DLL2 ADDRESS TABLE ³ - ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ NULL ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ DLL3 ADDRESS TABLE ³ - ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ NULL ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - -Figure 8. Import File Layout - -6.1 Import Directory Table - -The import information begins with the Import Directory Table which -describes the remainder of the import information. The Import -Directory Table contains address information that is used to resolve -fixup references to the entry points within a DLL image. The import -directory table consists of an array of Import Directory Entries, one -entry for each DLL this image references. The last directory entry is -empty (NULL) which indicates the end of the directory table. - -An Import Directory Entry has the following format: - - ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ - ³ IMPORT FLAGS ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ TIME/DATE STAMP ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ MAJOR VERSION ³ MINOR VERSION ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ NAME RVA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ IMPORT LOOKUP TABLE RVA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ IMPORT ADDRESS TABLE RVA ³ - ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ - -Figure 9. Import Directory Entry - -IMPORT FLAGS = DD Currently set to zero. - -TIME/DATE STAMP = DD Time/Date the import data was pre-snapped or -zero if not pre-snapped. - -MAJOR/MINOR VERSION = DW The major/minor version number of the dll -being referenced. - -NAME RVA = DD Relative Virtual Address of the Dll asciiz Name. -This is the address relative to the Image Base. - -IMPORT LOOKUP TABLE RVA = DD This field contains the address of the -start of the import lookup table for this image. The address is -relative to the beginning of the Image Base. - -IMPORT ADDRESS TABLE RVA = DD This field contains the address of the -start of the import addresses for this image. The address is -relative to the beginning of the Image Base. - -6.2 Import Lookup Table - -The Import Lookup Table is an array of ordinal or hint/name RVA's for -each DLL. The last entry is empty (NULL) which indicates the end of -the table. - -The last element is empty. - - 3 0 - 1 - ÚÄÒÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ - ³0º ORDINAL#/HINT-NAME TABLE RVA ³ - ÀÄÐÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ - -Figure 10. Import Address Table Format - -ORDINAL/HINT-NAME TABLE RVA = 31-bits (mask = 7fffffffh) Ordinal -Number or Name Table RVA. -If the import is by ordinal, this field contains a 31 bit ordinal -number. If the import is by name, this field contains a 31 bit -address relative to the Image Base to the Hint-Name Table. - -O = 1-bit (mask = 80000000h) Import by ordinal flag. - - o 00000000h __Import by name. - - o 80000000h __Import by ordinal. - -6.3 Hint-Name Table - -The Hint-Name Table format follows: - - ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ - ³ HINT ³ ASCII STRING |||³ - ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄ´ - ³|||||||||||||||||³ '\0' PAD ³ - ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ - - - The PAD field is optional. - -Figure 11. Import Hint-Name Table - -HINT = DW Hint into Export Name Table Pointers. -The hint value is used to index the Export Name Table Pointers array, -allowing faster by-name imports. If the hint is incorrect, then a -binary search is performed on the Export Name Ptr Table. - -ASCII STRING = DB ASCII String. -The string is case sensitive and is terminated by a null byte. - -PAD = DB Zero pad byte. -A trailing zero pad byte appears after the trailing null byte if -necessary to align the next entry on an even boundary. - -The loader overwrites the import address table when loading the image -with the 32-bit address of the import. - - - -6.4 Import Address Table - -The Import Address Table is an array of addresses of the imported -routines for each DLL. The last entry is empty (NULL) which indicates -the end of the table. - -7. Thread Local Storage - -Thread local storage is a special contiguous block of data. Each -thread will gets its own block upon creation of the thread. - -The file layout for thread local storage follows: - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ DIRECTORY TABLE ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ TLS DATA ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ INDEX VARIABLE ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ CALLBACK ADDRESSES ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - -Figure 12. Thread Local Storage Layout - -7.1 Thread Local Storage Directory Table - -The Thread Local Storage Directory Table contains address information -that is used to describe the rest of TLS. - -The Thread Local Storage Directory Table has the following format: - - ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ - ³ START DATA BLOCK VA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ END DATA BLOCK VA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ INDEX VA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ CALLBACK TABLE VA ³ - ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ - -Figure 13. Thread Local Storage Directory Table - -START DATA BLOCK VA = DD Virtual Address of the start of the thread -local storage data block. - -END DATA BLOCK VA = DD Virtual Address of the end of the thread local -storage data block. - -INDEX VA = DD Virtual Address of the index variable used to access -the thread local storage data block. - -CALLBACK TABLE VA = DD Virtual Address of the callback table. - -7.2 Thread Local Storage CallBack Table - -The Thread Local Storage Callbacks is an array of Virtual Address of -functions to be called by the loader after thread creation and thread -termination. The last entry is empty (NULL) which indicates the end -of the table. - -The Thread Local Storage CallBack Table has the following format: - - ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ - ³ FUNCTION1 VA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ FUNCTION2 VA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ NULL ³ - ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ - -Figure 14. Thread Local Storage CallBack Table - -8. Resources - -Resources are indexed by a multiple level binary-sorted tree -structure. The overall design can incorporate 2**31 levels, however, -NT uses only three: the highest is TYPE, then NAME, then LANGUAGE. - -A typical file layout for the resource information follows: - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ RESOURCE DIRECTORY ³ - ³ ³ - ³ ³ - ³ ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ RESOURCE DATA ³ - ³ ³ - ³ ³ - ³ ³ - ³ ³ - ³ ³ - ³ ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - -Figure 15. Resource File Layout - - -The Resource directory is made up of the following tables: - - - -8.1 Resource Directory Table -ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ -³ RESOURCE FLAGS ³ -ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ -³ TIME/DATE STAMP ³ -ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ -³ MAJOR VERSION ³ MINOR VERSION ³ -ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ -³ # NAME ENTRY ³ # ID ENTRY ³ -ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ -³ RESOURCE DIR ENTRIES ³ -ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ - -Figure 16. Resource Table Entry - - -RESOURCE FLAGS = DD Currently set to zero. - -TIME/DATE STAMP = DD Time/Date the resource data was created by the -resource compiler. - -MAJOR/MINOR VERSION = DW A user settable major/minor version number. - -# NAME ENTRY = DW The number of name entries. -This field contains the number of entries at the beginning of the -array of directory entries which have actual string names associated -with them. - -# ID ENTRY = DW The number of ID integer entries. -This field contains the number of 32-bit integer IDs as their names -in the array of directory entries. - -The resource directory is followed by a variable length array of -directory entries. # NAME ENTRY is the number of entries at the -beginning of the array that have actual names associated with each -entry. The entires are in ascending order, case insensitive strings. -# ID ENTRY identifies the number of entries that have 32-bit integer -IDs as their name. These entries are also sorted in ascending order. - -This structure allows fast lookup by either name or number, but for -any given resource entry only one form of lookup is supported, not -both. This is consistent with the syntax of the .RC file and the .RES -file. - - - -The array of directory entries have the following format: - 3 0 - 1 -ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ -³ NAME RVA/INTEGER ID ³ -ÃÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ -³Eº DATA ENTRY RVA/SUBDIR RVA ³ -ÀÄÐÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ - -Figure 17. Resource Directory Entry - - -INTERGER ID = DD ID. -This field contains a integer ID field to identify a resource. - -NAME RVA = DD Name RVA address. -This field contains a 31-bit address relative to the beginning of the -Image Base to a Resource Directory String Entry. - -E = 1-bit (mask 80000000h) Unescape bit. -This bit is zero for unescaped Resource Data Entries. - -DATA RVA = 31-bits (mask 7fffffffh) Data entry address. -This field contains a 31-bit address relative to the beginning of the -Image Base to a Resource Data Entry. - -E = 1-bit (mask 80000000h) Escape bit. -This bit is 1 for escaped Subdirectory Entry. - -DATA RVA = 31-bits (mask 7fffffffh) Directory entries. -This field contains a 31-bit address relative to the beginning of the -Image Base to Subdirectory Entry. - - - -Each resource directory string entry has the following format: -ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ -³ LENGTH ³ UNICODE STRING ³ -ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄ´ -³ ³ -ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ - -Figure 18. Resource Directory String Entry - - -LENGTH = DW Length of string. - -UNICODE STRING = DW UNICODE String. - -All of these string objects are stored together after the last -resource directory entry and before the first resource data object. -This minimizes the impact of these variable length objects on the -alignment of the fixed size directory entry objects. The length needs -to be word aligned. - - - -Each Resource Data Entry has the following format: - - ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ - ³ DATA RVA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ SIZE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ CODEPAGE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ RESERVED ³ - ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ - -Figure 19. Resource Data Entry - - - -DATA RVA = DD Address of Resource Data. -This field contains 32-bit virtaul address of the resource data -(relative to the Image Base). - -SIZE = DD Size of Resource Data. -This field contains the size of the resource data for this resource. - -CODEPAGE = DD Codepage. - -RESERVED = DD Reserved - must be zero. - -Each resource data entry describes a leaf node in the resource -directory tree. It contains an address which is relative to the -beginning of Image Base, a size field that gives the number of bytes -of data at that address, a CodePage that should be used when decoding -code point values within the resource data. Typically for new -applications the code page would be the unicode code page. - - - -8.2 Resource Example - -The following is an example for an app. which wants to use the following data -as resources: - - TypeId# NameId# Language ID Resource Data - 00000001 00000001 0 00010001 - 00000001 00000001 1 10010001 - 00000001 00000002 0 00010002 - 00000001 00000003 0 00010003 - 00000002 00000001 0 00020001 - 00000002 00000002 0 00020002 - 00000002 00000003 0 00020003 - 00000002 00000004 0 00020004 - 00000009 00000001 0 00090001 - 00000009 00000009 0 00090009 - 00000009 00000009 1 10090009 - 00000009 00000009 2 20090009 - -Then the Resource Directory in the Portable format looks like: -Offset Data -0000: 00000000 00000000 00000000 00030000 (3 entries in this directory) -0010: 00000001 80000028 (TypeId #1, Subdirectory at offset 0x28) -0018: 00000002 80000050 (TypeId #2, Subdirectory at offset 0x50) -0020: 00000009 80000080 (TypeId #9, Subdirectory at offset 0x80) -0028: 00000000 00000000 00000000 00030000 (3 entries in this directory) -0038: 00000001 800000A0 (NameId #1, Subdirectory at offset 0xA0) -0040: 00000002 00000108 (NameId #2, data desc at offset 0x108) -0048: 00000003 00000118 (NameId #3, data desc at offset 0x118) -0050: 00000000 00000000 00000000 00040000 (4 entries in this directory) -0060: 00000001 00000128 (NameId #1, data desc at offset 0x128) -0068: 00000002 00000138 (NameId #2, data desc at offset 0x138) -0070: 00000003 00000148 (NameId #3, data desc at offset 0x148) -0078: 00000004 00000158 (NameId #4, data desc at offset 0x158) -0080: 00000000 00000000 00000000 00020000 (2 entries in this directory) -0090: 00000001 00000168 (NameId #1, data desc at offset 0x168) -0098: 00000009 800000C0 (NameId #9, Subdirectory at offset 0xC0) -00A0: 00000000 00000000 00000000 00020000 (2 entries in this directory) -00B0: 00000000 000000E8 (Language ID 0, data desc at offset 0xE8 -00B8: 00000001 000000F8 (Language ID 1, data desc at offset 0xF8 -00C0: 00000000 00000000 00000000 00030000 (3 entries in this directory) -00D0: 00000001 00000178 (Language ID 0, data desc at offset 0x178 -00D8: 00000001 00000188 (Language ID 1, data desc at offset 0x188 -00E0: 00000001 00000198 (Language ID 2, data desc at offset 0x198 - -00E8: 000001A8 (At offset 0x1A8, for TypeId #1, NameId #1, Language id #0 - 00000004 (4 bytes of data) - 00000000 (codepage) - 00000000 (reserved) -00F8: 000001AC (At offset 0x1AC, for TypeId #1, NameId #1, Language id #1 - 00000004 (4 bytes of data) - 00000000 (codepage) - 00000000 (reserved) -0108: 000001B0 (At offset 0x1B0, for TypeId #1, NameId #2, - 00000004 (4 bytes of data) - 00000000 (codepage) - 00000000 (reserved) -0118: 000001B4 (At offset 0x1B4, for TypeId #1, NameId #3, - 00000004 (4 bytes of data) - 00000000 (codepage) - 00000000 (reserved) -0128: 000001B8 (At offset 0x1B8, for TypeId #2, NameId #1, - 00000004 (4 bytes of data) - 00000000 (codepage) - 00000000 (reserved) -0138: 000001BC (At offset 0x1BC, for TypeId #2, NameId #2, - 00000004 (4 bytes of data) - 00000000 (codepage) - 00000000 (reserved) -0148: 000001C0 (At offset 0x1C0, for TypeId #2, NameId #3, - 00000004 (4 bytes of data) - 00000000 (codepage) - 00000000 (reserved) -0158: 000001C4 (At offset 0x1C4, for TypeId #2, NameId #4, - 00000004 (4 bytes of data) - 00000000 (codepage) - 00000000 (reserved) -0168: 000001C8 (At offset 0x1C8, for TypeId #9, NameId #1, - 00000004 (4 bytes of data) - 00000000 (codepage) - 00000000 (reserved) -0178: 000001CC (At offset 0x1CC, for TypeId #9, NameId #9, Language id #0 - 00000004 (4 bytes of data) - 00000000 (codepage) - 00000000 (reserved) -0188: 000001D0 (At offset 0x1D0, for TypeId #9, NameId #9, Language id #1 - 00000004 (4 bytes of data) - 00000000 (codepage) - 00000000 (reserved) -0198: 000001D4 (At offset 0x1D4, for TypeId #9, NameId #9, Language id #2 - 00000004 (4 bytes of data) - 00000000 (codepage) - 00000000 (reserved) - -And the data for the resources will look like: -01A8: 00010001 -01AC: 10010001 -01B0: 00010002 -01B4: 00010003 -01B8: 00020001 -01BC: 00020002 -01C0: 00020003 -01C4: 00020004 -01C8: 00090001 -01CC: 00090009 -01D0: 10090009 -01D4: 20090009 - - -9. Fixup Table - -The Fixup Table contains entries for all fixups in the image. The -Total Fixup Data Size in the PE Header is the number of bytes in the -fixup table. The fixup table is broken into blocks of fixups. Each -block represents the fixups for a 4K page. - -Fixups that are resolved by the linker do not need to be processed by -the loader, unless the load image can't be loaded at the Image Base -specified in the PE Header. - -9.1 Fixup Block - -Fixup blocks have the following format: - - ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³ PAGE RVA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ BLOCK SIZE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ TYPE/OFFSET ³ TYPE/OFFSET ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ TYPE/OFFSET ³ ... ³ - ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - -Figure 20. Fixup Block Format - -To apply a fixup, a delta needs to be calculated. The 32-bit delta -is the difference between the preferred base, and the base where the -image is actually loaded. If the image is loaded at its preferred -base, the delta would be zero, and thus the fixups would not have to -be applied. Each block must start on a DWORD boundary. The ABSOLUTE -fixup type can be used to pad a block. - -PAGE RVA = DD Page RVA. The image base plus the page rva is added to -each offset to create the virtual address of where the fixup needs to -be applied. - -BLOCK SIZE = DD Number of bytes in the fixup block. This includes the -PAGE RVA and SIZE fields. - -TYPE/OFFSET is defined as: - - 1 1 0 - 5 1 - ÚÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³TYPEº OFFSET ³ - ÀÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÙ -Figure 21. Fixup Record Format - -TYPE = 4-bit fixup type. This value has the following definitions: - - o 0h __ABSOLUTE. This is a NOP. The fixup is skipped. - - o 1h __HIGH. Add the high 16-bits of the delta to the 16-bit field - at Offset. The 16-bit field represents the high value of a 32- - bit word. - - o 2h __LOW. Add the low 16-bits of the delta to the 16-bit field - at Offset. The 16-bit field represents the low half value of a - 32-bit word. This fixup will only be emitted for a RISC machine - when the image Object Align isn't the default of 64K. - - o 3h __HIGHLOW. Apply the 32-bit delta to the 32-bit field at - Offset. - - o 4h __HIGHADJUST. This fixup requires a full 32-bit value. The - high 16-bits is located at Offset, and the low 16-bits is - located in the next Offset array element (this array element is - included in the SIZE field). The two need to be combined into a - signed variable. Add the 32-bit delta. Then add 0x8000 and - store the high 16-bits of the signed variable to the 16-bit - field at Offset. - - o 5h __MIPSJMPADDR. - -All other values are reserved. - - - -10. Debug Information - -The debug information is defined by the debugger and is not -controlled by the portable EXE format or linker. The only data -defined by the portable EXE format is the Debug Directory Table. - -10.1 Debug Directory - -The debug directory table consists of one or more entries that have -the following format: - - ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ - ³ DEBUG FLAGS ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ TIME/DATE STAMP ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ MAJOR VERSION ³ MINOR VERSION ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ DEBUG TYPE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ DATA SIZE ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ DATA RVA ³ - ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ - ³ DATA SEEK ³ - ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ - -Figure 22. Debug Directory Entry - -DEBUG FLAGS = DD Set to zero for now. - -TIME/DATE STAMP = DD Time/Date the debug data was created. - -MAJOR/MINOR VERSION = DW Version stamp. -This stamp can be used to determine the version of the debug data. - -DEBUG TYPE = DD Format type. -To support multiple debuggers, this field determines the format of -the debug information. This value has the following definitions: - - o 0001h __Image contains COFF symbolics. - - o 0001h __Image contains CodeView symbolics. - - o 0001h __Image contains FPO symbolics. - -DATA SIZE = DD The number of bytes in the debug data. This is the -size of the actual debug data and does not include the debug -directory. - -DATA RVA = DD The relative virtual address of the debug data. This -address is relative to the beginning of the Image Base. - -DATA SEEK = DD The seek value from the beginning of the file to the -debug data. - -If the image contains more than one type of debug information, then -the next debug directory will immediately follow the first debug -directory. + + PORTABLE EXECUTABLE FORMAT + + Author: Micheal J. O'Leary + + + Preface + + This document was edited and released by Microsoft Developer + Support. It describes the binary portable executable format for NT. + The information is provided at this point because we feel it will + make the work of application development easier. Unfortunately, the + information in this document may change before the final release of + Windows NT. Microsoft is NOT committing to stay with these formats + by releasing this document. Questions or follow-ups for any of the + information presented here should be posted to CompuServe MSWIN32 + forum, section 6. + --Steve Firebaugh + Microsoft Developer Support + + + +Contents + + 1. Overview + + 2. PE Header + + 3. Object Table + + 4. Image Pages + + 5. Exports + 5.1 Export Directory Table + 5.2 Export Address Table + 5.3 Export Name Table Pointers + 5.4 Export Ordinal Table + 5.5 Export Name Table + + 6. Imports + 6.1 Import Directory Table + 6.2 Import Lookup Table + 6.3 Hint-Name Table + 6.4 Import Address Table + + 7. Thread Local Storage + 7.1 Thread Local Storage Directory Table + 7.2 Thread Local Storage CallBack Table + + 8. Resources + 8.1 Resource Directory Table + 8.2 Resource Example + + 9. Fixup Table + 9.1 Fixup Block + + 10. Debug Information + 10.1 Debug Directory + + + +1. Overview + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ <ÄÄ¿ <ÄÄÄÄÄ Base of Image Header + ³ DOS 2 Compatible ³ ³ + ³ EXE Header ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ + ³ unused ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ + ³ OEM Identifier ³ ³ + ³ OEM Info ³ ³ + ³ ³ ³ DOS 2.0 Section + ³ Offset to ³ ³ (for DOS compatibility only) + ³ PE Header ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ + ³ DOS 2.0 Stub ³ ³ + ³ Program & ³ ³ + ³ Reloc. Table ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ <ÄÄÙ + ³ unused ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ <ÄÄÄÄÄÄÄÄÄ Aligned on 8 byte boundary + ³ PE Header ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ Object Table ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ Image Pages ³ + ³ import info ³ + ³ export info ³ + ³ fixup info ³ + ³ resource info³ + ³ debug info ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +Figure 1. A typical 32-bit Portable EXE File Layout + + + +2. PE Header + + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ SIGNATURE BYTES ³ CPU TYPE ³ # OBJECTS ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ TIME/DATE STAMP ³ RESERVED ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ RESERVED ³ NT HDR SIZE³ FLAGS ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ RESERVED ³LMAJOR³LMINOR³ RESERVED ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ RESERVED ³ RESERVED ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ ENTRYPOINT RVA ³ RESERVED ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ RESERVED ³ IMAGE BASE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ OBJECT ALIGN ³ FILE ALIGN ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ OS MAJOR ³ OS MINOR ³USER MAJOR ³USER MINOR ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ SUBSYS MAJOR³ SUBSYS MINOR³ RESERVED ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ IMAGE SIZE ³ HEADER SIZE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ FILE CHECKSUM ³ SUBSYSTEM ³ DLL FLAGS ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ STACK RESERVE SIZE ³ STACK COMMIT SIZE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ HEAP RESERVE SIZE ³ HEAP COMMIT SIZE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ RESERVED ³ # INTERESTING RVA/SIZES ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ EXPORT TABLE RVA ³ TOTAL EXPORT DATA SIZE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ IMPORT TABLE RVA ³ TOTAL IMPORT DATA SIZE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ RESOURCE TABLE RVA ³ TOTAL RESOURCE DATA SIZE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ EXCEPTION TABLE RVA ³ TOTAL EXCEPTION DATA SIZE³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ SECURITY TABLE RVA ³ TOTAL SECURITY DATA SIZE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ FIXUP TABLE RVA ³ TOTAL FIXUP DATA SIZE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ DEBUG TABLE RVA ³ TOTAL DEBUG DIRECTORIES ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ IMAGE DESCRIPTION RVA ³ TOTAL DESCRIPTION SIZE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ MACHINE SPECIFIC RVA ³ MACHINE SPECIFIC SIZE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ THREAD LOCAL STORAGE RVA ³ TOTAL TLS SIZE ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +Figure 2. PE Header + +Notes: + + o A VA is a virtual address that is already biased by the Image + Base found in the PE Header. A RVA is a virtual address that is + relative to the Image Base. + + o An RVA in the PE Header which has a value of zero indicates the + field isn't used. + + o Image pages are aligned and zero padded to a File Align + boundary. The bases of all other tables and structures must be + aligned on DWORD (4 byte) boundary. Thus, all VA's and RVA's + must be on a 32 bit boundary. All table and structure fields + must be aligned on their "natural" boundaries, with the possible + exception of the Debug Info. + +SIGNATURE BYTES = DB * 4. +Current value is "PE/0/0". Thats PE followed by two zeros (nulls). + +CPU TYPE = DW CPU Type. +This field specifies the type of CPU compatibility required by this +image to run. The values are: + + o 0000h __unknown + + o 014Ch __80386 + + o 014Dh __80486 + + o 014Eh __80586 + + o 0162h __MIPS Mark I (R2000, R3000) + + o 0163h __MIPS Mark II (R6000) + + o 0166h __MIPS Mark III (R4000) + +# OBJECTS = DW Number of object entries. +This field specifies the number of entries in the Object Table. + +TIME/DATE STAMP = DD Used to store the time and date the file was +created or modified by the linker. + +NT HDR SIZE = DW This is the number of remaining bytes in the NT +header that follow the FLAGS field. + +FLAGS = DW Flag bits for the image. +The flag bits have the following definitons: + + o 0000h __Program image. + + o 0002h __Image is executable. + If this bit isn't set, then it indicates that either errors + where detected at link time or that the image is being + incrementally linked and therefore can't be loaded. + + o 0200h __Fixed. + Indicates that if the image can't be loaded at the Image Base, + then don't load it. + + o 2000h __Library image. + +LMAJOR/LMINOR = DB Linker major/minor version number. + +ENTRYPOINT RVA = DD Entrypoint relative virtual address. +The address is relative to the Image Base. The address is the +starting address for program images and the library initialization +and library termination address for library images. + +IMAGE BASE = DD The virtual base of the image. +This will be the virtual address of the first byte of the file (Dos +Header). This must be a multiple of 64K. + +OBJECT ALIGN = DD The alignment of the objects. This must be a power +of 2 between 512 and 256M inclusive. The default is 64K. + +FILE ALIGN = DD Alignment factor used to align image pages. The +alignment factor (in bytes) used to align the base of the image pages +and to determine the granularity of per-object trailing zero pad. +Larger alignment factors will cost more file space; smaller alignment +factors will impact demand load performance, perhaps significantly. +Of the two, wasting file space is preferable. This value should be a +power of 2 between 512 and 64K inclusive. + +OS MAJOR/MINOR = DW OS version number required to run this image. + +USER MAJOR/MINOR # = DW User major/minor version number. +This is useful for differentiating between revisions of +images/dynamic linked libraries. The values are specified at link +time by the user. + +SUBSYS MAJOR/MINOR # = DW Subsystem major/minor version number. + +IMAGE SIZE = DD The virtual size (in bytes) of the image. +This includes all headers. The total image size must be a multiple +of Object Align. + +HEADER SIZE = DD Total header size. +The combined size of the Dos Header, PE Header and Object Table. + +FILE CHECKSUM = DD Checksum for entire file. Set to 0 by the linker. + +SUBSYSTEM = DW NT Subsystem required to run this image. +The values are: + + o 0000h __Unknown + + o 0001h __Native + + o 0002h __Windows GUI + + o 0003h __Windows Character + + o 0005h __OS/2 Character + + o 0007h __Posix Character + +DLL FLAGS = DW Indicates special loader requirements. +This flag has the following bit values: + + o 0001h __Per-Process Library Initialization. + + o 0002h __Per-Process Library Termination. + + o 0004h __Per-Thread Library Initialization. + + o 0008h __Per-Thread Library Termination. + +All other bits are reserved for future use and should be set to zero. + +STACK RESERVE SIZE = DD Stack size needed for image. +The memory is reserved, but only the STACK COMMIT SIZE is committed. +The next page of the stack is a 'guarded page'. When the application +hits the guarded page, the guarded page becomes valid, and the next +page becomes the guarded page. This continues until the RESERVE SIZE +is reached. + +STACK COMMIT SIZE = DD Stack commit size. + +HEAP RESERVE SIZE = DD Size of local heap to reserve. + +HEAP COMMIT SIZE = DD Amount to commit in local heap. + +# INTERESTING VA/SIZES = DD Indicates the size of the VA/SIZE array +that follows. + +EXPORT TABLE RVA = DD Relative Virtual Address of the Export Table. +This address is relative to the Image Base. + +IMPORT TABLE RVA = DD Relative Virtual Address of the Import Table. +This address is relative to the Image Base. + +RESOURCE TABLE RVA = DD Relative Virtual Address of the Resource +Table. This address is relative to the Image Base. + +EXCEPTION TABLE RVA = DD Relative Virtual Address of the Exception +Table. This address is relative to the Image Base. + +SECURITY TABLE RVA = DD Relative Virtual Address of the Security +Table. This address is relative to the Image Base. + +FIXUP TABLE RVA = DD Relative Virtual Address of the Fixup Table. +This address is relative to the Image Base. + +DEBUG TABLE RVA = DD Relative Virtual Address of the Debug Table. +This address is relative to the Image Base. + +IMAGE DESCRIPTION RVA = DD Relative Virtual Address of the +description string specified in the module definiton file. + +MACHINE SPECIFIC RVA = DD Relative Virtual Address of a machine +specific value. This address is relative to the Image Base. + +TOTAL EXPORT DATA SIZE = DD Total size of the export data. + +TOTAL IMPORT DATA SIZE = DD Total size of the import data. + +TOTAL RESOURCE DATA SIZE = DD Total size of the resource data. + +TOTAL EXCEPTION DATA SIZE = DD Total size of the exception data. + +TOTAL SECURITY DATA SIZE = DD Total size of the security data. + +TOTAL FIXUP DATA SIZE = DD Total size of the fixup data. + +TOTAL DEBUG DIRECTORIES = DD Total number of debug directories. + +TOTAL DESCRIPTION SIZE = DD Total size of the description data. + +MACHINE SPECIFIC SIZE = DD A machine specific value. + + + +3. Object Table + +The number of entries in the Object Table is given by the # Objects +field in the PE Header. Entries in the Object Table are numbered +starting from one. The object table immediately follows the PE +Header. The code and data memory object entries are in the order +chosen by the linker. The virtual addresses for objects must be +assigned by the linker such that they are in ascending order and +adjacent, and must be a multiple of Object Align in the PE header. + +Each Object Table entry has the following format: + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ OBJECT NAME ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ VIRTUAL SIZE ³ RVA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ PHYSICAL SIZE ³ PHYSICAL OFFSET ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ RESERVED ³ RESERVED ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ RESERVED ³ OBJECT FLAGS ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +Figure 3. Object Table + +OBJECT NAME = DB * 8 Object name. This is an eight-byte null-padded +ASCII string representing the object name. + +VIRTUAL SIZE = DD Virtual memory size. The size of the object that +will be allocated when the object is loaded. Any difference between +PHYSICAL SIZE and VIRTUAL SIZE is zero filled. + +RVA = DD Relative Virtual Address. The virtual address the object is +currently relocated to, relative to the Image Base. Each Object's +virtual address space consumes a multiple of Object Align (power of 2 +between 512 and 256M inclusive. Default is 64K), and immediately +follows the previous Object in the virtual address space (the virtual +address space for a image must be dense). + +PHYSICAL SIZE = DD Physical file size of initialized data. The size +of the initialized data in the file for the object. The physical +size must be a multiple of the File Align field in the PE Header, and +must be less than or equal to the Virtual Size. + +PHYSICAL OFFSET = DD Physical offset for object's first page. This +offset is relative to beginning of the EXE file, and is aligned on a +multiple of the File Align field in the PE Header. The offset is +used as a seek value. + +OBJECT FLAGS = DD Flag bits for the object. The object flag bits +have the following definitions: + + o 000000020h __Code object. + + o 000000040h __Initialized data object. + + o 000000080h __Uninitialized data object. + + o 040000000h __Object must not be cached. + + o 080000000h __Object is not pageable. + + o 100000000h __Object is shared. + + o 200000000h __Executable object. + + o 400000000h __Readable object. + + o 800000000h __Writeable object. + +All other bits are reserved for future use and should be set to zero. + +4. Image Pages + +The Image Pages section contains all initialized data for all +objects. The seek offset for the first page in each object is +specified in the object table and is aligned on a File Align +boundary. The objects are ordered by the RVA. Every object begins +on a multiple of Object Align. + + + +5. Exports + +A typical file layout for the export information follows: + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ DIRECTORY TABLE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ ADDRESS TABLE ³ + ³ ³ + ³ ³ + ³ ³ + ³ ³ + ³ ³ + ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ NAME PTR TABLE ³ + ³ ³ + ³ ³ + ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ ORDINAL TABLE ³ + ³ ³ + ³ ³ + ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ NAME STRINGS ³ + ³ ³ + ³ ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +Figure 4. Export File Layout + +5.1 Export Directory Table + +The export information begins with the Export Directory Table which +describes the remainder of the export information. The Export +Directory Table contains address information that is used to resolve +fixup references to the entry points within this image. + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ EXPORT FLAGS ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ TIME/DATE STAMP ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ MAJOR VERSION ³ MINOR VERSION ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ NAME RVA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ ORDINAL BASE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ # EAT ENTRIES ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ # NAME PTRS ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ ADDRESS TABLE RVA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ NAME PTR TABLE RVA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ ORDINAL TABLE RVA ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +Figure 5. Export Directory Table Entry + +EXPORT FLAGS = DD Currently set to zero. + +TIME/DATE STAMP = DD Time/Date the export data was created. + +MAJOR/MINOR VERSION = DW A user settable major/minor version number. + +NAME RVA = DD Relative Virtual Address of the Dll asciiz Name. +This is the address relative to the Image Base. + +ORDINAL BASE = DD First valid exported ordinal. +This field specifies the starting ordinal number for the export +address table for this image. Normally set to 1. + +# EAT ENTRIES = DD Indicates number of entries in the Export Address +Table. + +# NAME PTRS = DD This indicates the number of entries in the Name Ptr +Table (and parallel Ordinal Table). + +ADDRESS TABLE RVA = DD Relative Virtual Address of the Export Address +Table. +This address is relative to the Image Base. + +NAME TABLE RVA = DD Relative Virtual Address of the Export Name Table +Pointers. +This address is relative to the beginning of the Image Base. This +table is an array of RVA's with # NAMES entries. + +ORDINAL TABLE RVA = DD Relative Virtual Address of Export Ordinals +Table Entry. +This address is relative to the beginning of the Image Base. + +5.2 Export Address Table + +The Export Address Table contains the address of exported entrypoints +and exported data and absolutes. An ordinal number is used to index +the Export Address Table. The ORDINAL BASE must be subracted from the +ordinal number before indexing into this table. + +Export Address Table entry formats are described below: + + ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ + ³ EXPORTED RVA ³ + ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ + +Figure 6. Export Address Table Entry + +EXPORTED RVA = DD Export address. +This field contains the relative virtual address of the exported +entry (relative to the Image Base). + +5.3 Export Name Table Pointers + +The export name table pointers array contains address into the Export +Name Table. The pointers are 32-bits each, and are relative to the +Image Base. The pointers are ordered lexically to allow binary +searches. + +5.4 Export Ordinal Table + +The Export Name Table Pointers and the Export Ordinal Table form two +parallel arrays, separated to allow natural field alignment. The +export ordinal table array contains the Export Address Table ordinal +numbers associated with the named export referenced by corresponding +Export Name Table Pointers. + +The ordinals are 16-bits each, and already include the Ordinal Base +stored in the Export Directory Table. + +5.5 Export Name Table + +The export name table contains optional ASCII names for exported +entries in the image. These tables are used with the array of Export +Name Table Pointers and the array of Export Ordinals to translate a +procedure name string into an ordinal number by searching for a +matching name string. The ordinal number is used to locate the entry +point information in the export address table. + +Import references by name require the Export Name Table Pointers +table to be binary searched to find the matching name, then the +corresponding Export Ordinal Table is known to contain the entry +point ordinal number. Import references by ordinal number provide +the fastest lookup since searching the name table is not required. + +Each name table entry has the following format: + + ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ + ³ ASCII STRING ::: :::::::: '\0' ³ + ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ + +Figure 7. Export Name Table Entry + +ASCII STRING = DB ASCII String. +The string is case sensitive and is terminated by a null byte. + + + +6. Imports + +A typical file layout for the import information follows: + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ DIRECTORY TABLE ³ + ³ ³ + ³ ³ + ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ NULL DIR ENTRY ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ DLL1 LOOKUP TABLE ³ + ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ NULL ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ DLL2 LOOKUP TABLE ³ + ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ NULL ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ Dll3 LOOKUP TABLE ³ + ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ NULL ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ HINT-NAME TABLE ³ + ³ ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ DLL1 ADDRESS TABLE ³ + ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ NULL ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ DLL2 ADDRESS TABLE ³ + ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ NULL ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ DLL3 ADDRESS TABLE ³ + ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ NULL ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +Figure 8. Import File Layout + +6.1 Import Directory Table + +The import information begins with the Import Directory Table which +describes the remainder of the import information. The Import +Directory Table contains address information that is used to resolve +fixup references to the entry points within a DLL image. The import +directory table consists of an array of Import Directory Entries, one +entry for each DLL this image references. The last directory entry is +empty (NULL) which indicates the end of the directory table. + +An Import Directory Entry has the following format: + + ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ + ³ IMPORT FLAGS ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ TIME/DATE STAMP ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ MAJOR VERSION ³ MINOR VERSION ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ NAME RVA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ IMPORT LOOKUP TABLE RVA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ IMPORT ADDRESS TABLE RVA ³ + ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ + +Figure 9. Import Directory Entry + +IMPORT FLAGS = DD Currently set to zero. + +TIME/DATE STAMP = DD Time/Date the import data was pre-snapped or +zero if not pre-snapped. + +MAJOR/MINOR VERSION = DW The major/minor version number of the dll +being referenced. + +NAME RVA = DD Relative Virtual Address of the Dll asciiz Name. +This is the address relative to the Image Base. + +IMPORT LOOKUP TABLE RVA = DD This field contains the address of the +start of the import lookup table for this image. The address is +relative to the beginning of the Image Base. + +IMPORT ADDRESS TABLE RVA = DD This field contains the address of the +start of the import addresses for this image. The address is +relative to the beginning of the Image Base. + +6.2 Import Lookup Table + +The Import Lookup Table is an array of ordinal or hint/name RVA's for +each DLL. The last entry is empty (NULL) which indicates the end of +the table. + +The last element is empty. + + 3 0 + 1 + ÚÄÒÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ + ³0º ORDINAL#/HINT-NAME TABLE RVA ³ + ÀÄÐÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ + +Figure 10. Import Address Table Format + +ORDINAL/HINT-NAME TABLE RVA = 31-bits (mask = 7fffffffh) Ordinal +Number or Name Table RVA. +If the import is by ordinal, this field contains a 31 bit ordinal +number. If the import is by name, this field contains a 31 bit +address relative to the Image Base to the Hint-Name Table. + +O = 1-bit (mask = 80000000h) Import by ordinal flag. + + o 00000000h __Import by name. + + o 80000000h __Import by ordinal. + +6.3 Hint-Name Table + +The Hint-Name Table format follows: + + ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ + ³ HINT ³ ASCII STRING |||³ + ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄ´ + ³|||||||||||||||||³ '\0' PAD ³ + ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ + + + The PAD field is optional. + +Figure 11. Import Hint-Name Table + +HINT = DW Hint into Export Name Table Pointers. +The hint value is used to index the Export Name Table Pointers array, +allowing faster by-name imports. If the hint is incorrect, then a +binary search is performed on the Export Name Ptr Table. + +ASCII STRING = DB ASCII String. +The string is case sensitive and is terminated by a null byte. + +PAD = DB Zero pad byte. +A trailing zero pad byte appears after the trailing null byte if +necessary to align the next entry on an even boundary. + +The loader overwrites the import address table when loading the image +with the 32-bit address of the import. + + + +6.4 Import Address Table + +The Import Address Table is an array of addresses of the imported +routines for each DLL. The last entry is empty (NULL) which indicates +the end of the table. + +7. Thread Local Storage + +Thread local storage is a special contiguous block of data. Each +thread will gets its own block upon creation of the thread. + +The file layout for thread local storage follows: + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ DIRECTORY TABLE ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ TLS DATA ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ INDEX VARIABLE ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ CALLBACK ADDRESSES ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +Figure 12. Thread Local Storage Layout + +7.1 Thread Local Storage Directory Table + +The Thread Local Storage Directory Table contains address information +that is used to describe the rest of TLS. + +The Thread Local Storage Directory Table has the following format: + + ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ + ³ START DATA BLOCK VA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ END DATA BLOCK VA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ INDEX VA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ CALLBACK TABLE VA ³ + ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ + +Figure 13. Thread Local Storage Directory Table + +START DATA BLOCK VA = DD Virtual Address of the start of the thread +local storage data block. + +END DATA BLOCK VA = DD Virtual Address of the end of the thread local +storage data block. + +INDEX VA = DD Virtual Address of the index variable used to access +the thread local storage data block. + +CALLBACK TABLE VA = DD Virtual Address of the callback table. + +7.2 Thread Local Storage CallBack Table + +The Thread Local Storage Callbacks is an array of Virtual Address of +functions to be called by the loader after thread creation and thread +termination. The last entry is empty (NULL) which indicates the end +of the table. + +The Thread Local Storage CallBack Table has the following format: + + ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ + ³ FUNCTION1 VA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ FUNCTION2 VA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ NULL ³ + ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ + +Figure 14. Thread Local Storage CallBack Table + +8. Resources + +Resources are indexed by a multiple level binary-sorted tree +structure. The overall design can incorporate 2**31 levels, however, +NT uses only three: the highest is TYPE, then NAME, then LANGUAGE. + +A typical file layout for the resource information follows: + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ RESOURCE DIRECTORY ³ + ³ ³ + ³ ³ + ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ RESOURCE DATA ³ + ³ ³ + ³ ³ + ³ ³ + ³ ³ + ³ ³ + ³ ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +Figure 15. Resource File Layout + + +The Resource directory is made up of the following tables: + + + +8.1 Resource Directory Table +ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ +³ RESOURCE FLAGS ³ +ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ +³ TIME/DATE STAMP ³ +ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ +³ MAJOR VERSION ³ MINOR VERSION ³ +ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ +³ # NAME ENTRY ³ # ID ENTRY ³ +ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ +³ RESOURCE DIR ENTRIES ³ +ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ + +Figure 16. Resource Table Entry + + +RESOURCE FLAGS = DD Currently set to zero. + +TIME/DATE STAMP = DD Time/Date the resource data was created by the +resource compiler. + +MAJOR/MINOR VERSION = DW A user settable major/minor version number. + +# NAME ENTRY = DW The number of name entries. +This field contains the number of entries at the beginning of the +array of directory entries which have actual string names associated +with them. + +# ID ENTRY = DW The number of ID integer entries. +This field contains the number of 32-bit integer IDs as their names +in the array of directory entries. + +The resource directory is followed by a variable length array of +directory entries. # NAME ENTRY is the number of entries at the +beginning of the array that have actual names associated with each +entry. The entires are in ascending order, case insensitive strings. +# ID ENTRY identifies the number of entries that have 32-bit integer +IDs as their name. These entries are also sorted in ascending order. + +This structure allows fast lookup by either name or number, but for +any given resource entry only one form of lookup is supported, not +both. This is consistent with the syntax of the .RC file and the .RES +file. + + + +The array of directory entries have the following format: + 3 0 + 1 +ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ +³ NAME RVA/INTEGER ID ³ +ÃÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ +³Eº DATA ENTRY RVA/SUBDIR RVA ³ +ÀÄÐÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ + +Figure 17. Resource Directory Entry + + +INTERGER ID = DD ID. +This field contains a integer ID field to identify a resource. + +NAME RVA = DD Name RVA address. +This field contains a 31-bit address relative to the beginning of the +Image Base to a Resource Directory String Entry. + +E = 1-bit (mask 80000000h) Unescape bit. +This bit is zero for unescaped Resource Data Entries. + +DATA RVA = 31-bits (mask 7fffffffh) Data entry address. +This field contains a 31-bit address relative to the beginning of the +Image Base to a Resource Data Entry. + +E = 1-bit (mask 80000000h) Escape bit. +This bit is 1 for escaped Subdirectory Entry. + +DATA RVA = 31-bits (mask 7fffffffh) Directory entries. +This field contains a 31-bit address relative to the beginning of the +Image Base to Subdirectory Entry. + + + +Each resource directory string entry has the following format: +ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ +³ LENGTH ³ UNICODE STRING ³ +ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄ´ +³ ³ +ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ + +Figure 18. Resource Directory String Entry + + +LENGTH = DW Length of string. + +UNICODE STRING = DW UNICODE String. + +All of these string objects are stored together after the last +resource directory entry and before the first resource data object. +This minimizes the impact of these variable length objects on the +alignment of the fixed size directory entry objects. The length needs +to be word aligned. + + + +Each Resource Data Entry has the following format: + + ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ + ³ DATA RVA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ SIZE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ CODEPAGE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ RESERVED ³ + ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ + +Figure 19. Resource Data Entry + + + +DATA RVA = DD Address of Resource Data. +This field contains 32-bit virtaul address of the resource data +(relative to the Image Base). + +SIZE = DD Size of Resource Data. +This field contains the size of the resource data for this resource. + +CODEPAGE = DD Codepage. + +RESERVED = DD Reserved - must be zero. + +Each resource data entry describes a leaf node in the resource +directory tree. It contains an address which is relative to the +beginning of Image Base, a size field that gives the number of bytes +of data at that address, a CodePage that should be used when decoding +code point values within the resource data. Typically for new +applications the code page would be the unicode code page. + + + +8.2 Resource Example + +The following is an example for an app. which wants to use the following data +as resources: + + TypeId# NameId# Language ID Resource Data + 00000001 00000001 0 00010001 + 00000001 00000001 1 10010001 + 00000001 00000002 0 00010002 + 00000001 00000003 0 00010003 + 00000002 00000001 0 00020001 + 00000002 00000002 0 00020002 + 00000002 00000003 0 00020003 + 00000002 00000004 0 00020004 + 00000009 00000001 0 00090001 + 00000009 00000009 0 00090009 + 00000009 00000009 1 10090009 + 00000009 00000009 2 20090009 + +Then the Resource Directory in the Portable format looks like: +Offset Data +0000: 00000000 00000000 00000000 00030000 (3 entries in this directory) +0010: 00000001 80000028 (TypeId #1, Subdirectory at offset 0x28) +0018: 00000002 80000050 (TypeId #2, Subdirectory at offset 0x50) +0020: 00000009 80000080 (TypeId #9, Subdirectory at offset 0x80) +0028: 00000000 00000000 00000000 00030000 (3 entries in this directory) +0038: 00000001 800000A0 (NameId #1, Subdirectory at offset 0xA0) +0040: 00000002 00000108 (NameId #2, data desc at offset 0x108) +0048: 00000003 00000118 (NameId #3, data desc at offset 0x118) +0050: 00000000 00000000 00000000 00040000 (4 entries in this directory) +0060: 00000001 00000128 (NameId #1, data desc at offset 0x128) +0068: 00000002 00000138 (NameId #2, data desc at offset 0x138) +0070: 00000003 00000148 (NameId #3, data desc at offset 0x148) +0078: 00000004 00000158 (NameId #4, data desc at offset 0x158) +0080: 00000000 00000000 00000000 00020000 (2 entries in this directory) +0090: 00000001 00000168 (NameId #1, data desc at offset 0x168) +0098: 00000009 800000C0 (NameId #9, Subdirectory at offset 0xC0) +00A0: 00000000 00000000 00000000 00020000 (2 entries in this directory) +00B0: 00000000 000000E8 (Language ID 0, data desc at offset 0xE8 +00B8: 00000001 000000F8 (Language ID 1, data desc at offset 0xF8 +00C0: 00000000 00000000 00000000 00030000 (3 entries in this directory) +00D0: 00000001 00000178 (Language ID 0, data desc at offset 0x178 +00D8: 00000001 00000188 (Language ID 1, data desc at offset 0x188 +00E0: 00000001 00000198 (Language ID 2, data desc at offset 0x198 + +00E8: 000001A8 (At offset 0x1A8, for TypeId #1, NameId #1, Language id #0 + 00000004 (4 bytes of data) + 00000000 (codepage) + 00000000 (reserved) +00F8: 000001AC (At offset 0x1AC, for TypeId #1, NameId #1, Language id #1 + 00000004 (4 bytes of data) + 00000000 (codepage) + 00000000 (reserved) +0108: 000001B0 (At offset 0x1B0, for TypeId #1, NameId #2, + 00000004 (4 bytes of data) + 00000000 (codepage) + 00000000 (reserved) +0118: 000001B4 (At offset 0x1B4, for TypeId #1, NameId #3, + 00000004 (4 bytes of data) + 00000000 (codepage) + 00000000 (reserved) +0128: 000001B8 (At offset 0x1B8, for TypeId #2, NameId #1, + 00000004 (4 bytes of data) + 00000000 (codepage) + 00000000 (reserved) +0138: 000001BC (At offset 0x1BC, for TypeId #2, NameId #2, + 00000004 (4 bytes of data) + 00000000 (codepage) + 00000000 (reserved) +0148: 000001C0 (At offset 0x1C0, for TypeId #2, NameId #3, + 00000004 (4 bytes of data) + 00000000 (codepage) + 00000000 (reserved) +0158: 000001C4 (At offset 0x1C4, for TypeId #2, NameId #4, + 00000004 (4 bytes of data) + 00000000 (codepage) + 00000000 (reserved) +0168: 000001C8 (At offset 0x1C8, for TypeId #9, NameId #1, + 00000004 (4 bytes of data) + 00000000 (codepage) + 00000000 (reserved) +0178: 000001CC (At offset 0x1CC, for TypeId #9, NameId #9, Language id #0 + 00000004 (4 bytes of data) + 00000000 (codepage) + 00000000 (reserved) +0188: 000001D0 (At offset 0x1D0, for TypeId #9, NameId #9, Language id #1 + 00000004 (4 bytes of data) + 00000000 (codepage) + 00000000 (reserved) +0198: 000001D4 (At offset 0x1D4, for TypeId #9, NameId #9, Language id #2 + 00000004 (4 bytes of data) + 00000000 (codepage) + 00000000 (reserved) + +And the data for the resources will look like: +01A8: 00010001 +01AC: 10010001 +01B0: 00010002 +01B4: 00010003 +01B8: 00020001 +01BC: 00020002 +01C0: 00020003 +01C4: 00020004 +01C8: 00090001 +01CC: 00090009 +01D0: 10090009 +01D4: 20090009 + + +9. Fixup Table + +The Fixup Table contains entries for all fixups in the image. The +Total Fixup Data Size in the PE Header is the number of bytes in the +fixup table. The fixup table is broken into blocks of fixups. Each +block represents the fixups for a 4K page. + +Fixups that are resolved by the linker do not need to be processed by +the loader, unless the load image can't be loaded at the Image Base +specified in the PE Header. + +9.1 Fixup Block + +Fixup blocks have the following format: + + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ PAGE RVA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ BLOCK SIZE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ TYPE/OFFSET ³ TYPE/OFFSET ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ TYPE/OFFSET ³ ... ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + +Figure 20. Fixup Block Format + +To apply a fixup, a delta needs to be calculated. The 32-bit delta +is the difference between the preferred base, and the base where the +image is actually loaded. If the image is loaded at its preferred +base, the delta would be zero, and thus the fixups would not have to +be applied. Each block must start on a DWORD boundary. The ABSOLUTE +fixup type can be used to pad a block. + +PAGE RVA = DD Page RVA. The image base plus the page rva is added to +each offset to create the virtual address of where the fixup needs to +be applied. + +BLOCK SIZE = DD Number of bytes in the fixup block. This includes the +PAGE RVA and SIZE fields. + +TYPE/OFFSET is defined as: + + 1 1 0 + 5 1 + ÚÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³TYPEº OFFSET ³ + ÀÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÙ +Figure 21. Fixup Record Format + +TYPE = 4-bit fixup type. This value has the following definitions: + + o 0h __ABSOLUTE. This is a NOP. The fixup is skipped. + + o 1h __HIGH. Add the high 16-bits of the delta to the 16-bit field + at Offset. The 16-bit field represents the high value of a 32- + bit word. + + o 2h __LOW. Add the low 16-bits of the delta to the 16-bit field + at Offset. The 16-bit field represents the low half value of a + 32-bit word. This fixup will only be emitted for a RISC machine + when the image Object Align isn't the default of 64K. + + o 3h __HIGHLOW. Apply the 32-bit delta to the 32-bit field at + Offset. + + o 4h __HIGHADJUST. This fixup requires a full 32-bit value. The + high 16-bits is located at Offset, and the low 16-bits is + located in the next Offset array element (this array element is + included in the SIZE field). The two need to be combined into a + signed variable. Add the 32-bit delta. Then add 0x8000 and + store the high 16-bits of the signed variable to the 16-bit + field at Offset. + + o 5h __MIPSJMPADDR. + +All other values are reserved. + + + +10. Debug Information + +The debug information is defined by the debugger and is not +controlled by the portable EXE format or linker. The only data +defined by the portable EXE format is the Debug Directory Table. + +10.1 Debug Directory + +The debug directory table consists of one or more entries that have +the following format: + + ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ + ³ DEBUG FLAGS ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ TIME/DATE STAMP ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ MAJOR VERSION ³ MINOR VERSION ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ DEBUG TYPE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ DATA SIZE ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ DATA RVA ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ + ³ DATA SEEK ³ + ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ + +Figure 22. Debug Directory Entry + +DEBUG FLAGS = DD Set to zero for now. + +TIME/DATE STAMP = DD Time/Date the debug data was created. + +MAJOR/MINOR VERSION = DW Version stamp. +This stamp can be used to determine the version of the debug data. + +DEBUG TYPE = DD Format type. +To support multiple debuggers, this field determines the format of +the debug information. This value has the following definitions: + + o 0001h __Image contains COFF symbolics. + + o 0001h __Image contains CodeView symbolics. + + o 0001h __Image contains FPO symbolics. + +DATA SIZE = DD The number of bytes in the debug data. This is the +size of the actual debug data and does not include the debug +directory. + +DATA RVA = DD The relative virtual address of the debug data. This +address is relative to the beginning of the Image Base. + +DATA SEEK = DD The seek value from the beginning of the file to the +debug data. + +If the image contains more than one type of debug information, then +the next debug directory will immediately follow the first debug +directory. diff --git a/reactos/include/base.h b/reactos/include/base.h index 14bfec708d7..7be8db3aa87 100644 --- a/reactos/include/base.h +++ b/reactos/include/base.h @@ -1,572 +1,572 @@ -/* - 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 */ - -#define FALSE 0 -#define TRUE 1 - -#ifndef RC_INVOKED - -/* typedef ACMDRIVERENUMCB; -typedef ACMDRIVERPROC; -typedef ACMFILERCHOOSEHOOKPROC; -typedef ACMFILTERENUMCB; -typedef ACMFILTERTAGENUMCB; -typedef ACMFORMATCHOOSEHOOKPROC; -typedef ACMFORMATENUMCB; -typedef ACMFORMATTAGENUMCB; -typedef APPLET_PROC; -*/ -typedef unsigned short ATOM; -/* Changed from BOOL to WINBOOL to avoid Objective-C conflict */ -typedef int WINBOOL; -typedef unsigned char BOOLEAN; -typedef unsigned char BYTE; -typedef unsigned long CALTYPE; -typedef unsigned long CALID; -typedef char CCHAR; -typedef unsigned long COLORREF; -#define CONST const - -/* Check VOID before defining CHAR, SHORT, and LONG */ -#ifndef VOID -#define VOID void -typedef char CHAR; -typedef short SHORT; -typedef long LONG; -#endif - -/* -typedef CTRYID; -typedef DLGPROC; -*/ -typedef unsigned int DWORD; /* was unsigned long */ -typedef double DWORDLONG, *PDWORDLONG; -/* -typedef EDITWORDBREAKPROC; -typedef ENHMFENUMPROC; -typedef ENUMRESLANGPROC; -typedef ENUMRESNAMEPROC; -typedef ENUMRESTYPEPROC; -*/ -typedef float FLOAT; -/* typedef GLOBALHANDLE; */ -typedef void *HANDLE; -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 int INT; -typedef unsigned short LANGID; -typedef DWORD LCID; -typedef DWORD LCTYPE; -/* typedef LOCALHANDLE */ -typedef double LONGLONG, *PLONGLONG; -typedef unsigned short *LP; -typedef long LPARAM; -typedef WINBOOL *LPBOOL; -typedef BYTE *LPBYTE; -typedef CONST CHAR *LPCCH; -typedef CHAR *LPCH; -typedef COLORREF *LPCOLORREF; -typedef const char *LPCSTR; -typedef char* PCSZ; - -#ifdef UNICODE -typedef const unsigned short *LPCTSTR; -#else -typedef const char *LPCTSTR; -#endif /* UNICODE */ - -typedef const unsigned short *LPCWCH; -typedef const unsigned short *LPCWSTR; -typedef DWORD *LPDWORD; -/* typedef LPFRHOOKPROC; */ -typedef HANDLE *LPHANDLE; -/* typedef LPHANDLER_FUNCTION; */ -typedef int *LPINT; -typedef long *LPLONG; -typedef char *LPSTR; - -#ifdef UNICODE -typedef unsigned short *LPTCH; -typedef unsigned short *LPTSTR; -#else -typedef char *LPTCH; -typedef char *LPTSTR; -#endif /* UNICODE */ - -typedef long LRESULT; -typedef void *LPVOID; -typedef const void *LPCVOID; -typedef unsigned short *LPWCH; -typedef unsigned short *LPWORD; -typedef unsigned short *LPWSTR; -typedef unsigned short *PWSTR; -/* typedef NPSTR; */ -typedef unsigned short *NWPSTR; -typedef WINBOOL *PWINBOOL; -typedef BYTE *PBOOLEAN; -typedef BYTE *PBYTE; -typedef const CHAR *PCCH; -typedef CHAR *PCH; -typedef CHAR *PCHAR; -typedef const char *PCSTR; -typedef const unsigned short *PCWCH; -typedef const unsigned short *PCWSTR; -typedef DWORD *PDWORD; -typedef float *PFLOAT; -typedef HANDLE *PHANDLE; -/* typedef PHKEY; */ -typedef int *PINT; -/* typedef LCID *PLCID; */ -typedef long *PLONG; -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 unsigned char *PUCHAR; -typedef unsigned int *PUINT; -typedef unsigned long *PULONG; -typedef unsigned short *PUSHORT; -typedef void *PVOID; -typedef unsigned short *PWCH; -typedef unsigned short *PWCHAR; -typedef unsigned short *PWORD; -/* -typedef PWSTR; -typedef 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; -typedef unsigned short TCHAR; -typedef unsigned short BCHAR; -#else -typedef unsigned char TBYTE; -typedef char TCHAR; -typedef BYTE BCHAR; -#endif /* UNICODE */ - -typedef unsigned char UCHAR; -typedef unsigned int UINT; -typedef unsigned long ULONG; -typedef unsigned short USHORT; -typedef unsigned short WCHAR; -typedef unsigned short WORD; -typedef unsigned int WPARAM; -/* typedef YIELDPROC; */ - -/* Only use __stdcall under WIN32 compiler */ -#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 - -#define _export - -/* - Enumerations -*/ -typedef enum _ACL_INFORMATION_CLASS { - AclRevisionInformation = 1, - AclSizeInformation -} ACL_INFORMATION_CLASS; - -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; - -#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 _SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous, - SecurityIdentification, - SecurityImpersonation, - SecurityDelegation -} SECURITY_IMPERSONATION_LEVEL; - -typedef enum _SID_NAME_USE { - SidTypeUser = 1, - SidTypeGroup, - SidTypeDomain, - SidTypeAlias, - SidTypeWellKnownGroup, - SidTypeDeletedAccount, - SidTypeInvalid, - SidTypeUnknown -} SID_NAME_USE, *PSID_NAME_USE; - -typedef enum _TOKEN_INFORMATION_CLASS { - TokenUser = 1, - TokenGroups, - TokenPrivileges, - TokenOwner, - TokenPrimaryGroup, - TokenDefaultDacl, - TokenSource, - TokenType, - TokenImpersonationLevel, - TokenStatistics -} TOKEN_INFORMATION_CLASS; - -typedef enum tagTOKEN_TYPE { - TokenPrimary = 1, - TokenImpersonation -} TOKEN_TYPE; - -#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 LOBYTE(w) ((BYTE) (w)) -#define LOWORD(l) ((WORD) (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)) - -#ifndef max -#define max(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -#ifndef min -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#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 TEXT(quote) L##quote -#else -#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 (*PTHREAD_START_ROUTINE) (LPVOID); -typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; -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 WINBOOL 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; - -typedef WINBOOL SECURITY_CONTEXT_TRACKING_MODE; - -/* End of stuff from ddeml.h in old Cygnus headers */ -/* ----------------------------------------------- */ - -typedef FARPROC WNDENUMPROC; -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 */ +/* + 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 */ + +#define FALSE 0 +#define TRUE 1 + +#ifndef RC_INVOKED + +/* typedef ACMDRIVERENUMCB; +typedef ACMDRIVERPROC; +typedef ACMFILERCHOOSEHOOKPROC; +typedef ACMFILTERENUMCB; +typedef ACMFILTERTAGENUMCB; +typedef ACMFORMATCHOOSEHOOKPROC; +typedef ACMFORMATENUMCB; +typedef ACMFORMATTAGENUMCB; +typedef APPLET_PROC; +*/ +typedef unsigned short ATOM; +/* Changed from BOOL to WINBOOL to avoid Objective-C conflict */ +typedef int WINBOOL; +typedef unsigned char BOOLEAN; +typedef unsigned char BYTE; +typedef unsigned long CALTYPE; +typedef unsigned long CALID; +typedef char CCHAR; +typedef unsigned long COLORREF; +#define CONST const + +/* Check VOID before defining CHAR, SHORT, and LONG */ +#ifndef VOID +#define VOID void +typedef char CHAR; +typedef short SHORT; +typedef long LONG; +#endif + +/* +typedef CTRYID; +typedef DLGPROC; +*/ +typedef unsigned int DWORD; /* was unsigned long */ +typedef double DWORDLONG, *PDWORDLONG; +/* +typedef EDITWORDBREAKPROC; +typedef ENHMFENUMPROC; +typedef ENUMRESLANGPROC; +typedef ENUMRESNAMEPROC; +typedef ENUMRESTYPEPROC; +*/ +typedef float FLOAT; +/* typedef GLOBALHANDLE; */ +typedef void *HANDLE; +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 int INT; +typedef unsigned short LANGID; +typedef DWORD LCID; +typedef DWORD LCTYPE; +/* typedef LOCALHANDLE */ +typedef double LONGLONG, *PLONGLONG; +typedef unsigned short *LP; +typedef long LPARAM; +typedef WINBOOL *LPBOOL; +typedef BYTE *LPBYTE; +typedef CONST CHAR *LPCCH; +typedef CHAR *LPCH; +typedef COLORREF *LPCOLORREF; +typedef const char *LPCSTR; +typedef char* PCSZ; + +#ifdef UNICODE +typedef const unsigned short *LPCTSTR; +#else +typedef const char *LPCTSTR; +#endif /* UNICODE */ + +typedef const unsigned short *LPCWCH; +typedef const unsigned short *LPCWSTR; +typedef DWORD *LPDWORD; +/* typedef LPFRHOOKPROC; */ +typedef HANDLE *LPHANDLE; +/* typedef LPHANDLER_FUNCTION; */ +typedef int *LPINT; +typedef long *LPLONG; +typedef char *LPSTR; + +#ifdef UNICODE +typedef unsigned short *LPTCH; +typedef unsigned short *LPTSTR; +#else +typedef char *LPTCH; +typedef char *LPTSTR; +#endif /* UNICODE */ + +typedef long LRESULT; +typedef void *LPVOID; +typedef const void *LPCVOID; +typedef unsigned short *LPWCH; +typedef unsigned short *LPWORD; +typedef unsigned short *LPWSTR; +typedef unsigned short *PWSTR; +/* typedef NPSTR; */ +typedef unsigned short *NWPSTR; +typedef WINBOOL *PWINBOOL; +typedef BYTE *PBOOLEAN; +typedef BYTE *PBYTE; +typedef const CHAR *PCCH; +typedef CHAR *PCH; +typedef CHAR *PCHAR; +typedef const char *PCSTR; +typedef const unsigned short *PCWCH; +typedef const unsigned short *PCWSTR; +typedef DWORD *PDWORD; +typedef float *PFLOAT; +typedef HANDLE *PHANDLE; +/* typedef PHKEY; */ +typedef int *PINT; +/* typedef LCID *PLCID; */ +typedef long *PLONG; +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 unsigned char *PUCHAR; +typedef unsigned int *PUINT; +typedef unsigned long *PULONG; +typedef unsigned short *PUSHORT; +typedef void *PVOID; +typedef unsigned short *PWCH; +typedef unsigned short *PWCHAR; +typedef unsigned short *PWORD; +/* +typedef PWSTR; +typedef 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; +typedef unsigned short TCHAR; +typedef unsigned short BCHAR; +#else +typedef unsigned char TBYTE; +typedef char TCHAR; +typedef BYTE BCHAR; +#endif /* UNICODE */ + +typedef unsigned char UCHAR; +typedef unsigned int UINT; +typedef unsigned long ULONG; +typedef unsigned short USHORT; +typedef unsigned short WCHAR; +typedef unsigned short WORD; +typedef unsigned int WPARAM; +/* typedef YIELDPROC; */ + +/* Only use __stdcall under WIN32 compiler */ +#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 + +#define _export + +/* + Enumerations +*/ +typedef enum _ACL_INFORMATION_CLASS { + AclRevisionInformation = 1, + AclSizeInformation +} ACL_INFORMATION_CLASS; + +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; + +#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 _SECURITY_IMPERSONATION_LEVEL { + SecurityAnonymous, + SecurityIdentification, + SecurityImpersonation, + SecurityDelegation +} SECURITY_IMPERSONATION_LEVEL; + +typedef enum _SID_NAME_USE { + SidTypeUser = 1, + SidTypeGroup, + SidTypeDomain, + SidTypeAlias, + SidTypeWellKnownGroup, + SidTypeDeletedAccount, + SidTypeInvalid, + SidTypeUnknown +} SID_NAME_USE, *PSID_NAME_USE; + +typedef enum _TOKEN_INFORMATION_CLASS { + TokenUser = 1, + TokenGroups, + TokenPrivileges, + TokenOwner, + TokenPrimaryGroup, + TokenDefaultDacl, + TokenSource, + TokenType, + TokenImpersonationLevel, + TokenStatistics +} TOKEN_INFORMATION_CLASS; + +typedef enum tagTOKEN_TYPE { + TokenPrimary = 1, + TokenImpersonation +} TOKEN_TYPE; + +#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 LOBYTE(w) ((BYTE) (w)) +#define LOWORD(l) ((WORD) (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)) + +#ifndef max +#define max(a, b) (((a) > (b)) ? (a) : (b)) +#endif + +#ifndef min +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#endif + +#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 TEXT(quote) L##quote +#else +#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 (*PTHREAD_START_ROUTINE) (LPVOID); +typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; +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 WINBOOL 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; + +typedef WINBOOL SECURITY_CONTEXT_TRACKING_MODE; + +/* End of stuff from ddeml.h in old Cygnus headers */ +/* ----------------------------------------------- */ + +typedef FARPROC WNDENUMPROC; +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/coff.h b/reactos/include/coff.h index 9eb5d0131cf..4e467d38197 100644 --- a/reactos/include/coff.h +++ b/reactos/include/coff.h @@ -1,339 +1,339 @@ -/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#ifndef __dj_include_coff_h_ -#define __dj_include_coff_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -//#ifndef __dj_ENFORCE_ANSI_FREESTANDING - -//#ifndef __STRICT_ANSI__ - -//#ifndef _POSIX_SOURCE - -/*** coff information for Intel 386/486. */ - -/********************** FILE HEADER **********************/ - -struct external_filehdr { - unsigned short f_magic; /* magic number */ - unsigned short f_nscns; /* number of sections */ - unsigned long f_timdat; /* time & date stamp */ - unsigned long f_symptr; /* file pointer to symtab */ - unsigned long f_nsyms; /* number of symtab entries */ - unsigned short f_opthdr; /* sizeof(optional hdr) */ - unsigned short f_flags; /* flags */ -}; - - -/* Bits for f_flags: - * F_RELFLG relocation info stripped from file - * F_EXEC file is executable (no unresolved external references) - * F_LNNO line numbers stripped from file - * F_LSYMS local symbols stripped from file - * F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax) - */ - -#define F_RELFLG (0x0001) -#define F_EXEC (0x0002) -#define F_LNNO (0x0004) -#define F_LSYMS (0x0008) - - - -#define I386MAGIC 0x14c -#define I386AIXMAGIC 0x175 -#define I386BADMAG(x) (((x).f_magic!=I386MAGIC) && (x).f_magic!=I386AIXMAGIC) - - -#define FILHDR struct external_filehdr -#define FILHSZ sizeof(FILHDR) - - -/********************** AOUT "OPTIONAL HEADER" **********************/ - - -typedef struct -{ - unsigned short magic; /* type of file */ - unsigned short vstamp; /* version stamp */ - unsigned long tsize; /* text size in bytes, padded to FW bdry*/ - unsigned long dsize; /* initialized data " " */ - unsigned long bsize; /* uninitialized data " " */ - unsigned long entry; /* entry pt. */ - unsigned long text_start; /* base of text used for this file */ - unsigned long data_start; /* base of data used for this file */ -} -AOUTHDR; - - -typedef struct gnu_aout { - unsigned long info; - unsigned long tsize; - unsigned long dsize; - unsigned long bsize; - unsigned long symsize; - unsigned long entry; - unsigned long txrel; - unsigned long dtrel; - } GNU_AOUT; - -#define AOUTSZ (sizeof(AOUTHDR)) - -#define OMAGIC 0404 /* object files, eg as output */ -#define ZMAGIC 0413 /* demand load format, eg normal ld output */ -#define STMAGIC 0401 /* target shlib */ -#define SHMAGIC 0443 /* host shlib */ - - -/********************** SECTION HEADER **********************/ - - -struct external_scnhdr { - char s_name[8]; /* section name */ - unsigned long s_paddr; /* physical address, aliased s_nlib */ - unsigned long s_vaddr; /* virtual address */ - unsigned long s_size; /* section size */ - unsigned long s_scnptr; /* file ptr to raw data for section */ - unsigned long s_relptr; /* file ptr to relocation */ - unsigned long s_lnnoptr; /* file ptr to line numbers */ - unsigned short s_nreloc; /* number of relocation entries */ - unsigned short s_nlnno; /* number of line number entries*/ - unsigned long s_flags; /* flags */ -}; - -#define SCNHDR struct external_scnhdr -#define SCNHSZ sizeof(SCNHDR) - -/* - * names of "special" sections - */ -#define _TEXT ".text" -#define _DATA ".data" -#define _BSS ".bss" -#define _COMMENT ".comment" -#define _LIB ".lib" - -/* - * s_flags "type" - */ -#define STYP_TEXT (0x0020) /* section contains text only */ -#define STYP_DATA (0x0040) /* section contains data only */ -#define STYP_BSS (0x0080) /* section contains bss only */ - -/********************** LINE NUMBERS **********************/ - -/* 1 line number entry for every "breakpointable" source line in a section. - * Line numbers are grouped on a per function basis; first entry in a function - * grouping will have l_lnno = 0 and in place of physical address will be the - * symbol table index of the function name. - */ -struct external_lineno { - union { - unsigned long l_symndx __attribute__((packed)); /* function name symbol index, iff l_lnno == 0 */ - unsigned long l_paddr __attribute__((packed)); /* (physical) address of line number */ - } l_addr; - unsigned short l_lnno; /* line number */ -}; - - -#define LINENO struct external_lineno -#define LINESZ sizeof(LINENO) - - -/********************** SYMBOLS **********************/ - -#define E_SYMNMLEN 8 /* # characters in a symbol name */ -#define E_FILNMLEN 14 /* # characters in a file name */ -#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */ - -struct external_syment -{ - union { - char e_name[E_SYMNMLEN]; - struct { - unsigned long e_zeroes __attribute__((packed)); - unsigned long e_offset __attribute__((packed)); - } e; - } e; - unsigned long e_value __attribute__((packed)); - short e_scnum; - unsigned short e_type; - unsigned char e_sclass; - unsigned char e_numaux; -}; - -#define N_BTMASK (0xf) -#define N_TMASK (0x30) -#define N_BTSHFT (4) -#define N_TSHIFT (2) - -union external_auxent { - struct { - unsigned long x_tagndx __attribute__((packed)); /* str, un, or enum tag indx */ - union { - struct { - unsigned short x_lnno; /* declaration line number */ - unsigned short x_size; /* str/union/array size */ - } x_lnsz; - unsigned long x_fsize __attribute__((packed)); /* size of function */ - } x_misc; - union { - struct { /* if ISFCN, tag, or .bb */ - unsigned long x_lnnoptr __attribute__((packed)); /* ptr to fcn line # */ - unsigned long x_endndx __attribute__((packed)); /* entry ndx past block end */ - } x_fcn; - struct { /* if ISARY, up to 4 dimen. */ - unsigned short x_dimen[E_DIMNUM]; - } x_ary; - } x_fcnary; - unsigned short x_tvndx; /* tv index */ - } x_sym; - - union { - char x_fname[E_FILNMLEN]; - struct { - unsigned long x_zeroes __attribute__((packed)); - unsigned long x_offset __attribute__((packed)); - } x_n; - } x_file; - - struct { - unsigned long x_scnlen __attribute__((packed)); /* section length */ - unsigned short x_nreloc; /* # relocation entries */ - unsigned short x_nlinno; /* # line numbers */ - } x_scn; - - struct { - unsigned long x_tvfill __attribute__((packed)); /* tv fill value */ - unsigned short x_tvlen; /* length of .tv */ - unsigned short x_tvran[2]; /* tv range */ - } x_tv; /* info about .tv section (in auxent of symbol .tv)) */ - - -}; - -#define SYMENT struct external_syment -#define SYMESZ sizeof(SYMENT) -#define AUXENT union external_auxent -#define AUXESZ sizeof(AUXENT) - - -# define _ETEXT "etext" - - -/* Relocatable symbols have number of the section in which they are defined, - or one of the following: */ - -#define N_UNDEF ((short)0) /* undefined symbol */ -#define N_ABS ((short)-1) /* value of symbol is absolute */ -#define N_DEBUG ((short)-2) /* debugging symbol -- value is meaningless */ -#define N_TV ((short)-3) /* indicates symbol needs preload transfer vector */ -#define P_TV ((short)-4) /* indicates symbol needs postload transfer vector*/ - -/* - * Type of a symbol, in low N bits of the word - */ -#define T_NULL 0 -#define T_VOID 1 /* function argument (only used by compiler) */ -#define T_CHAR 2 /* character */ -#define T_SHORT 3 /* short integer */ -#define T_INT 4 /* integer */ -#define T_LONG 5 /* long integer */ -#define T_FLOAT 6 /* floating point */ -#define T_DOUBLE 7 /* double word */ -#define T_STRUCT 8 /* structure */ -#define T_UNION 9 /* union */ -#define T_ENUM 10 /* enumeration */ -#define T_MOE 11 /* member of enumeration*/ -#define T_UCHAR 12 /* unsigned character */ -#define T_USHORT 13 /* unsigned short */ -#define T_UINT 14 /* unsigned integer */ -#define T_ULONG 15 /* unsigned long */ -#define T_LNGDBL 16 /* long double */ - -/* - * derived types, in n_type -*/ -#define DT_NON (0) /* no derived type */ -#define DT_PTR (1) /* pointer */ -#define DT_FCN (2) /* function */ -#define DT_ARY (3) /* array */ - -#define BTYPE(x) ((x) & N_BTMASK) - -#define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT)) -#define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT)) -#define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT)) -#define ISTAG(x) ((x)==C_STRTAG||(x)==C_UNTAG||(x)==C_ENTAG) -#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK)) - -/********************** STORAGE CLASSES **********************/ - -/* This used to be defined as -1, but now n_sclass is unsigned. */ -#define C_EFCN 0xff /* physical end of function */ -#define C_NULL 0 -#define C_AUTO 1 /* automatic variable */ -#define C_EXT 2 /* external symbol */ -#define C_STAT 3 /* static */ -#define C_REG 4 /* register variable */ -#define C_EXTDEF 5 /* external definition */ -#define C_LABEL 6 /* label */ -#define C_ULABEL 7 /* undefined label */ -#define C_MOS 8 /* member of structure */ -#define C_ARG 9 /* function argument */ -#define C_STRTAG 10 /* structure tag */ -#define C_MOU 11 /* member of union */ -#define C_UNTAG 12 /* union tag */ -#define C_TPDEF 13 /* type definition */ -#define C_USTATIC 14 /* undefined static */ -#define C_ENTAG 15 /* enumeration tag */ -#define C_MOE 16 /* member of enumeration */ -#define C_REGPARM 17 /* register parameter */ -#define C_FIELD 18 /* bit field */ -#define C_AUTOARG 19 /* auto argument */ -#define C_LASTENT 20 /* dummy entry (end of block) */ -#define C_BLOCK 100 /* ".bb" or ".eb" */ -#define C_FCN 101 /* ".bf" or ".ef" */ -#define C_EOS 102 /* end of structure */ -#define C_FILE 103 /* file name */ -#define C_LINE 104 /* line # reformatted as symbol table entry */ -#define C_ALIAS 105 /* duplicate tag */ -#define C_HIDDEN 106 /* ext symbol in dmert public lib */ - -/********************** RELOCATION DIRECTIVES **********************/ - - - -struct external_reloc { - unsigned long r_vaddr __attribute__((packed)); - unsigned long r_symndx __attribute__((packed)); - unsigned short r_type; -}; - - -#define RELOC struct external_reloc -#define RELSZ sizeof(RELOC) - -#define RELOC_REL32 20 /* 32-bit PC-relative address */ -#define RELOC_ADDR32 6 /* 32-bit absolute address */ - -#define DEFAULT_DATA_SECTION_ALIGNMENT 4 -#define DEFAULT_BSS_SECTION_ALIGNMENT 4 -#define DEFAULT_TEXT_SECTION_ALIGNMENT 4 -/* For new sections we havn't heard of before */ -#define DEFAULT_SECTION_ALIGNMENT 4 - -//#endif /* !_POSIX_SOURCE */ -//#endif /* !__STRICT_ANSI__ */ -//#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ - -#ifndef __dj_ENFORCE_FUNCTION_CALLS -#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ - -#ifdef __cplusplus -} -#endif - -#endif /* !__dj_include_coff_h_ */ +/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ +#ifndef __dj_include_coff_h_ +#define __dj_include_coff_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +//#ifndef __dj_ENFORCE_ANSI_FREESTANDING + +//#ifndef __STRICT_ANSI__ + +//#ifndef _POSIX_SOURCE + +/*** coff information for Intel 386/486. */ + +/********************** FILE HEADER **********************/ + +struct external_filehdr { + unsigned short f_magic; /* magic number */ + unsigned short f_nscns; /* number of sections */ + unsigned long f_timdat; /* time & date stamp */ + unsigned long f_symptr; /* file pointer to symtab */ + unsigned long f_nsyms; /* number of symtab entries */ + unsigned short f_opthdr; /* sizeof(optional hdr) */ + unsigned short f_flags; /* flags */ +}; + + +/* Bits for f_flags: + * F_RELFLG relocation info stripped from file + * F_EXEC file is executable (no unresolved external references) + * F_LNNO line numbers stripped from file + * F_LSYMS local symbols stripped from file + * F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax) + */ + +#define F_RELFLG (0x0001) +#define F_EXEC (0x0002) +#define F_LNNO (0x0004) +#define F_LSYMS (0x0008) + + + +#define I386MAGIC 0x14c +#define I386AIXMAGIC 0x175 +#define I386BADMAG(x) (((x).f_magic!=I386MAGIC) && (x).f_magic!=I386AIXMAGIC) + + +#define FILHDR struct external_filehdr +#define FILHSZ sizeof(FILHDR) + + +/********************** AOUT "OPTIONAL HEADER" **********************/ + + +typedef struct +{ + unsigned short magic; /* type of file */ + unsigned short vstamp; /* version stamp */ + unsigned long tsize; /* text size in bytes, padded to FW bdry*/ + unsigned long dsize; /* initialized data " " */ + unsigned long bsize; /* uninitialized data " " */ + unsigned long entry; /* entry pt. */ + unsigned long text_start; /* base of text used for this file */ + unsigned long data_start; /* base of data used for this file */ +} +AOUTHDR; + + +typedef struct gnu_aout { + unsigned long info; + unsigned long tsize; + unsigned long dsize; + unsigned long bsize; + unsigned long symsize; + unsigned long entry; + unsigned long txrel; + unsigned long dtrel; + } GNU_AOUT; + +#define AOUTSZ (sizeof(AOUTHDR)) + +#define OMAGIC 0404 /* object files, eg as output */ +#define ZMAGIC 0413 /* demand load format, eg normal ld output */ +#define STMAGIC 0401 /* target shlib */ +#define SHMAGIC 0443 /* host shlib */ + + +/********************** SECTION HEADER **********************/ + + +struct external_scnhdr { + char s_name[8]; /* section name */ + unsigned long s_paddr; /* physical address, aliased s_nlib */ + unsigned long s_vaddr; /* virtual address */ + unsigned long s_size; /* section size */ + unsigned long s_scnptr; /* file ptr to raw data for section */ + unsigned long s_relptr; /* file ptr to relocation */ + unsigned long s_lnnoptr; /* file ptr to line numbers */ + unsigned short s_nreloc; /* number of relocation entries */ + unsigned short s_nlnno; /* number of line number entries*/ + unsigned long s_flags; /* flags */ +}; + +#define SCNHDR struct external_scnhdr +#define SCNHSZ sizeof(SCNHDR) + +/* + * names of "special" sections + */ +#define _TEXT ".text" +#define _DATA ".data" +#define _BSS ".bss" +#define _COMMENT ".comment" +#define _LIB ".lib" + +/* + * s_flags "type" + */ +#define STYP_TEXT (0x0020) /* section contains text only */ +#define STYP_DATA (0x0040) /* section contains data only */ +#define STYP_BSS (0x0080) /* section contains bss only */ + +/********************** LINE NUMBERS **********************/ + +/* 1 line number entry for every "breakpointable" source line in a section. + * Line numbers are grouped on a per function basis; first entry in a function + * grouping will have l_lnno = 0 and in place of physical address will be the + * symbol table index of the function name. + */ +struct external_lineno { + union { + unsigned long l_symndx __attribute__((packed)); /* function name symbol index, iff l_lnno == 0 */ + unsigned long l_paddr __attribute__((packed)); /* (physical) address of line number */ + } l_addr; + unsigned short l_lnno; /* line number */ +}; + + +#define LINENO struct external_lineno +#define LINESZ sizeof(LINENO) + + +/********************** SYMBOLS **********************/ + +#define E_SYMNMLEN 8 /* # characters in a symbol name */ +#define E_FILNMLEN 14 /* # characters in a file name */ +#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */ + +struct external_syment +{ + union { + char e_name[E_SYMNMLEN]; + struct { + unsigned long e_zeroes __attribute__((packed)); + unsigned long e_offset __attribute__((packed)); + } e; + } e; + unsigned long e_value __attribute__((packed)); + short e_scnum; + unsigned short e_type; + unsigned char e_sclass; + unsigned char e_numaux; +}; + +#define N_BTMASK (0xf) +#define N_TMASK (0x30) +#define N_BTSHFT (4) +#define N_TSHIFT (2) + +union external_auxent { + struct { + unsigned long x_tagndx __attribute__((packed)); /* str, un, or enum tag indx */ + union { + struct { + unsigned short x_lnno; /* declaration line number */ + unsigned short x_size; /* str/union/array size */ + } x_lnsz; + unsigned long x_fsize __attribute__((packed)); /* size of function */ + } x_misc; + union { + struct { /* if ISFCN, tag, or .bb */ + unsigned long x_lnnoptr __attribute__((packed)); /* ptr to fcn line # */ + unsigned long x_endndx __attribute__((packed)); /* entry ndx past block end */ + } x_fcn; + struct { /* if ISARY, up to 4 dimen. */ + unsigned short x_dimen[E_DIMNUM]; + } x_ary; + } x_fcnary; + unsigned short x_tvndx; /* tv index */ + } x_sym; + + union { + char x_fname[E_FILNMLEN]; + struct { + unsigned long x_zeroes __attribute__((packed)); + unsigned long x_offset __attribute__((packed)); + } x_n; + } x_file; + + struct { + unsigned long x_scnlen __attribute__((packed)); /* section length */ + unsigned short x_nreloc; /* # relocation entries */ + unsigned short x_nlinno; /* # line numbers */ + } x_scn; + + struct { + unsigned long x_tvfill __attribute__((packed)); /* tv fill value */ + unsigned short x_tvlen; /* length of .tv */ + unsigned short x_tvran[2]; /* tv range */ + } x_tv; /* info about .tv section (in auxent of symbol .tv)) */ + + +}; + +#define SYMENT struct external_syment +#define SYMESZ sizeof(SYMENT) +#define AUXENT union external_auxent +#define AUXESZ sizeof(AUXENT) + + +# define _ETEXT "etext" + + +/* Relocatable symbols have number of the section in which they are defined, + or one of the following: */ + +#define N_UNDEF ((short)0) /* undefined symbol */ +#define N_ABS ((short)-1) /* value of symbol is absolute */ +#define N_DEBUG ((short)-2) /* debugging symbol -- value is meaningless */ +#define N_TV ((short)-3) /* indicates symbol needs preload transfer vector */ +#define P_TV ((short)-4) /* indicates symbol needs postload transfer vector*/ + +/* + * Type of a symbol, in low N bits of the word + */ +#define T_NULL 0 +#define T_VOID 1 /* function argument (only used by compiler) */ +#define T_CHAR 2 /* character */ +#define T_SHORT 3 /* short integer */ +#define T_INT 4 /* integer */ +#define T_LONG 5 /* long integer */ +#define T_FLOAT 6 /* floating point */ +#define T_DOUBLE 7 /* double word */ +#define T_STRUCT 8 /* structure */ +#define T_UNION 9 /* union */ +#define T_ENUM 10 /* enumeration */ +#define T_MOE 11 /* member of enumeration*/ +#define T_UCHAR 12 /* unsigned character */ +#define T_USHORT 13 /* unsigned short */ +#define T_UINT 14 /* unsigned integer */ +#define T_ULONG 15 /* unsigned long */ +#define T_LNGDBL 16 /* long double */ + +/* + * derived types, in n_type +*/ +#define DT_NON (0) /* no derived type */ +#define DT_PTR (1) /* pointer */ +#define DT_FCN (2) /* function */ +#define DT_ARY (3) /* array */ + +#define BTYPE(x) ((x) & N_BTMASK) + +#define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT)) +#define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT)) +#define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT)) +#define ISTAG(x) ((x)==C_STRTAG||(x)==C_UNTAG||(x)==C_ENTAG) +#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK)) + +/********************** STORAGE CLASSES **********************/ + +/* This used to be defined as -1, but now n_sclass is unsigned. */ +#define C_EFCN 0xff /* physical end of function */ +#define C_NULL 0 +#define C_AUTO 1 /* automatic variable */ +#define C_EXT 2 /* external symbol */ +#define C_STAT 3 /* static */ +#define C_REG 4 /* register variable */ +#define C_EXTDEF 5 /* external definition */ +#define C_LABEL 6 /* label */ +#define C_ULABEL 7 /* undefined label */ +#define C_MOS 8 /* member of structure */ +#define C_ARG 9 /* function argument */ +#define C_STRTAG 10 /* structure tag */ +#define C_MOU 11 /* member of union */ +#define C_UNTAG 12 /* union tag */ +#define C_TPDEF 13 /* type definition */ +#define C_USTATIC 14 /* undefined static */ +#define C_ENTAG 15 /* enumeration tag */ +#define C_MOE 16 /* member of enumeration */ +#define C_REGPARM 17 /* register parameter */ +#define C_FIELD 18 /* bit field */ +#define C_AUTOARG 19 /* auto argument */ +#define C_LASTENT 20 /* dummy entry (end of block) */ +#define C_BLOCK 100 /* ".bb" or ".eb" */ +#define C_FCN 101 /* ".bf" or ".ef" */ +#define C_EOS 102 /* end of structure */ +#define C_FILE 103 /* file name */ +#define C_LINE 104 /* line # reformatted as symbol table entry */ +#define C_ALIAS 105 /* duplicate tag */ +#define C_HIDDEN 106 /* ext symbol in dmert public lib */ + +/********************** RELOCATION DIRECTIVES **********************/ + + + +struct external_reloc { + unsigned long r_vaddr __attribute__((packed)); + unsigned long r_symndx __attribute__((packed)); + unsigned short r_type; +}; + + +#define RELOC struct external_reloc +#define RELSZ sizeof(RELOC) + +#define RELOC_REL32 20 /* 32-bit PC-relative address */ +#define RELOC_ADDR32 6 /* 32-bit absolute address */ + +#define DEFAULT_DATA_SECTION_ALIGNMENT 4 +#define DEFAULT_BSS_SECTION_ALIGNMENT 4 +#define DEFAULT_TEXT_SECTION_ALIGNMENT 4 +/* For new sections we havn't heard of before */ +#define DEFAULT_SECTION_ALIGNMENT 4 + +//#endif /* !_POSIX_SOURCE */ +//#endif /* !__STRICT_ANSI__ */ +//#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ + +#ifndef __dj_ENFORCE_FUNCTION_CALLS +#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ + +#ifdef __cplusplus +} +#endif + +#endif /* !__dj_include_coff_h_ */ diff --git a/reactos/include/ddk/defines.h b/reactos/include/ddk/defines.h index d7c662b2898..413e5af3240 100644 --- a/reactos/include/ddk/defines.h +++ b/reactos/include/ddk/defines.h @@ -1,521 +1,399 @@ -/* GENERAL DEFINITIONS ****************************************************/ - -#include - - - -/* - * PURPOSE: Number of a thread priority levels - */ -#define NR_PRIORITY_LEVELS (32) - -/* - * PURPOSE: Type of queue to insert a work item in - */ -enum -{ - CriticalWorkQueue, - DelayedWorkQueue, - HyperCriticalWorkQueue, -}; - -/* - * Types of memory to allocate - */ -enum -{ - NonPagedPool, - NonPagedPoolMustSucceed, - NonPagedPoolCacheAligned, - NonPagedPoolCacheAlignedMustS, - PagedPool, - PagedPoolCacheAligned, -}; - -/* - * PURPOSE: Irp flags - */ -enum -{ - /* - * Read any data from the actual backing media - */ - IRP_NOCACHE, - - /* - * The I/O operation is performing paging - */ - IRP_PAGING_IO, - - /* - * The IRP is for a mount operation - */ - IRP_MOUNT_COMPLETION, - - /* - * The API expects synchronous behaviour - */ - IRP_SYNCHRONOUS_API, - - /* - * The IRP is associated with a larger operation - */ - IRP_ASSOCIATED_IRP, - - /* - * The AssociatedIrp.SystemBuffer field is valid - */ - IRP_BUFFERED_IO, - - /* - * The system buffer was allocated from pool and should be deallocated - * by the I/O manager - */ - IRP_DEALLOCATE_BUFFER, - - /* - * The IRP is for an input operation - */ - IRP_INPUT_OPERATION, - - /* - * The paging operation should complete synchronously - */ - IRP_SYNCHRONOUS_PAGING_IO, - - /* - * The IRP represents a filesystem create operation - */ - IRP_CREATE_OPERATION, - - /* - * The IRP represents a filesystem read operation - */ - IRP_READ_OPERATION, - - /* - * The IRP represents a filesystem write operation - */ - IRP_WRITE_OPERATION, - - /* - * The IRP represents a filesystem close operation - */ - IRP_CLOSE_OPERATION, - - /* - * Asynchronous behavior is advised but not required - */ - IRP_DEFER_IO_COMPLETION, -}; - -/* - * I/O operation flags - */ -enum -{ - /* - * Force an access check even if opened in kernel mode - */ - SL_FORCE_ACCESS_CHECK, - - /* - * The file being opened is a paging file - */ - SL_OPEN_PAGING_FILE, - - SL_OPEN_TARGET_DIRECTORY, - - SL_CASE_SENSITIVE, - - SL_KEY_SPECIFIED, - - SL_OVERRIDE_VERIFY_VOLUME, - - SL_WRITE_THROUGH, - - SL_FT_SEQUENTIAL_WRITE, - - SL_FAIL_IMMEDIATELY, - - SL_EXCLUSIVE_LOCK, - - SL_RESTART_SCAN, - - SL_RETURN_SINGLE_ENTRY, - - SL_INDEX_SPECIFIED, - - SL_WATCH_TREE, - - SL_ALLOW_RAW_MOUNT, -}; - -/* - * Possible flags for the device object flags - */ -enum -{ - DO_BUFFERED_IO = 0x1, - DO_DIRECT_IO = 0x2, -}; - -/* - * Possible status codes - * FIXME: These may not be the actual values used by NT - */ -enum -{ - STATUS_SUCCESS, - STATUS_INSUFFICIENT_RESOURCES, - STATUS_OBJECT_NAME_EXISTS, - STATUS_OBJECT_NAME_COLLISION, -// STATUS_DATATYPE_MISALIGNMENT, - STATUS_CTL_FILE_NOT_SUPPORTED, -// STATUS_ACCESS_VIOLATION, - STATUS_PORT_ALREADY_SET, - STATUS_SECTION_NOT_IMAGE, - STATUS_BAD_WORKING_SET_LIMIT, - STATUS_INCOMPATIBLE_FILE_MAP, - STATUS_HANDLE_NOT_WAITABLE, - STATUS_PORT_DISCONNECTED, - STATUS_NOT_LOCKED, - STATUS_NOT_MAPPED_VIEW, - STATUS_UNABLE_TO_FREE_VM, - STATUS_UNABLE_TO_DELETE_SECTION, - STATUS_MORE_PROCESSING_REQUIRED, - STATUS_INVALID_CID, - STATUS_BAD_INITIAL_STACK, - STATUS_INVALID_VOLUME_LABEL, - STATUS_SECTION_NOT_EXTENDED, - STATUS_NOT_MAPPED_DATA, - STATUS_INFO_LENGTH_MISMATCH, - STATUS_INVALID_INFO_CLASS, - STATUS_SUSPEND_COUNT_EXCEEDED, - STATUS_NOTIFY_ENUM_DIR, - STATUS_REGISTRY_RECOVERED, - STATUS_REGISTRY_IO_FAILED, - STATUS_KEY_DELETED, - STATUS_NO_LOG_SPACE, - STATUS_KEY_HAS_CHILDREN, - STATUS_CHILD_MUST_BE_VOLATILE, - STATUS_REGISTRY_CORRUPT, - STATUS_DLL_NOT_FOUND, - STATUS_DLL_INIT_FAILED, - STATUS_ORDINAL_NOT_FOUND, - STATUS_ENTRYPOINT_NOT_FOUND, -// STATUS_PENDING, - STATUS_MORE_ENTRIES, -// STATUS_INTEGER_OVERFLOW, - STATUS_BUFFER_OVERFLOW, - STATUS_NO_MORE_FILES, - STATUS_NO_INHERITANCE, - STATUS_NO_MORE_EAS, - STATUS_NO_MORE_ENTRIES, - STATUS_GUIDS_EXHAUSTED, - STATUS_AGENTS_EXHAUSTED, - STATUS_UNSUCCESSFUL, - STATUS_NOT_IMPLEMENTED, - STATUS_ILLEGAL_FUNCTION, -// STATUS_IN_PAGE_ERROR, - STATUS_PAGEFILE_QUOTA, - STATUS_COMMITMENT_LIMIT, - STATUS_SECTION_TOO_BIG, - RPC_NT_SS_IN_NULL_CONTEXT, - RPC_NT_INVALID_BINDING, -// STATUS_INVALID_HANDLE, - STATUS_OBJECT_FILE_MISMATCH, - STATUS_FILE_CLOSED, - STATUS_INVALID_PORT_HANDLE, - STATUS_NOT_COMMITTED, - STATUS_INVALID_PARAMETER, - STATUS_INVALID_PARAMETER_1, - STATUS_INVALID_PARAMETER_2, - STATUS_INVALID_PARAMETER_3, - STATUS_INVALID_PARAMETER_4, - STATUS_INVALID_PARAMETER_5, - STATUS_INVALID_PARAMETER_6, - STATUS_INVALID_PARAMETER_7, - STATUS_INVALID_PARAMETER_8, - STATUS_INVALID_PARAMETER_9, - STATUS_INVALID_PARAMETER_10, - STATUS_INVALID_PARAMETER_11, - STATUS_INVALID_PARAMETER_12, - STATUS_INVALID_PARAMETER_MAX, - STATUS_INVALID_PAGE_PROTECTION, - STATUS_RESOURCE_DATA_NOT_FOUND, - STATUS_RESOURCE_TYPE_NOT_FOUND, - STATUS_RESOURCE_NAME_NOT_FOUND, - STATUS_RESOURCE_LANG_NOT_FOUND, - STATUS_NO_SUCH_DEVICE, - STATUS_NO_SUCH_FILE, - STATUS_INVALID_DEVICE_REQUEST, - STATUS_END_OF_FILE, - STATUS_FILE_FORCED_CLOSED, - STATUS_WRONG_VOLUME, - STATUS_NO_MEDIA, - STATUS_NO_MEDIA_IN_DEVICE, - STATUS_NONEXISTENT_SECTOR, - STATUS_WORKING_SET_QUOTA, -// STATUS_NO_MEMORY, - STATUS_CONFLICTING_ADDRESS, - STATUS_INVALID_SYSTEM_SERVICE, - STATUS_THREAD_IS_TERMINATING, - STATUS_PROCESS_IS_TERMINATING, - STATUS_INVALID_LOCK_SEQUENCE, - STATUS_INVALID_VIEW_SIZE, - STATUS_ALREADY_COMMITTED, - STATUS_ACCESS_DENIED, - STATUS_FILE_IS_A_DIRECTORY, - STATUS_CANNOT_DELETE, - STATUS_INVALID_COMPUTER_NAME, - STATUS_FILE_DELETED, - STATUS_DELETE_PENDING, - STATUS_PORT_CONNECTION_REFUSED, - STATUS_NO_SUCH_PRIVILEGE, - STATUS_PRIVILEGE_NOT_HELD, - STATUS_CANNOT_IMPERSONATE, - STATUS_LOGON_FAILURE, - STATUS_ACCOUNT_RESTRICTION, - STATUS_INVALID_LOGON_HOURS, - STATUS_INVALID_WORKSTATION, - STATUS_BUFFER_TOO_SMALL, - STATUS_UNABLE_TO_DECOMMIT_VM, - STATUS_DISK_CORRUPT_ERROR, - STATUS_OBJECT_NAME_INVALID, - STATUS_OBJECT_NAME_NOT_FOUND, -// STATUS_OBJECT_NAME_COLLISION, - STATUS_OBJECT_PATH_INVALID, - STATUS_OBJECT_PATH_NOT_FOUND, - STATUS_DFS_EXIT_PATH_FOUND, - STATUS_OBJECT_PATH_SYNTAX_BAD, - STATUS_DATA_OVERRUN, - STATUS_DATA_LATE_ERROR, - STATUS_DATA_ERROR, - STATUS_CRC_ERROR, - STATUS_SHARING_VIOLATION, - STATUS_QUOTA_EXCEEDED, - STATUS_MUTANT_NOT_OWNED, - STATUS_SEMAPHORE_LIMIT_EXCEEDED, - STATUS_DISK_FULL, - STATUS_LOCK_NOT_GRANTED, -}; - -/* - * Possible device types - */ -enum -{ - /* - * Standard define types - */ - FILE_DEVICE_BEEP, - FILE_DEVICE_CDROM, - FILE_DEVICE_CONTROLLER, - FILE_DEVICE_DISK, - FILE_DEVICE_INPORT_PORT, - FILE_DEVICE_KEYBOARD, - FILE_DEVICE_MIDI_IN, - FILE_DEVICE_MIDI_OUT, - FILE_DEVICE_MOUSE, - FILE_DEVICE_NULL, - FILE_DEVICE_PARALLEL_PORT, - FILE_DEVICE_PRINTER, - FILE_DEVICE_SCANNER, - FILE_DEVICE_SERIAL_MOUSE_PORT, - FILE_DEVICE_SERIAL_PORT, - FILE_DEVICE_SCREEN, - FILE_DEVICE_TAPE, - FILE_DEVICE_UNKNOWN, - FILE_DEVICE_VIDEO, - FILE_DEVICE_VIRTUAL_DISK, - FILE_DEVICE_WAVE_IN, - FILE_DEVICE_WAVE_OUT, - FILE_DEVICE_8042_PORT, - - /* - * Values beyond this are reserved for ISVs - */ - FILE_DEVICE_FIRST_FREE = 32768 -}; - - - -/* - * Possible device characteristics - */ -enum -{ - FILE_REMOVABLE_MEDIA = 0x1, - FILE_READ_ONLY_DEVICE = 0x2, - FILE_FLOPPY_DISKETTE = 0x4, - FILE_WRITE_ONCE_MEDIA = 0x8, - FILE_REMOTE_DEVICE = 0x10, -}; - -/* - * PURPOSE: Bus types - */ -enum -{ - Internal, - Isa, - MicroChannel, - TurboChannel, - PCIBus, - MaximumInterfaceType, -}; - -/* - * This is a list of bug check types (not MS's) - */ -enum -{ - KBUG_NONE, - KBUG_ORPHANED_IRP, - KBUG_IO_STACK_OVERFLOW, - KBUG_OUT_OF_MEMORY, - KBUG_POOL_FREE_LIST_CORRUPT, - - /* - * These are well known but the actual value is unknown - */ - NO_PAGES_AVAILABLE, - - /* - * These are well known (MS) bug types - * (Reference: NT Insider 1997 - http://www.osr.com) - */ - IRQL_NOT_LESS_OR_EQUAL = 0xa, - KMODE_EXCEPTION_NOT_HANDLED = 0x1e, - UNEXPECTED_KERNEL_MODE_TRAP = 0x7f, - PAGE_FAULT_IN_NON_PAGED_AREA = 0x50, -}; - -/* - * PURPOSE: Object attributes - */ -enum -{ - OBJ_INHERIT = 0x1, - OBJ_PERMANENT = 0x2, - OBJ_EXCLUSIVE = 0x4, - OBJ_CASE_INSENSITIVE = 0x8, - OBJ_OPENIF = 0x10, -}; - -/* - * PURPOSE: DPC priorities - */ -enum -{ - High, - Medium, - Low, -}; - -/* - * PURPOSE: Timer types - */ -enum - { - NotificationTimer, - SynchronizationTimer, - }; - -/* - * PURPOSE: Some drivers use these - */ -#define IN -#define OUT -#define OPTIONAL - -/* - * PURPOSE: Power IRP minor function numbers - */ -enum -{ - IRP_MN_QUERY_POWER, - IRP_MN_SET_POWER, - IRP_MN_WAIT_WAKE, - IRP_MN_QUERY_CAPABILITIES, - IRP_MN_POWER_SEQUENCE, -}; - -/* - * FIXME: These are not in the correct order - */ -enum -{ - IRP_MJ_CREATE, - IRP_MJ_CREATE_NAMED_PIPE, - IRP_MJ_CLOSE, - IRP_MJ_READ, - IRP_MJ_WRITE, - IRP_MJ_QUERY_INFORMATION, - IRP_MJ_SET_INFORMATION, - IRP_MJ_QUERY_EA, - IRP_MJ_SET_EA, - IRP_MJ_FLUSH_BUFFERS, - IRP_MJ_QUERY_VOLUME_INFORMATION, - IRP_MJ_SET_VOLUME_INFORMATION, - IRP_MJ_DIRECTORY_CONTROL, - IRP_MJ_FILE_SYSTEM_CONTROL, - IRP_MJ_DEVICE_CONTROL, - IRP_MJ_INTERNAL_DEVICE_CONTROL, - IRP_MJ_SHUTDOWN, - IRP_MJ_LOCK_CONTROL, - IRP_MJ_CLEANUP, - IRP_MJ_CREATE_MAILSLOT, - IRP_MJ_QUERY_SECURITY, - IRP_MJ_SET_SECURITY, - IRP_MJ_QUERY_POWER, - IRP_MJ_SET_POWER, - IRP_MJ_DEVICE_CHANGE, - IRP_MJ_QUERY_QUOTA, - IRP_MJ_SET_QUOTA, - IRP_MJ_PNP_POWER, - IRP_MJ_MAXIMUM_FUNCTION, -}; - -/* - * PURPOSE: Used all over - */ -enum -{ - KernelMode, - UserMode, -}; - -/* - * PURPOSE: Arguments to MmProbeAndLockPages - */ -enum -{ - IoReadAccess, - IoWriteAccess, - IoModifyAccess, -}; - -#define MAXIMUM_VOLUME_LABEL_LENGTH (32) - -/* - * IRQ levels - */ -enum -{ - PASSIVE_LEVEL, - - /* - * Which order for these (only DISPATCH_LEVEL is important for now) - */ - APC_LEVEL, - DISPATCH_LEVEL, - - /* - * Above here are device specific IRQ levels - */ - FIRST_DEVICE_SPECIFIC_LEVEL, - HIGH_LEVEL = FIRST_DEVICE_SPECIFIC_LEVEL + NR_DEVICE_SPECIFIC_LEVELS, -}; - +/* GENERAL DEFINITIONS ****************************************************/ + +#include + +#include +#include + +/* + * PURPOSE: Number of a thread priority levels + */ +#define NR_PRIORITY_LEVELS (32) + +/* + * PURPOSE: Type of queue to insert a work item in + */ +enum +{ + CriticalWorkQueue, + DelayedWorkQueue, + HyperCriticalWorkQueue, +}; + +/* + * Types of memory to allocate + */ +enum +{ + NonPagedPool, + NonPagedPoolMustSucceed, + NonPagedPoolCacheAligned, + NonPagedPoolCacheAlignedMustS, + PagedPool, + PagedPoolCacheAligned, +}; + +/* + * Possible status codes + * FIXME: These may not be the actual values used by NT + */ +enum +{ + STATUS_SUCCESS, + STATUS_INSUFFICIENT_RESOURCES, + STATUS_OBJECT_NAME_EXISTS, + STATUS_OBJECT_NAME_COLLISION, +// STATUS_DATATYPE_MISALIGNMENT, + STATUS_CTL_FILE_NOT_SUPPORTED, +// STATUS_ACCESS_VIOLATION, + STATUS_PORT_ALREADY_SET, + STATUS_SECTION_NOT_IMAGE, + STATUS_BAD_WORKING_SET_LIMIT, + STATUS_INCOMPATIBLE_FILE_MAP, + STATUS_HANDLE_NOT_WAITABLE, + STATUS_PORT_DISCONNECTED, + STATUS_NOT_LOCKED, + STATUS_NOT_MAPPED_VIEW, + STATUS_UNABLE_TO_FREE_VM, + STATUS_UNABLE_TO_DELETE_SECTION, + STATUS_MORE_PROCESSING_REQUIRED, + STATUS_INVALID_CID, + STATUS_BAD_INITIAL_STACK, + STATUS_INVALID_VOLUME_LABEL, + STATUS_SECTION_NOT_EXTENDED, + STATUS_NOT_MAPPED_DATA, + STATUS_INFO_LENGTH_MISMATCH, + STATUS_INVALID_INFO_CLASS, + STATUS_SUSPEND_COUNT_EXCEEDED, + STATUS_NOTIFY_ENUM_DIR, + STATUS_REGISTRY_RECOVERED, + STATUS_REGISTRY_IO_FAILED, + STATUS_KEY_DELETED, + STATUS_NO_LOG_SPACE, + STATUS_KEY_HAS_CHILDREN, + STATUS_CHILD_MUST_BE_VOLATILE, + STATUS_REGISTRY_CORRUPT, + STATUS_DLL_NOT_FOUND, + STATUS_DLL_INIT_FAILED, + STATUS_ORDINAL_NOT_FOUND, + STATUS_ENTRYPOINT_NOT_FOUND, +// STATUS_PENDING, + STATUS_MORE_ENTRIES, +// STATUS_INTEGER_OVERFLOW, + STATUS_BUFFER_OVERFLOW, + STATUS_NO_MORE_FILES, + STATUS_NO_INHERITANCE, + STATUS_NO_MORE_EAS, + STATUS_NO_MORE_ENTRIES, + STATUS_GUIDS_EXHAUSTED, + STATUS_AGENTS_EXHAUSTED, + STATUS_UNSUCCESSFUL, + STATUS_NOT_IMPLEMENTED, + STATUS_ILLEGAL_FUNCTION, +// STATUS_IN_PAGE_ERROR, + STATUS_PAGEFILE_QUOTA, + STATUS_COMMITMENT_LIMIT, + STATUS_SECTION_TOO_BIG, + RPC_NT_SS_IN_NULL_CONTEXT, + RPC_NT_INVALID_BINDING, +// STATUS_INVALID_HANDLE, + STATUS_OBJECT_FILE_MISMATCH, + STATUS_FILE_CLOSED, + STATUS_INVALID_PORT_HANDLE, + STATUS_NOT_COMMITTED, + STATUS_INVALID_PARAMETER, + STATUS_INVALID_PARAMETER_1, + STATUS_INVALID_PARAMETER_2, + STATUS_INVALID_PARAMETER_3, + STATUS_INVALID_PARAMETER_4, + STATUS_INVALID_PARAMETER_5, + STATUS_INVALID_PARAMETER_6, + STATUS_INVALID_PARAMETER_7, + STATUS_INVALID_PARAMETER_8, + STATUS_INVALID_PARAMETER_9, + STATUS_INVALID_PARAMETER_10, + STATUS_INVALID_PARAMETER_11, + STATUS_INVALID_PARAMETER_12, + STATUS_INVALID_PARAMETER_MAX, + STATUS_INVALID_PAGE_PROTECTION, + STATUS_RESOURCE_DATA_NOT_FOUND, + STATUS_RESOURCE_TYPE_NOT_FOUND, + STATUS_RESOURCE_NAME_NOT_FOUND, + STATUS_RESOURCE_LANG_NOT_FOUND, + STATUS_NO_SUCH_DEVICE, + STATUS_NO_SUCH_FILE, + STATUS_INVALID_DEVICE_REQUEST, + STATUS_END_OF_FILE, + STATUS_FILE_FORCED_CLOSED, + STATUS_WRONG_VOLUME, + STATUS_NO_MEDIA, + STATUS_NO_MEDIA_IN_DEVICE, + STATUS_NONEXISTENT_SECTOR, + STATUS_WORKING_SET_QUOTA, +// STATUS_NO_MEMORY, + STATUS_CONFLICTING_ADDRESS, + STATUS_INVALID_SYSTEM_SERVICE, + STATUS_THREAD_IS_TERMINATING, + STATUS_PROCESS_IS_TERMINATING, + STATUS_INVALID_LOCK_SEQUENCE, + STATUS_INVALID_VIEW_SIZE, + STATUS_ALREADY_COMMITTED, + STATUS_ACCESS_DENIED, + STATUS_FILE_IS_A_DIRECTORY, + STATUS_CANNOT_DELETE, + STATUS_INVALID_COMPUTER_NAME, + STATUS_FILE_DELETED, + STATUS_DELETE_PENDING, + STATUS_PORT_CONNECTION_REFUSED, + STATUS_NO_SUCH_PRIVILEGE, + STATUS_PRIVILEGE_NOT_HELD, + STATUS_CANNOT_IMPERSONATE, + STATUS_LOGON_FAILURE, + STATUS_ACCOUNT_RESTRICTION, + STATUS_INVALID_LOGON_HOURS, + STATUS_INVALID_WORKSTATION, + STATUS_BUFFER_TOO_SMALL, + STATUS_UNABLE_TO_DECOMMIT_VM, + STATUS_DISK_CORRUPT_ERROR, + STATUS_OBJECT_NAME_INVALID, + STATUS_OBJECT_NAME_NOT_FOUND, +// STATUS_OBJECT_NAME_COLLISION, + STATUS_OBJECT_PATH_INVALID, + STATUS_OBJECT_PATH_NOT_FOUND, + STATUS_DFS_EXIT_PATH_FOUND, + STATUS_OBJECT_PATH_SYNTAX_BAD, + STATUS_DATA_OVERRUN, + STATUS_DATA_LATE_ERROR, + STATUS_DATA_ERROR, + STATUS_CRC_ERROR, + STATUS_SHARING_VIOLATION, + STATUS_QUOTA_EXCEEDED, + STATUS_MUTANT_NOT_OWNED, + STATUS_SEMAPHORE_LIMIT_EXCEEDED, + STATUS_DISK_FULL, + STATUS_LOCK_NOT_GRANTED, + + STATUS_DEVICE_NOT_READY, + STATUS_IO_TIMEOUT, + STATUS_MEDIA_WRITE_PROTECTED, + STATUS_NO_MEDIA_IN_DRIVE, + STATUS_VERIFY_REQUIRED, + STATUS_UNRECOGNIZED_MEDIA, +// STATUS_WRONG_VOLUME, +}; + +/* + * This is a list of bug check types (not MS's) + */ +enum +{ + APC_INDEX_MISMATCH = 1, + DEVICE_QUEUE_NOT_BUSY, + INVALID_AFFINITY_SET, + INVALID_DATA_ACCESS_TRAP, + INVALID_PROCESS_ATTACH_ATTEMPT, + INVALID_PROCESS_DEATTACH_ATTEMPT, + INVALID_SOFTWARE_INTERRUPT, + IRQL_NOT_DISPATCH_LEVEL, + IRQL_NOT_GREATER_OR_EQUAL, + NO_EXCEPTION_HANDLING_SUPPORT, + MAXIMUM_WAIT_OBJECTS_EXCEEDED, + MUTEX_LEVEL_NUMBER_VIOLATION, + NO_USER_MODE_CONTEXT, + SPIN_LOCK_ALREADY_OWNED, + SPIN_LOCK_NOT_OWNED, + THREAD_NOT_MUTEX_OWNER, + TRAP_CAUSE_UNKNOWN, + EMPTY_THREAD_REAPER_LIST, + CREATE_DELETE_LOCK_NOT_LOCKED, + LAST_CHANCE_CALLED_FROM_KMODE, + CID_HANDLE_CREATION, + CID_HANDLE_DELETION, + REFERENCE_BY_POINTER, + BAD_POOL_HEADER, + MEMORY_MANAGMENT, + PFN_SHARE_COUNT, + PFN_REFERENCE_COUNT, + NO_SPIN_LOCK_AVAILABLE, + KMODE_EXCEPTION_NOT_HANDLED, + SHARED_RESOURCE_CONV_ERROR, + KERNEL_APC_PENDING_DURING_EXIT, + QUOTA_UNDERFLOW, + FILE_SYSTEM, + FAT_FILE_SYSTEM, + NTFS_FILE_SYSTEM, + NPFS_FILE_SYSTEM, + CDFS_FILE_SYSTEM, + RDR_FILE_SYSTEM, + CORRUPT_ACCESS_TOKEN, + SECURITY_SYSTEM, + INCONSISTENT_IRP, + PANIC_STACK_SWITCH, + PORT_DRIVER_INTERNAL, + SCSI_DISK_DRIVER_INTERNAL, + INSTRUCTION_BUS_ERROR, + SET_OF_INVALID_CONTEXT, + PHASE0_INITIALIZATION_FAILED, + PHASE1_INITIALIZATION_FAILED, + UNEXPECTED_INITIALIZATION_CALL, + CACHE_MANAGER, + NO_MORE_IRP_STACK_LOCATIONS, + DEVICE_REFERENCE_COUNT_NOT_ZERO, + FLOPPY_INTERNAL_ERROR, + SERIAL_DRIVER_INTERNAL, + SYSTEM_EXIT_OWNED_MUTEX, + SYSTEM_UNWIND_PREVIOUS_USER, + SYSTEN_SERVICE_EXCEPTION, + INTERRUPT_UNWIND_ATTEMPTED, + INTERRUPT_EXCEPTION_NOT_HANDLED, + MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED, + NO_MORE_SYSTEM_PTES, + TARGET_MDL_TOO_SMALL, + MUST_SUCCEED_POOL_EMPTY, + ATDISK_DRIVER_INTERNAL, + NO_SUCH_PARTITION, + MULTIPLE_IRP_COMPLETE_REQUESTS, + INSUFFICENT_SYSTEM_MAP_PAGES, + DEREF_UNKNOWN_LOGON_SERVICE, + REF_UNKNOWN_LOGON_SERVICE, + CANCEL_STATE_IN_COMPLETED_IRP, + PAGE_FAULT_WITH_INTERRUPTS_OFF, + IRQL_GT_ZERO_AT_SYSTEM_SERVICE, + STREAMS_INTERNAL_ERROR, + FATAL_UNHANDLED_HARD_ERROR, + NO_PAGES_AVAILABLE, + PFN_LIST_CORRUPT, + NDIS_INTERNAL_ERROR, + PAGE_FAULT_IN_NONPAGED_AREA, + REGISTRY_ERROR, + MAILSLOT_FILE_SYSTEM, + NO_BOOT_DEVICE, + LM_SERVER_INTERNAL_ERROR, + DATA_COHERENCY_EXCEPTION, + INSTRUCTION_COHERENCY_EXCEPTION, + XNS_INTERNAL_ERROR, + FTDISK_INTERNAL_ERROR, + PINBALL_FILE_SYSTEM, + CRITICAL_SERVICE_FAILED, + SET_ENV_VAR_FAILED, + HAL_INITIALIZED_FAILED, + UNSUPPORTED_PROCESSOR, + OBJECT_INITIALIZATION_FAILED, + SECURITY_INITIALIZATION_FAILED, + PROCESS_INITIALIZATION_FAILED, + HAL1_INITIALIZATION_FAILED, +}; +enum +{ + KBUG_NONE, + KBUG_ORPHANED_IRP, + KBUG_IO_STACK_OVERFLOW, + KBUG_OUT_OF_MEMORY, + KBUG_POOL_FREE_LIST_CORRUPT, + + /* + * These are well known but the actual value is unknown + */ +// NO_PAGES_AVAILABLE, + + /* + * These are well known (MS) bug types + * (Reference: NT Insider 1997 - http://www.osr.com) + */ + IRQL_NOT_LESS_OR_EQUAL = 0xa, +// KMODE_EXCEPTION_NOT_HANDLED = 0x1e, + UNEXPECTED_KERNEL_MODE_TRAP = 0x7f, + PAGE_FAULT_IN_NON_PAGED_AREA = 0x50, +}; + +/* + * PURPOSE: Object attributes + */ +enum +{ + OBJ_INHERIT = 0x1, + OBJ_PERMANENT = 0x2, + OBJ_EXCLUSIVE = 0x4, + OBJ_CASE_INSENSITIVE = 0x8, + OBJ_OPENIF = 0x10, +}; + +/* + * PURPOSE: DPC priorities + */ +enum +{ + High, + Medium, + Low, +}; + +/* + * PURPOSE: Timer types + */ +enum + { + NotificationTimer, + SynchronizationTimer, + }; + +/* + * PURPOSE: Some drivers use these + */ +#define IN +#define OUT +#define OPTIONAL + +/* + * PURPOSE: Power IRP minor function numbers + */ +enum +{ + IRP_MN_QUERY_POWER, + IRP_MN_SET_POWER, + IRP_MN_WAIT_WAKE, + IRP_MN_QUERY_CAPABILITIES, + IRP_MN_POWER_SEQUENCE, +}; + +/* + * PURPOSE: Used all over + */ +enum +{ + KernelMode, + UserMode, +}; + +/* + * PURPOSE: Arguments to MmProbeAndLockPages + */ +enum +{ + IoReadAccess, + IoWriteAccess, + IoModifyAccess, +}; + +#define MAXIMUM_VOLUME_LABEL_LENGTH (32) + +/* + * IRQ levels + */ +enum +{ + PASSIVE_LEVEL, + + /* + * Which order for these (only DISPATCH_LEVEL is important for now) + */ + APC_LEVEL, + DISPATCH_LEVEL, + + /* + * Above here are device specific IRQ levels + */ + FIRST_DEVICE_SPECIFIC_LEVEL, + HIGH_LEVEL = FIRST_DEVICE_SPECIFIC_LEVEL + NR_DEVICE_SPECIFIC_LEVELS, +}; + diff --git a/reactos/include/ddk/exfuncs.h b/reactos/include/ddk/exfuncs.h index 224241ae768..54145414f82 100644 --- a/reactos/include/ddk/exfuncs.h +++ b/reactos/include/ddk/exfuncs.h @@ -1,15 +1,17 @@ /* EXECUTIVE ROUTINES ******************************************************/ -//VOID ExAcquireFastMutex(PFAST_MUTEX FastMutex); +VOID ExAcquireFastMutex(PFAST_MUTEX FastMutex); +VOID ExAcquireFastMutexUnsafe(PFAST_MUTEX FastMutex); +BOOLEAN ExAcquireResourceExclusive(PERESOURCE Resource, BOOLEAN Wait); +BOOLEAN ExAcquireResourceExclusiveLite(PERESOURCE Resource, BOOLEAN Wait); +BOOLEAN ExAcquireResourceSharedLite(PERESOURCE Resource, BOOLEAN Wait); +BOOLEAN ExAcquireSharedStarveExclusive(PERESOURCE Resource, BOOLEAN Wait); +BOOLEAN ExAcquireSharedWaitForExclusive(PERESOURCE Resource, BOOLEAN Wait); +PVOID ExAllocateFromNPagedLookasideList(PNPAGED_LOOKASIDE_LIST LookSide); +PVOID ExAllocateFromPagedLookasideList(PPAGED_LOOKASIDE_LIST LookSide); +PVOID ExAllocateFromZone(PZONE_HEADER Zone); -/* - * FUNCTION: Releases previously allocated memory - * ARGUMENTS: - * block = block to free - */ -VOID ExFreePool(PVOID block); - /* * FUNCTION: Allocates memory from the nonpaged pool * ARGUMENTS: @@ -20,6 +22,63 @@ VOID ExFreePool(PVOID block); */ PVOID ExAllocatePool(POOL_TYPE PoolType, ULONG size); +PVOID ExAllocatePoolWithQuota(POOL_TYPE PoolType, ULONG NumberOfBytes); +PVOID ExAllocatePoolWithQuotaTag(POOL_TYPE PoolType, ULONG NumberOfBytes, + ULONG Tag); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, ULONG NumberOfBytes, + ULONG Tag); +VOID ExConvertExclusiveToSharedLite(PERESOURCE Resource); +VOID ExDeleteNPagedLookasideList(PNPAGED_LOOKASIDE_LIST Lookaside); +VOID ExDeletePagedLookasideList(PPAGED_LOOKASIDE_LIST Lookaside); +NTSTATUS ExDeleteResource(PERESOURCE Resource); +NTSTATUS ExDeleteResourceLite(PERESOURCE Resource); +NTSTATUS ExExtendZone(PZONE_HEADER Zone, PVOID Segment, ULONG SegmentSize); + +/* + * FUNCTION: Releases previously allocated memory + * ARGUMENTS: + * block = block to free + */ +VOID ExFreePool(PVOID block); + +VOID ExFreeToNPagedLookasideList(PNPAGED_LOOKASIDE_LIST Lookaside, + PVOID Entry); +VOID ExFreeToPagedLookasideList(PPAGED_LOOKASIDE_LIST Lookaside, + PVOID Entry); +PVOID ExFreeToZone(PZONE_HEADER Zone, PVOID Block); +ERESOURCE_THREAD ExGetCurrentResourceThread(VOID); +ULONG ExGetExclusiveWaiterCount(PERESOURCE Resource); +ULONG ExGetSharedWaiterCount(PERESOURCE Resource); +VOID ExInitializeFastMutex(PFAST_MUTEX FastMutex); +VOID ExInitializeNPagedLookasideList(PNPAGED_LOOKASIDE_LIST Lookaside, + PALLOCATE_FUNCTION Allocate, + PFREE_FUNCTION Free, + ULONG Flags, + ULONG Size, + ULONG Tag, + USHORT Depth); +VOID ExInitializePagedLookasideList(PPAGED_LOOKASIDE_LIST Lookaside, + PALLOCATE_FUNCTION Allocate, + PFREE_FUNCTION Free, + ULONG Flags, + ULONG Size, + ULONG Tag, + USHORT Depth); +NTSTATUS ExInitializeResource(PERESOURCE Resource); +NTSTATUS ExInitializeResourceLite(PERESOURCE Resource); +VOID ExInitializeSListHead(PSLIST_HEADER SListHead); +VOID ExInitializeWorkItem(PWORK_QUEUE_ITEM Item, + PWORKER_THREAD_ROUTINE Routine, + PVOID Context); +NTSTATUS ExInitializeZone(PZONE_HEADER Zone, + ULONG BlockSize, + PVOID InitialSegment, + ULONG InitialSegmentSize); +LARGE_INTEGER ExInterlockedAddLargeInteger(PLARGE_INTEGER Addend, + LARGE_INTEGER Increment, + PKSPIN_LOCK Lock); +ULONG ExInterlockedAddUlong(PULONG Addend, ULONG Increment, PKSPIN_LOCK Lock); + VOID ExInterlockedRemoveEntryList(PLIST_ENTRY ListHead, PLIST_ENTRY Entry, PKSPIN_LOCK Lock); VOID RemoveEntryFromList(PLIST_ENTRY ListHead, PLIST_ENTRY Entry); @@ -33,3 +92,5 @@ PLIST_ENTRY ExInterlockedInsertHeadList(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry, PKSPIN_LOCK Lock); +VOID ExQueueWorkItem(PWORK_QUEUE_ITEM WorkItem, + WORK_QUEUE_TYPE QueueType); diff --git a/reactos/include/ddk/extypes.h b/reactos/include/ddk/extypes.h index 81ed7c368e6..35e4e0290a4 100644 --- a/reactos/include/ddk/extypes.h +++ b/reactos/include/ddk/extypes.h @@ -1,3 +1,50 @@ + + +typedef ULONG INTERLOCKED_RESULT; +typedef ULONG WORK_QUEUE_TYPE; + +typedef ULONG ERESOURCE_THREAD, *PERESOURCE_THREAD; + +typedef struct _OWNER_ENTRY +{ + ERESOURCE_THREAD OwnerThread; + union + { + LONG OwnerCount; + ULONG TableSize; + } a; +} OWNER_ENTRY, *POWNER_ENTRY; + +typedef struct _ERESOURCE +{ + LIST_ENTRY SystemResourcesList; + POWNER_ENTRY OwnerTable; + SHORT ActiveCount; + USHORT Flag; + PKSEMAPHORE SharedWaiters; + PKEVENT ExclusiveWaiters; + OWNER_ENTRY OwnerThreads[2]; + ULONG ContentionCount; + USHORT NumberOfSharedWaiters; + USHORT NumberOfExclusiveWaiters; + union + { + PVOID Address; + ULONG CreatorBackTraceIndex; + } a; + KSPIN_LOCK SpinLock; +} ERESOURCE, *PERESOURCE; + + +typedef struct +{ + LONG Count; + PKTHREAD Owner; + ULONG Contention; + KEVENT Event; + ULONG OldIrql; +} FAST_MUTEX, *PFAST_MUTEX; + typedef struct _ZONE_HEADER { SINGLE_LIST_ENTRY FreeList; @@ -16,3 +63,65 @@ typedef struct _ZONE_ENTRY { SINGLE_LIST_ENTRY Entry; } ZONE_ENTRY, *PZONE_ENTRY; + + +typedef VOID (*PWORKER_THREAD_ROUTINE)(PVOID Parameter); + +typedef struct _WORK_QUEUE_ITEM +{ + LIST_ENTRY Entry; + PWORKER_THREAD_ROUTINE Routine; + PVOID Context; +} WORK_QUEUE_ITEM, *PWORK_QUEUE_ITEM; + +typedef PVOID (*PALLOCATE_FUNCTION)(POOL_TYPE PoolType, + ULONG NumberOfBytes, + ULONG Tag); +typedef VOID (*PFREE_FUNCTION)(PVOID Buffer); + +typedef union _SLIST_HEADER +{ + ULONGLONG Alignment; + struct + { + SINGLE_LIST_ENTRY Next; + USHORT Depth; + USHORT Sequence; + } s; +} SLIST_HEADER, *PSLIST_HEADER; + +typedef struct +{ + SLIST_HEADER ListHead; + USHORT Depth; + USHORT Pad; + ULONG TotalAllocates; + ULONG AllocateMisses; + ULONG TotalFrees; + ULONG TotalMisses; + POOL_TYPE Type; + ULONG Tag; + ULONG Size; + PALLOCATE_FUNCTION Allocate; + PFREE_FUNCTION Free; + LIST_ENTRY ListEntry; + KSPIN_LOCK Lock; +} NPAGED_LOOKASIDE_LIST, *PNPAGED_LOOKASIDE_LIST; + +typedef struct +{ + SLIST_HEADER ListHead; + USHORT Depth; + USHORT Pad; + ULONG TotalAllocates; + ULONG AllocateMisses; + ULONG TotalFrees; + ULONG TotalMisses; + POOL_TYPE Type; + ULONG Tag; + ULONG Size; + PALLOCATE_FUNCTION Allocate; + PFREE_FUNCTION Free; + LIST_ENTRY ListEntry; + FAST_MUTEX Lock; +} PAGED_LOOKASIDE_LIST, *PPAGED_LOOKASIDE_LIST; diff --git a/reactos/include/ddk/iofuncs.h b/reactos/include/ddk/iofuncs.h index 4b4499cf96d..b735640bab1 100644 --- a/reactos/include/ddk/iofuncs.h +++ b/reactos/include/ddk/iofuncs.h @@ -224,7 +224,7 @@ BOOLEAN IoCancelIrp(PIRP Irp); NTSTATUS IoCheckShareAccess(ACCESS_MASK DesiredAccess, ULONG DesiredShareAccess, PFILE_OBJECT FileObject, -// PSHARE_ACCESS ShareAccess, + PSHARE_ACCESS ShareAccess, BOOLEAN Update); /* @@ -404,7 +404,7 @@ BOOLEAN IoRaiseHardInformationalError(NTSTATUS ErrorStatus, NTSTATUS IoReadPartitionTable(PDEVICE_OBJECT DeviceObject, ULONG SectorSize, BOOLEAN ReturnedRecognizedPartitions, - struct _DRIVER_LAYOUT_INFORMATION** PBuffer); + struct _DRIVE_LAYOUT_INFORMATION** PBuffer); VOID IoRegisterDriverReinitialization(PDRIVER_OBJECT DriverObject, PDRIVER_REINITIALIZE ReinitRoutine, @@ -502,3 +502,22 @@ NTSTATUS IoWritePartitionTable(PDEVICE_OBJECT DeviceObject, ULONG SectorsPerTrack, ULONG NumberOfHeads, struct _DRIVE_LAYOUT_INFORMATION* PBuffer); + +typedef ULONG FS_INFORMATION_CLASS; + +// Preliminary guess +NTKERNELAPI NTSTATUS IoQueryFileVolumeInformation(IN PFILE_OBJECT FileObject, + IN FS_INFORMATION_CLASS FsInformationClass, + IN ULONG Length, + OUT PVOID FsInformation, + OUT PULONG ReturnedLength); + +NTKERNELAPI // confirmed - Undocumented because it does not require a valid file handle +NTSTATUS +IoQueryFileInformation( +IN PFILE_OBJECT FileObject, +IN FILE_INFORMATION_CLASS FileInformationClass, +IN ULONG Length, +OUT PVOID FileInformation, +OUT PULONG ReturnedLength +); diff --git a/reactos/include/ddk/iotypes.h b/reactos/include/ddk/iotypes.h index 08696017c7a..fb863d3e113 100644 --- a/reactos/include/ddk/iotypes.h +++ b/reactos/include/ddk/iotypes.h @@ -16,10 +16,14 @@ struct _IO_STATUS_BLOCK; /* SIMPLE TYPES *************************************************************/ +enum +{ + DeallocateObject, + KeepObject, +}; + typedef ULONG INTERFACE_TYPE; typedef INTERFACE_TYPE* PINTERFACE_TYPE; -typedef ULONG CONFIGURATION_TYPE; -typedef CONFIGURATION_TYPE* PCONFIGURATION_TYPE; /* * FIXME: Definition needed @@ -62,8 +66,9 @@ typedef VOID (*PIO_APC_ROUTINE) (PVOID ApcContext, */ typedef struct _IO_TIMER { -} IO_TIMER, PIO_TIMER; - + KTIMER timer; + KDPC dpc; +} IO_TIMER, *PIO_TIMER; /* * PURPOSE: IRP stack location @@ -136,9 +141,6 @@ typedef struct _IO_STACK_LOCATION */ PIO_COMPLETION_ROUTINE CompletionRoutine; PVOID CompletionContext; - BOOLEAN InvokeOnSuccess; - BOOLEAN InvokeOnError; - BOOLEAN InvokeOnCancel; /* * Driver created device object representing the target device @@ -176,6 +178,52 @@ typedef NTSTATUS (*PDRIVER_INITIALIZE)(struct _DRIVER_OBJECT* DriverObject, typedef NTSTATUS (*PDRIVER_CANCEL)(struct _DRIVER_OBJECT* DriverObject, PUNICODE_STRING RegistryPath); + +typedef struct _SECTION_OBJECT_POINTERS +{ + PVOID DataSectionObject; + PVOID SharedCacheMap; + PVOID ImageSectionObject; +} SECTION_OBJECT_POINTERS, *PSECTION_OBJECT_POINTERS; + +typedef struct _IO_COMPLETION_CONTEXT +{ + PVOID Port; + ULONG Key; +} IO_COMPLETION_CONTEXT, *PIO_COMPLETION_CONTEXT; + +typedef struct _FILE_OBJECT +{ + CSHORT Type; + CSHORT Size; + struct _DEVICE_OBJECT* DeviceObject; + struct _VPB* Vpb; + PVOID FsContext; + PVOID FsContext2; + PSECTION_OBJECT_POINTERS SectionObjectPointers; + PVOID PrivateCacheMap; + NTSTATUS FinalStatus; + struct _FILE_OBJECT* RelatedFileObject; + BOOLEAN LockOperation; + BOOLEAN DeletePending; + BOOLEAN ReadAccess; + BOOLEAN WriteAccess; + BOOLEAN DeleteAccess; + BOOLEAN SharedRead; + BOOLEAN SharedWrite; + BOOLEAN SharedDelete; + ULONG Flags; + UNICODE_STRING FileName; + LARGE_INTEGER CurrentByteOffset; + ULONG Waiters; + ULONG Busy; + PVOID LastLock; + KEVENT Lock; + KEVENT Event; + PIO_COMPLETION_CONTEXT CompletionContext; +} FILE_OBJECT, *PFILE_OBJECT; + + typedef struct _IRP { PMDL MdlAddress; @@ -212,13 +260,11 @@ typedef struct _IRP struct { KDEVICE_QUEUE_ENTRY DeviceQueueEntry; -// PETHREAD Thread; - PVOID Thread; + PETHREAD Thread; PCHAR AuxiliaryBuffer; LIST_ENTRY ListEntry; struct _IO_STACK_LOCATION* CurrentStackLocation; -// PFILE_OBJECT OriginalFileObject; - PVOID OriginalFileObject; + PFILE_OBJECT OriginalFileObject; } Overlay; KAPC Apc; ULONG CompletionKey; @@ -288,7 +334,7 @@ typedef NTSTATUS (*PFAST_IO_DISPATCH)(struct _DEVICE_OBJECT*, IRP*); /* * Dispatch routine type declaration */ -typedef NTSTATUS (*PDRIVER_STARTIO)(struct _DEVICE_OBJECT*, IRP*); +typedef VOID (*PDRIVER_STARTIO)(struct _DEVICE_OBJECT*, IRP*); /* * Dispatch routine type declaration @@ -326,14 +372,6 @@ typedef struct _DRIVER_OBJECT } DRIVER_OBJECT, *PDRIVER_OBJECT; - - -typedef struct _FILE_OBJECT -{ - PDEVICE_OBJECT DeviceObject; - PVOID FsContext; -} FILE_OBJECT, *PFILE_OBJECT; - typedef struct _CONFIGURATION_INFORMATION { ULONG DiskCount; @@ -355,20 +393,6 @@ typedef VOID (*PIO_DPC_ROUTINE)(PKDPC Dpc, typedef VOID (*PIO_TIMER_ROUTINE)(PDEVICE_OBJECT DeviceObject, PVOID Context); -#if PKEY_VALUE_FULL_INFORMATION_DEFINED -typedef NTSTATUS (*PIO_QUERY_DEVICE_ROUTINE)(PVOID Context, - PUNICODE_STRING PathName, - INTERFACE_TYPE BusType, - ULONG BusNumber, - PKEY_VALUE_FULL_INFORMATION* BusKey, - CONFIGURATION_TYPE ControllerType, - ULONG ControllerNumber, - PKEY_VALUE_FULL_INFORMATION* CtrlKey, - CONFIGURATION_TYPE PeripheralType, - ULONG PeripheralNumber, - PKEY_VALUE_FULL_INFORMATION* PrphKey); -#endif - #if WINDOWS_STRUCTS_DOESNT_ALREADY_DEFINE_THIS typedef struct _PARTITION_INFORMATION { @@ -390,4 +414,142 @@ typedef struct _DRIVER_LAYOUT_INFORMATION PARTITION_INFORMATION PartitionEntry[1]; } DRIVER_LAYOUT_INFORMATION, *PDRIVER_LAYOUT_INFORMATION; + + + + +typedef struct _IO_RESOURCE_DESCRIPTOR +{ + UCHAR Option; + UCHAR Type; + UCHAR SharedDisposition; + + /* + * Reserved for system use + */ + UCHAR Spare1; + + USHORT Flags; + + /* + * Reserved for system use + */ + UCHAR Spare2; + + union + { + struct + { + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; + } Port; + struct + { + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; + } Memory; + struct + { + ULONG MinimumVector; + ULONG MaximumVector; + } Interrupt; + struct + { + ULONG MinimumChannel; + ULONG MaximumChannel; + } Dma; + } u; +} IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR; + +typedef struct _IO_RESOURCE_LIST +{ + USHORT Version; + USHORT Revision; + ULONG Count; + IO_RESOURCE_DESCRIPTOR Descriptors[1]; +} IO_RESOURCE_LIST, *PIO_RESOURCE_LIST; + +typedef struct _IO_RESOURCES_REQUIREMENTS_LIST +{ + /* + * List size in bytes + */ + ULONG ListSize; + + /* + * System defined enum for the bus + */ + INTERFACE_TYPE InterfaceType; + + ULONG BusNumber; + ULONG SlotNumber; + ULONG Reserved[3]; + ULONG AlternativeLists; + IO_RESOURCE_LIST List[1]; +} IO_RESOURCES_REQUIREMENTS_LIST, *PIO_RESOURCE_REQUIREMENTS_LIST; + +typedef struct +{ + UCHAR Type; + UCHAR ShareDisposition; + USHORT Flags; + union + { + struct + { + PHYSICAL_ADDRESS Start; + ULONG Length; + } Port; + struct + { + ULONG Level; + ULONG Vector; + ULONG Affinity; + } Interrupt; + struct + { + PHYSICAL_ADDRESS Start; + ULONG Length; + } Memory; + struct + { + ULONG Channel; + ULONG Port; + ULONG Reserved1; + } Dma; + struct + { + ULONG DataSize; + ULONG Reserved1; + ULONG Reserved2; + } DeviceSpecificData; + } u; +} CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR; + +typedef struct +{ + USHORT Version; + USHORT Revision; + ULONG Count; + CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; +} CM_PARTIAL_RESOURCE_LIST; + +typedef struct +{ + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; +} CM_FULL_RESOURCE_DESCRIPTOR; + +typedef struct +{ + ULONG Count; + CM_FULL_RESOURCE_DESCRIPTOR List[1]; +} CM_RESOURCE_LIST, *PCM_RESOURCE_LIST; + + #endif __INCLUDE_DDK_IOTYPES_H diff --git a/reactos/include/ddk/kefuncs.h b/reactos/include/ddk/kefuncs.h index bbc42d2f30b..a15a0f8f245 100644 --- a/reactos/include/ddk/kefuncs.h +++ b/reactos/include/ddk/kefuncs.h @@ -1,6 +1,17 @@ +#ifndef __INCLUDE_DDK_KEFUNCS_H +#define __INCLUDE_DDK_KEFUNCS_H + /* KERNEL FUNCTIONS ********************************************************/ +/* + * FUNCTION: Acquires a spinlock so the caller can synchronize access to + * data + * ARGUMENTS: + * SpinLock = Initialized spinlock + * OldIrql (OUT) = Set the previous irql on return + */ VOID KeAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL OldIrql); + VOID KeAcquireSpinLockAtDpcLevel(PKSPIN_LOCK SpinLock); BOOLEAN KeCancelTimer(PKTIMER Timer); VOID KeClearEvent(PKEVENT Event); @@ -14,6 +25,7 @@ VOID KeFlushIoBuffers(PMDL Mdl, BOOLEAN ReadOperation, BOOLEAN DmaOperation); KIRQL KeGetCurrentIrql(VOID); ULONG KeGetCurrentProcessorNumber(VOID); ULONG KeGetDcacheFillSize(VOID); +PKTHREAD KeGetCurrentThread(VOID); VOID KeInitializeCallbackRecord(PKBUGCHECK_CALLBACK_RECORD CallbackRecord); VOID KeInitializeDeviceQueue(PKDEVICE_QUEUE DeviceQueue); VOID KeInitializeDpc(PKDPC Dpc, PKDEFERRED_ROUTINE DeferredRoutine, @@ -122,3 +134,5 @@ VOID KeBugCheckEx(ULONG BugCheckCode, * RETURNS: Doesn't */ VOID KeBugCheck(ULONG BugCheckCode); + +#endif /* __INCLUDE_DDK_KEFUNCS_H */ diff --git a/reactos/include/ddk/ketypes.h b/reactos/include/ddk/ketypes.h index 32f5348a1e1..23b1744a086 100644 --- a/reactos/include/ddk/ketypes.h +++ b/reactos/include/ddk/ketypes.h @@ -1,63 +1,154 @@ +/* KERNEL TYPES **************************************************************/ + +#ifndef __INCLUDE_DDK_KETYPES_H +#define __INCLUDE_DDK_KETYPES_H + typedef LONG KPRIORITY; typedef VOID (*PKBUGCHECK_CALLBACK_ROUTINE)(PVOID Buffer, ULONG Length); typedef BOOLEAN (*PKSYNCHRONIZE_ROUTINE)(PVOID SynchronizeContext); - -typedef struct -{ -} KBUGCHECK_CALLBACK_RECORD, *PKBUGCHECK_CALLBACK_RECORD; - -typedef struct -{ -} KMUTEX, *PKMUTEX; - -typedef struct -{ -} KSEMAPHORE, *PKSEMAPHORE; + +struct _KAPC; + +typedef VOID (*PKNORMAL_ROUTINE)(PVOID NormalContext, + PVOID SystemArgument1, + PVOID SystemArgument2); +typedef VOID (*PKKERNEL_ROUTINE)(struct _KAPC* Apc, + PKNORMAL_ROUTINE* NormalRoutine, + PVOID* NormalContext, + PVOID* SystemArgument1, + PVOID* SystemArgument2); + +typedef VOID (*PKRUNDOWN_ROUTINE)(struct _KAPC* Apc); typedef struct +/* + * PURPOSE: Object describing the wait a thread is currently performing + */ { -} KTHREAD, *PKTHREAD; + LIST_ENTRY WaitListEntry; + struct _KTHREAD* Thread; + PVOID Object; + struct _KWAIT_BLOCK* NextWaitBlock; + USHORT WaitKey; + USHORT WaitType; +} KWAIT_BLOCK, *PKWAIT_BLOCK; + +typedef struct _ETHREAD /* - * PURPOSE: Included in every object that a thread can wait on + * PURPOSE: Describes a thread of execution */ -typedef struct { + CSHORT Type; + CSHORT Size; + /* - * PURPOSE: True if the object is signaling a change of state + * PURPOSE: Head of the queue of apcs */ - BOOLEAN signaled; + LIST_ENTRY apc_queue_head; + + /* + * PURPOSE: Entry in the linked list of threads + */ + LIST_ENTRY Entry; /* - * PURPOSE: Head of the queue of threads waiting on this object + * PURPOSE: Current state of the thread */ - LIST_ENTRY wait_queue_head; + ULONG State; /* - * PURPOSE: True if all the threads waiting should be woken when the - * object changes state + * PURPOSE: Priority modifier of the thread */ - BOOLEAN wake_all; + ULONG Priority; -} DISPATCHER_HEADER, *PDISPATCHER_HEADER; + /* + * PURPOSE: Pointer to our process + */ + struct _EPROCESS* Process; + + /* + * PURPOSE: Handle of our process + */ + HANDLE ProcessHandle; + + /* + * PURPOSE: Thread affinity mask + */ + ULONG AffinityMask; + + /* + * PURPOSE: Saved thread context + */ + hal_thread_state context; + +} KTHREAD, *PKTHREAD, *PETHREAD; + +typedef struct _DISPATCHER_HEADER +{ + UCHAR Type; + UCHAR Absolute; + UCHAR Size; + UCHAR Inserted; + LONG SignalState; + LIST_ENTRY WaitListHead; +} DISPATCHER_HEADER; + +typedef struct _KAPC +{ + CSHORT Type; + CSHORT Size; + ULONG Spare0; + struct _KTHREAD* Thread; + LIST_ENTRY ApcListEntry; + PKKERNEL_ROUTINE KernelRoutine; + PKRUNDOWN_ROUTINE RundownRoutine; + PKNORMAL_ROUTINE NormalRoutine; + PVOID NormalContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + CCHAR ApcStateIndex; + KPROCESSOR_MODE ApcMode; + BOOLEAN Inserted; +} KAPC, *PKAPC; +typedef struct +{ + LIST_ENTRY Entry; + PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine; + PVOID Buffer; + ULONG Length; + PUCHAR Component; + ULONG Checksum; + UCHAR State; +} KBUGCHECK_CALLBACK_RECORD, *PKBUGCHECK_CALLBACK_RECORD; + +typedef struct +{ + DISPATCHER_HEADER Header; + LIST_ENTRY MutantListEntry; + struct _KTHREAD* OwnerThread; + BOOLEAN Abandoned; + UCHAR ApcDisable; +} KMUTEX, *PKMUTEX; + +typedef struct +{ + DISPATCHER_HEADER Header; + LONG Limit; +} KSEMAPHORE, *PKSEMAPHORE; +typedef struct _KEVENT /* * PURPOSE: Describes an event */ -typedef struct _KEVENT { /* * PURPOSE: So we can use the general wait routine */ - DISPATCHER_HEADER hdr; - - /* - * PURPOSE: Type of event, notification or synchronization - */ - EVENT_TYPE type; + DISPATCHER_HEADER Header; } KEVENT, *PKEVENT; @@ -66,14 +157,6 @@ typedef struct _KSPIN_LOCK KIRQL irql; } KSPIN_LOCK, *PKSPIN_LOCK; -typedef struct -{ -} KAPC; - -typedef struct -{ -} UNICODE_STRING; - typedef VOID (*PDRIVER_ADD_DEVICE)(VOID); struct _KDPC; @@ -139,3 +222,63 @@ typedef struct _KDEVICE_QUEUE_ENTRY typedef struct _WAIT_CONTEXT_BLOCK { } WAIT_CONTEXT_BLOCK, *PWAIT_CONTEXT_BLOCK; + + +typedef struct _KTIMER +{ + /* + * Pointers to maintain the linked list of activated timers + */ + LIST_ENTRY entry; + + /* + * Absolute expiration time in system time units + */ + unsigned long long expire_time; + + /* + * Optional dpc associated with the timer + */ + PKDPC dpc; + + /* + * True if the timer is signaled + */ + BOOLEAN signaled; + + /* + * True if the timer is in the system timer queue + */ + BOOLEAN running; + + /* + * Type of the timer either Notification or Synchronization + */ + TIMER_TYPE type; + + /* + * Period of the timer in milliseconds (zero if once-only) + */ + ULONG period; + +} KTIMER, *PKTIMER; + +struct _KINTERRUPT; + +typedef BOOLEAN (*PKSERVICE_ROUTINE)(struct _KINTERRUPT* Interrupt, + PVOID ServiceContext); + +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; + +#endif /* __INCLUDE_DDK_KETYPES_H */ diff --git a/reactos/include/ddk/mmfuncs.h b/reactos/include/ddk/mmfuncs.h index 4c0b8fce3d9..248d1e9df27 100644 --- a/reactos/include/ddk/mmfuncs.h +++ b/reactos/include/ddk/mmfuncs.h @@ -152,7 +152,7 @@ PVOID MmGetSystemAddressForMdl(PMDL Mdl); * BaseVa = Base virtual address of the buffer * Length = Length in bytes of the buffer */ -VOID MmInitalizeMdl(PMDL MemoryDescriptorList, PVOID BaseVa, ULONG Length); +VOID MmInitializeMdl(PMDL MemoryDescriptorList, PVOID BaseVa, ULONG Length); /* * FUNCTION: Checks whether an address is valid for read/write diff --git a/reactos/include/ddk/mmtypes.h b/reactos/include/ddk/mmtypes.h index bf3cd42251a..351d71aeac8 100644 --- a/reactos/include/ddk/mmtypes.h +++ b/reactos/include/ddk/mmtypes.h @@ -1,24 +1,14 @@ -typedef struct _MDL + typedef struct _MDL /* * PURPOSE: Describes a user buffer passed to a system API */ { - /* - * Base address of the buffer in user mode - */ - PVOID Base; - - /* - * Length of the buffer in bytes - */ - ULONG Length; - - /* - * System address of buffer or NULL if not mapped - */ - PVOID SysBase; - - /* - * Below this is a variable length list of page physical address - */ + struct _MDL* Next; + CSHORT Size; + CSHORT MdlFlags; + struct _EPROCESS* Process; + PVOID MappedSystemVa; + PVOID StartVa; + ULONG ByteCount; + ULONG ByteOffset; } MDL, *PMDL; diff --git a/reactos/include/ddk/ntddk.h b/reactos/include/ddk/ntddk.h index dcd5805717a..bfb5255d9dd 100644 --- a/reactos/include/ddk/ntddk.h +++ b/reactos/include/ddk/ntddk.h @@ -1,41 +1,75 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: include/ddk/ntddk.h - * PURPOSE: Interface definitions for drivers - * PROGRAMMER: David Welch (welch@mcmail.com) - * UPDATE HISTORY: - * 15/05/98: Created - */ - -#ifndef __NTDDK_H -#define __NTDDK_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* INCLUDES ***************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -}; -#endif - -#endif /* __NTDDK_H */ - +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/ddk/ntddk.h + * PURPOSE: Interface definitions for drivers + * PROGRAMMER: David Welch (welch@mcmail.com) + * UPDATE HISTORY: + * 15/05/98: Created + */ + +#ifndef __NTDDK_H +#define __NTDDK_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* INCLUDES ***************************************************************/ + +#include + +#define NT_SUCCESS(StatCode) ((NTSTATUS)(StatCode) >= 0) +#define NTKERNELAPI + + #define CTL_CODE(Dev, Func, Meth, Acc) ( ((Dev)<<16) | ((Acc)<<14) | ((Func)<<2) | (Meth)) + +// IOCTL Parameter buffering methods +#define METHOD_BUFFERED 0 +#define METHOD_IN_DIRECT 1 +#define METHOD_OUT_DIRECT 2 +#define METHOD_NEITHER 3 + +// IOCTL File access type +#define FILE_ANY_ACCESS 0 +#define FILE_READ_ACCESS 1 +#define FILE_WRITE_ACCESS 2 + +#define QUAD_PART(LI) (*(LONGLONG *)(&LI)) + +enum { + STATUS_NOT_SUPPORTED = 9999, + STATUS_DISK_OPERATION_FAILED +}; + +#define IO_DISK_INCREMENT 4 + +#define FILE_WORD_ALIGNMENT 0x0001 + +#define FILE_OPENED 0x0001 + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +ULONG DbgPrint(PCH Format,...); + +#ifdef __cplusplus +}; +#endif + +#endif /* __NTDDK_H */ + diff --git a/reactos/include/ddk/obtypes.h b/reactos/include/ddk/obtypes.h index 41f5baeae08..12c8c1eb6e2 100644 --- a/reactos/include/ddk/obtypes.h +++ b/reactos/include/ddk/obtypes.h @@ -12,7 +12,7 @@ typedef struct _OBJECT_TYPE /* * PURPOSE: Name of the type */ - LPCSTR TypeName; + UNICODE_STRING TypeName; /* * PURPOSE: Total number of objects of this type @@ -96,7 +96,7 @@ typedef struct _OBJECT /* * PURPOSE: Name of this entry */ - LPCSTR name; + UNICODE_STRING name; /* * PURPOSE: Our entry in our parents list of subdirectory @@ -139,11 +139,11 @@ typedef struct _OBJECT_ATTRIBUTES */ ULONG Attributes; - //SECURITY_DESCRIPTOR SecurityDescriptor - //SecurityQualityOfService + SECURITY_DESCRIPTOR SecurityDescriptor; +// SecurityQualityOfService struct _DIRECTORY_OBJECT* parent; - char* name; - char* path; + UNICODE_STRING name; + UNICODE_STRING path; } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; diff --git a/reactos/include/ddk/psfuncs.h b/reactos/include/ddk/psfuncs.h index cbbb9dbba92..5f2eb0b5651 100644 --- a/reactos/include/ddk/psfuncs.h +++ b/reactos/include/ddk/psfuncs.h @@ -25,3 +25,8 @@ NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, PCLIENT_ID ClientId, PKSTART_ROUTINE StartRoutine, PVOID StartContext); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +NTSTATUS PsSuspendThread(VOID); +NTSTATUS PsWakeThread(PETHREAD Thread); +PETHREAD PsGetCurrentThread(VOID); +PEPROCESS PsGetCurrentProcess(VOID); diff --git a/reactos/include/ddk/pstypes.h b/reactos/include/ddk/pstypes.h index e7fdeb4be09..b7aaf1e6cfd 100644 --- a/reactos/include/ddk/pstypes.h +++ b/reactos/include/ddk/pstypes.h @@ -3,6 +3,8 @@ #include +typedef ULONG THREADINFOCLASS; + typedef struct _CLIENT_ID { HANDLE UniqueProcess; @@ -60,10 +62,7 @@ typedef struct _NT_PEB WORD wMinorVersion; WORD wBuildNumber; WORD wPlatformId; -} NT_PEB; - -typedef NT_PEB *PPEB; - +} NT_PEB, *PPEB; typedef struct _NT_TIB { @@ -104,8 +103,58 @@ typedef struct _EPROCESS { } EPROCESS, *PEPROCESS; +//typedef KTHREAD ETHREAD, *PETHREAD; + +#if ETHREAD_NOT_THE_SAME_AS_KTHREAD typedef struct _ETHREAD { + EPROCESS* Process; } ETHREAD, *PETHREAD; +/* + * PURPOSE: Thread object + */ +typedef struct +{ + CSHORT Type; + CSHORT Size; + + /* + * PURPOSE: Entry in the linked list of threads + */ + LIST_ENTRY Entry; + + /* + * PURPOSE: Current state of the thread + */ + ULONG State; + + /* + * PURPOSE: Priority modifier of the thread + */ + ULONG Priority; + + /* + * PURPOSE: Pointer to our parent process + */ +// PEPROCESS Parent; + + /* + * PURPOSE: Handle of our parent process + */ + HANDLE ParentHandle; + + /* + * PURPOSE: Not currently used + */ + ULONG AffinityMask; + + /* + * PURPOSE: Saved thread context + */ + hal_thread_state context; + +} THREAD_OBJECT, *PTHREAD_OBJECT; +#endif + #endif /* __INCLUDE_DDK_PSTYPES_H */ diff --git a/reactos/include/ddk/rtl.h b/reactos/include/ddk/rtl.h index f4ad7716d1d..d7e708f33c6 100644 --- a/reactos/include/ddk/rtl.h +++ b/reactos/include/ddk/rtl.h @@ -5,6 +5,52 @@ #ifndef __DDK_RTL_H #define __DDK_RTL_H +typedef struct _CONTROLLER_OBJECT +{ + CSHORT Type; + CSHORT Size; + PVOID ControllerExtension; + KDEVICE_QUEUE DeviceWaitQueue; + ULONG Spare1; + LARGE_INTEGER Spare2; +} CONTROLLER_OBJECT, *PCONTROLLER_OBJECT; + +typedef struct _STRING +{ + /* + * Length in bytes of the string stored in buffer + */ + USHORT Length; + + /* + * Maximum length of the string + */ + USHORT MaximumLength; + + /* + * String + */ + PCHAR Buffer; +} STRING, *PSTRING; + +typedef struct _ANSI_STRING +{ + /* + * Length in bytes of the string stored in buffer + */ + USHORT Length; + + /* + * Maximum length of the string + */ + USHORT MaximumLength; + + /* + * String + */ + PCHAR Buffer; +} ANSI_STRING, *PANSI_STRING; + typedef struct _TIME_FIELDS { CSHORT Year; @@ -179,6 +225,43 @@ VOID RtlStoreLong(PULONG Address, ULONG Value); VOID RtlStoreUshort(PUSHORT Address, USHORT Value); BOOLEAN RtlTimeFieldsToTime(PTIME_FIELDS TimeFields, PLARGE_INTEGER Time); VOID RtlTimeToTimeFields(PLARGE_INTEGER Time, PTIME_FIELDS TimeFields); +PWSTR RtlStrtok(PUNICODE_STRING _string, PWSTR _sep, PWSTR* temp); + + +typedef struct { + ULONG Length; + ULONG Unknown[11]; +} RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION; + +// Heap creation routine + +HANDLE +STDCALL +RtlCreateHeap( + ULONG Flags, + PVOID BaseAddress, + ULONG SizeToReserve, + ULONG SizeToCommit, + PVOID Unknown, + PRTL_HEAP_DEFINITION Definition + ); + +PVOID +STDCALL +RtlAllocateHeap( + HANDLE Heap, + ULONG Flags, + ULONG Size + ); + + +BOOLEAN +STDCALL +RtlFreeHeap( + HANDLE Heap, + ULONG Flags, + PVOID Address + ); #endif /* __DDK_RTL_H */ diff --git a/reactos/include/ddk/structs.h b/reactos/include/ddk/structs.h index 6ea04d0a791..694bb21d930 100644 --- a/reactos/include/ddk/structs.h +++ b/reactos/include/ddk/structs.h @@ -1,318 +1,14 @@ -/* SYSTEM STRUCTURES ******************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * PURPOSE: Thread object - */ -typedef struct -{ - CSHORT Type; - CSHORT Size; - - /* - * PURPOSE: Entry in the linked list of threads - */ - LIST_ENTRY Entry; - - /* - * PURPOSE: Current state of the thread - */ - ULONG State; - - /* - * PURPOSE: Priority modifier of the thread - */ - ULONG Priority; - - /* - * PURPOSE: Pointer to our parent process - */ -// PEPROCESS Parent; - - /* - * PURPOSE: Handle of our parent process - */ - HANDLE ParentHandle; - - /* - * PURPOSE: Not currently used - */ - ULONG AffinityMask; - - /* - * PURPOSE: Saved thread context - */ - hal_thread_state context; - -} THREAD_OBJECT, *PTHREAD_OBJECT; - - - -/* - * PURPOSE: Object describing the wait a thread is currently performing - */ -typedef struct -{ - /* - * PURPOSE: Pointer to the waiting thread - */ - PTHREAD_OBJECT thread; - - /* - * PURPOSE: Entry in the wait queue for the object being waited on - */ - LIST_ENTRY Entry; - - /* - * PURPOSE: Pointer to the object being waited on - */ - DISPATCHER_HEADER* wait_object; - -} KWAIT_BLOCK, *PKWAIT_BLOCK; - -typedef struct _ADAPTER_OBJECT -{ -} ADAPTER_OBJECT, *PADAPTER_OBJECT; - -typedef struct _CONTROLLER_OBJECT -{ - PVOID ControllerExtension; -} CONTROLLER_OBJECT, *PCONTROLLER_OBJECT; - -typedef struct _STRING -{ - /* - * Length in bytes of the string stored in buffer - */ - USHORT Length; - - /* - * Maximum length of the string - */ - USHORT MaximumLength; - - /* - * String - */ - PCHAR Buffer; -} STRING, *PSTRING; - -typedef struct _ANSI_STRING -{ - /* - * Length in bytes of the string stored in buffer - */ - USHORT Length; - - /* - * Maximum length of the string - */ - USHORT MaximumLength; - - /* - * String - */ - PCHAR Buffer; -} ANSI_STRING, *PANSI_STRING; - -typedef struct _KTIMER -{ - /* - * Pointers to maintain the linked list of activated timers - */ - LIST_ENTRY entry; - - /* - * Absolute expiration time in system time units - */ - unsigned long long expire_time; - - /* - * Optional dpc associated with the timer - */ - PKDPC dpc; - - /* - * True if the timer is signaled - */ - BOOLEAN signaled; - - /* - * True if the timer is in the system timer queue - */ - BOOLEAN running; - - /* - * Type of the timer either Notification or Synchronization - */ - TIMER_TYPE type; - - /* - * Period of the timer in milliseconds (zero if once-only) - */ - ULONG period; - -} KTIMER, *PKTIMER; - - - - -typedef struct _IO_RESOURCE_DESCRIPTOR -{ - UCHAR Option; - UCHAR Type; - UCHAR SharedDisposition; - - /* - * Reserved for system use - */ - UCHAR Spare1; - - USHORT Flags; - - /* - * Reserved for system use - */ - UCHAR Spare2; - - union - { - struct - { - ULONG Length; - ULONG Alignment; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Port; - struct - { - ULONG Length; - ULONG Alignment; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Memory; - struct - { - ULONG MinimumVector; - ULONG MaximumVector; - } Interrupt; - struct - { - ULONG MinimumChannel; - ULONG MaximumChannel; - } Dma; - } u; -} IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR; - -typedef struct _IO_RESOURCE_LIST -{ - USHORT Version; - USHORT Revision; - ULONG Count; - IO_RESOURCE_DESCRIPTOR Descriptors[1]; -} IO_RESOURCE_LIST, *PIO_RESOURCE_LIST; - -typedef struct _IO_RESOURCES_REQUIREMENTS_LIST -{ - /* - * List size in bytes - */ - ULONG ListSize; - - /* - * System defined enum for the bus - */ - INTERFACE_TYPE InterfaceType; - - ULONG BusNumber; - ULONG SlotNumber; - ULONG Reserved[3]; - ULONG AlternativeLists; - IO_RESOURCE_LIST List[1]; -} IO_RESOURCES_REQUIREMENTS_LIST, *PIO_RESOURCE_REQUIREMENTS_LIST; - -typedef struct -{ - UCHAR Type; - UCHAR ShareDisposition; - USHORT Flags; - union - { - struct - { - PHYSICAL_ADDRESS Start; - ULONG Length; - } Port; - struct - { - ULONG Level; - ULONG Vector; - ULONG Affinity; - } Interrupt; - struct - { - PHYSICAL_ADDRESS Start; - ULONG Length; - } Memory; - struct - { - ULONG Channel; - ULONG Port; - ULONG Reserved1; - } Dma; - struct - { - ULONG DataSize; - ULONG Reserved1; - ULONG Reserved2; - } DeviceSpecificData; - } u; -} CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR; - -typedef struct -{ - USHORT Version; - USHORT Revision; - ULONG Count; - CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; -} CM_PARTIAL_RESOURCE_LIST; - -typedef struct -{ - INTERFACE_TYPE InterfaceType; - ULONG BusNumber; - CM_PARTIAL_RESOURCE_LIST PartialResourceList; -} CM_FULL_RESOURCE_DESCRIPTOR; - -typedef struct -{ - ULONG Count; - CM_FULL_RESOURCE_DESCRIPTOR List[1]; -} CM_RESOURCE_LIST, *PCM_RESOURCE_LIST; - -struct _KINTERRUPT; - -typedef BOOLEAN (*PKSERVICE_ROUTINE)(struct _KINTERRUPT* Interrupt, - PVOID ServiceContext); - -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; - +/* SYSTEM STRUCTURES ******************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct _ADAPTER_OBJECT +{ +} ADAPTER_OBJECT, *PADAPTER_OBJECT; diff --git a/reactos/include/ddk/types.h b/reactos/include/ddk/types.h index f7b4524d95e..d4d69e1c5f9 100644 --- a/reactos/include/ddk/types.h +++ b/reactos/include/ddk/types.h @@ -6,12 +6,9 @@ typedef const int CINT; -typedef ULONG KAFFINITY; -typedef KAFFINITY *PKAFFINITY; +typedef ULONG KAFFINITY, *PKAFFINITY; -//typedef LONG KPRIORITY; - -typedef LONG NTSTATUS; +typedef LONG NTSTATUS, *PNTSTATUS; typedef ULONG DEVICE_TYPE; @@ -35,20 +32,12 @@ typedef unsigned long long ULONGLONG; */ //typedef LONG NTSTATUS; -/* - * Unicode string type - * FIXME: Real unicode please - */ -typedef char* PUNICODE_STRING; - -#if REAL_UNICODE typedef struct _UNICODE_STRING { USHORT Length; USHORT MaximumLength; PWSTR Buffer; } UNICODE_STRING, *PUNICODE_STRING; -#endif typedef enum _SECTION_INHERIT { ViewShare = 1, @@ -58,12 +47,10 @@ typedef enum _SECTION_INHERIT { /* * Various other types (all quite pointless) */ -//typedef ULONG DEVICE_TYPE; typedef ULONG KPROCESSOR_MODE; -typedef ULONG KIRQL; +typedef UCHAR KIRQL; typedef KIRQL* PKIRQL; typedef ULONG IO_ALLOCATION_ACTION; -//typedef ULONG INTERFACE_TYPE; typedef ULONG POOL_TYPE; typedef ULONG TIMER_TYPE; typedef ULONG MM_SYSTEM_SIZE; @@ -71,15 +58,10 @@ typedef ULONG LOCK_OPERATION; typedef ULONG KEY_INFORMATION_CLASS; typedef ULONG FILE_INFORMATION_CLASS; typedef ULONG KEY_VALUE_INFORMATION_CLASS; -//typedef ULONG SECTION_INHERIT; -typedef ULONG EVENT_TYPE; -//typedef ULONG KAFFINITY; -//typedef KAFFINITY* PKAFFINITY; typedef ULONG PHYSICAL_ADDRESS; typedef PHYSICAL_ADDRESS* PPHYSICAL_ADDRESS; typedef ULONG WAIT_TYPE; -typedef ULONG KWAIT_REASON; -typedef ULONG KINTERRUPT_MODE; +//typedef ULONG KINTERRUPT_MODE; typedef USHORT CSHORT; #endif diff --git a/reactos/include/ddk/zw.h b/reactos/include/ddk/zw.h index ad6265da3cd..1ab26a6a7f2 100644 --- a/reactos/include/ddk/zw.h +++ b/reactos/include/ddk/zw.h @@ -1,1537 +1,3478 @@ -/* - * 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 Boudewijn Dekker - * 13/07/98: Reorganised things a bit (David Welch) - */ - -#ifndef __DDK_ZW_H -#define __DDK_ZW_H - -#include - -/* - * FUNCTION: Closes an object handle - * ARGUMENTS: - * Handle = Handle to the object - * RETURNS: Status - */ -NTSTATUS ZwClose(HANDLE Handle); - -/* - * FUNCTION: Creates or opens a directory object, which is a container for - * other objects - * ARGUMENTS: - * DirectoryHandle (OUT) = Points to a variable which stores the - * handle for the directory on success - * DesiredAccess = Type of access the caller requires to the directory - * ObjectAttributes = Structures specifing the object attributes, - * initialized with InitializeObjectAttributes - * RETURNS: Status - */ -NTSTATUS ZwCreateDirectoryObject(PHANDLE DirectoryHandle, - ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes); - -/* - * FUNCTION: Creates or opens a registry key - * ARGUMENTS: - * KeyHandle (OUT) = Points to a variable which stores the handle - * for the key on success - * DesiredAccess = Access desired by the caller to the key - * ObjectAttributes = Initialized object attributes for the key - * TitleIndex = Who knows? - * Class = Object class of the key? - * CreateOptions = Options for the key creation - * Disposition (OUT) = Points to a variable which a status value - * indicating whether a new key was created - * RETURNS: Status - */ -NTSTATUS ZwCreateKey(PHANDLE KeyHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes, - ULONG TitleIndex, PUNICODE_STRING Class, - ULONG CreateOptions, PULONG Disposition); - -/* - * FUNCTION: Deletes a registry key - * ARGUMENTS: - * KeyHandle = Handle of the key - * RETURNS: Status - */ -NTSTATUS ZwDeleteKey(HANDLE KeyHandle); - -/* - * 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 ZwEnumerateKey(HANDLE KeyHandle, ULONG Index, - KEY_INFORMATION_CLASS KeyInformationClass, - PVOID KeyInformation, ULONG Length, - 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 ZwEnumerateValueKey(HANDLE KeyHandle, ULONG Index, - KEY_VALUE_INFORMATION_CLASS KeyInformationClass, - PVOID KeyInformation, ULONG Length, - PULONG ResultLength); - - -/* - * FUNCTION: Forces a registry key to be committed to disk - * ARGUMENTS: - * KeyHandle = Handle of the key to be written to disk - * RETURNS: Status - */ -NTSTATUS ZwFlushKey(HANDLE KeyHandle); - -/* - * FUNCTION: Changes the attributes of an object to temporary - * ARGUMENTS: - * Handle = Handle for the object - * RETURNS: Status - */ -NTSTATUS ZwMakeTemporaryObject(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 ZwMapViewOfSection(HANDLE SectionHandle, - HANDLE ProcessHandle, - PVOID* BaseAddress, - ULONG ZeroBits, - ULONG CommitSize, - PLARGE_INTEGER SectionOffset, - PULONG ViewSize, - SECTION_INHERIT InheritDisposition, - ULONG AllocationType, - ULONG Protect); - -/* - * FUNCTION: Opens an existing key in the registry - * 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 ZwOpenKey(PHANDLE KeyHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes); - -/* - * 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 ZwOpenSection(PHANDLE KeyHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes); - -/* - * FUNCTION: Returns information about an open file - * ARGUMENTS: - * FileHandle = Handle of the file to be queried - * IoStatusBlock (OUT) = Caller supplied storage for the result - * FileInformation (OUT) = Caller supplied storage for the file - * information - * Length = Length in bytes of the buffer for file information - * FileInformationClass = Type of information to be returned - * RETURNS: Status - */ -NTSTATUS ZwQueryInformationFile(HANDLE FileHandle, - PIO_STATUS_BLOCK IoStatusBlock, - PVOID FileInformation, - ULONG Length, - FILE_INFORMATION_CLASS FileInformationClass); - -#ifndef _NTNATIVE -#define _NTNATIVE - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include - -#if KERNEL_SUPPORTS_OBJECT_ATTRIBUTES_CORRECTLY -typedef struct _OBJECT_ATTRIBUTES { - ULONG Length; - HANDLE RootDirectory; - PUNICODE_STRING ObjectName; - ULONG Attributes; - SECURITY_DESCRIPTOR *SecurityDescriptor; - SECURITY_QUALITY_OF_SERVICE *SecurityQualityOfService; -} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; -#endif - -#if IOTYPES_DIDNT_DECLARE_THIS -typedef struct _IO_STATUS_BLOCK { - NTSTATUS Status; - ULONG Information; -} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; -#endif - - -//typedef LARGE_INTEGER *PLARGE_INTEGER; - -// - -#define NtCurrentProcess() ( (HANDLE) 0xFFFFFFFF ) -#define NtCurrentThread() ( (HANDLE) 0xFFFFFFFE ) - - - -// event access mask - -#define EVENT_READ_ACCESS 0x0001 -#define EVENT_WRITE_ACCESS 0x0002 - - -//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 MaxProcessInfoClass 22 - -// 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 MaxThreadInfoClass 15 - - -// key query information class - -#define KeyBasicInformation 0 -#define KeyNodeInformation 1 -#define KeyFullInformation 2 - - -// key set information class - -#define KeyWriteTimeInformation 0 - -// key value information class - -#define KeyValueBasicInformation 0 -#define KeyValueFullInformation 1 -#define KeyValuePartialInformation 2 - -// object handle information - -#define HandleBasicInformation 4 - -// system information - -#define SystemTimeAdjustmentInformation 28 - - -// file information - - -#define FileDirectoryInformation 1 -#define FileFullDirectoryInformation 2 -#define FileBothDirectoryInformation 3 -#define FileBasicInformation 4 -#define FileStandardInformation 5 -#define FileInternalInformation 6 -#define FileEaInformation 7 -#define FileAccessInformation 8 -#define FileNameInformation 9 -#define FileRenameInformation 10 -#define FileLinkInformation 11 -#define FileNamesInformation 12 -#define FileDispositionInformation 13 -#define FilePositionInformation 14 -#define FileFullEaInformation 15 -#define FileModeInformation 16 -#define FileAlignmentInformation 17 -#define FileAllInformation 18 -#define FileAllocationInformation 19 -#define FileEndOfFileInformation 20 -#define FileAlternateNameInformation 21 -#define FileStreamInformation 22 -#define FilePipeInformation 23 -#define FilePipeLocalInformation 24 -#define FilePipeRemoteInformation 25 -#define FileMailslotQueryInformation 26 -#define FileMailslotSetInformation 27 -#define FileCompressionInformation 28 -#define FileCopyOnWriteInformation 29 -#define FileCompletionInformation 30 -#define FileMoveClusterInformation 31 -#define FileOleClassIdInformation 32 -#define FileOleStateBitsInformation 33 -#define FileNetworkOpenInformation 34 -#define FileObjectIdInformation 35 -#define FileOleAllInformation 36 -#define FileOleDirectoryInformation 37 -#define FileContentIndexInformation 38 -#define FileInheritContentIndexInformation 39 -#define FileOleInformation 40 -#define FileMaximumInformation 41 - - - -//file system information class values - - - -#define FileFsVolumeInformation 1 -#define FileFsLabelInformation 2 -#define FileFsSizeInformation 3 -#define FileFsDeviceInformation 4 -#define FileFsAttributeInformation 5 -#define FileFsControlInformation 6 -#define FileFsQuotaQueryInformation 7 -#define FileFsQuotaSetInformation 8 -#define FileFsMaximumInformation 9 - -// wait type - -#define WaitAll 0 -#define WaitAny 1 - - -// key restore flags - -#define REG_WHOLE_HIVE_VOLATILE (0x00000001L) -#define REG_REFRESH_HIVE (0x00000002L) - - -#define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\') - -// 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) - -typedef struct _PROCESS_WS_WATCH_INFORMATION { - PVOID FaultingPc; - PVOID FaultingVa; -} PROCESS_WS_WATCH_INFORMATION, *PPROCESS_WS_WATCH_INFORMATION; - -typedef struct _PROCESS_BASIC_INFORMATION { - NTSTATUS ExitStatus; - PPEB PebBaseAddress; - KAFFINITY AffinityMask; - KPRIORITY BasePriority; - ULONG UniqueProcessId; - ULONG InheritedFromUniqueProcessId; -} PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION; - -typedef struct _QUOTA_LIMITS { - ULONG PagedPoolLimit; - ULONG NonPagedPoolLimit; - ULONG MinimumWorkingSetSize; - ULONG MaximumWorkingSetSize; - ULONG PagefileLimit; - LARGE_INTEGER TimeLimit; -} QUOTA_LIMITS, *PQUOTA_LIMITS; - -typedef struct _IO_COUNTERS { - ULONG ReadOperationCount; - ULONG WriteOperationCount; - ULONG OtherOperationCount; - LARGE_INTEGER ReadTransferCount; - LARGE_INTEGER WriteTransferCount; - LARGE_INTEGER OtherTransferCount; -} IO_COUNTERS, *PIO_COUNTERS; - - -typedef struct _VM_COUNTERS { - ULONG PeakVirtualSize; - ULONG VirtualSize; - ULONG PageFaultCount; - ULONG PeakWorkingSetSize; - ULONG WorkingSetSize; - ULONG QuotaPeakPagedPoolUsage; - ULONG QuotaPagedPoolUsage; - ULONG QuotaPeakNonPagedPoolUsage; - ULONG QuotaNonPagedPoolUsage; - ULONG PagefileUsage; - ULONG PeakPagefileUsage; -} VM_COUNTERS, *PVM_COUNTERS; - - -typedef struct _POOLED_USAGE_AND_LIMITS { - ULONG PeakPagedPoolUsage; - ULONG PagedPoolUsage; - ULONG PagedPoolLimit; - ULONG PeakNonPagedPoolUsage; - ULONG NonPagedPoolUsage; - ULONG NonPagedPoolLimit; - ULONG PeakPagefileUsage; - ULONG PagefileUsage; - ULONG PagefileLimit; -} POOLED_USAGE_AND_LIMITS, *PPOOLED_USAGE_AND_LIMITS; - - -typedef struct _PROCESS_ACCESS_TOKEN { - HANDLE Token; - HANDLE Thread; - -} PROCESS_ACCESS_TOKEN, *PPROCESS_ACCESS_TOKEN; - -typedef struct _KERNEL_USER_TIMES { - LARGE_INTEGER CreateTime; - LARGE_INTEGER ExitTime; - LARGE_INTEGER KernelTime; - LARGE_INTEGER UserTime; -} KERNEL_USER_TIMES; -typedef KERNEL_USER_TIMES *PKERNEL_USER_TIMES; - -// exception structures - - -#define TEB_EXCEPTION_FRAME(pcontext) ((PEXCEPTION_FRAME)((TEB *)GET_SEL_BASE((pcontext)->SegFs))->except) - - -typedef struct _OBJECT_NAME_INFORMATION { - UNICODE_STRING Name; -} OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION; - - -// section information - - -// handle information - -//#define HANDLE_FLAG_INHERIT 0x00000001 -//#define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002 - - -typedef struct _HANDLE_INFO -{ - BOOL bInheritHanlde; - BOOL bProtectFromClose; -} HANDLE_INFO; -typedef HANDLE_INFO *PHANDLE_INFO; - - - -typedef struct _SYSTEM_TIME_ADJUSTMENT -{ - DWORD dwTimeAdjustment; - BOOL bTimeAdjustmentDisabled; -} SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT; - - -// file information - -// asynchorneous procedure call - - -typedef struct _FILE_BASIC_INFORMATION { - LARGE_INTEGER CreationTime; - LARGE_INTEGER LastAccessTime; - LARGE_INTEGER LastWriteTime; - LARGE_INTEGER ChangeTime; - ULONG FileAttributes; -} FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION; - -typedef struct _FILE_STANDARD_INFORMATION { - LARGE_INTEGER AllocationSize; - LARGE_INTEGER EndOfFile; - ULONG NumberOfLinks; - BOOLEAN DeletePending; - BOOLEAN Directory; -} FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION; - -typedef struct _FILE_POSITION_INFORMATION { - LARGE_INTEGER CurrentByteOffset; -} FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION; - -typedef struct _FILE_ALIGNMENT_INFORMATION { - ULONG AlignmentRequirement; -} FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION; - -typedef struct _FILE_DISPOSITION_INFORMATION { - BOOLEAN DeleteFile; -} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION; - -typedef struct _FILE_END_OF_FILE_INFORMATION { - LARGE_INTEGER EndOfFile; -} FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION; - - -typedef struct _FILE_FULL_EA_INFORMATION { - ULONG NextEntryOffset; - UCHAR Flags; - UCHAR EaNameLength; - USHORT EaValueLength; - CHAR EaName[1]; -} FILE_FULL_EA_INFORMATION; -typedef FILE_FULL_EA_INFORMATION *PFILE_FULL_EA_INFORMATION; - - - -// file system information structures - -typedef struct _FILE_FS_DEVICE_INFORMATION { - DEVICE_TYPE DeviceType; - ULONG Characteristics; -} FILE_FS_DEVICE_INFORMATION; -typedef FILE_FS_DEVICE_INFORMATION *PFILE_FS_DEVICE_INFORMATION; - - -// timer apc routine [ possible incompatible with ms winnt ] - -typedef -VOID -(*PTIMERAPCROUTINE) ( - PVOID Argument, - PVOID Context - ); - -// shutdown action [ possible incompatible with ms winnt ] -// this might be parameter to specify how to shutdown -typedef -VOID -(*SHUTDOWN_ACTION) ( - VOID - ); - - //NtAcceptConnectPort - //NtAccessCheck - //NtAccessCheckAndAuditAlarm - -NTSTATUS -STDCALL -NtAddAtom( - IN PUNICODE_STRING pString - ); - - //NtAdjustGroupsToken - //NtAdjustPrivilegesToken - //NtAlertResumeThread - //NtAlertThread - //NtAllocateLocallyUniqueId - //NtAllocateUuids - - -NTSTATUS -STDCALL -NtAllocateVirtualMemory( - IN HANDLE hProcess, - OUT LPVOID lpAddress, - IN ULONG uWillThingAbThis, - IN DWORD dwSize, - IN DWORD flAllocationType, - IN DWORD flProtect - ); - -// NtCallbackReturn -// NtCancelIoFile - -NTSTATUS -STDCALL -NtCancelTimer( - IN HANDLE TimerHandle, - IN BOOL Resume - ); - -NTSTATUS -STDCALL -NtClearEvent( - IN HANDLE EventHandle - ); - - -NTSTATUS -STDCALL -NtClose( - IN HANDLE Handle - ); - -// NtCloseObjectAuditAlarm -// NtCompleteConnectPort -// NtConnectPort - -NTSTATUS -STDCALL -NtContinue( - IN PCONTEXT Context - ); - -//NtCreateChannel - - -NTSTATUS -STDCALL -NtCreateDirectoryObject( - OUT PHANDLE DirectoryHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -NtCreateEvent( - OUT PHANDLE FileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN BOOL ManualReset, - IN BOOL InitialState - ); -//NtCreateEventPair - - -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 - ); - -// NtCreateIoCompletion - -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 - ); -// NtCreateMailslotFile -//-- NtCreateMutant -//-- NtCreateNamedPipeFile -//-- NtCreatePagingFile -//-- NtCreatePort - -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 - ); -// NtCreateProfile - -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 -NtCreateSemaphore( - OUT PHANDLE SemaphoreHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN ULONG InitialCount, - IN ULONG MaximumCount - ); -// NtCreateSymbolicLinkObject - -NTSTATUS -STDCALL -NtCreateThread( - OUT PHANDLE ThreadHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN HANDLE ProcessHandle, - IN PCLIENT_ID ClientId, - IN PCONTEXT ThreadContext, - IN PINITIAL_TEB InitialTeb, - IN BOOLEAN CreateSuspended - ); - -NTSTATUS -STDCALL -NtCreateTimer( - OUT PHANDLE TimerHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN LONG ManualReset - ); -//-- NtCreateToken - -NT_TEB -STDCALL -NtCurrentTeb( - VOID - ); - -NTSTATUS -STDCALL -NtDelayExecution( - IN BOOL Alertable, - IN PLARGE_INTEGER Interval - ); - - -NTSTATUS -STDCALL -NtDeleteAtom( - IN ATOM Atom - ); - - -NTSTATUS -STDCALL -NtDeleteFile( - IN HANDLE FileHandle - ); - - -NTSTATUS -STDCALL -NtDeleteKey( - IN HANDLE KeyHandle - ); -// NtDeleteObjectAuditAlarm -// NtDeleteValueKey -// NtDeviceIoControlFile - -NTSTATUS -STDCALL -NtDisplayString( - IN PUNICODE_STRING DisplayString - ); - -NTSTATUS -STDCALL -NtDuplicateObject( - IN HANDLE SourceProcessHandle, - IN PHANDLE SourceHandle, - IN HANDLE TargetProcessHandle, - OUT PHANDLE TargetHandle, - IN ULONG dwDesiredAccess, - IN ULONG InheritHandle - ); -// NtDuplicateToken - -NTSTATUS -STDCALL -NtEnumerateKey( - IN HANDLE KeyHandle, - IN ULONG Index, - IN CINT KeyInformationClass, - OUT PVOID KeyInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -NtEnumerateValueKey( - IN HANDLE KeyHandle, - IN ULONG Index, - IN CINT KeyValueInformationClass, - OUT PVOID KeyValueInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - //NtExtendSection - -ATOM -STDCALL -NtFindAtom( - IN PUNICODE_STRING AtomString - ); - -NTSTATUS -STDCALL -NtFlushBuffersFile( - IN HANDLE FileHandle - ); - -NTSTATUS -STDCALL -NtFlushInstructionCache( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN UINT Size - ); - -NTSTATUS -STDCALL -NtFlushKey( - IN HANDLE KeyHandle - ); - -/* - * FIXME: Is the return type correct? (David Welch) - */ -NTSTATUS -STDCALL -NtFlushVirtualMemory( - IN HANDLE ProcessHandle, - IN VOID *BaseAddress, - IN ULONG NumberOfBytesToFlush, - IN PULONG NumberOfBytesFlushed - ); - -VOID -STDCALL -NtFlushWriteBuffer ( - VOID - ); - -NTSTATUS -STDCALL -NtFreeVirtualMemory( - IN PHANDLE hProcess, - IN LPVOID lpAddress, // address of region of committed pages - IN DWORD dwSize, // size of region - IN DWORD dwFreeType - ); -//-- NtFsControlFile - -NTSTATUS -STDCALL -NtGetContextThread( - IN HANDLE ThreadHandle, - OUT PCONTEXT Context - ); -// NtGetPlugPlayEvent -// NtGetTickCount -// NtImpersonateClientOfPort -// NtImpersonateThread -// NtInitializeRegistry -// NtListenChannel -// NtListenPort - -NTSTATUS -STDCALL -NtLoadDriver( - IN PUNICODE_STRING DriverServiceName - ); - - //NtLoadKey2 - //NtLoadKey - //NtLockFile - //NtLockVirtualMemory - -NTSTATUS -STDCALL -NtMakeTemporaryObject( - OUT HANDLE Handle - ); - -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 Protect - ); - -// NtNotifyChangeDirectoryFile -// NtNotifyChangeKey -// NtOpenChannel - -NTSTATUS -STDCALL -NtOpenDirectoryObject( - OUT PHANDLE DirectoryHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -NtOpenEvent( - OUT PHANDLE EventHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -// NtOpenEventPair - -NTSTATUS -STDCALL -NtOpenFile( - OUT PHANDLE FileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG ShareAccess, - IN ULONG FileAttributes - ); -// NtOpenIoCompletion - -NTSTATUS -STDCALL -NtOpenKey( - OUT PHANDLE KeyHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -// NtOpenMutant -// NtOpenObjectAuditAlarm -NTSTATUS NtOpenProcess ( - OUT PHANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PCLIENT_ID ClientId - ); - -// NtOpenProcessToken - -NTSTATUS -STDCALL -NtOpenSection( - OUT PHANDLE SectionHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -// NtOpenSemaphore -NTSTATUS -STDCALL -NtOpenSymbolicLinkObject( - OUT PHANDLE SymbolicLinkHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -NtOpenThread( - OUT PHANDLE ThreadHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -//NtOpenThreadToken - -NTSTATUS -STDCALL -NtOpenTimer( - OUT PHANDLE TimerHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -// NtPlugPlayControl -// NtPrivilegeCheck -// NtPrivilegeObjectAuditAlarm -// NtPrivilegedServiceAuditAlarm -// NtProtectVirtualMemory - -NTSTATUS -STDCALL -NtPulseEvent( - IN HANDLE EventHandle, - IN BOOL Unknown OPTIONAL - ); -// NtQueryAttributesFile -// NtQueryDefaultLocale -// NtQueryDirectoryFile - -NTSTATUS -STDCALL -NtQueryDirectoryObject( - IN HANDLE DirectoryHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PLARGE_INTEGER AllocationSize OPTIONAL, - IN ULONG FileAttributes, - IN ULONG ShareAccess, - IN PVOID Buffer , - IN ULONG Length - ); - -NTSTATUS -STDCALL -NtQueryEaFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID EaBuffer , - IN ULONG EaLength, - ULONG Unknown1 , - ULONG Unknown2 , - ULONG Unknown3 , - ULONG Unknown4 , - IN CINT FileInformationClass - ); -//-- NtQueryEvent -//-- NtQueryFullAttributesFile -//-- NtQueryInformationAtom - -NTSTATUS -STDCALL -NtQueryInformationFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID FileInformation, - IN ULONG Length, - IN CINT FileInformationClass - ); -//NtQueryInformationPort - -/* -ProcessWorkingSetWatch PROCESS_WS_WATCH_INFORMATION -ProcessBasicInfo PROCESS_BASIC_INFORMATION -ProcessQuotaLimits QUOTA_LIMITS -ProcessPooledQuotaLimits QUOTA_LIMITS -ProcessIoCounters IO_COUNTERS -ProcessVmCounters VM_COUNTERS -ProcessPooledUsageAndLimits POOLED_USAGE_AND_LIMITS -ProcessTimes KERNEL_USER_TIMES -*/ - - - -NTSTATUS -STDCALL -NtQueryInformationProcess( - IN HANDLE ProcessHandle, - IN CINT ProcessInformationClass, - OUT PVOID ProcessInformation, - IN ULONG ProcessInformationLength, - OUT PULONG ReturnLength - ); - -/* -ThreadTimes KERNEL_USER_TIMES -*/ - -NTSTATUS -STDCALL -NtQueryInformationThread( - IN HANDLE ThreadHandle, - IN CINT ThreadInformationClass, - OUT PVOID ThreadInformation, - IN ULONG ThreadInformationLength, - OUT PULONG ReturnLength - ); -// NtQueryInformationToken -// NtQueryIntervalProfile -// NtQueryIoCompletion - -NTSTATUS -STDCALL -NtQueryKey( - IN HANDLE KeyHandle, - IN CINT KeyInformationClass, - OUT PVOID KeyInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); -//-- NtQueryMultipleValueKey -//-- NtQueryMutant - -NTSTATUS -STDCALL -NtQueryObject( - IN HANDLE ObjectHandle, - IN CINT HandleInformationClass, - OUT PHANDLE_INFO HandleInfo, - IN ULONG Length, - OUT PULONG ResultLength); - //NtQueryOleDirectoryFile - -NTSTATUS -STDCALL -NtQueryPerformanceCounter( - IN PULONG Count, - IN PULONG Frequency - ); - -// NtQuerySection -//-- NtQuerySecurityObject -//-- NtQuerySemaphore - -NTSTATUS -STDCALL -NtQuerySymbolicLinkObject( - IN HANDLE SymbolicLinkHandle, - OUT PUNICODE_STRING TargetName, /* target device name */ - IN PULONG Length - ); -//-- NtQuerySystemEnvironmentValue -NTSTATUS -STDCALL -NtQuerySystemInformation( - IN CINT SystemInformationClass, - OUT PVOID SystemInformation, - IN ULONG SystemInformationLength - ); - -NTSTATUS -STDCALL -NtQuerySystemTime ( - OUT PLARGE_INTEGER CurrentTime - ); -//-- NtQueryTimer -//-- NtQueryTimerResolution - -NTSTATUS -STDCALL -NtQueryValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName, - IN CINT KeyValueInformationClass, - OUT PVOID KeyValueInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); -//-- NtQueryVirtualMemory - -NTSTATUS -STDCALL -NtQueryVolumeInformationFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID VolumeInformation, - IN ULONG Length, - IN CINT FSInformationClass // dont know - ); -// NtQueueApcThread - -NTSTATUS -STDCALL -NtRaiseException( - IN PEXCEPTION_RECORD ExceptionRecord, - IN PCONTEXT CONTEXT, - IN BOOL bUnknown OPTIONAL - ); - -NTSTATUS -STDCALL -NtRaiseHardError( - IN OUT ULONG Unknown1, - IN OUT ULONG Unknown2, - IN OUT PVOID Unknow3, - IN OUT ULONG Unknow4, - IN PEXCEPTION_RECORD ExceptionRecord - ); - - -NTSTATUS -STDCALL -NtReadFile( - 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 Length, - IN PLARGE_INTEGER ByteOffset , - IN PULONG Key OPTIONAL - ); -NTSTATUS -NtReadFileScatter( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK UserIosb , - IN LARGE_INTEGER BufferDescription[], - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); - -//NtReadRequestData - -NTSTATUS -STDCALL -NtReadVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - OUT PVOID Buffer, - IN DWORD nSize, - OUT PDWORD lpNumberOfBytesRead - ); - //--NtRegisterThreadTerminatePort - //--NtReleaseMutant - -NTSTATUS -STDCALL -NtReleaseSemaphore( - IN HANDLE SemaphoreHandle, - IN ULONG ReleaseCount, - IN PULONG PreviousCount - ); - //NtRemoveIoCompletion - //NtReplaceKey - //NtReplyPort - //NtReplyWaitReceivePort - //NtReplyWaitReplyPort - //NtReplyWaitSendChannel - //NtRequestPort - //NtRequestWaitReplyPort - //--NtResetEvent - //NtRestoreKey - -NTSTATUS -STDCALL -NtResumeThread( - IN HANDLE ThreadHandle, - IN PCONTEXT Context - ); - //NtSaveKey - //NtSendWaitReplyChannel - //NtSetContextChannel - -NTSTATUS -STDCALL -NtSetContextThread( - IN HANDLE ThreadHandle, - IN PCONTEXT Context - ); - //--NtSetDefaultHardErrorPort - //--NtSetDefaultLocale - //--NtSetEaFile - //--NtSetEvent - //--NtSetHighEventPair - //--NtSetHighWaitLowEventPair - //--NtSetHighWaitLowThread - - -NTSTATUS -STDCALL -NtSetInformationFile( - IN HANDLE FileHandle, - IN PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID FileInformation, - IN ULONG Length, - IN CINT FileInformationClass - ); - -//KeyWriteTimeInformation KEY_WRITE_TIME_INFORMATION - -NTSTATUS -STDCALL -NtSetInformationKey( - IN HANDLE KeyHandle, - IN CINT KeySetInformationClass, - IN PVOID KeyInformation, - IN ULONG KeyInformationLength - ); -NTSTATUS -STDCALL -NtSetInformationObject( - IN HANDLE ObjectHandle, - IN CINT HandleInformationClass, - IN PVOID HandleInfo, - IN ULONG Length - ); -/* - -ProcessQuotaLimits QUOTA_LIMITS -ProcessAccessToken PROCESS_ACCESS_TOKEN - -*/ - -NTSTATUS -STDCALL -NtSetInformationProcess( - IN HANDLE ProcessHandle, - IN CINT ProcessInformationClass, - IN PVOID ProcessInformation, - IN ULONG ProcessInformationLength - ); - -NTSTATUS -STDCALL -NtSetInformationThread( - IN HANDLE ThreadHandle, - IN CINT ThreadInformationClass, - IN PVOID ThreadInformation, - IN ULONG ThreadInformationLength - ); -// NtSetInformationToken -// NtSetIntervalProfile -// NtSetIoCompletion -// NtSetLdtEntries -// NtSetLowEventPair -// NtSetLowWaitHighEventPair -// NtSetLowWaitHighThread -// NtSetSecurityObject - //NtSetSystemEnvironmentValue -/* -SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT -*/ -NTSTATUS -STDCALL -NtSetSystemInformation( - IN CINT SystemInformationClass, - IN PVOID SystemInformation, - IN ULONG SystemInformationLength - ); - //NtSetSystemPowerState - -NTSTATUS -STDCALL -NtSetSystemTime( - IN PLARGE_INTEGER SystemTime, - IN BOOL Unknown OPTIONAL - ); - -NTSTATUS -STDCALL -NtSetTimer( - IN HANDLE TimerHandle, - IN PLARGE_INTEGER DueTime, - IN PTIMERAPCROUTINE CompletionRoutine, - IN LPVOID ArgToCompletionRoutine, - IN BOOL Resume, - IN LONG Period - ); -// NtSetTimerResolution - -NTSTATUS -STDCALL -NtSetValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName, - IN ULONG TitleIndex , - IN ULONG Type, - IN PVOID Data, - IN ULONG DataSize - ); - -//-- NtSetVolumeInformationFile - -NTSTATUS -STDCALL -NtShutdownSystem( - IN SHUTDOWN_ACTION Action - ); -//-- NtSignalAndWaitForSingleObject -// NtStartProfile -// NtStopProfile - -NTSTATUS -STDCALL -NtSuspendThread( - IN HANDLE ThreadHandle, - IN PULONG PreviousSuspendCount - ); - //--NtSystemDebugControl - -NTSTATUS -STDCALL -NtTerminateProcess( - IN HANDLE ProcessHandle , - IN NTSTATUS ExitStatus - ); - -NTSTATUS -STDCALL -NtTerminateThread( - IN HANDLE ThreadHandle , - IN NTSTATUS ExitStatus - ); - - //--NtTestAlert - -NTSTATUS -STDCALL -NtUnloadDriver( - IN PUNICODE_STRING DriverServiceName - ); - - //--NtUnloadKey - //--NtUnlockFile - //--NtUnlockVirtualMemory - -NTSTATUS -STDCALL -NtUnmapViewOfSection( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress - ); - //NtVdmControl - //NtW32Call - -NTSTATUS -STDCALL -NtWaitForMultipleObjects ( - IN ULONG Count, - IN PVOID Object[], - IN CINT WaitType, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - -NTSTATUS -STDCALL -NtWaitForSingleObject ( - IN PVOID Object, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - //--NtWaitHighEventPair - //--NtWaitLowEventPair - -NTSTATUS -STDCALL -NtWriteFile( - IN HANDLE FileHandle, - IN HANDLE Event , - 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 NtWriteFileScatter( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK UserIosb, - IN LARGE_INTEGER BufferDescription[], - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); - - //NtWriteRequestData - -NTSTATUS -STDCALL -NtWriteVirtualMemory( - IN HANDLE ProcessHandle, - IN VOID *Buffer, - IN ULONG Size, - OUT PULONG NumberOfBytesWritten - ); - -NTSTATUS -STDCALL -NtYieldExecution( - VOID - ); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - -#endif /* __DDK_ZW_H */ + +/* + * 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 Boudewijn Dekker + * 13/07/98: Reorganised things a bit (David Welch) + * 04/08/98: Added some documentation (Boudewijn Dekker) + */ + +#ifndef __DDK_ZW_H +#define __DDK_ZW_H + +#include + +/* + * FUNCTION: Closes an object handle + * ARGUMENTS: + * Handle = Handle to the object + * RETURNS: Status + */ +NTSTATUS ZwClose(HANDLE Handle); + +/* + * FUNCTION: Creates or opens a directory object, which is a container for + * other objects + * ARGUMENTS: + * DirectoryHandle (OUT) = Points to a variable which stores the + * handle for the directory on success + * DesiredAccess = Type of access the caller requires to the directory + * ObjectAttributes = Structures specifing the object attributes, + * initialized with InitializeObjectAttributes + * RETURNS: Status + */ +NTSTATUS ZwCreateDirectoryObject(PHANDLE DirectoryHandle, + ACCESS_MASK DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes); + +/* + * FUNCTION: Creates or opens a registry key + * ARGUMENTS: + * KeyHandle (OUT) = Points to a variable which stores the handle + * for the key on success + * DesiredAccess = Access desired by the caller to the key + * ObjectAttributes = Initialized object attributes for the key + * TitleIndex = Who knows? + * Class = Object class of the key? + * CreateOptions = Options for the key creation + * Disposition (OUT) = Points to a variable which a status value + * indicating whether a new key was created + * RETURNS: Status + */ +NTSTATUS ZwCreateKey(PHANDLE KeyHandle, ACCESS_MASK DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + ULONG TitleIndex, PUNICODE_STRING Class, + ULONG CreateOptions, PULONG Disposition); + +/* + * FUNCTION: Deletes a registry key + * ARGUMENTS: + * KeyHandle = Handle of the key + * RETURNS: Status + */ +NTSTATUS ZwDeleteKey(HANDLE KeyHandle); + +/* + * 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 ZwEnumerateKey(HANDLE KeyHandle, ULONG Index, + KEY_INFORMATION_CLASS KeyInformationClass, + PVOID KeyInformation, ULONG Length, + 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 ZwEnumerateValueKey(HANDLE KeyHandle, ULONG Index, + KEY_VALUE_INFORMATION_CLASS KeyInformationClass, + PVOID KeyInformation, ULONG Length, + PULONG ResultLength); + + +/* + * FUNCTION: Forces a registry key to be committed to disk + * ARGUMENTS: + * KeyHandle = Handle of the key to be written to disk + * RETURNS: Status + */ +NTSTATUS ZwFlushKey(HANDLE KeyHandle); + +/* + * FUNCTION: Changes the attributes of an object to temporary + * ARGUMENTS: + * Handle = Handle for the object + * RETURNS: Status + */ +NTSTATUS ZwMakeTemporaryObject(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 ZwMapViewOfSection(HANDLE SectionHandle, + HANDLE ProcessHandle, + PVOID* BaseAddress, + ULONG ZeroBits, + ULONG CommitSize, + PLARGE_INTEGER SectionOffset, + PULONG ViewSize, + SECTION_INHERIT InheritDisposition, + ULONG AllocationType, + ULONG Protect); + +/* + * FUNCTION: Opens an existing key in the registry + * 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 ZwOpenKey(PHANDLE KeyHandle, ACCESS_MASK DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes); + +/* + * 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 ZwOpenSection(PHANDLE KeyHandle, ACCESS_MASK DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes); + +/* + * FUNCTION: Returns information about an open file + * ARGUMENTS: + * FileHandle = Handle of the file to be queried + * IoStatusBlock (OUT) = Caller supplied storage for the result + * FileInformation (OUT) = Caller supplied storage for the file + * information + * Length = Length in bytes of the buffer for file information + * FileInformationClass = Type of information to be returned + * RETURNS: Status + */ +NTSTATUS ZwQueryInformationFile(HANDLE FileHandle, + PIO_STATUS_BLOCK IoStatusBlock, + PVOID FileInformation, + ULONG Length, + FILE_INFORMATION_CLASS FileInformationClass); + + + + +#if KERNEL_SUPPORTS_OBJECT_ATTRIBUTES_CORRECTLY +typedef struct _OBJECT_ATTRIBUTES { + ULONG Length; + HANDLE RootDirectory; + PUNICODE_STRING ObjectName; + ULONG Attributes; + SECURITY_DESCRIPTOR *SecurityDescriptor; + SECURITY_QUALITY_OF_SERVICE *SecurityQualityOfService; +} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; +#endif + +#if IOTYPES_DIDNT_DECLARE_THIS +typedef struct _IO_STATUS_BLOCK { + NTSTATUS Status; + ULONG Information; +} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; +#endif + + +//typedef LARGE_INTEGER *PLARGE_INTEGER; + +// + +#define NtCurrentProcess() ( (HANDLE) 0xFFFFFFFF ) +#define NtCurrentThread() ( (HANDLE) 0xFFFFFFFE ) + + + +// 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 MaxProcessInfoClass 22 + +// 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 MaxThreadInfoClass 15 + + +// key query information class + +#define KeyBasicInformation 0 +#define KeyNodeInformation 1 +#define KeyFullInformation 2 + + +// key set information class + +#define KeyWriteTimeInformation 0 + +// key value information class + +#define KeyValueBasicInformation 0 +#define KeyValueFullInformation 1 +#define KeyValuePartialInformation 2 + +// object handle information + +#define HandleInformation 0 +#define HandleName 1 +#define HandleTypeInformation 2 +#define HandleAllInformation 3 +#define HandleBasicInformation 4 + +// system information +#define SystemPerformanceInformation 5 +#define SystemCacheInformation 21 +#define SystemTimeAdjustmentInformation 28 + + +// file information + + +#define FileDirectoryInformation 1 +#define FileFullDirectoryInformation 2 +#define FileBothDirectoryInformation 3 +#define FileBasicInformation 4 +#define FileStandardInformation 5 +#define FileInternalInformation 6 +#define FileEaInformation 7 +#define FileAccessInformation 8 +#define FileNameInformation 9 +#define FileRenameInformation 10 +#define FileLinkInformation 11 +#define FileNamesInformation 12 +#define FileDispositionInformation 13 +#define FilePositionInformation 14 +#define FileFullEaInformation 15 +#define FileModeInformation 16 +#define FileAlignmentInformation 17 +#define FileAllInformation 18 +#define FileAllocationInformation 19 +#define FileEndOfFileInformation 20 +#define FileAlternateNameInformation 21 +#define FileStreamInformation 22 +#define FilePipeInformation 23 +#define FilePipeLocalInformation 24 +#define FilePipeRemoteInformation 25 +#define FileMailslotQueryInformation 26 +#define FileMailslotSetInformation 27 +#define FileCompressionInformation 28 +#define FileCopyOnWriteInformation 29 +#define FileCompletionInformation 30 +#define FileMoveClusterInformation 31 +#define FileOleClassIdInformation 32 +#define FileOleStateBitsInformation 33 +#define FileNetworkOpenInformation 34 +#define FileObjectIdInformation 35 +#define FileOleAllInformation 36 +#define FileOleDirectoryInformation 37 +#define FileContentIndexInformation 38 +#define FileInheritContentIndexInformation 39 +#define FileOleInformation 40 +#define FileMaximumInformation 41 + + + +//file system information class values + + + +#define FileFsVolumeInformation 1 +#define FileFsLabelInformation 2 +#define FileFsSizeInformation 3 +#define FileFsDeviceInformation 4 +#define FileFsAttributeInformation 5 +#define FileFsControlInformation 6 +#define FileFsQuotaQueryInformation 7 +#define FileFsQuotaSetInformation 8 +#define FileFsMaximumInformation 9 + + +// shutdown action + +typedef enum _SHUTDOWN_ACTION_ { + ShutdownNoReboot, + ShutdownReboot, + ShutdownPowerOff +} SHUTDOWN_ACTION; + + + +// wait type + +#define WaitAll 0 +#define WaitAny 1 + + +// key restore flags + +#define REG_WHOLE_HIVE_VOLATILE 1 +#define REG_REFRESH_HIVE 2 + + +// object type access rights + +#define OBJECT_TYPE_CREATE 0x00000001 +#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) + +typedef struct _PROCESS_WS_WATCH_INFORMATION_ +{ + PVOID FaultingPc; + PVOID FaultingVa; +} PROCESS_WS_WATCH_INFORMATION, *PPROCESS_WS_WATCH_INFORMATION; + +typedef struct _PROCESS_BASIC_INFORMATION_ +{ + NTSTATUS ExitStatus; + PPEB PebBaseAddress; + KAFFINITY AffinityMask; + KPRIORITY BasePriority; + ULONG UniqueProcessId; + ULONG InheritedFromUniqueProcessId; +} PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION; + +typedef struct _QUOTA_LIMITS_ +{ + ULONG PagedPoolLimit; + ULONG NonPagedPoolLimit; + ULONG MinimumWorkingSetSize; + ULONG MaximumWorkingSetSize; + ULONG PagefileLimit; + LARGE_INTEGER TimeLimit; +} QUOTA_LIMITS, *PQUOTA_LIMITS; + +typedef struct _IO_COUNTERS_ +{ + ULONG ReadOperationCount; + ULONG WriteOperationCount; + ULONG OtherOperationCount; + LARGE_INTEGER ReadTransferCount; + LARGE_INTEGER WriteTransferCount; + LARGE_INTEGER OtherTransferCount; +} IO_COUNTERS, *PIO_COUNTERS; + + +typedef struct _VM_COUNTERS_ +{ + ULONG PeakVirtualSize; + ULONG VirtualSize; + ULONG PageFaultCount; + ULONG PeakWorkingSetSize; + ULONG WorkingSetSize; + ULONG QuotaPeakPagedPoolUsage; + ULONG QuotaPagedPoolUsage; + ULONG QuotaPeakNonPagedPoolUsage; + ULONG QuotaNonPagedPoolUsage; + ULONG PagefileUsage; + ULONG PeakPagefileUsage; +} VM_COUNTERS, *PVM_COUNTERS; + + +typedef struct _POOLED_USAGE_AND_LIMITS_ +{ + ULONG PeakPagedPoolUsage; + ULONG PagedPoolUsage; + ULONG PagedPoolLimit; + ULONG PeakNonPagedPoolUsage; + ULONG NonPagedPoolUsage; + ULONG NonPagedPoolLimit; + ULONG PeakPagefileUsage; + ULONG PagefileUsage; + ULONG PagefileLimit; +} POOLED_USAGE_AND_LIMITS, *PPOOLED_USAGE_AND_LIMITS; + + +typedef struct _PROCESS_ACCESS_TOKEN_ +{ + HANDLE Token; + HANDLE Thread; +} PROCESS_ACCESS_TOKEN, *PPROCESS_ACCESS_TOKEN; + +typedef struct _KERNEL_USER_TIMES_ +{ + LARGE_INTEGER CreateTime; + LARGE_INTEGER ExitTime; + LARGE_INTEGER KernelTime; + LARGE_INTEGER UserTime; +} KERNEL_USER_TIMES; +typedef KERNEL_USER_TIMES *PKERNEL_USER_TIMES; + + +typedef struct _OBJECT_NAME_INFORMATION_ +{ + UNICODE_STRING Name; +} OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION; + + +// section information + + +// handle information + +//HandleBasicInformation HANDLE_BASIC_INFORMATION +typedef struct _HANDLE_BASIC_INFORMATION_ +{ + BOOL bInheritHanlde; + BOOL bProtectFromClose; +} HANDLE_BASIC_INFORMATION, *PHANDLE_BASIC_INFORMATION; + +//HandleTypeInormation HANDLE_TYPE_INFORMATION +typedef struct _HANDLE_TYPE_INFORMATION_ { + UNICODE_STRING Name; + UNICODE_STRING Type; + ULONG TotalHandles; + ULONG ReferenceCount; +} HANDLE_TYPE_INFORMATION, *PHANDLE_TYPE_INFORMATION; + +typedef struct _SYSTEM_TIME_ADJUSTMENT_ +{ + ULONG TimeAdjustment; + BOOL TimeAdjustmentDisabled; +} SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT; + +#ifdef __STRUCTS_H_DIDNT_DEFINE_THIS_ALREADY +typedef struct _SYSTEM_INFO_ { + union { + DWORD dwOemId; + struct { + WORD wProcessorArchitecture; + WORD wReserved; + }; + }; + DWORD dwPageSize; + LPVOID lpMinimumApplicationAddress; + LPVOID lpMaximumApplicationAddress; + DWORD dwActiveProcessorMask; + DWORD dwNumberOfProcessors; + DWORD dwProcessorType; + DWORD dwAllocationGranularity; + WORD wProcessorLevel; + WORD wProcessorRevision; +} SYSTEM_INFO; +#endif + +typedef struct _SYSTEM_CACHE_INFORMATION_ { + ULONG CurrentSize; + ULONG PeakSize; + ULONG PageFaultCount; + ULONG MinimumWorkingSet; + ULONG MaximumWorkingSet; + ULONG Unused[4]; +} SYSTEM_CACHE_INFORMATION; + + + +// file information + +typedef struct _FILE_BASIC_INFORMATION_ +{ + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + ULONG FileAttributes; +} FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION; + +typedef struct _FILE_STANDARD_INFORMATION_ +{ + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG NumberOfLinks; + BOOLEAN DeletePending; + BOOLEAN Directory; +} FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION; + +typedef struct _FILE_POSITION_INFORMATION_ +{ + LARGE_INTEGER CurrentByteOffset; +} FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION; + +typedef struct _FILE_ALIGNMENT_INFORMATION_ +{ + ULONG AlignmentRequirement; +} FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION; + +typedef struct _FILE_DISPOSITION_INFORMATION_ +{ + BOOLEAN DeleteFile; +} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION; + +typedef struct _FILE_END_OF_FILE_INFORMATION_ +{ + LARGE_INTEGER EndOfFile; +} FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION; + +typedef struct _FILE_NETWORK_OPEN_INFORMATION_ { + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG FileAttributes; +} FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION; + +typedef struct _FILE_FULL_EA_INFORMATION_ +{ + ULONG NextEntryOffset; + UCHAR Flags; + UCHAR EaNameLength; + USHORT EaValueLength; + CHAR *EaName; +} FILE_FULL_EA_INFORMATION; +typedef FILE_FULL_EA_INFORMATION *PFILE_FULL_EA_INFORMATION; + + +typedef struct _FILE_EA_INFORMATION_ { + ULONG EaSize; +} FILE_EA_INFORMATION; + +typedef struct _FILE_STREAM_INFORMATION_ +{ + ULONG NextEntryOffset; + ULONG StreamNameLength; + LARGE_INTEGER StreamSize; + LARGE_INTEGER StreamAllocationSize; + WCHAR StreamName[1]; +} FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION; + + +#ifdef __IO_TYPE_DIDNT_DEFINE_THIS_ALREADY +typedef struct _IO_COMPLETION_CONTEXT +{ + PVOID Port; + ULONG Key; +} IO_COMPLETION_CONTEXT, *PIO_COMPLETION_CONTEXT; +#endif + +typedef struct _FILE_ALLOCATION_INFORMATION_ { + LARGE_INTEGER AllocationSize; +} FILE_ALLOCATION_INFORMATION; + +typedef struct _FILE_NAME_INFORMATION_ { + ULONG FileNameLength; + WCHAR FileName[1]; +} FILE_NAME_INFORMATION; + +typedef struct _FILE_RENAME_INFORMATION_ { + BOOLEAN Replace; + HANDLE RootDir; + ULONG FileNameLength; + WCHAR FileName[1]; +} FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION; + + +typedef struct _FILE_INTERNAL_INFORMATION_ { + LARGE_INTEGER IndexNumber; +} FILE_INTERNAL_INFORMATION; + +typedef struct _FILE_ACCESS_INFORMATION_ { + ACCESS_MASK AccessFlags; +} FILE_ACCESS_INFORMATION; + +#ifdef __DEFINED_ABOVE +typedef struct _FILE_POSITION_INFORMATION_ { + LARGE_INTEGER CurrentByteOffset; +} FILE_POSITION_INFORMATION; +#endif + +typedef struct _FILE_MODE_INFORMATION_ { + ULONG Mode; +} FILE_MODE_INFORMATION; + +#ifdef __DEFINED_ABOVE +typedef struct _FILE_ALIGNMENT_INFORMATION_ { + ULONG AlignmentRequirement; +} FILE_ALIGNMENT_INFORMATION; +#endif + +typedef struct _FILE_COMPRESSION_INFORMATION_ { + LARGE_INTEGER CompressedFileSize; + USHORT CompressionFormat; + UCHAR CompressionUnitShift; + UCHAR ChunkShift; + UCHAR ClusterShift; + UCHAR Reserved[3]; +} FILE_COMPRESSION_INFORMATION; + +typedef struct _FILE_ALL_INFORMATION { + FILE_BASIC_INFORMATION BasicInformation; + FILE_STANDARD_INFORMATION StandardInformation; + FILE_INTERNAL_INFORMATION InternalInformation; + FILE_EA_INFORMATION EaInformation; + FILE_ACCESS_INFORMATION AccessInformation; + FILE_POSITION_INFORMATION PositionInformation; + FILE_MODE_INFORMATION ModeInformation; + FILE_ALIGNMENT_INFORMATION AlignmentInformation; + FILE_NAME_INFORMATION NameInformation; +} FILE_ALL_INFORMATION; + +// file system information structures + +typedef struct _FILE_FS_DEVICE_INFORMATION_ { + DEVICE_TYPE DeviceType; + ULONG Characteristics; +} FILE_FS_DEVICE_INFORMATION; +typedef FILE_FS_DEVICE_INFORMATION *PFILE_FS_DEVICE_INFORMATION; + +/* + characteristics is one of the following values: + + FILE_REMOVABLE_MEDIA 0x00000001 + FILE_READ_ONLY_DEVICE 0x00000002 + FILE_FLOPPY_DISKETTE 0x00000004 + FILE_WRITE_ONCE_MEDIA 0x00000008 + FILE_REMOTE_DEVICE 0x00000010 + FILE_DEVICE_IS_MOUNTED 0x00000020 + FILE_VIRTUAL_VOLUME 0x00000040 +*/ + +typedef struct _FILE_FS_VOLUME_INFORMATION_ { + LARGE_INTEGER VolumeCreationTime; + ULONG VolumeSerialNumber; + ULONG VolumeLabelLength; + BOOLEAN SupportsObjects; + WCHAR VolumeLabel[1]; +} FILE_FS_VOLUME_INFORMATION; + +typedef struct _FILE_FS_SIZE_INFORMATION_ { + LARGE_INTEGER TotalAllocationUnits; + LARGE_INTEGER AvailableAllocationUnits; + ULONG SectorsPerAllocationUnit; + ULONG BytesPerSector; +} FILE_FS_SIZE_INFORMATION; + +typedef struct _FILE_FS_ATTRIBUTE_INFORMATION_ { + ULONG FileSystemAttributes; + LONG MaximumComponentNameLength; + ULONG FileSystemNameLength; + WCHAR FileSystemName[1]; +} FILE_FS_ATTRIBUTE_INFORMATION; + +/* + FileSystemAttributes is one of the following values: + + FILE_CASE_SENSITIVE_SEARCH 0x00000001 + FILE_CASE_PRESERVED_NAMES 0x00000002 + FILE_UNICODE_ON_DISK 0x00000004 + FILE_PERSISTENT_ACLS 0x00000008 + FILE_FILE_COMPRESSION 0x00000010 + FILE_VOLUME_QUOTAS 0x00000020 + FILE_VOLUME_IS_COMPRESSED 0x00008000 +*/ + + +// directory information + +typedef struct _OBJDIR_INFORMATION_ { + UNICODE_STRING ObjectName; + UNICODE_STRING ObjectTypeName; // Directory, Device ... + UCHAR Data[1]; // variable size +} OBJDIR_INFORMATION, *POBJDIR_INFORMATION; + + +/* + NotifyFilter / CompletionFilter: + + FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001 + FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002 + FILE_NOTIFY_CHANGE_NAME 0x00000003 + FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004 + FILE_NOTIFY_CHANGE_SIZE 0x00000008 + FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010 + FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020 + FILE_NOTIFY_CHANGE_CREATION 0x00000040 + FILE_NOTIFY_CHANGE_EA 0x00000080 + FILE_NOTIFY_CHANGE_SECURITY 0x00000100 + FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200 + FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400 + FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800 +*/ + +typedef struct _FILE_NOTIFY_INFORMATION_ { + ULONG NextEntryOffset; + ULONG Action; + ULONG FileNameLength; + WCHAR FileName[1]; // variable size +} FILE_NOTIFY_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 + +*/ + + +//FIXME: I belong somewhere in windows.h +typedef +VOID +(*PTIMERAPCROUTINE)( + LPVOID lpArgToCompletionRoutine, + DWORD dwTimerLowValue, + DWORD dwTimerHighValue + ); + +// NtProcessStartup parameters + +typedef struct _ENVIRONMENT_INFORMATION_ { + ULONG Unknown[21]; + UNICODE_STRING CommandLine; + UNICODE_STRING ImageFile; +} ENVIRONMENT_INFORMATION, *PENVIRONMENT_INFORMATION; + + +typedef struct _STARTUP_ARGUMENT_ { + ULONG Unknown[3]; + PENVIRONMENT_INFORMATION Environment; +} STARTUP_ARGUMENT, *PSTARTUP_ARGUMENT; + + +// File System Control commands ( related to defragging ) + +#define FSCTL_READ_MFT_RECORD 0x90068 // NTFS only +#define FSCTL_GET_VOLUME_BITMAP 0x9006F +#define FSCTL_GET_RETRIEVAL_POINTERS 0x90073 +#define FSCTL_MOVE_FILE 0x90074 + +typedef struct _MAPPING_PAIR_ { + ULONGLONG Vcn; + ULONGLONG Lcn; +} MAPPING_PAIR, *PMAPPING_PAIR; + +typedef struct _GET_RETRIEVAL_DESCRIPTOR_ { + ULONG NumberOfPairs; + ULONGLONG StartVcn; + MAPPING_PAIR Pair[1]; +} GET_RETRIEVAL_DESCRIPTOR, *PGET_RETRIEVAL_DESCRIPTOR; + +typedef struct _BITMAP_DESCRIPTOR_ { + ULONGLONG StartLcn; + ULONGLONG ClustersToEndOfVol; + BYTE Map[1]; +} BITMAP_DESCRIPTOR, *PBITMAP_DESCRIPTOR; + +typedef struct _MOVEFILE_DESCRIPTOR_ { + HANDLE FileHandle; + ULONG Reserved; + LARGE_INTEGER StartVcn; + LARGE_INTEGER TargetLcn; + ULONG NumVcns; + ULONG Reserved1; +} MOVEFILE_DESCRIPTOR, *PMOVEFILE_DESCRIPTOR; + + + + + +/* + * FUNCTION: Adds an atom to the global atom table + * ARGUMENTS: + * AtomString = The string to add to the atom table. + * REMARKS: The arguments map to the win32 add GlobalAddAtom. + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtAddAtom( + OUT ATOM *Atom, + IN PUNICODE_STRING pString + ); +/* + * FUNCTION: Decrements a thread's resume count and places it in an alerted state. + * ARGUMENTS: + * ThreadHandle = Handle to the thread that should be resumed + * SuspendCount = The resulting resume count. + * REMARK: + A thread is resumed if its resume count is 0 + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtAlertResumeThread( + 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 + ); +/* + * FUNCTION: Allocates a locally unique id + * ARGUMENTS: + * LocallyUniqueId = Locally unique number + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtAllocateLocallyUniqueId( + OUT PVOID LocallyUniqueId + ); + +/* + * 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 + * StartAddress = (OPTIONAL) The requested start address + * NumberOfBytesAllocated = 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 + * ProtectionType = 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 hProcess, + OUT PVOID BaseAddress, + IN ULONG StartAddress, + IN ULONG NumberOfBytesAllocated, + IN ULONG AllocationType, + IN ULONG ProtectionType + ); + +/* + * FUNCTION: Cancels a IO request + * ARGUMENTS: + * FileHandle = Handle to the file + * IoStatusBlock = Specifies the status of the io request when it was cancelled + * REMARKS: + * This function maps to the win32 CancelIo. + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtCancelIoFile( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock + ); +/* + * FUNCTION: Cancels a timer + * ARGUMENTS: + * TimerHandle = Handle to the timer + ElapsedTime = Specifies the elapsed time the timer has run so far. + * REMARKS: + The arguments to this function map to the function CancelWaitableTimer. + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtCancelTimer( + IN HANDLE TimerHandle, + OUT ULONG ElapsedTime + ); +/* + * 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 + ); + +/* + * 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 + ); + + +/* + * FUNCTION: Continues a thread with the specified context + * ARGUMENTS: + * Context = Specifies the processor context + * REMARKS + NtContinue can be used to continue after a exception. + * RETURNS: Status + */ +//FIXME This function might need another parameter +NTSTATUS +STDCALL +NtContinue( + IN PCONTEXT Context + ); + +/* + * 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 + ); +/* + * 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 FileHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN BOOL ManualReset, + IN BOOL InitialState + ); +/* + * 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 + ); +/* + * 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 + ); +/* + * FUNCTION: Creates a registry key + * ARGUMENTS: + * KeyHandle (OUT) = Caller supplied storage for the resulting handle + * DesiredAccess = Specifies the allowed or desired access to the key + * It can have a combination of the following values: + * KEY_READ | KEY_WRITE | KEY_EXECUTE | KEY_ALL_ACCESS + * or + * KEY_QUERY_VALUE The values of the key can be queried. + * KEY_SET_VALUE The values of the key can be modified. + * KEY_CREATE_SUB_KEYS The key may contain subkeys. + * KEY_ENUMERATE_SUB_KEYS Subkeys can be queried. + * KEY_NOTIFY + * KEY_CREATE_LINK A symbolic link to the key can be created. + * ObjectAttributes = The name of the key may be specified directly in the name field + * of object attributes or relative + * to a key in rootdirectory. + * Class = Specifies the kind of data. + * CreateOptions = Specifies additional options with which the key is created + * REG_OPTION_VOLATILE The key is not preserved across boots. + * REG_OPTION_NON_VOLATILE The key is preserved accross boots. + * REG_OPTION_CREATE_LINK The key is a symbolic link to another key. + * REG_OPTION_BACKUP_RESTORE Key is being opened or created for backup/restore operations. + * Disposition = Indicates if the call to NtCreateKey resulted in the creation of a key it + * can have the following values: REG_CREATED_NEW_KEY | REG_OPENED_EXISTING_KEY + * RETURNS: + * Status + */ +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 + ); + + +//NtCreateMailslotFile + +/* + * 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 OBJECT_ATTRIBUTES ObjectAttributes, + IN BOOL InitialOwner + ); + +//NtCreateNamedPipeFile + +/* + * FUNCTION: Creates a paging file. + * ARGUMENTS: + * PageFileName = Name of the pagefile + * MinimumSize = Specifies the minimum size + * MaximumSize = Specifies the maximum size + * ActualSize = Specifies the actual size + * RETURNS: Status +*/ +NTSTATUS +STDCALL +NtCreatePagingFile( + IN PUNICODE_STRING PageFileName, + IN ULONG MiniumSize, + IN ULONG MaxiumSize, + OUT PULONG ActualSize + ); +/* + * 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 + ); +/* + * 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 + ); +/* + * 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 ULONG InitialCount, + IN ULONG 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 = + * REMARKS: + * This function map to the win32 function CreateThread. + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtCreateSymbolicLinkObject( + 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 = Caller supplies storage for process id and thread id. + * ThreadContext = Initial processor context for the thread. + * InitialTeb = Initial Thread Environment Block for the Thread. + * CreateSuspended = Specifies if the thread is ready for scheduling + * REMARKS: + * This function maps to the win32 function CreateThread. The exact arguments are from the usenet. [<6f7cqj$tq9$1@nnrp1.dejanews.com>] + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtCreateThread( + OUT PHANDLE ThreadHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN HANDLE ProcessHandle, + IN 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. + * ManualReset = 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 BOOL ManualReset + ); +/* + * FUNCTION: Returns the callers thread TEB. + * ARGUMENTS: + * Teb (OUT) = Caller supplied storage for the resulting TEB. + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtCurrentTeb( + NT_TEB *CurrentTeb + ); + +/* + * 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 BOOL Alertable, + IN PLARGE_INTEGER Interval + ); + +/* + * FUNCTION: Deletes an atom from the global atom table + * ARGUMENTS: + * Atom = Atom to delete + * REMARKS: + The function maps to the win32 GlobalDeleteAtom + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtDeleteAtom( + IN ATOM Atom + ); + +/* + * FUNCTION: Deletes a file + * ARGUMENTS: + * FileHandle = Handle to the file which should be deleted + * REMARKS: + * The function maps to the win32 DeleteFile + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtDeleteFile( + IN HANDLE FileHandle + ); + +/* + * FUNCTION: Deletes a registry key + * ARGUMENTS: + * KeyHandle = Handle of the key + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtDeleteKey( + IN HANDLE KeyHandle + ); +/* + * 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 + ); +/* + * 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 = + * ApcContext = + * IoStatusBlock = Caller should supply storage for + * 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 + ); +/* + * FUNCTION: Displays a string on the blue screen + * ARGUMENTS: + * DisplayString = The string to display + * RETURNS: Status + */ + +NTSTATUS +STDCALL +NtDisplayString( + IN PUNICODE_STRING DisplayString + ); +/* + * FUNCTION: Displays a string on the blue screen + * ARGUMENTS: + * SourceProcessHandle = The string to display + SourceHandle = + TargetProcessHandle = + TargetHandle = + DesiredAccess = + InheritHandle = + * RETURNS: Status + */ + +NTSTATUS +STDCALL +NtDuplicateObject( + IN HANDLE SourceProcessHandle, + IN PHANDLE SourceHandle, + IN HANDLE TargetProcessHandle, + OUT PHANDLE TargetHandle, + IN ULONG DesiredAccess, + IN BOOL InheritHandle + ); +/* + * 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 CINT 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 CINT 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 + ); +/* + * FUNCTION: Finds a atom + * ARGUMENTS: + * Atom = Caller supplies storage for the resulting atom + * AtomString = String to search for. + * RETURNS: Status + * REMARKS: + This funciton maps to the win32 GlobalFindAtom + */ +NTSTATUS +STDCALL +NtFindAtom( + OUT ATOM *Atom, + IN PUNICODE_STRING AtomString + ); +/* + * FUNCTION: Flushes chached file data to disk + * ARGUMENTS: + * FileHandle = Points to the file + * RETURNS: Status + * REMARKS: + This funciton maps to the win32 FlushFileBuffers + */ +NTSTATUS +STDCALL +NtFlushBuffersFile( + IN HANDLE FileHandle + ); +/* + * 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 + ); + +/* + * 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 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 + */ +VOID +STDCALL +NtFlushWriteBuffer ( + 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 + * NumberOfBytesToFree = Limits the range to free, + * NumberOfBytesFreed = Actual number of bytes freed + * RETURNS: Status + */ + +NTSTATUS +STDCALL +NtFreeVirtualMemory( + IN PHANDLE ProcessHandle, + IN PVOID BaseAddress, + IN ULONG NumberOfBytesToFree, + OUT PULONG NumberOfBytesFreeed OPTIONAL + ); + +/* + * 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 + */ +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 + ); + +/* + * 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 + ); +/* + * FUNCTION: Retrieves the uptime of the system + * ARGUMENTS: + * UpTime = Number of clock ticks since boot. + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtGetTickCount( + PULONG UpTime + ); + +//-- NtImpersonateThread + +/* + * FUNCTION: Initializes the registry. + * ARGUMENTS: + * SetUpBoot = This parameter is true for a setup boot. + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtInitializeRegistry( + BOOL SetUpBoot + ); +/* + * FUNCTION: Loads a driver. + * ARGUMENTS: + * DriverServiceName = Name of the driver to load + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtLoadDriver( + IN PUNICODE_STRING DriverServiceName + ); + +//-- NtLoadKey2 +/* + * 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, + OBJECT_ATTRIBUTES ObjectAttributes + ); +/* + * 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. + * ByteOffsetOfLock = Offset + * LengthOfLock = Number of bytes to lock. + * KeyOfLock = + * DoNotWaitIfHeld = + * IsExclusiveLock = + * REMARK: + * This procedure maps to the win32 procedure LockFileEx + * RETURNS: Status + */ +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 ByteOffsetOfLock, + IN PLARGE_INTEGER LengthOfLock, + IN ULONG KeyOfLock, + IN BOOLEAN DoNotWaitIfHeld, + IN BOOLEAN IsExclusiveLock + ); +/* + * 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 + */ +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 + ); + + +/* + * 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 + ); + +/* + * FUNCTION: Installs a notify for the change of a directory's contents + * ARGUMENTS: + * FileHandle = Handle to the directory + * Event = + * UserApcRoutine = Start address + * UserApcContext = 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 + * NotifyFilter = // might be completionfileter + * WatchSubtree = + * + * 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 UserApcRoutine OPTIONAL, + IN PVOID UserApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID Buffer, + IN ULONG BufferSize, + IN ULONG NotifyFilter, + IN BOOL WatchSubtree + ); + +//NtNotifyChangeKey +/* + * 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 + ); +/* + * 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 + ); +/* + * 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 = + * FileAttributes = + * 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 FileAttributes + ); +//--> NtOpenIoCompletion +/* + * FUNCTION: Opens an existing key in the registry + * 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 +NtOpenKey( + 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 + ); + +/* + * 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 = storage for the process id and the thread id + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtOpenProcess ( + OUT PHANDLE ProcessHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN PCLIENT_ID ClientId + ); +/* + * 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 + ); +/* + * 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 + ); +/* + * 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 + ); +/* + * 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 + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtOpenThread( + OUT PHANDLE ThreadHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes + ); +/* + * 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 + ); +/* + * FUNCTION: Entry point for native applications + * ARGUMENTS: + * Argument = Arguments passed to the application by the system [ at boot time ] + * REMARKS: + * Native applications should use this function instead of a main. + * RETURNS: Status + */ +void NtProcessStartup( + IN PSTARTUP_ARGUMENT Argument + ); + +/* + * 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 should be repeated + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtPulseEvent( + IN HANDLE EventHandle, + IN PULONG PulseCount OPTIONAL + ); + +//-- NtQueryAttributesFile +//-- NtQueryDirectoryFile +/* + * 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 + ); + + +//-- NtQueryEaFile +/* + * FUNCTION: Queries an event + * ARGUMENTS: + * EventHandle = Handle to the event + * EventInformationClass = Index of the information structure + * 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 CINT EventInformationClass, + OUT PVOID EventInformation, + IN ULONG EventInformationLength, + OUT PULONG ReturnLength + ); +//-- NtQueryFullAttributesFile +//-- NtQueryInformationAtom + + + +/* + * FUNCTION: Queries 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 storage for the file information. + * FileInformationClass = Indicates which file information is queried + + FileDirectoryInformation + FileFullDirectoryInformation + FileBothDirectoryInformation + FileBasicInformation FILE_BASIC_INFORMATION + FileStandardInformation FILE_STANDARD_INFORMATION + FileInternalInformation FILE_INTERNAL_INFORMATION + FileEaInformation FILE_EA_INFORMATION + FileAccessInformation FILE_ACCESS_INFORMATION + FileNameInformation FILE_NAME_INFORMATION + FileRenameInformation FILE_RENAME_INFORMATION + FileLinkInformation + FileNamesInformation + FileDispositionInformation FILE_DISPOSITION_INFORMATION + FilePositionInformation FILE_POSITION_INFORMATION + FileFullEaInformation FILE_FULL_EA_INFORMATION + FileModeInformation FILE_MODE_INFORMATION + FileAlignmentInformation FILE_ALIGNMENT_INFORMATION + FileAllInformation FILE_ALL_INFORMATION + FileAllocationInformation FILE_ALLOCATION_INFORMATION + FileEndOfFileInformation FILE_END_OF_FILE_INFORMATION + FileAlternateNameInformation + FileStreamInformation FILE_STREAM_INFORMATION + FilePipeInformation + FilePipeLocalInformation + FilePipeRemoteInformation + FileMailslotQueryInformation + FileMailslotSetInformation + FileCompressionInformation FILE_COMPRESSION_INFORMATION + FileCopyOnWriteInformation + FileCompletionInformation IO_COMPLETION_CONTEXT + FileMoveClusterInformation + FileOleClassIdInformation + FileOleStateBitsInformation + FileNetworkOpenInformation FILE_NETWORK_OPEN_INFORMATION + FileObjectIdInformation + FileOleAllInformation + FileOleDirectoryInformation + FileContentIndexInformation + FileInheritContentIndexInformation + FileOleInformation + FileMaximumInformation + + * REMARK: + * This procedure maps to the win32 GetShortPathName, GetLongPathName, + GetFullPathName, GetFileType, GetFileSize, GetFileTime functions. + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtQueryInformationFile( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID FileInformation, + IN ULONG Length, + IN CINT FileInformationClass + ); + +/* + * FUNCTION: Queries the information of a process object. + * ARGUMENTS: + * ProcessHandle = Handle to the process object + * ProcessInformation = Index to a certain information structure + + ProcessBasicInformation PROCESS_BASIC_INFORMATION + ProcessQuotaLimits QUOTA_LIMITS + ProcessIoCounters IO_COUNTERS + ProcessVmCounters VM_COUNTERS + ProcessTimes KERNEL_USER_TIMES + ProcessBasePriority KPRIORITY + ProcessBasePriority KPRIORITY + ProcessRaisePriority KPRIORITY + ProcessDebugPort HANDLE + ProcessExceptionPort HANDLE + ProcessAccessToken PROCESS_ACCESS_TOKEN + ProcessLdtInformation LDT_ENTRY ?? + ProcessLdtSize ?? + ProcessDefaultHardErrorMode ULONG + ProcessIoPortHandlers // kernel mode only + ProcessPooledUsageAndLimits POOLED_USAGE_AND_LIMITS + ProcessWorkingSetWatch PROCESS_WS_WATCH_INFORMATION + ProcessUserModeIOPL (I/O Privilege Level) + ProcessEnableAlignmentFaultFixup BOOLEAN + ProcessPriorityClass ULONG + ProcessWx86Information + ProcessHandleCount ULONG + ProcessAffinityMask ULONG + ProcessPooledQuotaLimits QUOTA_LIMITS + MaxProcessInfoClass ?? + + * ProcessInformation = Caller supplies storage for the process information structure + * ProcessInformationLength = Size of the process information structure + * ReturnLength = Actual number of bytes written + + * REMARK: + * This procedure maps to the win32 GetProcessTimes, GetProcessVersion, + GetProcessWorkingSetSize, GetProcessPriorityBoost, GetProcessAffinityMask, GetPriorityClass, + GetProcessShutdownParameters functions. + * RETURNS: Status +*/ + + + +NTSTATUS +STDCALL +NtQueryInformationProcess( + IN HANDLE ProcessHandle, + IN CINT ProcessInformationClass, + OUT PVOID ProcessInformation, + IN ULONG ProcessInformationLength, + OUT PULONG ReturnLength + ); + +/* + * FUNCTION: Queries the information of a thread object. + * ARGUMENTS: + * ThreadHandle = Handle to the thread object + * ThreadInformationClass = Index to a certain information structure + + ThreadBasicInformation + ThreadTimes KERNEL_USER_TIMES + ThreadPriority KPRIORITY + ThreadBasePriority KPRIORITY + ThreadAffinityMask KAFFINITY + ThreadImpersonationToken + ThreadDescriptorTableEntry + ThreadEnableAlignmentFaultFixup + ThreadEventPair + ThreadQuerySetWin32StartAddress + ThreadZeroTlsCell + ThreadPerformanceCount + ThreadAmILastThread + ThreadIdealProcessor + ThreadPriorityBoost + 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 CINT ThreadInformationClass, + OUT PVOID ThreadInformation, + IN ULONG ThreadInformationLength, + OUT PULONG ReturnLength + ); +// NtQueryInformationToken +//-- NtQueryIoCompletion +/* + * 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 CINT KeyInformationClass, + OUT PVOID KeyInformation, + IN ULONG Length, + OUT PULONG ResultLength + ); +//-- NtQueryMultipleValueKey +//-- NtQueryMutant + + +/* + * FUNCTION: Queries the information of a object. + * ARGUMENTS: + ObjectHandle = Handle to a object + HandleInformationClass = Index to a certain information structure + + HandleBasicInformation HANDLE_BASIC_INFORMATION + HandleTypeInormation HANDLE_TYPE_INFORMATION + + HandleInformation = Caller supplies storage for resulting information + Length = Size of the supplied storage + ResultLength = Bytes written + */ + +NTSTATUS +STDCALL +NtQueryObject( + IN HANDLE ObjectHandle, + IN CINT HandleInformationClass, + OUT PVOID HandleInformationPtr, + 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 + ); +/* + * 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 + ); + + +//-- NtQuerySemaphore +/* + * FUNCTION: Queries the information of a symbolic link object. + * ARGUMENTS: + * SymbolicLinkHandle = Handle to the symbolic link object + * LinkName = resolved name of link + * DataWritten = size of the LinkName. + * RETURNS: Status + * +*/ +NTSTATUS +STDCALL +NtQuerySymbolicLinkObject( + IN HANDLE SymLinkObjHandle, + OUT PUNICODE_STRING LinkName, + OUT PULONG DataWritten OPTIONAL + ); +//-- NtQuerySystemEnvironmentValue + + +/* + * FUNCTION: Queries the system information. + * ARGUMENTS: + * SystemInformationClass = Index to a certain information structure + + SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT + SystemCacheInformation SYSTEM_CACHE_INFORMATION + + * SystemInformation = caller supplies storage for the information structure + * Length = size of the structure + ResultLength = Data written + * RETURNS: Status + * +*/ +NTSTATUS +STDCALL +NtQuerySystemInformation( + IN CINT 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 PLARGE_INTEGER CurrentTime + ); +//-- NtQueryTimer + +/* + * 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 +NtQueryTimerResolution ( + 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 CINT 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 = + 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 + FileFsSizeInformation FILE_FS_SIZE_INFORMATION + FileFsDeviceInformation FILE_FS_DEVICE_INFORMATION + FileFsAttributeInformation FILE_FS_ATTRIBUTE_INFORMATION + FileFsControlInformation + FileFsQuotaQueryInformation + FileFsQuotaSetInformation + FileFsMaximumInformation + + * RETURNS: Status + * +*/ +NTSTATUS +STDCALL +NtQueryVolumeInformationFile( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID FSInformation, + IN ULONG Length, + IN CINT FSInformationClass + ); +// NtQueueApcThread +/* + * 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 BOOL IsDebugger OPTIONAL + ); + +//NtRaiseHardError +/* + * 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 = unused + * 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 + ); +/* + * 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 = unused + * 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 LARGE_INTEGER 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 + ); +//FIXME: Is the parameters correctly named ? ThreadHandle might be a TerminationPort +/* + * FUNCTION: Debugger can register for thread termination + * ARGUMENTS: + * ThreadHandle = + * RETURNS: Status + */ + +NTSTATUS +STDCALL +NtRegisterThreadTerminatePort( + HANDLE ThreadHandle + ); +/* + * FUNCTION: Releases a mutant + * ARGUMENTS: + * MutantHandle = + * ReleaseCount = + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtReleaseMutant( + IN HANDLE MutantHandle, + IN PULONG ReleaseCount OPTIONAL + ); +/* + * FUNCTION: Releases a semaphore + * ARGUMENTS: + * SemaphoreHandle = + * ReleaseCount = + * PreviousCount = + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtReleaseSemaphore( + IN HANDLE SemaphoreHandle, + IN ULONG ReleaseCount, + IN PULONG PreviousCount + ); +/* + * FUNCTION: Removes an io completion + * ARGUMENTS: + * CompletionPort (OUT) = Caller supplied storage for the resulting handle + * CompletionKey = Requested access to the key + * IoStatusBlock = + * ObjectAttribute = Initialized attributes for the object + * CompletionStatus = + * WaitTime = + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtRemoveIoCompletion( + IN HANDLE CompletionPort, + OUT PULONG CompletionKey, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PULONG CompletionStatus, + ULONG 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 + ); +/* + * 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 + ); + //NtRestoreKey +/* + * 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, + IN PULONG SuspendCount + ); + //NtSaveKey +/* + * 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 + ); +/* + * 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 + ); + +/* + * FUNCTION: Set an event to a signalled state. + * ARGUMENTS: + * EventHandle = Handle to the event + * Count = The resulting count. + * REMARK: + * This procedure maps to the win32 SetEvent function. + * RETURNS: Status + */ + +NTSTATUS +STDCALL +NtSetEvent( + HANDLE EventHandle, + PULONG Count + ); + +/* + * 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 storage for the file information. + * FileInformationClass = Indicates which file information is set + + FileNameInformation PUNICODE_STRING + 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 CINT FileInformationClass + ); + + +/* + * FUNCTION: Sets the information of a registry key. + * ARGUMENTS: + * KeyHandle = Handle to the registry key + * KeyInformationClass = Index to the a certain set of parameter to set. + Can be one of the following values: + + * KeyWriteTimeInformation KEY_WRITE_TIME_INFORMATION + + KeyInformation = Storage for the new key information + * KeyInformationLength = Size of the storage allocated for the key information + * RETURNS: Status + */ + +NTSTATUS +STDCALL +NtSetInformationKey( + IN HANDLE KeyHandle, + IN CINT KeyInformationClass, + IN PVOID KeyInformation, + IN ULONG KeyInformationLength + ); +/* + * FUNCTION: Changes a set of object specific parameters + * ARGUMENTS: + * ObjectHandle = + * HandleInformationClass = Index to the set of parameters to change. + + HandleInformation + HandleName + HandleTypeInformation + HandleAllInformation + HandleBasicInformation + + + * HandleInformation = Caller supplies storage for parameters to set. + * Length = Size of the storage supplied + * RETURNS: Status +*/ +NTSTATUS +STDCALL +NtSetInformationObject( + IN HANDLE ObjectHandle, + IN CINT HandleInformationClass, + IN PVOID HandleInformationPtr, + IN ULONG Length + ); + +/* + * FUNCTION: Changes a set of process specific parameters + * ARGUMENTS: + * ProcessHandle = Handle to the process + * ProcessInformationClass = Index to a information structure. + * + * ProcessBasicInformation PROCESS_BASIC_INFORMATION + * ProcessQuotaLimits QUOTA_LIMITS + * ProcessBasePriority KPRIORITY + * ProcessRaisePriority KPRIORITY + * ProcessDebugPort HANDLE + * ProcessExceptionPort HANDLE + * ProcessAccessToken PROCESS_ACCESS_TOKEN + * ProcessDefaultHardErrorMode ULONG + * ProcessPriorityClass ULONG + * ProcessAffinityMask KAFFINITY + * + * ProcessInformation = Caller supplies storage for information to set. + * ProcessInformationLength = Size of the information structure + * RETURNS: Status +*/ +NTSTATUS +STDCALL +NtSetInformationProcess( + IN HANDLE ProcessHandle, + IN CINT ProcessInformationClass, + IN PVOID ProcessInformation, + IN ULONG ProcessInformationLength + ); +/* + * 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 + * 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 CINT ThreadInformationClass, + IN PVOID ThreadInformation, + IN ULONG ThreadInformationLength + ); +//FIXME: Are the arguments correct +/* + * FUNCTION: Sets a 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 + ); +//FIXME: Should I have more parameters ? + +typedef struct + { + } LDT_ENTR, *PLDT_ENTR; + +/* + * FUNCTION: Initializes the Local Descriptor Table + * ARGUMENTS: + * ProcessHandle = + * LdtEntry = + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtSetLdtEntries( + HANDLE ProcessHandle, + PLDT_ENTR LdtEntry + ); + +//FIXME: Should Value be a void pointer or a pointer to a unicode string ? +/* + * 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 ValueName, + IN PVOID 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 CINT 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 + ); +/* + * FUNCTION: Sets the characteristics of a timer + * ARGUMENTS: + * TimerHandle = + * DueTime = + * CompletionRoutine = + * ArgToCompletionRoutine = + * Resume = + * Period = + * RETURNS: Status +*/ +NTSTATUS +STDCALL +NtSetTimer( + IN HANDLE TimerHandle, + IN PLARGE_INTEGER DueTime, + IN PTIMERAPCROUTINE CompletionRoutine, + IN PVOID ArgToCompletionRoutine, + IN BOOL Resume, + IN ULONG Period + ); +/* + * 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 + ); +/* + * 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 + * 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 + ); +/* + * FUNCTION: Sets the volume information of a file. + * ARGUMENTS: + * FileHandle = Handle to the file + * VolumeInformationClass = specifies the particular volume information to set + * VolumeInformation = pointer to a structure containing the new volume information + * Length = size of the structure. + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtSetVolumeInformationFile( + IN HANDLE FileHandle, + IN CINT VolumeInformationClass, + PVOID VolumeInformation, + ULONG Length + ); +/* + * FUNCTION: Shuts the system down + * ARGUMENTS: + * Action: + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtShutdownSystem( + IN SHUTDOWN_ACTION Action + ); +/* + * FUNCTION: Signals an event and wait for it to be signaled again. + * ARGUMENTS: + * EventHandle = Handle to the event that should be signaled + * Alertable = True if the wait is alertable + * Time = The time to wait + * NumberOfWaitingThreads = Number of waiting threads + * RETURNS: Status + */ + +NTSTATUS +STDCALL +NtSignalAndWaitForSingleObject( + IN HANDLE EventHandle, + IN BOOLEAN Alertable, + IN PLARGE_INTEGER Time, + PULONG NumberOfWaitingThreads OPTIONAL + ); +/* + * FUNCTION: Increments a thread's resume count + * ARGUMENTS: + * ThreadHandle = Handle to the thread that should be resumed + * SuspendCount = The resulting 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 + ); + +//--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 + ); +/* + * 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 + ); +/* + * FUNCTION: Test to see if there are any pending alerts for the calling thread + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtTestAlert( + VOID + ); +/* + * FUNCTION: Unloads a driver. + * ARGUMENTS: + * DriverServiceName = Name of the driver to unload + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtUnloadDriver( + IN PUNICODE_STRING DriverServiceName + ); + +//FIXME: NtUnloadKey needs more arguments +/* + * FUNCTION: Unload 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 + ); + +/* + * 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. + * StartAddress = StartAddress of the range of bytes to unlock + * NumberOfBytesToUnlock = Number of bytes to unlock. + * NumberOfBytesUnlocked (OUT) = Number of bytes actually unlocked. + * REMARK: + This procedure maps to the win32 procedure UnlockFileEx + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtUnlockFile( + IN HANDLE FileHandle, + OUT IO_STATUS_BLOCK IoStatusBlock, + IN LARGE_INTEGER StartAddress, + IN LARGE_INTEGER NumberOfBytesToUnlock, + OUT PLARGE_INTEGER NumberOfBytesUnlocked OPTIONAL + ); + +/* + * 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 + */ +NTSTATUS +STDCALL +NtUnlockVirtualMemory( + HANDLE ProcessHandle, + PVOID BaseAddress, + ULONG NumberOfBytesToUnlock, + 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 + ); +/* + * FUNCTION: Waits for multiple objects to become signalled. + * ARGUMENTS: + * Count = The number of objects + * Object = The array of object handles + * WaitType = + * 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 PHANDLE 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 PHANDLE Object, + IN BOOLEAN Alertable, + IN PLARGE_INTEGER Time + ); +/* + * FUNCTION: Writes data to a file + * ARGUMENTS: + * FileHandle = The handle a file ( from NtCreateFile ) + * 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. + * 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 + */ +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 + ); + +/* + * 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. + * Key = Unused + * REMARKS: + * This function maps to the win32 WriteFile. + * Callers to NtWriteFile should run at IRQL PASSIVE_LEVEL. + * RETURNS: Status + */ + +NTSTATUS +STDCALL NtWriteFileScatter( + IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN LARGE_INTEGER BufferDescription[], + IN ULONG BufferLength, + IN PLARGE_INTEGER ByteOffset, + IN PULONG Key OPTIONAL + ); + +/* + * 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 + ); +/* + * FUNCTION: Yields the callers thread. + * RETURNS: Status + */ +NTSTATUS +STDCALL +NtYieldExecution( + VOID + ); + + + +#endif /* __DDK_ZW_H */ diff --git a/reactos/include/funcs.h b/reactos/include/funcs.h index 64fe7062c26..9c52234300b 100644 --- a/reactos/include/funcs.h +++ b/reactos/include/funcs.h @@ -1,7484 +1,7484 @@ -/* - 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 - -#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 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 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 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 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 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 - ); - -LONG -STDCALL -InterlockedIncrement( - LPLONG lpAddend - ); - -LONG -STDCALL -InterlockedDecrement( - LPLONG lpAddend - ); - -LONG -STDCALL -InterlockedExchange( - LPLONG Target, - LONG Value - ); - -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 - ); - -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 - ); - - -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 - ); - - -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 WIN95 -HKL -STDCALL -ActivateKeyboardLayout( - HKL hkl, - UINT Flags); -#else -WINBOOL -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); - - -int -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); - - -LONG -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 -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, HDC, CONST RECT *, UINT); - -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); - -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 *); - -HENHMETAFILE -STDCALL -SetWinMetaFileBits(UINT, CONST BYTE *, HDC, CONST METAFILEPICT *); - -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 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); -*/ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _GNU_H_WINDOWS32_FUNCTIONS */ +/* + 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 + +#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 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 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 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 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 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 + ); + +LONG +STDCALL +InterlockedIncrement( + LPLONG lpAddend + ); + +LONG +STDCALL +InterlockedDecrement( + LPLONG lpAddend + ); + +LONG +STDCALL +InterlockedExchange( + LPLONG Target, + LONG Value + ); + +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 + ); + +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 + ); + + +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 + ); + + +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 WIN95 +HKL +STDCALL +ActivateKeyboardLayout( + HKL hkl, + UINT Flags); +#else +WINBOOL +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); + + +int +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); + + +LONG +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 +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, HDC, CONST RECT *, UINT); + +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); + +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 *); + +HENHMETAFILE +STDCALL +SetWinMetaFileBits(UINT, CONST BYTE *, HDC, CONST METAFILEPICT *); + +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 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); +*/ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _GNU_H_WINDOWS32_FUNCTIONS */ diff --git a/reactos/include/internal/ctype.h b/reactos/include/internal/ctype.h index 838ef933d16..49439552642 100644 --- a/reactos/include/internal/ctype.h +++ b/reactos/include/internal/ctype.h @@ -1,6 +1,9 @@ #ifndef _LINUX_CTYPE_H #define _LINUX_CTYPE_H + +#ifdef USE_OLD_CTYPE_IMPLEMENTATION + #define _U 0x01 /* upper */ #define _L 0x02 /* lower */ #define _D 0x04 /* digit */ @@ -31,4 +34,38 @@ extern char _ctmp; #define tolower(c) (_ctmp=c,isupper(_ctmp)?_ctmp-('A'-'a'):_ctmp) #define toupper(c) (_ctmp=c,islower(_ctmp)?_ctmp-('a'-'A'):_ctmp) +#else + +#define upalpha ('A' - 'a') + +extern inline char toupper(char c) +{ + if ((c>='a') && (c<='z')) return (c+upalpha); + return(c); +} + +extern inline int islower(char c) +{ + if ((c>='a') && (c<='z')) return 1; + return 0; +} + +extern inline int isdigit(char c) +{ + if ((c>='0') && (c<='9')) return 1; + return 0; +} + +extern inline int isxdigit(char c) +{ + if (((c>='0') && (c<='9')) || ((toupper(c)>='A') && (toupper(c)<='Z'))) + { + return 1; + } + return 0; +} + + +#endif + #endif diff --git a/reactos/include/internal/debug.h b/reactos/include/internal/debug.h index 055c54ec2e7..6c8a05f9c30 100644 --- a/reactos/include/internal/debug.h +++ b/reactos/include/internal/debug.h @@ -1,70 +1,72 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: include/internal/debug.h - * PURPOSE: Useful debugging macros - * PROGRAMMER: David Welch (welch@mcmail.com) - * UPDATE HISTORY: - * 28/05/98: Created - */ - -/* - * NOTE: Define NDEBUG before including this header to disable debugging - * macros - */ - -#ifndef __INTERNAL_DEBUG -#define __INTERNAL_DEBUG - - -#ifndef NDEBUG -#define DPRINT(fmt,args...) do { printk("(%s:%d) ",__FILE__,__LINE__); printk(fmt,args); } while(0); -//#define assert(x) if (!(x)) {printk("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); (*((unsigned int *)0))=1; for (;;); } -#define assert(x) if (!(x)) {printk("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); for (;;); } -#define CHECKPOINT printk("%s:%d\n",__FILE__,__LINE__) -#else -#define DPRINT(fmt,args...) -#define assert(x) -#define CHECKPOINT -#endif /* NDEBUG */ - -/* - * FUNCTION: Assert a maximum value for the current irql - * ARGUMENTS: - * x = Maximum irql - */ -#define ASSERT_IRQL(x) assert(KeGetCurrentIrql()<=(x)) - -#define HBP_EXECUTE (0) -#define HBP_WRITE (1) -#define HBP_READWRITE (3) - -#define HBP_BYTE (0) -#define HBP_WORD (1) -#define HBP_DWORD (3) - -/* - * FUNCTION: Sets a hardware breakpoint - * ARGUMENTS: - * i = breakpoint to set (0 to 3) - * addr = linear address to break on - * type = Type of access to break on - * len = length of the variable to watch - * NOTES: - * The variable to watch must be aligned to its length (i.e. a dword - * breakpoint must be aligned to a dword boundary) - * - * A fatal exception will be generated on the access to the variable. - * It is (at the moment) only really useful for catching undefined - * pointers if you know the variable effected but not the buggy - * routine. - * - * FIXME: Extend to call out to kernel debugger on breakpoint - * Add support for I/O breakpoints - * REFERENCES: See the i386 programmer manual for more details - */ -void set_breakpoint(unsigned int i, unsigned int addr, unsigned int type, - unsigned int len); - - -#endif /* __INTERNAL_DEBUG */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/internal/debug.h + * PURPOSE: Useful debugging macros + * PROGRAMMER: David Welch (welch@mcmail.com) + * UPDATE HISTORY: + * 28/05/98: Created + */ + +/* + * NOTE: Define NDEBUG before including this header to disable debugging + * macros + */ + +#ifndef __INTERNAL_DEBUG +#define __INTERNAL_DEBUG + +#define UNIMPLEMENTED do {printk("%s at %s:%d is umimplemented, have a nice day\n",__FUNCTION__,__FILE__,__LINE__); for(;;); } while(0); + +#ifndef NDEBUG +#define DPRINT(fmt,args...) do { printk("(%s:%d) ",__FILE__,__LINE__); printk(fmt,args); } while(0); +//#define assert(x) if (!(x)) {printk("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); (*((unsigned int *)0))=1; for (;;); } +#define assert(x) if (!(x)) {printk("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); for (;;); } +#define CHECKPOINT printk("%s:%d\n",__FILE__,__LINE__) +#else +#define DPRINT(fmt,args...) +#define assert(x) +#define CHECKPOINT +#endif /* NDEBUG */ + +/* + * FUNCTION: Assert a maximum value for the current irql + * ARGUMENTS: + * x = Maximum irql + */ +#define ASSERT_IRQL(x) assert(KeGetCurrentIrql()<=(x)) +#define assert_irql(x) assert(KeGetCurrentIrql()<=(x)) + +#define HBP_EXECUTE (0) +#define HBP_WRITE (1) +#define HBP_READWRITE (3) + +#define HBP_BYTE (0) +#define HBP_WORD (1) +#define HBP_DWORD (3) + +/* + * FUNCTION: Sets a hardware breakpoint + * ARGUMENTS: + * i = breakpoint to set (0 to 3) + * addr = linear address to break on + * type = Type of access to break on + * len = length of the variable to watch + * NOTES: + * The variable to watch must be aligned to its length (i.e. a dword + * breakpoint must be aligned to a dword boundary) + * + * A fatal exception will be generated on the access to the variable. + * It is (at the moment) only really useful for catching undefined + * pointers if you know the variable effected but not the buggy + * routine. + * + * FIXME: Extend to call out to kernel debugger on breakpoint + * Add support for I/O breakpoints + * REFERENCES: See the i386 programmer manual for more details + */ +void set_breakpoint(unsigned int i, unsigned int addr, unsigned int type, + unsigned int len); + + +#endif /* __INTERNAL_DEBUG */ diff --git a/reactos/include/internal/hal/ddk.h b/reactos/include/internal/hal/ddk.h index 26f9343f839..8e17bc4105e 100644 --- a/reactos/include/internal/hal/ddk.h +++ b/reactos/include/internal/hal/ddk.h @@ -114,33 +114,4 @@ BOOLEAN HalTranslateBusAddress(INTERFACE_TYPE InterfaceType, PULONG AddressSpace, PPHYSICAL_ADDRESS TranslatedAddress); -struct __xchg_dummy { unsigned long a[100]; }; -#define __xg(x) ((struct __xchg_dummy *)(x)) - -extern inline LONG InterlockedDecrement(PLONG Addend) -/* - * FUNCTION: Decrements a variable as an atomic operations - * ARGUMENTS: - * Addend = Value to be decremented - * RETURNS: The decremented value - */ -{ -} - -extern inline LONG InterlockedExchange(PLONG Target, LONG Value) -/* - * FUNCTION: Sets a variable as an atomic operation - * ARGUMENTS: - * Target = Variable to be set - * Value = Caller specified value to set - * RETURNS: The previous value of the target - */ -{ - __asm__("xchgl %0,%1" - :"=r" (Value) - :"m" (*__xg(Target)), "0" (Value) - :"memory"); - return(Value); -} - #endif /* __INCLUDE_INTERNAL_HAL_DDK_H */ diff --git a/reactos/include/internal/hal/hal.h b/reactos/include/internal/hal/hal.h index 71042bbba61..21ea94a7546 100644 --- a/reactos/include/internal/hal/hal.h +++ b/reactos/include/internal/hal/hal.h @@ -1,71 +1,71 @@ -/* - * - */ - -#ifndef __INTERNAL_HAL_HAL_H -#define __INTERNAL_HAL_HAL_H - -typedef struct -{ - unsigned short previous_task; - unsigned short reserved1; - unsigned long esp0; - unsigned short ss0; - unsigned short reserved2; - unsigned long esp1; - unsigned short ss1; - unsigned short reserved3; - unsigned long esp2; - unsigned short ss2; - unsigned short reserved4; - unsigned long cr3; - unsigned long eip; - unsigned long eflags; - unsigned long eax; - unsigned long ecx; - unsigned long edx; - unsigned long ebx; - unsigned long esp; - unsigned long ebp; - unsigned long esi; - unsigned long edi; - unsigned short es; - unsigned short reserved5; - unsigned short cs; - unsigned short reserved6; - unsigned short ss; - unsigned short reserved7; - unsigned short ds; - unsigned short reserved8; - unsigned short fs; - unsigned short reserved9; - unsigned short gs; - unsigned short reserved10; - unsigned short ldt; - unsigned short reserved11; - unsigned short trap; - unsigned short iomap_base; - - unsigned short nr; - - unsigned char io_bitmap[1]; -} hal_thread_state; - -/* - * FUNCTION: Probes for a PCI bus - * RETURNS: True if found - */ -BOOL HalPciProbe(void); - -/* - * FUNCTION: Probes for a BIOS32 extension - */ -VOID Hal_bios32_probe(VOID); - -/* - * FUNCTION: Determines if a a bios32 service is present - */ -BOOLEAN Hal_bios32_is_service_present(ULONG service); - - -#endif /* __INTERNAL_HAL_HAL_H */ +/* + * + */ + +#ifndef __INTERNAL_HAL_HAL_H +#define __INTERNAL_HAL_HAL_H + +typedef struct +{ + unsigned short previous_task; + unsigned short reserved1; + unsigned long esp0; + unsigned short ss0; + unsigned short reserved2; + unsigned long esp1; + unsigned short ss1; + unsigned short reserved3; + unsigned long esp2; + unsigned short ss2; + unsigned short reserved4; + unsigned long cr3; + unsigned long eip; + unsigned long eflags; + unsigned long eax; + unsigned long ecx; + unsigned long edx; + unsigned long ebx; + unsigned long esp; + unsigned long ebp; + unsigned long esi; + unsigned long edi; + unsigned short es; + unsigned short reserved5; + unsigned short cs; + unsigned short reserved6; + unsigned short ss; + unsigned short reserved7; + unsigned short ds; + unsigned short reserved8; + unsigned short fs; + unsigned short reserved9; + unsigned short gs; + unsigned short reserved10; + unsigned short ldt; + unsigned short reserved11; + unsigned short trap; + unsigned short iomap_base; + + unsigned short nr; + + unsigned char io_bitmap[1]; +} hal_thread_state; + +/* + * FUNCTION: Probes for a PCI bus + * RETURNS: True if found + */ +BOOL HalPciProbe(void); + +/* + * FUNCTION: Probes for a BIOS32 extension + */ +VOID Hal_bios32_probe(VOID); + +/* + * FUNCTION: Determines if a a bios32 service is present + */ +BOOLEAN Hal_bios32_is_service_present(ULONG service); + + +#endif /* __INTERNAL_HAL_HAL_H */ diff --git a/reactos/include/internal/hal/page.h b/reactos/include/internal/hal/page.h index 2ac6cb2c48d..b185bb5b131 100644 --- a/reactos/include/internal/hal/page.h +++ b/reactos/include/internal/hal/page.h @@ -48,6 +48,11 @@ extern inline unsigned int physical_to_linear(unsigned int x) return(x+IDMAP_BASE); } +extern inline unsigned int linear_to_physical(unsigned int x) +{ + return(x-IDMAP_BASE); +} + #define FLUSH_TLB __asm__("movl %cr3,%eax\n\tmovl %eax,%cr3\n\t") extern inline unsigned int* get_page_directory(void) diff --git a/reactos/include/internal/iomgr.h b/reactos/include/internal/iomgr.h index 501a19ed2c2..3068ce2bcb1 100644 --- a/reactos/include/internal/iomgr.h +++ b/reactos/include/internal/iomgr.h @@ -8,16 +8,11 @@ * 28/05/97: Created */ -#ifndef __INTERNAL_IOMGR_H -#define __INTERNAL_IOMGR_H +#ifndef __INCLUDE_INTERNAL_IOMGR_H +#define __INCLUDE_INTERNAL_IOMGR_H #include -/* - * FUNCTION: - */ -NTSTATUS IoBeginIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp); - /* * FUNCTION: Called to initalize a loaded driver * ARGUMENTS: @@ -26,4 +21,7 @@ NTSTATUS IoBeginIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp); */ NTSTATUS InitalizeLoadedDriver(PDRIVER_INITIALIZE entry); +VOID IoInitCancelHandling(VOID); + + #endif diff --git a/reactos/include/internal/kernel.h b/reactos/include/internal/kernel.h index 329a7ab92ab..28d17060a7d 100644 --- a/reactos/include/internal/kernel.h +++ b/reactos/include/internal/kernel.h @@ -1,93 +1,109 @@ -/* - * Various useful prototypes - */ - -#ifndef __KERNEL_H -#define __KERNEL_H - -#include -#include - -#include -#include - -VOID KiInterruptDispatch(unsigned int irq); -VOID KiDispatchInterrupt(unsigned int irq); -VOID KeTimerInterrupt(VOID); - -/* - * Defines a descriptor as it appears in the processor tables - */ -typedef struct -{ - unsigned int a; - unsigned int b; -} descriptor; - -extern descriptor idt[256]; -extern descriptor gdt[256]; - -/* - * printf style functions - */ -asmlinkage void printk(const char* fmt, ...); -int vsprintf(char *buf, const char *fmt, va_list args); -int sprintf(char* buf, const char* fmt, ...); - -typedef struct -{ - /* - * Magic value (useless really) - */ - unsigned int magic; - - /* - * Cursor position - */ - unsigned int cursorx; - unsigned int cursory; - - /* - * Number of files (including the kernel) loaded - */ - unsigned int nr_files; - - /* - * Range of physical memory being used by the system - */ - unsigned int start_mem; - unsigned int end_mem; - - /* - * List of module lengths (terminated by a 0) - */ - unsigned int module_length[64]; -} boot_param; - - -/* - * Initalization functions (called once by main()) - */ -void MmInitalize(boot_param* bp); -void InitalizeExceptions(void); -void InitalizeIRQ(void); -void InitializeTimer(void); -void InitConsole(boot_param* bp); -void KeInitDpc(void); -void HalInit(boot_param* bp); -void IoInit(void); -void ObjNamespcInit(void); -void PsMgrInit(void); - - -/* - * FUNCTION: Called to execute queued dpcs - */ -void KeDrainDpcQueue(void); - -void KeExpireTimers(void); - -typedef unsigned int (exception_hook)(CONTEXT* c, unsigned int exp); -asmlinkage unsigned int ExHookException(exception_hook fn, UINT exp); - -#endif +/* + * Various useful prototypes + */ + +#ifndef __KERNEL_H +#define __KERNEL_H + +#include +#include + +#include +#include + +/* + * Use these to place a function in a specific section of the executable + */ +#define PLACE_IN_SECTION(s) __attribute__((section (s))) +#define INIT_FUNCTION (PLACE_IN_SECTION("init")) +#define PAGE_LOCKED_FUNCTION (PLACE_IN_SECTION("pagelk")) +#define PAGE_UNLOCKED_FUNCTION (PLACE_IN_SECTION("pagepo")) + +/* + * Maximum size of the kmalloc area (this is totally arbitary) + */ +#define NONPAGED_POOL_SIZE (4*1024*1024) + +VOID KiInterruptDispatch(unsigned int irq); +VOID KiDispatchInterrupt(unsigned int irq); +VOID KeTimerInterrupt(VOID); + +/* + * Defines a descriptor as it appears in the processor tables + */ +typedef struct +{ + unsigned int a; + unsigned int b; +} descriptor; + +extern descriptor idt[256]; +extern descriptor gdt[256]; + +/* + * printf style functions + */ +asmlinkage void printk(const char* fmt, ...); +int vsprintf(char *buf, const char *fmt, va_list args); +int sprintf(char* buf, const char* fmt, ...); + +typedef struct +{ + /* + * Magic value (useless really) + */ + unsigned int magic; + + /* + * Cursor position + */ + unsigned int cursorx; + unsigned int cursory; + + /* + * Number of files (including the kernel) loaded + */ + unsigned int nr_files; + + /* + * Range of physical memory being used by the system + */ + unsigned int start_mem; + unsigned int end_mem; + + /* + * List of module lengths (terminated by a 0) + */ + unsigned int module_length[64]; +} boot_param; + + +/* + * Initalization functions (called once by main()) + */ +void MmInitalize(boot_param* bp); +void InitalizeExceptions(void); +void InitalizeIRQ(void); +void InitializeTimer(void); +void InitConsole(boot_param* bp); +void KeInitDpc(void); +void HalInit(boot_param* bp); +void IoInit(void); +void ObjNamespcInit(void); +void PsMgrInit(void); +void KeInitializeBugCheck(void); +VOID KeInitializeDispatcher(VOID); +void TstBegin(void); +void KeCalibrateTimerLoop(void); + +/* + * FUNCTION: Called to execute queued dpcs + */ +void KeDrainDpcQueue(void); + +void KeExpireTimers(void); + +typedef unsigned int (exception_hook)(CONTEXT* c, unsigned int exp); +asmlinkage unsigned int ExHookException(exception_hook fn, UINT exp); + +#endif diff --git a/reactos/include/internal/mm.h b/reactos/include/internal/mm.h index 15080c760e5..8d9581ce095 100644 --- a/reactos/include/internal/mm.h +++ b/reactos/include/internal/mm.h @@ -1,146 +1,146 @@ -/* - * Higher level memory managment definitions - */ - -#ifndef __MM_H -#define __MM_H - -#define PAGE_SYSTEM (0x80000000) - -#include -#include -#include - -typedef struct _memory_area -/* - * PURPOSE: Describes an area of virtual memory - */ -{ - /* - * Access protection - */ - unsigned int access; - - /* - * Memory region base - */ - unsigned int base; - - /* - * Memory region length - */ - unsigned int length; - - /* - * Memory type (Mapped file, mapped from an executable or private) - */ - unsigned int type; - - /* - * Memory region state (committed, reserved or free) - */ - unsigned int state; - - /* - * Original access protection - */ - unsigned int initial_access; - - /* - * Used to maintain the linked list of memory areas - */ - struct _memory_area* previous; - struct _memory_area* next; - - /* - * True the region is locked - */ - BOOL lock; - - /* - * FUNCTION: Decommits all the pages in the regions - */ - void (*free)(struct _memory_area* marea); - - /* - * FUNCTION: Handles a page fault by loading the required page - * RECEIVES: - * marea = the memory area - * address = the relative address of the page to load - * RETURNS: - * TRUE = the access should be restarted - * FALSE = the access was illegal and an exception should - * be generated - * NOTES: This function is guarrented to be called within the context - * of the thread which required a page to be loaded - */ - BOOL (*load_page)(struct _memory_area* marea, unsigned int address); -} memory_area; - - -/* - * FUNCTION: Gets a page with a restricted max physical address (i.e. - * suitable for dma) - * RETURNS: - * The physical address of the page if it succeeds - * NULL if it fails. - * NOTES: This is very inefficent because the list isn't sorted. On the - * other hand sorting the list would be quite expensive especially if dma - * is only used infrequently. Perhaps a special cache of dma pages should - * be maintained? - */ -unsigned int get_dma_page(unsigned int max_address); - -/* - * FUNCTION: Allocate a page and return its physical address - * RETURNS: The physical address of the page allocated - */ -asmlinkage unsigned int get_free_page(void); - -/* - * FUNCTION: Adds pages to the free list - * ARGUMENTS: - * physical_base = Physical address of the base of the region to - * be freed - * nr = number of continuous pages to free - */ -asmlinkage void free_page(unsigned int physical_base, unsigned int nr); - -/* - * FUNCTION: Returns the physical address mapped by a given virtual address - * ARGUMENTS: - * vaddr = virtual address to query - * RETURNS: The physical address if present in memory - * Zero if paged out or invalid - * NOTE: This doesn't do any synchronization - */ -unsigned int get_page_physical_address(unsigned int vaddr); - -void mark_page_not_writable(unsigned int vaddr); - -void VirtualInit(boot_param* bp); - -/* - * FUNCTION: Returns the first memory area starting in the region or the last - * one before the start of the region - * ARGUMENTS: - * list_head = Head of the list of memory areas to search - * base = base address of the region - * length = length of the region - * RETURNS: A pointer to the area found or - * NULL if the region was before the first region on the list - */ -memory_area* find_first_marea(memory_area* list_head, unsigned int base, - unsigned int length); - -/* - * Head of the list of system memory areas - */ -extern memory_area* system_memory_area_list_head; - -/* - * Head of the list of user memory areas (this should be per process) - */ -extern memory_area* memory_area_list_head; - -#endif +/* + * Higher level memory managment definitions + */ + +#ifndef __MM_H +#define __MM_H + +#define PAGE_SYSTEM (0x80000000) + +#include +#include +#include + +typedef struct _memory_area +/* + * PURPOSE: Describes an area of virtual memory + */ +{ + /* + * Access protection + */ + unsigned int access; + + /* + * Memory region base + */ + unsigned int base; + + /* + * Memory region length + */ + unsigned int length; + + /* + * Memory type (Mapped file, mapped from an executable or private) + */ + unsigned int type; + + /* + * Memory region state (committed, reserved or free) + */ + unsigned int state; + + /* + * Original access protection + */ + unsigned int initial_access; + + /* + * Used to maintain the linked list of memory areas + */ + struct _memory_area* previous; + struct _memory_area* next; + + /* + * True the region is locked + */ + BOOL lock; + + /* + * FUNCTION: Decommits all the pages in the regions + */ + void (*free)(struct _memory_area* marea); + + /* + * FUNCTION: Handles a page fault by loading the required page + * RECEIVES: + * marea = the memory area + * address = the relative address of the page to load + * RETURNS: + * TRUE = the access should be restarted + * FALSE = the access was illegal and an exception should + * be generated + * NOTES: This function is guarrented to be called within the context + * of the thread which required a page to be loaded + */ + BOOL (*load_page)(struct _memory_area* marea, unsigned int address); +} memory_area; + + +/* + * FUNCTION: Gets a page with a restricted max physical address (i.e. + * suitable for dma) + * RETURNS: + * The physical address of the page if it succeeds + * NULL if it fails. + * NOTES: This is very inefficent because the list isn't sorted. On the + * other hand sorting the list would be quite expensive especially if dma + * is only used infrequently. Perhaps a special cache of dma pages should + * be maintained? + */ +unsigned int get_dma_page(unsigned int max_address); + +/* + * FUNCTION: Allocate a page and return its physical address + * RETURNS: The physical address of the page allocated + */ +asmlinkage unsigned int get_free_page(void); + +/* + * FUNCTION: Adds pages to the free list + * ARGUMENTS: + * physical_base = Physical address of the base of the region to + * be freed + * nr = number of continuous pages to free + */ +asmlinkage void free_page(unsigned int physical_base, unsigned int nr); + +/* + * FUNCTION: Returns the physical address mapped by a given virtual address + * ARGUMENTS: + * vaddr = virtual address to query + * RETURNS: The physical address if present in memory + * Zero if paged out or invalid + * NOTE: This doesn't do any synchronization + */ +unsigned int get_page_physical_address(unsigned int vaddr); + +void mark_page_not_writable(unsigned int vaddr); + +void VirtualInit(boot_param* bp); + +/* + * FUNCTION: Returns the first memory area starting in the region or the last + * one before the start of the region + * ARGUMENTS: + * list_head = Head of the list of memory areas to search + * base = base address of the region + * length = length of the region + * RETURNS: A pointer to the area found or + * NULL if the region was before the first region on the list + */ +memory_area* find_first_marea(memory_area* list_head, unsigned int base, + unsigned int length); + +/* + * Head of the list of system memory areas + */ +extern memory_area* system_memory_area_list_head; + +/* + * Head of the list of user memory areas (this should be per process) + */ +extern memory_area* memory_area_list_head; + +#endif diff --git a/reactos/include/internal/module.h b/reactos/include/internal/module.h index c311b8ef5ae..c76e0d0ecae 100644 --- a/reactos/include/internal/module.h +++ b/reactos/include/internal/module.h @@ -1,34 +1,34 @@ - -#ifndef __MODULE_H -#define __MODULE_H - -#include - -typedef struct -/* - * - */ -{ - unsigned int text_base; - unsigned int data_base; - unsigned int bss_base; - SCNHDR* scn_list; - char* str_tab; - SYMENT* sym_list; - unsigned int size; - - /* - * Base address of the module in memory - */ - unsigned int base; - - /* - * Offset of the raw data in memory - */ - unsigned int raw_data_off; -} module; - -int process_boot_module(unsigned int start); - -#endif - + +#ifndef __MODULE_H +#define __MODULE_H + +#include + +typedef struct +/* + * + */ +{ + unsigned int text_base; + unsigned int data_base; + unsigned int bss_base; + SCNHDR* scn_list; + char* str_tab; + SYMENT* sym_list; + unsigned int size; + + /* + * Base address of the module in memory + */ + unsigned int base; + + /* + * Offset of the raw data in memory + */ + unsigned int raw_data_off; +} module; + +BOOLEAN process_boot_module(unsigned int start); + +#endif + diff --git a/reactos/include/internal/objmgr.h b/reactos/include/internal/objmgr.h index d8078551081..5614812bb13 100644 --- a/reactos/include/internal/objmgr.h +++ b/reactos/include/internal/objmgr.h @@ -43,11 +43,12 @@ enum OBJTYP_MAX, }; -BOOL ObjAddObjectToNameSpace(const char* path, POBJECT_HEADER Object); +BOOL ObAddObjectToNameSpace(PUNICODE_STRING path, POBJECT_HEADER Object); VOID ObRegisterType(CSHORT id, OBJECT_TYPE* type); -VOID ObInitializeObjectHeader(CSHORT id, LPCSTR name, POBJECT_HEADER obj); +VOID ObInitializeObjectHeader(CSHORT id, PUNICODE_STRING name, + POBJECT_HEADER obj); /* * FUNCTION: Get the size of an object @@ -59,7 +60,7 @@ ULONG ObSizeOf(CSHORT Type); HANDLE ObAddHandle(PVOID obj); PVOID ObGetObjectByHandle(HANDLE h); -PVOID ObLookupObject(PDIRECTORY_OBJECT root, const char* _string); +PVOID ObLookupObject(PDIRECTORY_OBJECT root, PUNICODE_STRING _string); PVOID ObGenericCreateObject(PHANDLE Handle, ACCESS_MASK DesiredAccess, POBJECT_ATTRIBUTES ObjectAttributes, diff --git a/reactos/include/internal/pool.h b/reactos/include/internal/pool.h index 8baa905d9bc..0b5fd1a142e 100644 --- a/reactos/include/internal/pool.h +++ b/reactos/include/internal/pool.h @@ -1,19 +1,11 @@ -#ifndef __INTERNAL_POOL_H -#define __INTERNAL_POOL_H - -#include - -#include - -/* - * Maximum size of the kmalloc area (this is totally arbitary) - */ -#define NONPAGED_POOL_SIZE (4*1024*1024) - -/* - * Allocates an arbitary sized block at any alignment - */ -//asmlinkage void* ExAllocatePool(ULONG size); -//asmlinkage void ExFreePool(void* block); - -#endif /* __INTERNAL_POOL_H */ +#ifndef __INTERNAL_POOL_H +#define __INTERNAL_POOL_H + +#include + +#include + +static PVOID ExAllocatePagedPool(POOL_TYPE Type, ULONG size); +static PVOID ExAllocateNonPagedPool(POOL_TYPE Type, ULONG size); + +#endif /* __INTERNAL_POOL_H */ diff --git a/reactos/include/internal/psmgr.h b/reactos/include/internal/psmgr.h index d0775b4c25c..75b9cc4099b 100644 --- a/reactos/include/internal/psmgr.h +++ b/reactos/include/internal/psmgr.h @@ -1,50 +1,48 @@ -#ifndef __INCLUDE_INTERNAL_PSMGR_H -#define __INCLUDE_INTERNAL_PSMGR_H - -#include - -void PsInitThreadManagment(void); - -/* - * PURPOSE: Thread states - */ -enum -{ - /* - * PURPOSE: Don't touch - */ - THREAD_STATE_INVALID, - - /* - * PURPOSE: Waiting to be dispatched - */ - THREAD_STATE_RUNNABLE, - - /* - * PURPOSE: Currently running - */ - THREAD_STATE_RUNNING, - - /* - * PURPOSE: Doesn't want to run - */ - THREAD_STATE_SLEEPING, - - /* - * Waiting to be freed - */ - THREAD_STATE_TERMINATED, -}; - -NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); - -/* - * Functions the HAL must provide - */ - -void HalInitFirstTask(PTHREAD_OBJECT thread); -void HalInitTask(PTHREAD_OBJECT thread, PKSTART_ROUTINE fn, - PVOID StartContext); -void HalTaskSwitch(PTHREAD_OBJECT thread); - -#endif +#ifndef __INCLUDE_INTERNAL_PSMGR_H +#define __INCLUDE_INTERNAL_PSMGR_H + +#include + +void PsInitThreadManagment(void); + +/* + * PURPOSE: Thread states + */ +enum +{ + /* + * PURPOSE: Don't touch + */ + THREAD_STATE_INVALID, + + /* + * PURPOSE: Waiting to be dispatched + */ + THREAD_STATE_RUNNABLE, + + /* + * PURPOSE: Currently running + */ + THREAD_STATE_RUNNING, + + /* + * PURPOSE: Doesn't want to run + */ + THREAD_STATE_SUSPENDED, + + /* + * Waiting to be freed + */ + THREAD_STATE_TERMINATED, +}; + +/* + * Functions the HAL must provide + */ + +void HalInitFirstTask(PKTHREAD thread); +BOOLEAN HalInitTask(PKTHREAD thread, PKSTART_ROUTINE fn, + PVOID StartContext); +void HalTaskSwitch(PKTHREAD thread); + +#endif diff --git a/reactos/include/internal/version.h b/reactos/include/internal/version.h index a809d46f8fb..3ae250cec74 100644 --- a/reactos/include/internal/version.h +++ b/reactos/include/internal/version.h @@ -9,9 +9,9 @@ #ifndef __VERSION_H #define __VERSION_H -#define KERNEL_VERSION "0.0.7" +#define KERNEL_VERSION "0.0.8" #define KERNEL_MAJOR_VERSION 0 #define KERNEL_MINOR_VERSION 0 -#define KERNEL_PATCH_LEVEL 7 +#define KERNEL_PATCH_LEVEL 8 #endif diff --git a/reactos/include/ntdll/pagesize.h b/reactos/include/ntdll/pagesize.h index 6f1bd7134f6..75589588e15 100644 --- a/reactos/include/ntdll/pagesize.h +++ b/reactos/include/ntdll/pagesize.h @@ -1,7 +1,7 @@ -/* - * - */ - -#ifdef i386 -#define PAGESIZE (4096) -#endif +/* + * + */ + +#ifdef i386 +#define PAGESIZE (4096) +#endif diff --git a/reactos/include/types.h b/reactos/include/types.h index 84e7da776df..d7ad3dfe328 100644 --- a/reactos/include/types.h +++ b/reactos/include/types.h @@ -55,7 +55,7 @@ typedef unsigned long long u64; typedef unsigned int size_t; typedef size_t __kernel_size_t; -typedef unsigned short wchar_t; +//typedef unsigned short wchar_t; #endif /* _LINUX_TYPES_H */ diff --git a/reactos/include/windows.h b/reactos/include/windows.h index 207315e7752..fb1899e3cf3 100644 --- a/reactos/include/windows.h +++ b/reactos/include/windows.h @@ -1,86 +1,92 @@ -/* - 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 RC_INVOKED -#include -#include -#endif - -/* Base definitions */ -#include - -/* WIN32 messages */ -#include - -/* WIN32 definitions */ -#include - -#ifndef RC_INVOKED - -/* WIN32 structures */ -#include - -/* WIN32 functions */ -#include - -#endif /* ! defined (RC_INVOKED) */ - -/* WIN32 error codes */ -#include - -#ifndef RC_INVOKED - -/* Windows sockets specification version 1.1 */ -#ifdef Win32_Winsock -#include -#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) */ - -#endif /* _GNU_H_WINDOWS_H */ +/* + 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 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 + +#endif /* ! defined (RC_INVOKED) */ + +/* WIN32 error codes */ +#include + +#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) */ + +#endif /* _GNU_H_WINDOWS_H */ diff --git a/reactos/include/wstring.h b/reactos/include/wstring.h index deb3df8a974..bf4912ad374 100644 --- a/reactos/include/wstring.h +++ b/reactos/include/wstring.h @@ -10,6 +10,8 @@ #include /* for size_t */ +typedef unsigned short wchar_t; + #ifndef NULL #define NULL ((void *) 0) #endif @@ -38,8 +40,8 @@ extern int wcsnicmp(const wchar_t* cs,const wchar_t * ct, size_t count); /* * Include machine specific inline routines */ -#ifndef _I386_STRING_H_ -#define _I386_STRING_H_ +//#ifndef _I386_STRING_H_ +//#define _I386_STRING_H_ /* * On a 486 or Pentium, we are better off not using the @@ -70,7 +72,7 @@ extern int wcsnicmp(const wchar_t* cs,const wchar_t * ct, size_t count); #define __HAVE_ARCH_WCSCPY -inline wchar_t * wcscpy(wchar_t * dest,const wchar_t *src) +extern inline wchar_t * wcscpy(wchar_t * dest,const wchar_t *src) { __asm__ __volatile__( "cld\n" @@ -524,7 +526,7 @@ __asm__ __volatile__( return __res; } -#endif +//#endif #endif #ifdef __cplusplus diff --git a/reactos/lib/kernel32/mem/global.cc b/reactos/lib/kernel32/mem/global.cc index e75316c9ae3..cec05c9b816 100644 --- a/reactos/lib/kernel32/mem/global.cc +++ b/reactos/lib/kernel32/mem/global.cc @@ -1,320 +1,320 @@ -/* - * Win32 Global/Local heap functions (GlobalXXX, LocalXXX). - * These functions included in Win32 for compatibility with 16 bit Windows - * Especially the moveable blocks and handles are oldish. - * But the ability to directly allocate memory with GPTR and LPTR is widely - * used. - */ - -#include - -#define MAGIC_GLOBAL_USED 0x5342BEEF -#define GLOBAL_LOCK_MAX 0xFF - -typedef struct __GLOBAL_LOCAL_HANDLE -{ - ULONG Magic; - LPVOID Pointer; - BYTE Flags; - BYTE LockCount; -} GLOBAL_HANDLE, LOCAL_HANDLE, *PGLOBAL_HANDLE, *PLOCAL_HANDLE; - -/********************************************************************* -* GlobalAlloc -- KERNEL32 * -*********************************************************************/ -HGLOBAL WINAPI GlobalAlloc(UINT flags, DWORD size) -{ - PGLOBAL_HANDLE phandle; - LPVOID palloc; - - aprintf("GlobalAlloc( 0x%X, 0x%lX )\n", flags, size ); - - if((flags & GMEM_MOVEABLE)==0) /* POINTER */ - { - palloc=HeapAlloc(__ProcessHeap, 0, size); - return (HGLOBAL) palloc; - } - else /* HANDLE */ - { - HeapLock(__ProcessHeap); - - - phandle=__HeapAllocFragment(__ProcessHeap, 0, sizeof(GLOBAL_HANDLE)); - if(size) - { - palloc=HeapAlloc(__ProcessHeap, 0, size+sizeof(HANDLE)); - *(PHANDLE)palloc=(HANDLE) &(phandle->Pointer); - phandle->Pointer=palloc+sizeof(HANDLE); - } - else - phandle->Pointer=NULL; - phandle->Magic=MAGIC_GLOBAL_USED; - phandle->Flags=flags>>8; - phandle->LockCount=0; - HeapUnlock(__ProcessHeap); - - return (HGLOBAL) &(phandle->Pointer); - } -} - -/********************************************************************* -* GlobalLock -- KERNEL32 * -*********************************************************************/ -LPVOID WINAPI GlobalLock(HGLOBAL hmem) -{ - PGLOBAL_HANDLE phandle; - LPVOID palloc; - - aprintf("GlobalLock( 0x%lX )\n", (ULONG) hmem ); - - if(((ULONG)hmem%8)==0) - return (LPVOID) hmem; - - HeapLock(__ProcessHeap); - phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); - if(phandle->Magic==MAGIC_GLOBAL_USED) - { - if(phandle->LockCountLockCount++; - palloc=phandle->Pointer; - } - else - { - dprintf("GlobalLock: invalid handle\n"); - palloc=(LPVOID) hmem; - } - HeapUnlock(__ProcessHeap); - return palloc; -} - -/********************************************************************* -* GlobalUnlock -- KERNEL32 * -*********************************************************************/ -BOOL WINAPI GlobalUnlock(HGLOBAL hmem) -{ - PGLOBAL_HANDLE phandle; - BOOL locked; - - aprintf("GlobalUnlock( 0x%lX )\n", (ULONG) hmem ); - - if(((ULONG)hmem%8)==0) - return FALSE; - - HeapLock(__ProcessHeap); - phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); - if(phandle->Magic==MAGIC_GLOBAL_USED) - { - if((phandle->LockCountLockCount>0)) - phandle->LockCount--; - - locked=(phandle->LockCount==0) ? TRUE : FALSE; - } - else - { - dprintf("GlobalUnlock: invalid handle\n"); - locked=FALSE; - } - HeapUnlock(__ProcessHeap); - return locked; -} - -/********************************************************************* -* GlobalHandle -- KERNEL32 * -*********************************************************************/ -HGLOBAL WINAPI GlobalHandle(LPCVOID pmem) -{ - aprintf("GlobalHandle( 0x%lX )\n", (ULONG) pmem ); - - if(((ULONG)pmem%8)==0) /* FIXED */ - return (HGLOBAL) pmem; - else /* MOVEABLE */ - return (HGLOBAL) *(LPVOID *)(pmem-sizeof(HANDLE)); -} - -/********************************************************************* -* GlobalReAlloc -- KERNEL32 * -*********************************************************************/ -HGLOBAL WINAPI GlobalReAlloc(HGLOBAL hmem, DWORD size, UINT flags) -{ - LPVOID palloc; - HGLOBAL hnew; - PGLOBAL_HANDLE phandle; - - aprintf("GlobalReAlloc( 0x%lX, 0x%lX, 0x%X )\n", (ULONG) hmem, size, flags ); - - hnew=NULL; - HeapLock(__ProcessHeap); - if(flags & GMEM_MODIFY) /* modify flags */ - { - if( (((ULONG)hmem%8)==0) && (flags & GMEM_MOVEABLE)) - { - /* make a fixed block moveable - * actually only NT is able to do this. And it's soo simple - */ - size=HeapSize(__ProcessHeap, 0, (LPVOID) hmem); - hnew=GlobalAlloc( flags, size); - palloc=GlobalLock(hnew); - memcpy(palloc, (LPVOID) hmem, size); - GlobalUnlock(hnew); - GlobalFree(hmem); - } - else if((((ULONG)hmem%8) != 0)&&(flags & GMEM_DISCARDABLE)) - { - /* change the flags to make our block "discardable" */ - phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); - phandle->Flags = phandle->Flags | (GMEM_DISCARDABLE >> 8); - hnew=hmem; - } - else - { - SetLastError(ERROR_INVALID_PARAMETER); - hnew=NULL; - } - } - else - { - if(((ULONG)hmem%8)!=0) - { - /* reallocate fixed memory */ - hnew=(HANDLE)HeapReAlloc(__ProcessHeap, 0, (LPVOID) hmem, size); - } - else - { - /* reallocate a moveable block */ - phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); - if(phandle->LockCount!=0) - SetLastError(ERROR_INVALID_HANDLE); - else if(size!=0) - { - hnew=hmem; - if(phandle->Pointer) - { - palloc=HeapReAlloc(__ProcessHeap, 0, - phandle->Pointer-sizeof(HANDLE), - size+sizeof(HANDLE) ); - phandle->Pointer=palloc+sizeof(HANDLE); - } - else - { - palloc=HeapAlloc(__ProcessHeap, 0, size+sizeof(HANDLE)); - *(PHANDLE)palloc=hmem; - phandle->Pointer=palloc+sizeof(HANDLE); - } - } - else - { - if(phandle->Pointer) - { - HeapFree(__ProcessHeap, 0, phandle->Pointer-sizeof(HANDLE)); - phandle->Pointer=NULL; - } - } - } - } - HeapUnlock(__ProcessHeap); - return hnew; -} - -/********************************************************************* -* GlobalFree -- KERNEL32 * -*********************************************************************/ -HGLOBAL WINAPI GlobalFree(HGLOBAL hmem) -{ - PGLOBAL_HANDLE phandle; - - aprintf("GlobalFree( 0x%lX )\n", (ULONG) hmem ); - - if(((ULONG)hmem%4)==0) /* POINTER */ - { - HeapFree(__ProcessHeap, 0, (LPVOID) hmem); - } - else /* HANDLE */ - { - HeapLock(__ProcessHeap); - phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); - if(phandle->Magic==MAGIC_GLOBAL_USED) - { - HeapLock(__ProcessHeap); - if(phandle->LockCount!=0) - SetLastError(ERROR_INVALID_HANDLE); - if(phandle->Pointer) - HeapFree(__ProcessHeap, 0, phandle->Pointer-sizeof(HANDLE)); - __HeapFreeFragment(__ProcessHeap, 0, phandle); - } - HeapUnlock(__ProcessHeap); - } - return hmem; -} - -/********************************************************************* -* GlobalSize -- KERNEL32 * -*********************************************************************/ -DWORD WINAPI GlobalSize(HGLOBAL hmem) -{ - DWORD retval; - PGLOBAL_HANDLE phandle; - - aprintf("GlobalSize( 0x%lX )\n", (ULONG) hmem ); - - if(((ULONG)hmem%8)==0) - { - retval=HeapSize(__ProcessHeap, 0, hmem); - } - else - { - HeapLock(__ProcessHeap); - phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); - if(phandle->Magic==MAGIC_GLOBAL_USED) - { - retval=HeapSize(__ProcessHeap, 0, (phandle->Pointer)-sizeof(HANDLE))-4; - } - else - { - dprintf("GlobalSize: invalid handle\n"); - retval=0; - } - HeapUnlock(__ProcessHeap); - } - return retval; -} - -/********************************************************************* -* GlobalWire -- KERNEL32 * -*********************************************************************/ -LPVOID WINAPI GlobalWire(HGLOBAL hmem) -{ - return GlobalLock( hmem ); -} - -/********************************************************************* -* GlobalUnWire -- KERNEL32 * -*********************************************************************/ -BOOL WINAPI GlobalUnWire(HGLOBAL hmem) -{ - return GlobalUnlock( hmem); -} - -/********************************************************************* -* GlobalFix -- KERNEL32 * -*********************************************************************/ -VOID WINAPI GlobalFix(HGLOBAL hmem) -{ - GlobalLock( hmem ); -} - -/********************************************************************* -* GlobalUnfix -- KERNEL32 * -*********************************************************************/ -VOID WINAPI GlobalUnfix(HGLOBAL hmem) -{ - GlobalUnlock( hmem); -} - -/********************************************************************* -* GlobalFlags -- KERNEL32 * -*********************************************************************/ -UINT WINAPI GlobalFlags(HGLOBAL hmem) -{ - return LocalFlags( (HLOCAL) hmem); -} - +/* + * Win32 Global/Local heap functions (GlobalXXX, LocalXXX). + * These functions included in Win32 for compatibility with 16 bit Windows + * Especially the moveable blocks and handles are oldish. + * But the ability to directly allocate memory with GPTR and LPTR is widely + * used. + */ + +#include + +#define MAGIC_GLOBAL_USED 0x5342BEEF +#define GLOBAL_LOCK_MAX 0xFF + +typedef struct __GLOBAL_LOCAL_HANDLE +{ + ULONG Magic; + LPVOID Pointer; + BYTE Flags; + BYTE LockCount; +} GLOBAL_HANDLE, LOCAL_HANDLE, *PGLOBAL_HANDLE, *PLOCAL_HANDLE; + +/********************************************************************* +* GlobalAlloc -- KERNEL32 * +*********************************************************************/ +HGLOBAL WINAPI GlobalAlloc(UINT flags, DWORD size) +{ + PGLOBAL_HANDLE phandle; + LPVOID palloc; + + aprintf("GlobalAlloc( 0x%X, 0x%lX )\n", flags, size ); + + if((flags & GMEM_MOVEABLE)==0) /* POINTER */ + { + palloc=HeapAlloc(__ProcessHeap, 0, size); + return (HGLOBAL) palloc; + } + else /* HANDLE */ + { + HeapLock(__ProcessHeap); + + + phandle=__HeapAllocFragment(__ProcessHeap, 0, sizeof(GLOBAL_HANDLE)); + if(size) + { + palloc=HeapAlloc(__ProcessHeap, 0, size+sizeof(HANDLE)); + *(PHANDLE)palloc=(HANDLE) &(phandle->Pointer); + phandle->Pointer=palloc+sizeof(HANDLE); + } + else + phandle->Pointer=NULL; + phandle->Magic=MAGIC_GLOBAL_USED; + phandle->Flags=flags>>8; + phandle->LockCount=0; + HeapUnlock(__ProcessHeap); + + return (HGLOBAL) &(phandle->Pointer); + } +} + +/********************************************************************* +* GlobalLock -- KERNEL32 * +*********************************************************************/ +LPVOID WINAPI GlobalLock(HGLOBAL hmem) +{ + PGLOBAL_HANDLE phandle; + LPVOID palloc; + + aprintf("GlobalLock( 0x%lX )\n", (ULONG) hmem ); + + if(((ULONG)hmem%8)==0) + return (LPVOID) hmem; + + HeapLock(__ProcessHeap); + phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); + if(phandle->Magic==MAGIC_GLOBAL_USED) + { + if(phandle->LockCountLockCount++; + palloc=phandle->Pointer; + } + else + { + dprintf("GlobalLock: invalid handle\n"); + palloc=(LPVOID) hmem; + } + HeapUnlock(__ProcessHeap); + return palloc; +} + +/********************************************************************* +* GlobalUnlock -- KERNEL32 * +*********************************************************************/ +BOOL WINAPI GlobalUnlock(HGLOBAL hmem) +{ + PGLOBAL_HANDLE phandle; + BOOL locked; + + aprintf("GlobalUnlock( 0x%lX )\n", (ULONG) hmem ); + + if(((ULONG)hmem%8)==0) + return FALSE; + + HeapLock(__ProcessHeap); + phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); + if(phandle->Magic==MAGIC_GLOBAL_USED) + { + if((phandle->LockCountLockCount>0)) + phandle->LockCount--; + + locked=(phandle->LockCount==0) ? TRUE : FALSE; + } + else + { + dprintf("GlobalUnlock: invalid handle\n"); + locked=FALSE; + } + HeapUnlock(__ProcessHeap); + return locked; +} + +/********************************************************************* +* GlobalHandle -- KERNEL32 * +*********************************************************************/ +HGLOBAL WINAPI GlobalHandle(LPCVOID pmem) +{ + aprintf("GlobalHandle( 0x%lX )\n", (ULONG) pmem ); + + if(((ULONG)pmem%8)==0) /* FIXED */ + return (HGLOBAL) pmem; + else /* MOVEABLE */ + return (HGLOBAL) *(LPVOID *)(pmem-sizeof(HANDLE)); +} + +/********************************************************************* +* GlobalReAlloc -- KERNEL32 * +*********************************************************************/ +HGLOBAL WINAPI GlobalReAlloc(HGLOBAL hmem, DWORD size, UINT flags) +{ + LPVOID palloc; + HGLOBAL hnew; + PGLOBAL_HANDLE phandle; + + aprintf("GlobalReAlloc( 0x%lX, 0x%lX, 0x%X )\n", (ULONG) hmem, size, flags ); + + hnew=NULL; + HeapLock(__ProcessHeap); + if(flags & GMEM_MODIFY) /* modify flags */ + { + if( (((ULONG)hmem%8)==0) && (flags & GMEM_MOVEABLE)) + { + /* make a fixed block moveable + * actually only NT is able to do this. And it's soo simple + */ + size=HeapSize(__ProcessHeap, 0, (LPVOID) hmem); + hnew=GlobalAlloc( flags, size); + palloc=GlobalLock(hnew); + memcpy(palloc, (LPVOID) hmem, size); + GlobalUnlock(hnew); + GlobalFree(hmem); + } + else if((((ULONG)hmem%8) != 0)&&(flags & GMEM_DISCARDABLE)) + { + /* change the flags to make our block "discardable" */ + phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); + phandle->Flags = phandle->Flags | (GMEM_DISCARDABLE >> 8); + hnew=hmem; + } + else + { + SetLastError(ERROR_INVALID_PARAMETER); + hnew=NULL; + } + } + else + { + if(((ULONG)hmem%8)!=0) + { + /* reallocate fixed memory */ + hnew=(HANDLE)HeapReAlloc(__ProcessHeap, 0, (LPVOID) hmem, size); + } + else + { + /* reallocate a moveable block */ + phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); + if(phandle->LockCount!=0) + SetLastError(ERROR_INVALID_HANDLE); + else if(size!=0) + { + hnew=hmem; + if(phandle->Pointer) + { + palloc=HeapReAlloc(__ProcessHeap, 0, + phandle->Pointer-sizeof(HANDLE), + size+sizeof(HANDLE) ); + phandle->Pointer=palloc+sizeof(HANDLE); + } + else + { + palloc=HeapAlloc(__ProcessHeap, 0, size+sizeof(HANDLE)); + *(PHANDLE)palloc=hmem; + phandle->Pointer=palloc+sizeof(HANDLE); + } + } + else + { + if(phandle->Pointer) + { + HeapFree(__ProcessHeap, 0, phandle->Pointer-sizeof(HANDLE)); + phandle->Pointer=NULL; + } + } + } + } + HeapUnlock(__ProcessHeap); + return hnew; +} + +/********************************************************************* +* GlobalFree -- KERNEL32 * +*********************************************************************/ +HGLOBAL WINAPI GlobalFree(HGLOBAL hmem) +{ + PGLOBAL_HANDLE phandle; + + aprintf("GlobalFree( 0x%lX )\n", (ULONG) hmem ); + + if(((ULONG)hmem%4)==0) /* POINTER */ + { + HeapFree(__ProcessHeap, 0, (LPVOID) hmem); + } + else /* HANDLE */ + { + HeapLock(__ProcessHeap); + phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); + if(phandle->Magic==MAGIC_GLOBAL_USED) + { + HeapLock(__ProcessHeap); + if(phandle->LockCount!=0) + SetLastError(ERROR_INVALID_HANDLE); + if(phandle->Pointer) + HeapFree(__ProcessHeap, 0, phandle->Pointer-sizeof(HANDLE)); + __HeapFreeFragment(__ProcessHeap, 0, phandle); + } + HeapUnlock(__ProcessHeap); + } + return hmem; +} + +/********************************************************************* +* GlobalSize -- KERNEL32 * +*********************************************************************/ +DWORD WINAPI GlobalSize(HGLOBAL hmem) +{ + DWORD retval; + PGLOBAL_HANDLE phandle; + + aprintf("GlobalSize( 0x%lX )\n", (ULONG) hmem ); + + if(((ULONG)hmem%8)==0) + { + retval=HeapSize(__ProcessHeap, 0, hmem); + } + else + { + HeapLock(__ProcessHeap); + phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); + if(phandle->Magic==MAGIC_GLOBAL_USED) + { + retval=HeapSize(__ProcessHeap, 0, (phandle->Pointer)-sizeof(HANDLE))-4; + } + else + { + dprintf("GlobalSize: invalid handle\n"); + retval=0; + } + HeapUnlock(__ProcessHeap); + } + return retval; +} + +/********************************************************************* +* GlobalWire -- KERNEL32 * +*********************************************************************/ +LPVOID WINAPI GlobalWire(HGLOBAL hmem) +{ + return GlobalLock( hmem ); +} + +/********************************************************************* +* GlobalUnWire -- KERNEL32 * +*********************************************************************/ +BOOL WINAPI GlobalUnWire(HGLOBAL hmem) +{ + return GlobalUnlock( hmem); +} + +/********************************************************************* +* GlobalFix -- KERNEL32 * +*********************************************************************/ +VOID WINAPI GlobalFix(HGLOBAL hmem) +{ + GlobalLock( hmem ); +} + +/********************************************************************* +* GlobalUnfix -- KERNEL32 * +*********************************************************************/ +VOID WINAPI GlobalUnfix(HGLOBAL hmem) +{ + GlobalUnlock( hmem); +} + +/********************************************************************* +* GlobalFlags -- KERNEL32 * +*********************************************************************/ +UINT WINAPI GlobalFlags(HGLOBAL hmem) +{ + return LocalFlags( (HLOCAL) hmem); +} + diff --git a/reactos/lib/kernel32/mem/local.c b/reactos/lib/kernel32/mem/local.c index 0604a9c6234..da2641d9800 100644 --- a/reactos/lib/kernel32/mem/local.c +++ b/reactos/lib/kernel32/mem/local.c @@ -1,123 +1,123 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * Copyright (C) 1996, Onno Hovers, All rights reserved - * PROJECT: ReactOS system libraries - * FILE: lib/kernel32/mem/local.cc - * PURPOSE: Manages the local heap - * PROGRAMER: Onno Hovers (original wfc version) - * David Welch (adapted for ReactOS) - * UPDATE HISTORY: - * 9/4/98: Adapted from the wfc project - */ - - -/* NOTES - * - * The local heap is the same as the global heap for win32 and both are only - * required for legacy apps - * - */ - -/* INCLUDES ****************************************************************/ - -#include -#include - -/* FUNCTIONS ***************************************************************/ - -/********************************************************************* -* LocalFlags -- KERNEL32 * -*********************************************************************/ -UINT WINAPI LocalFlags(HLOCAL hmem) -{ - DWORD retval; - PGLOBAL_HANDLE phandle; - - if(((ULONG)hmem%8)==0) - { - retval=0; - } - else - { - HeapLock(__ProcessHeap); - phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); - if(phandle->Magic==MAGIC_GLOBAL_USED) - { - retval=phandle->LockCount + (phandle->Flags<<8); - if(phandle->Pointer==0) - retval|= LMEM_DISCARDED; - } - else - { - dprintf("GlobalSize: invalid handle\n"); - retval=0; - } - HeapUnlock(__ProcessHeap); - } - return retval; -} - - -/********************************************************************* -* LocalAlloc -- KERNEL32 * -*********************************************************************/ -HLOCAL WINAPI LocalAlloc(UINT flags, UINT size) -{ - return (HLOCAL) GlobalAlloc( flags, size ); -} - -/********************************************************************* -* LocalLock -- KERNEL32 * -*********************************************************************/ -LPVOID WINAPI LocalLock(HLOCAL hmem) -{ - return GlobalLock( (HGLOBAL) hmem ); -} - -/********************************************************************* -* LocalUnlock -- KERNEL32 * -*********************************************************************/ -BOOL WINAPI LocalUnlock(HLOCAL hmem) -{ - return GlobalUnlock( (HGLOBAL) hmem); -} - -/********************************************************************* -* LocalHandle -- KERNEL32 * -*********************************************************************/ -HLOCAL WINAPI LocalHandle(LPCVOID pmem) -{ - return (HLOCAL) GlobalHandle(pmem); -} - -/********************************************************************* -* LocalReAlloc -- KERNEL32 * -*********************************************************************/ -HLOCAL WINAPI LocalReAlloc(HLOCAL hmem, UINT size, UINT flags) -{ - return (HLOCAL) GlobalReAlloc( (HGLOBAL) hmem, size, flags); -} - -/********************************************************************* -* LocalFree -- KERNEL32 * -*********************************************************************/ -HLOCAL WINAPI LocalFree(HLOCAL hmem) -{ - return (HLOCAL) GlobalFree( (HGLOBAL) hmem ); -} - -/********************************************************************* -* LocalSize -- KERNEL32 * -*********************************************************************/ -UINT WINAPI LocalSize(HLOCAL hmem) -{ - return GlobalSize( (HGLOBAL) hmem ); -} - -/********************************************************************* -* LocalShrink -- KERNEL32 * -*********************************************************************/ -UINT WINAPI LocalShrink(HLOCAL hmem, UINT newsize) -{ - return (__ProcessHeap->End - (LPVOID) __ProcessHeap); -} +/* + * COPYRIGHT: See COPYING in the top level directory + * Copyright (C) 1996, Onno Hovers, All rights reserved + * PROJECT: ReactOS system libraries + * FILE: lib/kernel32/mem/local.cc + * PURPOSE: Manages the local heap + * PROGRAMER: Onno Hovers (original wfc version) + * David Welch (adapted for ReactOS) + * UPDATE HISTORY: + * 9/4/98: Adapted from the wfc project + */ + + +/* NOTES + * + * The local heap is the same as the global heap for win32 and both are only + * required for legacy apps + * + */ + +/* INCLUDES ****************************************************************/ + +#include +#include + +/* FUNCTIONS ***************************************************************/ + +/********************************************************************* +* LocalFlags -- KERNEL32 * +*********************************************************************/ +UINT WINAPI LocalFlags(HLOCAL hmem) +{ + DWORD retval; + PGLOBAL_HANDLE phandle; + + if(((ULONG)hmem%8)==0) + { + retval=0; + } + else + { + HeapLock(__ProcessHeap); + phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4); + if(phandle->Magic==MAGIC_GLOBAL_USED) + { + retval=phandle->LockCount + (phandle->Flags<<8); + if(phandle->Pointer==0) + retval|= LMEM_DISCARDED; + } + else + { + dprintf("GlobalSize: invalid handle\n"); + retval=0; + } + HeapUnlock(__ProcessHeap); + } + return retval; +} + + +/********************************************************************* +* LocalAlloc -- KERNEL32 * +*********************************************************************/ +HLOCAL WINAPI LocalAlloc(UINT flags, UINT size) +{ + return (HLOCAL) GlobalAlloc( flags, size ); +} + +/********************************************************************* +* LocalLock -- KERNEL32 * +*********************************************************************/ +LPVOID WINAPI LocalLock(HLOCAL hmem) +{ + return GlobalLock( (HGLOBAL) hmem ); +} + +/********************************************************************* +* LocalUnlock -- KERNEL32 * +*********************************************************************/ +BOOL WINAPI LocalUnlock(HLOCAL hmem) +{ + return GlobalUnlock( (HGLOBAL) hmem); +} + +/********************************************************************* +* LocalHandle -- KERNEL32 * +*********************************************************************/ +HLOCAL WINAPI LocalHandle(LPCVOID pmem) +{ + return (HLOCAL) GlobalHandle(pmem); +} + +/********************************************************************* +* LocalReAlloc -- KERNEL32 * +*********************************************************************/ +HLOCAL WINAPI LocalReAlloc(HLOCAL hmem, UINT size, UINT flags) +{ + return (HLOCAL) GlobalReAlloc( (HGLOBAL) hmem, size, flags); +} + +/********************************************************************* +* LocalFree -- KERNEL32 * +*********************************************************************/ +HLOCAL WINAPI LocalFree(HLOCAL hmem) +{ + return (HLOCAL) GlobalFree( (HGLOBAL) hmem ); +} + +/********************************************************************* +* LocalSize -- KERNEL32 * +*********************************************************************/ +UINT WINAPI LocalSize(HLOCAL hmem) +{ + return GlobalSize( (HGLOBAL) hmem ); +} + +/********************************************************************* +* LocalShrink -- KERNEL32 * +*********************************************************************/ +UINT WINAPI LocalShrink(HLOCAL hmem, UINT newsize) +{ + return (__ProcessHeap->End - (LPVOID) __ProcessHeap); +} diff --git a/reactos/lib/kernel32/thread/thread.c b/reactos/lib/kernel32/thread/thread.c index 81c7cf7045e..631314c5bec 100644 --- a/reactos/lib/kernel32/thread/thread.c +++ b/reactos/lib/kernel32/thread/thread.c @@ -8,12 +8,7 @@ todo: improve debug info #include -WINBASEAPI -BOOL -WINAPI -SwitchToThread( - VOID - ) +WINBASEAPI BOOL WINAPI SwitchToThread(VOID ) { return NtYieldExecution(); } @@ -80,4 +75,4 @@ TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) return (FALSE); } -/*************************************************************/ \ No newline at end of file +/*************************************************************/ diff --git a/reactos/lib/ntdll/genntdll b/reactos/lib/ntdll/genntdll index 8c554490ceab166b473c31b06fb84affdce8cb30..5a2318119904d6d29bdf7969b15651463678c481 100644 GIT binary patch delta 7 OcmX@*sW?G_u?7GO1_ELL literal 9418 zcma)C4{%(?d0%6>$ije)9b$+J2ev^t^6CCc=R4&1pJcn1ZGq*4ObpMbyLY;?Pj}~c z?`%`*MvP)&jVi`WXbYK6Y9`YO$qa;O}!X@B2--+ue=+r53e``P}%fklfJDHCo`ixs)Ur`y^Sh~K4w$qA)CO7%`bQFEq?N!V%4pj!4Kf9~qeCeY^Q+}rz6Si7 zFSfOleum^35X+_f21GT;Ymkx7fG1JTGP=v9k?wMSW4TmmoDA2i;iyt8kbVb<;dT&h z+z9#zhyiBRtsqnXc3{?-VJV1pqm7$D!EiGemW%56VHwaZKGy=PThK=z^$`1Hm4|Qh zr7gg6*;b~kQ18!EHxl4CQ2seBzYQ&mfL}go_zu+r{wJRNUf|6j_AT4HLM>Cf5VvE@ z5h=>|gJuKz2f^=xd=wRB{SJYi3&=;nH^IMvnDP?n4ERpOv{wVY7|=ffz7zJ&A*TKx zfX+isJLI1PnfirLze(_`p`Y^PXA!>%{Q-~vGsG##*)Hb)3TPJXy8-bE{Cx{?yVoD= zzi)eTMADzHUBmwf{9K@a6?`g3UrH)#$EWvg-Mf3cvUU#c-?nwo+CMOGpnupJ-nwnD z-%?hoQgW45K%@#ar&MtZ%ChXr@sd-ms6wt>t=psH;(I!vnMrGJ*dksd@lZ-mosVGKv!!5EIci!mm}AY*ju5MxY)Va9OCM;OCn4l%}L zI?Nc8B+nQVpvV}LsLYs?2%-5Ic-;4unolN>I=?=J|4g4>&sr1-FVD;)tY>YClwH0g zJZn|tG`)OLc-F4SDRuc3;aSUKi2OO>S=(YK`Ln{a)%j3ec_C>nW<(lwpMR5!H z!@{#Q#a-lwglDUYL*%yz&(;+mAs-Q*tt=iU9|Dh9!lx(SnVgw;cXsmc7X281mnJT@ zMgQaA!Gn`OA3E^R`7_YDK)tudr*^Ds|MD8xxb@W~bljol^Dr~Id`l&3ob6L(M#rJ~Qp!r>4JsKMkGdLh{!5m0wMN^FHz@=)i?8*qi9%f92jX`OB%r z^Oq)GYn#ZZ#?`4u=O*8K^tH)fdikMG{;Ub$pL}l_j22g;22=gZhMF&+^oiHoi)&26 zSubI;N%*Xnu)`!&bi!0Wnzc=E+vLU57aR95rO3{jKCRG_p=O&%mx*-cl|^SS--NOQ z?fZ=k|L{Mo&9WmM#)6~En!Gsq{mDO`19SSv?$W8#M1KQQ(=2ClnygM7Pp!T6b6h@( zkFmOyquSEc zX|Yj!)};4)ir+E`39Wefdnk+Dz`>dROOEXHU-3W2r+6O9%?oqlE!UAxyti!PRQqCg zRr5z^x;V(?zed)xv{!svmju6@TK;hJ=VGNDo!37%acWLA?k@ftt)J4?b!K|)SHf?oiH%8pt9&A9AZ9{^UTf z)^Jf^*;XfhLx`NdRCfm_i>zfPHhU0?pT_U+mq0Irz6<&x=xxw1Kp%i^!SC^1pfG4N zXdj5n6N!5y?pL^f;@ZZ2NE3TO?z1{4+S<9NdhW@#cJ8aVm*oD3i@({gagWLU4}af_ zAnu2_KjVI?4R(p=V268wb`bY+j2DJ!^#OjjXgd!IJ*9t(4CaFRpqGLBr*RK+(Kq-= z06!DJUkl(j1DH$cICzGk0Ime^*#Leifd4jt|0RHb5x_U1L&n8A_U8e-KY))0@N@t_ zFZj6Reo64{f-eZxJJmM?^Jf?1B3SRLX9Vkyh4%!1Omu!Nc#Ys2F=*rJcLlE$e3#(6 z1>Y;UTku-Jn+40yn%X0{Q_>$1{D9!R;0=Nu!5)`yEX}4C0L-^7QhDr__+Z7N&wFU@U55#FrEI< z0A8)=aXS4D#gW(ePMNnFuTgA`#&@Z+KE7MM=;M3T8$MpEF8O$!`k9aKQ&)U^zgmJ; zYMY(vP9JYjNgsb)?e%e&dd$Zg)o~w()#rWO9l#OAH9*_f_>1V1aemogA%0o#O2s|Q zHw3Rz+@@R*{1L@H1@m4+eYx#6*tDJLrY$qTrViI)*5P&7S*POa;^*7ib$zrCXq=F5 zeT|c{KL1ekQ)&kK{{(za^~(6Z?cvt=>baxyZjx_kjr#)l6Y@Ku)3=C6XuMs8P;ZTQ zsEm&X)K(wwRQr7Vd+M-{_oyd)yjQ+6wVi$HX+QlT)Z5rUAm5H!XIOpDPyeKP%g3Km zGuPlNXfM|U>?Y>l7o1kJz_Wrg>MAg8UPL}jCuz$JViMEyh+jX0?``h~KAcnCV->f% zn2&Wkb~fi$>vGJYcN}Uomy6-EZ>+{2`>?`CXWEVSInm6Yeaed$8$n{*?3lF4`y z`E}!U_eCROA{tBSF7z{cVi|!*CYD6TLb;mdprFg6nFRVw<*SX6vW+C^?-Y}yaelgV zZj=M0IJ9N^q^@{0*;h}&3CihcSEMT*%aq2lqrmYPnU=CClAYb7%QSZUGT3*$87bVz z7FL42#OARU$E&40>bt2gx(TNV)U&i9i!DpwK*YlFM(!xtIJvxioEX|WaWGM>`-0I@ z-WQZARbm{h?6k(JdD|CMaDXSaB!9I~@Uz!+_9(N|Tqj@BGT|{oI1ceG)=R%H7NvG> zX-pWYTq9726C5$$eBERcgD2qW6bW-Yi-VUsxLBlb1G`}-&S2b>$Rp$$J}dg*qCJ$R zj8L;CXFTScW=_pYUBUGvDC{vgHQTGK-TTq`(#^xMD0~53kd8&PFBD34IUh}@=nWY4 zLrM~2NJylZkdf?TS?8$jq=#d%zIrrfRd7s{j>Y>n#A4ctRUc^-(y;_ml6@!ZEOB7> zV1L^4u|vwjXu{=s658c_g<-F?NRAFdpahVJX-^j!`)x^0#I-d0UFP2PXVhTgrBVYWC<%^%7A>Zl)SS`jl$gqb` z{am^x@o`w=jObw@uuJ=h91Lqzsh!)mr$e1P_Z@s76btu;V`1#Re#{z1==Hh5@hsvM|c>W^dbxOg0Xi9 zywT(N&T>@tdgYFIdTcLGm{&tDa2+W&Xqx9Nw8x@&O3wR1*2e^cYe+D9JOB(qFIcY8 zx5qChv@xbK#%855$J6}nhCT=ngFqnSwEhU@qY3Quqlr*>+wfkOg$d+&qB}W zAj!wi0JDB3Q13+)V0@K%_$~FPAlfqF9Grw_S|%79=a679WnaRvjXB#QZ)9HuHrXlv z>4)gi7lY;Ajt}v#Bh3V3k1@yAgjaCnLm%V`(gqOQL7$;72knK{D)lvE1hN1Gw=nRI znJN0_TF+O_>ykMyHLpwH{L{SddCoJ@d_mDfL%?}ps;$0B(6r@+g_72-v>RnH?ff#n?qa|!E^PFs52`pg96TptY2 z@}2^3`kVHj1;5-o2fki?{v7gF{cct-fj5EmIS(dy@6AgZo^?G72j(f(8{p0O@gDjT z_~5%>3^l4&I~xJNV$e`G11v`bf{_z5cHe2j2zoFh6*2&g(U! z&wKWj;D6%z_r1{l7@XAQ>m2I5FE_M6x{)espeLE}* zTe^~KH0xD!WW*?PzJCh)DPV&I2ko1TCYo8}f{b`rz&Z!?4N?lxNi| z%@YI;i_9|uy@w6FS\n\n"); - while (!feof(in) && fgets(line,255,in)!=NULL) { fgets(line,255,in); @@ -37,12 +36,15 @@ int process(FILE* in, FILE* out) { name = strtok(s," \t"); value = strtok(NULL," \t"); - printf("name %s value %s\n",name,value); + nr_args = strtok(NULL," \t"); + +// printf("name %s value %s\n",name,value); - fprintf(out,"NTSTATUS %s(UCHAR first_arg)\n",name); - fprintf(out,"{\n"); - fprintf(out,"\tMAKE_NTAPI_CALL(%s,first_arg);\n",value); - fprintf(out,"}\n"); + fprintf(out,"%s:\n",name); + fprintf(out,"\tmov\teax,%s\n",value); + fprintf(out,"\tlea\tedx,[esp+4]\n"); + fprintf(out,"\tint\t2Eh\n"); + fprintf(out,"\tret\t%s\n\n",nr_args); } } } diff --git a/reactos/loaders/boot/boot.bin b/reactos/loaders/boot/boot.bin index 2e885f2cf4abc05c0d6296132afd1cbf6c464075..5b532fa6c7c09b4a4daadec1373912863e488f37 100644 GIT binary patch delta 6 NcmZo**}*tr2LK1v0)_wp delta 337 zcmV-X0j~bI0e}RMxPKb>bPIvUAOI$SJpgs(`Eq(tjz&H)+lzh{i$?s5R{rRP09bNm z9tIx=zW_k1iN=6_CMk6WfPOkQbQJ;i0mjkpt#bsi1k>n%Us_()V^6h}O`|(9DL!idGmX z%KpI#!HCdOiT;V$_tzgp-iN^P43jxD(2aLdg#1M|aSXu$_fzki~ jDffTi_+G<8Z*O!UWpZ+Fa!W;0PDM;0AVNt_00330%mtc9 diff --git a/reactos/loaders/boot/boot.inc b/reactos/loaders/boot/boot.inc index 0e195bf49d3..0491007aa6c 100644 --- a/reactos/loaders/boot/boot.inc +++ b/reactos/loaders/boot/boot.inc @@ -1,196 +1,196 @@ -; To save space, functions that are just called once are -; implemented as macros instead. Four bytes are saved by -; avoiding the call / ret instructions. - - -; FINDFILE: Searches for the file in the root directory. -; -; Returns: -; -; If file not found: CF set -; -; If file found: CF clear -; AX = first cluster of file - - -%macro FINDFILE 0 - ; First, read the whole root directory - ; into the temporary buffer. - - mov ax, word root_dir_start - mov dx, word root_dir_start_hi - mov di, nRootDir - xor bx, bx - mov es, tempbuf - call readDisk - jc ffDone - - xor di, di - -next_entry: mov cx, 11 - mov si, filename+7c00h - push di - repe cmpsb - pop di - mov ax, [es:di+1ah] ; get cluster number from directory entry - clc - je ffDone - - add di, 20h ; go to next directory entry - cmp byte [es:di], 0 ; if the first byte of the name is 0, - jnz next_entry ; there is no more files in the directory - - stc -ffDone: -%endmacro - -; GETDRIVEPARMS: Calculate start of some disk areas. - -%macro GETDRIVEPARMS 0 - mov si, word nHidden - mov di, word nHidden_hi - add si, word resSectors - adc di, 0 ; DI:SI = first FAT sector - - mov word fat_start, si - mov word fat_start_hi, di - - mov al, nFats - xor ah, ah - mul word sectPerFat ; DX:AX = total number of FAT sectors - - add si, ax - adc di, dx ; DI:SI = first root directory sector - mov word root_dir_start, si - mov word root_dir_start_hi, di - - ; Calculate how many sectors the root directory occupies. - mov bx, bytesPerSector - mov cl, 5 ; divide BX by 32 - shr bx, cl ; BX = directory entries per sector - - mov ax, nRootDir - xor dx, dx - div bx - - mov nRootDir, ax ; AX = sectors per root directory - - add si, ax - adc di, 0 ; DI:SI = first data sector - - mov data_start, si - mov data_start_hi, di -%endmacro - -; GETFATCHAIN: -; -; Reads the FAT chain and stores it in a temporary buffer in the first -; 64 kb. The FAT chain is stored an array of 16-bit cluster numbers, -; ending with 0. -; -; The file must fit in conventional memory, so it can't be larger than -; 640 kb. The sector size must be at least 512 bytes, so the FAT chain -; can't be larger than around 3 kb. -; -; Call with: AX = first cluster in chain -; -; Returns: CF clear on success, set on error - -%macro GETFATCHAIN 0 - push ax ; store first cluster number - - ; Load the complete FAT into memory. The FAT can't be larger - ; than 128 kb, so it should fit in the temporary buffer. - - mov es, tempbuf - xor bx, bx - mov di, sectPerFat - mov ax, word fat_start - mov dx, word fat_start_hi - call readDisk - pop ax ; restore first cluster number - jc boot_error - - ; Set ES:DI to the temporary storage for the FAT chain. - push ds - push es - pop ds - pop es - mov di, FATBUF - -next_clust: stosw ; store cluster number - mov si, ax ; SI = cluster number - cmp byte extBoot, 29h - jne fat_12 - cmp byte [bp+filesys+4], '6' ; check for FAT-16 system - je fat_16 - - ; This is a FAT-12 disk. - -fat_12: add si, si ; multiply cluster number by 3... - add si, ax - shr si, 1 ; ...and divide by 2 - lodsw - - ; If the cluster number was even, the cluster value is now in - ; bits 0-11 of AX. If the cluster number was odd, the cluster - ; value is in bits 4-15, and must be shifted right 4 bits. If - ; the number was odd, CF was set in the last shift instruction. - - jnc fat_even - mov cl, 4 - shr ax, cl ; shift the cluster number - -fat_even: and ah, 0fh ; mask off the highest 4 bits - cmp ax, 0fffh ; check for EOF - jmp short next_test - - ; This is a FAT-16 disk. The maximal size of a 16-bit FAT - ; is 128 kb, so it may not fit within a single 64 kb segment. - -fat_16: mov dx, tempbuf - add si, si ; multiply cluster number by two - jnc first_half ; if overflow... - add dh, 10h ; ...add 64 kb to segment value - -first_half: mov ds, dx ; DS:SI = pointer to next cluster - lodsw ; AX = next cluster - - cmp ax, 0fff8h ; >= FFF8 = 16-bit EOF -next_test: jb next_clust ; continue if not EOF - -finished: ; Mark end of FAT chain with 0, so we have a single - ; EOF marker for both FAT-12 and FAT-16 systems. - - xor ax, ax - stosw -fatError: -%endmacro - - -; loadFile: Loads the file into memory, one cluster at a time. - -%macro LOADFILE 0 - mov es, tempbuf ; set ES:BX to load address - xor bx, bx - - mov si, FATBUF ; set DS:SI to the FAT chain - push cs - pop ds - -next_cluster: lodsw ; AX = next cluster to read - or ax, ax ; if EOF... - je boot_success ; ...boot was successful - - dec ax ; cluster numbers start with 2 - dec ax - - mov di, word sectPerCluster - and di, 0ffh ; DI = sectors per cluster - mul di - add ax, data_start - adc dx, data_start_hi ; DX:AX = first sector to read - call readDisk - jnc next_cluster - -%endmacro +; To save space, functions that are just called once are +; implemented as macros instead. Four bytes are saved by +; avoiding the call / ret instructions. + + +; FINDFILE: Searches for the file in the root directory. +; +; Returns: +; +; If file not found: CF set +; +; If file found: CF clear +; AX = first cluster of file + + +%macro FINDFILE 0 + ; First, read the whole root directory + ; into the temporary buffer. + + mov ax, word root_dir_start + mov dx, word root_dir_start_hi + mov di, nRootDir + xor bx, bx + mov es, tempbuf + call readDisk + jc ffDone + + xor di, di + +next_entry: mov cx, 11 + mov si, filename+7c00h + push di + repe cmpsb + pop di + mov ax, [es:di+1ah] ; get cluster number from directory entry + clc + je ffDone + + add di, 20h ; go to next directory entry + cmp byte [es:di], 0 ; if the first byte of the name is 0, + jnz next_entry ; there is no more files in the directory + + stc +ffDone: +%endmacro + +; GETDRIVEPARMS: Calculate start of some disk areas. + +%macro GETDRIVEPARMS 0 + mov si, word nHidden + mov di, word nHidden_hi + add si, word resSectors + adc di, 0 ; DI:SI = first FAT sector + + mov word fat_start, si + mov word fat_start_hi, di + + mov al, nFats + xor ah, ah + mul word sectPerFat ; DX:AX = total number of FAT sectors + + add si, ax + adc di, dx ; DI:SI = first root directory sector + mov word root_dir_start, si + mov word root_dir_start_hi, di + + ; Calculate how many sectors the root directory occupies. + mov bx, bytesPerSector + mov cl, 5 ; divide BX by 32 + shr bx, cl ; BX = directory entries per sector + + mov ax, nRootDir + xor dx, dx + div bx + + mov nRootDir, ax ; AX = sectors per root directory + + add si, ax + adc di, 0 ; DI:SI = first data sector + + mov data_start, si + mov data_start_hi, di +%endmacro + +; GETFATCHAIN: +; +; Reads the FAT chain and stores it in a temporary buffer in the first +; 64 kb. The FAT chain is stored an array of 16-bit cluster numbers, +; ending with 0. +; +; The file must fit in conventional memory, so it can't be larger than +; 640 kb. The sector size must be at least 512 bytes, so the FAT chain +; can't be larger than around 3 kb. +; +; Call with: AX = first cluster in chain +; +; Returns: CF clear on success, set on error + +%macro GETFATCHAIN 0 + push ax ; store first cluster number + + ; Load the complete FAT into memory. The FAT can't be larger + ; than 128 kb, so it should fit in the temporary buffer. + + mov es, tempbuf + xor bx, bx + mov di, sectPerFat + mov ax, word fat_start + mov dx, word fat_start_hi + call readDisk + pop ax ; restore first cluster number + jc boot_error + + ; Set ES:DI to the temporary storage for the FAT chain. + push ds + push es + pop ds + pop es + mov di, FATBUF + +next_clust: stosw ; store cluster number + mov si, ax ; SI = cluster number + cmp byte extBoot, 29h + jne fat_12 + cmp byte [bp+filesys+4], '6' ; check for FAT-16 system + je fat_16 + + ; This is a FAT-12 disk. + +fat_12: add si, si ; multiply cluster number by 3... + add si, ax + shr si, 1 ; ...and divide by 2 + lodsw + + ; If the cluster number was even, the cluster value is now in + ; bits 0-11 of AX. If the cluster number was odd, the cluster + ; value is in bits 4-15, and must be shifted right 4 bits. If + ; the number was odd, CF was set in the last shift instruction. + + jnc fat_even + mov cl, 4 + shr ax, cl ; shift the cluster number + +fat_even: and ah, 0fh ; mask off the highest 4 bits + cmp ax, 0fffh ; check for EOF + jmp short next_test + + ; This is a FAT-16 disk. The maximal size of a 16-bit FAT + ; is 128 kb, so it may not fit within a single 64 kb segment. + +fat_16: mov dx, tempbuf + add si, si ; multiply cluster number by two + jnc first_half ; if overflow... + add dh, 10h ; ...add 64 kb to segment value + +first_half: mov ds, dx ; DS:SI = pointer to next cluster + lodsw ; AX = next cluster + + cmp ax, 0fff8h ; >= FFF8 = 16-bit EOF +next_test: jb next_clust ; continue if not EOF + +finished: ; Mark end of FAT chain with 0, so we have a single + ; EOF marker for both FAT-12 and FAT-16 systems. + + xor ax, ax + stosw +fatError: +%endmacro + + +; loadFile: Loads the file into memory, one cluster at a time. + +%macro LOADFILE 0 + mov es, tempbuf ; set ES:BX to load address + xor bx, bx + + mov si, FATBUF ; set DS:SI to the FAT chain + push cs + pop ds + +next_cluster: lodsw ; AX = next cluster to read + or ax, ax ; if EOF... + je boot_success ; ...boot was successful + + dec ax ; cluster numbers start with 2 + dec ax + + mov di, word sectPerCluster + and di, 0ffh ; DI = sectors per cluster + mul di + add ax, data_start + adc dx, data_start_hi ; DX:AX = first sector to read + call readDisk + jnc next_cluster + +%endmacro diff --git a/reactos/loaders/boot/boot.map b/reactos/loaders/boot/boot.map index 9023b6b248c..743747fb55c 100644 --- a/reactos/loaders/boot/boot.map +++ b/reactos/loaders/boot/boot.map @@ -1,8 +1,8 @@ - - Start Stop Length Name Class - - 00000H 001FFH 00200H TEXT TEXT - -Program entry point at 0000:0000 -Warning: No stack - + + Start Stop Length Name Class + + 00000H 001FFH 00200H TEXT TEXT + +Program entry point at 0000:0000 +Warning: No stack + diff --git a/reactos/loaders/boot/osldr.asm b/reactos/loaders/boot/osldr.asm index f43af30a431..0915d18d5eb 100644 --- a/reactos/loaders/boot/osldr.asm +++ b/reactos/loaders/boot/osldr.asm @@ -1,340 +1,340 @@ -; -; Loads the kernel and any required modules -; - -org 0 - -; -; Segment where we are loaded -; -LOADSEG equ 02000h - -; -; Segment used for temporay storage -; -WORKSEG equ 01000h - - -KERNELBASE equ 05000h - -; -; Offsets of work areas -; -FAT_CHAIN equ 0h - -DIR_BUFFER equ 4000h -END_DIR_BUFFER equ 0ffe0h - -FAT_SEG equ 03000h - - -; -; These are all on the stack -; -%define oem [bp+3] -%define bytesPerSector [bp+0bh] -%define sectPerCluster [bp+0dh] -%define resSectors [bp+0eh] -%define nFats [bp+10h] -%define nRootDir [bp+11h] -%define nSectors [bp+13h] -%define MID [bp+15h] -%define sectPerFat [bp+16h] -%define sectPerTrack [bp+18h] -%define nHeads [bp+1ah] -%define nHidden [bp+1ch] -%define nHidden_hi [bp+1eh] -%define nSectorHuge [bp+20h] -%define drive [bp+24h] -%define extBoot [bp+26h] -%define volid [bp+27h] -%define vollabel [bp+2bh] -%define filesys 36h - -RETRYCOUNT equ 5 - -%define fat_start [bp-4] ; first FAT sector -%define fat_start_hi [bp-2] -%define root_dir_start [bp-8] ; first root directory sector -%define root_dir_start_hi [bp-6] -%define data_start [bp-12] ; first data sector -%define data_start_hi [bp-10] - - -entry: - mov drive,dl - - mov ax,LOADSEG - mov ds,ax - - - ; - ; Print out a message - ; - mov di,loadmsg - call printmsg - - - ; - ; Check here for shift pressed and if so display boot menu - ; - - ; - ; Load the entire fat - ; -; mov ax,fat_start -; mov dx,fat_start_hi -; mov di,sectPerFat -; mov ax,FAT_SEG -; mov es,ax -; mov bx,0 -; call readDisk - - - ; - ; Load root directory - ; - mov ax,WORKSEG - mov es,ax - - mov dx,root_dir_start_hi - mov ax,root_dir_start - mov bx,DIR_BUFFER - mov di,nRootDir - shr di,4 - mov di,1 - call readDisk - jc disk_error - - ; - ; Look for a directory called boot - ; - mov di,DIR_BUFFER - cld - mov cx,4 -l1: - mov si,boot_dir_name -; cmp byte [di],0 -; je boot_error - repe cmpsb - je found_it - or di,31 - inc di - cmp di,END_DIR_BUFFER - jge boot_error - jmp l1 - - -boot_error: - mov di,errormsg - call printmsg -l3: - jmp l3 - -disk_error: - mov di,errormsg1 - call printmsg - jmp l3 - - - -found_it: - mov di,msg1 - call printmsg - - ; - ; Load the boot directory found above - ; - sub di,4 - call readFile - -l2: - jmp l2 - -; -; readFile -; -%define file_length [di+01ch] -%define start_cluster [di+01ah] -readFile: - cmp byte extBoot, 29h - jne fat_12 - cmp byte [bp+filesys+4], '6' ; check for FAT-16 system - je fat_16 - -fat_12: - mov di,msg2 - call printmsg -l4: - jmp l4 - -fat_16: - mov di,msg3 - call printmsg - jmp l4 - - - -; readDisk: Reads a number of sectors into memory. -; -; Call with: DX:AX = 32-bit DOS sector number -; DI = number of sectors to read -; ES:BX = destination buffer -; ES must be 64k aligned (1000h, 2000h etc). -; -; Returns: CF set on error -; ES:BX points one byte after the last byte read. - -readDisk: - push bp - push si -read_next: push dx - push ax - - ; - ; translate sector number to BIOS parameters - ; - - ; - ; abs = sector offset in track - ; + head * sectPerTrack offset in cylinder - ; + track * sectPerTrack * nHeads offset in platter - ; - ; t1 = abs / sectPerTrack (ax has t1) - ; sector = abs mod sectPerTrack (cx has sector) - ; - div word sectPerTrack - mov cx, dx - - ; - ; t1 = head + track * nHeads - ; - ; track = t1 / nHeads (ax has track) - ; head = t1 mod nHeads (dl has head) - ; - xor dx, dx - div word nHeads - - ; the following manipulations are necessary in order to - ; properly place parameters into registers. - ; ch = cylinder number low 8 bits - ; cl = 7-6: cylinder high two bits - ; 5-0: sector - mov dh, dl ; save head into dh for bios - ror ah, 1 ; move track high bits into - ror ah, 1 ; bits 7-6 (assumes top = 0) - xchg al, ah ; swap for later - mov dl, byte sectPerTrack - sub dl, cl - inc cl ; sector offset from 1 - or cx, ax ; merge cylinder into sector - mov al, dl ; al has # of sectors left - - ; Calculate how many sectors can be transfered in this read - ; due to dma boundary conditions. - push dx - - mov si, di ; temp register save - ; this computes remaining bytes because of modulo 65536 - ; nature of dma boundary condition - mov ax, bx ; get offset pointer - neg ax ; and convert to bytes - jz ax_min_1 ; started at seg:0, skip ahead - - xor dx, dx ; convert to sectors - div word bytesPerSector - - cmp ax, di ; check remainder vs. asked - jb ax_min_1 ; less, skip ahead - mov si, ax ; transfer only what we can - -ax_min_1: pop dx - - ; Check that request sectors do not exceed track boundary - mov si, sectPerTrack - inc si - mov ax, cx ; get the sector/cyl byte - and ax, 03fh ; and mask out sector - sub si, ax ; si has how many we can read - mov ax, di - cmp si, di ; see if asked <= available - jge ax_min_2 - mov ax, si ; get what can be xfered - -ax_min_2: mov si, RETRYCOUNT - mov ah, 2 - mov dl, drive - -retry: push ax - int 13h - pop ax - jnc read_ok - push ax - xor ax, ax ; reset the drive - int 13h - pop ax - dec si - jnz retry - stc - pop ax - pop dx - pop si - pop bp - ret - -read_next_jmp: jmp short read_next -read_ok: xor ah, ah - mov si, ax ; AX = SI = number of sectors read - mul word bytesPerSector ; AX = number of bytes read - add bx, ax ; add number of bytes read to BX - jnc no_incr_es ; if overflow... - - mov ax, es - add ah, 10h ; ...add 1000h to ES - mov es, ax - -no_incr_es: pop ax - pop dx ; DX:AX = last sector number - - add ax, si - adc dx, 0 ; DX:AX = next sector to read - sub di, si ; if there is anything left to read, - jg read_next_jmp ; continue - - clc - pop si - pop bp - ret - -; -; Print string (DI = start) -; -printmsg: - push ax - push bx - push di - mov ah,0eh - mov bh,0 - mov bl,07h -.l1 - mov al,[di] - cmp al,0 - je .l2 - inc di - int 10h - jmp .l1 -.l2 - pop di - pop bx - pop ax - ret - - - -loadmsg db "Starting ReactOS...",0xd,0xa,0 -boot_dir_name db 'BOOT' -errormsg db "Files missing on boot disk",0 -errormsg1 db "Disk read error",0 -msg1 db "Found boot directory",0xd,0xa,0 -msg2 db 'FAT12',0 -msg3 db 'FAT16',0 +; +; Loads the kernel and any required modules +; + +org 0 + +; +; Segment where we are loaded +; +LOADSEG equ 02000h + +; +; Segment used for temporay storage +; +WORKSEG equ 01000h + + +KERNELBASE equ 05000h + +; +; Offsets of work areas +; +FAT_CHAIN equ 0h + +DIR_BUFFER equ 4000h +END_DIR_BUFFER equ 0ffe0h + +FAT_SEG equ 03000h + + +; +; These are all on the stack +; +%define oem [bp+3] +%define bytesPerSector [bp+0bh] +%define sectPerCluster [bp+0dh] +%define resSectors [bp+0eh] +%define nFats [bp+10h] +%define nRootDir [bp+11h] +%define nSectors [bp+13h] +%define MID [bp+15h] +%define sectPerFat [bp+16h] +%define sectPerTrack [bp+18h] +%define nHeads [bp+1ah] +%define nHidden [bp+1ch] +%define nHidden_hi [bp+1eh] +%define nSectorHuge [bp+20h] +%define drive [bp+24h] +%define extBoot [bp+26h] +%define volid [bp+27h] +%define vollabel [bp+2bh] +%define filesys 36h + +RETRYCOUNT equ 5 + +%define fat_start [bp-4] ; first FAT sector +%define fat_start_hi [bp-2] +%define root_dir_start [bp-8] ; first root directory sector +%define root_dir_start_hi [bp-6] +%define data_start [bp-12] ; first data sector +%define data_start_hi [bp-10] + + +entry: + mov drive,dl + + mov ax,LOADSEG + mov ds,ax + + + ; + ; Print out a message + ; + mov di,loadmsg + call printmsg + + + ; + ; Check here for shift pressed and if so display boot menu + ; + + ; + ; Load the entire fat + ; +; mov ax,fat_start +; mov dx,fat_start_hi +; mov di,sectPerFat +; mov ax,FAT_SEG +; mov es,ax +; mov bx,0 +; call readDisk + + + ; + ; Load root directory + ; + mov ax,WORKSEG + mov es,ax + + mov dx,root_dir_start_hi + mov ax,root_dir_start + mov bx,DIR_BUFFER + mov di,nRootDir + shr di,4 + mov di,1 + call readDisk + jc disk_error + + ; + ; Look for a directory called boot + ; + mov di,DIR_BUFFER + cld + mov cx,4 +l1: + mov si,boot_dir_name +; cmp byte [di],0 +; je boot_error + repe cmpsb + je found_it + or di,31 + inc di + cmp di,END_DIR_BUFFER + jge boot_error + jmp l1 + + +boot_error: + mov di,errormsg + call printmsg +l3: + jmp l3 + +disk_error: + mov di,errormsg1 + call printmsg + jmp l3 + + + +found_it: + mov di,msg1 + call printmsg + + ; + ; Load the boot directory found above + ; + sub di,4 + call readFile + +l2: + jmp l2 + +; +; readFile +; +%define file_length [di+01ch] +%define start_cluster [di+01ah] +readFile: + cmp byte extBoot, 29h + jne fat_12 + cmp byte [bp+filesys+4], '6' ; check for FAT-16 system + je fat_16 + +fat_12: + mov di,msg2 + call printmsg +l4: + jmp l4 + +fat_16: + mov di,msg3 + call printmsg + jmp l4 + + + +; readDisk: Reads a number of sectors into memory. +; +; Call with: DX:AX = 32-bit DOS sector number +; DI = number of sectors to read +; ES:BX = destination buffer +; ES must be 64k aligned (1000h, 2000h etc). +; +; Returns: CF set on error +; ES:BX points one byte after the last byte read. + +readDisk: + push bp + push si +read_next: push dx + push ax + + ; + ; translate sector number to BIOS parameters + ; + + ; + ; abs = sector offset in track + ; + head * sectPerTrack offset in cylinder + ; + track * sectPerTrack * nHeads offset in platter + ; + ; t1 = abs / sectPerTrack (ax has t1) + ; sector = abs mod sectPerTrack (cx has sector) + ; + div word sectPerTrack + mov cx, dx + + ; + ; t1 = head + track * nHeads + ; + ; track = t1 / nHeads (ax has track) + ; head = t1 mod nHeads (dl has head) + ; + xor dx, dx + div word nHeads + + ; the following manipulations are necessary in order to + ; properly place parameters into registers. + ; ch = cylinder number low 8 bits + ; cl = 7-6: cylinder high two bits + ; 5-0: sector + mov dh, dl ; save head into dh for bios + ror ah, 1 ; move track high bits into + ror ah, 1 ; bits 7-6 (assumes top = 0) + xchg al, ah ; swap for later + mov dl, byte sectPerTrack + sub dl, cl + inc cl ; sector offset from 1 + or cx, ax ; merge cylinder into sector + mov al, dl ; al has # of sectors left + + ; Calculate how many sectors can be transfered in this read + ; due to dma boundary conditions. + push dx + + mov si, di ; temp register save + ; this computes remaining bytes because of modulo 65536 + ; nature of dma boundary condition + mov ax, bx ; get offset pointer + neg ax ; and convert to bytes + jz ax_min_1 ; started at seg:0, skip ahead + + xor dx, dx ; convert to sectors + div word bytesPerSector + + cmp ax, di ; check remainder vs. asked + jb ax_min_1 ; less, skip ahead + mov si, ax ; transfer only what we can + +ax_min_1: pop dx + + ; Check that request sectors do not exceed track boundary + mov si, sectPerTrack + inc si + mov ax, cx ; get the sector/cyl byte + and ax, 03fh ; and mask out sector + sub si, ax ; si has how many we can read + mov ax, di + cmp si, di ; see if asked <= available + jge ax_min_2 + mov ax, si ; get what can be xfered + +ax_min_2: mov si, RETRYCOUNT + mov ah, 2 + mov dl, drive + +retry: push ax + int 13h + pop ax + jnc read_ok + push ax + xor ax, ax ; reset the drive + int 13h + pop ax + dec si + jnz retry + stc + pop ax + pop dx + pop si + pop bp + ret + +read_next_jmp: jmp short read_next +read_ok: xor ah, ah + mov si, ax ; AX = SI = number of sectors read + mul word bytesPerSector ; AX = number of bytes read + add bx, ax ; add number of bytes read to BX + jnc no_incr_es ; if overflow... + + mov ax, es + add ah, 10h ; ...add 1000h to ES + mov es, ax + +no_incr_es: pop ax + pop dx ; DX:AX = last sector number + + add ax, si + adc dx, 0 ; DX:AX = next sector to read + sub di, si ; if there is anything left to read, + jg read_next_jmp ; continue + + clc + pop si + pop bp + ret + +; +; Print string (DI = start) +; +printmsg: + push ax + push bx + push di + mov ah,0eh + mov bh,0 + mov bl,07h +.l1 + mov al,[di] + cmp al,0 + je .l2 + inc di + int 10h + jmp .l1 +.l2 + pop di + pop bx + pop ax + ret + + + +loadmsg db "Starting ReactOS...",0xd,0xa,0 +boot_dir_name db 'BOOT' +errormsg db "Files missing on boot disk",0 +errormsg1 db "Disk read error",0 +msg1 db "Found boot directory",0xd,0xa,0 +msg2 db 'FAT12',0 +msg3 db 'FAT16',0 diff --git a/reactos/loaders/boot/osldr.bin b/reactos/loaders/boot/osldr.bin index facab893828fc7558b1d2a0738c5bb9c10789d86..794732e5988ec1e61b137f8ec74e43564e9a95dc 100644 GIT binary patch delta 6 NcmbQpJehIAWB>%+J3ZD-ib-o>9+i$T))c?wDS z`6UV|nZ?-*EQd zi^CZJD!1Wh98_OpFKz$v(R&OBli0Z{mf=EZ zzy2;{8#tOX*V3q?ZtX1Ki=B8tZ9N^b#5i zgHBb735JXHGtQ2R8QOC#4V3#WC(cOG`4s;hIbJ3bp*?sTJ7bGam8x=np3gCLE5$p# z)kpBht0$l9xCEg|#`9GQMv>n)6r8}hkDQ~)zA9-WyaokB*yEI0l*NjVxlwLJpQ-~$ z+8zLyB3I)(3;U>=`;W~+nn?pF*D7l`yg!HX(H~k)2;{C3=Ix59mJVmpIMmwZsOVQ! qxz(?|i>BnSe(g(iQ+};nQZMJbN${YXBF{-meh3XEe`Rq+rM=rASi@=n delta 553 zcmYjNL1+_E5S{(AyETwxQ=!pRvvG@T0}2XO@nE%xM-kCe@!}zj_f|X!C5IlCEkek} zW5ZrNs00#iE21O;bJ~L^LzOn9A^bqlQt%Qr>nv584}WIDkpct0p; zmu{Vj15kbs_Je@(4M_0IF=NQ)DjoroWAW5joC*umg{QNTK*$-z`6APWm*-X(_O4<7 ziP(hOzV%TGxeNV+fO`k}99HMc;0%3hspqvt^=4VPW?O6lyaVtpGB&oUwwG`kMJXvO7u5X- z&(hSh_~XN?ohojCpCIFHoxJnN{u6l@aqTN>Xz-sZX<3#}o`pkJ7(p!#^GRUbDCey`} zYWi#pjhWV%1Vz86%HN~%=Uz_!9F=!_59RmbqIy3$2q*Cd5pwO&BrP